Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43307 )
Change subject: soc/amd/common: Refactor and consolidate code for spi base ......................................................................
Patch Set 5:
(2 comments)
https://review.coreboot.org/c/coreboot/+/43307/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/43307/4//COMMIT_MSG@13 PS4, Line 13: reads
read from?
Done
https://review.coreboot.org/c/coreboot/+/43307/4/src/soc/amd/common/block/sp... File src/soc/amd/common/block/spi/fch_spi.c:
https://review.coreboot.org/c/coreboot/+/43307/4/src/soc/amd/common/block/sp... PS4, Line 20: if (ENV_X86 && !spi_base) : spi_set_base((void *)lpc_get_spibase());
Move this to fch_spi_early_init?
The global variables don't carry their values between stages. I was setting it in the init functions, but they don't get called in every stage.
I had an assert here to make sure the value was initialized, and we were hitting it in ramstage.