]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: automatically detect VCAP constants
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 29 Sep 2020 22:27:26 +0000 (01:27 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Sep 2020 01:26:24 +0000 (18:26 -0700)
commitf6497cd67e095e5b8887bb41d896620260b95096
treee3e5e653e705ff763c1a8df0dc85f5892f55832b
parentb524c0bae3e0c73bc45dd5225ecf06932f4c3e4b
net: mscc: ocelot: automatically detect VCAP constants

The numbers in struct vcap_props are not intuitive to derive, because
they are not a straightforward copy-and-paste from the reference manual
but instead rely on a fairly detailed level of understanding of the
layout of an entry in the TCAM and in the action RAM. For this reason,
bugs are very easy to introduce here.

Ease the work of hardware porters and read from hardware the constants
that were exported for this particular purpose. Note that this implies
that struct vcap_props can no longer be const.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.h
drivers/net/dsa/ocelot/felix_vsc9959.c
drivers/net/dsa/ocelot/seville_vsc9953.c
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot_vcap.c
drivers/net/ethernet/mscc/ocelot_vcap.h
drivers/net/ethernet/mscc/ocelot_vsc7514.c
include/soc/mscc/ocelot.h
include/soc/mscc/ocelot_vcap.h