openwrt/staging/linusw.git
12 months agomediatek: add support for Confiabits MT7981
Luis Mita [Wed, 22 Nov 2023 19:13:04 +0000 (15:13 -0400)]
mediatek: add support for Confiabits MT7981

Confiabits MT7981 is a Wi-Fi 6 router based on MediaTek MT7981.

Specification:
 - SoC: MediaTek MT7981B
 - CPU: 2x 1.3 GHz Cortex-A53
 - Flash: 128 MiB SPI NAND
 - RAM: 256 MiB
 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
 - Ethernet: 4x 10/100/1000 Mbps MT7531AE (3xLAN, 1xWAN)
 - USB 2.0 port
 - Buttons: 1 Reset button, 1 Mesh button.
 - LEDs: 7x light-blue, 2x warm-white
 - Serial console: internal 4-pin header, 115200 8n1
 - Power: 12 VDC, 1.5 A

MAC addresses in stock firmware and in this commit:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 00:0c:43:xx:xx:e1 | label+1   |
| LAN     | 00:0c:43:xx:xx:e0 | label     |
| WLAN 2g | 00:0c:43:xx:xx:e0 | label     |
| WLAN 5g | 02:0c:43:xx:xx:e0 |           |
+---------+-------------------+-----------+
The label MAC was found in 'Factory', 0x4

Installation:
The stock firmware is OpenWrt-based. If you can reach LuCI or SSH, just use the sysupgrade image
with the 'Keep settings' option turned off.

Signed-off-by: Luis Mita <luis@luismita.com>
12 months agotarget: Make TARGET_SERIAL independent of GRUB configuration
Hauke Mehrtens [Sun, 26 Nov 2023 22:04:04 +0000 (23:04 +0100)]
target: Make TARGET_SERIAL independent of GRUB configuration

GRUB_SERIAL is also used for the default serial on the target and not
only in grub. When no grub was build it was not available and the build
fails.

Rename GRUB_SERIAL to TARGET_SERIAL and make it always available on x86
and armsr targets.

Fixes: #14063
Fixes: b10768476f9d ("x86,armsr: interpolate GRUB_SERIAL into /etc/inittab")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 months agokernel: bump 5.15 to 5.15.140
John Audia [Tue, 28 Nov 2023 22:08:16 +0000 (17:08 -0500)]
kernel: bump 5.15 to 5.15.140

Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.140

Removed upstreamed:
mvebu/patches-5.15/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.140&id=06d320ca170b4e59bb261e2ce3ffe84e9154d42b

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
12 months agokernel: bump 6.1 to 6.1.64
John Audia [Tue, 28 Nov 2023 19:34:53 +0000 (14:34 -0500)]
kernel: bump 6.1 to 6.1.64

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.64

Removed upstreamed:
ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch[1]
mvebu/patches-6.1/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch[2]
qualcommax/patches-6.1/0026-v6.7-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch[3]

Manually rebased:
bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.64&id=3b93096d29c5b9ca2af94be4ee9949c1767acf17
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.64&id=b3fd9db79e30d5eb5f76ef1f5b7e4f444af574ea
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.64&id=877080a3490102da26b8d969588159b2385f739e

Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne

Signed-off-by: John Audia <therealgraysky@proton.me>
12 months agomediatek: add kmod-usb3 to default package set of the ZBT-Z8102AX
Daniel Golle [Wed, 29 Nov 2023 21:10:37 +0000 (21:10 +0000)]
mediatek: add kmod-usb3 to default package set of the ZBT-Z8102AX

Include XHCI USB drivers on the ZBT-Z8102AX router, the drivers are
required to be able to use the USB-connected M.2 slots for 4G/5G modems.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 months agolibubox: update to Git HEAD (2023-11-28)
Felix Fietkau [Tue, 28 Nov 2023 21:12:15 +0000 (22:12 +0100)]
libubox: update to Git HEAD (2023-11-28)

b77f2a4ce903 uloop: fix build using C++ compilers
260ad5bd1566 udebug: add ulog support
e80dc00ee90c link librt if needed for shm_open

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoubus: update to Git HEAD (2023-11-28)
Felix Fietkau [Tue, 28 Nov 2023 12:54:19 +0000 (13:54 +0100)]
ubus: update to Git HEAD (2023-11-28)

2b39a27d8bcc libubus: fix reconnect with auto subscribe
f84eb5998c6e libubus: fix initial subscribe with autosubscribe

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoubox: add acl file for logd
Felix Fietkau [Tue, 28 Nov 2023 11:51:37 +0000 (12:51 +0100)]
ubox: add acl file for logd

Fixes ubus reconnect, since the process user id changes to 'logd'

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoudebug: move ubus dependency to libudebug
Felix Fietkau [Mon, 27 Nov 2023 18:36:33 +0000 (19:36 +0100)]
udebug: move ubus dependency to libudebug

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoudebug: update to Git HEAD (2023-11-27)
Felix Fietkau [Mon, 27 Nov 2023 17:37:55 +0000 (18:37 +0100)]
udebug: update to Git HEAD (2023-11-27)

a2301fa3b0c6 README: add wireshark info
cfd83ccc1e4e server: properly handle unclaimed file descriptors
cb71f64de0ec lib: remove leftover debug code
a92101631c0d lib: fix avl tree lookup
d4b99820afd0 lib: move library code to libubox, add ubus config handling code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agolibubox: update to Git HEAD (2023-11-27)
Felix Fietkau [Mon, 27 Nov 2023 17:37:33 +0000 (18:37 +0100)]
libubox: update to Git HEAD (2023-11-27)

82fa6480de7a uloop: add support for interval timers
13d9b04fb09d uloop: add support for user defined signal handlers
f7d156911311 uloop: properly initialize signal handler mask
8a5a4319a85c uloop: fix typo in signal handling rework
b3fa3d92e3eb uloop: reset flags after __uloop_fd_delete call
d4c3066e7c5e udebug: add udebug library code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agomediatek: copy config for Acer Predator W6
David Bauer [Mon, 20 Nov 2023 15:36:43 +0000 (16:36 +0100)]
mediatek: copy config for Acer Predator W6

Config was previously not copied on sysupgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
12 months agomediatek: add support for GL.iNet GL-MT2500
David Bauer [Thu, 20 Apr 2023 17:49:55 +0000 (19:49 +0200)]
mediatek: add support for GL.iNet GL-MT2500

Hardware
--------
SoC:  MediaTek MT7981BA
RAM:  1GB DDR4 (NANYA NT5AD512M16C4-JR)
MMC:  8GB eMMC (Samsung 8GTF4R)
ETH:  1000Base-T LAN (ePHY)
      2500Base-T WAN (MaxLinear GPY211C)
BTN:  1x Reset Button
LED:  System (blue/white)
      VPN (white)
USB:  1x USB-A (USB 3.0)
UART: 115200 8N1 - Pinout on board next to LAN port
      Don't connect 3.3V!

Known Issues
------------
U-Boot vendor recovery does not seem to accept any images, neither
GL.iNet images nor OpenWrt images. Recovery requires serial access!

Installation
------------
Upload the OpenWrt sysupgrade image to the Gl.iNet Web-UI. Make sure to
not retain existing settings.

Signed-off-by: David Bauer <mail@david-bauer.net>
12 months agorockchip: require image metadata
David Bauer [Tue, 21 Nov 2023 13:10:09 +0000 (14:10 +0100)]
rockchip: require image metadata

All devices in the rockchip target have appended image-metadata. Enforce
the presence of this metadata to avoid flashing incomplete images.

This is the de-facto standard for almost all OpenWrt targets.

Signed-off-by: David Bauer <mail@david-bauer.net>
12 months agoath79: fortinet-fap-221-b: convert to nvmem-layout
Lech Perczak [Thu, 16 Nov 2023 16:30:11 +0000 (17:30 +0100)]
ath79: fortinet-fap-221-b: convert to nvmem-layout

Now that MAC address parser supports the hex format (without
delimiters), use the canonical MAC address stored in U-boot partition.
Get rid of the userspace adjustments which are no longer necessary.
While at that, move the mac-base to the common part, as it is again
exactly the same in both models.

And convert ART partition too - keep that one separate, as calibration
data length differs between the models.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
12 months agoath79: fortinet-fap-220-b: convert to nvmem-layout
Lech Perczak [Thu, 16 Nov 2023 16:17:32 +0000 (17:17 +0100)]
ath79: fortinet-fap-220-b: convert to nvmem-layout

Now that MAC address parser supports the hex format (without
delimiters), use the canonical MAC address stored in U-boot partition.
Get rid of the "mac-address-increment" binding.
While at that, convert ART partition too.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
12 months agoath79: fortinet-fap-220-b: fix WLAN MAC addresses
Lech Perczak [Sat, 25 Nov 2023 02:09:30 +0000 (03:09 +0100)]
ath79: fortinet-fap-220-b: fix WLAN MAC addresses

Addresses were swapped compared to the factory firmware. In addition to
that, one of them was shifted by -1. Fix that by setting wlan0 MAC
offset to 9, and wlan1 MAC offset to 2.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
12 months agoustream-ssl: update to Git HEAD (2023-11-26)
Hauke Mehrtens [Sun, 26 Nov 2023 19:37:01 +0000 (20:37 +0100)]
ustream-ssl: update to Git HEAD (2023-11-26)

91666a3 ustream-mbedtls: Add compatibility with Mbed TLS 3.0.0
263b9a9 cmake: Fail if undefined symbols are used

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 months agox86 64: Add new device Cordoba Edge Platform
Xiaojun Liu [Mon, 13 Nov 2023 03:59:45 +0000 (03:59 +0000)]
x86 64: Add new device Cordoba Edge Platform

Add new device Cordoba Edge Platform
hardware specifications: CPU - Intel Atom C3000
                           Ethernet - 2 10Gbps ixgbe SPF+
                                      2 1Gbps  ixgbe RJ45/SPF
                                      4 2.5Gbps  igc RJ45
                           WiFi - mt7915e
                           LED  - 3 multicolor(red|blue|green) LEDs

Signed-off-by: Xiaojun Liu <xiaojun.liu@silicom.co.il>
12 months agodnsmasq: mark global ubus context as closed after fork
Sven Eckelmann [Sat, 18 Nov 2023 15:29:09 +0000 (16:29 +0100)]
dnsmasq: mark global ubus context as closed after fork

If the dnsmasq process forks to handle TCP connections, it closes the ubus
context. But instead of changing the daemon wide pointer to NULL, only the
local variable was adjusted - and this portion of the code was even dropped
(dead store) by some optimizing compilers.

It makes more sense to change the daemon->ubus pointer because various
functions are already checking it for NULL. It is also the behavior which
ubus_destroy() implements.

Fixes: d8b33dad0bb7 ("dnsmasq: add support for monitoring and modifying dns lookup results via ubus")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
12 months agorockchip: add NanoPi R5C support
Tianling Shen [Sun, 25 Jun 2023 16:37:31 +0000 (00:37 +0800)]
rockchip: add NanoPi R5C support

Hardware
--------
RockChip RK3568 ARM64 (4 cores)
1GB or 4GB LPDDR4X RAM
2x 2500 Base-T
4 LEDs (LAN / WAN / WIFI / POWER)
1 Button (Reset)
8GB or 32GB eMMC on-board
Micro-SD Slot
M.2 Slot
2x USB 3.0 Port

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agouboot-rockchip: add NanoPi R5C support
Tianling Shen [Sun, 25 Jun 2023 16:37:30 +0000 (00:37 +0800)]
uboot-rockchip: add NanoPi R5C support

Add support for the FriendlyARM NanoPi R5C.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agorockchip: add NanoPi R5S support
Tianling Shen [Sun, 25 Jun 2023 16:37:30 +0000 (00:37 +0800)]
rockchip: add NanoPi R5S support

Hardware
--------
RockChip RK3568 ARM64 (4 cores)
2GB or 4GB LPDDR4X RAM
1x 1000 Base-T
2x 2500 Base-T
4 LEDs (LAN1 / LAN2 / WAN / POWER)
8GB eMMC on-board
Micro-SD Slot
M.2 Slot
2x USB 3.0 Port

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Tested-by: Packet Please <pktpls@systemli.org>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agouboot-rockchip: add NanoPi R5S support
Tianling Shen [Sun, 25 Jun 2023 16:37:30 +0000 (00:37 +0800)]
uboot-rockchip: add NanoPi R5S support

Add support for the FriendlyARM NanoPi R5S support.

Tested-by: Packet Please <pktpls@systemli.org>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agorockchip: armv8: broaden boardname
Tianling Shen [Sun, 25 Jun 2023 16:37:29 +0000 (00:37 +0800)]
rockchip: armv8: broaden boardname

Now we have rk356x support :-)

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agorockchip: enable drivers for rk356x
Tianling Shen [Sun, 25 Jun 2023 16:37:29 +0000 (00:37 +0800)]
rockchip: enable drivers for rk356x

Enable all necessary drivers for the rk356x SoCs, including PHY,
SCMI, SPI etc. Also backport 2 upstream patches for sdhci fixes.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agorockchip: remove kernel 5.15 patches and config
Tianling Shen [Sun, 25 Jun 2023 16:37:29 +0000 (00:37 +0800)]
rockchip: remove kernel 5.15 patches and config

As we switched to kernel 6.1, these files can go.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agorockchip: switch to kernel 6.1
Tianling Shen [Sun, 25 Jun 2023 16:37:28 +0000 (00:37 +0800)]
rockchip: switch to kernel 6.1

Required by the following rk3568 support.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agorockchip: move image generation command to default
Tianling Shen [Sun, 25 Jun 2023 16:37:28 +0000 (00:37 +0800)]
rockchip: move image generation command to default

It's applicable for all devices so move it to default to reduce
redudant code. Addtionally introduce a new variable `BOOT_SCRIPT`
to allow custom boot script (if necessary).

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agorkbin: add new TF-A package for rk35xx
Tianling Shen [Sun, 25 Jun 2023 16:37:28 +0000 (00:37 +0800)]
rkbin: add new TF-A package for rk35xx

Currently there's no usable mainline (open source) TF-A implementation
for rk35xx SoCs, so pack the prebuilt firmware from the vendor.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agouboot-rockchip: Update to 2023.07.02
Tianling Shen [Sun, 25 Jun 2023 16:37:27 +0000 (00:37 +0800)]
uboot-rockchip: Update to 2023.07.02

* Removed swig hacks and prebuilt of-platdata
* Removed upstreamed patches
  - 101-rock64pro-disable-CONFIG_USE_PREBOOT.patch
  - 102-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R2C.patch
* Reordered patches

* Introduced new dependencies check
* Overrided default PATH to avoid race condition
    (host python3 vs hostpkg python3)
* Switched to use UBOOT_CUSTOMIZE_CONFIG for config update

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agouboot-sunxi: use intree dtc explicitly
Tianling Shen [Sat, 25 Nov 2023 15:17:15 +0000 (23:17 +0800)]
uboot-sunxi: use intree dtc explicitly

This replaces pylibfdt hack.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agouboot-sifiveu: use intree dtc explicitly
Tianling Shen [Sat, 25 Nov 2023 15:22:59 +0000 (23:22 +0800)]
uboot-sifiveu: use intree dtc explicitly

This replaces pylibfdt hack.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agouboot-mediatek: use intree dtc explicitly
Tianling Shen [Sat, 25 Nov 2023 15:21:22 +0000 (23:21 +0800)]
uboot-mediatek: use intree dtc explicitly

This replaces pylibfdt hack.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agou-boot: introduce dependencies check for swig and pyelftools
Tianling Shen [Sun, 25 Jun 2023 16:37:27 +0000 (00:37 +0800)]
u-boot: introduce dependencies check for swig and pyelftools

They are required by modern u-boot builds,
e.g. uboot-rockchip and uboot-sunxi.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 months agoipq40xx: enable UBI size checks for some Linksys NAND devices
Tony Ambardar [Sat, 11 Nov 2023 12:53:26 +0000 (04:53 -0800)]
ipq40xx: enable UBI size checks for some Linksys NAND devices

Add correct NAND_SIZE in device definitions for EA6350v3, EA8300, MR8300,
WHW01 and WHW03v2, to enable improved image size checks wrt UBI reserved
blocks on NAND devices.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
12 months agoimage: improve UBI image sizing on NAND devices
Tony Ambardar [Sat, 11 Nov 2023 12:46:14 +0000 (04:46 -0800)]
image: improve UBI image sizing on NAND devices

Many NAND devices use a build recipe with "append-ubi | check-size" to
ensure factory images don't exceed the target flash partition size.
However, UBI reserves space for bad block handling and other operational
overhead, and thus 'check-size' can overestimate the space available by
several MB. In practice, this means a failed check is definitely a failure,
while a passing check is only probably a pass.

Improve the situation by teaching 'Build/append-ubi' to check image sizes
while accounting for UBI reserved blocks. Add new device variable NAND_SIZE
and use with existing IMAGE_SIZE to derate the available space. Each UBI
device reserves 20 PEBs per 1024 PEBs of the entire NAND device for bad
blocks, plus an additional 4 PEBs overhead.

Many devices can transparently enable this check by setting NAND_SIZE based
on their flash storage, and may then remove any unneeded 'check-size'.

Link: http://www.linux-mtd.infradead.org/doc/ubi.html#L_overhead
Suggested-by: Shiji Yang <yangshiji66@qq.com>
Suggested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
12 months agoimage: fix Linksys image alignment and simplify footer creation
Tony Ambardar [Tue, 14 Nov 2023 01:14:07 +0000 (17:14 -0800)]
image: fix Linksys image alignment and simplify footer creation

Current factory image sizes for Linksys devices are 256-byte aligned. This
is not an issue writing factory images from the OpenWrt or Linksys GUIs,
but can lead to failures using a TFTP client from the Linksys bootloader:

     NAND write: device 1 offset 0x2800000, size 0xc00100
     Attempt to write to non page aligned data
     NAND write to offset 2800000 failed -22
      0 bytes written: ERROR

Simplify Linksys footer creation by migrating to a makefile build recipe,
and pre-pad the footer (with 0xFF) to ensure the final image is $(PAGESIZE)
aligned.  Finally, remove the old linksys-image.sh script no longer needed.

Linksys footer details are given below for future reference. The 256-byte
footer is appended to factory images and tested by both the Linksys
Upgrader (observed in EA6350v3) and OpenWrt sysupgrade.

  Footer format:
    .LINKSYS.     Checked by Linksys upgrader before continuing.  (9 bytes)
    <VERSION>     Upgrade version number, unchecked so arbitrary. (8 bytes)
    <TYPE>        Model of device, space padded (0x20).          (15 bytes)
    <CRC>         CRC checksum of factory image to flash.         (8 bytes)
    <padding>     Padding ('0' + 0x20 * 7)                        (8 bytes)
    <signature>   Signature of signer, unchecked so arbitrary.   (16 bytes)
    <padding>     Padding with nulls (0x00)                     (192 bytes)

Link: https://github.com/openwrt/openwrt/pull/11405#issuecomment-1358510123
Link: https://github.com/openwrt/openwrt/pull/11405#issuecomment-1587517739
Reported-by: Stijn Segers <foss@volatilesystems.org>
Reported-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
12 months agoimage: use helper function for size units
Tony Ambardar [Sat, 11 Nov 2023 12:29:26 +0000 (04:29 -0800)]
image: use helper function for size units

Add the make function 'exp_units' for helping evaluate k/m/g size units in
expressions, and use this to consistently replace many ad hoc substitutions
like '$(subst k,* 1024,$(subst m, * 1024k,$(IMAGE_SIZE)))' in makefiles.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
12 months agoipq40xx: fix typo in Linksys WHW01 image definition
Tony Ambardar [Mon, 2 Oct 2023 04:51:32 +0000 (21:51 -0700)]
ipq40xx: fix typo in Linksys WHW01 image definition

Use lower-case "k" in IMAGE_SIZE for Linksys WHW01, permitting proper unit
conversions in build recipes (e.g. 75776k -> 75776*1024).

Fixes: 2a9f3b7717 ("ipq40xx: fix up Linksys WHW01 board name, device definition")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
12 months agoath79: add support for D-link DAP-1720 A1
Rani Hod [Sun, 12 Nov 2023 23:15:31 +0000 (01:15 +0200)]
ath79: add support for D-link DAP-1720 A1

D-Link DAP-1720 rev A1 is a mains-powered AC1750 Wi-Fi range extender,
manufactured by Alpha Networks [8WAPAC28.1A1G].
(in square brackets: PCB silkscreen markings)

Specifications:
* CPU (Qualcomm Atheros QCA9563-AL3A [U5]):
  775 MHz single core MIPS 74Kc;
* RAM (Winbond W9751G6KB-25J [U3]):
  64 MiB DDR2;
* ROM (Winbond W25Q128FV [U16]):
  16 MiB SPI NOR flash;
* Ethernet (AR8033-AL1A PHY [U1], no switch):
  1 GbE RJ45 port (no PHY LEDs);
* Wi-Fi
  * 2.4 GHz (Qualcomm Atheros QCA9563-AL3A [U5]):
    3x3 802.11n;
  * 5 GHz (Qualcomm Atheros QCA9880-BR4A [U9]):
    3x3 802.11ac Wave 1;
  * 3 foldable dual-band antennas (U.fl) [P1],[P2],[P3];
* GPIO LEDs:
  * RSSI low (red/green) [D2];
  * RSSI medium (green) [D3];
  * RSSI high (green) [D4];
  * status (red/green) [D5];
* GPIO buttons:
  * WPS [SW1], co-located with status LED;
  * reset [SW4], accessible via hole in the side;
* Serial/UART:
  Tx-Gnd-3v3-Rx [JP1], Tx is the square pin, 1.25mm pitch;
  125000-8-n-1 in U-boot, 115200-8-n-1 in kernel;
* Misc:
  * 12V VCC [JP2], fed from internal 12V/1A AC to DC converter;
  * on/off slide switch [SW2] (disconnects VCC mechanically);
  * unpopulated footprints for a Wi-Fi LED [D1];
  * unpopulated footprints for a 4-pin 3-position slide switch (SW3);

MAC addresses:
* Label = LAN;
* 2.4 GHz WiFi = LAN;
* 5 GHz WiFi = LAN+2;

Installation:
* `factory.bin` can be used to install OpenWrt from OEM firmware via the
  standard upgrade webpage at http://192.168.0.50/UpdateFirmware.html
* `recovery.bin` can be used to install OpenWrt (or revert to OEM
  firmware) from D-Link Web Recovery. To enter web recovery, keep reset
  button pressed and then power on the device. Reset button can be
  released when the red status LED is bright; it will then blink slowly.
  Set static IP to 192.168.0.10, navigate to http://192.168.0.50 and
  upload 'recovery.bin'. Note that in web recovery mode the device
  ignores ping and DHCP requests.

Note: 802.11s is not supported by the default `ath10k` driver and
firmware, but is supported by the non-CT driver and firmware variants.
The `-smallbuffers` driver variant is recommended due to RAM size.

Co-developed-by: Anthony Sepa <protectivedad@gmail.com>
Signed-off-by: Rani Hod <rani.hod@gmail.com>
12 months agoath79: ar: convert to mac-base
Rosen Penev [Sun, 26 Nov 2023 04:36:49 +0000 (20:36 -0800)]
ath79: ar: convert to mac-base

Replacement for deprecated mac-address-increment

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoath79: ar: convert to nvmem-layout
Rosen Penev [Sun, 26 Nov 2023 03:31:17 +0000 (19:31 -0800)]
ath79: ar: convert to nvmem-layout

Will allow removing deprecated mac-address-increment.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoath79: tp9343: convert to nvmem-layout
Rosen Penev [Sun, 26 Nov 2023 01:36:49 +0000 (17:36 -0800)]
ath79: tp9343: convert to nvmem-layout

Allows getting rid of deprecated mac-address-increment.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoath79: qcn: convert to nvmem-layout
Rosen Penev [Sun, 26 Nov 2023 01:25:18 +0000 (17:25 -0800)]
ath79: qcn: convert to nvmem-layout

Allows getting rid of deprecated mac-address-increment.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoath79: qca: remove mac-address-increment
Rosen Penev [Fri, 10 Nov 2023 22:55:43 +0000 (14:55 -0800)]
ath79: qca: remove mac-address-increment

nvmem-layout allows removal

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoath79: qca: convert to nvmem-layout
Rosen Penev [Thu, 9 Nov 2023 23:18:44 +0000 (15:18 -0800)]
ath79: qca: convert to nvmem-layout

Allows replacing mac-address-increment with mac-base.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoath79: mikrotik: fix dts warnings
Rosen Penev [Sat, 11 Nov 2023 00:21:29 +0000 (16:21 -0800)]
ath79: mikrotik: fix dts warnings

property has invalid length

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7621: nix mac-address-increment
Rosen Penev [Wed, 8 Nov 2023 03:39:00 +0000 (19:39 -0800)]
ramips: mt7621: nix mac-address-increment

nvmem-layout allows removal

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7621: convert to nvmem-layout
Rosen Penev [Tue, 7 Nov 2023 23:55:58 +0000 (15:55 -0800)]
ramips: mt7621: convert to nvmem-layout

Allows replacing mac-address-increment with mac-base.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7621: add interrupt-controller
Rosen Penev [Wed, 8 Nov 2023 03:25:58 +0000 (19:25 -0800)]
ramips: mt7621: add interrupt-controller

Fixes dtc warning:

'#interrupt-cells' found, but node is not an interrupt provider

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7620a: use mac-base
Rosen Penev [Sat, 25 Nov 2023 21:35:04 +0000 (13:35 -0800)]
ramips: mt7620a: use mac-base

mac-address-increment is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7620a: convert to nvmem-layout
Rosen Penev [Sat, 25 Nov 2023 21:20:44 +0000 (13:20 -0800)]
ramips: mt7620a: convert to nvmem-layout

Allows using mac-base to replace mac-address-increment.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7620n: convert to nvmem-layout
Rosen Penev [Sat, 25 Nov 2023 20:32:55 +0000 (12:32 -0800)]
ramips: mt7620n: convert to nvmem-layout

nvmem-cells is deprecated. nvmem-layout allows using mac-base.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7628: use mac-base
Rosen Penev [Fri, 24 Nov 2023 02:59:35 +0000 (18:59 -0800)]
ramips: mt7628: use mac-base

mac-address-increment is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: mt7628: use nvmem-layout
Rosen Penev [Fri, 24 Nov 2023 02:31:55 +0000 (18:31 -0800)]
ramips: mt7628: use nvmem-layout

Will allow using mac-base.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agomediatek: use mac-base
Rosen Penev [Sat, 25 Nov 2023 22:11:08 +0000 (14:11 -0800)]
mediatek: use mac-base

mac-address-increment is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agomediatek: convert to nvmem-layout
Rosen Penev [Sat, 25 Nov 2023 22:03:10 +0000 (14:03 -0800)]
mediatek: convert to nvmem-layout

Will allow removing mac-address-increment.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: rtxxxx: remove mac-address-increment
Rosen Penev [Fri, 24 Nov 2023 01:40:09 +0000 (17:40 -0800)]
ramips: rtxxxx: remove mac-address-increment

Deprecated and replaced upstream with mac-base.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: rtxxxx: convert to nvmem-layout
Rosen Penev [Wed, 22 Nov 2023 23:48:24 +0000 (15:48 -0800)]
ramips: rtxxxx: convert to nvmem-layout

Allows replacing mac-adress-increment.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agomediatek: filogic: reorder alphabetically
Chukun Pan [Mon, 6 Nov 2023 15:06:05 +0000 (23:06 +0800)]
mediatek: filogic: reorder alphabetically

Reorder scripts and image recipes to keep alphabetical order.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
12 months agouboot-envtools: filogic: reorder alphabetically
Chukun Pan [Sun, 5 Nov 2023 15:02:09 +0000 (23:02 +0800)]
uboot-envtools: filogic: reorder alphabetically

Reorder scripts to keep alphabetical order.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
12 months agomediatek: filogic: remove kmod-usb2 for GL-MT6000
Chukun Pan [Fri, 17 Nov 2023 15:27:03 +0000 (23:27 +0800)]
mediatek: filogic: remove kmod-usb2 for GL-MT6000

The usb driver requires kmod-usb3, not kmod-usb2.
Remove the useless kmod-usb2 from default package.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
12 months agomediatek: Cetron CT3003: fixes typo for spi properties
Chukun Pan [Sat, 4 Nov 2023 15:50:20 +0000 (23:50 +0800)]
mediatek: Cetron CT3003: fixes typo for spi properties

Same as commit 3674689, correct 'buswidth' to 'bus-width'.
Also move the nmbm properties outside the partition definition.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
12 months agoipq40xx: remove mac-address-increment
Rosen Penev [Mon, 13 Nov 2023 19:47:17 +0000 (11:47 -0800)]
ipq40xx: remove mac-address-increment

nvmem-layout allows removal

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoipq40xx: convert to nvmem-layout
Rosen Penev [Mon, 13 Nov 2023 19:23:12 +0000 (11:23 -0800)]
ipq40xx: convert to nvmem-layout

Allows replacing mac-address-increment with mac-base.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoipq40xx: fix dtc warnimg
Rosen Penev [Mon, 13 Nov 2023 20:02:38 +0000 (12:02 -0800)]
ipq40xx: fix dtc warnimg

I2C bus unit address format error, expected "62"

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoqualcommax: convert to nvmem-layout
Rosen Penev [Mon, 13 Nov 2023 20:20:51 +0000 (12:20 -0800)]
qualcommax: convert to nvmem-layout

nvmem-cells is deprecated

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoapm821xx: convert to nvmem-layout
Rosen Penev [Mon, 13 Nov 2023 20:23:07 +0000 (12:23 -0800)]
apm821xx: convert to nvmem-layout

nvmem-cells is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agomediatek: filogic: Fix GPIOs for Zbtlink ZBT-Z8102AX
Hauke Mehrtens [Sat, 25 Nov 2023 17:06:41 +0000 (18:06 +0100)]
mediatek: filogic: Fix GPIOs for Zbtlink ZBT-Z8102AX

The PGIO configuration should be added for the ZBT-Z8102AX and not the ZBT-Z8103AX

Fixes: c8c2f522625c ("mediatek: add support for Zbtlink ZBT-Z8102AX")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 months agoramips: mt76x8 add support for RTC class/drivers
Xiaobo Liu [Tue, 14 Nov 2023 03:07:56 +0000 (11:07 +0800)]
ramips: mt76x8 add support for RTC class/drivers

This commit adds support for RTC class/drivers to the mt76x8 target.

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
12 months agof2fs-tools: avoid dead symlinks in root
Rosen Penev [Sat, 7 Oct 2023 04:55:01 +0000 (21:55 -0700)]
f2fs-tools: avoid dead symlinks in root

When building on the host, this avoids creating dead symlinks. Matches
what is done elsewhere.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoramips: add support for TP-Link EX220 v1
Darlan Pedro de Campos [Fri, 24 Nov 2023 00:31:05 +0000 (19:31 -0500)]
ramips: add support for TP-Link EX220 v1

This device is very similar, if not identical, to the TP-Link AX23 v1
but is targeted at service providers and features a completely different
flash layout.

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
        LEDs - (3V3 - GND - RX - TX) - 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 all LEDs 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: Darlan Pedro de Campos <darlanpedro@gmail.com>
12 months agomwlwifi: update to version 10.4.10-20231120
Michael Trinidad [Wed, 22 Nov 2023 02:46:27 +0000 (21:46 -0500)]
mwlwifi: update to version 10.4.10-20231120

Upstream PR 416 improvements:
 -AMPDU Optimization of priority calculation. (8864/8897)
 -8864/8897 fix wpa3
 -Add cypher suite to driver capabilities (all chip)
 -Alignment of pcie_tx_ctrl* (all chip)
 -"feature" normalization for all chips (all chip)
 -Add modprobe parameters (all chip)
 -fix monitoring (all chip)
 -Code separation by chipset (8864/8897 <=> 8997)
 -dump_prob decommissioning (8864/8897/8997)
 -fix amsdu high ping latency (8864/8897/8997)
 -drop debug info in hostcmd_get_hw_spec() (8864/8897)
 -Add wcb_base in debug info (8864)
 -Rewrite AMSDU packets (8864/8897/8997)
 -debug rewrite output mwl_debugfs_sta_read (all chip)
 -Improved encryption interoperability (8864/8897/8997)
 -factorization encrypted packet test (8864/8897/8997)
 -Change 88W8864 firmware to 7.2.9.27 (8864/8897)
 -Fix the AMPDU session lifecycle (8864/8897/8997)
 -Remove the tx done packets mechanism (8864/8897)

Signed-off-by: Michael Trinidad <trinidude4@hotmail.com>
12 months agoramips: Add support for Cudy WR1300 v3
Filip Milivojevic [Sat, 11 Nov 2023 09:57:32 +0000 (10:57 +0100)]
ramips: Add support for Cudy WR1300 v3

Specifications:
 - SoC: MediaTek MT7621AT
 - RAM: 128 MB (DDR3)
 - Flash: 16 MB (SPI NOR)
 - WiFi: MediaTek MT7603E, MediaTek MT7613BE
 - Switch: 1 WAN, 4 LAN (Gigabit)
 - Buttons: Reset, WPS
 - LEDs: System, Wan, Lan 1-4, WiFi 2.4G, WiFi 5G, WPS
 - Power: DC 12V 1A tip positive

Download and flash the manufacturer's built OpenWRT image available at
http://www.cudytech.com/openwrt_software_download
Install the new OpenWRT image via luci (System -> Backup/Flash firmware)
Be sure to NOT keep settings. The force upgrade may need to be checked
due to differences in router naming conventions.

Cudy WR1300 v3 differs from v2 only in swapped WiFi chip PCIe slots. Common
nodes are extracted to .dtsi and new v2 and v3 dts are created.

Cudy WR1300 v2 dts now contains ieee80211-freq-limit and has
eeprom_factory_8000 length fixed.

The same manufacturer's built OpenWRT image is provided for both v2 and v3
devices as a step in installing, but for proper WiFi functionality,
a separate build is required.

Recovery:
 - Loads only signed manufacture firmware due to bootloader RSA verification
 - serve tftp-recovery image as /recovery.bin on 192.168.1.88/24
 - connect to any lan ethernet port
 - power on the device while holding the reset button
 - wait at least 8 seconds before releasing reset button for image to
   download
 - See http://www.cudytech.com/newsinfo/547425.html

Signed-off-by: Filip Milivojevic <zekica@gmail.com>
12 months agouboot-envtools: add support for Zyxel EX5601-T0 ubootmod
Nicolò Veronese [Thu, 2 Nov 2023 18:53:08 +0000 (19:53 +0100)]
uboot-envtools: add support for Zyxel EX5601-T0 ubootmod

The ubootmod bootlaoder for EX5601-T0 uses two partitions
 in ubi to store enviroment variables. so proper config
 is needed.

Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
12 months agomediatek: add Zyxel EX5601-T0 with uboot custom partition
Valerio 'ftp21' Mancini [Wed, 4 Oct 2023 09:43:25 +0000 (11:43 +0200)]
mediatek: add Zyxel EX5601-T0 with uboot custom partition

The flash procedure is similar to the Xiaomi AX6000 router.

Load openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-initramfs-recovery.itb from original Zyxel U-Boot:

tftpboot openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-initramfs-recovery.itb
bootm 0x46000000
Load mtd-rw
insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1

Format ubi and create ubootenv partitions

ubidetach -p /dev/mtd5; ubiformat /dev/mtd5 -y; ubiattach -p /dev/mtd5
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
Copy openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-initramfs-recovery.itb to /tmp and create recovery partition.
If your recovery image is larger than 10MiB, size the recovery partition accordingly to make it fit.

ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
ubiupdatevol /dev/ubi0_2  openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-initramfs-recovery.itb
Copy preloader and uboot to /tmp and write them in the mtd

mtd write /tmp/openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-preloader.bin bl2
mtd write /tmp/openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-bl31-uboot.fip fip
Now write the firmware:
sysupgrade -n  /tmp/openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-squashfs-sysupgrade.itb

To create a correct BL2, I had to add a profile for 'spim:4k+256' as I could not find a way to value the variable 'NAND_TYPE'.

Features and fixes from hitech95 tree has been squashed, I'm attaching his commit message:

The Power LED was not working correctly and not reacting
 to the boot process and statuses.

The board has space (footprint) for an unpopulated Zigbee chip,
 while we dont know the device model having this chip populated
 we have to assure that the common dts doesnt enable
 interfaces that share pins with such device.

In this instance the PCIe and the uart1 and uart2 are disabled.
Some of the control PCIE pins seems to be used for the Zigbee chip,
 UART1 seems to be used as a flash port while UART2 should be the
 main comunication interface of Zigbee chip.

The Zigbee chip should be a EFR32MG21. But the pins used for UART
 seems to be not on standard PINS used by other adapters.
 So it cannot run firmwares shared on the web.
 But it should be possible to build a custom firmware with
 the corrtect pinmux.

This commit also contains the following squashed commit from hitech95
 - mediatek: fix sysupgrade for Zyxel EX7601-T0 ubootmod

Changes and fixes added in common board:
 - added aliases for boot status leds.
 - added aliases for the mac-label-device.
 - added pin claims for core features (MDIO and UART 0)
 - added default LEDs configuration (01_leds)
 - added default network configuration (02_network)
 - added missing kmod-usb3 module for USB3
 - fixed LED names
 - fixed reset pin for SLIC chip
 - removed unused pinmux configurations and devices
 - fix LAN (switch) port numbering
 - using nvmem cells for wifi eeprom, dropping deprecated "mediatek,mtd-eeprom"
 - proper factory partition and mac address handling
 - cleaned up spi_nand sections and partition

Changes and fixxes added in stock layout:
 - added NMBM, if u-boot has it, the kernel must be informed.

Co-authored-by: Nicolò Veronese <nicveronese@gmail.com>
Co-developed-by: Nicolò Veronese <nicveronese@gmail.com>
Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
Signed-off-by: Valerio 'ftp21' Mancini <ftp21@ftp21.eu>
12 months agouboot-mediatek: add initial Zyxel EX5601-T0 support
Valerio 'ftp21' Mancini [Sat, 26 Aug 2023 22:01:58 +0000 (00:01 +0200)]
uboot-mediatek: add initial Zyxel EX5601-T0 support

Flash procedure is described in next commit.

TLDR:
Copy preloader and uboot to /tmp and write them in the mtd.
This will also require new UBI partition and
 volumes to boot openwrt.

mtd write /tmp/openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-preloader.bin bl2
mtd write /tmp/openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-bl31-uboot.fip fip

Changelist:
 - Added profile for 4k+256 SPI NAND_TYPE
 - Added basic Zyxel EX5601-T0 uboot profile

Backported from hitech95 branch:
 - Button RESET pin fix
 - Button WPS pin fix

Signed-off-by: Valerio 'ftp21' Mancini <ftp21@ftp21.eu>
Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
12 months agomediatek: remove DTS property added by mistake
Daniel Golle [Sat, 25 Nov 2023 03:20:50 +0000 (03:20 +0000)]
mediatek: remove DTS property added by mistake

Remove bogus 'phy-handle = <&phy0>;', an undefined reference.

Fixes: c8c2f52262 ("mediatek: add support for Zbtlink ZBT-Z8102AX")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 months agoramips: add support for Sercomm CPJ routers
Mikhail Zhilkin [Sun, 12 Nov 2023 07:58:26 +0000 (07:58 +0000)]
ramips: add support for Sercomm CPJ routers

This commit adds support for following wireless routers:
 - Rostelecom RT-FL-1 (Serсomm RT-FL-1)
 - Rostelecom S1010 (Serсomm S1010.RT)

The devices are almost identical and the only difference is one bit in the
factory image PID (thanks to Maximilian Weinmann <x1@disroot.org>
(@MaxS0niX) for the info and idea to make one PR for two devices at once).

Devices specification
---------------------
   SoC:          MediaTek MT7620A, MIPS
   RAM:          64 MB
   Flash:        16 MB SPI NOR
   Wireless 2.4: MT7620 (b/g/n, 2x2)
   Wireless 5:   MT7612EN (a/n/ac, 2x2)
   Ethernet:     5xFE (WAN, LAN1-4)
   BootLoader:   U-Boot
   Buttons:      2 (wps, reset)
   LEDs:         1 amber and 1 green status GPIO leds
                 5 green ethernet GPIO leds
                 1 green GPIO 2.4 GHz WLAN led
                 1 green PHY 5 GHz WLAN led
                 1 green unmanaged power led
   USB ports:    No
   Power:        12 VDC, 1 A
   Connector:    Barrel

OEM easy installation
---------------------
1. Remove all dots from the factory image filename (except the dot
   before file extension)
2. Upload and update the firmware via the original web interface
3. Wait until green status led stops blinking (can take several minutes)
4. Login to OpenWrt initramsfs. It's recommended to make a backup of the
   mtd partitions at this point.
4. Perform sysupgrade using the following command (or use Luci):
   sysupgrade -n sysupgrade.bin
5. Wait until green status les stops blinking (can take several minutes)
6. Mission acomplished

Return to Stock
---------------
Option 1. Restore firmware Slot1 from a backup (firmware2.bin):
   cd /tmp
   mtd -e Firmware2 write firmware2.bin Firmware2
   printf 1 | dd bs=1 seek=$((0x18007)) count=1 of=/dev/mtdblock2
   reboot

Option 2. Decrypt, ungzip and split stock firmware image into the parts,
take Slot1 parts (kernel2.bin, rootfs2.bin) and write them:
   cd /tmp
   mtd -e Kernel2 write kernel2.bin Kernel2
   mtd -e RootFS2 write rootfs2.bin RootFS2
   printf 1 | dd bs=1 seek=$((0x18007)) count=1 of=/dev/mtdblock2
   reboot
More about stock firmware decryption:
Link: https://github.com/Psychotropos/sercomm_fwutils/
Debricking
----------
Use sercomm-recovery tool. You can use "ALL" mtd partition backup as a
recovery image.
Link: https://github.com/danitool/sercomm-recovery
MAC addresses
-------------
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 48:3e:xx:xx:xx:1e | label     |
| LAN     | 48:3e:xx:xx:xx:1e | label     |
| WAN     | 48:3e:xx:xx:xx:28 | label+10  |
| WLAN 2g | 48:3e:xx:xx:xx:20 | label+2   |
| WLAN 5g | 48:3e:xx:xx:xx:24 | label+6   |
+---------+-------------------+-----------+

Co-authored-by: Vadzim Vabishchevich <bestmc2009@gmail.com>
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
12 months agoramips: mt7620: drop unnecessary trailing tabs
Mikhail Zhilkin [Sun, 12 Nov 2023 07:56:08 +0000 (07:56 +0000)]
ramips: mt7620: drop unnecessary trailing tabs

Let's tidy up a bit (drop unnecessary trailing tabs).

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
12 months agoramips: sercomm.mk: make common recipe to set a bit in pid
Mikhail Zhilkin [Sun, 12 Nov 2023 07:52:45 +0000 (07:52 +0000)]
ramips: sercomm.mk: make common recipe to set a bit in pid

This commit makes a common recipe to set bit in Sercomm factory pid since
this is necessary for several devices (WiFire S1500.nbn, Rostelecom
RT-FL-1) at different offsets.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
12 months agoscripts: sercomm-pid.py: use uppercase hwid in pid
Mikhail Zhilkin [Sun, 12 Nov 2023 07:46:11 +0000 (07:46 +0000)]
scripts: sercomm-pid.py: use uppercase hwid in pid

Sercomm uses uppercase for hexadecimal representation of the device
hardware IDs in factory image PID. This commit brings the sercomm-pid.py
script into compliance with the original Sercomm algorithm.

Example
-------
+--------+-------------+-----------+-------------+
| Device | PID (before | PID       | PID (after  |
| HWID   | the commit) | (Sercomm) | the commit) |
+--------+-------------+-----------+-------------+
| CPJ    | 43 50 4a    | 43 50 4A  | 43 50 4A    |
+--------+-------------+-----------+-------------+

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
12 months agolinux-firmware: intel: add firmware for AX101
Jitao Lu [Tue, 21 Nov 2023 14:46:11 +0000 (22:46 +0800)]
linux-firmware: intel: add firmware for AX101

iwlwifi from 6.5 supports API version up to 83, but 81 is the latest one
available from linux-firmware 20230804.

Signed-off-by: Jitao Lu <dianlujitao@gmail.com>
12 months agoipq40xx: refresh patches
Robert Marko [Fri, 24 Nov 2023 17:42:55 +0000 (18:42 +0100)]
ipq40xx: refresh patches

CI reported that ipq40xx needed a refresh, so lets refresh it.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
12 months agomediatek: add support for Zbtlink ZBT-Z8102AX
Daniel Golle [Mon, 20 Nov 2023 20:23:42 +0000 (20:23 +0000)]
mediatek: add support for Zbtlink ZBT-Z8102AX

Specifications:
SoC: MediaTek MT7981B
RAM: 1024MiB
Flash: SPI-NAND 128 MiB
Switch: 1 WAN, 4 LAN (Gigabit)
USB: two M.2 slots for 5G modems via USB 3.0 hub, external USB 3.0 port
Buttons: Reset, Mesh
Power: DC 12V 1A
WiFi: MT7976CN
UART: 115200n8
UART Layout:
VCC-RX-TX-GND

Installation:
A. Through OpenWrt Dashboard:
If your router comes with OpenWrt preinstalled (modified by the seller),
you can easily upgrade by going to the dashboard (192.168.1.1) and then
navigate to System -> Backup/Flash firmware, then flash the firmware

B. Through TFTP
Standard installation via UART:

1. Connect USB Serial Adapter to the UART, (NOTE: Don't connect the VCC pin).
2. Power on the router. Make sure that you can access your router via UART.
3. Restart the router then repeatedly press ctrl + c to skip default boot.
4. Type > bootmenu
5. Press '2' to select upgrade firmware
6. Press 'Y' on 'Run image after upgrading?'
7. Press '0' and hit 'enter' to select TFTP client (default)
8. Fill the U-Boot's IP address and TFTP server's IP address.
9. Finally, enter the 'firmware' filename.

Based on patch adding support for similar Zbtlink ZBT-Z8103AX device by
Ian Ishmael C. Oderon.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 months agogeneric: 6.1: backport upstream Aquantia PHY firmware loader patches
Christian Marangi [Sun, 19 Nov 2023 11:52:55 +0000 (12:52 +0100)]
generic: 6.1: backport upstream Aquantia PHY firmware loader patches

Backport merged upstream patch that adds support for firmware loader
from NVMEM or attached filesystem for Aquantia PHYs.

Refresh all kernel patches affected by this change.

Also update the path for aquantia .ko that got moved to dedicated
directory upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
12 months agorealtek: convert to nvmem-layout
Rosen Penev [Mon, 13 Nov 2023 20:14:37 +0000 (12:14 -0800)]
realtek: convert to nvmem-layout

nvmem-cells is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agokernel: bump 5.15 to 5.15.139
John Audia [Mon, 20 Nov 2023 13:23:17 +0000 (08:23 -0500)]
kernel: bump 5.15 to 5.15.139

Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.139

Removed upstreamed:
backport-5.15/830-v6.6-2-leds-turris-omnia-Drop-unnecessary-mutex-locking.patch[1]
backport-5.15/830-v6.7-1-leds-turris-omnia-Do-not-use-SMBUS-calls.patch[2]
x86/patches-5.15/120-hwrng-geode-fix-accessing-registers.patch[3]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.139&id=aec3706971b332af8321b2beccba981b8061489a
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.139&id=893eedf596dd81c7a7f0cd80b345956ae000eab9
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.139&id=a5c83c8043d70b9a28d1bd78a2dbbab340f43889

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
12 months agokernel: bump 6.1 to 6.1.63
John Audia [Mon, 20 Nov 2023 12:15:50 +0000 (07:15 -0500)]
kernel: bump 6.1 to 6.1.63

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.63

Removed upstreamed:
generic/backport-6.1/815-v6.6-2-leds-turris-omnia-Drop-unnecessary-mutex-locking.patch
generic/backport-6.1/815-v6.7-1-leds-turris-omnia-Do-not-use-SMBUS-calls.patch
ixp4xx/patches-6.1/0007-watchdog-ixp4xx-Make-sure-restart-always-works.patch

Manually rebased:
bcm27xx/patches-6.1/950-0606-hwrng-bcm2835-sleep-more-intelligently.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.63&id=7d0e60e4ff840e97fb18afb2a7344442c10a6fdf
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.63&id=63cdeb20ee3bfef820b045b8d3b8395f9f815a74
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.63&id=8803da01fe1b4ca3d37745283f7e73c6c2558c0c

Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne

Signed-off-by: John Audia <therealgraysky@proton.me>
12 months agoath79: add support for D-Link COVR-P2500 A1
Daniel Linjama [Thu, 2 Mar 2023 09:05:22 +0000 (11:05 +0200)]
ath79: add support for D-Link COVR-P2500 A1

Specifications:
* QCA9563, 16 MiB flash, 128 MiB RAM, 2T2R 802.11n
* QCA9886 2T2R 801.11ac Wave 2
* QCA7550 Homeplug AV2 1300
* AR8337, 3 Gigabit ports (1, 2: LAN; 3: WAN)

To make use of PLC functionality, firmware needs to be
provided via plchost (QCA7550 comes without SPI NOR),
patched with the Network Password and MAC.

Flashing via OEM Web Interface
* Flash 'factory.bin' using web-interface
* Wait until firmware succesfully installed and device booted
* Hold down reset button to reset factory defaults (~10 seconds)

Flashing via Recovery Web Interface:
* Hold down reset button during power-on (~10 seconds)
* Recovery Web UI is at 192.168.0.50, no DHCP.
* Flash 'recovery.bin' with
  scripts/flashing/dlink_recovery_upload.py
  (Recovery Web UI does not work with modern OSes)

Return to stock
* Hold down reset button during power-on (~10 seconds)
* Recovery Web UI is at 192.168.0.50, no DHCP.
* Flash unencrypted stock firmware with
  scripts/flashing/dlink_recovery_upload.py
  (Recovery Web UI does not work with modern OSes)

Co-developed-by: Sebastian Schaper <openwrt@sebastianschaper.net>
Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
Signed-off-by: Daniel Linjama <daniel@dev.linjama.com>
12 months agofirmware-utils: Fix PKG_MIRROR_HASH
Hauke Mehrtens [Wed, 22 Nov 2023 23:15:40 +0000 (00:15 +0100)]
firmware-utils: Fix PKG_MIRROR_HASH

This fixes the mirror hash to the version of the file uploaded to the
download mirror and which my build calculated.

Fixes: b117e7244f9e ("firmware-utils: update to Git HEAD (2023-11-21)")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 months agotools: firmware-utils: Fix PKG_MIRROR_HASH
Hauke Mehrtens [Wed, 22 Nov 2023 23:13:52 +0000 (00:13 +0100)]
tools: firmware-utils: Fix PKG_MIRROR_HASH

This fixes the mirror hash to the version of the file uploaded to the
download mirror and which my build calculated.

Fixes: 59a66d3c9b2a ("firmware-utils: update to Git HEAD (2023-11-21)")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 months agomvebu: remove mac-address-increment
Rosen Penev [Sat, 11 Nov 2023 02:52:20 +0000 (18:52 -0800)]
mvebu: remove mac-address-increment

It's deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agomediatek: fiilogic: device tree `switch@1f` fix
Rani Hod [Wed, 22 Nov 2023 17:38:06 +0000 (19:38 +0200)]
mediatek: fiilogic: device tree `switch@1f` fix

Quite a few `fiilogic` devices use the `mt7531` switch.
Some of them have a DT node that looks like:
```
switch: switch@0 {
compatible = "mediatek,mt7531";
reg = <31>;
...
};
```
This commit changes the DT node name to `switch@1f`.

Signed-off-by: Rani Hod <rani.hod@gmail.com>
12 months agoipq806x: add missing interrupt-controller
Rosen Penev [Tue, 14 Nov 2023 03:52:47 +0000 (19:52 -0800)]
ipq806x: add missing interrupt-controller

Fixes dtc warnings

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoipq806x: remove mac-address-increment
Rosen Penev [Sat, 11 Nov 2023 22:59:41 +0000 (14:59 -0800)]
ipq806x: remove mac-address-increment

It's deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agolantiq: remove mac-address-increment
Rosen Penev [Sat, 11 Nov 2023 03:42:31 +0000 (19:42 -0800)]
lantiq: remove mac-address-increment

It's deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agobmips: remove mac-address-increment
Rosen Penev [Sat, 11 Nov 2023 03:33:27 +0000 (19:33 -0800)]
bmips: remove mac-address-increment

It's deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoRevert "mpc85xx: replace user space MAC with nvmem"
Christian Marangi [Tue, 21 Nov 2023 22:57:44 +0000 (23:57 +0100)]
Revert "mpc85xx: replace user space MAC with nvmem"

This reverts commit 931fcf61891f14dffccd0ad5dfdf7d84460ff9f2.

The definition is wrong and require mac-base compatible. Also it's not
clear if it's correct to use 0xc for mac size.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>