diff options
author | Julius Werner <jwerner@chromium.org> | 2020-12-30 17:30:12 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2021-03-08 22:31:29 +0000 |
commit | 9b1f3cc6fb129789f1dd28160a83a1ea59dd123a (patch) | |
tree | 98347b2285d361fbcaa74892fa75a40a629d4b7f /src/soc | |
parent | 11075fc80e00186cb5b488e8e0fd280cd4e97823 (diff) |
cbfs: Pull handling of the CBFS_CACHE mem_pool into CBFS core
This patch pulls control of the memory pool serving allocations from the
CBFS_CACHE memlayout area into cbfs.c and makes it a core part of the
CBFS API. Previously, platforms would independently instantiate this as
part of boot_device_ro() (mostly through cbfs_spi.c). The new cbfs_cache
pool is exported as a global so these platforms can still use it to
directly back rdev_mmap() on their boot device, but the cbfs_cache can
now also use it to directly make allocations itself. This is used to
allow transparent decompression support in cbfs_map().
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I0d52b6a8f582a81a19fd0fd663bb89eab55a49d9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49333
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/samsung/exynos5250/spi.c | 6 | ||||
-rw-r--r-- | src/soc/samsung/exynos5420/spi.c | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/soc/samsung/exynos5250/spi.c b/src/soc/samsung/exynos5250/spi.c index e630090852..c7e07071c0 100644 --- a/src/soc/samsung/exynos5250/spi.c +++ b/src/soc/samsung/exynos5250/spi.c @@ -2,6 +2,8 @@ #include <device/mmio.h> #include <assert.h> +#include <boot_device.h> +#include <cbfs.h> #include <commonlib/region.h> #include <console/console.h> #include <soc/clk.h> @@ -160,13 +162,11 @@ static const struct region_device_ops exynos_spi_ops = { }; static struct mmap_helper_region_device mdev = - MMAP_HELPER_REGION_INIT(&exynos_spi_ops, 0, CONFIG_ROM_SIZE); + MMAP_HELPER_DEV_INIT(&exynos_spi_ops, 0, CONFIG_ROM_SIZE, &cbfs_cache); void exynos_init_spi_boot_device(void) { boot_slave_regs = (void *)EXYNOS5_SPI1_BASE; - - mmap_helper_device_init(&mdev, _cbfs_cache, REGION_SIZE(cbfs_cache)); } const struct region_device *exynos_spi_boot_device(void) diff --git a/src/soc/samsung/exynos5420/spi.c b/src/soc/samsung/exynos5420/spi.c index 0a2f0275ac..2fe9d5cf18 100644 --- a/src/soc/samsung/exynos5420/spi.c +++ b/src/soc/samsung/exynos5420/spi.c @@ -2,6 +2,7 @@ #include <device/mmio.h> #include <assert.h> +#include <cbfs.h> #include <console/console.h> #include <soc/cpu.h> #include <soc/spi.h> @@ -268,13 +269,11 @@ static const struct region_device_ops exynos_spi_ops = { }; static struct mmap_helper_region_device mdev = - MMAP_HELPER_REGION_INIT(&exynos_spi_ops, 0, CONFIG_ROM_SIZE); + MMAP_HELPER_DEV_INIT(&exynos_spi_ops, 0, CONFIG_ROM_SIZE, &cbfs_cache); void exynos_init_spi_boot_device(void) { boot_slave = &exynos_spi_slaves[1]; - - mmap_helper_device_init(&mdev, _cbfs_cache, REGION_SIZE(cbfs_cache)); } const struct region_device *exynos_spi_boot_device(void) |