![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <acpi/acpi_pm.h>
#include <device/mmio.h>
#include <device/device.h>
#include <console/console.h>
#include <elog.h>
#include <gpio.h>
#include <amdblocks/acpi.h>
#include <amdblocks/acpimmio.h>
#include <amdblocks/gpio.h>
#include <amdblocks/smi.h>
#include <soc/gpio.h>
#include <soc/smi.h>
#include <assert.h>
#include <string.h>
#include <types.h>
Go to the source code of this file.
|
static |
Definition at line 326 of file gpio.c.
References ARRAY_SIZE, BIOS_INFO, gpio_read32(), GPIO_WAKE_STATUS, and printk.
Referenced by check_gpios().
|
static |
Definition at line 342 of file gpio.c.
References BIT, and check_and_add_wake_gpio().
Referenced by gpio_fill_wake_state().
|
static |
Definition at line 71 of file gpio.c.
Referenced by set_single_gpio().
Definition at line 60 of file gpio.c.
References gpio_mux_ptr(), and read8().
Referenced by gpio_save_pin_registers(), and set_gpio_mux().
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().
Definition at line 144 of file gpio.c.
References gpio_update32(), and mask.
Referenced by gpio_input(), and master_switch_clr().
void gpio_configure_pads | ( | const struct soc_amd_gpio * | gpio_list_ptr, |
size_t | size | ||
) |
program a particular set of GPIO
gpio_list_ptr | = pointer to array of gpio configurations |
size | = number of entries in array |
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().
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 | ||
) |
Definition at line 262 of file gpio.c.
References c, soc_amd_gpio::gpio, GPIO_INTERRUPT_EN, GPIO_MASK_STS_EN, master_switch_clr(), master_switch_set(), and set_single_gpio().
Referenced by bootblock_mainboard_early_init(), bootblock_mainboard_init(), gpio_configure_pads(), mainboard_chip_init(), mainboard_configure_gpios(), mainboard_init(), mb_pre_fspm(), and verstage_mainboard_early_init().
Definition at line 26 of file gpio.c.
References acpimmio_gpio0, acpimmio_remote_gpio, AMD_GPIO_FIRST_REMOTE_GPIO_NUMBER, CONFIG, ENV_SEPARATE_VERSTAGE, and SOC_GPIO_TOTAL_PINS.
Referenced by gpio_read32(), and gpio_write32().
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().
int gpio_get | ( | gpio_t | gpio_num | ) |
Definition at line 166 of file gpio.c.
Referenced by _gpio_base2_value(), _gpio_base3_value(), has_360_sensor_board(), and variant_mainboard_post_init_params().
Definition at line 189 of file gpio.c.
Referenced by _gpio_base3_value(), and gpio_base2_value().
Definition at line 179 of file gpio.c.
Referenced by _gpio_base3_value(), and gpio_pulldown_base2_value().
Definition at line 184 of file gpio.c.
Referenced by _gpio_base3_value(), gpio_eint_configure(), and gpio_pullup_base2_value().
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().
Definition at line 48 of file gpio.c.
References acpimmio_iomux, acpimmio_remote_gpio, AMD_GPIO_FIRST_REMOTE_GPIO_NUMBER, AMD_GPIO_REMOTE_GPIO_MUX_OFFSET, CONFIG, ENV_SEPARATE_VERSTAGE, and SOC_GPIO_TOTAL_PINS.
Referenced by get_gpio_mux(), and set_gpio_mux().
Definition at line 149 of file gpio.c.
References gpio_update32().
Referenced by gpio_output(), master_switch_set(), and set_single_gpio().
Definition at line 38 of file gpio.c.
References gpio_ctrl_ptr(), and read32().
Referenced by check_and_add_wake_gpio(), gpio_fill_wake_state(), gpio_get(), gpio_interrupt_status(), gpio_restore_pin_registers(), gpio_save_pin_registers(), and gpio_update32().
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().
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().
Definition at line 174 of file gpio.c.
Referenced by __gpio_output(), and gpio_output().
Definition at line 139 of file gpio.c.
References gpio_update32(), and mask.
Referenced by gpio_input_pulldown(), gpio_input_pullup(), gpio_set(), and set_single_gpio().
Definition at line 128 of file gpio.c.
References gpio_read32(), gpio_write32(), and mask.
Referenced by gpio_and32(), gpio_or32(), and gpio_setbits32().
Definition at line 43 of file gpio.c.
References gpio_ctrl_ptr(), value, and write32().
Referenced by gpio_interrupt_status(), gpio_restore_pin_registers(), and gpio_update32().
Definition at line 154 of file gpio.c.
References gpio_and32(), GPIO_MASTER_SWITCH, and mask.
Referenced by gpio_configure_pads_with_override().
Definition at line 160 of file gpio.c.
References GPIO_MASTER_SWITCH, and gpio_or32().
Referenced by gpio_configure_pads_with_override().
Definition at line 108 of file gpio.c.
References configure_scimap(), sci_source::direction, sci_source::gpe, is_gpio_event_active_high(), is_gpio_event_level_triggered(), sci_source::level, sci_source::scimap, SMI_SCI_EDG, SMI_SCI_LVL, SMI_SCI_LVL_HIGH, and SMI_SCI_LVL_LOW.
Referenced by set_single_gpio().
Definition at line 83 of file gpio.c.
References BIOS_ERR, BUG, configure_gevent_smi(), is_gpio_event_active_high(), is_gpio_event_level_triggered(), printk, SMI_MODE_SMI, SMI_SCI_LVL_HIGH, and SMI_SCI_LVL_LOW.
Referenced by set_single_gpio().
Definition at line 65 of file gpio.c.
References AMD_GPIO_MUX_MASK, get_gpio_mux(), gpio_mux_ptr(), and write8().
Referenced by gpio_restore_pin_registers(), and set_single_gpio().
|
static |
Definition at line 224 of file gpio.c.
References BIOS_WARNING, CONFIG, soc_amd_gpio::control, ENV_SEPARATE_VERSTAGE, soc_amd_gpio::flags, soc_amd_gpio::function, get_gpio_gevent(), soc_amd_gpio::gpio, GPIO_FLAG_SCI, GPIO_FLAG_SMI, GPIO_INT_STATUS, gpio_or32(), gpio_setbits32(), GPIO_WAKE_STATUS, NULL, PAD_CFG_MASK, printk, program_sci(), program_smi(), set_gpio_mux(), and soc_get_gpio_event_table().
Referenced by gpio_configure_pads_with_override().