From 9fc7b8e973fca05381be66e7053ffa301c9dbe33 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 20 Aug 2018 13:03:45 -0600 Subject: libpayload/x86/delay: Make arch_ndelay call apic_delay if delay is long This reduces power consumption on grunt by over 3W when sitting at the depthcharge recovery screen. BUG=b:109749762 TEST=Booted grunt in the recovery screen and made sure it continued to work. Change-Id: Id079c099ee4cf6a07724241af4400063f4551668 Signed-off-by: Raul E Rangel Reviewed-on: https://review.coreboot.org/28245 Reviewed-by: Martin Roth Reviewed-by: Richard Spiegel Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- payloads/libpayload/arch/x86/apic.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'payloads/libpayload/arch/x86/apic.c') diff --git a/payloads/libpayload/arch/x86/apic.c b/payloads/libpayload/arch/x86/apic.c index 079f456eec..99eff27aad 100644 --- a/payloads/libpayload/arch/x86/apic.c +++ b/payloads/libpayload/arch/x86/apic.c @@ -210,6 +210,8 @@ static void apic_init_timer(void) /* Set APIC init counter to MAX and count for 1 ms */ apic_write32(APIC_TIMER_INIT_COUNT, UINT32_MAX); + /* This is safe because apic_initialized() returns false so + * arch_ndelay() falls back to a busy loop. */ mdelay(1); ticks_per_ms = -- cgit v1.2.3