From 99ce8a9bba091f9f57e46c48fa1493525c77b373 Mon Sep 17 00:00:00 2001 From: Venkateswarlu Vinjamuri Date: Wed, 22 Mar 2017 18:24:52 -0700 Subject: soc/intel/apollolake: Set sdcard card detect (CD) host ownership Currently sdcard CD host ownership is always owned by the GPIO driver. Due to this sdcard detection fails during initial boot process and OS fails to boot from sdcard. This implements change in host ownership from acpi to GPIO driver when kernel starts booting. BUG=b:35648535 TEST=Check OS boot from sdcard. Change-Id: I042a8762dc1f9cb73e6a24c1e7169c9746b2ee14 Signed-off-by: Venkateswarlu Vinjamuri Reviewed-on: https://review.coreboot.org/18947 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Vaibhav Shankar --- src/soc/intel/apollolake/acpi/scs.asl | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/soc/intel/apollolake/acpi/scs.asl') diff --git a/src/soc/intel/apollolake/acpi/scs.asl b/src/soc/intel/apollolake/acpi/scs.asl index bb8b684ef3..5933d522c5 100644 --- a/src/soc/intel/apollolake/acpi/scs.asl +++ b/src/soc/intel/apollolake/acpi/scs.asl @@ -115,14 +115,32 @@ Scope (\_SB.PCI0) { Device (SDCD) { Name (_ADR, 0x001B0000) + Name (_S0W, 4) /* _S0W: S0 Device Wake State */ + Name (SCD0, 0) /* Store SD_CD DW0 address */ + + /* Set the host ownership of sdcard cd during kernel boot */ + Method (_INI, 0) + { + /* Check SDCard CD port is valid */ + If (LAnd (LNotEqual (\SCDP, 0), LNotEqual (\SCDO, 0) )) + { + /* Store DW0 address of SD_CD */ + Store (GDW0 (\SCDP, \SCDO), SCD0) + /* Get the current SD_CD ownership */ + Store (\_SB.GHO (\SCDP, \SCDO), Local0) + /* Set host ownership as GPIO in HOSTSW_OWN reg */ + Or (Local0, ShiftLeft (1, Mod (\SCDO, 32)), Local0) + \_SB.SHO (\SCDP, \SCDO, Local0) + } + } Method (_PS0, 0, NotSerialized) { - /* Check SDCard CD pin address is valid */ - If (LNotEqual (SCD0, 0)) + /* Check SDCard CD port is valid */ + If (LAnd (LNotEqual (\SCDP, 0), LNotEqual (\SCDO, 0) )) { /* Store DW0 into local0 to get rxstate of GPIO */ - Store (\_SB.GPC0 (\SCD0), Local0) + Store (\_SB.GPC0 (SCD0), Local0) /* Extract rxstate [bit 1] of sdcard card detect pin */ And (Local0, PAD_CFG0_RX_STATE, Local0) /* If the sdcard is present, rxstate is low. -- cgit v1.2.3