Make SCP_BL2(U) image loading configurable on CSS platforms
authorVikram Kanigiri <vikram.kanigiri@arm.com>
Thu, 14 Jan 2016 14:26:27 +0000 (14:26 +0000)
committerVikram Kanigiri <vikram.kanigiri@arm.com>
Tue, 16 Feb 2016 10:51:45 +0000 (10:51 +0000)
Current code mandates loading of SCP_BL2/SCP_BL2U images for all
CSS platforms. On future ARM CSS platforms, the Application
Processor (AP) might not need to load these images. So, these
items can be removed from the FIP on those platforms.

BL2 tries to load  SCP_BL2/SCP_BL2U images if their base
addresses are defined causing boot error if the images are not
found in FIP.

This change adds a make flag `CSS_LOAD_SCP_IMAGES` which if set
to `1` does:
1. Adds SCP_BL2, SCP_BL2U images to FIP.
2. Defines the base addresses of these images so that AP loads
   them.

And vice-versa if it is set to `0`. The default value is set to
`1`.

Change-Id: I5abfe22d5dc1e9d80d7809acefc87b42a462204a

docs/user-guide.md
include/plat/arm/css/common/css_def.h
plat/arm/css/common/css_common.mk

index e692913456a09aef2db351fb13f10c88b9092a0a..7fd765815dd8f12efc7b07f42869ceef08f802c7 100644 (file)
@@ -471,6 +471,10 @@ map is explained in the [Firmware Design].
     set to 1 then Trusted Firmware will detect if an earlier version is in use.
     Default is 1.
 
+*   `CSS_LOAD_SCP_IMAGES`: Boolean flag, which when set, adds SCP_BL2 and
+    SCP_BL2U to the FIP and FWU_FIP respectively, and enables them to be loaded
+    during boot. Default is 1.
+
 #### ARM FVP platform specific build options
 
 *   `FVP_USE_GIC_DRIVER`   : Selects the GIC driver to be built. Options:
index 79bb44c84bc8cd39d1f6b24675ca04dc0efc287d..aa802a588e6ba839130e0e79c9d1c427406df32c 100644 (file)
  * ARM Compute SubSystems (CSS)
  ************************************************************************/
 
+/*
+ * The loading of SCP images(SCP_BL2 or SCP_BL2U) is done if there
+ * respective base addresses are defined (i.e SCP_BL2_BASE, SCP_BL2U_BASE).
+ * Hence, `CSS_LOAD_SCP_IMAGES` needs to be set to 1 if BL2 needs to load
+ * an SCP_BL2/SCP_BL2U image.
+ */
+#if CSS_LOAD_SCP_IMAGES
 /*
  * Load address of SCP_BL2 in CSS platform ports
  * SCP_BL2 is loaded to the same place as BL31.  Once SCP_BL2 is transferred to the
 #define SCP_BL2_BASE                   BL31_BASE
 
 #define SCP_BL2U_BASE                  BL31_BASE
+#endif /* CSS_LOAD_SCP_IMAGES */
 
 #define PLAT_ARM_SHARED_RAM_CACHED     MHU_PAYLOAD_CACHED
 
index 6a8773ddaaa36782529b79390346130e6b45576e..65e125eab1876e319296a316a111d23dc0c34078 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+# Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
+
+# By default, SCP images are needed by CSS platforms.
+CSS_LOAD_SCP_IMAGES    ?=      1
+
 PLAT_INCLUDES          +=      -Iinclude/plat/arm/css/common                   \
                                -Iinclude/plat/arm/css/common/aarch64
 
@@ -38,12 +42,10 @@ BL1_SOURCES         +=      plat/arm/css/common/css_bl1_setup.c
 
 BL2_SOURCES            +=      plat/arm/css/common/css_bl2_setup.c             \
                                plat/arm/css/common/css_mhu.c                   \
-                               plat/arm/css/common/css_scp_bootloader.c        \
                                plat/arm/css/common/css_scpi.c
 
 BL2U_SOURCES           +=      plat/arm/css/common/css_bl2u_setup.c            \
                                plat/arm/css/common/css_mhu.c                   \
-                               plat/arm/css/common/css_scp_bootloader.c        \
                                plat/arm/css/common/css_scpi.c
 
 BL31_SOURCES           +=      plat/arm/css/common/css_mhu.c                   \
@@ -51,17 +53,25 @@ BL31_SOURCES                +=      plat/arm/css/common/css_mhu.c                   \
                                plat/arm/css/common/css_scpi.c                  \
                                plat/arm/css/common/css_topology.c
 
-ifneq (${TRUSTED_BOARD_BOOT},0)
-$(eval $(call FWU_FIP_ADD_IMG,SCP_BL2U,--scp-fwu-cfg))
-endif
 
 ifneq (${RESET_TO_BL31},0)
   $(error "Using BL31 as the reset vector is not supported on CSS platforms. \
   Please set RESET_TO_BL31 to 0.")
 endif
 
-# Subsystems require a SCP_BL2 image
-$(eval $(call FIP_ADD_IMG,SCP_BL2,--scp-fw))
+# Process CSS_LOAD_SCP_IMAGES flag
+$(eval $(call assert_boolean,CSS_LOAD_SCP_IMAGES))
+$(eval $(call add_define,CSS_LOAD_SCP_IMAGES))
+
+ifeq (${CSS_LOAD_SCP_IMAGES},1)
+  $(eval $(call FIP_ADD_IMG,SCP_BL2,--scp-fw))
+  ifneq (${TRUSTED_BOARD_BOOT},0)
+    $(eval $(call FWU_FIP_ADD_IMG,SCP_BL2U,--scp-fwu-cfg))
+  endif
+
+  BL2U_SOURCES         +=      plat/arm/css/common/css_scp_bootloader.c
+  BL2_SOURCES          +=      plat/arm/css/common/css_scp_bootloader.c
+endif
 
 # Enable option to detect whether the SCP ROM firmware in use predates version
 # 1.7.0 and therefore, is incompatible.