soc/intel/common/block/smm: Add `mainboard_smi_finalize`
This commit adds a method called `mainboard_smi_finalize` which provides a mechanism for a mainboard to execute some code as part of the finalize method in the SMM stage before SoC does its finalization. BUG=b:191189275 BRANCH=None TEST=Implement `mainboard_smi_finalize` on lalala and verify that the code executes in SMM. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: If1ee63431e3c2a5831a4656c3a361229acff3f42 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55649 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
parent
4291c82ac0
commit
633560568d
|
@ -208,3 +208,4 @@ void __weak southbridge_smi_handler(void) {}
|
||||||
void __weak mainboard_smi_gpi(u32 gpi_sts) {}
|
void __weak mainboard_smi_gpi(u32 gpi_sts) {}
|
||||||
int __weak mainboard_smi_apmc(u8 data) { return 0; }
|
int __weak mainboard_smi_apmc(u8 data) { return 0; }
|
||||||
void __weak mainboard_smi_sleep(u8 slp_typ) {}
|
void __weak mainboard_smi_sleep(u8 slp_typ) {}
|
||||||
|
void __weak mainboard_smi_finalize(void) {}
|
||||||
|
|
|
@ -198,3 +198,4 @@ void __weak southbridge_smi_handler() {}
|
||||||
void __weak mainboard_smi_gpi(u32 gpi_sts) {}
|
void __weak mainboard_smi_gpi(u32 gpi_sts) {}
|
||||||
int __weak mainboard_smi_apmc(u8 data) { return 0; }
|
int __weak mainboard_smi_apmc(u8 data) { return 0; }
|
||||||
void __weak mainboard_smi_sleep(u8 slp_typ) {}
|
void __weak mainboard_smi_sleep(u8 slp_typ) {}
|
||||||
|
void __weak mainboard_smi_finalize(void) {}
|
||||||
|
|
|
@ -49,6 +49,7 @@ void southbridge_smi_handler(void);
|
||||||
void mainboard_smi_gpi(u32 gpi_sts);
|
void mainboard_smi_gpi(u32 gpi_sts);
|
||||||
int mainboard_smi_apmc(u8 data);
|
int mainboard_smi_apmc(u8 data);
|
||||||
void mainboard_smi_sleep(u8 slp_typ);
|
void mainboard_smi_sleep(u8 slp_typ);
|
||||||
|
void mainboard_smi_finalize(void);
|
||||||
|
|
||||||
/* This is the SMM handler. */
|
/* This is the SMM handler. */
|
||||||
extern unsigned char _binary_smm_start[];
|
extern unsigned char _binary_smm_start[];
|
||||||
|
|
|
@ -320,6 +320,13 @@ static void finalize(void)
|
||||||
/* Re-init SPI driver to handle locked BAR */
|
/* Re-init SPI driver to handle locked BAR */
|
||||||
fast_spi_init();
|
fast_spi_init();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HECI is disabled in smihandler_soc_at_finalize() which also locks down the side band
|
||||||
|
* interface. Some boards may require this interface in mainboard_smi_finalize(),
|
||||||
|
* therefore, this call must precede smihandler_soc_at_finalize().
|
||||||
|
*/
|
||||||
|
mainboard_smi_finalize();
|
||||||
|
|
||||||
/* Specific SOC SMI handler during ramstage finalize phase */
|
/* Specific SOC SMI handler during ramstage finalize phase */
|
||||||
smihandler_soc_at_finalize();
|
smihandler_soc_at_finalize();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue