2016-10-28 18:13:52 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2017-01-22 00:42:26 +01:00
|
|
|
#include <arch/io.h>
|
2016-10-28 18:13:52 +02:00
|
|
|
#include <bootblock_common.h>
|
2017-01-22 00:42:26 +01:00
|
|
|
#include <ec/google/chromeec/ec.h>
|
2016-10-28 18:13:52 +02:00
|
|
|
#include <gpio.h>
|
|
|
|
#include <soc/gpio.h>
|
2017-01-22 00:42:26 +01:00
|
|
|
#include <soc/iomap.h>
|
|
|
|
#include <soc/pm.h>
|
2016-10-28 18:13:52 +02:00
|
|
|
#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)
|
|
|
|
{
|
2017-01-22 00:42:26 +01:00
|
|
|
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 */
|
2017-02-01 00:10:10 +01:00
|
|
|
if (!((pm1_sts & WAK_STS) && (acpi_sleep_from_pm1(pm1_cnt) == ACPI_S3)))
|
2017-01-22 00:42:26 +01:00
|
|
|
google_chromeec_kbbacklight(75);
|
|
|
|
|
2016-10-28 18:13:52 +02:00
|
|
|
early_config_gpio();
|
|
|
|
}
|