Kyösti Mälkki has submitted this change. ( https://review.coreboot.org/c/coreboot/+/34998 )
Change subject: vendorcode/cavium: Replace use of __PRE_RAM__ ......................................................................
vendorcode/cavium: Replace use of __PRE_RAM__
Change-Id: I7c93031c8c0e3a86261988edc956e8cd5a8dd961 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34998 Reviewed-by: Aaron Durbin adurbin@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c 1 file changed, 9 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved
diff --git a/src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c b/src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c index 8e348d0..e078e74 100644 --- a/src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c +++ b/src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c @@ -18,7 +18,6 @@
static struct bdk_devicetree_key_value *config_fdt;
-#if !defined(__PRE_RAM__) static struct bdk_devicetree_key_value *bdk_config_duplicate( const struct bdk_devicetree_key_value *old, size_t free_space) @@ -38,7 +37,7 @@
return new; } -#endif + /** * Set the device tree used for configuration * @@ -49,11 +48,11 @@ */ int bdk_config_set_fdt(const struct bdk_devicetree_key_value *fdt) { -#if !defined(__PRE_RAM__) - config_fdt = bdk_config_duplicate(fdt, 0); -#else - config_fdt = (void *)fdt; -#endif + if (ENV_STAGE_HAS_HEAP_SECTION) + config_fdt = bdk_config_duplicate(fdt, 0); + else + config_fdt = (void *)fdt; + return 0; }
@@ -66,7 +65,6 @@ */ static void set_value(const char *name, const char *val) { -#if !defined(__PRE_RAM__) struct bdk_devicetree_key_value *iter; char n[64];
@@ -98,7 +96,6 @@ iter++; iter->key = 0; iter->value = 0; -#endif }
/** @@ -207,6 +204,9 @@ /* Make sure the correct access function was called */ assert(config_info[cfg_item].ctype == BDK_CONFIG_TYPE_INT);
+ if (!ENV_STAGE_HAS_HEAP_SECTION) + return; + if (!config_fdt) return;