4 4
ChrisK

RT patches for sun8i kernel?

Recommended Posts

Hello everyone,

 

since i couldn't find a section for the NanoPi Neo/M1 (or maybe i just overlooked it), and the OrangePi One is rather close to it anyways, i'll post it here.

 

Would there be interrest in a 3.4.112 kernel tree with the preempt_rt patches (rt143) added? I got myself said NanoPi's some days ago, and started to patch my way up from the original sunxi kernel 3.4.39 to the 3.4.112 version, then added the preempt_rt patches, and finally added (most?) patches from the Armbian build. Obviously manually adding the rejects. I'm also having a U-Boot 2016.09-rc1 that i have slightly patched to have it use uEnv.txt instead of boot.scr, because i got too annoyed to edit a text file, then male a binary version of it...

 

So far the kernel seems to wok fine, although i have only tested it with the stuff i need for my project (a controller for 3D printing).

 

I needed the preempt_rt patches to get some half-decent chance to actually control steppers directly from Linux (i'm writing my own driver for that currently), since there is no usable FIQ support in the 3.4 kernel (and all the patches to add such a thing are usually for newer kernels), but they also generally improve the responsiveness of the system. So it may be useful for others as well. I'm rather new to Github (and git in general), will create an account there soon and hopefully get the source trees checked in there.

 

This is a bottlog, from power up until the point systemd is started. U-Boot basically falls through (i have network and USB disabled in my own U-Boot config) and almost immediately loads the kernel.

 

 

 

U-Boot SPL 2016.09-rc1 (Aug 15 2016 - 14:22:49)
DRAM: 1024 MiB
Trying to boot from MMC1
 
 
U-Boot 2016.09-rc1 (Aug 15 2016 - 14:22:49 +0200) Allwinner Technology
 
CPU:   Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPI NEO
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
 
In:    serial
Out:   serial
Err:   serial
starting USB...
No controllers found
Hit any key to stop autoboot:  0 
reading uEnv.txt
228 bytes read in 16 ms (13.7 KiB/s)
Loaded environment from uEnv.txt
reading script.bin
35324 bytes read in 27 ms (1.2 MiB/s)
reading uImage
4068648 bytes read in 203 ms (19.1 MiB/s)
## Booting kernel from Legacy Image at 40008000 ...
   Image Name:   Linux-3.4.112-rt143-h3
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4068584 Bytes = 3.9 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
Using machid 0x1029 from environment
 
Starting kernel ...
 
[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.4.112-rt143-h3 (chris@desk) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #39 SMP PREEMPT RT Sun Aug 21 22:41:26 CEST 2016
[    0.000000] Truncating RAM at 40000000-7fffffff to -6f7fffff (vmalloc region overlap).
[    0.000000] cma: CMA: reserved 128 MiB at 58000000
[    0.000000] PERCPU: Embedded 9 pages/cpu @c0f0c000 s12480 r8192 d16192 u36864
[    0.000000] Kernel command line: console=ttyS0,115200 noinitrd root=/dev/mmcblk0p2 rootfstype=ext4 rootwait loglevel=7 isolcpus=3 
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1572864 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] allocated 7004160 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[    0.000000] Memory: 760MB = 760MB total
[    0.000000] Memory: 622448k/622448k available, 155792k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc079385c   (7727 kB)
[    0.000000]       .init : 0xc0794000 - 0xc07da0c0   ( 281 kB)
[    0.000000]       .data : 0xc07dc000 - 0xc0844e80   ( 420 kB)
[    0.000000]        .bss : 0xc0845634 - 0xc0902ac8   ( 758 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000] NR_IRQS:544
[    0.000000] Architected local timer running at 24.00MHz.
[    0.000000] Switching to timer-based delay loop
[    0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[    0.000000] Console: colour dummy device 80x30
[    0.000341] Calibrating delay loop (skipped), value calculated using timer frequency.. 4800.00 BogoMIPS (lpj=24000000)
[    0.000361] pid_max: default: 32768 minimum: 301
[    0.000867] Mount-cache hash table entries: 512
[    0.001936] Initializing cgroup subsys cpuacct
[    0.001951] Initializing cgroup subsys memory
[    0.002010] Initializing cgroup subsys devices
[    0.002021] Initializing cgroup subsys freezer
[    0.002030] Initializing cgroup subsys blkio
[    0.002061] Initializing cgroup subsys perf_event
[    0.002125] CPU: Testing write buffer coherency: ok
[    0.002174] ftrace: allocating 18817 entries in 56 pages
[    0.020324] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.020350] [sunxi_smp_prepare_cpus] enter
[    0.020387] Setting up static identity map for 0x40567a48 - 0x40567a7c
[    0.022604] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.022739] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.031133] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.031255] Brought up 4 CPUs
[    0.031255] SMP: Total of 4 processors activated (19200.00 BogoMIPS).
[    0.031255] devtmpfs: initialized
[    0.045746] wakeup src cnt is : 2. 
[    0.045828] sunxi pm init
[    0.046014] pinctrl core: initialized pinctrl subsystem
[    0.050865] NET: Registered protocol family 16
[    0.052287] DMA: preallocated 2048 KiB pool for atomic coherent allocations
[    0.052400] script_sysfs_init success
[    0.053648] gpiochip_add: registered GPIOs 0 to 383 on device: sunxi-pinctrl
[    0.053648] sunxi-pinctrl sunxi-pinctrl: initialized sunXi PIO driver
[    0.053648] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.053648] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.053648] script config pll_video to 297 Mhz
[    0.053648] script config pll_de to 864 Mhz
[    0.053648] script config pll_ve to 402 Mhz
[    0.068407] bio: create slab <bio-0> at 0
[    0.068407] [ARISC] :sunxi-arisc driver v1.04
[    0.087810] [ARISC] :arisc version: [v0.1.58]
[    0.176004] [ARISC] :sunxi-arisc driver v1.04 startup succeeded
[    0.176141] pwm module init!
[    0.180164] SCSI subsystem initialized
[    0.180549] usbcore: registered new interface driver usbfs
[    0.180668] usbcore: registered new interface driver hub
[    0.180693] usbcore: registered new device driver usb
[    0.180693] twi_chan_cfg()340 - [twi0] has no twi_regulator.
[    0.180693] twi_chan_cfg()340 - [twi1] has no twi_regulator.
[    0.180693] twi_chan_cfg()340 - [twi2] has no twi_regulator.
[    0.180742] Advanced Linux Sound Architecture Driver Version 1.0.25.
[    0.181679] Switching to clocksource arch_sys_counter
[    0.214304] FS-Cache: Loaded
[    0.214659] CacheFiles: Loaded
[    0.231012] NET: Registered protocol family 2
[    0.241737] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.242737] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.244523] TCP bind hash table entries: 65536 (order: 9, 2097152 bytes)
[    0.250612] TCP: Hash tables configured (established 131072 bind 65536)
[    0.250633] TCP: reno registered
[    0.250683] UDP hash table entries: 512 (order: 3, 40960 bytes)
[    0.250805] UDP-Lite hash table entries: 512 (order: 3, 40960 bytes)
[    0.251472] NET: Registered protocol family 1
[    0.251880] hw perfevents: enabled with ARMv7 Cortex_A7 PMU driver, 5 counters available
[    0.252045] sunxi_reg_init enter
[    0.253190] audit: initializing netlink socket (disabled)
[    0.253260] type=2000 audit(0.250:1): initialized
[    0.256611] NTFS driver 2.1.30 [Flags: R/W].
[    0.257182] msgmni has been set to 1471
[    0.259073] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.259094] io scheduler noop registered
[    0.259104] io scheduler deadline registered
[    0.259248] io scheduler cfq registered (default)
[    0.259829] gpio-sunxi: this module is used not!
[    0.260204] sw_uart_get_devinfo()1503 - uart0 has no uart_regulator.
[    0.260220] sw_uart_get_devinfo()1503 - uart1 has no uart_regulator.
[    0.260235] sw_uart_get_devinfo()1503 - uart2 has no uart_regulator.
[    0.260249] sw_uart_get_devinfo()1503 - uart3 has no uart_regulator.
[    0.261003] uart0: ttyS0 at MMIO 0x1c28000 (irq = 32) is a SUNXI
[    0.261017] sw_uart_pm()890 - uart0 clk is already enable
[    0.261036] sw_console_setup()1233 - console setup baud 115200 parity n bits 8, flow n
[    0.372092] console [ttyS0] enabled
[    0.559521] uart1: ttyS1 at MMIO 0x1c28400 (irq = 33) is a SUNXI
[    0.664347] uart2: ttyS2 at MMIO 0x1c28800 (irq = 34) is a SUNXI
[    0.839245] uart3: ttyS3 at MMIO 0x1c28c00 (irq = 35) is a SUNXI
[    0.947249] loop: module loaded
[    0.951316] sunxi_spi_chan_cfg()1383 - [spi-0] has no spi_regulator.
[    0.958371] sunxi_spi_chan_cfg()1383 - [spi-1] has no spi_regulator.
[    0.966294] spi spi0: master is unqueued, this is deprecated
[    0.973054] tun: Universal TUN/TAP device driver, 1.6
[    0.978658] tun: © 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    0.987114] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.014490] sunxi-ehci sunxi-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.023437] sunxi-ehci sunxi-ehci.1: new USB bus registered, assigned bus number 1
[    1.033897] sunxi-ehci sunxi-ehci.1: irq 104, io mem 0xf1c1a000
[    1.060061] sunxi-ehci sunxi-ehci.1: USB 0.0 started, EHCI 1.00
[    1.067590] hub 1-0:1.0: USB hub found
[    1.071926] hub 1-0:1.0: 1 port detected
[    1.096870] sunxi-ehci sunxi-ehci.2: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.105810] sunxi-ehci sunxi-ehci.2: new USB bus registered, assigned bus number 2
[    1.115011] sunxi-ehci sunxi-ehci.2: irq 106, io mem 0xf1c1b000
[    1.140058] sunxi-ehci sunxi-ehci.2: USB 0.0 started, EHCI 1.00
[    1.147490] hub 2-0:1.0: USB hub found
[    1.151718] hub 2-0:1.0: 1 port detected
[    1.176627] sunxi-ehci sunxi-ehci.3: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.185566] sunxi-ehci sunxi-ehci.3: new USB bus registered, assigned bus number 3
[    1.194739] sunxi-ehci sunxi-ehci.3: irq 108, io mem 0xf1c1c000
[    1.220054] sunxi-ehci sunxi-ehci.3: USB 0.0 started, EHCI 1.00
[    1.227467] hub 3-0:1.0: USB hub found
[    1.231694] hub 3-0:1.0: 1 port detected
[    1.256647] sunxi-ehci sunxi-ehci.4: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.265588] sunxi-ehci sunxi-ehci.4: new USB bus registered, assigned bus number 4
[    1.274734] sunxi-ehci sunxi-ehci.4: irq 110, io mem 0xf1c1d000
[    1.300055] sunxi-ehci sunxi-ehci.4: USB 0.0 started, EHCI 1.00
[    1.307426] hub 4-0:1.0: USB hub found
[    1.311671] hub 4-0:1.0: 1 port detected
[    1.316628] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.343603] sunxi-ohci sunxi-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.352158] sunxi-ohci sunxi-ohci.1: new USB bus registered, assigned bus number 5
[    1.360739] sunxi-ohci sunxi-ohci.1: irq 105, io mem 0xf1c1a400
[    1.424843] hub 5-0:1.0: USB hub found
[    1.429027] hub 5-0:1.0: 1 port detected
[    1.453976] sunxi-ohci sunxi-ohci.2: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.462526] sunxi-ohci sunxi-ohci.2: new USB bus registered, assigned bus number 6
[    1.471102] sunxi-ohci sunxi-ohci.2: irq 107, io mem 0xf1c1b400
[    1.534837] hub 6-0:1.0: USB hub found
[    1.539020] hub 6-0:1.0: 1 port detected
[    1.564048] sunxi-ohci sunxi-ohci.3: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.572598] sunxi-ohci sunxi-ohci.3: new USB bus registered, assigned bus number 7
[    1.581179] sunxi-ohci sunxi-ohci.3: irq 109, io mem 0xf1c1c400
[    1.644827] hub 7-0:1.0: USB hub found
[    1.649010] hub 7-0:1.0: 1 port detected
[    1.673930] sunxi-ohci sunxi-ohci.4: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.682491] sunxi-ohci sunxi-ohci.4: new USB bus registered, assigned bus number 8
[    1.691076] sunxi-ohci sunxi-ohci.4: irq 111, io mem 0xf1c1d400
[    1.754807] hub 8-0:1.0: USB hub found
[    1.758989] hub 8-0:1.0: 1 port detected
[    1.764070] usbcore: registered new interface driver cdc_acm
[    1.770385] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    1.779355] usbcore: registered new interface driver cdc_wdm
[    1.785665] Initializing USB Mass Storage driver...
[    1.791353] usbcore: registered new interface driver usb-storage
[    1.798017] USB Mass Storage support registered.
[    1.803282] usbcore: registered new interface driver ums-realtek
[    1.810209] usbcore: registered new interface driver usbserial
[    1.816683] usbserial: USB Serial Driver core
[    1.821558] WRN:L2534(drivers/usb/sunxi_usb/udc/sunxi_udc.c):ERR: Invalid driver: bind c0390748 setup c03958d8 speed 0
[    1.833465] g_acm_ms sunxi_usb_udc: failed to start g_acm_ms: -22
[    1.841334] [RTC] WARNING: Rtc time will be wrong!!
[    1.846745] [RTC] WARNING: use *internal OSC* as clock source
[    1.853509] sunxi-rtc sunxi-rtc: rtc core: registered sunxi-rtc as rtc0
[    1.861124] i2c /dev entries driver
[    1.865669] sunxi_wdt_init_module: sunxi WatchDog Timer Driver v1.0
[    1.872913] sunxi_wdt_probe: devm_ioremap return wdt_reg 0xf1c20ca0, res->start 0x01c20ca0, res->end 0x01c20cbf
[    1.884132] sunxi_wdt_probe: initialized (g_timeout=16s, g_nowayout=0)
[    1.891633] wdt_enable, write reg 0xf1c20cb8 val 0x00000000
[    1.897817] timeout_to_interv, line 167
[    1.902103] interv_to_timeout, line 189
[    1.906358] wdt_set_tmout, write 0x000000b0 to mode reg 0xf1c20cb8, actual timeout 16 sec
[    1.921454] no red_led, ignore it!
[    1.925227] no green_led, ignore it!
[    1.929540] no led_0, ignore it!
[    1.933164] no led_1, ignore it!
[    1.936741] no led_2, ignore it!
[    1.940349] no led_3, ignore it!
[    1.943925] no led_4, ignore it!
[    1.947500] no led_5, ignore it!
[    1.951106] no led_6, ignore it!
[    1.954683] no led_7, ignore it!
[    1.958853] usbcore: registered new interface driver usbhid
[    1.965070] usbhid: USB HID core driver
[    1.969436] stepcore_data_init: allocated 196708 bytes for stepdata structure
[    1.977825] stepCore_init: success
[    1.983304] script_get_item audio_pa_ctrl not found
[    1.994755] asoc: sndcodec <-> sunxi-codec mapping ok
[    2.000678] mmc0: new high speed SDHC card at address 0007
[    2.001739] [sPDIF]sunxi-spdif cannot find any using configuration for controllers, return directly!
[    2.002019] [sPDIF]sndspdif cannot find any using configuration for controllers, return directly!
[    2.002030] [sPDIF] driver not init,just return.
[    2.002263] u32 classifier
[    2.002271]     Actions configured
[    2.002279] Netfilter messages via NETLINK v0.30.
[    2.002381] nf_conntrack version 0.5.0 (11773 buckets, 47092 max)
[    2.003002] ctnetlink v0.93: registering with nfnetlink.
[    2.003094] NF_TPROXY: Transparent proxy support initialized, version 4.1.0
[    2.003102] NF_TPROXY: Copyright © 2006-2007 BalaBit IT Ltd.
[    2.003551] xt_time: kernel timezone is -0000
[    2.003705] IPv4 over IPv4 tunneling driver
[    2.004431] gre: GRE over IPv4 demultiplexor driver
[    2.004441] ip_gre: GRE over IPv4 tunneling driver
[    2.005422] ip_tables: © 2000-2006 Netfilter Core Team
[    2.005762] arp_tables: © 2002 David S. Miller
[    2.005860] TCP: cubic registered
[    2.005867] Initializing XFRM netlink socket
[    2.006302] NET: Registered protocol family 10
[    2.008117] Mobile IPv6
[    2.008178] ip6_tables: © 2000-2006 Netfilter Core Team
[    2.008495] IPv6 over IPv4 tunneling driver
[    2.010305] NET: Registered protocol family 17
[    2.010357] NET: Registered protocol family 15
[    2.010375] L2TP core driver, V2.0
[    2.010381] L2TP IP encapsulation support (L2TPv3)
[    2.010472] L2TP netlink interface
[    2.010521] L2TP ethernet pseudowire support (L2TPv3)
[    2.010529] lib80211: common routines for IEEE802.11 drivers
[    2.016892] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    2.016915] ThumbEE CPU extension supported.
[    2.016943] Registering SWP/SWPB emulation handler
[    2.026825] sunxi-rtc sunxi-rtc: setting system clock to 1970-01-01 07:00:10 UTC (25210)
[    2.026845] ths_fetch_sysconfig_para: type err  device_used = 1. 
[    2.028647] CPU Budget:corekeeper enabled
[    2.029029] CPU Budget:Register notifier
[    2.029039] CPU Budget:register Success
[    2.029049] sunxi-budget-cooling sunxi-budget-cooling: Cooling device registered: thermal-budget-0
[    2.036956] ALSA device list:
[    2.036962]   #0: audiocodec
[    2.105850] mmcblk0: mmc0:0007 SD32G 29.0 GiB 
[    2.110690]  mmcblk0: p1 p2 p3 p4
[    2.112261] *******************sd init ok*******************
[    2.242688] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.267732] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.274839] Freeing init memory: 280K
[    2.590189] systemd[1]: Failed to insert module 'kdbus': Function not implemented

 

So, if there is interrest i will let you know once i got it stuffed onto Github. In case anyone wants it before that i can just bzip it up and put it on my server.

 

Greetings,

 

Chris

Share this post


Link to post
Share on other sites

since i couldn't find a section for the NanoPi Neo/M1 (or maybe i just overlooked it), and the OrangePi One is rather close to it anyways, i'll post it here.

 

First: great to see you appearing here :)

 

Then I don't think this thread is the best point for stuff like that since it's outdated and both NanoPi are 'just another H3 board' (really nothing special). But at least it's in development forum.

 

I believe realtime patches would be nice to be able to provide. But since we would need patches anyway and your development approach sounds a little bit time consuming may I suggest adopting Armbian's build system? Especially FEL booting might be nice for you since you save the SD card entirely and time between build and boot is less than 1 second. Also you can supply your own u-boot parameters as userpatches/fel-boot.cmd (see docs above) and benefit from patch handling in Armbian. Also you can deal with different branches easily (just add 'BOOTBRANCH=tag:v2016.09-rc1' to userpatches/lib.config and you're testing out new u-boot version and so on)

 

It might take you some time in the beginning but the savings when you're familiar with the build system are enormous. On my build host subsequent image buildings take 5 min on average (from scratch including u-boot and kernel compilation and creating a whole FEL boot ready image). As an example a quick build with 2016-09-r1 below (just to see which of our u-boot patches will fail):

 

 

dpkg-deb: building package 'linux-firmware-image-sun8i' in '../linux-firmware-image-sun8i_5.17_armhf.deb'.

dpkg-deb: building package 'linux-headers-sun8i' in '../linux-headers-sun8i_5.17_armhf.deb'.

dpkg-deb: building package 'linux-image-sun8i' in '../linux-image-sun8i_5.17_armhf.deb'.

[ o.k. ] Creating board support package [ nanopim1 default ]

[ o.k. ] Fingerprinting [ Armbian 5.17 Nanopim1 Debian jessie default ]

[ o.k. ] Building package [ linux-jessie-root-nanopim1 ]

[ o.k. ] Starting build process for [ nanopim1 jessie ]

[ o.k. ] Extracting jessie-ng-armhf.d11...b44.tgz [ 8 days old ]

jessie-ng-armhf.d11...b44.tgz:  241MiB [  96MiB/s] [=======================================================================================>] 100%

[ o.k. ] Applying distribution specific tweaks for [ jessie ]

[ o.k. ] Applying common tweaks 

[ o.k. ] Installing kernel [ linux-image-sun8i ]

[ o.k. ] Installing u-boot [ linux-u-boot-nanopim1 ]

[ o.k. ] Installing headers [ linux-headers-sun8i ]

[ o.k. ] Installing generic firmware [ armbian-firmware ]

[ o.k. ] Installing board support package [ nanopim1 ]

[ o.k. ] Installing extra applications and drivers 

[ o.k. ] Installing linux firmware [ 5.17 ]

[ o.k. ] Installing additional driver [ MT7601U ]

[ o.k. ] ... you have latest sources [ mt7601 old ]

Reversed (or previously applied) patch detected!  Skipping patch.

1 out of 1 hunk ignored -- saving rejects to file src/include/os/rt_linux.h.rej

Reversed (or previously applied) patch detected!  Skipping patch.

1 out of 1 hunk ignored -- saving rejects to file src/os/linux/rt_linux.c.rej

[ o.k. ] Installing additional driver [ RT8192 ]

[ o.k. ] ... you have latest sources [ rt8192cu  ]

[ o.k. ] Installing [ armbian-tools-jessie_5.17_armhf.deb ]

[ o.k. ] Installing additional application [ USB redirector ]

[ o.k. ] Calling image customization script [ customize-image.sh ]

[ o.k. ] Preparing image file for rootfs [ nanopim1 jessie ]

[ o.k. ] Current rootfs size [ 776 MiB ]

[ o.k. ] Creating blank image for rootfs [ 1215 MiB ]

1,19GiB [ 324MiB/s] [======================================================================================================================>] 100%

[ o.k. ] Creating partitions [ root: ext4 ]

[ o.k. ] Copying files to image [ tmprootfs.raw ]

        704.06M  99%  105.12MB/s    0:00:06 (xfr#39117, to-chk=0/49096)   

 

sent 706.96M bytes  received 786.79K bytes  108.88M bytes/sec

total size is 707.97M  speedup is 1.00

[ o.k. ] Copying files to /boot partition [ tmprootfs.raw ]

         14.43M  99%  319.34MB/s    0:00:00 (xfr#42, to-chk=0/46) 

 

sent 14.44M bytes  received 829 bytes  9.63M bytes/sec

total size is 14.43M  speedup is 1.00

[ o.k. ] Free space: [ SD card ]

tmpfs                        1,5G  776M  725M  52% /var/git/Armbian/output/cache/sdcard

/dev/loop0p1                 1,2G  802M  322M  72% /var/git/Armbian/output/cache/mount

[ o.k. ] Writing bootloader [ /dev/loop0 ]

[ o.k. ] Copying image file [ Armbian_5.17_Nanopim1_Debian_jessie_3.4.112.raw ]

[ o.k. ] Done building [ /var/git/Armbian/output/images/Armbian_5.17_Nanopim1_Debian_jessie_3.4.112.raw ]

[ o.k. ] Runtime [ 6 min ]

 

 

Share this post


Link to post
Share on other sites

Hello,

 

thnaks for the welcome.

 

Yea, i wasn't sure wether to open a new thread or just add to this. If this isn't the right pülace, maybe a mod can move these parts to a new thread? Or i open a new one?

 

The method i used for patching the original kernel was indeed time consuming, but i did it that way on purpose. Great way to get a rough idea of what changed, plus, my last kernel hacking was way over 10 years ago, so it was also a great way to get back into that stuff. Also, i learned about Armbian only later, when it was already "too late", so to say.

 

I guess i could try to create a diff between the Armbian kernel and the rt kernel. After all, the only difference between the two now should be just the rt patches (unless i somehow forgot to apply one/some of the Armbian patches from lib/patch/kernel for the 3.4.112 version). Alternatively i could apply the rt patches to the "final" Armbian kernel, manually adding the failed hunks (as i did with my version of it). Now that i know  what to look for that should be done rather quickly.

 

What kind of patch-set would you guys prefer? The way i applied the rt stuff was by using the patch-set patches-3.4.112-rt143.tar.gz, instead of the single big patch file. So there are two options, i can either create basically the same patch set, just for the Armbian kernel, or make a single big rt patch that could be optionally applied to it after all the other patches from Armbian have been applied.

 

Regarding the Armbian build script, for what i am doing right now it is rather bulky. I'm writing a kernel driver/module, so all i ever need is to recompile that, copy over the uImage, and boot it. Building a whole new image all the time is just too much.

 

So, let me know how you guys would prefer the rt patch, small patches or a single big patch, and i try to get it done by the weekend.

 

Greetings,

 

Chris

Share this post


Link to post
Share on other sites

 (moved this to a new thread now)

So, let me know how you guys would prefer the rt patch, small patches or a single big patch, and i try to get it done by the weekend.

 

Up to @Igor, @Zador -- they are into kernel development. For me a huge patch that applies cleanly against Armbian's 3.4.112 would be great since then we could provide kernel .debs for testers interested in this stuff.

Share this post


Link to post
Share on other sites

Hi,

 

first of all, thanks for moving this part into a separate thread.

 

Attached is .tar.gz with the patches. While the RT patches themselves are in a single patch file, there are 4 more patches.

 

I created them by first running the compile.sh script. I selected the legacy kernel, and Nanopi M1, then had it unpack the kernel patch it and then compile it. Once that was done i copied over the sources/linux-sun8i/sun8i dierectory to apply the patches. In fact i copied it twice, to be able to get a patchset consistin of single patch files for the RT stuff as well. I then fixed up a few other issues /thus the extra patches), and added a patch to allow setting priority levels on IRQ's.

 

After all that i copied the clean sun8i directory again and applied the just created patches, to verify the result applies cleanly to the 3.4.112 sunxi kernel in Armbian. Which they do.

 

The patches are as follows:

 

0000-... : The lib/patch/kernel/sun8i-default/02-0005... patch has a small bug. The patched result makes use of kobj_to_dev(), but it can't find that because genhd.h is missing from the includes in firmware_class.c. This patch fixes that.

 

0001-... : The full preempt_rt patch. Most of the patches of the original rt143 apply just fine. A few have only line offsets, even fewer have failed hunks or errors. The latter ones are where i manually added the rejected parts into their proper places.

 

0002-... : Afte the RT patches are applied, when one want to use PREEMPT_RT_FULL, the use of highmem is no longer possible (in the 2.6 kernel patches it is possible again, though...). The SUNXI SS hardware crypto driver makes use of kmap/kunmap, which are provided by highmem functions. This patch disables that driver if no CONFIG_HIGHMEM is possible. No idea in what places the SUNXI SS is used anyways. By default it builds as a module, and i never saw it loaded.

 

0003-... : There is a small bug in the RT patches in rimerfd.c, where in one places it tries to access ctx->tmr, whereas it should be ctx->t.tmr. This patch fixes that.

 

0004-... : This adds the ability to set priorities for IRQ's on the GIC. Normally all IRQ's have the same priority, 0xa0. This patch allows three levels, and high priority can be selected for an IRQ by adding IRQF_HIGH_PRIORITY to its flags.

 

About the issue with no highmem available when PREEMPT_RT_FULL is used, i will dive into that once i have more time. Maybe i can backport some stuff from newer RT patches, who knows. Other than that the kernel runs fine, at least i didn't encounter any issues yet.

 

As usual, the RT patches add two extra choices to Kernel Features -> Preemption Model, Preemtible Kernel (Basic RT) and Fully Preemptible Kernel (RT). Also as usual, using those patches makes the kernel slightly less performant when it comes to things like raw I/O stuff. It simply improves the response time to events, decreases latency, etc., which is very useful in certain applications.

 

Anyways, i hope that this is helpful for you folks.

 

Greetings,

 

Chris

 

patches.tar.gz

 

Share this post


Link to post
Share on other sites

That reminds me, i forgot to include another patch. That one makes irq_set_affinity_hint() work properly. The interrupt controller allows IRQ's to be tied to specific cores, by setting the cpu affinity of the IRQ. While irq_set_affinity_hint() is already there and exported, it fails to actually put the IRQ on the selected CPU(s).

 

It can be quite useful to be able to tie an IRQ to a specific CPU/core, especially in conjunction with the RT patches. You can, for example, simply exclude one core from being used by the kernel, using the isolcpus= boot arg for the kernel. Like, isolcpus=3 will exclude the fourth core from being used by the kernel. If you then install your interrupt and call irq_set_affinity_hint(IRQNUM, cpumask_of(3)) (with IRQNUM being the number of the IRQ in question), that IRQ will then handled exclusively on the fourth core. This greatly reduces latency and jitter.

 

Greetings,

 

Chris

 

0005-make-irq-set-affinity-hint-work-properly.patch.gz

Share this post


Link to post
Share on other sites

https://github.com/igorpecovnik/lib/commit/b1c387cec595ab956c38fc4c75f0f3b4a2d15cb7

 

We usually left out the main patch as .disabled so one can enable and build if needed. Other patches, except disabled one, should not break current kernel, right? I only made a brief look into code and try building.

 

Thanks!

 

The other patches don't break or modify the default behaviour of the kernel. However, you should also disable 0003 if 0001 is not used. That one only fixes an issue that shows up when the RT patches are applied, and will fail if they are not applied first. 0000 is a general fix for an issue that exists in the 3.4.112 armbian kernel, 0002 just excludes SUNXI SS if highmem is not enabled, 0004 and 0005 are just additions to the IRQ handling/config that does not affect regular operation, but is handy to have in case one wants/needs these functionalities in their own drivers.

 

Greetings,

 

Chris

Share this post


Link to post
Share on other sites

Hi,

 

and here is another patch that should be added if the RT patch is applied.

 

This one fixes BUG's that are triggered when using the interactive cpufreq governor. The probelm is that spin_lock_irqsave and spin_lock_irqrestore are used there, which leads to:

 

BUG: scheduling while atomic: swapper/0/0/0x00000002

 

This patch makes it use the raw_ versions of those in case the PREEMPT_RT_FULL patch is applied.

 

I wasn't aware of the issue until now, since i usually use the "userpsace" governor.

 

Greetings,

 

Chris

0006-cpufreq_interactive-spin_lock_for_rt.patch.gz

Share this post


Link to post
Share on other sites

Hi,

 

Igor asked me if i could consolidate the RT patches into a single one, and only doing the extra patches seperately, so here they are.

 

First, i added the fix for firmware_class.c in the 02-0005-backport-firmware-loader.patch, because that is what introduces the issue in the first place. So, that patch can be replaced by this file:

 

02-0005-backport-firmware-loader.patch.gz

 

Then i took the liberty to consolidate all the patches that brings the kernel from 2.4.39 to 2.4.112 into a single one. I did so by first disabling all the patches from 02-0001-patch... down to z-0003... (leaving those before 02-0001 enabled), having the compile script apply the patches. Then i saved the kernel source tree, enabled these 39-112 patches:

 

 

 

02-0001-patch-3.4.39-40.patch
02-0001-patch-3.4.40-41.patch
02-0001-patch-3.4.41-42.patch
02-0001-patch-3.4.42-43.patch
02-0001-patch-3.4.43-44.patch
02-0001-patch-3.4.44-45.patch
02-0001-patch-3.4.45-46.patch
02-0001-patch-3.4.46-47.patch
02-0001-patch-3.4.47-48.patch
02-0001-patch-3.4.48-49.patch
02-0001-patch-3.4.49-50.patch
02-0001-patch-3.4.50-51.patch
02-0001-patch-3.4.51-52.patch
02-0001-patch-3.4.52-53.patch
02-0001-patch-3.4.53-54.patch
02-0001-patch-3.4.54-55.patch
02-0001-patch-3.4.55-56.patch
02-0001-patch-3.4.56-57.patch
02-0001-patch-3.4.57-58.patch
02-0001-patch-3.4.58-59.patch
02-0001-patch-3.4.59-60.patch
02-0001-patch-3.4.60-61.patch
02-0001-patch-3.4.61-62.patch
02-0001-patch-3.4.62-63.patch
02-0001-patch-3.4.63-64.patch
02-0001-patch-3.4.64-65.patch
02-0001-patch-3.4.65-66.patch
02-0001-patch-3.4.66-67.patch
02-0001-patch-3.4.67-68.patch
02-0001-patch-3.4.68-69.patch
02-0001-patch-3.4.69-70.patch
02-0001-patch-3.4.70-71.patch
02-0001-patch-3.4.71-72.patch
02-0001-patch-3.4.72-73.patch
02-0001-patch-3.4.73-74.patch
02-0001-patch-3.4.74-75.patch
02-0001-patch-3.4.75-76.patch
02-0001-patch-3.4.76-77.patch
02-0001-patch-3.4.77-78.patch
02-0001-patch-3.4.78-79.patch
02-0001-patch-3.4.79-80.patch
02-0001-patch-3.4.80-81.patch
02-0001-patch-3.4.81-82.patch
02-0001-patch-3.4.82-83.patch
02-0001-patch-3.4.83-84.patch
02-0001-patch-3.4.84-85.patch
02-0001-patch-3.4.85-86.patch
02-0001-patch-3.4.86-87.patch
02-0001-patch-3.4.87-88.patch
02-0001-patch-3.4.88-89.patch
02-0001-patch-3.4.89-90.patch
02-0001-patch-3.4.90-91.patch
02-0001-patch-3.4.91-92.patch
02-0001-patch-3.4.92-93.patch
02-0001-patch-3.4.93-94.patch
02-0001-patch-3.4.94-95.patch
02-0001-patch-3.4.95-96.patch
02-0001-patch-3.4.96-97.patch
02-0001-patch-3.4.97-98.patch
02-0001-patch-3.4.98-99.patch
02-0001-patch-3.4.99-100.patch
02-0002-patch-3.4.100-101.patch
02-0002-patch-3.4.101-102.patch
02-0002-patch-3.4.102-103.patch
02-0002-patch-3.4.103-104.patch
02-0002-patch-3.4.104-105.patch
02-0002-patch-3.4.105-106.patch
02-0002-patch-3.4.106-107.patch
02-0002-patch-3.4.107-108.patch
02-0003-linux-sunxi-3.4.108-overlayfs.patch
02-0004-patch-3.4.108-109.patch
02-0004-patch-3.4.109-110.patch
02-0004-patch-3.4.110-111.patch
02-0004-patch-3.4.111-112.patch

 

 

 

and ran compile.sh again to have all those applied. Then i saved that source tree, and made single patch file. This one brings the kernel from 2.4.39 up to 2.4.112 in one patch:

 

02-0001-patch-3.4.39-112.patch.gz

 

That means that in the lib/patch/kernel/sun8i-default directory all the patches in the above list can be removed and the single patch file be used instead.

 

Here is the consolidated RT patch, which now includes the RT itself plus the fixes for it:

 

0000-rt143-full-plus-rt-fixes.patch.gz

 

So all that is left is the patch for those who want to have irq_set_affinity_hin() work properly. I leave that one extra, because for one it doesn't change anything to the way the kernel operates and sets up IRQ's by default, and it also doesn't have anything to do with the RT patches as such. So, this applies opnly for those who write their own drivers (or want to modify existing ones) that use interrupts, and want to tie said IRQ's to a specific core (or cores):

 

0001-make-irq-set-affinity-hint-work-properly.patch.gz

 

Greetings,

 

Chris

 

EDIT: There was a bug in the full RT patch. Fixed it, and replaced the file in this post!

Share this post


Link to post
Share on other sites

Just to make sure the edit isn't overlooked:

 

There was a bug in the full RT patch in the post above. Fixed it, and replaced the file in the previous post.

 

Greetings,

 

Chris

Share this post


Link to post
Share on other sites

Hi Igor,

 

what exactly is the issue with the 39-112 patch? The overlay-patch (02-0003-linux-sunxi-3.4.108-overlayfs.patch) is included in that one. I have  tested it here, and so far it works.

 

Let me know what the issue is, the i can re-crete it and possibly fix the large patch.

 

Greetings,

 

Chris

Share this post


Link to post
Share on other sites

Hi Chris and others

 

I would certainly be interested in a 3.4.112 kernel tree with the preempt_rt patches (rt143) added

 

Regards

 

Hello everyone,

 

since i couldn't find a section for the NanoPi Neo/M1 (or maybe i just overlooked it), and the OrangePi One is rather close to it anyways, i'll post it here.

 

Would there be interrest in a 3.4.112 kernel tree with the preempt_rt patches (rt143) added? I got myself said NanoPi's some days ago, and started to patch my way up from the original sunxi kernel 3.4.39 to the 3.4.112 version, then added the preempt_rt patches, and finally added (most?) patches from the Armbian build. Obviously manually adding the rejects. I'm also having a U-Boot 2016.09-rc1 that i have slightly patched to have it use uEnv.txt instead of boot.scr, because i got too annoyed to edit a text file, then male a binary version of it...

 

So far the kernel seems to wok fine, although i have only tested it with the stuff i need for my project (a controller for 3D printing).

 

I needed the preempt_rt patches to get some half-decent chance to actually control steppers directly from Linux (i'm writing my own driver for that currently), since there is no usable FIQ support in the 3.4 kernel (and all the patches to add such a thing are usually for newer kernels), but they also generally improve the responsiveness of the system. So it may be useful for others as well. I'm rather new to Github (and git in general), will create an account there soon and hopefully get the source trees checked in there.

 

This is a bottlog, from power up until the point systemd is started. U-Boot basically falls through (i have network and USB disabled in my own U-Boot config) and almost immediately loads the kernel.

 

 

 

U-Boot SPL 2016.09-rc1 (Aug 15 2016 - 14:22:49)
DRAM: 1024 MiB
Trying to boot from MMC1
 
 
U-Boot 2016.09-rc1 (Aug 15 2016 - 14:22:49 +0200) Allwinner Technology
 
CPU:   Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPI NEO
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
 
In:    serial
Out:   serial
Err:   serial
starting USB...
No controllers found
Hit any key to stop autoboot:  0 
reading uEnv.txt
228 bytes read in 16 ms (13.7 KiB/s)
Loaded environment from uEnv.txt
reading script.bin
35324 bytes read in 27 ms (1.2 MiB/s)
reading uImage
4068648 bytes read in 203 ms (19.1 MiB/s)
## Booting kernel from Legacy Image at 40008000 ...
   Image Name:   Linux-3.4.112-rt143-h3
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4068584 Bytes = 3.9 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
Using machid 0x1029 from environment
 
Starting kernel ...
 
[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.4.112-rt143-h3 (chris@desk) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #39 SMP PREEMPT RT Sun Aug 21 22:41:26 CEST 2016
[    0.000000] Truncating RAM at 40000000-7fffffff to -6f7fffff (vmalloc region overlap).
[    0.000000] cma: CMA: reserved 128 MiB at 58000000
[    0.000000] PERCPU: Embedded 9 pages/cpu @c0f0c000 s12480 r8192 d16192 u36864
[    0.000000] Kernel command line: console=ttyS0,115200 noinitrd root=/dev/mmcblk0p2 rootfstype=ext4 rootwait loglevel=7 isolcpus=3 
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1572864 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] allocated 7004160 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[    0.000000] Memory: 760MB = 760MB total
[    0.000000] Memory: 622448k/622448k available, 155792k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc079385c   (7727 kB)
[    0.000000]       .init : 0xc0794000 - 0xc07da0c0   ( 281 kB)
[    0.000000]       .data : 0xc07dc000 - 0xc0844e80   ( 420 kB)
[    0.000000]        .bss : 0xc0845634 - 0xc0902ac8   ( 758 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Additional per-CPU info printed with stalls.
[    0.000000] NR_IRQS:544
[    0.000000] Architected local timer running at 24.00MHz.
[    0.000000] Switching to timer-based delay loop
[    0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[    0.000000] Console: colour dummy device 80x30
[    0.000341] Calibrating delay loop (skipped), value calculated using timer frequency.. 4800.00 BogoMIPS (lpj=24000000)
[    0.000361] pid_max: default: 32768 minimum: 301
[    0.000867] Mount-cache hash table entries: 512
[    0.001936] Initializing cgroup subsys cpuacct
[    0.001951] Initializing cgroup subsys memory
[    0.002010] Initializing cgroup subsys devices
[    0.002021] Initializing cgroup subsys freezer
[    0.002030] Initializing cgroup subsys blkio
[    0.002061] Initializing cgroup subsys perf_event
[    0.002125] CPU: Testing write buffer coherency: ok
[    0.002174] ftrace: allocating 18817 entries in 56 pages
[    0.020324] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.020350] [sunxi_smp_prepare_cpus] enter
[    0.020387] Setting up static identity map for 0x40567a48 - 0x40567a7c
[    0.022604] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.022739] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.031133] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.031255] Brought up 4 CPUs
[    0.031255] SMP: Total of 4 processors activated (19200.00 BogoMIPS).
[    0.031255] devtmpfs: initialized
[    0.045746] wakeup src cnt is : 2. 
[    0.045828] sunxi pm init
[    0.046014] pinctrl core: initialized pinctrl subsystem
[    0.050865] NET: Registered protocol family 16
[    0.052287] DMA: preallocated 2048 KiB pool for atomic coherent allocations
[    0.052400] script_sysfs_init success
[    0.053648] gpiochip_add: registered GPIOs 0 to 383 on device: sunxi-pinctrl
[    0.053648] sunxi-pinctrl sunxi-pinctrl: initialized sunXi PIO driver
[    0.053648] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.053648] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.053648] script config pll_video to 297 Mhz
[    0.053648] script config pll_de to 864 Mhz
[    0.053648] script config pll_ve to 402 Mhz
[    0.068407] bio: create slab <bio-0> at 0
[    0.068407] [ARISC] :sunxi-arisc driver v1.04
[    0.087810] [ARISC] :arisc version: [v0.1.58]
[    0.176004] [ARISC] :sunxi-arisc driver v1.04 startup succeeded
[    0.176141] pwm module init!
[    0.180164] SCSI subsystem initialized
[    0.180549] usbcore: registered new interface driver usbfs
[    0.180668] usbcore: registered new interface driver hub
[    0.180693] usbcore: registered new device driver usb
[    0.180693] twi_chan_cfg()340 - [twi0] has no twi_regulator.
[    0.180693] twi_chan_cfg()340 - [twi1] has no twi_regulator.
[    0.180693] twi_chan_cfg()340 - [twi2] has no twi_regulator.
[    0.180742] Advanced Linux Sound Architecture Driver Version 1.0.25.
[    0.181679] Switching to clocksource arch_sys_counter
[    0.214304] FS-Cache: Loaded
[    0.214659] CacheFiles: Loaded
[    0.231012] NET: Registered protocol family 2
[    0.241737] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.242737] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.244523] TCP bind hash table entries: 65536 (order: 9, 2097152 bytes)
[    0.250612] TCP: Hash tables configured (established 131072 bind 65536)
[    0.250633] TCP: reno registered
[    0.250683] UDP hash table entries: 512 (order: 3, 40960 bytes)
[    0.250805] UDP-Lite hash table entries: 512 (order: 3, 40960 bytes)
[    0.251472] NET: Registered protocol family 1
[    0.251880] hw perfevents: enabled with ARMv7 Cortex_A7 PMU driver, 5 counters available
[    0.252045] sunxi_reg_init enter
[    0.253190] audit: initializing netlink socket (disabled)
[    0.253260] type=2000 audit(0.250:1): initialized
[    0.256611] NTFS driver 2.1.30 [Flags: R/W].
[    0.257182] msgmni has been set to 1471
[    0.259073] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.259094] io scheduler noop registered
[    0.259104] io scheduler deadline registered
[    0.259248] io scheduler cfq registered (default)
[    0.259829] gpio-sunxi: this module is used not!
[    0.260204] sw_uart_get_devinfo()1503 - uart0 has no uart_regulator.
[    0.260220] sw_uart_get_devinfo()1503 - uart1 has no uart_regulator.
[    0.260235] sw_uart_get_devinfo()1503 - uart2 has no uart_regulator.
[    0.260249] sw_uart_get_devinfo()1503 - uart3 has no uart_regulator.
[    0.261003] uart0: ttyS0 at MMIO 0x1c28000 (irq = 32) is a SUNXI
[    0.261017] sw_uart_pm()890 - uart0 clk is already enable
[    0.261036] sw_console_setup()1233 - console setup baud 115200 parity n bits 8, flow n
[    0.372092] console [ttyS0] enabled
[    0.559521] uart1: ttyS1 at MMIO 0x1c28400 (irq = 33) is a SUNXI
[    0.664347] uart2: ttyS2 at MMIO 0x1c28800 (irq = 34) is a SUNXI
[    0.839245] uart3: ttyS3 at MMIO 0x1c28c00 (irq = 35) is a SUNXI
[    0.947249] loop: module loaded
[    0.951316] sunxi_spi_chan_cfg()1383 - [spi-0] has no spi_regulator.
[    0.958371] sunxi_spi_chan_cfg()1383 - [spi-1] has no spi_regulator.
[    0.966294] spi spi0: master is unqueued, this is deprecated
[    0.973054] tun: Universal TUN/TAP device driver, 1.6
[    0.978658] tun: © 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    0.987114] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.014490] sunxi-ehci sunxi-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.023437] sunxi-ehci sunxi-ehci.1: new USB bus registered, assigned bus number 1
[    1.033897] sunxi-ehci sunxi-ehci.1: irq 104, io mem 0xf1c1a000
[    1.060061] sunxi-ehci sunxi-ehci.1: USB 0.0 started, EHCI 1.00
[    1.067590] hub 1-0:1.0: USB hub found
[    1.071926] hub 1-0:1.0: 1 port detected
[    1.096870] sunxi-ehci sunxi-ehci.2: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.105810] sunxi-ehci sunxi-ehci.2: new USB bus registered, assigned bus number 2
[    1.115011] sunxi-ehci sunxi-ehci.2: irq 106, io mem 0xf1c1b000
[    1.140058] sunxi-ehci sunxi-ehci.2: USB 0.0 started, EHCI 1.00
[    1.147490] hub 2-0:1.0: USB hub found
[    1.151718] hub 2-0:1.0: 1 port detected
[    1.176627] sunxi-ehci sunxi-ehci.3: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.185566] sunxi-ehci sunxi-ehci.3: new USB bus registered, assigned bus number 3
[    1.194739] sunxi-ehci sunxi-ehci.3: irq 108, io mem 0xf1c1c000
[    1.220054] sunxi-ehci sunxi-ehci.3: USB 0.0 started, EHCI 1.00
[    1.227467] hub 3-0:1.0: USB hub found
[    1.231694] hub 3-0:1.0: 1 port detected
[    1.256647] sunxi-ehci sunxi-ehci.4: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.265588] sunxi-ehci sunxi-ehci.4: new USB bus registered, assigned bus number 4
[    1.274734] sunxi-ehci sunxi-ehci.4: irq 110, io mem 0xf1c1d000
[    1.300055] sunxi-ehci sunxi-ehci.4: USB 0.0 started, EHCI 1.00
[    1.307426] hub 4-0:1.0: USB hub found
[    1.311671] hub 4-0:1.0: 1 port detected
[    1.316628] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.343603] sunxi-ohci sunxi-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.352158] sunxi-ohci sunxi-ohci.1: new USB bus registered, assigned bus number 5
[    1.360739] sunxi-ohci sunxi-ohci.1: irq 105, io mem 0xf1c1a400
[    1.424843] hub 5-0:1.0: USB hub found
[    1.429027] hub 5-0:1.0: 1 port detected
[    1.453976] sunxi-ohci sunxi-ohci.2: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.462526] sunxi-ohci sunxi-ohci.2: new USB bus registered, assigned bus number 6
[    1.471102] sunxi-ohci sunxi-ohci.2: irq 107, io mem 0xf1c1b400
[    1.534837] hub 6-0:1.0: USB hub found
[    1.539020] hub 6-0:1.0: 1 port detected
[    1.564048] sunxi-ohci sunxi-ohci.3: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.572598] sunxi-ohci sunxi-ohci.3: new USB bus registered, assigned bus number 7
[    1.581179] sunxi-ohci sunxi-ohci.3: irq 109, io mem 0xf1c1c400
[    1.644827] hub 7-0:1.0: USB hub found
[    1.649010] hub 7-0:1.0: 1 port detected
[    1.673930] sunxi-ohci sunxi-ohci.4: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.682491] sunxi-ohci sunxi-ohci.4: new USB bus registered, assigned bus number 8
[    1.691076] sunxi-ohci sunxi-ohci.4: irq 111, io mem 0xf1c1d400
[    1.754807] hub 8-0:1.0: USB hub found
[    1.758989] hub 8-0:1.0: 1 port detected
[    1.764070] usbcore: registered new interface driver cdc_acm
[    1.770385] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    1.779355] usbcore: registered new interface driver cdc_wdm
[    1.785665] Initializing USB Mass Storage driver...
[    1.791353] usbcore: registered new interface driver usb-storage
[    1.798017] USB Mass Storage support registered.
[    1.803282] usbcore: registered new interface driver ums-realtek
[    1.810209] usbcore: registered new interface driver usbserial
[    1.816683] usbserial: USB Serial Driver core
[    1.821558] WRN:L2534(drivers/usb/sunxi_usb/udc/sunxi_udc.c):ERR: Invalid driver: bind c0390748 setup c03958d8 speed 0
[    1.833465] g_acm_ms sunxi_usb_udc: failed to start g_acm_ms: -22
[    1.841334] [RTC] WARNING: Rtc time will be wrong!!
[    1.846745] [RTC] WARNING: use *internal OSC* as clock source
[    1.853509] sunxi-rtc sunxi-rtc: rtc core: registered sunxi-rtc as rtc0
[    1.861124] i2c /dev entries driver
[    1.865669] sunxi_wdt_init_module: sunxi WatchDog Timer Driver v1.0
[    1.872913] sunxi_wdt_probe: devm_ioremap return wdt_reg 0xf1c20ca0, res->start 0x01c20ca0, res->end 0x01c20cbf
[    1.884132] sunxi_wdt_probe: initialized (g_timeout=16s, g_nowayout=0)
[    1.891633] wdt_enable, write reg 0xf1c20cb8 val 0x00000000
[    1.897817] timeout_to_interv, line 167
[    1.902103] interv_to_timeout, line 189
[    1.906358] wdt_set_tmout, write 0x000000b0 to mode reg 0xf1c20cb8, actual timeout 16 sec
[    1.921454] no red_led, ignore it!
[    1.925227] no green_led, ignore it!
[    1.929540] no led_0, ignore it!
[    1.933164] no led_1, ignore it!
[    1.936741] no led_2, ignore it!
[    1.940349] no led_3, ignore it!
[    1.943925] no led_4, ignore it!
[    1.947500] no led_5, ignore it!
[    1.951106] no led_6, ignore it!
[    1.954683] no led_7, ignore it!
[    1.958853] usbcore: registered new interface driver usbhid
[    1.965070] usbhid: USB HID core driver
[    1.969436] stepcore_data_init: allocated 196708 bytes for stepdata structure
[    1.977825] stepCore_init: success
[    1.983304] script_get_item audio_pa_ctrl not found
[    1.994755] asoc: sndcodec <-> sunxi-codec mapping ok
[    2.000678] mmc0: new high speed SDHC card at address 0007
[    2.001739] [sPDIF]sunxi-spdif cannot find any using configuration for controllers, return directly!
[    2.002019] [sPDIF]sndspdif cannot find any using configuration for controllers, return directly!
[    2.002030] [sPDIF] driver not init,just return.
[    2.002263] u32 classifier
[    2.002271]     Actions configured
[    2.002279] Netfilter messages via NETLINK v0.30.
[    2.002381] nf_conntrack version 0.5.0 (11773 buckets, 47092 max)
[    2.003002] ctnetlink v0.93: registering with nfnetlink.
[    2.003094] NF_TPROXY: Transparent proxy support initialized, version 4.1.0
[    2.003102] NF_TPROXY: Copyright © 2006-2007 BalaBit IT Ltd.
[    2.003551] xt_time: kernel timezone is -0000
[    2.003705] IPv4 over IPv4 tunneling driver
[    2.004431] gre: GRE over IPv4 demultiplexor driver
[    2.004441] ip_gre: GRE over IPv4 tunneling driver
[    2.005422] ip_tables: © 2000-2006 Netfilter Core Team
[    2.005762] arp_tables: © 2002 David S. Miller
[    2.005860] TCP: cubic registered
[    2.005867] Initializing XFRM netlink socket
[    2.006302] NET: Registered protocol family 10
[    2.008117] Mobile IPv6
[    2.008178] ip6_tables: © 2000-2006 Netfilter Core Team
[    2.008495] IPv6 over IPv4 tunneling driver
[    2.010305] NET: Registered protocol family 17
[    2.010357] NET: Registered protocol family 15
[    2.010375] L2TP core driver, V2.0
[    2.010381] L2TP IP encapsulation support (L2TPv3)
[    2.010472] L2TP netlink interface
[    2.010521] L2TP ethernet pseudowire support (L2TPv3)
[    2.010529] lib80211: common routines for IEEE802.11 drivers
[    2.016892] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    2.016915] ThumbEE CPU extension supported.
[    2.016943] Registering SWP/SWPB emulation handler
[    2.026825] sunxi-rtc sunxi-rtc: setting system clock to 1970-01-01 07:00:10 UTC (25210)
[    2.026845] ths_fetch_sysconfig_para: type err  device_used = 1. 
[    2.028647] CPU Budget:corekeeper enabled
[    2.029029] CPU Budget:Register notifier
[    2.029039] CPU Budget:register Success
[    2.029049] sunxi-budget-cooling sunxi-budget-cooling: Cooling device registered: thermal-budget-0
[    2.036956] ALSA device list:
[    2.036962]   #0: audiocodec
[    2.105850] mmcblk0: mmc0:0007 SD32G 29.0 GiB 
[    2.110690]  mmcblk0: p1 p2 p3 p4
[    2.112261] *******************sd init ok*******************
[    2.242688] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.267732] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.274839] Freeing init memory: 280K
[    2.590189] systemd[1]: Failed to insert module 'kdbus': Function not implemented

 

So, if there is interrest i will let you know once i got it stuffed onto Github. In case anyone wants it before that i can just bzip it up and put it on my server.

 

Greetings,

 

Chris

Share this post


Link to post
Share on other sites

Hello.

Some questions if you please?

Where do you get all the patches for the Armbian functionalities, from the armbian build??..

Also, the RT patch you (Chrisk) are providing, is one you created, why not use this one

https://rt.wiki.kernel.org/index.php/Main_Page

Also. Igor....where do you remove .disable to use this RT-patch its all ready been tested, and from where does it come from from the page i put above? (I ask this, because I need to patch an Orange pi kernel with this RT patch. So I was thinking in including the preempt-RT patch on the patches folder on the Armbian build (which i have started looking not so long ago. My first strategy was to use buildroot, but have problems with all the patches and now desided to use Armbian and patch it with the preempt-RT patch)).

Thanks in advance.

 

Share this post


Link to post
Share on other sites

patch/kernel/sun8i-default

Patch is here: https://github.com/armbian/build/blob/master/patch/kernel/sun8i-default/30-real-time143-full-plus-rt-fixes.patch.disabled 

This patch is here around for some time and also kernel is around for some time. Support is slowly fading out ... but was the only one for those boards until recently.
 

Just remove .disabled in the file name and remember that there are limitations - full preempt is not able to compile. I am monitoring to bring RT to the modern kernel, which would be much better ... latest patches are designed for 4.4, (usable) support for H3 started at (our) 4.13 ... haven't tried if its possible to adopt in some sane time. For some serious patch adjusting, we don't have resources.

Share this post


Link to post
Share on other sites

Hello.

Thanks for your answer Igor.

I am trying to patch for RT, to use an Orange pi zero.

In the build folder, in build/patch/kernel/,  there is the sun8i-default, and the sun8i-dev folders..What is the difference between this 2 (I am kind of neewbie in this). also, why is it necessary to u-boot, and the patches I would need for Orange pi zero are u-boot-sunxi (right?)

Thanks a lot in advance.

Share this post


Link to post
Share on other sites
2 hours ago, nwk said:

And another thing please...

The kernel used for using this patches is this one (https://github.com/orangepi-xunlong/orangepi_h3_linux) ??


Yes, the took it from us and you don't want to use their crappy tools. They are not newbie friendly.

 

2 hours ago, nwk said:

In the build folder, in build/patch/kernel/,  there is the sun8i-default, and the sun8i-dev folders..What is the difference between this 2 (I am kind of neewbie in this)


"dev" is development branch which is in the process of deleting since its getting merged into the common sunxi-next kernel. When RT patches are available for 4.13.x this would be the best way to go. Currently, it's n/a.

Share this post


Link to post
Share on other sites

Thanks a lot for the reply.

In the page

https://rt.wiki.kernel.org/index.php/Main_Page

There is  3.4-rt patch....

https://www.kernel.org/pub/linux/kernel/projects/rt/3.4/

Isn't that usable with the 3.4.113-sun8i kernel....??

downloading the kernel, using current working armbian .config, putting all the things needed (getting this things from Armbian/build/patch/sun8i-default), then add the RT patch, and compile it.

Would this give an RT OS to use with the orange pi zero?.

Thanks a lot.

 

Share this post


Link to post
Share on other sites

Hello Again.

I am triying to compile the OS with the Armbian compilation tool. I have enabled the RT patch (by errasing .desable), but I gen an error:

          

                               [ error ] ERROR in function compile_kernel [ compilation.sh:339 ]

 

In the compilation.sh, the line 338, is:

if [[ ${PIPESTATUS[0]} -ne 0 || ! -f arch/$ARCHITECTURE/boot/$KERNEL_IMAGE_TYPE ]]; then
        exit_with_error "Kernel was not built" "@host"

 

I dont know what actually this menas.

What could it be done to fix this??

 

 Thanks a lot in advance.

 

Share this post


Link to post
Share on other sites

Hi.

I managed to compile it, I did with Buildroot, the sun8i-default, a .config from a previus armbian i was using, and the kernel patches from the build, It has all compile well, but havent tried it yet.

I will post when i try it,, hopefully in some hours.

Thanks a lot for the answers.

nwk

Share this post


Link to post
Share on other sites

If you see, there it says, orange pi pc....I used this defconfig from buildroot, with some changes to meet the parameters i needed.. I attach the defconfig used.

The . config used, is from an armbian which i erased the things i didnt need. also, I used the RT patch provided.

The compilation runs good.

Thaks a lot in advance.

 

** One thing maybe. I did not applied the patches for u-boot...maybe that could be the problem???... I use the moment to ask, why does the u-boot need to be patched??.

 

 

orangepi_pc_defconfig

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
4 4