aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--product/juno/scp_romfw_bypass/CMakeLists.txt61
-rw-r--r--product/juno/scp_romfw_bypass/Firmware.cmake23
-rw-r--r--product/juno/scp_romfw_bypass/juno-scp_romfw_bypass.dts23
3 files changed, 100 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)
diff --git a/product/juno/scp_romfw_bypass/Firmware.cmake b/product/juno/scp_romfw_bypass/Firmware.cmake
index fd704a37978a..be192a11907a 100644
--- a/product/juno/scp_romfw_bypass/Firmware.cmake
+++ b/product/juno/scp_romfw_bypass/Firmware.cmake
@@ -21,6 +21,19 @@ set(SCP_ENABLE_NOTIFICATIONS TRUE)
set(SCP_ENABLE_IPO_INIT FALSE)
+
+# setup Device Tree sources
+
+# the root devicetree source file for this firmware variant
+# setting this source file triggers further DT build processes
+set(SCP_FIRMWARE_DTS_SOURCE "${CMAKE_CURRENT_LIST_DIR}/juno-scp_romfw_bypass.dts")
+
+# the includes needed:
+# the current include dir where generated headers appear
+list(PREPEND SCP_FIRMWARE_DTS_INCLUDE "${CMAKE_CURRENT_LIST_DIR}/../include")
+# the dts/include/juno specific .dtsi files for this product
+list(PREPEND SCP_FIRMWARE_DTS_INCLUDE "${CMAKE_SOURCE_DIR}/dts/include/juno")
+
list(PREPEND SCP_MODULE_PATHS "${CMAKE_CURRENT_LIST_DIR}/../module/juno_rom")
list(PREPEND SCP_MODULE_PATHS "${CMAKE_CURRENT_LIST_DIR}/../module/juno_ppu")
list(PREPEND SCP_MODULE_PATHS
@@ -37,3 +50,13 @@ list(APPEND SCP_MODULES "clock")
list(APPEND SCP_MODULES "gtimer")
list(APPEND SCP_MODULES "sds")
list(APPEND SCP_MODULES "bootloader")
+
+# select device tree configured modules
+# These use the .dts configured variants
+# Order is not important for this list
+list(APPEND SCP_DT_CONFIG_MODULES_STD "juno-ppu")
+list(APPEND SCP_DT_CONFIG_MODULES_STD "juno-rom")
+list(APPEND SCP_DT_CONFIG_MODULES_STD "clock")
+list(APPEND SCP_DT_CONFIG_MODULES_STD "gtimer")
+list(APPEND SCP_DT_CONFIG_MODULES_DYN "sds")
+list(APPEND SCP_DT_CONFIG_MODULES_STD "bootloader")
diff --git a/product/juno/scp_romfw_bypass/juno-scp_romfw_bypass.dts b/product/juno/scp_romfw_bypass/juno-scp_romfw_bypass.dts
new file mode 100644
index 000000000000..cf4d9bae53ea
--- /dev/null
+++ b/product/juno/scp_romfw_bypass/juno-scp_romfw_bypass.dts
@@ -0,0 +1,23 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/* must be first include */
+#include "base.dtsi"
+
+/* device tree file for Juno ROM bypass SCP firmware variant - use same as ROM variant */
+#include "juno-scp-base.dtsi"
+#include "juno-scp-romfw.dtsi"
+
+/* include the generated options file */
+#include "fwk-dt-options.dtsi"
+
+/ {
+ model = "Juno Development Platform (r0-r2)";
+ compatible = "arm,juno";
+
+
+}; \ No newline at end of file