Commit Graph

352 Commits (a10a204aab26ccec266cd09fa94110a61293fdd9)

Author SHA1 Message Date
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
John Crispin 72cdb34ae8 kernel: rtl8306: fix max pvid & remove port isolation
- hide port pvid - vlan index relation
- switch initialises with vlans disabled so port isolation is not used
- remove special treatment of cpu port

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

SVN-Revision: 40304
10 years ago
John Crispin 6a72dc4082 kernel: rtl8306: cosmetic changes for swconfig
Changes to:
- show the correct "enable_vlan" value under "Global attributes"
- show tagged ports under "Vlan: ports"
- use get_port_link method to report link status

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

SVN-Revision: 40303
10 years ago
Jonas Gorski c1f397e1e1 b53: Make b53_switch_init static
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Patchwork: http://patchwork.openwrt.org/patch/4869/
Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 39683
11 years ago
Jonas Gorski 9eb60826f2 b53: Add BCM53128 switch support
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Patchwork: http://patchwork.openwrt.org/patch/4867/
Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 39682
11 years ago
Luka Perkov cde033f918 kernel: rtl8306: update reset function
Signed-off-by: Antonios Vamporakis <ant@area128.com>

SVN-Revision: 39589
11 years ago
Gabor Juhos 7c137c187f ar71xx: swconfig: use the local helper to set LED brightness on link down
Use the 'swconfig_trig_set_brightness' function to set
the brightness value of the LED when the link goes down.
This ensures that the last brighness value is saved into
a local variable which is used to track the actual LED
status.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39402
11 years ago
Gabor Juhos 89d60314e7 kernel/3.1x: add split code for LZMA compressed kernel based firmwares
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39387
11 years ago
Gabor Juhos e89476e0a8 Revert "kernel: create firmware partition from MyLoader partition parser"
This reverts r38197.

The automatically created firmware partition includes
the partition_table partition. Apart from the partition
table, this partition contains sensitive data on some
Compex devices which data can be destroyed when the
firmware partition gets modified. Revert the change to
prevent that.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39382
11 years ago
Zoltan Herpai f3c07b8621 modules: swconfig.c: update the error path on 3.13, and behave nicely with return
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>

SVN-Revision: 39360
11 years ago
Zoltan Herpai 4d26250db1 modules: update swconfig.c to compile on 3.13 (compile-tested)
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>

SVN-Revision: 39359
11 years ago
Jonas Gorski d5b4292032 kernel: ocf: add missing dependency for hifn driver
The HIFN driver is a PCI driver, thus requires PCI support to be enabled
to compile. Therefore let it depend on PCI..

Should fix mvebu builds.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 39357
11 years ago
Hauke Mehrtens 1f4e6394ed b53: use drvdata to store driver data
we should not abuse the platform_data pointer.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 39354
11 years ago
Hauke Mehrtens de266cd1c1 b53: make b53_switch_reset_gpio() static
SVN-Revision: 39353
11 years ago