diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-19 09:40:51 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-09-23 21:39:22 +0000 |
commit | 1011ed76a629691491c3f18916277ae941a2c761 (patch) | |
tree | 10ccc62d4f704d4eca1814350cdea7a0621e0cc4 /src | |
parent | 7596c54dba82793fa53d05925ded98ffb4d3c7db (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/vendorcode/cavium/bdk/libbdk-hal/bdk-config.c | 18 |
1 files changed, 9 insertions, 9 deletions
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; |