summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/warnings'Sascha Hauer2019-04-091-1/+1
|\
| * treewide: Make locally used functions staticSascha Hauer2019-03-181-1/+1
| | | | | | | | | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2019-04-094-1/+354
|\ \
| * | realtek phy driverSascha Hauer2019-03-113-0/+178
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: phy: Add register access helper functions for physSascha Hauer2019-03-112-1/+176
| |/ | | | | | | | | | | | | Linux has phy helpers to access paged registers and to modify phy registers. Add them to barebox for upcoming realtek phy support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / net: Add Freescale FMan ethernet supportSascha Hauer2019-03-133-0/+1342
|/ | | | | | | | | | | | | | | | | | | This adds ethernet support for the Freecale Layerscape SoCs. The architecture in these SoCs is called "Data Path Acceleration Architecture" (DPAA). It is comprised of: - The Queue Manager (QMan) - Buffer Manager (BMan) - Frame Manager (FMan) - Multirate Ethernet Media Access Controller (mEMAC) The code is based on the corresponding U-Boot driver enriched with device tree parsing and proper device driver support. Tested on LS1046a, should work on other SoCs aswell with some minor quirks. SerDes support has been removed for now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/nvme'Sascha Hauer2019-03-073-18/+3
|\
| * drivers: Make use of device_pci_driver()Andrey Smirnov2019-02-183-18/+3
| | | | | | | | | | | | | | Replace all of the generic PCI boilerplate with device_pci_driver(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | efi: cleanupsOleksij Rempel2019-02-181-1/+1
|/ | | | | | | make local functions static and remove unused code Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-02-132-9/+65
|\
| * net: phy: micrel: backport ksz9031 125MHz ref-clk workaroundMarco Felsch2019-02-121-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch backports linux commit e1b505a60366 ("net: phy: micrel: add 125MHz reference clock workaround"). 8<--------------------- The original commit message ------------------- net: phy: micrel: add 125MHz reference clock workaround The micrel KSZ9031 phy has a optional clock pin (CLK125_NDO) which can be used as reference clock for the MAC unit. The clock signal must meet the RGMII requirements to ensure the correct data transmission between the MAC and the PHY. The KSZ9031 phy does not fulfill the duty cycle requirement if the phy is configured as slave. For a complete describtion look at the errata sheets: DS80000691D or DS80000692D. The errata sheet recommends to force the phy into master mode whenever there is a 1000Base-T link-up as work around. Only set the "micrel,force-master" property if you use the phy reference clock provided by CLK125_NDO pin as MAC reference clock in your application. Attenation, this workaround is only usable if the link partner can be configured to slave mode for 1000Base-T. Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de> [m.felsch@pengutronix.de: fix dt-binding documentation] [m.felsch@pengutronix.de: use already existing result var for read/write] [m.felsch@pengutronix.de: add error handling] [m.felsch@pengutronix.de: add more comments] Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> 8<--------------------------------------------------------------------- Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: designware: drop bad RX framesIan Abbott2019-02-051-9/+33
| | | | | | | | | | | | | | | | | | In dwc_ether_rx(), check the RX descriptor status for various error conditions. On error, issue a warning with the error status bits and drop the received frame. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/lseek'Sascha Hauer2019-02-133-4/+0
|\ \
| * | devfs: Drop dev_lseek_default()Andrey Smirnov2019-01-293-4/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only the following cdevs do not declare an .lseek() operation: - Console devices in common/console.c - Firmware framework in common/firmware.c - JTAG driver in drivers/misc/jtag.c - UBI in drivers/mtd/ubi/barebox.c Of those four, first two are marked DEVFS_IS_CHARACTER_DEV and implement only .write() operation and the last two don't implement anything but .ioctl(). While there's probably no meaningful way to use lseek() against any of those devices, there doesn't seem to be any harm in allowing it either. Change devfs_lseek() to ignore absense of .lseek() callback and drop dev_lseek_default() and all references to it in the codebase. 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-02-131-0/+7
|\ \
| * | net: fec_imx: skip fec_halt if the FEC wasn't startedLucas Stach2019-02-111-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | If the FEC driver is enabled, but the ethernet device was never opened due to booting from another source the wait for graceful transmit stop will always fail. This introduces an unnecessary boot delay and prints a distracting warning. As there is no point in trying to shut down the FEC if it was never started, just skip all of fec_halt in that case. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/e1000'Sascha Hauer2019-02-133-51/+66
|\ \
| * | net/e1000: Do not hardcode TDBAH and RDBAH to 0Andrey Smirnov2019-02-111-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | While there currently no user of e1000 driver that places those rings beyond 4GiB boundary, there's also no real reason not to initialize those registers properly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Improve RX buffer handling in e1000_fill_rx()Andrey Smirnov2019-02-111-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Drop explicit "volatile" specifier for struct e1000_rx_desc, "bla" variable as well as explicit endiannes fix, by using little endian IO accessors (readl, writel, etc.) Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Consolidate next index calculation codeAndrey Smirnov2019-02-111-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Consolidate next index calculation code into a helper function and convert the code to make use of it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Remove pointer arithmetic from e1000_fill_rx()Andrey Smirnov2019-02-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying on reles of pointer arithmetic (implicit multiplication by the size of pointer type), change the code to retreive address of an array elemet to clarify the intent. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Rename fill_rx() to e1000_fill_rx()Andrey Smirnov2019-02-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Rename fill_rx() to e1000_fill_rx() to match the naming convention of other functions in the file. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Make use of readl_poll_timeout() in e1000_transmit()Andrey Smirnov2019-02-111-12/+8
| | | | | | | | | | | | | | | | | | | | | Simplify code of e1000_transmit() with readl_poll_timeout(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Improve Tx descriptor handling in e1000_transmitAndrey Smirnov2019-02-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Drop explicit "volatile" specifier for struct e1000_tx_desc as well as explicit endiannes fix, by using little endian IO accessors (readl, writel, etc.) Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Remove pointer arithmetic in e1000_transmit()Andrey Smirnov2019-02-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying on reles of pointer arithmetic (implicit multiplication by the size of pointer type), change the code to retreive address of an array elemet to clarify the intent. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Improve Rx descriptor handling in e1000_poll()Andrey Smirnov2019-02-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop explicit volatile specifier as well as endianness conversion by changing the code to use appropriate read*() IO accessors. While at it if fix incorrect width used for "status" (8 vs 32) and "len" (16 vs 32). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Get rid of pointer arithmetic in e1000_pollAndrey Smirnov2019-02-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying on reles of pointer arithmetic (implicit multiplication by the size of pointer type), change the code to retreive address of an array elemet to clarify the intent. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Fix incorrect "Rx ready" checkAndrey Smirnov2019-02-111-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to wrong placement of parenthesis in if (!(le32_to_cpu(rd->status)) & E1000_RXD_STAT_DD) return 0; instead of checking that E1000_RXD_STAT_DD is not set, the condition ends up checking that "status" is 0. Change the code to invert the condition tested and get rid of ! entirely. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Fix debug print warningAndrey Smirnov2019-02-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Cast eeprom->word_size to int, so it would match its printf specifier to avoid getting errors when building on AArch64. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Convert e1000_transmit to use dma_map_single()Andrey Smirnov2019-02-111-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert e1000_transmit to use dma_map_single()/dma_unmap_single(), which is more apporpirate in this case, since it will account for phys/virtual address difference as well as allow us to check for DMA mapping failure. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Don't use coherent memory for Rx bufferAndrey Smirnov2019-02-112-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to avoid issues on AArch64, convert the driver to use regular memory and add appropriate DMA sync calls. Drop needless (uchar *) cast while at it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | net: ethernet: cpsw: cpsw-phy-sel: Use phandle for phy selTeresa Remmet2019-02-131-6/+11
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the usage of the interconnect target module hierarchy in device tree the cpsw-phy-sel node moved to the system control module. An phandle has been added instead to the device tree include. Try to use the cpsw-phy-sel phandle first then fall back looking for the cpsw-phy-sel child. This patch is based on the upstream kernel patch: 18eb8aea7fb2 ("net: ethernet: cpsw-phy-sel: prefer phandle for phy sel") Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / net: designware: fix TX descriptor length corruptionIan Abbott2019-02-011-0/+2
|/ | | | | | | | | | | | | | | dwc_ether_send() sets the SIZE1 field of the TX descriptor incorrectly. It sets the SIZE1 field to a bit-wise OR of the old value and the new value. If the old value differs from the new value, the transmitted Ethernet frame will be longer than it should be and is likely to have an incorrect frame check sequence. As more and more Ethernet frames of different lengths are sent, more and more of the TX descriptors are affected (up to a maximum number of CONFIG_TX_DESCR_NUM, defined as 16 in "designware.h"). Fix it by setting the SIZE1 field of the TX descriptor to just the new value. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ultrascale'Sascha Hauer2019-01-151-0/+1
|\
| * zynqmp: enable macb Ethernet supportThomas Hämmerle2019-01-091-0/+1
| | | | | | | | | | Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2019-01-155-4/+354
|\ \
| * | macb: disable second priority queue for zynqmp gem supportThomas Hämmerle2019-01-092-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Provide descriptors for second priority rx and tx queues and disable the the queues if hardware is GEM. Otherwise the function macb_send() will run into a timeout. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | macb: fix memory leakage due to double allocation of rx_bufferThomas Hämmerle2019-01-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove memory allocation of rx buffer in function macb_init_rx_buffer_size, which caused a memory leak since it also is alocated in macb_probe(). Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | macb: fix check if hw is gemThomas Hämmerle2019-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix check for peripheral version in MACB_MID register to treat Xilinx ZynqMP as GEM. All MIDs >= 2 indicate a GEM not only MID == 2. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | macb: fix format specifiers for debug outputThomas Hämmerle2019-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes compiler warning "format '%d' expects argument of type 'int', but argument 4 has type 'size_t {aka long unsigned int}' [-Wformat=]". Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | dp83867: port from linuxThomas Hämmerle2019-01-093-0/+329
| |/ | | | | | | | | | | | | Port driver for TI DP83867 Gigabit Ethernet PHY from linux. Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/missing-prototypes'Sascha Hauer2019-01-151-1/+1
|\ \
| * | net: ks8851_mll: fix "no previous prototype for 'ks_enable_qmu'" warningAntony Pavlov2019-01-101-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | The patch fixes the following compiler's warning: drivers/net/ks8851_mll.c:438:6: warning: no previous prototype for ‘ks_enable_qmu’ [-Wmissing-prototypes] void ks_enable_qmu(struct ks_net *ks) ^~~~~~~~~~~~~ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-01-151-5/+5
|\ \
| * | net: fec_imx: fix timeout off by *1000 errorAhmad Fatoum2018-12-171-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | read*_poll_timeout's final timeout parameter is in microseconds, but the supplied arguments in fec_imx.c were in nanoseconds, which might lead to barebox getting seemingly stuck in fec_halt (loops for a thousand seconds instead of one). I've tested this still works on an i.MX6D by copying a file over TFTP and verifying the hash is correct. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/e1000'Sascha Hauer2019-01-152-61/+61
|\ \
| * | net/e1000: Only read EEPROM_INIT_CONTROL2_REG if it is neededAndrey Smirnov2018-12-171-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E1000_ich8lan, e1000_82573, e1000_82574 and e1000_igb devices (hw->mac_type) do not use data read from EEPROM_INIT_CONTROL2_REG in e1000_setup_link(), so there's no reason for it to bail out when EEPROM read fails. An examlpe use-case would be a i210 adapter initialized from iNVM with no valid EEPROM attached. Change the code to only call e1000_read_eeprom() for devices that do need it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Use dev_err to report errorAndrey Smirnov2018-12-171-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those messages shouldn't be reported in normal use scenarious and in the case of error using dev_err saves user the trouble of having to run a custom build of Barebox with e1000 debugging enabled to see some initial diagnostic messages. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Do not discard EEPROM error code in e1000_setup_link()Andrey Smirnov2018-12-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | E1000_read_eeprom() returns a number of different error codes, so propagate them up the caller chain instead of reducing it to E1000_READ_EEPROM. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net/e1000: Map custom error codes to more appropriate errno valuesAndrey Smirnov2018-12-171-13/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of custom error codes used by e1000 driver will be propagated all the way up to generic networking code and will end up being fed to strerror(). As a result of that, some of the current error codes will result in not very helpful failure messages. For example, trying to ping a host on a system where access to i210's EEPROM fails results in the following message: barebox@ZII RDU2 Board:/ ping 192.168.53.7 ping failed: Operation not permitted In order to make message like that one a little bit more helpful, change definitions of various E1000_ERR_* constants to map to a bit more appropriate error codes. While at it, remove E1000_ERR_MASTER_REQUESTS_PENDING and E1000_ERR_HOST_INTERFACE_COMMAND that are not referenced anywhere in the codebase. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>