-
Notifications
You must be signed in to change notification settings - Fork 16
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 support for Xenomai on Toradex SoMs #239
base: scarthgap-7.x.y
Are you sure you want to change the base?
Changes from all commits
5e43e13
5e1c8fb
6e40c1a
53cfd7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# Xenomai config | ||
|
||
XENOMAI_KERNEL_ARGS = "audit=0 clocksource=arch_sys_counter nohz_full=1,3 \ | ||
irqaffinity=0 isolcpus=1,3 rcu_nocbs=1,3 rcu_nocb_poll=1024 \ | ||
nosoftlockup numa_balancing=disable hugepages=1024 " | ||
OSTREE_KERNEL_ARGS:sota:append:xenomai4 = " ${XENOMAI_KERNEL_ARGS} " | ||
OSTREE_KERNEL_ARGS:sota:append:xenomai3 = " ${XENOMAI_KERNEL_ARGS} " | ||
|
||
PREFERRED_PROVIDER_virtual/kernel:xenomai4 = "linux-xenomai-4" | ||
PREFERRED_PROVIDER_virtual/kernel:xenomai4:upstream = "linux-xenomai-4" | ||
PREFERRED_PROVIDER_virtual/dtb:xenomai4:upstream = "device-tree-overlays-mainline" | ||
LINUX_VERSION_EXTENSION:xenomai4:upstream ?= "-torizon-${LINUX_KERNEL_TYPE}-xenomai4" | ||
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you clarify why you need both However, using one or the other might make more sense: in this stretch of code I'd imagine something like this:
The xenomai specific assignments use |
||
|
||
PREFERRED_PROVIDER_virtual/kernel:xenomai3 = "linux-xenomai-3" | ||
PREFERRED_PROVIDER_virtual/kernel:xenomai3:upstream = "linux-xenomai-3" | ||
PREFERRED_PROVIDER_virtual/dtb:xenomai3:upstream = "device-tree-overlays-mainline" | ||
LINUX_VERSION_EXTENSION:xenomai3:upstream ?= "-torizon-${LINUX_KERNEL_TYPE}-xenomai3" | ||
|
||
# This is required to build the upstream device trees | ||
IMX_DEFAULT_BSP:xenomai4:upstream = "mainline" | ||
IMX_DEFAULT_BSP:xenomai3:upstream = "mainline" |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This distro is building upstream kernel for all devices, or is only for the devices we use upstream kernel? I understand it's the first, right? Since Couldn't we just name these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For intel-corei7-64, the upstream override does not apply. This is why I had to do this:
For Toradex machines, I'm explicitly using the upstream kernel recipe as base:
In the end, I could try to actually not use the
These Xenomai kernels aren't technically upstream because they are a fork of the upstream + the Xenomai patches applied:
But, from our perspective, what we call downstream are the SoC vendor BSPs, at least so far. And these Xenomai are not based on the SoC vendor BSPs. They are "just" some patches on top of upstream kernel. We have PREEMPT_RT variants of the upstream kernel, which looks more similar to this Xenoami case than a downstream. And we still called those I mean, whatever you guys decide, I'm in. I don't have a strong preference. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p.s. would the question apply the other way around? I mean, for x86 the Xenomai recipe is using the "upstream" kernel plus the patches, instead of the linux-intel which uses github.com/intel/linux-intel-lts I don't know if we can consider this kernel Intel's downstream, or just a fork of the upstream. But if we consider it Intel's downstream, I think that for the sake of alignment, then we should have:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd try to keep the naming pattern at least for distros targeting our SoMs; so I'd go with For common-torizon I don't have any preference. If we don't foresee the possibility of providing both downstream and upstream distros or if the meaning of these terms is too blurry I wouldn't necessarily use those words in the distro file name. Thus even the current |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require conf/distro/torizon.conf | ||
require conf/distro/include/xenomai.inc | ||
|
||
DISTRO = "torizon-upstream-xenomai3" | ||
DISTRO_NAME = "Torizon OS Upstream with Xenomai 3" | ||
|
||
DISTRO_FLAVOUR = " (UPSTREAM XENOMAI3)" | ||
DISTRO_FLAVOUR:experimental = " (UPSTREAM XENOMAI3 EXPERIMENTAL)" | ||
|
||
DISTROOVERRIDES .= ":xenomai3:upstream" | ||
|
||
IMAGE_BASENAME_SUFFIX = "-xenomai3" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require conf/distro/torizon.conf | ||
require conf/distro/include/xenomai.inc | ||
|
||
DISTRO = "torizon-upstream-xenomai4" | ||
DISTRO_NAME = "Torizon OS Upstream with Xenomai 4" | ||
|
||
DISTRO_FLAVOUR = " (UPSTREAM XENOMAI4)" | ||
DISTRO_FLAVOUR:experimental = " (UPSTREAM XENOMAI4 EXPERIMENTAL)" | ||
|
||
DISTROOVERRIDES .= ":xenomai4:upstream" | ||
|
||
IMAGE_BASENAME_SUFFIX = "-xenomai4" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
LINUX_VERSION_EXTENSION:prepend = "-intel-pk" | ||
|
||
COMPATIBLE_MACHINE ?= "(intel-corei7-64|intel-core2-32)" | ||
|
||
KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}" | ||
KERNEL_FEATURES:append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}" | ||
|
||
KCONFIG_REPO:intel-corei7-64 = "git://git.yoctoproject.org/yocto-kernel-cache" | ||
|
||
# Add patches from | ||
# https://github.com/YoeDistro/meta-intel/blob/scarthgap/recipes-kernel/linux/linux-intel.inc | ||
TDX_PATCHES:append = " \ | ||
file://fix-perf-reproducibility.patch \ | ||
file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch \ | ||
file://0002-mconf-fix-output-of-cflags-and-libraries.patch \ | ||
" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# | ||
# IRQ subsystem | ||
# | ||
CONFIG_IRQ_PIPELINE=y | ||
|
||
# | ||
# Timers subsystem | ||
# | ||
CONFIG_CONTEXT_TRACKING=y | ||
# CONFIG_CONTEXT_TRACKING_FORCE is not set | ||
CONFIG_NO_HZ_COMMON=y | ||
# CONFIG_HZ_PERIODIC is not set | ||
CONFIG_NO_HZ_IDLE=y | ||
CONFIG_NO_HZ=n | ||
CONFIG_HIGH_RES_TIMERS=y | ||
|
||
# | ||
# CPU/Task time and stats accounting | ||
# | ||
CONFIG_VIRT_CPU_ACCOUNTING=y | ||
# CONFIG_TICK_CPU_ACCOUNTING is not set | ||
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y | ||
|
||
# | ||
# RCU Subsystem | ||
# | ||
CONFIG_RCU_EXPERT=y | ||
CONFIG_RCU_FANOUT=64 | ||
CONFIG_RCU_FANOUT_LEAF=16 | ||
# CONFIG_RCU_FAST_NO_HZ is not set | ||
# CONFIG_RCU_BOOST is not set | ||
CONFIG_RCU_NOCB_CPU=y | ||
# CONFIG_TASKS_TRACE_RCU_READ_MB is not set | ||
|
||
# | ||
# Processor type and features | ||
# | ||
CONFIG_SCHED_MC=y | ||
CONFIG_SCHED_MC_PRIO=n | ||
CONFIG_MCORE2=y | ||
|
||
CONFIG_DOVETAIL=y | ||
CONFIG_DOVETAIL_LEGACY_SYSCALL_RANGE=y | ||
|
||
# | ||
# Memory Management options | ||
# | ||
CONFIG_COMPACTION=n | ||
CONFIG_MIGRATION=n | ||
CONFIG_TRANSPARENT_HUGEPAGE=n | ||
|
||
CONFIG_HZ_250=y | ||
CONFIG_HZ=250 | ||
|
||
# | ||
# Power management and ACPI options | ||
# | ||
CONFIG_SUSPEND=n | ||
CONFIG_PM=n | ||
CONFIG_ACPI_PROCESSOR=n | ||
|
||
# | ||
# CPU Frequency scaling | ||
# | ||
CONFIG_CPU_FREQ=n | ||
CONFIG_CPU_FREQ_STAT=n | ||
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y | ||
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=n | ||
CONFIG_CPU_FREQ_GOV_ONDEMAND=n | ||
|
||
CONFIG_DEBUG_IRQ_PIPELINE=y | ||
# CONFIG_IRQ_PIPELINE_TORTURE_TEST is not set | ||
CONFIG_DEBUG_DOVETAIL=y | ||
CONFIG_RAW_PRINTK=y | ||
|
||
# | ||
# CPU Idle | ||
# | ||
CONFIG_CPU_IDLE=n | ||
CONFIG_INTEL_IDLE=n | ||
# end of CPU Idle |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# | ||
# General architecture-dependent options | ||
# | ||
CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM=y | ||
# end of General architecture-dependent options | ||
|
||
CONFIG_XENOMAI=y | ||
CONFIG_XENO_ARCH_FPU=y | ||
CONFIG_XENO_ARCH_SYS3264=y | ||
|
||
# | ||
# Core features | ||
# | ||
# CONFIG_XENO_OPT_SCHED_CLASSES is not set | ||
CONFIG_XENO_OPT_STATS=y | ||
CONFIG_XENO_OPT_SHIRQ=y | ||
CONFIG_XENO_OPT_RR_QUANTUM=1000 | ||
CONFIG_XENO_OPT_AUTOTUNE=y | ||
# CONFIG_XENO_OPT_SCALABLE_SCHED is not set | ||
# CONFIG_XENO_OPT_TIMER_LIST is not set | ||
CONFIG_XENO_OPT_TIMER_RBTREE=y | ||
CONFIG_XENO_OPT_VFILE=y | ||
# end of Core features | ||
|
||
# | ||
# Sizes and static limits | ||
# | ||
CONFIG_XENO_OPT_REGISTRY_NRSLOTS=4096 | ||
CONFIG_XENO_OPT_SYS_HEAPSZ=4096 | ||
CONFIG_XENO_OPT_PRIVATE_HEAPSZ=256 | ||
CONFIG_XENO_OPT_SHARED_HEAPSZ=256 | ||
CONFIG_XENO_OPT_NRTIMERS=512 | ||
# end of Sizes and static limits | ||
|
||
# | ||
# Latency settings | ||
# | ||
CONFIG_XENO_OPT_TIMING_SCHEDLAT=0 | ||
CONFIG_XENO_OPT_TIMING_KSCHEDLAT=0 | ||
CONFIG_XENO_OPT_TIMING_IRQLAT=0 | ||
# end of Latency settings | ||
|
||
CONFIG_XENO_OPT_DEBUG=y | ||
CONFIG_XENO_OPT_DEBUG_COBALT=y | ||
CONFIG_XENO_OPT_DEBUG_MEMORY=y | ||
CONFIG_XENO_OPT_DEBUG_CONTEXT=y | ||
CONFIG_XENO_OPT_DEBUG_LOCKING=y | ||
CONFIG_XENO_OPT_DEBUG_USER=y | ||
CONFIG_XENO_OPT_DEBUG_MUTEX_RELAXED=y | ||
CONFIG_XENO_OPT_DEBUG_MUTEX_SLEEP=y | ||
CONFIG_XENO_OPT_DEBUG_LEGACY=y | ||
# CONFIG_XENO_OPT_DEBUG_TRACE_RELAX is not set | ||
CONFIG_XENO_OPT_WATCHDOG=y | ||
CONFIG_XENO_OPT_WATCHDOG_TIMEOUT=4 | ||
|
||
# | ||
# Drivers | ||
# | ||
CONFIG_XENO_OPT_RTDM_COMPAT_DEVNODE=y | ||
CONFIG_XENO_DRIVERS_AUTOTUNE=y | ||
|
||
# | ||
# Serial drivers | ||
# | ||
# CONFIG_XENO_DRIVERS_16550A is not set | ||
# end of Serial drivers | ||
|
||
# | ||
# Testing drivers | ||
# | ||
CONFIG_XENO_DRIVERS_TIMERBENCH=y | ||
CONFIG_XENO_DRIVERS_SWITCHTEST=y | ||
CONFIG_XENO_DRIVERS_HEAPCHECK=y | ||
CONFIG_XENO_DRIVERS_RTDMTEST=m | ||
# end of Testing drivers | ||
|
||
# | ||
# CAN drivers | ||
# | ||
# CONFIG_XENO_DRIVERS_CAN is not set | ||
# end of CAN drivers | ||
|
||
# | ||
# RTnet | ||
# | ||
# CONFIG_XENO_DRIVERS_NET is not set | ||
# end of RTnet | ||
|
||
# | ||
# ANALOGY drivers | ||
# | ||
# CONFIG_XENO_DRIVERS_ANALOGY is not set | ||
# end of ANALOGY drivers | ||
|
||
# | ||
# Real-time IPC drivers | ||
# | ||
# CONFIG_XENO_DRIVERS_RTIPC is not set | ||
# end of Real-time IPC drivers | ||
|
||
# | ||
# UDD support | ||
# | ||
# CONFIG_XENO_DRIVERS_UDD is not set | ||
# end of UDD support | ||
|
||
# | ||
# Real-time GPIO drivers | ||
# | ||
# CONFIG_XENO_DRIVERS_GPIO is not set | ||
# end of Real-time GPIO drivers | ||
|
||
# | ||
# GPIOPWM support | ||
# | ||
# CONFIG_XENO_DRIVERS_GPIOPWM is not set | ||
# end of GPIOPWM support | ||
|
||
# | ||
# Real-time SPI master drivers | ||
# | ||
# end of Real-time SPI master drivers | ||
# end of Drivers | ||
|
||
CONFIG_XENO_VERSION_MAJOR=3 | ||
CONFIG_XENO_VERSION_MINOR=2 | ||
CONFIG_XENO_REVISION_LEVEL=4 | ||
CONFIG_XENO_VERSION_STRING="3.2.4" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Processor type and features | ||
# | ||
CONFIG_EVL=y | ||
CONFIG_EVL_SCHED_QUOTA=y | ||
CONFIG_EVL_SCHED_TP=y | ||
CONFIG_EVL_SCHED_TP_NR_PART=4 | ||
# CONFIG_EVL_HIGH_PERCPU_CONCURRENCY is not set | ||
CONFIG_EVL_RUNSTATS=y | ||
# CONFIG_EVL_NET is not set | ||
|
||
# | ||
# Fixed sizes and limits | ||
# | ||
CONFIG_EVL_COREMEM_SIZE=2048 | ||
CONFIG_EVL_NR_THREADS=256 | ||
CONFIG_EVL_NR_MONITORS=512 | ||
CONFIG_EVL_NR_CLOCKS=8 | ||
CONFIG_EVL_NR_XBUFS=128 | ||
CONFIG_EVL_NR_PROXIES=64 | ||
CONFIG_EVL_NR_OBSERVABLES=64 | ||
# end of Fixed sizes and limits | ||
|
||
# | ||
# Pre-calibrated latency | ||
# | ||
CONFIG_EVL_LATENCY_USER=0 | ||
CONFIG_EVL_LATENCY_KERNEL=0 | ||
CONFIG_EVL_LATENCY_IRQ=0 | ||
# end of Pre-calibrated latency | ||
|
||
# CONFIG_EVL_DEBUG is not set | ||
|
||
# | ||
# Out-of-band device drivers | ||
# | ||
CONFIG_EVL_LATMUS=y | ||
CONFIG_EVL_HECTIC=y | ||
# end of Out-of-band device drivers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this indentation add several spaces to the OSTree commit metadata? (since the OSTREE_KERNEL_ARGS variable is passed verbatim to
ostree
(https://github.com/torizon/meta-toradex-torizon/blob/scarthgap-7.x.y/classes/torizon_base_image_type.inc#L89))