Move BL1 and BL2 private defines to bl_common.h
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Tue, 18 Dec 2018 13:49:46 +0000 (13:49 +0000)
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Tue, 15 Jan 2019 13:52:32 +0000 (13:52 +0000)
The definitions in bl1/bl1_private.h and bl2/bl2_private.h are useful for
platforms that may need to access them.

Change-Id: Ifd1880f855ddafcb3bfcaf1ed4a4e0f121eda174
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
12 files changed:
bl1/bl1_private.h
bl2/bl2_private.h
include/common/bl_common.h
plat/arm/common/arm_bl1_setup.c
plat/arm/css/sgi/sgi_plat.c
plat/hisilicon/hikey/hikey_bl1_setup.c
plat/hisilicon/hikey960/hikey960_bl1_setup.c
plat/hisilicon/poplar/bl1_plat_setup.c
plat/layerscape/common/ls_bl1_setup.c
plat/marvell/common/marvell_bl1_setup.c
plat/qemu/qemu_private.h
plat/rpi3/rpi3_bl1_setup.c

index bdbf80f32d1e4edc98db28bcfec7ed0c5c6b4a4d..927c7b8a2631f259ff4756ce7f58fcbbde3dc989 100644 (file)
@@ -9,16 +9,7 @@
 
 #include <stdint.h>
 
-#include <lib/utils_def.h>
-
-/*******************************************************************************
- * Declarations of linker defined symbols which will tell us where BL1 lives
- * in Trusted ROM and RAM
- ******************************************************************************/
-IMPORT_SYM(uintptr_t, __BL1_ROM_END__,   BL1_ROM_END);
-
-IMPORT_SYM(uintptr_t, __BL1_RAM_START__, BL1_RAM_BASE);
-IMPORT_SYM(uintptr_t, __BL1_RAM_END__,   BL1_RAM_LIMIT);
+#include <common/bl_common.h>
 
 /******************************************
  * Function prototypes
@@ -36,4 +27,5 @@ register_t bl1_fwu_smc_handler(unsigned int smc_fid,
                void *cookie,
                void *handle,
                unsigned int flags);
+
 #endif /* BL1_PRIVATE_H */
index 01f6c6bd2c83c3150d00add303bbbf7df9abe4ae..b1704d282f3f93749ad5d0a46afd16df838d4b6e 100644 (file)
@@ -7,22 +7,7 @@
 #ifndef BL2_PRIVATE_H
 #define BL2_PRIVATE_H
 
-#if BL2_IN_XIP_MEM
-
-#include <stdint.h>
-
-/*******************************************************************************
- * Declarations of linker defined symbols which will tell us where BL2 lives
- * in Trusted ROM and RAM
- ******************************************************************************/
-extern uintptr_t __BL2_ROM_END__;
-#define BL2_ROM_END (uintptr_t)(&__BL2_ROM_END__)
-
-extern uintptr_t __BL2_RAM_START__;
-extern uintptr_t __BL2_RAM_END__;
-#define BL2_RAM_BASE (uintptr_t)(&__BL2_RAM_START__)
-#define BL2_RAM_LIMIT (uintptr_t)(&__BL2_RAM_END__)
-#endif
+#include <common/bl_common.h>
 
 /******************************************
  * Forward declarations
index c12b08bb7db510ead862ee98af41e35f297778dd..f7b3b9c7d2918e967db4ca69b69303df047db1c8 100644 (file)
@@ -78,7 +78,12 @@ IMPORT_SYM(unsigned long, __RO_START__,              BL_CODE_BASE);
 IMPORT_SYM(unsigned long, __RO_END__,          BL_CODE_END);
 #endif
 
-#if defined(IMAGE_BL2)
+#if defined(IMAGE_BL1)
+IMPORT_SYM(uintptr_t, __BL1_ROM_END__,   BL1_ROM_END);
+
+IMPORT_SYM(uintptr_t, __BL1_RAM_START__, BL1_RAM_BASE);
+IMPORT_SYM(uintptr_t, __BL1_RAM_END__,   BL1_RAM_LIMIT);
+#elif defined(IMAGE_BL2)
 IMPORT_SYM(unsigned long, __BL2_END__,         BL2_END);
 #elif defined(IMAGE_BL2U)
 IMPORT_SYM(unsigned long, __BL2U_END__,                BL2U_END);
@@ -89,6 +94,17 @@ IMPORT_SYM(unsigned long, __BL31_END__,              BL31_END);
 IMPORT_SYM(unsigned long, __BL32_END__,                BL32_END);
 #endif /* IMAGE_BLX */
 
+/* The following symbols are only exported from the BL2 at EL3 linker script. */
+#if BL2_IN_XIP_MEM && defined(IMAGE_BL2)
+extern uintptr_t __BL2_ROM_END__;
+#define BL2_ROM_END (uintptr_t)(&__BL2_ROM_END__)
+
+extern uintptr_t __BL2_RAM_START__;
+extern uintptr_t __BL2_RAM_END__;
+#define BL2_RAM_BASE (uintptr_t)(&__BL2_RAM_START__)
+#define BL2_RAM_LIMIT (uintptr_t)(&__BL2_RAM_END__)
+#endif /* BL2_IN_XIP_MEM */
+
 /*
  * The next 2 constants identify the extents of the coherent memory region.
  * These addresses are used by the MMU setup code and therefore they must be
index e28211cfa7e86db32eac499136664e51151b6bc1..1a0385a776fb2d5b585283a226233f79235b674c 100644 (file)
@@ -19,8 +19,6 @@
 #include <arm_def.h>
 #include <plat_arm.h>
 
-#include "../../../bl1/bl1_private.h"
-
 /* Weak definitions may be overridden in specific ARM standard platform */
 #pragma weak bl1_early_platform_setup
 #pragma weak bl1_plat_arch_setup
index 79f3e5b55d0c11da0d2ca0b0180879bec0577fc1..2515e3b1b689d63c8c5e5516885790230fcc3011 100644 (file)
@@ -17,7 +17,6 @@
 #include <arm_def.h>
 #include <arm_spm_def.h>
 #include <plat_arm.h>
-#include "../../../../bl1/bl1_private.h"
 
 #if USE_COHERENT_MEM
 /*
index a08bdfa72b64f3458eb79608e0f02ba1df26dbcd..a97d763201e305097f3d5862895dd8f0d299429b 100644 (file)
@@ -22,7 +22,6 @@
 #include <hikey_def.h>
 #include <hikey_layout.h>
 
-#include "../../../bl1/bl1_private.h"
 #include "hikey_private.h"
 
 /* Data structure which holds the extents of the trusted RAM for BL1 */
index 38bdbe41767dda18482168fd1c3969662700a813..4a7036cfc742b276c7d2a8436dee75df18413451 100644 (file)
@@ -25,7 +25,6 @@
 #include <plat/common/platform.h>
 
 #include <hi3660.h>
-#include "../../../bl1/bl1_private.h"
 #include "hikey960_def.h"
 #include "hikey960_private.h"
 
index eb8ffe4fd00dcc7ac5ffad8b9425f702ff04a3ed..08ad67c5956626d3a74c559182fbafe53ecfe1cd 100644 (file)
@@ -22,7 +22,6 @@
 #include <lib/mmio.h>
 #include <plat/common/platform.h>
 
-#include "../../../bl1/bl1_private.h"
 #include "hi3798cv200.h"
 #include "plat_private.h"
 
index fb929fef1f0313eb5baa9ced0afe2b3c689fd668..163b35c4812b16d191a6e057162746c749e5370c 100644 (file)
@@ -4,11 +4,11 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <common/bl_common.h>
 #include <common/debug.h>
 
 #include "ls_16550.h"
 #include "plat_ls.h"
-#include "../../../bl1/bl1_private.h"
 
 /* Data structure which holds the extents of the trusted SRAM for BL1*/
 static meminfo_t bl1_tzram_layout;
index 8f722102502a77eeb923b07c1efb631132ded575..7b7cef39be841360aa10bb7ab666ce372db7e753 100644 (file)
@@ -8,7 +8,6 @@
 #include <platform_def.h>
 
 #include <bl1/bl1.h>
-#include <bl1/bl1_private.h>
 #include <common/bl_common.h>
 #include <common/debug.h>
 #include <drivers/arm/sp805.h>
index ab2bf1ba3407d6834029e385f21e7ecd7ea322ad..754831ab5af38caaf87d36e9d224c04a42ed4bc3 100644 (file)
@@ -9,8 +9,6 @@
 
 #include <stdint.h>
 
-#include "../../bl1/bl1_private.h"
-
 void qemu_configure_mmu_svc_mon(unsigned long total_base,
                        unsigned long total_size,
                        unsigned long code_start, unsigned long code_limit,
index ea4215d83e1952780d152bb9fd8bdbc168cc51d0..b869e9da891790c193a2edb9911439a2b0818f08 100644 (file)
@@ -13,7 +13,6 @@
 #include <lib/xlat_tables/xlat_mmu_helpers.h>
 #include <lib/xlat_tables/xlat_tables_defs.h>
 
-#include "../../bl1/bl1_private.h"
 #include "rpi3_private.h"
 
 /* Data structure which holds the extents of the trusted SRAM for BL1 */