From 98fb72fa3fcf399c790d24580b1021fecfda778f Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 21 Jul 2021 16:50:10 +0200 Subject: cpu/x86/mp_init: don't wait between INIT and SIPI for X86_AMD_INIT_SIPI Since current AMD SoCs don't need some wait time between INIT and SIPI, we can skip the 10ms wait there, which improves the boot time a bit. before: CPU_CLUSTER: 0 init finished in 632 msecs after: CPU_CLUSTER: 0 init finished in 619 msecs mpinit still works on Mandolin and all CPU cores show up and are usable. This also doesn't change the binary in a timeless build for boards/SoCs that don't select X86_AMD_INIT_SIPI which I verified for lenovo/x230. BUG=b:193885336 Signed-off-by: Felix Held Change-Id: I1e044776f45021742a88a5e369a74383c1baaab6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56533 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/cpu/x86/Kconfig | 4 +++- src/cpu/x86/mp_init.c | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/x86/Kconfig b/src/cpu/x86/Kconfig index 6a3bbd8c0b..a5c2a4df47 100644 --- a/src/cpu/x86/Kconfig +++ b/src/cpu/x86/Kconfig @@ -173,7 +173,9 @@ config X86_AMD_INIT_SIPI help This option limits the number of SIPI signals sent during during the common AP setup. Intel documentation specifies an INIT SIPI SIPI - sequence, however this doesn't work on some AMD platforms. + sequence, however this doesn't work on some AMD platforms. These + newer AMD platforms don't need the 10ms wait between INIT and SIPI, + so skip that too to save some time. config SOC_SETS_MSRS bool diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index a3a6becad7..3eef355148 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -449,8 +449,11 @@ static int start_aps(struct bus *cpu_bus, int ap_count, atomic_t *num_aps) /* Send INIT IPI to all but self. */ lapic_send_ipi(LAPIC_DEST_ALLBUT | LAPIC_INT_ASSERT | LAPIC_DM_INIT, 0); - printk(BIOS_DEBUG, "Waiting for 10ms after sending INIT.\n"); - mdelay(10); + + if (!CONFIG(X86_AMD_INIT_SIPI)) { + printk(BIOS_DEBUG, "Waiting for 10ms after sending INIT.\n"); + mdelay(10); + } /* Send 1st SIPI */ if (lapic_busy()) { -- cgit v1.2.3