IPQ806x NSS Drivers

See my reply above to @JayJax. If you’re game enough to compile your own build to test, I’ll be glad to help figure out where to change for the DTS for IPQ8064.

Absolutely, I'm doing my own community builds which I'm planning to add this to. I'm on master, i.e. 4.14. Would very much appreciate it if you had a look. Already building images for the R7800 using Ansuel's commits.

While changing the DTS is simple, your challenge will likely come from patching the Netfilter codes to hook the NSS Drivers into Netfilter. That, IMHO need a very good understanding of the entire Linux networking framework.

This is also the main reason I’m sticking with 4.4 atm as the codes available from CodeAurora are for 4.4.

@Ansuel

Have you had a chance to test on 4.14 yet?

I'm fixing the driver for 4.14
Today I will test if GMAC and drv firmware loader works
Then I will start to rework the offload part

I know it's supported. :wink: Moreover I was trying to enable the internal GMAC to the Broadcom CPU (probably the only consumer device to have 3 gmac) to get VDSL working (https://forum.openwrt.org/t/ipq806x-lede-support-for-tp-link-archer-vr2600v/326/25).
I tried to change some code accordingly to the TP-Link sources, but didn't work. I hope that switching to this gmac implementation can solve the problem. :slight_smile:

did you test my patch ?

Actually wouldn't it be smarter for me to test it on my device? because i seem to have 2 different systems installed where 1 is OpenWRT and the other one is my original router firmware.
So in case my device bricks i could simply switch to my original firmware and from there install the custom firmware again :smiley:

We don't actually know if the nss code is the same for zytel... We need to first compile something stable and make the crypto core works... Then we can try to port.. :frowning:

I think the r7800 and zyxel are almost a 1:1 device.

@JayJax from https://wikidevi.com/wiki/ZyXEL_NBG6817_(Armor_Z2) it looks like the same as the R7800 with different flash. If you’re comfortable compiling your own firmware, you can try cloning my repo and apply the changes I did for the R7800 to the Zyxel DTS and try to build. That should be all that’s needed.

Note that my repo is cloned from the lede-17.01 branch. If the Zyxel is already supported on that branch, you’re good to go with my repo.

update on porting.... got to compile an image without error with only nss-gmac and nss-drv...

testing the image i get a null point exception (i think on gmac?)

@quarky what does gmac driver print? only the driver info with version and name or something else after that?

I have this from my serial console:

[   10.574168] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.579637] nf_conntrack version 0.5.0 (7480 buckets, 29920 max)
[   10.581702] rfs_ess_init[1115]:ERROR:Cannot find ess-switch
[   10.627540] ssdk_alloc_priv[3813]:INFO:ess-switch dts node number: 1
[   10.630335] ssdk_dt_get_switch_node[2823]:WARN:cannot find ess-switch node
[   10.637207] ssdk_plat_init start
[   10.640075] ssdk_driver_register[3022]:INFO:Register QCA PHY driver
[   11.093812] f1_phy_api_ops_init[1391]:INFO:qca probe f1 phy driver succeeded!
[   11.096876] regi_init[3952]:INFO:qca-ssdk module init succeeded!
[   11.106844] tun: Universal TUN/TAP device driver, 1.6
[   11.106887] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   11.120349] **********************************************************
[   11.120390] * Driver    :NSS GMAC Driver for RTL v(3.72a)
[   11.125778] * Version   :1.0
[   11.131401] * Copyright :Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
[   11.134201] **********************************************************
[   11.178248] ipip: IPv4 over IPv4 tunneling driver
[   11.184474] l2tp_core: L2TP core driver, V2.0
[   11.185992] l2tp_netlink: L2TP netlink interface
[   11.202260] nss_init[634]:Init NSS drivernss-driver: fabric 0 handler
[   11.209057] nss-driver: fabric 1 handler
[   11.212133] nss_hal_probe[1031]:nss_hal_common_reset Done.
[   11.217583] nss_hal_probe[1065]:bf479178: NSS_DEV_ID 36000000.nss 
[   11.221405] nss_driver - fw of size 434240  bytes copied to load addr: 40000000, nss_id : 0
[   11.226507] nss_driver - Turbo Support 1
[   11.234622] Supported Frequencies - 110Mhz 600Mhz 800Mhz 
[   11.243247] nss_hal_probe[1260]:bf479178: Setting NSS0 Firmware load address to 40000000
[   11.243334] nss_hal_probe[1291]:0:ctx=bf479178, vphys=39000000, vmap=df540000, nphys=36000000, nmap=df4be000
[   11.252802] nss_hal_probe[1344]:0: This NSS core supports two interruptsnss_hal_probe[1396]:0: NSS shaping is enabled
[   11.267428] nss_pptp_register_handler[431]:nss_pptp_register_handlernss_l2tpv2_register_handler[303]:nss_l2tpv2_register_handler
[   11.277658] nss_wifi_register_handler[266]:nss_wifi_register_handlernss_hal_probe[1537]:bf479178: Reseting NSS core 0 now
[   11.289447] nss_hal_probe[1621]:bf479178: All resources initialized and nss core0 has been brought out of reset[   11.297764] nss_hal_probe[1065]:bf47a190: NSS_DEV_ID 36400000.nss 
[   11.309153] nss_driver - fw of size 189248  bytes copied to load addr: 40800000, nss_id : 1
[   11.310545] nss_hal_probe[1260]:bf47a190: Setting NSS1 Firmware load address to 40800000
[   11.318279] nss_hal_probe[1291]:1:ctx=bf47a190, vphys=39010000, vmap=df5c0000, nphys=36400000, nmap=df52e000
[   11.327651] nss_hal_probe[1344]:1: This NSS core supports two interruptsError - Duplicate Interface CB Registered for interface 107
[   11.342814] Error - Duplicate Interface CB Registered for interface 110
[   11.348227] nss_hal_probe[1537]:bf47a190: Reseting NSS core 1 now
[   11.354808] nss_hal_probe[1621]:bf47a190: All resources initialized and nss core1 has been brought out of reset
1 Like

thx for the log

I will have access to my C2600 in a week or so, but to keep the momentum going, I compiled an image:

Edit: deleted link: bootloops.
md5: 86dfd5d891876f52440f611fb2ce629c

Needless to say, I did not test this on any hardware so get tftp/recovery image ready before flashing.

  1. Based on trunk, r8614 as of this post.
  2. Added current nss-gmac. (1)
  3. Disabled upstream stmmac driver, updated dts, switched to nss-gmac. (2)

luci and iperf3 included.

Thats it. The goal is to simply see if the first layer works with current master. Without it the rest would be useless.
If you try this on archer c2600, post dmesg and log.

(1) I opted to go for what seemed to be the latest version of nss-gmac instead of one supplied in stock gpl tarballs, since we are trying to go for 4.14, might as well bump everything else :smile:
Codeaurora has many branches, but nss branch looks clean/most up-to-date. When this was not available I went for HNSS QSDK 9.

(2) gmac-nss is the driver used by qca in their sdks, it has the ability to offload to the NSS cores. Sometime in 2015, they tried to upstream this but it was rejected as there's an existing driver that supports the hardware (stmmac), they published a 'glue layer', which enabled the hw in ipq806x to work with the upstream driver but without offloading ability.

Hence this test, if gmac-nss doesn't work with current kernel, we can't offload and so no point in trying to port the other components.

The nss-gmac driver is tied to the nss-drv driver. And the nss-drv driver is tied to the NSS Firmware (I think.) So using the latest version may not be such a good idea.

Anyway, good to have more joining in the fun :grin:

@quarky If you live in europe I'd be willing to borrow you a C2600 to make this work with 18.06.1. I'd also be willing to chip in a $100 of bounty for said version.

@abenz Tried your image, it bootloops :confused:

@npr Thank you for your offer. I have my hands full with the R7800 now so unlikely I can do anything with the C2600. I don’t live in Europe as well. Besides, the C2600 doesn’t have a serial port so it’s hard to work on.

Let’s wait until we get it running well with the R7800. It should be easy to then target the C2600.

Cool. Any idea if you'll be able to get it merged into openwrt, or will it be relegated to a custom build?

Very unlikely to have it merged into the mainstream repo IMHO.