Debian Codegraph @

src/mainboard/mitaccomputing/sc513g6/config/iio.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <soc/iio.h>
4
5 static const struct iio_pe_config iio_config_table[] = {
6 {_IIO_PE_CFG_STRUCT(0x0, PE0, CB_IIO_BIFURCATE_x16xxxxx, PE_TYPE_PCIE) {
7 /* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
8 _IIO_PORT_CFG_STRUCT_BASIC_X16(0x0, 0x4B, 0x1),
9 _IIO_PORT_CFG_STRUCT_DISABLED,
10 _IIO_PORT_CFG_STRUCT_DISABLED,
11 _IIO_PORT_CFG_STRUCT_DISABLED,
12 _IIO_PORT_CFG_STRUCT_DISABLED,
13 _IIO_PORT_CFG_STRUCT_DISABLED,
14 _IIO_PORT_CFG_STRUCT_DISABLED,
15 _IIO_PORT_CFG_STRUCT_DISABLED,
16 }},
17
18 /*
19 * CB_IIO_BIFURCATE_x8x4x2x2 is first set to indicate how the IIO is bifurcated
20 * then port settings are listed accordingly. The minimal port elements are x2.
21 * If an x8 port is enabled, the neighboring 3 x2 port elements needs to be
22 * disabled.
23 */
24 {_IIO_PE_CFG_STRUCT(0x0, PE1, CB_IIO_BIFURCATE_x8x4x2x2, PE_TYPE_PCIE) {
25 /* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
26 _IIO_PORT_CFG_STRUCT_BASIC_X8(0x0, 0x4B, 0x2),
27 _IIO_PORT_CFG_STRUCT_DISABLED,
28 _IIO_PORT_CFG_STRUCT_DISABLED,
29 _IIO_PORT_CFG_STRUCT_DISABLED,
30 _IIO_PORT_CFG_STRUCT_BASIC_X4(0x0, 0x4B, 0x3),
31 _IIO_PORT_CFG_STRUCT_DISABLED,
32 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x4),
33 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x5),
34 }},
35
36 {_IIO_PE_CFG_STRUCT(0x0, PE2, CB_IIO_BIFURCATE_x16xxxxx, PE_TYPE_PCIE) {
37 /* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
38 _IIO_PORT_CFG_STRUCT_BASIC_X16(0x0, 0x4B, 0x6),
39 _IIO_PORT_CFG_STRUCT_DISABLED,
40 _IIO_PORT_CFG_STRUCT_DISABLED,
41 _IIO_PORT_CFG_STRUCT_DISABLED,
42 _IIO_PORT_CFG_STRUCT_DISABLED,
43 _IIO_PORT_CFG_STRUCT_DISABLED,
44 _IIO_PORT_CFG_STRUCT_DISABLED,
45 _IIO_PORT_CFG_STRUCT_DISABLED,
46 }},
47
48 {_IIO_PE_CFG_STRUCT(0x0, PE3, CB_IIO_BIFURCATE_x16xxxxx, PE_TYPE_PCIE) {
49 /* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
50 _IIO_PORT_CFG_STRUCT_BASIC_X16(0x0, 0x4B, 0x7),
51 _IIO_PORT_CFG_STRUCT_DISABLED,
52 _IIO_PORT_CFG_STRUCT_DISABLED,
53 _IIO_PORT_CFG_STRUCT_DISABLED,
54 _IIO_PORT_CFG_STRUCT_DISABLED,
55 _IIO_PORT_CFG_STRUCT_DISABLED,
56 _IIO_PORT_CFG_STRUCT_DISABLED,
57 _IIO_PORT_CFG_STRUCT_DISABLED,
58 }},
59
60 {_IIO_PE_CFG_STRUCT(0x0, PE4, CB_IIO_BIFURCATE_x2x2x2x2x2x2x2x2, PE_TYPE_PCIE) {
61 /* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
62 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x8),
63 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0x9),
64 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0xA),
65 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0xB),
66 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0xC),
67 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0xD),
68 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0xE),
69 _IIO_PORT_CFG_STRUCT_BASIC_X2(0x0, 0x4B, 0xF),
70 }},
71
72 {_IIO_PE_CFG_STRUCT(0x0, PE5, CB_IIO_BIFURCATE_x16xxxxx, PE_TYPE_PCIE) {
73 /* _IIO_PORT_CFG_STRUCT_BASIC(sltpls, sltplv, psn) */
74 _IIO_PORT_CFG_STRUCT_BASIC_X16(0x0, 0x4B, 0x10),
75 _IIO_PORT_CFG_STRUCT_DISABLED,
76 _IIO_PORT_CFG_STRUCT_DISABLED,
77 _IIO_PORT_CFG_STRUCT_DISABLED,
78 _IIO_PORT_CFG_STRUCT_DISABLED,
79 _IIO_PORT_CFG_STRUCT_DISABLED,
80 _IIO_PORT_CFG_STRUCT_DISABLED,
81 _IIO_PORT_CFG_STRUCT_DISABLED,
82 }},
83
84 _IIO_PE_CFG_DISABLED(0x0, PEa),
85 _IIO_PE_CFG_DISABLED(0x0, PEb),
86 _IIO_PE_CFG_DISABLED(0x0, PEc),
87 _IIO_PE_CFG_DISABLED(0x0, PEd),
88
89 _IIO_PE_CFG_DISABLED(0x1, PE0),
90 _IIO_PE_CFG_DISABLED(0x1, PE1),
91 _IIO_PE_CFG_DISABLED(0x1, PE2),
92 _IIO_PE_CFG_DISABLED(0x1, PE3),
93 _IIO_PE_CFG_DISABLED(0x1, PE4),
94 _IIO_PE_CFG_DISABLED(0x1, PE5),
95 _IIO_PE_CFG_DISABLED(0x1, PEa),
96 _IIO_PE_CFG_DISABLED(0x1, PEb),
97 _IIO_PE_CFG_DISABLED(0x1, PEc),
98 _IIO_PE_CFG_DISABLED(0x1, PEd),
99 };
100
101 const struct iio_pe_config *get_iio_config_table(int *size)
102 {
103 *size = ARRAY_SIZE(iio_config_table);
104 return iio_config_table;
105 }