summaryrefslogtreecommitdiff
path: root/drivers/net/vsc9953.c
diff options
context:
space:
mode:
authorCodrin Ciubotariu <codrin.ciubotariu@freescale.com>2015-12-15 15:21:03 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2016-01-28 12:22:08 -0600
commitba389e65e5bb64506ad35b3d7007ec1b3b9cf4de (patch)
tree9c618d8d686bd123593aea1d5d78430983801242 /drivers/net/vsc9953.c
parent96979dc94c1743e63cc8cc62c955075e47b7187b (diff)
downloadu-boot-imx-ba389e65e5bb64506ad35b3d7007ec1b3b9cf4de.zip
u-boot-imx-ba389e65e5bb64506ad35b3d7007ec1b3b9cf4de.tar.gz
u-boot-imx-ba389e65e5bb64506ad35b3d7007ec1b3b9cf4de.tar.bz2
drivers: net: vsc9953: Fix FDB aging time
By default, the aging period is set to 0, so the dynamic FDB entries are never removed. This patch sets the aging time to 300 seconds. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/vsc9953.c')
-rw-r--r--drivers/net/vsc9953.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
index 7595db1..160f478 100644
--- a/drivers/net/vsc9953.c
+++ b/drivers/net/vsc9953.c
@@ -593,6 +593,25 @@ static void vsc9953_port_all_vlan_egress_untagged_set(
vsc9953_port_vlan_egr_untag_set(i, mode);
}
+static int vsc9953_autoage_time_set(int age_period)
+{
+ u32 autoage;
+ struct vsc9953_analyzer *l2ana_reg;
+
+ l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
+ VSC9953_ANA_OFFSET);
+
+ if (age_period < 0 || age_period > VSC9953_AUTOAGE_PERIOD_MASK)
+ return -EINVAL;
+
+ autoage = bitfield_replace_by_mask(in_le32(&l2ana_reg->ana.auto_age),
+ VSC9953_AUTOAGE_PERIOD_MASK,
+ age_period);
+ out_le32(&l2ana_reg->ana.auto_age, autoage);
+
+ return 0;
+}
+
#ifdef CONFIG_CMD_ETHSW
/* Enable/disable status of a VSC9953 port */
@@ -2107,6 +2126,10 @@ void vsc9953_default_configuration(void)
{
int i;
+ if (vsc9953_autoage_time_set(VSC9953_DEFAULT_AGE_TIME))
+ debug("VSC9953: failed to set AGE time to %d\n",
+ VSC9953_DEFAULT_AGE_TIME);
+
for (i = 0; i < VSC9953_MAX_VLAN; i++)
vsc9953_vlan_table_membership_all_set(i, 0);
vsc9953_port_all_vlan_aware_set(1);