Porting to Ruijie X32 Pro Router but can not find PCI-E device, with "failed to get sys_ck0 clock" error

Hi, I am from China and porting to Ruijie X32 Pro using Openwrt 21.x source code.
Ruijie X32 Pro router is based on MT7622 with customized Openwrt 18.x, and the hardware structure is almose the same as Linksys E8450, except ROM is 16MB SPI NOR. Device Tree source converted from stock firmware can confirm this point.

But when I copied, adjusted dts file and made a final firmware image to burn it to router, router could not find PCI-E devices, infinity halting with "failed to get sys_ck0 clock" and rebooting forced by watchdog.

I think the problem is the wrong paramters in dts file, but can not find any clues.

Can someone give me hints? Thanks!

Port DTS files can be seen from this repo url:

Factory DTS files:

Difference between factory DTS files: linksys-E8450.dts vs ruijie-x32-pro.dts:

Failed bootlog


Starting kernel ...

[ATF][     4.994903]save kernel info
[ATF][     4.997839]Kernel_EL2
[ATF][     5.000509]Kernel is 64Bit
[ATF][     5.003597]pc=0x44000000, r0=0x4cf43000, r1=0x0
INFO:    BL3-1: Preparing for EL3 exit to normal world, Kernel
INFO:    BL3-1: Next image address = 0x44000000
INFO:    BL3-1: Next image spsr = 0x3c9
[ATF][     5.021295]el3_exit
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.10.61 (openwrt-build@openwrt-build) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 10.3.0 r17465+3-bf94c2da3e) 10.3.0, GNU ld (GNU Binutils) 2.36.1) #0 SMP Tue Aug 31 14:24:32 2021
[    0.000000] Machine model: Ruijie X32 Pro
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000004fffffff]
[    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-0x0000000042ffffff]
[    0.000000]   node   0: [mem 0x0000000043000000-0x000000004302ffff]
[    0.000000]   node   0: [mem 0x0000000043030000-0x000000004fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000004fffffff]
[    0.000000] On node 0 totalpages: 65536
[    0.000000]   DMA zone: 1024 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 65536 pages, LIFO batch:15
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] percpu: Embedded 21 pages/cpu s46296 r8192 d31528 u86016
[    0.000000] pcpu-alloc: s46296 r8192 d31528 u86016 alloc=21*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] CPU features: detected: ARM erratum 843419
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64512
[    0.000000] Kernel command line: console=ttyS0,115200n1 loglevel=8 swiotlb=512                               rootfstype=squashfs
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 245480K/262144K available (6334K kernel code, 944K rwdata, 2016K rodata, 1408K init, 264K bss, 16664K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    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] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
[    0.000000] random: get_random_bytes called from start_kernel+0x59c/0x794 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 12.50MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049cda, max_idle_ns: 440795202628 ns
[    0.000003] sched_clock: 56 bits at 12MHz, resolution 80ns, wraps every 4398046511080ns
[    0.000192] Console: colour dummy device 80x25
[    0.000217] Calibrating delay loop (skipped), value calculated using timer frequency.. 25.00 BogoMIPS (lpj=50000)
[    0.000227] pid_max: default: 32768 minimum: 301
[    0.000308] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000315] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.001300] rcu: Hierarchical SRCU implementation.
[    0.001593] smp: Bringing up secondary CPUs ...
[    0.001934] Detected VIPT I-cache on CPU1
[    0.001983] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.002059] smp: Brought up 1 node, 2 CPUs
[    0.002067] SMP: Total of 2 processors activated.
[    0.002073] CPU features: detected: 32-bit EL0 Support
[    0.002079] CPU features: detected: CRC32 instructions
[    0.007984] CPU: All CPU(s) started at EL2
[    0.008007] alternatives: patching kernel code
[    0.011786] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.011804] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.011900] pinctrl core: initialized pinctrl subsystem
[    0.012442] NET: Registered protocol family 16
[    0.012759] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.012790] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.012822] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.013154] thermal_sys: Registered thermal governor 'step_wise'
[    0.013941] cpuidle: using governor menu
[    0.014008] ASID allocator initialised with 65536 entries
[    0.014309] Serial: AMBA PL011 UART driver
[    0.022502] OF: /gsw@0: could not get #gpio-cells for /pinctrl@10211000/spic1-pins
[    0.043523] vgaarb: loaded
[    0.045098] clocksource: Switched to clocksource arch_sys_counter
[    0.048316] NET: Registered protocol family 2
[    0.048422] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.048757] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.048772] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.048791] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.048824] TCP: Hash tables configured (established 2048 bind 2048)
[    0.048904] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.048920] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.049029] NET: Registered protocol family 1
[    0.049053] PCI: CLS 0 bytes, default 64
[    0.054642] workingset: timestamp_bits=46 max_order=16 bucket_order=0
[    0.058060] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.058074] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.058648] io scheduler mq-deadline registered
[    0.058655] io scheduler kyber registered
[    0.059094] mtk-tphy 1a0c4000.usb-phy: failed to get ref_clk(id-1)
[    0.059716] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    0.059739] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    0.059886] mtk-pcie 1a143000.pcie: failed to get sys_ck0 clock
[    0.059999] mtk-pcie 1a145000.pcie: host bridge /pcie@1a145000 ranges:
[    0.060014] mtk-pcie 1a145000.pcie:      MEM 0x0028000000..0x002fffffff -> 0x0028000000
[    0.060042] mtk-pcie 1a145000.pcie: failed to get sys_ck1 clock
[    0.060465] mt-pmic-pwrap 10001000.pwrap: unexpected interrupt int=0x1
[    0.062620] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.063601] printk: console [ttyS0] disabled
[    0.083819] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 22, base_baud = 1562500) is a ST16650V2
[    0.676742] printk: console [ttyS0] enabled
[    0.701707] 11004000.serial: ttyS1 at MMIO 0x11004000 (irq = 23, base_baud = 1562500) is a ST16650V2
[    0.711557] 1100c000.serial: ttyS2 at MMIO 0x1100c000 (irq = 27, base_baud = 17499995) is a MediaTek BTIF
[    0.721537] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.729480] mtk-spi-nor 11014000.spi: IRQ not available.
[    0.735338] spi-nor spi2.0: w25q128 (16384 Kbytes)
[    0.740321] 8 fixed-partitions partitions found on MTD device spi2.0
[    0.746677] Creating 8 MTD partitions on "spi2.0":
[    0.751478] 0x000000000000-0x000000040000 : "Preloader"
[    0.757097] 0x000000040000-0x000000060000 : "ATF"
[    0.762045] 0x000000060000-0x0000000b0000 : "u-boot"
[    0.767203] 0x0000000b0000-0x0000000d0000 : "u-boot-env"
[    0.772714] 0x0000000d0000-0x000000150000 : "Factory"
[    0.778101] 0x000000150000-0x000000160000 : "product_info"
[    0.783794] 0x000000160000-0x000000170000 : "kdump"
[    0.788863] 0x000000170000-0x000001000000 : "firmware"
[    0.794340] 2 fit-fw partitions found on MTD device firmware
[    0.800005] 0x000000170000-0x000000460000 : "kernel"
[    0.805166] 0x000000470000-0x000001000000 : "rootfs"
[    0.810326] mtd: device 9 (rootfs) set to be root filesystem
[    0.816021] 1 squashfs-split partitions found on MTD device rootfs
[    0.822202] 0x000000cd0000-0x000001000000 : "rootfs_data"
[    0.831985] mtk-spi-nor 11014000.spi: spi frequency: 46666653 Hz
[    0.838657] libphy: Fixed MDIO Bus: probed
[    0.843323] PPP generic driver version 2.4.2
[    0.847698] PPP MPPE Compression module registered
[    0.853469] mtk-wdt 10212000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    0.861868] ipip: IPv4 and MPLS over IPv4 tunneling driver
[    0.867669] gre: GRE over IPv4 demultiplexor driver
[    0.872553] ip_gre: GRE over IPv4 tunneling driver
[    0.878371] NET: Registered protocol family 10
[    0.883603] Segment Routing with IPv6
[    0.887335] NET: Registered protocol family 17
[    0.891802] 8021q: 802.1Q VLAN Support v1.8
[    0.902822] mtk-tphy 1a0c4000.usb-phy: failed to get ref_clk(id-1)
[    0.909435] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    0.915984] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    0.924030] mtk-pcie 1a143000.pcie: failed to get sys_ck0 clock
[    0.930106] mtk-pcie 1a145000.pcie: host bridge /pcie@1a145000 ranges:
[    0.936638] mtk-pcie 1a145000.pcie:      MEM 0x0028000000..0x002fffffff -> 0x0028000000
[    0.944658] mtk-pcie 1a145000.pcie: failed to get sys_ck1 clock
[    0.950976] mtk-tphy 1a0c4000.usb-phy: failed to get ref_clk(id-1)
[    0.957364] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    0.963899] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    0.971926] mtk-pcie 1a143000.pcie: failed to get sys_ck0 clock
[    0.977962] mtk-pcie 1a145000.pcie: host bridge /pcie@1a145000 ranges:
[    0.984494] mtk-pcie 1a145000.pcie:      MEM 0x0028000000..0x002fffffff -> 0x0028000000
[    0.992517] mtk-pcie 1a145000.pcie: failed to get sys_ck1 clock
[    1.003024] VFS: Mounted root (squashfs filesystem) readonly on device 31:9.
[    1.010730] Freeing unused kernel memory: 1408K
[    1.029148] Run /sbin/init as init process
[    1.033245]   with arguments:
[    1.036202]     /sbin/init
[    1.038904]   with environment:
[    1.042040]     HOME=/
[    1.044390]     TERM=linux
[    1.539421] init: Console is alive
[    1.542936] init: - watchdog -
[    2.099853] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.290577] mtk-tphy 1a0c4000.usb-phy: failed to get ref_clk(id-1)
[    2.290969] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.297120] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    2.310561] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    2.314246] init: - preinit -