Skip to end of metadata
Go to start of metadata

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:

  1. 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/
  2. Rename the copy to xlnx-*_rt

  3. 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

    1. Make sure you download the patch version whose kernel version matches exactly with your kernel version

    2. 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)

  4. Copy the *-patch.gz file to

    petalinux-root>/components/linux-kernel/
  5. Open a terminal and go into your kernel directory

    cd xlnx-*/
  6. Patch the kernel sources by executing

    zcat ../*.patch.gz | patch -p1
  7. Make sure all operations are successful. the kernel compilation will most probably fail if the patch is not successful

  8. Go to the petalinux project root and run 

    petalinux-config
  9. Go to 

    linux Components Selection/kernel
  10. Select your patched linux kernel (referenced by the folder name)

  11. Exit the configuration program and wait until the petalinux configuration has been generated

  12. Run 
    petalinux-config -c kernel
  13. Go to 
    General setup / Timers subsystem / 

    and make sure the "High Resolution Timer Support" is selected

  14. Go back to the main menu and to 

    Kernel Features / Preemption Model 

    Select "Fully Preemptive Kernel (RT)" to activate the linux-rt features

  15. Go back to Kernel Features, select Timer frequency and set it to 1000 Hz

  16. Go back to the main menu and select 

    CPU power Management 

    Disable the CPU frequency scaling

  17. Exit the configuration and wait until the generation has finished

  18. Run

    petalinux-build 

    and copy the generated image.ub to your sd-card.

  19. boot the fpga and check the kernel version with 

    uname -a

 

  • No labels