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 <baseboard/variants.h>
4
#include <
commonlib/helpers.h
>
5
6
/* Pad configuration in ramstage */
7
static
const
struct
pad_config
gpio_table
[] = {
8
9
/* Community 0 - GpioGroup GPP_B */
10
PAD_CFG_NF
(
GPP_B2
,
NONE
, PLTRST, NF1),
/* PMC_VRALERT_N */
11
PAD_CFG_NF
(
GPP_B3
,
NONE
, PLTRST, NF4),
/* ESPI_ALERT0_N */
12
PAD_NC
(
GPP_B4
,
NONE
),
/* Not connected */
13
PAD_NC
(
GPP_B9
,
NONE
),
/* Not connected */
14
PAD_NC
(
GPP_B10
,
NONE
),
/* Not connected */
15
PAD_CFG_NF
(
GPP_B11
,
NONE
, PLTRST, NF1),
/* PMC_ALERT_N */
16
PAD_NC
(
GPP_B14
,
NONE
),
/* Not connected */
17
PAD_CFG_NF
(
GPP_B15
,
NONE
, PLTRST, NF5),
/* ESPI_CS1_N */
18
PAD_NC
(
GPP_B18
,
NONE
),
/* Not connected */
19
PAD_NC
(
GPP_B19
,
NONE
),
/* Not connected */
20
PAD_NC
(
GPP_B23
,
NONE
),
/* Not connected */
21
22
/* Community 0 - GpioGroup GPP_T */
23
PAD_CFG_NF
(
GPP_T4
,
NONE
, DEEP, NF1),
/* PSE_GBE0_INT */
24
PAD_CFG_GPO
(
GPP_T5
, 1, DEEP),
/* PSE_GBE0_RST_N */
25
PAD_CFG_NF
(
GPP_T6
,
NONE
, DEEP, NF1),
/* PSE_GBE0_AUXTS */
26
PAD_CFG_NF
(
GPP_T7
,
NONE
, DEEP, NF1),
/* PSE_GBE0_PPS */
27
PAD_CFG_NF
(
GPP_T12
,
NONE
, DEEP, NF2),
/* SIO_UART0_RXD */
28
PAD_CFG_NF
(
GPP_T13
,
NONE
, DEEP, NF2),
/* SIO_UART0_TXD */
29
30
/* Community 0 - GpioGroup GPP_G */
31
PAD_NC
(
GPP_G8
,
NONE
),
/* Not connected */
32
PAD_NC
(
GPP_G9
,
NONE
),
/* Not connected */
33
PAD_CFG_GPI
(
GPP_G19
, UP_20K, PLTRST),
/* TPM_IRQ_N */
34
35
/* Community 1 - GpioGroup GPP_V */
36
PAD_CFG_NF
(
GPP_V0
, UP_20K, DEEP, NF1),
/* EMMC_CMD */
37
PAD_CFG_NF
(
GPP_V1
, UP_20K, DEEP, NF1),
/* EMMC_DATA0 */
38
PAD_CFG_NF
(
GPP_V2
, UP_20K, DEEP, NF1),
/* EMMC_DATA1 */
39
PAD_CFG_NF
(
GPP_V3
, UP_20K, DEEP, NF1),
/* EMMC_DATA2 */
40
PAD_CFG_NF
(
GPP_V4
, UP_20K, DEEP, NF1),
/* EMMC_DATA3 */
41
PAD_CFG_NF
(
GPP_V5
, UP_20K, DEEP, NF1),
/* EMMC_DATA4 */
42
PAD_CFG_NF
(
GPP_V6
, UP_20K, DEEP, NF1),
/* EMMC_DATA5 */
43
PAD_CFG_NF
(
GPP_V7
, UP_20K, DEEP, NF1),
/* EMMC_DATA6 */
44
PAD_CFG_NF
(
GPP_V8
, UP_20K, DEEP, NF1),
/* EMMC_DATA7 */
45
PAD_CFG_NF
(
GPP_V9
, DN_20K, DEEP, NF1),
/* EMMC_RCLK */
46
PAD_CFG_NF
(
GPP_V10
, DN_20K, DEEP, NF1),
/* EMMC_CLK */
47
PAD_CFG_NF
(
GPP_V11
,
NONE
, DEEP, NF1),
/* EMMC_RESET */
48
49
/* Community 1 - GpioGroup GPP_H */
50
PAD_CFG_NF
(
GPP_H0
,
NONE
, DEEP, NF1),
/* PSE_GBE1_INT */
51
PAD_CFG_GPO
(
GPP_H1
, 1, DEEP),
/* PSE_GBE1_RST_N */
52
PAD_CFG_NF
(
GPP_H2
,
NONE
, DEEP, NF1),
/* PSE_GBE1_AUXTS */
53
PAD_CFG_NF
(
GPP_H3
,
NONE
, DEEP, NF1),
/* PSE_GBE1_PPS */
54
PAD_CFG_NF
(
GPP_H10
,
NONE
, DEEP, NF1),
/* PCIE_CLKREQ4_N */
55
PAD_CFG_NF
(
GPP_H11
,
NONE
, DEEP, NF1),
/* PCIE_CLKREQ5_N */
56
57
/* Community 1 - GpioGroup GPP_D */
58
PAD_CFG_NF
(
GPP_D5
,
NONE
, DEEP, NF1),
/* PCIE_CLKREQ0_N */
59
PAD_CFG_NF
(
GPP_D6
,
NONE
, DEEP, NF1),
/* PCIE_CLKREQ1_N */
60
PAD_CFG_NF
(
GPP_D7
,
NONE
, DEEP, NF1),
/* PCIE_CLKREQ2_N */
61
PAD_CFG_NF
(
GPP_D8
,
NONE
, DEEP, NF1),
/* PCIE_CLKREQ3_N */
62
63
/* Community 1 - GpioGroup GPP_U */
64
PAD_CFG_NF
(
GPP_U0
,
NONE
, DEEP, NF1),
/* GBE_INT */
65
PAD_CFG_GPO
(
GPP_U1
, 1, DEEP),
/* GBE_RST_N */
66
PAD_NC
(
GPP_U12
,
NONE
),
/* Not connected */
67
PAD_NC
(
GPP_U13
,
NONE
),
/* Not connected */
68
PAD_NC
(
GPP_U16
,
NONE
),
/* Not connected */
69
PAD_NC
(
GPP_U17
,
NONE
),
/* Not connected */
70
PAD_NC
(
GPP_U18
,
NONE
),
/* Not connected */
71
72
/* Community 2 - GpioGroup DSW */
73
PAD_CFG_NF
(
GPD1
,
NONE
, PLTRST, NF1),
/* ACPRESENT */
74
PAD_NC
(
GPD9
,
NONE
),
/* Not connected */
75
/* ONBOARD_X4_PCIE_SLOT1_RESET_N */
76
PAD_CFG_GPO
(
GPD11
, 1, PLTRST),
77
78
/* Community 3 - GpioGroup GPP_S */
79
PAD_NC
(
GPP_S0
,
NONE
),
/* Not connected */
80
PAD_NC
(
GPP_S1
,
NONE
),
/* Not connected */
81
82
/* Community 3 - GpioGroup GPP_A */
83
PAD_CFG_NF
(
GPP_A0
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_TXD3 */
84
PAD_CFG_NF
(
GPP_A1
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_TXD2 */
85
PAD_CFG_NF
(
GPP_A2
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_TXD1 */
86
PAD_CFG_NF
(
GPP_A3
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_TXD0 */
87
PAD_CFG_NF
(
GPP_A4
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_TXCLK */
88
PAD_CFG_NF
(
GPP_A5
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_TXCTL */
89
PAD_CFG_NF
(
GPP_A6
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_RXCLK */
90
PAD_CFG_NF
(
GPP_A7
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_RXD3 */
91
PAD_CFG_NF
(
GPP_A8
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_RXD2 */
92
PAD_CFG_NF
(
GPP_A9
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_RXD1 */
93
PAD_CFG_NF
(
GPP_A10
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_RXD0 */
94
PAD_CFG_NF
(
GPP_A11
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_TXD3 */
95
PAD_CFG_NF
(
GPP_A12
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_TXD2 */
96
PAD_CFG_NF
(
GPP_A13
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_TXD1 */
97
PAD_CFG_NF
(
GPP_A14
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_TXD0 */
98
PAD_CFG_NF
(
GPP_A15
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_TXCLK */
99
PAD_CFG_NF
(
GPP_A16
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_TXCTL */
100
PAD_CFG_NF
(
GPP_A17
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_RXCLK */
101
PAD_CFG_NF
(
GPP_A18
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_RXCTL */
102
PAD_CFG_NF
(
GPP_A19
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_RXD3 */
103
PAD_CFG_NF
(
GPP_A20
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_RXD2 */
104
PAD_CFG_NF
(
GPP_A21
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_RXD1 */
105
PAD_CFG_NF
(
GPP_A22
,
NONE
, DEEP, NF1),
/* PSE_GBE1_RGMII_RXD0 */
106
PAD_CFG_NF
(
GPP_A23
,
NONE
, DEEP, NF1),
/* PSE_GBE0_RGMII_RXCTL */
107
108
/* Community 4 - GpioGroup GPP_C */
109
PAD_CFG_NF
(
GPP_C3
,
NONE
, DEEP, NF1),
/* PSE_GBE0_MDC */
110
PAD_CFG_NF
(
GPP_C4
,
NONE
, DEEP, NF1),
/* PSE_GBE0_MDIO */
111
PAD_CFG_NF
(
GPP_C6
,
NONE
, DEEP, NF1),
/* PSE_GBE0_AUXTS */
112
PAD_CFG_NF
(
GPP_C7
,
NONE
, DEEP, NF1),
/* PSE_GBE0_PPS */
113
PAD_CFG_NF
(
GPP_C12
,
NONE
, DEEP, NF4),
/* SIO_UART1_RXD */
114
PAD_CFG_NF
(
GPP_C13
,
NONE
, DEEP, NF4),
/* SIO_UART1_TXD */
115
PAD_CFG_NF
(
GPP_C16
,
NONE
, DEEP, NF1),
/* GBE_MDIO */
116
PAD_CFG_NF
(
GPP_C17
,
NONE
, DEEP, NF1),
/* GBE_MDC */
117
118
/* Community 4 - GpioGroup GPP_F */
119
PAD_NC
(
GPP_F1
,
NONE
),
/* Not connected */
120
PAD_NC
(
GPP_F3
,
NONE
),
/* Not connected */
121
PAD_NC
(
GPP_F8
,
NONE
),
/* Not connected */
122
PAD_NC
(
GPP_F11
,
NONE
),
/* Not connected */
123
PAD_NC
(
GPP_F12
,
NONE
),
/* Not connected */
124
PAD_NC
(
GPP_F13
,
NONE
),
/* Not connected */
125
PAD_NC
(
GPP_F14
,
NONE
),
/* Not connected */
126
PAD_NC
(
GPP_F15
,
NONE
),
/* Not connected */
127
PAD_NC
(
GPP_F16
,
NONE
),
/* Not connected */
128
PAD_NC
(
GPP_F17
,
NONE
),
/* Not connected */
129
PAD_CFG_GPO
(
GPP_F20
, 0, DEEP),
/* LED_BIOS_DONE */
130
131
/* Community 4 - GpioGroup GPP_E */
132
PAD_CFG_NF
(
GPP_E0
,
NONE
, DEEP, NF1),
/* SATA_LED_N */
133
PAD_CFG_NF
(
GPP_E8
,
NONE
, DEEP, NF2),
/* M.2_SSD_SATA_DEVSLP_1 */
134
PAD_NC
(
GPP_E15
,
NONE
),
/* Not connected */
135
PAD_NC
(
GPP_E16
,
NONE
),
/* Not connected */
136
PAD_NC
(
GPP_E18
,
NONE
),
/* Not connected */
137
PAD_CFG_NF
(
GPP_E19
,
NONE
, DEEP, NF1),
/* DDI0_DDC_SCL */
138
PAD_NC
(
GPP_E23
,
NONE
),
/* Not connected */
139
140
/* Community 5 - GpioGroup GPP_R */
141
PAD_NC
(
GPP_R1
,
NONE
),
/* Not connected */
142
PAD_NC
(
GPP_R3
,
NONE
),
/* Not connected */
143
};
144
145
/* Early pad configuration in bootblock */
146
static
const
struct
pad_config
early_gpio_table
[] = {
147
};
148
149
const
struct
pad_config
*
variant_gpio_table
(
size_t
*num)
150
{
151
*num =
ARRAY_SIZE
(
gpio_table
);
152
return
gpio_table
;
153
}
154
155
const
struct
pad_config
*
variant_early_gpio_table
(
size_t
*num)
156
{
157
*num =
ARRAY_SIZE
(
early_gpio_table
);
158
return
early_gpio_table
;
159
}
GPD11
#define GPD11
Definition:
gpio_soc_defs.h:392
GPP_T7
#define GPP_T7
Definition:
gpio_soc_defs.h:98
GPP_A4
#define GPP_A4
Definition:
gpio_soc_defs.h:123
GPD9
#define GPD9
Definition:
gpio_soc_defs.h:390
GPP_D8
#define GPP_D8
Definition:
gpio_soc_defs.h:260
GPP_A18
#define GPP_A18
Definition:
gpio_soc_defs.h:137
GPP_C12
#define GPP_C12
Definition:
gpio_soc_defs.h:549
GPP_F12
#define GPP_F12
Definition:
gpio_soc_defs.h:585
GPP_F16
#define GPP_F16
Definition:
gpio_soc_defs.h:589
GPP_E0
#define GPP_E0
Definition:
gpio_soc_defs.h:628
GPP_F20
#define GPP_F20
Definition:
gpio_soc_defs.h:593
GPP_S0
#define GPP_S0
Definition:
gpio_soc_defs.h:160
GPP_H11
#define GPP_H11
Definition:
gpio_soc_defs.h:227
GPP_A14
#define GPP_A14
Definition:
gpio_soc_defs.h:133
GPP_A5
#define GPP_A5
Definition:
gpio_soc_defs.h:124
GPP_B2
#define GPP_B2
Definition:
gpio_soc_defs.h:55
GPP_D7
#define GPP_D7
Definition:
gpio_soc_defs.h:259
GPP_R3
#define GPP_R3
Definition:
gpio_soc_defs.h:672
GPP_D6
#define GPP_D6
Definition:
gpio_soc_defs.h:258
GPP_A19
#define GPP_A19
Definition:
gpio_soc_defs.h:138
GPP_H2
#define GPP_H2
Definition:
gpio_soc_defs.h:218
GPP_T12
#define GPP_T12
Definition:
gpio_soc_defs.h:103
GPP_B15
#define GPP_B15
Definition:
gpio_soc_defs.h:68
GPP_A2
#define GPP_A2
Definition:
gpio_soc_defs.h:121
GPP_A6
#define GPP_A6
Definition:
gpio_soc_defs.h:125
GPP_H1
#define GPP_H1
Definition:
gpio_soc_defs.h:217
GPP_D5
#define GPP_D5
Definition:
gpio_soc_defs.h:257
GPP_A23
#define GPP_A23
Definition:
gpio_soc_defs.h:142
GPP_C13
#define GPP_C13
Definition:
gpio_soc_defs.h:550
GPP_T13
#define GPP_T13
Definition:
gpio_soc_defs.h:104
GPP_E23
#define GPP_E23
Definition:
gpio_soc_defs.h:651
GPP_C17
#define GPP_C17
Definition:
gpio_soc_defs.h:554
GPP_E8
#define GPP_E8
Definition:
gpio_soc_defs.h:636
GPP_A7
#define GPP_A7
Definition:
gpio_soc_defs.h:126
GPP_A0
#define GPP_A0
Definition:
gpio_soc_defs.h:119
GPP_S1
#define GPP_S1
Definition:
gpio_soc_defs.h:161
GPP_A20
#define GPP_A20
Definition:
gpio_soc_defs.h:139
GPP_A16
#define GPP_A16
Definition:
gpio_soc_defs.h:135
GPP_F1
#define GPP_F1
Definition:
gpio_soc_defs.h:574
GPP_F17
#define GPP_F17
Definition:
gpio_soc_defs.h:590
GPP_A12
#define GPP_A12
Definition:
gpio_soc_defs.h:131
GPP_F15
#define GPP_F15
Definition:
gpio_soc_defs.h:588
GPP_C6
#define GPP_C6
Definition:
gpio_soc_defs.h:543
GPP_A3
#define GPP_A3
Definition:
gpio_soc_defs.h:122
GPP_C16
#define GPP_C16
Definition:
gpio_soc_defs.h:553
GPD1
#define GPD1
Definition:
gpio_soc_defs.h:382
GPP_F13
#define GPP_F13
Definition:
gpio_soc_defs.h:586
GPP_C4
#define GPP_C4
Definition:
gpio_soc_defs.h:541
GPP_B19
#define GPP_B19
Definition:
gpio_soc_defs.h:72
GPP_T4
#define GPP_T4
Definition:
gpio_soc_defs.h:95
GPP_E19
#define GPP_E19
Definition:
gpio_soc_defs.h:647
GPP_H0
#define GPP_H0
Definition:
gpio_soc_defs.h:215
GPP_B9
#define GPP_B9
Definition:
gpio_soc_defs.h:62
GPP_E18
#define GPP_E18
Definition:
gpio_soc_defs.h:646
GPP_F14
#define GPP_F14
Definition:
gpio_soc_defs.h:587
GPP_H3
#define GPP_H3
Definition:
gpio_soc_defs.h:219
GPP_A10
#define GPP_A10
Definition:
gpio_soc_defs.h:129
GPP_A8
#define GPP_A8
Definition:
gpio_soc_defs.h:127
GPP_A1
#define GPP_A1
Definition:
gpio_soc_defs.h:120
GPP_B14
#define GPP_B14
Definition:
gpio_soc_defs.h:67
GPP_B11
#define GPP_B11
Definition:
gpio_soc_defs.h:64
GPP_B18
#define GPP_B18
Definition:
gpio_soc_defs.h:71
GPP_A11
#define GPP_A11
Definition:
gpio_soc_defs.h:130
GPP_A15
#define GPP_A15
Definition:
gpio_soc_defs.h:134
GPP_A9
#define GPP_A9
Definition:
gpio_soc_defs.h:128
GPP_F8
#define GPP_F8
Definition:
gpio_soc_defs.h:581
GPP_A13
#define GPP_A13
Definition:
gpio_soc_defs.h:132
GPP_A21
#define GPP_A21
Definition:
gpio_soc_defs.h:140
GPP_B23
#define GPP_B23
Definition:
gpio_soc_defs.h:76
GPP_E15
#define GPP_E15
Definition:
gpio_soc_defs.h:643
GPP_B10
#define GPP_B10
Definition:
gpio_soc_defs.h:63
GPP_E16
#define GPP_E16
Definition:
gpio_soc_defs.h:644
GPP_T6
#define GPP_T6
Definition:
gpio_soc_defs.h:97
GPP_T5
#define GPP_T5
Definition:
gpio_soc_defs.h:96
GPP_B3
#define GPP_B3
Definition:
gpio_soc_defs.h:56
GPP_A22
#define GPP_A22
Definition:
gpio_soc_defs.h:141
GPP_F11
#define GPP_F11
Definition:
gpio_soc_defs.h:584
GPP_B4
#define GPP_B4
Definition:
gpio_soc_defs.h:57
GPP_F3
#define GPP_F3
Definition:
gpio_soc_defs.h:576
GPP_H10
#define GPP_H10
Definition:
gpio_soc_defs.h:226
GPP_C3
#define GPP_C3
Definition:
gpio_soc_defs.h:540
GPP_A17
#define GPP_A17
Definition:
gpio_soc_defs.h:136
GPP_C7
#define GPP_C7
Definition:
gpio_soc_defs.h:544
GPP_R1
#define GPP_R1
Definition:
gpio_soc_defs.h:670
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
helpers.h:12
GPP_V5
#define GPP_V5
Definition:
gpio_soc_defs.h:118
GPP_V0
#define GPP_V0
Definition:
gpio_soc_defs.h:113
GPP_U13
#define GPP_U13
Definition:
gpio_soc_defs.h:193
GPP_G8
#define GPP_G8
Definition:
gpio_soc_defs.h:90
GPP_U1
#define GPP_U1
Definition:
gpio_soc_defs.h:181
GPP_U12
#define GPP_U12
Definition:
gpio_soc_defs.h:192
GPP_V2
#define GPP_V2
Definition:
gpio_soc_defs.h:115
GPP_U0
#define GPP_U0
Definition:
gpio_soc_defs.h:180
GPP_V4
#define GPP_V4
Definition:
gpio_soc_defs.h:117
GPP_U18
#define GPP_U18
Definition:
gpio_soc_defs.h:198
GPP_V1
#define GPP_V1
Definition:
gpio_soc_defs.h:114
GPP_G19
#define GPP_G19
Definition:
gpio_soc_defs.h:101
GPP_V11
#define GPP_V11
Definition:
gpio_soc_defs.h:124
GPP_V10
#define GPP_V10
Definition:
gpio_soc_defs.h:123
GPP_V3
#define GPP_V3
Definition:
gpio_soc_defs.h:116
GPP_U16
#define GPP_U16
Definition:
gpio_soc_defs.h:196
GPP_V8
#define GPP_V8
Definition:
gpio_soc_defs.h:121
GPP_V9
#define GPP_V9
Definition:
gpio_soc_defs.h:122
GPP_V7
#define GPP_V7
Definition:
gpio_soc_defs.h:120
GPP_G9
#define GPP_G9
Definition:
gpio_soc_defs.h:91
GPP_U17
#define GPP_U17
Definition:
gpio_soc_defs.h:197
GPP_V6
#define GPP_V6
Definition:
gpio_soc_defs.h:119
helpers.h
variant_early_gpio_table
const struct pad_config * variant_early_gpio_table(size_t *num)
Definition:
gpio.c:204
variant_gpio_table
const struct pad_config *__weak variant_gpio_table(size_t *num)
Definition:
gpio.c:406
early_gpio_table
const struct pad_config early_gpio_table[]
Definition:
gpio.c:373
gpio_table
static const struct pad_config gpio_table[]
Definition:
gpio.c:7
NONE
@ NONE
Definition:
qup_se_handlers_common.h:196
PAD_NC
#define PAD_NC(pin)
Definition:
gpio_defs.h:263
PAD_CFG_GPI
#define PAD_CFG_GPI(pad, pull, rst)
Definition:
gpio_defs.h:284
PAD_CFG_NF
#define PAD_CFG_NF(pad, pull, rst, func)
Definition:
gpio_defs.h:197
PAD_CFG_GPO
#define PAD_CFG_GPO(pad, val, rst)
Definition:
gpio_defs.h:247
pad_config
Definition:
gpio.h:75
src
mainboard
siemens
mc_ehl
variants
mc_ehl2
gpio.c
Generated by
1.9.1