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
22void gpio_int_default();
23
24// clang-format off
25
26// gpio_cfg(chip, number, is_init, direction, status, int_type, int_callback)
27// dedicate gpio A0~A7, B0~B7, C0~C7, D0~D7, E0~E7, total 40 gpios
28// Default name: Reserve_GPIOH0
29#define name_gpio0 \
30 gpio_name_to_num(FM_ASIC_0_THERMTRIP_R_N) \
31 gpio_name_to_num(RST_ATH_PWR_ON_PLD_R1_N) \
32 gpio_name_to_num(ATH_CURRENT_SENSE_0_NPCM_R) \
33 gpio_name_to_num(ATH_CURRENT_SENSE_1_NPCM_R) \
34 gpio_name_to_num(FM_ATH_HBM3_CATTRIP_ALARM_LV33_R) \
35 gpio_name_to_num(ALL_VR_PM_ALERT_R_N) \
36 gpio_name_to_num(ATH_SMB_ALERT_NPCM_LVC33_R_N) \
37 gpio_name_to_num(FM_PLD_UBC_EN_R)
38#define name_gpio1 \
39 gpio_name_to_num(RSVD_GPIO_2_R) \
40 gpio_name_to_num(Reserve_GPIO11) \
41 gpio_name_to_num(Reserve_GPIO12) \
42 gpio_name_to_num(Reserve_GPIO13) \
43 gpio_name_to_num(Reserve_GPIO14) \
44 gpio_name_to_num(Reserve_GPIO15) \
45 gpio_name_to_num(Reserve_GPIO16) \
46 gpio_name_to_num(Reserve_GPIO17)
47#define name_gpio2 \
48 gpio_name_to_num(Reserve_GPIO20) \
49 gpio_name_to_num(Reserve_GPIO21) \
50 gpio_name_to_num(Reserve_GPIO22) \
51 gpio_name_to_num(Reserve_GPIO23) \
52 gpio_name_to_num(Reserve_GPIO24) \
53 gpio_name_to_num(Reserve_GPIO25) \
54 gpio_name_to_num(Reserve_GPIO26) \
55 gpio_name_to_num(Reserve_GPIO27)
56#define name_gpio3 \
57 gpio_name_to_num(Reserve_GPIO30) \
58 gpio_name_to_num(Reserve_GPIO31) \
59 gpio_name_to_num(Reserve_GPIO32) \
60 gpio_name_to_num(Reserve_GPIO33) \
61 gpio_name_to_num(Reserve_GPIO34) \
62 gpio_name_to_num(Reserve_GPIO35) \
63 gpio_name_to_num(Reserve_GPIO36) \
64 gpio_name_to_num(Reserve_GPIO37)
65#define name_gpio4 \
66 gpio_name_to_num(Reserve_GPIO40) \
67 gpio_name_to_num(Reserve_GPIO41) \
68 gpio_name_to_num(Reserve_GPIO42) \
69 gpio_name_to_num(Reserve_GPIO43) \
70 gpio_name_to_num(Reserve_GPIO44) \
71 gpio_name_to_num(Reserve_GPIO45) \
72 gpio_name_to_num(Reserve_GPIO46) \
73 gpio_name_to_num(Reserve_GPIO47)
74#define name_gpio5 \
75 gpio_name_to_num(Reserve_GPIO50) \
76 gpio_name_to_num(Reserve_GPIO51) \
77 gpio_name_to_num(Reserve_GPIO52) \
78 gpio_name_to_num(Reserve_GPIO53) \
79 gpio_name_to_num(Reserve_GPIO54) \
80 gpio_name_to_num(Reserve_GPIO55) \
81 gpio_name_to_num(Reserve_GPIO56) \
82 gpio_name_to_num(Reserve_GPIO57)
83#define name_gpio6 \
84 gpio_name_to_num(Reserve_GPIO60) \
85 gpio_name_to_num(Reserve_GPIO61) \
86 gpio_name_to_num(Reserve_GPIO62) \
87 gpio_name_to_num(Reserve_GPIO63) \
88 gpio_name_to_num(Reserve_GPIO64) \
89 gpio_name_to_num(Reserve_GPIO65) \
90 gpio_name_to_num(Reserve_GPIO66) \
91 gpio_name_to_num(Reserve_GPIO67)
92#define name_gpio7 \
93 gpio_name_to_num(Reserve_GPIO70) \
94 gpio_name_to_num(Reserve_GPIO71) \
95 gpio_name_to_num(Reserve_GPIO72) \
96 gpio_name_to_num(Reserve_GPIO73) \
97 gpio_name_to_num(GPIO74_Strap_DSW_EN) \
98 gpio_name_to_num(GPIO75_Strap_JEN_N) \
99 gpio_name_to_num(Reserve_GPIO76) \
100 gpio_name_to_num(Reserve_GPIO77)
101#define name_gpio8 \
102 gpio_name_to_num(Reserve_GPIO80) \
103 gpio_name_to_num(Reserve_GPIO81) \
104 gpio_name_to_num(LED_NPCM_HEARTBEAT_R) \
105 gpio_name_to_num(Reserve_GPIO83) \
106 gpio_name_to_num(Reserve_GPIO84) \
107 gpio_name_to_num(Reserve_GPIO85) \
108 gpio_name_to_num(Reserve_GPIO86) \
109 gpio_name_to_num(Reserve_GPIO87)
110#define name_gpio9 \
111 gpio_name_to_num(Reserve_GPIO90) \
112 gpio_name_to_num(Reserve_GPIO91) \
113 gpio_name_to_num(Reserve_GPIO92) \
114 gpio_name_to_num(Reserve_GPIO93) \
115 gpio_name_to_num(Reserve_GPIO94) \
116 gpio_name_to_num(Reserve_GPIO95) \
117 gpio_name_to_num(Reserve_GPIO96) \
118 gpio_name_to_num(Reserve_GPIO97)
119#define name_gpioA \
120 gpio_name_to_num(Reserve_GPIOA0) \
121 gpio_name_to_num(Reserve_GPIOA1) \
122 gpio_name_to_num(Reserve_GPIOA2) \
123 gpio_name_to_num(Reserve_GPIOA3) \
124 gpio_name_to_num(Reserve_GPIOA4) \
125 gpio_name_to_num(Reserve_GPIOA5) \
126 gpio_name_to_num(Reserve_GPIOA6) \
127 gpio_name_to_num(Reserve_GPIOA7)
128#define name_gpioB \
129 gpio_name_to_num(RSVD_GPIO_1_R) \
130 gpio_name_to_num(Reserve_GPIOB1) \
131 gpio_name_to_num(Reserve_GPIOB2) \
132 gpio_name_to_num(Reserve_GPIOB3) \
133 gpio_name_to_num(Reserve_GPIOB4) \
134 gpio_name_to_num(Reserve_GPIOB5) \
135 gpio_name_to_num(Reserve_GPIOB6) \
136 gpio_name_to_num(Reserve_GPIOB7)
137#define name_gpioC \
138 gpio_name_to_num(Reserve_GPIOC0) \
139 gpio_name_to_num(Reserve_GPIOC1) \
140 gpio_name_to_num(Reserve_GPIOC2) \
141 gpio_name_to_num(Reserve_GPIOC3) \
142 gpio_name_to_num(Reserve_GPIOC4) \
143 gpio_name_to_num(Reserve_GPIOC5) \
144 gpio_name_to_num(Reserve_GPIOC6) \
145 gpio_name_to_num(Reserve_GPIOC7)
146#define name_gpioD \
147 gpio_name_to_num(Reserve_GPIOD0) \
148 gpio_name_to_num(Reserve_GPIOD1) \
149 gpio_name_to_num(Reserve_GPIOD2) \
150 gpio_name_to_num(Reserve_GPIOD3) \
151 gpio_name_to_num(Reserve_GPIOD4) \
152 gpio_name_to_num(Reserve_GPIOD5) \
153 gpio_name_to_num(Reserve_GPIOD6) \
154 gpio_name_to_num(Reserve_GPIOD7)
155#define name_gpioE \
156 gpio_name_to_num(Reserve_GPIOE0) \
157 gpio_name_to_num(Reserve_GPIOE1) \
158 gpio_name_to_num(Reserve_GPIOE2) \
159 gpio_name_to_num(Reserve_GPIOE3) \
160 gpio_name_to_num(Reserve_GPIOE4) \
161 gpio_name_to_num(Reserve_GPIOE5) \
162 gpio_name_to_num(Reserve_GPIOE6) \
163 gpio_name_to_num(Reserve_GPIOE7)
164#define name_gpioF \
165 gpio_name_to_num(Reserve_GPIOF0) \
166 gpio_name_to_num(Reserve_GPIOF1) \
167 gpio_name_to_num(Reserve_GPIOF2) \
168 gpio_name_to_num(Reserve_GPIOF3)
169
170// clang-format on
171
172#define gpio_name_to_num(x) x,
178
179extern enum _GPIO_NUMS_ GPIO_NUMS;
180#undef gpio_name_to_num
181
182extern char *gpio_name[];
183
184#endif
char * gpio_name[]
Definition: hal_gpio.c:49
_GPIO_NUMS_
Definition: plat_gpio.h:228
enum _GPIO_NUMS_ GPIO_NUMS
void gpio_int_default()
Definition: plat_gpio.c:33
#define name_gpio4
Definition: plat_gpio.h:65
#define name_gpio8
Definition: plat_gpio.h:101
#define name_gpioF
Definition: plat_gpio.h:164
#define name_gpio2
Definition: plat_gpio.h:47
#define name_gpio1
Definition: plat_gpio.h:38
#define name_gpioE
Definition: plat_gpio.h:155
#define name_gpioC
Definition: plat_gpio.h:137
#define name_gpioD
Definition: plat_gpio.h:146
#define name_gpio6
Definition: plat_gpio.h:83
#define name_gpio5
Definition: plat_gpio.h:74
#define name_gpioB
Definition: plat_gpio.h:128
#define name_gpioA
Definition: plat_gpio.h:119
#define name_gpio9
Definition: plat_gpio.h:110
#define name_gpio3
Definition: plat_gpio.h:56
#define name_gpio0
Definition: plat_gpio.h:29
#define name_gpio7
Definition: plat_gpio.h:92