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-only */
2 
3 #include <types.h>
4 
5 #include "gpio.h"
6 
7 /* Pad configuration in ramstage */
8 static const struct pad_config gpio_table[] = {
9  /* ------- GPIO Group GPP_A ------- */
10  PAD_CFG_NF(GPP_A14, NONE, DEEP, NF1), /* USB_2_3_OC_N */
11  PAD_CFG_NF(GPP_A15, NONE, DEEP, NF1), /* USB_4_5_OC_N */
12  PAD_CFG_NF(GPP_A16, NONE, DEEP, NF1), /* USB_6_7_OC_N */
13  PAD_CFG_NF(GPP_A18, NONE, DEEP, NF1), /* DP1_HPD */
14  PAD_CFG_NF(GPP_A19, NONE, DEEP, NF1), /* DP2_HPD */
15  PAD_CFG_NF(GPP_A20, NONE, DEEP, NF1), /* DP3_HPD */
16  PAD_NC(GPP_A23, NONE), /* ESPI_CS1 */
17 
18  /* ------- GPIO Group GPP_B ------- */
19  PAD_CFG_NF(GPP_B0, NONE, DEEP, NF1), /* AUX_VID0 */
20  PAD_CFG_NF(GPP_B1, NONE, DEEP, NF1), /* AUX_VID1 */
21  PAD_CFG_NF(GPP_B14, NONE, DEEP, NF1), /* SATA_SPKR_N */
23  PAD_NC(GPP_B23, NONE), /* SML1_ALERT */
24 
25  /* ------- GPIO Group GPP_C ------- */
26  PAD_NC(GPP_C5, NONE), /* SML0_ALERT */
27  PAD_CFG_NF(GPP_C6, NONE, DEEP, NF1), /* SML1_CLK */
28  PAD_CFG_NF(GPP_C7, NONE, DEEP, NF1), /* SML1_DATA */
29 
30  /* ------- GPIO Group GPP_D ------- */
31  PAD_NC(GPP_D9, NONE),
35 
36  /* ------- GPIO Group GPP_E ------- */
37  PAD_NC(GPP_E0, NONE),
38  PAD_CFG_GPI(GPP_E3, NONE, DEEP), /* TPM INT (todo: check) */
39  PAD_CFG_GPI(GPP_E6, NONE, DEEP),
40  PAD_CFG_GPI_SMI_LOW(GPP_E7, NONE, DEEP, EDGE_SINGLE), /* EC SMI# */
41  PAD_CFG_GPO(GPP_E8, 1, DEEP), /* PERST_CB_RESET_N */
42  PAD_CFG_NF(GPP_E9, NONE, DEEP, NF1), /* USB_0_1_OC_N */
43  PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1), /* DP0_HPD (VGA_RED) */
46  PAD_CFG_NF(GPP_E18, NONE, DEEP, NF1), /* DP3_DDC_CTRLCLK */
47  PAD_CFG_NF(GPP_E19, NONE, DEEP, NF1), /* DP3_DDC_CTRLDATA */
48  PAD_CFG_NF(GPP_E20, NONE, DEEP, NF1), /* DP2_DDC_CTRLCLK */
49  PAD_CFG_NF(GPP_E21, NONE, DEEP, NF1), /* DP2_DDC_CTRLDATA */
50  PAD_CFG_NF(GPP_E22, NONE, DEEP, NF1), /* DP0_DDC_CTRLCLK */
51  PAD_CFG_NF(GPP_E23, NONE, DEEP, NF1), /* DP0_DDC_CTRLDATA */
52 
53  /* ------- GPIO Group GPP_F ------- */
54  PAD_NC(GPP_F0, NONE),
55  PAD_NC(GPP_F1, NONE),
56  PAD_CFG_GPI(GPP_F2, NONE, DEEP),
57  PAD_NC(GPP_F3, NONE),
58  PAD_NC(GPP_F5, NONE),
59  PAD_CFG_GPO(GPP_F9, 1, DEEP), /* EC_SLP_S0_CS_N */
60  PAD_CFG_GPI(GPP_F12, NONE, DEEP),
61  PAD_CFG_GPI(GPP_F13, NONE, DEEP),
64  PAD_CFG_GPO(GPP_F22, 1, DEEP), /* PERST_PHY0_N */
65 
66  /* ------- GPIO Group GPP_H ------- */
67  PAD_CFG_NF(GPP_H15, NONE, DEEP, NF1), /* DDPB_CTRLCLK */
68  PAD_CFG_NF(GPP_H17, NONE, DEEP, NF1), /* DDPB_CTRLDATA */
69 
70  /* ------- GPIO Group GPP_R ------- */
71  PAD_CFG_NF(GPP_R5, NONE, DEEP, NF1), /* HDA_SDI1 */
72 
73  /* ------- GPIO Group GPP_T ------- */
74  PAD_NC(GPP_T2, NONE),
75  PAD_NC(GPP_T3, NONE),
76 
77  /* ------- GPIO Group GPD ------- */
78  PAD_NC(GPD8, NONE), /* SUSCLK */
79  PAD_CFG_GPO(GPD11, 1, PLTRST), /* LAN_DISABLE_N */
80 };
81 
83 {
85 }
#define GPD11
#define GPP_T3
Definition: gpio_soc_defs.h:94
#define GPP_D10
#define GPP_E3
#define GPP_A18
#define GPP_F21
#define GPP_F12
#define GPP_H15
#define GPP_E0
#define GPP_B1
Definition: gpio_soc_defs.h:54
#define GPP_F20
#define GPP_C5
#define GPP_A14
#define GPP_H17
#define GPP_D12
#define GPP_E6
#define GPP_F0
#define GPP_A19
#define GPP_D9
#define GPP_F5
#define GPP_D11
#define GPP_A23
#define GPP_F9
#define GPP_E14
#define GPP_E23
#define GPP_E9
#define GPP_E8
#define GPP_A20
#define GPP_A16
#define GPP_F1
#define GPP_C6
#define GPP_E7
#define GPP_F13
#define GPP_E19
#define GPP_E18
#define GPP_B14
Definition: gpio_soc_defs.h:67
#define GPP_B18
Definition: gpio_soc_defs.h:71
#define GPP_B0
Definition: gpio_soc_defs.h:53
#define GPP_R5
#define GPP_E20
#define GPP_A15
#define GPD8
#define GPP_B23
Definition: gpio_soc_defs.h:76
#define GPP_E15
#define GPP_E16
#define GPP_T2
Definition: gpio_soc_defs.h:93
#define GPP_F2
#define GPP_F22
#define GPP_F3
#define GPP_E22
#define GPP_E21
#define GPP_C7
#define ARRAY_SIZE(a)
Definition: helpers.h:12
void configure_gpio_pads(void)
Definition: gpio.c:82
static const struct pad_config gpio_table[]
Definition: gpio.c:8
void gpio_configure_pads(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
program a particular set of GPIO
Definition: gpio.c:307
#define PAD_NC(pin)
Definition: gpio_defs.h:263
#define PAD_CFG_GPI(pad, pull, rst)
Definition: gpio_defs.h:284
#define PAD_CFG_NF(pad, pull, rst, func)
Definition: gpio_defs.h:197
#define PAD_CFG_GPO(pad, val, rst)
Definition: gpio_defs.h:247
#define PAD_CFG_GPI_SMI_LOW(pad, pull, rst, trig)
Definition: gpio_defs.h:425