diff options
author | Soby Mathew <soby.mathew@arm.com> | 2018-01-15 14:45:33 +0000 |
---|---|---|
committer | Soby Mathew <soby.mathew@arm.com> | 2018-02-26 16:31:11 +0000 |
commit | cab0b5b0452556c9f7ba3fa98c233d3a6a62b023 (patch) | |
tree | 7f373d294d652a62b4ec7fa508f50c24af37d831 /include | |
parent | c228956afa415685d7555578f252dfe4d0d1695e (diff) |
ARM Platforms: Load HW_CONFIG in BL2
The patch adds the necessary changes to load HW_CONFIG in BL2 for
ARM Platforms :
1. The load address of HW_CONFIG is specified via the `hw_config_addr`
property in TB_FW_CONFIG is loaded by BL1. The `hw_config_max_size`
property defines the maximum size to be expected for the HW_CONFIG.
The `arm_dyn_cfg_helpers.c` and corresponding header implements
utility functions to parse these DT properties defined.
The `arm_dyn_cfg.c` implements wrappers to these helpers to enable
them to be invoked from ARM platform layer.
2. `HW_CONFIG` is added to the `bl2_mem_params_descs[]` array which is
the list of images to be loaded by BL2.
3. The `libfdt` sources are now included when BL2 is built
4. A new helper `populate_next_bl_params_config()` is introduced in
desc_image_load.c to populate the subsequent executable BL images
with the `hw_config` and the corresponding `fw_config` if available.
The `plat_get_next_bl_params()` API for ARM platforms is modified to
invoke this new helper.
5. The implementation of `bl2_early_platform_setup2()` is modified to
consider `arg0` as well in addition to `arg1` passed from BL1.
6. Bump up the BL2 size for Juno to accommodate the inclusion of libfdt.
Change-Id: I80f1554adec41753e0d179a5237364f04fe13a3f
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/common/desc_image_load.h | 2 | ||||
-rw-r--r-- | include/plat/arm/board/common/board_arm_def.h | 2 | ||||
-rw-r--r-- | include/plat/arm/common/arm_dyn_cfg_helpers.h | 16 | ||||
-rw-r--r-- | include/plat/arm/common/plat_arm.h | 5 |
4 files changed, 22 insertions, 3 deletions
diff --git a/include/common/desc_image_load.h b/include/common/desc_image_load.h index 79f2bd7b..f183db50 100644 --- a/include/common/desc_image_load.h +++ b/include/common/desc_image_load.h @@ -33,7 +33,7 @@ int get_bl_params_node_index(unsigned int image_id); bl_mem_params_node_t *get_bl_mem_params_node(unsigned int image_id); bl_load_info_t *get_bl_load_info_from_mem_params_desc(void); bl_params_t *get_next_bl_params_from_mem_params_desc(void); - +void populate_next_bl_params_config(bl_params_t *bl2_to_next_bl_params); #endif /* LOAD_IMAGE_V2 */ #endif /* __DESC_IMAGE_LOAD_H__ */ diff --git a/include/plat/arm/board/common/board_arm_def.h b/include/plat/arm/board/common/board_arm_def.h index 888629e3..12a21fb7 100644 --- a/include/plat/arm/board/common/board_arm_def.h +++ b/include/plat/arm/board/common/board_arm_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ diff --git a/include/plat/arm/common/arm_dyn_cfg_helpers.h b/include/plat/arm/common/arm_dyn_cfg_helpers.h new file mode 100644 index 00000000..4a0f6397 --- /dev/null +++ b/include/plat/arm/common/arm_dyn_cfg_helpers.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +#ifndef __ARM_DYN_CFG_HELPERS_H__ +#define __ARM_DYN_CFG_HELPERS_H__ + +#include <stdint.h> + +/* Function declaration */ +int arm_dyn_get_hwconfig_info(void *dtb, int node, + uint64_t *hw_config_addr, uint32_t *hw_config_size); +int arm_dyn_tb_fw_cfg_init(void *dtb, int *node); + +#endif /* __ARM_DYN_CFG_HELPERS_H__ */ diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h index 933caeed..b2c7bd27 100644 --- a/include/plat/arm/common/plat_arm.h +++ b/include/plat/arm/common/plat_arm.h @@ -19,6 +19,7 @@ struct bl31_params; struct meminfo; struct image_info; +struct bl_params; #define ARM_CASSERT_MMAP \ CASSERT((ARRAY_SIZE(plat_arm_mmap) + ARM_BL_REGIONS) \ @@ -138,7 +139,7 @@ void arm_bl1_platform_setup(void); void arm_bl1_plat_arch_setup(void); /* BL2 utility functions */ -void arm_bl2_early_platform_setup(struct meminfo *mem_layout); +void arm_bl2_early_platform_setup(uintptr_t tb_fw_config, struct meminfo *mem_layout); void arm_bl2_platform_setup(void); void arm_bl2_plat_arch_setup(void); uint32_t arm_get_spsr_for_bl32_entry(void); @@ -180,6 +181,8 @@ int arm_io_is_toc_valid(void); /* Utility functions for Dynamic Config */ void arm_load_tb_fw_config(void); +void arm_bl2_set_tb_cfg_addr(void *dtb); +void arm_bl2_dyn_cfg_init(void); /* * Mandatory functions required in ARM standard platforms |