|
46 | 46 | #define ALE_UNKNOWNVLAN_FORCE_UNTAG_EGRESS 0x9C
|
47 | 47 | #define ALE_VLAN_MASK_MUX(reg) (0xc0 + (0x4 * (reg)))
|
48 | 48 |
|
| 49 | +#define ALE_POLICER_PORT_OUI 0x100 |
| 50 | +#define ALE_POLICER_DA_SA 0x104 |
| 51 | +#define ALE_POLICER_VLAN 0x108 |
| 52 | +#define ALE_POLICER_ETHERTYPE_IPSA 0x10c |
| 53 | +#define ALE_POLICER_IPDA 0x110 |
| 54 | +#define ALE_POLICER_PIR 0x118 |
| 55 | +#define ALE_POLICER_CIR 0x11c |
| 56 | +#define ALE_POLICER_TBL_CTL 0x120 |
| 57 | +#define ALE_POLICER_CTL 0x124 |
| 58 | +#define ALE_POLICER_TEST_CTL 0x128 |
| 59 | +#define ALE_POLICER_HIT_STATUS 0x12c |
| 60 | +#define ALE_THREAD_DEF 0x134 |
| 61 | +#define ALE_THREAD_CTL 0x138 |
| 62 | +#define ALE_THREAD_VAL 0x13c |
| 63 | + |
| 64 | +#define ALE_POLICER_TBL_WRITE_ENABLE BIT(31) |
| 65 | +#define ALE_POLICER_TBL_INDEX_MASK GENMASK(4, 0) |
| 66 | + |
49 | 67 | #define AM65_CPSW_ALE_THREAD_DEF_REG 0x134
|
50 | 68 |
|
51 | 69 | /* ALE_AGING_TIMER */
|
@@ -1306,6 +1324,74 @@ static const struct reg_field ale_fields_cpsw_nu[] = {
|
1306 | 1324 | /* CPSW_ALE_STATUS_REG */
|
1307 | 1325 | [ALE_ENTRIES] = REG_FIELD(ALE_STATUS, 0, 7),
|
1308 | 1326 | [ALE_POLICERS] = REG_FIELD(ALE_STATUS, 8, 15),
|
| 1327 | + /* CPSW_ALE_POLICER_PORT_OUI_REG */ |
| 1328 | + [POL_PORT_MEN] = REG_FIELD(ALE_POLICER_PORT_OUI, 31, 31), |
| 1329 | + [POL_TRUNK_ID] = REG_FIELD(ALE_POLICER_PORT_OUI, 30, 30), |
| 1330 | + [POL_PORT_NUM] = REG_FIELD(ALE_POLICER_PORT_OUI, 25, 25), |
| 1331 | + [POL_PRI_MEN] = REG_FIELD(ALE_POLICER_PORT_OUI, 19, 19), |
| 1332 | + [POL_PRI_VAL] = REG_FIELD(ALE_POLICER_PORT_OUI, 16, 18), |
| 1333 | + [POL_OUI_MEN] = REG_FIELD(ALE_POLICER_PORT_OUI, 15, 15), |
| 1334 | + [POL_OUI_INDEX] = REG_FIELD(ALE_POLICER_PORT_OUI, 0, 5), |
| 1335 | + |
| 1336 | + /* CPSW_ALE_POLICER_DA_SA_REG */ |
| 1337 | + [POL_DST_MEN] = REG_FIELD(ALE_POLICER_DA_SA, 31, 31), |
| 1338 | + [POL_DST_INDEX] = REG_FIELD(ALE_POLICER_DA_SA, 16, 21), |
| 1339 | + [POL_SRC_MEN] = REG_FIELD(ALE_POLICER_DA_SA, 15, 15), |
| 1340 | + [POL_SRC_INDEX] = REG_FIELD(ALE_POLICER_DA_SA, 0, 5), |
| 1341 | + |
| 1342 | + /* CPSW_ALE_POLICER_VLAN_REG */ |
| 1343 | + [POL_OVLAN_MEN] = REG_FIELD(ALE_POLICER_VLAN, 31, 31), |
| 1344 | + [POL_OVLAN_INDEX] = REG_FIELD(ALE_POLICER_VLAN, 16, 21), |
| 1345 | + [POL_IVLAN_MEN] = REG_FIELD(ALE_POLICER_VLAN, 15, 15), |
| 1346 | + [POL_IVLAN_INDEX] = REG_FIELD(ALE_POLICER_VLAN, 0, 5), |
| 1347 | + |
| 1348 | + /* CPSW_ALE_POLICER_ETHERTYPE_IPSA_REG */ |
| 1349 | + [POL_ETHERTYPE_MEN] = REG_FIELD(ALE_POLICER_ETHERTYPE_IPSA, 31, 31), |
| 1350 | + [POL_ETHERTYPE_INDEX] = REG_FIELD(ALE_POLICER_ETHERTYPE_IPSA, 16, 21), |
| 1351 | + [POL_IPSRC_MEN] = REG_FIELD(ALE_POLICER_ETHERTYPE_IPSA, 15, 15), |
| 1352 | + [POL_IPSRC_INDEX] = REG_FIELD(ALE_POLICER_ETHERTYPE_IPSA, 0, 5), |
| 1353 | + |
| 1354 | + /* CPSW_ALE_POLICER_IPDA_REG */ |
| 1355 | + [POL_IPDST_MEN] = REG_FIELD(ALE_POLICER_IPDA, 31, 31), |
| 1356 | + [POL_IPDST_INDEX] = REG_FIELD(ALE_POLICER_IPDA, 16, 21), |
| 1357 | + |
| 1358 | + /* CPSW_ALE_POLICER_TBL_CTL_REG */ |
| 1359 | + /** |
| 1360 | + * REG_FIELDS not defined for this as fields cannot be correctly |
| 1361 | + * used independently |
| 1362 | + */ |
| 1363 | + |
| 1364 | + /* CPSW_ALE_POLICER_CTL_REG */ |
| 1365 | + [POL_EN] = REG_FIELD(ALE_POLICER_CTL, 31, 31), |
| 1366 | + [POL_RED_DROP_EN] = REG_FIELD(ALE_POLICER_CTL, 29, 29), |
| 1367 | + [POL_YELLOW_DROP_EN] = REG_FIELD(ALE_POLICER_CTL, 28, 28), |
| 1368 | + [POL_YELLOW_THRESH] = REG_FIELD(ALE_POLICER_CTL, 24, 26), |
| 1369 | + [POL_POL_MATCH_MODE] = REG_FIELD(ALE_POLICER_CTL, 22, 23), |
| 1370 | + [POL_PRIORITY_THREAD_EN] = REG_FIELD(ALE_POLICER_CTL, 21, 21), |
| 1371 | + [POL_MAC_ONLY_DEF_DIS] = REG_FIELD(ALE_POLICER_CTL, 20, 20), |
| 1372 | + |
| 1373 | + /* CPSW_ALE_POLICER_TEST_CTL_REG */ |
| 1374 | + [POL_TEST_CLR] = REG_FIELD(ALE_POLICER_TEST_CTL, 31, 31), |
| 1375 | + [POL_TEST_CLR_RED] = REG_FIELD(ALE_POLICER_TEST_CTL, 30, 30), |
| 1376 | + [POL_TEST_CLR_YELLOW] = REG_FIELD(ALE_POLICER_TEST_CTL, 29, 29), |
| 1377 | + [POL_TEST_CLR_SELECTED] = REG_FIELD(ALE_POLICER_TEST_CTL, 28, 28), |
| 1378 | + [POL_TEST_ENTRY] = REG_FIELD(ALE_POLICER_TEST_CTL, 0, 4), |
| 1379 | + |
| 1380 | + /* CPSW_ALE_POLICER_HIT_STATUS_REG */ |
| 1381 | + [POL_STATUS_HIT] = REG_FIELD(ALE_POLICER_HIT_STATUS, 31, 31), |
| 1382 | + [POL_STATUS_HIT_RED] = REG_FIELD(ALE_POLICER_HIT_STATUS, 30, 30), |
| 1383 | + [POL_STATUS_HIT_YELLOW] = REG_FIELD(ALE_POLICER_HIT_STATUS, 29, 29), |
| 1384 | + |
| 1385 | + /* CPSW_ALE_THREAD_DEF_REG */ |
| 1386 | + [ALE_DEFAULT_THREAD_EN] = REG_FIELD(ALE_THREAD_DEF, 15, 15), |
| 1387 | + [ALE_DEFAULT_THREAD_VAL] = REG_FIELD(ALE_THREAD_DEF, 0, 5), |
| 1388 | + |
| 1389 | + /* CPSW_ALE_THREAD_CTL_REG */ |
| 1390 | + [ALE_THREAD_CLASS_INDEX] = REG_FIELD(ALE_THREAD_CTL, 0, 4), |
| 1391 | + |
| 1392 | + /* CPSW_ALE_THREAD_VAL_REG */ |
| 1393 | + [ALE_THREAD_ENABLE] = REG_FIELD(ALE_THREAD_VAL, 15, 15), |
| 1394 | + [ALE_THREAD_VALUE] = REG_FIELD(ALE_THREAD_VAL, 0, 5), |
1309 | 1395 | };
|
1310 | 1396 |
|
1311 | 1397 | static const struct cpsw_ale_dev_id cpsw_ale_id_match[] = {
|
|
0 commit comments