summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mt7530.h
diff options
context:
space:
mode:
authorDENG Qingfang <dqfext@gmail.com>2020-12-08 08:00:28 +0100
committerDavid S. Miller <davem@davemloft.net>2020-12-09 01:18:26 +0100
commitea6d5c924e391872d402acac38461a5f8261e57f (patch)
treecdb6a7616c7c210c464268b32e9429368335bbea /drivers/net/dsa/mt7530.h
parentMerge branch 'GVE-Raw-Addressing' (diff)
downloadlinux-ea6d5c924e391872d402acac38461a5f8261e57f.tar.xz
linux-ea6d5c924e391872d402acac38461a5f8261e57f.zip
net: dsa: mt7530: support setting ageing time
MT7530 has a global address age control register, so use it to set ageing time. The applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds Signed-off-by: DENG Qingfang <dqfext@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mt7530.h')
-rw-r--r--drivers/net/dsa/mt7530.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
index ee3523a7537e..32d8969b3ace 100644
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -161,6 +161,19 @@ enum mt7530_vlan_egress_attr {
MT7530_VLAN_EGRESS_STACK = 3,
};
+/* Register for address age control */
+#define MT7530_AAC 0xa0
+/* Disable ageing */
+#define AGE_DIS BIT(20)
+/* Age count */
+#define AGE_CNT_MASK GENMASK(19, 12)
+#define AGE_CNT_MAX 0xff
+#define AGE_CNT(x) (AGE_CNT_MASK & ((x) << 12))
+/* Age unit */
+#define AGE_UNIT_MASK GENMASK(11, 0)
+#define AGE_UNIT_MAX 0xfff
+#define AGE_UNIT(x) (AGE_UNIT_MASK & (x))
+
/* Register for port STP state control */
#define MT7530_SSP_P(x) (0x2000 + ((x) * 0x100))
#define FID_PST(x) ((x) & 0x3)