Netgear R7800 exploration (IPQ8065, QCA9984)

I have @hnyman build r6420 running on my Netgear XR500. Before the firmware can be flashed, it is necessary to modify two U-Boot variables: board_model_id and board_hw_id.

First, remove the four rubber feet and use a Torx T-9 screwdriver tip to remove the four screws. Separate the two case halves.
Connect a 3.3 VDC USB/TTL Serial adapter to the Serial port header J1 on the system PCB.

J1 Pinout:
pin 1 ... 3.3 VDC (generally not used for most adapters)
pin 2 ... RX (receive)
pin 3 ... TX (transmit)
pin 4 ... GND (ground)

On the PC run a terminal emulation program capable of serial communications such as PuTTY and set the parameters as follows:

Serial line device: /dev/ttyUSB0 for Ubuntu linux. For Windows and possibly other flavors of linux you'll have to figure it out.
Line speed (baud rate) 115200
Data bits: 8
Stop bits: 1
Parity: None
Flow control: None

While the terminal program is running, press and hold the CTRL c keys and power cycle the router. Release the keys when the U-Boot command line prompt appears:

(IPQ) # <INTERRUPT>
(IPQ) # <INTERRUPT>
(IPQ) # <INTERRUPT>
(IPQ) # <INTERRUPT>
(IPQ) #

Display the current values of the two vars:

(IPQ) # board_model_id_show

131072 bytes read: OK
board_model_id : XR500

(IPQ) # board_hw_id_show

131072 bytes read: OK
board_hw_id : 29764958+0+256+512+4x4+4x4+cascade

Modify the two vars as follows:

(IPQ) # board_model_id_set R7800

Burn board_model_id (= R7800) into ART block
131072 bytes read: OK
Erasing: off 1200000, size 20000

Erasing at 0x1200000 -- 100% complete. Cleanmarker written at 0x1200000.
OK
Writing: from RAM addr 5fe86df4, to NAND off 1200000, size 20000
131072 bytes written: OK
Active-timer expires
Done.

(IPQ) # board_hw_id_set 29764958+0+128+512+4x4+4x4+cascade

Burn board_hw_id (= 29764958+0+128+512+4x4+4x4+cascade) into ART block
131072 bytes read: OK
Erasing: off 1200000, size 20000

Erasing at 0x1200000 -- 100% complete. Cleanmarker written at 0x1200000.
OK
Writing: from RAM addr 5fe86de4, to NAND off 1200000, size 20000
131072 bytes written: OK
Active-timer expires
Done.

Next prepare to load R7800 firmware (I used R7800-master-r6420-4e8f1e9f4c-20180310-1406-sqfs-factory.img) from a PC TFTP Client (set static IP address 192.168.1.2 over an ethernet cable) by using the built-in TFTP server in U-Boot:

(IPQ) # fw_recovery

The Router is in TFTP Server Firmware Recovery mode NOW!
Listening on Port : 69, IP Address: 192.168.1.1 ...

The TFTP Server will patiently wait for you to setup TFTP on your PC.
Once the file has successfully transfered, the router should automatically boot.

Although the kernel senses the 256 MiB Macronix MX30UF2G18AC flash memory chip, it will use only the first 128MiB.

  • Magnetron1.1

Based on your message, it sounds rather straightforward to introduce XR500 as itself to the Openwrt sources.

Yes ... It should be easy.

U-Boot allows user defined flash partitions which can be passed to the kernel during boot time.
Here is the partitioning info I defined to U-Boot:

(IPQ) # mtdparts


device nand0 <msm_nand>, # parts = 11
 #: name                size            offset       mask_flags
 0: qcadata             0x00c80000      0x00000000   0
 1: APPSBL              0x00500000      0x00c80000   0
 2: APPSBLENV           0x00080000      0x01180000   0
 3: art                 0x00140000      0x01200000   0
 4: artbak              0x00140000      0x01340000   0
 5: kernel              0x00200000      0x01480000   0
 6: firmware            0x02000000      0x01480000   0
 7: ubi                 0x01e00000      0x01680000   0
 8: netgear             0x04480000      0x03480000   0
 9: reserve             0x00700000      0x07900000   0
10: spare               0x08000000      0x08000000   0

active partition: nand0,0 - (qcadata) 0x00c80000 @ 0x00000000

defaults:
mtdids  : nand0=msm_nand
mtdparts: none
(IPQ) #  

U-Boot passes the partition table to the kernel, but, unfortunately, it completely ignores it.

Managed to enable the 2nd NSS CPU core for my R7800. Unfortunately, the NSS driver doesn't seem to work right. When I follow the init script to enable the 'rps' option, network traffic does not flow ... sigh. Looks like need to dig deeper into the driver codes.

If anyone is interested, I've committed the .dts entry for the R7800 into my Github repo. Links posted in my earlier post.

1 Like

While this wouldn't be much of an issue once you switched to a dedicated image for for xr500 with its own DTS, you could also use qcom-smem to detect the flash partitions automatically, instead of hardcoding them in the DTS (the nbg6817) does that.

So! i'm ready, my new wrt1900acs is taking over. I have an idle r7800 waiting to do some tests. So i'll clone your repo and try to build and image and report back to you. Any hints or suggestions for the build and tests?

:slight_smile:

My repo is ready to go for the R7800. I didn’t upload my config, so you have to disable the stmmac drivers via ‘make menuconfig’ and enable the qca-nss drivers.

Hi i've cloned your repo but in the ./package/kernel there is no qca-nss-drv dir. I've cloned this repo under package kernel https://github.com/zhangjingye03/qca-nss-drv and try to compile it

best!

Think you need to switch to the branch ‘lede-17.01-qca-nss’. You should be at the master branch after the clone. You won’t be able to compile successfully as it doesn’t have the necessary device tree sources.

thanks! i forgot about checking out the branches :frowning:

I tried to flash my R7800 back to (Voxel's) stock image via tftp(tftp2).
Unfortunately, it failed. I see the uploading stop at about 3/4th, then something is erased, uploading again, fail again, etc until tftp2 says the uploading failed.
What am I doing wrong? This used to work before.

@lesandie, @quarky why would you want to take the qca driver from https://github.com/zhangjingye03/qca-nss-drv when a recent version, straight from Netgear, is here: https://github.com/SVoxel/R7800/tree/master/package/qca-nss-drv

1 Like

I took the driver from CodeAurora’s repo. I believe that should the more up to date.

Agree, but not fully.
How did you know which branch to take?
Wouldn't it be easier/safer to start with what is working (stock firmware) and once you fully understand the details move over to using the bleeding edge = CodeAurora?
Anyway, just my 2 cents...

I don't know but the tftp subsystem built-in the router works flawlessly ... Maybe it just fails because the CRC or the hash is wrong ... could you try another firmware to rule out problems?

Meh i didn't know! :blush:

It is more like there is not enough space: during the firmware upload I see a progress-bar running up to about 3/4th, then the bar stops, then the tftp2 software (?) attempts to erase the flash, then 2 retries happen (tftp2 setting)
Thank you for responding though :slight_smile: , I'll try again with a firmware-file straight from the Netgear website.

Having the drivers loaded is already a miracle to me :grin:

The drivers from the Netgear source seems to be for the 3.4 kernel, while the CodeAurora ones seems to cater to 4.x kernel, so I decided to use those. You’re right in that they have tons of branches. So I just picked the latest one with CC tagged, which I take it to mean OpenWRT Chaos Chalmer :grimacing:

I would just like to return to the latency spike issue: is this problem exclusive to the R7800 or has it been reported on other routers as well? What about other routers with the same hardware?

only 7800 to my knowledge