Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47991 )
Change subject: soc/intel/common/fast_spi: Add support for configuring MTRRs ......................................................................
Patch Set 1: -Code-Review
(1 comment)
https://review.coreboot.org/c/coreboot/+/47991/1/src/soc/intel/common/block/... File src/soc/intel/common/block/fast_spi/fast_spi.c:
https://review.coreboot.org/c/coreboot/+/47991/1/src/soc/intel/common/block/... PS1, Line 238: if (ENV_PAYLOAD_LOADER) { : mtrr_use_temp_range(ext_bios_base, ext_bios_size, type); : } else { : int mtrr = get_free_var_mtrr(); : : if (mtrr == -1) : return; : : set_var_mtrr(mtrr, ext_bios_base, ext_bios_size, type); : }
Ack
Actually, let's not add a helper function right now. For extended BIOS window, we don't need the check:
if (ENV_PAYLOAD_LOADER) { ... }
Instead we need to add a separate helper `fast_spi_cache_ext_bios_postcar()` which adds the MTRR to postcar frame. I can push that as a follow-up.
For this change, I would say let's drop the if-part of this function. I think we can do the same for `fast_spi_cache_bios_region()` too, but it is currently being used by APL. I will have to read the code to ensure that it is just a leftover and then drop it. I can clean that up as a follow-up.