Attention is currently required from: Furquan Shaikh, Julius Werner, Karthik Ramasubramanian. Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56577 )
Change subject: lib/cbfs: Add HAVE_CBFS_CACHE Kconfig ......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
So the problem is that the availability of the cache may be stage-dependent, and you can't easily mo […]
I think this makes sense.
I'm running into an issue where REGION_SIZE doesn't work correctly for optional regions in ramstage.
romstage works as expected. ``` coreboot-4.14-2248-ga3f9b16e0549-dirty Thu Oct 14 16:53:49 UTC 2021 romstage starting (log level: 8)... GPIO Control Switch: 0xcf000000, Wake Stat 0: 0x00000000, Wake Stat 1: 0x00000000 Boot Count incremented to 639 FMAP: area FW_MAIN_A found @ 12000 (3137280 bytes) CBFS: Found 'fspm.bin' @0x1906c0 size 0x16328 in mcache @0x02016a38 RX: _cbfs_alloc: cbfs_cache->size: 0 ```
Once we hit ramstage though, we get garbage. I'm not sure if this is caused by the rmodule loader.
``` coreboot-4.14-2248-ga3f9b16e0549-dirty Thu Oct 14 16:53:49 UTC 2021 ramstage starting (log level: 8)... RX: main: cbfs_cache->size: 3111460864 ```
Loading the ramstage ELF in gdb shows the correct values:
``` (gdb) print cbfs_cache $1 = {buf = 0x0, size = 0, last_alloc = 0x0, second_to_last_alloc = 0x0, free_offset = 0} ```
So I'm not quite sure why we are getting garbage.