coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <baseboard/gpio.h>
4 #include <baseboard/variants.h>
5 #include <commonlib/helpers.h>
6 
7 /* Pad configuration in ramstage */
8 static const struct pad_config gpio_table[] = {
9  /* A10 : WWAN_EN => LTE_PWR_OFF_ODL */
10  PAD_CFG_GPO(GPP_A10, 1, PWROK),
11 
12  /* B7 : WWAN_SAR_DETECT_R_ODL */
13  PAD_CFG_GPO(GPP_B7, 1, DEEP),
14 
15  /* C12 : AP_PEN_DET_ODL */
16  PAD_CFG_GPI_GPIO_DRIVER(GPP_C12, UP_20K, DEEP),
17  /* C18 : AP_I2C_EMR_SDA */
19  /* C19 : AP_I2C_EMR_SCL */
21  /* C22 : UART2_RTS_N */
23  /* C23 : UART2_CTS_N */
25 
26  /* D12 : WCAM_RST_L */
28  /* D13 : EN_PP2800_CAMERA */
29  PAD_CFG_GPO(GPP_D13, 1, PLTRST),
30  /* D14 : EN_PP1200_CAMERA */
32  /* D15 : UCAM_RST_L */
34  /* D19 : WWAN_WLAN_COEX1 */
36  /* D20 : WWAN_WLAN_COEX2 */
38  /* D21 : WWAN_WLAN_COEX3 */
40  /* D22 : AP_I2C_SUB_SDA*/
41  PAD_CFG_NF(GPP_D22, NONE, DEEP, NF1),
42  /* D23 : AP_I2C_SUB_SCL */
43  PAD_CFG_NF(GPP_D23, NONE, DEEP, NF1),
44 
45  /* E0 : CLK_24M_UCAM */
46  PAD_NC(GPP_E0, NONE),
47  /* E2 : CLK_24M_WCAM */
48  PAD_NC(GPP_E2, NONE),
49  /* E11 : AP_I2C_SUB_INT_ODL */
50  PAD_CFG_GPI_APIC(GPP_E11, NONE, PLTRST, LEVEL, NONE),
51 
52  /* H6 : AP_I2C_CAM_SDA */
53  PAD_NC(GPP_H6, NONE),
54  /* H7 : AP_I2C_CAM_SCL */
55  PAD_NC(GPP_H7, NONE),
56  /* H17 : WWAN_RST_L => LTE_RESET_R_ODL */
57  PAD_CFG_GPO(GPP_H17, 0, PLTRST),
58 };
59 
60 const struct pad_config *variant_override_gpio_table(size_t *num)
61 {
62  *num = ARRAY_SIZE(gpio_table);
63  return gpio_table;
64 }
#define GPP_C12
#define GPP_E0
#define GPP_D14
#define GPP_H17
#define GPP_D12
#define GPP_H6
#define GPP_C22
#define GPP_C23
#define GPP_H7
#define GPP_C18
#define GPP_E2
#define GPP_A10
#define GPP_D13
#define GPP_C19
#define GPP_D19
#define GPP_E11
#define GPP_D15
#define GPP_B7
Definition: gpio_soc_defs.h:60
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define GPP_D23
#define GPP_D22
#define GPP_D21
#define GPP_D20
const struct pad_config *__weak variant_override_gpio_table(size_t *num)
Definition: gpio.c:450
static const struct pad_config gpio_table[]
Definition: gpio.c:8
#define PAD_NC(pin)
Definition: gpio_defs.h:263
#define PAD_CFG_NF(pad, pull, rst, func)
Definition: gpio_defs.h:197
#define PAD_CFG_GPI_APIC(pad, pull, rst, trig, inv)
Definition: gpio_defs.h:376
#define PAD_CFG_GPO(pad, val, rst)
Definition: gpio_defs.h:247
#define PAD_CFG_GPI_GPIO_DRIVER(pad, pull, rst)
Definition: gpio_defs.h:323