From 56428572c3a9fefb6e6cb0d8f13de6e6a09fab38 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Sat, 21 Jan 2017 15:42:26 -0800 Subject: [PATCH] UPSTREAM: google/eve: Enable keyboard backlight in bootblock Enable the keyboard backlight as early in boot as possible to provide a indication that the BIOS is executing. Since this is bootblock it can't use the convenience function for checking for S3 resume so just read the PM1 value from the SOC and check it directly. Use a value of 75% for the current system as that is visible without being full brightness. BUG=chrome-os-partner:61464 TEST=boot on eve and check that keyboard backlight is enabled as soon as the SOC starts booting Change-Id: I80274af9b3e032cc97403a180477b2d4742ad753 Signed-off-by: Duncan Laurie Original-Commit-Id: 367c9b328fd084509f8ed41ecf3c64ebc2e02e17 Original-Change-Id: I9ac78e9c3913a2776943088f35142afe3ffef056 Original-Signed-off-by: Duncan Laurie Original-Reviewed-on: https://review.coreboot.org/18197 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Aaron Durbin Original-Reviewed-by: Paul Menzel Reviewed-on: https://chromium-review.googlesource.com/431207 Commit-Ready: Duncan Laurie Tested-by: Duncan Laurie Reviewed-by: Aaron Durbin --- src/mainboard/google/eve/bootblock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mainboard/google/eve/bootblock.c b/src/mainboard/google/eve/bootblock.c index 2c524f443a..baca9c895c 100644 --- a/src/mainboard/google/eve/bootblock.c +++ b/src/mainboard/google/eve/bootblock.c @@ -14,9 +14,13 @@ * GNU General Public License for more details. */ +#include #include +#include #include #include +#include +#include #include "gpio.h" static void early_config_gpio(void) @@ -26,5 +30,12 @@ static void early_config_gpio(void) void bootblock_mainboard_init(void) { + uint32_t pm1_cnt = inl(ACPI_BASE_ADDRESS + PM1_CNT); + uint32_t pm1_sts = inl(ACPI_BASE_ADDRESS + PM1_STS); + + /* Turn on keyboard backlight to indicate we are booting */ + if ((pm1_sts & WAK_STS) && (acpi_sleep_from_pm1(pm1_cnt) != ACPI_S3)) + google_chromeec_kbbacklight(75); + early_config_gpio(); }