coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.c File Reference
#include <console/console.h>
#include <arch/io.h>
#include <device/mmio.h>
#include <device/pci.h>
#include <soc/gpio.h>
#include <soc/pm.h>
#include <soc/smm.h>
Include dependency graph for gpio.c:

Go to the source code of this file.

Macros

#define GPIO_DEBUG
 

Functions

static void setup_gpio_route (const struct soc_gpio_map *sw_gpios, const struct soc_gpio_map *n_gpios)
 
static void setup_gpios (const struct soc_gpio_map *gpios, const struct gpio_bank *community)
 
void setup_soc_gpios (struct soc_gpio_config *config, u8 enable_xdp_tap)
 
__weak struct soc_gpio_configmainboard_get_gpios (void)
 

Variables

static const u8 gpncommunity_gpio_to_pad [GP_NORTH_COUNT]
 
static const u8 gpsecommunity_gpio_to_pad [GP_SOUTHEAST_COUNT]
 
static const u8 gpswcommunity_gpio_to_pad [GP_SOUTHWEST_COUNT]
 
static const u8 gpecommunity_gpio_to_pad [GP_EAST_COUNT]
 
static const struct gpio_bank gpnorth_community
 
static const struct gpio_bank gpsoutheast_community
 
static const struct gpio_bank gpsouthwest_community
 
static const struct gpio_bank gpeast_community
 

Macro Definition Documentation

◆ GPIO_DEBUG

#define GPIO_DEBUG

Definition at line 11 of file gpio.c.

Function Documentation

◆ mainboard_get_gpios()

__weak struct soc_gpio_config* mainboard_get_gpios ( void  )

Definition at line 262 of file gpio.c.

References BIOS_DEBUG, NULL, and printk.

◆ setup_gpio_route()

static void setup_gpio_route ( const struct soc_gpio_map sw_gpios,
const struct soc_gpio_map n_gpios 
)
static

Definition at line 77 of file gpio.c.

References ACPI_BASE_ADDRESS, BIOS_DEBUG, GP_NORTH_COUNT, GP_SOUTHWEST_COUNT, soc_gpio_map::gpe, GPE0A_EN_REG, GPIO_LIST_END, outl(), soc_gpio_map::pad_conf0, printk, SCI, SMI, SMM_SAVE_PARAM_GPIO_ROUTE, and smm_southcluster_save_param().

Referenced by setup_soc_gpios().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_gpios()

static void setup_gpios ( const struct soc_gpio_map gpios,
const struct gpio_bank community 
)
static

◆ setup_soc_gpios()

void setup_soc_gpios ( struct soc_gpio_config config,
u8  enable_xdp_tap 
)

Variable Documentation

◆ gpeast_community

const struct gpio_bank gpeast_community
static
Initial value:
= {
.gpio_count = GP_EAST_COUNT,
.gpio_to_pad = gpecommunity_gpio_to_pad,
.pad_base = COMMUNITY_GPEAST_BASE,
.has_gpe_en = GPE_CAPABLE_NONE,
.has_wake_en = 1,
}
static const u8 gpecommunity_gpio_to_pad[GP_EAST_COUNT]
Definition: gpio.c:39
#define GPE_CAPABLE_NONE
Definition: gpio.h:131
#define GP_EAST_COUNT
Definition: gpio.h:120
#define COMMUNITY_GPEAST_BASE
Definition: gpio.h:20

Definition at line 39 of file gpio.c.

Referenced by setup_soc_gpios().

◆ gpecommunity_gpio_to_pad

const u8 gpecommunity_gpio_to_pad[GP_EAST_COUNT]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26 }

Definition at line 39 of file gpio.c.

◆ gpncommunity_gpio_to_pad

const u8 gpncommunity_gpio_to_pad[GP_NORTH_COUNT]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72 }

Definition at line 15 of file gpio.c.

◆ gpnorth_community

const struct gpio_bank gpnorth_community
static
Initial value:
= {
.gpio_count = GP_NORTH_COUNT,
.gpio_to_pad = gpncommunity_gpio_to_pad,
.has_gpe_en = GPE_CAPABLE,
.has_wake_en = 1,
}
static const u8 gpncommunity_gpio_to_pad[GP_NORTH_COUNT]
Definition: gpio.c:15
#define COMMUNITY_GPNORTH_BASE
Definition: gpio.h:17
#define GP_NORTH_COUNT
Definition: gpio.h:119
#define GPE_CAPABLE
Definition: gpio.h:130

Definition at line 39 of file gpio.c.

Referenced by setup_soc_gpios().

◆ gpsecommunity_gpio_to_pad

const u8 gpsecommunity_gpio_to_pad[GP_SOUTHEAST_COUNT]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
30, 31, 32, 33, 34, 35, 45, 46, 47, 48,
49, 50, 51, 52, 60, 61, 62, 63, 64, 65,
66, 67, 68, 69, 75, 76, 77, 78, 79, 80,
81, 82, 83, 84, 85 }

Definition at line 23 of file gpio.c.

◆ gpsoutheast_community

const struct gpio_bank gpsoutheast_community
static
Initial value:
= {
.gpio_count = GP_SOUTHEAST_COUNT,
.gpio_to_pad = gpsecommunity_gpio_to_pad,
.has_gpe_en = GPE_CAPABLE_NONE,
.has_wake_en = 1,
}
static const u8 gpsecommunity_gpio_to_pad[GP_SOUTHEAST_COUNT]
Definition: gpio.c:23
#define GP_SOUTHEAST_COUNT
Definition: gpio.h:121
#define COMMUNITY_GPSOUTHEAST_BASE
Definition: gpio.h:23

Definition at line 39 of file gpio.c.

Referenced by setup_soc_gpios().

◆ gpsouthwest_community

const struct gpio_bank gpsouthwest_community
static
Initial value:
= {
.gpio_count = GP_SOUTHWEST_COUNT,
.gpio_to_pad = gpswcommunity_gpio_to_pad,
.has_gpe_en = GPE_CAPABLE,
.has_wake_en = 1,
}
static const u8 gpswcommunity_gpio_to_pad[GP_SOUTHWEST_COUNT]
Definition: gpio.c:31
#define COMMUNITY_GPSOUTHWEST_BASE
Definition: gpio.h:14
#define GP_SOUTHWEST_COUNT
Definition: gpio.h:118

Definition at line 39 of file gpio.c.

Referenced by setup_soc_gpios().

◆ gpswcommunity_gpio_to_pad

const u8 gpswcommunity_gpio_to_pad[GP_SOUTHWEST_COUNT]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 15, 16,
17, 18, 19, 20, 21, 22, 30, 31, 32, 33,
34, 35, 36, 37, 45, 46, 47, 48, 49, 50,
51, 52, 60, 61, 62, 63, 64, 65, 66, 67,
75, 76, 77, 78, 79, 80, 81, 82, 90, 91,
92, 93, 94, 95, 96, 97 }

Definition at line 31 of file gpio.c.