openwrt/staging/hauke.git
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>
12 months agompc85xx: replace user space MAC with nvmem
Rosen Penev [Sun, 19 Nov 2023 01:23:48 +0000 (17:23 -0800)]
mpc85xx: replace user space MAC with nvmem

Possible now that NVMEM supports ASCII.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agompc85xx: remove mac-address-increment
Rosen Penev [Sat, 11 Nov 2023 02:57:43 +0000 (18:57 -0800)]
mpc85xx: remove mac-address-increment

It's deprecated

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agompc85xx: fix dtc warning
Rosen Penev [Tue, 14 Nov 2023 01:09:42 +0000 (17:09 -0800)]
mpc85xx: fix dtc warning

States to remove the linux prefix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoocteon: remove mac-address-increment
Rosen Penev [Sat, 11 Nov 2023 02:42:52 +0000 (18:42 -0800)]
octeon: remove mac-address-increment

It's deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agofirmware-utils: update to Git HEAD (2023-11-21)
Rafał Miłecki [Tue, 21 Nov 2023 20:16:42 +0000 (21:16 +0100)]
firmware-utils: update to Git HEAD (2023-11-21)

12bf1a9 lxlfw: support certificate & signature blobs
eaf2ea2 lxlfw: support extracting image
d770cab lxlfw: support embedding blobs
16fa890 lxlfw: fix struct lxl_hdr attribute
8e149e4 lxlfw: move code copying data to helper function
3b114de lxlfw: move code opening LXL to helper function

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
12 months agokernel: drop "mac-address-increment-byte" DT property support
Rafał Miłecki [Wed, 15 Nov 2023 08:04:47 +0000 (09:04 +0100)]
kernel: drop "mac-address-increment-byte" DT property support

This downstream DT property is not used by any DTS file anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
12 months agofirmware-utils: update to Git HEAD (2023-11-21)
Rafał Miłecki [Tue, 21 Nov 2023 15:30:22 +0000 (16:30 +0100)]
firmware-utils: update to Git HEAD (2023-11-21)

1d42292d8063 tplink-safeloader: Add TP-Link Archer A6 V3.20
3338f5389d72 tplink-safeloader: add TL-WPA8635P v3
17ca5eeb1c10 tplink-safeloader: add TL-WPA8631P v4
f730ad2fa0b4 bcmblob: new tool for reading Broadcom's BLOBs
cb1ddac98124 firmware-utils: fix typo in error message when no OpenSSL library found
916633160dc9 bcmclm: new tool for reading Broadcom's CLM data
a2d49fb1e188 tplink-safeloader: add RU support-list entry for Archer C6U v1
bb12cf5c3fa9 tplink-safeloader: Add support for TP-Link Deco M5 The special_id values are the same for EU and Asian models, and they apply to all models: v1, v2, and v3. They are not sorted as they are currently in the same order as extracted from the official firmware image.
9e2de8515be1 tplink-safeloader: add EAP610 v3 and EAP613 v1
a170683c0e11 firmware-utils: fix use of NULL string progname
89875fc18b57 tplink-safeloader: CPE510: add Canadian support
9e211d2980fe mktplinkfw2: add support to extract bootloader images
c18f662f3c74 mktplinkfw2: add support to pack bootloader
3dc133915f87 mktplinkfw2: show exact exceed bytes when the image is to big
d16ff798d58a tplink-safeloader: WPA8631: add v4 AU, US
0fa1cc51013f zytrx: add LTE5398-M904
635466123429 firmware-utils: ptgen: add SiFive GPT partition support
ba5bc4e1ae9d add dlink-sge-image for D-Link devices by SGE
3b114de29cf7 lxlfw: move code opening LXL to helper function
8e149e480391 lxlfw: move code copying data to helper function
16fa89076122 lxlfw: fix struct lxl_hdr attribute
d770cab82e58 lxlfw: support embedding blobs
eaf2ea28dbe6 lxlfw: support extracting image
12bf1a99bd6e lxlfw: support certificate & signature blobs

Fixes: https://github.com/openwrt/openwrt/issues/12939
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
12 months agoumdns: update to Git HEAD (2023-11-21)
Felix Fietkau [Tue, 21 Nov 2023 06:35:48 +0000 (07:35 +0100)]
umdns: update to Git HEAD (2023-11-21)

9040335e102b interface: fix interface memory corruption
b1e023eda358 add udebug support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoudebug: update to Git HEAD (2023-11-20)
Felix Fietkau [Mon, 20 Nov 2023 22:03:48 +0000 (23:03 +0100)]
udebug: update to Git HEAD (2023-11-20)

759d9404034b ring: add missing fread return code check

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agonetifd: update to Git HEAD (2023-11-20), adds udebug support
Felix Fietkau [Mon, 20 Nov 2023 18:16:45 +0000 (19:16 +0100)]
netifd: update to Git HEAD (2023-11-20), adds udebug support

9dcc37a77cb2 add udebug support
525fa911e8ab replace DPRINTF calls with D(...)
7642eaba3838 system-linux: fix bogus debug error messages on adding bridge members
f3e06e81b347 wireless: add bridge_isolate option

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agouboot-envtools: add settings for Synology DS213j
Daniel Golle [Sun, 19 Nov 2023 22:04:02 +0000 (22:04 +0000)]
uboot-envtools: add settings for Synology DS213j

Add settings to be able to access the U-Boot environment on the
Synology DS213j NAS.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 months agomvebu: add support for Synology DS213j
Daniel Golle [Sun, 19 Nov 2023 22:01:47 +0000 (22:01 +0000)]
mvebu: add support for Synology DS213j

The Synology DS213j is a rather dated dual-bay SATA NAS based on on the
Marvell Armada-370 SoC. It has long been supported in vanilla Linux,
however, flash partitioning there didn't match with reality (ie. the
bootloaders expectations) and nobody cared to wrap up OpenWrt support
for the device.

CPU: Marvell Armada-370 ARMv7 SoC @ 1200 MHz
RAM: 512 MB DDR3
Flash: 8 MB (Micron Technology N25Q064)
Network: 1x 1000M/100M/10M Ethernet (Marvell 88E1510)
SATA: 2x 3.0Gbps
USB: 2x USB 2.0

As OS options are becoming limited on that still quite useful hardware,
patch the flash partitions to be able to get the most out of it when
using OpenWrt.

The vendor firmware loads kernel and initrd from fixed addresses in
the flash, not making use of a modifyable environment stored in flash
which is stored at a location right in the middle of the vendor's
zImage partition (at 0x100000).

Stock firmware flash layout:

0x000000 ~ 0x0c0000 : "RedBoot" (actually U-Boot)
0x0c0000 ~ 0x390000 : "zImage"
0x390000 ~ 0x7d0000 : "rd.gz"
0x7d0000 ~ 0x7e0000 : "vendor" (contains MAC address, serial no)
0x7e0000 ~ 0x7f0000 : "RedBoot Config" (unused? legacy left-over)
0x7f0000 ~ 0x800000 : "FIS directory" (unused? legacy left-over)

OpenWrt flash layout:

0x000000 ~ 0x0c0000 : "u-boot"
0x0c0000 ~ 0x100000 : "gap"
0x100000 ~ 0x110000 : "u-boot-env"
0x110000 ~ 0x7d0000 : "kernel"
0x7d0000 ~ 0x7e0000 : "vendor" (contains MAC address, serial no)
0x7e0000 ~ 0x800000 : "gap2"

"kernel", "gap" and "gap2" are concatenated using the mtd-concat
virtual MTD driver, resulting in a partition "firmware" used by
OpenWrt for kernel, rootfs and rootfs-overlay, 0x720000 (7296kiB) in
total.

Installation:
1. Connect to internal serial console port and Ethernet port,
   providing a TFTP server at a static IPv4 address, e.g.
   192.168.1.254/24.
2. Interrupt bootloader using CTRL+C
3. Configure bootloader to load OpenWrt on future boot:
   setenv bootcmd "bootm f4110000"
   saveenv
4. Load and boot initramfs image via TFTP:
   setenv ipaddr 192.168.1.1
   setenv serverip 192.168.1.254
   tftpboot openwrt-mvebu-cortexa9-synology_ds213j-initramfs-kernel.bin
   bootm
5. Use sysupgrade to load final image.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 months agohostapd: add missing acl entries for udebug
Felix Fietkau [Mon, 20 Nov 2023 13:03:43 +0000 (14:03 +0100)]
hostapd: add missing acl entries for udebug

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoubus: update to Git HEAD (2023-11-14)
Felix Fietkau [Mon, 20 Nov 2023 12:56:57 +0000 (13:56 +0100)]
ubus: update to Git HEAD (2023-11-14)

b3e8c4ef07eb Add auto subscribe support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agohostapd: add udebug support
Felix Fietkau [Mon, 13 Nov 2023 16:44:04 +0000 (17:44 +0100)]
hostapd: add udebug support

This is not activated by default and must be explicitly enabled via ubus
It supports reporting log messages and netlink packets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoudebug: add new package
Felix Fietkau [Sun, 12 Nov 2023 20:28:34 +0000 (21:28 +0100)]
udebug: add new package

This will help with debugging by providing system wide access to per-process
ring buffers with debug data.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 months agoramips: D-Link Dxx-1xx0 image fixes
Rani Hod [Sun, 25 Jun 2023 12:31:54 +0000 (15:31 +0300)]
ramips: D-Link Dxx-1xx0 image fixes

Three fixes for D-Link DAP-1620 rev B and its twin D-Link DRA-1360:

1. `uboot-envtools` is removed from default package list.
2. Makefile variable is doubly escaped, i.e. `$$$$(DLINK_HWID)`.
3. Previously the size of `factory.bin` was always 10.5 MiB, same as
D-Link firmwares. This commit makes it possible to use smaller images
(with no lost space due to padding) as well as larger images. Tested
successfully flashing a 6.5 MiB image and a 14.5 MiB image.

Recall that factory images need to be installed via D-Link Web Recovery
(at http://192.168.0.50/, server ignores pings and DHCP requests).

P.S.
I implemented the OEM firmware encryption algorithm, so firmware can be
flashed via OEM firmware, but after successful flashing the device
reboots to web recovery, so further debugging is required.

Signed-off-by: Rani Hod <rani.hod@gmail.com>
12 months agouboot-mediatek: Fix ubi command in uboot commands
Carter Wang [Sat, 18 Nov 2023 13:40:39 +0000 (13:40 +0000)]
uboot-mediatek: Fix ubi command in uboot commands

Fix typo 'ubi remote ...' -> 'ubi remove ...'.

Signed-off-by: Carter Wang <carter.wang@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 months agobase-files: ipcalc.sh: Should take netmask or prefix after slash
Philip Prindeville [Sun, 19 Nov 2023 19:26:15 +0000 (12:26 -0700)]
base-files: ipcalc.sh: Should take netmask or prefix after slash

dnmasq.init now invokes ipcalc.sh as either:

ipcalc.sh address/netmask ...

or:

ipcalc.sh address/prefix

but the existing version doesn't accept the 2nd notation.  We're
trying to rationalize the usage of ipcalc.sh, and here we add
support for the 2nd format.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
12 months agoramips: Add support for TP-Link Archer C50 v6 (CA/EU/RU)
Renaud Gaspard [Sun, 22 Jan 2023 19:41:48 +0000 (20:41 +0100)]
ramips: Add support for TP-Link Archer C50 v6 (CA/EU/RU)

This adds support for the TP-Link Archer C50 v6 (CA/EU/RU).
(The ES variant is a rebranded Archer C54 and NOT supported.)

CPU:   MediaTek MT7628 (580MHz)
RAM:   64M DDR2
FLASH: 8M SPI
WiFi:  2.4GHz 2x2 MT7628 b/g/n integrated
WiFi:  5GHz 2x2 MT7613 a/n/ac
ETH:   1x WAN 4x LAN
LED:   Power, WiFi2, WiFi5, LAN, WAN, WPS
BTN:   WPS/WiFi, RESET
UART:  Near ETH ports, 115200 8n1, TP-Link pinout

Create Factory image
--------------------
As all installation methods require a U-Boot to be integrated into the
image (and we do not ship one with the image). We are not able to create
an image in the OpenWRT build-process.

Download a TP-Link image for your device variant (CA/EU or RU) from their
website and a OpenWRT sysupgrade image for the device
and build yourself a factory image like following:

TP-Link image:             tpl.bin
OpenWRT sysupgrade image:  owrt.bin

 > dd if=tpl.bin of=boot.bin bs=131584 count=1
 > cat owrt.bin >> boot.bin

Installing via Web-UI
---------------------
Upload the boot.bin via TP-Links firmware upgrade tool in the
web-interface.

Installing via Recovery
-----------------------
Activate Web-Recovery by beginning the upgrade Process with a
Firmware-Image from TP-Link. After starting the Firmware Upgrade,
wait ~3 seconds (When update status is switching to 0%), then
disconnect the power supply from the device. Upgrade flag (which
activates Web-Recovery) is written before the OS-image is touched and
removed after write is succesfull, so this procedure should be safe.

Plug the power back in. It will come up in Recovery-Mode on 192.168.0.1.
When active, all LEDs but the WPS LED are off.
Remeber to assign yourself a static IP-address as DHCP is not active in
this mode.

The boot.bin can now be uploaded and flashed using the web-recovery.

Installing via TFTP
-------------------
Prepare an image like following (Filenames from factory image steps
apply here)

 > dd if=/dev/zero of=tp_recovery.bin bs=196608 count=1
 > dd if=tpl.bin of=tmp.bin bs=131584 count=1
 > dd if=tmp.bin of=boot.bin bs=512 skip=1
 > cat boot.bin >> tp_recovery.bin
 > cat owrt.bin >> tp_recovery.bin

Place tp_recovery.bin in root directory of TFTP server and listen on
192.168.0.66/24.

Connect router LAN ports with your computer and power up the router
while pressing the reset button. The router will download the image via
tftp and after ~1 Minute reboot into OpenWRT.

U-Boot CLI
----------
U-Boot CLI can be activated by holding down '4' on bootup.

Dual U-Boot
-----------
This is the first TP-Link MediaTek device to feature a split-uboot
design. The first (factory-uboot) provides recovery via TFTP and HTTP,
jumping straight into the second (firmware-uboot) if no recovery needs
to be performed. The firmware-uboot unpacks and executed the kernel.

Web-Recovery
------------
TP-Link integrated a new Web-Recovery like the one on the Archer C7v4 /
TL-WR1043v5. Stock-firmware sets a flag in the "romfile" partition
before beginning to write and removes it afterwards. If the router boots
with this flag set, bootloader will automatically start Web-recovery and
listens on 192.168.0.1. This way, the vendor-firmware or an OpenWRT
factory image can be written.

By doing the same while performing sysupgrade, we can take advantage of
the Web-recovery in OpenWRT.

It is important to note that Web-Recovery is only based on this flag. It
can't detect e.g. a crashing kernel or other means. Once activated it
won't boot the OS before a recovery action (either via TFTP or HTTP) is
performed. This recovery-mode is indicated by an illuminated WPS-LED on
boot.

Co-authored-by: Julius Schwartzenberg <julius.schwartzenberg@gmail.com>
Signed-off-by: Renaud Gaspard <gaspardrenaud@hotmail.com>
Signed-off-by: Julius Schwartzenberg <julius.schwartzenberg@gmail.com>
Tested-by: Julius Schwartzenberg <julius.schwartzenberg@gmail.com>
Tested-by: Jaroslav Mikulík <byczech@gmail.com>
Tested-by: Ashipa Eko <ashipa.eko@gmail.com>
12 months agoramips: add support for D-Link COVR-X1860 A1
Roland Reinl [Fri, 3 Nov 2023 10:22:02 +0000 (11:22 +0100)]
ramips: add support for D-Link COVR-X1860 A1

The COVR-X1860 are MT7621-based AX1800 devices (similar to DAP-X1860, but
with two Ethernet ports and external power supply) that are sold in sets
of two (COVR-X1862) and three (COVR-X1863).

Specification:
 - MT7621
 - MT7915 + MT7975 2x2 802.11ax (DBDC)
 - 256MB RAM
 - 128 MB flash
 - 3 LEDs (red, orange, white), routed to one indicator in the top of the device
 - 2 buttons (WPS in the back and Reset at the bottom of the device)

MAC addresses:
 - LAN MAC (printed on the device) is stored in config2 partition as ASCII (entry factory_mac=xx:xx:xx:xx:xx:xx)
 - WAN MAC: LAN MAC + 3
 - 2.4G MAC: LAN MAC + 1
 - 5G MAC: LAN MAC + 2

The pins for the serial console are already labeled on the board (VCC, TX, RX, GND). Serial settings: 3.3V, 115200,8n1

Flashing via OEM Web Interface:
 - Download openwrt-ramips-mt7621-dlink_covr-x1860-a1-squashfs-factory.bin via the OEM web interface firmware update
 - The configuration wizard can be skipped by directly going to http://192.168.0.1/UpdateFirmware_Simple.html

Flashing via Recovery Web Interface:
 - Set your IP address to 192.168.0.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the status LED blinks red
 - Open a Chromium based browser and goto http://192.168.0.1
 - Download openwrt-ramips-mt7621-dlink_covr-x1860-a1-squashfs-recovery.bin

Revert back to stock using the Recovery Web Interface:
 - Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the status LED blinks red
 - Open a Chromium based browser and goto http://192.168.0.1
 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.

Decrypting a D-Link firmware image:
 - Download https://github.com/openwrt/firmware-utils/blob/master/src/dlink-sge-image.c and https://raw.githubusercontent.com/openwrt/firmware-utils/master/src/dlink-sge-image.h
 - Compile a binary from the downloaded file, e.g. gcc dlink-sge-image.c -lcrypto -o dlink-sge-image
 - Run ./dlink-sge-image COVR-X1860 <OriginalFirmware> <OutputFile> -d
 - Example for firmware 102b01: ./dlink-sge-image COVR-X1860 COVR-X1860_RevA_Firmware_102b01.bin COVR-X1860_RevA_Firmware_102b01_Decrypted.bin -d

The pull request is based on the discussion in https://forum.openwrt.org/t/add-support-for-d-link-covr-x1860

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
12 months agohostapd: fix undeclared variable iface_name
Nazar Mokrynskyi [Tue, 14 Nov 2023 03:49:28 +0000 (05:49 +0200)]
hostapd: fix undeclared variable iface_name

Signed-off-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>