diff --git a/repos/base-foc/config/imx7.kernel b/repos/base-foc/config/imx7.kernel new file mode 100644 index 0000000000..b728f2b3af --- /dev/null +++ b/repos/base-foc/config/imx7.kernel @@ -0,0 +1,112 @@ +# +# Automatically generated file; DO NOT EDIT. +# Fiasco configuration +# +CONFIG_HAS_FPU_OPTION=y +CONFIG_HAS_VIRT_OBJ_SPACE_OPTION=y +CONFIG_HAS_SERIAL_OPTION=y +CONFIG_HAS_JDB_GZIP_OPTION=y +CONFIG_HAS_MP_OPTION=y +CONFIG_HAS_CPU_VIRT=y + +# +# Target configuration +# +# CONFIG_IA32 is not set +# CONFIG_AMD64 is not set +CONFIG_ARM=y +# CONFIG_MIPS is not set +# CONFIG_PF_INTEGRATOR is not set +# CONFIG_PF_REALVIEW is not set +# CONFIG_PF_SUNXI is not set +# CONFIG_PF_BCM283X is not set +# CONFIG_PF_SA1100 is not set +# CONFIG_PF_XSCALE is not set +# CONFIG_PF_ARMADA38X is not set +# CONFIG_PF_KIRKWOOD is not set +# CONFIG_PF_TEGRA is not set +# CONFIG_PF_LAYERSCAPE is not set +CONFIG_PF_IMX=y +# CONFIG_PF_ARM_VIRT is not set +# CONFIG_PF_RCAR3 is not set +# CONFIG_PF_EXYNOS is not set +# CONFIG_PF_S3C2410 is not set +# CONFIG_PF_OMAP is not set +# CONFIG_PF_ZYNQ is not set +# CONFIG_PF_ZYNQMP is not set +CONFIG_BSP_NAME="imx" +CONFIG_CAN_ARM_CPU_CORTEX_A7=y +CONFIG_ARM_V7=y +CONFIG_ARM_V6PLUS=y +CONFIG_ARM_V7PLUS=y +# CONFIG_PF_IMX_21 is not set +# CONFIG_PF_IMX_28 is not set +# CONFIG_PF_IMX_35 is not set +# CONFIG_PF_IMX_51 is not set +# CONFIG_PF_IMX_6 is not set +# CONFIG_PF_IMX_6UL is not set +CONFIG_PF_IMX_7=y +CONFIG_PF_IMX_RAM_PHYS_BASE=0x80000000 +CONFIG_ABI_VF=y +CONFIG_ARM_CORTEX_A7=y +# CONFIG_CPU_VIRT is not set +CONFIG_FPU=y +# CONFIG_ARM_ALIGNMENT_CHECK is not set +CONFIG_ARM_EM_STD=y +# CONFIG_ARM_EM_NS is not set +# CONFIG_ARM_EM_TZ is not set +# CONFIG_ARM_SMC_USER is not set +# CONFIG_ARM_ENABLE_SWP is not set +CONFIG_ARM_LPAE=y +CONFIG_HAS_ARM_PSCI=y +# CONFIG_ARM_PSCI is not set +CONFIG_ARM_CPU_ERRATA=y + +# +# Kernel options +# +CONFIG_MP=y +CONFIG_MP_MAX_CPUS=4 +CONFIG_CONTEXT_4K=y +# CONFIG_FINE_GRAINED_CPUTIME is not set +CONFIG_SCHED_FIXED_PRIO=y +CONFIG_VIRT_OBJ_SPACE=y + +# +# Debugging +# +CONFIG_INLINE=y +# CONFIG_NDEBUG is not set +# CONFIG_NO_FRAME_PTR is not set +# CONFIG_STACK_DEPTH is not set +# CONFIG_LIST_ALLOC_SANITY is not set +CONFIG_SERIAL=y +CONFIG_JDB=y +# CONFIG_JDB_LOGGING is not set +CONFIG_JDB_GZIP=y +# CONFIG_JDB_ACCOUNTING is not set +# CONFIG_WARN_NONE is not set +CONFIG_WARN_WARNING=y +# CONFIG_WARN_ANY is not set + +# +# ARM debugging options +# +# CONFIG_VMEM_ALLOC_TEST is not set +# CONFIG_DEBUG_KERNEL_PAGE_FAULTS is not set + +# +# Compiling +# +CONFIG_CC="gcc" +CONFIG_CXX="g++" +CONFIG_HOST_CC="gcc" +CONFIG_HOST_CXX="g++" +# CONFIG_MAINTAINER_MODE is not set +CONFIG_LABEL="" +# CONFIG_EXPERIMENTAL is not set +CONFIG_PERF_CNT=y +CONFIG_BIT32=y +CONFIG_WARN_LEVEL=1 +CONFIG_XARCH="arm" +CONFIG_ABI="vf" diff --git a/repos/base-foc/config/imx7.user b/repos/base-foc/config/imx7.user new file mode 100644 index 0000000000..40211f4677 --- /dev/null +++ b/repos/base-foc/config/imx7.user @@ -0,0 +1,86 @@ +# +# Automatically generated file; DO NOT EDIT. +# L4Re Configuration +# +CONFIG_ARCH_ENABLE_STACK_PROTECTOR=y +# CONFIG_BUILD_ARCH_amd64 is not set +CONFIG_BUILD_ARCH_arm=y +# CONFIG_BUILD_ARCH_arm64 is not set +# CONFIG_BUILD_ARCH_mips is not set +# CONFIG_BUILD_ARCH_ppc32 is not set +# CONFIG_BUILD_ARCH_sparc is not set +# CONFIG_BUILD_ARCH_x86 is not set +CONFIG_BUILD_ARCH="arm" +CONFIG_BUILD_ABI_l4f=y +CONFIG_BUILD_ABI="l4f" +# CONFIG_CPU_ARM_ARMV4 is not set +# CONFIG_CPU_ARM_ARMV4T is not set +# CONFIG_CPU_ARM_ARMV5 is not set +# CONFIG_CPU_ARM_ARMV5T is not set +# CONFIG_CPU_ARM_ARMV5TE is not set +# CONFIG_CPU_ARM_ARMV6 is not set +# CONFIG_CPU_ARM_ARMV6T2 is not set +# CONFIG_CPU_ARM_ARMV6ZK is not set +CONFIG_CPU_ARM_ARMV7A=y +CONFIG_CPU="armv7a" +CONFIG_CPU_ARMV6KPLUS=y +CONFIG_CPU_ARMV6PLUS=y +# CONFIG_PLATFORM_TYPE_exynos4 is not set +# CONFIG_PLATFORM_TYPE_imx35 is not set +# CONFIG_PLATFORM_TYPE_zedboard is not set +# CONFIG_PLATFORM_TYPE_beagleboard is not set +# CONFIG_PLATFORM_TYPE_rv_pbx is not set +# CONFIG_PLATFORM_TYPE_exynos5 is not set +# CONFIG_PLATFORM_TYPE_kirkwood is not set +# CONFIG_PLATFORM_TYPE_ls1012afrdm is not set +# CONFIG_PLATFORM_TYPE_pandaboard is not set +# CONFIG_PLATFORM_TYPE_arm_virt is not set +# CONFIG_PLATFORM_TYPE_tegra2 is not set +# CONFIG_PLATFORM_TYPE_rv is not set +# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set +# CONFIG_PLATFORM_TYPE_cubieboard2 is not set +# CONFIG_PLATFORM_TYPE_omap3_am33xx is not set +# CONFIG_PLATFORM_TYPE_parallella is not set +# CONFIG_PLATFORM_TYPE_rpi_b is not set +# CONFIG_PLATFORM_TYPE_imx21 is not set +# CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_ls1021atwr is not set +# CONFIG_PLATFORM_TYPE_tegra3 is not set +CONFIG_PLATFORM_TYPE_imx7=y +# CONFIG_PLATFORM_TYPE_imx28 is not set +# CONFIG_PLATFORM_TYPE_omap3evm is not set +# CONFIG_PLATFORM_TYPE_rcar3_m3 is not set +# CONFIG_PLATFORM_TYPE_zynqmp is not set +# CONFIG_PLATFORM_TYPE_imx6 is not set +# CONFIG_PLATFORM_TYPE_imx6ul is not set +# CONFIG_PLATFORM_TYPE_armada38x is not set +# CONFIG_PLATFORM_TYPE_omap5 is not set +# CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_rpi_a is not set +# CONFIG_PLATFORM_TYPE_integrator is not set +# CONFIG_PLATFORM_TYPE_custom is not set +CONFIG_PLATFORM_TYPE="imx7" +# CONFIG_USE_DROPS_STDDIR is not set +# CONFIG_USE_DICE is not set +CONFIG_DROPS_STDDIR="/path/to/l4re" +CONFIG_DROPS_INSTDIR="/path/to/l4re" +CONFIG_BID_COLORED_PHASES=y + +# +# Building +# +CONFIG_YACC="yacc" +CONFIG_LEX="flex" +CONFIG_CTAGS="ctags" +CONFIG_ETAGS="etags" +CONFIG_HAVE_LDSO=y +CONFIG_INT_CPP_NAME_SWITCH=y +CONFIG_INT_LD_NAME_SWITCH=y +# CONFIG_BID_STRIP_PROGS is not set +# CONFIG_BID_GCC_OMIT_FP is not set +CONFIG_BID_GCC_ENABLE_STACK_PROTECTOR=y +# CONFIG_BID_GCC_STACK_PROTECTOR_ALL is not set +CONFIG_BID_GCC_STACK_PROTECTOR=y +# CONFIG_BID_BUILD_DOC is not set +# CONFIG_RELEASE_MODE is not set +CONFIG_MAKECONFS_ADD="" diff --git a/repos/base-foc/lib/mk/spec/imx7d_sabre/kernel-foc.mk b/repos/base-foc/lib/mk/spec/imx7d_sabre/kernel-foc.mk new file mode 100644 index 0000000000..ffc60aa5d7 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/imx7d_sabre/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/imx7.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/imx7d_sabre/syscall-foc.mk b/repos/base-foc/lib/mk/spec/imx7d_sabre/syscall-foc.mk new file mode 100644 index 0000000000..888c45d6bb --- /dev/null +++ b/repos/base-foc/lib/mk/spec/imx7d_sabre/syscall-foc.mk @@ -0,0 +1,5 @@ +L4_CONFIG := $(call select_from_repositories,config/imx7.user) + +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv7a + +include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-sel4/lib/mk/spec/imx7d_sabre/core-sel4.mk b/repos/base-sel4/lib/mk/spec/imx7d_sabre/core-sel4.mk new file mode 100644 index 0000000000..b3d1440873 --- /dev/null +++ b/repos/base-sel4/lib/mk/spec/imx7d_sabre/core-sel4.mk @@ -0,0 +1,13 @@ +GEN_SRC_CC = platform_services.cc + +REP_SRC_CC = \ + spec/arm/boot_info.cc \ + spec/arm/irq.cc \ + spec/arm/platform.cc \ + spec/arm/platform_thread.cc \ + spec/arm/thread.cc \ + spec/arm/vm_space.cc + +INC_DIR += $(REP_DIR)/src/core/spec/arm + +include $(REP_DIR)/lib/mk/core-sel4.inc diff --git a/repos/base-sel4/lib/mk/spec/imx7d_sabre/kernel-sel4.mk b/repos/base-sel4/lib/mk/spec/imx7d_sabre/kernel-sel4.mk new file mode 100644 index 0000000000..47a30506c3 --- /dev/null +++ b/repos/base-sel4/lib/mk/spec/imx7d_sabre/kernel-sel4.mk @@ -0,0 +1,5 @@ +PLAT := imx7 +CPU := cortex-a7 +BOARD := imx7d_sabre + +-include $(REP_DIR)/lib/mk/spec/arm/kernel-sel4.inc diff --git a/repos/base-sel4/lib/mk/spec/imx7d_sabre/syscall-sel4.mk b/repos/base-sel4/lib/mk/spec/imx7d_sabre/syscall-sel4.mk new file mode 100644 index 0000000000..675bd0d742 --- /dev/null +++ b/repos/base-sel4/lib/mk/spec/imx7d_sabre/syscall-sel4.mk @@ -0,0 +1,8 @@ +PLAT := imx7 +ARCH := arm + +SEL4_ARCH := aarch32 +PLAT_BOARD := /imx7d_sabre +SEL4_WORDBITS := 32 + +include $(REP_DIR)/lib/mk/syscall-sel4.inc diff --git a/repos/base-sel4/patches/imx7d_sabre.config b/repos/base-sel4/patches/imx7d_sabre.config new file mode 100644 index 0000000000..574e8f40fb --- /dev/null +++ b/repos/base-sel4/patches/imx7d_sabre.config @@ -0,0 +1,27 @@ +--- src/kernel/sel4/configs/imx7/imx7d_sabre/autoconf.h ++++ src/kernel/sel4/configs/imx7/imx7d_sabre/autoconf.h +@@ -38,6 +38,7 @@ + #define CONFIG_LIBSEL4DEBUG_FUNCTION_INSTRUMENTATION_NONE 1 + #define CONFIG_LIB_SEL4_UTILS 1 + #define CONFIG_LIB_SEL4_VSPACE 1 ++#define CONFIG_PRINTING 1 + #define CONFIG_LIB_PLATSUPPORT 1 + #define CONFIG_LIB_SEL4_ALLOCMAN 1 + #define CONFIG_HAVE_LIB_SEL4_SIMPLE_DEFAULT 1 +@@ -75,7 +76,7 @@ + #define CONFIG_USER_OPTIMISATION_O2 1 + #define CONFIG_LIB_CPIO 1 + #define CONFIG_RETYPE_FAN_OUT_LIMIT 256 +-#define CONFIG_ROOT_CNODE_SIZE_BITS 12 ++#define CONFIG_ROOT_CNODE_SIZE_BITS 15 + #define CONFIG_NUM_PRIORITIES 256 + #define CONFIG_TESTPRINTER_REGEX ".*" + #define CONFIG_APP_SEL4TEST 1 +@@ -89,3 +90,7 @@ + #define CONFIG_BUILDSYS_USE_CCACHE 1 + #define CONFIG_MAX_NUM_NODES 1 + #define CONFIG_KERNEL_STACK_BITS 12 ++#define CONFIG_ARCH_AARCH32 1 ++#define CONFIG_IPC_BUF_TPIDRURW 1 ++#define CONFIG_HAVE_FPU 1 ++#define CONFIG_FPU_MAX_RESTORES_SINCE_SWITCH 64 diff --git a/repos/base-sel4/ports/sel4.hash b/repos/base-sel4/ports/sel4.hash index 1cdfc81aab..eb7301c49d 100644 --- a/repos/base-sel4/ports/sel4.hash +++ b/repos/base-sel4/ports/sel4.hash @@ -1 +1 @@ -e9a08b9de9e3aceb19804af4473b65f9a1ee0280 +876d7aaf232c1b7dd548dd2b18474bb91f19ac23 diff --git a/repos/base-sel4/ports/sel4.port b/repos/base-sel4/ports/sel4.port index 4cbd8d2dfd..5e969b66eb 100644 --- a/repos/base-sel4/ports/sel4.port +++ b/repos/base-sel4/ports/sel4.port @@ -16,6 +16,7 @@ $(call check_python_module,six) PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch)) HASH_INPUT += $(REP_DIR)/patches/imx6q_sabrelite.config +HASH_INPUT += $(REP_DIR)/patches/imx7d_sabre.config # adjust kernel config usable on qemu and on native hw, and add a 32bit version default: $(DOWNLOADS) @@ -27,3 +28,6 @@ default: $(DOWNLOADS) $(VERBOSE)mkdir -p src/kernel/sel4/configs/imx6/imx6q_sabrelite $(VERBOSE)mv src/kernel/sel4/configs/imx6/autoconf.h src/kernel/sel4/configs/imx6/imx6q_sabrelite/autoconf.h $(VERBOSE)patch -p0 <$(REP_DIR)/patches/imx6q_sabrelite.config + $(VERBOSE)mkdir -p src/kernel/sel4/configs/imx7/imx7d_sabre + $(VERBOSE)mv src/kernel/sel4/configs/imx7/autoconf.h src/kernel/sel4/configs/imx7/imx7d_sabre/autoconf.h + $(VERBOSE)patch -p0 <$(REP_DIR)/patches/imx7d_sabre.config diff --git a/repos/base/mk/spec/imx7d_sabre.mk b/repos/base/mk/spec/imx7d_sabre.mk new file mode 100644 index 0000000000..0813ec30d1 --- /dev/null +++ b/repos/base/mk/spec/imx7d_sabre.mk @@ -0,0 +1,3 @@ +SPECS += arm_v7a + +include $(BASE_DIR)/mk/spec/arm_v7a.mk diff --git a/tool/builddir/build.conf/run_kernel_imx6q_sabrelite b/tool/builddir/build.conf/run_kernel_hw_foc_sel4 similarity index 100% rename from tool/builddir/build.conf/run_kernel_imx6q_sabrelite rename to tool/builddir/build.conf/run_kernel_hw_foc_sel4 diff --git a/tool/create_builddir b/tool/create_builddir index 11f1becef3..44ad16ecb3 100755 --- a/tool/create_builddir +++ b/tool/create_builddir @@ -12,7 +12,7 @@ PLATFORM = $(MAKECMDGOALS) PLATFORMS = x86_32 x86_64 panda pbxa9 rpi arndale imx53_qsb imx53_qsb_tz \ usb_armory wand_quad odroid_xu odroid_x2 zynq_qemu muen \ - imx6q_sabrelite riscv_spike linux nit6_solox + imx6q_sabrelite imx7d_sabre riscv_spike linux nit6_solox PLATFORMS_DEPR = linux_x86 linux_arm fiasco_x86 okl4_x86 pistachio_x86 \ nova_x86_32 nova_x86_64 hw_x86_64 foc_x86_32 foc_x86_64 \ @@ -143,7 +143,8 @@ BUILD_CONF(imx53_qsb) := run_kernel_hw run_boot_dir repos BUILD_CONF(imx53_qsb_tz) := run_kernel_hw run_boot_dir repos BUILD_CONF(usb_armory) := run_kernel_hw run_boot_dir repos BUILD_CONF(wand_quad) := run_kernel_wand_quad run_boot_dir repos -BUILD_CONF(imx6q_sabrelite) := run_kernel_imx6q_sabrelite run_boot_dir repos +BUILD_CONF(imx6q_sabrelite) := run_kernel_hw_foc_sel4 run_boot_dir repos +BUILD_CONF(imx7d_sabre) := run_kernel_hw_foc_sel4 run_boot_dir repos BUILD_CONF(odroid_xu) := run_kernel_hw run_boot_dir repos BUILD_CONF(odroid_x2) := run_kernel_foc run_boot_dir repos BUILD_CONF(zynq_qemu) := run_kernel_hw run_qemu run_opt_hw run_boot_dir qemu_opt_arm repos @@ -229,6 +230,7 @@ SPECS(imx53_qsb_tz) := imx53_qsb trustzone SPECS(usb_armory) := usb_armory trustzone SPECS(wand_quad) := wand_quad SPECS(imx6q_sabrelite) := imx6q_sabrelite +SPECS(imx7d_sabre) := imx7d_sabre SPECS(odroid_xu) := odroid_xu SPECS(odroid_x2) := odroid_x2 SPECS(zynq_qemu) := zynq_qemu diff --git a/tool/run/boot_dir/foc b/tool/run/boot_dir/foc index 68ae3a2561..7adcb0157f 100644 --- a/tool/run/boot_dir/foc +++ b/tool/run/boot_dir/foc @@ -17,6 +17,7 @@ proc core_link_address { } { if {[have_spec odroid_x2]} { return "0x80100000" } if {[have_spec imx53 ]} { return "0x70140000" } if {[have_spec imx6q_sabrelite ]} { return "0x14000000" } + if {[have_spec imx7d_sabre ]} { return "0x80140000" } puts stderr "Error: platform not supported, core link address unknown" exit 1 diff --git a/tool/run/boot_dir/sel4 b/tool/run/boot_dir/sel4 index 73440aa99b..4795127acb 100644 --- a/tool/run/boot_dir/sel4 +++ b/tool/run/boot_dir/sel4 @@ -92,7 +92,11 @@ proc run_boot_dir {binaries} { # Use seL4 elfloader tool to generate bootable image on ARM # if {[have_spec arm]} { - if {![have_spec imx6]} { + if {[have_spec imx6]} { + set ::env(PLAT) imx6 + } elseif {[have_spec imx7d_sabre]} { + set ::env(PLAT) imx7 + } else { puts "abort - unknown ARM board" exit 1 } @@ -103,7 +107,6 @@ proc run_boot_dir {binaries} { # call seL4 elfloader tool to generate image.elf bootable by uboot with 'bootelf' command set ::env(COMMON_PATH) [sel4_elfloader_dir] set ::env(CPPFLAGS) -I[sel4_elfloader_dir]/include - set ::env(PLAT) imx6 set ::env(TOOLPREFIX) [cross_dev_prefix] exec [sel4_elfloader_dir]/gen_boot_image.sh [pwd]/[run_dir]/boot/kernel.elf [pwd]/[run_dir]/boot/genode.elf [pwd]/[run_dir]/boot/image.elf }