Commit Graph

365 Commits (39d0b8fea8c8731fb6829f8568edaec80bdf44db)

Author SHA1 Message Date
Felix Fietkau 1cbf0fbcb4 ar8216: factor out AR8327/AR8337-specific driver code into ar8327.c
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
10 years ago
Felix Fietkau cc02d4c72d ar8216: move definitions from ar8216.c to ar8216.h and introduce ar8327.h
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
10 years ago
Felix Fietkau baa3a38ac6 kernel: add mtd split support for trx images
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43809
10 years ago
Felix Fietkau cc5f89c66a kernel: add a mtdsplit implementation for tp-link firmware headers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43806
10 years ago
Felix Fietkau 4153c0adff kernel: move mtdsplit files to drivers/mtd/mtdsplit/ to simplify maintenance, unify patches across kernel versions
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43805
10 years ago
Felix Fietkau 5506420980 kernel: remove openwrt micrel.c (replaced by upstream driver)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43762
10 years ago
Luka Perkov 0847247129 mvsw6171: note support for 88E6172 switches
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
10 years ago
Felix Fietkau 2f9b042d69 ar8216: Inline function ar8xxx_create_mii
Inline function ar8xxx_create_mii.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

SVN-Revision: 43743
10 years ago
Felix Fietkau 2289c7a010 ar8216: Remove read/write/rmw member functions from ar8xxx_priv
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
10 years ago
Felix Fietkau 45a494b808 ar8216: Create helpers mii_read32 / mii_write32 for 32 bit MII ops
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
10 years ago
Felix Fietkau 0e7f844c66 ar8216: Factor out chip-specific parameters from ar8xxx_probe_switch
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
10 years ago
Felix Fietkau 054767cebc ar8216: remove unused function parameter in ar8327_led_register
Remove unused function parameter in ar8327_led_register.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

SVN-Revision: 43739
10 years ago
Felix Fietkau 5b16fd1bf8 ar8216: enable cpu port to receive arp and broadcast frames for ar8236
Signed-off-by: Weijie Gao <hackpascal@gmail.com>

SVN-Revision: 43668
10 years ago
John Crispin 9b5f583906 kernel: add driver for Marvell 88E6171 switch
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
10 years ago
John Crispin ecd27db757 ar8216: factor out reg_port_stats_base parameters to ar8xxx_chip
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
10 years ago
John Crispin ae15531bd2 ar8216: factor out mii_lo_first to ar8xxx_chip
Factor out mii_lo_first to ar8xxx_chip.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

SVN-Revision: 43470
10 years ago
John Crispin ea9324f3d3 ar8216: factor out chip-specific data structures from ar8xxx_priv
Factor out chip-specific data structures from ar8xxx_priv.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

SVN-Revision: 43469
10 years ago
John Crispin a3b651635f ar8216: factor out set_mirror_regs to ar8xxx_chip
Factor out set_mirror_regs to ar8xxx_chip.
Remove related chip_is_... checks.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

SVN-Revision: 43468
10 years ago
John Crispin b82a08f5b6 ar8216: factor out mib_func to ar8xxx_chip
Factor out mib_func to ar8xxx_chip. Remove related chip_is_... checks.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

SVN-Revision: 43467
10 years ago
John Crispin af003867b1 ar8216: factor out info whether switch should be configured at probe stage 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
10 years ago
Felix Fietkau 14db2826ad ar8216: suppress PHY reset for linux 3.14
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43410
10 years ago
Felix Fietkau 35902404fc ar8216: Fix issue with autoneg being disabled under 3.14, revert 43332
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
10 years ago
Felix Fietkau c9340fd8a9 ar8216: Use generic hw_init from ar8236 for ar8216 too
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
10 years ago
Felix Fietkau 0178b516a2 ar8216: simplify PHY fixup/init
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
10 years ago
Felix Fietkau 43e3e88379 ar8216: use genphy_config_aneg also for PHY 0
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
10 years ago
Felix Fietkau 898712f43f ar8216: factor out PHY init code into a generic function
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
10 years ago
Felix Fietkau 20baeb5595 ar8216: introduce fixup_phys callback in ar8xxx_chip
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
10 years ago
Felix Fietkau 37fefea79b ar8216: after a switch reset poll until BCMR_RESET is cleared
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
10 years ago
Felix Fietkau 6dcdc2bb05 ar8216: introduce global constant for number of PHYs
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
10 years ago
John Crispin 76a54a424c ar8216: fix "unused variable" compiler warning
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
10 years ago
John Crispin 2c72ffc154 ar71xx: add support for Netgear WNR2000v4
Signed-off-by: Michaël Burtin <mburtin@gmail.com>

SVN-Revision: 43173
10 years ago
John Crispin 62107ff367 swconfig: last vs tail
sorry .....

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43107
10 years ago
John Crispin ab5d70e046 swconfig: "swconfig list" shows devices in reverse order
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
10 years ago
Felix Fietkau 156b296b20 ar8216: set the pvid based on runtime state instead of port number to fix learning with enable_vlan = 0
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 42753
10 years ago
Felix Fietkau 38a8f5ae63 ar71xx: ar8216: tagged+untagged on ar8327 (#12181)
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
10 years ago
Felix Fietkau 1c675ee9be ar71xx: ar8216: move policies, pvid to setup_port
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
10 years ago
John Crispin c9813699b6 kernel: add own Kconfig for OpenWrt mtdsplit drivers
There are pretty many OpenWrt patches against mtd subsystem resulting
in a bit of mess and growing maintenance cost.
My idea is to use an extra "mtdsplit" directory with OpenWrt specific
files (including Kconfig).
This is the first step to achieve this. This patch adds a "mtdsplit"
directory with Kconfig and replaces 4 patches with a single one.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 42287
10 years ago
John Crispin de5fd0a189 ar8216: add new phyid 0x004dd043 (ar8326)
Used in ubiquity nanostation xw boards

SVN-Revision: 41635
10 years ago
Felix Fietkau a17a58e310 ar8216: disable EEE by default on AR8327 to fix stability issues (#14597)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41577
10 years ago
Hauke Mehrtens ed0dc1c97e b53: hardcode reset GPIO for Linksys WRT300N 1.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
10 years ago
Hauke Mehrtens 286ff7e322 adm6996: the GPIO interface for the adm6996l does not support switch statistics.
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
10 years ago
Imre Kaloz e1de4e27c1 coding style cleanups, drop old kernel support
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>

SVN-Revision: 41293
10 years ago
Jo-Philipp Wich f6e7074924 Revert "ar71xx: Fix tagged+untagged operation on AR8327N (#12181)"
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
10 years ago
Felix Fietkau 8513629e3e mac80211: update to wireless-testing 2014-05-19
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40800
10 years ago
Jo-Philipp Wich 443b2dfe3c ar71xx: Fix tagged+untagged operation on AR8327N (#12181)
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
10 years ago
Hauke Mehrtens 100e795bcc kernel: fix warning in swconfig.c with kernel 3.14
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 40733
10 years ago
Hauke Mehrtens c09007c1af kernel/generic: modify mtd related patches for 3.14
Function register_mtd_parser always returned 0 (at least since v3.3)
before being changed to return void in v3.14-rc1~65^2~93 (mtd: make
register_mtd_parser return void), so it's not needed to check the
return value of this function. Also add __init flag to caller.

This fix compile errors in 3.14 kernel like:
drivers/mtd/mtdsplit_seama.c: In function 'mtdsplit_seama_init':
drivers/mtd/mtdsplit_seama.c:99:2: error: void value not ignored as it ought to be
  return register_mtd_parser(&mtdsplit_seama_parser);
  ^

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>

SVN-Revision: 40731
10 years ago
John Crispin 1b96cf30a9 linux/generic: add MIB counters and port status to ADM6996 switch
This patch adds port status information and MIB counters to the ADM6996
switch driver.

The driver supports also the older ADM6996L-variant, but I'm not able to
test this patch on that chip. According to the datasheet the same
registers exist there as well, so I think it should work, but any
feedback is appreciated.

Signed-off-by: Matti Laakso <malaakso at elisanet.fi>

SVN-Revision: 40542
10 years ago
John Crispin 3972b47458 revert: kernel: rtl8306: fix max pvid & remove port isolation
apparently this one was nt a good idea to merge

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 40330
10 years ago
John Crispin deba38f2a7 kernel: rtl8306: fix vlan support on lantiq ar9 p2601hnfx
If the CPU port is not forced up, the link, at least on this board, is lost after
changes are applied. This makes sure that the link is restored. Regression tests
should confirm it doesn't break other boards.

Signed-off-by: Antonios Vamporakis <ant@area128.com>

SVN-Revision: 40305
10 years ago