summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-12-07 00:32:19 -0600
committerAaron Durbin <adurbin@chromium.org>2016-12-08 21:39:43 +0100
commitb21e362e93993a8879906cf3fa56586b84226920 (patch)
tree0536129b69e5d52d35814f43f16db69d8a42e6e7 /src/arch/x86
parent16bd2676ce1dcec342de19640c45bd7216ba70f1 (diff)
downloadcoreboot-b21e362e93993a8879906cf3fa56586b84226920.tar.xz
cpu/x86: allow AP callbacks after MP init
There are circumstances where the APs need to run a piece of code later in the boot flow. The current MP init just parks the APs after MP init is completed so there's not an opportunity to target running a piece of code on all the APs at a later time. Therefore, provide an option, PARALLEL_MP_AP_WORK, that allows the APs to perform callbacks. BUG=chrome-os-partner:60657 BRANCH=reef Change-Id: I849ecfdd6641dd9424943e246317cd1996ef1ba6 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17745 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Lijian Zhao <lijian.zhao@intel.com>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/cpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/arch/x86/cpu.c b/src/arch/x86/cpu.c
index fbd48b0c2b..1e74d0cd59 100644
--- a/src/arch/x86/cpu.c
+++ b/src/arch/x86/cpu.c
@@ -11,11 +11,13 @@
* GNU General Public License for more details.
*/
+#include <bootstate.h>
#include <boot/coreboot_tables.h>
#include <console/console.h>
#include <cpu/cpu.h>
#include <arch/io.h>
#include <string.h>
+#include <cpu/x86/mp.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/lapic.h>
@@ -310,3 +312,14 @@ void lb_arch_add_records(struct lb_header *header)
tsc_info->size = sizeof(*tsc_info);
tsc_info->freq_khz = freq_khz;
}
+
+void arch_bootstate_coreboot_exit(void)
+{
+ /* APs are already parked by existing infrastructure. */
+ if (!IS_ENABLED(CONFIG_PARALLEL_MP_AP_WORK))
+ return;
+
+ /* APs are waiting for work. Last thing to do is park them. */
+ if (mp_park_aps())
+ printk(BIOS_ERR, "Parking APs failed.\n");
+}