]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 3 Jan 2021 01:25:44 +0000 (02:25 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 4 Jan 2021 21:47:15 +0000 (13:47 -0800)
commit00d9655bfd9a8f3cc8497a3f15b73b54bd0a0d04
tree6c04fd751dd793327fff453663a6d1437d9cf89f
parent3a0ed845c01d0447b1d2754d44de4a9a5e9e08b8
net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access

There is one GSWIP_MII_CFG register for each switch-port except the CPU
port. The register offset for the first port is 0x0, 0x02 for the
second, 0x04 for the third and so on.

Update the driver to not only restrict the GSWIP_MII_CFG registers to
ports 0, 1 and 5. Handle ports 0..5 instead but skip the CPU port. This
means we are not overwriting the configuration for the third port (port
two since we start counting from zero) with the settings for the sixth
port (with number five) anymore.

The GSWIP_MII_PCDU(p) registers are not updated because there's really
only three (one for each of the following ports: 0, 1, 5).

Fixes: 1e1742476b63e3 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/lantiq_gswip.c