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 <
amdblocks/agesawrapper.h
>
4
#include <
amdblocks/BiosCallOuts.h
>
5
#include <soc/gpio.h>
6
#include <soc/southbridge.h>
7
#include "
gpio.h
"
8
9
/*
10
* As a rule of thumb, GPIO pins used by coreboot should be initialized at
11
* bootblock while GPIO pins used only by the OS should be initialized at
12
* ramstage.
13
*/
14
static
const
struct
soc_amd_gpio
gpio_set_stage_reset
[] = {
15
/* GFX presence detect */
16
PAD_GPI
(
GPIO_9
,
PULL_DOWN
),
17
/* VDDP_VCTRL */
18
PAD_GPO
(
GPIO_40
, HIGH),
19
/* PC SPKR */
20
PAD_NF
(
GPIO_91
, SPKR,
PULL_NONE
),
21
};
22
23
static
const
struct
soc_amd_gpio
gpio_set_stage_ram
[] = {
24
#if CONFIG(HAVE_ACPI_RESUME)
25
/* PCIE_WAKE - default, do not program */
26
27
/* DEVSLP1 */
28
PAD_NF
(
GPIO_70
, DEVSLP1,
PULL_UP
),
29
/* WLAND */
30
PAD_WAKE
(
GPIO_137
,
PULL_UP
, LEVEL_LOW,
S3
),
31
#else
32
/* PCIE_WAKE, SCI */
33
PAD_NF_SCI
(
GPIO_2
, WAKE_L,
PULL_UP
, EDGE_LOW),
34
/* DEVSLP1 - default as GPIO, do not program */
35
36
/* WLAND - default as GPIO, do not program */
37
38
#endif
/* HAVE_ACPI_RESUME */
39
/* BLINK - reselect GPIO OUTPUT HIGH to force BLINK */
40
PAD_GPO
(
GPIO_11
, HIGH),
41
};
42
43
const
struct
soc_amd_gpio
*
early_gpio_table
(
size_t
*size)
44
{
45
*size =
ARRAY_SIZE
(
gpio_set_stage_reset
);
46
return
gpio_set_stage_reset
;
47
}
48
49
const
struct
soc_amd_gpio
*
gpio_table
(
size_t
*size)
50
{
51
*size =
ARRAY_SIZE
(
gpio_set_stage_ram
);
52
return
gpio_set_stage_ram
;
53
}
agesawrapper.h
GPIO_11
#define GPIO_11
Definition:
gpio_ftns.h:13
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:14
gpio_set_stage_ram
static const struct soc_amd_gpio gpio_set_stage_ram[]
Definition:
gpio.c:23
S3
@ S3
Definition:
smihandler.c:21
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_91
#define GPIO_91
Definition:
gpio.h:67
GPIO_70
#define GPIO_70
Definition:
gpio.h:56
GPIO_9
#define GPIO_9
Definition:
gpio.h:30
GPIO_2
#define GPIO_2
Definition:
gpio.h:23
GPIO_40
#define GPIO_40
Definition:
gpio.h:49
BiosCallOuts.h
PAD_WAKE
#define PAD_WAKE(pin, pull, trigger, type)
Definition:
gpio_defs.h:247
PAD_NF_SCI
#define PAD_NF_SCI(pin, func, pull, trigger)
Definition:
gpio_defs.h:241
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_137
#define GPIO_137
Definition:
gpio.h:92
gpio.h
soc_amd_gpio
Definition:
gpio.h:11
src
mainboard
amd
padmelon
gpio.c
Generated by
1.9.1