Adding OpenWrt Support for Netgear RAX120 (Nighthawk AX12)

Ok, thank you. I'll make some more tests. Have a good weekend.

@WiZaR5789 : I wasn't able to reliably test wifi, it crashes too often. I even tried with the firmware file from stock and it didn't change. Not sure what else to try.

To all: I created a patch (lots of copy-paste) for proper support of the Aquantia AQR111 5G lan interface my github repo. It involves adding the two IDs to the phy driver structure and creating a init method.

The firmware claims it supports 10G (if I understand the mdio output correct) and that messes with auto-negotiation.

$ mdio 900* mmd 7:1
...
SPEED(0x04): 0x6031
  capabilities: -100g -40g -10g/1g -10 +100 +1000 -10-ts -2-tl +10g
...
EXTABLE(0x0B): 0x40fc
  capabilities: -10g-cx4 -10g-lrm +10g-t +10g-kx4 +10g-kr +1000-t
                +1000-kx +100-tx -10-t +2.5g/5g-t

PKGID(0x0E/0x0F): 0x03a1b612

Would anyone with more knowledge (@robimarko again) than me be able to have a look at the patch and see if it make sense to them? Especially in the phy driver structure if all the (callbacks?) methods are useful. Like .*et_tunable, .suspend and .resume.

The patch is successfully tested with the RAX120v2 running from a initramfs, on a

  • QNAP QSW-M1204-4C, connected to a RJ45 10GbE port
    • speed set to 'auto', 5G, 2.5G and 1G
    • speed set to 'auto' & on RAX120v2 using ethtool set to 5G FDX, 2.5G FDX, 1G FDX, 100M FDX & HDX and autoneg on
  • again with the QNAP but using a MikroTik S+RJ10 on a SFP+ port (speed on the switch is alway 10G)
    • speed set to 'auto' & on RAX120v2 using ethtool set to 5G FDX, 2.5G FDX, 1G FDX, 100M FDX & HDX and autoneg on
  • MikroTik CSS610-8G-2S+, connected using the MikroTik S+RJ10 on a SFP+ port
    • speed set to 'auto' & on RAX120v2 using ethtool set to 5G FDX, 2.5G FDX, 1G FDX, 100M FDX & HDX and autoneg on

Addition: right now the 5G port is called 'lan5'. IMHO it would be more accurate to call it '5g-0' or '5g' since it can be used for either wan or lan.

1 Like

Its weird to see 10G being advertised

It is indeed. Something similar was done for the AQCS109 (where I copied it from), in aqcs109_config_init(). They write:

    /* AQCS109 belongs to a chip family partially supporting 10G and 5G.
     * PMA speed ability bits are the same for all members of the family,
     * AQCS109 however supports speeds up to 2.5G only.
     */

The AQR111 family of chips don't support 10G at all according to the product brief. Sloppy firmware programming maybe.

looks like almost there, and really looking forward to try this on my Rax120v2

Thank you for your dedicated efforts and hard work.

I have rebased the PR for RAX120v2 to include the lastest work from @robimarko which enables the testing kernel 6.1 for the IPQ807x target.

With the testing kernel everything works as well as with the 5.15 kernel. Wifi is not faster but didn't get worse either :slight_smile: ... the 5G lan5 port got a little bit faster (2.56G before, 2.6G now).

If someone got too much time on their hand to compile and test, it would be great to have some more feedback.

Also if we could get some feedback for the AQR111 patch. Running wise but also maybe someone with 'mdio' knowledge and has the RAX120v2 could have a look at it.
I don't seem to be able to find the documentation about the clause 45 registers and no datasheet for the AQR111. I'm confused in general but here specifically that mdio 9* mmd 7:1, mdio 9* mmd 7:3, mdio 9* mmd 7:4 and mdio 9* mmd 7:7 all return some data.

mmd 7:1
root@OpenWrt:~# mdio 9* mmd 7:1
CTRL1(0x00): 0x205c
  flags: -reset -low-power -remote-loopback -local-loopback
  speed: 5g

STAT1(0x01): 0x0006
  capabilities: -pias -peas +low-power
  flags:        -fault +link

DEVID(0x02/0x03): 0x03a1b612

SPEED(0x04): 0x6031
  capabilities: -100g -40g -10g/1g -10 +100 +1000 -10-ts -2-tl +10g

DEVS(0x06/0x05): 0xe000009a
  devices: +vendor2 +vendor1 +c22-ext -pma4 -pma3 -pma2 -pma1
           +aneg -tc -dte-xs +phy-xs +pcs -wis +pma/pmd -c22

CTRL2(0x07): 0x0009
  flags: -pias -peas
  type:  10g-t

STAT2(0x08): 0xb301
  capabilities: +tx-fault +rx-fault +ext-register +tx-disable +local-loopback
                -10g-sr -10g-lr -10g-er -10g-lx4 -10g-sw -10g-lw -10g-ew
  flags:        +present -tx-fault -rx-fault

EXTABLE(0x0B): 0x40fc
  capabilities: -10g-cx4 -10g-lrm +10g-t +10g-kx4 +10g-kr +1000-t
                +1000-kx +100-tx -10-t +2.5g/5g-t

PKGID(0x0E/0x0F): 0x03a1b612
mmd 7:3
root@OpenWrt:~# mdio 9* mmd 7:3
CTRL1(0x00): 0x2040
  flags: -reset -loopback -low-power -lpi-clock-stop
  speed: 10g

STAT1(0x01): 0x0082
  capabilities: -lpi-clock-stop +low-power
  flags:        -rx-lpi-recv -tx-lpi-recv -rx-lpi-ind -tx-lpi-ind +fault -link

DEVID(0x02/0x03): 0x03a1b612

SPEED(0x04): 0x00c1
  capabilities: -100g -40g -10-ts/2-tl +10g

DEVS(0x06/0x05): 0xe000009a
  devices: +vendor2 +vendor1 +c22-ext -pma4 -pma3 -pma2 -pma1
           +aneg -tc -dte-xs +phy-xs +pcs -wis +pma/pmd -c22

CTRL2(0x07): 0x0003
  type: 10g-t

STAT2(0x08): 0xbc09
  capabilities: -100g-r -40g-r +10g-t -10g-w -10g-x +10g-r
  flags:        +present +tx-fault +rx-fault

PKGID(0x0E/0x0F): 0x03a1b612
mmd 7:4
root@OpenWrt:~# mdio 9* mmd 7:4
DEVID(0x02/0x03): 0x03a1b612

DEVS(0x06/0x05): 0xe000009a
  devices: +vendor2 +vendor1 +c22-ext -pma4 -pma3 -pma2 -pma1
           +aneg -tc -dte-xs +phy-xs +pcs -wis +pma/pmd -c22

PKGID(0x0E/0x0F): 0x03a1b612
mmd 7:7
root@OpenWrt:~# mdio 9* mmd 7:7
CTRL1(0x00): 0x3000
  flags: -reset +ext-page +aneg-enable -aneg-restart

STAT1(0x01): 0x00ad
  capabilities: +aneg-capable +partner-capable
  flags:        +ext-page +parallel-fault -page +aneg-complete -remote-fault
                +link

DEVID(0x02/0x03): 0x03a1b612

DEVS(0x06/0x05): 0xe000009a
  devices: +vendor2 +vendor1 +c22-ext -pma4 -pma3 -pma2 -pma1
           +aneg -tc -dte-xs +phy-xs +pcs -wis +pma/pmd -c22

PKGID(0x0E/0x0F): 0x03a1b612

And I'll look at the why the device is referred to in the log as 'AQR111' although its ID matches 'AQR111B0'

Hello everyone.

Thanks for trying to add full support for rax120.
I've tried to build an image and boot from it, but got a kernel panic. May I ask someone to take a look ? Is there anything that I did wrong or do I have older version of hardware ?
Netgear UI show v2

tftpboot log:

IPQ807x# tftpboot openwrt-ipq807x-generic-netgear_rax120v2-initramfs-uImage.itb
ipq807x_eth_halt: done
eth0 PHY0 Down Speed :10 Half duplex
eth0 PHY1 Down Speed :10 Half duplex
eth0 PHY2 Down Speed :10 Half duplex
eth0 PHY3 up Speed :1000 Full duplex
eth0 PHY4 Down Speed :10 Half duplex
10M speed not supported
ipq807x_eth_init: done
Using eth0 device
TFTP from server 192.168.1.10; our IP address is 192.168.1.1
Filename 'openwrt-ipq807x-generic-netgear_rax120v2-initramfs-uImage.itb'.
Load address: 0x44000000
Loading: *
Got TFTP_OACK: TFTP remote port: changes from 69 to 48102
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################################################
         2.9 MiB/s
done
Bytes transferred = 11284140 (ac2eac hex)
ipq807x_eth_halt: done
IPQ807x# bootm
## Loading kernel from FIT Image at 44000000 ...
   Using 'config@hk01' configuration
   Trying 'kernel-1' kernel subimage
     Description:  ARM64 OpenWrt Linux-5.15.114
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x440000ec
     Data Size:    11236149 Bytes = 10.7 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x41000000
     Entry Point:  0x41000000
     Hash algo:    crc32
     Hash value:   5f89a89f
     Hash algo:    sha1
     Hash value:   e6d70901bf55ca897e21c79dd66a4870c969ed1c
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 44000000 ...
   Using 'config@hk01' configuration
   Trying 'fdt-1' fdt subimage
     Description:  ARM64 OpenWrt netgear_rax120v2 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x44ab7564
     Data Size:    46079 Bytes = 45 KiB
     Architecture: AArch64
     Hash algo:    crc32
     Hash value:   d0b90019
     Hash algo:    sha1
     Hash value:   4b169ddd83decdde71009b7d7006a3b645dcb107
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x44ab7564
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 4a770000, end 4a77e3fe ... OK
mtdids not defined, no default present
Using machid 0x8010000 from environment

Starting kernel ...

Jumping to AARCH64 kernel via monitor
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.114 (root@maxi) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r23202-4f7cf504eb) 12.3.0, GNU ld (GNU Binutils) 2.40.0)3
[    0.000000] Machine model: Netgear RAX120v2
[    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-0x0000000040ffffff]
[    0.000000]   node   0: [mem 0x0000000041000000-0x000000004a3fffff]
[    0.000000]   node   0: [mem 0x000000004a400000-0x000000004a5fffff]
[    0.000000]   node   0: [mem 0x000000004a600000-0x000000004aafffff]
[    0.000000]   node   0: [mem 0x000000004ab00000-0x00000000510fffff]
[    0.000000]   node   0: [mem 0x0000000051100000-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.
[    0.000000] percpu: Embedded 17 pages/cpu s30360 r8192 d31080 u69632
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258048
[    0.000000] Kernel command line: console=ttyMSM0,115200n8 ubi.mtd=rootfs root=/dev/ubiblock0_0
[    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: 886884K/1048576K available (7424K kernel code, 842K rwdata, 2040K rodata, 7744K init, 271K bss, 161692K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GICv2m: range[mem 0x0b00a000-0x0b00affc], SPI[448:479]
[    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.000000] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000067] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000076] pid_max: default: 32768 minimum: 301
[    0.000330] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000340] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.001509] rcu: Hierarchical SRCU implementation.
[    0.002001] smp: Bringing up secondary CPUs ...
[    0.002404] Detected VIPT I-cache on CPU1
[    0.002453] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.002839] Detected VIPT I-cache on CPU2
[    0.002862] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.003220] Detected VIPT I-cache on CPU3
[    0.003240] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.003276] smp: Brought up 1 node, 4 CPUs
[    0.003290] SMP: Total of 4 processors activated.
[    0.003295] CPU features: detected: 32-bit EL0 Support
[    0.003298] CPU features: detected: CRC32 instructions
[    0.003328] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.003334] CPU: All CPU(s) started at EL1
[    0.003347] alternatives: patching kernel code
[    0.009214] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.009242] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.009401] pinctrl core: initialized pinctrl subsystem
[    0.010115] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.010441] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.010465] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.010485] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.010703] thermal_sys: Registered thermal governor 'step_wise'
[    0.011692] cpuidle: using governor menu
[    0.011795] ASID allocator initialised with 65536 entries
[    0.040519] qcom,cpr4-apss-regulator b018000.cpr4-ctrl: CPR valid fuse count: 4
[    0.044980] SCSI subsystem initialized
[    0.045113] usbcore: registered new interface driver usbfs
[    0.045137] usbcore: registered new interface driver hub
[    0.045156] usbcore: registered new device driver usb
[    0.045303] CPUidle PSCI: failed to enable OSI mode: -95
[    0.045496] qcom_scm: convention: smc arm 64
[    0.046267] clocksource: Switched to clocksource arch_sys_counter
[    0.046852] NET: Registered PF_INET protocol family
[    0.046940] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.047439] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.047456] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.047464] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.047508] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.047586] TCP: Hash tables configured (established 8192 bind 8192)
[    0.047655] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.047676] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.047791] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.047813] PCI: CLS 0 bytes, default 64
[    0.067289] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.069843] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.069863] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.072483] qcom-qmp-phy 58000.phy: supply vdda-phy not found, using dummy regulator
[    0.072596] qcom-qmp-phy 58000.phy: supply vdda-pll not found, using dummy regulator
[    0.073221] qcom-qmp-phy 58000.phy: Registered Qcom-QMP phy
[    0.073403] qcom-qmp-phy 78000.phy: supply vdda-phy not found, using dummy regulator
[    0.073513] qcom-qmp-phy 78000.phy: supply vdda-pll not found, using dummy regulator
[    0.074030] qcom-qmp-phy 78000.phy: Registered Qcom-QMP phy
[    0.074626] qcom-qusb2-phy 59000.phy: supply vdda-pll not found, using dummy regulator
[    0.074736] qcom-qusb2-phy 59000.phy: supply vdda-phy-dpdm not found, using dummy regulator
[    0.074838] qcom-qusb2-phy 59000.phy: Registered Qcom-QUSB2 phy
[    0.074968] qcom-qusb2-phy 79000.phy: supply vdda-pll not found, using dummy regulator
[    0.075040] qcom-qusb2-phy 79000.phy: supply vdda-phy-dpdm not found, using dummy regulator
[    0.075149] qcom-qusb2-phy 79000.phy: Registered Qcom-QUSB2 phy
[    0.077913] bam-dma-engine 704000.dma-controller: num-channels unspecified in dt
[    0.077934] bam-dma-engine 704000.dma-controller: num-ees unspecified in dt
[    0.080437] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.080811] msm_serial 78b3000.serial: msm_serial: detected port #0
[    0.080835] msm_serial 78b3000.serial: uartclk = 3686400
[    0.080864] 78b3000.serial: ttyMSM0 at MMIO 0x78b3000 (irq = 22, base_baud = 230400) is a MSM
[    0.080887] msm_serial: console setup on port #0
[    0.764109] printk: console [ttyMSM0] enabled
[    0.769183] msm_serial: driver initialized
[    0.775984] loop: module loaded
[    0.778144] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xac
[    0.780071] nand: Winbond W29N04GZ
[    0.786690] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.794684] 27 fixed-partitions partitions found on MTD device qcom_nand.0
[    0.797484] OF: Bad cell count for /soc/nand-controller@79b0000/nand@0/partitions
[    0.804306] OF: Bad cell count for /soc/nand-controller@79b0000/nand@0/partitions
[    0.812452] Creating 27 MTD partitions on "qcom_nand.0":
[    0.819320] 0x000000000000-0x000000100000 : "0:sbl1"
[    0.825782] 0x000000100000-0x000000200000 : "0:mibib"
[    0.830647] 0x000000200000-0x000000280000 : "0:bootconfig"
[    0.835208] 0x000000280000-0x000000300000 : "0:bootconfig_1"
[    0.840723] 0x000000300000-0x000000600000 : "0:qsee"
[    0.848152] 0x000000600000-0x000000900000 : "0:qsee_1"
[    0.853074] 0x000000900000-0x000000980000 : "0:devcfg"
[    0.856328] 0x000000980000-0x000000a00000 : "0:devcfg_1"
[    0.861448] 0x000000a00000-0x000000a80000 : "0:apdp"
[    0.866932] 0x000000a80000-0x000000b00000 : "0:apdp_1"
[    0.871828] 0x000000b00000-0x000000b80000 : "0:rpm"
[    0.876837] 0x000000b80000-0x000000c00000 : "0:rpm_1"
[    0.881577] 0x000000c00000-0x000000c80000 : "0:cdt"
[    0.886832] 0x000000c80000-0x000000d00000 : "0:cdt_1"
[    0.891455] 0x000000d00000-0x000000d80000 : "0:appsblenv"
[    0.896697] 0x000000d80000-0x000000e80000 : "0:appsbl"
[    0.902402] 0x000000e80000-0x000000f80000 : "0:appsbl_1"
[    0.907493] 0x000000f80000-0x000001000000 : "0:art"
[    0.912574] 0x000001000000-0x000001080000 : "0:art.bak"
[    0.917238] 0x000001080000-0x000001180000 : "config"
[    0.922727] 0x000001180000-0x000001280000 : "boarddata1"
[    0.928030] 0x000001280000-0x000001380000 : "boarddata2"
[    0.933250] 0x000001380000-0x000001480000 : "pot"
[    0.938559] 0x000001480000-0x000001980000 : "dnidata"
[    0.945931] 0x000001980000-0x000003680000 : "kernel"
[    0.967773] 0x000007e00000-0x000007e80000 : "ethphyfw"
[    0.968445] 0x00000e880000-0x000020000000 : "rootfs"
[    1.168304] mtd: setting mtd26 (rootfs) as root device
[    1.168576] mtdsplit: no squashfs found in "rootfs"
[    1.178519] spmi spmi-0: PMIC arbiter version v2 (0x20010000)
[    1.180897] s1: supplied by regulator-dummy
[    1.183364] s2: supplied by regulator-dummy
[    1.187377] vdd_s3: supplied by regulator-dummy
[    1.191654] vdd_s4: supplied by regulator-dummy
[    1.196124] s5: supplied by regulator-dummy
[    1.200569] l1: supplied by regulator-dummy
[    1.204735] l2: supplied by regulator-dummy
[    1.208877] l3: supplied by regulator-dummy
[    1.213050] l4: supplied by regulator-dummy
[    1.217240] l5: supplied by regulator-dummy
[    1.221387] l6: supplied by regulator-dummy
[    1.225535] l7: supplied by regulator-dummy
[    1.229742] l8: supplied by regulator-dummy
[    1.233876] l9: supplied by regulator-dummy
[    1.238149] l11: supplied by regulator-dummy
[    1.242234] l12: supplied by regulator-dummy
[    1.246734] l13: supplied by regulator-dummy
[    1.317643] i2c_dev: i2c /dev entries driver
[    1.321357] sdhci: Secure Digital Host Controller Interface driver
[    1.321395] sdhci: Copyright(c) Pierre Ossman
[    1.327002] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.333833] remoteproc remoteproc0: releasing cd00000.q6v5_wcss
[    1.339052] NET: Registered PF_INET6 protocol family
[    1.343447] Segment Routing with IPv6
[    1.348036] In-situ OAM (IOAM) with IPv6
[    1.351570] NET: Registered PF_PACKET protocol family
[    1.355566] 8021q: 802.1Q VLAN Support v1.8
[    1.372187] qcom,cpr4-apss-regulator b018000.cpr4-ctrl: CPR valid fuse count: 4
[    1.372423] cpr4_ipq807x_apss_read_fuse_data: apc_corner: speed bin = 0
[    1.378321] cpr4_ipq807x_apss_read_fuse_data: apc_corner: CPR fusing revision = 3
[    1.384906] cpr4_ipq807x_apss_read_fuse_data: apc_corner: CPR misc fuse value = 0
[    1.392572] cpr4_ipq807x_apss_read_fuse_data: apc_corner: Voltage boost fuse config = 0 boost = disable
[    1.400055] cpr3_mem_acc_init: apc: not using memory accelerator regulator
[    1.409213] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused      SVS: open-loop= 720000 uV
[    1.416159] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused      NOM: open-loop= 848000 uV
[    1.426146] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused    TURBO: open-loop= 896000 uV
[    1.435955] cpr4_ipq807x_apss_calculate_open_loop_voltages: apc_corner: fused   STURBO: open-loop= 976000 uV
[    1.445802] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused      SVS: quot[ 7]= 638, quot_offset[ 7]=   0
[    1.455576] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused      NOM: quot[ 7]= 902, quot_offset[ 7]= 260
[    1.466425] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused    TURBO: quot[ 7]= 988, quot_offset[ 7]=  85
[    1.477362] cpr4_ipq807x_apss_calculate_target_quotients: apc_corner: fused   STURBO: quot[ 7]=1152, quot_offset[ 7]= 160
[    1.488400] cpr3_regulator_init_ctrl: apc: Default CPR mode = closed-loop
[    1.489477] ------------[ cut here ]------------
[    1.505994] Kernel BUG at qcom_cpufreq_ipq8074_name_version+0x74/0x80 [verbose debug info unavailable]
[    1.510690] Internal error: Oops - BUG: 0 [#1] SMP
[    1.519795] Modules linked in:
[    1.524567] CPU: 1 PID: 9 Comm: kworker/u8:0 Not tainted 5.15.114 #0
[    1.527610] Hardware name: Netgear RAX120v2 (DT)
[    1.534118] Workqueue: events_unbound deferred_probe_work_func
[    1.538722] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    1.544365] pc : qcom_cpufreq_ipq8074_name_version+0x74/0x80
[    1.551220] lr : qcom_cpufreq_ipq8074_name_version+0x2c/0x80
[    1.557123] sp : ffffffc00926baf0
[    1.562760] x29: ffffffc00926baf0 x28: 00000000000000a0 x27: ffffff800240d820
[    1.565979] x26: ffffff8002442074 x25: ffffff8002d05800 x24: ffffff800240a4b0
[    1.573096] x23: 0000000000000005 x22: ffffff80027f3f80 x21: ffffff803fdfd358
[    1.580216] x20: ffffff803fda30a8 x19: ffffff80027f3000 x18: 0000000000000002
[    1.587333] x17: 632d347270632e30 x16: 3030383130623a6d x15: ffffffffffffffff
[    1.594451] x14: ffffff8003c92a1c x13: 006d656d766e2d71 x12: 6572667570632d6d
[    1.601570] x11: 0000000000000001 x10: 0101010101010101 x9 : 0000000000000000
[    1.608688] x8 : ffffff80027f4000 x7 : ffffffc009d00890 x6 : 0000000000000001
[    1.615806] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffffffc00845ad40
[    1.622923] x2 : ffffff8002497ca0 x1 : 0000000000000000 x0 : 0000000000000143
[    1.630042] Call trace:
[    1.637151]  qcom_cpufreq_ipq8074_name_version+0x74/0x80
[    1.639413]  qcom_cpufreq_probe+0xdc/0x48c
[    1.644965]  platform_probe+0x68/0xc0
[    1.648871]  really_probe.part.0+0x9c/0x30c
[    1.652604]  __driver_probe_device+0x98/0x170
[    1.656598]  driver_probe_device+0x44/0x120
[    1.661111]  __device_attach_driver+0xb8/0x134
[    1.665105]  bus_for_each_drv+0x68/0xb0
[    1.669618]  __device_attach+0xa0/0x194
[    1.673350]  device_initial_probe+0x14/0x20
[    1.677171]  bus_probe_device+0x98/0xa0
[    1.681337]  deferred_probe_work_func+0x88/0xc0
[    1.685158]  process_one_work+0x218/0x3c4
[    1.689672]  worker_thread+0x284/0x4cc
[    1.693836]  kthread+0x120/0x130
[    1.697481]  ret_from_fork+0x10/0x20
[    1.700871] Code: d50323bf d65f03c0 7106101f 5400004c (d4210000) 
[    1.704434] ---[ end trace d4b8418fa13fd437 ]---
[    1.710420] Kernel panic - not syncing: Oops - BUG: Fatal exception
[    1.715109] SMP: stopping secondary CPUs
[    1.721098] Kernel Offset: disabled
[    1.725260] CPU features: 0x00000000,00000802
[    1.728474] Memory Limit: none
[    1.732986] Rebooting in 1 seconds..


Boot log:

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.3.1-00110
S - IMAGE_VARIANT_STRING=HAACANAZA
S - OEM_IMAGE_VERSION_STRING=CRM
S - Boot Config, 0x000002e5
B -       205 - PBL, Start
B -      2748 - bootable_media_detect_entry, Start
B -      3454 - bootable_media_detect_success, Start
B -      3459 - elf_loader_entry, Start
B -      6286 - auth_hash_seg_entry, Start
B -      6546 - auth_hash_seg_exit, Start
B -     78050 - elf_segs_hash_verify_entry, Start
B -    149954 - PBL, End
B -    244122 - SBL1, Start
B -    322659 - GCC [RstStat:0x10, RstDbg:0x600000] WDog Stat : 0x4
B -    332480 - pm_device_init, Start
B -    512034 - PM_SET_VAL:Skip
D -    177479 - pm_device_init, Delta
B -    514260 - pm_driver_init, Start
D -      5276 - pm_driver_init, Delta
B -    520757 - clock_init, Start
D -      1525 - clock_init, Delta
B -    524874 - boot_flash_init, Start
D -     12505 - boot_flash_init, Delta
B -    541039 - boot_config_data_table_init, Start
D -      3111 - boot_config_data_table_init, Delta - (575 Bytes)
B -    548542 - Boot Setting :  0x00000618
B -    552446 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:0,Subtype:0
B -    559736 - sbl1_ddr_set_params, Start
B -    563152 - cpr_init, Start
D -      1098 - cpr_init, Delta
B -    568459 - Pre_DDR_clock_init, Start
B -    572546 - Pre_DDR_clock_init, End
B -    575931 - DDR Type : PCDDR3
B -    581513 - do ddr sanity test, Start
D -       976 - do ddr sanity test, Delta
B -    586454 - DDR: Start of HAL DDR Boot Training
B -    591090 - DDR: End of HAL DDR Boot Training
B -    596732 - DDR: Checksum to be stored on flash is -959818364
B -    606828 - Image Load, Start
D -    245159 - QSEE Image Loaded, Delta - (1368672 Bytes)
B -    852048 - Image Load, Start
D -       610 - SEC Image Loaded, Delta - (2048 Bytes)
B -    859673 - Image Load, Start
D -     43218 - DEVCFG Image Loaded, Delta - (31941 Bytes)
B -    902952 - Image Load, Start
D -     23028 - RPM Image Loaded, Delta - (99896 Bytes)
B -    926071 - Image Load, Start
D -     71065 - APPSBL Image Loaded, Delta - (446536 Bytes)
B -    997258 - QSEE Execution, Start
D -        61 - QSEE Execution, Delta
B -   1003023 - USB D+ check, Start
D -         0 - USB D+ check, Delta
B -   1009519 - SBL1, End
D -    767593 - SBL1, Delta
S - Flash Throughput, 6935 KB/s  (1950340 Bytes,  281200 us)
S - DDR Frequency, 466 MHz
S - Core 0 Frequency, 1651 MHz


U-Boot 2016.01-23637-g6be947d (Sep 26 2018 - 10:21:39 +0800)

Model: QCA, IPQ807x-HK01
U-boot dni1 V1.2 for DNI HW ID: 29765589; NAND flash 512MB; RAM 1024MB .
developed based on 'qsdk-ipq807x.ilq.8.0-spf.8.0.CS' 
DRAM:  smem ram ptable found: ver: 1 len: 4
1 GiB
NAND:  ONFI device found
ID = 1590acef
Vendor = ef
Device = ac
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000
ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)
512 MiB
MMC:   <NULL>: 0
*** Warning - bad CRC, using default environment

In:    serial@78B3000
Out:   serial@78B3000
Err:   serial@78B3000
machid: 8010000
Net:   MAC0 addr:94:a6:7e:53:5e:4a
PHY ID1: 0x4d
PHY ID2: 0xd0b1

NAND read: device 0 offset 0x7e00000, size 0x80000
 524288 bytes read: OK
bad magic on ETHPHYFW partition
PHY ID1: 0x3a1
PHY ID2: 0xb612
EDMA ver 1 hw init
Num rings - TxDesc:1 (0-0) TxCmpl:1 (7-7)
RxDesc:1 (15-15) RxFill:1 (7-7)
ipq807x_edma_alloc_rings: successfull
ipq807x_edma_setup_ring_resources: successfull
ipq807x_edma_configure_rings: successfull
ipq807x_edma_hw_init: successfull
eth0
Hit any key to stop autoboot:  0 
IPQ807x#   

smeminfo:

IPQ807x# smeminfo
flash_type:             0x2
flash_index:            0x0
flash_chip_select:      0x0
flash_block_size:       0x20000
flash_density:          0x100000
partition table offset  0x0
No.: Name             Attributes            Start             Size
  0: 0:SBL1           0x0000ffff              0x0         0x100000
  1: 0:MIBIB          0x0000ffff         0x100000         0x100000
  2: 0:BOOTCONFIG     0x0000ffff         0x200000          0x80000
  3: 0:BOOTCONFIG1    0x0000ffff         0x280000          0x80000
  4: 0:QSEE           0x0000ffff         0x300000         0x300000
  5: 0:QSEE_1         0x0000ffff         0x600000         0x300000
  6: 0:DEVCFG         0x0000ffff         0x900000          0x80000
  7: 0:DEVCFG_1       0x0000ffff         0x980000          0x80000
  8: 0:APDP           0x0000ffff         0xa00000          0x80000
  9: 0:APDP_1         0x0000ffff         0xa80000          0x80000
 10: 0:RPM            0x0000ffff         0xb00000          0x80000
 11: 0:RPM_1          0x0000ffff         0xb80000          0x80000
 12: 0:CDT            0x0000ffff         0xc00000          0x80000
 13: 0:CDT_1          0x0000ffff         0xc80000          0x80000
 14: 0:APPSBLENV      0x0000ffff         0xd00000          0x80000
 15: 0:APPSBL         0x0000ffff         0xd80000         0x100000
 16: 0:APPSBL_1       0x0000ffff         0xe80000         0x100000
 17: 0:ART            0x0000ffff         0xf80000          0x80000
 18: rootfs           0x0000ffff        0x1000000        0x2e00000
 19: 0:WIFIFW         0x0000ffff        0x3e00000         0x900000
 20: rootfs_1         0x0000ffff        0x4700000        0x2e00000
 21: 0:WIFIFW_1       0x0000ffff        0x7500000         0x900000
 22: 0:ETHPHYFW       0x0000ffff        0x7e00000          0x80000

I never encounter that kernel panic. You may actually hit a bug, what did you compile it from? boretom's jewwest-based-pr branch or did you rebase to master?

That BUG() is only triggered if SMEM ID that is returned is not part of IPQ807x v2 family.

Are you sure your SoC has A on the end aka its v2?

@greenlogles: To see if @robimarko is right about the hardware version, earlier in this thread (post #31) the following was suggested to see the hardware version.
'01' means hardware version 1, '02' version 2 (below the output of my RAX120v2).

Run the command in Netgear stock:

$ hexdump -C /proc/device-tree/soc_version_major
00000000  02 00 00 00                                       |....|
00000004

Some u-boot info on my RAX120v2 are different (newer) to yours:

U-Boot 2016.01 (Nov 12 2019 - 11:55:34 +0800)

Model: QCA, IPQ807x-HK01
U-boot dni1 V1.6 for DNI HW ID: 29765589; NAND flash 512MB; RAM 1024MB .
developed based on 'qsdk-ipq807x.ilq.10.0-spf.10.0.CS_patch_4'

It would be ideal if I could get the SMEM ID, that would tell immediatelly what is the exact CPU

How would one find the SMEM ID (a forum and internet search didn't reveal much)?

Thanks!
It seems like I have v1 :frowning: :

root@RAX120:/# hexdump -C /proc/device-tree/soc_version_major
00000000  01 00 00 00                                       |....|
00000004

I curious is it possible to make this device openwrt based router (even without wlan modules). Stock firmware isn't usable :frowning:

While booting, found that:

BusyBox v1.24.1 (2021-09-22 10:33:25 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

     MM           NM                    MMMMMMM          M       M
   $MMMMM        MMMMM                MMMMMMMMMMM      MMM     MMM
  MMMMMMMM     MM MMMMM.              MMMMM:MMMMMM:   MMMM   MMMMM
MMMM= MMMMMM  MMM   MMMM       MMMMM   MMMM  MMMMMM   MMMM  MMMMM'
MMMM=  MMMMM MMMM    MM       MMMMM    MMMM    MMMM   MMMMNMMMMM
MMMM=   MMMM  MMMMM          MMMMM     MMMM    MMMM   MMMMMMMM
MMMM=   MMMM   MMMMMM       MMMMM      MMMM    MMMM   MMMMMMMMM
MMMM=   MMMM     MMMMM,    NMMMMMMMM   MMMM    MMMM   MMMMMMMMMMM
MMMM=   MMMM      MMMMMM   MMMMMMMM    MMMM    MMMM   MMMM  MMMMMM
MMMM=   MMMM   MM    MMMM    MMMM      MMMM    MMMM   MMMM    MMMM
MMMM$ ,MMMMM  MMMMM  MMMM    MMM       MMMM   MMMMM   MMMM    MMMM
  MMMMMMM:      MMMMMMM     M         MMMMMMMMMMMM  MMMMMMM MMMMMMM
    MMMMMM       MMMMN     M           MMMMMMMMM      MMMM    MMMM
     MMMM          M                    MMMMMMM        M       M
       M
 ---------------------------------------------------------------
   For those about to rock... (Chaos Calmer, RAX120-V1.2.3.28+r49254)

Then its not supported, and its intentionally like that.

1 Like

The PR got (force) updated to latest commit which includes renaming/moving of target 'ipq807x' to 'qualcommax', subtarget 'ipq807x'. Rerun 'scripts/diffconfig.sh' if you used if before to save the '.config'. And the resulting firmware files naming changed too.

Question I'd like feedback:

  • I'd like to rename the (5G port) 'lan5' to '5g-0' to make clear that it's a port that can be used for whatever you want
  • My AQR111 patch is included now, it pretty simple but if someone with technical knowledge would have a look at it?
  • Creating a stock flashable image: The kernel get's loaded but the rootfs is not written to the right place. Since in stock the flash layout and numbering is not as with OpenWrt how can I make sure the rootfs get written to the address I want to?

If I add the following I can flash from stock, the kernel loads but rootfs can't be found:

+	IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
+		append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \
+		append-ubi | netgear-dni

Couldn't any port technically be used for whatever you want? Keeping it 'lan5' seems simple enough to me from a mnemonic standpoint (i.e. 5 = 5G).

I unfortunately don't have any other feedback on the other two questions. Perhaps @wangyu can assist since he created the first stock image flashable script.

@patient0 anything else you need assistance with?

Nope, only looking for assistance for the factory image creation. Otherwise it would be ready to be merged, for some time already. Everyone's busy I assume.

But thanks for asking.

If I add the following I can flash from stock, the kernel loads but rootfs can't be found:

Which one do you mean by rootfs in rootfs can't be found

In the branch last year (when ubi wasn't used yet), there was a squashfs(which is the readonly fs) and a jffs2(the mutable fs).

Does the new branch have two partitions corresponding to the squashfs and jffs2? If so which one is the rootfs you mean?

From my understanding, now you have two versions:

  1. one that fully works, but requires changing the bootcmd to work

  2. one that doesn't require changing the bootcmd, but the rootfs doesn't mount.

Are they pushed into a github repo, and can you post a short instruction of how to build and flash 1 and how to build 2 ?

I should be able to investigate into this problem a bit this month.