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/gpio.h>
4
#include "../../gpio.h"
5
6
/*
7
* As a rule of thumb, GPIO pins used by coreboot should be initialized at
8
* bootblock while GPIO pins used only by the OS should be initialized at
9
* ramstage.
10
*/
11
static
const
struct
soc_amd_gpio
gpio_set_stage_ram
[] = {
12
/* GPIO_2 - WLAN_PCIE_WAKE_3V3_ODL, SCI */
13
PAD_NF_SCI
(
GPIO_2
, WAKE_L,
PULL_UP
, EDGE_LOW),
14
/* SSD DEVSLP */
15
PAD_NF
(
GPIO_5
, DEVSLP0,
PULL_NONE
),
16
/* Defeature SATA Express DEVSLP, as some boards are reworked
17
* to tie this to GPIO23 to control power */
18
PAD_GPI
(
GPIO_6
,
PULL_UP
),
19
/* I2S SDIN */
20
PAD_NF
(
GPIO_7
, ACP_I2S_SDIN,
PULL_NONE
),
21
/* I2S LRCLK */
22
PAD_NF
(
GPIO_8
, ACP_I2S_LRCLK,
PULL_NONE
),
23
/* Blink */
24
PAD_NF
(
GPIO_11
, BLINK,
PULL_NONE
),
25
/* APU_ALS_INT# */
26
PAD_SCI
(
GPIO_24
,
PULL_UP
, EDGE_LOW),
27
/* Finger print CS# */
28
PAD_GPO
(
GPIO_31
, HIGH),
29
/* NFC IRQ */
30
PAD_INT
(
GPIO_69
,
PULL_UP
, EDGE_LOW, STATUS),
31
/* Rear camera power enable */
32
PAD_GPO
(
GPIO_89
, HIGH),
33
};
34
35
void
mainboard_program_gpios
(
void
)
36
{
37
gpio_configure_pads
(
gpio_set_stage_ram
,
ARRAY_SIZE
(
gpio_set_stage_ram
));
38
}
GPIO_11
#define GPIO_11
Definition:
gpio_ftns.h:13
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
helpers.h:12
PULL_UP
#define PULL_UP
Definition:
buildOpts.c:70
PULL_NONE
#define PULL_NONE
Definition:
buildOpts.c:72
mainboard_program_gpios
void mainboard_program_gpios(void)
Definition:
gpio.c:24
gpio_set_stage_ram
static const struct soc_amd_gpio gpio_set_stage_ram[]
Definition:
gpio.c:11
GPIO_7
#define GPIO_7
Definition:
gpio.h:28
GPIO_89
#define GPIO_89
Definition:
gpio.h:65
GPIO_69
#define GPIO_69
Definition:
gpio.h:55
GPIO_5
#define GPIO_5
Definition:
gpio.h:26
GPIO_8
#define GPIO_8
Definition:
gpio.h:29
GPIO_24
#define GPIO_24
Definition:
gpio.h:42
GPIO_31
#define GPIO_31
Definition:
gpio.h:47
GPIO_2
#define GPIO_2
Definition:
gpio.h:23
GPIO_6
#define GPIO_6
Definition:
gpio.h:27
gpio_configure_pads
void gpio_configure_pads(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
program a particular set of GPIO
Definition:
gpio.c:307
PAD_SCI
#define PAD_SCI(pin, pull, trigger)
Definition:
gpio_defs.h:229
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_INT
#define PAD_INT(pin, pull, trigger, action)
Definition:
gpio_defs.h:224
PAD_GPI
#define PAD_GPI(pin, pull)
Definition:
gpio_defs.h:216
soc_amd_gpio
Definition:
gpio.h:11
src
mainboard
amd
mandolin
variants
mandolin
gpio.c
Generated by
1.9.1