OSDN Git Service

staging: mt7621-eth: add gigabit switch driver (GSW)
authorJohn Crispin <blogic@openwrt.org>
Wed, 14 Mar 2018 20:22:36 +0000 (07:22 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 18:56:02 +0000 (19:56 +0100)
commitf079b640634853419809104907e07365ad9fd272
tree3ddbd50b7ee9c9595229a9f5e40df38d56c8e000
parente3cbf478f846374537941895182cd1aaf16dcb91
staging: mt7621-eth: add gigabit switch driver (GSW)

The GSW is found in all of the 1000mbit SoCs. it has 5 external ports,
1-2 cpu ports and 1 further port that the internal HW offloading engine
connects to. The switch core used is a MT7530, which also exists as a
standalone chip. Although these SoCs (mt7620/1/3) share the same switch
core, the bring up of these is slightly different. One of the reasons is
that on mt7620 the switch core is mmio mapped while MT7621/3 talks to the
switch via MDIO addr 0x1f. Additionally, the SoCs have different MAC types
and some of them have TRGMII support. MT7621 can do 1,2gbit and MT7623 is
able to do 2,6gbit. The support for the TRGMII bring up is not part of this
series as the code is based on the SDK driver and has between 1500 and 2000
magic values that still need to be converted to defines.

Because of these differences we have 3 separate drivers for these 3 SoCs.
These drivers are very basic and only provides basic init and irq support.

The SoC and switch core both have support for a special tag making DSA
support possible.

NeilBrown:
 - added setting to mt7621_hw_init to match working code from libreCMC
 This needs to be converted to use switchdev.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-eth/TODO
drivers/staging/mt7621-eth/gsw_mt7620.h [new file with mode: 0644]
drivers/staging/mt7621-eth/gsw_mt7621.c [new file with mode: 0644]