Felix Held submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Matt DeVillier: Looks good to me, approved
arch/x86/include/smm_call: use pm_acpi_smi_cmd_port

Use pm_acpi_smi_cmd_port() to get the APMC trigger IO port instead of
using the hard-coded APM_CNT define. This makes sure that the correct
APMC IO port will be used even when a system doesn't use the default
APM IO port.

TEST=SMMSTORE V2 still works with the EDK2 payload on Careena

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Icb79c91cfcd75db760bd80cff7f3d0400d1f16cd
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79568
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M src/arch/x86/include/smm_call.h
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/arch/x86/include/smm_call.h b/src/arch/x86/include/smm_call.h
index c0d96c0..66925c4 100644
--- a/src/arch/x86/include/smm_call.h
+++ b/src/arch/x86/include/smm_call.h
@@ -11,13 +11,14 @@
*/
static inline u32 call_smm(u8 cmd, u8 subcmd, void *arg)
{
+ const uint16_t apmc_port = pm_acpi_smi_cmd_port();
u32 res = 0;
__asm__ __volatile__ (
"outb %%al, %%dx"
: "=a" (res)
: "a" ((subcmd << 8) | cmd),
"b" (arg),
- "d" (APM_CNT)
+ "d" (apmc_port)
: "memory");
return res;
}

To view, visit change 79568. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Icb79c91cfcd75db760bd80cff7f3d0400d1f16cd
Gerrit-Change-Number: 79568
Gerrit-PatchSet: 9
Gerrit-Owner: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella@intel.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-MessageType: merged