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
/* A0 : SAR0_INT_ODL */
9
PAD_CFG_GPI_INT
(
GPP_A0
,
NONE
, PLTRST, LEVEL),
10
/* A6 : SAR1_INT_ODL */
11
PAD_CFG_GPI_INT
(
GPP_A6
,
NONE
, PLTRST, LEVEL),
12
/* A8 : PEN_GARAGE_DET_L (wake) */
13
PAD_CFG_GPI_SCI
(
GPP_A8
,
NONE
, DEEP, EDGE_SINGLE,
NONE
),
14
/* A10 : FPMCU_PCH_BOOT1 */
15
PAD_CFG_GPO
(
GPP_A10
, 0, DEEP),
16
/* A11 : PCH_SPI_FPMCU_CS_L */
17
PAD_CFG_NF
(
GPP_A11
,
NONE
, DEEP, NF2),
18
/* A12 : FPMCU_RST_ODL */
19
PAD_CFG_GPO
(
GPP_A12
, 0, DEEP),
20
/* C13 : EC_PCH_INT_L */
21
PAD_CFG_GPI_APIC
(
GPP_C13
, UP_20K, PLTRST, LEVEL, INVERT),
22
/* C15 : WWAN_DPR_SAR_ODL
23
*
24
* TODO: Driver doesn't use this pin as of now. In case driver starts
25
* using this pin, expose this pin to driver.
26
*/
27
PAD_CFG_GPO
(
GPP_C15
, 1, DEEP),
28
};
29
30
const
struct
pad_config
*
override_gpio_table
(
size_t
*num)
31
{
32
*num =
ARRAY_SIZE
(
gpio_table
);
33
return
gpio_table
;
34
}
35
36
/*
37
* GPIOs configured before ramstage
38
* Note: the Hatch platform's romstage will configure
39
* the MEM_STRAP_* (a.k.a GPIO_MEM_CONFIG_*) pins
40
* as inputs before it reads them, so they are not
41
* needed in this table.
42
*/
43
static
const
struct
pad_config
early_gpio_table
[] = {
44
/* B15 : H1_SLAVE_SPI_CS_L */
45
PAD_CFG_NF
(
GPP_B15
,
NONE
, DEEP, NF1),
46
/* B16 : H1_SLAVE_SPI_CLK */
47
PAD_CFG_NF
(
GPP_B16
,
NONE
, DEEP, NF1),
48
/* B17 : H1_SLAVE_SPI_MISO_R */
49
PAD_CFG_NF
(
GPP_B17
,
NONE
, DEEP, NF1),
50
/* B18 : H1_SLAVE_SPI_MOSI_R */
51
PAD_CFG_NF
(
GPP_B18
,
NONE
, DEEP, NF1),
52
/* C8 : UART_PCH_RX_DEBUG_TX */
53
PAD_CFG_NF
(
GPP_C8
,
NONE
, DEEP, NF1),
54
/* C9 : UART_PCH_TX_DEBUG_RX */
55
PAD_CFG_NF
(
GPP_C9
,
NONE
, DEEP, NF1),
56
/* C14 : BT_DISABLE_L */
57
PAD_CFG_GPO
(
GPP_C14
, 0, DEEP),
58
/* PCH_WP_OD */
59
PAD_CFG_GPI
(
GPP_C20
,
NONE
, DEEP),
60
/* C21 : H1_PCH_INT_ODL */
61
PAD_CFG_GPI_APIC
(
GPP_C21
,
NONE
, PLTRST, LEVEL, INVERT),
62
/* C22 : EC_IN_RW_OD */
63
PAD_CFG_GPI
(
GPP_C22
,
NONE
, DEEP),
64
/* C23 : WLAN_PE_RST# */
65
PAD_CFG_GPO
(
GPP_C23
, 1, DEEP),
66
/* E1 : M2_SSD_PEDET */
67
PAD_CFG_NF
(
GPP_E1
,
NONE
, DEEP, NF1),
68
/* E5 : SATA_DEVSLP1 */
69
PAD_CFG_NF
(
GPP_E5
,
NONE
, PLTRST, NF1),
70
/* F2 : MEM_CH_SEL */
71
PAD_CFG_GPI
(
GPP_F2
,
NONE
, PLTRST),
72
};
73
74
const
struct
pad_config
*
variant_early_gpio_table
(
size_t
*num)
75
{
76
*num =
ARRAY_SIZE
(
early_gpio_table
);
77
return
early_gpio_table
;
78
}
GPP_C15
#define GPP_C15
Definition:
gpio_soc_defs.h:552
GPP_B16
#define GPP_B16
Definition:
gpio_soc_defs.h:69
GPP_C9
#define GPP_C9
Definition:
gpio_soc_defs.h:546
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_C8
#define GPP_C8
Definition:
gpio_soc_defs.h:545
GPP_A6
#define GPP_A6
Definition:
gpio_soc_defs.h:125
GPP_C13
#define GPP_C13
Definition:
gpio_soc_defs.h:550
GPP_E5
#define GPP_E5
Definition:
gpio_soc_defs.h:633
GPP_A0
#define GPP_A0
Definition:
gpio_soc_defs.h:119
GPP_C20
#define GPP_C20
Definition:
gpio_soc_defs.h:557
GPP_A12
#define GPP_A12
Definition:
gpio_soc_defs.h:131
GPP_C21
#define GPP_C21
Definition:
gpio_soc_defs.h:558
GPP_A10
#define GPP_A10
Definition:
gpio_soc_defs.h:129
GPP_A8
#define GPP_A8
Definition:
gpio_soc_defs.h:127
GPP_B18
#define GPP_B18
Definition:
gpio_soc_defs.h:71
GPP_A11
#define GPP_A11
Definition:
gpio_soc_defs.h:130
GPP_C14
#define GPP_C14
Definition:
gpio_soc_defs.h:551
GPP_F2
#define GPP_F2
Definition:
gpio_soc_defs.h:575
GPP_B17
#define GPP_B17
Definition:
gpio_soc_defs.h:70
GPP_E1
#define GPP_E1
Definition:
gpio_soc_defs.h:629
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:43
NONE
@ NONE
Definition:
qup_se_handlers_common.h:196
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_GPI_INT
#define PAD_CFG_GPI_INT(pad, pull, rst, trig)
Definition:
gpio_defs.h:348
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_CFG_GPI_SCI
#define PAD_CFG_GPI_SCI(pad, pull, rst, trig, inv)
Definition:
gpio_defs.h:432
pad_config
Definition:
gpio.h:75
src
mainboard
google
hatch
variants
hatch
gpio.c
Generated by
1.9.1