mb/google/brya: Create rull variant
[coreboot2.git] / src / mainboard / 51nb / x210 / gpio.h
blobdf12f5bb615179ff5eb7b7b37841691f8894d5a6
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef MAINBOARD_GPIO_H
4 #define MAINBOARD_GPIO_H
6 #include <soc/gpio.h>
8 /*
9 * Bidirectional GPIO port when both RX and TX buffer is enabled
10 * todo: move this macros to src/soc/intel/common/block/include/intelblocks/gpio_defs.h
12 #ifndef PAD_CFG_GPIO_BIDIRECT
13 #define PAD_CFG_GPIO_BIDIRECT(pad, val, pull, rst, trig, own) \
14 _PAD_CFG_STRUCT(pad, \
15 PAD_FUNC(GPIO) | PAD_RESET(rst) | PAD_TRIG(trig) | \
16 PAD_BUF(NO_DISABLE) | val, \
17 PAD_PULL(pull) | PAD_CFG_OWN_GPIO(own))
18 #endif
20 #ifndef __ACPI__
22 /* Pad configuration in ramstage. */
23 static const struct pad_config gpio_table[] = {
24 PAD_CFG_NF(GPP_A0, NONE, DEEP, NF1),
25 PAD_CFG_NF(GPP_A1, NATIVE, DEEP, NF1),
26 PAD_CFG_NF(GPP_A2, NATIVE, DEEP, NF1),
27 PAD_CFG_NF(GPP_A3, NATIVE, DEEP, NF1),
28 PAD_CFG_NF(GPP_A4, NATIVE, DEEP, NF1),
29 PAD_CFG_NF(GPP_A5, NONE, DEEP, NF1),
30 PAD_CFG_NF(GPP_A6, NONE, DEEP, NF1),
31 PAD_CFG_GPO(GPP_A7, 1, DEEP),
32 PAD_NC(GPP_A8, UP_20K),
33 PAD_CFG_NF(GPP_A9, DN_20K, DEEP, NF1),
34 PAD_CFG_NF(GPP_A10, DN_20K, DEEP, NF1),
35 PAD_CFG_GPO(GPP_A11, 0, DEEP),
36 PAD_CFG_GPO(GPP_A12, 0, PWROK),
37 PAD_CFG_NF(GPP_A13, NONE, DEEP, NF1),
38 PAD_CFG_NF(GPP_A14, NONE, DEEP, NF1),
39 PAD_CFG_NF(GPP_A15, UP_20K, DEEP, NF1),
40 PAD_CFG_NF(GPP_A16, NONE, DEEP, NF1),
41 PAD_CFG_NF(GPP_A17, NONE, DEEP, NF1),
42 PAD_NC(GPP_A18, NONE),
43 PAD_NC(GPP_A19, NONE),
44 PAD_NC(GPP_A20, NONE),
45 PAD_NC(GPP_A21, NONE),
46 PAD_CFG_GPO(GPP_A22, 1, DEEP),
47 PAD_CFG_GPI_TRIG_OWN(GPP_A23, DN_20K, DEEP, OFF, ACPI),
48 PAD_CFG_NF(GPP_B0, NONE, DEEP, NF1),
49 PAD_CFG_NF(GPP_B1, NONE, DEEP, NF1),
50 PAD_NC(GPP_B2, NONE),
51 PAD_CFG_GPI_TRIG_OWN(GPP_B3, NONE, PLTRST, OFF, ACPI),
52 PAD_CFG_GPO(GPP_B4, 1, DEEP),
53 PAD_CFG_NF(GPP_B5, NONE, DEEP, NF1),
54 PAD_CFG_NF(GPP_B6, NONE, DEEP, NF1),
55 PAD_CFG_NF(GPP_B7, NONE, DEEP, NF1),
56 PAD_CFG_NF(GPP_B8, NONE, DEEP, NF1),
57 PAD_CFG_NF(GPP_B9, NONE, DEEP, NF1),
58 PAD_CFG_GPI_TRIG_OWN(GPP_B10, NONE, DEEP, OFF, ACPI),
59 PAD_CFG_NF(GPP_B11, NONE, DEEP, NF1),
60 PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1),
61 PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1),
62 PAD_CFG_TERM_GPO(GPP_B14, 1, DN_20K, DEEP),
63 PAD_NC(GPP_B15, NONE),
64 PAD_CFG_GPI_TRIG_OWN(GPP_B16, NONE, PLTRST, OFF, ACPI),
65 PAD_CFG_GPI_TRIG_OWN(GPP_B17, UP_20K, PLTRST, OFF, ACPI),
66 PAD_CFG_GPI_TRIG_OWN(GPP_B18, UP_20K, PLTRST, OFF, ACPI),
67 PAD_NC(GPP_B19, NONE),
68 PAD_CFG_NF(GPP_B20, DN_20K, DEEP, NF1),
69 PAD_CFG_NF(GPP_B21, DN_20K, DEEP, NF1),
70 PAD_CFG_NF(GPP_B22, DN_20K, DEEP, NF1),
71 PAD_CFG_TERM_GPO(GPP_B23, 1, DN_20K, DEEP),
72 PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1),
73 PAD_CFG_NF(GPP_C1, DN_20K, DEEP, NF1),
74 PAD_CFG_TERM_GPO(GPP_C2, 1, DN_20K, DEEP),
75 PAD_CFG_NF(GPP_C3, UP_20K, DEEP, NF1),
76 PAD_CFG_NF(GPP_C4, UP_20K, DEEP, NF1),
77 PAD_CFG_GPI_TRIG_OWN(GPP_C5, DN_20K, DEEP, OFF, ACPI),
78 /* GPP_C6 - RESERVED */
79 /* GPP_C7 - RESERVED */
80 PAD_CFG_NF(GPP_C8, UP_20K, DEEP, NF1),
81 PAD_CFG_NF(GPP_C9, NONE, DEEP, NF1),
82 PAD_CFG_NF(GPP_C10, NONE, DEEP, NF1),
83 PAD_CFG_NF(GPP_C11, NONE, DEEP, NF1),
84 PAD_CFG_NF(GPP_C12, NONE, DEEP, NF1),
85 PAD_CFG_NF(GPP_C13, NONE, DEEP, NF1),
86 PAD_CFG_NF(GPP_C14, NONE, DEEP, NF1),
87 PAD_CFG_NF(GPP_C15, NONE, DEEP, NF1),
88 PAD_CFG_NF(GPP_C16, UP_20K, DEEP, NF1),
89 PAD_CFG_NF(GPP_C17, UP_20K, DEEP, NF1),
90 PAD_CFG_NF(GPP_C18, UP_20K, DEEP, NF1),
91 PAD_CFG_NF(GPP_C19, UP_20K, DEEP, NF1),
92 PAD_CFG_NF(GPP_C20, UP_20K, DEEP, NF1),
93 PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1),
94 PAD_CFG_NF(GPP_C22, NONE, DEEP, NF1),
95 PAD_CFG_NF(GPP_C23, NONE, DEEP, NF1),
96 PAD_CFG_NF(GPP_D0, NONE, DEEP, NF1),
97 PAD_CFG_NF(GPP_D1, NONE, DEEP, NF1),
98 PAD_CFG_NF(GPP_D2, NONE, DEEP, NF1),
99 PAD_CFG_NF(GPP_D3, NONE, DEEP, NF1),
100 PAD_CFG_NF(GPP_D4, NONE, DEEP, NF1),
101 PAD_CFG_NF(GPP_D5, UP_20K, DEEP, NF1),
102 PAD_CFG_NF(GPP_D6, UP_20K, DEEP, NF1),
103 PAD_CFG_NF(GPP_D7, UP_20K, DEEP, NF1),
104 PAD_CFG_NF(GPP_D8, UP_20K, DEEP, NF1),
105 PAD_CFG_GPI_TRIG_OWN(GPP_D9, UP_20K, DEEP, OFF, ACPI),
106 PAD_CFG_GPI_TRIG_OWN(GPP_D10, UP_20K, DEEP, OFF, ACPI),
107 PAD_CFG_GPI_TRIG_OWN(GPP_D11, UP_20K, DEEP, OFF, ACPI),
108 PAD_CFG_GPI_TRIG_OWN(GPP_D12, UP_20K, DEEP, OFF, ACPI),
109 PAD_CFG_NF(GPP_D13, UP_20K, DEEP, NF1),
110 PAD_CFG_NF(GPP_D14, UP_20K, DEEP, NF1),
111 PAD_CFG_NF(GPP_D15, NONE, DEEP, NF1),
112 PAD_CFG_NF(GPP_D16, NONE, DEEP, NF1),
113 PAD_CFG_NF(GPP_D17, NONE, DEEP, NF1),
114 PAD_CFG_NF(GPP_D18, DN_20K, DEEP, NF1),
115 PAD_CFG_NF(GPP_D19, NONE, DEEP, NF1),
116 PAD_CFG_NF(GPP_D20, DN_20K, DEEP, NF1),
117 PAD_CFG_NF(GPP_D21, NONE, DEEP, NF1),
118 PAD_CFG_NF(GPP_D22, NONE, DEEP, NF1),
119 PAD_CFG_NF(GPP_D23, NONE, DEEP, NF1),
120 PAD_CFG_GPO(GPP_E0, 0, DEEP),
121 PAD_CFG_GPI_TRIG_OWN(GPP_E1, NONE, DEEP, OFF, ACPI),
122 PAD_NC(GPP_E2, NONE),
123 PAD_CFG_GPI_TRIG_OWN(GPP_E3, NONE, DEEP, OFF, ACPI),
124 PAD_NC(GPP_E4, NONE),
125 PAD_CFG_NF(GPP_E5, NONE, PWROK, NF1),
126 PAD_CFG_NF(GPP_E6, NONE, PWROK, NF1),
127 PAD_NC(GPP_E7, NONE),
128 PAD_CFG_NF(GPP_E8, NONE, DEEP, NF1),
129 PAD_CFG_NF(GPP_E9, NONE, DEEP, NF1),
130 PAD_CFG_NF(GPP_E10, NONE, DEEP, NF1),
131 PAD_CFG_NF(GPP_E11, NONE, DEEP, NF1),
132 PAD_NC(GPP_E12, NONE),
133 PAD_CFG_NF(GPP_E13, NONE, DEEP, NF1),
134 PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1),
135 PAD_CFG_GPI_SCI(GPP_E15, NONE, PLTRST, LEVEL, INVERT),
136 PAD_CFG_GPI_TRIG_OWN(GPP_E16, NONE, PLTRST, OFF, ACPI),
137 PAD_CFG_NF(GPP_E17, NONE, DEEP, NF1),
138 PAD_CFG_NF(GPP_E18, UP_20K, DEEP, NF1),
139 PAD_CFG_NF(GPP_E19, DN_20K, DEEP, NF1),
140 PAD_CFG_NF(GPP_E20, UP_20K, DEEP, NF1),
141 PAD_CFG_NF(GPP_E21, DN_20K, DEEP, NF1),
142 PAD_CFG_GPIO_BIDIRECT(GPP_E22, 0, NONE, DEEP, OFF, ACPI),
143 PAD_CFG_TERM_GPO(GPP_E23, 1, DN_20K, DEEP),
144 PAD_CFG_NF(GPD0, UP_20K, PWROK, NF1),
145 PAD_CFG_NF(GPD1, NONE, PWROK, NF1),
146 PAD_CFG_NF(GPD2, NATIVE, PWROK, NF1),
147 PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1),
148 PAD_CFG_NF(GPD4, NONE, PWROK, NF1),
149 PAD_CFG_NF(GPD5, NONE, PWROK, NF1),
150 PAD_CFG_NF(GPD6, NONE, PWROK, NF1),
151 PAD_NC(GPD7, NONE),
152 PAD_CFG_NF(GPD8, NONE, PWROK, NF1),
153 PAD_CFG_NF(GPD9, NONE, PWROK, NF1),
154 PAD_CFG_NF(GPD10, NONE, PWROK, NF1),
155 PAD_CFG_NF(GPD11, NONE, PWROK, NF1),
156 PAD_CFG_NF(GPP_F0, NONE, DEEP, NF1),
157 PAD_CFG_NF(GPP_F1, NONE, DEEP, NF1),
158 PAD_CFG_NF(GPP_F2, NONE, DEEP, NF1),
159 PAD_CFG_NF(GPP_F3, NONE, DEEP, NF1),
160 PAD_CFG_NF_1V8(GPP_F4, UP_20K, DEEP, NF1),
161 PAD_CFG_NF_1V8(GPP_F5, UP_20K, DEEP, NF1),
162 PAD_CFG_NF_1V8(GPP_F6, UP_20K, DEEP, NF1),
163 PAD_CFG_NF_1V8(GPP_F7, UP_20K, DEEP, NF1),
164 PAD_CFG_NF_1V8(GPP_F8, UP_20K, DEEP, NF1),
165 PAD_CFG_NF_1V8(GPP_F9, UP_20K, DEEP, NF1),
166 PAD_CFG_NF_1V8(GPP_F10, UP_20K, DEEP, NF2),
167 PAD_CFG_NF_1V8(GPP_F11, UP_20K, DEEP, NF2),
168 PAD_CFG_NF(GPP_F12, NONE, DEEP, NF1),
169 PAD_CFG_NF(GPP_F13, NONE, DEEP, NF1),
170 PAD_CFG_NF(GPP_F14, NONE, DEEP, NF1),
171 PAD_CFG_NF(GPP_F15, NONE, DEEP, NF1),
172 PAD_CFG_NF(GPP_F16, NONE, DEEP, NF1),
173 PAD_CFG_NF(GPP_F17, NONE, DEEP, NF1),
174 PAD_CFG_NF(GPP_F18, NONE, DEEP, NF1),
175 PAD_CFG_NF(GPP_F19, NONE, DEEP, NF1),
176 PAD_CFG_NF(GPP_F20, NONE, DEEP, NF1),
177 PAD_CFG_NF(GPP_F21, NONE, DEEP, NF1),
178 PAD_CFG_NF(GPP_F22, NONE, DEEP, NF1),
179 PAD_CFG_GPI_TRIG_OWN(GPP_F23, NONE, DEEP, OFF, ACPI),
180 PAD_CFG_NF(GPP_G0, NONE, DEEP, NF1),
181 PAD_CFG_NF(GPP_G1, NONE, DEEP, NF1),
182 PAD_CFG_NF(GPP_G2, NONE, DEEP, NF1),
183 PAD_CFG_NF(GPP_G3, NONE, DEEP, NF1),
184 PAD_CFG_NF(GPP_G4, NONE, DEEP, NF1),
185 PAD_CFG_NF(GPP_G5, NONE, DEEP, NF1),
186 PAD_CFG_NF(GPP_G6, NONE, DEEP, NF1),
187 PAD_CFG_NF(GPP_G7, DN_20K, DEEP, NF1),
190 #endif
192 #endif