OpenWrt Support for Armor G5 (NBG7815)

Sorry. I think I didn't discribe exactly what I want to do. Because patching the kernel which would allow to set it within DTS is not a good idea. Despite I think it would not be allowed.

What I would do is to just put a script into /etc/init.d respectively /etc/rc.d to set this parameter on boot time. Is this acceptable or not?

I mean I could it just put into rc.local. But that is not the best idea (imo).

EDIT:

I would do sth. like that (if this is allowed to be integrated in OpenWrt):

#!/bin/sh /etc/rc.common

START=99

boot() {
	# get board name
	case $(board_name) in
         zyxel_nbg7815)
	# get correct thermal zone defined in DTS
         aqr_thermal=$(grep -Ril "aqr-thermal" /sys/class/thermal/thermal_zone*/type | cut -d'/' -f 5)
	# setting thermal governor from step_wise to bang_bang
	     echo "bang_bang" > /sys/class/thermal/${aqr_thermal}/policy
	;;
	esac
}

While I'm not sure if it would make sense to set this for all zones.

EDIT:
Does the required kernel parameter have a chance to be accepted? Because kernel config is for all targets. At least I didn't found a file which would pharse kernel settings for a specific device. :confused:

If some one want to try the new way for fan support can look at this code.

The last 2 commits make it works. Feel free to integrate it in your forks.

I put 80ºC max for the aquantia (10g port chip) and 75ºC for CPU.

If someone considers others values, fill free to suggest them.

EDIT:
If you are on main / master branch you can cherry-pick from here

3 Likes

Thanks a lot for your work, I have a question, can we make the led lights variable as in the stock software? So I want different color transitions from top to bottom to be continuous. Also, what should I do to set color other than blue and purple?

1 Like

Sorry. I can't help you.
Leds was implemented by @itorK
I've never play with them. I only want it off.
I just updated kernel driver to work for 6.1.
Don't know how its work.

1 Like

Updated irresponsible build here. I included Tailscale/Wireguard support.

Latest patches from @asvio made the router very silent, I haven't heard the fan spinning yet.

1 Like

sorry i need a basic information to ser interface and device only to test the router. can please help me? thanks

What's your room temperature?
Are you using usb port?
Have you switch on all the wifi radios?
Are you using 10g and or 2,5g port?

Room temp ~25°, no USB port, just using the 2.5g port as uplink, the 10g one is disconnected (and I was wondering if I could disable it to save power). All radios are enabled and configured.

Btw I noticed worst perfornances in the latest snapshot, I'll try to build on the 23.05 branch and check the differences. I may be wrong but a previous build with kernel 5.15 was more responsive.

That's a little bit too vague...

i have an italian ftth operator, i need to configure WAN PPPOE and VlanID. I have try to create WAN PPOE ( with user and password), i create device LAN 1 with VLANID but receive messagge unknow error. I think i need a steps to configure this parameters. i have find more guides but i have find only a different configuration respect armor g5.

I'd suggest asking for your specific ISP operator on an italian forum, what you are doing seems correct to me and the settings are the same for every openwrt build regardless of the router model.

I can't exclude that my build (if you are using that one) could be missing some packages, but usually the problems are related to wrong parameters (vlan id, user/password). If you ssh into the router and run the logread command you should be able to get some logs.

i have the correct parameters because in other router free, i have set and work properly. i think the problem is configuration dhcp...device lan (br or not)....i try again :sweat_smile:

finally now works. i 'dont know why the speed in download is 500 mega and not 2.5 , upload is correct 470 ( i have unidata 2.5 / 500 OF). Exist a setting to fix this problem? this night i can check.

Check the CPU usage (via top or similar over ssh). PPPoE is quite CPU intensive and the standard build isn't hardware accelerated (that's the NSS one that is not stable for daily use), you could be hitting some hardware limit.

When arrive the last version of Openwrt stable for this router? The possibility to have the same hardware functionality present with OOTB firmare is real or is a dream?

I'm trying to figure out the Wifi MAC address issue. In the script /etc/hotplug.d/firmware/11-ath11k-caldata I can see that MAC is retrieved from art partition.

caldata_extract "0:art" 0x1000 0x20000

If I look into ART for this specific device I see:

0000:1000 | 01 00 04 04  00 00 00 00  00 80 F7 82  18 04 00 03 | ..........÷.....
0000:1010 | 7F 12 34 56  00 03 7F 12  34 57 00 03  7F 12 34 58 | ..4V....4W....4X
0000:1020 | 00 03 7F 12  34 59 00 03  7F 12 34 5A  00 03 7F 12 | ....4Y....4Z....
0000:1030 | 34 5B                                              | 4[              

If I look at it the 1st three octets are 00:03:7F I get a typical Atheros MAC. While the following octets are 12 34 56-5B. They look strange (at least to me).

Every reboot the last 3 octets of the Wifi MAC are changing.

It looks like this (3 devices, 6 AP's)

phy1-ap0     00:03:7f:12:3d:87 
phy0-ap0     00:03:7f:12:f9:a3
pyh2-ap0     00:03:7f:12:c1:ab
pyh2-ap1     02:03:7f:12:c1:ab permaddr 00:03:7f:12:c1:ab
pyh1-ap1     02:03:7f:12:3d:87 permaddr 00:03:7f:12:3d:87
pyh0-ap1     02:03:7f:12:f9:a3 permaddr 00:03:7f:12:f9:a3

I see the manufacturer part 00:03:7F and I understand the addition to 02 for ap1.

Basically we have 6 MAC addresses. While I guess that 3 are for wifi and at least one for bluetooth.

What did I try:

As we have an mmc device here I've tried to change to caldata_extract_mmc. It does not change anything. I've restricted the search range for MAC e. g. 0x100E-0x1031. No dice.

So my assumption:

  • OpenWrt is looking into ART finds sth. is wrong and let run the last 3 octets through a meat grinder. Every reboot.
  • The device MAC retrieved from ART is the wrong approach for this specific device.

If I compare it to AX3600 I can see that the 1st three octets are the same for wifi and eth devices.

For this device its different. I have bc:cf:4f for eth devices and 00:03:7f for wifi devices. I can see those values in ART also.

Something is wrong here and I have the feeling that OpenWrt installation has sth. to do with altering the ART value (while I do not know if possible and if why)? As I've saved ART after initial flash (and not before) I cannot compare. -.- This is wrong ofc. :smiley: Let's say it in other way: The MAC's in ART are clearly not uniqe. So maybe OpenWrt is deciding within a script which I'm not aware of to alter them because of this.

Is it worth to try to fix the values in ART if possible. Or does it nothing? For the AX3600 the values in ART are corresponding to those for wifi devices.

EDIT: BTW. We are not alone anymore: Adding Support for Verizon CR1000A - #583 by a_guy
So there is hope that others with deeper knowledge will find the issue. ^^

O. K. I give up on this task. I have no clue/reference to get the nvmem MAC we have for this device for the lan & wan into the wifi tree.

We have:

/sys/devices/platform/soc/c000000.wifi/ieee80211/phy{0,1,2}/addresses 
/sys/devices/platform/soc/c000000.wifi/ieee80211/phy{0,1,2}/macaddress 

The corresponding DTS dir is:

/proc/device-tree/soc/wifi@c0000000
partition@600000 {
	compatible = "u-boot,env";
	label = "0:appsblenv";
	reg = <0x600000 0x10000>;

	macaddr_lan: ethaddr {
	#nvmem-cell-cells = <1>;
	};
};
&wifi {
	status = "okay";
	nvmem-cells = <&macaddr_lan 0>;
	nvmem-cells-name = "mac-address";
	qcom,ath11k-calibration-variant = "Zyxel-NBG7815";
};

I know I'm missing here a connection to ieee80211/phy{0,1,2}. I'm lacking knowledge ...

Despite that I don't understand how the firmware/driver is calculating the MAC. As we have 6 useless adresses (00:03:7F:12:34:56-5B) in ART. For me it looks like the driver is aware of it that it is not a real MAC and is doing a random iteration on every boot.

I've tried the caldata.sh way referencing ath10k_patch_mac with various flavours. But it does nothing. Even if I give a "salt" to make the MAC's looking "normal".

So I doubt it would respect any settings within DTS or via caldata if it find entries in ART. ART will win and this BS MAC's will be iterated every reboot.

Does anybody know if it has worked in the past correctly?

The only thing what we have is a hotplug script. But this is an ugly solution. I'm even unsure if this would makes sense at all. Setting it in UCI is basically the same.

Other question: Does anyone has a reference for proper editing ART? I guess we cannot simple edit ART partition due to checksums?

I have the same problem and i never update openwrt. Fresh install, and now i want to revert back original firmware, but i have:
root@OpenWrt:/# sh change_boot_partition.sh
OpenWrt release
1+0 records in
1+0 records out
1+0 records in
1+0 records out
Could not open mtd device: /dev/mtd2
Can't open device for writing!
Could not open mtd device: /dev/mtd3
Can't open device for writing!

please help

I found solution:
install mtd-rw package then from shell
insmod mtd-rw.ko i_want_a_brick=1

Unfortunately, that won't work as ath11k currently has no NVMEM support.
That is one of the things I want to add in the short term to get rid of userspace caldata loading.

MAC setting is also configured via the BDF, but I find it ridiculous that vendors are not burning the proper MAC in ART as part of caldata as its meant to be done.

2 Likes

Thank you for this post and your effort to get this into the driver. :slight_smile:

If someone want to fix it meanwhile with a "hack":

mkdir -p /etc/hotplug.d/ieee80211/
cat <<'EOF' > "/etc/hotplug.d/ieee80211/10-fix-wifi-mac"
#!/bin/ash

[ "$ACTION" = "add" ] || exit 0

PHYNBR=${DEVPATH##*/phy}

[ -n "$PHYNBR" ] || exit 0

. /lib/functions.sh
. /lib/functions/system.sh

board=$(board_name)
label_mac=""

case "$board" in
    zyxel,nbg7815)
        label_mac=$(cat /sys/firmware/devicetree/base/soc/dp1/mac-address | hexdump -ve '/1 "%02x"' | sed 's/.\{2\}/&:/g' | cut -d':' -f 1-6)
        macaddr_add $label_mac $(($PHYNBR + 2)) > /sys${DEVPATH}/macaddress
        sleep 5
        /sbin/wifi down && /sbin/wifi up
          ;;
esac
EOF
chmod +x /etc/hotplug.d/ieee80211/10-fix-wifi-mac

As the hotplug script is called quite late wifi is already up. So we need to restart wifi.

1 Like