Contributed by: Felix Igelbrink.
This is a short step-by-step description on how to apply the linux-rt realtime patch on the petalinux kernel.
Do as follows:
Make a copy of the petalinux kernel sources in
<petalinux-root>/components/linux-kernel/xlnx-*
(petalinux-root is the folder with the settings.sh file, * is the kernel revision number)
or clone the latest xilinx petalinux version from
https://github.com/Xilinx/linux-xlnx
and copy the folder to
<petalinux-root>/components/linux-kernel/
Rename the copy to xlnx-*_rt
Get the appropriate linux-rt patch version for your kernel from
https://www.kernel.org/pub/linux/kernel/projects/rt/
Patches for older kernel revisions can be found in the older/ directory
Make sure you download the patch version whose kernel version matches exactly with your kernel version
Make sure to download the *.patch.gz version of the patch. The .tar.* versions contain mulitple files and are more difficult to patch.
tested versions are:
"patch-4.6-rc7-rt1.patch.gz" for the xlnx-4.6 kernel (most recent kernel version from the repository above)
"patch-4.0.8-rt6-patch.gz" for the xlnx-4.0 kernel (for the petalinux-v2015.4-final version)
Copy the *-patch.gz file to
petalinux-root>/components/linux-kernel/
Open a terminal and go into your kernel directory
cd xlnx-*/
Patch the kernel sources by executing
zcat ../*.patch.gz | patch -p1
Make sure all operations are successful. the kernel compilation will most probably fail if the patch is not successful
Go to the petalinux project root and run
petalinux-config
Go to
linux Components Selection/kernel
- Select your patched linux kernel (referenced by the folder name)
- Exit the configuration program and wait until the petalinux configuration has been generated
Run
petalinux-config -c kernel
Go to
General setup / Timers subsystem /
and make sure the "High Resolution Timer Support" is selected
Go back to the main menu and to
Kernel Features / Preemption Model
Select "Fully Preemptive Kernel (RT)" to activate the linux-rt features
Go back to Kernel Features, select Timer frequency and set it to 1000 Hz
Go back to the main menu and select
CPU power Management
Disable the CPU frequency scaling
- Exit the configuration and wait until the generation has finished
Run
petalinux-build
and copy the generated image.ub to your sd-card.
boot the fpga and check the kernel version with
uname -a