From a9f49366c09f8902a13221185449a1d0870af1c6 Mon Sep 17 00:00:00 2001 From: Richard Spiegel Date: Mon, 5 Mar 2018 08:11:50 -0700 Subject: soc/amd/stoneyridge: Create a HALT_THIS_AP callout It was required for all cores use the same CAR teardown function (exit_car.S and gcccar.inc). AGESA has already been modified to do the AP to do the call out. Create assembly code to call chipset_teardown_car and then enter an endless loop with halt instruction. Then create the call out that will call this new assembly code. BUG=b:70338633 AGESA COMMIT=3313d277 TEST=Created a debug version of AGESA that would print the returned status of HALT_THIS_AP. Build code without the fix, see the return. Build code with the fix, see that there's no return. Change-Id: I05ee405812211d93dfdbdc5ee7d9978c2eb585e1 Signed-off-by: Richard Spiegel Reviewed-on: https://review.coreboot.org/24999 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/soc/amd/stoneyridge/BiosCallOuts.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/soc/amd/stoneyridge/BiosCallOuts.c') diff --git a/src/soc/amd/stoneyridge/BiosCallOuts.c b/src/soc/amd/stoneyridge/BiosCallOuts.c index 4ddcedcdd9..f30ed3cb01 100644 --- a/src/soc/amd/stoneyridge/BiosCallOuts.c +++ b/src/soc/amd/stoneyridge/BiosCallOuts.c @@ -26,6 +26,7 @@ #include #include #include "chip.h" +#include void __attribute__((weak)) platform_FchParams_reset( FCH_RESET_DATA_BLOCK *FchParams_reset) {} @@ -139,6 +140,24 @@ AGESA_STATUS agesa_ReadSpd(UINT32 Func, UINTN Data, VOID *ConfigPtr) return AGESA_SUCCESS; } +AGESA_STATUS agesa_HaltThisAp(UINT32 Func, UINTN Data, VOID *ConfigPtr) +{ + AGESA_HALT_THIS_AP_PARAMS *info = ConfigPtr; + uint32_t flags = 0; + + if (info->PrimaryCore == TRUE) + return AGESA_UNSUPPORTED; /* force normal path */ + if (info->ExecWbinvd == TRUE) + flags |= 1; + if (info->CacheEn == TRUE) + flags |= 2; + + ap_teardown_car(flags); /* does not return */ + + /* Should never reach here */ + return AGESA_UNSUPPORTED; +} + /* Allow mainboards to fill the SPD buffer */ __attribute__((weak)) int mainboard_read_spd(uint8_t spdAddress, char *buf, size_t len) -- cgit v1.2.3