16
16
#include <linux/pci.h>
17
17
#include "felix.h"
18
18
19
- #define VSC9959_VCAP_IS2_CNT 1024
20
- #define VSC9959_VCAP_IS2_ENTRY_WIDTH 376
21
- #define VSC9959_VCAP_PORT_CNT 6
22
19
#define VSC9959_TAS_GCL_ENTRY_MAX 63
23
20
24
21
static const u32 vsc9959_ana_regmap [] = {
@@ -138,14 +135,27 @@ static const u32 vsc9959_qs_regmap[] = {
138
135
REG_RESERVED (QS_INH_DBG ),
139
136
};
140
137
141
- static const u32 vsc9959_s2_regmap [] = {
142
- REG (S2_CORE_UPDATE_CTRL , 0x000000 ),
143
- REG (S2_CORE_MV_CFG , 0x000004 ),
144
- REG (S2_CACHE_ENTRY_DAT , 0x000008 ),
145
- REG (S2_CACHE_MASK_DAT , 0x000108 ),
146
- REG (S2_CACHE_ACTION_DAT , 0x000208 ),
147
- REG (S2_CACHE_CNT_DAT , 0x000308 ),
148
- REG (S2_CACHE_TG_DAT , 0x000388 ),
138
+ static const u32 vsc9959_vcap_regmap [] = {
139
+ /* VCAP_CORE_CFG */
140
+ REG (VCAP_CORE_UPDATE_CTRL , 0x000000 ),
141
+ REG (VCAP_CORE_MV_CFG , 0x000004 ),
142
+ /* VCAP_CORE_CACHE */
143
+ REG (VCAP_CACHE_ENTRY_DAT , 0x000008 ),
144
+ REG (VCAP_CACHE_MASK_DAT , 0x000108 ),
145
+ REG (VCAP_CACHE_ACTION_DAT , 0x000208 ),
146
+ REG (VCAP_CACHE_CNT_DAT , 0x000308 ),
147
+ REG (VCAP_CACHE_TG_DAT , 0x000388 ),
148
+ /* VCAP_CONST */
149
+ REG (VCAP_CONST_VCAP_VER , 0x000398 ),
150
+ REG (VCAP_CONST_ENTRY_WIDTH , 0x00039c ),
151
+ REG (VCAP_CONST_ENTRY_CNT , 0x0003a0 ),
152
+ REG (VCAP_CONST_ENTRY_SWCNT , 0x0003a4 ),
153
+ REG (VCAP_CONST_ENTRY_TG_WIDTH , 0x0003a8 ),
154
+ REG (VCAP_CONST_ACTION_DEF_CNT , 0x0003ac ),
155
+ REG (VCAP_CONST_ACTION_WIDTH , 0x0003b0 ),
156
+ REG (VCAP_CONST_CNT_WIDTH , 0x0003b4 ),
157
+ REG (VCAP_CONST_CORE_CNT , 0x0003b8 ),
158
+ REG (VCAP_CONST_IF_CNT , 0x0003bc ),
149
159
};
150
160
151
161
static const u32 vsc9959_qsys_regmap [] = {
@@ -359,7 +369,9 @@ static const u32 *vsc9959_regmap[TARGET_MAX] = {
359
369
[QSYS ] = vsc9959_qsys_regmap ,
360
370
[REW ] = vsc9959_rew_regmap ,
361
371
[SYS ] = vsc9959_sys_regmap ,
362
- [S2 ] = vsc9959_s2_regmap ,
372
+ [S0 ] = vsc9959_vcap_regmap ,
373
+ [S1 ] = vsc9959_vcap_regmap ,
374
+ [S2 ] = vsc9959_vcap_regmap ,
363
375
[PTP ] = vsc9959_ptp_regmap ,
364
376
[GCB ] = vsc9959_gcb_regmap ,
365
377
[DEV_GMII ] = vsc9959_dev_gmii_regmap ,
@@ -392,6 +404,16 @@ static const struct resource vsc9959_target_io_res[TARGET_MAX] = {
392
404
.end = 0x001ffff ,
393
405
.name = "sys" ,
394
406
},
407
+ [S0 ] = {
408
+ .start = 0x0040000 ,
409
+ .end = 0x00403ff ,
410
+ .name = "s0" ,
411
+ },
412
+ [S1 ] = {
413
+ .start = 0x0050000 ,
414
+ .end = 0x00503ff ,
415
+ .name = "s1" ,
416
+ },
395
417
[S2 ] = {
396
418
.start = 0x0060000 ,
397
419
.end = 0x00603ff ,
@@ -596,6 +618,112 @@ static const struct ocelot_stat_layout vsc9959_stats_layout[] = {
596
618
{ .offset = 0x111 , .name = "drop_green_prio_7" , },
597
619
};
598
620
621
+ static const struct vcap_field vsc9959_vcap_es0_keys [] = {
622
+ [VCAP_ES0_EGR_PORT ] = { 0 , 3 },
623
+ [VCAP_ES0_IGR_PORT ] = { 3 , 3 },
624
+ [VCAP_ES0_RSV ] = { 6 , 2 },
625
+ [VCAP_ES0_L2_MC ] = { 8 , 1 },
626
+ [VCAP_ES0_L2_BC ] = { 9 , 1 },
627
+ [VCAP_ES0_VID ] = { 10 , 12 },
628
+ [VCAP_ES0_DP ] = { 22 , 1 },
629
+ [VCAP_ES0_PCP ] = { 23 , 3 },
630
+ };
631
+
632
+ static const struct vcap_field vsc9959_vcap_es0_actions [] = {
633
+ [VCAP_ES0_ACT_PUSH_OUTER_TAG ] = { 0 , 2 },
634
+ [VCAP_ES0_ACT_PUSH_INNER_TAG ] = { 2 , 1 },
635
+ [VCAP_ES0_ACT_TAG_A_TPID_SEL ] = { 3 , 2 },
636
+ [VCAP_ES0_ACT_TAG_A_VID_SEL ] = { 5 , 1 },
637
+ [VCAP_ES0_ACT_TAG_A_PCP_SEL ] = { 6 , 2 },
638
+ [VCAP_ES0_ACT_TAG_A_DEI_SEL ] = { 8 , 2 },
639
+ [VCAP_ES0_ACT_TAG_B_TPID_SEL ] = { 10 , 2 },
640
+ [VCAP_ES0_ACT_TAG_B_VID_SEL ] = { 12 , 1 },
641
+ [VCAP_ES0_ACT_TAG_B_PCP_SEL ] = { 13 , 2 },
642
+ [VCAP_ES0_ACT_TAG_B_DEI_SEL ] = { 15 , 2 },
643
+ [VCAP_ES0_ACT_VID_A_VAL ] = { 17 , 12 },
644
+ [VCAP_ES0_ACT_PCP_A_VAL ] = { 29 , 3 },
645
+ [VCAP_ES0_ACT_DEI_A_VAL ] = { 32 , 1 },
646
+ [VCAP_ES0_ACT_VID_B_VAL ] = { 33 , 12 },
647
+ [VCAP_ES0_ACT_PCP_B_VAL ] = { 45 , 3 },
648
+ [VCAP_ES0_ACT_DEI_B_VAL ] = { 48 , 1 },
649
+ [VCAP_ES0_ACT_RSV ] = { 49 , 23 },
650
+ [VCAP_ES0_ACT_HIT_STICKY ] = { 72 , 1 },
651
+ };
652
+
653
+ static const struct vcap_field vsc9959_vcap_is1_keys [] = {
654
+ [VCAP_IS1_HK_TYPE ] = { 0 , 1 },
655
+ [VCAP_IS1_HK_LOOKUP ] = { 1 , 2 },
656
+ [VCAP_IS1_HK_IGR_PORT_MASK ] = { 3 , 7 },
657
+ [VCAP_IS1_HK_RSV ] = { 10 , 9 },
658
+ [VCAP_IS1_HK_OAM_Y1731 ] = { 19 , 1 },
659
+ [VCAP_IS1_HK_L2_MC ] = { 20 , 1 },
660
+ [VCAP_IS1_HK_L2_BC ] = { 21 , 1 },
661
+ [VCAP_IS1_HK_IP_MC ] = { 22 , 1 },
662
+ [VCAP_IS1_HK_VLAN_TAGGED ] = { 23 , 1 },
663
+ [VCAP_IS1_HK_VLAN_DBL_TAGGED ] = { 24 , 1 },
664
+ [VCAP_IS1_HK_TPID ] = { 25 , 1 },
665
+ [VCAP_IS1_HK_VID ] = { 26 , 12 },
666
+ [VCAP_IS1_HK_DEI ] = { 38 , 1 },
667
+ [VCAP_IS1_HK_PCP ] = { 39 , 3 },
668
+ /* Specific Fields for IS1 Half Key S1_NORMAL */
669
+ [VCAP_IS1_HK_L2_SMAC ] = { 42 , 48 },
670
+ [VCAP_IS1_HK_ETYPE_LEN ] = { 90 , 1 },
671
+ [VCAP_IS1_HK_ETYPE ] = { 91 , 16 },
672
+ [VCAP_IS1_HK_IP_SNAP ] = {107 , 1 },
673
+ [VCAP_IS1_HK_IP4 ] = {108 , 1 },
674
+ /* Layer-3 Information */
675
+ [VCAP_IS1_HK_L3_FRAGMENT ] = {109 , 1 },
676
+ [VCAP_IS1_HK_L3_FRAG_OFS_GT0 ] = {110 , 1 },
677
+ [VCAP_IS1_HK_L3_OPTIONS ] = {111 , 1 },
678
+ [VCAP_IS1_HK_L3_DSCP ] = {112 , 6 },
679
+ [VCAP_IS1_HK_L3_IP4_SIP ] = {118 , 32 },
680
+ /* Layer-4 Information */
681
+ [VCAP_IS1_HK_TCP_UDP ] = {150 , 1 },
682
+ [VCAP_IS1_HK_TCP ] = {151 , 1 },
683
+ [VCAP_IS1_HK_L4_SPORT ] = {152 , 16 },
684
+ [VCAP_IS1_HK_L4_RNG ] = {168 , 8 },
685
+ /* Specific Fields for IS1 Half Key S1_5TUPLE_IP4 */
686
+ [VCAP_IS1_HK_IP4_INNER_TPID ] = { 42 , 1 },
687
+ [VCAP_IS1_HK_IP4_INNER_VID ] = { 43 , 12 },
688
+ [VCAP_IS1_HK_IP4_INNER_DEI ] = { 55 , 1 },
689
+ [VCAP_IS1_HK_IP4_INNER_PCP ] = { 56 , 3 },
690
+ [VCAP_IS1_HK_IP4_IP4 ] = { 59 , 1 },
691
+ [VCAP_IS1_HK_IP4_L3_FRAGMENT ] = { 60 , 1 },
692
+ [VCAP_IS1_HK_IP4_L3_FRAG_OFS_GT0 ] = { 61 , 1 },
693
+ [VCAP_IS1_HK_IP4_L3_OPTIONS ] = { 62 , 1 },
694
+ [VCAP_IS1_HK_IP4_L3_DSCP ] = { 63 , 6 },
695
+ [VCAP_IS1_HK_IP4_L3_IP4_DIP ] = { 69 , 32 },
696
+ [VCAP_IS1_HK_IP4_L3_IP4_SIP ] = {101 , 32 },
697
+ [VCAP_IS1_HK_IP4_L3_PROTO ] = {133 , 8 },
698
+ [VCAP_IS1_HK_IP4_TCP_UDP ] = {141 , 1 },
699
+ [VCAP_IS1_HK_IP4_TCP ] = {142 , 1 },
700
+ [VCAP_IS1_HK_IP4_L4_RNG ] = {143 , 8 },
701
+ [VCAP_IS1_HK_IP4_IP_PAYLOAD_S1_5TUPLE ] = {151 , 32 },
702
+ };
703
+
704
+ static const struct vcap_field vsc9959_vcap_is1_actions [] = {
705
+ [VCAP_IS1_ACT_DSCP_ENA ] = { 0 , 1 },
706
+ [VCAP_IS1_ACT_DSCP_VAL ] = { 1 , 6 },
707
+ [VCAP_IS1_ACT_QOS_ENA ] = { 7 , 1 },
708
+ [VCAP_IS1_ACT_QOS_VAL ] = { 8 , 3 },
709
+ [VCAP_IS1_ACT_DP_ENA ] = { 11 , 1 },
710
+ [VCAP_IS1_ACT_DP_VAL ] = { 12 , 1 },
711
+ [VCAP_IS1_ACT_PAG_OVERRIDE_MASK ] = { 13 , 8 },
712
+ [VCAP_IS1_ACT_PAG_VAL ] = { 21 , 8 },
713
+ [VCAP_IS1_ACT_RSV ] = { 29 , 9 },
714
+ [VCAP_IS1_ACT_VID_REPLACE_ENA ] = { 38 , 1 },
715
+ [VCAP_IS1_ACT_VID_ADD_VAL ] = { 39 , 12 },
716
+ [VCAP_IS1_ACT_FID_SEL ] = { 51 , 2 },
717
+ [VCAP_IS1_ACT_FID_VAL ] = { 53 , 13 },
718
+ [VCAP_IS1_ACT_PCP_DEI_ENA ] = { 66 , 1 },
719
+ [VCAP_IS1_ACT_PCP_VAL ] = { 67 , 3 },
720
+ [VCAP_IS1_ACT_DEI_VAL ] = { 70 , 1 },
721
+ [VCAP_IS1_ACT_VLAN_POP_CNT_ENA ] = { 71 , 1 },
722
+ [VCAP_IS1_ACT_VLAN_POP_CNT ] = { 72 , 2 },
723
+ [VCAP_IS1_ACT_CUSTOM_ACE_TYPE_ENA ] = { 74 , 4 },
724
+ [VCAP_IS1_ACT_HIT_STICKY ] = { 78 , 1 },
725
+ };
726
+
599
727
static struct vcap_field vsc9959_vcap_is2_keys [] = {
600
728
/* Common: 41 bits */
601
729
[VCAP_IS2_TYPE ] = { 0 , 4 },
@@ -694,15 +822,32 @@ static struct vcap_field vsc9959_vcap_is2_actions[] = {
694
822
[VCAP_IS2_ACT_HIT_CNT ] = { 49 , 32 },
695
823
};
696
824
697
- static const struct vcap_props vsc9959_vcap_props [] = {
825
+ static struct vcap_props vsc9959_vcap_props [] = {
826
+ [VCAP_ES0 ] = {
827
+ .action_type_width = 0 ,
828
+ .action_table = {
829
+ [ES0_ACTION_TYPE_NORMAL ] = {
830
+ .width = 72 , /* HIT_STICKY not included */
831
+ .count = 1 ,
832
+ },
833
+ },
834
+ .target = S0 ,
835
+ .keys = vsc9959_vcap_es0_keys ,
836
+ .actions = vsc9959_vcap_es0_actions ,
837
+ },
838
+ [VCAP_IS1 ] = {
839
+ .action_type_width = 0 ,
840
+ .action_table = {
841
+ [IS1_ACTION_TYPE_NORMAL ] = {
842
+ .width = 78 , /* HIT_STICKY not included */
843
+ .count = 4 ,
844
+ },
845
+ },
846
+ .target = S1 ,
847
+ .keys = vsc9959_vcap_is1_keys ,
848
+ .actions = vsc9959_vcap_is1_actions ,
849
+ },
698
850
[VCAP_IS2 ] = {
699
- .tg_width = 2 ,
700
- .sw_count = 4 ,
701
- .entry_count = VSC9959_VCAP_IS2_CNT ,
702
- .entry_width = VSC9959_VCAP_IS2_ENTRY_WIDTH ,
703
- .action_count = VSC9959_VCAP_IS2_CNT +
704
- VSC9959_VCAP_PORT_CNT + 2 ,
705
- .action_width = 89 ,
706
851
.action_type_width = 1 ,
707
852
.action_table = {
708
853
[IS2_ACTION_TYPE_NORMAL ] = {
@@ -714,8 +859,9 @@ static const struct vcap_props vsc9959_vcap_props[] = {
714
859
.count = 4
715
860
},
716
861
},
717
- .counter_words = 4 ,
718
- .counter_width = 32 ,
862
+ .target = S2 ,
863
+ .keys = vsc9959_vcap_is2_keys ,
864
+ .actions = vsc9959_vcap_is2_actions ,
719
865
},
720
866
};
721
867
@@ -1184,8 +1330,6 @@ static const struct felix_info felix_info_vsc9959 = {
1184
1330
.ops = & vsc9959_ops ,
1185
1331
.stats_layout = vsc9959_stats_layout ,
1186
1332
.num_stats = ARRAY_SIZE (vsc9959_stats_layout ),
1187
- .vcap_is2_keys = vsc9959_vcap_is2_keys ,
1188
- .vcap_is2_actions = vsc9959_vcap_is2_actions ,
1189
1333
.vcap = vsc9959_vcap_props ,
1190
1334
.shared_queue_sz = 128 * 1024 ,
1191
1335
.num_mact_rows = 2048 ,
0 commit comments