Commit graph

4127 commits

Author SHA1 Message Date
Marcin FM
28a88ff7e6 ramips: EAP615-Wall v1: fix bootloop by reducing LZMA dictionary
Fix bootloop on TP-Link EAP615-Wall v1 by reducing LZMA dictionary
size. Before this patch and after an upgrade to kernel 6.12 this
device couldn't boot a kernel because of an error: "lzma compressed:
uncompress error 1".

I have chosen -d22 as dictionary size as suggested by @namiltd.
The usual sizes for problematic devices are -d16, -d20, -d22. I
have confirmed with my tests that this device can boot with a value
up to -d27, but there is no size benefit from values above -d21,
therefore -d22 is good enough.

See also: https://github.com/openwrt/openwrt/issues/19403

Signed-off-by: Marcin FM <marcin@ipv8.pl>
Link: https://github.com/openwrt/openwrt/pull/19433
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-21 23:56:32 +02:00
Jonathan Sturges
79b5151d7f ramips: add support for Wavlink WL-WN570HA2
The Wavlink Aerial HD3 (WL-WN570HA2) is an AC1200 dual-band outdoor
access point.  It supports 802.3AT/AF PoE and is IP67 waterproof.
It is based on the MediaTek MT7628DAN SoC and MT7613BEN WiFi 5 chip.
This model uses the 100Mbit LAN and 2.4Ghz WiFi elements of the
MT7628 and the 5Ghz WiFi of the MT7613.

Specification:
- SoC: MediaTek MT7628DAN (1C/1T) @ 580MHz
- RAM: 64MB DDR2 (integrated in SoC)
- FLASH: 16MB SPI NOR (Fudan FM25Q128A)
- Ethernet: 1x 10/100Mbps
- WiFi: 2.4/5 GHz 2T2R
  - 2.4GHz MediaTek MT7628DAN bgn
  - 5GHz MediaTek MT7613BEN nac
- Antennas: 2x detachable, dual-band 7dBi with RP-SMA connectors.
- USB: none
- BTN: Reset
- LED: 6 total: power; WAN/LAN; WiFi; WiFi low; WiFi med; Wifi high
- UART:  surface-mount on PCB.  Pins are marked via silkscreen.
   pin1 (square pad, towards Ethernet)=Vcc, pin2=RX,
   pin3=TX, pin4=GND.  Settings: 57600/8N1.
   NOTE: The TX & RX silkscreens were reversed on my test unit.

Installation:
1) This device requires a HTTP recovery procedure to do an initial load
  of OpenWRT.  You will need:
  a. A web browser (private window recommended)
  b. Configure an Ethernet interface to 192.168.1.x/24; don't use .1
  c. Connect a cable between the computer and the Wavlink's PoE injector.
2) Put the Wavlink in HTTP recovery mode.
  a. Do this by pressing and holding the reset button on the bottom while
  powering the unit on.
  b. As soon as all 6 LEDs light up blue (roughly 2-3 seconds), release
  the button.
  c. The LEDs should all remain lit, indicating it's in HTTP recovery.
3) Point the browser at http://192.168.1.1/index.html
4) Click "Choose File" and select the OpenWRT sysupgrade image.
5) Click the "Update Firmware" button and wait while the unit flashes
the image and reboots.
6) When the system comes back up fully, only the power LED will be lit.
Wait an extra minute then you should be able to reach OpenWRT on
http://192.168.1.1
5) Log into LuCI as root; there is no password.

Revert to the OEM Firmware:
--------------------------
* U-boot HTTP:
  Follow the HTTP recovery steps, and use a firmware image downloaded
  from Wavlink.

Signed-off-by: Jonathan Sturges <jsturges@redhat.com>
Link: https://github.com/openwrt/openwrt/pull/18856
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-12 22:51:39 +02:00
Gustavo Curi
dd15117dab ramips: add support for TP-Link EX220 v2
This device is similar to the TP-Link EX220 v1.
The differences are the number of ports (3 LANs
and 1 WAN) and the number of LEDs (1 LED RGB)

Hardware
--------

CPU:    MediaTek MT7621 DAT
RAM:    128MB DDR3 (integrated)
FLASH:  16MB SPI-NOR
WiFi:   MediaTek MT7905 + MT7975 (2.4 / 5 DBDC) 802.11ax
SERIAL: 115200 8N1
        LED - (TX - RX - GND - 3V3 ) - ETH ports

Installation
------------

Flashing is only possible via a serial connection using the sysupgrade
image; the factory image must be signed. You can flash the sysupgrade
image directly through the U-Boot console, or preferably, by booting the
initramfs image and flashing with the sysupgrade command. Follow these
steps for sysupgrade flashing:

1. Establish a UART serial connection.
2. Set up a TFTP server at 192.168.0.2 and copy the initramfs image
   there.
3. Power on the device and press any key to interrupt normal boot.
4. Load the initramfs image using tftpboot.
5. Boot with bootm.
6. If you haven't done so already, back up all stock mtd partitions.
7. Copy the sysupgrade image to the router.
8. Flash OpenWrt through either LuCI or the sysupgrade command. Remember
   not to attempt saving settings.

Revert to stock firmware
------------------------

Flash stock firmware via OEM web-recovery mode. If you don't have access
to the stock firmware image, you will need to restore the firmware
partition backed up earlier.

Web-Recovery
------------

The router supports an HTTP recovery mode:

1. Turn off the router.
2. Press the reset button and power on the device.
3. When the LED start flashing, release reset and quickly press it
   again.

The interface is reachable at 192.168.0.1 and supports installation of
the OEM factory image. Note that flashing OpenWrt this way is not
possible, as mentioned above.

Signed-off-by: Gustavo Curi <gpcuri@land.ufrj.br>
Link: https://github.com/openwrt/openwrt/pull/19104
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-12 21:37:52 +02:00
Shiji Yang
57aa05e8e5 kernel: bump 6.12 to 6.12.37
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.37

Manually rebased patch:
  generic/hack-6.12/902-debloat_proc.patch[1]

New Kconfig symbol:
  x86: enable MITIGATION_TSA[2]

All other patches are automatically refreshed.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.37&id=ead91de35d9cd5c4f80ec51e6020f342079170af
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.37&id=7a0395f6607a5d01e2b2a86355596b3f1224acbd

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19317
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-12 16:47:58 +02:00
Mieczyslaw Nalewaj
6f09f8ca31 ramips: update drivers to be compatible with kernel 6.12 and above
Replace .remove_new with .remove for compatibility with future kernel versions.
Dropping compatibility with older kernels.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/19320
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-07 20:30:26 +02:00
Mieczyslaw Nalewaj
ce97258300 ramips: drop 6.6 support
Drop configs and patches for Linux 6.6.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/19320
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-07 20:30:26 +02:00
Mieczyslaw Nalewaj
3402384f17 ramips: use kernel 6.12 by default
Switch to Linux kernel version 6.12.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/19320
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-07-07 20:30:26 +02:00
Rosen Penev
f955716341 ramips: fix wifi nodes to upstream standards
Replaced all mt76@ with wifi@ per upstream requirement for all wifi
nodes.

Added missing compatible string where appropriate as stated by mt76.yaml
upstream.

Also updated reg value to be consistent everywhere.

Replace all pci14c3 entries to use mediatek,mt76.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19067
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-04 22:01:40 +02:00
John Audia
1831966406 kernel: bump 6.6 to 6.6.95
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.95

Removed upstreamed:
 backport-6.6/201-v6.16-mips-Add-std-flag-specified.patch[1]
 mvebu/patches-6.6/0004-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch[2]
 mvebu/patches-6.6/0005-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch[3]
 mvebu/patches-6.6/0006-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch[4]
 mvebu/patches-6.6/0007-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch[5]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.95&id=231f6a1de15b3f62eb8d6163a8b1bc5935025c69
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.95&id=ae48bc0b8be8786fd0ceab4b5a95c09b5aa93816
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.95&id=8a15a5438c5816a1003b88ce20f25ccc92909ee7
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.95&id=02c966a8869becb29282403540c88ba33e19c347
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.95&id=14a26f6692062a529b612420adb6c0b9290b25d3

Build system: x86/64
Build-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64
Run-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/19248
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-28 22:55:13 +02:00
Shiji Yang
9ddeb30499 kernel: bump 6.12 to 6.12.35
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.35

Remove upstreamed patches:
  bcm27xx/patches-6.12/950-0961-media-imx335-Use-correct-register-width-for-HNUM.patch [1]
  bcm27xx/patches-6.12/950-1003-drivers-media-i2c-imx335-Fix-frame-size-enumeration.patch [2]
  gemini/patches-6.12/0001-net-ethernet-cortina-Use-TOE-TSO-on-all-TCP.patch [3]
  generic/backport-6.12/300-v6.16-mips-Add-std-flag-specified.patch [4]
  mvebu/patches-6.12/0004-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [5]
  mvebu/patches-6.12/0005-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [6]
  mvebu/patches-6.12/0006-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [7]
  mvebu/patches-6.12/0007-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch [8]

Manually rebased patches:
  bcm27xx/patches-6.12/950-0392-fbdev-Allow-client-to-request-a-particular-dev-fbN-n.patch [9]

All other patches are automatically refreshed.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=b93864e0865f235a791e69dc9ef4f896e559ef77
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=1f78790d988c9d55cf8d4b4d511d4b3e38ecb81d
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=2bd434bb0eeb680c2b3dd6c68ca319b30cb8d47f
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=6dbda47fe8bd6aa978c150bc9d321a286d2cc3f4
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=2cd2022c38fa26257cc6eec100ae122de9c1541c
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=133f17922b3dbae44fe583fb898b92b03558a657
[7] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=aefe45843ea667366e35df4fcfef5ff9051a86c9
[8] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=461d5a73ae45fbe6c300a6e64600f9792684eb52
[9] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.35&id=3f2098f4fba7718eb2501207ca6e99d22427f25a

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19249
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-28 22:47:48 +02:00
Anton Yu. Ivanusev
7aecbefb52 ramips: mt76x8: add support for Keenetic 4G (KN-1212)
Specification:
SoC: MediaTek MT7628NN
RAM: 128 MB, EtronTech EM68C16CWQG-25H (DDR2)
Flash: 32MB, Winbond 25Q256JVFQ (Dual Boot, SPI)
Switch: MediaTek MT7628AN, 4 ports 100 Mbps
WiFi: MediaTek MT7603 2T2R/2.4GHz 802.11n
GPIO: 3 buttons (Wi-Fi, Reset, FN), 3 LEDs (Power, Internet, Wi-Fi), 1 port USB 2.0

Disassembly:
At the bottom, under the LEDs, there are 2 screws hidden by rubber feet. After removing the screws, pry the gray plastic part around (it is secured with latches) and remove it.

Serial Interface:
The serial interface can be connected to the 5 pin dots located on the right between the operating mode switch and the antenna.
Pins (from antenna to operating mode switch):
VCC
TX
RX
NC
GND
Settings: 115200, 8N1

Flashing via OEM recovery software:
1. Download the OEM recovery software from the manufacturer's website
2. Download the firmware image (for OpenWRT it is *-squashfs-factory.bin), rename it to KN-1212_recovery.bin
3. Replace the file in the fw folder OEM recovery software with the file from step 2.
4. Run the OEM recovery software and follow the instructions.

Flashing via TFTP:
1. Connect your PC and router to port 1-3, configure PC interface using IP 192.168.1.2, mask 255.255.255.252
2. Serve the firmware image (for OpenWRT it is *-squashfs-factory.bin) renamed to KN-1212_recovery.bin via TFTP
3. Power up the router while pressing Reset button on the back
4. Release Restart button when Power LED starts blinking

To revert back to OEM firmware:
The return to the OEM firmware is carried out by using the methods described above with the help of the appropriate firmware image.

When using OEM bootloader, the firmware image size cannot exceed the size of one OEM «Firmware_x» partition or Kernel + rootFS size.

Signed-off-by: Anton Yu. Ivanusev <ivanusevanton@yandex.ru>
Link: https://github.com/openwrt/openwrt/pull/19157
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-22 23:13:27 +02:00
Yijie Jin
c35f2a23c8 ramips: mt7621: add support for JDCloud RE-SP-01B
JDCloud RE-SP-01B is a dual-band WiFi 5 router based on the MT7621AT.

Specifications:
- SoC: MediaTek MT7621AT
- RAM: 512MB DDR3
- Flash: 32MB SPI NOR
- WiFi: MediaTek MT7603EN (2.4GHz), MediaTek MT7615N (5GHz)
- Ethernet: 1x WAN, 2x LAN (Gigabit Ethernet)
- LEDs: red, blue, green (GPIO controlled)
- Button: Reset (GPIO controlled)
- eMMC: Single onboard (32GB/64GB/128GB)
- USB: 1x USB 2.0 port

MAC Address Structure:
The MAC addresses share the structure DC:D8:7C:XX:XX:XX, where:
- WAN, LAN, and 2.4GHz WiFi: same as the label MAC address.
- 5GHz WiFi: label MAC address + 0x800000.

The manufacturer writes the label MAC address at different
offsets depending on the storage version of the device:

e.g.
128GB version:  &config + 0x442a
64GB version:   &config + 0x4429

So `get_mac_ascii()` is used here to search for the
base label MAC address of the device.

Ref:
https://github.com/openwrt/openwrt/pull/17409#discussion_r1899674262
https://github.com/immortalwrt/immortalwrt/commit/c0c480d

Flash Instruction:
A 3rd party bootloader is required to boot the image. You can
use a SOP16 test clip to burn the image/bootloader to the flash.

The official bootloader does provide a web recovery interface
which only accepts an official image. To access it, you will
need to hold the reset button and power on the device, set your
IP address to 192.168.68.2 and visit http://192.168.68.1.

Co-authored-by: Chukun Pan <amadeus@jmu.edu.cn>
Signed-off-by: Yijie Jin <jinyijie@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/17409
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-19 20:33:57 +02:00
Shiji Yang
9b777547be ramips: PCIe driver improvements for mt7620 and mt7628
This patchset fixes some PCIe bridge register access issues and
reworks the initialization procedure. It may bring some stability
improvements. To match the driver changes, the memory remap range
was extended and a PCIe reset pinctrl was added to mt7628an.dtsi.

Link: https://lore.kernel.org/all/OSBPR01MB1670555F549B69B9A5E7F133BC72A@OSBPR01MB1670.jpnprd01.prod.outlook.com/
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/18299
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-18 20:35:23 +02:00
Shiji Yang
143cfd6113 ramips: dts: increase maximum MMC clock frequency
The High-Speed SD mode stability issue should have been fixed.
Increase the MMC max-frequency to improve the IO speed. We can
still use the sysfs to limit the clock frequency, e.g.

root@OpenWrt:~# echo 25000000 > /sys/kernel/debug/mmc0/clock

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-16 19:31:51 +02:00
Shiji Yang
3f78e5c918 ramips: mtk-sd: stability improvements for MIPS mt762x SoCs
* Add tuning parameters to improve the stability of 48~50 MHz
  High-Speed SD mode.

* Fix I/O errors on EMMC mode by disabling unsupported auto CMD23
  feature.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-16 19:31:51 +02:00
Shiji Yang
db76fe6a02 ramips: mtk-sd: backport Host Software Queue support
This new feature has some improvements for random RW performance.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-16 19:31:51 +02:00
Shiji Yang
e69c867cdf ramips: mtk-mmc: fix data timeout value
The MT7628 programing guide shows that the correct DTOC unit is
1048576 clocks instead of 65536 clocks. This value is also used
by linux upstream mtk-sd driver. Correct the DTOC register and
also round up its value.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-16 19:31:51 +02:00
Anton Yu. Ivanusev
ca866328d5 ramips: mt76x8: add support for Keenetic Start (KN-1112)
Specification:
SoC: MediaTek MT7628NN
RAM: 128 MB, EtronTech EM68C16CWQG-25H (DDR2)
Flash: 32MB, Winbond 25Q256JVFQ (Dual Boot, SPI)
Switch: MediaTek MT7628AN, 4 ports 100 Mbps
WiFi: MediaTek MT7603 2T2R/2.4GHz 802.11n
GPIO: 2 buttons (Wi-Fi, Reset), 3 LEDs (Power, Internet, Wi-Fi), 1 mode switch

Disassembly:
At the bottom, under the LEDs, there are 2 screws hidden by rubber feet. After removing the screws, pry the gray plastic part around (it is secured with latches) and remove it.

Serial Interface:
The serial interface can be connected to the 5 pin dots located on the right between the operating mode switch and the antenna.
Pins (from antenna to operating mode switch):
VCC
TX
RX
NC
GND
Settings: 115200, 8N1

Flashing via OEM recovery software:
1. Download the OEM recovery software from the manufacturer's website
2. Download the firmware image (for OpenWRT it is *-squashfs-factory.bin), rename it to KN-1112_recovery.bin
3. Replace the file in the fw folder OEM recovery software with the file from step 2.
4. Run the OEM recovery software and follow the instructions.

Flashing via TFTP:
1. Connect your PC and router to port 1-3, configure PC interface using IP 192.168.1.2, mask 255.255.255.252
2. Serve the firmware image (for OpenWRT it is *-squashfs-factory.bin) renamed to KN-1112_recovery.bin via TFTP
3. Power up the router while pressing Reset button on the back
4. Release Restart button when Power LED starts blinking

To revert back to OEM firmware:
The return to the OEM firmware is carried out by using the methods described above with the help of the appropriate firmware image.

When using OEM bootloader, the firmware image size cannot exceed the size of one OEM «Firmware_x» partition or Kernel + rootFS size.

Signed-off-by: Anton Yu. Ivanusev <ivanusevanton@yandex.ru>
Link: https://github.com/openwrt/openwrt/pull/19091
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-16 19:01:18 +02:00
Mateusz Jończyk
b7fa9d92ae ramips/mt7621: mark EEE as broken in devicetree
Multiple users have reported a regression [1] in OpenWRT 24.10 with the
ramips/mt7621 target, which has the MT7530 PHYs: the Ethernet link is
periodically going down for a brief period of time:

        mt7530-mdio mdio-bus:1f lan1: Link is Down
        br-lan: port 1(lan1) entered disabled state
        mt7530-mdio mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx

The symptoms stop after disabling EEE and it was reported by Mediatek in
2021 that EEE is unstable for the MT7530 PHYs [2]:

> EEE of the 10-year-old MT7530 internal gephy has many IOT problems, so
> it is recommended to disable its EEE.

EEE is enabled by default for these devices in OpenWRT 24.10 whereas in the
previous version (OpenWRT 23.05, Linux 5.15) it was not. It was determined
that in Linux 6.6, the PHY driver tries to disable EEE in
mtk_gephy_config_init() in drivers/net/phy/mediatek-ge.c, but this is later
overridden by a subsequent execution of the genphy_c45_write_eee_adv()
function, which enables every EEE mode supported.

The best way forward for now seems to be to mark EEE as broken directly in
the devicetree, which affects the genphy_c45_write_eee_adv() function.

There are some devices, like GnuBee GB-PC2, that define additional PHYs,
for example ethernet-phy@5 or ethernet-phy@7. As reported by Chester A.
Unal, these are not MT7530 PHYs and they are not affected.

This would need to be cherrypicked for the OpenWRT 24.10 branch.

[1] https://github.com/openwrt/openwrt/issues/17351

[2] https://lore.kernel.org/all/0adde34f936a2dafca40b06b408d82afe0852327.camel@mediatek.com/

Tested-by: Darren Tucker
Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Closes: https://github.com/openwrt/openwrt/issues/17351
Link: https://github.com/openwrt/openwrt/pull/18585
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 15:38:25 +02:00
Shiji Yang
09c2ceb7a5 ramips: a workaround for system halt issue on 6.12 kernel
Fix potential invalid memory address access on ip_fast_csum().

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:16:21 +02:00
Mieczyslaw Nalewaj
4f62facf10 mips: ralink: add missing include
Missing headers causes an error on kernel 6.12:
arch/mips/ralink/irq.c:86:5: error: no previous prototype for 'get_c0_perfcount_int' [-Werror=missing-prototypes]
   86 | int get_c0_perfcount_int(void)
      |     ^~~~~~~~~~~~~~~~~~~~
arch/mips/ralink/irq.c:92:14: error: no previous prototype for 'get_c0_compare_int' [-Werror=missing-prototypes]
   92 | unsigned int get_c0_compare_int(void)
      |              ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:16:21 +02:00
Mieczyslaw Nalewaj
92fec1ff24 mtk-mmc: replace empty body macros
Replace macros with empty body with 'do {} while (0)'.
Remove unnecessary semicolons.

Fixes:
drivers/mmc/host/mtk-mmc/sd.c: In function 'msdc_irq':
drivers/mmc/host/mtk-mmc/sd.c:1969:87: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
 1969 |                                 IRQ_MSG("XXX CMD<%d> MSDC_INT_RSPCRCERR", cmd->opcode);
      |                                                                                       ^
drivers/mmc/host/mtk-mmc/sd.c:1975:84: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
 1975 |                                 IRQ_MSG("XXX CMD<%d> MSDC_INT_CMDTMO", cmd->opcode);
      |                                                                                    ^
cc1: all warnings being treated as errors

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:16:21 +02:00
Mieczyslaw Nalewaj
fa90484c6a ramips: enable 6.12 testing kernel
The ramips now supports 6.12 kernel as testing.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:16:21 +02:00
Mieczyslaw Nalewaj
e09d6ce9f3 kernel/ramips: update config for kernel 6.12
Update target ramips config for kernel 6.12.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
[Remove some more option already in generic config]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:15:57 +02:00
Mieczyslaw Nalewaj
02c991a141 ramips: pci-rt2880: 6.12: change pcibios_init declaration
Fixes error:
arch/mips/pci/pci-rt2880.c:267:12: error: no previous prototype for 'pcibios_init' [-Werror=missing-prototypes]
  267 | int __init pcibios_init(void)
      |            ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[8]: *** [scripts/Makefile.build:229: arch/mips/pci/pci-rt2880.o] Error 1
make[7]: *** [scripts/Makefile.build:478: arch/mips/pci] Error 2

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:12:26 +02:00
Mieczyslaw Nalewaj
d798bef016 ramips: 6.12: automatically rebuilding patches
Automatic rebasing of patches.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:12:26 +02:00
Mieczyslaw Nalewaj
65add58add ramips: 6.12: manually rebuilding patches
Manually rebuilding patches:
 - 001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch
 - 311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch
 - 314-MIPS-add-bootargs-override-property.patch
 - 405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch
 - 810-uvc-add-iPassion-iP2970-support.patch
 - 821-SPI-ralink-add-Ralink-SoC-spi-driver.patch
 - 825-i2c-MIPS-adds-ralink-I2C-driver.patch
 - 845-pwm-add-mediatek-support.patch
 - 860-ramips-add-eip93-driver.patch

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:12:26 +02:00
Mieczyslaw Nalewaj
5f34c308bc ramips: 6.12: remove obsolete patches
Remove obsolete patches already included in kernel 6.12.

Removed (already included):
 - 805-01-v6.9-pinctrl-Add-driver-for-Awinic-AW9523-B-I2C-GPIO-Expa.patch
 - 805-02-v6.9-pinctrl-aw9523-Add-proper-terminator.patch
 - 805-03-v6.10-pinctrl-aw9523-Destroy-mutex-on-remove.patch
 - 805-04-v6.10-pinctrl-aw9523-Use-correct-error-code-for-not-suppor.patch
 - 805-05-v6.10-pinctrl-aw9523-Always-try-both-ports-in-aw9523_gpio_.patch
 - 805-06-v6.10-pinctrl-aw9523-Make-use-of-struct-pinfunction-and-PI.patch
 - 805-07-v6.10-pinctrl-aw9523-Use-temporary-variable-for-HW-IRQ-num.patch
 - 805-08-v6.10-pinctrl-aw9523-Get-rid-of-redundant-U8_MAX-pieces.patch
 - 805-09-v6.10-pinctrl-aw9523-Remove-unused-irqchip-field-in-struct.patch
 - 805-10-v6.10-pinctrl-aw9523-Make-use-of-dev_err_probe.patch
 - 805-11-v6.10-pinctrl-aw9523-Sort-headers-and-group-pinctrl.patch
 - 805-12-v6.10-pinctrl-aw9523-Fix-indentation-in-a-few-places.patch

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:12:26 +02:00
Mieczyslaw Nalewaj
e0f7afef1a kernel/ramips: Restore kernel files for v6.6
This is an automatically generated commit which aids following Kernel patch
history, as git will see the move and copy as a rename thus defeating the
purpose.

For the original discussion see:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:12:25 +02:00
Mieczyslaw Nalewaj
2b4223c0db kernel/ramips: Create kernel files for v6.12 (from v6.6)
This is an automatically generated commit.

When doing `git bisect`, consider `git bisect --skip`.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18654
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-11 14:12:25 +02:00
Mario Andrés Pérez
6dffaf9316 ramips: mt7621: include uboot-envtools in some missed devices
Add uboot-envtools (removing -uboot-envtools) to devices which were
missed in the commit 79bd017 ("ramips: mt7621: add uboot-envtools to
all devices")

- Mi Router 3G
- Mi Router AC2100

While at here remove two redundant entries from devices which were added
just after the referenced commit 79bd017 and did not account for the
new DEFAULT_PACKAGES member:

- SNR-CPE-ME1
- SNR-CPE-ME2-SFP

Fixes: 79bd017 ("ramips: mt7621: add uboot-envtools to all devices")
Fixes: https://github.com/openwrt/openwrt/issues/18960

Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19012
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-08 20:42:19 +02:00
Shiji Yang
dd0476aca0 ramips: some minor FDT improvements for HiWiFi devices
This patch contains various minor FDT improvements for ramips
HiWiFi series devices:

* Add mt76 driver compatibles.
* Remove useless platform compatibles.
* Add default USB LED trigger for HC5861.
* Disable unused usbphy for HC5661, HC5661A and HC581B.
* Add switch port map properties based on 02_network scripts.
* Move aliases node to device dts because the LED nodes it
  references only exist in the device specific dts.
* Rename gpio-leds nodes to follow the upstream dt-bindings
  suggested pattern "(^led-[0-9a-f]$|led)".
* Convert deprecated LED label property to color and function.
  "system" LED has been renamed to "status", it is acceptable
  because these LEDs do not have text labels.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18251
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-08 19:37:49 +02:00
Shiji Yang
9e08350b10 ramips: convert HiWiFi devices MAC address to NVMEM format
For all HiWiFi series devices, the base MAC address is stored on
"bdinfo" partition, offset 0x18a, ASCII text format. The recently
introduced "mac-base" nvmem layout can handle the ASCII text now,
so it's time to move MAC address configurations to dts. There is
no valid MAC info in the "factory" partition, hence they will be
replaced with the correct ones.

Tested on HiWiFi HC5661A and HC5861.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18251
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-08 19:37:49 +02:00
Simonas Tamošaitis
7264a913a3 ramips: mt76x8: add Teltonika RUT951/RUT901 support
Specification:
- MediaTek MT7628AN SoC
- 128 MB of RAM EtronTech EM68C16CWQG-25IH
- 16MB of Flash Winbond W25Q128 SPI
- 4x 10/100 Mbps Ethernet, with passive PoE support on LAN1
- MediaTek MT7628AN 2.4 GHz 802.11n WiFi
- Quectel EC25-EUX 4G cat 4 modem (RUT951) or Quectel EC200A-EU 4G cat 4 modem (RUT901)
- 1x Digital input
- 1x Digital output
- 2x SIM slot (can be swapped via GPIO)
- eSIM (depends on hardware configuration, can be swapped via GPIO)

GPIO:
 - 1 button (Reset)
 - 7 LEDs (power, status green/red, RSSI 1,2,3,4,5)
 - 5 Modem control (power button, reset, status, SIM select, eSIM select)
 - 1 Digital input
 - 1 Digital output

Flashing via OEM WebUI:
1. Download the firmware image *-squashfs-factory.bin
2. Upload firmware image via OEM WebUI firmware update, do not keep settings

To revert back to OEM firmware:
https://wiki.teltonika-networks.com/view/Bootloader_menu

Mobile data connection:
Quectel EC200A-EU send command to modem:
    echo -ne 'AT+QNETDEVCTL=3,1\r\n' > /dev/ttyUSB2
    Create DHCP interface with usb0 device.
Quectel EC25-EUX create proto qmi interface.

Signed-off-by: Simonas Tamošaitis <simsasss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18788
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-08 17:10:03 +02:00
Simonas Tamošaitis
85e300c93d ramips: mt76x8: add Teltonika RUT956/RUT906 support
Specification:
- MediaTek MT7628AN SoC
- 128 MB of RAM EtronTech EM68C16CWQG-25IH
- 16MB of Flash Winbond W25Q128 SPI
- 4x 10/100 Mbps Ethernet, with passive PoE support on LAN1
- MediaTek MT7628AN 2.4 GHz 802.11n WiFi
- Quectel EC25-EUX (RUT956) or Meig SLM770A (RUT906) modem
- GNSS
- RS232, DB9 connector, Cypress ACM via USB, /dev/ttyACM0
- RS485 /dev/ttyS1
- microSD card slot
- 2.0 USB Type-A HOST port
- analog 0-24V input (MCP3221)
- Relay
- 2x Digital input
- 2x Digital output
- 2x SIM slot (can be swapped via GPIO)
- eSIM (depends on hardware configuration, can be swapped via GPIO)

GPIO:
 - 1 button (Reset)
 - 7 LEDs (power, status green/red, RSSI 1,2,3,4,5)
 - 5 Modem control (power button, reset, status (v5 hw), SIM select, eSIM select)
 - 2 Digital input
 - 2 Digital output
 - 1 Isolated input
 - 1 RS485 tx enable
 - 1 RS485 rx enable
 - 1 Relay
 - 1 Data Carrier Detect (DCD)

Flashing via OEM WebUI:
1. Download the firmware image *-squashfs-factory.bin
2. Upload firmware image via OEM WebUI firmware update, do not keep settings

To revert back to OEM firmware:
https://wiki.teltonika-networks.com/view/Bootloader_menu

Mobile data connection:
Meig SLM770 create proto DHCP interface with usb0 device.
Quectel EC25-EUX create proto qmi interface.

Signed-off-by: Simonas Tamošaitis <simsasss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18788
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-08 17:10:02 +02:00
Sander van Deijck
b6a07dd091 ramips: mt7621: add support for Arcadyan WE410443
The Arcadyan WE410443 is a WiFi AC access point distributed by various ISPs
under various names, including KPN SuperWifi and BT Whole Home Wi-Fi. It
features one ethernet port, dual MT7615N radios and four internal antennas.

Hardware:
- SoC: Mediatek MT7621AT
- Flash: 32 MB
- RAM: 128 MB
- Ethernet: 1x 10/100/1000 Mbps, built into the SoC
- WLAN: 2x MediaTek MT7615N
- Buttons: 1 Reset button, 1 WPS button
- LEDs: 1x Green, 1x Blue, 1x Red, all unmarked
- Power: 12 VDC, 1.5A barrel plug

Installation:
The bootloader is locked with a password, so the image needs to be written
directly to the SPI flash chip. To do this, you need to open up the case,
remove the heatsink and connect the flash chip to a Raspberry Pi. Use the
following connections:

Flash chip --> Raspberry Pi

VCC --> 3v3
RESET --> 3v3
/CS --> GPIO 8
DO --> GPIO 9
CLK --> GPIO 11
DI --> GPIO 10
GND --> Ground

You can solder wires to the flash chip, or use a SOIC16 clip. More details on
the Raspberry Pi and SPI chip pinouts are available on the wiki [1]
When you have the Raspberry Pi connected to the flash chip, boot your Pi and
follow the instructions:

1) Make sure your Pi has SPI enabled with sudo raspi-config

2) Install necessary tools: sudo apt install xxd libubootenv-tool mtd-utils

3) Upload overlay and execute:
sudo dtc -@ -I dts -O dtb -o
/boot/overlays/we410443.dtbo we410443-overlay.dts

4) Enable in /boot/firmware/config.txt by adding a new line containing
dtoverlay=we410443

5) Reboot your Pi and verify the mtd partitions with
cat /proc/mtd, you should see:

dev:    size   erasesize  name
mtd0: 02000000 00001000 "all"
mtd1: 00030000 00001000 "u-boot"
mtd2: 00010000 00001000 "u-boot-env"
mtd3: 00010000 00001000 "factory"
mtd4: 01f60000 00001000 "firmware"
mtd5: 00010000 00001000 "glbcfg"
mtd6: 00010000 00001000 "config"
mtd7: 00010000 00001000 "glbcfg2"
mtd8: 00010000 00001000 "config2"

6) Optionally (but recommended), make a backup:
sudo dd if=/dev/mtd0 of=backup.bin
It can be restored with: sudo flashcp backup.bin /dev/mtd0

7) Set the variables for the bootloader:
echo '/dev/mtd2 0x0 0x1000 0x1000' > fw_env.config
sudo fw_setenv -c fw_env.config bootpartition 0

8) Finally, flash the image:
sudo flashcp openwrt-ramips-mt7621-arcadyan_we410443-
squashfs-sysupgrade.bin /dev/mtd4

MAC addresses
The label address is stored in ASCII in the config partition

Use --> Address

Device --> label
Ethernet --> label
WLAN 2g --> + 1
WLAN 5g --> + 2

References:
[1] https://openwrt.org/toh/arcadyan/astoria/we410443

Signed-off-by: Sander van Deijck <sander@vandeijck.com>
Link: https://github.com/openwrt/openwrt/pull/17981
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-07 21:04:53 +02:00
Shiji Yang
afdf88b9a1 ramips: dts: adjust the power regulators of MMC controller
- Fix MMC bus IO voltage. The GPIO voltage of mt762x series SoCs
  is fixed 3.3V. There are no visible registers that can control
  the voltage level. Also add "no-1-8-v" property to indicate that
  MMC controller doesn't support 1.8V IO.

- Drop useless property "enable-active-high". These dummy fixed
  voltage regulators are not controlled by the GPIO. We don't need
  to set the GPIO polarity.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18886
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-07 20:28:11 +02:00
Shiji Yang
a617ab6639 ramips: dts: mt7621: reuse the default USB dummy regulators
To simplify the device specific dts, reuse the mt7621 default
XHCI voltage regulators by adding the corresponding GPIO pin
and polarity properties.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18886
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-07 20:28:11 +02:00
Shiji Yang
548d993a04 ramips: dts: mt7621: remove redundant USB regulators
We have added the default voltage regulators for the mt7621 SoC
dtsi. These redundant voltage regulators can be removed now.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18886
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-07 20:28:11 +02:00
Shiji Yang
51b77a3298 ramips: dts: mt7621: add the missing XHCI power regulators
The USB power regulators are essential for the Mediatek XHCI
controller. If any of them is missing, the kernel will throw
a warning. Add fixed voltage io/vbus regulators to workaround
this issue. Fix the following warnings:

[    7.514572] xhci-mtk 1e1c0000.xhci: supply vbus not found, using dummy regulator
[    7.522375] xhci-mtk 1e1c0000.xhci: supply vusb33 not found, using dummy regulator

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18886
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-07 20:28:11 +02:00
Zheng Zhang
1f7304a0cc ramips: mt7621: fix file permissions in source tree
They don't need +x permission.

Fixes: 502916468e ("ramips: add support for ASUS 4G-AX56")
Signed-off-by: Zheng Zhang <everything411@qq.com>
Link: https://github.com/openwrt/openwrt/pull/19034
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-06-06 09:38:43 +02:00
Rosen Penev
079db0ab81 ramips: mt7621: use regulators for USB GPIO
Regulators as implemented by the XHCI driver only accept one GPIO.
However, we can abuse the fact that the XHCI driver accepts two
regulators, one for 5V and the other for 3.3V, for USB 2 and 3 GPIOs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16967
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-03 11:04:50 +02:00
Robert Marko
200a31b6f5 ramips: mt7621: sercomm_na502s: use upstream XR USB serial driver
Instead of including the out-of-tree XR USB serial driver, use the
newly packaged in-tree driver for it.

Link: https://github.com/openwrt/openwrt/pull/18926
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-26 18:59:26 +02:00
Shiji Yang
e247b7ab66 ramips: fix wrg-header image recipe
Before generating the factory image, check if the input file
exists. Fix the build error when sysupgrade image is too big:

[mkwrgimg] *** error: stat failed on /builder/shared-workdir/build/build_dir/target-mipsel_24kc_musl/linux-ramips_rt288x/tmp/openwrt-ramips-rt288x-airlink101_ar670w-squashfs-factory.bin, No such file or directory

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18836
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-22 18:49:31 +02:00
INAGAKI Hiroshi
d95e8a59bb ramips: mt7621: fix broken hexdump expression in iodata.sh
Use the "1/1" as a iteration count of hexdump expression instead of the
broken "1", to fix the issue that the invalid bootnum will be obtained.

Currently, the hexdump command always outputs "0" when the decimal format
and the iteration count "1" are specified[0]. This is unexpected
behaviour, but the cause is unknown and use this fix as a workaround.

[0]: https://github.com/openwrt/openwrt/issues/18808

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18827
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-20 13:04:06 +02:00
Mieczyslaw Nalewaj
a238170e57 treewide: strip trailing whitespace
Strip trailing whitespace in all code:
find . -type f | grep "\.c$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.h$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dts$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dtsi$" | xargs sed -i 's/[ \t]\+$//'

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18626
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-20 00:47:37 +02:00
Shiji Yang
7193539c98 treewide: dts: trim "#size-cells" from "gpio-export" node
The "gpio-export" driver doesn't require a "reg" property in the
device tree, hence we don't need to use the "#size-cells" property
to describe the size of "reg".

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18290
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-18 19:35:00 +02:00
David Bauer
eea4689654 ramips: pad EX400 kernel partition to retain web recovery
The web-recovery of the Genexis EX400 validates uploaded images to fit
in the rootf_0 partition.

With OpenWrt, only the kernel is stored in this partition, leaving the
partition very small. Currently, the first factory release image won't
be accepted by the recovery interface after the OpenWrt installation.

Pad the image of the ubifs to 10MB. This allows the 24.10 release image
to be uploaded, enabling device recovery.

Signed-off-by: David Bauer <mail@david-bauer.net>
2025-05-14 18:39:56 +02:00
David Bauer
d97c01a11f ramips: clean UBI tempdir before image creation
Clean the temporary directory the UBI image is generated from before
generation.

Currently it is removed after the image generation, which leads to files
possibly not being cleared after a build failure in this step.

Signed-off-by: David Bauer <mail@david-bauer.net>
2025-05-14 18:39:56 +02:00
INAGAKI Hiroshi
dcc440c7c9 ramips: mt7621: relocate kernel for ELECOM WRC-X1800GS
Relocate the kernel in the firmware images for WRC-X1800GS when booting,
to fix the LZMA error while extraction by U-Boot with the following
messages.

log (official initramfs image (ffde9a9fe9)):

```
=> bootm
   Using 'config-1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  MIPS OpenWrt Linux-6.6.89
     Type:         Kernel Image
     Compression:  lzma compressed
     Data Start:   0x800100e4
     Data Size:    7365490 Bytes = 7 MiB
     Architecture: MIPS
     OS:           Linux
     Load Address: 0x80001000
     Entry Point:  0x80001000
     Hash algo:    crc32
     Hash value:   f27303e3
     Hash algo:    sha1
     Hash value:   7715e6d2d27eeef34ea88ad7ae0c6f73b6748ba4
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Using 'config-1' configuration
   Trying 'fdt-1' fdt subimage
     Description:  MIPS OpenWrt elecom_wrc-x1800gs device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x8071659c
     Data Size:    13578 Bytes = 13.3 KiB
     Architecture: MIPS
     Hash algo:    crc32
     Hash value:   d37ef67f
     Hash algo:    sha1
     Hash value:   e66ac0a2e8024a276bf9b3712dffa2192d7a70dc
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x8071659c
   Uncompressing Kernel Image ... lzma compressed: uncompress error 1
Must RESET board to recover

===================================================================
                MT7621   stage1 code Dec 16 2019 17:45:55 (ASIC)
                CPU=500000000 HZ BUS=166666666 HZ
==================================================================
...

```

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18781
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-13 21:59:07 +02:00