8000 Backport support for Linksys MX4300 to 24.10 branch by rkboni · Pull Request #17889 · openwrt/openwrt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Backport support for Linksys MX4300 to 24.10 branch #17889

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

Conversation

rkboni
Copy link
Contributor
@rkboni rkboni commented Feb 7, 2025

Backport support for Linksys MX4300 to 24.10 branch:

b985575 qualcommax: ipq807x: add support for Linksys MX4300 (LN1301)
df5ea1a mtd: check the return value of malloc and pread
492ddd1 qualcommax: add kernel cmdline replacement hack
7d0bccd mtd: fix resetbc on nand w/ min I/O size > 2048
f0b940f qualcommax: ipq807x: fix mac setup for Linksys MX4200v2
4b859cc qualcommax: ipq807x: define configuration for Linksys MX4x00 devices
53375be qualcommax: ipq807x: create generic Linksys MX4x00 dts
ababd7a qualcommax: ipq807x: remove unnecessary bootargs-append for MX4200

@github-actions github-actions bot added kernel pull request/issue with Linux kernel related changes core packages pull request/issue for core (in-tree) packages target/qualcommax pull request/issue for qualcommax target release/24.10 pull request/issue targeted (also) for OpenWrt 24.10 release labels Feb 7, 2025
@rkboni
Copy link
Contributor Author
rkboni commented Feb 7, 2025

CC @testuser7 @robimarko first time submitting a multi-commit backport, so please let me know if I should do it differently (e.g. maybe split mtd and qualcommax commits into 2 PRs?). 🙏

Lessons learned here would be handy, because I'd like to backport the HomeWRK commits as well, once this is in.

@robimarko
Copy link
Contributor

Honestly, considering that 24.10 final has been released I think its too late to backport this device, especially since its not just a simple DTS addition

@testuser7
Copy link
Contributor

@rkboni, thanks for the PR.

Honestly, considering that 24.10 final has been released I think its too late to backport this device, especially since its not just a simple DTS addition

@robimarko, I planned to add a backport for these 3 PRs:

The changes you mention have been used by many users for quite some time now. There have been no reports related to this.
However, there are many reports of someone trying to update without installing OpenWrt on both partitions first. And this problem is now solved.

@robimarko
Copy link
Contributor

It was late during RC-s as well, this is not a simple backport

@rkboni
Copy link
Contributor Author
rkboni commented Feb 7, 2025 via email

@OpenWRT-fanboy
Copy link

It was late during RC-s as well, this is not a simple backport

MX4300 is a very popular device in the community. Providing an official stable 24.10.1 version would be very beneficial to many, far more than just about any recent device that has been added. PR has been well tested for many months now without incident.

Not all users are comfortable being on the bleeding edge using SNAPSHOT.

@testuser7
Copy link
Contributor

It was late during RC-s as well, this is not a simple backport

Which changes are you worried about?

@robimarko
Copy link
Contributor

It was late during RC-s as well, this is not a simple backport

Which changes are you worried about?

Basically all of them, its my position that backporting anything more complicated than DTS changes or bugfixes beats the purpose of a stable release.

@testuser7
Copy link
Contributor

Support for the MX4300 was added before branch 24.10 was created. Because it is a popular (cheap) model, custom builds have been created and used successfully since support was added.

@robimarko
Copy link
Contributor

Look, I understand your reasoning, but I do not want to deal with more regressions.

Couple of Tested-by could probably change my opinion, especially on other devices.

@rkboni
Copy link
Contributor Author
rkboni commented Feb 10, 2025 via email

@robimarko
Copy link
Contributor

Yes, other ipq807x boards with this backported especially, no board in particular but just a couple and then we can take the risk

@testuser7
Copy link
Contributor
testuser7 commented Feb 10, 2025

I have prepared test builds:

Branch openwrt-24.10 + 3 PR that I mentioned without a single commit:

@rkboni
Copy link
Contributor Author
rkboni commented Feb 10, 2025 via email

@OpenWRT-fanboy
Copy link

I have prepared test builds:

Branch openwrt-24.10 + 3 PR that I mentioned without a single commit:

I tested your MX8500 test build. The 2.4g and 5g wireless do not come up. Kernel log:

[ 14.060500] ath11k c000000.wifi: fw_version 0x290b84a5 fw_build_timestamp 2024-09-23 11:32 fw_build_id WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1
[ 14.093939] ath11k c000000.wifi: failed to fetch board data for bus=ahb,qmi-chip-id=0,qmi-board-id=255,variant=Linksys-MX8500 from ath11k/IPQ8074/hw2.0/board-2.bin
[ 14.094002] ath11k c000000.wifi: failed to fetch board data for bus=ahb,qmi-chip-id=0,qmi-board-id=255 from ath11k/IPQ8074/hw2.0/board-2.bin
[ 14.107415] ath11k c000000.wifi: failed to fetch board data for bus=ahb,qmi-chip-id=0,qmi-board-id=255 from ath11k/IPQ8074/hw2.0/board-2.bin
[ 14.120246] ath11k c000000.wifi: failed to fetch board.bin from IPQ8074/hw2.0
[ 14.132805] ath11k c000000.wifi: qmi failed to fetch board file: -12
[ 14.139828] ath11k c000000.wifi: failed to load board data file: -12
[ 33.766638] l11: disabling
[ 74.726742] ath11k c000000.wifi: Coldboot Calibration timed out

@testuser7
Copy link
Contributor
testuser7 commented Feb 10, 2025

I tested your MX8500 test build. The 2.4g and 5g wireless do not come up.

Did you install the image or run initramfs? In case of initramfs, BDF files may be missing.

I checked and there is no equivalent BDF files in all images. This is because config contains many devices.

@OpenWRT-fanboy
Copy link

I tested your MX8500 test build. The 2.4g and 5g wireless do not come up.

Did you install the image or run initramfs? In case of initramfs, BDF files may be missing.

I checked and there is no equivalent BDF files in all images. This is because config contains many devices.

I used your sysupgrade.bin. The included board-2.bin is "variant=Linksys-HomeWRK" which was why it didn't work. I replaced with the board-2.bin from 24.10 which is "variant=Linksys-MX8500" and then everything works as expected.

@robimarko
Copy link
Contributor

Probably ipq-wifi needs to be updated which is yet another thing I do not like

@testuser7
Copy link
Contributor

I have prepared new images with the correct board packages: #17889 (comment)

@testuser7
Copy link
Contributor

Probably ipq-wifi needs to be updated which is yet another thing I do not like

Yes but only for HomeWRK. MX4300 uses the same BDF files as MX4200v1.

@testuser7
Copy link
Contributor
8000

Should we expand that to build all hardware for the qualcommax/ipq807x target so we can ask for testers on non-Linksys MX... hardware to show that this merge doesn't cause other regressions?

I think the only thing that needs to be checked is mtd resetbc used for Linksys devices on other architectures.

@OpenWRT-fanboy
Copy link

I have prepared new images with the correct board packages: #17889 (comment)

Tested new MX8500 build. Works fine now.

@sivom
Copy link
sivom commented Feb 14, 2025

I bought couple of them a while ago for $10 each on sale. I played with it for a while dd-wrt and some part with openwrt. I forgot about them. I was wondering what are these boxes. I opened them yesterday and tried Openwrt-fanboy version from snapshot.

  • Installation was a breeze with fwupdate
  • No luci and no wifi by default. I enabled wifi and installed Luci
  • configured for mesh both the pieces with mesh-openssl. Everything worked out well.
  • my video feeds are running through this a mesh config. They were very fast and works well.

Thanks Openwrt-FanBoy
Let me know if you want me to try any thing on these

image

@testuser7
Copy link
Contributor

Let me know if you want me to try any thing on these

Thanks but the case here is to check the backport for version 24.10.
If you can check the images shared in this comment (with LuCI): #17889 (comment)

The default value for the "root" parameter is "/dev/ubiblock0_0"
and there is no need to append it to bootargs.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: openwrt#16070
(cherry picked from commit fee2d93)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
testuser7 and others added 7 commits February 16, 2025 13:03
Create a generic Linksys MX4x00 dts file and extract the specific configuration
for MX4200v1/v2 to a new file.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: openwrt#16070
(cherry picked from commit ff85f88)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
Define shared configuration for Linksys MX4x00 devices.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: openwrt#16070
(cherry picked from commit 73fc1e0)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
Currently for Linksys MX4200v2 all u-boot ethXaddr variables share the same MAC address
and there is no need to check them one by one.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: openwrt#16070
(cherry picked from commit 80c8678)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
Fix a bug in linksys_bootcount.c that resetbc  won't work on nand
with min I/O size> 2048.

Check the boot-log entry's intergrity with checksum.

Signed-off-by: Qiyuan Zhang <zhang.github@outlook.com>
Link: openwrt#16070
(cherry picked from commit 62da99e)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add kernel command line replacement hack to qualcommax. Now we can
find and replace arguments in the kernel command line by setting
bootargs-find-1, bootargs-replace-1, bootargs-exact-match-1
and bootargs-find-2, bootargs-replace-2, bootargs-exact-match-2
under the chosen node in the device tree.

This hack replaces the first occurence of bootargs-find-X with
bootargs-replace-X. When bootargs-exact-match-X is set to "y",
then the replacement happens only if the kernel command line is
identical to bootargs-find-X.

Signed-off-by: Qiyuan Zhang <zhang.github@outlook.com>
Link: openwrt#16070
(cherry picked from commit 337f6f7)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
Check the return value of malloc and pread in case they fail.

Signed-off-by: Qiyuan Zhang <zhang.github@outlook.com>
Link: openwrt#16070
(cherry picked from commit 3f01454)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
Hardware specification:
========
SoC: Qualcomm IPQ8174
Flash: 1GB (Micron MT29F8G08ABBCAH4 or AMD/Spansion S34MS08G2)
RAM: 2GB (2x Kingston B5116ECMDXGJD or ESMT M15T2G16128A DDR3L)
Ethernet: 4x 10/100/1000Mbps (Qualcomm QCA8075)
WiFi1: 5GHz ax 2x2 (Qualcomm QCN5054 + Skyworks SKY85755-11) - channels 36-64 (low band)
WiFi2: 2.4GHz ax 2x2 (Qualcomm QCN5024 + Skyworks SKY85340-11)
WiFi3: 5GHz ax 4x4 (Qualcomm QCN5054 + Skyworks SKY85755-11) - channels 100-177 (high band)
LED: 1x RGB status (NXP PCA9633)
USB: 1x USB 3.0
Button: WPS, Reset

Flash instructions:
========
1. Manually upgrade firmware using openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin image.
More details can be found here: https://support.linksys.com/kb/article/6564-en/
After first boot check actual partition:
- fw_printenv -n boot_part
and install firmware on second partition using command in case of 2:
- mtd -r -e kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin kernel
and in case of 1:
- mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin alt_kernel

2. Installation using serial connection from OEM firmware (default login: root, password: admin):
- fw_printenv -n boot_part
In case of 2:
- flash_erase /dev/mtd21 0 0
- nandwrite -p /dev/mtd21 openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin
or in case of 1:
- flash_erase /dev/mtd23 0 0
- nandwrite -p /dev/mtd23 openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin
After first boot install firmware on second partition:
- mtd -r -e kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin kernel
or:
- mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin alt_kernel

3. Installation from initramfs image using USB drive:
Put the initramfs image on the USB drive:
- dd bs=1M if=openwrt-qualcommax-ipq807x-linksys_mx4300-initramfs-uImage.itb of=/dev/sdX
Stop u-boot and run:
- usb start && usbboot $loadaddr 0 && bootm $loadaddr
Write firmware to the flash from initramfs:
- mtd -e kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin kernel
and:
- mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin alt_kernel

4. Back to the OEM firmware:
- mtd -e kernel -n write FW_MX4300_1.0.4.215382_prod.img kernel
and:
- mtd -r -e alt_kernel -n write FW_MX4300_1.0.4.215382_prod.img alt_kernel

5. USB recovery:
Put the initramfs image on the USB:
- dd bs=1M if=openwrt-qualcommax-ipq807x-linksys_mx4300-initramfs-uImage.itb of=/dev/sdX
Set u-boot env:
- fw_setenv bootusb 'usb start && usbboot $loadaddr 0 && bootm $loadaddr'
- fw_setenv bootcmd 'run bootusb; if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi'

Co-authored-by: Qiyuan Zhang <zhang.github@outlook.com>
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: openwrt#16070
(cherry picked from commit 4d310b1)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: openwrt#17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
@robimarko robimarko force-pushed the openwrt-24.10-mx4300-backport branch from b985575 to 4c9cae1 Compare February 16, 2025 12:03
@openwrt-bot openwrt-bot merged commit 4c9cae1 into openwrt:openwrt-24.10 Feb 16, 2025
1 check passed
@robimarko
Copy link
Contributor

Thanks! Rebased on top of openwrt-24.10 and merged!

@rkboni
Copy link
Contributor Author
rkboni commented Feb 16, 2025

Thanks @robimarko 🙏 @testuser7 since I don't have a HomeWRK to test do you want to do the honors for the remaining PRs?

@testuser7
Copy link
Contributor

@rkboni sure, the first one is already created: #17985

@rkboni rkboni deleted the openwrt-24.10-mx4300-backport branch February 16, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core packages pull request/issue for core (in-tree) packages kernel pull request/issue with Linux kernel related changes release/24.10 pull request/issue targeted (also) for OpenWrt 24.10 release target/qualcommax pull request/issue for qualcommax target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0