aboutsummaryrefslogtreecommitdiff
path: root/product/juno/scp_romfw_bypass/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Leach <mike.leach@linaro.org>2023-03-16 22:17:48 +0000
committerMike Leach <mike.leach@linaro.org>2023-07-14 11:12:37 +0100
commit210d70fe97fe734efb31c65e86c60c7c36e36f02 (patch)
treea3cf80e4508548ba0896c3d1810a1ef4fd47c250 /product/juno/scp_romfw_bypass/CMakeLists.txt
parent9b40f50f8cde1e6e33b641d209b4a0b6938a52d2 (diff)
product: juno: scp_romfw_bypass: Update to configure modules using device tree
Update the source and build files for this target to use device tree configuration for supported modules Updates CMakelists.txt and Firmware.cmake to enable DT build flow. Adds .dts file to define module configuration. Adds specific config_dt_juno.. files for modules requiring additional runtime configuration. Signed-off-by: Mike Leach <mike.leach@linaro.org>
Diffstat (limited to 'product/juno/scp_romfw_bypass/CMakeLists.txt')
-rw-r--r--product/juno/scp_romfw_bypass/CMakeLists.txt61
1 files changed, 54 insertions, 7 deletions
diff --git a/product/juno/scp_romfw_bypass/CMakeLists.txt b/product/juno/scp_romfw_bypass/CMakeLists.txt
index bc59f2c14122..c8abeaccf05d 100644
--- a/product/juno/scp_romfw_bypass/CMakeLists.txt
+++ b/product/juno/scp_romfw_bypass/CMakeLists.txt
@@ -21,17 +21,58 @@ target_include_directories(
target_sources(
juno-bl1-bypass
- PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_juno_ppu.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/config_juno_rom.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/config_juno_soc_clock.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/config_clock.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/config_timer.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/config_sds.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/config_bootloader.c"
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_juno_soc_clock.c"
"${CMAKE_CURRENT_SOURCE_DIR}/juno_pll_workaround.c"
"${CMAKE_CURRENT_SOURCE_DIR}/../src/juno_utils.c"
"${CMAKE_CURRENT_SOURCE_DIR}/../src/juno_id.c")
+# compile DT sources if DT build is enabled, otherwise build the old way
+if (SCP_FIRMWARE_DTS_SOURCE)
+
+ # specific Juno DT config files, other DT config files are built automatically
+ # as part of the modules
+ target_sources(
+ juno-bl1-bypass
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../scp_romfw/config_dt_juno_sds.c")
+
+else()
+
+ # files that are replaced by DT versions either in Juno or common
+ # framework modules.
+ #
+ # for now we allow option to build the firmware with the deprecated module
+ # config methods.
+ target_sources(
+ juno-bl1-bypass
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/config_bootloader.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config_clock.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config_juno_rom.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config_timer.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config_sds.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config_juno_ppu.c")
+endif()
+
+
+# add in juno specific headers for device tree bindings processing,
+# that are not include by other juno module builds
+list(APPEND SCP_DT_BIND_H_GEN_FROM_INCL
+ "${CMAKE_CURRENT_SOURCE_DIR}/../include/juno_ppu_idx.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../include/juno_sds.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../include/software_mmap.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../include/scp_mmap.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../include/system_clock.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../include/system_mmap.h"
+ )
+
+# create a list of optional .dtsi includes that will be added to the final dt compile
+# These are dependent on compile time defines which are generated later,
+# so add to define list and file list for later processing
+list(APPEND SCP_MODULE_DT_OPTIONS_DEFINE_REQ "BUILD_MODE_DEBUG")
+list(APPEND SCP_MODULE_DT_OPTIONS_FILE_REQ "juno-scp-romfw-debug-opts.dtsi")
+
+# additional -D define option when pre-compiling headers for dt
+list(APPEND SCP_DT_BIND_H_GEN_DEFS "SCP_ROM_BYPASS=1")
+
#
# We explicitly add the CMSIS include directories to our interfaceinclude
# directories. Each module target adds these include directories totheir own,
@@ -45,3 +86,9 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_link_options(juno-bl1-bypass
PUBLIC "LINKER:--wrap=arch_exception_reset")
endif()
+
+# ensure include lists pushed to parent scope
+set(SCP_DT_BIND_H_GEN_FROM_INCL ${SCP_DT_BIND_H_GEN_FROM_INCL} PARENT_SCOPE)
+set(SCP_DT_BIND_H_GEN_DEFS ${SCP_DT_BIND_H_GEN_DEFS} PARENT_SCOPE)
+set(SCP_MODULE_DT_OPTIONS_DEFINE_REQ ${SCP_MODULE_DT_OPTIONS_DEFINE_REQ} PARENT_SCOPE)
+set(SCP_MODULE_DT_OPTIONS_FILE_REQ ${SCP_MODULE_DT_OPTIONS_FILE_REQ} PARENT_SCOPE)