Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rpi3 support to tutorials #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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}"
Expand Down
12 changes: 12 additions & 0 deletions settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down