• Soby Mathew's avatar
    ARM Platforms: Load HW_CONFIG in BL2 · cab0b5b0
    Soby Mathew authored
    
    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: default avatarSoby Mathew <soby.mathew@arm.com>
    cab0b5b0
arm_image_load.c 1.4 KB
/*
 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <arm_def.h>
#include <bl_common.h>
#include <desc_image_load.h>
#include <plat_arm.h>
#include <platform.h>


#pragma weak plat_flush_next_bl_params
#pragma weak plat_get_bl_image_load_info
#pragma weak plat_get_next_bl_params


/*******************************************************************************
 * This function flushes the data structures so that they are visible
 * in memory for the next BL image.
 ******************************************************************************/
void plat_flush_next_bl_params(void)
{
	flush_bl_params_desc();
}

/*******************************************************************************
 * This function returns the list of loadable images.
 ******************************************************************************/
bl_load_info_t *plat_get_bl_image_load_info(void)
{
	return get_bl_load_info_from_mem_params_desc();
}

/*******************************************************************************
 * This function returns the list of executable images.
 ******************************************************************************/
bl_params_t *plat_get_next_bl_params(void)
{
	bl_params_t *next_bl_params = get_next_bl_params_from_mem_params_desc();

	populate_next_bl_params_config(next_bl_params);
	return next_bl_params;
}