summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
...
* | net: davinci-emac: switch to device tree supportHeinrich Toews2018-12-141-69/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds device tree support to the davinci-emac driver. This needs some changes to the driver as the device has four different resources. Three of them are merged into a single resource in the dts files with the node providing offsets for the different resources to base address. The mdio node is found separately in the dts, so we have to split this out to a different driver. Since this driver has been unused previously, we do not bother maintaining two different probe methods and remove platform probe support at the same time. Signed-off-by: Heinrich Toews <heinrich.toews@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: davinci-emac: Add timeout to polling loopSascha Hauer2018-12-141-9/+38
| | | | | | | | | | | | Do not poll forever when the hardware does not behave like we want to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: davinci-emac: fix buggy channel tear downHeinrich Toews2018-12-131-0/+11
|/ | | | | | | | | | | | | | | | | Druing a barebox_shutdown() already probed platform devices are being halted. While trying to halt the davinci emac a channel tear down operation is triggered which leads due to a missing DMA pointer configuration to a memory corruption whithin the decompressed kernel memory. In this case the devices failed to boot and are completely freezed. In the davinci driver DMA initialisation is only done during the opening of the device which is done only when the device is setup for communication. The problem was solved by adding DMA init code to emacs_init() which is called shortly after the probing of the device. In this case the tearing down of the channels completes successfully. Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
* Merge branch 'for-next/spdx'Sascha Hauer2018-12-0756-549/+59
|\
| * drivers: net: usb: convert drivers to spdxOleksij Rempel2018-12-072-30/+4
| | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * drivers: net: phy: convert drivers to spdxOleksij Rempel2018-12-0714-83/+14
| | | | | | | | | | | | Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * drivers: net: convert drivers to spdxOleksij Rempel2018-12-0640-436/+41
| | | | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2018-12-071-3/+1
|\ \
| * | net: designware: socfpga: return error valueSteffen Trumtrar2018-11-301-3/+1
| |/ | | | | | | | | | | | | | | Instead of silently dropping the return value of socfpga_dwc_set_phy_mode, use it as the return value of the function, instead. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-12-072-3/+3
|\ \
| * | net: cpsw: Make locally used function staticSascha Hauer2018-11-191-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Mark e1000_register_invm() staticAndrey Smirnov2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Mark e1000_register_invm() static because it is not used outside the source file. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Mark e1000_igb_get_flash_size() staticAndrey Smirnov2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Mark e1000_igb_get_flash_size() static because it is not used outside the source file. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/checkpatch'Sascha Hauer2018-12-072-2/+2
|\ \ \ | |_|/ |/| |
| * | net: e1000: fix "Uninitialized variable: phy_data" warningOleksij Rempel2018-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | After carefully reading the code, this situation should never happen. This patch is to reduce warning noise. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000/flash: Increased erase timeoutMichael Schuhmacher2018-11-121-1/+1
| |/ | | | | | | | | | | | | | | Serial flash Adesto AT25DF321A specifies the maximal chip erase time as 40 seconds. Extend timeout accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / net: cpsw: support "phy-handle" and deprecate "phy_id"Sascha Hauer2018-11-191-2/+2
|/ | | | | | | | | Upstream dts files changed to the generic binding for mii phys, so we have to support it in barebox aswell. The barebox internal device trees haven't been changed, so support them until all have changed. We print a warning to add some motivation to change. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net-switch-mv88e6xxx'Sascha Hauer2018-11-0914-16/+2358
|\
| * net: phy: mv88e6xxx: Add support for MAC portsAndrey Smirnov2018-10-234-9/+877
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for MAC-only/no-PHY ports by adding code that will create a pseudo PHY device for such ports and a driver to match against. Original Linux driver exposes all of the ports using DSA subystem, but lacking that in Barebox, creating pseudo PHYs is the simplest option to have code to properly configure various interface parameters. This is needed, for example, on ZII RPU2 board where FEC is connected directly to one of the MAC-only ports. That link requires proper RGMII delay configuration in order to be functional. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: phy: mv88e6xxx: Port EEPROM support codeAndrey Smirnov2018-10-234-0/+388
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: phy: Add basic driver for MV88E6XXX switches from MarvellAndrey Smirnov2018-10-239-0/+1070
| | | | | | | | | | | | | | | | | | Port a very abridged version of MV88E6XXX DSA driver from Linux kernel. Currently only internal MDIO bus connected to switch PHYs is exposed. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mdio_bus: Allow for non PHY-devices on MDIO busesAndrey Smirnov2018-10-231-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of just creating a simple PHY device for every child of MDIO bus node, add code to check if any of them have "compatible" property set, as well as code to create a proper platform device for such cases. This change is useful for when MDIO bus and some of Ethernet ports are connected to a switch or some other MDIO device that doesn't behave like a generic PHY and can't be probed via its PHY ID. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: phy: Check phy_mask in get_phy_device()Andrey Smirnov2018-10-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | Do not try to probe PHY devices if they are masked in phy_mask. This way we won't try adding devices that are unlikely to be proper PHYs by default. With this change it still remains possible to add such a device explicitly either using "miitool" or calling phy_device_create() explicilty. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mdio_bus: Fix documentation for mdio_bus_match()Andrey Smirnov2018-10-181-4/+7
| | | | | | | | | | | | | | | | | | Fix documentation for mdio_bus_match(). While at it, re-arrange the code to be easier to follow. Seeing != used as a result of a matching function is extremely confusing. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * drivers: Introduce dev_set_name()Andrey Smirnov2018-10-185-8/+8
| | | | | | | | | | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2018-11-091-7/+15
|\ \
| * | net: macb: Add compatible for atmel,sama5d3-gemSascha Hauer2018-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | The macb driver works with the gigabit MAC found on Atmel sama5d3 SoCs. Add a compatible for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: add remove callbackSascha Hauer2018-11-021-0/+8
| | | | | | | | | | | | | | | | | | | | | The macb driver does DMA and thus should be quiesced on shutdown. Add the remove callback. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: simplify private data allocationSascha Hauer2018-11-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Instead of allocating struct macb_device and a struct eth_device separately just use the eth_device structure that is already embedded in struct macb_device but currently unused. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: remove unused variableSascha Hauer2018-11-021-2/+1
| | | | | | | | | | | | | | | | | | tx_tail is unused. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: no need for coherent memory for receive bufferSascha Hauer2018-11-021-2/+1
| |/ | | | | | | | | | | | | The receive buffers are properly synchronized with dma_sync_*, no need to use coherent memory for them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: designware: look for a child device node for MDIO busIan Abbott2018-11-021-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Designware driver registers a local MDIO bus for each MAC device, but without setting a device node pointer for the MDIO bus device. In this case, mdiobus_register() will use the MDIO bus's parent device node (if any) as the MDIO device node. If the MAC device node has a child node compatible with "snps,dwmac-mdio", let us use that as the MDIO bus device node. Otherwise, leave the MDIO bus device node pointer set to NULL and carry on as before. The upshot is that PHY device nodes can now be placed in an intermediate node for the MDIO bus instead of having to place them directly in the Designware MAC device node. (Tested on a Terasic DE0-Nano-SoC with a suitably modified device tree.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | phy: call adjust_link in attach if using fixed-linkClément Leger2018-10-161-0/+4
|/ | | | | | | | | | | | | Normally, phy_update_status is in charge of reporting a change in link status when phy is updated. When using fixed-link, speed and duplex are initialized directly after registering the phy and there is no driver. Hence when phy_update_status is called, the check for new values fails and returns directly. Since update_link call is mandatory for some network devices to work, call it directly when using fixed link in phy_device_attach to force update of link. Signed-off-by: Clement Leger <clement.leger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Do not use DMA coherent memory for Rx buffersAndrey Smirnov2018-09-191-4/+25
| | | | | | | | | | | | Trying to do unaligned access of coherent memory on AArch64 will lead to an abort and some parts of our IP stack will do exactly that with received packet buffer by using memcpy() to extracts parts of it. Convert the driver to use regular memory for received data buffers to prevent the issue from happening. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Make use of readx_poll_timeout() macrosAndrey Smirnov2018-09-191-39/+22
| | | | | | | Condense a bit of code by using vairous readx_poll_timeout() macros. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Drop frame_lengthAndrey Smirnov2018-09-191-4/+3
| | | | | | | Drop frame_length in favour of just using len Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Drop struct fec_frameAndrey Smirnov2018-09-191-12/+4
| | | | | | | | | Drop struct fec_frame since it doesn't have any real users in the code. It is only referenced in fec_recv() and is used by that function as a generic pointer. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Read data_length only onceAndrey Smirnov2018-09-191-14/+17
| | | | | | | | | Data length of a given Rx data descriptor isn't going to change until that descriptor is processed and given back to HW. Re-work the code to save and re-use that value instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Don't check bd_status & FEC_RBD_ERR twiceAndrey Smirnov2018-09-191-7/+5
| | | | | | | | Re-shuffle comparisons in order to avoid having to check for FEC_RBD_ERR in bd_status more than once. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Drop extra indentation level by exiting earlyAndrey Smirnov2018-09-191-26/+27
| | | | | | | | | Drop extra indentation level by exiting early which also allows us to check for bd_status & FEC_RBD_EMPTY instead of !(bd_status & FEC_RBD_EMPTY). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: mdio: Do not warn about invalid PHY addressSascha Hauer2018-09-181-4/+4
| | | | | | | | | | | | | | | | of_mdiobus_register is now called with nodes from ethernet devices. Their child nodes are not necessarily phy nodes. For am335x devices we get several warnings now: miibus0: /ocp/ethernet@4a100000/mdio@4a101000 PHY address 1242566656 is too large miibus0: /ocp/ethernet@4a100000/slave@4a100200 has invalid PHY address miibus0: /ocp/ethernet@4a100000/slave@4a100300 has invalid PHY address miibus0: /ocp/ethernet@4a100000/cpsw-phy-sel@44e10650 PHY address 1155597904 is too large None of the nodes is a phy node, so silence the warnings and turn them into dev_dbg. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2018-09-114-1/+241
|\
| * phylib: add support for reset-gpiosSam Ravnborg2018-08-241-1/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add minimal support for reset-gpios in the PHY node. Example DT that uses this: macb0: ethernet@fffbc000 { phy-mode = "rmii"; #address-cells = <1>; #size-cells = <0>; ethphy0: ethernet-phy@1 { reg = <3>; reset-gpios = <&pioE 17 GPIO_ACTIVE_LOW>; reset-assert-us = <1000>; reset-deassert-us = <2000>; }; }; The reset is required to get the Davicom PHY operational on my proprietary board, and is assumed relevant for other boards too. The PHY is reset when we read the info from DT, before the phy_id is retreived. The bindings are documented in dts/Bindings/net/phy.txt. A side-effect of this patch is that we may see phy devices created from the DT due to the extra call to: of_mdiobus_register() with the ethernet node as argument. The logic to determine if a child node is a PHY node is a simpler version compared to the one used in the kernel. The kernel have a whitelist of compatible strings that is not included in the barebox version. They can be added later if needed. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * phylib: add Davicom PHY supportSam Ravnborg2018-08-243-0/+146
| | | | | | | | | | | | | | Based on driver from Linux kernel 4.18.0-rc4 Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dma-mask'Sascha Hauer2018-09-111-1/+3
|\ \
| * | net: fec_imx: Return EFAULT when DMA mapping failsAndrey Smirnov2018-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EFAULT seems to be much more appropriate error code for DMA mapping failure, it also produces more informative message, compare: ping 192.168.53.7 WARNING: eth0: No MAC address set. Using random address 92:4e:f1:18:96:67 eth0: 100Mbps full duplex link detected ping failed: Bad address versus old message: ping 192.168.53.7 WARNING: eth0: No MAC address set. Using random address c6:b7:67:bb:4a:c3 eth0: 100Mbps full duplex link detected ping failed: I/O error Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: fec_imx: Specify that DMA is 32-bit onlyAndrey Smirnov2018-08-311-0/+2
| |/ | | | | | | | | | | | | | | FEC can only do a DMA transfer to 32-bit address space, so mark it as such. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / drivers: net: designware: select reset controllerSteffen Trumtrar2018-08-311-0/+1
|/ | | | | | | | | The socfpga-specific designware driver uses reset_control_get(). Select the socfpga-reset driver to actually use this function instead of a stub. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/e1000: allow to overwrite flash size from device treeUwe Kleine-König2018-07-131-14/+42
| | | | | | | | | | | | | | | | | When barebox probes the e1000 driver and the flash on the i210 device is unprogrammed, the driver assumes the flash has a size of only 4 kiB. This is annoying because to program the flash an image must be written that is bigger than 4 kiB. So you first have to flash the first sector to make barebox detect the right size on the next boot. Then reset the board to be able to write the remaining data. To work around that limitation, try to read the actual size from the device tree. (Note however that barebox' pci code currently doesn't use the device tree and so currently this try always fails without further patching.) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: make sure DMA is disabled on kernel start.Oleksij Rempel2018-07-024-0/+11
| | | | | | | | Halt is not automatically executed if we start the kernel. So, we may have potentially memory corruptions. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>