summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/misc'Sascha Hauer2016-05-094-11/+44
|\
| * net: phy: Add fixed link supportSascha Hauer2016-05-091-8/+41
| | | | | | | | | | | | | | | | | | | | Some network devices, especially when connected to a switch, are connected via a fixed link. This patch adds support for a fixed phy configured through device tree. TODO: Add support for the "speed" and "full-duplex" properties. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com>
| * whole tree: remove trailing whitespacesDu Huanpeng2016-04-213-3/+3
| | | | | | | | | | Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/include-pdata'Sascha Hauer2016-05-098-8/+8
|\ \
| * | include: Move smc911x eth platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move dm9000 eth platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move fec eth platform_data to include/platform_dataSascha Hauer2016-04-152-2/+2
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move davinci emac platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move designware eth platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move smc91111 eth platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: Move ep93xx eth platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-1/+1
|/ | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fec_imx: Unregister MDIO when probe failsAndrey Smirnov2016-03-171-2/+4
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fec_imx: Deallocate DMA buffers when probe failsAndrey Smirnov2016-03-171-4/+17
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fec_imx: Implement reset timeoutAndrey Smirnov2016-03-171-1/+6
| | | | | | | | | | Don't wait for more than one second for IP block to finish resetting. If the block is dead it makes more sence to continue execution in hopes that the rest of the processor is fine, rather than spin indefinetly inside of the fec_probe function Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fec_imx: Use FEC_ECNTRL_RESET instead of a magic numberAndrey Smirnov2016-03-161-1/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fec_imx: Free phy_reset GPIO if when probe failsAndrey Smirnov2016-03-161-2/+5
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fec_imx: Deallocate I/O resources if probe failsAndrey Smirnov2016-03-161-5/+9
| | | | | | | | | | Add a proper check for I/O memory resource allocation failure and replace dev_request_mem_region with dev_request_mem_resource so it would be possible to correctly deallocate device's I/O resources when probe fails. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fec_imx: Deallocate clocks when probe failsAndrey Smirnov2016-03-161-4/+10
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2016-03-112-8/+16
|\
| * EP93xx eth: allow passing of phy config via platform dataAlexander Kurz2016-02-252-2/+14
| | | | | | | | | | | | | | | | | | | | Passing phy configuration to the ep93xx_eth driver was not supported yet and will be added with this patch. When no pdata is passed, the probably broken default of phy_addr = 0 will be used to maintain compatibility with the previous implementation. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net ep93xx mii: do not supress MII preamble transmissionAlexander Kurz2016-02-241-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | PHY like the ks8721bl used on the edb9302 and similar evaluation boards will initially not respond to the ep93xx_phy_read/write functions when the MII-preamble is supressed. The supression is switched on by default and must be switched off by clearing bit 8, see also EP93xx Users guide. Removing the orphaned MII_SUPPRESS_PREAMBLE config option, note: setting MII_SUPPRESS_PREAMBLE would actually enable the preamble transmission. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/driver'Sascha Hauer2016-03-1116-59/+121
|\ \
| * | driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-0716-59/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | driver: Fix return check of dev_request_mem_regionSascha Hauer2016-02-231-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region returns an ERR_PTR, fix places which check for a NULL pointer instead. This patch has been generated with this semantic patch, written by me and improved by Andrey Smirnov: // <smpl> @@ expression e; expression e1; @@ e = dev_request_mem_region(...); ... -if (!e) - return e1; +if (IS_ERR(e)) + return PTR_ERR(e); @ rule1 @ expression e; @@ e = dev_request_mem_region(...); @@ expression rule1.e; identifier ret, label; constant errno; @@ if (!e) { ... ( - ret = -errno; + ret = PTR_ERR(e); ... goto label; | - return -errno; + return PTR_ERR(e); ) } @depends on rule1@ expression rule1.e; @@ - if (e == NULL) + if (IS_ERR(e)) { ... } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
* / net: efi: correct function signature of set_ethaddrLucas Stach2016-03-041-1/+1
|/ | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>