Adding OpenWrt support for Xiaomi AX3600 (Part 1)

Sure, here it is:
earlycon=msm_serial_dm,0x78b3000 console=ttyS0,115200n8

You also need to force the cmdline.

This address is UART5, check what UART you use first

1 Like

Unfortunately there is not more output as before even with earlycon in the commandline.
UART5 should be right it's the same as in u-boot.

I tried the elf image and again the initramfs.itb

1 Like

I guess git bisect time :frowning:

1 Like

Since we really need to test the bootup... and if someone has lots of time, what could be quicker is test older kernel version and remove any patch that doesn't apply to the newer kernel (starting with the newer) (both generic and ipq807x) i mean it's 4 kernel version not that much ahahha

1 Like

I had a chance to test 5.10-rc1 on the IPQ6018 CP01-C1 board, and it has the same issue.
Simply no output after Jumping to AARCH64 kernel via monitor

Ok, this now makes no sense.
Its gotta be something upstream.

Update, I fixed the earlycon address and this is a clue:

Starting kernel ...

Jumping to AARCH64 kernel via monitor
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x51af8014]
[    0.000000] Linux version 5.10.0-rc1 (robimarko@localhost.localdomain) (aarch64-linux-gcc.br_real (Buildroot 2020.08.1) 10.2.0, GNU ld (GNU Binutils) 2.34) #356 SMP Sun Nov 1 23:36:54 CET 2020
[    0.000000] Machine model: Qualcomm Technologies, Inc. IPQ6018/AP-CP01-C1
[    0.000000] earlycon: msm_serial_dm0 at MMIO 0x00000000078b1000 (options '')
[    0.000000] printk: bootconsole [msm_serial_dm0] enabled
[    0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x000000004a5fffff]
[    0.000000]   node   0: [mem 0x0000000050000000-0x000000007fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] psci: OSI mode supported.

Ok, it points to this:

Ok, so reducing the load and entry address for uImage by 0x80000 solved that warning, unfortunately it still hangs after PSCI.

I suspect the same things is bugging IPQ807x as well as everybody using the old load and entry addresses

3 Likes

Haha, it was the damn text offset in load address.
Upon changing load and entry addresses earlycon now magically works.
Ok, it still panics, but we are making progress.

## Loading kernel from FIT Image at 44000000 ...
   Using 'config@ac04' configuration
   Trying 'kernel@1' kernel subimage
     Description:  ARM64 OpenWrt Linux-5.9.2
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x440000e8
     Data Size:    7478457 Bytes = 7.1 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x41000000
     Entry Point:  0x41000000
     Hash algo:    crc32
     Hash value:   1780a4c6
     Hash algo:    sha1
     Hash value:   b36d412410ae77f42ddc6da8f1012ac9170d6c8e
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 44000000 ...
   Using 'config@ac04' configuration
   Trying 'fdt@1' fdt subimage
     Description:  ARM64 OpenWrt xiaomi_ax3600 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x44721ee4
     Data Size:    14718 Bytes = 14.4 KiB
     Architecture: AArch64
     Hash algo:    crc32
     Hash value:   df176d13
     Hash algo:    sha1
     Hash value:   8f4c19bfdbaaaddd7b9030729daa657ba36cc673
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x44721ee4
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 4a3f9000, end 4a3ff97d ... OK
Using machid 0x8010010 from environment

Starting kernel ...

Jumping to AARCH64 kernel via monitor
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.9.2 (robimarko@localhost.localdomain) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 8.4.0 r14812-22dee1667a) 8.4.0, GNU ld (GNU Binutils) 2.34) #0 SMP PREEMPT Sat Oct 31 22:16:37 2020
[    0.000000] Machine model: Xiaomi Mi AIoT Router AX3600
[    0.000000] earlycon: msm_serial_dm0 at MMIO 0x00000000078b3000 (options '')
[    0.000000] printk: bootconsole [msm_serial_dm0] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000041000000-0x000000004a5fffff]
[    0.000000]   node   0: [mem 0x000000004ab00000-0x000000004abfffff]
[    0.000000]   node   0: [mem 0x000000004e800000-0x00000000504fffff]
[    0.000000]   node   0: [mem 0x0000000050f00000-0x000000005fffffff]
[    0.000000] Zeroed struct page in unavailable ranges: 1280 pages
[    0.000000] Initmem setup node 0 [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] psci: OSI mode supported.
[    0.000000] percpu: Embedded 21 pages/cpu s48728 r8192 d29096 u86016
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 106092
[    0.000000] Kernel command line: earlycon=msm_serial_dm,0x78b3000
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 395444K/431104K available (7550K kernel code, 482K rwdata, 2348K rodata, 6400K init, 281K bss, 35660K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] random: get_random_bytes called from start_kernel+0x348/0x524 with crng_init=0
[    0.000000] arch_timer: cp15 and mmio timer(s) running at 19.20MHz (virt/virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000005] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.010870] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=76800)
[    0.018757] pid_max: default: 32768 minimum: 301
[    0.029293] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.033860] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.042350] rcu: Hierarchical SRCU implementation.
[    0.049055] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.053821] smp: Bringing up secondary CPUs ...
[    0.061632] Detected VIPT I-cache on CPU1
[    0.061689] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.062308] Detected VIPT I-cache on CPU2
[    0.062345] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.062924] Detected VIPT I-cache on CPU3
[    0.062959] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.063035] smp: Brought up 1 node, 4 CPUs
[    0.097140] SMP: Total of 4 processors activated.
[    0.101215] CPU features: detected: 32-bit EL0 Support
[    0.106006] CPU features: detected: CRC32 instructions
[    0.111069] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.116169] CPU: All CPU(s) started at EL1
[    0.124404] alternatives: patching kernel code
[    0.132623] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.133016] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.142832] pinctrl core: initialized pinctrl subsystem
[    0.150680] NET: Registered protocol family 16
[    0.155007] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.159243] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.166440] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.174477] thermal_sys: Registered thermal governor 'step_wise'
[    0.174480] thermal_sys: Registered thermal governor 'user_space'
[    0.182109] cpuidle: using governor ladder
[    0.194022] cpuidle: using governor menu
[    0.198146] NET: Registered protocol family 42
[    0.202200] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.206415] ASID allocator initialised with 65536 entries
[    0.252139] Unable to handle kernel paging request at virtual address 0000a00000000000
[    0.252172] Mem abort info:
[    0.258945]   ESR = 0x96000004
[    0.261631]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.264766]   SET = 0, FnV = 0
[    0.270229]   EA = 0, S1PTW = 0
[    0.273085] Data abort info:
[    0.276132]   ISV = 0, ISS = 0x00000004
[    0.279251]   CM = 0, WnR = 0
[    0.282817] [0000a00000000000] address between user and kernel address ranges
[    0.285945] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    0.293057] Modules linked in:
[    0.298439] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.2 #0
[    0.301564] Hardware name: Xiaomi Mi AIoT Router AX3600 (DT)
[    0.307384] pstate: 20400005 (nzCv daif +PAN -UAO BTYPE=--)
[    0.313207] pc : clk_core_get_parent_by_index+0x68/0xd8
[    0.318493] lr : __clk_init_parent+0x48/0x58
[    0.323698] sp : ffffffc0110fb9e0
[    0.328209] x29: ffffffc0110fb9e0 x28: 0000000000000000 
[    0.331425] x27: ffffff801f484000 x26: ffffffc011032cb8 
[    0.336806] x25: 00000000000000e3 x24: 0000000000000002 
[    0.342101] x23: ffffff801f4b6050 x22: ffffff801f4b5300 
[    0.347397] x21: ffffff801f4b6028 x20: 0000000000000028 
[    0.352693] x19: ffffff801f4b5300 x18: 0000000000000400 
[    0.357987] x17: 000000000000000c x16: 0000000000007fff 
[    0.363282] x15: ffffffffffffffff x14: ffffffffff000000 
[    0.368577] x13: 0000000000000005 x12: ffffffc011067740 
[    0.373873] x11: 0000000000000003 x10: 0101010101010101 
[    0.379167] x9 : 0000000000000000 x8 : 7f7f7f7f7f7f7f7f 
[    0.384462] x7 : 5e6c646c5e626266 x6 : 17000a3a5d3a1f3c 
[    0.389758] x5 : 3c1f3a5d3a0a0017 x4 : 0000000000000000 
[    0.395054] x3 : 0000000000000001 x2 : 0000a00000000000 
[    0.400347] x1 : 0000000000000001 x0 : ffffff801f4b5300 
[    0.405644] Call trace:
[    0.410937]  clk_core_get_parent_by_index+0x68/0xd8
[    0.413112]  __clk_init_parent+0x48/0x58
[    0.417971]  __clk_register+0x3c0/0x790
[    0.422135]  clk_hw_register+0x20/0x60
[    0.425694]  devm_clk_hw_register+0x48/0xa0
[    0.429516]  devm_clk_register_regmap+0x44/0x88
[    0.433596]  qcom_cc_really_probe+0x178/0x1c8
[    0.438110]  qcom_cc_probe+0x34/0x48
[    0.442622]  gcc_ipq8074_probe+0x18/0x28
[    0.446272]  platform_drv_probe+0x54/0xa8
[    0.450174]  really_probe+0xe8/0x3a0
[    0.454080]  driver_probe_device+0x58/0xb8
[    0.457726]  __device_attach_driver+0x84/0xc8
[    0.461633]  bus_for_each_drv+0x6c/0xb0
[    0.466059]  __device_attach+0xd8/0x150
[    0.469704]  device_initial_probe+0x14/0x20
[    0.473524]  bus_probe_device+0x9c/0xa8
[    0.477690]  fw_devlink_resume+0x84/0x110
[    0.481516]  of_platform_default_populate_init+0xb0/0xd0
[    0.485682]  do_one_initcall+0x74/0x1cc
[    0.491061]  kernel_init_freeable+0x1d4/0x238
[    0.494622]  kernel_init+0x14/0x114
[    0.499132]  ret_from_fork+0x10/0x30
[    0.502438] Code: d50323bf d65f03c0 f94002a2 b4000282 (f9400042) 
[    0.506259] ---[ end trace 29a04662c0582554 ]---
[    0.512240] Kernel panic - not syncing: Fatal exception
[    0.516932] SMP: stopping secondary CPUs
[    0.521882] Rebooting in 5 seconds..
1 Like

0000a0 looks like a error pointer treated as pointer...

Most likely, there have been similar stuff in Qualcomm clk drivers.
It should be easy to find with stack trace decoding, I am glad that it boots.

Now we can done some good stuff.

1 Like

so the problem was in a wrong load address ?

Yes, ARM64 before 5.8 was using TEXT_OFFSET of 0x80000.
Since this was a legacy thing carried over from ARM and never intended to be used, it was changed to 0x0 in 5.8 and a warning like I saw on IPQ6018 which at least printed something was added.
Then in 5.10 TEXT_OFFSET was dropped completely.

The issue is that everybody simply added the 0x80000 to uImage load and entry addresses, and since OpenWrt kernel config does not enable relocation support by default kernel would not even start.
If we had enabled the relocation it would at least start enough to print the warning when using earlycon.

Subtracting 0x80000 from the load and start addresses resolves that, I have pushed that to my branch.

Anyway, I am going to sleep.
Should have some time tommorow to try and find where is it panicking.

5 Likes

Sorry for the stupid question... since they dropped TEXT_OFFSET now this needs to be fixed for all the target

Well, it only affects ARM64 aka AARCH64 targets, ARM is not affected as it required TEXT_OFFSET which is platform specific.

So, yes this will need to be corrected for all 64bit ARM targets in OpenWrt

2 Likes

It boots on the RAX120 as well without a panic, but later stucks at random: 3 urandom warning(s) missed due to ratelimiting

Jumping to AARCH64 kernel via monitor
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.9.1 (dirk@t14s) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 8.4.0 unknown) 8.4.0, GNU ld (GNU Binutils) 2.34) #0 SMP PREEMPT Sun Oct 25 13:00:55 2020
[    0.000000] Machine model: Qualcomm Technologies, Inc. IPQ8074-HK01
[    0.000000] earlycon: msm_serial_dm0 at MMIO 0x00000000078b3000 (options '')
[    0.000000] printk: bootconsole [msm_serial_dm0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000041000000-0x000000007fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000041000000-0x000000004a3fffff]
[    0.000000]   node   0: [mem 0x000000004a600000-0x000000004aafffff]
[    0.000000]   node   0: [mem 0x0000000050b20000-0x000000007fffffff]
[    0.000000] Zeroed struct page in unavailable ranges: 256 pages
[    0.000000] Initmem setup node 0 [mem 0x0000000041000000-0x000000007fffffff]
[    0.000000] On node 0 totalpages: 232928
[    0.000000]   DMA zone: 3640 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 232928 pages, LIFO batch:63
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] psci: OSI mode supported.
[    0.000000] percpu: Embedded 22 pages/cpu s49240 r8192 d32680 u90112
[    0.000000] pcpu-alloc: s49240 r8192 d32680 u90112 alloc=22*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 229288
[    0.000000] Kernel command line: ubi.mtd=rootfs root=/dev/ubiblock0_1 rootfstype=squashfs rootwait earlycon=msm_serial_dm,0x78b3000 console=ttyS0,115200n8 debug
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 890852K/931712K available (7292K kernel code, 408K rwdata, 2356K rodata, 10240K init, 284K bss, 40860K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] random: get_random_bytes called from start_kernel+0x340/0x498 with crng_init=0
[    0.000000] arch_timer: cp15 and mmio timer(s) running at 19.20MHz (virt/virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000002] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.010826] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=76800)
[    0.018753] pid_max: default: 32768 minimum: 301
[    0.029233] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.033854] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.042080] rcu: Hierarchical SRCU implementation.
[    0.049054] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.053727] EFI services will not be available.
[    0.061303] smp: Bringing up secondary CPUs ...
[    0.066065] Detected VIPT I-cache on CPU1
[    0.066099] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.066452] Detected VIPT I-cache on CPU2
[    0.066471] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.066801] Detected VIPT I-cache on CPU3
[    0.066818] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.066855] smp: Brought up 1 node, 4 CPUs
[    0.101818] SMP: Total of 4 processors activated.
[    0.105896] CPU features: detected: 32-bit EL0 Support
[    0.110680] CPU features: detected: CRC32 instructions
[    0.115731] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.120841] CPU: All CPU(s) started at EL1
[    0.129081] alternatives: patching kernel code
[    0.135367] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.137693] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.147434] pinctrl core: initialized pinctrl subsystem
[    0.154433] regulator-dummy: no parameters
[    0.159503] DMI not present or invalid.
[    0.163820] NET: Registered protocol family 16
[    0.167471] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.171806] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.179007] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.186893] thermal_sys: Registered thermal governor 'step_wise'
[    0.186895] thermal_sys: Registered thermal governor 'user_space'
[    0.194604] cpuidle: using governor ladder
[    0.206595] cpuidle: using governor menu
[    0.210643] NET: Registered protocol family 42
[    0.214770] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.218964] ASID allocator initialised with 65536 entries
[    0.245091] pps_core: LinuxPPS API ver. 1 registered
[    0.245114] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.249194] PTP clock support registered
[    0.258472] Advanced Linux Sound Architecture Driver Initialized.
[    0.262159] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.268564] clocksource: Switched to clocksource arch_sys_counter
[    0.278119] NET: Registered protocol family 2
[    0.284094] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.288200] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.296386] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.304401] TCP: Hash tables configured (established 8192 bind 8192)
[    0.311436] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.317888] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.324308] NET: Registered protocol family 1
[    0.331511] PCI: CLS 0 bytes, default 64
[    0.362796] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.365184] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.368208] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.400159] qcom-qmp-phy 86000.phy: Failed to get clk 'aux': -2
[    0.400185] qcom-qmp-phy: probe of 86000.phy failed with error -2
[    0.404911] qcom-qmp-phy 8e000.phy: Failed to get clk 'aux': -2
[    0.411132] qcom-qmp-phy: probe of 8e000.phy failed with error -2
[    0.417615] msm_serial 78b1000.serial: msm_serial: detected port #1
[    0.423170] msm_serial 78b3000.serial: msm_serial: detected port #0
[    0.429208] msm_serial: driver initialized
[    0.439253] brd: module loaded
[    0.440871] libphy: Fixed MDIO Bus: probed
[    0.442629] i2c /dev entries driver
[    0.446806] i2c_qup 78b6000.i2c: 
[    0.446806]  tx channel not available
[    0.450497] sdhci: Secure Digital Host Controller Interface driver
[    0.457047] sdhci: Copyright(c) Pierre Ossman
[    0.463293] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.467862] sdhci_msm 7824900.sdhci: Peripheral clk setup failed (-517)
[    0.477492] NET: Registered protocol family 10
[    0.480288] Segment Routing with IPv6
[    0.484338] NET: Registered protocol family 17
[    0.488054] 8021q: 802.1Q VLAN Support v1.8
[    0.493716] msm_serial 78b1000.serial: msm_serial: detected port #1
[    0.496581] msm_serial 78b3000.serial: msm_serial: detected port #0
[    0.503175] i2c_qup 78b6000.i2c: 
[    0.503175]  tx channel not available
[    0.509166] sdhci_msm 7824900.sdhci: Peripheral clk setup failed (-517)
[    0.516491] msm_serial 78b1000.serial: msm_serial: detected port #1
[    0.522628] msm_serial 78b3000.serial: msm_serial: detected port #0
[    0.529201] i2c_qup 78b6000.i2c: 
[    0.529201]  tx channel not available
[    0.535166] sdhci_msm 7824900.sdhci: Peripheral clk setup failed (-517)
[    0.542105] UBI error: cannot open mtd rootfs, error -2
[    0.548641] ALSA device list:
[    0.553744]   No soundcards found.
[    0.556895] Warning: unable to open an initial console.
[    0.563378] Freeing unused kernel memory: 10240K
[    0.584615] Run /init as init process
[    0.584630]   with arguments:
[    0.587238]     /init
[    0.590197]   with environment:
[    0.592446]     HOME=/
[    0.595402]     TERM=linux
[    0.601225] init: Console is alive
[    0.601335] init: - watchdog -
[    0.606372] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    0.606989] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    0.614270] init: - preinit -
[    0.670886] random: jshn: uninitialized urandom read (4 bytes read)
[    0.679415] random: jshn: uninitialized urandom read (4 bytes read)
[    0.684216] random: jshn: uninitialized urandom read (4 bytes read)
[    2.722514] procd: - early -
[    2.722562] procd: - watchdog -
[    3.232482] procd: - watchdog -
[    3.232601] procd: failed to set stdio: No such device
[    3.234437] procd: - ubus -
[    3.241456] urandom_read: 1 callbacks suppressed
[    3.241461] random: ubusd: uninitialized urandom read (4 bytes read)
[    3.289194] random: ubusd: uninitialized urandom read (4 bytes read)
[    3.289317] random: ubusd: uninitialized urandom read (4 bytes read)
[    3.294881] procd: - init -
[    3.369023] kmodloader: loading kernel modules from /etc/modules.d/*
[    3.370235] urngd: v1.0.2 started.
[    3.380732] xt_time: kernel timezone is -0000
[    3.384899] PPP generic driver version 2.4.2
[    3.385328] NET: Registered protocol family 24
[    3.390995] kmodloader: done loading kernel modules from /etc/modules.d/*
[    3.392720] random: crng init done
[    3.399522] random: 3 urandom warning(s) missed due to ratelimiting
1 Like

Its missing the base files script to drop you into shell.

Its weird that it boots on RAX120

1 Like

Nice work, I would never have found that myself :smiley:

Possible its some difference between IPQ8074 V1 and V2 on the RAX120 (QSDK had sone changes in GCC drivers I think)

1 Like

Could be but I would think that V2 would boot rather than V1 since that's the only one supported upstream.

1 Like

@Ansuel Do you maybe have time for some of your magic?
I am looking at the clock issue, but the stack trace does not really point to a specific issue as the clock driver gets probed, etc, but it fails on clk_core_get_parent_by_index.
That's not really helpful as that one gets called a lot of times

 [robimarko@localhost linux-5.9.2]$ ./scripts/decode_stacktrace.sh vmlinux . < log 
[    0.226770] Unable to handle kernel paging request at virtual address 0000a00000000000
[    0.226802] Mem abort info:
[    0.233575]   ESR = 0x96000004
[    0.236260]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.239394]   SET = 0, FnV = 0
[    0.244857]   EA = 0, S1PTW = 0
[    0.247715] Data abort info:
[    0.250759]   ISV = 0, ISS = 0x00000004
[    0.253881]   CM = 0, WnR = 0
[    0.257445] [0000a00000000000] address between user and kernel address ranges
[    0.260576] Internal error: Oops: 96000004 [#1] SMP
[    0.267686] Modules linked in:
[    0.272375] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.2 #0
[    0.275500] Hardware name: Xiaomi Mi AIoT Router AX3600 (DT)
[    0.281319] pstate: 20400005 (nzCv daif +PAN -UAO BTYPE=--)
[    0.287141] pc : clk_core_get_parent_by_index (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:426 /home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:452) 
[    0.292428] lr : __clk_init_parent (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:2434) 
[    0.297633] sp : ffffffc010e4b9e0
[    0.302144] x29: ffffffc010e4b9e0 x28: 0000000000000000
[    0.305361] x27: ffffff801ed5c000 x26: ffffffc010dab100
[    0.310743] x25: 00000000000000e3 x24: 0000000000000002
[    0.316037] x23: ffffff801ee4f7d0 x22: ffffff801ee50a00
[    0.321332] x21: ffffff801ee4f7a8 x20: 0000000000000028
[    0.326627] x19: ffffff801ee50a00 x18: 0000000000000014
[    0.331923] x17: 00000000b466c13f x16: 00000000d0130fee
[    0.337218] x15: ffffffffffffffff x14: ffffffffff000000
[    0.342512] x13: 0000000000000005 x12: 0000000000000000
[    0.347807] x11: 0000000000000003 x10: 0101010101010101
[    0.353103] x9 : 0000000000000000 x8 : 7f7f7f7f7f7f7f7f
[    0.358398] x7 : 5e6c646c5e626266 x6 : 17000a3a5d3a1f3c
[    0.363694] x5 : 3c1f3a5d3a0a0017 x4 : 0000000000000000
[    0.368989] x3 : 0000000000000001 x2 : 0000a00000000000
[    0.374283] x1 : 0000000000000001 x0 : ffffff801ee50a00
[    0.379580] Call trace:
[    0.384872] clk_core_get_parent_by_index (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:426 /home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:452) 
[    0.387045] __clk_init_parent (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:2434) 
[    0.391906] __clk_register (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:3456 /home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:3827) 
[    0.396071] clk_hw_register (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/./include/linux/err.h:60 /home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:3902) 
[    0.399630] devm_clk_hw_register (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/clk.c:4130) 
[    0.403450] devm_clk_register_regmap (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/qcom/clk-regmap.c:104) 
[    0.407530] qcom_cc_really_probe (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/qcom/common.c:288) 
[    0.412043] qcom_cc_probe (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/qcom/common.c:309) 
[    0.416560] gcc_ipq8074_probe (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/clk/qcom/gcc-ipq8074.c:4777) 
[    0.420205] platform_drv_probe (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/platform.c:748) 
[    0.424112] really_probe (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/dd.c:557) 
[    0.428017] driver_probe_device (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/dd.c:738) 
[    0.431663] __device_attach_driver (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/dd.c:845) 
[    0.435570] bus_for_each_drv (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/bus.c:431) 
[    0.439996] __device_attach (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/dd.c:914) 
[    0.443641] device_initial_probe (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/dd.c:960) 
[    0.447462] bus_probe_device (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/bus.c:491) 
[    0.451626] fw_devlink_resume (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/base/core.c:1562 (discriminator 12)) 
[    0.455449] of_platform_default_populate_init (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/drivers/of/platform.c:545) 
[    0.459618] do_one_initcall (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/init/main.c:1229) 
[    0.464995] kernel_init_freeable (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/init/main.c:1301 /home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/init/main.c:1318 /home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/init/main.c:1338 /home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/init/main.c:1538) 
[    0.468556] kernel_init (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/init/main.c:1429) 
[    0.473067] ret_from_fork (/home/robimarko/Building/AX3600/ipq807x-5.9/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/linux-5.9.2/arch/arm64/kernel/entry.S:926) 
[ 0.476375] Code: d50323bf d65f03c0 f94002a2 b4000282 (f9400042)
All code
========
   0:	bf 23 03 d5 c0       	mov    $0xc0d50323,%edi
   5:	03 5f d6             	add    -0x2a(%rdi),%ebx
   8:	a2 02 40 f9 82 02 00 	movabs %al,0x42b4000282f94002
   f:	b4 42 
  11:*	00 40 f9             	add    %al,-0x7(%rax)		<-- trapping instruction

Code starting with the faulting instruction
===========================================
   0:	42 00 40 f9          	rex.X add %al,-0x7(%rax)
[    0.480193] ---[ end trace 211af497def0fa5e ]---
1 Like

Just a thought, looks like @kirdes RAX120 booted with the HK01 DTS. I know there are only minor differences but maybe worth trying that DTS as is ?

1 Like

Already tried using HK01 DTS, it has the same issue

1 Like

In that case it may be worth printing the clk_core name in clk_core_get_parent_by_index to see what parent it is trying to look up.

1 Like