]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: fix non-initialized CPU port on VSC7514
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 22 Jul 2020 08:08:57 +0000 (11:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jul 2020 20:02:09 +0000 (13:02 -0700)
commit4830315c7291c5533cc7efbafd64c56d9ca7528e
treed0d42b578dcad4f9e69dbfde6cc6c28dfec66f0b
parent71a58e68fd2901dd6f356ad4d5c17c8e0d2cfc45
net: mscc: ocelot: fix non-initialized CPU port on VSC7514

The VSC7514 is marketed as a 10-port switch, however it has 11 physical
ports (0->10) in the block diagram:
https://www.microsemi.com/product-directory/ethernet-switches/3992-vsc7514
(also in the device tree at arch/mips/boot/dts/mscc/ocelot.dtsi)

Additionally, by architecture it has one more entry in the analyzer
block, situated right after the physical ports, for the CPU port module.
This is not a physical port, it only represents a channel for frame
injection and extraction. That entry for the CPU port is at index 11 in
the analyzer.

When the register groups for QSYS_SWITCH_PORT_MODE, SYS_PORT_MODE and
SYS_PAUSE_CFG are declared to be replicated 11 times, the 11th entry in
the array of regfields is not initialized, so the CPU port module is not
initialized either.

The documentation of QSYS_SWITCH_PORT_MODE for VSC7514 also says that
this register group is replicated 12 times, so this patch is simply
reflecting that and not introducing any further inconsistency.

Fixes: c3f374ed3f1a ("net: mscc: ocelot: convert QSYS_SWITCH_PORT_MODE and SYS_PORT_MODE to regfields")
Fixes: 8136328a61ce ("net: mscc: ocelot: convert SYS_PAUSE_CFG register access to regfield")
Reported-by: Bryan Whitehead <bryan.whitehead@microchip.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot_vsc7514.c