coreboot-kgpe-d16/src/mainboard/google/eve/bootblock.c
Duncan Laurie 649100ad20 google/eve: Fix keyboard backlight enable in wake from G3
The WAK_STS bit is not set in a wake from G3, so the check for this
bit needs to only be done when checking for a wake from S3.

This change correctly enables the keyboard backlight in wake from G3
and only does not enable it during a wake from S3.

BUG=chrome-os-partner:58666
TEST=Use Refresh+Power to issue hard reset and ensure that the keyboard
backlight turns on like it does when waking from S5.  Also force enter
hibernate with Alt+VolumeUp+H and then power back up and ensure that
the keyboard backlight is enabled when booting.

Change-Id: I44045950e38aa5e5ae96a79385d604791852c7e6
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/18280
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-02-05 22:01:50 +01:00

41 lines
1.2 KiB
C

/*
* This file is part of the coreboot project.
*
* Copyright (C) 2016 Google Inc.
* Copyright (C) 2016 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <arch/io.h>
#include <bootblock_common.h>
#include <ec/google/chromeec/ec.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <soc/iomap.h>
#include <soc/pm.h>
#include "gpio.h"
static void early_config_gpio(void)
{
gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table));
}
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();
}