Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/78288?usp=email )
Change subject: drivers/pc80/rtc/option.c: Stop resetting CMOS during s3 resume ......................................................................
Patch Set 8:
(1 comment)
Patchset:
PS4:
Ah makes sense, so the training cache is only for S3 resume on these platforms. […]
It's still not really nice what we do with this odd static-option-table implementation. There are other things that can corrupt CMOS than a power outage, so if STATIC_OPTION_TABLE needs a quirk, it shouldn't unconditionally disable the code on S3 resume. IOW, I think the condition should be
cmos_need_reset = (CONFIG(STATIC_OPTION_TABLE) && !acpi_is_wakeup_s3()) || ...
Another thought: Does anybody know what STATIC_OPTION_TABLE is actually supposed to do? Is there a need to involve CMOS at all or was that maybe just a hack because it was doable by altering a single line? If it doesn't need CMOS, we could add another option backend, backed by the CBFS file. That would be more code but much cleaner than adding complexity to the CMOS logic.