From 6d8d12366f1d46ec6539bef77f9caf9782e480a2 Mon Sep 17 00:00:00 2001 From: Axel Heider Date: Wed, 24 Jan 2024 08:59:08 +0100 Subject: [PATCH] CMake: fail if platform configuration is missing Signed-off-by: Axel Heider --- apps/Arm/vm_cross_connector/CMakeLists.txt | 2 ++ apps/Arm/vm_cross_connector/settings.cmake | 8 +++++++- apps/Arm/vm_introspect/CMakeLists.txt | 2 ++ apps/Arm/vm_introspect/settings.cmake | 8 +++++++- apps/Arm/vm_minimal/CMakeLists.txt | 3 +++ apps/Arm/vm_minimal/settings.cmake | 23 +++++++++++----------- apps/Arm/vm_multi/CMakeLists.txt | 2 ++ apps/Arm/vm_multi/settings.cmake | 8 +++++++- apps/Arm/vm_virtio_net/CMakeLists.txt | 3 +++ apps/Arm/vm_virtio_net/settings.cmake | 9 +++++++++ 10 files changed, 54 insertions(+), 14 deletions(-) diff --git a/apps/Arm/vm_cross_connector/CMakeLists.txt b/apps/Arm/vm_cross_connector/CMakeLists.txt index 64697289..66c599d0 100644 --- a/apps/Arm/vm_cross_connector/CMakeLists.txt +++ b/apps/Arm/vm_cross_connector/CMakeLists.txt @@ -35,6 +35,8 @@ elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt") if(SIMULATION) GenerateSimulateScript() endif() +else() + message(FATAL_ERROR "unsupported KernelARMPlatform: ${KernelARMPlatform}") endif() AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux") diff --git a/apps/Arm/vm_cross_connector/settings.cmake b/apps/Arm/vm_cross_connector/settings.cmake index 149c2e21..45353878 100644 --- a/apps/Arm/vm_cross_connector/settings.cmake +++ b/apps/Arm/vm_cross_connector/settings.cmake @@ -9,11 +9,17 @@ if(NOT "${PLATFORM}" IN_LIST supported) message(FATAL_ERROR "PLATFORM: ${PLATFORM} not supported. Supported: ${supported}") endif() + set(VmPCISupport ON CACHE BOOL "" FORCE) set(LibUSB OFF CACHE BOOL "" FORCE) set(VmInitRdFile ON CACHE BOOL "" FORCE) -if(${PLATFORM} STREQUAL "qemu-arm-virt") + +if(${PLATFORM} STREQUAL "exynos5422") + # nothing special here +elseif(${PLATFORM} STREQUAL "qemu-arm-virt") # force cpu set(QEMU_MEMORY "2048") set(KernelArmCPU cortex-a53 CACHE STRING "" FORCE) +else() + message(FATAL_ERROR "unsupported PLATFORM: ${PLATFORM}") endif() diff --git a/apps/Arm/vm_introspect/CMakeLists.txt b/apps/Arm/vm_introspect/CMakeLists.txt index 8db76bbf..b0482d85 100644 --- a/apps/Arm/vm_introspect/CMakeLists.txt +++ b/apps/Arm/vm_introspect/CMakeLists.txt @@ -52,6 +52,8 @@ elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt") GenerateSimulateScript() endif() +else() + message(FATAL_ERROR "unsupported KernelARMPlatform: ${KernelARMPlatform}") endif() AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux") diff --git a/apps/Arm/vm_introspect/settings.cmake b/apps/Arm/vm_introspect/settings.cmake index 78ce0f19..b0b30dbf 100644 --- a/apps/Arm/vm_introspect/settings.cmake +++ b/apps/Arm/vm_introspect/settings.cmake @@ -9,11 +9,17 @@ if(NOT "${PLATFORM}" IN_LIST supported) message(FATAL_ERROR "PLATFORM: ${PLATFORM} not supported. Supported: ${supported}") endif() + set(VmPCISupport ON CACHE BOOL "" FORCE) set(LibUSB OFF CACHE BOOL "" FORCE) set(VmInitRdFile ON CACHE BOOL "" FORCE) -if(${PLATFORM} STREQUAL "qemu-arm-virt") + +if(${PLATFORM} STREQUAL "exynos5422") + # nothing here +elseif(${PLATFORM} STREQUAL "qemu-arm-virt") # force cpu set(QEMU_MEMORY "2048") set(KernelArmCPU cortex-a53 CACHE STRING "" FORCE) +else() + message(FATAL_ERROR "unsupported PLATFORM: ${PLATFORM}") endif() diff --git a/apps/Arm/vm_minimal/CMakeLists.txt b/apps/Arm/vm_minimal/CMakeLists.txt index b4fc6474..b13514a6 100644 --- a/apps/Arm/vm_minimal/CMakeLists.txt +++ b/apps/Arm/vm_minimal/CMakeLists.txt @@ -160,6 +160,9 @@ elseif("${KernelARMPlatform}" STREQUAL "zcu102") AddToFileServer("linux-dtb" "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb" DEPENDS set_dtb) list(APPEND cpp_includes "${CAMKES_VM_DIR}/components/VM_Arm/plat_include/zynqmp") + +else() + message(FATAL_ERROR "unsupported KernelARMPlatform: ${KernelARMPlatform}") endif() AddCamkesCPPFlag(cpp_flags CONFIG_VARS VmEmmc2NoDMA VmVUSB Tk1DeviceFwd Tk1Insecure) diff --git a/apps/Arm/vm_minimal/settings.cmake b/apps/Arm/vm_minimal/settings.cmake index ff385ada..98ec1bb0 100644 --- a/apps/Arm/vm_minimal/settings.cmake +++ b/apps/Arm/vm_minimal/settings.cmake @@ -9,35 +9,36 @@ if(NOT "${PLATFORM}" IN_LIST supported) message(FATAL_ERROR "PLATFORM: ${PLATFORM} not supported. Supported: ${supported}") endif() + +set(LibUSB OFF CACHE BOOL "" FORCE) + if(${PLATFORM} STREQUAL "tk1") set(KernelTk1SMMU ON CACHE BOOL "" FORCE) set(KernelTk1SMMUInterruptEnable ON CACHE BOOL "" FORCE) -endif() -set(LibUSB OFF CACHE BOOL "" FORCE) -if(${PLATFORM} STREQUAL "exynos5422") +elseif(${PLATFORM} STREQUAL "exynos5422") set(VmPCISupport ON CACHE BOOL "" FORCE) set(VmVirtioNet ON CACHE BOOL "" FORCE) set(VmInitRdFile ON CACHE BOOL "" FORCE) -endif() -if(${PLATFORM} STREQUAL "tx2") +elseif(${PLATFORM} STREQUAL "tx1") + # nothing here +elseif(${PLATFORM} STREQUAL "tx2") set(VmPCISupport ON CACHE BOOL "" FORCE) set(VmVirtioNet ON CACHE BOOL "" FORCE) set(VmInitRdFile ON CACHE BOOL "" FORCE) set(VmDtbFile ON CACHE BOOL "" FORCE) -endif() -if(${PLATFORM} STREQUAL "odroidc2") +elseif(${PLATFORM} STREQUAL "odroidc2") set(VmInitRdFile ON CACHE BOOL "" FORCE) set(VmDtbFile ON CACHE BOOL "" FORCE) -endif() -if(${PLATFORM} STREQUAL "qemu-arm-virt") +elseif(${PLATFORM} STREQUAL "qemu-arm-virt") # force cpu set(QEMU_MEMORY "2048") set(KernelArmCPU cortex-a53 CACHE STRING "" FORCE) set(VmInitRdFile ON CACHE BOOL "" FORCE) -endif() -if(${PLATFORM} STREQUAL "zcu102") +elseif(${PLATFORM} STREQUAL "zcu102") set(AARCH64 ON CACHE BOOL "" FORCE) set(KernelAllowSMCCalls ON CACHE BOOL "" FORCE) set(VmZynqmpPetalinuxVersion 2021_1 CACHE STRING "" FORCE) +else() + message(FATAL_ERROR "unsupported PLATFORM: ${PLATFORM}") endif() diff --git a/apps/Arm/vm_multi/CMakeLists.txt b/apps/Arm/vm_multi/CMakeLists.txt index 26456ece..597c12f1 100644 --- a/apps/Arm/vm_multi/CMakeLists.txt +++ b/apps/Arm/vm_multi/CMakeLists.txt @@ -22,6 +22,8 @@ elseif("${PLATFORM}" STREQUAL "qemu-arm-virt") if(SIMULATION) GenerateSimulateScript() endif() +else() + message(FATAL_ERROR "unsupported PLATFORM: ${PLATFORM}") endif() # Generate our overlayed rootfs images diff --git a/apps/Arm/vm_multi/settings.cmake b/apps/Arm/vm_multi/settings.cmake index c3069b02..d06c8623 100644 --- a/apps/Arm/vm_multi/settings.cmake +++ b/apps/Arm/vm_multi/settings.cmake @@ -9,13 +9,17 @@ if(NOT "${PLATFORM}" IN_LIST supported) message(FATAL_ERROR "PLATFORM: ${PLATFORM} not supported. Supported: ${supported}") endif() + set(LibUSB OFF CACHE BOOL "" FORCE) set(VmPCISupport ON CACHE BOOL "" FORCE) set(VmVirtioConsole ON CACHE BOOL "" FORCE) set(VmVirtioNetArping OFF CACHE BOOL "" FORCE) set(VmVirtioNetVirtqueue ON CACHE BOOL "" FORCE) set(VmInitRdFile ON CACHE BOOL "" FORCE) -if("${PLATFORM}" STREQUAL "qemu-arm-virt") + +if("${PLATFORM}" STEQUAL "exynos5422") + # nothing special here +elseif("${PLATFORM}" STREQUAL "qemu-arm-virt") set(QEMU_MEMORY "2048") set(KernelArmCPU cortex-a53 CACHE STRING "" FORCE) set( @@ -24,4 +28,6 @@ if("${PLATFORM}" STREQUAL "qemu-arm-virt") ) set(KernelArmExportPCNTUser ON CACHE BOOL "" FORCE) set(KernelArmExportPTMRUser ON CACHE BOOL "" FORCE) +else() + message(FATAL_ERROR "unsupported PLATFORM: ${PLATFORM}") endif() diff --git a/apps/Arm/vm_virtio_net/CMakeLists.txt b/apps/Arm/vm_virtio_net/CMakeLists.txt index 77fca436..6ea96d77 100644 --- a/apps/Arm/vm_virtio_net/CMakeLists.txt +++ b/apps/Arm/vm_virtio_net/CMakeLists.txt @@ -26,6 +26,9 @@ elseif("${KernelARMPlatform}" STREQUAL "tx2") set(rootfs_address "0xf7000000") set(dtb_file "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux-pci-dtb") set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/rootfs_crossvm.cpio.gz") + +else() + message(FATAL_ERROR "unsupported KernelARMPlatform: ${KernelARMPlatform}") endif() # Generate overlayed rootfs diff --git a/apps/Arm/vm_virtio_net/settings.cmake b/apps/Arm/vm_virtio_net/settings.cmake index 18a00b4d..23fb956b 100644 --- a/apps/Arm/vm_virtio_net/settings.cmake +++ b/apps/Arm/vm_virtio_net/settings.cmake @@ -9,6 +9,7 @@ if(NOT "${PLATFORM}" IN_LIST supported) message(FATAL_ERROR "PLATFORM: ${PLATFORM} not supported. Supported: ${supported}") endif() + set(LibUSB OFF CACHE BOOL "" FORCE) set(VmPCISupport ON CACHE BOOL "" FORCE) if(VIRTIO_NET_PING) @@ -18,3 +19,11 @@ else() endif() set(VmInitRdFile ON CACHE BOOL "" FORCE) set(VmDtbFile ON CACHE BOOL "provide dtb" FORCE) + +if("${PLATFORM}" STREQUAL "exynos5422") + # nothing special here +elseif("${PLATFORM}" STREQUAL "tx2") + # nothing special here +else() + message(FATAL_ERROR "unsupported PLATFORM: ${PLATFORM}") +endif()