summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc/coreboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/libc/coreboot.c')
-rw-r--r--payloads/libpayload/libc/coreboot.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c
index b7d2a537b5..7e23afe2e5 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -211,6 +211,13 @@ static void cb_parse_spi_flash(void *ptr, struct sysinfo_t *info)
info->spi_flash.size = flash->flash_size;
info->spi_flash.sector_size = flash->sector_size;
info->spi_flash.erase_cmd = flash->erase_cmd;
+
+ if (flash->mmap_count == 0)
+ return;
+
+ info->spi_flash.mmap_window_count = MIN(flash->mmap_count, SYSINFO_MAX_MMAP_WINDOWS);
+ memcpy(info->spi_flash.mmap_table, flash->mmap_table,
+ info->spi_flash.mmap_window_count * sizeof(struct flash_mmap_window));
}
static void cb_parse_boot_media_params(unsigned char *ptr,