Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34939 )
Change subject: Add ENV_BEFORE_RAMSTAGE ......................................................................
Add ENV_BEFORE_RAMSTAGE
Change-Id: Ibd2292f922ccb9e79d10ca9bc35797048d174287 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/riscv/include/arch/memlayout.h M src/include/rules.h M src/soc/samsung/exynos5250/alternate_cbfs.c M src/soc/samsung/exynos5420/alternate_cbfs.c 4 files changed, 11 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/34939/1
diff --git a/src/arch/riscv/include/arch/memlayout.h b/src/arch/riscv/include/arch/memlayout.h index 7baab76..ebedb2d 100644 --- a/src/arch/riscv/include/arch/memlayout.h +++ b/src/arch/riscv/include/arch/memlayout.h @@ -20,7 +20,7 @@
#define STACK(addr, size) REGION(stack, addr, size, 4096)
-#if defined(__PRE_RAM__) +#if ENV_BEFORE_RAMSTAGE #define CAR_STACK(addr, size) \ REGION(car_stack, addr, size, 4K) \ ALIAS_REGION(car_stack, stack) diff --git a/src/include/rules.h b/src/include/rules.h index 10cd715..530404d 100644 --- a/src/include/rules.h +++ b/src/include/rules.h @@ -266,6 +266,8 @@ #define ENV_PAYLOAD_LOADER ENV_RAMSTAGE #endif
+#define ENV_BEFORE_RAMSTAGE (ENV_BOOTBLOCK || ENV_VERSTAGE || ENV_ROMSTAGE || ENV_POSTCAR) + /** * For pre-DRAM stages and post-CAR always build with simple device model, ie. * PCI, PNP and CPU functions operate without use of devicetree. The reason diff --git a/src/soc/samsung/exynos5250/alternate_cbfs.c b/src/soc/samsung/exynos5250/alternate_cbfs.c index e431672..a012837 100644 --- a/src/soc/samsung/exynos5250/alternate_cbfs.c +++ b/src/soc/samsung/exynos5250/alternate_cbfs.c @@ -35,12 +35,12 @@ * should contain all available stages/payloads/etc. It is loaded when this * function is called a second time at the end of the romstage, and copied to * the romstage/ramstage CBFS cache in DRAM. It will reside there for the - * rest of the firmware's lifetime and all subsequent stages (which will not - * have __PRE_RAM__ defined) can just directly reference it there. + * rest of the firmware's lifetime and all subsequent stages can just directly + * reference it there. */ static int usb_cbfs_open(void) { -#ifdef __PRE_RAM__ +#if ENV_BEFORE_RAMSTAGE static int first_run = 1; int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -75,7 +75,7 @@ */ static int sdmmc_cbfs_open(void) { -#ifdef __PRE_RAM__ +#if ENV_BEFORE_RAMSTAGE /* * In the bootblock, we just copy the small part that fits in the buffer * and hope that it's enough (since the romstage is currently always the diff --git a/src/soc/samsung/exynos5420/alternate_cbfs.c b/src/soc/samsung/exynos5420/alternate_cbfs.c index ba3f9a3..b8f3e04 100644 --- a/src/soc/samsung/exynos5420/alternate_cbfs.c +++ b/src/soc/samsung/exynos5420/alternate_cbfs.c @@ -36,12 +36,12 @@ * should contain all available stages/payloads/etc. It is loaded when this * function is called a second time at the end of the romstage, and copied to * the romstage/ramstage CBFS cache in DRAM. It will reside there for the - * rest of the firmware's lifetime and all subsequent stages (which will not - * have __PRE_RAM__ defined) can just directly reference it there. + * rest of the firmware's lifetime and all subsequent stages can just directly + * reference it there. */ static int usb_cbfs_open(void) { -#ifdef __PRE_RAM__ +#if ENV_BEFORE_RAMSTAGE static int first_run = 1; int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -79,7 +79,7 @@ */ static int sdmmc_cbfs_open(void) { -#ifdef __PRE_RAM__ +#if ENV_BEFORE_RAMSTAGE /* * In the bootblock, we just copy the small part that fits in the buffer * and hope that it's enough (since the romstage is currently always the