diff --git a/apps/sel4test-driver/CMakeLists.txt b/apps/sel4test-driver/CMakeLists.txt index 9288fd556..bb4a6a1ae 100644 --- a/apps/sel4test-driver/CMakeLists.txt +++ b/apps/sel4test-driver/CMakeLists.txt @@ -10,24 +10,6 @@ project(sel4test-driver C) set(configure_string "") -config_option(Sel4testHaveTimer HAVE_TIMER "Enable tests that require a timer driver" DEFAULT ON) - -config_option(Sel4testSimulation SIMULATION "Disable tests not suitable for simulation" DEFAULT OFF) - -config_option( - Sel4testHaveCache - HAVE_CACHE - "Enable tests that require a functioning cache" - DEFAULT - ON -) -if(Sel4testAllowSettingsOverride) - mark_as_advanced(CLEAR Sel4testHaveTimer Sel4testHaveCache) -else() - mark_as_advanced(FORCE Sel4testHaveTimer Sel4testHaveCache) -endif() -add_config_library(sel4test-driver "${configure_string}") - find_package(musllibc REQUIRED) find_package(util_libs REQUIRED) find_package(seL4_libs REQUIRED) @@ -48,6 +30,42 @@ set(LibNanopb ON CACHE BOOL "" FORCE) sel4_projects_libs_import_libraries() add_subdirectory(../../libsel4testsupport libsel4testsupport) +if( + # Platform does not support timers + (NOT LibPlatSupportHaveTimer) + # Frequency settings of the ZynqMP make the ltimer tests problematic + OR + KernelPlatformZynqmp + # Polarfire does not have a complete ltimer implementation + OR + KernelPlatformPolarfire + # Quartz64 does not have a complete ltimer implementation + OR KernelPlatformQuartz64 +) + set(Sel4testHaveTimer OFF CACHE BOOL "" FORCE) +else() + set(Sel4testHaveTimer ON CACHE BOOL "" FORCE) +endif() + +config_option(Sel4testHaveTimer HAVE_TIMER "Enable tests that require a timer driver" DEFAULT ON) + +config_option(Sel4testSimulation SIMULATION "Disable tests not suitable for simulation" DEFAULT OFF) + +config_option( + Sel4testHaveCache + HAVE_CACHE + "Enable tests that require a functioning cache" + DEFAULT + ON +) +if(Sel4testAllowSettingsOverride) + mark_as_advanced(CLEAR Sel4testHaveTimer Sel4testHaveCache) +else() + mark_as_advanced(FORCE Sel4testHaveTimer Sel4testHaveCache) +endif() + +add_config_library(sel4test-driver "${configure_string}") + file( GLOB static diff --git a/settings.cmake b/settings.cmake index 1a36f29e9..461d46d8a 100644 --- a/settings.cmake +++ b/settings.cmake @@ -77,30 +77,6 @@ if(NOT Sel4testAllowSettingsOverride) set(Sel4testHaveCache ON CACHE BOOL "" FORCE) endif() - if(KernelPlatformQEMUArmVirt) - if(KernelArmExportPCNTUser AND KernelArmExportPTMRUser) - set(Sel4testHaveTimer ON CACHE BOOL "" FORCE) - else() - set(Sel4testHaveTimer OFF CACHE BOOL "" FORCE) - endif() - elseif( - KernelPlatformZynqmp - OR KernelPlatformPolarfire - OR KernelPlatformQuartz64 - OR KernelPlatformRocketchip - OR KernelPlatformRocketchipZCU102 - OR KernelPlatformCheshire - OR (SIMULATION AND (KernelArchRiscV OR KernelArchARM)) - ) - # Frequency settings of the ZynqMP make the ltimer tests problematic - # Polarfire does not have a complete ltimer implementation - # Quartz64 does not have a complete ltimer implementation - # Rocket Chip on the ZCU102 FPGA does not have a timer peripheral - set(Sel4testHaveTimer OFF CACHE BOOL "" FORCE) - else() - set(Sel4testHaveTimer ON CACHE BOOL "" FORCE) - endif() - # Check the hardware debug API non simulated (except for ia32, which can be simulated), # or platforms that don't support it. if(((NOT SIMULATION) OR KernelSel4ArchIA32) AND NOT KernelHardwareDebugAPIUnsupported)