6 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/snr"
7 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/test"
10 func TestGenMacro(t
*testing
.T
) {
11 sunrise
:= snr
.PlatformSpecific
{}
14 Pad
: test
.Pad
{ID
: "GPP_A1", DW0
: 0x84000402, DW1
: 0x00003000, Ownership
: 0},
16 Short
: "PAD_CFG_NF(GPP_A1, UP_20K, PLTRST, NF1),",
17 Long
: "_PAD_CFG_STRUCT(GPP_A1, PAD_FUNC(NF1) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | (1 << 1), PAD_PULL(UP_20K)),",
20 { /* GPP_A5 - LFRAME# */
21 Pad
: test
.Pad
{ID
: "GPP_A5", DW0
: 0x84000600, DW1
: 0x00000000, Ownership
: 0},
23 Short
: "PAD_CFG_NF(GPP_A5, NONE, PLTRST, NF1),",
24 Long
: "_PAD_CFG_STRUCT(GPP_A5, PAD_FUNC(NF1) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE), 0),",
27 { /* GPP_A22 - GPIO */
28 Pad
: test
.Pad
{ID
: "GPP_A22", DW0
: 0x84000102, DW1
: 0x00000000, Ownership
: 0},
30 Short
: "PAD_CFG_GPI_TRIG_OWN(GPP_A22, NONE, PLTRST, OFF, ACPI),",
31 Long
: "_PAD_CFG_STRUCT(GPP_A22, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE) | (1 << 1), 0),",
35 Pad
: test
.Pad
{ID
: "GPP_B3", DW0
: 0x44000201, DW1
: 0x00000000, Ownership
: 0},
37 Short
: "PAD_CFG_GPO(GPP_B3, 1, DEEP),",
38 Long
: "_PAD_CFG_STRUCT(GPP_B3, PAD_FUNC(GPIO) | PAD_RESET(DEEP) | PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE) | 1, 0),",
42 Pad
: test
.Pad
{ID
: "GPP_B5", DW0
: 0x84000100, DW1
: 0x00000000, Ownership
: 0},
44 Short
: "PAD_CFG_GPI_TRIG_OWN(GPP_B5, NONE, PLTRST, OFF, ACPI),",
45 Long
: "_PAD_CFG_STRUCT(GPP_B5, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE), 0),",
49 Pad
: test
.Pad
{ID
: "GPP_B8", DW0
: 0x44000300, DW1
: 0x00000000, Ownership
: 0},
51 Short
: "PAD_NC(GPP_B8, NONE),",
52 Long
: "_PAD_CFG_STRUCT(GPP_B8, PAD_FUNC(GPIO) | PAD_RESET(DEEP) | PAD_TRIG(OFF) | PAD_BUF(TX_RX_DISABLE), 0),",
56 Pad
: test
.Pad
{ID
: "GPP_C2", DW0
: 0x44000201, DW1
: 0x00000000, Ownership
: 0},
58 Short
: "PAD_CFG_GPO(GPP_C2, 1, DEEP),",
59 Long
: "_PAD_CFG_STRUCT(GPP_C2, PAD_FUNC(GPIO) | PAD_RESET(DEEP) | PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE) | 1, 0),",
62 { /* GPP_C10 - GPIO */
63 Pad
: test
.Pad
{ID
: "GPP_C10", DW0
: 0x04000000, DW1
: 0x00000000, Ownership
: 0},
65 Short
: "PAD_CFG_GPIO_BIDIRECT(GPP_C10, 0, NONE, RSMRST, OFF, ACPI),",
66 Long
: "_PAD_CFG_STRUCT(GPP_C10, PAD_FUNC(GPIO) | PAD_RESET(RSMRST) | PAD_TRIG(OFF), 0),",
69 { /* GPP_C22 - UART2_RTS# */
70 Pad
: test
.Pad
{ID
: "GPP_C22", DW0
: 0x84000600, DW1
: 0x00000000, Ownership
: 0},
72 Short
: "PAD_CFG_NF(GPP_C22, NONE, PLTRST, NF1),",
73 Long
: "_PAD_CFG_STRUCT(GPP_C22, PAD_FUNC(NF1) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE), 0),",
76 { /* GPP_C23 - GPIO */
77 Pad
: test
.Pad
{ID
: "GPP_C23", DW0
: 0x40880102, DW1
: 0x00000000, Ownership
: 0},
79 Short
: "PAD_CFG_GPI_SCI(GPP_C23, NONE, DEEP, LEVEL, INVERT),",
80 Long
: "_PAD_CFG_STRUCT(GPP_C23, PAD_FUNC(GPIO) | PAD_RESET(DEEP) | PAD_IRQ_ROUTE(SCI) | PAD_RX_POL(INVERT) | PAD_BUF(TX_DISABLE) | (1 << 1), 0),",
84 Pad
: test
.Pad
{ID
: "GPP_D0", DW0
: 0x84000200, DW1
: 0x00000000, Ownership
: 0},
86 Short
: "PAD_CFG_GPO(GPP_D0, 0, PLTRST),",
87 Long
: "_PAD_CFG_STRUCT(GPP_D0, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE), 0),",
90 { /* GPP_D16 - GPIO */
91 Pad
: test
.Pad
{ID
: "GPP_D16", DW0
: 0x84000100, DW1
: 0x00000000, Ownership
: 0},
93 Short
: "PAD_CFG_GPI_TRIG_OWN(GPP_D16, NONE, PLTRST, OFF, ACPI),",
94 Long
: "_PAD_CFG_STRUCT(GPP_D16, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE), 0),",
97 { /* GPP_E0 - SATAXPCIE0 */
98 Pad
: test
.Pad
{ID
: "GPP_E0", DW0
: 0x84000502, DW1
: 0x00003000, Ownership
: 0},
100 Short
: "PAD_CFG_NF(GPP_E0, UP_20K, PLTRST, NF1),",
101 Long
: "_PAD_CFG_STRUCT(GPP_E0, PAD_FUNC(NF1) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE) | (1 << 1), PAD_PULL(UP_20K)),",
104 { /* GPP_E7 - GPIO */
105 Pad
: test
.Pad
{ID
: "GPP_E7", DW0
: 0x84000102, DW1
: 0x00000000, Ownership
: 1},
107 Short
: "PAD_CFG_GPI_TRIG_OWN(GPP_E7, NONE, PLTRST, OFF, DRIVER),",
108 Long
: "_PAD_CFG_STRUCT(GPP_E7, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE) | (1 << 1), PAD_CFG_OWN_GPIO(DRIVER)),",
111 { /* GPP_F2 - GPIO */
112 Pad
: test
.Pad
{ID
: "GPP_F2", DW0
: 0x44000300, DW1
: 0x00000000, Ownership
: 0},
114 Short
: "PAD_NC(GPP_F2, NONE),",
115 Long
: "_PAD_CFG_STRUCT(GPP_F2, PAD_FUNC(GPIO) | PAD_RESET(DEEP) | PAD_TRIG(OFF) | PAD_BUF(TX_RX_DISABLE), 0),",
118 { /* GPP_F12 - GPIO */
119 Pad
: test
.Pad
{ID
: "GPP_F12", DW0
: 0x80900102, DW1
: 0x00000000, Ownership
: 0},
121 Short
: "PAD_CFG_GPI_APIC_LOW(GPP_F12, NONE, PLTRST),",
122 Long
: "_PAD_CFG_STRUCT(GPP_F12, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_IRQ_ROUTE(IOAPIC) | PAD_RX_POL(INVERT) | PAD_BUF(TX_DISABLE) | (1 << 1), 0),",
125 { /* GPP_F13 - GPIO */
126 Pad
: test
.Pad
{ID
: "GPP_F13", DW0
: 0x80100102, DW1
: 0x00000000, Ownership
: 0},
128 Short
: "PAD_CFG_GPI_APIC_HIGH(GPP_F13, NONE, PLTRST),",
129 Long
: "_PAD_CFG_STRUCT(GPP_F13, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_IRQ_ROUTE(IOAPIC) | PAD_BUF(TX_DISABLE) | (1 << 1), 0),",
132 { /* GPP_F14 - GPIO */
133 Pad
: test
.Pad
{ID
: "GPP_F14", DW0
: 0x40900102, DW1
: 0x00000000, Ownership
: 0},
135 Short
: "PAD_CFG_GPI_APIC_LOW(GPP_F14, NONE, DEEP),",
136 Long
: "_PAD_CFG_STRUCT(GPP_F14, PAD_FUNC(GPIO) | PAD_RESET(DEEP) | PAD_IRQ_ROUTE(IOAPIC) | PAD_RX_POL(INVERT) | PAD_BUF(TX_DISABLE) | (1 << 1), 0),",
139 { /* GPP_H13 - GPIO */
140 Pad
: test
.Pad
{ID
: "GPP_H13", DW0
: 0x80100102, DW1
: 0x00000000, Ownership
: 0},
142 Short
: "PAD_CFG_GPI_APIC_HIGH(GPP_H13, NONE, PLTRST),",
143 Long
: "_PAD_CFG_STRUCT(GPP_H13, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_IRQ_ROUTE(IOAPIC) | PAD_BUF(TX_DISABLE) | (1 << 1), 0),",
147 Pad
: test
.Pad
{ID
: "GPD1", DW0
: 0x04000200, DW1
: 0x00000000, Ownership
: 0},
149 Short
: "PAD_CFG_GPO(GPD1, 0, PWROK),",
150 Long
: "_PAD_CFG_STRUCT(GPD1, PAD_FUNC(GPIO) | PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE), 0),",
153 { /* GPD2 - LAN_WAKE# */
154 Pad
: test
.Pad
{ID
: "GPD2", DW0
: 0x00080602, DW1
: 0x00003c00, Ownership
: 0},
156 Short
: "PAD_CFG_NF(GPD2, NATIVE, PWROK, NF1),",
157 Long
: "_PAD_CFG_STRUCT(GPD2, PAD_FUNC(NF1) | PAD_IRQ_ROUTE(SCI) | PAD_BUF(RX_DISABLE) | (1 << 1), PAD_PULL(NATIVE)),",
160 { /* GPD3 - PWRBTN# */
161 Pad
: test
.Pad
{ID
: "GPD3", DW0
: 0x04000502, DW1
: 0x00003000, Ownership
: 0},
163 Short
: "PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1),",
164 Long
: "_PAD_CFG_STRUCT(GPD3, PAD_FUNC(NF1) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE) | (1 << 1), PAD_PULL(UP_20K)),",
168 Pad
: test
.Pad
{ID
: "GPD7", DW0
: 0x84000103, DW1
: 0x00000000, Ownership
: 0},
170 Short
: "PAD_CFG_GPI_TRIG_OWN(GPD7, NONE, PLTRST, OFF, ACPI),",
171 Long
: "_PAD_CFG_STRUCT(GPD7, PAD_FUNC(GPIO) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE) | (1 << 1) | 1, 0),",
174 { /* GPP_I1 - DDPC_HPD1 */
175 Pad
: test
.Pad
{ID
: "GPP_I1", DW0
: 0x84000502, DW1
: 0x00000000, Ownership
: 0},
177 Short
: "PAD_CFG_NF(GPP_I1, NONE, PLTRST, NF1),",
178 Long
: "_PAD_CFG_STRUCT(GPP_I1, PAD_FUNC(NF1) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE) | (1 << 1), 0),",
181 { /* GPP_I8 - DDPC_CTRLDATA */
182 Pad
: test
.Pad
{ID
: "GPP_I8", DW0
: 0x84000500, DW1
: 0x00001000, Ownership
: 0},
184 Short
: "PAD_CFG_NF(GPP_I8, DN_20K, PLTRST, NF1),",
185 Long
: "_PAD_CFG_STRUCT(GPP_I8, PAD_FUNC(NF1) | PAD_RESET(PLTRST) | PAD_TRIG(OFF) | PAD_BUF(TX_DISABLE), PAD_PULL(DN_20K)),",
188 }.Run(t
, "INTEL-SUNRISE-PCH/PAD-MAP", sunrise
)
192 Pad
: test
.Pad
{ID
: "GPP_Axx", DW0
: 0xBFFFFFFF, DW1
: 0xFFFFFFFF, Ownership
: 1},
194 Short
: "PAD_CFG_NF_1V8(GPP_Axx, NATIVE, PLTRST, NF7),",
195 Long
: "_PAD_CFG_STRUCT(GPP_Axx, PAD_FUNC(NF7) | PAD_RESET(PLTRST) | PAD_TRIG(EDGE_BOTH) | PAD_IRQ_ROUTE(IOAPIC) | PAD_IRQ_ROUTE(SCI) | PAD_IRQ_ROUTE(SMI) | PAD_IRQ_ROUTE(NMI) | PAD_RX_POL(INVERT) | PAD_BUF(TX_RX_DISABLE) | (1 << 29) | (1 << 28) | (1 << 1) | 1, PAD_CFG1_TOL_1V8PAD_PULL(NATIVE) | PAD_IOSSTATE(IGNORE) | PAD_IOSTERM(ENPU) | PAD_CFG_OWN_GPIO(DRIVER)),",
198 }.Run(t
, "INTEL-SUNRISE-PCH/MASK", sunrise
)
202 Pad
: test
.Pad
{ID
: "GPP_Bxx", DW0
: 0x00000000, DW1
: 0x00000000, Ownership
: 0},
204 Short
: "PAD_CFG_GPIO_BIDIRECT(GPP_Bxx, 0, NONE, RSMRST, LEVEL, ACPI),",
205 Long
: "_PAD_CFG_STRUCT(GPP_Bxx, PAD_FUNC(GPIO) | PAD_RESET(RSMRST), 0),",
208 }.Run(t
, "INTEL-SUNRISE-PCH/EMRTY", sunrise
)