Skip to content

qualcommax: 301w: enable using kernel for AQR firmware loadin #14484

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

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

robimarko
Copy link
Contributor

@robimarko robimarko commented Jan 25, 2024

Currently, AQR firmware is loaded via U-Boot as previously there was no support for the kernel to load the firmware, however, that has recently changed and with the MDIO frequency fixed as well we can now rely on the kernel to load the firmware instead.

This has multiple benefits:

  1. We do not have to modify the U-Boot environment during installation
  2. AQR LED-s are properly configured as in the stock FW and both of them work
  3. There is no need to wrap the firmware with an MBN header
  4. Firmware can be easily extracted from the stock firmware

This PR allows loading the firmware via 2 ways:

  1. Just place the FW binaries to /lib/firmware
  2. Flash FW binaries to the respective 0:ethphyfw1 and 0:ethphyfw2 partitions and then they will be loaded via NVMEM.

@github-actions github-actions bot added kernel pull request/issue with Linux kernel related changes target/qualcommax pull request/issue for qualcommax target labels Jan 25, 2024
@robimarko robimarko force-pushed the qnap-aqr-fw branch 2 times, most recently from 5dc4057 to 78de4a0 Compare January 26, 2024 10:19
Now that we have support for firmware loading via the kernel driver, it
makes sense to populate the firmware name as well, so if its present the
driver can load it.

In later patches, loading the FW via NVMEM will be added as well.

Signed-off-by: Robert Marko <robimarko@gmail.com>
It seems that the reset GPIO-s defined for the two AQR PHY-s are actually
reversed.

Manually testing confirmed that GPIO44 is actually reset GPIO of AQR at 0,
while GPIO59 is reset of AQR at 8:
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 44=0
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 44=1
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 59=0
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 59=1
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down

Signed-off-by: Robert Marko <robimarko@gmail.com>
In order to get rid of having to modify U-boot bootcmd and having U-boot
load the Aquantia PHY-s firmware lets use some of the free space on SPI-NOR
to add a second ethphyfw partition and be able to load AQR FW via NVMEM
cells.

Signed-off-by: Robert Marko <robimarko@gmail.com>
@openwrt-bot openwrt-bot merged commit 652d722 into openwrt:main Jan 26, 2024
@robimarko robimarko deleted the qnap-aqr-fw branch January 27, 2024 10:19
@sppmasterspp
Copy link

sppmasterspp commented Mar 12, 2024

Currently using the QNAP stock 10G Firmware with (officially unsupported) NSS enabled community builds brakes the 10G_1 port connection. Cannot get/lease IP address. See this.
This can be seen in the logs.

nss-dp 3a001800.dp5 10g-1: PHY Link up speed: 1000
br-lan: port 1(10g-1) entered blocking state
br-lan: port 1(10g-1) entered forwarding state
uniphy autoneg time out!

Doesn't work with 2.5G mode either.

nss-dp 3a001800.dp5 10g-1: PHY Link up speed: 2500
br-lan: port 1(10g-1) entered blocking state
br-lan: port 1(10g-1) entered forwarding state
uniphy autoneg time out!

Don't use on NSS builds at least for now!
If anyone can offer a patch or solution to this, please write to the QNAP thread too.

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

Successfully merging this pull request may close these issues.

3 participants