2016-07-12 06:04:25 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008-2009 coresystems GmbH
|
|
|
|
* Copyright (C) 2016 Intel Corp.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2016-07-13 20:01:13 +02:00
|
|
|
#include <arch/acpi.h>
|
2016-09-02 23:56:03 +02:00
|
|
|
#include <baseboard/variants.h>
|
2016-07-12 06:04:25 +02:00
|
|
|
#include <cpu/x86/smm.h>
|
2016-07-14 07:43:11 +02:00
|
|
|
#include <ec/google/chromeec/smm.h>
|
2017-08-09 00:30:41 +02:00
|
|
|
#include <intelblocks/smihandler.h>
|
2016-07-12 06:04:25 +02:00
|
|
|
#include <soc/pm.h>
|
2016-08-18 01:18:05 +02:00
|
|
|
#include <soc/gpio.h>
|
2016-09-02 22:58:16 +02:00
|
|
|
#include <variant/ec.h>
|
|
|
|
#include <variant/gpio.h>
|
2016-07-12 06:04:25 +02:00
|
|
|
|
2016-07-25 07:54:13 +02:00
|
|
|
void mainboard_smi_gpi_handler(const struct gpi_status *sts)
|
|
|
|
{
|
|
|
|
if (gpi_status_get(sts, EC_SMI_GPI))
|
|
|
|
chromeec_smi_process_events();
|
|
|
|
}
|
|
|
|
|
2016-07-12 06:04:25 +02:00
|
|
|
void mainboard_smi_sleep(u8 slp_typ)
|
|
|
|
{
|
2016-09-02 23:56:03 +02:00
|
|
|
const struct pad_config *pads;
|
|
|
|
size_t num;
|
|
|
|
|
mainboard/google/coral: power off EN_PP3300_DX_LTE_SOC when entering S5
On Astronaunt, after the system enters the S5 power state, there is a
10-second timeout before the system transitions the power state from S5
to G3. The EN_PP3300_DX_LTE_SOC signal, which is controlled by GPIO_78
on the APL platform, remains on during that period. If the system is
powered back on before going to G3, the built-in modem won't go through
a power cycle as EN_PP3300_DX_LTE_SOC is never de-asserted.
Keeping the modem, and indirectly the SIM, powered during a quick system
power cycle may sometimes be undesirable. For instance, we would like a
SIM with PIN lock enabled to require unlocking each time the system is
powered on. After the SIM receives a PIN, it may remain unlocked until
its next power cycle.
Also, it is often desirable to power cycle the modem when the system
goes through a power cycle. For instance, a user may power cycle the
system to recover a wedged modem.
BUG=b:68365029
TEST=Tested the following on an Astronaunt device:
1. Verify that the modem is powered on after the system boots from cold.
2. Suspend the system to S0ix. Verify that the modem remains powered on
when the system is in S0ix. After the system goes back to S0, verify
that the SIM with PIN lock enabled doesn't request unlocking, and the
modem can quickly reconnect to a network.
3. Configure the system to suspend to S3 instead of S0ix, and then
repeat (2).
4. Perform a quick system power cycle, verify that the modem is powered
cycle and the SIM with PIN lock enabled requests unlocking.
Change-Id: Ie60776d5d9ebc6a69aa9e360bd882f455265dfa2
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://review.coreboot.org/22415
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-11-10 01:53:26 +01:00
|
|
|
pads = variant_sleep_gpio_table(slp_typ, &num);
|
2016-09-02 23:56:03 +02:00
|
|
|
gpio_configure_pads(pads, num);
|
2016-08-18 01:18:05 +02:00
|
|
|
|
2016-07-14 07:43:11 +02:00
|
|
|
if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC))
|
|
|
|
chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS,
|
|
|
|
MAINBOARD_EC_S5_WAKE_EVENTS);
|
2016-07-12 06:04:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int mainboard_smi_apmc(u8 apmc)
|
|
|
|
{
|
2016-07-14 07:43:11 +02:00
|
|
|
if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC))
|
|
|
|
chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS,
|
|
|
|
MAINBOARD_EC_SMI_EVENTS);
|
2016-07-12 06:04:25 +02:00
|
|
|
return 0;
|
|
|
|
}
|