diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-01-15 03:11:12 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-16 05:02:34 +0100 |
commit | 703b762190e643bf46a048ebe99504b14d71449c (patch) | |
tree | d378d88772977df7f7f7e42b516b21e1f1b67dbe /include/soc/mscc/ocelot_qsys.h | |
parent | net: mscc: ocelot: auto-detect packet buffer size and number of frame references (diff) | |
download | linux-703b762190e643bf46a048ebe99504b14d71449c.tar.xz linux-703b762190e643bf46a048ebe99504b14d71449c.zip |
net: mscc: ocelot: add ops for decoding watermark threshold and occupancy
We'll need to read back the watermark thresholds and occupancy from
hardware (for devlink-sb integration), not only to write them as we did
so far in ocelot_port_set_maxlen. So introduce 2 new functions in struct
ocelot_ops, similar to wm_enc, and implement them for the 3 supported
mscc_ocelot switches.
Remove the INUSE and MAXUSE unpacking helpers for the QSYS_RES_STAT
register, because that doesn't scale with the number of switches that
mscc_ocelot supports now. They have different bit widths for the
watermarks, and we need function pointers to abstract that difference
away.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/soc/mscc/ocelot_qsys.h')
-rw-r--r-- | include/soc/mscc/ocelot_qsys.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/soc/mscc/ocelot_qsys.h b/include/soc/mscc/ocelot_qsys.h index b7b263a19068..9731895be643 100644 --- a/include/soc/mscc/ocelot_qsys.h +++ b/include/soc/mscc/ocelot_qsys.h @@ -71,12 +71,6 @@ #define QSYS_RES_STAT_GSZ 0x8 -#define QSYS_RES_STAT_INUSE(x) (((x) << 12) & GENMASK(23, 12)) -#define QSYS_RES_STAT_INUSE_M GENMASK(23, 12) -#define QSYS_RES_STAT_INUSE_X(x) (((x) & GENMASK(23, 12)) >> 12) -#define QSYS_RES_STAT_MAXUSE(x) ((x) & GENMASK(11, 0)) -#define QSYS_RES_STAT_MAXUSE_M GENMASK(11, 0) - #define QSYS_MMGT_EQ_CTRL_FP_FREE_CNT(x) ((x) & GENMASK(15, 0)) #define QSYS_MMGT_EQ_CTRL_FP_FREE_CNT_M GENMASK(15, 0) |