OpenBIC
OpenSource Bridge-IC
plat_gpio.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_GPIO_H
18#define PLAT_GPIO_H
19
20#include "hal_gpio.h"
21
22// clang-format off
23
24#define name_gpioA \
25 gpio_name_to_num(PWR_ON_RST_N_R) \
26 gpio_name_to_num(SYS_RST_N_R) \
27 gpio_name_to_num(PERST_ASIC_N_R) \
28 gpio_name_to_num(JTAG2_NTRST2_R) \
29 gpio_name_to_num(RST_PCIE_MB_EXP_N) \
30 gpio_name_to_num(BIC_PWR_EN_4C) \
31 gpio_name_to_num(PG_CARD_OK) \
32 gpio_name_to_num(POWER_EN_R)
33
34#define name_gpioB \
35 gpio_name_to_num(PAD_CORE_TAP_CTRL_L_R) \
36 gpio_name_to_num(Reserve_GPIOB1) \
37 gpio_name_to_num(Reserve_GPIOB2) \
38 gpio_name_to_num(BIC_SECUREBOOT) \
39 gpio_name_to_num(SMBUS_ALERT_R_N) \
40 gpio_name_to_num(FM_PWRBRK_PRIMARY_R_N) \
41 gpio_name_to_num(BIC_ESPI_SELECT) \
42 gpio_name_to_num(RST_SPI_FLASH_N)
43
44#define name_gpioC \
45 gpio_name_to_num(P0V85_BIC_ASIC_EN) \
46 gpio_name_to_num(PWRGD_P0V85_ASIC) \
47 gpio_name_to_num(P1V2_BIC_ASIC_EN) \
48 gpio_name_to_num(PWRGD_P1V2_ASIC) \
49 gpio_name_to_num(P1V8_BIC_ASIC_EN) \
50 gpio_name_to_num(PWRGD_P1V8_ASIC) \
51 gpio_name_to_num(P0V8_BIC_ASIC_EN) \
52 gpio_name_to_num(PWRGD_P0V8_ASIC)
53
54#define name_gpioD \
55 gpio_name_to_num(PVPP_AB_BIC_DIMM_EN) \
56 gpio_name_to_num(PWRGD_PVPP_AB) \
57 gpio_name_to_num(PVPP_CD_BIC_DIMM_EN) \
58 gpio_name_to_num(PWRGD_PVPP_CD) \
59 gpio_name_to_num(PVTT_AB_BIC_DIMM_EN) \
60 gpio_name_to_num(PWRGD_PVTT_AB) \
61 gpio_name_to_num(PVTT_CD_BIC_DIMM_EN) \
62 gpio_name_to_num(PWRGD_PVTT_CD)
63
64#define name_gpioE \
65 gpio_name_to_num(ALT_SMB_BIC_PMIC_R_N) \
66 gpio_name_to_num(ALT_TMPS_N) \
67 gpio_name_to_num(ALT_INA_R_N) \
68 gpio_name_to_num(USB_MUX1_SEL_R) \
69 gpio_name_to_num(Reserve_GPIOE4) \
70 gpio_name_to_num(SEL_SMB_MUX_PMIC_R) \
71 gpio_name_to_num(SEL_SMB_MUX_DIMM_R) \
72 gpio_name_to_num(SEL_SPI_MUX_R)
73
74#define name_gpioF \
75 gpio_name_to_num(SLOT_ID0_R) \
76 gpio_name_to_num(SLOT_ID1_R) \
77 gpio_name_to_num(BOARD_ID0) \
78 gpio_name_to_num(BOARD_ID1) \
79 gpio_name_to_num(BOARD_ID2) \
80 gpio_name_to_num(BOARD_ID3) \
81 gpio_name_to_num(LED_CXL_FAULT) \
82 gpio_name_to_num(LED_CXL_POWER)
83
84#define name_gpioG \
85 gpio_name_to_num(PWRGD_AUX_R) \
86 gpio_name_to_num(PVDDQ_AB_EN_BIC) \
87 gpio_name_to_num(PWRGD_PVDDQ_AB_BIC) \
88 gpio_name_to_num(PVDDQ_CD_EN_BIC) \
89 gpio_name_to_num(PWRGD_PVDDQ_CD_BIC) \
90 gpio_name_to_num(P0V75_ASIC_EN_BIC) \
91 gpio_name_to_num(PWRGD_P0V75_ASIC_BIC) \
92 gpio_name_to_num(P5V_STBY_EN_BIC)
93
94#define name_gpioH \
95 gpio_name_to_num(PWRGD_P5V_STBY_BIC) \
96 gpio_name_to_num(LED_ASIC_BIC_HB) \
97 gpio_name_to_num(BIC_READY_R) \
98 gpio_name_to_num(ADAPTER_VCC) \
99 gpio_name_to_num(Reserve_GPIOH4) \
100 gpio_name_to_num(Reserve_GPIOH5) \
101 gpio_name_to_num(Reserve_GPIOH6) \
102 gpio_name_to_num(Reserve_GPIOH7)
103
104#define name_gpioI \
105 gpio_name_to_num(Reserve_GPIOI0) \
106 gpio_name_to_num(Reserve_GPIOI1) \
107 gpio_name_to_num(Reserve_GPIOI2) \
108 gpio_name_to_num(Reserve_GPIOI3) \
109 gpio_name_to_num(Reserve_GPIOI4) \
110 gpio_name_to_num(Reserve_GPIOI5) \
111 gpio_name_to_num(Reserve_GPIOI6) \
112 gpio_name_to_num(Reserve_GPIOI7)
113
114#define name_gpioJ \
115 gpio_name_to_num(Reserve_GPIOJ0) \
116 gpio_name_to_num(Reserve_GPIOJ1) \
117 gpio_name_to_num(Reserve_GPIOJ2) \
118 gpio_name_to_num(Reserve_GPIOJ3) \
119 gpio_name_to_num(Reserve_GPIOJ4) \
120 gpio_name_to_num(Reserve_GPIOJ5) \
121 gpio_name_to_num(Reserve_GPIOJ6) \
122 gpio_name_to_num(Reserve_GPIOJ7)
123
124#define name_gpioK \
125 gpio_name_to_num(Reserve_GPIOK0) \
126 gpio_name_to_num(Reserve_GPIOK1) \
127 gpio_name_to_num(Reserve_GPIOK2) \
128 gpio_name_to_num(Reserve_GPIOK3) \
129 gpio_name_to_num(Reserve_GPIOK4) \
130 gpio_name_to_num(Reserve_GPIOK5) \
131 gpio_name_to_num(Reserve_GPIOK6) \
132 gpio_name_to_num(Reserve_GPIOK7)
133
134#define name_gpioL \
135 gpio_name_to_num(Reserve_GPIOL0) \
136 gpio_name_to_num(Reserve_GPIOL1) \
137 gpio_name_to_num(Reserve_GPIOL2) \
138 gpio_name_to_num(Reserve_GPIOL3) \
139 gpio_name_to_num(Reserve_GPIOL4) \
140 gpio_name_to_num(EN_LS_BIC_ASIC_R) \
141 gpio_name_to_num(EN_JTAG2_ASIC_SEL_R) \
142 gpio_name_to_num(OE_USB_MUX1_R_N)
143
144#define name_gpioM \
145 gpio_name_to_num(Reserve_GPIOM0) \
146 gpio_name_to_num(OE_FM_SPI_MUX_R_N) \
147 gpio_name_to_num(EN_LS_JTAG2_BIC_R) \
148 gpio_name_to_num(EN_LS_SPI_BIC_R) \
149 gpio_name_to_num(Reserve_GPIOM4) \
150 gpio_name_to_num(Reserve_GPIOM5) \
151 gpio_name_to_num(Reserve_GPIOM6) \
152 gpio_name_to_num(Reserve_GPIOM7)
153
154#define name_gpioN \
155 gpio_name_to_num(Reserve_GPION0) \
156 gpio_name_to_num(Reserve_GPION1) \
157 gpio_name_to_num(Reserve_GPION2) \
158 gpio_name_to_num(EN_CLK_100M_OSC) \
159 gpio_name_to_num(Reserve_GPION4) \
160 gpio_name_to_num(Reserve_GPION5) \
161 gpio_name_to_num(Reserve_GPION6) \
162 gpio_name_to_num(Reserve_GPION7)
163
164#define name_gpioO \
165 gpio_name_to_num(Reserve_GPIOO0) \
166 gpio_name_to_num(Reserve_GPIOO1) \
167 gpio_name_to_num(Reserve_GPIOO2) \
168 gpio_name_to_num(Reserve_GPIOO3) \
169 gpio_name_to_num(Reserve_GPIOO4) \
170 gpio_name_to_num(Reserve_GPIOO5) \
171 gpio_name_to_num(Reserve_GPIOO6) \
172 gpio_name_to_num(Reserve_GPIOO7)
173
174#define name_gpioP \
175 gpio_name_to_num(Reserve_GPIOP0) \
176 gpio_name_to_num(Reserve_GPIOP1) \
177 gpio_name_to_num(Reserve_GPIOP2) \
178 gpio_name_to_num(Reserve_GPIOP3) \
179 gpio_name_to_num(Reserve_GPIOP4) \
180 gpio_name_to_num(Reserve_GPIOP5) \
181 gpio_name_to_num(LED_ASIC_BIC_1) \
182 gpio_name_to_num(LED_ASIC_BIC_2)
183
184#define name_gpioQ \
185 gpio_name_to_num(LED_ASIC_BIC_3) \
186 gpio_name_to_num(Reserve_GPIOQ1) \
187 gpio_name_to_num(Reserve_GPIOQ2) \
188 gpio_name_to_num(Reserve_GPIOQ3) \
189 gpio_name_to_num(Reserve_GPIOQ4) \
190 gpio_name_to_num(Reserve_GPIOQ5) \
191 gpio_name_to_num(Reserve_GPIOQ6) \
192 gpio_name_to_num(Reserve_GPIOQ7)
193
194#define name_gpioR \
195 gpio_name_to_num(Reserve_GPIOR0) \
196 gpio_name_to_num(Reserve_GPIOR1) \
197 gpio_name_to_num(Reserve_GPIOR2) \
198 gpio_name_to_num(Reserve_GPIOR3) \
199 gpio_name_to_num(Reserve_GPIOR4) \
200 gpio_name_to_num(Reserve_GPIOR5) \
201 gpio_name_to_num(Reserve_GPIOR6) \
202 gpio_name_to_num(Reserve_GPIOR7)
203
204#define name_gpioS \
205 gpio_name_to_num(Reserve_GPIOS0) \
206 gpio_name_to_num(Reserve_GPIOS1) \
207 gpio_name_to_num(Reserve_GPIOS2) \
208 gpio_name_to_num(Reserve_GPIOS3) \
209 gpio_name_to_num(Reserve_GPIOS4) \
210 gpio_name_to_num(Reserve_GPIOS5) \
211 gpio_name_to_num(Reserve_GPIOS6) \
212 gpio_name_to_num(Reserve_GPIOS7)
213
214#define name_gpioT \
215 gpio_name_to_num(Reserve_GPIOT0) \
216 gpio_name_to_num(Reserve_GPIOT1) \
217 gpio_name_to_num(Reserve_GPIOT2) \
218 gpio_name_to_num(Reserve_GPIOT3) \
219 gpio_name_to_num(Reserve_GPIOT4) \
220 gpio_name_to_num(Reserve_GPIOT5) \
221 gpio_name_to_num(Reserve_GPIOT6) \
222 gpio_name_to_num(Reserve_GPIOT7)
223
224#define name_gpioU \
225 gpio_name_to_num(Reserve_GPIOU0) \
226 gpio_name_to_num(Reserve_GPIOU1) \
227 gpio_name_to_num(Reserve_GPIOU2) \
228 gpio_name_to_num(Reserve_GPIOU3) \
229 gpio_name_to_num(Reserve_GPIOU4) \
230 gpio_name_to_num(Reserve_GPIOU5) \
231 gpio_name_to_num(Reserve_GPIOU6) \
232 gpio_name_to_num(Reserve_GPIOU7)
233
234// clang-format on
235
236#define gpio_name_to_num(x) x,
242
243extern enum _GPIO_NUMS_ GPIO_NUMS;
244#undef gpio_name_to_num
245
246extern char *gpio_name[];
247
248#endif
char * gpio_name[]
Definition: hal_gpio.c:49
_GPIO_NUMS_
Definition: plat_gpio.h:228
enum _GPIO_NUMS_ GPIO_NUMS
#define name_gpioO
Definition: plat_gpio.h:164
#define name_gpioK
Definition: plat_gpio.h:124
#define name_gpioH
Definition: plat_gpio.h:94
#define name_gpioF
Definition: plat_gpio.h:74
#define name_gpioQ
Definition: plat_gpio.h:184
#define name_gpioR
Definition: plat_gpio.h:194
#define name_gpioP
Definition: plat_gpio.h:174
#define name_gpioE
Definition: plat_gpio.h:64
#define name_gpioL
Definition: plat_gpio.h:134
#define name_gpioC
Definition: plat_gpio.h:44
#define name_gpioD
Definition: plat_gpio.h:54
#define name_gpioT
Definition: plat_gpio.h:214
#define name_gpioN
Definition: plat_gpio.h:154
#define name_gpioM
Definition: plat_gpio.h:144
#define name_gpioI
Definition: plat_gpio.h:104
#define name_gpioB
Definition: plat_gpio.h:34
#define name_gpioJ
Definition: plat_gpio.h:114
#define name_gpioA
Definition: plat_gpio.h:24
#define name_gpioG
Definition: plat_gpio.h:84
#define name_gpioS
Definition: plat_gpio.h:204
#define name_gpioU
Definition: plat_gpio.h:224