soc/amd/stoneyridge: Set missing RTC offsets for day alarm and century

On Linux, in order to set wake alarms >24 hours, the RTC Date Alarm
field must be set to a valid non-zero value. If not, there are two
consequences:
1. Alarms >24 hours don't work
2. The kernel will refuse to enter suspend because it can't resume as
   expected to service the alarm.

Since the RTC Date Alarm and RTC AltCentury fields are supported on
Stoneyridge, set them.

This is a mirror of commit 041fcf5902
("soc/amd/picasso/acpi: Set missing RTC offsets") for picasso.

BUG=b:187516317
TEST=On a Chrome OS 'grunt' device, run
     `time powerd_dbus_suspend --suspend_for_sec=172800`
     and verify the system suspended and woke up after 48 hours
BRANCH=grunt

Signed-off-by: Anand K Mistry <amistry@google.com>
Change-Id: I10831b982662e680fa71aa81d02935e1b7e7a7a1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55001
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Anand K Mistry 2021-05-27 14:32:29 +10:00 committed by Patrick Georgi
parent c7d12f1165
commit dd8e819e6b

View File

@ -82,9 +82,9 @@ void acpi_fill_fadt(acpi_fadt_t *fadt)
fadt->p_lvl3_lat = ACPI_FADT_C3_NOT_SUPPORTED; fadt->p_lvl3_lat = ACPI_FADT_C3_NOT_SUPPORTED;
fadt->duty_offset = 1; /* CLK_VAL bits 3:1 */ fadt->duty_offset = 1; /* CLK_VAL bits 3:1 */
fadt->duty_width = 3; /* CLK_VAL bits 3:1 */ fadt->duty_width = 3; /* CLK_VAL bits 3:1 */
fadt->day_alrm = 0; /* 0x7d these have to be */ fadt->day_alrm = 0x0d;
fadt->mon_alrm = 0; /* 0x7e added to cmos.layout */ fadt->mon_alrm = 0; /* Not supported */
fadt->century = 0; /* 0x7f to make rtc alarm work */ fadt->century = 0x32;
fadt->iapc_boot_arch = FADT_BOOT_ARCH; /* See table 5-10 */ fadt->iapc_boot_arch = FADT_BOOT_ARCH; /* See table 5-10 */
fadt->res2 = 0; /* reserved, MUST be 0 ACPI 3.0 */ fadt->res2 = 0; /* reserved, MUST be 0 ACPI 3.0 */
fadt->flags |= ACPI_FADT_WBINVD | /* See table 5-10 ACPI 3.0a spec */ fadt->flags |= ACPI_FADT_WBINVD | /* See table 5-10 ACPI 3.0a spec */