coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.h File Reference
#include <types.h>
#include "gpio_defs.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  soc_amd_gpio
 
struct  soc_amd_gpio_register_save
 
struct  soc_amd_event
 
struct  gpio_wake_state
 

Typedefs

typedef uint32_t gpio_t
 

Functions

void gpio_fill_wake_state (struct gpio_wake_state *state)
 
void gpio_add_events (void)
 
static bool is_gpio_event_level_triggered (uint32_t flags)
 
static bool is_gpio_event_edge_triggered (uint32_t flags)
 
static bool is_gpio_event_active_high (uint32_t flags)
 
static bool is_gpio_event_active_low (uint32_t flags)
 
void gpio_configure_pads_with_override (const struct soc_amd_gpio *base_cfg, size_t base_num_pads, const struct soc_amd_gpio *override_cfg, size_t override_num_pads)
 
void gpio_configure_pads (const struct soc_amd_gpio *gpio_list_ptr, size_t size)
 program a particular set of GPIO More...
 
int gpio_interrupt_status (gpio_t gpio)
 
void soc_get_gpio_event_table (const struct soc_amd_event **table, size_t *items)
 
void gpio_save_pin_registers (gpio_t gpio, struct soc_amd_gpio_register_save *save)
 
void gpio_restore_pin_registers (gpio_t gpio, struct soc_amd_gpio_register_save *save)
 

Typedef Documentation

◆ gpio_t

typedef uint32_t gpio_t

Definition at line 9 of file gpio.h.

Function Documentation

◆ gpio_add_events()

void gpio_add_events ( void  )

Definition at line 382 of file gpio.c.

References acpi_pm_state_for_elog(), ARRAY_SIZE, elog_add_event_wake(), ELOG_WAKE_SOURCE_GPIO, chipset_power_state::gpio_state, and MIN.

Referenced by fch_init().

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 soc_amd_gpio gpio_list_ptr,
size_t  size 
)

program a particular set of GPIO

Parameters
gpio_list_ptr= pointer to array of gpio configurations
size= number of entries in array
Returns
none

Definition at line 307 of file gpio.c.

References gpio_configure_pads_with_override(), and NULL.

Referenced by bootblock_mainboard_early_init(), bootblock_mainboard_init(), carrier_gpio_configure(), configure_early_gpio_pads(), configure_gpio_pads(), disable_unused_gpios(), disable_wifi_wake(), early_config_gpio(), early_lpc_init(), enable_i2s(), fw_config_handle(), init_mainboard(), mainboard_chip_init(), mainboard_config_gpios(), mainboard_config_stage_gpios(), mainboard_configure_early_gpios(), mainboard_configure_gpios(), mainboard_init(), mainboard_memory_init_params(), mainboard_program_early_gpios(), mainboard_program_emmc_gpios(), mainboard_program_gpios(), mainboard_romstage_entry(), mainboard_silicon_init_params(), mainboard_smi_sleep(), mb_pre_fspm(), mb_set_up_early_espi(), program_early_gpio_pads(), program_gpio_pads(), sb_reset_i2c_peripherals(), set_uart_config(), setup_gpio(), tpm_enable(), variant_configure_early_gpio_pads(), variant_configure_early_gpios(), variant_configure_gpios(), variant_early_gpio_configure(), variant_pcie_gpio_configure(), verstage_mainboard_espi_init(), verstage_mainboard_tpm_init(), wifi_power_reset_configure_active_high_power(), wifi_power_reset_configure_active_low_power(), and wifi_power_reset_configure_pre_v3().

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

◆ gpio_configure_pads_with_override()

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

◆ gpio_fill_wake_state()

void gpio_fill_wake_state ( struct gpio_wake_state state)

Definition at line 362 of file gpio.c.

References BIOS_INFO, check_gpios(), GPIO_MASTER_SWITCH, gpio_read32(), GPIO_WAKE_STAT_0, GPIO_WAKE_STAT_1, memset(), and printk.

Referenced by fill_chipset_state().

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

◆ gpio_interrupt_status()

int gpio_interrupt_status ( gpio_t  gpio)

Definition at line 312 of file gpio.c.

References GPIO_INT_STATUS, gpio_read32(), GPIO_WAKE_STATUS, and gpio_write32().

Referenced by tis_plat_irq_status().

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

◆ gpio_restore_pin_registers()

void gpio_restore_pin_registers ( gpio_t  gpio,
struct soc_amd_gpio_register_save save 
)

Definition at line 217 of file gpio.c.

References soc_amd_gpio_register_save::control_value, gpio_read32(), gpio_write32(), soc_amd_gpio_register_save::mux_value, and set_gpio_mux().

Referenced by sb_reset_i2c_peripherals().

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

◆ gpio_save_pin_registers()

void gpio_save_pin_registers ( gpio_t  gpio,
struct soc_amd_gpio_register_save save 
)

Definition at line 211 of file gpio.c.

References soc_amd_gpio_register_save::control_value, get_gpio_mux(), gpio_read32(), and soc_amd_gpio_register_save::mux_value.

Referenced by sb_reset_i2c_peripherals().

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

◆ is_gpio_event_active_high()

static bool is_gpio_event_active_high ( uint32_t  flags)
inlinestatic

Definition at line 52 of file gpio.h.

References GPIO_FLAG_EVENT_ACTIVE_HIGH, and GPIO_FLAG_EVENT_ACTIVE_MASK.

Referenced by program_sci(), and program_smi().

Here is the caller graph for this function:

◆ is_gpio_event_active_low()

static bool is_gpio_event_active_low ( uint32_t  flags)
inlinestatic

Definition at line 57 of file gpio.h.

References GPIO_FLAG_EVENT_ACTIVE_LOW, and GPIO_FLAG_EVENT_ACTIVE_MASK.

◆ is_gpio_event_edge_triggered()

static bool is_gpio_event_edge_triggered ( uint32_t  flags)
inlinestatic

Definition at line 47 of file gpio.h.

References GPIO_FLAG_EVENT_TRIGGER_EDGE, and GPIO_FLAG_EVENT_TRIGGER_MASK.

◆ is_gpio_event_level_triggered()

static bool is_gpio_event_level_triggered ( uint32_t  flags)
inlinestatic

Definition at line 42 of file gpio.h.

References GPIO_FLAG_EVENT_TRIGGER_LEVEL, and GPIO_FLAG_EVENT_TRIGGER_MASK.

Referenced by program_sci(), and program_smi().

Here is the caller graph for this function:

◆ soc_get_gpio_event_table()

void soc_get_gpio_event_table ( const struct soc_amd_event **  table,
size_t items 
)

Definition at line 35 of file gpio.c.

References ARRAY_SIZE, and gpio_event_table.

Referenced by set_single_gpio().

Here is the caller graph for this function: