From 307908347e644a86408195a5c972afcffd0c13eb Mon Sep 17 00:00:00 2001 From: Indan Zupancic Date: Tue, 26 Oct 2021 12:21:23 +0200 Subject: [PATCH] Custom DTS overlay file support Add KernelCustomDTSOverlay option to append user provided DTS overlay files. This way users do not need to modify the seL4 kernel sources just because they use a hardware module differently. Also useful for defining VM memory regions. Signed-off-by: Indan Zupancic --- config.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config.cmake b/config.cmake index bb6e25e04..7ee3348a7 100644 --- a/config.cmake +++ b/config.cmake @@ -108,6 +108,18 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL "")) ) set(config_file "${CMAKE_CURRENT_SOURCE_DIR}/tools/hardware.yml") set(config_schema "${CMAKE_CURRENT_SOURCE_DIR}/tools/hardware_schema.yml") + set( + KernelCustomDTSOverlay "" + CACHE FILEPATH "Provide an additional overlay to append to the selected KernelPlatform's \ + device tree during build time" + ) + if(NOT "${KernelCustomDTSOverlay}" STREQUAL "") + if(NOT EXISTS ${KernelCustomDTSOverlay}) + message(FATAL_ERROR "Can't open external overlay file '${KernelCustomDTSOverlay}'!") + endif() + list(APPEND KernelDTSList "${KernelCustomDTSOverlay}") + message(STATUS "Using ${KernelCustomDTSOverlay} overlay") + endif() find_program(DTC_TOOL dtc) if("${DTC_TOOL}" STREQUAL "DTC_TOOL-NOTFOUND")