From 6dd7b402d512d5bfc5f3bc20b0fc8c80aca817db Mon Sep 17 00:00:00 2001 From: Venkateswarlu Vinjamuri Date: Fri, 24 Feb 2017 15:37:30 -0800 Subject: soc/intel/apollolake: Add PM methods to power gate SD card This implements dynamic generation of sdcard GpioInt in SSDT. GpioInt in SSDT generation is based on the card detect GPIO if it is provided by the mainboard in devicetree. This implements GNVS variable to store the address of sdcard cd pin. GNVS used to store rxstate of the sdcard cd pin to get card presence. Add _PS0/_PS3 methods to power gate the sd card controller in S0ix and runtime PM. CQ-DEPEND=448173 BUG=chrome-os-partner:63070 TEST=Suspend and resume using 'echo freeze > /sys/power/state'. System should enter S0ix and resume with no issue. Change-Id: Id2c42fc66062f0431385607cff1a83563eaeef87 Signed-off-by: Venkateswarlu Vinjamuri Reviewed-on: https://review.coreboot.org/18496 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie Reviewed-by: Vaibhav Shankar --- src/soc/intel/apollolake/acpi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/soc/intel/apollolake/acpi.c') diff --git a/src/soc/intel/apollolake/acpi.c b/src/soc/intel/apollolake/acpi.c index 3c1faa5cd2..bcf1420b3f 100644 --- a/src/soc/intel/apollolake/acpi.c +++ b/src/soc/intel/apollolake/acpi.c @@ -183,6 +183,10 @@ static void acpi_create_gnvs(struct global_nvs_t *gnvs) /* Assign address of PERST_0 if GPIO is defined in devicetree */ if (cfg->prt0_gpio != GPIO_PRT0_UDEF) gnvs->prt0 = (uintptr_t)gpio_dwx_address(cfg->prt0_gpio); + + /* Assign sdcard cd address if GPIO is defined in devicetree */ + if (cfg->sdcard_cd_gpio) + gnvs->scd0 = (uintptr_t)gpio_dwx_address(cfg->sdcard_cd_gpio); } /* Save wake source information for calculating ACPI _SWS values */ -- cgit v1.2.3