Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42570 )
Change subject: WIP: src/amd/picasso/acpi: Add power resource for eMMC ......................................................................
WIP: src/amd/picasso/acpi: Add power resource for eMMC
This currently gets stuck on storing the registers when entering S3. Is there something I did wrong?
BUG=b:153001807
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I7f695d65d08fe5ae25747ce1c3ce2f881f0c7e7f --- M src/soc/amd/picasso/acpi/aoac.asl M src/soc/amd/picasso/acpi/sb_fch.asl 2 files changed, 79 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/42570/1
diff --git a/src/soc/amd/picasso/acpi/aoac.asl b/src/soc/amd/picasso/acpi/aoac.asl index 191619e..4170cdb 100644 --- a/src/soc/amd/picasso/acpi/aoac.asl +++ b/src/soc/amd/picasso/acpi/aoac.asl @@ -137,6 +137,69 @@ Return (0x08) }
+ OperationRegion (SHDW, SystemMemory, ACPIMMIO_AOAC_BASE + 0x80, 8) + Field (SHDW, AnyAcc, NoLock, Preserve) { + DEV, 30, // Device + REQT, 1, // Request Type: 0 = Store, 1 = Restore + ERR, 1, + + STAT, 30, // Request Status + , 2, // Reserved + } + + /* + * Save the hardware state. + * + * Arg0: Device ID + */ + Method (STOR, 1, Serialized) + { + Printf("Saving state for device %o", Arg0) + Local0 = 1 << Arg0 + Printf("Local0: %o", Local0) + Printf("prev REQT: %o", REQT) + Printf("prev DEV: %o", DEV) + Printf("prev STAT: %o", STAT) + + REQT = 0 + DEV = Local0 + + While (STAT & Local0) { + Printf ("Waiting for device to store state: DEV: %o, STAT: %o", DEV, STAT) + Stall (200) + } + Printf("State saved for device %o", Arg0) + } + + /* + * Restore the hardware state. + * + * Arg0: Device ID + */ + Method (REST, 1, Serialized) + { + Printf("Restoring state for device %o", Arg0) + Local0 = 1 << Arg0 + Printf("Local0: %o", Local0) + Printf("prev REQT: %o", REQT) + Printf("prev DEV: %o", DEV) + Printf("prev STAT: %o", STAT) + + If (STAT & Local0) { + Printf("No previous state") + Return () + } + + REQT = 1 + DEV = Local0 + + While (!(STAT & Local0)) { + Printf ("Waiting for device to restore state: DEV: %o, STAT: %o", DEV, STAT) + Stall (200) + } + Printf("State restored for device %o", Arg0) + } + AOAC_DEVICE(I2C2, 7, 0) AOAC_DEVICE(I2C3, 8, 0) AOAC_DEVICE(I2C4, 9, 5) /* I2C4 is powered from the S5 power group. */ @@ -144,4 +207,5 @@ AOAC_DEVICE(FUR1, 12, 0) AOAC_DEVICE(FUR2, 16, 0) AOAC_DEVICE(FUR3, 26, 0) + AOAC_DEVICE(MMC0, 28, 0) } diff --git a/src/soc/amd/picasso/acpi/sb_fch.asl b/src/soc/amd/picasso/acpi/sb_fch.asl index cb186c4..545af54 100644 --- a/src/soc/amd/picasso/acpi/sb_fch.asl +++ b/src/soc/amd/picasso/acpi/sb_fch.asl @@ -90,6 +90,21 @@ { Return (0x0F) } + + Name (_PR0, Package () { _SB.AOAC.MMC0 }) + Name (_PR2, Package () { _SB.AOAC.MMC0 }) + Name (_PR3, Package () { _SB.AOAC.MMC0 }) + Method (_PS0) { + Printf("MMC0._PS0") + _SB.AOAC.MMC0.TDS = 0 + _SB.AOAC.REST(28) + _SB.AOAC.MMC0.TDS = 1 + } + Method (_PS3) { + Printf("MMC0._PS3") + _SB.AOAC.STOR(28) + _SB.AOAC.FUR1.TDS = 3 + } }
Device (FUR0)
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/42570?usp=email )
Change subject: WIP: src/amd/picasso/acpi: Add power resource for eMMC ......................................................................
Abandoned