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 <soc/southbridge.h>
4
#include <soc/gpio.h>
5
6
#include "
gpio.h
"
7
8
/*
9
* As a rule of thumb, GPIO pins used by coreboot should be initialized at
10
* bootblock while GPIO pins used only by the OS should be initialized at
11
* ramstage.
12
*/
13
static
const
struct
soc_amd_gpio
gpio_set_stage_reset
[] = {
14
/* NFC PU */
15
PAD_GPO
(
GPIO_64
, HIGH),
16
/* PCIe presence detect */
17
PAD_GPI
(
GPIO_69
,
PULL_UP
),
18
/* MUX for Power Express Eval */
19
PAD_GPI
(
GPIO_116
,
PULL_DOWN
),
20
/* SD power */
21
PAD_GPO
(
GPIO_119
, HIGH),
22
/* GPIO_136 - UART0_FCH_RX_DEBUG_RX */
23
PAD_NF
(
GPIO_136
, UART0_RXD,
PULL_NONE
),
24
/* GPIO_137 - UART0_FCH_DEBUG_RTS */
25
PAD_NF
(
GPIO_137
, UART0_RTS_L,
PULL_NONE
),
26
/* GPIO_138 - UART0_FCH_TX_DEBUG_RX */
27
PAD_NF
(
GPIO_138
, UART0_TXD,
PULL_NONE
),
28
/* GPIO_142 - UART1_FCH_RTS */
29
PAD_NF
(
GPIO_142
, UART1_RTS_L,
PULL_NONE
),
30
/* GPIO_143 - UART1_FCH_TX */
31
PAD_NF
(
GPIO_143
, UART1_TXD,
PULL_NONE
),
32
};
33
34
static
const
struct
soc_amd_gpio
gpio_set_stage_ram
[] = {
35
/* BT radio disable */
36
PAD_GPO
(
GPIO_14
, HIGH),
37
/* NFC wake */
38
PAD_GPO
(
GPIO_65
, HIGH),
39
/* Webcam */
40
PAD_GPO
(
GPIO_66
, HIGH),
41
/* GPS sleep */
42
PAD_GPO
(
GPIO_70
, HIGH),
43
};
44
45
const
struct
soc_amd_gpio
*
early_gpio_table
(
size_t
*size)
46
{
47
*size =
ARRAY_SIZE
(
gpio_set_stage_reset
);
48
return
gpio_set_stage_reset
;
49
}
50
51
const
struct
soc_amd_gpio
*
gpio_table
(
size_t
*size)
52
{
53
*size =
ARRAY_SIZE
(
gpio_set_stage_ram
);
54
return
gpio_set_stage_ram
;
55
}
GPIO_66
#define GPIO_66
Definition:
gpio_ftns.h:25
GPIO_64
#define GPIO_64
Definition:
gpio_ftns.h:24
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
helpers.h:12
PULL_DOWN
#define PULL_DOWN
Definition:
buildOpts.c:71
PULL_UP
#define PULL_UP
Definition:
buildOpts.c:70
PULL_NONE
#define PULL_NONE
Definition:
buildOpts.c:72
gpio_set_stage_reset
static const struct soc_amd_gpio gpio_set_stage_reset[]
Definition:
gpio.c:13
gpio_set_stage_ram
static const struct soc_amd_gpio gpio_set_stage_ram[]
Definition:
gpio.c:34
early_gpio_table
const struct pad_config early_gpio_table[]
Definition:
gpio.c:373
gpio_table
const struct pad_config gpio_table[]
Definition:
gpio.c:33
GPIO_143
#define GPIO_143
Definition:
gpio.h:90
GPIO_69
#define GPIO_69
Definition:
gpio.h:55
GPIO_70
#define GPIO_70
Definition:
gpio.h:56
GPIO_116
#define GPIO_116
Definition:
gpio.h:78
GPIO_142
#define GPIO_142
Definition:
gpio.h:89
PAD_GPO
#define PAD_GPO(pin, direction)
Definition:
gpio_defs.h:220
PAD_NF
#define PAD_NF(pin, func, pull)
Definition:
gpio_defs.h:208
PAD_GPI
#define PAD_GPI(pin, pull)
Definition:
gpio_defs.h:216
GPIO_14
#define GPIO_14
Definition:
gpio.h:35
GPIO_136
#define GPIO_136
Definition:
gpio.h:91
GPIO_137
#define GPIO_137
Definition:
gpio.h:92
GPIO_138
#define GPIO_138
Definition:
gpio.h:93
GPIO_65
#define GPIO_65
Definition:
gpio.h:51
GPIO_119
#define GPIO_119
Definition:
gpio.h:86
gpio.h
soc_amd_gpio
Definition:
gpio.h:11
src
mainboard
amd
gardenia
gpio.c
Generated by
1.9.1