summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* net: designware: eqos: mimic Linux gmac4 mdio_{read, write}Ahmad Fatoum2020-03-024-21/+7
| | | | | | | | | | | | | | | The code was ported over from U-Boot and has some things different than the Kernel driver: - It reads ->mdio_address, but the kernel driver doesn't - It doesn't write ->mdio_data in a read, but the kernel driver does - It has delays in addition to spinning on MII_BUSY, but the kernel driver doesn't Adopt the same flow as used by the kernel. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: remove left-over PHY quirk work aroundAhmad Fatoum2020-03-021-6/+2
| | | | | | | | | The dummy read was a left over from an abandoned merge with the existing support for the SoCFPGA variant of the Designware MAC. It doesn't exist in either the U-Boot or kernel drivers for the EQOS, thus drop it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: stm32: drop no longer needed syscfg-clkAhmad Fatoum2020-02-191-2/+1
| | | | | | | | | | | | The upstream device tree no longer lists "syscfg-clk" and the syscon node contains a clocks property that the barebox syscon driver now automatically clocks before access. Thus drop the requirement that "syscfg-clk" is specified. Fixes: 4aaceef58 ("dts: update to v5.6-rc1") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: socfpga: fix possible invalid pointer derefAhmad Fatoum2020-02-121-10/+8
| | | | | | | | | | | | | | In cases where the reset controller specification in the device tree is malformed, we get an error pointer back from reset_control_get. This compares unequal to NULL and would cause an access violation when passed to reset_control_(de)?assert. Fix this by propagating the error. When the reset controller is missing, reset_control_(de)?assert will be passed NULL pointers, rendering them no-ops. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: designware: eqos: don't funnel all MDIO writes to register 0Ahmad Fatoum2020-01-201-3/+3
| | | | | | | | | | | | | | | | eqos_mdio_write ended up using the addr parameter instead of the computed miiaddr variable, which would've factored in the reg parameter. This had the effect that all writes went to PHY register 0, which was fine as long as there were only register 0 writes. As soon there are more writes, e.g. because a PHY driver was enabled, register 0 became clobbered and erratic behavior ensued. Fix the typo and while at it rename the val parameter to a more descriptive name. Fixes: a4f709bbb ("net: add Designware Ethernet QoS for STM32MP") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fsl-fman: Do not put hardware in reset before Linux startSascha Hauer2020-01-131-8/+0
| | | | | | | | Linux depends on the icid values configured in the DPAA. Do not put the hardware into reset in order to preserve the register values. Without this, the IOMMU doesn't work properly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynq'Sascha Hauer2019-12-101-2/+23
|\
| * net: macb: add Zynq compatibleLucas Stach2019-11-111-0/+1
| | | | | | | | | | | | | | Add compatible for the GEM on the Zynq 7000 device. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: macb: handle more clocksLucas Stach2019-11-111-2/+22
| | | | | | | | | | | | | | | | | | Both pclk and hclk are required clocks in the DT binding. rx_clk and tx_clk are optional, but must be enabled if a system has separate gates for them. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/randfixes'Sascha Hauer2019-12-101-1/+2
|\ \
| * | net: designware-eqos: depend on COMMON_CLKLucas Stach2019-12-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The clk_bulk_* functions are only available with common clock. Also OFTREE should not be selected, but is a dependency. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2019-12-101-1/+0
|\ \ \
| * | | net: designware: eqos: remove done TODOAhmad Fatoum2019-12-051-1/+0
| | |/ | |/| | | | | | | | | | | | | | | | The todo split comment is a left-over from refactoring. Remove it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/layerscape'Sascha Hauer2019-12-101-0/+38
|\ \ \
| * | | net: fsl-fman: Disable unused network interfacesSascha Hauer2019-11-281-0/+38
| | |/ | |/| | | | | | | | | | | | | | | | The Linux dts files have all network interfaces enabled. We have to disable the ones that are unused. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/fsl-fman'Sascha Hauer2019-12-101-40/+50
|\ \ \ | |/ / |/| |
| * | net: fsl-fman: do not leave not transmitted DMA buffers mappedSascha Hauer2019-11-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a packet can't be transmitted we should unmap it. This probably won't change much since when we can't transmit a packet the fman probably can't recover from it anyway, but still it is cleaner to not leave the buffers mapped. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: fsl-fman: simplify setting next offsetSascha Hauer2019-11-141-9/+5
| | | | | | | | | | | | | | | | | | | | | The offset of the current packet can be retrieved from the current txbd index, so do this instead of increasing the offset with each new packet. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: fsl-fman: Store index for rxbdSascha Hauer2019-11-141-12/+9
| | | | | | | | | | | | | | | | | | | | | Like done for the txbd, also store the index of the current rxbd in the driver private data. This makes the code easier to follow. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: fsl-fman: move status read into loopSascha Hauer2019-11-141-4/+5
| | | | | | | | | | | | | | | | | | | | | Instead of reading the status once before the loop and then again right before the next iteration, just read the status in the loop. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: fsl-fman: Store index for txbdSascha Hauer2019-11-141-13/+8
| | | | | | | | | | | | | | | | | | | | | Instead of storing a pointer to the current txbd store the index of the current buffer. This makes the code more straight forward. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: fsl-fman: reset device before leavingSascha Hauer2019-11-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | edev->halt is implemented, but not called by the core during shutdown. We have to call it manually during device remove. With this and also resetting the whole FMan during shutdown the driver now works properly when started second stage from another barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | net: designware: eqos: fix NULL pointer use in dev_printfAhmad Fatoum2019-11-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inside mdio_register, a read of the PHY's id register is attempted. If it fails, we print an error message with eqos_err, which uses the ethernet device's unique name, but at this time there has been none set, because eth_register was not yet called. Fix this by using the MDIO bus device instead. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | net: designware: eqos: enable clocks before mdio_registerAhmad Fatoum2019-11-154-78/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't be using the MAC including the MDIO controller while the clocks are off, but this is exactly the case when mdio_register is called and the interface is not yet up. To allow reading the PHY id to succeed before the interface is up, turn on the clocks as part of the initialization in the probe. This fixes following error at probe time: ERROR: <NULL>: MDIO not idle at entry The NULL is fixed in a follow-up commit. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | net: designware: eqos: properly stop DMA on haltAhmad Fatoum2019-11-151-0/+2
|/ / | | | | | | | | | | | | | | | | Specifying ->halt only means that it's called along with eth_unregister. If we want to halt the DMA, we will have to call it ourselves in the remove callback. Do this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: designware: eqos: stop DMA on haltAhmad Fatoum2019-11-122-0/+4
|/ | | | | | | | | designware_eqos.c contains an eqos_stop implementation to stop the NIC when halting the interface. Unfortunately it wasn't used leading to memory corruption on boot, possibly due to DMA. Fix this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2019-11-076-1/+1581
|\
| * net: eqos: extend Designware Ethernet QoS for Tegra 186 supportAhmad Fatoum2019-11-063-0/+354
| | | | | | | | | | | | | | | | | | | | | | | | The U-Boot dwc_eth_qos driver ported in the previous commit had support for both the Tegra 186/194 and STM32MP variants of the EQOS IP. The barebox Tegra supported doesn't include the 186, but as the driver was nevertheless ported along with the rest, lets include it in the source tree. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: add Designware Ethernet QoS for STM32MPAhmad Fatoum2019-11-065-1/+1227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have Designware NIC support in barebox, but for the DWMAC1000, the DWMAC4 (also called GMAC4), no support was mainline so far. The DWMAC4 is different enough that sharing code with the DWMAC1000 is not really that helpful, because even basics like MDIO registers have different layout. Instead of coding bit masks and shifts into the driver data, like Linux does, we'll keep both driver kinds separate. Nevertheless, we collect functions that are not SoC-specific into a separate 'library' file. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: designware: socfpga: fix phy setup for Arria10Steffen Trumtrar2019-10-182-16/+118
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Barebox-version of the Linux v5.2 patch: 40ae25505fe834648ce4aa70b073ee934942bfdb net: stmmac: socfpga: fix phy and ptp_ref setup for Arria10/Stratix10 On the Arria10, Agilex, and Stratix10 SoC, there are a few differences from the Cyclone5 and Arria5: - The emac PHY setup bits are in separate registers. - The PTP reference clock select mask is different. - The register to enable the emac signal from FPGA is different. Thus, this patch creates a separate function for setting the phy modes on Arria10/Agilex/Stratix10. The separation is based a new DTS binding: "altr,socfpga-stmmac-a10-s10". Signed-off-by: Dinh Nguyen <dinguyen@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> The new DTS binding is already part of v2019.10.0 and the driver doesn't probe on Arria10 without the new binding introduced in this patch. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-10-176-2/+126
|\
| * MIPS: net: ag71xx/ar9331: partially sync network support with upstreamOleksij Rempel2019-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Ethernet support for ar9331 is upstream now. So, drop every thing what is provided by upstream devicetree and rename compatible in the driver. barebox network driver will need more work to be upstream compliant. For example we should not request or touch the gmac register directly. Since currently it is not clear how this should be implemented, patch the upstream dts with reg-names = "ge0", "gmac". Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dsa: mv88e6xxx: Wait for EEPROM done after HW resetAndrey Smirnov2019-10-145-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on a unpublished patch from Andrew Lunn: When the switch is hardware reset, it reads the contents of the EEPROM. This can contain instructions for programming values into registers and to perform waits between such programming. Reading the EEPROM can take longer than the 100ms mv88e6xxx_hardware_reset() waits after deasserting the reset GPIO. So poll the EEPROM done bit to ensure it is complete. Signed-off-by: Andrew Lunn <andrew@lunn.ch> orignal patch augmented to have necessary Global 1 plubming, ported to Barebox and slightly changed. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dsa: mv88e6xxx: Fix error message typoAndrey Smirnov2019-10-141-1/+1
| | | | | | | | | | | | | | s/MIDO/MDIO Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2019-10-171-2/+3
|\ \
| * | net: fec_imx: Fix resource rollback with regulator errorsStefan Riedmueller2019-10-141-2/+3
| |/ | | | | | | | | | | | | | | When the driver is not able to get or control the phy regulator memory resources are already acquired and need to be released during rollback. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: Remove NETX ethernet driverSascha Hauer2019-09-233-288/+0
|/ | | | | | | NETX support has been removed from barebox, so remove the ethernet driver as well. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/omap'Sascha Hauer2019-09-121-82/+96
|\
| * net: cpsw: Make phy its own driverSascha Hauer2019-08-281-82/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes of_phy_device_connect() work properly when the phy is specified in the device tree. Without it of_mdio_find_phy() will not find the right device. It will match: bus->parent->device_node == phy_node->parent Without this patch bus->parent->device_node will be the ethernet node and phy_node->parent will be the ti,cpsw-mdio node. With the MDIO device node registered as device of its own both nodes above will be the ti,cpsw-mdio node. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2019-09-122-6/+34
|\ \
| * | net: macb: extend support to Microchip SAMA5D2Ahmad Fatoum2019-08-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Tested on Microchip SAMA5D27 SOM1 EK1 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: macb: init multiple dummy TX queuesOleksij Rempel2019-08-162-6/+33
| |/ | | | | | | | | | | | | | | | | Microchip SAMA5D27 has more then one TX queue. So it will go in to TX timeout if only one was initialized. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | smc911x: fix inverted poll-for-readyAhmad Fatoum2019-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | The ! operator is applied wrongly to only smc91xx_reg_read's return value, when probably the intention was for it to apply to the whole expression. However, wait_on_timeout keeps looping while the condition is false, so dropping the ! is the right thing to do. Do the right thing. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: phy: mv88e6xxx: remove duplicate member in struct initializerAhmad Fatoum2019-08-301-1/+0
|/ | | | | | | There's already an .ops member two lines later. Remove one. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: add regulator supportOleksij Rempel2019-07-172-0/+20
| | | | | | | at least imx28-evk need it to work with devicetree Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: cpsw: adopt to upstream device tree changesSascha Hauer2019-07-101-6/+10
| | | | | | | | | | | | | | | | | Upstream device trees no longer have a "cpsw-phy-sel" property to find the phy_sel register, instead they have a child device of the pinctrl node compatible to "ti,am3352-phy-gmii-sel". Also the "rmii-clock-ext" property is no longer global to the cpsw but instead can be selected per slave. To adopt to these changes take the short way out for now and find the new node by its compatible and hardcode the "rmii-clock-ext" setting (which is set to true in am33xx-l4.dtsi and not overwritten by any board). This makes the cpsw driver work again. Tested on Beaglebone black board. Fixes: 1dc748b3b2 ("dts: update to v5.1-rc1") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-06-113-22/+35
|\
| * net: macb: dma_sync_* receive buffersLadislav Michl2019-06-041-7/+20
| | | | | | | | | | | | | | | | | | Receive buffers are properly synchronized only if Cadence is GEM. Fix it for MACB as well. Fixes: 86dc5259e25d (net: macb: no need for coherent memory for receive buffer) Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * treewide: replace '---help---' with 'help' in Kconfig filesMasahiro Yamada2019-05-172-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Linux, '---help---' was deprecated in favor of 'help', and this is checked by the recent checkpatch.pl See Linux commit 84af7a6194e493fae312a2b7fa5a3b51f76d9282 The number of '---help---' is gradually decreasing in Linux, but there are still lots. However, '---help---' will be completely killed when the time comes. Fortunately, there are only some in Barebox. Replacing them is not hard. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dma'Sascha Hauer2019-06-111-3/+0
|\ \