summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy
Commit message (Collapse)AuthorAgeFilesLines
* ar8216: fix ATU flushingFelix Fietkau2015-01-242-9/+5
| | | | | | | | | | | | | | | | | | The functionality to flush the address translation table contains two bugs which luckily compensate each other. 1. Just setting the operation is not sufficient to perform the flushing. The "active" bit needs to be set to actually trigger an action. For the vtu operations this is implemented correctly. 2. ar8xxx_phy_read_status is called every 2s by the phy state machine to check for link changes. This would have caused an ATU flush every 2s. Fix the chip-specific ATU flush functions and remove the ATU flush call from ar8xxx_phy_read_status. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44101
* ar8216: display flow control info in swconfig get_link in case of ↵Felix Fietkau2015-01-182-1/+19
| | | | | | | | | | | | | | | | | | autonegatiation too The swconfig get_link attribute (at least) on AR8327/AR8337 doesn't consider the autonegotiated flow control. AR8327/AR8337 provide the info about autonegotiated rx/tx flow control in bits 10 and 11 of the port status register. Use these values to display info about autonegotiated rx/tx flow control as part of the get_link attribute. Successfully tested on TL-WDR4900 (AR8327 rev.4) and TL-WDR4300 (AR8327 rev.2). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44023
* ar8216: add 802.3az EEE info to swconfig get_link attributeFelix Fietkau2015-01-184-1/+47
| | | | | | | | | | | | | AR8327/AR8337 allow to read the result of EEE autonegotiation. If EEE is autonegotiated between the link partners, display this as part of the swconfig get_link attribute. eee100: 100MBit EEE supported by both link partners eee1000: 1GBit EEE supported by both link partners Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44022
* ar8216: introduce enable_eee swconfig attribute to control 802.3az EEE per portFelix Fietkau2015-01-184-17/+122
| | | | | | | | | | | | | | | | Users reported network issues with AR8327 which turned out to be caused by EEE not working correctly with certain link partners (ticket 14597). The workaround was to disable EEE on all ports (changeset 41577). The issue was with certain link partners only, therefore this patch allows to control usage of EEE per port via swconfig. Still the default is to initially disable EEE on all ports. Successfully tested on a TL-WDR4900 (AR8327 rev.4) Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44021
* ar8216: introduce ar8xxx_reg_clear complementing ar8xxx_reg_setJohn Crispin2015-01-173-12/+14
| | | | | | | | Introduce ar8xxx_reg_clear complementing ar8xxx_reg_set. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44004
* ar8216: replace ar8xxx_rmw with ar8xxx_reg_set where appropriateJohn Crispin2015-01-172-12/+7
| | | | | | | | Replace ar8xxx_rmw with ar8xxx_reg_set where appropriate. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44003
* ar8216: define all switch_addr structs as constJohn Crispin2015-01-172-6/+6
| | | | | | | | Define all switch_addr structs as const. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44002
* mvsw61xx: track and set per-VLAN port state in STULuka Perkov2015-01-112-7/+32
| | | | | | | | | | Since the driver doesn't know anything about (M)STP we just hard-set the ports to be enabled if they are part of the VLAN. Signed-off-by: Claudio Leite <leitec@staticky.com> SVN-Revision: 43938
* mvsw61xx: clean up and expand register definitionsLuka Perkov2015-01-112-29/+50
| | | | | | | | | | | | | | | | - eliminate MV_CPUPORT; not necessary since we define the CPU port(s) via Device Tree - add STU and expand VTU operations - update register names to match those of 88E61xx rather than mvswitch's 88E6060 - use more consistent formatting Signed-off-by: Claudio Leite <leitec@staticky.com> SVN-Revision: 43937
* mvsw61xx: rework chip recognitionLuka Perkov2015-01-112-10/+31
| | | | | | | | Recognizes 88E6171/6172/6176 at the moment. Signed-off-by: Claudio Leite <leitec@staticky.com> SVN-Revision: 43936
* mvsw6171: rename to 'mvsw61xx'Luka Perkov2015-01-112-129/+129
| | | | | | | | | In preparation for properly supporting switches beyond the 88E6171. Signed-off-by: Claudio Leite <leitec@staticky.com> SVN-Revision: 43935
* ar8216: factor out AR8327/AR8337-specific driver code into ar8327.cFelix Fietkau2015-01-053-1030/+1134
| | | | | | | | | | Move all AR8327/AR8337-specific driver code into a separate source file ar8327.c and adjust patches so that ar8327.c is compiled if CONFIG_AR8216_PHY is set. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43845
* ar8216: move definitions from ar8216.c to ar8216.h and introduce ar8327.hFelix Fietkau2015-01-053-345/+365
| | | | | | | | | | Move several structure definitions and #defines from ar8216.c to ar8216.h and move AR8327/AR8337 header stuff into a new header file ar8327.h. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43844
* kernel: remove openwrt micrel.c (replaced by upstream driver)Felix Fietkau2014-12-221-83/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43762
* mvsw6171: note support for 88E6172 switchesLuka Perkov2014-12-191-1/+1
| | | | | | | | | The '6171 and '6172 are similar enough to work without any changes to the code. Signed-off-by: Claudio Leite <leitec@staticky.com> SVN-Revision: 43753
* ar8216: Inline function ar8xxx_create_miiFelix Fietkau2014-12-181-13/+3
| | | | | | | | Inline function ar8xxx_create_mii. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43743
* ar8216: Remove read/write/rmw member functions from ar8xxx_privFelix Fietkau2014-12-181-65/+51
| | | | | | | | | | | | | | Remove read/write/rmw member functions from ar8xxx_priv There seems to be no real benefit of the ar8xxx_priv member functions read/write/rmw as one implementation exists for each of them only. Especially ar8xxx_mii_rmw is assigned to priv->rmw first and then mapped to ar8xxx_rmw. Rename the ar8xxx_mii_.. functions to ar8xxx_.. and use them directly. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43742
* ar8216: Create helpers mii_read32 / mii_write32 for 32 bit MII opsFelix Fietkau2014-12-181-34/+40
| | | | | | | | | | Create helpers mii_read32 / mii_write32 for 32 bit MII ops. Rename r3 variable to page in ar8xxx_mii_write to make it consistent with the other ar8xxx_mii_xxxx functions. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43741
* ar8216: Factor out chip-specific parameters from ar8xxx_probe_switchFelix Fietkau2014-12-181-117/+151
| | | | | | | | | Factor out chip-specific parameters from ar8xxx_probe_switch. Move the ar8xxx_chip definitions after the swops definitions. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43740
* ar8216: remove unused function parameter in ar8327_led_registerFelix Fietkau2014-12-181-2/+2
| | | | | | | | Remove unused function parameter in ar8327_led_register. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43739
* ar8216: enable cpu port to receive arp and broadcast frames for ar8236Felix Fietkau2014-12-122-0/+12
| | | | | | Signed-off-by: Weijie Gao <hackpascal@gmail.com> SVN-Revision: 43668
* kernel: add driver for Marvell 88E6171 switchJohn Crispin2014-12-012-0/+1096
| | | | | | | | | | This is a swconfig driver for the Marvell 88E6171 switch, which is a 7-port GigE switch with two CPU ports and 64 802.1q VLANs. Signed-off-by: Claudio Leite <leitec@staticky.com> SVN-Revision: 43486
* ar8216: factor out reg_port_stats_base parameters to ar8xxx_chipJohn Crispin2014-12-012-13/+20
| | | | | | | | | Factor out reg_port_stats_base parameters to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43471
* ar8216: factor out mii_lo_first to ar8xxx_chipJohn Crispin2014-12-011-5/+5
| | | | | | | | Factor out mii_lo_first to ar8xxx_chip. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43470
* ar8216: factor out chip-specific data structures from ar8xxx_privJohn Crispin2014-12-011-15/+16
| | | | | | | | Factor out chip-specific data structures from ar8xxx_priv. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43469
* ar8216: factor out set_mirror_regs to ar8xxx_chipJohn Crispin2014-12-011-15/+13
| | | | | | | | | Factor out set_mirror_regs to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43468
* ar8216: factor out mib_func to ar8xxx_chipJohn Crispin2014-12-011-6/+6
| | | | | | | | Factor out mib_func to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43467
* ar8216: factor out info whether switch should be configured at probe stage ↵John Crispin2014-12-011-2/+4
| | | | | | | | | | | to ar8xxx_chip Factor out info whether switch should be configured at probe stage to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43466
* ar8216: suppress PHY reset for linux 3.14Felix Fietkau2014-11-271-2/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43410
* ar8216: Fix issue with autoneg being disabled under 3.14, revert 43332Felix Fietkau2014-11-241-2/+47
| | | | | | | | | | Patch reverts 43332 which seems to cause issues with VLAN functionality. Add a specific check to check whether ANEG is still enabled and re-enable it if necessary. Disable generic phy soft reset for kernel >=3.16. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43356
* ar8216: Use generic hw_init from ar8236 for ar8216 tooFelix Fietkau2014-11-201-13/+7
| | | | | | | | | | We should make sure that also for ar8216 hw gets initialized. For ar8216 hw_init is a dummy currently. The hw_init used for ar8236 should be generic enough to be usable with ar8216 too. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43334
* ar8216: simplify PHY fixup/initFelix Fietkau2014-11-201-19/+10
| | | | | | | | | | Move the PHY fixup call to the PHY init loop. Use ar8xxx_has_gige in the PHY init instead of passing the gigE capability via function parameter. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43333
* ar8216: use genphy_config_aneg also for PHY 0Felix Fietkau2014-11-191-10/+1
| | | | | | | | | | | | | | | | | Kernel 3.14 introduced a switch reset in phy_init_hw in drivers/net/phy causing BMCR_ANENABLE to get cleared. Due to the fact that ar8xxx_phy_config_aneg does nothing for PHY 0 autonegatiation support remains disabled. This can cause ports to operate at 10MBit/half-duplex only. Fix this by calling genphy_config_aneg for PHY 0 too as genphy_config_aneg sets BMCR_ANENABLE if it's not yet set. Fixes: ticket 17800 Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43332
* ar8216: factor out PHY init code into a generic functionFelix Fietkau2014-11-191-41/+25
| | | | | | | | | | PHY init code in the switch-specific hw_init functions is mainly identical. Factor it out into a generic ar8xxx_phy_init function. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43331
* ar8216: introduce fixup_phys callback in ar8xxx_chipFelix Fietkau2014-11-191-2/+13
| | | | | | | | | Move phy fixup code from the chip-specific hw_init functions into a fixup_phys callback. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43330
* ar8216: after a switch reset poll until BCMR_RESET is clearedFelix Fietkau2014-11-191-3/+29
| | | | | | | | | | | | Currently there is a fixed 1000ms wait time after the switch was reset. Most if not all switches need much less time to perform a reset. Therefore replace the fixed wait time with polling for BMCR_RESET to be cleared. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43329
* ar8216: introduce global constant for number of PHYsFelix Fietkau2014-11-192-4/+5
| | | | | | | | | | All supported switches have 5 PHYs. Currently partially 5 is hardcoded and partially switch-specific constants exist. Replace them with a global constant. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43328
* ar8216: fix "unused variable" compiler warningJohn Crispin2014-11-141-1/+1
| | | | | | | | | | Most likely a copy & paste error when deriving ar8327_sw_set_ports from ar8xxx_sw_set_ports. Remove unused variable. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 43273
* swconfig: last vs tailJohn Crispin2014-10-291-1/+1
| | | | | | | | sorry ..... Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43107
* swconfig: "swconfig list" shows devices in reverse orderJohn Crispin2014-10-291-1/+1
| | | | | | | | | Boards that have more than one swconfig enabled switch will show the devices in reverse order when call swconfig list. Fix this by using list_add_tail(). Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43106
* ar8216: set the pvid based on runtime state instead of port number to fix ↵Felix Fietkau2014-10-021-3/+1
| | | | | | | | learning with enable_vlan = 0 Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42753
* ar71xx: ar8216: tagged+untagged on ar8327 (#12181)Felix Fietkau2014-09-231-7/+53
| | | | | | | | | | | | | | | | | | This allows tagged and untagged traffic together on the same port on ar8327 switch devices. I looked at the first attempt to do this in r40777 (ar71xx: Fix tagged+untagged operation on AR8327N (#12181)). I also set the vlan and port egress policies like that change. But I change vlan_tagged in an less intrusive way. The tagged/untagged decision is now based on the following rules: - if vid != pvid then traffic is always tagged - if vid == pvid then vlan_tagged stores if the traffic should be tagged Tested on TP-Link WDR-3600 (ar8327N). Signed-off-by: Valentin Spreckels <Valentin.Spreckels@Informatik.Uni-Oldenburg.DE> SVN-Revision: 42653
* ar71xx: ar8216: move policies, pvid to setup_portFelix Fietkau2014-09-231-41/+52
| | | | | | | | | | | | | | This moves ingress, egress policy and pvid decisions to setup_port methods. They arenow device type dependent. This allows policy changes on only one device type which is needed to allow tagged + untagged operation on ar8327. Tested on TP-LINK WDR-3600 (ar8327N). Signed-off-by: Valentin Spreckels <Valentin.Spreckels@Informatik.Uni-Oldenburg.DE> SVN-Revision: 42652
* ar8216: add new phyid 0x004dd043 (ar8326)John Crispin2014-07-141-0/+1
| | | | | | Used in ubiquity nanostation xw boards SVN-Revision: 41635
* ar8216: disable EEE by default on AR8327 to fix stability issues (#14597)Felix Fietkau2014-07-102-0/+12
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41577
* b53: hardcode reset GPIO for Linksys WRT300N 1.1Hauke Mehrtens2014-07-061-0/+1
| | | | | | | | | | | | According to the thread https://forum.openwrt.org/viewtopic.php?id=48281 b53 uses GPIO 7: [ 4.470000] b53_common: [DBG] b53_switch_reset_gpio using 7 and causes device to self-reboot. GPIO 8 was found in CFE boot log: "Reset switch via GPIO 8 ..." Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 41526
* adm6996: the GPIO interface for the adm6996l does not support switch statistics.Hauke Mehrtens2014-07-051-2/+9
| | | | | | | | | This patch deactivates the statistics, adds a missing lock initialization and fixes a waring. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 41511
* Revert "ar71xx: Fix tagged+untagged operation on AR8327N (#12181)"Jo-Philipp Wich2014-05-241-154/+72
| | | | | | | | | Revert the tagged + untagged rework for now due to regressions in vlan setup on certain AR83xx switches. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 40842
* ar71xx: Fix tagged+untagged operation on AR8327N (#12181)Jo-Philipp Wich2014-05-191-72/+154
| | | | | | | | | | | | | | Replace the global "vlan_tagged" variable with an array storing the tagging state per vlan. The code was taken from #12181, tested and cleaned up by Saverio Proto with additional bug fixes supplied by Álvaro Fernández. Tested-by: Jo-Philipp Wich <jow@openwrt.org> Signed-off-by: Saverio Proto <zioproto@gmail.com> Signed-off-by: Álvaro Fernández <noltari@gmail.com> SVN-Revision: 40777
* kernel: fix warning in swconfig.c with kernel 3.14Hauke Mehrtens2014-05-081-6/+10
| | | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 40733