diff --git a/plat/juno/bl2_plat_setup.c b/plat/juno/bl2_plat_setup.c index 7e0b9e8..4d162c6 100644 --- a/plat/juno/bl2_plat_setup.c +++ b/plat/juno/bl2_plat_setup.c @@ -71,24 +71,18 @@ __attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE), section("tzfw_coherent_mem"))); -/******************************************************************************* - * Reference to structure which holds the arguments which need to be passed - * to BL31 - ******************************************************************************/ -static bl31_args *bl2_to_bl31_args; +static bl31_args bl2_to_bl31_args +__attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE), + section("tzfw_coherent_mem"))); meminfo *bl2_plat_sec_mem_layout(void) { return &bl2_tzram_layout; } -/******************************************************************************* - * This function returns a pointer to the memory that the platform has kept - * aside to pass all the information that BL31 could need. - ******************************************************************************/ bl31_args *bl2_get_bl31_args_ptr(void) { - return bl2_to_bl31_args; + return &bl2_to_bl31_args; } /******************************************************************************* @@ -118,16 +112,14 @@ { /* Initialise the IO layer and register platform IO devices */ io_setup(); - /* Use the Trusted DRAM for passing args to BL31 */ - bl2_to_bl31_args = (bl31_args *) TZDRAM_BASE; /* Populate the extents of memory available for loading BL33 */ - bl2_to_bl31_args->bl33_meminfo.total_base = DRAM_BASE; - bl2_to_bl31_args->bl33_meminfo.total_size = DRAM_SIZE; - bl2_to_bl31_args->bl33_meminfo.free_base = DRAM_BASE; - bl2_to_bl31_args->bl33_meminfo.free_size = DRAM_SIZE; - bl2_to_bl31_args->bl33_meminfo.attr = 0; - bl2_to_bl31_args->bl33_meminfo.next = 0; + bl2_to_bl31_args.bl33_meminfo.total_base = DRAM_BASE; + bl2_to_bl31_args.bl33_meminfo.total_size = DRAM_SIZE; + bl2_to_bl31_args.bl33_meminfo.free_base = DRAM_BASE; + bl2_to_bl31_args.bl33_meminfo.free_size = DRAM_SIZE; + bl2_to_bl31_args.bl33_meminfo.attr = 0; + bl2_to_bl31_args.bl33_meminfo.next = 0; } diff --git a/plat/juno/bl31_plat_setup.c b/plat/juno/bl31_plat_setup.c index c2c7ff8..fb29076 100644 --- a/plat/juno/bl31_plat_setup.c +++ b/plat/juno/bl31_plat_setup.c @@ -61,20 +61,16 @@ #define BL31_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__) #define BL31_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__) -/******************************************************************************* - * Reference to structure which holds the arguments that have been passed to - * BL31 from BL2. - ******************************************************************************/ -static bl31_args *bl2_to_bl31_args; +static bl31_args bl2_to_bl31_args; meminfo *bl31_plat_sec_mem_layout(void) { - return &bl2_to_bl31_args->bl31_meminfo; + return &bl2_to_bl31_args.bl31_meminfo; } meminfo *bl31_plat_get_bl32_mem_layout(void) { - return &bl2_to_bl31_args->bl32_meminfo; + return &bl2_to_bl31_args.bl32_meminfo; } /******************************************************************************* @@ -88,8 +84,8 @@ el_change_info *next_image_info; next_image_info = (type == NON_SECURE) ? - &bl2_to_bl31_args->bl33_image_info : - &bl2_to_bl31_args->bl32_image_info; + &bl2_to_bl31_args.bl33_image_info : + &bl2_to_bl31_args.bl32_image_info; /* None of the images on this platform can have 0x0 as the entrypoint */ if (next_image_info->entrypoint) @@ -112,8 +108,7 @@ void bl31_early_platform_setup(bl31_args *from_bl2, void *data) { - bl2_to_bl31_args = from_bl2; - + bl2_to_bl31_args = *from_bl2; } /******************************************************************************* @@ -145,7 +140,7 @@ ******************************************************************************/ void bl31_plat_arch_setup() { - configure_mmu(&bl2_to_bl31_args->bl31_meminfo, + configure_mmu(&bl2_to_bl31_args.bl31_meminfo, BL31_RO_BASE, BL31_RO_LIMIT, BL31_COHERENT_RAM_BASE,