OpenWrt support for Netgear WAX620

I don't have this device in my possession.

Usually OEM's have some kind of fallback mode implemented in u-boot.

I'm guessing it's the boot_count env variable, you need to reset that to 0 during boot.

Otherwise u-boot is switching to the secondary rootfs partition during next boot.

Example:

Awesome. Will add and try this later :+1:

Hi.

I did manage to compile a WAX620 version based on 23.05.0-rc2. Was more like copy/paste wax218 really and changing some things. But I checked git status after compiling, and it did add this line CONFIG_FRAME_WARN=2048:

diff --git a/target/linux/ipq807x/config-5.15 b/target/linux/ipq807x/config-5.15
index a3d0628be9..b510667662 100644
--- a/target/linux/ipq807x/config-5.15
+++ b/target/linux/ipq807x/config-5.15
@@ -124,6 +124,7 @@ CONFIG_EDAC_SUPPORT=y
 CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FRAME_POINTER=y
+CONFIG_FRAME_WARN=2048
 CONFIG_FUJITSU_ERRATUM_010001=y
 CONFIG_FWNODE_MDIO=y
 CONFIG_FW_LOADER_PAGED_BUF=y

I can't find a match in the original rc2 source. Anything to worry about? This is prob a dumb question but just wanna be safe here...

I've just compiled it, so have not been able to test my sysupgrade bin yet.

Have a nice weekend :slightly_smiling_face:

Okey, I'm stuck, and not able to successfully build the board-2.bin. I get no errors while compiling, but my package ipq-wifi-netgear_wax620...ipk is only 1 KB, compared to wax218 that is 9 KB.

If I look inside the file, my rootfs-overlay folder is empty. The folder is from the data.tar.gz file btw.

Any tips or hints are very welcome. @jmspswny , is this the same issue you have?

I feel I'm missing some steps to add a new device. I've followed the steps from wax218. But is there any commands you need to run before build to tell that there's something new?

Edit: This is RC2.

This is the same dead end I hit.

I was looking at this file https://github.com/openwrt/openwrt/blob/v23.05.0-rc2/package/firmware/ipq-wifi/Makefile and it looks like it downloads the board files.
Since wax620 is not available in the repo it will always be 1KB.

It doesn’t make sense to me… I’m clearly missing something here.

Edit: yeah, I believe we have to use the qca tool

yes, the BDF file needs to be present in this repo:
https://git.openwrt.org/?p=project/firmware/qca-wireless.git;a=summary

( you can issue a PR here:
https://github.com/openwrt/firmware_qca-wireless )

That being said, I've not even been able to successfully build the WAX218 firmware, which does have the necessary BDF file in the repo. Without being able to successfully build a known good firmware, I wasn't going to start building beyond that.

Okey, I understand.

I have now created a board-2.bin from stock file bdwlan.bin. I changed the filename to board-netgear_wax620.ipq8074 and put it in the ipq-wifi folder as described in other posts. However, I'm still unable to include this board-2.bin file in my build. No compile errors tho, but it just want fetch this file.

@kirdes Hello, do you have any hints how to include the board-2.bin file when I build a custom firmware.

Here is my board-2.bin file https://github.com/skramstad/openwrt-netgear_wax620/commit/95163b781acae2aba2146192f85efc87e763c2cb

Edit: My files for Netgear WAX620. If there's anything wrong please let me know. @jmspswny you may compare your files, to see if I did something wrong :slight_smile: .

You could either fork the qca-wireless repo, commit your bdf and update the ipq-wifi makefile to point to your fork or you could omit the ipq-wifi package and simply add that as a cutom file to the build, e.g. just put that file under the target dir with the full path (target/linux/qualcommax/lib/firmware....)

Okey. I'm trying to compile but nothing is working. The compiled file is still pretty empty, so the board file is not added.

I added my file to

target/linux/ipq807x/lib/firmware/ath11k/IPQ8074/hw2.0/board-2.bin

and/or

target/linux/ipq807x/lib/firmware/ath11k/IPQ8074/hw2.0/board-netgear_wax620.ipq8074

I also forked firmware-qca repository and changed the path in the Makemenu file, but no luck there.
I also added my board file to this folder

package/firmware/ipq-wifi/board-netgear_wax620.ipq8074

but no luck...

I'm really sorry for asking all the time, but I'm glad you are responding and pointing me in the right direction.

First rm -R build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/base-files
then:

make package/base-files/{clean,compile} V=s

And look if there* s any error during make. If it's successful, the bdf should be in the following path

build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq807x/base-files/ipkg-aarch64_cortex-a53/base-files

Putting the bdf locally to the ipq-wifi package won't work 'cause the package source ist git. The bdf needs to exists in the git repo and you need to add 2 device specific entries to the makefile.

Thanks for helping out. I'm on RC2 btw, so no qualcommax folder...
I followed your instructions but no luck the first time. I then added my board-2.bin inside base-files folder target/linux/ipq807x/base-files/lib/firmware/ath11k/IPQ8074/hw2.0.
Don't know if that's correct. But that did work, so my board-2.bin is now in
build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/base-files/ipkg-aarch64_cortex-a53/base-files/lib/firmware/ath11k/IPQ8074/hw2.0.
Did not see any errors this time.

Edit: Extracted the firmware to see if board-2.bin was included, and it was. Will try to boot initramfs later to see if it detects the changes... Thanks for helping out @kirdes . :+1:

Okey, so I managed to create an image and boot with no errors as far as I can see. But I'm not really sure how to manage the leds for LAN and WLAN. I've tried wax218 gpios numbers and some others from the extracted wax620 dts firmware. However, I only got the power leds working.

I have to use &tlmm and not gpio or it will fail. The dts shows the gpios for power, but nothing for lan and wlan. So for now I'm comparing the debug/gpio output when I enable/disable wifi. I dunno if it helps, or it's the right way to do this.

This works:

led_system_red: system-red {
	label = "red:system";
	gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>;
};

led_system_green: system-green {
	label = "green:system";
	gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>;
};

led_system_blue: system-blue {
	label = "blue:system";
	gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>;
};
root@OpenWrt:~# cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 430-441, parent: platform/200f000.spmi:pmic@0:gpio@c000, 200f000.spmi:pmic@0:gpio@c000:
 gpio1 : ---
 gpio2 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio3 : out  high normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio4 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio5 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio6 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio7 : out  high normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio8 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio9 : out  high normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio10: in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio11: out  high normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio12: ---

gpiochip0: GPIOs 442-511, parent: platform/1000000.pinctrl, 1000000.pinctrl:
 gpio0   : in  low  func1 2mA pull down
 gpio1   : in  high func1 8mA no pull
 gpio2   : in  high func1 2mA pull down
 gpio3   : in  high func1 8mA no pull
 gpio4   : in  high func1 8mA no pull
 gpio5   : in  low  func1 8mA no pull
 gpio6   : in  low  func1 8mA no pull
 gpio7   : in  low  func1 8mA no pull
 gpio8   : in  low  func1 8mA no pull
 gpio9   : in  high func1 2mA pull down
 gpio10  : in  high func1 8mA no pull
 gpio11  : in  high func1 8mA no pull
 gpio12  : in  low  func1 8mA no pull
 gpio13  : in  low  func1 8mA no pull
 gpio14  : in  low  func1 8mA no pull
 gpio15  : in  low  func1 8mA no pull
 gpio16  : in  low  func1 8mA no pull
 gpio17  : in  high func1 8mA no pull
 gpio18  : in  low  func0 2mA pull down
 gpio19  : in  low  func0 2mA pull down
 gpio20  : in  low  func0 2mA pull down
 gpio21  : in  low  func0 2mA pull down
 gpio22  : in  high func2 2mA pull down
 gpio23  : in  low  func2 8mA no pull
 gpio24  : out low  func2 8mA no pull
 gpio25  : in  low  func0 2mA pull down
 gpio26  : in  low  func0 2mA pull down
 gpio27  : in  low  func0 2mA pull down
 gpio28  : in  high func0 2mA pull down
 gpio29  : in  low  func0 2mA pull down
 gpio30  : in  low  func0 2mA pull down
 gpio31  : in  high func0 2mA pull down
 gpio32  : in  low  func0 2mA pull down
 gpio33  : in  low  func0 2mA pull down
 gpio34  : in  low  func0 2mA pull down
 gpio35  : in  low  func0 2mA pull down
 gpio36  : in  high func0 2mA pull down
 gpio37  : in  low  func0 2mA pull down
 gpio38  : in  low  func3 2mA pull up
 gpio39  : in  high func3 2mA pull up
 gpio40  : in  high func2 2mA pull up
 gpio41  : in  high func2 2mA pull up
 gpio42  : in  low  func2 2mA pull down
 gpio43  : in  low  func2 2mA pull down
 gpio44  : out high func0 2mA pull down
 gpio45  : in  high func1 2mA pull down
 gpio46  : in  low  func0 2mA pull down
 gpio47  : in  low  func0 2mA pull down
 gpio48  : in  low  func0 2mA pull down
 gpio49  : in  low  func0 2mA pull down
 gpio50  : in  low  func0 2mA pull down
 gpio51  : in  low  func0 2mA pull down
 gpio52  : in  high func0 2mA pull down
 gpio53  : in  low  func0 2mA pull down
 gpio54  : out low  func0 8mA pull down
 gpio55  : out high func0 2mA pull down
 gpio56  : out low  func0 2mA pull down
 gpio57  : in  low  func0 2mA pull down
 gpio58  : in  low  func0 2mA pull down
 gpio59  : in  low  func0 2mA pull down
 gpio60  : in  low  func0 2mA pull down
 gpio61  : in  low  func0 2mA pull down
 gpio62  : in  low  func0 2mA pull down
 gpio63  : in  low  func0 2mA pull down
 gpio64  : in  low  func0 2mA pull down
 gpio65  : in  low  func0 2mA pull down
 gpio66  : in  low  func0 2mA pull down
 gpio67  : in  high func0 2mA pull down
 gpio68  : in  high func1 8mA pull up
 gpio69  : in  high func1 8mA pull up

This is how OEM is using leds for LAN + WLAN.

ledc@191E000 {
			compatible = "qca,ledc";
			reg = <0x191e000 0x20070>;
			reg-names = "ledc_base_addr";
			qcom,tcsr_ledc_values = <0x320193 0x00 0x00 0x00 0x00 0xffffffff 0xffffffff 0xffffffff 0x7d0820 0x00 0x10482094 0x3ffffe1>;
			qcom,ledc_blink_indices_cnt = <0x06>;
			qcom,ledc_blink_indices = <0x0f 0x0e 0x0d 0x0c 0x0b 0x0a 0x17>;
			qcom,ledc_blink_idx_src_pair = <0x06 0x14>;
			status = "ok";
			pinctrl-0 = <0x2f>;
			pinctrl-names = "default";

			led_lan_g {
				label = "led_lan_g";
				linux,default-trigger = "none";
			};

			led_lan_o {
				label = "led_lan_o";
				linux,default-trigger = "none";
			};

			led_2g_b {
				label = "led_2g_b";
				linux,default-trigger = "none";
			};

			led_2g_g {
				label = "led_2g_g";
				linux,default-trigger = "none";
			};

			led_5g_b {
				label = "led_5g_b";
				linux,default-trigger = "none";
			};

			led_5g_g {
				label = "led_5g_g";
				linux,default-trigger = "none";
			};
		};

And in a script they do this

usage()
{
    echo -n "Usage : /etc/netgear_leds.sh <all|colour|led> <on|off>

    Valid arguments are :
    2g_blue         - Turn on/off 2.4G WLAN Blue colour LED
    2g_green        - Turn on/off 2.4G WLAN Green colour LED"
    if [ ${WLAN_NUM_RADIOS} = "3" ]; then
    echo -n "
    5g_low_blue     - Turn on/off 5G_LOW WLAN Blue colour LED
    5g_low_green    - Turn on/off 5G_LOW WLAN Green colour LED
    5g_high_blue    - Turn on/off 5G_HIGH WLAN Blue colour LED
    5g_high_green   - Turn on/off 5G_HIGH WLAN Green colour LED"
    else echo -n "
    5g_blue         - Turn on/off 5G WLAN Blue colour LED
    5g_green        - Turn on/off 5G WLAN Green colour LED"
    fi
    echo "
    pwr_green       - Turn on/off Power Green LED
    pwr_red         - Turn on/off Power Red LED
    pwr_blue        - Turn on/off Power Blue LED"
    if [ ${ETH_NUM_PORTS} = "2" ]; then
    echo -n "
    lan1_green      - Turn on/off LAN1 Green LED
    lan1_amber      - Turn on/off LAN1 Orange LED
    lan2_green      - Turn on/off LAN2 Green LED
    lan2_amber      - Turn on/off LAN2 Orange LED"
    else echo -n "
    lan_green       - Turn on/off LAN Green LED
    lan_amber       - Turn on/off LAN Orange LED"
    fi
    echo "
    blue            - Turn on/off all Blue LEDs
    green           - Turn on/off all Green LEDs
    red             - Turn on/off all Red LEDs
    amber           - Turn on/off all Amber LEDs     
    all             - Turn on/off all LEDs

    Example:
    /etc/netgear_leds.sh pwr_red off
    /etc/netgear_leds.sh all on"

	exit 1
}

And some of this

RESET_DELAY_ON=75
RESET_DELAY_OFF=75
DELAY_ON=1000
DELAY_OFF=1000

led_set_attr() {
        [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2"
}

led_timer() {
        led_set_attr $1 "trigger" "timer"
        led_set_attr $1 "delay_on" "$2"
        led_set_attr $1 "delay_off" "$3"
}

led_on() {
        led_set_attr $1 "trigger" "none"
        led_set_attr $1 "brightness" 255
}

led_off() {
        led_set_attr $1 "trigger" "none"
        led_set_attr $1 "brightness" 0
}

start_pwr_led_blink_green()
{
        led_timer led_pwr_g $DELAY_ON $DELAY_OFF
}

stop_pwr_led_blink_green()
{
        led_off led_pwr_g
}

Is this a smiliar way(ish) to how Verizon CR1000A is doing it?

CR100A is different, it's using a dedicated led controller.

AFAIK you can drop the entire ledc dts node, the leds are gpio controlled. Look in the dts for the gpio definitions for the leds.

You just need to define the leds including the gpios, look in the ipq8072-dl-wrx36.dts for example.

I'm sorry, but I can't find any gpio related to lan and wlan. I've posted a gist if you want to have a look.

Edit: Kernel log from stock: Machine model: Qualcomm Technologies, Inc. IPQ807x/AP-HK07, so that's the one I'm using. Some of the others dts is referring to gpios for lan and wlan. I've tried those gpios, but no luck.

Looks similar to the RAX120

Try the definitions from the RAX120 (led_spi and leds)

Finally... working leds. :smile:
Thanks @kirdes for helping out. I was on the right track, and what you pointed out was correct about the led_gpios. I did try the same in the beginning, but it failed. However I did not have kmod-gpio-nxp-74hc164 installed. Dunno why, but as soon as that was installed, the leds started working. So I learned the hard way I guess.

I got one error on load:

kern.err kernel: [    0.025911] OF: /soc/dp6-syn: could not find phandle 40

Maybe I did something wrong in the aliases with ethernet0 = &dp6_syn; or missing something in my dts.

One thing I'm not sure about is.
If registers-number = <2>; should be 1 or 2. The WAX218 dts use 1.

I've pushed my last changes in my repo if anyone wanna test.

Next up would be creating a valid firmware for stock UI. But that's not something I'm comfortable doing. Maybe someone else with more experience could have a look.

regarding

kern.err kernel: [    0.025911] OF: /soc/dp6-syn: could not find phandle 40

Use dp6 instead of dp6_syn.
dp6 is the correct node with the same reg as the stock dts.

Thanks, I'll fix that.