From 1011ed76a629691491c3f18916277ae941a2c761 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Mon, 19 Aug 2019 09:40:51 +0300 Subject: vendorcode/cavium: Replace use of __PRE_RAM__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7c93031c8c0e3a86261988edc956e8cd5a8dd961 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34998 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c b/src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c index 8e348d0175..e078e7476f 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 @@ static struct bdk_devicetree_key_value *bdk_config_duplicate( return new; } -#endif + /** * Set the device tree used for configuration * @@ -49,11 +48,11 @@ static struct bdk_devicetree_key_value *bdk_config_duplicate( */ 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 @@ int bdk_config_set_fdt(const struct bdk_devicetree_key_value *fdt) */ 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 @@ static void set_value(const char *name, const char *val) iter++; iter->key = 0; iter->value = 0; -#endif } /** @@ -207,6 +204,9 @@ void bdk_config_set_int(int64_t value, bdk_config_t cfg_item, ...) /* 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; -- cgit v1.2.3