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(HSC_TYPE) \
26 gpio_name_to_num(H_CPU_MON_FAIL_LVC3_N) \
27 gpio_name_to_num(FM_SLPS3_LVC3_N) \
28 gpio_name_to_num(IRQ_BMC_NMI) \
29 gpio_name_to_num(IRQ_UV_DETECT_N) \
30 gpio_name_to_num(FM_UV_ADR_TRIGGER_EN_R) \
31 gpio_name_to_num(Reserve_GPIOA6) \
32 gpio_name_to_num(HSC_SET_EN_R)
33
34#define name_gpioB \
35 gpio_name_to_num(Reserve_GPIOB0) \
36 gpio_name_to_num(RST_USB_HUB_N_R) \
37 gpio_name_to_num(A_P3V_BAT_SCALED_EN_R) \
38 gpio_name_to_num(DAM_BIC_R_EN) \
39 gpio_name_to_num(Reserve_GPIOB4) \
40 gpio_name_to_num(FM_SLPS4_PLD_N) \
41 gpio_name_to_num(FM_CPU0_CD_INIT_ERROR) \
42 gpio_name_to_num(Reserve_GPIOB7)
43
44#define name_gpioC \
45 gpio_name_to_num(FM_HSC_TIMER) \
46 gpio_name_to_num(IRQ_SMB_IO_LVC3_STBY_ALRT_N) \
47 gpio_name_to_num(IRQ_PVCCD_CPU0_VRHOT_LVC3_N) \
48 gpio_name_to_num(DBP_CPU_PREQ_BIC_N) \
49 gpio_name_to_num(FM_CPU_THERMTRIP_LATCH_LVT3_N) \
50 gpio_name_to_num(FM_CPU_SKTOCC_LVT3_PLD_N) \
51 gpio_name_to_num(H_CPU_MEMHOT_OUT_LVC3_N) \
52 gpio_name_to_num(RST_PLTRST_SYNC_LVC3_N)
53
54#define name_gpioD \
55 gpio_name_to_num(PWRBTN_N) \
56 gpio_name_to_num(RST_BMC_R_N) \
57 gpio_name_to_num(H_BMC_PRDY_BUF_N) \
58 gpio_name_to_num(BMC_READY) \
59 gpio_name_to_num(BIC_READY) \
60 gpio_name_to_num(FM_RMCA_LVT3_N) \
61 gpio_name_to_num(PWRGD_AUX_PWRGD_BMC_LVC3) \
62 gpio_name_to_num(FM_FORCE_ADR_N_R)
63
64#define name_gpioE \
65 gpio_name_to_num(PWRGD_CPU_LVC3) \
66 gpio_name_to_num(Reserve_GPIOE1) \
67 gpio_name_to_num(Reserve_GPIOE2) \
68 gpio_name_to_num(IRQ_HSC_ALERT2_N) \
69 gpio_name_to_num(SMB_SENSOR_LVC3_ALERT_N) \
70 gpio_name_to_num(FM_CATERR_LVT3_N) \
71 gpio_name_to_num(SYS_PWRBTN_LVC3_N) \
72 gpio_name_to_num(RST_PLTRST_BUF_N)
73
74#define name_gpioF \
75 gpio_name_to_num(Reserve_GPIOF0) \
76 gpio_name_to_num(IRQ_SML1_PMBUS_ALERT_N) \
77 gpio_name_to_num(Reserve_GPIOF2) \
78 gpio_name_to_num(FM_BMC_DEBUG_ENABLE_R_N) \
79 gpio_name_to_num(FM_DBP_PRESENT_N) \
80 gpio_name_to_num(FM_FAST_PROCHOT_EN_R_N) \
81 gpio_name_to_num(Reserve_GPIOF6) \
82 gpio_name_to_num(FBRK_R_N)
83
84#define name_gpioG \
85 gpio_name_to_num(FM_PEHPCPU_INT) \
86 gpio_name_to_num(Reserve_GPIOF1) \
87 gpio_name_to_num(FAST_PROCHOT_N) \
88 gpio_name_to_num(Reserve_GPIOF3) \
89 gpio_name_to_num(BMC_JTAG_SEL_R) \
90 gpio_name_to_num(H_CPU_ERR0_LVC3_R_N) \
91 gpio_name_to_num(H_CPU_ERR1_LVC3_R_N) \
92 gpio_name_to_num(H_CPU_ERR2_LVC3_R_N)
93
94#define name_gpioH \
95 gpio_name_to_num(Reserve_GPIOH0) \
96 gpio_name_to_num(FM_MP_PS_FAIL_N) \
97 gpio_name_to_num(H_CPU_MEMTRIP_LVC3_N) \
98 gpio_name_to_num(FM_CPU_BIC_PROCHOT_LVT3_N) \
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(AUTH_COMPLETE) \
138 gpio_name_to_num(BOARD_ID2) \
139 gpio_name_to_num(IRQ_PVCCIN_CPU0_VRHOT_N) \
140 gpio_name_to_num(IRQ_PVCCINF_CPU0_VRHOT_N) \
141 gpio_name_to_num(BOARD_ID0) \
142 gpio_name_to_num(BOARD_ID1)
143
144#define name_gpioM \
145 gpio_name_to_num(Reserve_GPIOM0) \
146 gpio_name_to_num(BOARD_ID3) \
147 gpio_name_to_num(Reserve_GPIOM2) \
148 gpio_name_to_num(AUTH_PRSNT_N) \
149 gpio_name_to_num(UART_RSVD_RXD) \
150 gpio_name_to_num(UART_RSVD_R_TXD) \
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(Reserve_GPION3) \
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(Reserve_GPIOP6) \
182 gpio_name_to_num(Reserve_GPIOP7)
183
184#define name_gpioQ \
185 gpio_name_to_num(Reserve_GPIOQ0) \
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
250
251#endif
char * gpio_name[]
Definition: hal_gpio.c:49
_GPIO_NUMS_
Definition: plat_gpio.h:228
enum _GPIO_NUMS_ GPIO_NUMS
void enable_PRDY_interrupt()
Definition: plat_gpio.c:265
void disable_PRDY_interrupt()
Definition: plat_gpio.c:270
#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