elog: make elog's SMM handler code follow everything else

Instead of ELOG_GSMI_APM_CNT use APM_CNT_ELOG_GSMI and define it in
cpu/x86/smm.h

Change-Id: I3a3e2f823c91b475d1e15b8c20e9cf5f3fd9de83
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/30022
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Georgi 2018-12-03 16:10:33 +01:00
parent 8b04dc730d
commit d61839c3ea
11 changed files with 19 additions and 21 deletions

View File

@ -473,6 +473,7 @@ typedef struct {
#define APM_CNT_GNVS_UPDATE 0xea #define APM_CNT_GNVS_UPDATE 0xea
#define APM_CNT_FINALIZE 0xcb #define APM_CNT_FINALIZE 0xcb
#define APM_CNT_LEGACY 0xcc #define APM_CNT_LEGACY 0xcc
#define APM_CNT_ELOG_GSMI 0xef
#define APM_STS 0xb3 #define APM_STS 0xb3
/* SMI handler function prototypes */ /* SMI handler function prototypes */

View File

@ -16,9 +16,6 @@
#ifndef ELOG_H_ #ifndef ELOG_H_
#define ELOG_H_ #define ELOG_H_
/* SMI command code for GSMI event logging */
#define ELOG_GSMI_APM_CNT 0xEF
#define MAX_EVENT_SIZE 0x7F #define MAX_EVENT_SIZE 0x7F
/* End of log */ /* End of log */

View File

@ -72,7 +72,7 @@ static void southbridge_smi_gsmi(void)
amd64_smm_state_save_area_t *io_smi; amd64_smm_state_save_area_t *io_smi;
u32 reg_ebx; u32 reg_ebx;
io_smi = find_save_state(ELOG_GSMI_APM_CNT); io_smi = find_save_state(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
/* Command and return value in EAX */ /* Command and return value in EAX */
@ -101,7 +101,7 @@ static void sb_apmc_smi_handler(void)
reg32 &= ~(1 << 0); /* clear SCI_EN */ reg32 &= ~(1 << 0); /* clear SCI_EN */
acpi_write32(MMIO_ACPI_PM1_CNT_BLK, reg32); acpi_write32(MMIO_ACPI_PM1_CNT_BLK, reg32);
break; break;
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
if (IS_ENABLED(CONFIG_ELOG_GSMI)) if (IS_ENABLED(CONFIG_ELOG_GSMI))
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;

View File

@ -214,7 +214,7 @@ static void southbridge_smi_gsmi(void)
u32 *ret, *param; u32 *ret, *param;
uint8_t sub_command; uint8_t sub_command;
em64t100_smm_state_save_area_t *io_smi = em64t100_smm_state_save_area_t *io_smi =
smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
@ -347,7 +347,7 @@ static void southbridge_smi_apmc(void)
} }
break; break;
#if IS_ENABLED(CONFIG_ELOG_GSMI) #if IS_ENABLED(CONFIG_ELOG_GSMI)
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;
#endif #endif

View File

@ -263,7 +263,7 @@ static void southbridge_smi_gsmi(void)
u32 *ret, *param; u32 *ret, *param;
uint8_t sub_command; uint8_t sub_command;
em64t100_smm_state_save_area_t *io_smi = em64t100_smm_state_save_area_t *io_smi =
smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
@ -344,7 +344,7 @@ static void southbridge_smi_apmc(void)
} }
break; break;
#if IS_ENABLED(CONFIG_ELOG_GSMI) #if IS_ENABLED(CONFIG_ELOG_GSMI)
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;
#endif #endif

View File

@ -300,7 +300,7 @@ static void southbridge_smi_gsmi(void)
u32 *ret, *param; u32 *ret, *param;
u8 sub_command; u8 sub_command;
em64t101_smm_state_save_area_t *io_smi = em64t101_smm_state_save_area_t *io_smi =
smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
@ -374,7 +374,7 @@ static void southbridge_smi_apmc(void)
} }
break; break;
#if IS_ENABLED(CONFIG_ELOG_GSMI) #if IS_ENABLED(CONFIG_ELOG_GSMI)
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;
#endif #endif

View File

@ -279,7 +279,7 @@ static void southbridge_smi_gsmi(
void *io_smi = NULL; void *io_smi = NULL;
uint32_t reg_ebx; uint32_t reg_ebx;
io_smi = find_save_state(save_state_ops, ELOG_GSMI_APM_CNT); io_smi = find_save_state(save_state_ops, APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
/* Command and return value in EAX */ /* Command and return value in EAX */
@ -387,7 +387,7 @@ void smihandler_southbridge_apmc(
printk(BIOS_DEBUG, "SMI#: Setting GNVS to %p\n", gnvs); printk(BIOS_DEBUG, "SMI#: Setting GNVS to %p\n", gnvs);
} }
break; break;
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
if (IS_ENABLED(CONFIG_ELOG_GSMI)) if (IS_ENABLED(CONFIG_ELOG_GSMI))
southbridge_smi_gsmi(save_state_ops); southbridge_smi_gsmi(save_state_ops);
break; break;

View File

@ -212,7 +212,7 @@ static void southbridge_smi_gsmi(void)
u32 *ret, *param; u32 *ret, *param;
uint8_t sub_command; uint8_t sub_command;
em64t100_smm_state_save_area_t *io_smi = em64t100_smm_state_save_area_t *io_smi =
smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
@ -274,7 +274,7 @@ static void southbridge_smi_apmc(void)
} }
break; break;
#if IS_ENABLED(CONFIG_ELOG_GSMI) #if IS_ENABLED(CONFIG_ELOG_GSMI)
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;
#endif #endif

View File

@ -249,7 +249,7 @@ static void southbridge_smi_gsmi(void)
u32 *ret, *param; u32 *ret, *param;
u8 sub_command; u8 sub_command;
em64t101_smm_state_save_area_t *io_smi = em64t101_smm_state_save_area_t *io_smi =
smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
@ -316,7 +316,7 @@ static void southbridge_smi_apmc(void)
mainboard_finalized = 1; mainboard_finalized = 1;
break; break;
#if IS_ENABLED(CONFIG_ELOG_GSMI) #if IS_ENABLED(CONFIG_ELOG_GSMI)
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;
#endif #endif

View File

@ -537,7 +537,7 @@ static void southbridge_smi_gsmi(void)
u32 *ret, *param; u32 *ret, *param;
u8 sub_command; u8 sub_command;
em64t101_smm_state_save_area_t *io_smi = em64t101_smm_state_save_area_t *io_smi =
smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
@ -604,7 +604,7 @@ static void southbridge_smi_apmc(void)
} }
break; break;
#if IS_ENABLED(CONFIG_ELOG_GSMI) #if IS_ENABLED(CONFIG_ELOG_GSMI)
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;
#endif #endif

View File

@ -253,7 +253,7 @@ static void southbridge_smi_gsmi(void)
u32 *ret, *param; u32 *ret, *param;
u8 sub_command; u8 sub_command;
em64t101_smm_state_save_area_t *io_smi = em64t101_smm_state_save_area_t *io_smi =
smi_apmc_find_state_save(ELOG_GSMI_APM_CNT); smi_apmc_find_state_save(APM_CNT_ELOG_GSMI);
if (!io_smi) if (!io_smi)
return; return;
@ -333,7 +333,7 @@ static void southbridge_smi_apmc(void)
usb_xhci_route_all(); usb_xhci_route_all();
break; break;
#if IS_ENABLED(CONFIG_ELOG_GSMI) #if IS_ENABLED(CONFIG_ELOG_GSMI)
case ELOG_GSMI_APM_CNT: case APM_CNT_ELOG_GSMI:
southbridge_smi_gsmi(); southbridge_smi_gsmi();
break; break;
#endif #endif