summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* i.MX: fec: Add support for Vybrid variantAndrey Smirnov2017-01-111-0/+3
| | | | | | | Add support for Vybrid variant of this IP block Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: fec: Enable all clocks specified for FECAndrey Smirnov2017-01-112-11/+70
| | | | | | | | | For some i.MX variants more than just "ipg" clock need to be enabled for Ethernet to function, so change the code to enable all of the clock defined for FEC node (this is what analogous Linux driver does as well). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: e1000: don't try to register eeprom if MTD support is missingLucas Stach2017-01-091-4/+7
| | | | | | | | EEPROM support is an optional feature and the driver should work just fine without it. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2016-11-141-4/+8
|\
| * net/designware: add explicit reset of {tx|rx}_currdescnumIan Abbott2016-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver "init" function might be called multiple times. On every "init" Tx/Rx buffer descriptors are initialized: "descs_init" -> "{tx|rx}_descs_init". In its turn those init functions set MAC's "{tx|rx}desclistaddr" to point on the first buffer descriptor in the list. So CPU to start operation from the first buffer descriptor as well after every "init" we have to reset "{tx|rx}_currdescnum". [Original U-Boot patch by Alexey Brodkin <abrodkin@synopsys.com>] Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: designware: Respect "bus mode" register contents on SW resetIan Abbott2016-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | "bus mode" register contains lots of fields and some of them don't expect to be written with 0 (zero). So since we're only interested in resetting MAC (which is done with setting the least significant bit of this register with "0") I believe it's better to modify only 1 bit of the register. [Original U-Boot patch by Alexey Brodkin <abrodkin@synopsys.com>] Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net/designware: Do not select MIIPORT for RGMII interfaceIan Abbott2016-11-091-1/+3
| | | | | | | | | | | | | | | | | | Do not select MIIPORT for RGMII interface [Original U-Boot patch by Vipin Kumar <vipin.kumar@st.com>] Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net/designware: Consecutive writes to the same register to be avoidedIan Abbott2016-11-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few registers where consecutive writes to the same location should be avoided or have a delay. According to Synopsys, here is a list of the registers and bit(s) where consecutive writes should be avoided or a delay is required: DMA Registers: Register 0 Bit 7 Register 6 All bits except for 24, 16-13, 2-1. GMAC Registers: Registers 0-3 All bits Registers 6-7 All bits Register 10 All bits Register 11 All bits except for 5-6. Registers 16-47 All bits Register 48 All bits except for 18-16, 14. Register 448 Bit 4. Register 459 Bits 0-3. [Original U-Boot patch by Dinh Nguyen <dinguyen@altera.com>] Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-11-142-1/+6
|\ \ | |/ |/|
| * net: phy: micrel: Do not overwrite reserved bitsSascha Hauer2016-11-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ksz8021_config_init() unconditionally sets the KSZPHY_OMSO_RMII_OVERRIDE bit. This is since the initial micrel phy commit, so it's not reproducible where this comes from and why this is done. Neither U-Boot nor the kernel ever touch this bit and so should we. Also, instead of doing a write only operation, read/modify/write the bit we actually want to change. This fixes operation on a KSZ8081MLX which is a MII only phy. KSZPHY_OMSO_RMII_OVERRIDE is reserved here and must be written to 0. KSZPHY_OMSO_MII_OVERRIDE is default 1 and must be written as 1. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: e1000: set edev parent pointerLucas Stach2016-11-031-0/+1
| | | | | | | | | | | | | | | | This way the ethernet device will show up at the correct point in the device hierarchy. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: e1000: fix i210 register remappingLucas Stach2016-11-031-3/+2
|/ | | | | | | | | | Don't mask out the remapping flag before checking the register offset, otherwise none of the switch statements will ever match. Fixes: ff6a64d42ffc (e1000: Consolidate register offset fixups) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mvebu'Sascha Hauer2016-10-101-0/+1
|\
| * net: mvneta: clean txdesc before usageUwe Kleine-König2016-09-161-0/+1
| | | | | | | | | | | | | | | | This fixes tx error detection which triggered way too often because the hardware doesn't seem to clear the error bits on success Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net/phy: marvell: fix error handlingUwe Kleine-König2016-10-041-1/+2
|/ | | | | | | Without first assigning to ret it doesn't make sense to check it. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: phy: of_phy_register_fixed_link(): drop redundant initializationAntony Pavlov2016-08-221-2/+0
| | | | | | | | | The phy_device_create() function makes all necessary phydev initialization so we can drop phydev->pause and phydev->link initialization in the of_phy_register_fixed_link() function. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: usb: use minimum timeout when polling for new packetsSascha Hauer2016-07-141-1/+1
| | | | | | | | | | When no new packets have arrived we want to return to the caller as soon as possible to give other network controllers the chance to receive packets. With the current USB bulk message timeout of one second other network controllers do not work properly whenever the USB network controller is active. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc911x: Add parsing devicetree optionsAlexander Shiyan2016-07-051-2/+15
| | | | | | | | | This patch adds parsing basic devicetree options for the smc911x driver: reg-io-width, reg-shift and smsc,force-(in/ex)ternal-phy, which makes driver usable for most DTS-based boards. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dm9k: Fix buswidth setting for platform data probeSascha Hauer2016-07-051-24/+18
| | | | | | | | | | | priv->buswidth expects IORESOURCE_MEM_* macros which are not identical to the integer byte bus width, so calling dm9000_setup_buswidth() for the platform_data case is wrong. fixes: d818f02 net: dm9k: add device tree support Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported by: 张忠山 <zzs213@126.com>
* net: phy: make locally used of_phy_register_fixed_link() staticAntony Pavlov2016-06-161-1/+2
| | | | | | | | | | The patch fixes this compiler's warning: drivers/net/phy/phy.c:303:20: warning: no previous prototype for ‘of_phy_register_fixed_link’ [-Wmissing-prototypes] Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2016-06-141-1/+1
|\
| * net: phy: micrel: KSZ9081/KSZ8091: Disable broadcast modeTeresa Remmet2016-05-131-1/+1
| | | | | | | | | | | | | | | | | | KSZ9081 only supports two phy ids 0x0 and 0x3. 0x0 is also used as broadcast address. Disable broadcast, so that id 0x0 can be used as unique address on a shared bus. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/e1000'Sascha Hauer2016-06-145-1019/+1931
|\ \
| * | e1000: Expose i210's external flash as MTDAndrey Smirnov2016-06-033-3/+423
| | | | | | | | | | | | | | | | | | | | | | | | Add code needed to access SPI-NOR flash attached to i210 as a regular MTD device. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Expose i210's iNVM as a cdevAndrey Smirnov2016-06-032-0/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add code needed to expose iNVM memory on the chip as a cdev. The driver also registers a dummy "invm" device that exposes "locked" property which is used to implement iNMV line locking feature. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Add a "poll register" functionAndrey Smirnov2016-06-032-0/+20
| | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Add EEPROM access locking for i210Andrey Smirnov2016-06-031-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | As per datasheet (section 4.6 p. 147) accessing EEPROM on i210 requires software to hold a corresponding lock bit in SW_FW_SYNC register. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Properly release SW_FW_SYNC semaphore bitsAndrey Smirnov2016-06-032-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in the datasheet Software/Firmware synchronisation bits are expected to be released by the software after it is done using it. Add a porper subroutine to do that instead of relying on the Firmware clearing those bits due to timeout. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Refactor Flash/EEPROM reading codeAndrey Smirnov2016-06-032-126/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor Flash/EEPROM reading code to use vtable with pointers to small, specialized functions based on the flash class instead of big monolithic funtions whose behaviour is driven by a number of flags and variables. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Remove unnecessary intializationAndrey Smirnov2016-06-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | We always call e1000_init_eeprom_params() as a part of probing, so there's no need check if it needs to be called in e1000_read_eeprom(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Fix a bug in e1000_probe()Andrey Smirnov2016-06-033-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several reasons why that code in e1000_probe had to be changed: - It reads from chip variant specific register (present only on i210) in a chip variant agnostic codepath - It makes no sense to check for FLUPD bit to make a decision weither to validate EEPROM or not since its function per datasheet is: " ... Flash Update. Writing 1b to this bit causes the content of the internal 4 KB shadow RAM to be written into one of the first two 4 KB sectors of the Flash device (Sector 0 or Sector 1). The bit is self-cleared immediately... " and it is only through sheer serendipity the defined value for bitmask for FLUPD is equivalent to bitmask for FLASH_DETECTED bit which is the bit we actually care about and need to test against (FLUPD for i210 has a different bitmask) Fix those problems by replacing the i210 specific check inside of e1000_validate_eeprom_checksum() with a chip agnostic one and using correct bitmask. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Consolidate Microwire EEPROM init codeAndrey Smirnov2016-06-031-31/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | All of the chips that bitbang Microwire to access EEPROM appear to be configured in the same way, so move common code into a separate function and make use of it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Consolidate SPI EEPROM init codeAndrey Smirnov2016-06-031-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | All of the chips that bitbang SPI to access EEPROM appear to be configured in the same way, so move common code into a separate function and make use of it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Simplify EEPROM init for e1000_igbAndrey Smirnov2016-06-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | That chip specifies read access uising EERD via use_eerd, which means that none of the more "advanced" EEPROM parameters will be used for reads, so remove them. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Simplify EEPROM init for e1000_80003es2lanAndrey Smirnov2016-06-031-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | That chip specifies read access uising EERD via use_eerd, which means that none of the more "advanced" EEPROM parameters will be used for reads, so remove them. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Remove 'page_size'Andrey Smirnov2016-06-032-22/+11
| | | | | | | | | | | | | | | | | | | | | | | | Remove 'page_size' from 'struct e1000_eeprom_info' since it is not used anywhere in the code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Remove 'use_eewr' parameterAndrey Smirnov2016-06-032-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove 'use_eewr' from 'struct e1000_eeprom_info' since it is not used anywhere in the code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Consolidate register offset fixupsAndrey Smirnov2016-06-034-22/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate all code taking care on CSR offset differences for i210 chips into a single place in the driver and integrate that funcionality into e1000_{read,write}_reg functions. This way we can get rid of all those if (hw->mac_type == e1000_igb) { .... } else { .... } snippets sprinkled all across the driver code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Remove unneeded i210 specific register codeAndrey Smirnov2016-06-033-24/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Despite having EEC(EECD) and EERD at "non-standard" offsets i210 aliases those registers to be accesible via regular addresses so none of the code removed by this commit is really necessary. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Do not read same register twiceAndrey Smirnov2016-06-031-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | EEPROM_INIT_CONTROL2_REG is already read once before entering this switch statement, so there's not much use in reading its value for the second time. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Remove unnecessary variableAndrey Smirnov2016-06-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There doesn't seem to be any point for having 'nv_packet' variable and it looks like a leftover from driving porting. Remove it and use 'txpacket' instead Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Fix a bug in e1000_detect_gig_phyAndrey Smirnov2016-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems there's stray exclamation mark character in e1000_detect_gig_phy which renders the whole if statement useless since it converts 'phy_type' into a boolean and comparing that to 0xFF would always result in false (which GCC 5.1 is now able to detect and warn about). This commit fixes that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Convert E1000_*_REG macros to functionsAndrey Smirnov2016-06-035-266/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | E1000_*_REG don't bring any value by being macros and implicit appending of "E1000_" prefix to the constant name only makes thing harder to grep or understand. Replace those macros with functions. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Include <net.h> in e1000.hAndrey Smirnov2016-06-033-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | That header(e1000.h) uses a number of definitions from net.h, so for it to be self-contained it needs to include that file. This change also allows remove includes of net.h from other files. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | e1000: Split driver into multiple filesAndrey Smirnov2016-06-034-777/+796
| |/ | | | | | | | | | | | | | | | | | | The driver has a number of not very tightly coupled subsystems and at 4K+ lines e1000.c is getting rather hard to wrangle, so let's move EEPROM handling code (very self contained susbsystem) into a separate file and put all of the driver into a dedicated subdirectory. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / Fix genphy_restart_aneg() for Micrel's ksz9031.grodriguez2016-06-141-1/+8
|/ | | | | | | | | Commit da89ee8f2e04 ("Center FLP timing at 16ms") breaks genphy_restart_aneg() for Micrel's ksz9031. According to the datasheet, the ksz9031 requires a wait of 1ms after clearing the PDOWN bit and before read/write access to any PHY registers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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
|\ \