Commit Graph

31224 Commits

Author SHA1 Message Date
Rouven Czerwinski
d67963943b ipq40xx: disable SPI DMA for Fritzbox 4040
We have seen hung devices and failures during SPI transactions on
Fritzbox devices with a gluon based freifunk network. We have narrowed
down that disabling DMA for spi fixes the problem, so disable dma for
the SPI controller on the Fritzbox 4040.

Signed-off-by: Rouven Czerwinski <rouven@czerwinskis.de>

Link: https://github.com/openwrt/openwrt/pull/15966
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-12 11:01:56 +01:00
David Bentham
794291bbdf mediatek: add Comfast CF-E395AX support by adding an alternative model name
both these devices share the board and same config, just different model number

Install instructions are the same as the CF-E393AX commit - https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=d8f4453bf2de9fd9baf3d660ed12e0797ff2cfdb

Signed-off-by: David Bentham <db260179@gmail.com>

Link: https://github.com/openwrt/openwrt/pull/16389
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-12 09:46:38 +01:00
Chukun Pan
8108967e27 qualcommax: use ath11k_patch_mac for MR7350
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Use ath11k_patch_mac and ath11k_set_macflag functions
instead of fix_wifi_mac script.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/17230
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-11 17:02:14 +01:00
Chukun Pan
d6be0a2039 qualcommax: ipq60xx: fixes base-files typo
* fix caldata file name
 * fix bootcount file permission

Fixes: 9c55866 ("qualcommax: ipq60xx: add Linksys MR7350 support")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/17230
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-11 17:02:14 +01:00
Isaac de Wolff
0d21cc8a92 lantiq: grow kernel partition Zyxel P-2812HNU-F1
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Change partition table in dts file.
Change DEVICE_COMPAT_VERSION
Enable automatic build.

To take advantage of the bigger kernel partition,
the uboot environment has to be changed:
setenv nboot 'nand read 0x81000000 0x60000 0x500000; bootm 0x81000000'
setenv bootcmd 'run nboot'
saveenv

Of course you need a u-boot capable of handling this.
The u-boot discussed in this forum thread:
https://forum.openwrt.org/t/zyxel-p2812hnu-f1-u-boot/100281
should be able to handle kernels up to an uncompressed size of 16MiB.

Signed-off-by: Isaac de Wolff <idewolff@gmx.com>
Link: https://github.com/openwrt/openwrt/pull/17209
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-10 21:18:06 +01:00
Hauke Mehrtens
f8b93e2d12 mediatek: filogic: Migrate wifi configuration device paths
The device path to the devices changed. Migrate the wifi
configurations from the old path to the new one. This is needed to
migrate Wireless configurations from OpenWrt 23.05 to OpenWrt 24.10.

This script is based on these two files:
target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate

Fixes: 0ef9274721 ("mediatek: filogic: move mt7981 on-SoC blocks to "soc" node in DT")
Fixes: https://github.com/openwrt/openwrt/issues/17174
Link: https://github.com/openwrt/openwrt/pull/17210
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-10 00:02:27 +01:00
Ondřej Niesner
a498a84393 mediatek: filogic: prevent faulty mac address assignment
The vendor U-Boot on the Cudy WR3000 assign random mac addresses on boot
and set the 'local-mac-address' property which prevents Openwrt from
assigning the correct address from evmem.

This patch removes the alias for ethernet0 so that U-Boot doesn't add
the property.

Related to: a55ab9e134 ("mediatek: filogic: prevent faulty mac address assignment")
Fixes: https://github.com/openwrt/openwrt/issues/15587
Signed-off-by: Ondřej Niesner <ondra.niesner@seznam.cz>
Link: https://github.com/openwrt/openwrt/pull/17201
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-09 23:57:12 +01:00
Rosen Penev
477c8a5101 ath79: gl-e750: use nvmem for mac addresses
This is a simple conversion to dts.

68ac3f2cdd states that the 5ghz wifi address is calculated from ART 0
+ 2.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17066
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-08 23:36:24 +01:00
Maxim Anisimov
d087a79b7b mediatek/filogic: add Keenetic KN-3811 support
Specification:
 * Mediatek MT7981BA
 * 256 MB SPI-NAND
 * 512 MB DDR4 RAM
 * MT7976CN DBDC AX Wi-Fi
 * MediaTek MT7531AE (3x LAN Gigabit ports) + Internal Gbe Phy (1x WAN Gigabit port)
 * 4x LED (power, internet, fn, wifi)
 * 3x buttons (wps, fn, reset)
 * 1x USB 3.0 port

Serial Interface:
 * 3 Pins GND, RX, TX
 * Settings: 115200, 8N1

Notes:
 * The device supports dual boot mode
 * Fn led reassigned to wlan 2.4

Flash instruction:
The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24 and tftp server.
2. Rename "openwrt-mediatek-filogic-keenetic_kn-3811-squashfs-factory.bin"
   to "KN-3811_recovery.bin" and place it in tftp server directory.
3. Connect PC with ethernet port, press the reset button, power up
   the device and keep button pressed until status led start blinking.
4. Device will download file from server, write it to flash and reboot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17135
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-08 19:52:35 +01:00
Pavel Shirov
0826b224b5 kernel: packages: fix building package/devel/perf with -O3
Add patch to fix failure to build package/devel/perf when
CONFIG_TARGET_OPTIMIZATION has -O3 enabled with this error:

```
In function 'elf_close',
    inlined from 'elf_close' at elf.c:41:6,
    inlined from 'elf_find_func_offset_from_file' at elf.c:267:2:
elf.c:45:9: error: 'elf_fd.elf' may be used uninitialized [-Werror=maybe-uninitialized]
   45 |         elf_end(elf_fd->elf);
      |         ^~~~~~~~~~~~~~~~~~~~
elf.c: In function 'elf_find_func_offset_from_file':
elf.c:260:23: note: 'elf_fd.elf' was declared here
  260 |         struct elf_fd elf_fd;
      |                       ^~~~~~
In function 'elf_close',
    inlined from 'elf_close' at elf.c:41:6,
    inlined from 'elf_find_func_offset_from_file' at elf.c:267:2:
elf.c:46:9: error: 'elf_fd.fd' may be used uninitialized [-Werror=maybe-uninitialized]
   46 |         close(elf_fd->fd);
      |         ^~~~~~~~~~~~~~~~~
elf.c: In function 'elf_find_func_offset_from_file':
elf.c:260:23: note: 'elf_fd.fd' was declared here
  260 |         struct elf_fd elf_fd;
      |                       ^~~~~~
```

Link: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=fab45b962749
Signed-off-by: Pavel Shirov <nstorm.ahoy166@silomails.com>
Link: https://github.com/openwrt/openwrt/pull/17141
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-08 19:02:48 +01:00
Mieczyslaw Nalewaj
22d2aa65e8 kernel: fallback-sprom: create separate header files
Create a separate header files fallback-sprom.h
for BCMA and SSB Fallback SPROM Driver
to add function prototypes to fallback-sprom.c as well.
This prevents missing function prototype errors.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/17138
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-08 13:32:46 +01:00
Robert Marko
1b6f7ec679 qualcommax: ipq807x: add Netgear DEVICE_VARS
Add NETGEAR_BOARD_ID and NETGEAR_HW_ID to DEVICE_VARS as multiple devices
set them in their recipes, so without them being added to DEVICE_VARS then
simply the value from last recipe that gets evaluated is used and images
are generated with the wrong ID-s.

Link: https://github.com/openwrt/openwrt/pull/17203
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-08 09:58:38 +01:00
Vladyslav Andreichykov
9c55866fad qualcommax: ipq60xx: add Linksys MR7350 support
Linksys MR7350 is a 802.11ax Dual-band router/AP.
Specifications:
* CPU: Qualcomm IPQ6000 Quad core Cortex-A53(A73) 1.5GHz
* RAM: 512MB of DDR3
* Storage: 256Mb NAND
* Ethernet: 5x1G RJ45 ports (QCA8075)
* WLAN:
	* 2.4GHz: Qualcomm QCN5022 2x2 802.11b/g/n/ax 574 Mbps PHY rate
	* 5GHz: Qualcomm QCN5052 2x2@80MHz or  802.11a/b/g/n/ac/ax 1201 Mbps PHY rate
* LED-s:
	* RGB system led
	* USB blue led

* Buttons: 1x Soft reset 1x WPS
* Power: 12V DC Jack

Installation instructions:
Open Linksys Web UI - http://192.168.1.1/ca or http://10.65.1.1/ca depending on your setup.
Login with your admin password. The default password can be found on a sticker under the device.
To enter into the support mode, click on the “CA” link and the bottom of the page.
Open the “Connectivity” menu and upload the squash-factory image with the “Choose file” button.
Click start. Ignore all the prompts and warnings by click “yes” in all the popups.
The Wifi radios are turned off by default. To configure the router, you will need to connect your computer to the LAN port of the device.
Then you would need to write openwrt to the other partition for it to work
- First Check booted partition:
fw_printenv -n boot_part

- Change the partition:
fw_setenv boot_part 1
or
fw_setenv boot_part 2
depending on the current partition

- Then install Openwrt to the other partition if booted in slot 1:
mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7350-squashfs-factory.bin alt_kernel

- If in slot 2:
mtd -r -e kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7350-squashfs-factory.bin kernel

Co-Authored-by: Chukun Pan <amadeus@jmu.edu.cn>
Co-Authored-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Vladyslav Andreichykov <vladdrako007@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14807
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-07 16:00:58 +01:00
Robert Marko
2e4a0ebdde qualcommax: enable userspace regulator for ipq60xx as well
Userspace regulator consumer is rather usefull so enable it for ipq60xx
as well and remove from ipq807x only kernel config.

Link: https://github.com/openwrt/openwrt/pull/14807
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-07 16:00:58 +01:00
Robert Marko
3fbc740008 qualcommax: refresh config
Refresh the kernel config via kernel_menuconfig.

Link: https://github.com/openwrt/openwrt/pull/14807
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-07 16:00:58 +01:00
Bohdan Chubuk
1269a836ed
generic: mtd: spinand: add support for FORESEE F35SQA001G
Add support for FORESEE F35SQA001G SPI NAND.

Similar to F35SQA002G, but differs in capacity.
Datasheet:
  -  https://cdn.ozdisan.com/ETicaret_Dosya/704795_871495.pdf

Tested on Xiaomi AX3000T flashed with OpenWRT.

Signed-off-by: Bohdan Chubuk <chbgdn@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16915
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-12-06 14:38:53 +01:00
Bohdan Chubuk
5348e2e81a
generic: mtd: spinand: add support for FORESEE F35SQA002G
Add support for FORESEE F35SQA002G SPI NAND.
Datasheet:
  https://www.longsys.com/uploads/LM-00006FORESEEF35SQA002GDatasheet_1650183701.pdf

Refresh all affected patch with make target/linux/refresh.

Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Bohdan Chubuk <chbgdn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16915
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-12-06 14:38:53 +01:00
Chukun Pan
025dbeb70c qualcommax: ipq60xx: add Qihoo 360V6 support
Specifications:
  SoC:     Qualcomm IPQ6000 1.5GHz
  RAM:     NTCC256M16ER-EK 512MiB
  Flash:   W29N01HZSINA 128MiB
  ETH:     QCA8075 (3x LAN, 1x WAN)
  WLAN1:   2.4GHz 802.11b/g/n/ax 2x2
  WLAN2:   5GHz 802.11a/n/ac/ax 2x2
  Power:   DC 12V 1.5A
  Button:  Reset, Wps
  USB:     1x 2.0

Flash instructions:
  1. Download the initramfs image, rename it to
     initramfs.itb, host it with the tftp server.
  2. Interrupt U-Boot and run these commands:
     tftpboot initramfs.itb
     bootm
  3. After openwrt boots up, use scp or luci web
     to upload sysupgrade.bin to upgrade.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/15940
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-06 10:59:38 +01:00
Chukun Pan
7e18e27e2f qualcommax: image: cleanup whitespace
Replace whitespaces with tab.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/15940
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-06 10:59:38 +01:00
Rosen Penev
9ab03a1e3e ipq40xx: remove default MAC assignments
1006 and 5006 are defaults that get set based on the calibration data.
There's no need to explicitly specify them.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17128
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-06 10:47:46 +01:00
Ivan Davydov
1c274227b0 ramips: mt76x8: add support for Keenetic KN-3211
Keenetic KN-3211 is a 2.4 Ghz band 11n (Wi-Fi 4) Wi-Fi repeater, based on MT7628AN.

Specification:
- System-On-Chip: MT7628AN
- CPU/Speed: 575 MHz
- Flash-Chip: Winbond w25q256
- Flash size: 32768 KiB
- RAM: 64 MiB
- 1x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- Wireless No1 (2T2R): SoC Built-in 2.4 GHz 802.11bgn
- 3x LED, 1x button, 1x mode switch

Notes:
- The device supports dual boot mode
- The firmware partitions were concatenated into one
- The status button has been reassigned as the WPS button.

Flash instruction:
This device doesn't support sysupgrade, so the only way to flash OpenWrt image
is to use tftp recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24 and tftp server.
2. Rename "openwrt-ramips-mt76x8-keenetic_kn-3211-squashfs-factory.bin"
   to "KN-3211_recovery.bin" and place it in tftp server directory.
3. Connect PC with the ethernet port, press the reset button, power up
   the router and keep button pressed until power led starts blinking.
4. Router will download file from server, write it to flash and reboot.

Signed-off-by: Ivan Davydov <lotigara@lotigara.ru>
Link: https://github.com/openwrt/openwrt/pull/17080
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-05 23:09:43 +01:00
John Crispin
5c12fe45b9 target/metadata: set OpenWrt One as the default menuconfig target/profile
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
John Crispin
f342255025 mediatek: filogic: enable CONFIG_LEDS_TRIGGER_PATTERN
The boot LED on OpenWrt One is PWM driven and sets the pattern trigger as the
default inside its devicetree.

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
Rosen Penev
86f489c02f ath79: remove wmac mac address defaults
1002 and 5006 are default addresses as part of the calibration data.
Don't bother specifying them explicitly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17082
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-30 18:55:17 +01:00
Andreas Böhler
dde510cf97 ath79: add support for KuWFi N650 CPE
The KuWFi N650 is a 5GHz outdoor wireless bridge based on QCA9563.

Specs
=====

CPU: QCA9563, 775MHz
RAM: 128MiB
Flash: 16MiB
Wireless: QCA9888 (5GHz only)
Ethernet: 2x GBit (via QCA8337), 48V passive PoE

Installation
============

From OEM firmware
-----------------

The OEM firmware has telnet enabled by default. If not, it can be enabled
from the firmware web interface. You need a TFTP server on your computer
and the OpenWrt factory image should be available as "n650factory.bin".
It is assumed that your computer has the IP 192.168.1.1 and the N650
192.168.1.20 (default IP address).

1. Connect via Telnet to the device and log in with the default credentials
   "admin:admin"
2. Exploit the limited interface by typing "ps & /bin/sh"
3. Press <ENTER> to start the shell
4. Enter the following commands:

$ cd /tmp
$ tftp -r n650factory.bin -g 192.168.1.1
$ cat << EOF > /tmp/openwrt.sh
#!/bin/sh

IMAGE_NAME="\$1"

if [ ! -e \${IMAGE_NAME} ]; then
  echo "Image file not found: \${IMAGE_NAME}"
  exit 1
fi

. /usr/sbin/common.sh

kill_remaining TERM
sleep 3
kill_remaining KILL

run_ramfs mtd write \${IMAGE_NAME} firmware
sleep 2
reboot -f
EOF

$ chmod +x /tmp/openwrt.sh
$ /tmp/openwrt.sh n650factory.bin

Once the device reboots, it should load OpenWrt.

From UART
---------

UART installation is possible since the serial header is already soldered
on. The pinout is GND - Tx - Rx - VCC from top to bottom (RJ45 ports are
at the bottom). Connect with 115200 8N1.

First, boot OpenWrt from TFTP. Enter the following commands in the U-Boot
shell, assuming your computer has the IP address 192.168.1.1 and a TFTP
server running where the initramfs image is provided as n650.bin:

  setenv ipaddr 192.168.1.20
  setenv serverip 192.168.1.1
  tftpboot 0x84000000 n650.bin
  bootm

Once booted, transfer -loader.bin and -sysupgrade.bin images to the device
at /tmp. Enter the following commands, replacing the filenames:

  mtd write /tmp/loader.bin loader
  sysupgrade /tmp/sysupgrade.bin

Reboot and OpenWrt should load from flash.

Back to Stock
-------------

Back to stock is only possible if you saved a partition backup before
installing OpenWrt. Assuming you have fullbackup.bin covering the whole
flash, you need to prepare the image as follows:

$ dd if=fullbackup.bin of=fwconcat0.bin bs=65536 skip=4 count=212
$ dd if=fullbackup.bin of=loader.bin bs=65536 skip=216 count=1
$ dd if=fullbackup.bin of=fwconcat1.bin bs=65536 skip=217 count=22
$ cat fwconcat0.bin fwconcat1.bin > firmware.bin

Transfer firmware.bin and loader.bin to the OpenWrt device. First, flash
loader.bin to mtd device loader, then force sysupgrade:

$ mtd write loader.bin loader
$ sysupgrade -F firmware.bin

The reason for the two-step process is the way the flash layout is designed
for OpenWrt in contrast to the OEM firmware partition.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
Link: https://github.com/openwrt/openwrt/pull/17089
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-30 18:52:41 +01:00
Mikhail Zhilkin
ee8df790ca mediatek: MERCUSYS MR90X v1: add OpenWrt U-Boot (UBI) layout
This commit adds OpenWrt U-Boot (UBI) layout support for MERCUSYS MR90X
v1.

Stock U-Boot UBI size:   50 MiB
OpenWrt U-boot UBI size: 126 MiB

Install
-------
1. Perform steps 1-14 of the OpenWrt installation guide (use OpenWrt
   initramfs-recovery.itb instead of initramfs-kernel.bin at the step 10,
   12 and 14).
Link: https://openwrt.org/toh/mercusys/mr90x_v1#installation

2. Make backups:
```
cat /dev/mtd0 > /tmp/boot.bin
cat /dev/mtd5 > /tmp/tp_data.bin
```
   Copy /tp_data dir content, /tmp/boot.bin and /tmp/tp_data.bin and to
   your PC using scp. You can also backup the remaining partititons. Copy
   backups to a safe place, they are required for the next steps and stock
   firmware recovery.

3. Reboot to OpenWrt initramfs:
```
reboot
```

4. Copy OpenWrt ubi-bl31-uboot.fip, ubi-preloader.bin,
   ubi-squashfs-sysupgrade.itb and MT7986_EEPROM.bin, default-mac (from
   /tp_data backup) to the /tmp folder of the router using scp.

5. Prepare UBI:
```
ubidetach -p /dev/mtd3; ubiformat /dev/mtd3 -y; ubiattach -p /dev/mtd3
ubimkvol /dev/ubi0 -N fip -t static -s 1MiB
ubiupdatevol /dev/ubi0_0 /tmp/ubi-bl31-uboot.fip
ubimkvol /dev/ubi0 -N ubootenv -s 0x1f000
ubimkvol /dev/ubi0 -N ubootenv2 -s 0x1f000
```

6.  Install kmod-mtd-rw and unlock partitions:
```
opkg update && opkg install kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd unlock boot
mtd unlock bl2
mtd unlock factory
```

7. Prepare "factory" partition:
```
dd if=/dev/zero bs=$((0x8000)) count=1 | tr '\000' '\377' > /tmp/factory.bin
dd if=/tmp/MT7986_EEPROM.bin of=/tmp/factory.bin conv=notrunc
dd if=/tmp/default-mac >> /tmp/factory.bin
```

8. Write "factory" partition:
```
mtd erase factory
mtd write /tmp/factory.bin factory
```

9. Write preloader partition:
```
mtd erase bl2
mtd write /tmp/ubi-preloader.bin bl2
```

10. Write OpenWrt sysupgrade image:
```
sysupgrade -n /tmp/ubi-squashfs-sysupgrade.itb
```

Recovery
--------
1. Place OpenWrt initramfs-recovery.itb image (with original name) on the
   tftp server (IP: 192.168.1.254).
2. Press "reset" button and power on the router. After ~10 sec release the
   button.
3. Use OpenWrt initramfs system for recovery.

BL2 and FIP recovery
--------------------
Use mtk_uartboot and UART connetion if BL2 or FIP in UBI is destroyed:
Link: https://github.com/981213/mtk_uartboot
Link: https://openwrt.org/toh/mercusys/mr90x_v1#serial

Return to stock:
----------------
1. Copy "boot" partition backup (boot.bin) to the /tmp dir of the router
   using scp.

2. Install kmod-mtd-rw:
```
opkg update && opkg install kmod-mtd-rw
```

3. Restore stock U-Boot:
```
   insmod mtd-rw i_want_a_brick=1
   mtd unlock boot
   mtd erase boot
   mtd write /tmp/boot.bin boot
```

4. Erase UBI and reboot:
```
mtd erase ubi
reboot
```

5. Open U-Boot web recovery, upload stock firmware image and start
   upgrade.
Link: http://192.168.1.1

6. Complete steps 1-9 of the OpenWrt installation guide to get root
   rights.
Link: https://openwrt.org/toh/mercusys/mr90x_v1#installation

7. Upload "tp_data" partition backup (tp_data.bin) to the /tmp folder of
   the router using scp.

8. Restore stock calibrations:
```
mtd write /tmp/tp_data.bin tp_data
reboot
```

9. Perform "factory restore" via stock firmware web interface.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16744
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-30 18:36:05 +01:00
Christoph Krapp
22899e77a9 ath79: Unify Sophos AP15/AP15C dts files
The recently added AP15C dts file only differs by the definition of the
reset button. Unify the shared definition into a dtsi to reduce code
duplication.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://github.com/openwrt/openwrt/pull/16998
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-30 18:19:52 +01:00
INAGAKI Hiroshi
af611bce44 Revert "ath79: elecom,wab: use nvmem"
This reverts commit 70e41d0205.

"ethaddr" is stored into the "u-boot-env" (stock: "Config") partition
and it's quoted with double-quotations, but that format is not supported
by the current NVMEM u-boot-env driver (and mac_pton() function) and the
MAC address won't be parsed to byte array.
This causes random MAC addresses on the adapters, so revert the above
commit.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17116
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-29 15:02:48 +01:00
Maxim Anisimov
5a4eb56a7b mediatek/filogic: add Keenetic KN-3911 support
Specification:
 - MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX)
 - 512MB RAM
 - 128MB SPI NAND
 - 2 LEDs (green, orange)
 - 3 buttons (fn, reset, wps)
 - 2 2.5Gbit ethernet ports based on Airoha EN8811H phy

Serial Interface:
 - 3 Pins GND, RX, TX
 - Settings: 115200, 8N1

Notes:
 - The device supports dual boot mode

Flash instruction:
The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24 and tftp server.
2. Rename "openwrt-mediatek-filogic-keenetic_kn-3911-squashfs-factory.bin"
   to "KN-3911_recovery.bin" and place it in tftp server directory.
3. Connect PC with ethernet port, press the reset button, power up
   the device and keep button pressed until status led start blinking.
4. Device will download file from server, write it to flash and reboot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16830
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-28 22:33:21 +01:00
Maxim Anisimov
0d651dd302 mediatek/filogic: enable mtd virtual concat support
This is required for upcoming Keenetic KN-3911 support

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16830
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-28 22:33:21 +01:00
Maxim Anisimov
79db5d65ca ramips: move zyimage creation to include/image-commands.mk
This is required for upcoming Keenetic KN-3911 support

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16830
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-28 22:33:21 +01:00
Petr Štetiar
30ae0b3f1e
mediatek: filogic: Cudy WR3000S v1: fix CRLF line endings
DTS file for this device seems to be using CRLF line endings, so lets
convert them into Unix-style LF.

Fixes: faf4b3e0f7 ("mediatek: filogic: add support for Cudy WR3000S v1")
Link: https://github.com/openwrt/openwrt/pull/17096
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 21:19:47 +00:00
George Oldfort
e44180d45c mediatek: filogic: add KTD2026/7 driver to Acer Connect Vero W6m
This commit adds kmod-leds-ktd202x to the OpenWrt image for the device
"Acer Connect Vero W6m" which is equipped with one KTD2026 controlling the
device's status LED via I2C.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16860
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-28 21:59:58 +01:00
George Oldfort
56d97fff55 generic: backport support for KTD2026/7 rgb(w) led controller
This commit adds the Linux kernel mainline driver "leds-ktd202x" for the
KinetIC KTD2026 and KTD2027 RGB/RBGW controller with I2C interface that was
introduced in kernel version 6.7, last changed in mainline on 2024-05-31.

At least the Acer Connect Vero W6m (a variant of the Acer Predator Connect
W6 without 2.5G eth1 port, usb3 port, and the 6 on-board gpio RGB LEDs) is
equipped with a KTD2026 (and a single RGB LED attached to it used by the
stock firmware as status LED), and maybe other router devices also are.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16860
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-28 21:59:58 +01:00
George Oldfort
1bdb6d8404 mediatek: remove ktd-202x driver filogic image (Aer Vero W6m)
Image build fails with PR #16861 merged while PR #16860 not merged.

Removing kmod-leds-ktd202x from filogic.mk will fix the build process.

Fixes: 2898d1d126 ("mediatek: add support for Acer Predator W6d and Acer Vero W6m")
Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/17087
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-26 10:43:16 +01:00
Robert Marko
5695267847 ramips: mt7621: support openwrt,netdev-name for renaming interfaces
Edgerouter X currently has its eth1 port on the switch missing since there
is a naming conflict currently.

So, as the root cause is mixing kernel support for DSA interfaces having
predictable names set via "label" property vs others having it assigned
dynamically lets avoid the conflict by using our own custom property as
suggested upstream [1].

So, add support via "openwrt,netdev-name" property and use it on ERX.

Fixes: 2a25c6ace8 ("ramips: get rid of downstream network device label patch")
Fixes: #15643
Link: https://github.com/openwrt/openwrt/pull/17062
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-25 16:41:30 +01:00
Robert Marko
1f53b7fb75 qualcommax: ipq60xx: remove source-only flag
Its been a while since we added ipq60xx as source-only, it is now
quite usable so lets remove the source-only flag to start building
official images.

I also plan to merge additional popular boards rather soon.

Link: https://github.com/openwrt/openwrt/pull/17065
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-25 10:26:33 +01:00
John Audia
eed39d45c2 kernel: enable pressure interface
PSI provides a canonical way to see resource pressure increases as
they develop, with pressure metrics for three major resources:
memory, CPU, and IO. PSI stats are like barometers that provide
fair warning of impending resource shortages, enabling users to
take more proactive, granular, and nuanced steps when resources
start becoming scarce.

References:
* https://www.kernel.org/doc/html/latest/accounting/psi.html
* https://lwn.net/Articles/759781/

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000
Run-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/13819
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-25 00:15:41 +01:00
Mikhail Zhilkin
d413163832 mediatek: Routerich AX3000: add OpenWrt U-Boot layout
This commit adds OpenWrt U-Boot layout support for Routerich AX3000. The
aims:
1. Get open-source U-Boot;
2. Get maximum available free space in OpenWrt.

Install
-------
1. Copy OpenWrt ubootmod-bl31-uboot.fip, ubootmod-preloader.bin, to the
   /tmp folder of the router using scp.

2. Make mtd partitions backups:
   http://192.168.1.1/cgi-bin/luci/admin/system/flash -> Save mtdblock
   contents

3. Install kmod-mtd-rw:
```
opkg update && opkg install kmod-mtd-rw
```

4. Write FIP and preloader:
```
insmod mtd-rw i_want_a_brick=1
mtd unlock BL2
mtd erase BL2
mtd write /tmp/ubootmod-preloader.bin BL2
mtd unlock FIP
mtd erase FIP
mtd write /tmp/ubootmod-bl31-uboot.fip FIP
```

5. Copy OpenWrt ubootmod-initramfs-recovery.itb to the tftp server root
   with IP 192.168.1.254.

6. Reboot router:
```
reboot
```
U-Boot will automatically download from the tftp server and boot OpenWrt
initramfs system.

7. Copy OpenWrt ubootmod-squashfs-sysupgrade.itb to the /tmp dir of the
   router using scp.

8. Run sysupgrade:
```
sysupgrade -n /tmp/squashfs-sysupgrade.itb
```

Recovery
--------
1. Place OpenWrt initramfs-recovery.itb image (with original name) on the
   tftp server (IP: 192.168.1.254).
2. Press "reset" button and power on the router. After ~10 sec release the
   button.
3. Use OpenWrt initramfs system for recovery.

BL2 and FIP recovery
--------------------
Use mtk_uartboot and UART connection if BL2 or FIP in UBI is destroyed:
Link: https://github.com/981213/mtk_uartboot

Return to stock:
----------------
1. Copy partition backups (BL2.bin and FIP.bin) to the /tmp dir of the
   router using scp.

2. Install kmod-mtd-rw:
```
opkg update && opkg install kmod-mtd-rw
```

3. Restore stock U-Boot and reboot:
```
insmod mtd-rw i_want_a_brick=1
mtd unlock BL2
mtd erase BL2
mtd write /tmp/BL2.bin BL2
mtd unlock FIP
mtd erase FIP
mtd write /tmp/FIP.bin FIP
reboot
```

4. Open U-Boot web recovery, upload stock firmware image and start
   upgrade.
Link: http://192.168.1.1

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16791
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 23:41:02 +01:00
Mauri Sandberg
ec839c786c ramips: dna_valokuitu-plus-ex400: clean-up image creation
Code cleanup. Simplify and unify how kernel image is passed to
Build/dna-bootfs

Signed-off-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/16811
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 23:36:44 +01:00
Shiji Yang
0c57510ced ramips: mt76x8: disable unused Ralink systick driver
The mt76x8 series SoCs use the MIPS generic systick timer. Sync the
upstream Ralink systick driver changes and disable it for mt76x8
target to reduce the kernel size.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16844
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 23:28:53 +01:00
Hauke Mehrtens
ea2c860225 stm32: Remove unnecessary kernel options
These options are filtered out since some weeks, remove them also from
the new stm32 target.

Fixes: 851e7f77e4 ("stm32: add new stm32 target")
Link: https://github.com/openwrt/openwrt/pull/17058
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 22:51:14 +01:00
Hauke Mehrtens
ed52345445 x86: Deactivate kernel options with extra overhead
Deactivate CONFIG_CONTEXT_TRACKING_USER_FORCE: Force user context
tracking: This is a testing feature which should not be activate in
production environments according to the Kconfig help. It adds an extra
overhead.

Deactivate CONFIG_RCU_NOCB_CPU_DEFAULT_ALL: Offload RCU callback
processing from all CPUs by default: This option should only be used in
aggressive HPC or real-time workloads which we do not have in OpenWrt.
For normal workloads it increases the number of context switches.

In the default Arch Linux kernel both options are not activated.

Fixes: 31111680f6 ("x86: switch config to a tickless kernel")
Link: https://github.com/openwrt/openwrt/pull/17057
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 20:03:59 +01:00
David Ignjic
faf4b3e0f7 mediatek: filogic: add support for Cudy WR3000S v1
Hardware
--------
MediaTek MT7981 WiSoC
256MB DDR3 RAM
128MB SPI-NAND (XMC XM25QH128C)
MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5)
UART: 115200 8N1 3.3V

MAC:
LAN MAC: label mac
WAN MAC: label mac + 1
2.4G MAC: label mac
5G MAC: label mac + 1 with LA bit set

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

1. Connect to the serial port as described in the "Hardware" section.

2. Power on the device + press reset pin. Keep pressing reset pin to enter the U-Boot  shell.

3. Download the OpenWrt initramfs image. Place it on an TFTP server
   connected to the Cudy LAN ports. Make sure the server is reachable at
   192.168.1.88. Rename the image to "cudy3000s.bin"

4. Download and boot the OpenWrt initramfs image.

   $ tftpboot 0x46000000 cudy3000s.bin; bootm 0x46000000

5. Transfer the OpenWrt sysupgrade image to the device using scp.
   Install with sysupgrade.

Signed-off-by: David Ignjic <ignjic@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16939
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 20:24:57 +01:00
David Bauer
b8b658bc0d mediatek: fix Cudy AP3000 Outdoor label-mac
The label-mac does not match the one assigned to the ethernet interface.
Use the mac-address assigned to the wifi interface instead, as it
matches the one found on the device label.

Signed-off-by: David Bauer <mail@david-bauer.net>
2024-11-23 20:04:01 +01:00
George Oldfort
2898d1d126 mediatek: add support for Acer Predator W6d and Acer Vero W6m
This commit adds support for two variants of the already supported router
Acer Predator Connect W6: The Acer Predator Connect W6d (W6 without 6 GHz
wifi) and the Acer Connect Vero W6m (W6 without 2.5G eth1 port, usb3 port,
and the 6 on-board gpio RGB LEDs, and with a KTD2026 RGB LED controller
instead of the KTD2061 LED controller of the W6/W6d).

The device tree for the W6m refers to the KTD202x driver suggested in
PR #16860.

Patching target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
removes the code repetition in (old) lines 121 to 124 on the occasion.

This is the last of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 19:33:42 +01:00
George Oldfort
d42075dcef mediatek: improve device tree for Acer Predator Connect W6
In order to prepare for OpenWrt support other Acer W6 devices and to get
a step further to full hardware support for Acer Predator Connect W6, this
commit
- adjusts the product name ("Acer Predator Connect W6")
- updates gpio LED labels to function/color scheme
- show router status by using first rgb led instead of it's red color only
  (blue: booting/failsafe mode; red: sysupgrade; green: running – was: red)
- changes switch/eth1 led configuration to reflect RX/TX activity and speed
  (green: full 1Gbps/2.5Gbps speed; amber: lower speed; blink: RX/TX)
- shortens dummy dm-mod.create string in bootargs
- enables W6's i2c interface

This is the third of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 19:33:42 +01:00
George Oldfort
e7aaba2587 mediatek: make use of Acer Predator Connect W6's u-boot environment
In order to prepare OpenWrt support for other Acer W6 devices and to adapt
the procedure to read and set mac addresses which other devices of the same
target are using (instead of needing an additional script and creating an
additional structure in the file system), this commit
- reads device mac addresses from u-boot environment
- avoids the detour via the file system to set the mac addresses
- drops redundant file /lib/preinit/05_extract_factory_data.sh

The idea and the implementation were thankfully taken from PR #16410.

This is the second of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 19:33:42 +01:00
George Oldfort
ce3b36b3d5 mediatek: split Acer/W6 dts into W6 common dtsi and device specific dts
In order to prepare OpenWrt support for other Acer W6 devices, this commit
moves all device tree components that are used by all Acer W6/W6e/W6d/W6m
routers from mt7986a-acer-predator-w6.dts to mt7986a-acer-w6-common.dtsi
(new file) and includes this dtsi file in mt7986a-acer-predator-w6.dts.

Minor changes had to be made to the device tree in order to improve clarity
and – notably – to reduce the number of dtc warnings:
- replace (obviously wrong) led@<N> gpio led entities by led-<N>
- remove unnecessary (default-state = "off") gpio led statements
- rename entity “memory” to “memory@0”
- add missing #address-cells and #address-size in /soc/mmc@11230000
- add missing #address-cells and #address-size in /soc/pcie@11280000
- introduce symbols “nvmem” and “swport0” in dtsi (referenced in dts)

The changes were checked with `diff -BEZbdtwy --suppress-common-lines ...`
(comparing two dts files created using old and new fdt-1 blobs again), see
https://github.com/openwrt/openwrt/pull/16861/#issuecomment-2455680020 .

This is the first of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 19:33:42 +01:00
Tim Noack
5572e0196a ath79: add support for TP-Link CPE710-v2
TP-Link CPE710-v2 is an outdoor wireless CPE for 5 GHz with one Ethernet
port based on the AP152 reference board. Compared to the CPE710-v1, the
only change observed in hardware is that the mdio address of the ethernet
physical changed from 0x4 to 0x0.

Specifications:
- SoC: QCA9563-AL3A MIPS 74kc @ 775MHz, AHB @ 258MHz
- RAM: 128MiB DDR2 @ 650MHz
- Flash: 16MiB SPI NOR Based on the GD25Q128
- Wi-Fi 5Ghz: ath10k chip (802.11ac for up to 867Mbps on 5GHz wireless
  data rate), based on the QCA9896
- Ethernet: one 1GbE port
- 23dBi high-gain directional 2×2 MIMO parabolic antenna
- Power, LAN, WLAN5G Blue LEDs

Flashing instructions:
Flash factory image through stock firmware WEB UI or through TFTP
To get to TFTP recovery just hold reset button while powering on for around
30-40 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP address:192.168.0.254

Signed-off-by: Tim Noack <tim@noack.id>
Link: https://github.com/openwrt/openwrt/pull/16637
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 18:43:20 +01:00