]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: ethernet: ti: ale: add support for multi port k3 cpsw versions
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 10 Sep 2020 20:28:07 +0000 (23:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Sep 2020 00:34:39 +0000 (17:34 -0700)
The TI J721E (CPSW9g) ALE version is similar, in general, to Sitara AM3/4/5
CPSW ALE, but has more extended functions and different ALE VLAN entry
format.

This patch adds support for for multi port TI J721E (CPSW9g) ALE variant.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw_ale.c

index 0dd0c3329deef9e8e6b4e0c3149d7a4c3ad2ed8b..a6a455c326288d0c7beb9490e9b2ea152a26f05d 100644 (file)
@@ -191,6 +191,14 @@ static const struct ale_entry_fld vlan_entry_nu[ALE_ENT_VID_LAST] = {
        ALE_ENTRY_FLD(ALE_ENT_VID_REG_MCAST_IDX, 44, 3),
 };
 
+/* K3 j721e/j7200 cpsw9g/5g, am64x cpsw3g  */
+static const struct ale_entry_fld vlan_entry_k3_cpswxg[] = {
+       ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_MEMBER_LIST, 0),
+       ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_UNREG_MCAST_MSK, 12),
+       ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_FORCE_UNTAGGED_MSK, 24),
+       ALE_ENTRY_FLD_DYN_MSK_SIZE(ALE_ENT_VID_REG_MCAST_MSK, 36),
+};
+
 DEFINE_ALE_FIELD(entry_type,           60,     2)
 DEFINE_ALE_FIELD(vlan_id,              48,     12)
 DEFINE_ALE_FIELD(mcast_state,          62,     2)
@@ -1213,6 +1221,12 @@ static const struct cpsw_ale_dev_id cpsw_ale_id_match[] = {
                .nu_switch_ale = true,
                .vlan_entry_tbl = vlan_entry_nu,
        },
+       {
+               .dev_id = "j721e-cpswxg",
+               .features = CPSW_ALE_F_STATUS_REG | CPSW_ALE_F_HW_AUTOAGING,
+               .major_ver_mask = 0x7,
+               .vlan_entry_tbl = vlan_entry_k3_cpswxg,
+       },
        { },
 };