summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* net: phy: micrel: Add workaround for bad autonegPhilipp Zabel2016-02-041-1/+22
| | | | | | | | | | | | | Based on kernel commit d2fd719bcb0e ("net/phy: micrel: Add workaround for bad autoneg") by Nathan Sullivan <nathan.sullivan@ni.com>: Very rarely, the KSZ9031 will appear to complete autonegotiation, but will drop all traffic afterwards. When this happens, the idle error count will read 0xFF after autonegotiation completes. Reset the PHY when in that state. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: Center FLP timing at 16msPhilipp Zabel2016-02-041-1/+16
| | | | | | | | Based on kernel commit 6270e1ae804a ("net/phy: micrel: Center FLP timing at 16ms") by Jaeden Amero <jaeden.amero@ni.com>: Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: Be more const correctPhilipp Zabel2016-02-041-12/+12
| | | | | | | | | | | | | | Based on kernel commit 3c9a9f7fb0ee ("net/phy: micrel: Be more const correct") by Jaeden Amero <jaeden.amero@ni.com>: In a few places in this driver, we weren't using const where we could have. Use const more. In addition, change the arrays of strings in ksz9031_config_init() to be not only const, but also static. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: use BIT macroPhilipp Zabel2016-02-041-9/+9
| | | | | | | | Based on kernel commit 00aee095000c ("net: phy: micrel: use BIT macro") by Johan Hovold <johan@kernel.org>. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: micrel: Staticise ksz8873mll_read_status()Philipp Zabel2016-02-041-1/+1
| | | | | | | | | | | | | Based on kernel commit 32d73b144eac ("net: phy: micrel: Staticise ksz8873mll_read_status()") by Jingoo Han <jg1.han@samsung.com>: ksz8873mll_read_status() is used only in this file. Fix the following sparse warning: drivers/net/phy/micrel.c:147:5: warning: symbol 'ksz8873mll_read_status' was not declared. Should it be static? Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* miitool: Add code to register a PHYAndrey Smirnov2016-02-041-2/+7
| | | | | | | | | | | | | This commit changes the behaviour of the 'miitool'. Now in order to show PHY's link information 'miitool' should be invoked as such: miitool -s [PHY] Also, implment code to allow to register a dummy PHY device in order to be able to perform raw MDIO bus access. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mdio_bus: Change PHY's naming schemeAndrey Smirnov2016-02-032-3/+7
| | | | | | | | | | | | | Change the way PHY devices are named upon creation. This commit replaces sequentialy numbered "/dev/phy%d" with "/dev/mdio%d-phy%02x". This way it is significanlty easier to identify which PHY in real-life (e.g. on a schematic) corresponds to which device in /dev. Also, replace asprintf with xasprintf to provide some form of memory allocation failure checking. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mdio_bus: Add mdiobus_get_bus() functionAndrey Smirnov2016-02-031-0/+19
| | | | | | | Add mdiobus_get_bus() -- a function to get a MDIO bus by its number Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mdio_bus: Change dev_info to dev_dbgAndrey Smirnov2016-02-031-1/+1
| | | | | | | | | Change dev_info to dev_dbg in mdiobus_detect for displaying phy's registration status as it is in of_mdiobus_register_phy(). While that information is useful for debugging, user doesn't really need to see that information every time they call miitool for the first time. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Port bitbanged MDIO code from Linux kernelAndrey Gusakov2016-02-034-0/+476
| | | | | | | | | Port bitbanged MDIO framework and gpiolib MDIO bus driver that uses it from Linux kernel. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2015-12-085-20/+49
|\
| * net: tap: fix whitespacesAntony Pavlov2015-12-041-3/+4
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: tap: make locally used functions staticAntony Pavlov2015-12-041-5/+5
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: usb: asix: fix 'no previous prototype' warningAntony Pavlov2015-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | Here is the warning message: drivers/net/usb/asix.c:427:5: warning: no previous prototype for 'asix_rx_fixup_internal' [-Wmissing-prototypes] int asix_rx_fixup_internal(struct usbnet *dev, void *buf, int len, ^ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: usb: asix: make rx_fixup ax_skb buffer alignedAntony Pavlov2015-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ax_skb receive buffer unalignment leads to consequent unalignment data access in network stack routines, especially in net_checksum(). By-turn unalignment data accesses lead to performance penalty. Moreover on classic MIPS CPUs without hardware unalignment access support this leads to undesirable exceptions. At the moment barebox on MIPS can't parry these unalignment access exceptions, so the Asix USB Ethernet chips, that need receive fixup workaround, are completely unusable on MIPS without this patch. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: fec: fix indentation and whitspacesStefan Christ2015-11-191-4/+4
| | | | | | | | | | Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: fec: implement dtb property phy-reset-durationStefan Christ2015-11-191-1/+4
| | | | | | | | | | | | | | | | Implement device tree property phy-reset-duration to adjust length of phy reset. Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: fec: set phy reset time to 1msStefan Christ2015-11-191-1/+1
| | | | | | | | | | | | | | | | According to the device tree bindings in dts/Bindings/net/fsl-fec.txt the default phy-reset time is 1ms. Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: rtl8169: get rid of DMA_ADDRESS_BROKENLucas Stach2015-11-131-4/+6
| | | | | | | | | | | | | | | | Don't assume a 1:1 virt to phys mapping, but use the real physical address returned by the dma alloc function. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: designware: Don't hang in reset with powered down phyTrent Piepho2015-11-131-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dw MAC requires that all clock domains to be running for it to finish a MAC reset. This include the clock provided by the PHY. If the PHY is powered down, bit BMCR_PDOWN set, then it won't be generating a clock. And so the MAC never comes out of reset. On shutdown, Linux will put the PHY in powerdown mode, so it can easily be the case that the PHY is powered down on boot. See Linux kernel commit 2d871aa07136fe6e576bde63072cf33e2c664e95. Currently the MAC reset is done before the phy is probed. We can't power up the phy until it's probed, so the resets must be in the opposite order. The MAC reset is in device init but the PHY probe is in device open. Device init is done first, always, while open is done later, and only if the device is used. Rather than move the phy probe to init, this moves the MAC reset to open. It seems better to speed up boots that doesn't use ethernet by skipping MAC reset than to slow them down by adding PHY probe. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: smc1111: fix ethernet mac settingRobert Jarzmik2015-12-071-1/+1
|/ | | | | | | | | | | | | | Even if the setting of the MAC address does work correctly, the function return an error. In the former barebox version, this didn't seem to be a problem. In v2015.11.0 version, the "ifup eth0" command fails because of this, and as a consequence the network interface doesn't work. The fix is straightforward. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2015-11-061-5/+8
|\
| * net: phy: wait for link OK after successfull autonegotiationAnton Bondarenko2015-11-051-5/+8
| | | | | | | | | | | | | | | | | | It may take some time for PHY to indicate link OK status after autonegotiation completed. This change addresses this case and prevent network commands fails due to the delay. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: mvneta: add Armada XP compatibleSebastian Hesselbarth2015-10-121-0/+1
|/ | | | | | | | | Marvell NETA Network Engine found in Armada 370 and XP SoCs also has a different compatible for Armada XP. Add the compatible to the of_device_id list. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: e1000: correct function signature of set_ethaddrLucas Stach2015-09-091-1/+1
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ppc'Sascha Hauer2015-08-061-1/+1
|\
| * PPC/MPC52xx: unify header file name for clock APIJuergen Borleis2015-08-031-1/+1
| | | | | | | | | | | | | | | | In preparation to re-use the i.MX I2C driver for the MPC5200 SoC use clock.h instead of clocks.h for the clock API. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2015-08-062-35/+4
|\ \ | |/ |/|
| * net: phy: at803x: Use genphy_config_initSascha Hauer2015-07-292-35/+4
| | | | | | | | | | | | | | | | Based on the Linux commit: 6ff01db net: phy: at803x: use genphy_config_init() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: enc28j60: fix set mac function signatureLucas Stach2015-07-291-1/+1
|/ | | | | | | | | | Fixes: drivers/net/enc28j60.c: In function 'enc28j60_probe': drivers/net/enc28j60.c:947:20: warning: assignment from incompatible pointer type edev->set_ethaddr = enc28j60_set_ethaddr; Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc911x: Add device tree supportSascha Hauer2015-06-261-0/+6
| | | | | | | There should probably be more compatible entries, but this is what the kernel driver matches for. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Make set_ethaddr argument constSascha Hauer2015-06-2627-27/+27
| | | | | | | The set_ethaddr callback should not modify the MAC address passed to it, so make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mips'Sascha Hauer2015-06-091-18/+120
|\
| * net: dm9k: fix reset routineAntony Pavlov2015-05-121-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on Linux's commit: commit 09ee9f87d02e779e4fc3f5c29212c733d6d6e349 Author: Michael Abbott <michael.abbott@diamond.ac.uk> Date: Wed Oct 16 11:41:33 2013 +0300 dm9000: Implement full reset of DM9000 network device A Davicom application note for the DM9000 network device recommends performing software reset twice to correctly initialise the device. Without this reset some devices fail to initialise correctly on system startup. N.B. DM9000B on MIPS Creator CI20 board needs additional workaround (see the 'Make all GPIO pins outputs' and 'Power internal PHY' lines). This workaround was taken from this U-boot's commit: commit fbcb7ece0ea1e364180f1cf963e0fa0ce7f6560d Author: Remy Bohmer <linux@bohmer.net> Date: Tue Jun 3 15:26:24 2008 +0200 DM9000: Improve eth_reset() routine According to the application notes of the DM9000 v1.22 chapter 5.2 bullet 2, the reset procedure must be done twice to properly reset the DM9000 by means of software. This errata is not needed anymore for the DM9000A, but it does not bother it. This change has been tested with DM9000A, DM9000E, DM9000EP. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dm9k: add device tree supportAntony Pavlov2015-05-121-16/+87
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dm9k: show only one phy on miibusAntony Pavlov2015-05-121-0/+10
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'pu/am335x'Sascha Hauer2015-05-282-5/+50
|\ \ | |/ |/|
| * net: cpsw: unregister device on remove callbackSascha Hauer2015-04-281-5/+39
| | | | | | | | | | | | | | | | | | | | The CPSW uses DMA, so we should quiesce the device before leaving barebox. This patch unregisters the CPSW properly on the device remove callback. To do this we have to fix the error path in cpsw_slave_setup, since this function can fail and we need a known slave status in the remove function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: phy: Add missing phy_unregister_deviceSascha Hauer2015-04-281-0/+11
| | | | | | | | | | | | The counterpart of phy_register_device is missing. Add it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/of-device-id'Sascha Hauer2015-05-062-8/+8
|\ \
| * | of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-302-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mvebu'Sascha Hauer2015-05-061-0/+31
|\ \ \
| * | | net: phy: Support Marvell 88E1318S PHYSebastian Hesselbarth2015-04-271-0/+31
| | |/ | |/| | | | | | | | | | | | | | | | This adds support for the Marvell 88E1318S Gigabit Ethernet PHY. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2015-05-062-1/+8
|\ \ \
| * | | net: fec: Fix RGMII-IDMarkus Pargmann2015-05-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RGMII-ID just defines transmitter internal delays. Otherwise it is the same as RGMII. As the differences only influence the behaviour of the phy, the fec driver should handle it the same way as RGMII. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: usb: asix: Add D-link DUB-E100 H/W Ver C1 supportMayur Nande2015-04-281-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hello! This patch adds support for USB ethernet adapter D-Link DUB-E100 H/W Rev C1. I tested this on Beagleboneblack Rev A6A and our custom h/w based on i.mx6 Phytec phycore module. More information about the adapter is here: http://us.dlink.com/products/connect/high-speed-usb-2-0-fast-ethernet-adapter/ Signed-off-by: Mayur Nande <mayur.nande@medel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | / net: phy: Do not double remove phy deviceSascha Hauer2015-05-051-0/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes: 80264a8 driver: Call bus->remove instead of driver->remove On mvebu it happens that: Upon device shutdown, when iterating through the active device list, the phy0 device is removed before mdio-mvebu. Then, when the mdio bus device is removed, the phy0 device is removed again, here: mdio_bus_remove(on mdio-mvebu) mvebu_mdio_remove mdiobus_unregister unregister_device mdio_bus_remove(on phy0) Fix this by setting the mdio busses phy_map[phy->addr] to NULL when unregistering the phy device, so that mdiobus_unregister no longer finds a valid phy_device when iterating over the busses device list. Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
* | net: e1000: add HAS_DMA dependencyAntony Pavlov2015-04-281-0/+1
|/ | | | | | | | | | | | | | | | | The e1000 driver uses the dma coherent functions and thus can only be build for architectures implementing them. Here is mips malta build error log: drivers/built-in.o: In function `e1000_transmit': drivers/net/e1000.c:(.text.e1000_transmit+0x80): undefined reference to `dma_sync_single_for_device' drivers/built-in.o: In function `e1000_poll': drivers/net/e1000.c:(.text.e1000_poll+0x60): undefined reference to `dma_sync_single_for_cpu' Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pxa'Sascha Hauer2015-04-131-0/+29
|\
| * net: smc1111: add a quirk for pxa pxa27x platformsRobert Jarzmik2015-04-131-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | As hinted in the linux kernel driver, pxa platforms such as mainstone, stargate and idp have a broken design, where half-word writes not aligned to a word address are not working. This patch is a taking back the half-word write accessor for this specific case from the linux kernel. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>