soc/intel/skylake: storage: Use word access for power state registers

In the D0 and D3 ACPI methods use word access to the PME status and
control register.  This brings the code inline with the Intel reference
code and matches how the kernel handles access to this register.

BUG=b:35587084
BRANCH=eve
TEST=manual stress testing of D0<>D3 transition across multiple devices

Change-Id: I53f7465d6ad5da1780a5641ff52056445ebaca8b
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/20364
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Duncan Laurie 2017-06-25 20:41:40 -07:00
parent d4b6ac19b0
commit 8bd88341e8
1 changed files with 17 additions and 19 deletions

View File

@ -21,12 +21,13 @@ Device (EMMC)
Name (_ADR, 0x001E0004) Name (_ADR, 0x001E0004)
Name (_DDN, "eMMC Controller") Name (_DDN, "eMMC Controller")
Name (UUID, ToUUID ("E5C937D0-3553-4D7A-9117-EA4D19C3434D")) Name (UUID, ToUUID ("E5C937D0-3553-4D7A-9117-EA4D19C3434D"))
Name (TEMP, 0)
OperationRegion (EMCR, PCI_Config, 0x00, 0x100) OperationRegion (EMCR, PCI_Config, 0x00, 0x100)
Field (EMCR, DWordAcc, NoLock, Preserve) Field (EMCR, WordAcc, NoLock, Preserve)
{ {
Offset (0x84), /* PMECTRLSTATUS */ Offset (0x84), /* PMECTRLSTATUS */
D0D3, 2, /* POWERSTATE */ PMCR, 16,
Offset (0xa2), /* PG_CONFIG */ Offset (0xa2), /* PG_CONFIG */
, 2, , 2,
PGEN, 1, /* PG_ENABLE */ PGEN, 1, /* PG_ENABLE */
@ -88,9 +89,8 @@ Device (EMMC)
Sleep (2) Sleep (2)
/* Set Power State to D0 */ /* Set Power State to D0 */
Store (Zero, Local0) And (PMCR, 0xFFFC, PMCR)
Store (Local0, ^D0D3) Store (PMCR, ^TEMP)
Store (^D0D3, Local0)
} }
Method (_PS3, 0, Serialized) Method (_PS3, 0, Serialized)
@ -98,10 +98,9 @@ Device (EMMC)
/* Enable Power Gate */ /* Enable Power Gate */
Store (1, ^PGEN) Store (1, ^PGEN)
/* Set Power State to D0 */ /* Set Power State to D3 */
Store (3, Local0) Or (PMCR, 0x0003, PMCR)
Store (Local0, ^D0D3) Store (PMCR, ^TEMP)
Store (^D0D3, Local0)
} }
} }
@ -110,12 +109,13 @@ Device (SDXC)
{ {
Name (_ADR, 0x001E0006) Name (_ADR, 0x001E0006)
Name (_DDN, "SD Controller") Name (_DDN, "SD Controller")
Name (TEMP, 0)
OperationRegion (SDCR, PCI_Config, 0x00, 0x100) OperationRegion (SDCR, PCI_Config, 0x00, 0x100)
Field (SDCR, DWordAcc, NoLock, Preserve) Field (SDCR, WordAcc, NoLock, Preserve)
{ {
Offset (0x84), /* PMECTRLSTATUS */ Offset (0x84), /* PMECTRLSTATUS */
D0D3, 2, /* POWERSTATE */ PMCR, 16,
Offset (0xa2), /* PG_CONFIG */ Offset (0xa2), /* PG_CONFIG */
, 2, , 2,
PGEN, 1, /* PG_ENABLE */ PGEN, 1, /* PG_ENABLE */
@ -138,14 +138,13 @@ Device (SDXC)
^^PCRA (PID_SCS, 0x600, 0xFFFFFE7A) ^^PCRA (PID_SCS, 0x600, 0xFFFFFE7A)
Sleep (2) Sleep (2)
/* Set bits 31, 6, 2, 0 */ /* Set bits 8, 7, 2, 0 */
^^PCRO (PID_SCS, 0x600, 0x00000185) ^^PCRO (PID_SCS, 0x600, 0x00000185)
Sleep (2) Sleep (2)
/* Set Power State to D0 */ /* Set Power State to D0 */
Store (Zero, Local0) And (PMCR, 0xFFFC, PMCR)
Store (Local0, ^D0D3) Store (PMCR, ^TEMP)
Store (^D0D3, Local0)
} }
Method (_PS3, 0, Serialized) Method (_PS3, 0, Serialized)
@ -153,10 +152,9 @@ Device (SDXC)
/* Enable Power Gate */ /* Enable Power Gate */
Store (1, ^PGEN) Store (1, ^PGEN)
/* Set Power State to D0 */ /* Set Power State to D3 */
Store (3, Local0) Or (PMCR, 0x0003, PMCR)
Store (Local0, ^D0D3) Store (PMCR, ^TEMP)
Store (^D0D3, Local0)
/* Enable 20K pull-down on CLK, CMD and DAT lines */ /* Enable 20K pull-down on CLK, CMD and DAT lines */
^^PCRO (PID_GPIOCOM3, 0x4c4, 0x00001000) ^^PCRO (PID_GPIOCOM3, 0x4c4, 0x00001000)