xref: /linux/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_vcap_impl.c (revision 150b567e0d572342ef08bace7ee7aff80fd75327)
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #include "vcap_api.h"
4 #include "lan969x.h"
5 
6 const struct sparx5_vcap_inst lan969x_vcap_inst_cfg[] = {
7 	{
8 		.vtype = VCAP_TYPE_IS0, /* CLM-0 */
9 		.vinst = 0,
10 		.map_id = 1,
11 		.lookups = SPARX5_IS0_LOOKUPS,
12 		.lookups_per_instance = SPARX5_IS0_LOOKUPS / 3,
13 		.first_cid = SPARX5_VCAP_CID_IS0_L0,
14 		.last_cid = SPARX5_VCAP_CID_IS0_L2 - 1,
15 		.blockno = 2,
16 		.blocks = 1,
17 		.ingress = true,
18 	},
19 	{
20 		.vtype = VCAP_TYPE_IS0, /* CLM-1 */
21 		.vinst = 1,
22 		.map_id = 2,
23 		.lookups = SPARX5_IS0_LOOKUPS,
24 		.lookups_per_instance = SPARX5_IS0_LOOKUPS / 3,
25 		.first_cid = SPARX5_VCAP_CID_IS0_L2,
26 		.last_cid = SPARX5_VCAP_CID_IS0_L4 - 1,
27 		.blockno = 3,
28 		.blocks = 1,
29 		.ingress = true,
30 	},
31 	{
32 		.vtype = VCAP_TYPE_IS0, /* CLM-2 */
33 		.vinst = 2,
34 		.map_id = 3,
35 		.lookups = SPARX5_IS0_LOOKUPS,
36 		.lookups_per_instance = SPARX5_IS0_LOOKUPS / 3,
37 		.first_cid = SPARX5_VCAP_CID_IS0_L4,
38 		.last_cid = SPARX5_VCAP_CID_IS0_MAX,
39 		.blockno = 4,
40 		.blocks = 1,
41 		.ingress = true,
42 	},
43 	{
44 		.vtype = VCAP_TYPE_IS2, /* IS2-0 */
45 		.vinst = 0,
46 		.map_id = 4,
47 		.lookups = SPARX5_IS2_LOOKUPS,
48 		.lookups_per_instance = SPARX5_IS2_LOOKUPS / 2,
49 		.first_cid = SPARX5_VCAP_CID_IS2_L0,
50 		.last_cid = SPARX5_VCAP_CID_IS2_L2 - 1,
51 		.blockno = 0,
52 		.blocks = 1,
53 		.ingress = true,
54 	},
55 	{
56 		.vtype = VCAP_TYPE_IS2, /* IS2-1 */
57 		.vinst = 1,
58 		.map_id = 5,
59 		.lookups = SPARX5_IS2_LOOKUPS,
60 		.lookups_per_instance = SPARX5_IS2_LOOKUPS / 2,
61 		.first_cid = SPARX5_VCAP_CID_IS2_L2,
62 		.last_cid = SPARX5_VCAP_CID_IS2_MAX,
63 		.blockno = 1,
64 		.blocks = 1,
65 		.ingress = true,
66 	},
67 	{
68 		.vtype = VCAP_TYPE_ES0,
69 		.lookups = SPARX5_ES0_LOOKUPS,
70 		.lookups_per_instance = SPARX5_ES0_LOOKUPS,
71 		.first_cid = SPARX5_VCAP_CID_ES0_L0,
72 		.last_cid = SPARX5_VCAP_CID_ES0_MAX,
73 		.count = 1536,
74 		.ingress = false,
75 	},
76 	{
77 		.vtype = VCAP_TYPE_ES2,
78 		.lookups = SPARX5_ES2_LOOKUPS,
79 		.lookups_per_instance = SPARX5_ES2_LOOKUPS,
80 		.first_cid = SPARX5_VCAP_CID_ES2_L0,
81 		.last_cid = SPARX5_VCAP_CID_ES2_MAX,
82 		.count = 1024,
83 		.ingress = false,
84 	},
85 };
86