summaryrefslogtreecommitdiffstats
path: root/src/include/spi_flash.h
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-11-25 17:15:09 -0800
committerFurquan Shaikh <furquan@google.com>2020-12-08 22:56:09 +0000
commit493937e1d67e734c2ac45f92280f2c2c22a50b85 (patch)
tree16b77de5c971be7774935c8c98846bcead32c663 /src/include/spi_flash.h
parentb53280ab53e19746be04b67f73f9ce230038b1ee (diff)
downloadcoreboot-493937e1d67e734c2ac45f92280f2c2c22a50b85.tar.gz
coreboot-493937e1d67e734c2ac45f92280f2c2c22a50b85.tar.bz2
coreboot-493937e1d67e734c2ac45f92280f2c2c22a50b85.zip
coreboot tables: Add SPI flash memory map windows to coreboot tables
This change adds details about the memory map windows to translate addresses between SPI flash space and host address space to coreboot tables. This is useful for payloads to setup the translation using the decode windows already known to coreboot. Until now, there was a single decode window at the top of 4G used by all x86 platforms. However, going forward, platforms might support more decode windows and hence in order to avoid duplication in payloads this information is filled in coreboot tables. `lb_spi_flash()` is updated to fill in the details about these windows by making a call to `spi_flash_get_mmap_windows()` which is implemented by the driver providing the boot media mapping device. BUG=b:171534504 Signed-off-by: Furquan Shaikh <furquan@google.com> Change-Id: I00ae33d9b53fecd0a8eadd22531fdff8bde9ee94 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48185 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/spi_flash.h')
-rw-r--r--src/include/spi_flash.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h
index 1061e9905e2b..a7f707eb1c4c 100644
--- a/src/include/spi_flash.h
+++ b/src/include/spi_flash.h
@@ -225,4 +225,12 @@ int spi_flash_vector_helper(const struct spi_slave *slave,
int (*func)(const struct spi_slave *slave, const void *dout,
size_t bytesout, void *din, size_t bytesin));
+/*
+ * Fill in the memory mapped windows used by the SPI flash device. This is useful for payloads
+ * to identify SPI flash to host space mapping.
+ *
+ * Returns number of windows added to the table.
+ */
+uint32_t spi_flash_get_mmap_windows(struct flash_mmap_window *table);
+
#endif /* _SPI_FLASH_H_ */