
On Intel Apollolake the BIOS region on the flash is mapped right below 4GiB in the address space. However, 256KiB right below 4GiB is decoded by read-only SRAM. For this case we need a new API to handle this case - file_cbfs_init_ext().
This patch only does the groundwork to fix this issue. The caller of this API is responsible to calucalte/determine the correct cbfs addresses.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- fs/cbfs/cbfs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index c60a8d5dc1..97272ce5e8 100644 --- a/fs/cbfs/cbfs.c +++ b/fs/cbfs/cbfs.c @@ -193,6 +193,19 @@ void file_cbfs_init(uintptr_t end_of_rom) initialized = 1; }
+void file_cbfs_init_ext(uintptr_t header, uintptr_t cbfs_start, u32 cbfs_size) +{ + initialized = 0; + + if (file_cbfs_load_header(header, &cbfs_header)) + return; + + file_cbfs_fill_cache((u8 *)cbfs_start, cbfs_size, cbfs_header.align); + + if (file_cbfs_result == CBFS_SUCCESS) + initialized = 1; +} + const struct cbfs_header *file_cbfs_get_header(void) { if (initialized) {