net: mscc: ocelot: convert port registers to regmap
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 13 Jul 2020 16:57:01 +0000 (19:57 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Jul 2020 00:40:01 +0000 (17:40 -0700)
commit91c724cfc0cbc049f18c04634ad56080650e93b8
treec74b40a862f2e499af91dcd489ab6c58c990346d
parent5d037b4d3df7b77ecd22fa8e10f5000bdc42cc8b
net: mscc: ocelot: convert port registers to regmap

At the moment, there are some minimal register differences between
VSC7514 Ocelot and VSC9959 Felix. To be precise, the PCS1G registers are
missing from Felix because it was integrated with an NXP PCS.

But with VSC9953 Seville (not yet introduced), the register differences
are more pronounced.  The MAC registers are located at different offsets
within the DEV_GMII target. So we need to refactor the driver to keep a
regmap even for per-port registers. The callers of the ocelot_port_readl
and ocelot_port_writel were kept unchanged, only the implementation is
now more generic.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c
drivers/net/dsa/ocelot/felix_vsc9959.c
drivers/net/ethernet/mscc/ocelot.h
drivers/net/ethernet/mscc/ocelot_io.c
drivers/net/ethernet/mscc/ocelot_net.c
drivers/net/ethernet/mscc/ocelot_vsc7514.c
include/soc/mscc/ocelot.h
include/soc/mscc/ocelot_dev.h