hw: take over ACPI hardware from SMI

Fix #5196
This commit is contained in:
Stefan Kalkowski 2024-04-24 17:29:09 +02:00 committed by Christian Helmuth
parent 68de550090
commit d9420c618c
2 changed files with 14 additions and 0 deletions

View File

@ -228,6 +228,8 @@ Bootstrap::Platform::Board::Board()
info.acpi_fadt = addr_t(table);
Hw::Acpi_fadt fadt(table);
fadt.takeover_acpi();
Hw::Acpi_facs facs(fadt.facs());
facs.wakeup_vector(AP_BOOT_CODE_PAGE);

View File

@ -91,6 +91,9 @@ struct Hw::Acpi_fadt : Genode::Mmio<276>
struct Fw_ctrl : Register < 0x24, 32> { };
struct Fw_ctrl_ext : Register <FW_OFFSET_EXT, 64> { };
struct Smi_cmd : Register<0x30, 32> { };
struct Acpi_enable : Register<0x34, 8> { };
struct Pm1a_cnt_blk : Register < 64, 32> {
struct Slp_typ : Bitfield < 10, 3> { };
struct Slp_ena : Bitfield < 13, 1> { };
@ -176,6 +179,15 @@ struct Hw::Acpi_fadt : Genode::Mmio<276>
Acpi_fadt(Acpi_generic const * a) : Mmio({(char *)a, Mmio::SIZE}) { }
void takeover_acpi()
{
if (!read<Acpi_enable>() || !read<Smi_cmd>())
return;
asm volatile ("out %0, %w1" :: "a" (read<Acpi_enable>()),
"Nd" (read<Smi_cmd>()));
}
addr_t facs() const
{
addr_t facs { };