net: enetc: implement software lockstep for port MAC registers
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 19 Jan 2023 16:04:30 +0000 (18:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Jan 2023 13:13:09 +0000 (13:13 +0000)
commit12717decb570ea457b2baa5ad36758c0c967c306
tree8751a482634e02ea0e2c0f4dc45192bdae29e23c
parent219355f1b093526fc980a202e4d48e8469c9a29c
net: enetc: implement software lockstep for port MAC registers

Currently the enetc driver duplicates its writes to the PM0 registers
also to PM1, but it doesn't do this consistently - for example we write
to ENETC_PM0_MAXFRM but not to ENETC_PM1_MAXFRM.

Create enetc_port_mac_wr() which writes both the PM0 and PM1 register
with the same value (if frame preemption is supported on this port).
Also create enetc_port_mac_rd() which reads from PM0 - the assumption
being that PM1 contains just the same value.

This will be necessary when we enable the MAC Merge layer properly, and
the pMAC becomes operational.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/freescale/enetc/enetc.h
drivers/net/ethernet/freescale/enetc/enetc_hw.h
drivers/net/ethernet/freescale/enetc/enetc_pf.c