diff options
author | Louis Mayencourt <louis.mayencourt@arm.com> | 2019-10-17 15:14:25 +0100 |
---|---|---|
committer | Louis Mayencourt <louis.mayencourt@arm.com> | 2020-02-07 13:51:31 +0000 |
commit | 9814bfc1bfc4868a8505d3756aceea5ad41a8c64 (patch) | |
tree | 57ea00023b87eefc1b8f7a24cdfb9d0c95f12a90 /lib/fconf | |
parent | 3b5ea741fd92088c9e005d3508b73e50f1d5daf7 (diff) | |
download | arm-trusted-firmware-9814bfc1bfc4868a8505d3756aceea5ad41a8c64.tar.gz |
fconf: Populate properties from dtb during bl2 setup
Use the dtb provided by bl1 as configuration file for fconf.
Change-Id: I3f466ad9b7047e1a361d94e71ac6d693e31496d9
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
Diffstat (limited to 'lib/fconf')
-rw-r--r-- | lib/fconf/fconf.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/fconf/fconf.c b/lib/fconf/fconf.c index 7e0b00b08..2ca1bdc77 100644 --- a/lib/fconf/fconf.c +++ b/lib/fconf/fconf.c @@ -7,18 +7,17 @@ #include <assert.h> #include <common/debug.h> +#include <common/fdt_wrappers.h> #include <lib/fconf/fconf.h> #include <libfdt.h> #include <plat/common/platform.h> #include <platform_def.h> -static uintptr_t tb_fw_cfg_dtb; -static size_t tb_fw_cfg_dtb_size; +struct fconf_dtb_info_t fconf_dtb_info; void fconf_load_config(void) { int err; - image_desc_t *desc; image_info_t arm_tb_fw_info = { .h.type = (uint8_t)PARAM_IMAGE_BINARY, @@ -27,7 +26,7 @@ void fconf_load_config(void) .h.attr = 0, .image_base = ARM_TB_FW_CONFIG_BASE, .image_max_size = (uint32_t) - (ARM_TB_FW_CONFIG_LIMIT - ARM_TB_FW_CONFIG_BASE) + (ARM_TB_FW_CONFIG_LIMIT - ARM_TB_FW_CONFIG_BASE) }; VERBOSE("FCONF: Loading FW_CONFIG\n"); @@ -39,15 +38,19 @@ void fconf_load_config(void) } /* At this point we know that a DTB is indeed available */ - tb_fw_cfg_dtb = arm_tb_fw_info.image_base; - tb_fw_cfg_dtb_size = (size_t)arm_tb_fw_info.image_size; + fconf_dtb_info.base_addr = arm_tb_fw_info.image_base; + fconf_dtb_info.size = (size_t)arm_tb_fw_info.image_size; + +#if !BL2_AT_EL3 + image_desc_t *desc; /* The BL2 ep_info arg0 is modified to point to FW_CONFIG */ desc = bl1_plat_get_image_desc(BL2_IMAGE_ID); assert(desc != NULL); - desc->ep_info.args.arg0 = tb_fw_cfg_dtb; + desc->ep_info.args.arg0 = arm_tb_fw_info.image_base; +#endif - INFO("FCONF: FW_CONFIG loaded at address = 0x%lx\n", tb_fw_cfg_dtb); + INFO("FCONF: FW_CONFIG loaded at address = 0x%lx\n", arm_tb_fw_info.image_base); } void fconf_populate(uintptr_t config) @@ -76,4 +79,7 @@ void fconf_populate(uintptr_t config) panic(); } } + + /* save local pointer to the config dtb */ + fconf_dtb_info.base_addr = config; } |