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/gpio.h>
4
#include <baseboard/variants.h>
5
#include <
commonlib/helpers.h
>
6
7
static
const
struct
pad_config
gpio_table
[] = {
8
/* A16 : SD_OC_ODL */
9
PAD_CFG_GPI
(
GPP_A16
,
NONE
, DEEP),
10
/* A18 : LAN_PE_ISOLATE_ODL */
11
PAD_CFG_GPO
(
GPP_A18
, 1, DEEP),
12
/* A23 : M2_WLAN_INT_ODL */
13
PAD_CFG_GPI_APIC
(
GPP_A23
,
NONE
, PLTRST, LEVEL, INVERT),
14
15
/* B5 : LAN_CLKREQ_ODL */
16
PAD_CFG_NF
(
GPP_B5
,
NONE
, DEEP, NF1),
17
18
/* C0 : SMBCLK */
19
PAD_CFG_NF
(
GPP_C0
,
NONE
, DEEP, NF1),
20
/* C1 : SMBDATA */
21
PAD_CFG_NF
(
GPP_C1
,
NONE
, DEEP, NF1),
22
/* C6: M2_WLAN_WAKE_ODL */
23
PAD_CFG_GPI_SCI_LOW
(
GPP_C6
,
NONE
, DEEP, EDGE_SINGLE),
24
/* C7 : LAN_WAKE_ODL */
25
PAD_CFG_GPI_SCI_LOW
(
GPP_C7
,
NONE
, DEEP, EDGE_SINGLE),
26
/* C10 : PCH_PCON_RST_ODL */
27
PAD_CFG_GPO
(
GPP_C10
, 1, DEEP),
28
/* C11 : PCH_PCON_PDB_ODL */
29
PAD_CFG_GPO
(
GPP_C11
, 1, DEEP),
30
/* C15 : WLAN_OFF_L */
31
PAD_CFG_GPO
(
GPP_C15
, 1, DEEP),
32
33
/* E2 : EN_PP_MST_OD */
34
PAD_CFG_GPO
(
GPP_E2
, 1, DEEP),
35
/* E9 : USB_A0_OC_ODL */
36
PAD_CFG_NF
(
GPP_E9
,
NONE
, DEEP, NF1),
37
/* E10 : USB_A1_OC_ODL */
38
PAD_CFG_NF
(
GPP_E10
,
NONE
, DEEP, NF1),
39
40
/* F11 : EMMC_CMD */
41
PAD_CFG_NF
(
GPP_F11
,
NONE
, DEEP, NF1),
42
/* F12 : EMMC_DATA0 */
43
PAD_CFG_NF
(
GPP_F12
,
NONE
, DEEP, NF1),
44
/* F13 : EMMC_DATA1 */
45
PAD_CFG_NF
(
GPP_F13
,
NONE
, DEEP, NF1),
46
/* F14 : EMMC_DATA2 */
47
PAD_CFG_NF
(
GPP_F14
,
NONE
, DEEP, NF1),
48
/* F15 : EMMC_DATA3 */
49
PAD_CFG_NF
(
GPP_F15
,
NONE
, DEEP, NF1),
50
/* F16 : EMMC_DATA4 */
51
PAD_CFG_NF
(
GPP_F16
,
NONE
, DEEP, NF1),
52
/* F17 : EMMC_DATA5 */
53
PAD_CFG_NF
(
GPP_F17
,
NONE
, DEEP, NF1),
54
/* F18 : EMMC_DATA6 */
55
PAD_CFG_NF
(
GPP_F18
,
NONE
, DEEP, NF1),
56
/* F19 : EMMC_DATA7 */
57
PAD_CFG_NF
(
GPP_F19
,
NONE
, DEEP, NF1),
58
/* F20 : EMMC_RCLK */
59
PAD_CFG_NF
(
GPP_F20
,
NONE
, DEEP, NF1),
60
/* F21 : EMMC_CLK */
61
PAD_CFG_NF
(
GPP_F21
,
NONE
, DEEP, NF1),
62
/* F22 : EMMC_RST_L */
63
PAD_CFG_NF
(
GPP_F22
,
NONE
, DEEP, NF1),
64
65
/* H4: PCH_I2C_PCON_SDA */
66
PAD_CFG_NF
(
GPP_H4
,
NONE
, DEEP, NF1),
67
/* H5: PCH_I2C_PCON_SCL */
68
PAD_CFG_NF
(
GPP_H5
,
NONE
, DEEP, NF1),
69
/* H22 : PWM_PP3300_BIOZZER */
70
PAD_CFG_GPO
(
GPP_H22
, 0, DEEP),
71
};
72
73
const
struct
pad_config
*
override_gpio_table
(
size_t
*num)
74
{
75
*num =
ARRAY_SIZE
(
gpio_table
);
76
return
gpio_table
;
77
}
78
79
/* Early pad configuration in bootblock */
80
static
const
struct
pad_config
early_gpio_table
[] = {
81
/* B14 : GPP_B14_STRAP */
82
PAD_NC
(
GPP_B14
,
NONE
),
83
/* B22 : GPP_B22_STRAP */
84
PAD_NC
(
GPP_B22
,
NONE
),
85
/* E19 : GPP_E19_STRAP */
86
PAD_NC
(
GPP_E19
,
NONE
),
87
/* E21 : GPP_E21_STRAP */
88
PAD_NC
(
GPP_E21
,
NONE
),
89
/* B15 : H1_SLAVE_SPI_CS_L */
90
PAD_CFG_NF
(
GPP_B15
,
NONE
, DEEP, NF1),
91
/* B16 : H1_SLAVE_SPI_CLK */
92
PAD_CFG_NF
(
GPP_B16
,
NONE
, DEEP, NF1),
93
/* B17 : H1_SLAVE_SPI_MISO_R */
94
PAD_CFG_NF
(
GPP_B17
,
NONE
, DEEP, NF1),
95
/* B18 : H1_SLAVE_SPI_MOSI_R */
96
PAD_CFG_NF
(
GPP_B18
,
NONE
, DEEP, NF1),
97
/* C14 : BT_DISABLE_L */
98
PAD_CFG_GPO
(
GPP_C14
, 0, DEEP),
99
/* PCH_WP_OD */
100
PAD_CFG_GPI
(
GPP_C20
,
NONE
, DEEP),
101
/* C21 : H1_PCH_INT_ODL */
102
PAD_CFG_GPI_APIC
(
GPP_C21
,
NONE
, PLTRST, LEVEL, INVERT),
103
/* C22 : EC_IN_RW_OD */
104
PAD_CFG_GPI
(
GPP_C22
,
NONE
, DEEP),
105
/* C23 : WLAN_PE_RST# */
106
PAD_CFG_GPO
(
GPP_C23
, 1, DEEP),
107
/* E1 : M2_SSD_PEDET */
108
PAD_CFG_NF
(
GPP_E1
,
NONE
, DEEP, NF1),
109
/* E5 : SATA_DEVSLP1 */
110
PAD_CFG_NF
(
GPP_E5
,
NONE
, PLTRST, NF1),
111
};
112
113
const
struct
pad_config
*
variant_early_gpio_table
(
size_t
*num)
114
{
115
*num =
ARRAY_SIZE
(
early_gpio_table
);
116
return
early_gpio_table
;
117
}
GPP_H22
#define GPP_H22
Definition:
gpio_soc_defs.h:238
GPP_C15
#define GPP_C15
Definition:
gpio_soc_defs.h:552
GPP_A18
#define GPP_A18
Definition:
gpio_soc_defs.h:137
GPP_F21
#define GPP_F21
Definition:
gpio_soc_defs.h:594
GPP_F12
#define GPP_F12
Definition:
gpio_soc_defs.h:585
GPP_F16
#define GPP_F16
Definition:
gpio_soc_defs.h:589
GPP_F20
#define GPP_F20
Definition:
gpio_soc_defs.h:593
GPP_B16
#define GPP_B16
Definition:
gpio_soc_defs.h:69
GPP_C22
#define GPP_C22
Definition:
gpio_soc_defs.h:559
GPP_B15
#define GPP_B15
Definition:
gpio_soc_defs.h:68
GPP_C23
#define GPP_C23
Definition:
gpio_soc_defs.h:560
GPP_C11
#define GPP_C11
Definition:
gpio_soc_defs.h:548
GPP_B22
#define GPP_B22
Definition:
gpio_soc_defs.h:75
GPP_A23
#define GPP_A23
Definition:
gpio_soc_defs.h:142
GPP_E9
#define GPP_E9
Definition:
gpio_soc_defs.h:637
GPP_E5
#define GPP_E5
Definition:
gpio_soc_defs.h:633
GPP_C20
#define GPP_C20
Definition:
gpio_soc_defs.h:557
GPP_A16
#define GPP_A16
Definition:
gpio_soc_defs.h:135
GPP_F17
#define GPP_F17
Definition:
gpio_soc_defs.h:590
GPP_F15
#define GPP_F15
Definition:
gpio_soc_defs.h:588
GPP_C10
#define GPP_C10
Definition:
gpio_soc_defs.h:547
GPP_C6
#define GPP_C6
Definition:
gpio_soc_defs.h:543
GPP_F13
#define GPP_F13
Definition:
gpio_soc_defs.h:586
GPP_E2
#define GPP_E2
Definition:
gpio_soc_defs.h:630
GPP_E19
#define GPP_E19
Definition:
gpio_soc_defs.h:647
GPP_H5
#define GPP_H5
Definition:
gpio_soc_defs.h:221
GPP_C21
#define GPP_C21
Definition:
gpio_soc_defs.h:558
GPP_F14
#define GPP_F14
Definition:
gpio_soc_defs.h:587
GPP_B14
#define GPP_B14
Definition:
gpio_soc_defs.h:67
GPP_B18
#define GPP_B18
Definition:
gpio_soc_defs.h:71
GPP_B5
#define GPP_B5
Definition:
gpio_soc_defs.h:58
GPP_C14
#define GPP_C14
Definition:
gpio_soc_defs.h:551
GPP_E10
#define GPP_E10
Definition:
gpio_soc_defs.h:638
GPP_C1
#define GPP_C1
Definition:
gpio_soc_defs.h:538
GPP_F18
#define GPP_F18
Definition:
gpio_soc_defs.h:591
GPP_F22
#define GPP_F22
Definition:
gpio_soc_defs.h:595
GPP_F11
#define GPP_F11
Definition:
gpio_soc_defs.h:584
GPP_E21
#define GPP_E21
Definition:
gpio_soc_defs.h:649
GPP_B17
#define GPP_B17
Definition:
gpio_soc_defs.h:70
GPP_C0
#define GPP_C0
Definition:
gpio_soc_defs.h:537
GPP_E1
#define GPP_E1
Definition:
gpio_soc_defs.h:629
GPP_F19
#define GPP_F19
Definition:
gpio_soc_defs.h:592
GPP_H4
#define GPP_H4
Definition:
gpio_soc_defs.h:220
GPP_C7
#define GPP_C7
Definition:
gpio_soc_defs.h:544
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
helpers.h:12
helpers.h
variant_early_gpio_table
const struct pad_config * variant_early_gpio_table(size_t *num)
Definition:
gpio.c:204
override_gpio_table
const struct pad_config * override_gpio_table(size_t *num)
Definition:
gpio.c:124
gpio_table
static const struct pad_config gpio_table[]
Definition:
gpio.c:7
early_gpio_table
static const struct pad_config early_gpio_table[]
Definition:
gpio.c:80
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_GPI_SCI_LOW
#define PAD_CFG_GPI_SCI_LOW(pad, pull, rst, trig)
Definition:
gpio_defs.h:452
PAD_CFG_NF
#define PAD_CFG_NF(pad, pull, rst, func)
Definition:
gpio_defs.h:197
PAD_CFG_GPI_APIC
#define PAD_CFG_GPI_APIC(pad, pull, rst, trig, inv)
Definition:
gpio_defs.h:376
PAD_CFG_GPO
#define PAD_CFG_GPO(pad, val, rst)
Definition:
gpio_defs.h:247
pad_config
Definition:
gpio.h:75
src
mainboard
google
hatch
variants
faffy
gpio.c
Generated by
1.9.1