summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/ar8216.h
Commit message (Collapse)AuthorAgeFilesLines
* treewide: replace nbd@openwrt.org with nbd@nbd.nameFelix Fietkau2016-06-071-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* AR8216: improve mmd register accessJohn Crispin2016-03-041-2/+2
| | | | | | | | | | | Combine all bus operations for one MMD access in one function. Protecting all these bus operations with one lock also helps to avoid potential issues due to bus operations intercepting the register and data write. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 48914
* AR8216: make ARL age time configurableJohn Crispin2016-03-041-0/+14
| | | | | | | | | | | | | | | | | The default TTL for address resolution table entries is 5 minutes for all members of the AR8216 family. This can cause issues if e.g. Wifi clients roam to another AP and their MAC appears on another switch port suddenly. Then the client may not be reachable until the old ARL entry expires. I would have expected the switch to invalidate old entries if it detects the same MAC on another port. But that's not the case. Therefore make the TTL for ARL entries configurable. The effective TTL will always be a multiple of 7 seconds. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 48913
* ar8216: add swconfig attributes for ARL table flushingFelix Fietkau2015-07-151-0/+8
| | | | | | | | Add swconfig attributes for flushing the ARL table globally or per port. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 46382
* ar8216: add ARL table flushing per portFelix Fietkau2015-07-151-2/+4
| | | | | | | | | | | | | Adds functions for flushing ARL table entries per port. Successfully tested on AR8327. Implementation for AR8216/AR8236/AR8316 is based on the AR8236 datasheet and assumes that the three chips share a common ATU register layout. Compile-tested only for AR8216/AR8236/AR8316. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 46380
* ar8216: add reading ARL table for AR8216/AR8236/AR8316Felix Fietkau2015-07-151-4/+21
| | | | | | | | | | | | | | | | Adds the chip-specific part of reading ARL table for AR8216/AR8236/AR8316. It's based on the AR8236 datasheet and compile-tested only as I couldn't find datasheets for AR8216/AR8316 and don't own devices with these chips. The existing ar8216_atu_flush implementation was used for all three chip types, therefore I guess they share a common ATU register layout. More testing would be appreciated. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 46379
* ar8216: prefix mii_xxx functions to avoid kernel namespace pollutionFelix Fietkau2015-01-241-2/+2
| | | | | | | | | Prefix the exported mii_xxx32 functions with ar8xxx_ to avoid kernel namespace pollution. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44105
* ar8216: add swconfig attribute to display ARL table on AR8327/AR8337Felix Fietkau2015-01-241-0/+37
| | | | | | | | | | | | | | Add global read-only swconfig attribute "arl_table" to display the address resolution table. So far the chip-specific part is implemented for AR8327/AR8337 only as I don't have the datasheets for the other AR8XXX chips. Successfully tested on TL-WDR4300 (AR8327rev2) and TL-WDR4900 (AR8327rev4). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44104
* ar8216: decrease page switch wait timeFelix Fietkau2015-01-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | Until a few years ago the page switch wait time was set to msleep(1) what was changed to usleep_range(1000, 2000) later. I can not imagine that a low-level operation like switching page on register level takes so much time. Most likely the value of 1ms was initially set to check whether it fixes an issue and then remained w/o further checking whether also a smaller value would be sufficient. Now the wait time is set to 5us and I successfully tested this on AR8327. IMHO 5us should be plenty of time for all supported chips. However I couldn't test this due to missing hardware. If other chips should need a longer wait time we can add the wait time as a parameter to the ar8xxx_chip struct. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44103
* ar8216: add link change detection for switch portsFelix Fietkau2015-01-241-0/+1
| | | | | | | | | | Check for switch port link changes and - flush ATU in case of a change - report link change via syslog Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44102
* ar8216: add 802.3az EEE info to swconfig get_link attributeFelix Fietkau2015-01-181-0/+3
| | | | | | | | | | | | | 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-181-0/+9
| | | | | | | | | | | | | | | | 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-171-0/+6
| | | | | | | | Introduce ar8xxx_reg_clear complementing ar8xxx_reg_set. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44004
* ar8216: factor out AR8327/AR8337-specific driver code into ar8327.cFelix Fietkau2015-01-051-0/+76
| | | | | | | | | | 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-051-168/+140
| | | | | | | | | | 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
* ar8216: enable cpu port to receive arp and broadcast frames for ar8236Felix Fietkau2014-12-121-0/+3
| | | | | | Signed-off-by: Weijie Gao <hackpascal@gmail.com> SVN-Revision: 43668
* ar8216: factor out reg_port_stats_base parameters to ar8xxx_chipJohn Crispin2014-12-011-6/+0
| | | | | | | | | 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: introduce global constant for number of PHYsFelix Fietkau2014-11-191-1/+0
| | | | | | | | | | 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: disable EEE by default on AR8327 to fix stability issues (#14597)Felix Fietkau2014-07-101-0/+3
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41577
* generic: ar8216: add custom LED support for the AR8327 switchGabor Juhos2014-01-201-0/+3
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 39338
* generic: ar8216: add AR8337N switch supportGabor Juhos2013-11-291-0/+2
| | | | | | | | | | | | | | | | | This patch is needed to use the switch inside the Sitecom WLR-8100; it was unusable and detected as Generic-Phy before. since ar8337 is behaving like ar8327 generally do the same thing see: https://forum.openwrt.org/viewtopic.php?pid=214218#p214218 forward-ported to trunk Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de> Patchwork: http://patchwork.openwrt.org/patch/4469/ [juhosg: merge chip_is_ar83[23]7 statements in ar8xxx_phy_config_init] Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38952
* generic: ar8216: allow to specify SGMII config via platform dataGabor Juhos2013-05-301-0/+6
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 36798
* generic: ar8216: add port mirroringLuka Perkov2013-05-241-0/+8
| | | | | | | | | | | | | | | Tested on Buffalo WZR-600DHP with ar8316 switch. Commands used to mirror both RX and TX traffic from LAN port 1 to LAN port 4: $ swconfig dev switch0 set enable_mirror_rx 1 $ swconfig dev switch0 set enable_mirror_tx 1 $ swconfig dev switch0 set mirror_monitor_port 4 $ swconfig dev switch0 set mirror_source_port 1 Signed-off-by: Colin Leitner <colin.leitner@googlemail.com> Tested-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 36713
* generic: ar8216: add defines for the AR8316 POSTRIP registerGabor Juhos2013-02-101-0/+30
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35539
* generic: ar8216: add sgmii_delay_en field to ar8327_platform_dataGabor Juhos2012-12-251-0/+1
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34881
* generic: ar8216: add MIB counter support for the AR8216 switch as wellGabor Juhos2012-11-181-0/+40
| | | | | | | | Thanks to Jonas Gorski for the reference URL. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34245
* generic: ar8216: rename AR8216_*_STATS_* definesGabor Juhos2012-11-181-42/+42
| | | | | | | | | | | The names are misleading, those are only valid from AR8236. The AR8216 chip uses different offsets. Thanks to Jonas Gorski for the report. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34244
* generic ar8216: allow to read/reset MIB counters via swconfigGabor Juhos2012-11-181-0/+61
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34243
* generic: ar8216: allow to configure AR8327 LEDs via platform dataGabor Juhos2012-06-191-0/+2
| | | | SVN-Revision: 32456
* generic: ar8216: add revision specific PHY fixups for AR8327Gabor Juhos2012-05-291-0/+2
| | | | SVN-Revision: 32000
* generic: ar8216: replace chip_type field with chip_{ver,rev} in ar8216_privGabor Juhos2012-05-291-9/+0
| | | | SVN-Revision: 31999
* generic: ar8216: add support for the AR8327 chipGabor Juhos2012-03-181-0/+142
| | | | SVN-Revision: 31011
* kernel: ar8216: add support for the AR8236 switchGabor Juhos2011-11-121-1/+18
| | | | SVN-Revision: 28993
* rename target/linux/generic-2.6 to genericFelix Fietkau2010-06-261-0/+187
SVN-Revision: 21952