summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* net: fec_imx: Make use of IS_ALIGNEDAndrey Smirnov2018-06-111-1/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: Use dma mapping functionsSascha Hauer2018-06-112-6/+10
| | | | | | | Rather than doing DMA on the input buffer address get a proper DMA address from the mapping functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_imx: remove unnecessary DMA sync opsSascha Hauer2018-06-111-4/+0
| | | | | | | The fec receive buffers are coherently mapped, no need to dma_sync on them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/socfpga'Sascha Hauer2018-05-091-0/+1
|\
| * net: make SoCFPGA-specific designware driver work againAntony Pavlov2018-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If MFD_SYSCON is disabled in .config then socfpga_designware_eth probe fails with this message: socfpga_designware_eth ff702000.ethernet: Could not get sysmgr-syscon node Thanks to Steffen for hint! Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2018-05-091-0/+1
|\ \
| * | net: phy: micrel: fix too late link upChristian Hemp2018-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit a4cee7207a1 ("net: phy: micrel: Add workaround for bad autoneg") by Philipp Zabel <p.zabel@pengutronix.de>: 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. is it possible that we get the link to late and barebox reports "Network is down". The problem is that ksz9031_config_init is called again in an error case. In this case autoneg will restart but waiting for finish is missing. Signed-off-by: Christian Hemp <c.hemp@phytec.de> Tested-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
* | | usbnet: increase bulk message timeoutNikita Yushchenko2018-05-021-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | Timeout of 1ms is too low for case when device operates in Full Speed mode. This causes most incoming frames to be lost. Since timeout is only used to get out of polling loop in case of no response from hardware, increasing it should be safe for all platforms. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Tested-By: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | rename file_operations -> cdev_operationsSascha Hauer2018-04-063-4/+4
|/ | | | | | | | Linux also has struct file_operations which are something different. Rename our file_operations to cdev_operations which better matches what we have. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: cpsw: fix probe with fixed-linkAndreas Schmidt2018-03-051-4/+6
| | | | | | | | | While cpsw is probe dt, it accepts only slaves nodes with "phy_id" property. In case of fixed-link there are no "phy_id" property and probe would be failed. This patch avoid the failure due to missing "phy_id" in case of fixed-link. Signed-off-by: Andreas Schmidt <mail@schmidt-andreas.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: cpsw: Call phy_device_connect() earlierSascha Hauer2018-02-221-15/+4
| | | | | | | | | We only want to register a slave when a valid phy is available. Instead of manually calling mdiobus_scan() and phy_register_device() we can let this do from phy_device_connect() which also works for fixed phys. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-02-081-2/+19
|\
| * net: phy: fixed-link: read link parameters from devicetreeLucas Stach2018-02-061-2/+7
| | | | | | | | | | | | | | Implement the missing reading of the fixed link parameters from the devicetree properties. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * net: phy: scan PHYs referenced by phandleLucas Stach2018-01-251-0/+12
| | | | | | | | | | | | | | | | | | | | If we point to a PHY node by phandle, that PHY might well be on a MDIO bus that hasn't been scanned when we look for the PHY. Fortunately we know exactly where to look for the PHY, so make sure to scan the bus at the right address. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/e1000'Sascha Hauer2018-02-083-76/+80
|\ \
| * | net/e1000: don't register EERPOM device if the content is invalidLucas Stach2018-01-301-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | If the EEPROM content isn't valid, there is no point in registering the EEPROM device, as it will reject any read attempt anyway. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: don't check EEPROM signature if populated from iNVMLucas Stach2018-01-302-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EEPROM device will contain an invalid signature if it has been populated from iNVM. Since the iNVM enum type has been removed, the only way to tell if a signature check makes sense is to look at the EEPROM valid status. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: EEPROM isn't valid if only iNVM is availableLucas Stach2018-01-301-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no point in registering the emulated EEPROM device if only the iNVM is available with no external flash attached to the i210, as in practice it's only shadowing the iNVM. When the EEPROM is populated from iNVM, the signature is not valid, which causes other parts of the driver to fall over. To fix this just ignore the EEPROM in that case. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: use correct bit for flash detectionLucas Stach2018-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes: 95c346ccaa6d (net/e1000: don't access the (simulated) eeprom when it is invalid) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: remove one level of indentationLucas Stach2018-01-301-60/+61
| |/ | | | | | | | | | | | | By returning early if the MAC type isn't e1000_igb. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: phy: ar8327: fix ar8327n_reg_readOleksij Rempel2018-02-051-1/+1
| | | | | | | | | | | | | | Actual read value was lost and only by accident worked properly. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: designware: add missing headersLucas Stach2018-02-052-2/+2
|/ | | | | | | | | As the eth_device and mii_bus structs are allocated inside the dw_eth_dev struct a forward declaration isn't enough. Fixes: c1f902841ce3 (net: designware: move probe to generic driver) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net-designware'Sascha Hauer2018-01-226-56/+307
|\
| * net: designware: add warning for drvdataSteffen Trumtrar2018-01-111-1/+5
| | | | | | | | | | | | | | | | | | Instead of silently using a wrong value, check if drvdata is defined before use. Print a warning if there is no drvdata found. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: add SoCFPGA-specific designware driverSteffen Trumtrar2018-01-113-0/+192
| | | | | | | | | | | | | | Add a driver for the SoCFPGA-specific version of the designware ethernet ip core. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: designware: move probe to generic driverSteffen Trumtrar2018-01-115-55/+110
| | | | | | | | | | | | | | | | | | The designware ethernet core is used on multiple different SoCs. The linux kernel has a generic driver and SoC-specific drivers. Do the same here. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: fix driver probing in the presence of two e1000 devicesUwe Kleine-König2018-01-171-0/+1
|/ | | | | | | | | | | | | | | | The .id member of the struct device for the invm device is not initialized and so implicitly zero. This yields: register_device: already registered invm0 for the second i210 during probe. So use the parent's id to initialize the id for invm, too, as is already done for the corresponding e1000-nor device. Fixes: a74b97f009c6 ("e1000: Expose i210's iNVM as a cdev") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mii'Sascha Hauer2018-01-055-0/+341
|\
| * net: mdio-mux: Avoid probing multiplexed bussesAndrey Smirnov2017-12-062-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Calling mdiobus_detect() for a bus that serves as a parent for a MDIO bus multiplexer would result in parent bus being populated with devices that are present on downstream bus that multiplexer happens to be "pointing" at that moment. To avoid that introduce 'is_multiplexed' flag to struct mii_bus and change mdiobus_detect to ignore busses for which that flag is set. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: phy: Port GPIO controlled MDIO multiplexer driverAndrey Smirnov2017-12-063-0/+158
| | | | | | | | | | | | | | | | Port Linux version driver to Barebox, to support such device found in various revisions of ZII's VF610 development board. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: phy: Port MDIO bus miltiplexer framework from Linux kernelAndrey Smirnov2017-12-063-0/+152
| | | | | | | | | | | | | | | | Port mdio-mux.c from Linux kernel to Barebox, to support adding dirvers that rely on that infrastructure/API. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mdio_bus: Port of_mdio_find_bus() from Linux kernelAndrey Smirnov2017-12-061-0/+27
| | | | | | | | | | | | | | | | Port of_mdio_find_bus() from Linux kernel. This function is used in MDIO multiplexor infrastructure added in following commit. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: indicate at boot time if flash is in secure modeUwe Kleine-König2017-12-062-3/+8
| | | | | | | | | | | | | | | | If the flash is in secure mode it is not possible to modify its contents. So log that useful information at probe time. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: add missing \n in error messageUwe Kleine-König2017-12-011-1/+1
| | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: implement protect and unprotect for attached flashUwe Kleine-König2017-11-282-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | Some supported flash devices (e.g. SST25VF040) are write protected after power up. If the device holds a valid firmware image the i210 can handle that just fine. If however there is no firmware programmed, a procedure is needed to remove this protection before an image can be flashed. So implement the needed callbacks to make the commands protect and unprotect do the right thing. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: expand timeout for flash erasureUwe Kleine-König2017-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Erasing the whole flash takes approximately 7s on one of my test machines. Expand the timeout accordingly. Note however that it is in general not allowed to hold the flash semaphore for so long and "firmware might implement a timeout mechanism and take ownership of the relevant [lock]" after one second. So a chip erase should better only be done when firmware doesn't make use of the flash. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: indicate in error messages where the failure occuredUwe Kleine-König2017-11-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | There used to be four places that all emit the same error message. Even if in a given context not all four of them can be relevant, there are always two possible locations where the message can origin from. So make the output slightly different in all places to ease future debugging. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: don't access the (simulated) eeprom when it is invalidUwe Kleine-König2017-11-243-6/+35
| | | | | | | | | | | | | | | | | | | | The shadow RAM that is used to serve read requests from the eeprom interface isn't valid in all cases. Catch these by returning an error in the eeprom read function and make eeprom validation dependant on working access. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: log flash/invm status at probe timeUwe Kleine-König2017-11-241-0/+18
| | | | | | | | | | | | | | Provide some info about flash/eeprom state at boot up Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: don't fail to bind on uninitialized flashUwe Kleine-König2017-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | When the flash doesn't hold a valid firmware image there are still some things (like accessing the flash) possible. Don't return an error code in this case but return 0 instead. This way the driver is regularily bound and just doesn't provide a network interface. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: provide device for accessing emulated eepromUwe Kleine-König2017-11-242-1/+44
| | | | | | | | | | | | | | | | This device uses e1000_read_eeprom to provide access to the emulated eeprom on e1000-igb. Only reading is implemented for now. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: fix size of invm deviceUwe Kleine-König2017-11-241-1/+1
| | | | | | | | | | | | | | The iNVM storage is 2 Kib containing 64 32bit words (0-63). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: provide access to iNVM even if a flash is presentUwe Kleine-König2017-11-242-67/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An i210 (aka e1000_igb) supports two different non-volatile storages for configuration. There is a built-in one-time programmable storage called iNVM and an optional external SPI-Flash. If a flash is populated and contains a valid configuration image the iNVM is not used (if I understood the documentation correctly). Still the iNVM can be useful if the flash is not configured. Also the iNVM contains manufacturing identification information. So it makes sense to provide the invm device even if a flash is present. This patch also cleans up some confusion that suggests that invm is a way to access the (simulated) eeprom structures and drops some unused enum values. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: reorder functionsUwe Kleine-König2017-11-241-70/+67
| | | | | | | | | | | | | | | | Bring functions in a more natural order which allows to drop a few forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: don't use the eeprom word size as timeout to get a semaphoreUwe Kleine-König2017-11-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing in the documentation suggests that the time to get a semaphore depends on the size of the (optional) eeprom and I doubt there is a relation. Given that 2048 is the maximal value for word_size unless a flash is used to emulate the eeprom, pick 2049 as alternative arbitrary value that probably doesn't result in regressions. This drops the only user of ->word_size outside of eeprom.c which allows easier restructurings there in the future. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/e1000: fix coding style at a few locationsUwe Kleine-König2017-11-242-5/+14
|/ | | | | | | | While working on the e1000 driver I noticed a few coding style misdeeds. These are fixed here. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2017-10-192-7/+69
|\
| * Marvell: implement marvell_of_reg_initClément Leger2017-10-161-4/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | From ed1cbcd05d5efeb4012d77a9a4ab9c1da0449bdc Mon Sep 17 00:00:00 2001 From: Clement Leger <clement.leger@kalray.eu> Date: Tue, 10 Oct 2017 14:29:49 +0200 Subject: [PATCH] Marvell: implement marvell_of_reg_init Implement marvell_of_reg_init in order to use marvell,reg-init property from device-tree. The code is taken from Linux kernel and slighlty modify to fit barebox structures. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove checks for xzalloc() returning NULLUwe Kleine-König2017-09-261-3/+0
| | | | | | | | | | | | | | xzalloc() either returns memory or panics, so checking for NULL is useless. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mips'Sascha Hauer2017-10-196-0/+978
|\ \