![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
Go to the source code of this file.
Data Structures | |
struct | smm_runtime |
struct | smm_module_params |
struct | smm_stub_params |
struct | smm_loader_params |
Macros | |
#define | SMM_DEFAULT_BASE 0x30000 |
#define | SMM_DEFAULT_SIZE 0x10000 |
#define | SMM_BASE 0xa0000 |
#define | SMM_ENTRY_OFFSET 0x8000 |
#define | SMM_SAVE_STATE_BEGIN(x) (SMM_ENTRY_OFFSET + (x)) |
#define | APM_CNT 0xb2 |
#define | APM_CNT_NOOP_SMI 0x00 |
#define | APM_CNT_ACPI_DISABLE 0x1e |
#define | APM_CNT_ACPI_ENABLE 0xe1 |
#define | APM_CNT_ROUTE_ALL_XHCI 0xca |
#define | APM_CNT_FINALIZE 0xcb |
#define | APM_CNT_LEGACY 0xcc |
#define | APM_CNT_MBI_UPDATE 0xeb |
#define | APM_CNT_SMMINFO 0xec |
#define | APM_CNT_SMMSTORE 0xed |
#define | APM_CNT_ELOG_GSMI 0xef |
#define | APM_STS 0xb3 |
#define | SMM_REVISION_OFFSET_FROM_TOP (0x8000 - 0x7efc) |
Typedefs | |
typedef asmlinkage void(* | smm_handler_t) (void *) |
Enumerations | |
enum | { SMM_SUBREGION_HANDLER , SMM_SUBREGION_CACHE , SMM_SUBREGION_CHIPSET , SMM_SUBREGION_NUM } |
Variables | |
unsigned char | _binary_smm_start [] |
unsigned char | _binary_smm_end [] |
struct smm_runtime | __packed |
#define SMM_SAVE_STATE_BEGIN | ( | x | ) | (SMM_ENTRY_OFFSET + (x)) |
typedef asmlinkage void(* smm_handler_t) (void *) |
anonymous enum |
int apm_control | ( | u8 | cmd | ) |
Definition at line 31 of file smi_trigger.c.
References APM_CNT, apmc_log(), BIOS_DEBUG, CONFIG, ENV_SMM, outb(), and printk.
Referenced by aseg_smm_relocate(), finalize_chipset(), i82801gx_set_acpi_mode(), i82801ix_set_acpi_mode(), i82801jx_set_acpi_mode(), lpc_final(), mainboard_suspend_resume(), pch_set_acpi_mode(), soc_finalize(), and usb_xhci_init().
Definition at line 46 of file smi_trigger.c.
References APM_CNT, apmc_log(), and inb().
Referenced by smihandler_southbridge_apmc(), and southbridge_smi_apmc().
Definition at line 9 of file backup_default_smm.c.
References acpi_is_wakeup_s3(), BIOS_DEBUG, cbmem_add(), CBMEM_ID_SMM_SAVE_SPACE, CONFIG, memcpy(), NULL, printk, SMM_DEFAULT_BASE, and SMM_DEFAULT_SIZE.
Referenced by aseg_smm_relocate().
Definition at line 206 of file smm_module_handler.c.
Referenced by smm_handler_start().
Set the EOS bit and enable SMI generation from southbridge.
Definition at line 60 of file smi_util.c.
References dump_all_status(), GBL_EN, PWRBTN_EN, smi_enabled(), smi_read32(), SMI_REG_SMITRIG0, smi_write32(), SMITRG0_EOS, SMITRG0_SMIENB, and smm_southbridge_enable().
Referenced by mainboard_enable().
Definition at line 69 of file smm.c.
References GBL_EN, and smm_southbridge_enable().
Referenced by post_mp_init().
void io_trap_handler | ( | int | smif | ) |
Definition at line 58 of file smihandler.c.
References BIOS_DEBUG, mainboard_io_trap_handler(), printk, and southbridge_io_trap_handler().
Referenced by smihandler_southbridge_monitor(), and southbridge_smi_monitor().
int mainboard_io_trap_handler | ( | int | smif | ) |
Definition at line 206 of file smihandler.c.
References BIOS_DEBUG, global_nvs::brtl, DEFAULT_GPIOBASE, dock_connect(), dock_disconnect(), ec_clr_bit(), ec_read(), ec_set_bit(), ec_write(), gnvs, GP_LVL, inl(), legacy_io_present(), mainboard_smi_brightness_down(), mainboard_smi_brightness_up(), mainboard_smi_save_cmos(), mdelay(), outl(), printk, SMI_BRIGHTNESS_DOWN, SMI_BRIGHTNESS_UP, SMI_DOCK_CONNECT, SMI_DOCK_DISCONNECT, SMI_SAVE_CMOS, and global_nvs::smif.
Referenced by io_trap_handler(), and mainboard_smi_handle_ec_sci().
int mainboard_smi_apmc | ( | u8 | data | ) |
Definition at line 209 of file smihandler.c.
References ACPI_SMI_CMD_DISABLE, ACPI_SMI_CMD_ENABLE, APM_CNT_ACPI_DISABLE, APM_CNT_ACPI_ENABLE, APM_CNT_BOARD_SMI, APM_CNT_FINALIZE, BIOS_DEBUG, chromeec_smi_apmc(), CONFIG, EC_ACPI_DISABLE, EC_ACPI_ENABLE, ec_clear_out_queue(), EC_CMD_DISABLE_ACPI_MODE, EC_CMD_ENABLE_ACPI_MODE, EC_CMD_NOTIFY_ACPI_ENTER, EC_CMD_NOTIFY_ACPI_EXIT, ec_enter_acpi_mode(), ec_enter_apm_mode(), EC_HOST_EVENT_NONE, ec_kbc_write_cmd(), ec_kbc_write_ib(), EC_LID_GEVENT, EC_LID_GPI, EC_MAILBOX_PORT, ec_set_ports(), EC_SMI_DISABLE, EC_SMI_ENABLE, ec_smi_handler(), ec_write(), ec_write_cmd(), gnvs, google_chromeec_get_event(), google_chromeec_set_sci_mask(), google_chromeec_set_smi_mask(), GPE_EC_SCI, GPE_PALMDET1, GPE_PALMDET2, GPI_IS_SCI, GPI_IS_SMI, gpi_route_interrupt(), GPIO_133, gpio_set(), hudson_configure_gevent_smi(), hudson_disable_gevent_smi(), inb(), info, LINK_EC_SCI_EVENTS, LINK_EC_SMI_EVENTS, MAINBOARD_EC_SCI_EVENTS, MAINBOARD_EC_SMI_EVENTS, outb(), PCI_DEV, pci_read_config8(), pci_write_config8(), printk, SCH5545_GLOBAL_PME_EN, SCH5545_GLOBAL_PME_STS, SCH5545_KBD_PME_EN, SCH5545_MOUSE_PME_EN, SCH5545_RR_PME_EN, SCH5545_RR_PME_EN1, SCH5545_RR_PME_STS, SCH5545_RUNTIME_REG_BASE, send_ec_command(), send_ec_data(), SMI_LVL_LOW, SMI_MODE_SMI, global_nvs::smif, stout_ec_finalize_smm(), val, variant_get_event_info(), and wilco_ec_smi_apmc().
Referenced by fch_apmc_smi_handler(), hudson_apmc_smi_handler(), smihandler_southbridge_apmc(), and southbridge_smi_apmc().
Definition at line 211 of file smihandler.c.
References CONFIG, and mainboard_config_cbi_wp().
Referenced by finalize().
Definition at line 208 of file smihandler.c.
References BIOS_DEBUG, BIOS_WARNING, chromeec_smi_process_events(), CONFIG, EC_LID_GEVENT, EC_LID_GPI, EC_MAILBOX_PORT, EC_NO_EVENT, ec_set_ports(), EC_SMI_DISABLE, EC_SMI_ENABLE, EC_SMI_GEVENT, EC_SMI_GPI, GPE_EC_SCI, GPE_EC_SMI, handle_ec_smi(), handle_lid_smi(), mainboard_smi_ec(), mainboard_smi_handle_ec_sci(), mainboard_smi_hotkey(), PM1_CNT, printk, read_pmbase32(), recv_ec_oem_data(), send_ec_command(), send_ec_oem_command(), and write_pmbase32().
Referenced by process_gpe_smi(), process_smi_sources(), southbridge_smi_gpi(), and southbridge_smi_handler().
Definition at line 210 of file smihandler.c.
References ACPI_S3, ACPI_S4, ACPI_S5, addr, BIOS_DEBUG, BIOS_INFO, chromeec_smi_device_event_sleep(), chromeec_smi_sleep(), COMMUNITY_OFFSET_GPNORTH, CONFIG, EC_DEVICE_CONTROL_1, EC_DEVICE_CONTROL_1_BOOMER_ON, EC_DEVICE_CONTROL_2, EC_DEVICE_CONTROL_2_MPI_ON, EC_DEVICE_CONTROL_2_USB_ON, EC_EC_PSW, EC_HOST_EVENT_NONE, ec_it8518_enable_wake_events(), ec_kbc_write_cmd(), ec_kbc_write_ib(), EC_KBD_CMD_MUTE, ec_mem_read(), ec_mem_write(), EC_PERIPH_CNTL_3, EC_PSW_IKB, EC_PSW_USB, ec_read(), ec_running(), EC_USB_S3_EN, ec_write(), enable_gpe(), gnvs, google_chromeec_get_event(), google_chromeec_set_sci_mask(), google_chromeec_set_smi_mask(), google_chromeec_set_usb_charge_mode(), google_chromeec_set_wake_mask(), GPE_EC_WAKE, GPI_IS_SCI, gpi_route_interrupt(), gpio_configure_pads(), GPIO_LTE_DISABLE_L, GPIO_PP3300_CODEC_EN, GPIO_SUS1_WAKE_MASK, GPIO_SUS7_WAKE_MASK, GPIO_USB_CTL_1, GPIO_WAKE_MASK_REG0, GPIO_WLAN_DISABLE_L, inb(), info, IO_BASE_ADDRESS, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ, it8772f_gpio_led(), LED_BLINK, LED_OFF, LINK_EC_S3_WAKE_EVENTS, lpc_set_low_power(), mainboard_disable_gpios(), MAINBOARD_EC_S3_DEVICE_EVENTS, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS, mainboard_gpio_smi_sleep(), mask, outb(), PCH_XHCI_DEV, pci_read_config32(), pci_write_config32(), printk, read32(), S3, global_nvs::s3u0, global_nvs::s3u1, global_nvs::s5u0, global_nvs::s5u1, set_gpio(), set_power_led(), SIO_GPIO_BASE_SET4, SIO_GPIO_BLINK_GPIO45, SUPERIO_DEV, SUPERIO_LOCK, SUPERIO_UNLOCK, SUPERIO_WRITE, USB_CHARGE_MODE_DISABLED, variant_get_event_info(), variant_sleep_gpio_table(), variant_smi_sleep(), WAKE_GPIO_EN, wilco_ec_smi_sleep(), write32(), and global_nvs::xhci.
Referenced by fch_slp_typ_handler(), smihandler_southbridge_sleep(), and southbridge_smi_sleep().
Definition at line 207 of file smm_module_handler.c.
Referenced by smm_handler_start().
Definition at line 6 of file smi.c.
References APM_CNT, PM_ACPI_SMI_CMD, and pm_read16().
Referenced by fch_apmc_smi_handler(), and find_save_state().
Definition at line 42 of file backup_default_smm.c.
References memcpy(), NULL, SMM_DEFAULT_BASE, and SMM_DEFAULT_SIZE.
Referenced by smm_init_completion().
Definition at line 159 of file smm_module_loader.c.
References cpus, and cpu_smm_info::smbase.
Referenced by smm_do_relocation().
void* smm_get_save_state | ( | int | cpu | ) |
Definition at line 114 of file smihandler.c.
References NULL, smm_runtime::num_cpus, smm_runtime::save_state_size, smm_runtime::save_state_top, SMM_AMD64_ARCH_OFFSET, SMM_BASE, SMM_EM64T100_ARCH_OFFSET, SMM_EM64T101_ARCH_OFFSET, SMM_LEGACY_ARCH_OFFSET, smm_revision(), and smm_save_state().
Referenced by find_save_state(), smi_apmc_find_state_save(), smi_handler(), and smm_revision().
asmlinkage void smm_handler_start | ( | void * | params | ) |
Definition at line 126 of file smm_module_handler.c.
References arg, BIOS_DEBUG, BIOS_SPEW, smm_module_params::canary, CONFIG, console_init(), smm_module_params::cpu, cpu_smi_handler(), DEBUG_SMI, die(), do_driver_init, gnvs, smm_runtime::gnvs_ptr, northbridge_smi_handler(), printk, smi_backup_pci_address(), smi_handler_status, SMI_LOCKED, smi_obtain_lock(), smi_release_lock(), smi_restore_pci_address(), smi_set_eos(), smm_soc_early_init(), smm_soc_exit(), southbridge_smi_handler(), and spi_init().
Definition at line 70 of file tseg_region.c.
References base, BIOS_DEBUG, printk, PRIxPTR, smm_region(), smm_subregion(), and SMM_SUBREGION_NUM.
Referenced by car_stage_entry(), and romstage_main().
int smm_load_module | ( | uintptr_t | smram_base, |
size_t | smram_size, | ||
struct smm_loader_params * | params | ||
) |
Definition at line 458 of file smm_module_loader.c.
References _binary_smm_start, acpi_get_gnvs(), base, BIOS_DEBUG, BIOS_ERR, cbmem_entry_find(), cbmem_entry_size(), cbmem_entry_start(), CBMEM_ID_CONSOLE, smm_runtime::cbmemc, smm_runtime::cbmemc_size, CONFIG, cpus, DEBUG_SMI, FXSAVE_SIZE, smm_runtime::gnvs_ptr, memset(), NULL, smm_runtime::num_cpus, params, printk, rmodule_entry(), rmodule_load(), rmodule_load_alignment(), rmodule_memory_size(), rmodule_parameters(), rmodule_parse(), smm_runtime::save_state_size, smm_runtime::save_state_top, smm_runtime::smbase, SMM_CODE_SEGMENT_SIZE, smm_create_map(), SMM_DEFAULT_SIZE, smm_load_module_aseg(), smm_module_setup_stub(), smm_runtime::smm_size, cpu_smm_info::ss_start, and stack_top.
Definition at line 118 of file smm.h.
References smm_region_overlaps_handler().
Referenced by backlight_off(), mainboard_smi_brightness_down(), mainboard_smi_brightness_up(), range_check(), and xhci_a0_suspend_smm_workaround().
Definition at line 50 of file memmap.c.
References ALIGN_DOWN, BGSM, BIOS_ERR, BIOS_SPEW, BUNIT_SMRRL, clear_tvalid(), ESMRAMC, EXT_TSEG_MBYTES, fsp_find_range_hob(), HOST_BRIDGE, iosf_bunit_read(), KiB, MiB, northbridge_get_tseg_base(), northbridge_get_tseg_limit(), northbridge_get_tseg_size(), pci_read_config16(), pci_read_config32(), pci_read_config8(), printk, qemu_get_memory_size(), range_entry_base(), range_entry_size(), sa_get_tseg_base(), sa_get_tseg_size(), dpr_register::size, smm_region_size(), smm_region_start(), TSEG, TSEG_SZ_MASK, VTD_DEV, VTD_TSEG_BASE_CSR, and VTD_TSEG_LIMIT_CSR.
Referenced by cbmem_top_chipset(), fill_in_relocation_params(), get_smm_info(), lockdown_intel_txt(), nc_read_resources(), postcar_enable_tseg_cache(), raminit(), smm_list_regions(), smm_subregion(), and txt_dump_regions().
Definition at line 132 of file smihandler.c.
References region_overlap(), smm_runtime::smbase, SMM_BASE, SMM_DEFAULT_SIZE, and smm_runtime::smm_size.
Referenced by smm_points_to_smram().
Definition at line 109 of file smihandler.c.
References save_state, smm_runtime::save_state_size, SMM_BASE, SMM_ENTRY_OFFSET, smm_get_save_state(), and SMM_REVISION_OFFSET_FROM_TOP.
Referenced by init_save_state(), smi_handler(), and smm_get_save_state().
int smm_setup_relocation_handler | ( | struct smm_loader_params * | params | ) |
Definition at line 406 of file smm_module_loader.c.
References BIOS_SPEW, fxsave_area_relocation, NULL, params, printk, SMM_DEFAULT_BASE, SMM_DEFAULT_SIZE, and smm_module_setup_stub().
int smm_setup_stack | ( | const uintptr_t | perm_smbase, |
const size_t | perm_smram_size, | ||
const unsigned int | total_cpus, | ||
const size_t | stack_size | ||
) |
Definition at line 235 of file smm_module_loader.c.
References BIOS_ERR, g_stack_size, printk, SMM_MINIMUM_STACK_SIZE, and stack_top.
Referenced by load_smm_handlers().
Definition at line 214 of file smm_module_handler.c.
References __CBMEM_CONSOLE_ENABLE__, CONFIG, and replay_transfer_buffer_cbmemc().
Referenced by smm_handler_start().
Definition at line 215 of file smm_module_handler.c.
Referenced by smm_handler_start().
Definition at line 22 of file tseg_region.c.
References ASSERT, IS_ALIGNED, smm_region(), SMM_SUBREGION_CACHE, SMM_SUBREGION_CHIPSET, and SMM_SUBREGION_HANDLER.
Referenced by fill_in_relocation_params(), get_smm_info(), smm_info(), smm_list_regions(), and stage_cache_external_region().
int southbridge_io_trap_handler | ( | int | smif | ) |
Definition at line 131 of file smihandler.c.
References BIOS_DEBUG, gnvs, printk, and global_nvs::smif.
Referenced by io_trap_handler().
Interrupt handler for SMI#.
Definition at line 207 of file smihandler.c.
References ARRAY_SIZE, BIOS_DEBUG, BIOS_WARNING, clear_alt_status(), clear_smi_sci_status(), clear_smi_status(), dump, dump_smi_status(), get_smm_save_state_ops(), GPE0_STS_BIT, mainboard_smi_gpi(), NULL, PCI_DEV, pci_read_config16(), PM1_STS_BIT, pmbase, pmc_clear_smi_status(), pmc_read_pm1_control(), printk, process_gpe_smi(), process_smi_0x84(), process_smi_0x88(), process_smi_0x8c(), process_smi_0x90(), process_smi_sci(), process_smi_sources(), reset_smi_status(), SCI_EN, smi_read16(), smi_read32(), SMI_REG_POINTER, SMI_REG_SMISTS0, SMI_REG_SMISTS1, SMI_REG_SMISTS2, SMI_REG_SMISTS3, SMI_REG_SMISTS4, SMI_SCI_STATUS, SMI_SOURCE_0x84, SMI_SOURCE_0x88, SMI_SOURCE_0x90, SMI_SOURCE_GPE, SMI_SOURCE_IRQ_TRAP, SMI_SOURCE_SCI, SMI_STATUS_SRC_0, SMI_STATUS_SRC_1, SMI_STATUS_SRC_2, SMI_STATUS_SRC_3, SMI_STATUS_SRC_4, SMI_STATUS_SRC_SCI, and southbridge_smi.
Referenced by smi_handler(), and smm_handler_start().
Set the EOS bit.
Definition at line 68 of file smi_util.c.
References enable_smi(), EOS, inb(), outb(), pmbase, pmc_enable_smi(), read_pmbase8(), SMI_EN, smi_read32(), SMI_REG_SMITRIG0, smi_write32(), SMITRG0_EOS, and write_pmbase8().
Referenced by smi_set_eos().
struct smm_stub_params __packed |
|
extern |
Referenced by aseg_smm_install(), and smm_init().
|
extern |
Referenced by aseg_smm_install(), smm_init(), smm_load_module(), and smm_load_module_aseg().