diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2020-09-30 01:27:26 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-29 18:26:24 -0700 |
commit | 2096805497e2bd21df3c26bd48c43ff0ce954316 (patch) | |
tree | e3e5e653e705ff763c1a8df0dc85f5892f55832b /include/soc/mscc/ocelot.h | |
parent | e3aea296d86f0f2166f4ddc5e1325217f847e722 (diff) |
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>
Diffstat (limited to 'include/soc/mscc/ocelot.h')
-rw-r--r-- | include/soc/mscc/ocelot.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index b0a9efce8813..0c40122dcb88 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -523,6 +523,17 @@ enum { VCAP_CACHE_ACTION_DAT, VCAP_CACHE_CNT_DAT, VCAP_CACHE_TG_DAT, + /* VCAP_CONST */ + VCAP_CONST_VCAP_VER, + VCAP_CONST_ENTRY_WIDTH, + VCAP_CONST_ENTRY_CNT, + VCAP_CONST_ENTRY_SWCNT, + VCAP_CONST_ENTRY_TG_WIDTH, + VCAP_CONST_ACTION_DEF_CNT, + VCAP_CONST_ACTION_WIDTH, + VCAP_CONST_CNT_WIDTH, + VCAP_CONST_CORE_CNT, + VCAP_CONST_IF_CNT, }; enum ocelot_ptp_pins { @@ -621,7 +632,7 @@ struct ocelot { struct list_head multicast; struct ocelot_vcap_block block; - const struct vcap_props *vcap; + struct vcap_props *vcap; /* Workqueue to check statistics for overflow with its lock */ struct mutex stats_lock; |