Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31349 )
Change subject: lib/bootblock: Sanitize CMOS after bootblock_*_early_init() ......................................................................
Patch Set 3:
Patch Set 3: Code-Review+2
With 4.8.1 and 4.9, we run into this issue on APL when _not_ using memory mapping to access the SPI flash _and_ using a CMOS table (with RTC set to the `cmos.default` on every boot).
This patch fixes the issue for us (in the bootblock, at least).
I might be wrong, but in our case `sanitize_cmos()` needs the Fast SPI PCI device to be initialized for accessing `cmos.default` in CBFS. The device isn't initialized until `bootblock_soc_early_init()` is run. Thus, there is an implicit dependency between the two calls.
So, bring it on after maybe adding a code comment / commit message on why this order matters.
I think the explanation makes sense. It could probably be hitting this assert https://review.coreboot.org/cgit/coreboot.git/tree/src/soc/intel/common/bloc... when accessing "cmos.default". Or maybe end up accessing the wrong registers from MMIO space for the fast SPI. And, if this is true, it should actually be seen on more than just APL because other Intel SoCs using the common fast_spi block seem to have very similar dependency.