Patching kernel with RT

Started by hnb2907, April 02, 2014, 05:04:40 PM

Previous topic - Next topic


Hi folks,

Just wondering if anyone has tried patching the kernel with the RT patch? 

A few months ago, I tried patching 3.4.67 with the relevant patch, but it wouldn't compile.  Might try it again, as I have an application that requires it.

(BTW; I can compile this version of kernel and boot my A20 ok without the RT patch).



Well, it appears to work, with a fix to the RT patch :)  I'm typing this without the equipment here, so I think the details are correct.

1 ) Following some of the instructions from to download the 3.4.67 kernel source.
Get 3.4.67 version source code (might need to add some switched to "git" to point to this version, can't remember!)
# git clone
# cd linux-sunxi/
Get the a20_defconfig file
# cp a20_defconfig linux-sunxi/arch/arm/configs/.
# make ARCH=arm a20_defconfig

2 ) Optional step, patch the kernel with the F2FS filesytem for FLASH devices.  See here for more information

3 ) Download the respective RT patch from

4 ) Follow the instructions here to patch the kernel source

5 ) The patch does not correctly fix file "fs/timerfd.c".  Change line 388 to include the missing "t."

6 ) Configure the kernel:
# make ARCH=arm menuconfig
Follow the instructions here, regarding disabling certain power management features
Don't forget to set F2FS as statically built (if you're using it).

7 ) Patch the kernel for i2c
Get the i2c patch file
# patch -p0 < sunxi-i2c.patch

8 ) Check the following lines are in "arch/arm/Kconfig":
# I also changed the timer from 100 to 1000, not sure if this has helped?

9 ) Build the kernel and modules
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j`nproc` uImage
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j`nproc` INSTALL_MOD_PATH=out modules
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j`nproc` INSTALL_MOD_PATH=out modules_install

10 ) mount the micro-sd card, copy the kernel, modules and firmware files as described here

11 ) Put the micro-sd card in the A20, and hopefully it will boot.  There is information here describing how to check if the kernel is patched ok.
I checked for:

  • "uname -a" reports 3.4.67-rt83
  • file "/sys/kernel/realtime" now exists
  • IRQ handlers are now reported in "ps -ef" with [brackets]
  • my realtime application now behaves better with RT kernel support

I did plan to use the newer 3.4.79 kernel, but there isn't a patch available for this version.

Hope that helps someone :)


Hey i recently found some other Info about a RT-Kernel for a A20,the guy applied a lot of other settings on it(CPU-Governor and so on). Maybe its worth a look:


Nice fine N8body, thanks!  :)

That's almost exactly what I did. 
Although, I've disabled the CPU governor.  I'm assuming it now runs at 100% speed, which I what I want it to do.

One step I performed, but didn't put in my instructions, was to modify the USB settings in the .fex file.  You'll find in my other posts on here that I'd already done this.