Commit Graph

56731 Commits

Author SHA1 Message Date
Rafał Miłecki
6e555ac3ad bcm53xx: refactor packet steering init
Replace a standalone init.d script with a platform implementation as
supported by netifd. This avoids a race between netifd and target
specific setups.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-15 14:25:57 +01:00
Rafał Miłecki
601257e388 netifd: refactor packet steering init
1. Move setup code to independent script file
2. Add init.d script to allow automatic updates
3. Support platform specific /usr/libexec/platform/packet-steering.sh

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-15 14:25:38 +01:00
Daniel Golle
f584fb2f7e kernel: import accepted MediaTek Ethernet patches
Import some accepted and pending upstream patches for mtk_eth_soc,
replacing some semantically equivalent local patches and fixing issues
when operating the PCS in 1G SGMII mode.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-15 03:28:09 +00:00
Daniel Golle
80196f4e3c mediatek: mtk_thermal: replace with upstream patch
Replace local patch adding thermal support for MT7986 with version
accepted upstream.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-15 03:28:09 +00:00
Daniel Golle
e8625c89ef treewide: replace /sys/devices/virtual/ubi by /sys/class/ubi
Starting from Linux Kernel version 6.3 UBI devices will no longer be
considered virtual, but rather have an MTD device parent. Hence they
will no longer be listed under /sys/devices/virtual/ubi which is
used in multiple places in OpenWrt. Prepare for future kernels by
using /sys/class/ubi instead of /sys/devuces/virtual/ubi.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-15 03:27:59 +00:00
Daniel Golle
62e583ddb9 fstools: update to git HEAD
12155d3 libfstools: use class interface to iterate over ubi devices

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-15 03:27:35 +00:00
Felix Fietkau
ac4fae2338 ucode: update to the latest version
08c709c58187 rtnl: add support for registering an uloop based listener
599a7fb59380 Merge pull request #140 from nbd168/rtnl
c4125c516e0a nl80211: fix NL80211_ATTR_SURVEY_INFO
c43bb9d8fe8d Merge pull request #141 from dhewg/master
c1342d934b2d nl80211: add missing ucv_get() calls
9022b270683a rtnl: add missing ucv_get() calls
837cffec5a5c Merge pull request #142 from nbd168/ref-fixes
65b1f181e642 rtnl: add missing uc_vm_registry_set call
ab2f3f70257d Merge pull request #143 from nbd168/rtnl-fix

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-14 09:59:16 +01:00
INAGAKI Hiroshi
f490295bf2
ipq807x: add support for Buffalo WXR-5950AX12
Buffalo WXR-5950AX12 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on
IPQ8074A.

Specification:

- SoC         : Qualcomm IPQ8074A
- RAM         : DDR3 1024 MiB (2x Nanya NT5CC256M16ER-EK)
- Flash       : RAW NAND 256 MiB (Winbond W29N02GZBIBA)
- WLAN        : 2.4/5 GHz (IPQ8074A)
- Ethernet    : 5 ports
  - WAN       : 100/1000/2500/10000 Mbps x1 (AQR113C)
  - LAN       : 100/1000/2500/10000 Mbps x1 (AQR113C),
                10/100/1000 Mbps x3 (QCA8075)
- LED/Keys    : 8x/5x
- UART        : pin header on PCB (J7)
  - assignment: 3.3V, GND, TX, RX from disc marking
  - settings  : 115200n8
- Power       : 12 VDC, 4 A

Flash instruction using initramfs image:

1. Prepare TFTP server with IP address 192.168.11.10
2. Rename OpenWrt initramfs image to "WXR-5950AX12-initramfs.uImage and
   place it to TFTP directory
3. Hold AOSS (WPS) button and power on WXR-5950AX12
4. WXR-5950AX12 downloads initramfs image from TFTP server and boots
   with it automatically
5. Upload sysupgrade image to WXR-5950AX12 and perform sysupgrade
6. Wait ~120 seconds to complete flashing

Partition layout:

0x000000000000-0x000000100000 : "0:sbl1"
0x000000100000-0x000000200000 : "0:mibib"
0x000000200000-0x000000280000 : "0:bootconfig"
0x000000280000-0x000000300000 : "0:bootconfig1"
0x000000300000-0x000000600000 : "0:qsee"
0x000000600000-0x000000900000 : "0:qsee_1"
0x000000900000-0x000000980000 : "0:devcfg"
0x000000980000-0x000000a00000 : "0:devcfg_1"
0x000000a00000-0x000000a80000 : "0:apdp"
0x000000a80000-0x000000b00000 : "0:apdp_1"
0x000000b00000-0x000000b80000 : "0:rpm"
0x000000b80000-0x000000c00000 : "0:rpm_1"
0x000000c00000-0x000000c80000 : "0:cdt"
0x000000c80000-0x000000d00000 : "0:cdt_1"
0x000000d00000-0x000000d80000 : "0:appsblenv"
0x000000d80000-0x000000e80000 : "0:appsbl"
0x000000e80000-0x000000f80000 : "0:appsbl_1"
0x000000f80000-0x000001000000 : "0:art"
0x000001000000-0x000001080000 : "0:art_1"
0x000001080000-0x000001100000 : "0:orgdata"
0x000001100000-0x000001180000 : "0:orgdata_1"
0x000001180000-0x000005180000 : "rootfs"
0x000005180000-0x000009180000 : "rootfs_recover"
0x000009180000-0x000010000000 : "user_property"

Notes:

- WXR-5950AX12 has 2x OS images on NAND flash. The 1st image is for
  normal operation and the 2nd one is for recoverying or firmware
  upgrading on stock.

- Stock U-Boot checks MD5 hashes in "fw_hash" volume in each "root*"
  partition when booting. This is just a comparation of hash strings.

  Behaviors:

  - both "fw_hash" volumes exist, hashes are rootfs == rootfs_recover
    ---> boot from rootfs

  - both "fw_hash" volumes exist, hashes are rootfs != rootfs_recover
    ---> boot from rootfs_recover

    Note: this behavior is used for firmware upgrading on stock

  - "fw_hash" volume in rootfs is missing
    ---> boot from rootfs_recover

  - "fw_hash" volume in rootfs_recover is missing
    ---> boot from rootfs

  - "fw_hash" volumes in both root* partition are missing
    ---> boot from rootfs_recover

Reverting to stock firmware:

1. Decrypt official image by buffalo-enc and remove header

   example of decryption:

   $ buffalo-enc -i wxr_5950ax12_jp_305 -o wxr_5950ax12_jp_305.dec \
                 -d -k olaffuB -O 0xc8

   example of removing header (v3.05):

   - before

   $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.dec
   00000000  57 58 52 2d 35 39 35 30  41 58 31 32 5f 33 2e 30  |WXR-5950AX12_3.0|
   00000010  35 5f 31 2e 30 31 5f 4a  50 5f 6a 70 5f 71 63 61  |5_1.01_JP_jp_qca|
   00000020  0a 66 69 6c 65 6c 65 6e  3d 34 35 33 35 30 39 31  |.filelen=4535091|
   00000030  32 0a 55 42 49 23 01 00  00 00 00 00 00 00 00 00  |2.UBI#..........|
   00000040

   - after

   $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.ubi
   00000000  55 42 49 23 01 00 00 00  00 00 00 00 00 00 00 00  |UBI#............|
   00000010  00 00 08 00 00 00 10 00  78 cf c4 91 00 00 00 00  |........x.......|
   00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
   00000030  00 00 00 00 00 00 00 00  00 00 00 00 3d 2a 64 fd  |............=*d.|
   00000040

2. Boot WXR-5950AX12 with OpenWrt initramfs image

3. Upload modified stock image to WXR-5950AX12

4. Find partitions "rootfs" and "rootfs_recover"

   example:

   root@OpenWrt:/# cat /proc/mtd
   dev:    size   erasesize  name
   ...
   mtd22: 04000000 00020000 "rootfs"
   mtd23: 04000000 00020000 "rootfs_recover"
   ...

   in this case, "rootfs" is mtd22 and "rootfs_recover" is mtd23

5. Format "rootfs"/"rootfs_recover" partition with the uploaded image

   example:

   ubiformat /dev/mtd22 -f /tmp/wxr_5950ax12_jp_305.ubi
   ubiformat /dev/mtd23 -f /tmp/wxr_5950ax12_jp_305.ubi

6. Remove "rootfs"/"rootfs_data" volume from user_property partition

   example:

   . /lib/upgrade/nand.sh
   UBI=$(nand_attach_ubi user_property)
   ubirmvol /dev/$UBI -N rootfs
   ubirmvol /dev/$UBI -N rootfs_data

7. Reboot

MAC addresses:

LAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
WAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
2.4 GHz: 50:C4:DD:xx:xx:30 (0:APPSBLENV, wlan0addr (text))
5 GHz  : 50:C4:DD:xx:xx:38 (0:APPSBLENV, wlan1addr (text))

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-12 01:18:39 +01:00
INAGAKI Hiroshi
d256c0bfd7
ipq807x: merge duplicate network configurations in 02_network
Merge network configurations in 02_network of Dynalink DL-WRX36 and
Xiaomi AX9000.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-12 01:18:39 +01:00
INAGAKI Hiroshi
f5d962f9b3
ipq807x: enable regulator-fixed driver
Enable regulator-fixed to define the regulator of USB vbus on Buffalo
WXR-5950AX12.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-12 01:18:35 +01:00
INAGAKI Hiroshi
5163bb5e54 realtek: add support for APRESIA ApresiaLightGS120GT-SS
APRESIA ApresiaLightGS120GT-SS (APLGS120GTSS) is a 16 + 4 ports gigabit
switch, based on RTL8382M.

Specifications:

- SoC          : Realtek RTL8382M
- RAM          : DDR3 256 MiB (Nanya NT5CC256M8JQ-EK)
- Flash        : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G)
- Ethernet     : 10/100/1000 Mbps x16 + 4
  - port  1-8  : RTL8218B
  - port  9-16 : RTL8382M, TP (SoC, RTL8218B)
  - port 17-20 : RTL8214FC, TP/SFP (Combo)
- LEDs/Keys    : 3x/1x
- UART         : through-hole on PCB
  - J6: 3.3V, TX, RX, GND from tri-angle marking side
  - 115200n8
- Power        : 100-120/200-240 VAC, 50/60 Hz
                 Max. 16 W, Avg 14 W (100 VAC)
  - Plug       : IEC 60320-C13

Flash instruction using factory image:

1. Boot ApresiaLightGS120GT-SS normally
2. Login to WebUI and open firmware page ("ファームウェア")
3. If the device is booted from image1, set active image for next
   booting ("起動イメージ選択") to image2("イメージ2"), press apply
   ("適用") button and reboot the device to make booting from image2
4. On the WebUI, set active image to image1
5. Select the OpenWrt factory image and press update button ("更新")
6. Open reboot page ("再起動") and press reboot button ("再起動実行")

Notes:

- "ApresiaLightGS120GT-SS" is a model name and "APLGS120GTSS" is a model
  number

- this device has 3x GPIO-controlled LEDs on PCB, but 1x LED
  ("green:unused") has no hole on the case

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-13 12:22:17 +01:00
INAGAKI Hiroshi
5b33916c0a realtek: add common definition of cameo based firmware
The cameo-related recipes can also be used for APRESIA ApresiaLightGS
series devices. So create common definition for the devices manufactured
by Cameo.
And also, the model name of ApresiaLightGS120GT-SS is too long for cameo
header (max: 20 bytes), so use additional variable "CAMEO_BOARD_MODEL"
in Build/cameo-headers instead of DEVICE_MODEL to use the custom name.
(default of CAMEO_BOARD_MODEL: DEVICE_MODEL)

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-13 12:22:17 +01:00
INAGAKI Hiroshi
d76f0f407b realtek: rename cameo specific names in "Build/*" definitions
This patch renames some Cameo specific definitions for image generation.
The same format is also used on APRESIA ApresiaLightGS series devices, not
D-Link specific.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-13 12:22:17 +01:00
INAGAKI Hiroshi
54c5f33b30 uboot-envtools: add support for APRESIA ApresiaLightGS120GT-SS
This patch adds support for APRESIA ApresiaLightGS120GT-SS to
uboot-envtools.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-13 12:22:17 +01:00
Jan Hoffmann
65b2bcbf5f realtek: fix memory leak in netevent handler
The net_event_work struct is allocated, but only freed in a single case.
Move the allocation to the branch where it is actually needed, and free
it after the work has been done.

Fixes: 03e1d93e07 ("realtek: add driver support for routing offload")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-02-13 12:14:16 +01:00
Felix Fietkau
1352e5da8d kernel: add missing optimization for page pool
Improves performance in combination with threaded NAPI

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-13 11:48:55 +01:00
Felix Fietkau
ec33a6ca2c mac80211: add fixes for receiving A-MSDU packets on mesh interfaces
The standard defines the A-MSDU header length field differently for mesh
compared to other modes. Deal with this accordingly and work around broken
implementations (e.g. ath10k, ath11k).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-13 11:45:43 +01:00
Nick Hainke
9639ef2a5b e2fsprogs: update to 1.47.0
Release notes:
https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-02-13 00:48:25 +01:00
Linhui Liu
2e32b47cf8 toolchain: glibc: Update to glibc 2.37
This updates to glibc to version 2.37.

Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
[Update to current git commit]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-02-13 00:38:22 +01:00
Karl Chan
92276eef70 ramips: add support for ASUS RT-AX54
Specifications:
- Device: ASUS RT-AX54 (AX1800S/HP,AX54HP)
- SoC: MT7621AT
- Flash: 128MB
- RAM: 256MB
- Switch: 1 WAN, 4 LAN (10/100/1000 Mbps)
- WiFi: MT7905 2x2 2.4G + MT7975 2x2 5G
- LEDs: 1x POWER (blue, configurable)
        1x LAN (blue, configurable)
        1x WAN (blue, configurable)
	1x 2.4G (blue, not configurable)
	1x 5G (blue, not configurable)

Flash by U-Boot TFTP method:
- Configure your PC with IP 192.168.1.2
- Set up TFTP server and put the factory.bin image on your PC
- Connect serial port(rate:115200) and turn on AP, then interrupt "U-Boot Boot Menu" by hitting any key
   Select "2. Upgrade firmware"
   Press enter when show "Run firmware after upgrading? (Y/n):"
   Select 0 for TFTP method
   Input U-Boot's IP address: 192.168.1.1
   Input TFTP server's IP address: 192.168.1.2
   Input IP netmask: 255.255.255.0
   Input file name: openwrt-ramips-mt7621-asus_rt-ax1800hp-squashfs-factory.bin
- Restart AP aftre see the log "Firmware upgrade completed!"

Signed-off-by: Karl Chan <exkc@exkc.moe>
2023-02-12 18:27:45 +01:00
Michael Pratt
51982560a9 ath79: bump SPI frequency of Senao qca955x routers
All boards using this DTSI are expected to have
the same 16 MB MX25L12845EMI-10G flash chip,
or a larger one which can also use 40 MHz frequency.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 18:07:31 +01:00
Michael Pratt
5e973dd61f ath79: add eth0 mac and initvals for Engenius EPG5000
Although VLANs are used, the "eth0" device by itself
does not have a valid MAC, so fix that with preinit script.

More initvals added by editing the driver to print switch registers,
after the bootloader sets them but before openwrt changes them.

The register bits needed for the QCA8337 switch
can be read from interrupted boot (tftpboot, bootm)
by adding print lines in the switch driver ar8327.c
before 'qca,ar8327-initvals' is parsed from DTS and written
for example:

  pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 18:07:31 +01:00
Michael Pratt
f545caf001 ath79: convert Engenius EPG5000 radios to nvmem-cells
Use nvmem kernel subsystem to pull radio calibration data
with the devicetree instead of userspace scripts.

Existing blocks for caldata_extract are reordered alphabetically.

MAC address is set using the hotplug script.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 18:07:31 +01:00
Michael Pratt
f9c28222c8 ath79: add support for Senao Engenius ESR1200
FCC ID: A8J-ESR900

Engenius ESR1200 is an indoor wireless router with
a gigabit ethernet switch, dual-band wireless,
internal antenna plates, and a USB 2.0 port

**Specification:**

  - QCA9557 SOC		2.4 GHz, 2x2
  - QCA9882 WLAN	PCIe mini card, 5 GHz, 2x2
  - QCA8337N SW		4 ports LAN, 1 port WAN
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 2x 64 MB RAM
  - UART at J1		populated, RX grounded
  - 6 internal antenna plates (omni-directional)
  - 5 LEDs, 1 button (power, 2G, 5G, WAN, WPS) (reset)

**MAC addresses:**

  Base MAC address labeled as "MAC ADDRESS"
  MAC "wanaddr" is not similar to "ethaddr"

  eth0 *:c8 MAC u-boot-env ethaddr
  phy0 *:c8 MAC u-boot-env ethaddr
  phy1 *:c9 --- u-boot-env ethaddr +1
  WAN  *:66:44  u-boot-env wanaddr

**Serial Access:**

  RX on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin

**Installation:**

  Method 1: Firmware upgrade page

    OEM webpage at 192.168.0.1
    username and password "admin"
    Navigate to Settings (gear icon) --> Tools --> Firmware
    select the factory.bin image
    confirm and wait 3 minutes

  Method 2: TFTP recovery

    Follow TFTP instructions using initramfs.bin
    use sysupgrade.bin to flash using openwrt web interface

**Return to OEM:**

  MTD partitions should be backed up before flashing
  using TFTP to boot openwrt without overwriting flash

  Alternatively, it is possible to edit OEM firmware images
  to flash MTD partitions in openwrt to restore OEM firmware
  by removing the OEM header and writing the rest to "firmware"

**TFTP recovery:**

  Requires serial console, reset button does nothing at boot

  rename initramfs.bin to 'uImageESR1200'
  make available on TFTP server at 192.168.99.8
  power board, interrupt boot by pressing '4' rapidly
  execute tftpboot and bootm

**Note on ETH switch registers**

  Registers must be written to the ethernet switch
  in order to set up the switch's MAC interface.
  U-boot can write the registers on it's own
  which is needed, for example, in a TFTP transfer.

  The register bits from OEM for the QCA8337 switch
  can be read from interrupted boot (tftpboot, bootm)
  by adding print lines in the switch driver ar8327.c
  before 'qca,ar8327-initvals' is parsed from DTS and written.
  for example:

    pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 18:07:31 +01:00
Michael Pratt
96c2119dba ath79: add support for Senao Engenius ESR1750
FCC ID: A8J-ESR1750

Engenius ESR1750 is an indoor wireless router with
a gigabit ethernet switch, dual-band wireless,
internal antenna plates, and a USB 2.0 port

**Specification:**

  - QCA9558 SOC		2.4 GHz, 3x3
  - QCA9880 WLAN	PCIe mini card, 5 GHz, 3x3
  - QCA8337N SW		4 ports LAN, 1 port WAN
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 2x 64 MB RAM
  - UART at J1		populated, RX grounded
  - 6 internal antenna plates (omni-directional)
  - 5 LEDs, 1 button (power, 2G, 5G, WAN, WPS) (reset)

**MAC addresses:**

  Base MAC address labeled as "MAC ADDRESS"
  MAC "wanaddr" is similar to "ethaddr"

  eth0 *:58 MAC u-boot-env ethaddr
  phy0 *:58 MAC u-boot-env ethaddr
  phy1 *:59 --- u-boot-env ethaddr +1
  WAN  *:10:58  u-boot-env wanaddr

**Serial Access:**

  RX on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin

**Installation:**

  Method 1: Firmware upgrade page

    NOTE: ESR1750 might require the factory.bin
      for ESR1200 instead, OEM provides 1 image for both.

    OEM webpage at 192.168.0.1
    username and password "admin"
    Navigate to Settings (gear icon) --> Tools --> Firmware
    select the factory.bin image
    confirm and wait 3 minutes

  Method 2: TFTP recovery

    Follow TFTP instructions using initramfs.bin
    use sysupgrade.bin to flash using openwrt web interface

**Return to OEM:**

  MTD partitions should be backed up before flashing
  using TFTP to boot openwrt without overwriting flash

  Alternatively, it is possible to edit OEM firmware images
  to flash MTD partitions in openwrt to restore OEM firmware
  by removing the OEM header and writing the rest to "firmware"

**TFTP recovery:**

  Requires serial console, reset button does nothing at boot

  rename initramfs.bin to 'uImageESR1200'
  make available on TFTP server at 192.168.99.8
  power board, interrupt boot by pressing '4' rapidly
  execute tftpboot and bootm

**Note on ETH switch registers**

  Registers must be written to the ethernet switch
  in order to set up the switch's MAC interface.
  U-boot can write the registers on it's own
  which is needed, for example, in a TFTP transfer.

  The register bits from OEM for the QCA8337 switch
  can be read from interrupted boot (tftpboot, bootm)
  by adding print lines in the switch driver ar8327.c
  before 'qca,ar8327-initvals' is parsed from DTS and written.
  for example:

    pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 18:07:31 +01:00
Michael Pratt
2f99f7e2d0 ath79: add support for Senao Engenius ESR900
FCC ID: A8J-ESR900

Engenius ESR900 is an indoor wireless router with
a gigabit ethernet switch, dual-band wireless,
internal antenna plates, and a USB 2.0 port

**Specification:**

  - QCA9558 SOC		2.4 GHz, 3x3
  - AR9580 WLAN		PCIe on board, 5 GHz, 3x3
  - AR8327N SW		4 ports LAN, 1 port WAN
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 2x 64 MB RAM
  - UART at J1		populated, RX grounded
  - 6 internal antenna plates (omni-directional)
  - 5 LEDs, 1 button (power, 2G, 5G, WAN, WPS) (reset)

**MAC addresses:**

  Base MAC address labeled as "MAC ADDRESS"
  MAC "wanaddr" is not similar to "ethaddr"

  eth0 *:06 MAC u-boot-env ethaddr
  phy0 *:06 MAC u-boot-env ethaddr
  phy1 *:07 --- u-boot-env ethaddr +1
  WAN  *:6E:81  u-boot-env wanaddr

**Serial Access:**

  RX on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin

**Installation:**

  Method 1: Firmware upgrade page

    OEM webpage at 192.168.0.1
    username and password "admin"
    Navigate to Settings (gear icon) --> Tools --> Firmware
    select the factory.bin image
    confirm and wait 3 minutes

  Method 2: TFTP recovery

    Follow TFTP instructions using initramfs.bin
    use sysupgrade.bin to flash using openwrt web interface

**Return to OEM:**

  MTD partitions should be backed up before flashing
  using TFTP to boot openwrt without overwriting flash

  Alternatively, it is possible to edit OEM firmware images
  to flash MTD partitions in openwrt to restore OEM firmware
  by removing the OEM header and writing the rest to "firmware"

**TFTP recovery:**

  Requires serial console, reset button does nothing at boot

  rename initramfs.bin to 'uImageESR900'
  make available on TFTP server at 192.168.99.8
  power board, interrupt boot by pressing '4' rapidly
  execute tftpboot and bootm

**Note on ETH switch registers**

  Registers must be written to the ethernet switch
  in order to set up the switch's MAC interface.
  U-boot can write the registers on it's own
  which is needed, for example, in a TFTP transfer.

  The register bits from OEM for the AR8327 switch
  can be read from interrupted boot (tftpboot, bootm)
  by adding print lines in the switch driver ar8327.c
  before 'qca,ar8327-initvals' is parsed from DTS and written.
  for example:

    pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 18:07:31 +01:00
Michael Pratt
2742705fa5 ath79: split Engenius EPG5000 DTS to common DTSI
Split the DTS to be used with similar boards made by Senao,
dual-band routers with Atheros / Qualcomm ethernet switch.

Set initvals for the switch in each device's DTS.
Set some common calibration nvmem-cells in DTSI.

While at it, fix MTD partition node names.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 18:07:31 +01:00
Nick Hainke
11591752ac tools/e2fsprogs: update to 1.47.0
Release notes:
https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-02-12 16:45:29 +01:00
Eneas U de Queiroz
ed81acdcc2
toolchain: wrapper.sh: use --rpath-link
Use --rpath-link option instead of --rpath.  The former is used only at
link-time, while the latter is searched at run-time as well.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2023-02-12 10:55:06 -03:00
Eneas U de Queiroz
9a49e257d6
toolchain: wrapper.sh: fix TOOLCHAIN_SYSROOT path
62c1740676 changed the location of the script from $(TOOLCHAIN_DIR)/usr
to $(TOOLCHAIN_DIR), but the TOOLCHAIN_SYSROOT used in wrapper.sh was
still expecting to find the script under usr/bin.

Fixes: 62c1740676 toolchain: fix the sysroot mess by getting...
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2023-02-12 10:55:05 -03:00
Michael Pratt
eeba2a67ca Revert "tools/fakeroot: update to 1.30.1"
This reverts commit 52167feff8.

Fakeroot 1.30.1 broke building on certain hosts (32-bit archs).

As of 2023-01-10, this was apparently fixed in source code,
however, the version is still 1.30.1 (patch release),
so the old binaries are removed from the repository and replaced,
but the source provided by the repository remains the same.

Furthermore, there are some complicated issues blocking
the "testing" release from being bumped to a 1.30.x version.

Considering all of this, it would likely be better for this package
to follow the "testing" release instead of the "unstable" release,
which is still 1.29-1, so revert to that.

Link: https://bugs.debian.org/1023286
Link: https://tracker.debian.org/news/1407613/accepted-fakeroot-1301-11-source-into-unstable/
Link: https://qa.debian.org/excuses.php?package=fakeroot
Link: https://bugs.debian.org/1027803
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-12 01:02:22 +01:00
John Audia
4ae86b3358 openssl: bump to 1.1.1t
Removed upstreamed patch: 010-padlock.patch

Changes between 1.1.1s and 1.1.1t [7 Feb 2023]

  *) Fixed X.400 address type confusion in X.509 GeneralName.

     There is a type confusion vulnerability relating to X.400 address processing
     inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING
     but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This
     vulnerability may allow an attacker who can provide a certificate chain and
     CRL (neither of which need have a valid signature) to pass arbitrary
     pointers to a memcmp call, creating a possible read primitive, subject to
     some constraints. Refer to the advisory for more information. Thanks to
     David Benjamin for discovering this issue. (CVE-2023-0286)

     This issue has been fixed by changing the public header file definition of
     GENERAL_NAME so that x400Address reflects the implementation. It was not
     possible for any existing application to successfully use the existing
     definition; however, if any application references the x400Address field
     (e.g. in dead code), note that the type of this field has changed. There is
     no ABI change.
     [Hugo Landau]

  *) Fixed Use-after-free following BIO_new_NDEF.

     The public API function BIO_new_NDEF is a helper function used for
     streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL
     to support the SMIME, CMS and PKCS7 streaming capabilities, but may also
     be called directly by end user applications.

     The function receives a BIO from the caller, prepends a new BIO_f_asn1
     filter BIO onto the front of it to form a BIO chain, and then returns
     the new head of the BIO chain to the caller. Under certain conditions,
     for example if a CMS recipient public key is invalid, the new filter BIO
     is freed and the function returns a NULL result indicating a failure.
     However, in this case, the BIO chain is not properly cleaned up and the
     BIO passed by the caller still retains internal pointers to the previously
     freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO
     then a use-after-free will occur. This will most likely result in a crash.
     (CVE-2023-0215)
     [Viktor Dukhovni, Matt Caswell]

  *) Fixed Double free after calling PEM_read_bio_ex.

     The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and
     decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload
     data. If the function succeeds then the "name_out", "header" and "data"
     arguments are populated with pointers to buffers containing the relevant
     decoded data. The caller is responsible for freeing those buffers. It is
     possible to construct a PEM file that results in 0 bytes of payload data.
     In this case PEM_read_bio_ex() will return a failure code but will populate
     the header argument with a pointer to a buffer that has already been freed.
     If the caller also frees this buffer then a double free will occur. This
     will most likely lead to a crash.

     The functions PEM_read_bio() and PEM_read() are simple wrappers around
     PEM_read_bio_ex() and therefore these functions are also directly affected.

     These functions are also called indirectly by a number of other OpenSSL
     functions including PEM_X509_INFO_read_bio_ex() and
     SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL
     internal uses of these functions are not vulnerable because the caller does
     not free the header argument if PEM_read_bio_ex() returns a failure code.
     (CVE-2022-4450)
     [Kurt Roeckx, Matt Caswell]

  *) Fixed Timing Oracle in RSA Decryption.

     A timing based side channel exists in the OpenSSL RSA Decryption
     implementation which could be sufficient to recover a plaintext across
     a network in a Bleichenbacher style attack. To achieve a successful
     decryption an attacker would have to be able to send a very large number
     of trial messages for decryption. The vulnerability affects all RSA padding
     modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.
     (CVE-2022-4304)
     [Dmitry Belyavsky, Hubert Kario]

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-02-12 00:08:29 +01:00
John Audia
3c0676911b kernel: bump 5.15 to 5.15.93
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-02-11 23:39:30 +01:00
Oleg S
b174de2c5f mediatek: mt7622: fix rootfs/ubi detection for Xiaomi AX6S
By specifying the flag "denx,fit" for partition "kernel", the kernel
try to find rootfs in the same partition during boot. Reality is that
the placement of rootfs is precisely determined by the name of another
partition -"ubi".
It was also found that on some device (for example devices with NAND
chips), the "Denx search engine" manages to find roots at the end of
partition "kernel", but such partition doesn't exist and is empty
there.

Fix this by removing the "denx,fit" flag from partition "kernel". With
this change the original behavior of searchif rootfs in partition "ubi"
is restored.

Signed-off-by: Oleg S <remittor@gmail.com>
2023-02-11 21:42:06 +08:00
Xu Yiming
1a145ccb0a
kernel: kmod-fs-ntfs3: fix typo
Fix typo that mistaken the description of ntfs3 for fuse.

Signed-off-by: Xu Yiming <xuyiming.open@outlook.com>
2023-02-09 03:16:51 +01:00
Felix Baumann
e8096de9a2
realtek: fix dts whitespace
Remove whitespace from otherwise empty lines

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:52 +01:00
Felix Baumann
d87482a8db
ramips: fix dts whitespace
Replace blanks with tabs
Remove whitespace from otherwise empty lines

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:52 +01:00
Felix Baumann
d88e2aa794
mediatek: fix dts whitespace
Replace blanks with tabs

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:52 +01:00
Felix Baumann
fc4bf73d39
kirkwood: fix dts whitespace
Replace blanks with tabs

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:51 +01:00
Felix Baumann
abdb9f327e
ipq807x: fix dts whitespace
Replace blanks with tabs

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:51 +01:00
Felix Baumann
505cf10e83
ipq806x: fix dts whitespace
Replace blanks with tabs

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:51 +01:00
Felix Baumann
836b994132
bcm63xx: fix dts whitespace
Remove whitespace from otherwise empty lines

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:50 +01:00
Felix Baumann
d0c64ae695
ath79: fix dts whitespace
Replace blanks with tabs
Remove whitespace from otherwise empty lines

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:50 +01:00
Felix Baumann
7fd28f2e3a
ipq40xx: fix dts whitespace
Remove whitespace from otherwise empty lines

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:47 +01:00
Rosen Penev
786c4099b4
tools/cmake: remove rpath ldflag
no longer needed because of tools/zstd

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-09 02:53:36 +01:00
Rosen Penev
e704a2b57b
tools/zstd: build libraries as static
Enables to get rid of rpath hack for all users.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-09 02:53:36 +01:00
Andre Heider
ad564cb019
toolchain/gcc: clean up CFLAGS
Instead of having two different ways to pass flags to the gcc build
process, add them as configure args, which is a reliable way to let
gcc pass them around to its various pieces.

Also add CXXFLAGS, since gcc started to use c++ for itself recently
(~10 years ago now).

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-02-09 02:53:35 +01:00
Andre Heider
4b8b89da50
toolchain/gcc: use explicit configure args
Spell out what we want to enable or disable. This prevents host libs to leak in,
so everyone get the same feature set.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-02-09 02:53:35 +01:00
Andre Heider
dd39f760b7
toolchain/binutils: use explicit configure args
Spell out what we want to enable or disable. This prevents host libs to leak in,
so everyone get the same feature set.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-02-09 02:53:31 +01:00
Robert Marko
721206a1b1 kernel: set default values for ARM low level debugging symbols
Set default values for KERNEL_DEBUG_LL and KERNEL_DEBUG_LL_UART_NONE again
as both of these symbols are non visible if KERNEL_EARLY_PRINTK is not
selected and KConfig wont write their value to .config.

This usually is the intended behaviour, but in OpenWrt we are relying on
the KConfig to set these and disable the debug console settings that
multiple targets like mvebu have set in their kernel config.
This was the behaviour before removing all of the "default n" settings
as KConfig by default considers symbols disabled but they are not visible
anymore and thus their value is not set in .config and build system then
later does not override the values from target kernel config.

So, to restore the behaviour to the previous one lets a default value for
KERNEL_DEBUG_LL and KERNEL_DEBUG_LL_UART_NONE.

Fixes: 8bc72ea7be ("treewide: strip useless default n Kconfig lines")
Tested-by: Georgi Valkov <gvalkov@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-02-08 16:21:05 +01:00