Compare commits

..

128 Commits

Author SHA1 Message Date
Hauke Mehrtens
4f7e6e554b OpenWrt v24.10.5: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-18 21:39:34 +01:00
Markus Petri
d9c5716d1d vrx518_tc: fix rx_len_adj
Fix rx_len_adj to avoid leaking the ethernet FCS into the actual frame
data in single line mode (the default)

Fixes: https://github.com/openwrt/openwrt/issues/20983
Signed-off-by: Markus Petri <devel@isjunk.org>
Link: https://github.com/openwrt/openwrt/pull/21045
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 487178f8b0)
2025-12-17 22:08:22 +01:00
Hauke Mehrtens
e382fc552a wireless-regdb: Update to version 2025.10.07
e51d568 wireless-regdb: update regulatory rules for Botswana (BW) for 2022
5afc632 wireless-regdb: update regulatory rules for Sint Marteen (SX) for 2018
b484a31 wireless-regdb: Update regulatory info including bandwidth for Costa Rica (CR) for 2023
39e5e04 wireless-regdb: Permit lower 6 GHz band for Kazakhstan (KZ)
a827d3a wireless-regdb: update regulatory database based on preceding changes

Link: https://github.com/openwrt/openwrt/pull/20544
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b4a8ba2e88)
2025-12-17 22:08:20 +01:00
Hauke Mehrtens
0f52a05723 dropbear: backport security fixes
This fixes the following security problems:
CVE-2025-14282: Avoid privilege escalation via unix stream forwarding in Dropbear server.
CVE-2019-6111: This allowed a malicious server to overwrite arbitrary local files.

This backports two upstream merged PRs:
https://github.com/mkj/dropbear/pull/391
https://github.com/mkj/dropbear/pull/394
and this upstream commit:
48a17cff6a

Link: https://github.com/openwrt/openwrt/pull/21192
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-17 21:19:28 +01:00
Martin Nadvornik
58a0211f82 mediatek: fix IPv4 address missing on interface in failsafe mode for cudy ap3000-v1
cudy ap3000-v1 did not work correctly in failsafe mode
because the address 192.168.1.1 was missing on the eth0 inteface.
it was reachable via it's IPv6 link-local address however.
this commit fixes the issue.

Fixes: https://github.com/openwrt/openwrt/issues/20750
Signed-off-by: Martin Nadvornik <martin.nadvornik@gmx.at>
Link: https://github.com/openwrt/openwrt/pull/21172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e5cd6461c9)
2025-12-16 00:29:58 +01:00
Thibaut VARÈNE
7aa929881e mediatek/filogic: fix Cudy WR3000H ethernet port order
The ports are physically labelled in reverse order on the device.
This patch aligns logical names with physical ones.
LED order on front of device is correct after this patch.

Fixes: 9d66b8b312
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/20528
(cherry picked from commit 887cab883b)
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/21173
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-16 00:11:44 +01:00
Hauke Mehrtens
b8d232d9dc kernel: Fix boot of realtek rtl838x
Revert two patches from upstream Linux:
135713cd07
231ac951fa

This fixes a boot hang on realtek rtl838x switches.
This is the last printed message:
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)

Thread on mips mailing list:
https://lore.kernel.org/linux-mips/b35fe4b3-8f42-49f4-a6bf-9f0e56d4050c@hauke-m.de/T/#u

Link: https://github.com/openwrt/openwrt/pull/21166
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-16 00:08:38 +01:00
Petr Štetiar
3c97c4a44c dropbear: enable configurable port forwarding options
Currently its only possible to disable port forwarding only for specific
keys, via the OpenSSH-style restriction in `authorized_keys` file.

In some use cases it might be feasible to disable such features globally
on service level, so lets add new LocalPortForward and RemotePortForward
config knobs.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Link: https://github.com/openwrt/openwrt/pull/21071
(cherry picked from commit 83f6177dbf)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-12-15 19:25:58 +01:00
Ayra Hikari
30b7a5f27a mediatek/filogic: fix Totolink X6000R sysupgrade failed
Fix Totolink X6000R image failing to upgrade via sysupgrade due to an
incorrect upgrade case. The fallback upgrade path used the NAND upgrade
routine, which caused the "layout volume not found" error on NOR flash
devices. By adding a specific case for this board, sysupgrade now uses
`default_do_upgrade`, which is compatible with the NOR flash layout.

Fixes: 7cd10ad
Signed-off-by: Ayra Hikari <ayrahikari@linuxmail.org>
(cherry picked from commit 7cd10add2d)
Link: https://github.com/openwrt/openwrt/pull/20674
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-14 22:51:17 +01:00
Ari Kurniawan
8db7b6ff53 mediatek: filogic: add support for Totolink X6000R
Specification :
- SOC : Mediatek MT7981B (1.3GHz)
- RAM : 256MB
- Flash : 16MB SPI NOR
- Ports : 4 LAN (1G) & 1 WAN (1G)
- WIFI : MediaTek dual-band WiFi 6
  - 2.4 GHz : b/g/n/ax, MIMO 2x2
  - 5 GHz   : a/n/ac/ax, MIMO 2x2
- Buttons : Reset & WPS/Mesh
- LEDS : WAN (Green), Status (Red & Blue)
- Power : 12V1A

Install via OEM web ui:
Upload the sysupgrade image to firmware upgrade page on OEM web ui

Install via recovery / revert to stock firmware:
1. Unplug from power
2. Download the Sysupgrade (for openwrt installation) or OEM Factory image (for revert to stock firmware)
3. Set your computer ethernet IP to 192.168.1.X, subnet 255.255.255.0 (X=your chosen ip number ranging from 2-254)
4. Press and hold reset button while turn on / plug power adapter to the router. Wait untill ALL LAN green LED turn on, then release the reset button.
5. Plug the LAN cable from your computer into LAN 1 port then open web browser, and type in the address column : 192.168.1.1
6. Upload the sysupgrade / oem factory image
7. Wait until the router finished flashing (the router will reboot)
8. Set ethernet ip to dhcp
9. Open 192.168.1.1 (for openwrt install) / 192.168.0.1 (for OEM firmware)

Signed-off-by: Ari Kurniawan <noobhek@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20035
(cherry picked from commit 7cd10add2d)
Signed-off-by: Ari Kurniawan <noobhek@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20674
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-14 22:51:01 +01:00
Hauke Mehrtens
454fd69589 mac80211: update to version 6.12.61
This contains the following commits:
```
git log --oneline   v6.12.52...v6.12.61 -- drivers/net/wireless/ net/mac80211/ net/wireless/
a1eb56723b32 wifi: ath12k: correctly handle mcast packets for clients
c0a9c2c1b7b9 wifi: mac80211: use wiphy_hrtimer_work for csa.switch_work
d4caee32a9f8 wifi: cfg80211: add an hrtimer based delayed work item
6455948c8aab wifi: mac80211: reject address change while connecting
80dc5a2ce5b7 wifi: ath11k: Clear affinity hint before calling ath11k_pcic_free_irq() in error path
acd24d509227 wifi: mac80211: skip rate verification for not captured PSDUs
53cf801b8555 wifi: ath11k: zero init info->status in wmi_process_mgmt_tx_comp()
e8fa86b0bd96 wifi: mac80211_hwsim: Limit destroy_on_close radio removal to netgroup
77d4afd6c78b Revert "wifi: ath10k: avoid unnecessary wait for service ready message"
07d862c7de3d wifi: ath12k: Increase DP_REO_CMD_RING_SIZE to 256
522734fc807c wifi: mac80211: Track NAN interface start/stop
8db790c2491e wifi: ath10k: Fix connection after GTK rekeying
72f1984246e6 wifi: rtw89: renew a completion for each H2C command waiting C2H event
336da4414300 wifi: rtw89: obtain RX path from ppdu status IE00
da91687f01f4 wifi: mt76: mt7996: fix memory leak on mt7996_mcu_sta_key_tlv error
a534dd44b70e wifi: mt76: mt76_eeprom_override to int
aa5ed215cfe8 wifi: mt76: mt7996: Temporarily disable EPCS
efe2ef24feab wifi: mt76: mt7921: Add 160MHz beamformee capability for mt7922 device
5de410dfb4d9 wifi: mac80211: Fix HE capabilities element check
f157d1cb2cdc wifi: iwlwifi: fw: Add ASUS to PPAG and TAS list
c9df78e84e85 wifi: mac80211: Fix 6 GHz Band capabilities element advertisement in lower bands
958234997dd5 wifi: rtw89: fix BSSID comparison for non-transmitted BSSID
ca18975c4de2 wifi: rtw89: wow: remove notify during WoWLAN net-detect
bc1ca06998c1 wifi: rtw88: sdio: use indirect IO for device registers before power-on
8ebef59d0294 wifi: rtw89: print just once for unknown C2H events
5596a90c8952 wifi: mac80211: fix key tailroom accounting leak
23b8682f05ec wifi: mac80211: don't mark keys for inactive links as uploaded
e3373f10c6a6 wifi: ath11k: avoid bit operation on key flags
50f50dd024b4 wifi: ath11k: add support for MU EDCA
2a6cd5951ba8 wifi: ath12k: free skb during idr cleanup callback
775e37df2acc wifi: ath11k: Add missing platform IDs for quirk table
c4840991ee4c wifi: ath10k: Fix memory leak on unsupported WMI command
a6eed58249e7 wifi: brcmfmac: fix crash while sending Action Frames in standalone AP Mode
57100b87c778 wifi: ath12k: fix read pointer after free in ath12k_mac_assign_vif_to_vdev()
4a63523d3541 wifi: cfg80211: Add missing lock in cfg80211_check_and_end_cac()
e9fd43b799d2 wifi: rtw89: avoid possible TX wait initialization race
b419093e5e42 wifi: mt76: mt7921u: Add VID/PID for Netgear A7500
feb1774aaf85 wifi: mt76: mt7925u: Add VID/PID for Netgear A9000
bd3ac455a88d wifi: ath11k: HAL SRNG: don't deinitialize and re-initialize again
8055133a9f64 wifi: rtw89: avoid circular locking dependency in ser_state_run()
1c873416758f wifi: mac80211: fix Rx packet handling when pubsta information is not available
6e7d9fa61d7d wifi: ath10k: avoid unnecessary wait for service ready message
8d4f6ab4c53e wifi: ath12k: fix wrong logging ID used for CE
fc00890c55e3 wifi: mt76: mt7915: fix mt7981 pre-calibration
e18c4e6ba36c wifi: mt76: mt7996: Convert mt7996_wed_rro_addr to LE
f481404a9826 wifi: mt76: mt7996: Fix RX packets configuration for primary WED device
57519239c76c wifi: mt76: fix potential memory leak in mt76_wmac_probe()
27c8e2e4b56f wifi: iwlwifi: Remove redundant header files
605402433eb8 wifi: mwifiex: send world regulatory domain to driver
```

The removed patch was added upstream.

Link: https://github.com/openwrt/openwrt/pull/21134
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-14 22:41:16 +01:00
Florian Maurer
f415748ba8 ath11k: fix transmit queue flushing through flush_sta implementation
warning print "ath11k c000000.wifi: failed to flush transmit queue 0"
is observed during busy times.

The mac80211 fallback implementation of `flush_sta` does not handle the per STA queues well.
This is fixed by providing a ath11k specific implementation of flush_sta telling the firmware to flush a given station.
The draining of the transmit queues should therefore stop correctly, even if new packets arrive in the mean time.

An upstream ath11k RFC is available at:
https://patchwork.kernel.org/project/linux-wireless/patch/GV1P250MB14333A5BF24623C4753A10E1E8E0A@GV1P250MB1433.EURP250.PROD.OUTLOOK.COM/

The patch was tested on a Xiaomi AX3600.

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
Tested-by: Florian Maurer  <f.maurer@outlook.de>
Co-authored-by: Benjamin Berg <benjamin@sipsolutions.net>
Tested-by: Flole <flole@flole.de>
Link: https://github.com/openwrt/openwrt/pull/20293
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8faa9dedb4)
Signed-off-by: Felix Baumann <felix.bau@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/20667
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-12 01:32:26 +01:00
Shine
9123a0c358 mpc85xx: p1010: Use zImage loader for Watchguard Firebox T10
Since kernel 6.1, the Watchguard Firebox T10 can't boot anymore due to
increased kernel size.

This commit introduces the zImage loader from 7d768a9 to boot the kernel.
This is required, since the U-Boot version used in this device appears
to have a hard limit of 16MB for the kernel size it can handle. The
current kernel size is around 17MB, though, due to kernel page alignment
required for memory protection.

(cherry-picked from commit be7aa5bda4)
Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21130
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-12 01:25:50 +01:00
Marcin Leksmark
22391baf99 ramips: fix support for Cudy r700
This PR fixes support for Cudy r700.

Original PR: https://github.com/openwrt/openwrt/pull/18532
Fixed:

- WAN port functionality;
- RESET button;
- Status LED;
- LAN port names consistent with the chassis;
- Merged partitions "debug", "backup" & "firmware"  to one partition "firmware" ("debug" & "backup" contained unimportant data);
- Removed redundant DTS elements.

Installation:

To install OpenWRT, you need the intermediate firmware from Cudy. (U-boot is locked). After installing the intermediate firmware, you can install OpenWRT via sysupgrade.

Recovery:

TFTP available.
1. Place the recovery.bin in the serving directory of your TFTP server.
2. Set your IP to 192.168.1.88/24.
3. Press the “Reset” button of Cudy router and hold it. Before the Cudy router is powered on and before TFTP start to download the firmware, don't release the “Reset” button.
4. Power on the Cudy router.
5. You can release the reset button only when TFTP starts downloading firmware.
6. When the SYSTEM LED turns solid green, the upgrade is complete.

Fixes: 75403dd1d0 ("ramips: add support for Cudy R700")
Link: https://github.com/openwrt/openwrt/pull/20756
(cherry picked from commit 35a86267e9)
Signed-off-by: Marcin Leksmark <lexmark3200@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/21068
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-12 01:23:49 +01:00
David DeGraw
4a3409f628 ramips: add support for Cudy R700
This is the same hardware as the Cudy WR2100 that's
had support for some time now, just without the WLAN
hardware.

This PR is mostly copied from the commit that added
support for the WR2100, here: 3501db9

Specifications:
SoC: MT7621
CPU: 880 MHz
Flash: 16 MiB
RAM: 128 MiB
Ethernet: 5x Gbit ports

Installation:
There are two known options:

The Luci-based UI.
Press and hold the reset button during power up.
The router will request 'recovery.bin' from a TFTP server at
192.168.1.88.

Both options require a signed firmware binary.
A signed firmware can be found in GitHub PR #18532.

R4 & R5 need to be shorted (0-100Ω) for the UART to work.

Link: https://github.com/openwrt/openwrt/pull/18532

Signed-off-by: David DeGraw <degraw@fastmail.com>
(cherry picked from commit 75403dd1d0)
Link: https://github.com/openwrt/openwrt/pull/21068
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-12 01:23:46 +01:00
Marcin Leksmark
a9858a9632 ramips: add support for Cudy C200P
This patch adds support for Cudy C200P.
Because v24.10 stable has no regulator definition, so we cannot make simple cherry-pick. We need another DTS file.

Specifications:

    SoC: MediaTek MT7621AT
    RAM: 256 MB (DDR3)
    Flash: 16 MB (NOR)
    POE Chip: IP804AR

Interfaces:

    Switch: 1 WAN, 4 LAN (Gigabit)
    Gigabit RJ45 PoE Ports on 2~5
    Max Power on a Single PoE Ports 	30W
    PoE Ports : The PoE ports comply with IEEE 802.3at/af standards.
    Ports: 1 USB-A 3.0 Ports

LED:

    System
    PoE Max Status
    Link/ACT/PoE Status of Each PoE Port

Physical Buttons:

 	Reset Button

Power Input:

 	DC Jack

Power Methods:

    DC: 54V 1.11A
    802.3at/af PoE
    Passive PoE: 24/48V

Max Power Consumption (W):

 	Total: 60W
    PoE: 55W
    PoE (when USB Device is plugged in): 50W
    No PoE: 5W

Installation:

To install OpenWRT, you need the intermediate firmware from Cudy. (U-boot is locked). After installing the intermediate firmware, you can install OpenWRT via sysupgrade.

Recovery:

TFTP available.
1. Place the recovery.bin in the serving directory of your TFTP server.
2. Set your IP to 192.168.1.88/24.
3. Press the “Reset” button of Cudy router and hold it. Before the Cudy router is powered on and before TFTP start to download the firmware, don't release the “Reset” button.
4. Power on the Cudy router.
5. You can release the reset button only when TFTP starts downloading firmware.
6. When the SYSTEM LED turns solid green, the upgrade is complete.

Serial:

1. Serial connection parameters: 115200 / 8N1
2. Serial connection voltage: 3.3V

PoE is not supported at the time of PR. The IP804R chip is not yet supported by OpenWRT.

Signed-off-by: Marcin Leksmark <lexmark3200@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/21064
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-12 01:12:14 +01:00
Coia Prant
61408bb99a ramips: add support for Hongdian H8850 v20
This is an industrial 4G router equipped with OpenWrt SNAPSHOT OEM
customized version

WARNING: The original firmware device tree is modified from evb
boards, and the device tree name is evb board. This submitted device
tree is a modified version, which deletes the non-this-device parts
and adds GPIO watchdog.

Specification:
- SoC: MediaTek MT7628DAN
- Flash: 16 MB
- RAM: 64 MB
- Power: DC 5V-36V 1.5A
- Ethernet: 1x WAN/LAN, 3x LAN (10/100 Mbps)
- Wireless radio: 802.11n 2.4g-only
- LED:
  System/Power (PWR): Always Off
  Modem (NET): GPIO/3 active-low
  LAN: Always On
  RF (Modem Signal): GPIO/2 active-low
  WIFI: GPIO/44 active-low
- Button:
  WPS / RESET: GPIO/11 active-low
- UART: 1x UART on PCB - 115200 8N1
- GPIO Watchdog: GPIO/0 mode=toggle timeout=1s
- Modem: 1x Built-in modem on board (Power: GPIO/4 active-high)
- SIM Slots: 1x SIM Slots

Issue:
- Factory partition not store mac address on original firmware

Flash instruction:
Using TTL:
1. Connect the board to the computer via TTL.
2. Enter original firmware failsafe mode.
3. Use wget download firmware to board /tmp
4. Use command "mtd -r write openwrt-ramips-mt76x8-hongdian_h8850-v20-squashfs-sysupgrade.bin firmware"
   to flash

Original Firmware Dump / More details:
https://blog.gov.cooking/archives/research-hongdian-h8850-v20-and-flash.html

Signed-off-by: Coia Prant <coiaprant@gmail.com>
Tested-by: Coia Prant <coiaprant@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20259
(cherry picked from commit 23a070dfb1)
Link: https://github.com/openwrt/openwrt/pull/21007
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-12 01:07:50 +01:00
Mikhail Zadorozhnyi
ce660d934f mvebu: gl-mv1000: fix sdhci1 controller
GL-MV1000 external SD controller was broken by a recent kernel update
between OpenWRT releases 24.10.2 and 24.10.3 due to a mistake in Device
Tree: "regulator-gpio" was defined without required "gpios" property.

Since "no-1-8-v" property is also defined for this controller
a switchable vqmmc-supply regulator performs no function - a fixed 3.3V
IO voltage will always be used.

This regulator definition was probably added by mistake from a Device
Tree from another device.

Remove incomplete vcc_sd_reg1 regulator definition to fix this issue.

Issue discussion for reference: openwrt/openwrt#20309

Upstream commit: 6f2325b23d
Signed-off-by: Mikhail Zadorozhnyi <zador.blood.stained+git@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/20378
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-12 01:04:07 +01:00
Brian Lee
237b1c29e1 mediatek: filogic: add support for ASUS TUF-AX4200Q
ASUS TUF-AX4200Q(TUF 小旋风Pro WiFi6 AX4200) is a home router that adds an additional 2.5G Ethernet port to ASUS TUF-AX4200.

Hardware
- - - - - - - -
- SOC   : MediaTek MT7986
- RAM   : 512MB DDR3
- FLASH : 256MB SPI-NAND (Winbond W25N02KV)
- WIFI  : Mediatek MT7986 DBDC 802.11ax 2.4/5 GHz
- ETH   : MediaTek MT7531 Switch
          MaxLinear GPY211C 2.5 N-Base-T PHY (WAN)
          MaxLinear GPY211C 2.5 N-Base-T PHY (LAN)
- UART  : 3V3 115200 8N1 (Pinout silkscreened / Do not ocnnect VCC)

Installation
- - - - - - - -
Vendor-UI Method:

1. Download or make the OpenWrt initramfs.trx image
2. Connect the PC via LAN to one of the yellow router ports and wait until your PC to get a DHCP lease.
3. Browse to http://192.168.50.1/
4. If your router is brand new, finish the setup process and log into the Web-UI.
5. Navigate to Administration -> Firmware Upgrade and upload the downloaded OpenWrt image.
6. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device using SCP and install using sysupgrade.

   $ sysupgrade -n <path-to-sysupgrade.bin>

TFTP Method:

1. Download the OpenWrt initramfs image.
   Copy the image to a TFTP server reachable at 192.168.1.70/24.
   Rename the image to tufax4200q.bin.

2. Connect the PC with TFTP server to the TUF-AX4200Q.
   Set a static ip on the ethernet interface of your PC.
   (IP address: 192.168.1.70, subnet mask: 255.255.255.0)
   Connect to the serial console,
   interrupt the autoboot process by pressing '4' when prompted.

3. Download & Boot the OpenWrt initramfs image.

   $ setenv ipaddr 192.168.1.1
   $ setenv serverip 192.168.1.70
   $ tftpboot 0x46000000 tufax4200q.bin
   $ bootm 0x46000000

4. Wait for OpenWrt to boot.
   Transfer the sysupgrade image to the device using SCP and install using sysupgrade.

   $ sysupgrade -n <path-to-sysupgrade.bin>

(based on support for ASUS RT-AX52 by achterin and trx image generation by remittor)

Link: https://github.com/openwrt/openwrt/pull/20900
(cherry picked from commit e7086d7a2f)
Signed-off-by: Brian Lee <larte332@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21036
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 23:36:58 +01:00
Oliver Sedlbauer
8498118893 mac80211: ath12k: backport correctly handle mcast packets
Backport upstream commit that fixes handling of multicast packets.
Without this patch, ARP resolution fails, and connectivity from a
station to an AP does not work reliably until traffic is initiated
by the AP.

Signed-off-by: Oliver Sedlbauer <os@dev.tdt.de>
Link: https://github.com/openwrt/openwrt/pull/21088
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 23:11:18 +01:00
Marcin Leksmark
6a92e68c51 ramips: add support for D-Link DIR-2660 A2
This patch adds support for D-Link DIR-2660 A2.
Based on the commit: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=b5dd746cbb1aaf91f4b68e9f3eda97413550d904,

Both devices look identical, except for the A1/A2 designation.
You can safely install the A1 firmware for the A2 – I've been testing it for several months as a DUMB AP – without any problems.

Specifications:
* SoC: MediaTek MT7621AT
* RAM: 256 MB (DDR3)
* Flash: 128 MB (NAND)
* WiFi: MediaTek MT7615N (x2)
* Switch: 1 WAN, 4 LAN (Gigabit)
* Ports: 1 USB 2.0, 1 USB 3.0
* Buttons: Reset, WPS
* LEDs: Power (white/orange), Internet (white/orange), WiFi 2.4G (white),
        WiFi 5G (white), USB 3.0 (white), USB 2.0 (white)

Notes:
* WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips

Installation:
* D-Link Recovery GUI: power down the router, press and hold the reset
  button, then re-plug it. Keep the reset button pressed until the power
  LED starts flashing orange, manually assign a static IP address under
  the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1

* Some modern browsers may have problems flashing via the Recovery GUI,
  if that occurs consider uploading the firmware through cURL:

    curl -v -i -F "firmware=@file.bin" 192.168.0.1

Signed-off-by: Marcin Leksmark <lexmark3200@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20020
(cherry picked from commit 485f9b0d31)
Link: https://github.com/openwrt/openwrt/pull/21113
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 23:03:33 +01:00
Goetz Goerisch
581050ce4e kernel: bump 6.6 to 6.6.119
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.119

Removed upstreamed patch:
bcm27xx/patches-6.6/950-1255-Revert-Bluetooth-Always-request-for-user-confirmatio.patch [1]

All other patches auto-refreshed.

Upstream patch:
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.119&id=fd6a1261d05d7f4d6630229e1f280dd7256b9ce8

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21076
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 22:11:28 +01:00
Andreas Gnau
c0b10f7442 build: depend on tools/zstd for download
Downloading packages from git requires zstd to compress their tarballs.
Make sure that zstd from host tools is compiled when running make
download. Otherwise, either the download would fail because zstd is not
present or a random version from the host would be used leading to hash
mismatches.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/21125
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit f3e4620f59)
2025-12-10 19:09:01 +01:00
Tianling Shen
9fa8e7e9a3 mediatek: fix ubi size for zbtlink zbt z8102ax v2
According to the factory uboot and firmware[1], the ubi size is set
to 512 MiB (0x20000000) and it exceeds the size of the flash, after
that the uboot and kernel resizes it to 114.5 MiB (0x7280000) instead
of 114.125 MiB (0x7220000). The mismatch of the ubi size causes
kernel fails to read ubi volumes and throws panic.

Trim whitespaces while at it.

1. https://github.com/immortalwrt/immortalwrt/issues/2123#issuecomment-3523744128

Fixes: c908fc7d95 ("mediatek: add support for Zbtlink ZBT-Z8102AX v2")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20769
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d2fa070f70)
[rebased upon 24.10 branch]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/21085
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-08 17:27:20 +01:00
Shine
0ed59099ee mpc85xx: p1010: Fix Sophos RED 15w NAND partitions
This partially reverts 78d259e7d2.
That commit broke mounting the root fs on Sophos RED 15w due to
partition size mismatch, and changed the partition sequence, causing
the OpenWrt partition numbers to change from mtd3:kernel/mtd4:ubi to
mtd4:kernel/mtd5:ubi.

Fixes: 78d259e7d2 ("mpc85xx: fix some dtc warnings")
(cherry-picked from commit 09e7b24ceb)
Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21062
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-07 20:29:18 +01:00
Christian Marangi
d0c2c30e50 sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
There is currently a logic error with generating the base feed string.

In the scenario where the commit of a Tag match the latest commit of a
stable branch, the stable branch have priority over the tag name.

This results in generating SDK that actually target the branch instead
of the specific tag.

To fix this invert the logic and give priority to the tag name.

Fixes: #18583
(cherry picked from commit 289172b00e)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-12-04 19:25:13 +01:00
Christian Marangi
9c23ecf31c sdk: filter out main on GIT_BRANCH parsing
Branch named main was never filter out on parsing the GIT_BRANCH define.

Add main to the name of branch that should be filtered.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 0338dd44d5)
2025-12-04 19:24:30 +01:00
Mikhail Zhilkin
96a67d2f2e kernel: add support for Fudan Micro FM25S01BI3 SPI-NAND
Add support for Fudan Micro FM25S01BI3 SPI NAND.
Link: https://www.fmsh.com/nvm/FM25S01BI3_ds_eng.pdf

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20872
(cherry picked from commit 05cddcd12a)
[Update patch path]
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20974
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-03 21:31:20 +01:00
Mikhail Zhilkin
15601a545e kernel: fix QE bit for Fudan Micro FM25S01A SPI-NAND
According to datasheet (http://eng.fmsh.com/nvm/FM25S01A_ds_eng.pdf)
there is no QE (Quad Enable) bit for FM25S01A flash, so remove it.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20872
(cherry picked from commit 40fc91be6e)
[Update patch path and number]
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20974
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-03 21:31:20 +01:00
Goetz Goerisch
b1528735da kernel: bump 6.6 to 6.6.118
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.118

All patches auto-refreshed.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21022
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-03 21:28:27 +01:00
Andy Chiang
13226471ef ppp: add reqprefix norelease ac_mac
Use ppp and enable autoipv6, odhcp6c supports reqprefix and norelease to minimize the chance of IPv6 PD changes.[1]
PPPoE supports connecting to a specific AC/BRAS by using the pppoe-mac parameter.[2]

1. https://github.com/openwrt/openwrt/blob/master/package/network/ipv6/odhcp6c/files/dhcpv6.sh#L67
   https://github.com/openwrt/openwrt/blob/master/package/network/ipv6/odhcp6c/files/dhcpv6.sh#L77
2. https://github.com/ppp-project/ppp/blob/master/pppd/plugins/pppoe/plugin.c#L93

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19978
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 7079e456ad)
Link: https://github.com/openwrt/openwrt/pull/20824
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-12-03 18:13:13 +01:00
George Sapkin
e781816fe1 formal: fix workflow permissions
Fix formality check permissions that are needed to post optional
summaries back to the PR.

Link: https://github.com/openwrt/actions-shared-workflows/pull/64
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/20930
(cherry picked from commit 9f6c16e722)
Link: https://github.com/openwrt/openwrt/pull/20986
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-30 12:42:58 +01:00
Qing W.
913e26b20f mediatek: add support for WAVLINK WL-WN536AX6 Rev a
Product name: Wavlink WL-WN536AX6 Rev a "Mighty LX2"
Product link: https://www.wavlink.com/en_us/product/WL-WN536AX6.html

Specifications:
SOC: MT7986AV
RAM: 512MB DDR4
Flash: 128MB SPI NAND
Ports: 4 LAN (1G) & 1 WAN (2.5G)
WIFI: MT7976PN + MT7975N
LEDs: 8 (STATUS, WIFI, WAN, LAN1, LAN2, LAN3, LAN4, PWR)
USB: 1 (3.0)

MAC table, same as stock firmware:
LAN: 80:3F:5D:xx:xx:x1 partition "hw" at 0x44e (ASCII)
WAN: 80:3F:5D:xx:xx:x2 partition "hw" at 0x460 (ASCII)
2G: 80:3F:5D:xx:xx:x3
5G: 80:3F:5D:xx:xx:x4

* Installation with OEM WebUI:

Note: Make sure PC is connected on LAN1 port. The OEM firmware has an unknown root password and settings are kept after upgrading firmware. Therefore, a customized Openwrt firmware is needed to remove the root password on login, by adding `passwd -d root` to /etc/init.d/bootcount. The WebUI does a filename check so the customized firmware is named accordingly.

1. Download modified firmware file `WAVLINK_WN536AX6-A_M36AX6_V250320-WO-437baca-modified.bin` from https://github.com/ses1er/firmware-misc/tree/main/wavlink/wl-wn536ax6a
2. Log into WebUI on default IP: http://192.168.20.1
3. Browse to More (top menu) -> System -> Firmware Upgrade.
4. Under `Local Upgrade` section, check the device to be upgraded and upload downloaded modified firmware. Click `UPLOAD FILE`, then `APPLY`
5. Wait about 2 minutes (ignore progress bar), and browse to http://192.168.20.1. You should see LUCI login page. Username is root and no password.
6. Browse to `System -> Backup/Flash Firmware`, click on `Flash Image`, click `Browse` and locate `openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin` file.
7. Uncheck `Keep settings and retain the current configuration` and click `Continue`.
8. Router will now be set to IP 192.168.1.1 which is the Openwrt default.

* Installation with UART:

Note: Having UART connected while cold booting the device will result in a kernel panic when initializing wifi. I've found this workaround:
1. Power off the device and ensure UART is not connected to PC.
2. Power up the device, when lights come on, plug in UART.
3. Warm boots and soft restarts will not cause kernel panic for the duration of device being powered on. Repeat steps for subsequent cold boots.

1. Configure TFTP server with IP 192.168.1.66. Copy `openwrt-mediatek-filogic-wavlink_wl-wn536ax6a-initramfs.itb` to TFTP root.
2. Interrupt boot by pressing 0.
3. Run the following in Uboot console: `setenv serverip 192.168.1.66; setenv ipaddr 192.168.1.1; tftpboot 0x46000000 openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-initramfs.itb; bootm`
4. Transfer `openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin` to device:
   (`scp -O openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/`)
5. Run the following on device: `sysupgrade -n /tmp/openwrt-mediatek-filogic-wavlink_wl-wn536ax6-a-squashfs-sysupgrade.bin`

Signed-off-by: Qing W. <ses1er@gmail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://github.com/openwrt/openwrt/pull/20760
(cherry picked from commit 1748ce8295)
Link: https://github.com/openwrt/openwrt/pull/20775
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:26:18 +01:00
Luis Mita
c6e59d06af ramips: mt7621: add support for Cudy AP1300 Outdoor v1
Hardware:
 - SoC: MediaTek MT7621DAT
 - Flash: 16 MiB XM25QH128C
 - RAM: 128 MiB
 - WLAN: 2.4 GHz (MT7603E, 11n), 5 GHz (MediaTek MT7613BEN, 11ac)
 - Ethernet: 1x10/100/1000 Mbps LAN
 - Buttons: 1 Reset button, 1 WPS button
 - LEDs: 5x Green
 - Serial Console: unpopulated header 115200 8n1 (silkscreen on PCB)
 - Power: POE 802.3af (37-57V DC)

MAC addresses:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| LAN     | 80:af:ca:xx:xx:x0 | label     |
| WLAN 2g | 80:af:ca:xx:xx:x0 | label     |
| WLAN 5g | 82:af:ca:xx:xx:x1 | +1        |
+---------+-------------------+-----------+

Installation:
The factory firmware is locked: you can only work with Cudy signed firmware.
Download a intermediate firmware signed by Cudy here:
https://www.cudy.com/blogs/faq/openwrt-software-download

After that, login to the router (192.168.10.254, password "admin") and install the intermediate firmware.

If you can reach LuCI or SSH now on the intermediate firmware, just use the sysupgrade image with the 'Keep settings' option turned off.

Special thanks to Daniel de Kock for starting the porting work at #16265.

Signed-off-by: Luis Mita <luis@luismita.com>
Co-Authored-By: Daniel de Kock <daniel@riot.network>
Co-Authored-By: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/20268
(cherry picked from commit 8fb644e9e8)
Link: https://github.com/openwrt/openwrt/pull/20710
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:20:14 +01:00
Donghyun Ko
9f8c60c2c8 mediatek: use dt-bindings drive strength macros for ipTIME AX7800M-6E
Replace hardcoded numbers with the dt-bindings drive strength macros
defined in "dt-bindings/pinctrl/mt65xx.h".

Signed-off-by: Donghyun Ko <nyankosoftware@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20894
(cherry picked from commit 2c667f2df4)
Signed-off-by: Donghyun Ko <nyankosoftware@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20773
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:17:45 +01:00
Donghyun Ko
ea96f50747 mediatek: add support for ipTIME AX7800M-6E
Specification
-------------
- SoC       : MediaTek MT7986AV quad-core ARM Cortex-A53 2GHz
- RAM       : DDR4 512Mbytes, Nanya Technology NT5AD256M16E4
- Flash     : 128Mbytes NAND Flash, ESMT F50L1G41LB
- WLAN      : MediaTek MT7976DAN, MediaTek MT7916AN, MediaTek MT7976AN
  - 2.4GHz  : b/g/n/ax, Multi User MIMO
  - 5GHz    : a/n/ac/ax, Multi User MIMO
  - 6GHz    : ax, Multi User MIMO
- Ethernet  : 10/100/1000 Mbps x4, LAN (MediaTek MT7531AE)
              10/100/1000/2500 Mbps x1, WAN (MaxLinear GPY211C0VC)
- UART      : 1x4 pin header on PCB
  - [J1] 3.3V, TX, RX, GND (115200, 8N1)
- Buttons   : WPS, Reset
- Switches  : Rfkill Slide Switch
- USB       : 1x USB 3.0 (MediaTek MT7986AV peripheral)
- FAN       : 1x Fan (off - slow - fast)
- LEDs      : 1x Power (Blue)
              1x CPU (Blue)
              1x Wi-Fi 6GHz (Blue)
              1x Wi-Fi 5GHz (Blue)
              1x Wi-Fi 2.4GHz (Blue)
              4x LAN activity (Blue)
              1x WAN activity (Blue)
              1x USB 3.0 (Blue)
- Power     : 12VDC, 3.5A (Center positive polarity)

MAC address
-----------
+-----------+-------------------+------------------------+
| Interface | MAC               | Algorithm              |
+-----------+-------------------+------------------------+
| WLAN 2.4G | 58:86:94:xx:xx:xx | label1                 |
| WLAN 5G   | 5A:86:94:xx:xx:xx | label2 with LA Bit set |
| WLAN 6G   | 5A:86:94:xx:xx:xx | label1 with LA Bit set |
| WAN       | 58:86:94:xx:xx:xx | label1 + 1             |
| LAN       | 58:86:94:xx:xx:xx | label1 + 3             |
+-----------+-------------------+------------------------+
The WLAN 2.4G MAC address (label1) was found in 'Factory' partition, 0xA0004
The WLAN 5G MAC address (label2) was found in 'Factory' partition, 0x4

Installation
------------
1. Download the OEM recovery software (ipTIME Firmware Wizard (11ac))
   from the manufacturer's website
2. Download the *squashfs-factory.bin file from the OpenWrt website
3. Press a reset button, and power up the router (keep pressing the reset button)
4. Wait more than 10 seconds until the CPU LED stop blinking
5. Connect the router (LAN port) to the PC
6. Run the OEM recovery software and follow the instructions
7. Select the *squashfs-factory.bin file during the router recovery process
8. Wait for the router to boot from *squashfs-factory.bin

Note: The router will automatically reboot if no file is uploaded within
55 seconds.

Fan Control
------------
The fan speed is controlled by writing a value from 0 to 2 to the
`fan1_target` file.

```
cd /sys/devices/platform/gpio-fan/hwmon/hwmon2

echo '0' > fan1_target // off
echo '1' > fan1_target // slow
echo '2' > fan1_target // fast
```

Limitation: Enabling Wi-Fi 6E
----------
Wi-Fi 6E (6GHz) does not work out of the box on LuCI.
After installation, you need to configure a few settings in the `radio1`
and `default_radio1` sections of the `/etc/config/wireless`.
Once you have made these changes, you can enable and use Wi-Fi 6E.

In the `radio1` section, you need to add three common options:
- band: must be set to `6g`
- country: a valid country code for the 6GHz band
- channel: a preferrend scanning channel (PSC) for 6GHz

In the `default_radio1` section, you need to add the SSID and key:
- ssid: The public name of your Wi-Fi network
- key: The Wi-Fi password
- encryption: must be set to either `sae` for WPA3 or `owe` for OWE
  (open network)

Example:

```
config wifi-device 'radio1'
        ...
        option band '6g'
        option country 'KR'
        option channel '37'
        ...

config wifi-iface 'default_radio1'
        ...
        option ssid 'my_wifi_6e_name'
        option key 'my_strong_password1234'
        option encryption 'sae'
        ...
```

Note: A list of all the 6GHz PSC channels:

```
5, 21, 37, 53, 69, 85, 101, 117, 133, 149, 165, 181, 197, 213, and 229
```

Limitation: Maximum Transmit Power (Wi-Fi 6E)
----------
The maximum transmit power is currently broken. In the drop-down menu,
you can only choose between "driver default" and "255 dBm (2147493647
mW)". There is currently no workaround for the issue. Please leave the
maximum transmit power set to "driver default".

Signed-off-by: Donghyun Ko <nyankosoftware@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19763
(cherry picked from commit 2503e5bc37)
Signed-off-by: Donghyun Ko <nyankosoftware@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20773
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:17:45 +01:00
Michal Halva
51108508f1 mediatek: filogic: add support for Cudy WR3000P v1
Hardware
--------
MediaTek MT7981 WiSoC
512MB DDR4 RAM
128MB SPI-NAND
MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5)
4 LAN MediaTek MT7531 PHY
1 WAN RTL8221B-VB-CG 2.5Gbps PHY
UART: 115200 8N1 3.3V
USB2 Port
PoE on WAN Port

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

Gotchas:
WAN LED does not light up (might require further DTS tweaks)
PoE on WAN port was not tested

This commit is heavily based on WR3000H one, I've just ported DTS differences
from the official image to get USB support and proper LED mapping.

Installation
------------
[Untested as I've received and used a transitional image from Cudy]

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

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

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

4. Download and boot the OpenWrt initramfs image.

   $ tftpboot 0x46000000 cudy3000s.bin; bootm 0x46000000

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

Signed-off-by: Michal Halva <hedik01@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19636
(cherry picked from commit 04e9d154f2)
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/20830
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:10:10 +01:00
Liangbin Lian
414f196a96 rockchip: LinkEase EasePi R1 use dedicated uboot
Fixes the "mdio_bus stmmac-1: MDIO device at address 1 is missing" error
that occurs during cold boot when initializing GMAC.

Fixes: 8ca4caacd0 ("rockchip: Add support for RK3568 LinkEase EasePi R1")
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20772
(cherry picked from commit e6a5ca0da7)
Link: https://github.com/openwrt/openwrt/pull/20744
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:05:47 +01:00
Liangbin Lian
9c25d39d3e uboot-rockchip: add dedicated uboot for LinkEase EasePi R1
The generic-rk3568 does not reset the gmac phy, causing the kernel to
fail to initialize gmac during cold boot with the error message
"mdio_bus stmmac-1: MDIO device at address 1 is missing."

Adding a dedicated uboot for EasePi R1 to resolve this issue.

The EasePi R1's DTS hasn't been merged into the Linux release yet,
so it cannot be submitted to the upstream u-boot.

Fixes: ef093299db ("uboot-rockchip: add support for LinkEase EasePi R1")
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20772
(cherry picked from commit 5dff7b45d3)

With changes:
1. Reorder patch file names (`105-*` to `106-*`).
2. configs/easepi-r1-rk3568_defconfig needs CONFIG_SPL_PAD_TO on u-boot 2024.10.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20744
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:05:47 +01:00
Liangbin Lian
fbaf5271d2 rockchip: make NIC name predictable for LinkEase EasePi R1
The probe order for PCIe buses and devices is non-deterministic,
making the names eth2 and eth3 unpredictable (they may be swapped).

This patch fixes the names by referencing the device path using
`ucidef_set_network_device_path`.

This patch ensures that the OpenWrt interface name matches the case label.

Fixes: 8ca4caacd0 ("rockchip: Add support for RK3568 LinkEase EasePi R1")
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20779
(cherry picked from commit d7530c1e54)
Link: https://github.com/openwrt/openwrt/pull/20744
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:05:47 +01:00
Liangbin Lian
c795a91579 rockchip: Add support for RK3568 LinkEase EasePi R1
Specification:
- Rockchip RK3568
- 2GB/4GB LPDDR4 RAM
- 16GB on-board eMMC
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
- 1x USB 3.0 Type-A
- 1x USB 2.0 Type-C (for USB flashing)
- 2x 1000 Base-T (native, RTL8211F)
- 2x 2500 Base-T (PCIe, RTL8125B)
- 1x HDMI 2.0 Output
- 12v DC Jack
- 1x Power key connected to PMIC
- 2x LEDs (one static power supplied, one GPIO controlled)

Debug Serial Port: 3.3V TTL, 3-pin 2.54mm pitch connector, 1500000 bauds,
'J7' on board with G/R/T (GND/RX/TX) pins marked

Installation - eMMC:
-Boot official firmware (OpenWRT based)
-Upload sysupgrade.img.gz to /tmp/firmware.bin (with scp or web page)
-Flash to eMMC: sysupgrade -n -p -F /tmp/firmware.bin

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20147
(cherry picked from commit 8ca4caacd0)
[refresh patches upon 24.10 branch]
Link: https://github.com/openwrt/openwrt/pull/20744
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:05:47 +01:00
Liangbin Lian
e35f37791f uboot-rockchip: add support for LinkEase EasePi R1
generic-rk3568 is enough

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20147
(cherry picked from commit ef093299db)
Link: https://github.com/openwrt/openwrt/pull/20744
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 01:05:47 +01:00
Hauke Mehrtens
804a2e6c51 uboot-mediatek: mtd: spinand: esmt: add support for F50L1G41LC
Add support for esmt F50L1G41LC flash chip. It is used in some recent
Cudy devices.

(cherry picked from commit c84025dea2)
Link: https://github.com/openwrt/openwrt/pull/20963
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-29 00:00:04 +01:00
Hauke Mehrtens
6ff763e78c kernel: mtd: spinand: esmt: add support for F50L1G41LC
Backport upstream patch to add support for the ESMT F50L1G41LC flash
chip. It is used in multiple Cudy products manufactured starting
November 2025.

(cherry picked from commit 9424b2b786)
Link: https://github.com/openwrt/openwrt/pull/20963
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-28 23:59:45 +01:00
Goetz Goerisch
648fa1b6d3 kernel: bump 6.6 to 6.6.117
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.117

Manually updated:
bcm27xx/patches-6.6/950-0814-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch
Updated with Raspberry Pi patch.

All patches auto-refreshed.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20927
(cherry picked from commit 0337cdfb33)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20952
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-27 22:52:26 +01:00
Christian Marangi
443fc11576 package: drop creating spurious tmp directory in feed directory
In implementing APK support it seems a a leftover was never removed that
creates an unused tmp directory in the package feed directory.

Drop it as it's not used anywhere. What is actually needed is the
creation of the $$(PDIR_$(1)) directory for the feed package directory
in the bin/packages directory.

This was a side effect of using INSTALL_DIR on $$(PDIR_$(1))/tmp that
indirectly creates the $$(PDIR_$(1)) parent directory.

Fixes: d788ab376f ("build: add APK package build capabilities")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit f9802d70c6)
2025-11-23 11:41:47 +01:00
Felix Fietkau
444299d70c kernel: backport mediatek WED DMA mask fixes
Fixes issues on devices with 4 GB RAM.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 3632c0d3ce)
[ fix conflict errors ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-19 14:31:17 +01:00
Lorenzo Bianconi
6c5c8598ab mt76: Enable NPU support for Airoha AN7581 SoC
Airoha AN7581 SoC supports a Network Processor (NPU) to offload WiFi
traffic. Add the required bits to enable the support of it in the MT76
driver. This will be enabled by default if we are compiling for the
Airoha AN7581 SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
[ improve commit title/description ]
Link: https://github.com/openwrt/openwrt/pull/20826
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 79d418eed8)
2025-11-19 13:54:41 +01:00
Felix Fietkau
59b4c9e114 mt76: update to Git HEAD (2025-11-06)
0aece3089a3a wifi: mt76: mt7996: Remove useless check in mt7996_msdu_page_get_from_cache()
05b3d899ad24 wifi: mt76: Move Q_READ/Q_WRITE definitions in dma.h
85e6517b0ac5 wifi: mt76: Add mt76_dev pointer in mt76_queue struct.
a3b6c67c97d2 wifi: mt76: Add the capability to set TX token start ID
141a81557070 wifi: mt76: Introduce the NPU generic layer
647d11bb17e0 wifi: mt76: mt7996: Add NPU offload support to MT7996 driver
8ff3b2bfc37f wifi: mt76: mt7996: fix typos in comments
0043147439b4 wifi: mt76: mt7925: refactor regulatory domain handling to regd.[ch]
f0e8fe441489 wifi: mt76: mt7925: refactor CLC support check flow
588cc87bf6a2 wifi: mt76: mt7925: refactor regulatory notifier flow
dac1d45fe94b wifi: mt76: mt7925: improve EHT capability control in regulatory flow
c166c4a0e750 wifi: mt76: mt7925: add auto regdomain switch support
d7b059bba166 wifi: mt76: mt7925: disable auto regd changes after user set
84f62a6beb99 wifi: mt76: mmio_*_copy fix byte order and alignment
f5ae5b2e8116 Revert "wifi: mt76: mt792x: improve monitor interface handling"
8ae7e6dc1d3a wifi: mt76: adjust BSS conf pointer handling
1b438ebe0d06 wifi: mt76: mt7925: cqm rssi low/high event notify
7519fa4ce62c wifi: mt76: mt7996: fix max nss value when getting rx chainmask
ea0580ad065f wifi: mt76: mt7996: no need to wait ACK event for SDO command
74112c2956fb wifi: mt76: mt7996: fix implicit beamforming support for mt7992
361d6bdac45d wifi: mt76: mt7996: support fixed rate for link station
d99274cdc30c wifi: mt76: mt7996: fix several fields in mt7996_mcu_bss_basic_tlv()
ad90a85b652b wifi: mt76: mt7996: fix teardown command for an MLD peer
e9fe8bc03e41 wifi: mt76: mt7996: set link_valid field when initializing wcid
050394665502 wifi: mt76: mt7996: use correct link_id when filling TXD and TXP
5d223855552c wifi: mt76: mt7996: fix MLD group index assignment
ab8361dbc421 wifi: mt76: mt7996: fix MLO set key and group key issues
7ce7ab881b3f wifi: mt76: mt7996: fix using wrong phy to start in mt7996_mac_restart()
1e0c23ff754b wifi: mt76: mt7996: fix EMI rings for RRO
eb567bc7f9b6 wifi: mt76: mt7925: ensure the 6GHz A-MPDU density cap from the hardware.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit e1a584b5d2)
2025-11-19 13:54:34 +01:00
Felix Fietkau
2b3f8c0d4c mt76: update to Git HEAD (2025-10-20)
9050597c4cd6 wifi: mt76: fix license/copyright of util.h
33f29d2345cc wifi: mt76: relicense to BSD-3-Clause-Clear
fc25ba82192e add LICENSE file
c1349a686cd1 wifi: mt76: mt7921: fix a potential clc buffer length underflow
4e7077f77400 wifi: mt76: mt7996: fix FCS error flag check in RX descriptor
754e3357045d wifi: mt76: mt7996: Remove unnecessary link_id checks in mt7996_tx
2e63c495f59b wifi: mt76: connac: Replace memcpy + hard-coded size with strscpy
95c4df3233ed wifi: mt76: Fix DTS power-limits on little endian systems
6f27d647c0ce wifi: mt76: mt7915: add bf backoff limit table support
1e91eadc9d46 wifi: mt76: wed: use proper wed reference in mt76 wed driver callabacks
2fe5bdbe7e13 wifi: mt76: use GFP_DMA32 for page_pool buffer allocation
c63db0fcadb8 wifi: mt76: mt7915: add WDS support when WED is enabled

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 13c30c2e58)
2025-11-19 13:54:27 +01:00
Christian Marangi
84927ebac6 mt76: update to Git HEAD (2025-10-03)
9ee788a38251 wifi: mt76: mt7996: fix null pointer deref in mt7996_conf_tx()
ec3f05480e5b tools: CMakeLists: update cmake minimum required version to 3.10

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3531322a4a)
2025-11-19 13:54:15 +01:00
Pawel Dembicki
dbc2b142ce mac80211: mwl8k: inject DSSS Parameter Set element into beacons if missing
Some Marvell AP firmware used with mwl8k misbehaves when beacons do not
contain the DSSS Parameter Set (WLAN_EID_DS_PARAMS) with the current
channel. When hostapd/mac80211 omits this element (which is valid on
some bands), the firmware may report bogus RX channel information and AP
mode becomes unusable.

Backport the upstream fix that ensures beacons always carry the DSSS
Parameter Set for mwl8k: when setting the beacon, detect if the element
is missing and inject it after SSID and Supported Rates (per spec
ordering). This mirrors behaviour in newer Marvell drivers and restores
stable operation.

Tested on Linksys EA4500 (88W8366).

Fixes: openwrt/openwrt#19088
Link: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git/commit/?id=c4e1ac09ee1c750890e36cb1f841f25518f23589

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20757
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 38ed1510db)
[refreshed patches]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20817
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-18 12:41:38 +01:00
Álvaro Fernández Rojas
4d1c1d7754 odhcpd: backport memleak fix from Git HEAD
be7ca7c0792b config: fix memleak during odhcpd reload

https://github.com/openwrt/odhcpd/commit/be7ca7c0792b

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-11-14 23:02:27 +01:00
George Tsiamasiotis
58cde9ec22 scripts/patch-kernel.sh: do not try to check files after patch
Since we are not using patch -b, *.orig files are only created when
there are conflicts, or never according to posix patch.

As such, it doesn't really make sense to always delete *.orig files
presuming they are patch backups, even if they are patch backups.
Doing so is both deleting potentially useful information for failed
patch applications and creating hard to diagnose bugs [1].

In a similar vein, checking for *.rej files does not add any value
since we're already checking the patch command's return code.

[1]: https://github.com/openwrt/packages/issues/27485

Signed-off-by: George Tsiamasiotis <george@tsiamasiotis.gr>
Link: https://github.com/openwrt/openwrt/pull/20141
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 75ca6bafd6)
Link: https://github.com/openwrt/openwrt/pull/20742
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-12 12:09:43 +01:00
Ernestas Kulik
dddeea5e7f scripts: feeds: Don’t hardcode IS_TTY
When building in environments that set IS_TTY, the feeds script does not
honor it and passes a hardcoded value to scan.mk, causing unwanted
control characters to appear in stdout.

This commit addresses the issue by checking IS_TTY and MAKE_TERMOUT
variables and uses their values if defined.

Closes #8039

Signed-off-by: Ernestas Kulik <ernestas.k@iconn-networks.com>
Link: https://github.com/openwrt/openwrt/pull/20743
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit fd7e43d429)
2025-11-12 12:06:51 +01:00
Christian Marangi
d804c3110b airoha: backport patch fixing out of order DMA for ethernet driver
Backport upstream patch fixing out of order DMA access for ethernet
driver. This is relevant in the context of QoS when packets doesn't
follow linear handling by QDMA HW.

(cherry picked from commit 3169ffa4c7)
[ fix conflict errors ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-12 10:13:26 +01:00
Shiji Yang
b01c68ddbd ipq806x: migrate wifi configuration device paths for 6.12 kernel
The device tree PCIe host node names have been changed in the new
6.12 kernel[1]. Hence we have to update the wifi device path to
make sure it can work properly.

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

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=07299ba2e7d98045e6b522f7c5b97f402b15bc82
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18989
(cherry picked from commit ae70dbc267)

Backport the migration script that can also work backward, migrating
from 6.12 to 6.6. Like going from main/master to stable 24.10.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/20739
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-12 00:08:15 +01:00
Shiji Yang
42ca1612a2 base-files: introduce a function to get kernel version number
A new function "get_linux_version()" to normalize and print the
kernel version as an integer. In some migration scripts, it is
useful for checking the Linux kernel version.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit a0fe3cfb62)
Link: https://github.com/openwrt/openwrt/pull/20739
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-12 00:08:14 +01:00
Christian Marangi
ae51d0098e airoha: refresh kernel patches
After all the backports, automatically refresh all the patches for
Airoha target.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 18:29:44 +01:00
Christian Marangi
2d05923d2e airona: an7583: fix typo for CONFIG_PHY_AIROHA_USB
KConfig flag have an extra whitespace for CONFIG_PHY_AIROHA_USB and
value is not ignored.

Drop the extra whitespace to correctly ignore the value on kernel
compilation.

Fixes: c5b12fc02a ("airoha: Introduce support for Airoha AN7583 SoC")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit eedc7b3b79)
2025-11-10 18:26:30 +01:00
Christian Marangi
81929a31af airoha: replace PWM patch with upstream version
Replace Airoha AN7581 PWM patch with upstream version and add kernel
version tag.

(cherry picked from commit 2352de96c1)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 18:20:45 +01:00
Christian Marangi
b3e90139ce airoha: backport minor fixes for NPU handling
Backport upstream minor fixed for NPU handling that might result in
kernel panic or handle leak.

(cherry picked from commit 83eacb6ab0)
[ fix conflict errors ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 18:20:45 +01:00
Lorenzo Bianconi
dcced671e2 airoha: Add missing board files for EN7581
Add missing leds and network board files for EN7581 SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
[ drop reference to downstream 10g RFB board ]
Link: https://github.com/openwrt/openwrt/pull/20556
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 738eacb9a0)
2025-11-10 18:20:44 +01:00
Ziyang Huang
9d218f0853 airoha: adjust and default the loadaddr
Similar to e92b153e99 ("mediatek: introduce KERNEL_LOADADDR to Device/Default template"),
let's move the default loadaddr to Device/Default.

What's more, use 0x80200000 instead of the SDK default value 0x80088000
to avoid the following error which may overwrite TZ memory and cause crash:

    [    0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
    [    0.000000] OF: reserved mem: Reserved memory: failed to reserve memory for node 'atf@80000000': base 0x0000000080000000, size 2 MiB

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
[ fix spelling mistake ]
Link: https://github.com/openwrt/openwrt/pull/20470
(cherry picked from commit fed2d31343)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 18:20:44 +01:00
Christian Marangi
e905c45b05 airoha: an7581: enable USB node on eMMC RFB board
Enable USB node on eMMC RFB board and disable USB2 3.0 port to make the
3rd PCIe line correctly work.

This is needed to prevent the xHCI driver to mess with PCIe by
configuring the USB2 3.0 port. Port will still be detected but won't be
configureed by the driver and won't have PHY to configure for.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 6d51c80424)
2025-11-10 18:20:44 +01:00
Christian Marangi
b5a66740c2 airoha: an7581: correctly attach the USB2 PHY for 3rd PCIe line
The 3rd PCIe line use the USB2 serdes for PCIe operation. Correctly set
it to the DT node so that the mode can be correctly set in the PHY
driver.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3ba92e0e32)
2025-11-10 18:20:44 +01:00
Christian Marangi
64ad16e3ed airoha: an7581: add USB nodes
Add USB nodes to AN7581 DTSI, disabled by default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3db72b71d1)
2025-11-10 18:20:44 +01:00
Christian Marangi
9aeda89c05 airoha: add pending patch for USB support on AN7581
Add pending patch for USB support on AN7581 SoC. This is also required
to make operational the 3rd PCIe line that use the USB2 Serdes for PCIe
operations.

(cherry picked from commit 7afc2da3fc)
[ fix conflict errors, add missing Kconfig flag ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 18:20:40 +01:00
Christian Marangi
9097d73cbb airoha: add nodes for 3rd PCIe line for AN7581
Some SoC might use the Serdes for the second USB port as a 3rd PCIe
line (with the SSTR register correctly setup).

Add the node for the 3rd PCIe card and enable for the eMMC RFB board.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 2fae199953)
2025-11-10 18:09:14 +01:00
Christian Marangi
7af48fdcd3 airoha: backport fix for Airoha offload support with airoha_hw_init fail
Backport a patch fixing a kernel panic on airoha_hw_init fail. This
should better handle scenario with NPU load Probe deferring.

(cherry picked from commit c3c75d0e68)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 18:09:14 +01:00
Christian Marangi
518f3c6171 airoha: backport cleanup patch for Airoha Ethernet driver
Backport cleanup patch for Airoha Ethernet patch to permit easier
backport in the future.

Automatically refresh all affected patch.

(cherry picked from commit 2f3ea18f91)
[ fix conflict errors, drop upstream patch ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 18:05:46 +01:00
Christian Marangi
9babe16bd2 airoha: an7581: add Aeonsemi AS21xxx PHY to RFB eMMC board
Airoha AN7581 eMMC RFB board mount 2 Aeonsemi AS21xxx PHY. One is
usually connected to GDM4 and the other is optionally connected to GDM2.
Add the relevant nodes to support the one connected to GDM4.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 26da4bf552)
2025-11-10 17:55:48 +01:00
Christian Marangi
fda425adf4 airoha: an7581: add BL2 and BL31+U-Boot Artifacts for RFB board
Pack the BL2 and BL31+U-Boot artifacts as Airoha AN7581 is currently
supported in upstream U-Boot and bootloader files can be used for
unfused boards.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 17cb69fe7f)
2025-11-10 17:55:41 +01:00
Christian Marangi
1f7de3311c airoha: backport additional upstream patch for NPU support for AN7583
Backport additional patch required for NPU support of Airoha AN7583.
These are specific for the NPU module with some minor fixes and to adds
upport for loading the specific Airoha AN7583 NPU firmware.

(cherry picked from commit 8b4adfbb87)
[ fix conflict errors ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:54:54 +01:00
Christian Marangi
4391bf8729 airoha: an7583: add NPU nodes and enable kernel config
Add relevant nodes for NPU support for Airoha AN7583 and enable the
kernel config to enable support in the Airoha Ethernet driver.

NPU firmware is scheduled to be upstreamed to linux-firmware and will be
added once present upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8758b58f25)
2025-11-10 17:54:16 +01:00
Christian Marangi
ed8ba06ced airoha: an7583: drop bootloader artifacts entry and add default pkg
Fix the current image Makefile for Airoha AN7583 by dropping the
artifacts entry for bootloader and add default PKG for the PHY mounted
on the RFB boards.

The artifacts for the bootloader will be readded later once ATF-A
support will be pushed mainline.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a7964f0893)
2025-11-10 17:54:10 +01:00
Christian Marangi
89cee1bf3f airoha: an7583: Add missing DTS for EMMC RFB board
While adding support for Airoha AN7583, it was forget to push the EMMC
DTS while defining the variant in the image Makefile.

Add the missing DTS to fix image creation error.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 6fe65d404b)
2025-11-10 17:54:03 +01:00
Christian Marangi
4d4fd4d125 airoha: an7583: add additional comments on EVB board
On the Airoha AN7583 EVB there are 2 Aeonsemi AS21xxx PHY but only the
one connected to Serdes Ethernet is usable as the other connected to
Serdes PON is not actually HW connected (as the serdes is connected to
the BOSA port)

Add comments and disable the relevant PHY.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ea850b5a18)
2025-11-10 17:53:56 +01:00
Christian Marangi
262b537f48 airoha: backport upstream patch for AN7583 Ethernet support
Backport upstream patch for AN7583 Ethernet support. While at it also
backport some additional fixes required to apply the AN7583 patches
cleanly.

Refresh all affected patch automatically (aside from the XSI patch that
changed the implementation)

Link: https://github.com/openwrt/openwrt/pull/20489
(cherry picked from commit 46a454fb9b)
[ fix conflict errors ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:53:47 +01:00
Aleksander Jan Bajkowski
c56fbe156e airoha: fix scuclk node for an7581
Add missing syscon compatible for scuclk node.
Fix the unit-address of the scuclk node.
This fixes the pcs driver error:

airoha-pcs 1fa08000.pcs: probe with driver airoha-pcs failed with error -22
airoha-pcs 1fa09000.pcs: probe with driver airoha-pcs failed with error -22

Fixes: c3d70b1 ("airoha: en7581: Add support for external PHY")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/20190
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a30daf8a0b)
2025-11-10 17:48:34 +01:00
Chukun Pan
84944c0311 airoha: set default DEVICE_DTS/DEVICE_DTS_DIR
All devices under airoha use dts directory under the target,
so update the default DEVICE_DTS_DIR. Also set the default
DEVICE_DTS based on the SoC name for non-dev boards.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/20190
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 866c4e5cdf)
2025-11-10 17:46:45 +01:00
Christian Marangi
0272d79e34 airoha: Introduce support for Airoha AN7583 SoC
Introduce initial support for Airoha AN7583 SoC and add all the required
patch for basic functionality of the SoC.

Airoha AN7583 is based on Airoha EN7581 SoC with some major changes on
the PHY handling and Serdes. It can be see as a lower spec of EN7581
with modern and simplified implementations.

All the patch are sent upstream and are pending revision. Support for
PCIe and USB will come later as soon as DT structure is accepted
upstream.

(cherry picked from commit c5b12fc02a)
[ fix conflict errors, add MDIO_AIROHA config ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:46:13 +01:00
Christian Marangi
1181c031a0 airoha: en7581: Add pending ASOC driver
Add pending ASOC driver for I2S sound support on Airoha EN7581 SoC.

(cherry picked from commit 14bc87cf76)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:37:04 +01:00
Christian Marangi
48ec8469fd airoha: en7581: Add support for external PHY
This add a pending version of the Airoha PCS driver to add support for
External PHY. The Airoha PCS driver will receive some minor modification
once we the PCS subsystem will be defined upstream.

Add all the required node for GDM2 and GDM4 and enable the PCS config.

(cherry picked from commit c3d70b1ae5)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:36:25 +01:00
Aleksander Jan Bajkowski
8c5ad273b4 airoha: en7581: dts: fix typo "disable"
No functional changes intended.

Fixes warning:
/linux/arch/arm64/boot/dts/airoha/en7581-gemtek-w1700k.dtb: i2c1@1fbf8100 (mediatek,mt7621-i2c): status: 'oneOf' conditional failed, one must be fixed:
	['disable'] is not of type 'object'
	'disable' is not one of ['okay', 'disabled', 'reserved', 'fail', 'fail-needs-probe']
	from schema $id: http://devicetree.org/schemas/dt-core.yaml#

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20131
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 3872e9d317)
2025-11-10 17:30:05 +01:00
Aleksander Jan Bajkowski
f364fe5e09 airoha: an7581: enable uart baudrate control
The baud rate control on Airoha does not function properly. This
patch enables the inactive code responsible for this. The UART2
baud rate is correct. HSUART3 operates at twice the requested
baud rate. The same problem exists in the current code, so this
doesn't introduce any regression. Support for baud rates higher
than 460800 is still required. This will be added in the future.

Tested on Gemtek W1700k. UART2 and HSUART3 are working fine.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20049
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 440b85f5b1)
[ solve conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:30:05 +01:00
Christian Marangi
dc11868486 airoha: backport upstream fixes for pinctrl PHY LED and MDIO
Backport fixes for Airoha pinctrl driver for PHY LED and MDIO bus. This
fix a copy-paste error for PHY LED and a misconfiguration for MT7530
embedded Switch MDIO bus GPIO pin to permit usage of external PHYs.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 35ff70e807)
2025-11-10 17:30:05 +01:00
Christian Marangi
6a7b16e616 airoha: add NPU and reserved memory node for AN7581
Add the NPU and reserved memory node for AN7581 dtsi since it's not
supported.

Link: https://github.com/openwrt/openwrt/pull/19816
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3dca527e6d)
2025-11-10 17:30:05 +01:00
Christian Marangi
671f4d53ac airoha: major backport of Airoha Ethernet driver feature support
Major backport of upstream patch for support of multiple feature of the
Airoha Ethernet driver.

Feature backported are TSO, Jumbo packet, Offload and initial Wlan
Offload support.

Link: https://github.com/openwrt/openwrt/pull/19816
(cherry picked from commit 9d3009f426)
[ add missing kconfig flag ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:29:48 +01:00
Christian Marangi
bac7ee02f9 airoha: backport trivial fixes for pinctrl and ethernet driver
Backport trivial fixes from upstream related to pinctrl and ethernet
driver.

Link: https://github.com/openwrt/openwrt/pull/19816
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 354d7472d5)
2025-11-10 17:24:44 +01:00
Christian Marangi
3b1fc6661a airoha: backport patch adding support for AN7581 Ethernet PHY
Backport patch adding support for AN7581 Ethernet PHY based on the same
Mediatek embedded Switch PHY.

Link: https://github.com/openwrt/openwrt/pull/19816
(cherry picked from commit 0adaeff5ee)
[ rework backported patch ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-10 17:24:10 +01:00
Christian Marangi
a6e8cbdf53 airoha: replace thermal patch with upstream version
Replace thermal patch with upstream version. The thermal maintainer
reported that the sysfs entry are considered deprecated and that slope
and offset should be handled internally to the driver.

Link: https://github.com/openwrt/openwrt/pull/19816
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a713260966)
2025-11-10 17:11:10 +01:00
Tianling Shen
a167e68c76 mediatek: add Konka KOMI A31 support
This board is also as known as E-Life ETR631-T/ETR635-U.

Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 128 MB SPI-NAND
  RAM: 256MB DDR3
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, Mesh
  Power: DC 12V 1A

Gain telnet access:
1. Login into web interface, and download the configuration.
2. Uncompress the configuration:
     * Enter fakeroot if you are not login as root.
   tar -zxf <filename>.tar.gz
3. Edit 'etc/passwd', remove root password: 'root::1:0:99999:7:::'.
4. Edit 'etc/rc.local', insert telnetd command before 'exit 0':
   ( sleep 3s; telnetd; ) &
5. Repack the configuration:
   tar -zcf backup.tar.gz etc/
6. Upload new configuration via web interface, now you can connect to
   KOMI A31 via telnet.

Flash instructions:
1. Connect to KOMI A31, backup everything, especially 'Factory' part.
2. Write new BL2:
   mtd write openwrt-mediatek-filogic-konka_komi-a31-preloader.bin BL2
3. Write new FIP:
   mtd write openwrt-mediatek-filogic-konka_komi-a31-bl31-uboot.fip FIP
4. Set static IP on your PC:
   IP 192.168.1.254/24, GW 192.168.1.1
5. Serve OpenWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After OpenWrt has booted, perform sysupgrade.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20357
(cherry picked from commit 8a7de107d8)
[rebase uboot patches upon 24.10 branch]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20595
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:42:06 +01:00
Luis Mita
d414ed185e ramips: mt76x8: add support for Cudy RE1200 Outdoor v1
Hardware:
 - SoC: MediaTek MT7628DAN
 - Flash: 8 MiB XMC 25QH64CHIQ
 - RAM: 64 MiB (integrated on SoC)
 - WLAN: 2.4 GHz (MT7603E, 11n), 5 GHz (MediaTek MT7613BEN, 11ac)
 - Ethernet: 1x10/100 Mbps LAN
 - Buttons: 1 Reset button, 1 WPS button
 - LEDs: 5x Green
 - Serial Console: unpopulated header 115200 8n1
 - Power: 24v Passive POE

MAC addresses:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| LAN     | 80:af:ca:xx:xx:x0 | label     |
| WLAN 2g | 80:af:ca:xx:xx:x0 | label     |
| WLAN 5g | 80:af:ca:xx:xx:x2 | +2        |
+---------+-------------------+-----------+

Installation:
Please check the Wiki for this device for a more convenient solution than the one below.

1. Disassemble the device, desolder and dump the flash chip with a SPI programmer.
2. Separate the partitions with dd:

dd if=spi_dump.bin of=u-boot.bin     bs=1  skip=0        count=196608  status=progress
dd if=spi_dump.bin of=u-boot-env.bin bs=1  skip=196608   count=65536   status=progress
dd if=spi_dump.bin of=factory.bin    bs=1  skip=262144   count=65536   status=progress
dd if=spi_dump.bin of=firmware.bin   bs=1  skip=327680   count=7995392 status=progress
dd if=spi_dump.bin of=bdinfo.bin     bs=1  skip=8323072   count=65536   status=progress

3. Download the sysupgrade firmware at openwrt.bin.
4. The firmware size should be 7995392 bytes. Fix the size of your firmware putting zeros to the end, with:

truncate -s 7995392 firmware.bin

5. Combine all the parititions:

cat u-boot.bin u-boot-env.bin factory.bin openwrt.bin bdinfo.bin > spi_new.bin

6. Erase and flash the SPI chip with the new file. Solder the chip and boot the router.

Signed-off-by: Luis Mita <luis@luismita.com>
Link: https://github.com/openwrt/openwrt/pull/20381
(cherry picked from commit 65215e6d46)
Link: https://github.com/openwrt/openwrt/pull/20463
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:39:45 +01:00
Tianling Shen
c3b4e8e531 rockchip: add Lunzn FastRhino R66S support
Hardware
--------
RockChip RK3568 ARM64 (4 cores)
1/2GB LPDDR4 RAM
2x 2500 Base-T (PCIe, r8125b)
1 LED (Power)
1 Button (Reset)
Micro-SD Slot
2x USB 3.0 Port
12V DC Jack

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

Tested-by: Francisco G Luna <frangonlun@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/19990
(cherry picked from commit d76a774270)
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20618
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:36:56 +01:00
Tianling Shen
32a2193a48 uboot-rockchip: add Fastrhino R66S support
Add support for the Lunzn FastRhino R66S board.

Tested-by: Francisco G Luna <frangonlun@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/19990
(cherry picked from commit 678536740e)
[rebase patches upon 24.10 branch]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20618
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:36:56 +01:00
Shiji Yang
a902c0d020 ramips: dts: increase maximum MMC clock frequency
The High-Speed SD mode stability issue should have been fixed.
Increase the MMC max-frequency to improve the IO speed. We can
still use the sysfs to limit the clock frequency, e.g.

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

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
(cherry picked from commit 143cfd6113)
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20258
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:26:35 +01:00
Shiji Yang
43c1a0440f ramips: mtk-sd: stability improvements for MIPS mt762x SoCs
* Add tuning parameters to improve the stability of 48~50 MHz
  High-Speed SD mode.

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

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
(cherry picked from commit 3f78e5c918)
[removed kernel 6.12 patches]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20258
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:26:34 +01:00
Shiji Yang
0be05cdf72 ramips: mtk-sd: backport Host Software Queue support
This new feature has some improvements for random RW performance.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
(cherry picked from commit db76fe6a02)
[removed kernel 6.12 patches]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20258
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:26:34 +01:00
Shiji Yang
0ed371472c ramips: mtk-mmc: fix data timeout value
The MT7628 programing guide shows that the correct DTOC unit is
1048576 clocks instead of 65536 clocks. This value is also used
by linux upstream mtk-sd driver. Correct the DTOC register and
also round up its value.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18896
(cherry picked from commit e69c867cdf)
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20258
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:26:34 +01:00
Shiji Yang
550fa37533 ramips: dts: adjust the power regulators of MMC controller
- Fix MMC bus IO voltage. The GPIO voltage of mt762x series SoCs
  is fixed 3.3V. There are no visible registers that can control
  the voltage level. Also add "no-1-8-v" property to indicate that
  MMC controller doesn't support 1.8V IO.

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

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18886
(cherry picked from commit afdf88b9a1)
[rebased upon 24.10 branch]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20258
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:26:34 +01:00
Goetz Goerisch
9837ae4002 kernel: bump 6.6 to 6.6.116
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.116

All patches auto-refreshed.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20598
(cherry picked from commit 099633be82)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20701
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:21:42 +01:00
Goetz Goerisch
597598baa9 kernel: bump 6.6 to 6.6.115
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.115

Patch manual updated:
- starfive/patches-6.6/0067-driver-uart-fix-up-uart-communicate-fail.patch [1]

All patches auto-refreshed.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.115&id=f354f7510ff0efaa1735093625749fc788ec67d1

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20598
(cherry picked from commit 6526d6d057)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20701
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-09 14:21:42 +01:00
Hang Zhou
aa03dfeb96 bmips: fix leds on f@st3864op
gpio-leds were not working on F@ST3864OP before https://github.com/openwrt/openwrt/pull/17527 was merged.

This pull request adds definitions for all LEDs, including the previously
non-working WAN LEDs.

Signed-off-by: Hang Zhou <929513338@qq.com>
Link: https://github.com/openwrt/openwrt/pull/20533
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 6de96914e5)
2025-11-06 09:57:37 +01:00
Andreas Gnau
a38b0c94dd tools/ccache: same behaviour for local and CI builds
If the environment variable `CI` is set, ccache will enable the CMake
option CCACHE_DEV_MODE by default. This leads to differing behaviour
between local and CI builds which takes quite some time to debug. 🤯

Achieve consistent behaviour between local builds and CI builds by
setting CCACHE_DEV_MODE. Set it to OFF, because CCACHE_DEV_MODE amongst
other settings like linker choice, enables -Werror, which will lead to
potential compilation failures when the host compiler is updated. Using
-Werror for host utils is not desirable, because the compiler version
used is not controlled by the OpenWrt build system and host utils should
compile successfully on an as wide range of host OSes as possible.

Reported-by: Roman Azarenko <roman.azarenko@iopsys.eu>
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/20290
(cherry picked from commit 6f32c657db)
Link: https://github.com/openwrt/openwrt/pull/20334
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-04 15:13:05 +01:00
Robert Marko
99e62c21c6 mold: dont allow on MacOS
Mold does not really work on MacOS, when attempting to use it for example
for ubus:
mold: get_self_path is not supportedcollect2: error: ld returned 1 exit status

Which was introduced by [1] so it seems that MacOS is not supported, so
lets make it non selectable when MacOS is the host.

[1] f9a37e9dd4

Link: https://github.com/openwrt/openwrt/pull/18575
(cherry picked from commit 3c65dc3678)
Link: https://github.com/openwrt/openwrt/pull/20621
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-03 10:21:02 +01:00
Zxl hhyccc
984a219781 kernel: bump 6.6 to 6.6.114
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.114

Removed upstreamed:
/target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch

merged upstream with commit: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.114&id=499089376206f3f7f09d6852b3ec92f2674d24bb

All other patches automatically rebased.

Build system: bcm4908
Build system: bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20434
(cherry picked from commit 8103b79776)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20551
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-28 22:16:44 +01:00
Zxl hhyccc
8d90e178b1 kernel: bump 6.6 to 6.6.113
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.113

Manually rebased:

/target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch

Dropped patch

/target/linux/generic/backport-6.6/541-v6.18-ksmbd-add-max-ip-connections-parameter.patch

merged upstream with commit:  https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.6.y&id=bc718d0bd87e372f7786c0239e340f3577ac94fa

All other patches automatically rebased.

Build system: bcm4908
Build system: bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20434
(cherry picked from commit d1d8febc42)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20551
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-28 22:16:44 +01:00
Zxl hhyccc
5902917588 kernel: bump 6.6 to 6.6.112
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.112

All patches automatically rebased.

Build system: bcm4908
Build system: bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20434
(cherry picked from commit 32062152a8)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20551
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-28 22:16:44 +01:00
Zxl hhyccc
630354031a kernel: bump 6.6 to 6.6.111
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.111

All patches automatically rebased.

Build system: bcm4908
Build system: bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20434
(cherry picked from commit 70df331a8e)
Link: https://github.com/openwrt/openwrt/pull/20551
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-28 22:16:44 +01:00
Christoph Krapp
2d758300e3 ath79: add calibration variant for TP-Link Archer C60 v2
Now that we have a board file, add calibration variant for TP-Link
Archer C60 v2 and add ipq-wifi package for it.

Tested-by: Semih Baskan <strstgs@gmail.com>
Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20496
Link: https://github.com/openwrt/openwrt/pull/20497
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-24 12:05:32 +02:00
Christoph Krapp
dbf2c101ed ipq-wifi: Add entry for TP-Link Archer C60 v2
Add IPQ Wifi entry for ath79 TP-Link Archer C60 v2.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20496
Link: https://github.com/openwrt/openwrt/pull/20497
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-24 12:05:32 +02:00
Robert Marko
ef3b14e06c ipq-wifi: update to Git HEAD (2025-10-22)
c585e435c611 ipq6018: add jdcloud_re-cs-02 BDF
14aef623f3e5 qcn9074: add jdcloud_re-cs-02 BDF
ec6831a43ff0 qca9888: replace TP-Link Archer C60 v2 BDF

Link: https://github.com/openwrt/openwrt/pull/20497
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-24 12:05:32 +02:00
Christian Marangi
bdb89ee6df image: fix race between mkits.sh and mkimage in .itb squashfs generation
With further investigation it was found a race in generating .itb images
that include a RootFS caused by the mkits.sh and the mkimage.

Due to the fact that mkits.sh generates a .pagesync image of the passed
rootfs, it can happen that, concurrently, mkimage can be called at the
same time mkits.sh is creating another .pagesync for the same rootfs.

This cause mkimage to use an half made rootfs.pagesync creating a
corrupted image.

To address this, also protect the mkimage with the same lock used for
mkits.sh preventing any kind of concurrent usage/generation of the
rootfs.pagesync blob

Fixes: 52cc9d82f1 ("kernel: rework Initramfs locking logic")
Link: https://github.com/openwrt/openwrt/pull/20492
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3de1bbd5ae)
2025-10-23 18:16:33 +02:00
Robert Marko
debc420622 at91bootstrap: put at91bootstrap images into image staging directory
Currently, building at91 subtargets via image builder will fail as the
required built at91bootstrap is not present in the image builder at all
since its presumed to be in the binary directory which obviously does not
exist yet.

So, lets install the at91bootstrap binary into image staging directory and
use that instead

Link: https://github.com/openwrt/openwrt/pull/18414
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit a947be41b7)
2025-10-22 18:19:42 +02:00
Robert Marko
c5d7ef41f8 at91: put u-boot images into image staging directory
Currently, building at91 subtargets via image builder will fail as the
required built u-boot is not present in the image builder at all since its
presumed to be in the binary directory which obviously does not exist yet.

So, lets install the u-boot binary into image staging directory and use
that instead.

Link: https://github.com/openwrt/openwrt/pull/18414
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 4724331d70)
2025-10-22 18:19:37 +02:00
Robert Marko
be73a7f033 at91: add USB kmods only for subtargets that support USB
Currently, kmod-usb-ohci,kmod-at91-udc and kmod-usb-gadget-eth are included
as the default packages for all at91 subtargets.

However, this is breaking image builder as kmod-at91-udc is not being built
on sama7 since it depends on USB_SUPPORT and sama7 does not have USB support
enabled in the kernel as its not supported upstream so its not even
selectable in the config.

So, move to include these as default packages only for sama5 and sama9x as
both of those have USB support enabled.

Fixes: #18407
Link: https://github.com/openwrt/openwrt/pull/18413
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 02d3aa72bb)
2025-10-22 18:19:28 +02:00
Robert Marko
d4eb33990b layerscape: armv7: drop skipped packages
Now that all packages that relied on the skip mechanism are selected
via BUILD_DEVICES or by defaulting for the subtarget drop them from
individual DEVICE_PACKAGES so that Image Builder works again for armv7.

Fixes: #18411
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 8cb7919a13)
2025-10-22 18:19:10 +02:00
Robert Marko
fa3632f332 ls-rcw: select by default for layerscape/armv7
Currently, ls-rcw package is being included in the individual
profile DEVICE_PACKAGES but using the feature that allows skipping their
inclusion in the end image package list if prefixed with a tilde(~) which
was added in:
377b66990b ("build: introduce support to declare skip package")

But it not added to Image Builder so currently trying to build layerscape
device images in Image Builder will fail with:
ERROR: '~ls-rcw' is not a valid world dependency, format is name(@tag)([<>~=]version)

So, instead of having to rely on support for skipping package installation
and declaring the ls-rcw package in DEVICE_PACKAGES lets select it when
layerscape/armv7 target is selected.

Fixes: #18411
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 598a0556b7)
2025-10-22 18:19:10 +02:00
Robert Marko
5c6e95c5b4 layerscape: armv8_64b: drop skipped packages
Now that all packages that relied on the skip mechanism are selected
via BUILD_DEVICES or by defaulting for the subtarget drop them from
individual DEVICE_PACKAGES so that Image Builder works again for armv8_64b.

Fixes: #18412
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit c04eaad12a)
2025-10-22 18:19:10 +02:00
Robert Marko
c39bc0375f ls-ddr-phy: select by default for layerscape/armv8_64b
Currently, ls-ddr-phy package is being included in the individual
profile DEVICE_PACKAGES but using the feature that allows skipping their
inclusion in the end image package list if prefixed with a tilde(~) which
was added in:
377b66990b ("build: introduce support to declare skip package")

But it not added to Image Builder so currently trying to build layerscape
device images in Image Builder will fail with:
ERROR: '~ls-ddr-phy' is not a valid world dependency, format is name(@tag)([<>~=]version)

So, instead of having to rely on support for skipping package installation
and declaring the ls-ddr-phy package in DEVICE_PACKAGES lets select it when
layerscape/armv8_64b target is selected.

Fixes: #18412
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 8a28ddafe7)
2025-10-22 18:19:10 +02:00
Robert Marko
9f630a4141 ls-dpl: select by default for layerscape/armv8_64b
Currently, ls-dpl package is being included in the individual
profile DEVICE_PACKAGES but using the feature that allows skipping their
inclusion in the end image package list if prefixed with a tilde(~) which
was added in:
377b66990b ("build: introduce support to declare skip package")

But it not added to Image Builder so currently trying to build layerscape
device images in Image Builder will fail with:
ERROR: '~ls-dpl' is not a valid world dependency, format is name(@tag)([<>~=]version)

So, instead of having to rely on support for skipping package installation
and declaring the ls-dpl package in DEVICE_PACKAGES lets select it when
layerscape/armv8_64b target is selected.

Fixes: #18412
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 84437eeec0)
2025-10-22 18:19:10 +02:00
Robert Marko
ebcda1d7da ls-mc: select by default for layerscape/armv8_64b
Currently, ls-mc package is being included in the individual
profile DEVICE_PACKAGES but using the feature that allows skipping their
inclusion in the end image package list if prefixed with a tilde(~) which
was added in:
377b66990b ("build: introduce support to declare skip package")

But it not added to Image Builder so currently trying to build layerscape
device images in Image Builder will fail with:
ERROR: '~ls-mc' is not a valid world dependency, format is name(@tag)([<>~=]version)

So, instead of having to rely on support for skipping package installation
and declaring the ls-mc package in DEVICE_PACKAGES lets select it when
layerscape/armv8_64b target is selected.

Fixes: #18412
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 2fb3efda0a)
2025-10-22 18:19:10 +02:00
Robert Marko
975552ea14 fman-ucode: select by default for layerscape/armv8_64b
Currently, fman-ucode package is being included in the individual
profile DEVICE_PACKAGES but using the feature that allows skipping their
inclusion in the end image package list if prefixed with a tilde(~) which
was added in:
377b66990b ("build: introduce support to declare skip package")

But it not added to Image Builder so currently trying to build layerscape
device images in Image Builder will fail with:
ERROR: '~fman-ucode' is not a valid world dependency, format is name(@tag)([<>~=]version)

So, instead of having to rely on support for skipping package installation
and declaring the fman-ucode package in DEVICE_PACKAGES lets select it when
layerscape/armv8_64b target is selected.

Fixes: #18412
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 22f02beaab)
2025-10-22 18:19:10 +02:00
Robert Marko
4108db2bd8 tfa-layerscape: set BUILD_DEVICES
Currently, tfa-layerscape packages are being included in the individual
profile DEVICE_PACKAGES but using the feature that allows skipping their
inclusion in the end image package list if prefixed with a tilde(~) which
was added in:
377b66990b ("build: introduce support to declare skip package")

But it not added to Image Builder so currently trying to build layerscape
device images in Image Builder will fail with:
ERROR: '~trusted-firmware-a-ls1012a-frdm' is not a valid world dependency, format is name(@tag)([<>~=]version)

So, instead of having to rely on support for skipping package installation
and declaring the individual TFA packages in DEVICE_PACKAGES we can just
do what other targets do and set BUILD_DEVICES so that TFA packages are
automatically set.

Fixes: #18412
Link: https://github.com/openwrt/openwrt/pull/18462
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 03ab770da5)
2025-10-22 18:19:10 +02:00
Robert Marko
4b7728ba8b bcm63xx-cfe: install into image staging dir
Currently, bcm63xx-cfe is being installed into kernel build dir, however
that does not work for Image Builder as only certain artifacts from kernel
build dir are included in Image Builder.

So, simply install bcm63xx-cfe into image staging dir so its artifacts can
be used in Image Builder as well.

Fixes: #18408
Fixes: #18409
Link: https://github.com/openwrt/openwrt/pull/18463
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 4a7de50769)
2025-10-22 18:17:40 +02:00
Eric Fahlgren
4ead11296a targetwide: imagebuilder: add explicit guards around initramfs rules
Additional work building upon f6e0f57be0

Add more explict guards around the unsupported generation of the initramfs
images and suppress requirement for certain others.

Fixes: https://github.com/openwrt/openwrt/issues/20151
Fixes: https://github.com/openwrt/asu/issues/1499
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20460
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit f5fd7ef888)
2025-10-21 11:39:10 +02:00
Hauke Mehrtens
859ff7a978 OpenWrt v24.10.4: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-21 00:00:26 +02:00
444 changed files with 37203 additions and 1712 deletions

View File

@@ -5,8 +5,14 @@ on:
permissions:
contents: read
pull-requests: write
jobs:
build:
name: Test Formalities
uses: openwrt/actions-shared-workflows/.github/workflows/formal.yml@main
# with:
# # Post formality check summaries to the PR.
# # Repo's permissions need to be updated for actions to modify PRs:
# # https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
# post_comment: true

View File

@@ -176,6 +176,7 @@ menu "Global build settings"
config MOLD
depends on (aarch64 || arm || i386 || i686 || m68k || powerpc || powerpc64 || sh4 || x86_64)
depends on !GCC_USE_VERSION_11
depends on !HOST_OS_MACOS
def_bool $(shell, ./config/check-hostcxx.sh 10 2 12)
config USE_MOLD

View File

@@ -1,4 +1,4 @@
src-git packages https://git.openwrt.org/feed/packages.git^f1470815f41fe199bfdafe9a91ad115bc2e91203
src-git luci https://git.openwrt.org/project/luci.git^75e41cba5160281b2d1dca922719efef29f7ffd8
src-git routing https://git.openwrt.org/feed/routing.git^3eb59e9471858c83891979793f1dd29cca156919
src-git telephony https://git.openwrt.org/feed/telephony.git^2a4541d46199ac96fac214d02c908402831c4dc6
src-git packages https://git.openwrt.org/feed/packages.git^953b6d47b4e9f0ad3c39547c6d3f9a828f10e206
src-git luci https://git.openwrt.org/project/luci.git^d88390be4ec9722cb427fee03368fc8c8582627d
src-git routing https://git.openwrt.org/feed/routing.git^178a40d321d6c11f18528f34777f4e24ce62b19a
src-git telephony https://git.openwrt.org/feed/telephony.git^92892fa285360b8981f62bf4e0a097e6449e7e33

View File

@@ -391,8 +391,9 @@ define Build/fit
$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtbo)) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION), gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))))
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new
$(call locked,PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new, \
gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))))
@mv $@.new $@
endef

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .110
LINUX_KERNEL_HASH-6.6.110 = 1bf20daf5543b8759f325e55fb0da4913715e68741627a13380e66aaf219fb1d
LINUX_VERSION-6.6 = .119
LINUX_KERNEL_HASH-6.6.119 = 3da09b980bb404cc28793479bb2d6c636522679215ffa65a04c893575253e5e8

View File

@@ -248,7 +248,7 @@ endif
)
endif
$(INSTALL_DIR) $$(PDIR_$(1))/tmp
$(INSTALL_DIR) $$(PDIR_$(1))
ifeq ($(CONFIG_USE_APK),)
mkdir -p $$(IDIR_$(1))/CONTROL

View File

@@ -201,7 +201,7 @@ else
DOWNLOAD_DIRS = package/download
endif
download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile)
download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile) $(if $(wildcard $(STAGING_DIR_HOST)/bin/zstd),,tools/zstd/compile)
@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
clean dirclean: .config

View File

@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.4)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.5)
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r28959-29397011cc)
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r29087-d9c5716d1d)
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.4)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.5)
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)

View File

@@ -315,3 +315,10 @@ macaddr_canonicalize() {
dt_is_enabled() {
grep -q okay "/proc/device-tree/$1/status"
}
get_linux_version() {
local ver=$(uname -r)
local minor=${ver%\.*}
printf "%d%02d%03d" ${ver%%\.*} ${minor#*\.} ${ver##*\.} 2>/dev/null
}

View File

@@ -190,7 +190,7 @@ if VERSIONOPT
config VERSION_REPO
string
prompt "Release repository"
default "https://downloads.openwrt.org/releases/24.10.4"
default "https://downloads.openwrt.org/releases/24.10.5"
help
This is the repository address embedded in the image, it defaults
to the trunk snapshot repo; the url may contain the following placeholders:

View File

@@ -201,4 +201,9 @@ define Build/Compile
CROSS_COMPILE=$(TARGET_CROSS)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(BINARIES_DIR)/at91bootstrap.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-at91bootstrap.bin
endef
$(eval $(call BuildPackage/AT91Bootstrap))

View File

@@ -43,6 +43,7 @@ endef
define Trusted-Firmware-A/Default
BUILD_TARGET:=layerscape
BUILD_SUBTARGET:=armv8_64b
BUILD_DEVICES:=fsl_$(1)
DEPENDS:=+layerscape-rcw +u-boot-fsl_$(1)
endef

View File

@@ -179,4 +179,9 @@ define Build/Compile
$(UBOOT_MAKE_FLAGS)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)
endef
$(eval $(call BuildPackage/U-Boot))

View File

@@ -38,6 +38,7 @@ cmcc,a10-ubootmod|\
cudy,tr3000-v1-ubootmod|\
h3c,magic-nx30-pro|\
jcg,q30-pro|\
konka,komi-a31|\
mercusys,mr90x-v1-ubi|\
netcore,n60|\
netis,nx31|\

View File

@@ -326,6 +326,18 @@ define U-Boot/mt7981_jcg_q30-pro
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
endef
define U-Boot/mt7981_konka_komi-a31
NAME:=Konka KOMI A31
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=konka_komi-a31
UBOOT_CONFIG:=mt7981_konka_komi-a31
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand
BL2_SOC:=mt7981
BL2_DDRTYPE:=ddr3
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
endef
define U-Boot/mt7981_netis_nx31
NAME:=netis NX31
BUILD_SUBTARGET:=filogic
@@ -876,6 +888,7 @@ UBOOT_TARGETS := \
mt7981_glinet_gl-xe3000 \
mt7981_h3c_magic-nx30-pro \
mt7981_jcg_q30-pro \
mt7981_konka_komi-a31 \
mt7981_netis_nx31 \
mt7981_nokia_ea0326gmp \
mt7981_openwrt_one-snand \

View File

@@ -0,0 +1,68 @@
Subject: [PATCH] mtd: spinand: esmt: add support for F50L1G41LC
This adds support for ESMT F50L1G41LC, which appears to be an updated
version of the already supported F50L1G41LB.
Add esmt_8c SPI_NAND manufacturer to account for the newly used vendor
ID with support for the ESMT F50L1G41LC chip.
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -834,6 +834,7 @@ static const struct spinand_manufacturer
&toshiba_spinand_manufacturer,
&winbond_spinand_manufacturer,
&esmt_c8_spinand_manufacturer,
+ &esmt_8c_spinand_manufacturer,
&xtx_spinand_manufacturer,
};
--- a/drivers/mtd/nand/spi/esmt.c
+++ b/drivers/mtd/nand/spi/esmt.c
@@ -13,6 +13,7 @@
/* ESMT uses GigaDevice 0xc8 JECDEC ID on some SPI NANDs */
#define SPINAND_MFR_ESMT_C8 0xc8
+#define SPINAND_MFR_ESMT_8C 0x8c
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
@@ -104,6 +105,18 @@ static const struct mtd_ooblayout_ops f5
.rfree = f50l1g41lb_ooblayout_free,
};
+static const struct spinand_info esmt_8c_spinand_table[] = {
+ SPINAND_INFO("F50L1G41LC",
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x2C),
+ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
+ NAND_ECCREQ(1, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ &write_cache_variants,
+ &update_cache_variants),
+ 0,
+ SPINAND_ECCINFO(&f50l1g41lb_ooblayout, NULL)),
+};
+
static const struct spinand_info esmt_c8_spinand_table[] = {
SPINAND_INFO("F50L1G41LB",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x01),
@@ -135,3 +148,11 @@ const struct spinand_manufacturer esmt_c
.nchips = ARRAY_SIZE(esmt_c8_spinand_table),
.ops = &esmt_spinand_manuf_ops,
};
+
+const struct spinand_manufacturer esmt_8c_spinand_manufacturer = {
+ .id = SPINAND_MFR_ESMT_8C,
+ .name = "ESMT",
+ .chips = esmt_8c_spinand_table,
+ .nchips = ARRAY_SIZE(esmt_8c_spinand_table),
+ .ops = &esmt_spinand_manuf_ops,
+};
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -252,6 +252,7 @@ extern const struct spinand_manufacturer
extern const struct spinand_manufacturer toshiba_spinand_manufacturer;
extern const struct spinand_manufacturer winbond_spinand_manufacturer;
extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
+extern const struct spinand_manufacturer esmt_8c_spinand_manufacturer;
extern const struct spinand_manufacturer xtx_spinand_manufacturer;
/**

View File

@@ -0,0 +1,328 @@
--- /dev/null
+++ b/configs/mt7981_konka_komi-a31_defconfig
@@ -0,0 +1,107 @@
+CONFIG_ARM=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-konka-komi-a31"
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_TARGET_MT7981=y
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
+CONFIG_DEBUG_UART_BASE=0x11002000
+CONFIG_DEBUG_UART_CLOCK=40000000
+CONFIG_SYS_LOAD_ADDR=0x46000000
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+CONFIG_BOOTDELAY=30
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-konka-komi-a31.dtb"
+CONFIG_LOGLEVEL=7
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_LOG=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="MT7981> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
+CONFIG_CMD_BOOTMENU=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_TFTPSRV=y
+CONFIG_CMD_RARP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CDP=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_LINK_LOCAL=y
+CONFIG_CMD_PXE=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_PSTORE=y
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
+CONFIG_CMD_UUID=y
+CONFIG_CMD_HASH=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_UBI=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_ENV_UBI_PART="ubi"
+CONFIG_ENV_UBI_VOLUME="ubootenv"
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="konka_komi-a31_env"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
+CONFIG_USE_IPADDR=y
+CONFIG_IPADDR="192.168.1.1"
+CONFIG_USE_SERVERIP=y
+CONFIG_SERVERIP="192.168.1.254"
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
+CONFIG_CLK=y
+CONFIG_GPIO_HOG=y
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_MTD_SPI_NAND=y
+CONFIG_MTD_UBI_FASTMAP=y
+CONFIG_PHY_FIXED=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PHY=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7981=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_RAM=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_MTK_SPIM=y
+CONFIG_ZSTD=y
+CONFIG_HEXDUMP=y
+CONFIG_LMB_MAX_REGIONS=64
--- /dev/null
+++ b/arch/arm/dts/mt7981-konka-komi-a31.dts
@@ -0,0 +1,158 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/dts-v1/;
+#include "mt7981.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "Konka KOMI A31";
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
+
+ chosen {
+ stdout-path = &uart0;
+ tick-timer = &timer0;
+ };
+
+ memory@40000000 {
+ device_type = "memory";
+ reg = <0x40000000 0x10000000>;
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ button-mesh {
+ label = "mesh";
+ linux,code = <BTN_9>;
+ linux,input-type = <EV_SW>;
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+ };
+
+ button-reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ green_led: led-0 {
+ label = "green:status";
+ gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ led-1 {
+ label = "blue:status";
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ red_led: led-2 {
+ label = "red:status";
+ gpios = <&gpio 34 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+ };
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "2500base-x";
+ mediatek,switch = "mt7531";
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
+
+ fixed-link {
+ speed = <2500>;
+ full-duplex;
+ };
+};
+
+&pinctrl {
+ spi_flash_pins: spi0-pins-func-1 {
+ mux {
+ function = "flash";
+ groups = "spi0", "spi0_wp_hold";
+ };
+
+ conf-pu {
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
+ };
+
+ conf-pd {
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
+ };
+ };
+};
+
+&spi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_flash_pins>;
+ status = "okay";
+ must_tx;
+ enhance_timing;
+ dma_ext;
+ ipm_design;
+ support_quad;
+ tick_dly = <2>;
+ sample_sel = <0>;
+
+ spi_nand@0 {
+ compatible = "spi-nand";
+ reg = <0>;
+ spi-max-frequency = <52000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "bl2";
+ reg = <0x0 0x100000>;
+ };
+
+ partition@100000 {
+ label = "u-boot-env";
+ reg = <0x100000 0x80000>;
+ };
+
+ partition@180000 {
+ label = "factory";
+ reg = <0x180000 0x200000>;
+ };
+
+ partition@380000 {
+ label = "fip";
+ reg = <0x380000 0x200000>;
+ };
+
+ partition@580000 {
+ label = "ubi";
+ reg = <0x580000 0x7a80000>;
+ compatible = "linux,ubi";
+ };
+ };
+ };
+};
+
+&uart0 {
+ mediatek,force-highspeed;
+ status = "okay";
+};
+
+&watchdog {
+ status = "disabled";
+};
--- /dev/null
+++ b/konka_komi-a31_env
@@ -0,0 +1,54 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
+bootconf=config-1
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-konka_komi-a31-initramfs-recovery.itb
+bootfile_bl2=openwrt-mediatek-filogic-konka_komi-a31-preloader.bin
+bootfile_fip=openwrt-mediatek-filogic-konka_komi-a31-bl31-uboot.fip
+bootfile_upg=openwrt-mediatek-filogic-konka_komi-a31-squashfs-sysupgrade.itb
+bootled_pwr=red:status
+bootled_rec=blue:status
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
+bootmenu_default=0
+bootmenu_delay=0
+bootmenu_title= ( ( ( OpenWrt ) ) )
+bootmenu_0=Initialize environment.=run _firstboot
+bootmenu_0d=Run default boot command.=run boot_default
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
+bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return
+bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
+bootmenu_8=Reboot.=reset
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
+boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
+boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
+mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
+mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"

View File

@@ -13,7 +13,7 @@ Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -663,19 +663,13 @@ static init_fnc_t init_sequence_r[] = {
@@ -651,19 +651,13 @@ static init_fnc_t init_sequence_r[] = {
serial_initialize,
initr_announce,
dm_announce,
@@ -33,7 +33,7 @@ Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
#if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT)
/*
* Do early PCI configuration _before_ the flash gets initialised,
@@ -690,7 +684,6 @@ static init_fnc_t init_sequence_r[] = {
@@ -678,7 +672,6 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_MTD_NOR_FLASH
initr_flash,
#endif
@@ -41,7 +41,7 @@ Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86)
/* initialize higher level parts of CPU like time base and timers */
cpu_init_r,
@@ -719,6 +712,10 @@ static init_fnc_t init_sequence_r[] = {
@@ -707,6 +700,10 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_PVBLOCK
initr_pvblock,
#endif

View File

@@ -219,6 +219,20 @@ define U-Boot/bpi-r2-pro-rk3568
sinovoip_bpi-r2-pro
endef
define U-Boot/easepi-r1-rk3568
$(U-Boot/rk3568/Default)
NAME:=LinkEase EasePi R1
BUILD_DEVICES:= \
linkease_easepi-r1
endef
define U-Boot/fastrhino-r66s-rk3568
$(U-Boot/rk3568/Default)
NAME:=FastRhino R66S
BUILD_DEVICES:= \
lunzn_fastrhino-r66s
endef
define U-Boot/nanopi-r5c-rk3568
$(U-Boot/rk3568/Default)
NAME:=NanoPi R5C
@@ -333,6 +347,8 @@ UBOOT_TARGETS := \
radxa-zero-3-rk3566 \
rock-3c-rk3566 \
bpi-r2-pro-rk3568 \
easepi-r1-rk3568 \
fastrhino-r66s-rk3568 \
nanopi-r5c-rk3568 \
nanopi-r5s-rk3568 \
radxa-e25-rk3568 \

View File

@@ -0,0 +1,132 @@
From 37a5383059d0c3d8a72394cbffef775042a40acd Mon Sep 17 00:00:00 2001
From: Tianling Shen <cnsztl@gmail.com>
Date: Mon, 8 Sep 2025 19:32:18 +0800
Subject: [PATCH] board: rockchip: add Lunzn FastRhino R66S
Lunzn Fastrhino R66S is a high-performance mini router.
Specification:
- Rockchip RK3568
- 1/2GB LPDDR4 RAM
- SD card slot
- 2x USB 3.0 Port
- 2x 2500 Base-T (PCIe, r8125b)
- 12v DC Jack
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
.../arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi | 3 +
board/rockchip/evb_rk3568/MAINTAINERS | 7 ++
configs/fastrhino-r66s-rk3568_defconfig | 64 +++++++++++++++++++
doc/board/rockchip/rockchip.rst | 1 +
4 files changed, 75 insertions(+)
create mode 100644 arch/arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi
create mode 100644 configs/fastrhino-r66s-rk3568_defconfig
--- /dev/null
+++ b/arch/arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "rk356x-u-boot.dtsi"
+
+/ {
+ chosen {
+ stdout-path = &uart2;
+ };
+};
--- a/board/rockchip/evb_rk3568/MAINTAINERS
+++ b/board/rockchip/evb_rk3568/MAINTAINERS
@@ -14,6 +14,13 @@ F: configs/evb-rk3568_defconfig
F: arch/arm/dts/rk3568-evb-u-boot.dtsi
F: arch/arm/dts/rk3568-evb.dts
+FASTRHINO-R66S-RK3568
+M: Tianling Shen <cnsztl@gmail.com>
+R: Jonas Karlman <jonas@kwiboo.se>
+S: Maintained
+F: configs/fastrhino-r66s-rk3568_defconfig
+F: arch/arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi
+
GENERIC-RK3568
M: Jonas Karlman <jonas@kwiboo.se>
S: Maintained
--- /dev/null
+++ b/configs/fastrhino-r66s-rk3568_defconfig
@@ -0,0 +1,65 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-fastrhino-r66s"
+CONFIG_ROCKCHIP_RK3568=y
+CONFIG_SPL_SERIAL=y
+CONFIG_DEBUG_UART_BASE=0xFE660000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_PCI=y
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-fastrhino-r66s.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_MAX_SIZE=0x40000
+CONFIG_SPL_PAD_TO=0x7f8000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_SPL_CLK=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MISC=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_RTL8169=y
+CONFIG_PCIE_DW_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_SPL_RAM=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_ERRNO_STR=y
--- a/doc/board/rockchip/rockchip.rst
+++ b/doc/board/rockchip/rockchip.rst
@@ -118,6 +118,7 @@ List of mainline supported Rockchip boar
- FriendlyElec NanoPi R5S (nanopi-r5s-rk3568)
- Generic RK3566/RK3568 (generic-rk3568)
- Hardkernel ODROID-M1 (odroid-m1-rk3568)
+ - Lunzn FastRhino R66S (fastrhino-r66s-rk3568)
- Radxa E25 Carrier Board (radxa-e25-rk3568)
- Radxa ROCK 3A (rock-3a-rk3568)
- Radxa ROCK 3B (rock-3b-rk3568)

View File

@@ -0,0 +1,662 @@
From 63d60b21fd4933080ff22bdc21652f7c2a14bc52 Mon Sep 17 00:00:00 2001
From: Liangbin Lian <jjm2473@gmail.com>
Date: Tue, 14 Oct 2025 13:12:26 +0800
Subject: [PATCH 1/2] arm64: dts: rockchip: add LinkEase EasePi R1
LinkEase EasePi R1 [1] is a high-performance mini router.
Specification:
- Rockchip RK3568
- 2GB/4GB LPDDR4 RAM
- 16GB on-board eMMC
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
- 1x USB 3.0 Type-A
- 1x USB 2.0 Type-C (for USB flashing)
- 2x 1000 Base-T (native, RTL8211F)
- 2x 2500 Base-T (PCIe, RTL8125B)
- 1x HDMI 2.0 Output
- 12v DC Jack
- 1x Power key connected to PMIC
- 2x LEDs (one static power supplied, one GPIO controlled)
[1] https://doc.linkease.com/zh/guide/easepi-r1/hardware.html
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://patch.msgid.link/20251014051226.64255-4-jjm2473@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: deaefeaf3df433d50935b9a85076041040f06d74 ]
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
---
.../src/arm64/rockchip/rk3568-easepi-r1.dts | 623 ++++++++++++++++++
1 file changed, 623 insertions(+)
create mode 100644 dts/upstream/src/arm64/rockchip/rk3568-easepi-r1.dts
--- /dev/null
+++ b/dts/upstream/src/arm64/rockchip/rk3568-easepi-r1.dts
@@ -0,0 +1,623 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
+#include "rk3568.dtsi"
+
+/ {
+ model = "LinkEase EasePi R1";
+ compatible = "linkease,easepi-r1", "rockchip,rk3568";
+
+ aliases {
+ ethernet0 = &gmac0;
+ ethernet1 = &gmac1;
+ mmc0 = &sdhci;
+ };
+
+ chosen: chosen {
+ stdout-path = "serial2:1500000n8";
+ };
+
+ adc-keys {
+ compatible = "adc-keys";
+ io-channels = <&saradc 0>;
+ io-channel-names = "buttons";
+ keyup-threshold-microvolt = <1800000>;
+
+ button-recovery {
+ label = "Recovery";
+ linux,code = <KEY_VENDOR>;
+ press-threshold-microvolt = <1750>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ pinctrl-names = "default";
+ pinctrl-0 = <&status_led_pin>;
+
+ status_led: led-status {
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "heartbeat";
+ };
+ };
+
+ hdmi-con {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_con_in: endpoint {
+ remote-endpoint = <&hdmi_out_con>;
+ };
+ };
+ };
+
+ dc_12v: regulator-dc-12v {
+ compatible = "regulator-fixed";
+ regulator-name = "dc_12v";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <12000000>;
+ regulator-max-microvolt = <12000000>;
+ };
+
+ vcc5v0_sys: regulator-vcc5v0-sys {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc5v0_sys";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ vin-supply = <&dc_12v>;
+ };
+
+ vcc3v3_sys: regulator-vcc3v3-sys {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc3v3_sys";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&dc_12v>;
+ };
+
+ pcie30_avdd0v9: regulator-pcie30-avdd0v9 {
+ compatible = "regulator-fixed";
+ regulator-name = "pcie30_avdd0v9";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+ vin-supply = <&vcc3v3_sys>;
+ };
+
+ pcie30_avdd1v8: regulator-pcie30-avdd1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "pcie30_avdd1v8";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vcc3v3_sys>;
+ };
+
+ regulator-vdd0v95-25glan {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vdd0v95_25glan_en>;
+ regulator-name = "vdd0v95_25glan";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <950000>;
+ vin-supply = <&vcc3v3_sys>;
+ };
+
+ vcc3v3_nvme: regulator-vcc3v3-nvme {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vcc3v3_nvme_en>;
+ regulator-name = "vcc3v3_nvme";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&dc_12v>;
+ };
+
+};
+
+&combphy1 {
+ status = "okay";
+};
+
+&combphy2 {
+ status = "okay";
+};
+
+&cpu0 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&cpu1 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&cpu2 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&cpu3 {
+ cpu-supply = <&vdd_cpu>;
+};
+
+&gmac0 {
+ assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
+ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
+ assigned-clock-rates = <0>, <125000000>;
+ phy-handle = <&rgmii_phy0>;
+ phy-mode = "rgmii-id";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gmac0_miim
+ &gmac0_tx_bus2
+ &gmac0_rx_bus2
+ &gmac0_rgmii_clk
+ &gmac0_rgmii_bus>;
+ status = "okay";
+};
+
+&gmac1 {
+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
+ assigned-clock-rates = <0>, <125000000>;
+ phy-handle = <&rgmii_phy1>;
+ phy-mode = "rgmii-id";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gmac1m1_miim
+ &gmac1m1_tx_bus2
+ &gmac1m1_rx_bus2
+ &gmac1m1_rgmii_clk
+ &gmac1m1_rgmii_bus>;
+ status = "okay";
+};
+
+&gpu {
+ mali-supply = <&vdd_gpu>;
+ status = "okay";
+};
+
+&hdmi {
+ avdd-0v9-supply = <&vdda0v9_image>;
+ avdd-1v8-supply = <&vcca1v8_image>;
+ status = "okay";
+};
+
+&hdmi_in {
+ hdmi_in_vp0: endpoint {
+ remote-endpoint = <&vp0_out_hdmi>;
+ };
+};
+
+&hdmi_out {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
+&hdmi_sound {
+ status = "okay";
+};
+
+&i2c0 {
+ status = "okay";
+
+ vdd_cpu: regulator@1c {
+ compatible = "tcs,tcs4525";
+ reg = <0x1c>;
+ fcs,suspend-voltage-selector = <1>;
+ regulator-name = "vdd_cpu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <1150000>;
+ regulator-ramp-delay = <2300>;
+ vin-supply = <&vcc5v0_sys>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ rk809: pmic@20 {
+ compatible = "rockchip,rk809";
+ reg = <0x20>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
+ #clock-cells = <1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pmic_int>;
+ system-power-controller;
+ vcc1-supply = <&vcc3v3_sys>;
+ vcc2-supply = <&vcc3v3_sys>;
+ vcc3-supply = <&vcc3v3_sys>;
+ vcc4-supply = <&vcc3v3_sys>;
+ vcc5-supply = <&vcc3v3_sys>;
+ vcc6-supply = <&vcc3v3_sys>;
+ vcc7-supply = <&vcc3v3_sys>;
+ vcc8-supply = <&vcc3v3_sys>;
+ vcc9-supply = <&vcc3v3_sys>;
+ wakeup-source;
+
+ regulators {
+ vdd_logic: DCDC_REG1 {
+ regulator-name = "vdd_logic";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-initial-mode = <0x2>;
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <6001>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdd_gpu: DCDC_REG2 {
+ regulator-name = "vdd_gpu";
+ regulator-always-on;
+ regulator-initial-mode = <0x2>;
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <6001>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc_ddr: DCDC_REG3 {
+ regulator-name = "vcc_ddr";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-initial-mode = <0x2>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+
+ vdd_npu: DCDC_REG4 {
+ regulator-name = "vdd_npu";
+ regulator-initial-mode = <0x2>;
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-ramp-delay = <6001>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc_1v8: DCDC_REG5 {
+ regulator-name = "vcc_1v8";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdda0v9_image: LDO_REG1 {
+ regulator-name = "vdda0v9_image";
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <950000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdda_0v9: LDO_REG2 {
+ regulator-name = "vdda_0v9";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdda0v9_pmu: LDO_REG3 {
+ regulator-name = "vdda0v9_pmu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <900000>;
+ };
+ };
+
+ vccio_acodec: LDO_REG4 {
+ regulator-name = "vccio_acodec";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vccio_sd: LDO_REG5 {
+ regulator-name = "vccio_sd";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc3v3_pmu: LDO_REG6 {
+ regulator-name = "vcc3v3_pmu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <3300000>;
+ };
+ };
+
+ vcca_1v8: LDO_REG7 {
+ regulator-name = "vcca_1v8";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcca1v8_pmu: LDO_REG8 {
+ regulator-name = "vcca1v8_pmu";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ regulator-suspend-microvolt = <1800000>;
+ };
+ };
+
+ vcca1v8_image: LDO_REG9 {
+ regulator-name = "vcca1v8_image";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc_3v3: SWITCH_REG1 {
+ regulator-name = "vcc_3v3";
+ regulator-always-on;
+ regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc3v3_sd: SWITCH_REG2 {
+ regulator-name = "vcc3v3_sd";
+ regulator-always-on;
+ regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+ };
+ };
+};
+
+&i2s0_8ch {
+ status = "okay";
+};
+
+&mdio0 {
+ rgmii_phy0: ethernet-phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0x1>;
+ pinctrl-0 = <&eth_phy0_reset_pin>;
+ pinctrl-names = "default";
+ reset-assert-us = <20000>;
+ reset-deassert-us = <100000>;
+ reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
+ };
+};
+
+&mdio1 {
+ rgmii_phy1: ethernet-phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0x1>;
+ pinctrl-0 = <&eth_phy1_reset_pin>;
+ pinctrl-names = "default";
+ reset-assert-us = <20000>;
+ reset-deassert-us = <100000>;
+ reset-gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_LOW>;
+ };
+};
+
+/* ETH3 */
+&pcie2x1 {
+ reset-gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc3v3_sys>;
+ status = "okay";
+};
+
+&pcie30phy {
+ data-lanes = <1 2>;
+ status = "okay";
+};
+
+/* ETH2 */
+&pcie3x1 {
+ num-lanes = <1>;
+ reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc3v3_sys>;
+ status = "okay";
+};
+
+/* M.2 Key for 2280 NVMe */
+&pcie3x2 {
+ num-lanes = <1>;
+ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc3v3_nvme>;
+ status = "okay";
+};
+
+&pinctrl {
+ gmac0 {
+ eth_phy0_reset_pin: eth-phy0-reset-pin {
+ rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+ gmac1 {
+ eth_phy1_reset_pin: eth-phy1-reset-pin {
+ rockchip,pins = <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+ gpio-leds {
+ status_led_pin: status-led-pin {
+ rockchip,pins = <2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ nvme {
+ vcc3v3_nvme_en: vcc3v3-nvme-en {
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ pcie-nic {
+ vdd0v95_25glan_en: vdd0v95-25glan-en {
+ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ pmic {
+ pmic_int: pmic-int {
+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+};
+
+&pmu_io_domains {
+ pmuio1-supply = <&vcc3v3_pmu>;
+ pmuio2-supply = <&vcc3v3_pmu>;
+ vccio1-supply = <&vccio_acodec>;
+ vccio3-supply = <&vccio_sd>;
+ vccio4-supply = <&vcc_1v8>;
+ vccio5-supply = <&vcc_3v3>;
+ vccio6-supply = <&vcc_1v8>;
+ vccio7-supply = <&vcc_3v3>;
+ status = "okay";
+};
+
+&saradc {
+ vref-supply = <&vcca_1v8>;
+ status = "okay";
+};
+
+&sdhci {
+ bus-width = <8>;
+ max-frequency = <200000000>;
+ non-removable;
+ pinctrl-names = "default";
+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
+ status = "okay";
+};
+
+&tsadc {
+ rockchip,hw-tshut-mode = <1>;
+ rockchip,hw-tshut-polarity = <0>;
+ status = "okay";
+};
+
+&uart2 {
+ status = "okay";
+};
+
+/* OTG Only USB2.0, Only device mode */
+&usb_host0_xhci {
+ dr_mode = "peripheral";
+ extcon = <&usb2phy0>;
+ maximum-speed = "high-speed";
+ phys = <&usb2phy0_otg>;
+ phy-names = "usb2-phy";
+ status = "okay";
+};
+
+&usb_host1_xhci {
+ status = "okay";
+};
+
+&usb2phy0 {
+ status = "okay";
+};
+
+&usb2phy0_host {
+ phy-supply = <&vcc5v0_sys>;
+ status = "okay";
+};
+
+&usb2phy0_otg {
+ status = "okay";
+};
+
+&vop {
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+ status = "okay";
+};
+
+&vop_mmu {
+ status = "okay";
+};
+
+&vp0 {
+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+ reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+ remote-endpoint = <&hdmi_in_vp0>;
+ };
+};

View File

@@ -0,0 +1,124 @@
From bb1996b423b81b94b1468fffe5eb9949434b941e Mon Sep 17 00:00:00 2001
From: Liangbin Lian <jjm2473@gmail.com>
Date: Thu, 13 Nov 2025 14:51:21 +0800
Subject: [PATCH 2/2] board: rockchip: add LinkEase EasePi R1
LinkEase EasePi R1 [1] is a high-performance mini router.
Specification:
- Rockchip RK3568
- 2GB/4GB LPDDR4 RAM
- 16GB on-board eMMC
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
- 1x USB 3.0 Type-A
- 1x USB 2.0 Type-C (for USB flashing)
- 2x 1000 Base-T (native, RTL8211F)
- 2x 2500 Base-T (PCIe, RTL8125B)
- 1x HDMI 2.0 Output
- 12v DC Jack
- 1x Power key connected to PMIC
- 2x LEDs (one static power supplied, one GPIO controlled)
[1] https://doc.linkease.com/zh/guide/easepi-r1/hardware.html
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
---
arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi | 3 +
configs/easepi-r1-rk3568_defconfig | 84 +++++++++++++++++++++++
2 files changed, 87 insertions(+)
create mode 100644 arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi
create mode 100644 configs/easepi-r1-rk3568_defconfig
--- /dev/null
+++ b/arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "rk356x-u-boot.dtsi"
--- /dev/null
+++ b/configs/easepi-r1-rk3568_defconfig
@@ -0,0 +1,84 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-easepi-r1"
+CONFIG_ROCKCHIP_RK3568=y
+CONFIG_SPL_SERIAL=y
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_DEBUG_UART_BASE=0xFE660000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_PCI=y
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-easepi-r1.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_MAX_SIZE=0x40000
+CONFIG_SPL_PAD_TO=0x7f8000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_SPL_CLK=y
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MISC=y
+CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_SDMA=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_PHY_REALTEK=y
+CONFIG_DWC_ETH_QOS=y
+CONFIG_DWC_ETH_QOS_ROCKCHIP=y
+CONFIG_RTL8169=y
+CONFIG_NVME_PCI=y
+CONFIG_PCIE_DW_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_SPL_RAM=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_SPL_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_FUNCTION_ROCKUSB=y
+CONFIG_ERRNO_STR=y

View File

@@ -6,9 +6,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
PKG_SOURCE_DATE:=2025-10-17
PKG_SOURCE_VERSION:=a1529e183333e38bdc95dc8d9317b7af2bec0dcd
PKG_MIRROR_HASH:=30ce8f808424602cba556e106cb16080ef29d6d45a9d9018e04664598460eb2f
PKG_SOURCE_DATE:=2025-10-22
PKG_SOURCE_VERSION:=ec6831a43ff066c9873e7c41fd6f68354bb67b4a
PKG_MIRROR_HASH:=33a26f90fd450e9dc2b2d5ae9c137ffcd57ef62dac277d63c5d5f6f5a1262a2f
PKG_FLAGS:=nonshared
include $(INCLUDE_DIR)/package.mk
@@ -58,6 +58,7 @@ ALLWIFIBOARDS:= \
tplink_archer-c59-v1 \
tplink_archer-c6-v2 \
tplink_archer-c60-v1 \
tplink_archer-c60-v2 \
wallys_dr40x9 \
xiaomi_aiot-ac2350 \
xiaomi_ax3600 \
@@ -192,6 +193,7 @@ $(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1)
$(eval $(call generate-ipq-wifi-package,tplink_archer-c59-v1,TP-Link Archer C59 V1))
$(eval $(call generate-ipq-wifi-package,tplink_archer-c6-v2,TP-Link Archer C6 V2))
$(eval $(call generate-ipq-wifi-package,tplink_archer-c60-v1,TP-Link Archer C60 V1))
$(eval $(call generate-ipq-wifi-package,tplink_archer-c60-v2,TP-Link Archer C60 V2))
$(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
$(eval $(call generate-ipq-wifi-package,xiaomi_aiot-ac2350,Xiaomi AIoT AC2350))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))

View File

@@ -25,6 +25,8 @@ define Package/layerscape-fman
CATEGORY:=Firmware
TITLE:=NXP FMan ucode
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
define Build/Compile

View File

@@ -27,6 +27,8 @@ define Package/layerscape-ddr-phy
CATEGORY:=Firmware
TITLE:=NXP Layerscape DDR PHY firmware
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
define Build/Compile

View File

@@ -26,6 +26,8 @@ define Package/layerscape-dpl
CATEGORY:=Firmware
TITLE:=NXP DPL firmware
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
MAKE_PATH:=config

View File

@@ -25,6 +25,8 @@ define Package/layerscape-mc
CATEGORY:=Firmware
TITLE:=NXP MC firmware
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv8_64b
HIDDEN:=1
endef
define Build/Compile

View File

@@ -25,6 +25,8 @@ define Package/layerscape-rcw
CATEGORY:=Firmware
TITLE:=NXP Layerscape RCW binaries
DEPENDS:=@TARGET_layerscape
DEFAULT:=y if TARGET_layerscape_armv7
HIDDEN:=1
endef
BOARDS := \

View File

@@ -1,14 +1,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wireless-regdb
PKG_VERSION:=2025.07.10
PKG_VERSION:=2025.10.07
PKG_RELEASE:=1
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
PKG_HASH:=a8340bcdcd1b5db6c79149879d122b170f3bb075381718d4f429ad831a6fa28d
PKG_HASH:=d4c872a44154604c869f5851f7d21d818d492835d370af7f58de8847973801c3
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>

View File

@@ -35,9 +35,9 @@ define Package/bcm63xx-cfe/install
endef
define Build/InstallDev
rm -rf $(KERNEL_BUILD_DIR)/$(PKG_NAME)
mkdir -p $(KERNEL_BUILD_DIR)/$(PKG_NAME)
$(CP) -r $(PKG_BUILD_DIR)/* $(KERNEL_BUILD_DIR)/$(PKG_NAME)
rm -rf $(STAGING_DIR_IMAGE)/$(PKG_NAME)
mkdir -p $(STAGING_DIR_IMAGE)/$(PKG_NAME)
$(CP) -r $(PKG_BUILD_DIR)/* $(STAGING_DIR_IMAGE)/$(PKG_NAME)
endef
$(eval $(call BuildPackage,bcm63xx-cfe))

View File

@@ -0,0 +1,14 @@
Fixes leaking the ethernet FCS into the frame payload on the RX
path.
--- a/dcdp/ptm_tc.c
+++ b/dcdp/ptm_tc.c
@@ -923,7 +923,7 @@ static void ptm_fw_init(struct ptm_ep_pr
rx_gitf_cfg.rx_inserted_bytes_1h = 0;
rx_gitf_cfg.rx_inserted_bytes_2l = 0;
rx_gitf_cfg.rx_inserted_bytes_2h = 0;
- rx_gitf_cfg.rx_len_adj = -2;
+ rx_gitf_cfg.rx_len_adj = is_bonding ? -2 : -6;
for (i = 0; i < 4; i++) {
dst_addr = __RX_GIF0_CFG_STATS_CFG +
(i * DW_SZ(rx_gitf_cfg));

View File

@@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
PKG_VERSION:=6.12.52
PKG_VERSION:=6.12.61
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
PKG_HASH:=ed6ef4c67e08b294ed1101c7cc5ae584a5f338c99ef95362fa3921eb6d207f5d
PKG_HASH:=9db2f836dba7f38ad68f8798720ad4360bce6a3557bde02b88b3a4f068c77118
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION)

View File

@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -9924,6 +9924,21 @@ static int ath10k_mac_init_rd(struct ath
@@ -9932,6 +9932,21 @@ static int ath10k_mac_init_rd(struct ath
return 0;
}
@@ -22,7 +22,7 @@
int ath10k_mac_register(struct ath10k *ar)
{
static const u32 cipher_suites[] = {
@@ -10286,6 +10301,12 @@ int ath10k_mac_register(struct ath10k *a
@@ -10294,6 +10309,12 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;

View File

@@ -40,7 +40,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
if (ret)
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -10302,7 +10302,7 @@ int ath10k_mac_register(struct ath10k *a
@@ -10310,7 +10310,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
#ifdef CPTCFG_MAC80211_LEDS

View File

@@ -28,7 +28,7 @@ Forwarded: no
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1022,6 +1022,40 @@ static inline int ath10k_vdev_setup_sync
@@ -1030,6 +1030,40 @@ static inline int ath10k_vdev_setup_sync
return ar->last_wmi_vdev_start_status;
}
@@ -69,7 +69,7 @@ Forwarded: no
static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
{
struct cfg80211_chan_def *chandef = NULL;
@@ -1054,7 +1088,8 @@ static int ath10k_monitor_vdev_start(str
@@ -1062,7 +1096,8 @@ static int ath10k_monitor_vdev_start(str
arg.channel.min_power = 0;
arg.channel.max_power = channel->max_power * 2;
arg.channel.max_reg_power = channel->max_reg_power * 2;
@@ -79,7 +79,7 @@ Forwarded: no
reinit_completion(&ar->vdev_setup_done);
reinit_completion(&ar->vdev_delete_done);
@@ -1500,7 +1535,8 @@ static int ath10k_vdev_start_restart(str
@@ -1508,7 +1543,8 @@ static int ath10k_vdev_start_restart(str
arg.channel.min_power = 0;
arg.channel.max_power = chandef->chan->max_power * 2;
arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
@@ -89,7 +89,7 @@ Forwarded: no
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
arg.ssid = arvif->u.ap.ssid;
@@ -3431,7 +3467,8 @@ static int ath10k_update_channel_list(st
@@ -3439,7 +3475,8 @@ static int ath10k_update_channel_list(st
ch->min_power = 0;
ch->max_power = channel->max_power * 2;
ch->max_reg_power = channel->max_reg_power * 2;

View File

@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -10094,7 +10094,6 @@ int ath10k_mac_register(struct ath10k *a
@@ -10102,7 +10102,6 @@ int ath10k_mac_register(struct ath10k *a
ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);

View File

@@ -29,7 +29,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -8135,6 +8135,20 @@ static void ath10k_flush(struct ieee8021
@@ -8143,6 +8143,20 @@ static void ath10k_flush(struct ieee8021
mutex_unlock(&ar->conf_mutex);
}
@@ -50,7 +50,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
/* TODO: Implement this function properly
* For now it is needed to reply to Probe Requests in IBSS mode.
* Probably we need this information from FW.
@@ -9486,6 +9500,7 @@ static const struct ieee80211_ops ath10k
@@ -9494,6 +9508,7 @@ static const struct ieee80211_ops ath10k
.set_rts_threshold = ath10k_set_rts_threshold,
.set_frag_threshold = ath10k_mac_op_set_frag_threshold,
.flush = ath10k_flush,
@@ -58,7 +58,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
.tx_last_beacon = ath10k_tx_last_beacon,
.set_antenna = ath10k_set_antenna,
.get_antenna = ath10k_get_antenna,
@@ -10307,6 +10322,9 @@ int ath10k_mac_register(struct ath10k *a
@@ -10315,6 +10330,9 @@ int ath10k_mac_register(struct ath10k *a
if (!ar->hw_params.hw_ops->set_coverage_class)
ar->ops->set_coverage_class = NULL;

View File

@@ -0,0 +1,65 @@
From b5ade0e0e1c1622a85fbfd2c93b41caff479f305 Mon Sep 17 00:00:00 2001
From: Florian Maurer <f.maurer@outlook.de>
Date: Fri, 3 Oct 2025 12:56:13 +0200
Subject: [PATCH] ath11k: add ath11k_mac_op_flush_sta to properly flush pending
packets
When a STA is marked as no longer authorized, if the driver doesn't
implement flush_sta(), mac80211 calls ieee80211_flush_queues() to
flush hardware queues to avoid sending unencrypted frames.
This has became a problem for ath11k because ieee80211_flush_queues()
will stop all traffic and call ath11k_flush, which waits until the
whole HW queue is empty. In a busy environment this will trigger a
timeout warning and stalls other STAs.
Fix this by implementing flush_sta method using WMI command to flush
frames of a specific STA.
Flushed frames will be marked as discard in tx complete indication.
warning print "ath11k c000000.wifi: failed to flush transmit queue 0"
was observed on various openwrt devices, and is fixed through this patch.
Tested-by: Florian Maurer <f.maurer@outlook.de>
Tested-by: Flole <flole@flole.de>
Co-developed-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Florian Maurer <f.maurer@outlook.de>
---
drivers/net/wireless/ath/ath11k/mac.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -8327,6 +8327,23 @@ static void ath11k_mac_op_flush(struct i
ath11k_mac_flush_tx_complete(ar);
}
+static void ath11k_mac_op_flush_sta(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
+{
+ struct ath11k_vif *arvif = (void *)vif->drv_priv;
+ struct ath11k *ar = hw->priv;
+ struct peer_flush_params params = {
+ .peer_tid_bitmap = 0xFF,
+ .vdev_id = arvif->vdev_id,
+ };
+ int ret;
+
+ ret = ath11k_wmi_send_peer_flush_tids_cmd(ar, sta->addr, &params);
+ if (ret)
+ ath11k_warn(ar->ab, "failed to flush sta %pM: %d\n", sta->addr, ret);
+}
+
static bool
ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
enum nl80211_band band,
@@ -9959,6 +9976,7 @@ static const struct ieee80211_ops ath11k
.set_bitrate_mask = ath11k_mac_op_set_bitrate_mask,
.get_survey = ath11k_mac_op_get_survey,
.flush = ath11k_mac_op_flush,
+ .flush_sta = ath11k_mac_op_flush_sta,
.sta_statistics = ath11k_mac_op_sta_statistics,
CFG80211_TESTMODE_CMD(ath11k_tm_cmd)

View File

@@ -31,7 +31,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
{
.hw_rev = ATH11K_HW_IPQ8074,
.name = "ipq8074 hw2.0",
@@ -2201,7 +2201,8 @@ static void ath11k_core_reset(struct wor
@@ -2239,7 +2239,8 @@ static void ath11k_core_reset(struct wor
static int ath11k_init_hw_params(struct ath11k_base *ab)
{
const struct ath11k_hw_params *hw_params = NULL;
@@ -41,7 +41,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
hw_params = &ath11k_hw_params[i];
@@ -2217,7 +2218,31 @@ static int ath11k_init_hw_params(struct
@@ -2255,7 +2256,31 @@ static int ath11k_init_hw_params(struct
ab->hw_params = *hw_params;

View File

@@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
return ret;
}
@@ -5998,7 +6013,7 @@ static int ath12k_mac_start(struct ath12
@@ -6000,7 +6015,7 @@ static int ath12k_mac_start(struct ath12
/* TODO: Do we need to enable ANI? */
@@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
ar->num_started_vdevs = 0;
ar->num_created_vdevs = 0;
@@ -6178,6 +6193,9 @@ static void ath12k_mac_stop(struct ath12
@@ -6180,6 +6195,9 @@ static void ath12k_mac_stop(struct ath12
cancel_delayed_work_sync(&ar->scan.timeout);
cancel_work_sync(&ar->regd_update_work);
cancel_work_sync(&ar->ab->rfkill_work);
@@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
spin_lock_bh(&ar->data_lock);
list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
@@ -6424,6 +6442,117 @@ static void ath12k_mac_op_update_vif_off
@@ -6426,6 +6444,117 @@ static void ath12k_mac_op_update_vif_off
ath12k_mac_update_vif_offload(arvif);
}
@@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
{
struct ath12k_hw *ah = ar->ah;
@@ -6538,6 +6667,7 @@ static int ath12k_mac_vdev_create(struct
@@ -6540,6 +6669,7 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
@@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
break;
case WMI_VDEV_TYPE_STA:
param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
@@ -6576,6 +6706,13 @@ static int ath12k_mac_vdev_create(struct
@@ -6578,6 +6708,13 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
@@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
break;
default:
break;
@@ -6916,6 +7053,11 @@ static void ath12k_mac_op_remove_interfa
@@ -6918,6 +7055,11 @@ static void ath12k_mac_op_remove_interfa
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
arvif->vdev_id);
@@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
if (ret)
@@ -7756,6 +7898,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
@@ -7758,6 +7900,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
ath12k_mac_monitor_stop(ar);
@@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
mutex_unlock(&ar->conf_mutex);
}
@@ -8294,6 +8444,14 @@ ath12k_mac_op_reconfig_complete(struct i
@@ -8296,6 +8446,14 @@ ath12k_mac_op_reconfig_complete(struct i
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
ar->pdev->pdev_id);
@@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
if (ab->is_reset) {
recovery_count = atomic_inc_return(&ab->recovery_count);
@@ -9344,6 +9502,9 @@ static void ath12k_mac_setup(struct ath1
@@ -9346,6 +9504,9 @@ static void ath12k_mac_setup(struct ath1
INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
skb_queue_head_init(&ar->wmi_mgmt_tx_queue);

View File

@@ -22,7 +22,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#include <net/cfg80211.h>
#include <net/netlink.h>
#include <uapi/linux/if_arp.h>
@@ -8212,31 +8213,45 @@ static void brcmf_cfg80211_reg_notifier(
@@ -8211,31 +8212,45 @@ static void brcmf_cfg80211_reg_notifier(
struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
struct brcmf_pub *drvr = cfg->pub;
struct brcmf_fil_country_le ccreq;

View File

@@ -119,7 +119,7 @@ Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val,
sizeof(s32));
if (err)
@@ -1826,6 +1830,7 @@ bool brcmf_p2p_send_action_frame(struct
@@ -1817,6 +1821,7 @@ bool brcmf_p2p_send_action_frame(struct
/* validate channel and p2p ies */
if (config_af_params.search_channel &&
IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) &&

View File

@@ -9,7 +9,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -7991,6 +7991,7 @@ static s32 brcmf_translate_country_code(
@@ -7990,6 +7990,7 @@ static s32 brcmf_translate_country_code(
return 0;
}
@@ -17,7 +17,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
static int
brcmf_parse_dump_obss(char *buf, struct brcmf_dump_survey *survey)
{
@@ -8213,6 +8214,7 @@ exit:
@@ -8212,6 +8213,7 @@ exit:
brcmf_set_mpc(ifp, 1);
return err;
}
@@ -25,7 +25,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
struct regulatory_request *req)
@@ -8379,8 +8381,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802
@@ -8378,8 +8380,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK))
ops->set_rekey_data = brcmf_cfg80211_set_rekey_data;
#endif

View File

@@ -530,7 +530,7 @@
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -446,7 +446,7 @@ TRACE_EVENT(rdev_add_virtual_intf,
@@ -467,7 +467,7 @@ TRACE_EVENT(rdev_add_virtual_intf,
),
TP_fast_assign(
WIPHY_ASSIGN;

View File

@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -6636,6 +6636,7 @@ static void hwsim_virtio_rx_done(struct
@@ -6637,6 +6637,7 @@ static void hwsim_virtio_rx_done(struct
static int init_vqs(struct virtio_device *vdev)
{
@@ -8,7 +8,7 @@
struct virtqueue_info vqs_info[HWSIM_NUM_VQS] = {
[HWSIM_VQ_TX] = { "tx", hwsim_virtio_tx_done },
[HWSIM_VQ_RX] = { "rx", hwsim_virtio_rx_done },
@@ -6643,6 +6644,19 @@ static int init_vqs(struct virtio_device
@@ -6644,6 +6645,19 @@ static int init_vqs(struct virtio_device
return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
hwsim_vqs, vqs_info, NULL);

View File

@@ -0,0 +1,116 @@
From f4e661a75cdfa7eb88ac0fa832edd4a90775805d Mon Sep 17 00:00:00 2001
From: Pawel Dembicki <paweldembicki@gmail.com>
Date: Fri, 7 Nov 2025 23:05:56 +0100
Subject: [PATCH] mwl8k: inject DS Params IE into beacons if missing
Some Marvell AP firmware used with mwl8k misbehaves when beacon frames
do not contain a WLAN_EID_DS_PARAMS information element with the current
channel. It was reported on OpenWrt Github issues [0].
When hostapd/mac80211 omits DS Params from the beacon (which is valid on
some bands), the firmware stops transmitting sane frames and RX status
starts reporting bogus channel information. This makes AP mode unusable.
Newer Marvell drivers (mwlwifi [1]) hard-code DS Params IE into AP beacons
for all chips, which suggests this is a firmware requirement rather than
a mwl8k-specific quirk.
Mirror that behaviour in mwl8k: when setting the beacon, check if
WLAN_EID_DS_PARAMS is present, and if not, extend the beacon and inject
a DS Params IE at the beginning of the IE list, using the current
channel from hw->conf.chandef.chan.
Tested on Linksys EA4500 (88W8366).
[0] https://github.com/openwrt/openwrt/issues/19088
[1] https://github.com/kaloz/mwlwifi/blob/db97edf20fadea2617805006f5230665fadc6a8c/hif/fwcmd.c#L675
Tested-by: Antony Kolitsos <zeusomighty@hotmail.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
drivers/net/wireless/marvell/mwl8k.c | 61 +++++++++++++++++++++++++---
1 file changed, 56 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
@@ -2966,6 +2966,42 @@ mwl8k_cmd_rf_antenna(struct ieee80211_hw
/*
* CMD_SET_BEACON.
*/
+
+static bool mwl8k_beacon_has_ds_params(const u8 *buf, int len)
+{
+ const struct ieee80211_mgmt *mgmt = (const void *)buf;
+ int ies_len;
+
+ if (len <= offsetof(struct ieee80211_mgmt, u.beacon.variable))
+ return false;
+
+ ies_len = len - offsetof(struct ieee80211_mgmt, u.beacon.variable);
+
+ return cfg80211_find_ie(WLAN_EID_DS_PARAMS, mgmt->u.beacon.variable,
+ ies_len) != NULL;
+}
+
+static void mwl8k_beacon_copy_inject_ds_params(struct ieee80211_hw *hw,
+ u8 *buf_dst, const u8 *buf_src,
+ int src_len)
+{
+ const struct ieee80211_mgmt *mgmt = (const void *)buf_src;
+ const u8 *ies;
+ int hdr_len, left;
+
+ ies = mgmt->u.beacon.variable;
+ hdr_len = ies - buf_src;
+ left = src_len - hdr_len;
+
+ memcpy(buf_dst, buf_src, hdr_len);
+
+ /* Inject a DS Params IE at the beginning of the IE list */
+ buf_dst[hdr_len + 0] = WLAN_EID_DS_PARAMS;
+ buf_dst[hdr_len + 1] = 1;
+ buf_dst[hdr_len + 2] = hw->conf.chandef.chan->hw_value;
+
+ memcpy(buf_dst + hdr_len + 3, buf_src + hdr_len, left);
+}
struct mwl8k_cmd_set_beacon {
struct mwl8k_cmd_pkt_hdr header;
__le16 beacon_len;
@@ -2975,17 +3011,32 @@ struct mwl8k_cmd_set_beacon {
static int mwl8k_cmd_set_beacon(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u8 *beacon, int len)
{
+ bool ds_params_present = mwl8k_beacon_has_ds_params(beacon, len);
struct mwl8k_cmd_set_beacon *cmd;
- int rc;
+ int rc, final_len = len;
+
+ if (!ds_params_present)
+ /*
+ * mwl8k firmware requires a DS Params IE with the current
+ * channel in AP beacons. If mac80211/hostapd does not
+ * include it, inject one here. IE ID + length + channel
+ * number = 3 bytes.
+ */
+ final_len += 3;
- cmd = kzalloc(sizeof(*cmd) + len, GFP_KERNEL);
+ cmd = kzalloc(sizeof(*cmd) + final_len, GFP_KERNEL);
if (cmd == NULL)
return -ENOMEM;
cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_BEACON);
- cmd->header.length = cpu_to_le16(sizeof(*cmd) + len);
- cmd->beacon_len = cpu_to_le16(len);
- memcpy(cmd->beacon, beacon, len);
+ cmd->header.length = cpu_to_le16(sizeof(*cmd) + final_len);
+ cmd->beacon_len = cpu_to_le16(final_len);
+
+ if (ds_params_present)
+ memcpy(cmd->beacon, beacon, len);
+ else
+ mwl8k_beacon_copy_inject_ds_params(hw, cmd->beacon, beacon,
+ len);
rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
kfree(cmd);

View File

@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
@@ -5716,6 +5716,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
@@ -5767,6 +5767,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
static const struct pci_device_id mwl8k_pci_id_table[] = {

View File

@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
@@ -6302,6 +6302,8 @@ static int mwl8k_probe(struct pci_dev *p
@@ -6353,6 +6353,8 @@ static int mwl8k_probe(struct pci_dev *p
priv->running_bsses = 0;
@@ -9,7 +9,7 @@
return rc;
err_stop_firmware:
@@ -6335,8 +6337,6 @@ static void mwl8k_remove(struct pci_dev
@@ -6386,8 +6388,6 @@ static void mwl8k_remove(struct pci_dev
return;
priv = hw->priv;

View File

@@ -535,7 +535,7 @@ Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com
struct rtw_rx_pkt_stat *pkt_stat);
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -979,8 +979,7 @@ static void rtw_sdio_rxfifo_recv(struct
@@ -983,8 +983,7 @@ static void rtw_sdio_rxfifo_recv(struct
while (true) {
rx_desc = skb->data;

View File

@@ -121,7 +121,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com
.ht_supported = true,
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -862,7 +862,7 @@ static void rtw_sdio_tx_skb_prepare(stru
@@ -866,7 +866,7 @@ static void rtw_sdio_tx_skb_prepare(stru
pkt_info->qsel = rtw_sdio_get_tx_qsel(rtwdev, skb, queue);

View File

@@ -9,7 +9,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnect
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1649,12 +1649,6 @@ static int ieee80211_stop_ap(struct wiph
@@ -1663,12 +1663,6 @@ static int ieee80211_stop_ap(struct wiph
__sta_info_flush(sdata, true, link_id);

View File

@@ -8,7 +8,7 @@ Subject: [PATCH] mac80211: allow scans in access point mode (for site survey)
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2863,6 +2863,8 @@ static int ieee80211_scan(struct wiphy *
@@ -2877,6 +2877,8 @@ static int ieee80211_scan(struct wiphy *
*/
fallthrough;
case NL80211_IFTYPE_AP:

View File

@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1360,10 +1360,12 @@ struct ieee80211_local {
@@ -1362,10 +1362,12 @@ struct ieee80211_local {
spinlock_t handle_wake_tx_queue_lock;
u16 airtime_flags;

View File

@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -6274,6 +6274,7 @@ enum ieee80211_ap_reg_power {
@@ -6352,6 +6352,7 @@ enum ieee80211_ap_reg_power {
* entered.
* @links.cac_time_ms: CAC time in ms
* @valid_links: bitmap describing what elements of @links are valid
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
*/
struct wireless_dev {
struct wiphy *wiphy;
@@ -6386,6 +6387,8 @@ struct wireless_dev {
@@ -6464,6 +6465,8 @@ struct wireless_dev {
unsigned int cac_time_ms;
} links[IEEE80211_MLD_MAX_NUM_LINKS];
u16 valid_links;
@@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
static inline const u8 *wdev_address(struct wireless_dev *wdev)
@@ -6572,6 +6575,17 @@ bool cfg80211_radio_chandef_valid(const
@@ -6650,6 +6653,17 @@ bool cfg80211_radio_chandef_valid(const
const struct cfg80211_chan_def *chandef);
/**

View File

@@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
int (*scan)(struct wiphy *wiphy,
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -879,6 +879,7 @@ static int ieee80211_get_station(struct
@@ -893,6 +893,7 @@ static int ieee80211_get_station(struct
}
static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
@@ -126,7 +126,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1318,19 +1318,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
@@ -1339,19 +1339,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
);
TRACE_EVENT(rdev_set_monitor_channel,

View File

@@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ieee80211_set_mu_mimo_follow(monitor_sdata, params);
if (params->flags) {
@@ -889,22 +894,25 @@ static int ieee80211_set_monitor_channel
@@ -903,22 +908,25 @@ static int ieee80211_set_monitor_channel
lockdep_assert_wiphy(local->hw.wiphy);
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (ret)
return ret;
done:
@@ -3050,7 +3058,8 @@ static int ieee80211_set_tx_power(struct
@@ -3064,7 +3072,8 @@ static int ieee80211_set_tx_power(struct
if (wdev) {
sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
return -EOPNOTSUPP;
@@ -3098,7 +3107,8 @@ static int ieee80211_set_tx_power(struct
@@ -3112,7 +3121,8 @@ static int ieee80211_set_tx_power(struct
}
list_for_each_entry(sdata, &local->interfaces, list) {
@@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
has_monitor = true;
continue;
}
@@ -3108,7 +3118,8 @@ static int ieee80211_set_tx_power(struct
@@ -3122,7 +3132,8 @@ static int ieee80211_set_tx_power(struct
sdata->vif.bss_conf.txpower_type = txp_type;
}
list_for_each_entry(sdata, &local->interfaces, list) {
@@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
continue;
ieee80211_recalc_txpower(sdata, update_txp_type);
}
@@ -4303,7 +4314,8 @@ static int ieee80211_cfg_get_channel(str
@@ -4317,7 +4328,8 @@ static int ieee80211_cfg_get_channel(str
if (chanctx_conf) {
*chandef = link->conf->chanreq.oper;
ret = 0;
@@ -201,7 +201,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -279,8 +279,13 @@ static int _ieee80211_change_mac(struct
@@ -296,8 +296,13 @@ static int _ieee80211_change_mac(struct
ret = eth_mac_addr(sdata->dev, sa);
if (ret == 0) {
@@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
/* Regardless of eth_mac_addr() return we still want to add the
@@ -705,9 +710,11 @@ static void ieee80211_do_stop(struct iee
@@ -722,9 +727,11 @@ static void ieee80211_do_stop(struct iee
ieee80211_recalc_idle(local);
ieee80211_recalc_offload(local);
@@ -230,7 +230,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
fallthrough;
default:
if (!going_down)
@@ -1140,7 +1147,8 @@ int ieee80211_add_virtual_monitor(struct
@@ -1157,7 +1164,8 @@ int ieee80211_add_virtual_monitor(struct
ASSERT_RTNL();
lockdep_assert_wiphy(local->hw.wiphy);
@@ -240,7 +240,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return 0;
sdata = kzalloc(sizeof(*sdata) + local->hw.vif_data_size, GFP_KERNEL);
@@ -1202,6 +1210,9 @@ void ieee80211_del_virtual_monitor(struc
@@ -1219,6 +1227,9 @@ void ieee80211_del_virtual_monitor(struc
{
struct ieee80211_sub_if_data *sdata;
@@ -250,7 +250,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ASSERT_RTNL();
lockdep_assert_wiphy(local->hw.wiphy);
@@ -1345,7 +1356,8 @@ int ieee80211_do_open(struct wireless_de
@@ -1362,7 +1373,8 @@ int ieee80211_do_open(struct wireless_de
break;
}

View File

@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1382,7 +1382,7 @@ struct ieee80211_local {
@@ -1384,7 +1384,7 @@ struct ieee80211_local {
spinlock_t queue_stop_reason_lock;
int open_count;
@@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
fif_probe_req;
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1103,6 +1103,8 @@ void ieee80211_adjust_monitor_flags(stru
@@ -1120,6 +1120,8 @@ void ieee80211_adjust_monitor_flags(stru
ADJUST(CONTROL, control);
ADJUST(CONTROL, pspoll);
ADJUST(OTHER_BSS, other_bss);

View File

@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
u8 cab_queue;
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -279,13 +279,8 @@ static int _ieee80211_change_mac(struct
@@ -296,13 +296,8 @@ static int _ieee80211_change_mac(struct
ret = eth_mac_addr(sdata->dev, sa);
if (ret == 0) {
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
/* Regardless of eth_mac_addr() return we still want to add the
@@ -1336,6 +1331,8 @@ int ieee80211_do_open(struct wireless_de
@@ -1353,6 +1348,8 @@ int ieee80211_do_open(struct wireless_de
}
}

View File

@@ -284,7 +284,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
sta->ampdu_mlme.tid_rx_manage_offl))
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2131,14 +2131,19 @@ int ieee80211_send_smps_action(struct ie
@@ -2133,14 +2133,19 @@ int ieee80211_send_smps_action(struct ie
const u8 *bssid, int link_id);
bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old,
enum ieee80211_smps_mode smps_mode_new);

View File

@@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1220,6 +1220,19 @@ struct ieee80211_sub_if_data *vif_to_sda
@@ -1222,6 +1222,19 @@ struct ieee80211_sub_if_data *vif_to_sda
((__link) = sdata_dereference((__sdata)->link[__link_id], \
(__sdata))))

View File

@@ -23,7 +23,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2167,6 +2167,21 @@ static void ieee80211_csa_switch_work(st
@@ -2168,6 +2168,21 @@ static void ieee80211_csa_switch_work(st
}
}
@@ -45,7 +45,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ieee80211_sta_reset_beacon_monitor(sdata);
ieee80211_sta_reset_conn_monitor(sdata);
}
@@ -7892,6 +7907,29 @@ void ieee80211_sta_work(struct ieee80211
@@ -7893,6 +7908,29 @@ void ieee80211_sta_work(struct ieee80211
}
}

View File

@@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3841,9 +3841,6 @@ static void ieee80211_mgd_probe_ap_send(
@@ -3842,9 +3842,6 @@ static void ieee80211_mgd_probe_ap_send(
lockdep_assert_wiphy(sdata->local->hw.wiphy);
@@ -35,7 +35,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
/*
* Try sending broadcast probe requests for the last three
* probe requests after the first ones failed since some
@@ -3889,9 +3886,6 @@ static void ieee80211_mgd_probe_ap(struc
@@ -3890,9 +3887,6 @@ static void ieee80211_mgd_probe_ap(struc
lockdep_assert_wiphy(sdata->local->hw.wiphy);
@@ -45,7 +45,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (!ieee80211_sdata_running(sdata))
return;
@@ -7950,36 +7944,73 @@ static void ieee80211_sta_bcn_mon_timer(
@@ -7951,36 +7945,73 @@ static void ieee80211_sta_bcn_mon_timer(
&sdata->u.mgd.beacon_connection_loss_work);
}

View File

@@ -3,14 +3,14 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=mt76
PKG_RELEASE=1
PKG_LICENSE:=GPLv2
PKG_LICENSE:=BSD-3-Clause-Clear
PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2025-09-15
PKG_SOURCE_VERSION:=6467af3bcf1154c2ceb032c903d533f0c718bbc2
PKG_MIRROR_HASH:=98781ea57cdc97bc63ecb2c1d4004964f2a10663987887445f1c71b76610cd96
PKG_SOURCE_DATE:=2025-11-06
PKG_SOURCE_VERSION:=eb567bc7f9b692bbf1ddfe31dd740861c58ec85b
PKG_MIRROR_HASH:=7cfe242a5494cdf5d8e8eea86633778a525717528bcce70aedef96eee5594383
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_USE_NINJA:=0
@@ -494,6 +494,12 @@ ifdef CONFIG_PACKAGE_kmod-mt7921e
endif
ifdef CONFIG_PACKAGE_kmod-mt7996e
PKG_MAKE_FLAGS += CONFIG_MT7996E=m
ifdef CONFIG_TARGET_airoha_an7581
PKG_MAKE_FLAGS += CONFIG_MT76_NPU=y
PKG_MAKE_FLAGS += CONFIG_MT7996_NPU=y
NOSTDINC_FLAGS += -DCONFIG_MT76_NPU
NOSTDINC_FLAGS += -DCONFIG_MT7996_NPU
endif
endif
ifdef CONFIG_PACKAGE_kmod-mt7925-common
PKG_MAKE_FLAGS += CONFIG_MT7925_COMMON=m

View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dropbear
PKG_VERSION:=2024.86
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \

View File

@@ -5,3 +5,5 @@ config dropbear main
option RootPasswordAuth 'on'
option Port '22'
# option BannerFile '/etc/banner'
# option LocalPortForward 'off'
# option RemotePortForward 'off'

View File

@@ -179,6 +179,8 @@ validate_section_dropbear()
'IdleTimeout:uinteger:0' \
'MaxAuthTries:uinteger:3' \
'RecvWindowSize:uinteger:262144' \
'LocalPortForward:bool:1' \
'RemotePortForward:bool:1' \
'mdns:bool:1'
}
@@ -319,6 +321,8 @@ dropbear_instance()
fi
[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
[ "${LocalPortForward}" -eq 0 ] && procd_append_param command -j
[ "${RemotePortForward}" -eq 0 ] && procd_append_param command -k
[ -n "${ForceCommand}" ] && procd_append_param command -c "${ForceCommand}"
[ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
[ "${RootLogin}" -eq 0 ] && procd_append_param command -w

View File

@@ -0,0 +1,262 @@
From 61cfbc66aefcb047534210713f3aac097100e5f5 Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Tue, 9 Dec 2025 15:08:06 +0900
Subject: Drop privileges after user authentication
Instead of switching user privileges after forking to a shell, switch
to the user immediately upon successful authentication.
This will require further commits to fix utmp and hostkey handling.
The DROPBEAR_SVR_DROP_PRIVS configuration option controls this
behaviour. This should generally be enabled, but can be set to 0 for
incompatible platforms. In future it may become non-optional, those
platforms should be investigated.
Most uses of DROPBEAR_SVR_MULTIUSER have been replaced by
!DROPBEAR_SVR_DROP_PRIVS.
(cherry picked from commit e0251be2354e1a5c6eccfc2cf4b64243625dafcc)
---
.github/workflows/build.yml | 2 ++
src/auth.h | 1 +
src/default_options.h | 6 +++++
src/svr-agentfwd.c | 14 ++++++++----
src/svr-auth.c | 45 +++++++++++++++++++++++++++++++++++++
src/svr-authpubkey.c | 6 +++--
src/svr-chansession.c | 26 ++-------------------
src/sysoptions.h | 3 +++
8 files changed, 73 insertions(+), 30 deletions(-)
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -217,6 +217,8 @@ jobs:
echo "#define DROPBEAR_SVR_PASSWORD_AUTH 0" >> localoptions.h
# 1 second timeout is too short
sed -i "s/DEFAULT_IDLE_TIMEOUT 1/DEFAULT_IDLE_TIMEOUT 99/" localoptions.h
+ # DROPBEAR_SVR_DROP_PRIVS is on by default, turn it off
+ echo "#define DROPBEAR_SVR_DROP_PRIVS 0" >> localoptions.h
- name: make
run: |
--- a/src/auth.h
+++ b/src/auth.h
@@ -40,6 +40,7 @@ void send_msg_userauth_banner(const buff
void svr_auth_password(int valid_user);
void svr_auth_pubkey(int valid_user);
void svr_auth_pam(int valid_user);
+void svr_switch_user(void);
#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
int svr_pubkey_allows_agentfwd(void);
--- a/src/default_options.h
+++ b/src/default_options.h
@@ -297,6 +297,12 @@ group1 in Dropbear server too */
/* -T server option overrides */
#define MAX_AUTH_TRIES 10
+/* Change server process to user privileges after authentication. */
+#ifndef DROPBEAR_SVR_DROP_PRIVS
+/* Default is enabled. Should only be disabled if platforms are incompatible */
+#define DROPBEAR_SVR_DROP_PRIVS DROPBEAR_SVR_MULTIUSER
+#endif
+
/* Delay introduced before closing an unauthenticated session (seconds).
Disabled by default, can be set to say 30 seconds to reduce the speed
of password brute forcing. Note that there is a risk of denial of
--- a/src/svr-agentfwd.c
+++ b/src/svr-agentfwd.c
@@ -151,7 +151,7 @@ void svr_agentcleanup(struct ChanSess *
if (chansess->agentfile != NULL && chansess->agentdir != NULL) {
-#if DROPBEAR_SVR_MULTIUSER
+#if !DROPBEAR_SVR_DROP_PRIVS
/* Remove the dir as the user. That way they can't cause problems except
* for themselves */
uid = getuid();
@@ -160,6 +160,9 @@ void svr_agentcleanup(struct ChanSess *
(seteuid(ses.authstate.pw_uid)) < 0) {
dropbear_exit("Failed to set euid");
}
+#else
+ (void)uid;
+ (void)gid;
#endif
/* 2 for "/" and "\0" */
@@ -172,7 +175,7 @@ void svr_agentcleanup(struct ChanSess *
rmdir(chansess->agentdir);
-#if DROPBEAR_SVR_MULTIUSER
+#if !DROPBEAR_SVR_DROP_PRIVS
if ((seteuid(uid)) < 0 ||
(setegid(gid)) < 0) {
dropbear_exit("Failed to revert euid");
@@ -219,7 +222,7 @@ static int bindagent(int fd, struct Chan
gid_t gid;
int ret = DROPBEAR_FAILURE;
-#if DROPBEAR_SVR_MULTIUSER
+#if !DROPBEAR_SVR_DROP_PRIVS
/* drop to user privs to make the dir/file */
uid = getuid();
gid = getgid();
@@ -227,6 +230,9 @@ static int bindagent(int fd, struct Chan
(seteuid(ses.authstate.pw_uid)) < 0) {
dropbear_exit("Failed to set euid");
}
+#else
+ (void)uid;
+ (void)gid;
#endif
memset((void*)&addr, 0x0, sizeof(addr));
@@ -267,7 +273,7 @@ bindsocket:
out:
-#if DROPBEAR_SVR_MULTIUSER
+#if !DROPBEAR_SVR_DROP_PRIVS
if ((seteuid(uid)) < 0 ||
(setegid(gid)) < 0) {
dropbear_exit("Failed to revert euid");
--- a/src/svr-auth.c
+++ b/src/svr-auth.c
@@ -456,12 +456,22 @@ void send_msg_userauth_success() {
/* authdone must be set after encrypt_packet() for
* delayed-zlib mode */
ses.authstate.authdone = 1;
+
+#if DROPBEAR_DROP_PRIVS
+ svr_switch_user();
+#endif
ses.connect_time = 0;
+#if DROPBEAR_DROP_PRIVS
+ /* If running as the user, we can rely on the OS
+ * to limit allowed ports */
+ ses.allowprivport = 1;
+#else
if (ses.authstate.pw_uid == 0) {
ses.allowprivport = 1;
}
+#endif
/* Remove from the list of pre-auth sockets. Should be m_close(), since if
* we fail, we might end up leaking connection slots, and disallow new
@@ -471,3 +481,38 @@ void send_msg_userauth_success() {
TRACE(("leave send_msg_userauth_success"))
}
+
+/* Switch to the ses.authstate user.
+ * Fails if not running as root and the user differs.
+ *
+ * This may be called either after authentication, or
+ * after shell/command fork if DROPBEAR_SVR_DROP_PRIVS is unset.
+ */
+void svr_switch_user(void) {
+ assert(ses.authstate.authdone);
+
+ /* We can only change uid/gid as root ... */
+ if (getuid() == 0) {
+
+ if ((setgid(ses.authstate.pw_gid) < 0) ||
+ (initgroups(ses.authstate.pw_name,
+ ses.authstate.pw_gid) < 0)) {
+ dropbear_exit("Error changing user group");
+ }
+ if (setuid(ses.authstate.pw_uid) < 0) {
+ dropbear_exit("Error changing user");
+ }
+ } else {
+ /* ... but if the daemon is the same uid as the requested uid, we don't
+ * need to */
+
+ /* XXX - there is a minor issue here, in that if there are multiple
+ * usernames with the same uid, but differing groups, then the
+ * differing groups won't be set (as with initgroups()). The solution
+ * is for the sysadmin not to give out the UID twice */
+ if (getuid() != ses.authstate.pw_uid) {
+ dropbear_exit("Couldn't change user as non-root");
+ }
+ }
+}
+
--- a/src/svr-authpubkey.c
+++ b/src/svr-authpubkey.c
@@ -444,12 +444,14 @@ static int checkpubkey(const char* keyal
buffer * line = NULL;
unsigned int len;
int line_num;
+#if !DROPBEAR_SVR_DROP_PRIVS
uid_t origuid;
gid_t origgid;
+#endif
TRACE(("enter checkpubkey"))
-#if DROPBEAR_SVR_MULTIUSER
+#if !DROPBEAR_SVR_DROP_PRIVS
/* access the file as the authenticating user. */
origuid = getuid();
origgid = getgid();
@@ -476,7 +478,7 @@ static int checkpubkey(const char* keyal
TRACE(("checkpubkey: failed opening %s: %s", filename, strerror(errno)))
}
}
-#if DROPBEAR_SVR_MULTIUSER
+#if !DROPBEAR_SVR_DROP_PRIVS
if ((seteuid(origuid)) < 0 ||
(setegid(origgid)) < 0) {
dropbear_exit("Failed to revert euid");
--- a/src/svr-chansession.c
+++ b/src/svr-chansession.c
@@ -980,30 +980,8 @@ static void execchild(const void *user_d
#endif /* DEBUG_VALGRIND */
}
-#if DROPBEAR_SVR_MULTIUSER
- /* We can only change uid/gid as root ... */
- if (getuid() == 0) {
-
- if ((setgid(ses.authstate.pw_gid) < 0) ||
- (initgroups(ses.authstate.pw_name,
- ses.authstate.pw_gid) < 0)) {
- dropbear_exit("Error changing user group");
- }
- if (setuid(ses.authstate.pw_uid) < 0) {
- dropbear_exit("Error changing user");
- }
- } else {
- /* ... but if the daemon is the same uid as the requested uid, we don't
- * need to */
-
- /* XXX - there is a minor issue here, in that if there are multiple
- * usernames with the same uid, but differing groups, then the
- * differing groups won't be set (as with initgroups()). The solution
- * is for the sysadmin not to give out the UID twice */
- if (getuid() != ses.authstate.pw_uid) {
- dropbear_exit("Couldn't change user as non-root");
- }
- }
+#if !DROPBEAR_SVR_DROP_PRIVS
+ svr_switch_user();
#endif
/* set env vars */
--- a/src/sysoptions.h
+++ b/src/sysoptions.h
@@ -403,6 +403,9 @@
#define DROPBEAR_MULTI 0
#endif
+#if !DROPBEAR_SVR_MULTIUSER && DROPBEAR_SVR_DROP_PRIVS
+#error DROPBEAR_SVR_DROP_PRIVS needs DROPBEAR_SVR_MULTIUSER
+#endif
/* Fuzzing expects all key types to be enabled */
#if DROPBEAR_FUZZ
#if defined(DROPBEAR_DSS)

View File

@@ -0,0 +1,91 @@
From febe8493782965b05025b016091a8bffa5d03563 Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Tue, 9 Dec 2025 09:04:04 +0900
Subject: Remove return code from login_login
Previously this was always 0, so not useful.
(cherry picked from commit b47fe5df58f0b459bb49accdd8cb961d969209fb)
---
src/loginrec.c | 19 +++++--------------
src/loginrec.h | 6 +++---
2 files changed, 8 insertions(+), 17 deletions(-)
--- a/src/loginrec.c
+++ b/src/loginrec.c
@@ -193,32 +193,24 @@ int wtmpx_get_entry(struct logininfo *li
*
* Call with a pointer to a struct logininfo initialised with
* login_init_entry() or login_alloc_entry()
- *
- * Returns:
- * >0 if successful
- * 0 on failure (will use OpenSSH's logging facilities for diagnostics)
*/
-int
+void
login_login (struct logininfo *li)
{
li->type = LTYPE_LOGIN;
- return login_write(li);
+ login_write(li);
}
/* login_logout(struct logininfo *) - Record a logout
*
* Call as with login_login()
- *
- * Returns:
- * >0 if successful
- * 0 on failure (will use OpenSSH's logging facilities for diagnostics)
*/
-int
+void
login_logout(struct logininfo *li)
{
li->type = LTYPE_LOGOUT;
- return login_write(li);
+ login_write(li);
}
@@ -309,7 +301,7 @@ login_set_current_time(struct logininfo
** login_write: Call low-level recording functions based on autoconf
** results
**/
-int
+void
login_write (struct logininfo *li)
{
#ifndef HAVE_CYGWIN
@@ -340,7 +332,6 @@ login_write (struct logininfo *li)
#ifdef USE_WTMPX
wtmpx_write_entry(li);
#endif
- return 0;
}
#ifdef LOGIN_NEEDS_UTMPX
--- a/src/loginrec.h
+++ b/src/loginrec.h
@@ -161,8 +161,8 @@ int login_init_entry(struct logininfo *l
void login_set_current_time(struct logininfo *li);
/* record the entry */
-int login_login (struct logininfo *li);
-int login_logout(struct logininfo *li);
+void login_login (struct logininfo *li);
+void login_logout(struct logininfo *li);
#ifdef LOGIN_NEEDS_UTMPX
int login_utmp_only(struct logininfo *li);
#endif
@@ -170,7 +170,7 @@ int login_utmp_only(struct logininfo *li
/** End of public functions */
/* record the entry */
-int login_write (struct logininfo *li);
+void login_write (struct logininfo *li);
int login_log_entry(struct logininfo *li);
/* produce various forms of the line filename */

View File

@@ -0,0 +1,260 @@
From b20e7823a0c6a4480aa473e0a46d3ccab4b9b102 Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Tue, 9 Dec 2025 09:05:30 +0900
Subject: Retain utmp saved group when dropping privileges
utmp is required to record logout. The saved group
is reset by the OS for the executed user shell.
This requires setresgid() function which is not available on all
platforms. Notable platforms are netbsd and macos. Those platforms will
have to set DROPBEAR_SVR_DROP_PRIVS 0 unless an alternative approach is
found.
(cherry picked from commit 73e4e70ea8e6b890c3918b52bb2e647313a09faa)
---
.github/workflows/build.yml | 6 ++++
configure | 7 +++++
configure.ac | 1 +
src/auth.h | 2 ++
src/config.h.in | 3 ++
src/loginrec.c | 6 ----
src/session.h | 6 ++++
src/svr-auth.c | 61 +++++++++++++++++++++++++++++++++++--
src/svr-chansession.c | 8 +++++
src/sysoptions.h | 4 +++
10 files changed, 96 insertions(+), 8 deletions(-)
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -72,6 +72,9 @@ jobs:
# fails with:
# .../ranlib: file: libtomcrypt.a(cbc_setiv.o) has no symbols
ranlib: ranlib -no_warning_for_no_symbols
+ # macos doesn't have setresgid
+ localoptions: |
+ #define DROPBEAR_SVR_DROP_PRIVS 0
- name: macos 15
os: macos-15
@@ -84,6 +87,9 @@ jobs:
# fails with:
# .../ranlib: file: libtomcrypt.a(cbc_setiv.o) has no symbols
ranlib: ranlib -no_warning_for_no_symbols
+ # macos doesn't have setresgid
+ localoptions: |
+ #define DROPBEAR_SVR_DROP_PRIVS 0
# Check that debug code doesn't bitrot
- name: DEBUG_TRACE
--- a/configure
+++ b/configure
@@ -7597,6 +7597,13 @@ then :
fi
+ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid"
+if test "x$ac_cv_func_setresgid" = xyes
+then :
+ printf "%s\n" "#define HAVE_SETRESGID 1" >>confdefs.h
+
+fi
+
# POSIX monotonic time
ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
--- a/configure.ac
+++ b/configure.ac
@@ -545,6 +545,7 @@ AC_CHECK_FUNCS(utmpname)
AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
AC_CHECK_FUNCS(setutxent utmpxname)
AC_CHECK_FUNCS(logout updwtmp logwtmp)
+AC_CHECK_FUNCS(setresgid)
# POSIX monotonic time
AC_CHECK_FUNCS(clock_gettime)
--- a/src/auth.h
+++ b/src/auth.h
@@ -41,6 +41,8 @@ void svr_auth_password(int valid_user);
void svr_auth_pubkey(int valid_user);
void svr_auth_pam(int valid_user);
void svr_switch_user(void);
+void svr_raise_gid_utmp(void);
+void svr_restore_gid(void);
#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
int svr_pubkey_allows_agentfwd(void);
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -222,6 +222,9 @@
/* Define to 1 if you have the <security/pam_appl.h> header file. */
#undef HAVE_SECURITY_PAM_APPL_H
+/* Define to 1 if you have the `setresgid' function. */
+#undef HAVE_SETRESGID
+
/* Define to 1 if you have the `setutent' function. */
#undef HAVE_SETUTENT
--- a/src/loginrec.c
+++ b/src/loginrec.c
@@ -304,12 +304,6 @@ login_set_current_time(struct logininfo
void
login_write (struct logininfo *li)
{
-#ifndef HAVE_CYGWIN
- if ((int)geteuid() != 0) {
- return 1;
- }
-#endif
-
/* set the timestamp */
login_set_current_time(li);
#ifdef USE_LOGIN
--- a/src/session.h
+++ b/src/session.h
@@ -271,6 +271,12 @@ struct serversession {
/* The instance created by the plugin_new function */
struct PluginInstance *plugin_instance;
#endif
+
+#if DROPBEAR_SVR_DROP_PRIVS
+ /* Set to 1 when utmp_gid is valid */
+ int have_utmp_gid;
+ gid_t utmp_gid;
+#endif
};
typedef enum {
--- a/src/svr-auth.c
+++ b/src/svr-auth.c
@@ -457,13 +457,14 @@ void send_msg_userauth_success() {
* delayed-zlib mode */
ses.authstate.authdone = 1;
-#if DROPBEAR_DROP_PRIVS
+#if DROPBEAR_SVR_DROP_PRIVS
+ /* Drop privileges as soon as authentication has happened. */
svr_switch_user();
#endif
ses.connect_time = 0;
-#if DROPBEAR_DROP_PRIVS
+#if DROPBEAR_SVR_DROP_PRIVS
/* If running as the user, we can rely on the OS
* to limit allowed ports */
ses.allowprivport = 1;
@@ -482,6 +483,20 @@ void send_msg_userauth_success() {
}
+#if DROPBEAR_SVR_DROP_PRIVS
+/* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
+static int utmp_gid(gid_t *ret_gid) {
+ struct group *utmp_gr = getgrnam("utmp");
+ if (!utmp_gr) {
+ TRACE(("No utmp group"));
+ return DROPBEAR_FAILURE;
+ }
+
+ *ret_gid = utmp_gr->gr_gid;
+ return DROPBEAR_SUCCESS;
+}
+#endif
+
/* Switch to the ses.authstate user.
* Fails if not running as root and the user differs.
*
@@ -499,6 +514,25 @@ void svr_switch_user(void) {
ses.authstate.pw_gid) < 0)) {
dropbear_exit("Error changing user group");
}
+
+#if DROPBEAR_SVR_DROP_PRIVS
+ /* Retain utmp saved group so that wtmp/utmp can be written */
+ int ret = utmp_gid(&svr_ses.utmp_gid);
+ if (ret == DROPBEAR_SUCCESS) {
+ /* Set saved gid to utmp so that it can be
+ * restored for login_logout() etc. This saved
+ * group is cleared by the OS on execve() */
+ int rc = setresgid(-1, -1, svr_ses.utmp_gid);
+ if (rc == 0) {
+ svr_ses.have_utmp_gid = 1;
+ } else {
+ /* Will not attempt to switch to utmp gid.
+ * login() etc may fail. */
+ TRACE(("utmp setresgid failed"));
+ }
+ }
+#endif
+
if (setuid(ses.authstate.pw_uid) < 0) {
dropbear_exit("Error changing user");
}
@@ -516,3 +550,26 @@ void svr_switch_user(void) {
}
}
+void svr_raise_gid_utmp(void) {
+#if DROPBEAR_SVR_DROP_PRIVS
+ if (!svr_ses.have_utmp_gid) {
+ return;
+ }
+
+ if (setegid(svr_ses.utmp_gid) != 0) {
+ dropbear_log(LOG_WARNING, "failed setegid");
+ }
+#endif
+}
+
+void svr_restore_gid(void) {
+#if DROPBEAR_SVR_DROP_PRIVS
+ if (!svr_ses.have_utmp_gid) {
+ return;
+ }
+
+ if (setegid(getgid()) != 0) {
+ dropbear_log(LOG_WARNING, "failed setegid");
+ }
+#endif
+}
--- a/src/svr-chansession.c
+++ b/src/svr-chansession.c
@@ -326,7 +326,11 @@ static void cleanupchansess(const struct
if (chansess->tty) {
/* write the utmp/wtmp login record */
li = chansess_login_alloc(chansess);
+
+ svr_raise_gid_utmp();
login_logout(li);
+ svr_restore_gid();
+
login_free_entry(li);
pty_release(chansess->tty);
@@ -847,7 +851,11 @@ static int ptycommand(struct Channel *ch
* terminal used for stdout with the dup2 above, otherwise
* the wtmp login will not be recorded */
li = chansess_login_alloc(chansess);
+
+ svr_raise_gid_utmp();
login_login(li);
+ svr_restore_gid();
+
login_free_entry(li);
/* Can now dup2 stderr. Messages from login_login() have gone
--- a/src/sysoptions.h
+++ b/src/sysoptions.h
@@ -318,6 +318,10 @@
#error "At least one hostkey or public-key algorithm must be enabled; RSA is recommended."
#endif
+#if DROPBEAR_SVR_DROP_PRIVS && !defined(HAVE_SETRESGID)
+ #error "DROPBEAR_SVR_DROP_PRIVS requires setresgid()."
+#endif
+
/* Source for randomness. This must be able to provide hundreds of bytes per SSH
* connection without blocking. */
#ifndef DROPBEAR_URANDOM_DEV

View File

@@ -0,0 +1,64 @@
From ae7f99902161237542f2c71089ff68b8f694006b Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Tue, 9 Dec 2025 09:08:37 +0900
Subject: Limit rekey to current hostkey type
During rekey dropbear process may be running with user privileges, that
can't write a new hostkey when auto-generating keys.
Only offer the original hostkey when rekeying, also for non-autogenerate
case.
(cherry picked from commit a4043dac4e0e0237255200603672ddb0122017a4)
---
src/runopts.h | 1 +
src/svr-kex.c | 8 ++++++++
src/svr-runopts.c | 11 +++++++++++
3 files changed, 20 insertions(+)
--- a/src/runopts.h
+++ b/src/runopts.h
@@ -66,6 +66,7 @@ extern runopts opts;
int readhostkey(const char * filename, sign_key * hostkey,
enum signkey_type *type);
void load_all_hostkeys(void);
+void disable_sig_except(enum signature_type sig_type);
typedef struct svr_runopts {
--- a/src/svr-kex.c
+++ b/src/svr-kex.c
@@ -96,6 +96,14 @@ void recv_msg_kexdh_init() {
}
#endif
+ if (!ses.kexstate.donesecondkex) {
+ /* Disable other signature types.
+ * During future rekeying, privileges may have been dropped
+ * so other keys won't be loadable.
+ * This must occur after send_msg_ext_info() which uses the hostkey list */
+ disable_sig_except(ses.newkeys->algo_signature);
+ }
+
ses.requirenext = SSH_MSG_NEWKEYS;
TRACE(("leave recv_msg_kexdh_init"))
}
--- a/src/svr-runopts.c
+++ b/src/svr-runopts.c
@@ -502,6 +502,17 @@ static void disablekey(enum signature_ty
}
}
+void disable_sig_except(enum signature_type allow_type) {
+ int i;
+ TRACE(("Disabling other sigs except %d", allow_type));
+ for (i = 0; sigalgs[i].name != NULL; i++) {
+ enum signature_type sig_type = sigalgs[i].val;
+ if (sig_type != allow_type) {
+ sigalgs[i].usable = 0;
+ }
+ }
+}
+
static void loadhostkey_helper(const char *name, void** src, void** dst, int fatal_duplicate) {
if (*dst) {
if (fatal_duplicate) {

View File

@@ -0,0 +1,41 @@
From 3e487854fcf09a5ef57a620ebe606f586a6efdc3 Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Fri, 12 Dec 2025 12:31:40 +0900
Subject: Restore seteuid for authorized_keys
Authorized_keys reading is pre-authentication so should not be
modified in the post-auth drop-privilege change.
Fixes: e0251be2354e ("Drop privileges after user authentication")
(cherry picked from commit d193731630a62482855b450daa1d5a5e13a90125)
---
src/svr-authpubkey.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/src/svr-authpubkey.c
+++ b/src/svr-authpubkey.c
@@ -444,14 +444,12 @@ static int checkpubkey(const char* keyal
buffer * line = NULL;
unsigned int len;
int line_num;
-#if !DROPBEAR_SVR_DROP_PRIVS
uid_t origuid;
gid_t origgid;
-#endif
TRACE(("enter checkpubkey"))
-#if !DROPBEAR_SVR_DROP_PRIVS
+#if DROPBEAR_SVR_MULTIUSER
/* access the file as the authenticating user. */
origuid = getuid();
origgid = getgid();
@@ -478,7 +476,7 @@ static int checkpubkey(const char* keyal
TRACE(("checkpubkey: failed opening %s: %s", filename, strerror(errno)))
}
}
-#if !DROPBEAR_SVR_DROP_PRIVS
+#if DROPBEAR_SVR_MULTIUSER
if ((seteuid(origuid)) < 0 ||
(setegid(origgid)) < 0) {
dropbear_exit("Failed to revert euid");

View File

@@ -0,0 +1,153 @@
From 5938a084b0aad887c0f7fa62bf3644d029e4d47d Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Tue, 9 Dec 2025 22:59:19 +0900
Subject: scp CVE-2019-6111 fix
Cherry-pick from OpenSSH portable
391ffc4b9d31 ("upstream: check in scp client that filenames sent during")
upstream: check in scp client that filenames sent during
remote->local directory copies satisfy the wildcard specified by the user.
This checking provides some protection against a malicious server
sending unexpected filenames, but it comes at a risk of rejecting wanted
files due to differences between client and server wildcard expansion rules.
For this reason, this also adds a new -T flag to disable the check.
reported by Harry Sintonen
fix approach suggested by markus@;
has been in snaps for ~1wk courtesy deraadt@
(cherry picked from commit 48a17cff6aa104b8e806ddb2191f83f1024060f1)
---
src/scp.c | 38 +++++++++++++++++++++++++++++---------
1 file changed, 29 insertions(+), 9 deletions(-)
--- a/src/scp.c
+++ b/src/scp.c
@@ -76,6 +76,8 @@
#include "includes.h"
/*RCSID("$OpenBSD: scp.c,v 1.130 2006/01/31 10:35:43 djm Exp $");*/
+#include <fnmatch.h>
+
#include "atomicio.h"
#include "compat.h"
#include "scpmisc.h"
@@ -291,14 +293,14 @@ void verifydir(char *);
uid_t userid;
int errs, remin, remout;
-int pflag, iamremote, iamrecursive, targetshouldbedirectory;
+int Tflag, pflag, iamremote, iamrecursive, targetshouldbedirectory;
#define CMDNEEDS 64
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
int response(void);
void rsource(char *, struct stat *);
-void sink(int, char *[]);
+void sink(int, char *[], const char *);
void source(int, char *[]);
void tolocal(int, char *[]);
void toremote(char *, int, char *[]);
@@ -325,8 +327,8 @@ main(int argc, char **argv)
args.list = NULL;
addargs(&args, "%s", ssh_program);
- fflag = tflag = 0;
- while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:")) != -1)
+ fflag = Tflag = tflag = 0;
+ while ((ch = getopt(argc, argv, "dfl:prtTvBCc:i:P:q1246S:o:F:")) != -1)
switch (ch) {
/* User-visible flags. */
case '1':
@@ -389,9 +391,12 @@ main(int argc, char **argv)
setmode(0, O_BINARY);
#endif
break;
+ case 'T':
+ Tflag = 1;
+ break;
default:
usage();
- }
+ }
argc -= optind;
argv += optind;
@@ -409,7 +414,7 @@ main(int argc, char **argv)
}
if (tflag) {
/* Receive data. */
- sink(argc, argv);
+ sink(argc, argv, NULL);
exit(errs != 0);
}
if (argc < 2)
@@ -589,7 +594,7 @@ tolocal(int argc, char **argv)
continue;
}
xfree(bp);
- sink(1, argv + argc - 1);
+ sink(1, argv + argc - 1, src);
(void) close(remin);
remin = remout = -1;
}
@@ -822,7 +827,7 @@ bwlimit(int amount)
}
void
-sink(int argc, char **argv)
+sink(int argc, char **argv, const char *src)
{
static BUF buffer;
struct stat stb;
@@ -836,6 +841,7 @@ sink(int argc, char **argv)
off_t size, statbytes;
int setimes, targisdir, wrerrno = 0;
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
+ char *src_copy = NULL, *restrict_pattern = NULL;
struct timeval tv[2];
#define atime tv[0]
@@ -857,6 +863,17 @@ sink(int argc, char **argv)
(void) atomicio(vwrite, remout, "", 1);
if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
targisdir = 1;
+ if (src != NULL && !iamrecursive && !Tflag) {
+ /*
+ * Prepare to try to restrict incoming filenames to match
+ * the requested destination file glob.
+ */
+ if ((src_copy = strdup(src)) == NULL)
+ fatal("strdup failed");
+ if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) {
+ *restrict_pattern++ = '\0';
+ }
+ }
for (first = 1;; first = 0) {
cp = buf;
if (atomicio(read, remin, cp, 1) != 1)
@@ -939,6 +956,9 @@ sink(int argc, char **argv)
run_err("error: unexpected filename: %s", cp);
exit(1);
}
+ if (restrict_pattern != NULL &&
+ fnmatch(restrict_pattern, cp, 0) != 0)
+ SCREWUP("filename does not match request");
if (targisdir) {
static char *namebuf = NULL;
static size_t cursize = 0;
@@ -977,7 +997,7 @@ sink(int argc, char **argv)
goto bad;
}
vect[0] = xstrdup(np);
- sink(1, vect);
+ sink(1, vect, src);
if (setimes) {
setimes = 0;
if (utimes(vect[0], tv) < 0)

View File

@@ -1,6 +1,6 @@
--- a/src/svr-chansession.c
+++ b/src/svr-chansession.c
@@ -984,12 +984,12 @@ static void execchild(const void *user_d
--- a/src/svr-auth.c
+++ b/src/svr-auth.c
@@ -509,9 +509,9 @@ void svr_switch_user(void) {
/* We can only change uid/gid as root ... */
if (getuid() == 0) {
@@ -11,6 +11,11 @@
+ ses.authstate.pw_gid) < 0))) {
dropbear_exit("Error changing user group");
}
@@ -533,7 +533,7 @@ void svr_switch_user(void) {
}
#endif
- if (setuid(ses.authstate.pw_uid) < 0) {
+ if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) {
dropbear_exit("Error changing user");

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=odhcpd
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git

View File

@@ -0,0 +1,66 @@
From be7ca7c0792b185263ad86b961ea61129494a7f9 Mon Sep 17 00:00:00 2001
From: Fei Lv <feilv@asrmicro.com>
Date: Fri, 14 Nov 2025 15:31:22 +0800
Subject: [PATCH] config: fix memleak during odhcpd reload
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- The memset in close_interface reset the pios pointer before it
could be freed, causing a memory leak. Relocate the free call
to clean_interface to ensure proper deallocation.
- Use realloc instead of malloc in config_load_ra_pio()
This function may be called multiple times during odhcpd reload,
and using malloc without freeing the previous allocation was
causing memory leaks.
Signed-off-by: Fei Lv <feilv@asrmicro.com>
Link: https://github.com/openwrt/odhcpd/pull/309
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
src/config.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/src/config.c
+++ b/src/config.c
@@ -314,6 +314,7 @@ static void clean_interface(struct inter
free(iface->dnr[i].svc);
}
free(iface->dnr);
+ free(iface->pios);
memset(&iface->ra, 0, sizeof(*iface) - offsetof(struct interface, ra));
set_interface_defaults(iface);
}
@@ -335,7 +336,6 @@ static void close_interface(struct inter
clean_interface(iface);
free(iface->addr4);
free(iface->addr6);
- free(iface->pios);
free(iface->ifname);
free(iface);
}
@@ -1810,6 +1810,7 @@ static json_object *config_load_ra_pio_j
void config_load_ra_pio(struct interface *iface)
{
json_object *json, *slaac_json;
+ struct ra_pio *new_pios;
size_t pio_cnt;
time_t now;
@@ -1829,12 +1830,13 @@ void config_load_ra_pio(struct interface
now = odhcpd_time();
pio_cnt = json_object_array_length(slaac_json);
- iface->pios = malloc(sizeof(struct ra_pio) * pio_cnt);
- if (!iface->pios) {
+ new_pios = realloc(iface->pios, sizeof(struct ra_pio) * pio_cnt);
+ if (!new_pios) {
json_object_put(json);
return;
}
+ iface->pios = new_pios;
iface->pio_cnt = 0;
for (size_t i = 0; i < pio_cnt; i++) {
json_object *cur_pio_json, *length_json, *prefix_json;

View File

@@ -26,9 +26,11 @@ if [ -n "$AUTOIPV6" ]; then
[ -n "$ZONE" ] && json_add_string zone "$ZONE"
[ -n "$EXTENDPREFIX" ] && json_add_string extendprefix 1
[ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE
[ -n "$REQPREFIX" ] && json_add_string reqprefix $REQPREFIX
[ -n "$PEERDNS" ] && json_add_boolean peerdns $PEERDNS
[ "$NOSOURCEFILTER" = "1" ] && json_add_boolean sourcefilter "0"
[ "$DELEGATE" = "0" ] && json_add_boolean delegate "0"
[ -n "$NORELEASE" ] && json_add_boolean norelease "1"
json_close_object
ubus call network add_dynamic "$(json_dump)"
fi

View File

@@ -79,18 +79,20 @@ ppp_generic_init_config() {
proto_config_add_int mtu
proto_config_add_string pppname
proto_config_add_string unnumbered
proto_config_add_string reqprefix
proto_config_add_boolean persist
proto_config_add_int maxfail
proto_config_add_int holdoff
proto_config_add_boolean sourcefilter
proto_config_add_boolean delegate
proto_config_add_boolean norelease
}
ppp_generic_setup() {
local config="$1"; shift
local localip
json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns sourcefilter delegate
json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered reqprefix persist maxfail holdoff peerdns sourcefilter delegate norelease
[ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6
@@ -101,6 +103,11 @@ ppp_generic_setup() {
autoipv6=1
fi
if [ "$autoipv6" != 1 ]; then
reqprefix=""
norelease=""
fi
if [ "${demand:-0}" -gt 0 ]; then
demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
else
@@ -137,6 +144,7 @@ ppp_generic_setup() {
[ -n "$disconnect" ] || json_get_var disconnect disconnect
[ "$sourcefilter" = "0" ] || sourcefilter=""
[ "$delegate" != "0" ] && delegate=""
[ "$norelease" = "1" ] || norelease=""
proto_run_command "$config" /usr/sbin/pppd \
nodetach ipparam "$config" \
@@ -145,6 +153,8 @@ ppp_generic_setup() {
${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adaptive} \
${ipv6:++ipv6} \
${autoipv6:+set AUTOIPV6=1} \
${reqprefix:+set REQPREFIX=$reqprefix} \
${norelease:+set NORELEASE=1} \
${ip6table:+set IP6TABLE=$ip6table} \
${peerdns:+set PEERDNS=$peerdns} \
${sourcefilter:+set NOSOURCEFILTER=1} \
@@ -215,6 +225,7 @@ proto_pppoe_init_config() {
ppp_generic_init_config
proto_config_add_string "ac"
proto_config_add_string "service"
proto_config_add_string "ac_mac"
proto_config_add_string "host_uniq"
proto_config_add_int "padi_attempts"
proto_config_add_int "padi_timeout"
@@ -233,6 +244,7 @@ proto_pppoe_setup() {
json_get_var ac ac
json_get_var service service
json_get_var ac_mac ac_mac
json_get_var host_uniq host_uniq
json_get_var padi_attempts padi_attempts
json_get_var padi_timeout padi_timeout
@@ -241,6 +253,7 @@ proto_pppoe_setup() {
plugin pppoe.so \
${ac:+rp_pppoe_ac "$ac"} \
${service:+rp_pppoe_service "$service"} \
${ac_mac:+pppoe-mac "$ac_mac"} \
${host_uniq:+host-uniq "$host_uniq"} \
${padi_attempts:+pppoe-padi-attempts $padi_attempts} \
${padi_timeout:+pppoe-padi-timeout $padi_timeout} \

View File

@@ -128,8 +128,14 @@ sub update_index($)
-d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 1;
system("$mk -s prepare-mk OPENWRT_BUILD= TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
system("$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
system("$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"targetinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"target\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" SCAN_MAKEOPTS=\"TARGET_BUILD=1\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
my $is_tty = $ENV{IS_TTY};
$is_tty = defined $is_tty ? $is_tty : $ENV{MAKE_TERMOUT};
$is_tty = defined $is_tty ? $is_tty : 1;
system("$mk -s -f include/scan.mk IS_TTY=$is_tty SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
system("$mk -s -f include/scan.mk IS_TTY=$is_tty SCAN_TARGET=\"targetinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"target\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" SCAN_MAKEOPTS=\"TARGET_BUILD=1\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index");
system("ln -sf $name.tmp/.targetinfo ./feeds/$name.targetindex");

View File

@@ -43,12 +43,3 @@ for i in ${patchdir}/${patchpattern} ; do
exit 1
fi
done
# Check for rejects...
if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
echo "Aborting. Reject files found."
exit 1
fi
# Remove backup files
find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;

View File

@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=airoha
BOARDNAME:=Airoha ARM
SUBTARGETS:=en7523 an7581
SUBTARGETS:=en7523 an7581 an7583
FEATURES:=dt squashfs nand ramdisk gpio
KERNEL_PATCHVER:=6.6

View File

@@ -0,0 +1,20 @@
#
# Copyright (C) 2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
airoha,an7581-evb)
ucidef_set_led_usbport "usb1" "USB 1" "green:usb-1" "usb1-port1" "usb2-port1"
ucidef_set_led_usbport "usb2" "USB 2" "green:usb-2" "usb3-port1" "usb4-port1"
;;
esac
board_config_flush
exit 0

View File

@@ -0,0 +1,28 @@
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
an7581_setup_interfaces()
{
local board="$1"
case "$board" in
airoha,an7581-evb)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth1"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}
board_config_update
board=$(board_name)
an7581_setup_interfaces $board
board_config_flush
exit 0

View File

@@ -345,6 +345,7 @@ CONFIG_LOG_BUF_SHIFT=14
# CONFIG_LRU_GEN is not set
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
# CONFIG_MDIO_AIROHA is not set
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_DEVRES=y
@@ -388,6 +389,7 @@ CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_FLAGS=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NET_AIROHA=y
# CONFIG_NET_AIROHA_FLOW_STATS is not set
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
CONFIG_NET_DSA_MT7530=y
@@ -446,7 +448,8 @@ CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_MSI=y
CONFIG_PCPU_DEV_REFCNT=y
CONFIG_PCS_MTK_LYNXI=y
CONFIG_PCS_AIROHA_AN7581=y
# CONFIG_PCS_AIROHA_AN7583 is not set
CONFIG_PERF_EVENTS=y
CONFIG_PER_VMA_LOCK=y
CONFIG_PGTABLE_LEVELS=3
@@ -455,6 +458,7 @@ CONFIG_PHYLIB_LEDS=y
CONFIG_PHYLINK=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_PHY_AIROHA_PCIE=y
CONFIG_PHY_AIROHA_USB=y
CONFIG_PID_NS=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_AIROHA=y
@@ -516,6 +520,7 @@ CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_SECURITY_NETWORK is not set
CONFIG_SERIAL_8250_AIROHA=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_FSL=y
CONFIG_SERIAL_8250_NR_UARTS=5

View File

@@ -0,0 +1,28 @@
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
an7583_setup_interfaces()
{
local board="$1"
case "$board" in
airoha,an7583-evb)
ucidef_set_interface_lan "lan1 lan2 lan3 lan4 eth1"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}
board_config_update
board=$(board_name)
an7583_setup_interfaces $board
board_config_flush
exit 0

View File

@@ -0,0 +1,403 @@
CONFIG_64BIT=y
CONFIG_AIROHA_CPU_PM_DOMAIN=y
CONFIG_AIROHA_SCU_SSR=y
CONFIG_AIROHA_THERMAL=y
CONFIG_AIROHA_WATCHDOG=y
CONFIG_AMPERE_ERRATUM_AC03_CPU_38=y
CONFIG_ARCH_AIROHA=y
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
CONFIG_ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_ARCH_FORCE_MAX_ORDER=10
CONFIG_ARCH_KEEP_MEMBLOCK=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
CONFIG_ARCH_MMAP_RND_BITS=18
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_STACKWALK=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANTS_NO_INSTR=y
CONFIG_ARCH_WANTS_THP_SWAP=y
CONFIG_ARM64=y
CONFIG_ARM64_4K_PAGES=y
CONFIG_ARM64_ERRATUM_843419=y
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
CONFIG_ARM64_PA_BITS=48
CONFIG_ARM64_PA_BITS_48=y
CONFIG_ARM64_PLATFORM_DEVICES=y
CONFIG_ARM64_TAGGED_ADDR_ABI=y
CONFIG_ARM64_VA_BITS=39
CONFIG_ARM64_VA_BITS_39=y
# CONFIG_ARM64_VA_BITS_48 is not set
# CONFIG_ARM64_VA_BITS_52 is not set
CONFIG_ARM_AIROHA_SOC_CPUFREQ=y
CONFIG_ARM_AMBA=y
CONFIG_ARM_ARCH_TIMER=y
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
# CONFIG_ARM_DEBUG_WX is not set
CONFIG_ARM_GIC=y
CONFIG_ARM_GIC_V2M=y
CONFIG_ARM_GIC_V3=y
CONFIG_ARM_GIC_V3_ITS=y
CONFIG_ARM_PMU=y
CONFIG_ARM_PMUV3=y
CONFIG_ARM_PSCI_FW=y
CONFIG_ARM_SMCCC_SOC_ID=y
# CONFIG_ARM_SMMU is not set
# CONFIG_ARM_SMMU_V3 is not set
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_PM=y
CONFIG_BUFFER_HEAD=y
CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
CONFIG_COMMON_CLK_EN7523=y
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
# CONFIG_COMPAT_32BIT_TIME is not set
# CONFIG_COMPRESSED_INSTALL is not set
CONFIG_CONTEXT_TRACKING=y
CONFIG_CONTEXT_TRACKING_IDLE=y
CONFIG_CPUFREQ_DT=y
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_LITTLE_ENDIAN=y
CONFIG_CPU_RMAP=y
CONFIG_CRC16=y
CONFIG_CRC_CCITT=y
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_DEV_EIP93=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_DRBG_HMAC=y
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_JITTERENTROPY=y
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32
CONFIG_CRYPTO_JITTERENTROPY_OSR=1
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_GF128MUL=y
CONFIG_CRYPTO_LIB_SHA1=y
CONFIG_CRYPTO_LIB_SHA256=y
CONFIG_CRYPTO_LIB_UTILS=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_RNG_DEFAULT=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA3=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_DEBUG_MISC=y
CONFIG_DMADEVICES=y
CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y
CONFIG_DMA_DIRECT_REMAP=y
CONFIG_DMA_ENGINE=y
CONFIG_DMA_NEED_SYNC=y
CONFIG_DMA_OF=y
CONFIG_DMA_OPS_HELPERS=y
CONFIG_DTC=y
CONFIG_EDAC_SUPPORT=y
CONFIG_EXT4_FS=y
CONFIG_FIXED_PHY=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_FRAME_POINTER=y
CONFIG_FS_IOMAP=y
CONFIG_FS_MBCACHE=y
CONFIG_FUNCTION_ALIGNMENT=4
CONFIG_FUNCTION_ALIGNMENT_4B=y
CONFIG_FWNODE_MDIO=y
CONFIG_FW_CACHE=y
# CONFIG_FW_LOADER_USER_HELPER is not set
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_ARCH_TOPOLOGY=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_DEVICES=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_EARLY_IOREMAP=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
CONFIG_GENERIC_IOREMAP=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_PHY=y
CONFIG_GENERIC_PINCONF=y
CONFIG_GENERIC_PINCTRL_GROUPS=y
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GLOB=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_CDEV=y
CONFIG_GPIO_EN7523=y
CONFIG_GPIO_GENERIC=y
CONFIG_GRO_CELLS=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
CONFIG_HOTPLUG_CPU=y
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_AIROHA=y
# CONFIG_HISILICON_ERRATUM_162100801 is not set
# CONFIG_IDPF is not set
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_INET_AH=y
CONFIG_INET_ESP=y
# CONFIG_INET_ESP_OFFLOAD is not set
CONFIG_INET_IPCOMP=y
CONFIG_INET_TUNNEL=y
CONFIG_INET_XFRM_TUNNEL=y
CONFIG_IO_URING=y
CONFIG_IPC_NS=y
CONFIG_IPV6=y
CONFIG_IPV6_MULTIPLE_TABLES=y
# CONFIG_IPV6_SUBTREES is not set
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_COMMON=y
# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
CONFIG_IP_PNP=y
# CONFIG_IP_PNP_BOOTP is not set
# CONFIG_IP_PNP_DHCP is not set
# CONFIG_IP_PNP_RARP is not set
# CONFIG_IP_ROUTE_MULTIPATH is not set
# CONFIG_IP_ROUTE_VERBOSE is not set
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_MSI_LIB=y
CONFIG_IRQ_WORK=y
CONFIG_JBD2=y
CONFIG_LIBFDT=y
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_LRU_GEN_WALKS_MMU=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_AIROHA=y
CONFIG_MDIO_DEVRES=y
# CONFIG_MEDIATEK_GE_SOC_PHY is not set
# CONFIG_MEMCG is not set
CONFIG_MFD_SYSCON=y
CONFIG_MIGRATION=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_CQHCI=y
CONFIG_MMC_MTK=y
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_MTD_NAND_CORE=y
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_MTK_BMT=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_SPI_NAND=y
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_FIT_FW=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_MTD_UBI_BLOCK=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_NET_AIROHA=y
CONFIG_NET_AIROHA_FLOW_STATS=y
CONFIG_NET_AIROHA_NPU=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
CONFIG_NET_DSA_MT7530=y
CONFIG_NET_DSA_MT7530_MDIO=y
CONFIG_NET_DSA_MT7530_MMIO=y
CONFIG_NET_DSA_TAG_MTK=y
CONFIG_NET_FLOW_LIMIT=y
# CONFIG_NET_MEDIATEK_SOC is not set
CONFIG_NET_SELFTESTS=y
# CONFIG_NET_VENDOR_3COM is not set
CONFIG_NET_VENDOR_AIROHA=y
# CONFIG_NET_VENDOR_MEDIATEK is not set
CONFIG_NLS=y
CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y
CONFIG_NR_CPUS=4
CONFIG_NVMEM=y
CONFIG_NVMEM_BLOCK=y
CONFIG_NVMEM_LAYOUTS=y
CONFIG_NVMEM_LAYOUT_ASCII_ENV=y
CONFIG_NVMEM_SYSFS=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
CONFIG_OF_GPIO=y
CONFIG_OF_IRQ=y
CONFIG_OF_KOBJ=y
CONFIG_OF_MDIO=y
CONFIG_PAGE_POOL=y
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
CONFIG_PARTITION_PERCPU=y
CONFIG_PCI=y
CONFIG_PCIEAER=y
CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEFAULT is not set
CONFIG_PCIEASPM_PERFORMANCE=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_MEDIATEK=y
CONFIG_PCIE_MEDIATEK_GEN3=y
CONFIG_PCIE_PME=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_MSI=y
# CONFIG_PCS_AIROHA_AN7581 is not set
CONFIG_PCS_AIROHA_AN7583=y
CONFIG_PERF_EVENTS=y
CONFIG_PER_VMA_LOCK=y
CONFIG_PGTABLE_LEVELS=3
CONFIG_PHYLIB=y
CONFIG_PHYLIB_LEDS=y
CONFIG_PHYLINK=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_PHY_AIROHA_PCIE=y
# CONFIG_PHY_AIROHA_USB is not set
CONFIG_PINCTRL=y
CONFIG_PINCTRL_AIROHA=y
# CONFIG_PINCTRL_MT2712 is not set
# CONFIG_PINCTRL_MT6765 is not set
# CONFIG_PINCTRL_MT6795 is not set
# CONFIG_PINCTRL_MT6797 is not set
# CONFIG_PINCTRL_MT7622 is not set
# CONFIG_PINCTRL_MT7981 is not set
# CONFIG_PINCTRL_MT7986 is not set
# CONFIG_PINCTRL_MT8173 is not set
# CONFIG_PINCTRL_MT8183 is not set
# CONFIG_PINCTRL_MT8186 is not set
# CONFIG_PINCTRL_MT8188 is not set
# CONFIG_PINCTRL_MT8516 is not set
CONFIG_PM=y
CONFIG_PM_CLK=y
CONFIG_PM_OPP=y
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_POWER_SUPPLY=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_QUEUED_SPINLOCKS=y
CONFIG_RANDSTRUCT_NONE=y
CONFIG_RAS=y
CONFIG_RATIONAL=y
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_RELOCATABLE=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RFS_ACCEL=y
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
CONFIG_RPS=y
CONFIG_RTL8261N_PHY=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_SERIAL_8250_AIROHA=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_FSL=y
CONFIG_SERIAL_8250_NR_UARTS=5
CONFIG_SERIAL_8250_RUNTIME_UARTS=5
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SGL_ALLOC=y
CONFIG_SKB_EXTENSIONS=y
CONFIG_SMP=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_SOC_BUS=y
CONFIG_SOFTIRQ_ON_OWN_STACK=y
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSE_IRQ=y
CONFIG_SPI=y
# CONFIG_SPI_AIROHA_EN7523 is not set
CONFIG_SPI_AIROHA_SNFI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
CONFIG_SWIOTLB=y
CONFIG_SWPHY=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
# CONFIG_TEST_FPU is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
CONFIG_THERMAL_GOV_STEP_WISE=y
CONFIG_THERMAL_OF=y
CONFIG_THREAD_INFO_IN_TASK=y
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TIMER_OF=y
CONFIG_TIMER_PROBE=y
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
CONFIG_TREE_RCU=y
CONFIG_TREE_SRCU=y
CONFIG_UBIFS_FS=y
# CONFIG_UNMAP_KERNEL_AT_EL0 is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_VDSO_GETRANDOM=y
CONFIG_VMAP_STACK=y
CONFIG_WATCHDOG_CORE=y
# CONFIG_WLAN is not set
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_XFRM_AH=y
CONFIG_XFRM_ALGO=y
CONFIG_XFRM_ESP=y
CONFIG_XFRM_IPCOMP=y
CONFIG_XFRM_MIGRATE=y
CONFIG_XPS=y
CONFIG_XXHASH=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZONE_DMA32=y
CONFIG_ZSTD_COMMON=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y

View File

@@ -0,0 +1,11 @@
ARCH:=aarch64
SUBTARGET:=an7583
BOARDNAME:=AN7583
CPU_TYPE:=cortex-a53
KERNELNAME:=Image dtbs
FEATURES+=pwm source-only
define Target/Description
Build firmware images for Airoha an7583 ARM based boards.
endef

View File

@@ -57,6 +57,13 @@
};
};
pcie2_rst_pins: pcie2-rst-pins {
conf {
pins = "pcie_reset2";
drive-open-drain = <1>;
};
};
gswp1_led0_pins: gswp1-led0-pins {
mux {
function = "phy1_led0";
@@ -99,6 +106,17 @@
};
};
&usb0 {
status = "okay";
};
&usb1 {
status = "okay";
mediatek,u3p-dis-msk = <0x1>;
phys = <&usb1_phy PHY_TYPE_USB2>;
};
&mmc0 {
pinctrl-names = "default", "state_uhs";
pinctrl-0 = <&mmc_pins>;
@@ -156,6 +174,46 @@
status = "okay";
};
&pcie2 {
pinctrl-names = "default";
pinctrl-0 = <&pcie2_rst_pins>;
status = "okay";
};
&mdio {
as21xx_1: ethernet-phy@1d {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <0x1d>;
firmware-name = "as21x1x_fw.bin";
reset-deassert-us = <1000000>;
reset-assert-us = <1000000>;
reset-gpios = <&en7581_pinctrl 31 GPIO_ACTIVE_LOW>;
leds {
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
default-state = "keep";
};
led@1 {
reg = <1>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
default-state = "keep";
};
};
};
};
&eth {
status = "okay";
};
@@ -164,6 +222,13 @@
status = "okay";
};
&gdm4 {
status = "okay";
phy-handle = <&as21xx_1>;
phy-mode = "usxgmii";
};
&switch {
pinctrl-names = "default";
pinctrl-0 = <&mdio_pins>;

View File

@@ -3,6 +3,9 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/en7523-clk.h>
#include <dt-bindings/phy/phy.h>
#include <dt-bindings/phy/airoha,an7581-usb-phy.h>
#include <dt-bindings/soc/airoha,scu-ssr.h>
#include <dt-bindings/reset/airoha,en7581-reset.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/thermal/thermal.h>
@@ -17,29 +20,39 @@
#size-cells = <2>;
ranges;
npu-binary@84000000 {
atf@80000000 {
no-map;
reg = <0x0 0x80000000 0x0 0x200000>;
};
npu_binary: npu-binary@84000000 {
no-map;
reg = <0x0 0x84000000 0x0 0xa00000>;
};
npu-flag@84b0000 {
qdma0_buf: qdma0-buf@87000000 {
no-map;
reg = <0x0 0x84b00000 0x0 0x100000>;
reg = <0x0 0x87000000 0x0 0x2000000>;
};
npu-pkt@85000000 {
qdma1_buf: qdma1-buf@89000000 {
no-map;
reg = <0x0 0x85000000 0x0 0x1a00000>;
reg = <0x0 0x89000000 0x0 0x1000000>;
};
npu-phyaddr@86b00000 {
npu_pkt: npu-pkt@8a000000 {
no-map;
reg = <0x0 0x86b00000 0x0 0x100000>;
reg = <0x0 0x8a000000 0x0 0x2c00000>;
};
npu-rxdesc@86d00000 {
npu_txpkt: npu-txpkt@8cc00000 {
no-map;
reg = <0x0 0x86d00000 0x0 0x100000>;
reg = <0x0 0x8cc00000 0x0 0x4000000>;
};
npu_txbufid: npu-txbufid@90c00000 {
no-map;
reg = <0x0 0x90c00000 0x0 0x6800>;
};
};
@@ -428,6 +441,48 @@
status = "disabled";
};
pon_pcs: pcs@1fa08000 {
compatible = "airoha,an7581-pcs-pon";
reg = <0x0 0x1fa08000 0x0 0x1000>,
<0x0 0x1fa80000 0x0 0x60>,
<0x0 0x1fa80a00 0x0 0x164>,
<0x0 0x1fa84000 0x0 0x450>,
<0x0 0x1fa85900 0x0 0x338>,
<0x0 0x1fa86000 0x0 0x300>,
<0x0 0x1fa8a000 0x0 0x1000>,
<0x0 0x1fa8b000 0x0 0x1000>;
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
"multi_sgmii", "usxgmii",
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
resets = <&scuclk EN7581_XPON_MAC_RST>,
<&scuclk EN7581_XPON_PHY_RST>;
reset-names = "mac", "phy";
airoha,scu = <&scuclk>;
};
eth_pcs: pcs@1fa09000 {
compatible = "airoha,an7581-pcs-eth";
reg = <0x0 0x1fa09000 0x0 0x1000>,
<0x0 0x1fa70000 0x0 0x60>,
<0x0 0x1fa70a00 0x0 0x164>,
<0x0 0x1fa74000 0x0 0x450>,
<0x0 0x1fa75900 0x0 0x338>,
<0x0 0x1fa76000 0x0 0x300>,
<0x0 0x1fa7a000 0x0 0x1000>,
<0x0 0x1fa7b000 0x0 0x1000>;
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
"multi_sgmii", "usxgmii",
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
resets = <&scuclk EN7581_XSI_MAC_RST>,
<&scuclk EN7581_XSI_PHY_RST>;
reset-names = "mac", "phy";
airoha,scu = <&scuclk>;
};
chip_scu: syscon@1fa20000 {
compatible = "airoha,en7581-chip-scu", "syscon";
reg = <0x0 0x1fa20000 0x0 0x388>;
@@ -438,8 +493,8 @@
reg = <0x0 0x1fbe3400 0x0 0xff>;
};
scuclk: clock-controller@1fa20000 {
compatible = "airoha,en7581-scu";
scuclk: clock-controller@1fb00000 {
compatible = "airoha,en7581-scu", "syscon";
reg = <0x0 0x1fb00000 0x0 0x970>;
#clock-cells = <1>;
#reset-cells = <1>;
@@ -451,6 +506,52 @@
interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
};
usb0: usb@1fab0000 {
compatible = "mediatek,mtk-xhci";
reg = <0x0 0x1fab0000 0x0 0x3e00>,
<0x0 0x1fab3e00 0x0 0x100>;
reg-names = "mac", "ippc";
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
phys = <&usb0_phy PHY_TYPE_USB2>, <&usb0_phy PHY_TYPE_USB3>;
status = "disabled";
};
usb0_phy: phy@1fac0000 {
compatible = "airoha,an7581-usb-phy";
reg = <0x0 0x1fac0000 0x0 0x10000>;
airoha,scu = <&scuclk>;
airoha,usb2-monitor-clk-sel = <AIROHA_USB2_MONCLK_SEL1>;
airoha,serdes-port = <AIROHA_SCU_SERDES_USB1>;
#phy-cells = <1>;
};
usb1: usb@1fad0000 {
compatible = "mediatek,mtk-xhci";
reg = <0x0 0x1fad0000 0x0 0x3e00>,
<0x0 0x1fad3e00 0x0 0x100>;
reg-names = "mac", "ippc";
interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
phys = <&usb1_phy PHY_TYPE_USB2>, <&usb1_phy PHY_TYPE_USB3>;
status = "disabled";
};
usb1_phy: phy@1fae0000 {
compatible = "airoha,an7581-usb-phy";
reg = <0x0 0x1fae0000 0x0 0x10000>;
airoha,scu = <&scuclk>;
airoha,usb2-monitor-clk-sel = <AIROHA_USB2_MONCLK_SEL2>;
airoha,serdes-port = <AIROHA_SCU_SERDES_USB2>;
#phy-cells = <1>;
};
crypto@1e004000 {
compatible = "inside-secure,safexcel-eip93ies";
reg = <0x0 0x1fb70000 0x0 0x1000>;
@@ -510,7 +611,7 @@
#address-cells = <1>;
#size-cells = <0>;
status = "disable";
status = "disabled";
};
i2c1: i2c1@1fbf8100 {
@@ -524,7 +625,7 @@
#address-cells = <1>;
#size-cells = <0>;
status = "disable";
status = "disabled";
};
snfi: spi@1fa10000 {
@@ -666,6 +767,74 @@
};
};
pcie2: pcie@1fc40000 {
compatible = "airoha,en7581-pcie";
device_type = "pci";
linux,pci-domain = <2>;
#address-cells = <3>;
#size-cells = <2>;
reg = <0x0 0x1fc40000 0x0 0x1670>;
reg-names = "pcie-mac";
clocks = <&scuclk EN7523_CLK_PCIE>;
clock-names = "sys-ck";
phys = <&usb1_phy PHY_TYPE_USB3>;
phy-names = "pcie-phy";
ranges = <0x02000000 0 0x28000000 0x0 0x28000000 0 0x4000000>;
resets = <&scuclk EN7581_PCIE0_RST>,
<&scuclk EN7581_PCIE1_RST>,
<&scuclk EN7581_PCIE2_RST>;
reset-names = "phy-lane0", "phy-lane1", "phy-lane2";
mediatek,pbus-csr = <&pbus_csr 0x10 0x14>;
interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
bus-range = <0x00 0xff>;
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0 0 0 1 &pcie_intc2 0>,
<0 0 0 2 &pcie_intc2 1>,
<0 0 0 3 &pcie_intc2 2>,
<0 0 0 4 &pcie_intc2 3>;
status = "disabled";
pcie_intc2: interrupt-controller {
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <1>;
};
};
npu: npu@1e900000 {
compatible = "airoha,en7581-npu";
reg = <0x0 0x1e900000 0x0 0x313000>;
interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
memory-region = <&npu_binary>, <&npu_pkt>, <&npu_txpkt>,
<&npu_txbufid>;
memory-region-names = "binary", "pkt", "tx-pkt",
"tx-bufid";
status = "disabled";
};
eth: ethernet@1fb50000 {
compatible = "airoha,en7581-eth";
reg = <0 0x1fb50000 0 0x2600>,
@@ -696,6 +865,11 @@
<GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
memory-region = <&qdma0_buf>, <&qdma1_buf>;
memory-region-names = "qdma0-buf", "qdma1-buf";
airoha,npu = <&npu>;
status = "disabled";
#address-cells = <1>;
@@ -713,6 +887,22 @@
pause;
};
};
gdm2: ethernet@2 {
compatible = "airoha,eth-mac";
reg = <2>;
pcs = <&pon_pcs>;
status = "disabled";
};
gdm4: ethernet@4 {
compatible = "airoha,eth-mac";
reg = <4>;
pcs = <&eth_pcs>;
status = "disabled";
};
};
switch: switch@1fb58000 {
@@ -776,7 +966,7 @@
};
};
mdio {
mdio: mdio {
#address-cells = <1>;
#size-cells = <0>;

View File

@@ -0,0 +1,297 @@
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/dts-v1/;
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "an7583.dtsi"
/ {
model = "Airoha AN7583 Evaluation Board";
compatible = "airoha,an7583-evb", "airoha,an7583", "airoha,en7583";
aliases {
serial0 = &uart1;
};
chosen {
bootargs = "console=ttyS0,115200 earlycon";
stdout-path = "serial0:115200n8";
};
memory@80000000 {
device_type = "memory";
reg = <0x0 0x80000000 0x2 0x00000000>;
};
gpio-keys-polled {
compatible = "gpio-keys-polled";
poll-interval = <100>;
btn-reset {
label = "reset";
linux,code = <BTN_0>;
gpios = <&an7583_pinctrl 0 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led-1 {
label = "pon";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&an7583_pinctrl 12 GPIO_ACTIVE_LOW>;
};
led-2 {
label = "internet";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&an7583_pinctrl 26 GPIO_ACTIVE_LOW>;
};
led-3 {
label = "wps";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&an7583_pinctrl 31 GPIO_ACTIVE_LOW>;
};
led-4 {
label = "los";
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_STATUS;
gpios = <&an7583_pinctrl 27 GPIO_ACTIVE_LOW>;
};
led-5 {
label = "voip_hook";
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&an7583_pinctrl 29 GPIO_ACTIVE_LOW>;
};
};
};
&an7583_pinctrl {
gpio-ranges = <&an7583_pinctrl 0 2 53>;
mdio0_pins: mdio0-pins {
conf {
pins = "mdio_0";
output-high;
};
};
pcie0_rst_pins: pcie0-rst-pins {
conf {
pins = "pcie_reset0";
drive-open-drain = <1>;
};
};
pcie1_rst_pins: pcie1-rst-pins {
conf {
pins = "pcie_reset1";
drive-open-drain = <1>;
};
};
gswp1_led0_pins: gswp1-led0-pins {
mux {
function = "phy1_led0";
pins = "gpio1";
};
};
gswp2_led0_pins: gswp2-led0-pins {
mux {
function = "phy2_led0";
pins = "gpio2";
};
};
gswp3_led0_pins: gswp3-led0-pins {
mux {
function = "phy3_led0";
pins = "gpio3";
};
};
gswp4_led0_pins: gswp4-led0-pins {
mux {
function = "phy4_led0";
pins = "gpio4";
};
};
mmc_pins: mmc-pins {
mux {
function = "emmc";
groups = "emmc";
};
};
};
&mmc0 {
pinctrl-names = "default", "state_uhs";
pinctrl-0 = <&mmc_pins>;
pinctrl-1 = <&mmc_pins>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
card@0 {
compatible = "mmc-card";
reg = <0>;
block {
compatible = "block-device";
partitions {
block-partition-factory {
partname = "art";
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x40000 0x1e00>;
};
mac_factory_2c0000: mac@2c0000 {
reg = <0x2c0000 0x6>;
};
pon_mac_factory_2c0006: pon_mac@2c0006 {
reg = <0x2c0006 0x6>;
};
onu_type_factory_2e0000: onu_type@2e0000 {
reg = <0x2e0000 0x10>;
};
board_config_factory_2e0010: board_config@2e0010 {
reg = <0x2e0010 0x8>;
};
};
};
};
};
};
};
&i2c0 {
status = "okay";
};
&i2c1 {
status = "okay";
};
&mdio_0 {
pinctrl-names = "default";
pinctrl-0 = <&mdio0_pins>;
en8811: ethernet-phy@f {
reg = <0xf>;
reset-gpios = <&an7583_pinctrl 28 GPIO_ACTIVE_LOW>;
reset-assert-us = <10000>;
reset-deassert-us = <20000>;
leds {
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_GREEN>;
function-enumerator = <0>;
default-state = "keep";
};
led@1 {
reg = <1>;
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_GREEN>;
function-enumerator = <1>;
default-state = "keep";
};
};
};
};
&npu {
status = "okay";
};
&eth {
status = "okay";
nvmem-cells = <&mac_factory_2c0000>;
nvmem-cell-names = "mac";
};
&gdm1 {
status = "okay";
};
&gdm3 {
status = "okay";
phy-handle = <&en8811>;
phy-mode = "2500base-x";
};
&switch {
status = "okay";
};
&gsw_phy1 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp1_led0_pins>;
status = "okay";
};
&gsw_phy1_led0 {
status = "okay";
active-low;
};
&gsw_phy2 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp2_led0_pins>;
status = "okay";
};
&gsw_phy2_led0 {
status = "okay";
active-low;
};
&gsw_phy3 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp3_led0_pins>;
status = "okay";
};
&gsw_phy3_led0 {
status = "okay";
active-low;
};
&gsw_phy4 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp4_led0_pins>;
status = "okay";
};
&gsw_phy4_led0 {
status = "okay";
active-low;
};

View File

@@ -0,0 +1,226 @@
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/dts-v1/;
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "an7583.dtsi"
/ {
model = "Airoha AN7583 Evaluation Board";
compatible = "airoha,an7583-evb", "airoha,an7583", "airoha,en7583";
aliases {
serial0 = &uart1;
};
chosen {
bootargs = "console=ttyS0,115200 earlycon";
stdout-path = "serial0:115200n8";
};
memory@80000000 {
device_type = "memory";
reg = <0x0 0x80000000 0x2 0x00000000>;
};
};
&an7583_pinctrl {
gpio-ranges = <&an7583_pinctrl 0 2 53>;
mdio0_pins: mdio0-pins {
conf {
pins = "mdio_0";
output-high;
};
};
pcie0_rst_pins: pcie0-rst-pins {
conf {
pins = "pcie_reset0";
drive-open-drain = <1>;
};
};
pcie1_rst_pins: pcie1-rst-pins {
conf {
pins = "pcie_reset1";
drive-open-drain = <1>;
};
};
gswp1_led0_pins: gswp1-led0-pins {
mux {
function = "phy1_led0";
pins = "gpio1";
};
};
};
&snfi {
status = "okay";
};
&spi_nand {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
bl2@0 {
label = "bl2";
reg = <0x0 0x20000>;
};
ubi@20000 {
label = "ubi";
reg = <0x20000 0x0>;
};
};
};
&i2c0 {
status = "okay";
};
&npu {
status = "okay";
};
&eth {
status = "okay";
};
&gdm1 {
status = "okay";
};
&switch {
status = "okay";
};
&gsw_phy1 {
pinctrl-names = "gbe-led";
pinctrl-0 = <&gswp1_led0_pins>;
status = "okay";
};
&gsw_phy1_led0 {
status = "okay";
active-low;
};
&gsw_port2 {
status = "disabled";
};
&gsw_port3 {
status = "disabled";
};
&gsw_port4 {
status = "disabled";
};
&gsw_phy2 {
status = "disabled";
};
&gsw_phy3 {
status = "disabled";
};
&gsw_phy4 {
status = "disabled";
};
&mdio_0 {
pinctrl-names = "default";
pinctrl-0 = <&mdio0_pins>;
/* Present but not HW connected to GDM port */
/*
* as21xx_0: ethernet-phy@1d {
* reg = <0x1d>;
* compatible = "ethernet-phy-ieee802.3-c45";
* status = "disabled";
*
* firmware-name = "as21x1x_fw.bin";
*
* reset-deassert-us = <350000>;
* reset-assert-us = <200000>;
* reset-gpios = <&an7583_pinctrl 34 GPIO_ACTIVE_LOW>;
*
* leds {
* #address-cells = <1>;
* #size-cells = <0>;
*
* led@0 {
* reg = <0>;
* color = <LED_COLOR_ID_GREEN>;
* function = LED_FUNCTION_LAN;
* function-enumerator = <0>;
* default-state = "keep";
* };
*
* led@1 {
* reg = <1>;
* color = <LED_COLOR_ID_GREEN>;
* function = LED_FUNCTION_LAN;
* function-enumerator = <1>;
* default-state = "keep";
* };
* };
* };
*/
as21xx_1: ethernet-phy@1f {
reg = <0x1f>;
compatible = "ethernet-phy-ieee802.3-c45";
firmware-name = "as21x1x_fw.bin";
reset-deassert-us = <350000>;
reset-assert-us = <200000>;
reset-gpios = <&an7583_pinctrl 35 GPIO_ACTIVE_LOW>;
leds {
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
default-state = "keep";
};
led@1 {
reg = <1>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
default-state = "keep";
};
};
};
};
/* GDM2 seems to be connected to PON */
/*
*&gdm2 {
* status = "disabled";
*
* phy-handle = <&as21xx_0>;
* phy-mode = "usxgmii";
*};
*/
&gdm3 {
status = "okay";
phy-handle = <&as21xx_1>;
phy-mode = "usxgmii";
};

View File

@@ -0,0 +1,844 @@
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/en7523-clk.h>
#include <dt-bindings/phy/phy.h>
#include <dt-bindings/reset/airoha,an7583-reset.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/thermal/thermal.h>
/ {
interrupt-parent = <&gic>;
#address-cells = <2>;
#size-cells = <2>;
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
atf@80000000 {
no-map;
reg = <0x0 0x80000000 0x0 0x200000>;
};
npu_binary: npu-binary@84000000 {
no-map;
reg = <0x0 0x84000000 0x0 0xa00000>;
};
qdma0_buf: qdma0-buf@87000000 {
no-map;
reg = <0x0 0x87000000 0x0 0x2000000>;
};
qdma1_buf: qdma1-buf@89000000 {
no-map;
reg = <0x0 0x89000000 0x0 0x1000000>;
};
};
psci {
compatible = "arm,psci-1.0";
method = "smc";
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu-map {
cluster0 {
core0 {
cpu = <&cpu0>;
};
core1 {
cpu = <&cpu1>;
};
};
};
cpu0: cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a53";
reg = <0x0>;
operating-points-v2 = <&cpu_opp_table>;
enable-method = "psci";
clocks = <&cpufreq>;
clock-names = "cpu";
power-domains = <&cpufreq>;
power-domain-names = "perf";
next-level-cache = <&l2>;
#cooling-cells = <2>;
};
cpu1: cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a53";
reg = <0x1>;
operating-points-v2 = <&cpu_opp_table>;
enable-method = "psci";
clocks = <&cpufreq>;
clock-names = "cpu";
power-domains = <&cpufreq>;
power-domain-names = "perf";
next-level-cache = <&l2>;
#cooling-cells = <2>;
};
l2: l2-cache {
compatible = "cache";
cache-size = <0x80000>;
cache-line-size = <64>;
cache-level = <2>;
cache-unified;
};
};
cpufreq: cpufreq {
compatible = "airoha,en7581-cpufreq";
operating-points-v2 = <&cpu_smcc_opp_table>;
#power-domain-cells = <0>;
#clock-cells = <0>;
};
cpu_opp_table: opp-table {
compatible = "operating-points-v2";
opp-shared;
opp-500000000 {
opp-hz = /bits/ 64 <500000000>;
required-opps = <&smcc_opp0>;
};
opp-550000000 {
opp-hz = /bits/ 64 <550000000>;
required-opps = <&smcc_opp1>;
};
opp-600000000 {
opp-hz = /bits/ 64 <600000000>;
required-opps = <&smcc_opp2>;
};
opp-650000000 {
opp-hz = /bits/ 64 <650000000>;
required-opps = <&smcc_opp3>;
};
opp-7000000000 {
opp-hz = /bits/ 64 <700000000>;
required-opps = <&smcc_opp4>;
};
opp-7500000000 {
opp-hz = /bits/ 64 <750000000>;
required-opps = <&smcc_opp5>;
};
opp-8000000000 {
opp-hz = /bits/ 64 <800000000>;
required-opps = <&smcc_opp6>;
};
opp-8500000000 {
opp-hz = /bits/ 64 <850000000>;
required-opps = <&smcc_opp7>;
};
opp-9000000000 {
opp-hz = /bits/ 64 <900000000>;
required-opps = <&smcc_opp8>;
};
opp-9500000000 {
opp-hz = /bits/ 64 <950000000>;
required-opps = <&smcc_opp9>;
};
opp-10000000000 {
opp-hz = /bits/ 64 <1000000000>;
required-opps = <&smcc_opp10>;
};
opp-10500000000 {
opp-hz = /bits/ 64 <1050000000>;
required-opps = <&smcc_opp11>;
};
opp-11000000000 {
opp-hz = /bits/ 64 <1100000000>;
required-opps = <&smcc_opp12>;
};
opp-11500000000 {
opp-hz = /bits/ 64 <1150000000>;
required-opps = <&smcc_opp13>;
};
opp-12000000000 {
opp-hz = /bits/ 64 <1200000000>;
required-opps = <&smcc_opp14>;
};
};
cpu_smcc_opp_table: opp-table-cpu-smcc {
compatible = "operating-points-v2";
smcc_opp0: opp0 {
opp-level = <0>;
};
smcc_opp1: opp1 {
opp-level = <1>;
};
smcc_opp2: opp2 {
opp-level = <2>;
};
smcc_opp3: opp3 {
opp-level = <3>;
};
smcc_opp4: opp4 {
opp-level = <4>;
};
smcc_opp5: opp5 {
opp-level = <5>;
};
smcc_opp6: opp6 {
opp-level = <6>;
};
smcc_opp7: opp7 {
opp-level = <7>;
};
smcc_opp8: opp8 {
opp-level = <8>;
};
smcc_opp9: opp9 {
opp-level = <9>;
};
smcc_opp10: opp10 {
opp-level = <10>;
};
smcc_opp11: opp11 {
opp-level = <11>;
};
smcc_opp12: opp12 {
opp-level = <12>;
};
smcc_opp13: opp13 {
opp-level = <13>;
};
smcc_opp14: opp14 {
opp-level = <14>;
};
};
timer {
compatible = "arm,armv8-timer";
interrupt-parent = <&gic>;
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
<GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
<GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
<GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
};
thermal-zones {
cpu_thermal: cpu-thermal {
polling-delay-passive = <10000>;
polling-delay = <5000>;
thermal-sensors = <&thermal 0>;
trips {
cpu_hot: cpu-hot {
temperature = <95000>;
hysteresis = <1000>;
type = "hot";
};
cpu-critical {
temperature = <110000>;
hysteresis = <1000>;
type = "critical";
};
};
cooling-maps {
map0 {
trip = <&cpu_hot>;
cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
};
clk25m: oscillator {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <25000000>;
clock-output-names = "clkxtal";
};
sys_hclk: clk-oscillator-100mhz {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <100000000>;
clock-output-names = "sys_hclk";
};
vmmc_3v3: regulator-vmmc-3v3 {
compatible = "regulator-fixed";
regulator-name = "vmmc";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
sfp1: sfp1 {
compatible = "sff,sfp";
};
sfp2: sfp2 {
compatible = "sff,sfp";
};
soc {
compatible = "simple-bus";
#address-cells = <2>;
#size-cells = <2>;
ranges;
gic: interrupt-controller@9000000 {
compatible = "arm,gic-v3";
interrupt-controller;
#interrupt-cells = <3>;
#address-cells = <1>;
#size-cells = <1>;
reg = <0x0 0x09000000 0x0 0x20000>,
<0x0 0x09080000 0x0 0x80000>,
<0x0 0x09400000 0x0 0x2000>,
<0x0 0x09500000 0x0 0x2000>,
<0x0 0x09600000 0x0 0x20000>;
interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>;
};
chip_scu: syscon@1fa20000 {
compatible = "airoha,en7581-chip-scu", "syscon", "simple-mfd";
reg = <0x0 0x1fa20000 0x0 0x388>;
thermal: thermal {
compatible = "airoha,an7583-thermal";
#thermal-sensor-cells = <0>;
};
};
pbus_csr: syscon@1fbe3400 {
compatible = "airoha,en7581-pbus-csr", "syscon";
reg = <0x0 0x1fbe3400 0x0 0xff>;
};
scuclk: system-controller@1fa20000 {
compatible = "airoha,an7583-scu", "syscon";
reg = <0x0 0x1fb00000 0x0 0x970>;
#address-cells = <1>;
#size-cells = <0>;
#clock-cells = <1>;
#reset-cells = <1>;
airoha,chip-scu = <&chip_scu>;
mdio_0: mdio-bus@c8 {
compatible = "airoha,an7583-mdio";
reg = <0xc8>;
clocks = <&scuclk AN7583_CLK_MDIO0>;
resets = <&scuclk AN7583_MDIO0>;
};
mdio_1: mdio-bus@cc {
compatible = "airoha,an7583-mdio";
reg = <0xcc>;
clocks = <&scuclk AN7583_CLK_MDIO1>;
resets = <&scuclk AN7583_MDIO1>;
};
};
system-controller@1fbf0200 {
compatible = "syscon", "simple-mfd";
reg = <0x0 0x1fbf0200 0x0 0xc0>;
an7583_pinctrl: pinctrl {
compatible = "airoha,an7583-pinctrl";
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
};
i2cclock: i2cclock@0 {
#clock-cells = <0>;
compatible = "fixed-clock";
/* 20 MHz */
clock-frequency = <20000000>;
};
i2c0: i2c0@1fbf8000 {
compatible = "airoha,an7581-i2c";
reg = <0x0 0x1fbf8000 0x0 0x100>;
clocks = <&i2cclock>;
/* 100 kHz */
clock-frequency = <100000>;
#address-cells = <1>;
#size-cells = <0>;
status = "disable";
};
i2c1: i2c1@1fbf8100 {
compatible = "airoha,an7581-i2c";
reg = <0x0 0x1fbf8100 0x0 0x100>;
clocks = <&i2cclock>;
/* 100 kHz */
clock-frequency = <100000>;
#address-cells = <1>;
#size-cells = <0>;
status = "disable";
};
mmc0: mmc@1fa0e000 {
compatible = "mediatek,mt7622-mmc";
reg = <0x0 0x1fa0e000 0x0 0x1000>,
<0x0 0x1fa0c000 0x0 0x60>;
interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&scuclk EN7581_CLK_EMMC>, <&clk25m>;
clock-names = "source", "hclk";
bus-width = <4>;
max-frequency = <52000000>;
vmmc-supply = <&vmmc_3v3>;
disable-wp;
cap-mmc-highspeed;
non-removable;
status = "disabled";
};
snfi: spi@1fa10000 {
compatible = "airoha,en7581-snand";
reg = <0x0 0x1fa10000 0x0 0x140>,
<0x0 0x1fa11000 0x0 0x160>;
clocks = <&scuclk EN7523_CLK_SPI>;
clock-names = "spi";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
spi_nand: nand@0 {
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <50000000>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <2>;
};
};
uart1: serial@1fbf0000 {
compatible = "ns16550";
reg = <0x0 0x1fbf0000 0x0 0x30>;
reg-io-width = <4>;
reg-shift = <2>;
interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <1843200>;
};
watchdog@1fbf0100 {
compatible = "airoha,en7581-wdt";
reg = <0x0 0x1fbf0100 0x0 0x38>;
clocks = <&sys_hclk>;
clock-names = "bus";
};
uart2: serial@1fbf0300 {
compatible = "airoha,en7523-uart";
reg = <0x0 0x1fbf0300 0x0 0x30>;
reg-io-width = <4>;
reg-shift = <2>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <7372800>;
status = "disabled";
};
hsuart3: serial@1fbe1000 {
compatible = "airoha,en7523-uart";
reg = <0x0 0x1fbe1000 0x0 0x40>;
reg-io-width = <4>;
reg-shift = <2>;
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <7372800>;
status = "disabled";
};
uart4: serial@1fbf0600 {
compatible = "airoha,en7523-uart";
reg = <0x0 0x1fbf0600 0x0 0x30>;
reg-io-width = <4>;
reg-shift = <2>;
interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <7372800>;
status = "disabled";
};
uart5: serial@1fbf0700 {
compatible = "airoha,en7523-uart";
reg = <0x0 0x1fbf0700 0x0 0x30>;
reg-io-width = <4>;
reg-shift = <2>;
interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <7372800>;
status = "disabled";
};
crypto@1e004000 {
compatible = "inside-secure,safexcel-eip93ies";
reg = <0x0 0x1fb70000 0x0 0x1000>;
interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
};
npu: npu@1e900000 {
compatible = "airoha,an7583-npu";
reg = <0x0 0x1e900000 0x0 0x313000>;
interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
memory-region = <&npu_binary>;
memory-region-names = "binary";
status = "disabled";
};
pon_pcs: pcs@1fa08000 {
compatible = "airoha,an7583-pcs-pon";
reg = <0x0 0x1fa08000 0x0 0x1000>,
<0x0 0x1fa80000 0x0 0x60>,
<0x0 0x1fa80a00 0x0 0x164>,
<0x0 0x1fa84000 0x0 0x450>,
<0x0 0x1fa85900 0x0 0x338>,
<0x0 0x1fa86000 0x0 0x300>,
<0x0 0x1fa8f000 0x0 0x1000>,
<0x0 0x1fa8e000 0x0 0x1000>;
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
"multi_sgmii", "usxgmii",
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
resets = <&scuclk AN7583_XPON_MAC_RST>,
<&scuclk AN7583_XPON_PHY_RST>,
<&scuclk AN7583_XPON_XFI_RST>;
reset-names = "mac", "phy", "xfi";
airoha,scu = <&scuclk>;
};
eth_pcs: pcs@1fa09000 {
compatible = "airoha,an7583-pcs-eth";
reg = <0x0 0x1fa09000 0x0 0x1000>,
<0x0 0x1fa70000 0x0 0x60>,
<0x0 0x1fa70a00 0x0 0x164>,
<0x0 0x1fa74000 0x0 0x450>,
<0x0 0x1fa75900 0x0 0x338>,
<0x0 0x1fa76000 0x0 0x300>,
<0x0 0x1fa7f000 0x0 0x1000>,
<0x0 0x1fa7e000 0x0 0x1000>;
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
"multi_sgmii", "usxgmii",
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
resets = <&scuclk AN7583_XSI_MAC_RST>,
<&scuclk AN7583_XSI_PHY_RST>;
reset-names = "mac", "phy";
airoha,scu = <&scuclk>;
};
eth: ethernet@1fb50000 {
compatible = "airoha,an7583-eth";
reg = <0 0x1fb50000 0 0x2600>,
<0 0x1fb54000 0 0x2000>,
<0 0x1fb56000 0 0x2000>;
reg-names = "fe", "qdma0", "qdma1";
resets = <&scuclk AN7583_FE_RST>,
<&scuclk AN7583_FE_PDMA_RST>,
<&scuclk AN7583_FE_QDMA_RST>,
<&scuclk AN7583_DUAL_HSI0_MAC_RST>,
<&scuclk AN7583_DUAL_HSI1_MAC_RST>,
<&scuclk AN7583_XFP_MAC_RST>;
reset-names = "fe", "pdma", "qdma",
"hsi0-mac", "hsi1-mac",
"xfp-mac";
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
memory-region = <&qdma0_buf>, <&qdma1_buf>;
memory-region-names = "qdma0-buf", "qdma1-buf";
airoha,npu = <&npu>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
gdm1: ethernet@1 {
compatible = "airoha,eth-mac";
reg = <1>;
phy-mode = "internal";
status = "disabled";
fixed-link {
speed = <10000>;
full-duplex;
pause;
};
};
gdm2: ethernet@2 {
compatible = "airoha,eth-mac";
reg = <2>;
pcs = <&pon_pcs>;
status = "disabled";
};
gdm3: ethernet@3 {
compatible = "airoha,eth-mac";
reg = <3>;
pcs = <&eth_pcs>;
airoha,gdm-srcport = <0x16>;
status = "disabled";
};
};
switch: switch@1fb58000 {
compatible = "airoha,an7583-switch";
reg = <0 0x1fb58000 0 0x8000>;
resets = <&scuclk AN7583_GSW_RST>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
#address-cells = <1>;
#size-cells = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
gsw_port1: port@1 {
reg = <1>;
label = "lan1";
phy-mode = "internal";
phy-handle = <&gsw_phy1>;
};
gsw_port2: port@2 {
reg = <2>;
label = "lan2";
phy-mode = "internal";
phy-handle = <&gsw_phy2>;
};
gsw_port3: port@3 {
reg = <3>;
label = "lan3";
phy-mode = "internal";
phy-handle = <&gsw_phy3>;
};
gsw_port4: port@4 {
reg = <4>;
label = "lan4";
phy-mode = "internal";
phy-handle = <&gsw_phy4>;
};
port@6 {
reg = <6>;
label = "cpu";
ethernet = <&gdm1>;
phy-mode = "internal";
fixed-link {
speed = <10000>;
full-duplex;
pause;
};
};
};
mdio: mdio {
#address-cells = <1>;
#size-cells = <0>;
gsw_phy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <9>;
phy-mode = "internal";
leds {
#address-cells = <1>;
#size-cells = <0>;
gsw_phy1_led0: gsw-phy1-led0@0 {
reg = <0>;
function = "phy1_led0";
status = "disabled";
};
gsw_phy1_led1: gsw-phy1-led1@1 {
reg = <1>;
function = "phy1_led1";
status = "disabled";
};
};
};
gsw_phy2: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <10>;
phy-mode = "internal";
leds {
#address-cells = <1>;
#size-cells = <0>;
gsw_phy2_led0: gsw-phy2-led0@0 {
reg = <0>;
function = "phy2_led0";
status = "disabled";
};
gsw_phy2_led1: gsw-phy2-led1@1 {
reg = <1>;
function = "phy1_led1";
status = "disabled";
};
};
};
gsw_phy3: ethernet-phy@3 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <11>;
phy-mode = "internal";
leds {
#address-cells = <1>;
#size-cells = <0>;
gsw_phy3_led0: gsw-phy3-led0@0 {
reg = <0>;
function = LED_FUNCTION_LAN;
status = "disabled";
};
gsw_phy3_led1: gsw-phy3-led1@1 {
reg = <1>;
function = LED_FUNCTION_LAN;
status = "disabled";
};
};
};
gsw_phy4: ethernet-phy@4 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <12>;
phy-mode = "internal";
leds {
#address-cells = <1>;
#size-cells = <0>;
gsw_phy4_led0: gsw-phy4-led0@0 {
reg = <0>;
function = LED_FUNCTION_LAN;
status = "disabled";
};
gsw_phy4_led1: gsw-phy4-led1@1 {
reg = <1>;
function = LED_FUNCTION_LAN;
status = "disabled";
};
};
};
};
};
};
};

View File

@@ -1,6 +1,10 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
loadaddr-$(CONFIG_TARGET_airoha_an7581) := 0x80200000
loadaddr-$(CONFIG_TARGET_airoha_an7583) := 0x80200000
loadaddr-$(CONFIG_TARGET_airoha_en7523) := 0x80200000
# default all platform image(fit) build
define Device/Default
PROFILES = Default $$(DEVICE_NAME)
@@ -9,8 +13,10 @@ define Device/Default
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
KERNEL_LOADADDR = $(loadaddr-y)
FILESYSTEMS := squashfs
DEVICE_DTS_DIR := $(DTS_DIR)
DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
DEVICE_DTS_DIR := ../dts
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | \
pad-rootfs | append-metadata

View File

@@ -1,3 +1,17 @@
define Build/an7581-emmc-bl2-bl31-uboot
head -c $$((0x800)) /dev/zero > $@
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl2.fip >> $@
dd if=$(STAGING_DIR_IMAGE)/an7581_$1-bl31-u-boot.fip of=$@ bs=1 seek=$$((0x20000)) conv=notrunc
endef
define Build/an7581-preloader
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl2.fip >> $@
endef
define Build/an7581-bl31-uboot
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl31-u-boot.fip >> $@
endef
define Device/FitImageLzma
KERNEL_SUFFIX := -uImage.itb
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
@@ -10,10 +24,11 @@ define Device/airoha_an7581-evb
DEVICE_MODEL := AN7581 Evaluation Board (SNAND)
DEVICE_PACKAGES := kmod-leds-pwm kmod-i2c-an7581 kmod-pwm-airoha kmod-input-gpio-keys-polled
DEVICE_DTS := an7581-evb
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_CONFIG := config@1
KERNEL_LOADADDR := 0x80088000
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
ARTIFACT/preloader.bin := an7581-preloader rfb
ARTIFACT/bl31-uboot.fip := an7581-bl31-uboot rfb
ARTIFACTS := preloader.bin bl31-uboot.fip
endef
TARGET_DEVICES += airoha_an7581-evb
@@ -21,7 +36,9 @@ define Device/airoha_an7581-evb-emmc
DEVICE_VENDOR := Airoha
DEVICE_MODEL := AN7581 Evaluation Board (EMMC)
DEVICE_DTS := an7581-evb-emmc
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-i2c-an7581
ARTIFACT/preloader.bin := an7581-preloader rfb
ARTIFACT/bl31-uboot.fip := an7581-bl31-uboot rfb
ARTIFACTS := preloader.bin bl31-uboot.fip
endef
TARGET_DEVICES += airoha_an7581-evb-emmc

View File

@@ -0,0 +1,25 @@
define Device/FitImageLzma
KERNEL_SUFFIX := -uImage.itb
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
KERNEL_NAME := Image
endef
define Device/airoha_an7583-evb
$(call Device/FitImageLzma)
DEVICE_VENDOR := Airoha
DEVICE_MODEL := AN7583 Evaluation Board (SNAND)
DEVICE_PACKAGES := kmod-phy-aeonsemi-as21xxx kmod-leds-pwm kmod-pwm-airoha kmod-input-gpio-keys-polled
DEVICE_DTS := an7583-evb
DEVICE_DTS_CONFIG := config@1
KERNEL_LOADADDR := 0x80088000
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
endef
TARGET_DEVICES += airoha_an7583-evb
define Device/airoha_an7583-evb-emmc
DEVICE_VENDOR := Airoha
DEVICE_MODEL := AN7583 Evaluation Board (EMMC)
DEVICE_DTS := an7583-evb-emmc
DEVICE_PACKAGES := kmod-phy-airoha-en8811h kmod-i2c-an7581
endef
TARGET_DEVICES += airoha_an7583-evb-emmc

View File

@@ -1,5 +1,3 @@
KERNEL_LOADADDR := 0x80208000
define Target/Description
Build firmware images for Airoha EN7523 ARM based boards.
endef
@@ -8,6 +6,5 @@ define Device/airoha_en7523-evb
DEVICE_VENDOR := Airoha
DEVICE_MODEL := EN7523 Evaluation Board
DEVICE_DTS := en7523-evb
DEVICE_DTS_DIR := ../dts
endef
TARGET_DEVICES += airoha_en7523-evb
TARGET_DEVICES += airoha_en7523-evb

View File

@@ -29,7 +29,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16871,6 +16871,13 @@ F: drivers/pinctrl/
@@ -16872,6 +16872,13 @@ F: drivers/pinctrl/
F: include/dt-bindings/pinctrl/
F: include/linux/pinctrl/

View File

@@ -1,7 +1,7 @@
From bc6a6a4ec6c28467683121cc165e5681b4acdf8d Mon Sep 17 00:00:00 2001
From 42de37f40e1bc818df216dfa0918c114cfb5941d Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Tue, 27 Aug 2024 23:04:53 +0200
Subject: [PATCH 3/3] thermal: Add support for Airoha EN7581 thermal sensor
Date: Sun, 11 May 2025 20:49:55 +0200
Subject: [PATCH] thermal/drivers: Add support for Airoha EN7581 thermal sensor
Add support for Airoha EN7581 thermal sensor. This provide support for
reading the CPU or SoC Package sensor and to setup trip points for hot
@@ -12,12 +12,20 @@ The thermal regs provide a way to read the ADC value from an external
register placed in the Chip SCU regs. Monitor will read this value and
fire an interrupt if the trip condition configured is reached.
The Thermal Trip and Interrupt logic is conceptually similar to Mediatek
LVTS Thermal but differ in register mapping and actual function/bug
workaround. The implementation only share some register names but from
functionality observation it's very different and used only for the
basic function of periodically poll the temp and trip the interrupt.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://lore.kernel.org/r/20250511185003.3754495-2-ansuelsmth@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/Kconfig | 9 +
drivers/thermal/Makefile | 1 +
drivers/thermal/airoha_thermal.c | 482 +++++++++++++++++++++++++++++++
3 files changed, 492 insertions(+)
drivers/thermal/airoha_thermal.c | 489 +++++++++++++++++++++++++++++++
3 files changed, 499 insertions(+)
create mode 100644 drivers/thermal/airoha_thermal.c
--- a/drivers/thermal/Kconfig
@@ -50,7 +58,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
obj-$(CONFIG_ROCKCHIP_THERMAL) += rockchip_thermal.o
--- /dev/null
+++ b/drivers/thermal/airoha_thermal.c
@@ -0,0 +1,482 @@
@@ -0,0 +1,489 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include <linux/module.h>
@@ -235,15 +243,17 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+#define EN7581_SCU_THERMAL_MUX_DIODE1 0x7
+
+/* Convert temp to raw value as read from ADC ((((temp / 100) - init) * slope) / 1000) + offset */
+#define TEMP_TO_RAW(priv, tz, temp) ((((((temp) / 100) - (priv)->init_temp) * \
+ thermal_zone_get_slope(tz)) / 1000) + \
+ thermal_zone_get_offset(tz))
+#define TEMP_TO_RAW(priv, temp) ((((((temp) / 100) - (priv)->init_temp) * \
+ (priv)->default_slope) / 1000) + \
+ (priv)->default_offset)
+
+/* Convert raw to temp ((((temp - offset) * 1000) / slope + init) * 100) */
+#define RAW_TO_TEMP(priv, tz, raw) (((((raw) - thermal_zone_get_offset(tz)) * 1000) / \
+ thermal_zone_get_slope(tz) + \
+#define RAW_TO_TEMP(priv, raw) (((((raw) - (priv)->default_offset) * 1000) / \
+ (priv)->default_slope + \
+ (priv)->init_temp) * 100)
+
+#define AIROHA_MAX_SAMPLES 6
+
+struct airoha_thermal_priv {
+ void __iomem *base;
+ struct regmap *chip_scu;
@@ -251,6 +261,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+
+ struct thermal_zone_device *tz;
+ int init_temp;
+ int default_slope;
+ int default_offset;
+};
+
+static int airoha_get_thermal_ADC(struct airoha_thermal_priv *priv)
@@ -280,28 +292,25 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+static int airoha_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
+{
+ struct airoha_thermal_priv *priv = thermal_zone_device_priv(tz);
+ int min, max, avg_temp, temp_adc;
+ int min_value, max_value, avg_value, value;
+ int i;
+
+ /* Get the starting temp */
+ temp_adc = airoha_get_thermal_ADC(priv);
+ min = temp_adc;
+ max = temp_adc;
+ avg_temp = temp_adc;
+ avg_value = 0;
+ min_value = INT_MAX;
+ max_value = INT_MIN;
+
+ /* Make 5 more measurement and average the temp ADC difference */
+ for (i = 0; i < 5; i++) {
+ temp_adc = airoha_get_thermal_ADC(priv);
+ avg_temp += temp_adc;
+ if (temp_adc > max)
+ max = temp_adc;
+ if (temp_adc < min)
+ min = temp_adc;
+ for (i = 0; i < AIROHA_MAX_SAMPLES; i++) {
+ value = airoha_get_thermal_ADC(priv);
+ min_value = min(value, min_value);
+ max_value = max(value, max_value);
+ avg_value += value;
+ }
+ avg_temp = avg_temp - max - min;
+ avg_temp /= 4;
+
+ *temp = RAW_TO_TEMP(priv, tz, avg_temp);
+ /* Drop min and max and average for the remaining sample */
+ avg_value -= (min_value + max_value);
+ avg_value /= AIROHA_MAX_SAMPLES - 2;
+
+ *temp = RAW_TO_TEMP(priv, avg_value);
+ return 0;
+}
+
@@ -309,29 +318,35 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+ int high)
+{
+ struct airoha_thermal_priv *priv = thermal_zone_device_priv(tz);
+ bool enable_monitor = false;
+
+ if (high != INT_MAX) {
+ /* Validate high and clamp them a sane value */
+ if (high > RAW_TO_TEMP(priv, tz, FIELD_MAX(EN7581_DOUT_TADC_MASK)))
+ high = 110000;
+ /* Validate high and clamp it a supported value */
+ high = clamp_t(int, high, RAW_TO_TEMP(priv, 0),
+ RAW_TO_TEMP(priv, FIELD_MAX(EN7581_DOUT_TADC_MASK)));
+
+ /* We offset the high temp of 1°C to trigger correct event */
+ writel(TEMP_TO_RAW(priv, tz, high) >> 4,
+ writel(TEMP_TO_RAW(priv, high) >> 4,
+ priv->base + EN7581_TEMPOFFSETH);
+
+ enable_monitor = true;
+ }
+
+ if (low != -INT_MAX) {
+ /* Validate low and clamp them to a sane value */
+ if (low < RAW_TO_TEMP(priv, tz, 0))
+ low = -33000;
+ /* Validate low and clamp it to a supported value */
+ low = clamp_t(int, high, RAW_TO_TEMP(priv, 0),
+ RAW_TO_TEMP(priv, FIELD_MAX(EN7581_DOUT_TADC_MASK)));
+
+ /* We offset the low temp of 1°C to trigger correct event */
+ writel(TEMP_TO_RAW(priv, tz, low) >> 4,
+ writel(TEMP_TO_RAW(priv, low) >> 4,
+ priv->base + EN7581_TEMPOFFSETL);
+
+ enable_monitor = true;
+ }
+
+ /* Enable sensor 0 monitor */
+ writel(EN7581_SENSE0_EN, priv->base + EN7581_TEMPMONCTL0);
+ /* Enable sensor 0 monitor after trip are set */
+ if (enable_monitor)
+ writel(EN7581_SENSE0_EN, priv->base + EN7581_TEMPMONCTL0);
+
+ return 0;
+}
@@ -345,32 +360,35 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+{
+ struct airoha_thermal_priv *priv = data;
+ enum thermal_notify_event event;
+ bool update = false;
+ u32 status;
+
+ status = readl(priv->base + EN7581_TEMPMONINTSTS);
+ switch (status & (EN7581_HOFSINTSTS0 | EN7581_LOFSINTSTS0)) {
+ case EN7581_HOFSINTSTS0:
+ event = THERMAL_TRIP_VIOLATED;
+ update = true;
+ break;
+ case EN7581_LOFSINTSTS0:
+ event = THERMAL_EVENT_UNSPECIFIED;
+ update = true;
+ break;
+ default:
+ goto exit;
+ /* Should be impossible as we enable only these Interrupt */
+ break;
+ }
+
+ thermal_zone_device_update(priv->tz, event);
+
+exit:
+ /* reset interrupt */
+ /* Reset Interrupt */
+ writel(status, priv->base + EN7581_TEMPMONINTSTS);
+
+ if (update)
+ thermal_zone_device_update(priv->tz, event);
+
+ return IRQ_HANDLED;
+}
+
+static void airoha_thermal_setup_adc_val(struct device *dev,
+ struct airoha_thermal_priv *priv,
+ struct thermal_zone_params *tzp)
+ struct airoha_thermal_priv *priv)
+{
+ u32 efuse_calib_info, cpu_sensor;
+
@@ -381,19 +399,19 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+
+ efuse_calib_info = readl(priv->base + EN7581_EFUSE_TEMP_OFFSET_REG);
+ if (efuse_calib_info) {
+ tzp->offset = FIELD_GET(EN7581_EFUSE_TEMP_OFFSET, efuse_calib_info);
+ priv->default_offset = FIELD_GET(EN7581_EFUSE_TEMP_OFFSET, efuse_calib_info);
+ /* Different slope are applied if the sensor is used for CPU or for package */
+ cpu_sensor = readl(priv->base + EN7581_EFUSE_TEMP_CPU_SENSOR_REG);
+ if (cpu_sensor) {
+ tzp->slope = EN7581_SLOPE_X100_DIO_DEFAULT;
+ priv->default_slope = EN7581_SLOPE_X100_DIO_DEFAULT;
+ priv->init_temp = EN7581_INIT_TEMP_FTK_X10;
+ } else {
+ tzp->slope = EN7581_SLOPE_X100_DIO_AVS;
+ priv->default_slope = EN7581_SLOPE_X100_DIO_AVS;
+ priv->init_temp = EN7581_INIT_TEMP_CPK_X10;
+ }
+ } else {
+ tzp->offset = airoha_get_thermal_ADC(priv);
+ tzp->slope = EN7581_SLOPE_X100_DIO_DEFAULT;
+ priv->default_offset = airoha_get_thermal_ADC(priv);
+ priv->default_slope = EN7581_SLOPE_X100_DIO_DEFAULT;
+ priv->init_temp = EN7581_INIT_TEMP_NONK_X10;
+ dev_info(dev, "missing thermal calibrarion EFUSE, using non calibrated value\n");
+ }
@@ -456,7 +474,6 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+
+static int airoha_thermal_probe(struct platform_device *pdev)
+{
+ struct thermal_zone_params tzp = { };
+ struct airoha_thermal_priv *priv;
+ struct device_node *chip_scu_np;
+ struct device *dev = &pdev->dev;
@@ -487,19 +504,17 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+
+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
+ airoha_thermal_irq, IRQF_ONESHOT,
+ pdev->name, (void *)priv);
+ pdev->name, priv);
+ if (ret) {
+ dev_err(dev, "Can't get interrupt working.\n");
+ return ret;
+ }
+
+ airoha_thermal_setup_monitor(priv);
+ airoha_thermal_setup_adc_val(dev, priv, &tzp);
+ airoha_thermal_setup_adc_val(dev, priv);
+
+ /* register of thermal sensor and get info from DT */
+ priv->tz = devm_thermal_of_zone_register_with_params(dev, 0, priv,
+ &thdev_ops,
+ &tzp);
+ priv->tz = devm_thermal_of_zone_register(dev, 0, priv, &thdev_ops);
+ if (IS_ERR(priv->tz)) {
+ dev_err(dev, "register thermal zone sensor failed\n");
+ return PTR_ERR(priv->tz);

View File

@@ -0,0 +1,44 @@
From e23cba0ab49a9cf95e9bc3a86cfbf336b0e285f6 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Wed, 14 May 2025 23:39:12 +0200
Subject: [PATCH] thermal/drivers/airoha: Fix spelling mistake
Fix various spelling mistake in airoha_thermal_setup_monitor() and
define.
Reported-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://lore.kernel.org/r/20250514213919.2321490-1-ansuelsmth@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/airoha_thermal.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/thermal/airoha_thermal.c
+++ b/drivers/thermal/airoha_thermal.c
@@ -155,7 +155,7 @@
* Can operate in:
* - 1 sample
* - 2 sample and make average of them
- * - 4,6,10,16 sample, drop max and min and make avgerage of them
+ * - 4,6,10,16 sample, drop max and min and make average of them
*/
#define EN7581_MSRCTL_1SAMPLE 0x0
#define EN7581_MSRCTL_AVG2SAMPLE 0x1
@@ -365,12 +365,12 @@ static void airoha_thermal_setup_monitor
/*
* Configure ADC valid reading addr
* The AHB temp monitor system doesn't have direct access to the
- * thermal sensor. It does instead work by providing all kind of
- * address to configure how to access and setup an ADC for the
+ * thermal sensor. It does instead work by providing various
+ * addresses to configure how to access and setup an ADC for the
* sensor. EN7581 supports only one sensor hence the
* implementation is greatly simplified but the AHB supports
- * up to 4 different sensor from the same ADC that can be
- * switched by tuning the ADC mux or wiriting address.
+ * up to 4 different sensors from the same ADC that can be
+ * switched by tuning the ADC mux or writing address.
*
* We set valid instead of volt as we don't enable valid/volt
* split reading and AHB read valid addr in such case.

View File

@@ -0,0 +1,435 @@
From 457d9772e8a5cdae64f66b5f7d5b0247365191ec Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Tue, 1 Apr 2025 15:50:21 +0200
Subject: [PATCH] pinctrl: airoha: fix wrong PHY LED mapping and PHY2 LED
defines
The current PHY2 LED define are wrong and actually set BITs outside the
related mask. Fix it and set the correct value. While at it, also use
FIELD_PREP_CONST macro to make it simple to understand what values are
actually applied for the mask.
Also fix wrong PHY LED mapping. The SoC Switch supports up to 4 port but
the register define mapping for 5 PHY port, starting from 0. The mapping
was wrongly defined starting from PHY1. Reorder the function group to
start from PHY0. PHY4 is actually never supported as we don't have a
GPIO pin to assign.
Cc: stable@vger.kernel.org
Fixes: 1c8ace2d0725 ("pinctrl: airoha: Add support for EN7581 SoC")
Reviewed-by: Benjamin Larsson <benjamin.larsson@genexis.eu>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/20250401135026.18018-1-ansuelsmth@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/mediatek/pinctrl-airoha.c | 159 ++++++++++------------
1 file changed, 70 insertions(+), 89 deletions(-)
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -6,6 +6,7 @@
*/
#include <dt-bindings/pinctrl/mt65xx.h>
+#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/cleanup.h>
#include <linux/gpio/driver.h>
@@ -106,39 +107,19 @@
#define REG_LAN_LED1_MAPPING 0x0280
#define LAN4_LED_MAPPING_MASK GENMASK(18, 16)
-#define LAN4_PHY4_LED_MAP BIT(18)
-#define LAN4_PHY2_LED_MAP BIT(17)
-#define LAN4_PHY1_LED_MAP BIT(16)
-#define LAN4_PHY0_LED_MAP 0
-#define LAN4_PHY3_LED_MAP GENMASK(17, 16)
+#define LAN4_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN4_LED_MAPPING_MASK, (_n))
#define LAN3_LED_MAPPING_MASK GENMASK(14, 12)
-#define LAN3_PHY4_LED_MAP BIT(14)
-#define LAN3_PHY2_LED_MAP BIT(13)
-#define LAN3_PHY1_LED_MAP BIT(12)
-#define LAN3_PHY0_LED_MAP 0
-#define LAN3_PHY3_LED_MAP GENMASK(13, 12)
+#define LAN3_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN3_LED_MAPPING_MASK, (_n))
#define LAN2_LED_MAPPING_MASK GENMASK(10, 8)
-#define LAN2_PHY4_LED_MAP BIT(12)
-#define LAN2_PHY2_LED_MAP BIT(11)
-#define LAN2_PHY1_LED_MAP BIT(10)
-#define LAN2_PHY0_LED_MAP 0
-#define LAN2_PHY3_LED_MAP GENMASK(11, 10)
+#define LAN2_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN2_LED_MAPPING_MASK, (_n))
#define LAN1_LED_MAPPING_MASK GENMASK(6, 4)
-#define LAN1_PHY4_LED_MAP BIT(6)
-#define LAN1_PHY2_LED_MAP BIT(5)
-#define LAN1_PHY1_LED_MAP BIT(4)
-#define LAN1_PHY0_LED_MAP 0
-#define LAN1_PHY3_LED_MAP GENMASK(5, 4)
+#define LAN1_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN1_LED_MAPPING_MASK, (_n))
#define LAN0_LED_MAPPING_MASK GENMASK(2, 0)
-#define LAN0_PHY4_LED_MAP BIT(3)
-#define LAN0_PHY2_LED_MAP BIT(2)
-#define LAN0_PHY1_LED_MAP BIT(1)
-#define LAN0_PHY0_LED_MAP 0
-#define LAN0_PHY3_LED_MAP GENMASK(2, 1)
+#define LAN0_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN0_LED_MAPPING_MASK, (_n))
/* CONF */
#define REG_I2C_SDA_E2 0x001c
@@ -1470,8 +1451,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY1_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(0)
},
.regmap_size = 2,
}, {
@@ -1485,8 +1466,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY1_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(0)
},
.regmap_size = 2,
}, {
@@ -1500,8 +1481,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY1_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(0)
},
.regmap_size = 2,
}, {
@@ -1515,8 +1496,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY1_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(0)
},
.regmap_size = 2,
},
@@ -1534,8 +1515,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY2_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(1)
},
.regmap_size = 2,
}, {
@@ -1549,8 +1530,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY2_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(1)
},
.regmap_size = 2,
}, {
@@ -1564,8 +1545,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY2_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(1)
},
.regmap_size = 2,
}, {
@@ -1579,8 +1560,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY2_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(1)
},
.regmap_size = 2,
},
@@ -1598,8 +1579,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY3_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(2)
},
.regmap_size = 2,
}, {
@@ -1613,8 +1594,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY3_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(2)
},
.regmap_size = 2,
}, {
@@ -1628,8 +1609,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY3_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(2)
},
.regmap_size = 2,
}, {
@@ -1643,8 +1624,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY3_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(2)
},
.regmap_size = 2,
},
@@ -1662,8 +1643,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY4_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(3)
},
.regmap_size = 2,
}, {
@@ -1677,8 +1658,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY4_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(3)
},
.regmap_size = 2,
}, {
@@ -1692,8 +1673,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY4_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(3)
},
.regmap_size = 2,
}, {
@@ -1707,8 +1688,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED0_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY4_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(3)
},
.regmap_size = 2,
},
@@ -1726,8 +1707,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY1_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(0)
},
.regmap_size = 2,
}, {
@@ -1741,8 +1722,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY1_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(0)
},
.regmap_size = 2,
}, {
@@ -1756,8 +1737,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY1_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(0)
},
.regmap_size = 2,
}, {
@@ -1771,8 +1752,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY1_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(0)
},
.regmap_size = 2,
},
@@ -1790,8 +1771,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY2_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(1)
},
.regmap_size = 2,
}, {
@@ -1805,8 +1786,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY2_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(1)
},
.regmap_size = 2,
}, {
@@ -1820,8 +1801,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY2_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(1)
},
.regmap_size = 2,
}, {
@@ -1835,8 +1816,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY2_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(1)
},
.regmap_size = 2,
},
@@ -1854,8 +1835,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY3_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(2)
},
.regmap_size = 2,
}, {
@@ -1869,8 +1850,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY3_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(2)
},
.regmap_size = 2,
}, {
@@ -1884,8 +1865,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY3_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(2)
},
.regmap_size = 2,
}, {
@@ -1899,8 +1880,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY3_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(2)
},
.regmap_size = 2,
},
@@ -1918,8 +1899,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN1_LED_MAPPING_MASK,
- LAN1_PHY4_LED_MAP
+ LAN0_LED_MAPPING_MASK,
+ LAN0_PHY_LED_MAP(3)
},
.regmap_size = 2,
}, {
@@ -1933,8 +1914,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN2_LED_MAPPING_MASK,
- LAN2_PHY4_LED_MAP
+ LAN1_LED_MAPPING_MASK,
+ LAN1_PHY_LED_MAP(3)
},
.regmap_size = 2,
}, {
@@ -1948,8 +1929,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN3_LED_MAPPING_MASK,
- LAN3_PHY4_LED_MAP
+ LAN2_LED_MAPPING_MASK,
+ LAN2_PHY_LED_MAP(3)
},
.regmap_size = 2,
}, {
@@ -1963,8 +1944,8 @@ static const struct airoha_pinctrl_func_
.regmap[1] = {
AIROHA_FUNC_MUX,
REG_LAN_LED1_MAPPING,
- LAN4_LED_MAPPING_MASK,
- LAN4_PHY4_LED_MAP
+ LAN3_LED_MAPPING_MASK,
+ LAN3_PHY_LED_MAP(3)
},
.regmap_size = 2,
},

View File

@@ -0,0 +1,130 @@
From 6a325aed130bb68790e765f923e76ec5669d2da7 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Thu, 10 Apr 2025 12:04:04 +0200
Subject: [PATCH 2/2] net: phy: mediatek: add Airoha PHY ID to SoC driver
Airoha AN7581 SoC ship with a Switch based on the MT753x Switch embedded
in other SoC like the MT7581 and the MT7988. Similar to these they
require configuring some pin to enable LED PHYs.
Add support for the PHY ID for the Airoha embedded Switch and define a
simple probe function to toggle these pins. Also fill the LED functions
and add dedicated function to define LED polarity.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20250410100410.348-2-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/phy/Kconfig | 4 +-
drivers/net/phy/mediatek-ge-soc.c | 62 +++++++++++++++++++++++++++
2 files changed, 65 insertions(+), 1 deletion(-)
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -320,8 +320,9 @@ config MEDIATEK_GE_PHY
config MEDIATEK_GE_SOC_PHY
tristate "MediaTek SoC Ethernet PHYs"
- depends on (ARM64 && ARCH_MEDIATEK) || COMPILE_TEST
- depends on NVMEM_MTK_EFUSE
+ depends on ARM64 || COMPILE_TEST
+ depends on ARCH_AIROHA || (ARCH_MEDIATEK && NVMEM_MTK_EFUSE) || \
+ COMPILE_TEST
help
Supports MediaTek SoC built-in Gigabit Ethernet PHYs.
--- a/drivers/net/phy/mediatek-ge-soc.c
+++ b/drivers/net/phy/mediatek-ge-soc.c
@@ -8,8 +8,11 @@
#include <linux/phy.h>
#include <linux/regmap.h>
+#define MTK_PHY_MAX_LEDS 2
+
#define MTK_GPHY_ID_MT7981 0x03a29461
#define MTK_GPHY_ID_MT7988 0x03a29481
+#define MTK_GPHY_ID_AN7581 0x03a294c1
#define MTK_EXT_PAGE_ACCESS 0x1f
#define MTK_PHY_PAGE_STANDARD 0x0000
@@ -1502,6 +1505,53 @@ static int mt7981_phy_probe(struct phy_d
return mt798x_phy_calibration(phydev);
}
+static int an7581_phy_probe(struct phy_device *phydev)
+{
+ struct mtk_socphy_priv *priv;
+ struct pinctrl *pinctrl;
+
+ /* Toggle pinctrl to enable PHY LED */
+ pinctrl = devm_pinctrl_get_select(&phydev->mdio.dev, "gbe-led");
+ if (IS_ERR(pinctrl))
+ dev_err(&phydev->mdio.bus->dev,
+ "Failed to setup PHY LED pinctrl\n");
+
+ priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ phydev->priv = priv;
+
+ return 0;
+}
+
+static int an7581_phy_led_polarity_set(struct phy_device *phydev, int index,
+ unsigned long modes)
+{
+ u32 mode;
+ u16 val;
+
+ if (index >= MTK_PHY_MAX_LEDS)
+ return -EINVAL;
+
+ for_each_set_bit(mode, &modes, __PHY_LED_MODES_NUM) {
+ switch (mode) {
+ case PHY_LED_ACTIVE_LOW:
+ val = MTK_PHY_LED_ON_POLARITY;
+ break;
+ case PHY_LED_ACTIVE_HIGH:
+ val = 0;
+ break;
+ default:
+ return -EINVAL;
+ }
+ }
+
+ return phy_modify_mmd(phydev, MDIO_MMD_VEND2, index ?
+ MTK_PHY_LED1_ON_CTRL : MTK_PHY_LED0_ON_CTRL,
+ MTK_PHY_LED_ON_POLARITY, val);
+}
+
static struct phy_driver mtk_socphy_driver[] = {
{
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7981),
@@ -1537,6 +1587,17 @@ static struct phy_driver mtk_socphy_driv
.led_hw_control_set = mt798x_phy_led_hw_control_set,
.led_hw_control_get = mt798x_phy_led_hw_control_get,
},
+ {
+ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_AN7581),
+ .name = "Airoha AN7581 PHY",
+ .probe = an7581_phy_probe,
+ .led_blink_set = mt798x_phy_led_blink_set,
+ .led_brightness_set = mt798x_phy_led_brightness_set,
+ .led_hw_is_supported = mt798x_phy_led_hw_is_supported,
+ .led_hw_control_set = mt798x_phy_led_hw_control_set,
+ .led_hw_control_get = mt798x_phy_led_hw_control_get,
+ .led_polarity_set = an7581_phy_led_polarity_set,
+ },
};
module_phy_driver(mtk_socphy_driver);
@@ -1544,6 +1605,7 @@ module_phy_driver(mtk_socphy_driver);
static struct mdio_device_id __maybe_unused mtk_socphy_tbl[] = {
{ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7981) },
{ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7988) },
+ { PHY_ID_MATCH_EXACT(MTK_GPHY_ID_AN7581) },
{ }
};

Some files were not shown because too many files have changed in this diff Show More