From 2e9000fb4a6364bb67a72026b4f3554eace39197 Mon Sep 17 00:00:00 2001 From: Mete Balci Date: Fri, 8 Mar 2019 10:13:59 +0100 Subject: [PATCH] Add rpi3 support to tutorials Made changes to init scripts to support rpi3, based on the rpi3 blog post: https://docs.sel4.systems/Hardware/Rpi3.html --- common.py | 3 +++ settings.cmake | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/common.py b/common.py index eed9b1ca..73a3b81a 100644 --- a/common.py +++ b/common.py @@ -20,6 +20,7 @@ PLAT_CONFIG = { 'pc99': ['-DTUT_BOARD=pc', '-DTUT_ARCH=x86_64'], 'zynq7000': ['-DAARCH32=TRUE', '-DTUT_BOARD=zynq7000'], + 'rpi3': ['-DAARCH32=TRUE', '-DTUT_BOARD=rpi3'], } CAMKES_VM_CONFIG = { @@ -81,6 +82,8 @@ def _init_tute_directory(config, tut, solution, task, directory, output=None): arch = "x86_64" elif config == "zynq7000": arch = "aarch32" + elif config == "rpi3": + arch = "aarch32" with open(os.path.join(directory, ".tute_config"), 'w') as file: file.write("set(TUTE_COMMAND \"%s\")" % ';'.join(["PYTHONPATH=${PYTHON_CAPDL_PATH}" diff --git a/settings.cmake b/settings.cmake index b1828d01..ad809b2e 100644 --- a/settings.cmake +++ b/settings.cmake @@ -37,6 +37,18 @@ elseif(${TUT_BOARD} STREQUAL "zynq7000") set(KernelArmSel4Arch "aarch32" CACHE STRING "" FORCE) set(KernelARMPlatform "zynq7000" CACHE STRING "" FORCE) ApplyData61ElfLoaderSettings(${KernelARMPlatform} ${KernelArmSel4Arch}) +elseif(${TUT_BOARD} STREQUAL "rpi3") + # Do a quick check and warn the user if they haven't set + # -DARM/-DAARCH32/-DAARCH64. + if ((NOT ARM) AND (NOT AARCH32) + AND ((NOT CROSS_COMPILER_PREFIX) OR ("${CROSS_COMPILER_PREFIX}" STREQUAL ""))) + message(WARNING "The target machine is an ARM machine. Unless you've defined -DCROSS_COMPILER_PREFIX, you may need to set one of:\n\t-DARM/-DAARCH32/-DAARCH64") + endif() + + set(KernelArch "arm" CACHE STRING "" FORCE) + set(KernelArmSel4Arch "aarch32" CACHE STRING "" FORCE) + set(KernelARMPlatform "rpi3" CACHE STRING "" FORCE) + ApplyData61ElfLoaderSettings(${KernelARMPlatform} ${KernelArmSel4Arch}) else() message(FATAL_ERROR "Unsupported board ${TUT_BOARD}.") endif()