coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.h File Reference
#include <soc/gpio.h>
#include "gpio_defs.h"
#include <types.h>
#include <device/device.h>
Include dependency graph for gpio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pad_config
 
struct  reset_mapping
 
struct  pad_group
 
struct  vw_entries
 
struct  pad_community
 
struct  gpi_status
 
struct  pmc_to_gpio_route
 
struct  gpio_lock_config
 

Macros

#define MISCCFG_GPVNNREQEN   (1 << 7)
 
#define MISCCFG_GPPGCBDPCGEN   (1 << 6)
 
#define MISCCFG_GPSIDEDPCGEN   (1 << 5)
 
#define MISCCFG_GPRCOMPCDLCGEN   (1 << 4)
 
#define MISCCFG_GPRTCDLCGEN   (1 << 3)
 
#define MISCCFG_GSXSLCGEN   (1 << 2)
 
#define MISCCFG_GPDPCGEN   (1 << 1)
 
#define MISCCFG_GPDLCGEN   (1 << 0)
 
#define INTEL_GPP_BASE(first_of_community, start_of_group, end_of_group, group_pad_base)
 
#define PAD_BASE_NONE   -1
 
#define INTEL_GPP(first_of_community, start_of_group, end_of_group)
 

Typedefs

typedef uint32_t gpio_t
 

Enumerations

enum  gpio_lock_action { GPIO_UNLOCK = 0x0 , GPIO_LOCK_CONFIG = 0x1 , GPIO_LOCK_TX = 0x2 , GPIO_LOCK_FULL = GPIO_LOCK_CONFIG | GPIO_LOCK_TX }
 

Functions

const struct pad_communitysoc_gpio_get_community (size_t *num_communities)
 
void gpi_clear_get_smi_status (struct gpi_status *sts)
 
int gpi_status_get (const struct gpi_status *sts, gpio_t gpi)
 
void gpio_configure_pads (const struct pad_config *cfg, size_t num_pads)
 
void gpio_configure_pads_with_override (const struct pad_config *base_cfg, size_t base_num_pads, const struct pad_config *override_cfg, size_t override_num_pads)
 
voidgpio_dwx_address (const gpio_t pad)
 
int gpio_lock_pad (const gpio_t pad, enum gpio_lock_action lock_action)
 
int gpio_lock_pads (const struct gpio_lock_config *pad_list, const size_t count)
 
const struct gpio_lock_configsoc_gpio_lock_config (size_t *num)
 
const struct pmc_to_gpio_routesoc_pmc_gpio_routes (size_t *num)
 
void gpio_route_gpe (uint8_t gpe0b, uint8_t gpe0c, uint8_t gpe0d)
 
uint8_t gpio_get_pad_portid (const gpio_t pad)
 
uint32_t soc_gpio_pad_config_fixup (const struct pad_config *cfg, int dw_reg, uint32_t reg_val)
 
void gpi_clear_int_cfg (void)
 
void gpio_pm_configure (const uint8_t *misccfg_pm_values, size_t num)
 
void block_gpio_enable (struct device *dev)
 
bool gpio_routes_ioapic_irq (unsigned int irq)
 
size_t gpio_get_index_in_group (gpio_t pad)
 
bool gpio_get_vw_info (gpio_t pad, unsigned int *vw_index, unsigned int *vw_bit)
 
unsigned int gpio_get_pad_cpu_portid (gpio_t pad)
 

Macro Definition Documentation

◆ INTEL_GPP

#define INTEL_GPP (   first_of_community,
  start_of_group,
  end_of_group 
)
Value:
INTEL_GPP_BASE(first_of_community, start_of_group, end_of_group,\
#define PAD_BASE_NONE
Definition: gpio.h:46
#define INTEL_GPP_BASE(first_of_community, start_of_group, end_of_group, group_pad_base)
Definition: gpio.h:34

Definition at line 49 of file gpio.h.

◆ INTEL_GPP_BASE

#define INTEL_GPP_BASE (   first_of_community,
  start_of_group,
  end_of_group,
  group_pad_base 
)
Value:
{ \
.first_pad = (start_of_group) - (first_of_community), \
.size = (end_of_group) - (start_of_group) + 1, \
.acpi_pad_base = (group_pad_base), \
}

Definition at line 34 of file gpio.h.

◆ MISCCFG_GPDLCGEN

#define MISCCFG_GPDLCGEN   (1 << 0)

Definition at line 24 of file gpio.h.

◆ MISCCFG_GPDPCGEN

#define MISCCFG_GPDPCGEN   (1 << 1)

Definition at line 22 of file gpio.h.

◆ MISCCFG_GPPGCBDPCGEN

#define MISCCFG_GPPGCBDPCGEN   (1 << 6)

Definition at line 12 of file gpio.h.

◆ MISCCFG_GPRCOMPCDLCGEN

#define MISCCFG_GPRCOMPCDLCGEN   (1 << 4)

Definition at line 16 of file gpio.h.

◆ MISCCFG_GPRTCDLCGEN

#define MISCCFG_GPRTCDLCGEN   (1 << 3)

Definition at line 18 of file gpio.h.

◆ MISCCFG_GPSIDEDPCGEN

#define MISCCFG_GPSIDEDPCGEN   (1 << 5)

Definition at line 14 of file gpio.h.

◆ MISCCFG_GPVNNREQEN

#define MISCCFG_GPVNNREQEN   (1 << 7)

Definition at line 10 of file gpio.h.

◆ MISCCFG_GSXSLCGEN

#define MISCCFG_GSXSLCGEN   (1 << 2)

Definition at line 20 of file gpio.h.

◆ PAD_BASE_NONE

#define PAD_BASE_NONE   -1

Definition at line 46 of file gpio.h.

Typedef Documentation

◆ gpio_t

typedef uint32_t gpio_t

Definition at line 66 of file gpio.h.

Enumeration Type Documentation

◆ gpio_lock_action

Enumerator
GPIO_UNLOCK 
GPIO_LOCK_CONFIG 
GPIO_LOCK_TX 
GPIO_LOCK_FULL 

Definition at line 68 of file gpio.h.

Function Documentation

◆ block_gpio_enable()

void block_gpio_enable ( struct device dev)

Definition at line 24 of file gpio_dev.c.

References assert, block_gpio_ops, DEVICE_PATH_GPIO, device::ops, device::path, and device_path::type.

Referenced by chip_enable_dev(), enable_dev(), soc_enable(), and soc_enable_dev().

Here is the caller graph for this function:

◆ gpi_clear_get_smi_status()

void gpi_clear_get_smi_status ( struct gpi_status sts)

◆ gpi_clear_int_cfg()

void gpi_clear_int_cfg ( void  )

Definition at line 820 of file gpio.c.

References GPI_IE_OFFSET, GPI_IS_OFFSET, pad_community::num_gpi_regs, pad_community::num_groups, pcr_read32(), pcr_write32(), pad_community::port, and soc_gpio_get_community().

Referenced by bootblock_pch_init(), and soc_init().

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

◆ gpi_status_get()

int gpi_status_get ( const struct gpi_status sts,
gpio_t  gpi 
)

Definition at line 733 of file gpio.c.

References pad_community::gpi_status_offset, gpio_bitmask_within_group(), gpio_get_community(), gpio_group_index(), gpi_status::grp, and relative_pad_in_comm().

Referenced by mainboard_smi_gpi_handler().

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

◆ gpio_configure_pads()

void gpio_configure_pads ( const struct pad_config cfg,
size_t  num_pads 
)

Definition at line 353 of file gpio.c.

References gpio_configure_pad().

Here is the call graph for this function:

◆ gpio_configure_pads_with_override()

void gpio_configure_pads_with_override ( const struct pad_config base_cfg,
size_t  base_num_pads,
const struct pad_config override_cfg,
size_t  override_num_pads 
)

Definition at line 383 of file gpio.c.

References c, gpio_configure_pad(), and gpio_get_config().

Here is the call graph for this function:

◆ gpio_dwx_address()

void* gpio_dwx_address ( const gpio_t  pad)

Definition at line 398 of file gpio.c.

References gpio_get_community(), pad_config_offset(), pcr_reg_address(), and pad_community::port.

Referenced by acpigen_soc_get_gpio_val(), acpigen_soc_set_gpio_val(), fw_config_handle(), and soc_fill_gnvs().

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

◆ gpio_get_index_in_group()

size_t gpio_get_index_in_group ( gpio_t  pad)

Definition at line 861 of file gpio.c.

References gpio_get_community(), gpio_within_group(), and relative_pad_in_comm().

Here is the call graph for this function:

◆ gpio_get_pad_cpu_portid()

unsigned int gpio_get_pad_cpu_portid ( gpio_t  pad)

Definition at line 977 of file gpio.c.

References pad_community::cpu_port, and gpio_get_community().

Referenced by calc_bias_ctrl_reg_value().

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

◆ gpio_get_pad_portid()

uint8_t gpio_get_pad_portid ( const gpio_t  pad)

Definition at line 411 of file gpio.c.

References gpio_get_community(), and pad_community::port.

Referenced by soc_fill_gnvs().

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

◆ gpio_get_vw_info()

bool gpio_get_vw_info ( gpio_t  pad,
unsigned int *  vw_index,
unsigned int *  vw_bit 
)

Definition at line 953 of file gpio.c.

References vw_entries::first_pad, gpio_get_community(), vw_entries::last_pad, pad_community::num_vw_entries, offset, pad_community::vw_base, and pad_community::vw_entries.

Referenced by calc_bias_ctrl_reg_value().

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

◆ gpio_lock_pad()

int gpio_lock_pad ( const gpio_t  pad,
enum gpio_lock_action  lock_action 
)

Definition at line 618 of file gpio.c.

References CONFIG, ENV_ROMSTAGE_OR_BEFORE, ENV_SMM, gpio_lock_pads(), gpio_non_smm_lock_pad(), gpio_lock_config::lock_action, gpio_lock_config::pad, and vboot_recovery_mode_enabled().

Referenced by gpio_configure_pad(), and mainboard_config_cbi_wp().

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

◆ gpio_lock_pads()

int gpio_lock_pads ( const struct gpio_lock_config pad_list,
const size_t  count 
)

◆ gpio_pm_configure()

void gpio_pm_configure ( const uint8_t misccfg_pm_values,
size_t  num 
)

Definition at line 844 of file gpio.c.

References die(), GPIO_MISCCFG, MISCCFG_GPIO_PM_CONFIG_BITS, pcr_rmw8(), pad_community::port, and soc_gpio_get_community().

Referenced by soc_fill_gpio_pm_configuration(), and soc_gpio_pm_configuration().

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

◆ gpio_route_gpe()

void gpio_route_gpe ( uint8_t  gpe0b,
uint8_t  gpe0c,
uint8_t  gpe0d 
)

◆ gpio_routes_ioapic_irq()

bool gpio_routes_ioapic_irq ( unsigned int  irq)

Definition at line 232 of file gpio.c.

References ARRAY_SIZE, assert, BIT, and gpio_ioapic_irqs_used.

Referenced by find_free_pin().

Here is the caller graph for this function:

◆ soc_gpio_get_community()

◆ soc_gpio_lock_config()

const struct gpio_lock_config* soc_gpio_lock_config ( size_t num)

Definition at line 314 of file smihandler.c.

References NULL.

Referenced by soc_lock_gpios().

Here is the caller graph for this function:

◆ soc_gpio_pad_config_fixup()

uint32_t soc_gpio_pad_config_fixup ( const struct pad_config cfg,
int  dw_reg,
uint32_t  reg_val 
)

Definition at line 814 of file gpio.c.

References CONFIG, GPP_F11, GPP_F4, and pad_config::pad.

Referenced by gpio_configure_pad().

Here is the caller graph for this function:

◆ soc_pmc_gpio_routes()