scp: scp is now built using cmake
The scp is now built using cmake, specifically with Makefile.cmake. This
requires changes to configuration as how the compiler is specified has
changed. This also required changes to any reference to scp files as
these have all moved.
Signed-off-by: Joel Goddard <joel.goddard@arm.com>
Signed-off-by: Leandro Belli <leandro.belli@arm.com>
Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
Co-authored-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
Change-Id: Idaab98e8f217b891e3dd76791502bc5988e39ec4
diff --git a/run_config/scp_juno-linux.uboot b/run_config/scp_juno-linux.uboot
index d7acd93..e2f5884 100644
--- a/run_config/scp_juno-linux.uboot
+++ b/run_config/scp_juno-linux.uboot
@@ -10,12 +10,15 @@
}
post_tf_build() {
- path_bypass_rom="$scp_root/build/product/juno/scp_romfw_bypass/$mode/bin"
+ path_bypass_rom="$scp_root/build/juno/GNU/$mode/firmware-scp_romfw_bypass/bin"
- cp "$path_bypass_rom/scp_romfw_bypass.bin" "$path_bypass_rom/scp_bl1.bin"
+ cp "$path_bypass_rom/juno-bl1-bypass.bin" "$path_bypass_rom/scp_bl1.bin"
archive_file "$path_bypass_rom/scp_bl1.bin"
- archive_file "$scp_root/build/product/juno/scp_ramfw/$mode/bin/scp_ramfw.bin"
+ path_ram="$scp_root/build/juno/GNU/$mode/firmware-scp_ramfw/bin"
+
+ cp "$path_ram/juno-bl2.bin" "$path_ram/scp_ramfw.bin"
+ archive_file "$path_ram/scp_ramfw.bin"
get_uboot_bin
build_fip BL33="$archive/uboot.bin" SCP_BL2="$archive/scp_ramfw.bin"
}
diff --git a/run_config/scp_juno-tftf b/run_config/scp_juno-tftf
index 1b854e8..4ef2d9f 100644
--- a/run_config/scp_juno-tftf
+++ b/run_config/scp_juno-tftf
@@ -6,12 +6,15 @@
#
post_tf_build() {
- path_bypass_rom="$scp_root/build/product/juno/scp_romfw_bypass/$mode/bin"
+ path_bypass_rom="$scp_root/build/juno/GNU/$mode/firmware-scp_romfw_bypass/bin"
- cp "$path_bypass_rom/scp_romfw_bypass.bin" "$path_bypass_rom/scp_bl1.bin"
+ cp "$path_bypass_rom/juno-bl1-bypass.bin" "$path_bypass_rom/scp_bl1.bin"
archive_file "$path_bypass_rom/scp_bl1.bin"
- archive_file "$scp_root/build/product/juno/scp_ramfw/$mode/bin/scp_ramfw.bin"
+ path_ram="$scp_root/build/juno/GNU/$mode/firmware-scp_ramfw/bin"
+
+ cp "$path_ram/juno-bl2.bin" "$path_ram/scp_ramfw.bin"
+ archive_file "$path_ram/scp_ramfw.bin"
build_fip BL33="$archive/tftf.bin" SCP_BL2="$archive/scp_ramfw.bin"
}
diff --git a/scp_config/fvp-morello b/scp_config/fvp-morello
index fa070eb..678a3db 100644
--- a/scp_config/fvp-morello
+++ b/scp_config/fvp-morello
@@ -1,3 +1,5 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
PRODUCT=morello
-LOG_LEVEL=INFO
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
+EXTRA_CONFIG_ARGS+=-DSCP_LOG_LEVEL=INFO
\ No newline at end of file
diff --git a/scp_config/fvp-rdn1edge b/scp_config/fvp-rdn1edge
index 4eebb58..21eee56 100644
--- a/scp_config/fvp-rdn1edge
+++ b/scp_config/fvp-rdn1edge
@@ -1,2 +1,4 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
PRODUCT=rdn1e1
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
\ No newline at end of file
diff --git a/scp_config/fvp-rdv1 b/scp_config/fvp-rdv1
index 12b442c..ba2e4f2 100644
--- a/scp_config/fvp-rdv1
+++ b/scp_config/fvp-rdv1
@@ -1,2 +1,4 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
PRODUCT=rdv1
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
\ No newline at end of file
diff --git a/scp_config/fvp-sgi575 b/scp_config/fvp-sgi575
index 2084b97..ab0e452 100644
--- a/scp_config/fvp-sgi575
+++ b/scp_config/fvp-sgi575
@@ -1,2 +1,4 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
PRODUCT=sgi575
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
\ No newline at end of file
diff --git a/scp_config/fvp-tc0 b/scp_config/fvp-tc0
index 602cc69..e969a51 100644
--- a/scp_config/fvp-tc0
+++ b/scp_config/fvp-tc0
@@ -1,3 +1,5 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc
PRODUCT=tc0
-LOG_LEVEL=WARN
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-g++
+EXTRA_CONFIG_ARGS+=-DSCP_LOG_LEVEL=WARN
\ No newline at end of file
diff --git a/scp_config/fvp-tc1 b/scp_config/fvp-tc1
index e157f90..fed01b9 100644
--- a/scp_config/fvp-tc1
+++ b/scp_config/fvp-tc1
@@ -1,3 +1,5 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc
PRODUCT=tc1
-LOG_LEVEL=WARN
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-g++
+EXTRA_CONFIG_ARGS+=-DSCP_LOG_LEVEL=WARN
diff --git a/scp_config/juno b/scp_config/juno
index df6d969..9bf4e9e 100644
--- a/scp_config/juno
+++ b/scp_config/juno
@@ -1,2 +1,5 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
PRODUCT=juno
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
+EXTRA_CONFIG_ARGS+=-DSCP_LOG_LEVEL=CRIT
\ No newline at end of file
diff --git a/scp_config/juno-scmiv2 b/scp_config/juno-scmiv2
index acd3803..118a430 100644
--- a/scp_config/juno-scmiv2
+++ b/scp_config/juno-scmiv2
@@ -1,8 +1,10 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
PRODUCT=juno
-BS_FIRMWARE_HAS_SCMI_NOTIFICATIONS=yes
-BS_FIRMWARE_HAS_FAST_CHANNELS=yes
-BS_FIRMWARE_HAS_SCMI_RESET=yes
-BS_FIRMWARE_HAS_DEBUG_UNIT=no
-BS_FIRMWARE_HAS_RESOURCE_PERMISSIONS=no
-LOG_LEVEL=CRIT
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
+EXTRA_CONFIG_ARGS+=-DSCP_ENABLE_SCMI_NOTIFICATIONS=ON
+EXTRA_CONFIG_ARGS+=-DSCP_ENABLE_FAST_CHANNELS=ON
+EXTRA_CONFIG_ARGS+=-DSCP_ENABLE_SCMI_RESET=ON
+EXTRA_CONFIG_ARGS+=-DSCP_ENABLE_DEBUG_UNIT=OFF
+EXTRA_CONFIG_ARGS+=-DSCP_ENABLE_RESOURCE_PERMISSIONS=OFF
+EXTRA_CONFIG_ARGS+=-DSCP_LOG_LEVEL=CRIT
\ No newline at end of file
diff --git a/scp_config/n1sdp b/scp_config/n1sdp
index 555dffd..c260fe3 100644
--- a/scp_config/n1sdp
+++ b/scp_config/n1sdp
@@ -1,3 +1,5 @@
-CC=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
PRODUCT=n1sdp
-LOG_LEVEL=INFO
+EXTRA_CONFIG_ARGS+=-DCMAKE_ASM_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_C_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc
+EXTRA_CONFIG_ARGS+=-DCMAKE_CXX_COMPILER=/arm/pdsw/downloads/scp-models/tools/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++
+EXTRA_CONFIG_ARGS+=-DSCP_LOG_LEVEL=INFO
\ No newline at end of file
diff --git a/script/build_package.sh b/script/build_package.sh
index f1d86f0..8cb6047 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -175,29 +175,29 @@
# collect_build_artefacts function.
collect_scp_artefacts() {
to="${to:?}" \
- find "$scp_root" \( -name "*.bin" -o -name '*.elf' \) -exec bash -c '
+ find "$scp_root" \( \( -name "*.bin" -o -name '*.elf' \) -and ! -name 'CMake*' \) -exec bash -c '
for file; do
ext="$(echo $file | awk -F. "{print \$NF}")"
case $file in
- */scp_ramfw/*)
+ */firmware-scp_ramfw/bin/*)
cp $file $to/scp_ram.$ext
;;
- */scp_ramfw_fvp/*)
+ */firmware-scp_ramfw_fvp/bin/*)
cp $file $to/scp_ramfw_fvp.$ext
;;
- */scp_romfw/*)
+ */firmware-scp_romfw/bin/*)
cp $file $to/scp_rom.$ext
;;
- */mcp_ramfw/*)
+ */firmware-mcp_ramfw/bin/*)
cp $file $to/mcp_ram.$ext
;;
- */mcp_ramfw_fvp/*)
+ */firmware-mcp_ramfw_fvp/bin/*)
cp $file $to/mcp_ramfw_fvp.$ext
;;
- */mcp_romfw/*)
+ */firmware-mcp_romfw/bin/*)
cp $file $to/mcp_rom.$ext
;;
- */scp_romfw_bypass/*)
+ */firmware-scp_romfw_bypass/bin/*)
cp $file $to/scp_rom_bypass.$ext
;;
*)
@@ -583,17 +583,29 @@
make clean &>>"$build_log" || fail_build
fi
+ python3 -m venv .venv
+ . .venv/bin/activate
+
+ # Install extra tools used by CMake build system
+ pip install -r requirements.txt --timeout 30 --retries 15
+
# Log build command line. It is left unfolded on purpose to assist
# copying to clipboard.
cat <<EOF | log_separator >/dev/null
SCP build command line:
- make $(cat "$config_file" | tr '\n' ' ') MODE=$mode V=1
+ make -f Makefile.cmake $(cat "$config_file" | tr '\n' ' ') \
+ TOOLCHAIN=GNU \
+ MODE="$mode" \
+ V=1 &>>"$build_log"
EOF
# Build SCP
- make $(cat "$config_file") MODE="$mode" V=1 &>>"$build_log" \
+ make -f Makefile.cmake $(cat "$config_file" | tr '\n' ' ') \
+ TOOLCHAIN=GNU \
+ MODE="$mode" \
+ V=1 &>>"$build_log" \
|| fail_build
)
}
@@ -740,7 +752,7 @@
cross_compile="$(set_cross_compile_gcc_linaro_toolchain)"
- if [ ! -d "$scp_root/build/product/juno/scp_ramfw/debug" ]; then
+ if [ ! -d "$scp_root/build/juno/GNU/debug/firmware-scp_ramfw" ]; then
make fiptool
echo "Make FIP 4 SCP-Tools rls..."
@@ -755,7 +767,7 @@
"CROSS_COMPILE=$cross_compile" \
"BL31=$scp_tools_root/arm-tf/build/juno/debug/bl31.bin" \
"BL33=$scp_tools_root/baremetal/dummy_bl33" \
- "SCP_BL2=$scp_root/build/product/juno/scp_ramfw/debug/bin/firmware.bin"
+ "SCP_BL2=$scp_root/build/juno/GNU/$mode/firmware-scp_ramfw/bin/juno-bl2.bin"
archive_file "$scp_tools_root/arm-tf/build/juno/debug/fip.bin"
fi