Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipq40xx: add support for Linksys WHW01 v1 #3682

Closed
wants to merge 2 commits into from

Conversation

darkarnium
Copy link
Contributor

@darkarnium darkarnium commented Dec 13, 2020

This patch adds support for Linksys WHW01 v1 ("Velop") [FCC ID Q87-03331].

Specification
-------------

SOC:             Qualcomm IPQ4018
WiFi 1:          Qualcomm QCA4019 IEEE 802.11b/g/n
WiFi 2:          Qualcomm QCA4019 IEEE 802.11a/n/ac
Bluetooth:       Qualcomm CSR8811 (A12U)
Ethernet:        Qualcomm Atheros QCA8072 (2-port)
SPI Flash 1:     Mactronix MX25L1605D (2MB)
SPI Flash 2:     Winbond W25M02GV (256MB)
DRAM:            Nanya NT5CC128M16IP-DI (256MB)
LED Controller:  NXP PCA963x (I2C)
Buttons:         Single reset button (GPIO).

Notes
-----

There does not appear to be a way to trigger TFTP recovery without entering
U-Boot. The device must be opened to access the serial console in order to
first flash OpenWrt onto a device from factory.

The device has automatic recovery backed by a second set of partitions on
the larger of the two SPI flash ICs. Both the primary and secondary must
be flashed to prevent accidental rollback to "factory" after 3 failed boot
attempts.

Serial console
--------------

A serial console is available on the following pins of the populated J2
connector on the device mainboard (115200 8n1).

(<-- Top of PCB / Device)

  J2
  [o o o o o o]
       |   | |
       |   |  `-- GND
       |    `---- TX
       `--------- RX

Installation instructions
-------------------------

1. Setup TFTP server with server IP set to 192.168.1.236.
2. Copy compiled `...squashfs-factory.bin` to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Revert to "factory"
-------------------

1. Download latest firmware update from vendor support site.
2. Copy extracted `.img` file to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Signed-off-by: Peter Adkins peter@sunkenlab.com

@darkarnium darkarnium force-pushed the Linksys-WHW01v1 branch 2 times, most recently from bee0977 to 0511536 Compare December 13, 2020 13:58
@adschm adschm added the target/ipq40xx pull request/issue for ipq40xx target label Dec 13, 2020
@darkarnium
Copy link
Contributor Author

Thanks for the quick review, and the feedback! I've just added the requested changes and I am running a build now. Once complete I'll flash a test device to ensure no breaking changes and update this PR.

@darkarnium darkarnium force-pushed the Linksys-WHW01v1 branch 2 times, most recently from 4236412 to fefed9e Compare December 13, 2020 22:11
@darkarnium
Copy link
Contributor Author

darkarnium commented Dec 13, 2020

Rebuild complete and new ...factory.bin image flashed via TFTP without error (openwrt-ipq40xx-generic-linksys_whw01-v1-squashfs-factory.bin). Pushed a change to remove the padding to IMAGE_SIZE in favour of just padding to BLOCKSIZE - which is all that is required. Also fixed up ro flags on a few partitions which shouldn't have been there.

Confirmed LEDs, ethernet switch, and radios are still functioning. Appologies for the change after sign-off, but I thought this would be better than an immediate patch being required. 👍

@sniff122
Copy link

looks like im getting about the same throughput with the non -ct firmware

@sniff122
Copy link

Just installed atop with opkg and it looks like the limitation might be coming from IRQ because an IRQ is being hammered when doing a speed test
img

@sniff122
Copy link

tested with a second AP with the same results

@darkarnium
Copy link
Contributor Author

darkarnium commented May 18, 2022

I'm seeing about 281Mbit - 289Mbit average over a 60s iperf run with the client on a laptop, and the server ON the access point. The AP 801.11nac radio has been configured with the SSID the client is connected to, with the client shown as being connected as: 400.0 Mbit/s, 40 MHz, VHT-MCS 9, VHT-NSS 2, Short GI

image

To eliminate bottlenecks due to running iperf on the access point I ran the server on a machine with a wired connection to the access point - ableit via a switch. I'm seeing similar iperf results in this configuration.

@sniff122
Copy link

Running iperf between my phone and server on stock firmware:
img

running iperf between phone and server on openwrt:
img
Actually a little higher than ive had just using the speed test in ubiquiti wifi man (where i pull the 500-600mbps on the stock firmware)

@sniff122
Copy link

And my phone is connected as: 526.6 Mbit/s, 80 MHz, VHT-MCS 6, VHT-NSS 2 / 780.0 Mbit/s, 80 MHz, VHT-MCS 8, VHT-NSS 2, Short GI with the server on a gigabit ethernet connection to the switch the AP is on

@darkarnium
Copy link
Contributor Author

Thanks for those! I'll have a look and see what may be going on. I've upstreamed the board files for this device to the ath10k project, which were pulled directly from the device, but they're also present in this pull-request. I'll need to see what may be different between the stock firmware and the openwrt build. This is quite strange.

@sniff122
Copy link

alright, hope we can get to the bottom of this. Also ive recently wrote an ifixit teardown guide of the device what could be helpful on the wiki as a guide for users if they want to flash but want images of the process: https://www.ifixit.com/Teardown/Linksys+Velop+WHW01+Teardown/150164

@hervadore
Copy link

Hello, I've had several issues trying to build this for my whw01. Would anyone be able to assist or is there an option to download the file from anywhere?

@sniff122
Copy link

can you elaborate on the issues you are having? any errors logged? reproduction steps?

@hervadore
Copy link

hervadore commented May 23, 2022

can you elaborate on the issues you are having? any errors logged? reproduction steps?

Running on Ubuntu 22.04

git clone https://github.com/openwrt/openwrt.git

cd openwrt

git branch -a

git tag

git checkout v19.07.10

scripts/feeds update -a
scripts/feeds install -a

I tried manually making the changes for the patch but assuming I'm doing something wrong there. What would be the best way to apply a patch?

@sniff122
Copy link

you cant clone the master branch as this PR isnt merged in, here is what i have been doing with success

git clone https://github.com/darkarnium/openwrt -b Linksys-WHW01v1
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make -j $(nproc) kernel_menuconfig
make -j $(nproc) defconfig download clean world

for make menuconfig, the target system is Qualcomm Atheros IPQ40xx, subtarget is Generic and target profile is Linksys WHW01 v1 (feel free to make any other changes you may want)

That should compile successfully assuming you have all needed build dependencies installed, the firmware image you would use to initially flash the WHW01 will be in bin/targets/ipq40xx/generic/openwrt-ipq40xx-generic-linksys_whw01-v1-squashfs-factory.bin

@hervadore
Copy link

you cant clone the master branch as this PR isnt merged in, here is what i have been doing with success

git clone https://github.com/darkarnium/openwrt -b Linksys-WHW01v1
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make -j $(nproc) kernel_menuconfig
make -j $(nproc) defconfig download clean world

for make menuconfig, the target system is Qualcomm Atheros IPQ40xx, subtarget is Generic and target profile is Linksys WHW01 v1 (feel free to make any other changes you may want)

That should compile successfully assuming you have all needed build dependencies installed, the firmware image you would use to initially flash the WHW01 will be in bin/targets/ipq40xx/generic/openwrt-ipq40xx-generic-linksys_whw01-v1-squashfs-factory.bin

Thank you so much! That worked. I knew I was doing something wrong.

@sniff122
Copy link

Thank you so much! That worked. I knew I was doing something wrong.

np, glad to hear it worked

@hervadore
Copy link

Am I supposed to rename the bin file since the router is looking for nodes-jr.img?

@sniff122
Copy link

yeah

@ddgg
Copy link

ddgg commented May 26, 2022

yeah

thanks for the great work, I want to use it as a router, but there is only lan interface, if I want to add wan, should I use device eth1? and which of the two eth port should i plug wan cable in?

@sniff122
Copy link

yeah

thanks for the great work, I want to use it as a router, but there is only lan interface, if I want to add wan, should I use device eth1? and which of the two eth port should i plug wan cable in?

eth0 is the port that connects to the internal switch that handles the 2 ethernet ports. I'm pretty sure you would need to configure a VLAN for WAN in the switch config under network for one of the ports. After you would configure the firewall zone for that VLAN. Someone please correct me if I'm wrong

@ddgg
Copy link

ddgg commented May 26, 2022

yeah

thanks for the great work, I want to use it as a router, but there is only lan interface, if I want to add wan, should I use device eth1? and which of the two eth port should i plug wan cable in?

eth0 is the port that connects to the internal switch that handles the 2 ethernet ports. I'm pretty sure you would need to configure a VLAN for WAN in the switch config under network for one of the ports. After you would configure the firewall zone for that VLAN. Someone please correct me if I'm wrong

yeah, you are right, I add vlan and wan following another router setup and everything is working now, very glad this old but well designed router can be useful again, thank you for the help.

@sniff122
Copy link

np! glad to hear you are making good use of it! wish more manufacturers made it easier to use custom firmware on the devices to be able to use them for more but nope

jow- pushed a commit that referenced this pull request Jun 5, 2022
This patch adds support for Linksys WHW01 v1 ("Velop") [FCC ID Q87-03331].

Specification
-------------

SOC:             Qualcomm IPQ4018
WiFi 1:          Qualcomm QCA4019 IEEE 802.11b/g/n
WiFi 2:          Qualcomm QCA4019 IEEE 802.11a/n/ac
Bluetooth:       Qualcomm CSR8811 (A12U)
Ethernet:        Qualcomm QCA8072 (2-port)
SPI Flash 1:     Mactronix MX25L1605D (2MB)
SPI Flash 2:     Winbond W25M02GV (256MB)
DRAM:            Nanya NT5CC128M16IP-DI (256MB)
LED Controller:  NXP PCA963x (I2C)
Buttons:         Single reset button (GPIO).

Notes
-----

There does not appear to be a way to trigger TFTP recovery without entering
U-Boot. The device must be opened to access the serial console in order to
first flash OpenWrt onto a device from factory.

The device has automatic recovery backed by a second set of partitions on
the larger of the two SPI flash ICs. Both the primary and secondary must
be flashed to prevent accidental rollback to "factory" after 3 failed boot
attempts.

Serial console
--------------

A serial console is available on the following pins of the populated J2
connector on the device mainboard (115200 8n1).

(<-- Top of PCB / Device)

  J2
  [o o o o o o]
       |   | |
       |   |  `-- GND
       |    `---- TX
       `--------- RX

Installation instructions
-------------------------

1. Setup TFTP server with server IP set to 192.168.1.236.
2. Copy compiled `...squashfs-factory.bin` to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Revert to "factory"
-------------------

1. Download latest firmware update from vendor support site.
2. Copy extracted `.img` file to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Link: #3682
Signed-off-by: Peter Adkins <peter@sunkenlab.com>
(calibration from nvmem, updated to 5.10+5.15)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
@chunkeey
Copy link
Member

chunkeey commented Jun 5, 2022

Merged. Thanks!

@chunkeey chunkeey closed this Jun 5, 2022
1715173329 pushed a commit to immortalwrt/immortalwrt that referenced this pull request Jun 6, 2022
This patch adds support for Linksys WHW01 v1 ("Velop") [FCC ID Q87-03331].

Specification
-------------

SOC:             Qualcomm IPQ4018
WiFi 1:          Qualcomm QCA4019 IEEE 802.11b/g/n
WiFi 2:          Qualcomm QCA4019 IEEE 802.11a/n/ac
Bluetooth:       Qualcomm CSR8811 (A12U)
Ethernet:        Qualcomm QCA8072 (2-port)
SPI Flash 1:     Mactronix MX25L1605D (2MB)
SPI Flash 2:     Winbond W25M02GV (256MB)
DRAM:            Nanya NT5CC128M16IP-DI (256MB)
LED Controller:  NXP PCA963x (I2C)
Buttons:         Single reset button (GPIO).

Notes
-----

There does not appear to be a way to trigger TFTP recovery without entering
U-Boot. The device must be opened to access the serial console in order to
first flash OpenWrt onto a device from factory.

The device has automatic recovery backed by a second set of partitions on
the larger of the two SPI flash ICs. Both the primary and secondary must
be flashed to prevent accidental rollback to "factory" after 3 failed boot
attempts.

Serial console
--------------

A serial console is available on the following pins of the populated J2
connector on the device mainboard (115200 8n1).

(<-- Top of PCB / Device)

  J2
  [o o o o o o]
       |   | |
       |   |  `-- GND
       |    `---- TX
       `--------- RX

Installation instructions
-------------------------

1. Setup TFTP server with server IP set to 192.168.1.236.
2. Copy compiled `...squashfs-factory.bin` to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Revert to "factory"
-------------------

1. Download latest firmware update from vendor support site.
2. Copy extracted `.img` file to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Link: openwrt/openwrt#3682
Signed-off-by: Peter Adkins <peter@sunkenlab.com>
(calibration from nvmem, updated to 5.10+5.15)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit b4184c6)
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Jun 6, 2022
This patch adds support for Linksys WHW01 v1 ("Velop") [FCC ID Q87-03331].

Specification
-------------

SOC:             Qualcomm IPQ4018
WiFi 1:          Qualcomm QCA4019 IEEE 802.11b/g/n
WiFi 2:          Qualcomm QCA4019 IEEE 802.11a/n/ac
Bluetooth:       Qualcomm CSR8811 (A12U)
Ethernet:        Qualcomm QCA8072 (2-port)
SPI Flash 1:     Mactronix MX25L1605D (2MB)
SPI Flash 2:     Winbond W25M02GV (256MB)
DRAM:            Nanya NT5CC128M16IP-DI (256MB)
LED Controller:  NXP PCA963x (I2C)
Buttons:         Single reset button (GPIO).

Notes
-----

There does not appear to be a way to trigger TFTP recovery without entering
U-Boot. The device must be opened to access the serial console in order to
first flash OpenWrt onto a device from factory.

The device has automatic recovery backed by a second set of partitions on
the larger of the two SPI flash ICs. Both the primary and secondary must
be flashed to prevent accidental rollback to "factory" after 3 failed boot
attempts.

Serial console
--------------

A serial console is available on the following pins of the populated J2
connector on the device mainboard (115200 8n1).

(<-- Top of PCB / Device)

  J2
  [o o o o o o]
       |   | |
       |   |  `-- GND
       |    `---- TX
       `--------- RX

Installation instructions
-------------------------

1. Setup TFTP server with server IP set to 192.168.1.236.
2. Copy compiled `...squashfs-factory.bin` to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Revert to "factory"
-------------------

1. Download latest firmware update from vendor support site.
2. Copy extracted `.img` file to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Link: openwrt#3682
Signed-off-by: Peter Adkins <peter@sunkenlab.com>
(calibration from nvmem, updated to 5.10+5.15)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
@Sybalau
Copy link

Sybalau commented Aug 26, 2022

Hello, can you tell me if this method is compatible with the version socket from WHW01 (WHW01P)?

@darkarnium
Copy link
Contributor Author

darkarnium commented Aug 27, 2022

Hey @Sybalau,

Good question! I've had a quick look around and it looks like the WHW01P uses the same Winbond W632GU6MB-12 memory, Qualcomm IPQ4018 SoC, CSR8811 Bluetooth radio. However, it looks like the 5GHz front-end is different (SKY7482I001 vs SKY85748-11 in the WHW01v1), and the flash also looks like it may be different.

As a result, it seems likely that there would, at the very least, need to be some adjustments to the device-tree for this device, modification of the ethernet switch (as it looks like this device doesn't have any Ethernet ports), and likely extraction of new ath10k calibration data.

All in all, it doesn't seem easily possible - to me at least - to add support for this device to this change set. You may be able to re-use a bunch of the changes in a subsequent pull-request to add support for this device, but there would need to be several other changes based on information extracted from a running device.

devendranaga pushed a commit to devendra-naga-labs/bsp_build that referenced this pull request Sep 8, 2022
This patch adds support for Linksys WHW01 v1 ("Velop") [FCC ID Q87-03331].

Specification
-------------

SOC:             Qualcomm IPQ4018
WiFi 1:          Qualcomm QCA4019 IEEE 802.11b/g/n
WiFi 2:          Qualcomm QCA4019 IEEE 802.11a/n/ac
Bluetooth:       Qualcomm CSR8811 (A12U)
Ethernet:        Qualcomm QCA8072 (2-port)
SPI Flash 1:     Mactronix MX25L1605D (2MB)
SPI Flash 2:     Winbond W25M02GV (256MB)
DRAM:            Nanya NT5CC128M16IP-DI (256MB)
LED Controller:  NXP PCA963x (I2C)
Buttons:         Single reset button (GPIO).

Notes
-----

There does not appear to be a way to trigger TFTP recovery without entering
U-Boot. The device must be opened to access the serial console in order to
first flash OpenWrt onto a device from factory.

The device has automatic recovery backed by a second set of partitions on
the larger of the two SPI flash ICs. Both the primary and secondary must
be flashed to prevent accidental rollback to "factory" after 3 failed boot
attempts.

Serial console
--------------

A serial console is available on the following pins of the populated J2
connector on the device mainboard (115200 8n1).

(<-- Top of PCB / Device)

  J2
  [o o o o o o]
       |   | |
       |   |  `-- GND
       |    `---- TX
       `--------- RX

Installation instructions
-------------------------

1. Setup TFTP server with server IP set to 192.168.1.236.
2. Copy compiled `...squashfs-factory.bin` to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Revert to "factory"
-------------------

1. Download latest firmware update from vendor support site.
2. Copy extracted `.img` file to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Link: openwrt#3682
Signed-off-by: Peter Adkins <peter@sunkenlab.com>
(calibration from nvmem, updated to 5.10+5.15)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
@Nyshan
Copy link

Nyshan commented Nov 26, 2022

I'm currently trying to get DSA support setup for this device but I'm not having much luck. Could anyone assist me?

edit: For context on the "...I'm not having much luck." part: I've never done anything like this before but I have serial access to my hardware and can compile a working firmware (without Ethernet support) from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changes target/ipq40xx pull request/issue for ipq40xx target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet