Compare commits

...

541 commits

Author SHA1 Message Date
Aleksander Jan Bajkowski
5cd176925e airoha: reduce HWRNG quality
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Backport a patch that reduces the quality of HWRNG. HWRNG has lower
entropy than expected. Thanks to this patch, it has a lower priority.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/21722
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-28 00:52:13 +01:00
Bevan Weiss
b59a89bde6 realtek: rtl930x: Add Hasivo s1100wp-8gt-se (excl. PoE)
This commit adds support for Hasivo S1100WP-8GT-SE switch.

Device specification
--------------------
SoC Type:		Realtek RTL9303
RAM:		Samsung K4B2G1646F-BYMA (256MB DDR3 SDRAM)
Flash:		Fudan FM25Q128A (16 MB)
Ethernet:		8x RTL8221B 10/100/1000/2500Mbps PHY
LEDs:		2 LEDs + 4 LEDs/port
			1x power green (no control)
			1x system green (via RLT9303 GPIO)
			3x RJ45 LEDs/port (via HC595 shift registers on LED spi)
				1x Green
				1x Green/Orange
			1x Orange LED/port for PoE status (below RJ45, on STC8)
Button:		Reset
USB ports:		None
Bootloader:		Realtek U-Boot 2011.12.(3.6.6.55087) (Nov 13 2022 - 14:37:31)
Fan:		None installed (but board provision for temp/FET/fan)
POE:		2x HS104PTI for 802.3af/at/bt PoE (Not yet working)

Installing OpenWrt
------------------
1. UART RJ45 requires soldering a connector to the empty footprint (RJ1).
   (Amphenol RJHSEE380 or similar)
2. Connect to UART 38400@8n1, using Cisco Console Rollover cable (RS232)
3. Set computer IP to 192.168.0.111, and plug in with 2.5Gbps
4. Enter bootloader by pressing esc key during boot
5. Enter password `Hs2021cfgmg`
6. Type `XXXX` to get into U-Boot
7. Type `rtk network on`
8. Use tftp if you have a 2.5G link (other speeds won't work).
   If serial, you can increase baudrate in uboot with `setenv baudrate 115200`
9.1. `tftpboot 0x84f00000 <openwrt-initramfs-filename>`
9.2. Otherwise use serial transfer (Y modem): `loady 0x84f00000`
10. `bootm 0x84f00000`

Now you should be in OpenWRT, and can use sysupgrade to install.

Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21576
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-28 00:43:16 +01:00
FUKAYA Toshikuni
c63433acd8 realtek: add support for XikeStor SKS8300-8T
XikeStor SKS8300-8T is a 8 ports Multi-Gig switch, based on the RTL9303.

Specifications:

- SoC                : Realtek RTL9303
- RAM                : DDR3 512 MiB
- Flash              : SPI-NOR 32 MiB (Macronix)
- CPU                : 800MHz
- Ethernet           : 8× 1G/2.5G/5G/10G Base-T RJ45 ports (RTL8261N)
- Keys (GPIO)        : 1x
- UART               : "Console" port on the front panel
  - type             : RS-232C
  - connector        : RJ-45
  - settings         : 115200 8N1
- Power              : 12 VDC, 4A
- Temperature sensor : LM75 or compatible
- Fan controller     : SensyLink CTF2302

Flash instruction using initramfs image:

 1. Prepare TFTP server & connect to serial port.
 2. Connect your computer to one of the RJ45 ports on SKS8300-8T
 3. Power on SKS8300-8T and interrupt autoboot with Shift + A.
 4. Use Shift + Q to drop from vendor CLI to U-Boot CLI.
 5. Set the boot command to enable network on boot.
       > setenv bootcmd 'mw.l 0x8401da94 0; rtk network on; boota'
 6. Set switch IP and TFTP server IP (optional, adjust to your setup).
       > setenv ipaddr <ip>
       > setenv serverip <ip>
 7. Download initramfs image from TFTP server.
       > tftpboot 0x83000000 <image name>
 8. Boot with the downloaded image.
       > bootm 0x83000000
 9. With rambooted OpenWrt, backup the stock firmware if needed.
10. Copy sysupgrade image to the device.
11. Perform sysupgrade with the sysupgrade image.
12. After reboot, you should have functional OpenWrt.

In OpenWrt, it is necessary to execute "rtk network on" to enable full
networking functionality. However, the internal U-Boot initialization
(which shares logic with "rtk network init" initializing MAC only and
configures the fan controller) sets a flag at memory address 0x8401da94.
Once this flag is set, any subsequent calls to "rtk network on" are
blocked. To bypass this, resetting 0x8401da94 to 0 by step 5, ensuring
that the network can be properly initialized later. This specific
address was confirmed in U-Boot 2011.12.(3.6.11.55242) (Jan 06 2025 -
14:39:46) by decompiling the function that references the "rtk_mac_init"
string.

Reverting to stock firmware:

1. Connect to serial port.
2. Power on SKS8300-8T and interrupt autoboot with Shift + A.
3. Use Shift + Q to drop from vendor CLI to U-Boot CLI.
4. Set the boot command to the firmware default.
       > setenv bootcmd boota
5. Enable network.
       > rtk network on
6. Boot OpenWrt.
       > boota
7. Download latest firmware from XikeStor and upload to your device.
8. Write firmware with 'sysupgrade -F'.
9. After reboot, stock firmware should boot automatically.

Co-authored-by: Samy Younsi <kame@duck.com>
Signed-off-by: FUKAYA Toshikuni <toshiq2@neenana.org>
Link: https://github.com/openwrt/openwrt/pull/21511
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-28 00:33:13 +01:00
Markus Stockhausen
38fea332d9 realtek: phy: replace hard coded pages 30/31 with define
Some of the code forgot to use the register defines for page
selection. Replace the hard coded values with their define.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-28 00:28:15 +01:00
Markus Stockhausen
c2a3871387 realtek: phy: align page select register naming with upstream
The downstream driver has different naming conventions than upstream.

Register: 31
Downstream name: RTL8XXX_PAGE_SELECT
Upstream name: RTL821x_PAGE_SELECT

Register: 30
Downstream name: RTL821XEXT_MEDIA_PAGE_SELECT
Upstream name: RTL821x_EXT_PAGE_SELECT

Align to upstream.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-28 00:28:15 +01:00
Markus Stockhausen
3c024c00ce realtek: phy: cleanup RTL8214C configuration
RTL8214C configuration is currently useless.

- It uses register 29 (write only companion of ext. page register 30)
- "configuration" only reads registers 2/3 and writes a message
- "configuration" is run during probing

Drop the useless coding. As this was the last consumer drop register
29 define too.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-28 00:28:15 +01:00
Youfu Zhang
1d0e2859c5 wifi-scripts: fix ucode mobility_domain default value
The mobility_domain value generated by ucode differed from the previous
shell script implementation. The legacy shell script used `echo` on the
SSID, which appended a trailing newline.

To maintain roaming compatibility with pre-25.12 releases and OpenWrt
forks in default configuration, update the ucode logic to include this
newline character when generating the default value.

Fixes: #21731
Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21732
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-28 00:24:55 +01:00
Hauke Mehrtens
9bdb1b4eb4 mac80211: update to version 6.18.7
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This is based on Linux kernel 6.18.7.

This update contains the following upstream fixes:
f75b9d2c9f5b wifi: rtl8xxxu: Add USB ID 2001:3328 for D-Link AN3U rev. A1
401b10a72f5a wifi: rtw88: Add USB ID 2001:3329 for D-Link AC13U rev. A1
c0d93d69e147 staging: rtl8723bs: fix out-of-bounds read in rtw_get_ie() parser
e841d8ea7223 staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing
bf323db1d883 staging: rtl8723bs: fix out-of-bounds read in OnBeacon ESR IE parsing
b1497ea24639 wifi: ath10k: move recovery check logic into a new work
99fc0689a588 wifi: ath11k: restore register window after global reset
ab0554f51e5f wifi: ath12k: Fix MSDU buffer types handling in RX error path
d911fa97dab3 wifi: ath12k: fix VHT MCS assignment
ca2a33cee1ef wifi: ath12k: fix TX and RX MCS rate configurations in HE mode
18d4706956b7 wifi: ath11k: fix VHT MCS assignment
6b1a0da75932 wifi: ath11k: fix peer HE MCS assignment
d0a5b5d56438 wifi: ath12k: restore register window after global reset
1564c04afa92 wifi: iwlwifi: mld: add null check for kzalloc() in iwl_mld_send_proto_offload()
d0bb3db7b295 wifi: ath12k: fix potential memory leak in ath12k_wow_arp_ns_offload()
36faecac7a2c wifi: ath12k: fix reusing m3 memory
4f93750fa588 wifi: ath12k: fix error handling in creating hardware group
41b623129175 wifi: ath12k: enforce vdev limit in ath12k_mac_vdev_create()
e442e820e953 wifi: ath12k: unassign arvif on scan vdev create failure
bcf44fe565bf wifi: rtw89: usb: use common error path for skbs in rtw89_usb_rx_handler()
87cc6fe79c3e wifi: rtw89: usb: fix leak in rtw89_usb_write_port()
c7ca777c5879 wifi: ath12k: Fix timeout error during beacon stats retrieval
51b823d7723f wifi: cw1200: Fix potential memory leak in cw1200_bh_rx_helper()
c9d1c4152e6d wifi: rtl818x: Fix potential memory leaks in rtl8180_init_rx_ring()
a6fb8785b179 wifi: mac80211: fix CMAC functions not handling errors
5ebf0fe7eaef wifi: rtl818x: rtl8187: Fix potential buffer underflow in rtl8187_rx_cb()
b8f34c1c5c4f wifi: mt76: mt7996: fix null pointer deref in mt7996_conf_tx()
cbeca0b7ea20 wifi: mt76: mt7996: Remove unnecessary link_id checks in mt7996_tx
d582d0e988d6 wifi: mt76: wed: use proper wed reference in mt76 wed driver callabacks
d2d11298dfc3 wifi: mt76: mt7996: Remove useless check in mt7996_msdu_page_get_from_cache()
2cde732373a7 Revert "wifi: mt76: mt792x: improve monitor interface handling"
74bb080717a3 wifi: mt76: mt7996: fix max nss value when getting rx chainmask
95bb36f8d6b3 wifi: mt76: mt7996: fix implicit beamforming support for mt7992
ee94375d06b5 wifi: mt76: mt7996: fix several fields in mt7996_mcu_bss_basic_tlv()
d64e6f27260e wifi: mt76: mt7996: fix teardown command for an MLD peer
e5c42efeb162 wifi: mt76: mt7996: set link_valid field when initializing wcid
9a43ed9ab800 wifi: mt76: mt7996: fix MLD group index assignment
7d6cd8f51ad8 wifi: mt76: mt7996: fix MLO set key and group key issues
1a4b481a21ae wifi: mt76: mt7996: fix using wrong phy to start in mt7996_mac_restart()
b4b789d24319 wifi: mt76: mt7996: fix EMI rings for RRO
46f0648e261c wifi: mt76: mt7996: grab mt76 mutex in mt7996_mac_sta_event()
70656b45467c wifi: mt76: Move mt76_abort_scan out of mt76_reset_device()
c319967690d4 wifi: mt76: mt7996: skip deflink accounting for offchannel links
abdedd46dc58 wifi: mt76: mt7996: skip ieee80211_iter_keys() on scanning link remove
f4c57afff3b0 wifi: mt76: mt7996: Add missing locking in mt7996_mac_sta_rc_work()
4d42aba0ee49 mt76: mt7615: Fix memory leak in mt7615_mcu_wtbl_sta_add()
ad26a7ef0488 wifi: ieee80211: correct FILS status codes
40257a2ef1bc wifi: rtl8xxxu: Fix HT40 channel config for RTL8192CU, RTL8723AU
c3ab9657866f wifi: cfg80211: stop radar detection in cfg80211_leave()
0283fac52b42 wifi: cfg80211: use cfg80211_leave() in iftype change
9c6f9b2a80ed wifi: mt76: mt792x: fix wifi init fail by setting MCU_RUNNING after CLC load
f5323b43019d wifi: brcmfmac: Add DMI nvram filename quirk for Acer A1 840 tablet
498e286941b9 wifi: mt76: Fix DTS power-limits on little endian systems
e5c129a05531 wifi: rtw88: limit indirect IO under powered off for RTL8822CS
90a15ff32464 wifi: rtlwifi: 8192cu: fix tid out of range in rtl92cu_tx_fill_desc()
7ea38152a289 wifi: cfg80211: sme: store capped length in __cfg80211_connect_result()
182a2786d248 wifi: mac80211: do not use old MBSSID elements
de5eb6b65e9f wifi: iwlwifi: Fix firmware version handling
a21704df4024 wifi: mac80211: Discard Beacon frames to non-broadcast address
e3c35177103e wifi: avoid kernel-infoleak from struct iw_point
b97be67dc06e wifi: mac80211: restore non-chanctx injection behaviour
1251bbdb8f5b wifi: mac80211_hwsim: fix typo in frequency notification

The following patches were applied upstream:
build/130-backports-move-__counted_by-to-compiler_types.h-head.patch patch [1]
build/999-kernel-6.12.64.patch [2]

[1]: b63f79524e
[2]: ed8c176dfa

Link: https://github.com/openwrt/openwrt/pull/21711
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 23:24:02 +01:00
Jonas Jelonek
180f53d285 realtek: pcs: rtl931x: add sequence for LC PLL
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The RTL931X CMU code was only capable of setting up ring PLL. This is
fine so far as most modes use this PLL type. Other modes are not handled
by the code, neither here nor in the SDK. Though, the SDK has the needed
sequence to setup the LC PLL. Using LC PLL seems to be handled somewhere
else.

Include the small sequence from the SDK to have it, though not used yet.
This could be helpful for further development which goes beyond the SDK.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21707
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-27 09:22:10 +01:00
Jonas Jelonek
638ccb6760 realtek: pcs: rtl93xx: improve CMU terminology
The implementations for CMU management for RTL930x and RTL931x differ in
their terminology but not that much in their technical aspect. For both
it seems to be the case that two adjacent SerDes share a CMU. This CMU
contains a ring PLL for low speeds (capable of 1G/2.5G) and an LC PLL for
high speeds (capable of 1G/2.5G/10G).

Introduce an enum for the PLL type, used for both RTL93xx variants.
Align the naming of internal variables, especially in the RTL931x
implementation. Rename cmu_type to pll_type because this is much more
accurate. Use 'force_' instead of 'frc_' to make clear what it means.
Also rename the function from 'cmu_type_set' to 'config_cmu' because it
obviously does more than just setting the CMU type but rather configures
the CMU.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21707
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-27 09:22:10 +01:00
Jonas Jelonek
48ada316f2 realtek: pcs: rtl931x: fix and cleanup CMU functions
Fix the wrong values bit values when setting CMU band which were the
same for both 'enable == true' and 'enable == false'.

While at it, fix some coding issues in the CMU functions:
- drop confusing debug output
- use ternary value instead of if-else
- return proper error
- make variable declaration in reverse christmas tree
- drop unneeded temporary value

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21707
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-27 09:22:10 +01:00
Jonas Jelonek
a477315f7e realtek: pcs: rtl931x: use SerDes hw mode for CMU setup
Switch the CMU setup functions to use the SerDes hardware mode instead
of the PHY interface mode.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21707
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-27 09:22:10 +01:00
Markus Stockhausen
81f6eca5ec realtek: pcs: rtl930x: enhance symbol error reset
The symbol error reset function misses the default sequence. E.g. kernel
spits the message "rtpcs_930x_sds_sym_err_reset unsupported phy mode" when
working on 2500base-x.

Align the function with the SDK by

- adding QSGMII mode
- adding the "all other modes" switch
- working with "channels" to make clearer what happens

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21718
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-27 09:19:54 +01:00
Joe Hohertz
ebf169afa6 mdadm: move init before fstab init runs
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Ensure md volumes are ready before attempting to mount volumes.

Signed-off-by: Joe Hohertz <jhohertz@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21553
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 01:45:10 +01:00
Joe Holden
17003bb0c5 realtek: add Zyxel GS1900-24 B1 device definition
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
The Zyxel GS1900-24 B1 is a 24 port switch with two SFP ports, it is
identical to the A1 except for doubling the ram.

Specifications
--------------
* Device:    Zyxel GS1900-24 B1
* SoC:       Realtek RTL8382M 500 MHz MIPS 4KEc
* Flash:     16 MiB
* RAM:       128 MiB DDR2 SDRAM
* Ethernet:  24x 10/100/1000 Mbps, 2x SFP 100/1000 Mbps
* LEDs:
  * 1 PWR LED (green, not configurable)
  * 1 SYS LED (green, configurable)
  * 24 ethernet port link/activity LEDs (green, SoC controlled)
  * 2 SFP status/activity LEDs (green, SoC controlled)
* Buttons:
  * 1 "RESET" button on front panel (soft reset)
  * 1 button ('SW1') behind right hex grate (hardwired power-off)
* Power:     120-240V AC C13
* UART:      Internal populated 10-pin header ('J5') providing RS232;
             connected to SoC UART through a SIPEX 3232EC for voltage
             level shifting.

* 'J5' RS232 Pinout (dot as pin 1):
  2) SoC RXD
  3) GND
  10) SoC TXD

Serial connection parameters: 115200 8N1.

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

OEM upgrade method:

* Log in to OEM management web interface

* Navigate to Maintenance > Firmware > Management

* If "Active Image" has the first option selected, OpenWrt will need to be
  flashed to the "Active" partition. If the second option is selected,
  OpenWrt will need to be flashed to the "Backup" partition.

* Navigate to Maintenance > Firmware > Upload

* Upload the openwrt-realtek-rtl838x-zyxel_gs1900-24-b1-initramfs-kernel.bin
  file by your preferred method to the previously determined partition.
  When prompted, select to boot from the newly flashed image, and reboot
  the switch.

* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:

  > sysupgrade /tmp/openwrt-realtek-rtl838x-zyxel_gs1900-24-b1-squashfs-sysupgrade.bin

U-Boot TFTP method:

* Configure your client with a static 192.168.1.x IP (e.g. 192.168.1.10).

* Set up a TFTP server on your client and make it serve the initramfs
  image.

* Connect serial, power up the switch, interrupt U-boot by hitting the
  space bar, and enable the network:

  > rtk network on

> Since the GS1900-24 B1 is a dual-partition device, you want to keep the
  OEM firmware on the backup partition for the time being. OpenWrt can
  only be installed in the first partition anyway (hardcoded in the
  DTS). To ensure we are set to boot from the first partition, issue the
  following commands:

  > setsys bootpartition 0
  > savesys

* Download the image onto the device and boot from it:

  > tftpboot 0x81f00000 192.168.1.10:openwrt-realtek-rtl838x-zyxel_gs1900-24-b1-initramfs-kernel.bin
  > bootm

* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:

  > sysupgrade /tmp/openwrt-realtek-rtl838x-zyxel_gs1900-24-b1-squashfs-sysupgrade.bin

Co-authored-by: Goetz Goerisch <ggoerisch@gmail.com>
Signed-off-by: Joe Holden <jwh@zorins.us>
Add memory size and adapt supported device.
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21595
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 01:34:21 +01:00
Joe Holden
c4cf9da881 realtek: use common dtsi for Zyxel GS1900-24
As there are actually 2 versions of the GS1900-24 where the only
difference is the amount of ram, use a common dtsi and make the
original A1 model dts include the dtsi and only override the memory size.

Signed-off-by: Joe Holden <jwh@zorins.us>
Move memory size to device dts.
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21595
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 01:34:21 +01:00
Stefan Kalscheuer
1e678eb223 tools/mkimage: update to version 2026.01
Update package to the latest stable version.

Patches manually refreshed:
* 030-allow-to-use-different-magic.patch

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
Link: https://github.com/openwrt/openwrt/pull/21674
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 01:29:57 +01:00
Stefan Kalscheuer
6796bace3e uboot-tools: update to version 2026.01
Update package to the latest stable version.

Patches manually refreshed:
* 003-tools-dumpimage-fix-tools-compile.patch

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
Link: https://github.com/openwrt/openwrt/pull/21674
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 01:29:57 +01:00
Markus Stockhausen
6ac2a17ebf realtek: eth: simplify mac port control access
The ethernet driver uses an indirection for access to the MAC_PORT_CTRL
register (aka. MAC_L2_PORT_CTRL on RTL93xx). It defines the base address
and adds up the cpu port offset. This is not needed as the driver does
not handle the non-cpu ports. Use direct register access instead and
avoid register confusion by always using the "_L2_" naming.

While we are here:

- Drop the functions and use defines instead
- Add CPU port defines for better readability

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21691
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 01:22:08 +01:00
Markus Stockhausen
fff4fe32dd realtek: mdio: rename driver data structure from priv to ctrl
Align with the other Realtek switch drivers and use "ctrl" instead
of "priv" for the central data structure.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21701
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-27 01:18:11 +01:00
Hauke Mehrtens
bf9e90c94e kernel: add missing kernel config option
The CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM option shows up when the
OpenWrt option CONFIG_KERNEL_SOFTLOCKUP_DETECTOR is activated.

Link: https://github.com/openwrt/openwrt/pull/21710
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-26 23:57:25 +01:00
Hauke Mehrtens
daa36b7770 kernel: reorder configuration options
Reorder the kernel configuration options by running:
./scripts/kconfig-reorder.sh

Link: https://github.com/openwrt/openwrt/pull/21710
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-26 23:57:25 +01:00
Milan Krstic
30378ffea4
qualcommax: ipq807x: fix sysupgrade for TCL LINKHUB HH500V
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Fix missing reference to bootconfig.sh that was breaking root partition
swap.

Signed-off-by: Milan Krstic <milan.krstic@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21721
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-26 22:01:09 +01:00
Álvaro Fernández Rojas
118d369ea6 odhcp6c: update to Git HEAD (2026-01-25)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
ee2949e3a70a dhcpv6: add config for strict RFC7550
abf6677391f0 dhcpv6: replace hash_ifname() with MD5 implementation

8abb45065f...24485bb4b3

Link: https://github.com/openwrt/openwrt/pull/21705
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2026-01-26 18:49:51 +01:00
Felix Fietkau
0b302ec658 tcpdump: add PROVIDES=tcpdump to tcpdump-tiny
Improves handling of dependencies on tcpdump

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-26 17:46:16 +00:00
John Crispin
b44d4290fe hostapd: add raw beacon report data to ubus notification
Add the complete base64-encoded beacon report structure to the
"beacon-report" ubus notification event.

Signed-off-by: John Crispin <john@phrozen.org>
2026-01-26 17:46:16 +00:00
John Crispin
79cd45ddee hostapd: add association frame to taxonomy data
Extend the taxonomy subsystem to capture the complete association frame
in addition to the existing probe and association IE data.

This adds a new assoc_frame_taxonomy field to struct sta_info and exposes
it via the get_sta_ies ubus method as a base64-encoded "assoc_frame" field.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-26 17:46:16 +00:00
John Crispin
c1492838f7 hostapd: add reporting detail support to RRM beacon request
Extend the hostapd_rrm_beacon_req ubus method to support the optional
reporting_detail parameter as defined in IEEE 802.11-2016 section 9.4.2.21.7.

Also fix missing assignment operators (=) in the beacon_req_policy array
initialisation.

Signed-off-by: John Crispin <john@phrozen.org>
2026-01-26 17:46:16 +00:00
Felix Fietkau
6fb3e95baa hostapd: fix beacon_req_policy syntax issues
Use the correct syntax for array element assignment

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-26 17:46:16 +00:00
Peter Meiser
168d5affc3 netifd: add loglevel config option (fixes #18001)
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Add netifd_loglevel to /etc/config/network:

config globals 'globals'
	option netifd_loglevel '1'

The netifd's default value is 2.

Signed-off-by: Peter Meiser <peter.meiser@gmx.com>
Link: https://github.com/openwrt/openwrt/pull/19737
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-26 10:33:28 +01:00
Markus Stockhausen
ac96463944 realtek: dsa: rtl839x: fix uninitialized global access
Setup for DSA QOS on RTL839x accesses unitialized memory. For some
reason the handover of the priv structure was realized via global
intermediate variable switch_priv. During refactoring for adbb9a6
("realtek: dsa: rtl83xx: fix init section mismatch") this was not
noticed. Since then RTL839x devices crash during startup.

Fix this by using standard handover via function parameters.

Fixes: adbb9a6 ("realtek: dsa: rtl83xx: fix init section mismatch")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21703
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-26 09:58:13 +01:00
Hauke Mehrtens
17d45f677b mt76: mt7996: fix crash when using mesh
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Backport a fix from upstream mt76 to fix a crash in 802.11s mesh mode.

Fixes: https://github.com/openwrt/openwrt/issues/20751
Link: https://github.com/openwrt/openwrt/pull/21643
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-26 00:43:11 +01:00
Milan Krstic
ac8b5526bc qualcommax: ipq807x: add support for TCL LINKHUB HH500V
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
TCL LINKHUB HH500V also known as Vodafone Gigacube B157 is a dual band
802.11ax 5G NR CPE with an FXS port.

Specifications:
* SoC: Qualcomm IPQ8072A
* RAM: 1024 MB
* NAND flash: 256MB NAND (MT29F2G08ABBGAH4)
* NOR flash: 64MB NOR (MX25U25635F) - only in some variants
* WiFi 5G: Qualcomm QCN5054
* WiFi 2.4G: Qualcomm QCN5024
* Ethernet 2.5G: Qualcomm QCA8081
* Ethernet 1G: Qualcomm QCA8075
* Modem: GosunCn GM800 (Qualcomm Snapdragon X55)
* SIM: 1 nano-SIM card slot
* Buttons: Power, Reset, WPS
* LEDs: Power (B/R), WiFi (B), 4G (B/Y/R), 5G (B/Y/R)
* VoIP: 1 FXS RJ11 port (not supported in OpenWrt)
* Power: 12V, 3A

UART serial console:

* 115200,8N1,1.8V
* Three unmarked test points next to QJ2012A:

 +---------+
 | QJ2012A |
 +---------+
 o TX
 o GND
 o RX
 o
 o
 o

Installation via OEM firmware:

* Use the following process to obtain root ssh access
https://forum.openwrt.org/t/150371/24
* Connect using root with no password on port 42000
* Optionally for serial bootloader access run :
fw_setenv bootdelay=3
* SCP factory.bin to /tmp
* Run:
sysupgrade -n /tmp/factory.bin

Installation via serial console and OEM firmware::

* Use console to access OEM firmware shell
* Proceed with SCP & sysupgrade as described above

Other notes:

* This device uses active partition rotation
* Some versions (TCL branded?) have a NOR chip in addition to NAND
* The above is supported by u-boot patching DT partitions
* DT patching does NOT occur on tftpboot/bootm
* Modem is detected as foxconn-sdx55 by kernel (same VID/PID)
* This works OK-ish and should be improved if we can get OEM modem details

Signed-off-by: Milan Krstic <milan.krstic@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19182
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:21:58 +01:00
Milan Krstic
8dd1be5f7b qualcommax: ipq807x: add functions for bootconfig partition
The BOOTCONFIG partition is used by Qualcomm's boot chain to store
metadata about the device's startup configuration. It contains info such
as versioning, configuration flags, primary boot partition, and more.

Newer devices with dual boot partitions not only store the active boot
partition in a U-boot variable but also in partition info in the
BOOTCONFIG partition. As such, add library functions to set and toggle
the active boot partition.

Signed-off-by: Milan Krstic <milan.krstic@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19182
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:21:58 +01:00
Milan Krstic
fcb988be1f generic: 6.12: backport aw9523 fix can_sleep flag
The GPIO expander is connected via I2C, thus the can_sleep flag has to
be set to true. This fixes spurious "scheduling while atomic" bugs
in the kernel ringbuffer.

Signed-off-by: Milan Krstic <milan.krstic@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19182
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:21:58 +01:00
Markus Stockhausen
cf51728467 realtek: eth: use new prefix for ring operations
Align the functions with rest of driver.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21685
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:18:48 +01:00
Markus Stockhausen
7b89702504 realtek: eth: use new prefix for open/stop operations
Align the functions with rest of driver.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21685
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:18:48 +01:00
Markus Stockhausen
5dbfbe59bb realtek: dsa: remove half-cooked SoC version determination
There are some code pieces that determine the SoC version of the
running system. For RTL83xx it reads out the registers, for RTL93xx
it simply uses a constant value. Without any consumer of this data
drop it.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21684
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:18:10 +01:00
Markus Stockhausen
5ebb93158e realtek: phy: drop external RTL8218B firmware blob
No one has looked into the firmware based RTL8218B initializations
for a long time. Instead the basic setup sequences have evolved
so that they can start the RTL8218B PHY from scratch. See

19bc6e8 ("realtek: phy: add basic RTL8218B setup")
4fa90d8 ("realtek: phy: enhance RTL8218B initialization")

Drop the legacy coding.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21679
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:16:56 +01:00
Zeyu Dong
979f70cc7e ipq40xx: fix image pipeline for MR6350
Add two missing $$ in the factory image build pipeline for MR6350

Signed-off-by: Zeyu Dong <dzy201415@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21682
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:15:48 +01:00
Hal Martin
561a8858f5 ipq40xx: enable PoE output on Meraki MR30H
This commit enables PoE output on port 1 of the Meraki MR30H if
the device is powered via 802.3at PoE.

No PoE output is enabled if the device is powered via 802.3af PoE,
as there is insufficient power.

Signed-off-by: Hal Martin <hal.martin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20645
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 22:11:17 +01:00
Robert Marko
51710e9dd4
microchipsw: lan969x: include ip-bridge and dcb tools
Now that DCB is enabled by default, it makes sense to include it on
lan969x.

While we are here, lets include ip-bridge as these devices are switches
and the Busybox applet does not expose enough functionality.

These devices have no space constraints.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-25 22:10:22 +01:00
Robert Marko
4c0c7442db
microchipsw: enable DCB by default
Switchdev driver used by microchipsw supports DCB and has not storage
constraints, so enable kernel and driver DCB support by default.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-25 22:10:22 +01:00
Paweł Owoc
7a5aa24706 odhcpd: update to Git HEAD (2026-01-19)
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
5a13d875ac71 dhcpv6: set static defines for DHCPv6 option header size
9857adb8ac99 dhcpv6-ia: switch case refactor in dhcpv6_handle_ias()
3cbbea830ddd netlink: clean up sockets, close files
13ef483716a5 dhcpv4: de-escalate error logging to debug

3fda5f8b12...13ef483716

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21636
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2026-01-25 19:29:20 +01:00
Linus Walleij
691aa70e16 gemini: create a copy-kernel for 3072k kernels
The Raidsonic devices do not use a 2048k kernel "Kern"
partition like the Storlink reference designs. Instead
it uses a 3072k partition to fit a slightly
larger kernel.

Sadly the current OpenWrt Gemini kernel is still bigger
than 3072k so we need to make use of the Ramdisk
partition as well.

Create a special "copy-kernel" version that can deal
with the Raidsonic 3072k kernels. Tested on the
Raidsonic IB-4220-B booting kernel v6.12.66.

Fix a copy/paste error in the image generation makefile
while we are at it.

Link: https://github.com/openwrt/openwrt/pull/21686
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-01-25 19:08:01 +01:00
John Christoforidis
428bcee2f8 qualcommax: ipq60xx: add support for TP-Link EAP620HD v3
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Specifications:
  * SoC: Qualcomm IPQ6018/AP-CP03-C1 (64-bit Quad-core Arm Cortex-A53 @ 1.2 GHz)
  * RAM: 2x Zentel A3T4GF40BBF-HP (1 GiB DDR3-1866 (13-13-13))
  * Serial Port: 1v8 TTL 115200n8
  * Wi-Fi: Qualcomm QCN5022 (802.11ax/b/g/n)
  * Wi-Fi: Qualcomm QCN5052 (802.11ac/ax/n)
  * Ethernet: RTL8211FS (10/100/1000BASE-T)
  * Flash: GigaDevice PSR1GA30DT (128 MiB)
  * LEDs: 1x Blue Status (GPIO 35 Active High)
  * Buttons: 1x Reset (GPIO 9 Active Low)
  * FCCID: 2AXJ4EAP620HDV3
  * UART: 4-pin unpopulated header by the J1 footprint

Installation Instructions (Serial+TFTP):
  1. Locate the J1 footprint which contains 4 unpopulated pins
  where starting from the arrow, the pins are TX, RX, VCC and GND
  respectively.
  2. Connect a 1v8 TTL port to the 4 pins. Ensure RX and TX are crossed
     over.
  3. Copy openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-initramfs-uImage.itb
  to your TFTP server.
  4. Power up the AP and hold Ctrl+B in the serial console (115200n8) until autoboot is halted.
  5. Run the following commands in the U-boot prompt:
     IPQ6018# setenv serverip <TFTP server addr>
     IPQ6018# setenv ipaddr <addr of the AP>
     IPQ6018# tftpboot 0x44000000 openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-initramfs-uImage.itb
     IPQ6018# bootm 0x44000000
     You may need to type Ctrl+C and Enter before running these commands
     to clear invisible characters from the buffer.
  6. Run the following command in a terminal to copy the sysupgrade image
     to be installed (check IP address):
     $ scp -O openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/
  7. Activate the OpenWrt serial console and run the following commands:
     # cd /tmp
     # sysupgrade -n openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-squashfs-sysupgrade.bin
  8. The AP will reboot and OpenWrt will be successfully installed.

Installation Instructions (Web UI method):
  1. Set up the device using the vendor's web UI. Navigate to
     Management->SSH and enable the "SSH Login" checkbox. Select "Save".

  2. Connect to the machine via SSH:
     $ ssh -o hostkeyalgorithms=ssh-rsa <ip_of_device>

  3. Disable signature verification:
     $ cliclientd stopcs
  4. Rename the "-web-ui-factory" image to something less than 63
     characters, maintaining the ".bin" suffix.

  5. Go to System -> Firmware Update.
     Under "New Firmware File", click "Browse" and select the image.
     Select "Update" and confirm by clicking "OK".

  6. If the update fails, the web UI should show an error message.
     Otherwise, the device should reboot into OpenWrt.

Device support followed from EAP620HD v2 and eap6xx-outdoor for DTS.
Links: openwrt/openwrt#18227

Signed-off-by: John Christoforidis <github@yanny.dev>
Link: https://github.com/openwrt/openwrt/pull/21467
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 16:17:08 +01:00
Caleb James DeLisle
8291fdedad econet: major rewrite of ethernet driver
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Update the econet-eth driver to a new version which is of
sufficient quality that it is realistic to think about upstreaming.

This version is now NAPI based, collects stats, downloads without
dropped packets anymore, has debugfs introspection, and can be
unloaded and reloaded (providing the reset controller is present).

PR #21545 is recommended but not required, without this the
ethernet driver will log a warning on startup because it can't get
the resets and it will be impossible to unload and reload the
driver without a reboot. However, the PoC driver was not capable of
reloading so this is not a regression.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/21557
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-25 15:59:42 +01:00
Markus Stockhausen
adbb9a6423 realtek: dsa: rtl83xx: fix init section mismatch
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Compilation currently spits this message:

WARNING: modpost: vmlinux: section mismatch in reference:
rtl83xx_sw_probe+0x6a4 (section: .text.rtl83xx_sw_probe)
-> rtl83xx_setup_qos (section: .init.text)

That means that we have a "normal" function caller (can be
called during the whole uptime) and a "initialization" function
callee (only available during init.

Fix this and directly fix the unwanted family checks.

Fixes: a91c3ab ("realtek: dsa: avoid use-after-free")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21690
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-25 13:58:48 +01:00
Shiji Yang
4ed5fa3379 uboot-mediatek: fix malformed patch
This patch was manually edited but not refreshed.

Fixes: 794b4dee65 ("uboot-mediatek: add 8g check to bpi-r4 environment for bl2")
Fixes: 46ee5209aa ("uboot-mediatek: add command for getting size of ram")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21693
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-25 13:55:50 +01:00
Jonas Jelonek
19e1e508ea
realtek: mdio: add more Aquantia PHY IDs
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Add a PHY ID for Aquantia AQR813 which is an Octa-PHY found in some
Realtek switches.

Add another PHY ID for another revision of AQR113C, also found in some
Realtek switches.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21515
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-25 12:12:16 +01:00
Jonas Jelonek
4fa27cb325
realtek: mdio: apply phy polling config for RTL931x
Apply the PHY polling configuration for RTL931x too, as previously
implemented for RTL930x. This is needed for several PHYs on that
platform to function properly.

Add another flag called 'force_res' to the phy_info struct which is for
RTL931x only. The SDK mentions this as a flag to force polling the
Realtek proprietary PHY status resolution register. Effectively, this
changes the polling to proprietary format instead of standard format,
and sets an enable bit in another private polling register field.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21515
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-25 12:12:15 +01:00
Jonas Jelonek
322041ffeb
realtek: mdio: enhance reading phy id
Reading the PHY ID to assign a PHY config is currently simple. For C45
two MDIO reads of a hardcoded MMD are done to get the standard PHY ID
registers. MMD 31 (MMD_VEND2) is used for that purpose, assuming there
will be a valid PHY ID stored in this MMD in all cases. However, with
Aquantia AQR813 there's at least one example for which this isn't true.
This PHY returns 0 for the PHY ID in MMD_VEND2, instead MMD_VEND1 would
have the correct ID.

Enhance reading the PHY by accessing a common set of MMDs of which most
PHY at least implement one and have a valid PHY ID in. To keep overhead
low, do not scan all MMDs. As soon as a valid PHY ID is found, exit and
use that. This is similar to the kernel logic, jsut reduced to fewer
MMDs.

Also handle possible errors coming from MDIO reads to avoid reading garbage.

While at it, move reading the PHY ID to a separate function to not
pollute the poll fixup retrievel function.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21515
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-25 12:12:15 +01:00
Robert Marko
12fd85eb79 ipq-wifi: update to Git HEAD (2026-01-24)
38804f59fbb9 ci: add ath12k BDF-s
d28bc0724dc6 ipq8074: add TCL LINKHUB  HH500V BDF
8e1fb2f59893 ipq6018:add TP-Link EAP620 HD v3 BDF Add board file for TP-Link EAP620 HD v3. bdwlan_US.bin sourced from EAP620 HD(US)_V3_1.4.4 Build 20250718 stock firmware.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-25 11:39:25 +01:00
Chukun Pan
cf84e8ee86 rockchip: add HINLINK H66K / H68K support
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Hardware (common):
- RK3568 SoC
- 2/4GB LPDDR4
- 1x HDMI Type A
- 3.5mm jack with mic
- 1x PCIE 2.0 WiFi slot
- 1x USB 3.0, 2x USB 2.0
- 2x 2.5GbE RTL8125B Ethernet
- MicroSD card slot / eMMC 32GB

Additions to HINLINK H68K:
- 2x 1GbE RTL8211F/YT8531 Ethernet

Installation:
  Use dd or balenaEtcher to flash the firmware.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/21270
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 23:46:23 +01:00
Chukun Pan
9de9a15427 uboot-rockchip: add HINLINK H66K / H68K support
Add pending support for the HINLINK H66K / H68K.
Tested on HINLINK H66K, H68K and H68K-V2.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/21270
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 23:46:23 +01:00
Markus Stockhausen
48b4160329 realtek: mdio: drop driver lock
The Realtek mdio driver does not need to track a separate lock.
Rely on the default kernel mdio bus lock instead.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21529
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 23:40:24 +01:00
Markus Stockhausen
5c0e415a4b realtek: mdio: use generic bus command function for RTL931x
Refactor RTL931x mdio commands to use the new helper function.
Remove unneeded goto and debug statements.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21529
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 23:40:24 +01:00
Markus Stockhausen
4eeac83917 realtek: mdio: use generic bus command function for RTL930x
Refactor RTL930x mdio commands to use the new helper function.
Remove unneeded goto and debug statements.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21529
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 23:40:24 +01:00
Markus Stockhausen
a89c72daf5 realtek: mdio: use generic bus command function for RTL839x
Refactor RTL839x mdio commands to use the new helper function.
Remove unneeded goto and debug statements.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21529
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 23:40:24 +01:00
Markus Stockhausen
ff17bb7839 realtek: mdio: use generic bus command function for RTL838x
The Realtek mdio bus works similar for all devices with only
minor family specific differences. Basically command issuing
follows a generic style. Write command type and a trigger.
Afterwards wait until the trigger flag goes back to zero (aka
"command complete"). Unify this sequence in a central helper.

RTL838x read/write callers of this helper use a strange style of
error handling by issuing goto statements. Refactor this for better
readability. Additionally remove all debug prints. These are not
needed as the central read/write handlers provide a common logging
mechanism.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21529
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 23:40:24 +01:00
Thomas Richard
3ddee7edc4 kernel: add TIMERLAT_TRACER kernel config option
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This adds the TIMERLAT_TRACER kernel configuration option. The timelat
tracer helps to find sources of wakeup latencies of real-time threads.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:54:29 +01:00
Thomas Richard
c1c37b40c1 kernel: add OSNOISE_TRACER kernel config option
This adds the OSNOISE_TRACER kernel configuration option. The osnoise
tracer allows to track interference experienced by an application due to
activities inside the operating system (like NMIs, IRQs ...).

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:54:29 +01:00
Thomas Richard
9a584c631e kernel: add HWLAT_TRACER kernel config option
This adds the HWLAT_TRACER kernel configuration option. The hwlat tracer
allows to detect hardware latencies.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:54:29 +01:00
Thomas Richard
2530c99981 loongarch64: set PREEMPT_NONE as default preemption model
Loongarch64 currently uses the PREEMPT_VOLUNTARY model, which is not
aligned with OpenWrt's default. Switch to PREEMPT_NONE for consistency with
OpenWrt's default configuration. Preemption model selection is now
available via menuconfig for further customization.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:54:29 +01:00
Thomas Richard
777fc28040 mediatek: mt7623: set PREEMPT_NONE as default model
Mediatek/mt7623 currently uses the PREEMPT model, which is not aligned with
OpenWrt's default. Switch to PREEMPT_NONE for consistency with OpenWrt's
default configuration. Preemption model selection is now available via
menuconfig for further customization.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
[Added some config options again]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:54:16 +01:00
Thomas Richard
e47c21acfc gemini: set PREEMPT_NONE as default preemption model
Gemini currently uses the PREEMPT model, which is not aligned with
OpenWrt's default. Switch to PREEMPT_NONE for consistency with OpenWrt's
default configuration. Preemption model selection is now available via
menuconfig for further customization.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:52:49 +01:00
Thomas Richard
6924c16745 layerscape: set PREEMPT_NONE as default preemption model
Layerscape currently uses the PREEMPT model, which is not aligned with
OpenWrt's default. Switch to PREEMPT_NONE for consistency with
OpenWrt's default configuration. Preemption model selection is now
available via menuconfig for further customization.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:52:49 +01:00
Thomas Richard
5d720117f7 kernel: add preemption models
Introduce preemption model selection with PREEMPT_NONE as the default.
PREEMPT_NONE is the traditional Linux preemption model and also the best
choice for servers.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21413
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:52:49 +01:00
Frank Wunderlich
794b4dee65 uboot-mediatek: add 8g check to bpi-r4 environment for bl2
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Add check for 8g and replace filename for bl2 to install the right file.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://github.com/openwrt/openwrt/pull/21437
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:15:29 +01:00
Frank Wunderlich
46ee5209aa uboot-mediatek: add command for getting size of ram
Add command which gets ramsize and write it to env variable.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://github.com/openwrt/openwrt/pull/21437
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:15:29 +01:00
Frank Wunderlich
02b2dd3508 mediatek: filogic: add 8GB builds for BPI-R4
Add builds for Bananapi R4 with 8GB RAM.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://github.com/openwrt/openwrt/pull/21437
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:10:57 +01:00
Frank Wunderlich
2d45172138 uboot-mediatek: add mt7988 4bg builds
This allows builds for Bananapi R4 (Pro) with 8GB RAM.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://github.com/openwrt/openwrt/pull/21437
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:10:57 +01:00
Frank Wunderlich
6141cd1dbc arm-trusted-firmware-mediatek: add mt7988 4bg build
This allows builds for Bananapi R4 (Pro) with 8GB RAM.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://github.com/openwrt/openwrt/pull/21437
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 22:10:57 +01:00
John Audia
2228b7048c kernel: bump 6.12 to 6.12.67
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.67

Manually rebased:
  rockchip/patches-6.12/160-01-phy-rockchip-inno-usb2-Simplify-rockchip-usbgrf-handling.patch

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21629
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 21:36:10 +01:00
Hauke Mehrtens
2ae350b725 firewall: change synflood_protect option name
The `syn_flood` option name is deprecated, `synflood_protect` should
be used instead. firewall3 and firewall4 both support this option since
a long time. LuCI already replaces the option name.
0abcb39b62

Suggested-by: rparge in OpenWrt forum
Link: https://github.com/openwrt/openwrt/pull/21642
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 21:33:15 +01:00
David Yang
f0f5525b75 iproute2: add dcb utility
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
KERNEL_DCB was introduced in 40f1db9cb1, however the dcb utility is not
enabled for iproute2. Although DCB is not generally available among
Ethernet cards, not having the dcb utility renders it completely
unchangeable.

On aarch64, it takes ~85.3KiB.

Signed-off-by: David Yang <mmyangfl@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21606
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 21:13:26 +01:00
Maxim Anisimov
46ff60ce02 mediatek: enable wan led for Keenetic KN-(3711/3811)
The indicator is unused by default and not associated
with the wan port. So let’s fix this.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21635
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 20:59:40 +01:00
Maxim Anisimov
9bcfe7b76f mediatek: simplify nvmem mac for Keenetic KN-(3811/3911)
This is a cosmetic change. There is no need to use mac
address increment/decrement in the dts on these devices,
so this can be simplified.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21635
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 20:59:40 +01:00
Maxim Anisimov
299105441a mediatek: drop spi cal for Keenetic KN-(3711/3811/3911)
In the original DTS from the device firmware, there are
no entries that enable SPI calibration. Therefore, it
should be disabled.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21635
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 20:59:40 +01:00
Maxim Anisimov
5c195add76 mediatek: fix label mac for Keenetic KN-(3711/3811/3911)
Keenetic devices always use the WAN port MAC address as
the MAC address printed on the label.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21635
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 20:59:40 +01:00
John Audia
ef10679153 base-files: remove ftp user and group
Any ftpd package such as vsftpd or atftpd (are there others?) should
create their own unprivileged user. Both of the aforementioned
packages do not even use this ftp user and run as root. That should be
addressed in separate commits.

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/19418
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 20:32:53 +01:00
Linus Walleij
0b0cd4efe2 gemini: support upgrade on reference designs
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The Gemini reference design-derived devices uses a partition
format which is predictable and we can exploit this to offer
some proper upgrade path.

The kernel for these contains a hack to use this partition
format unaltered by combining the partitions "Kern" and "Ramdisk"
to one image with all of the kernel+ramdisk in memory.

Then the "Application" which is used for the rootfs go into its
own partition.

Standard flash layout:
Kern         2048k |
Ramdisk      6144k | = 9216k
Application  6144k | = 15360k

Following the pattern of the factory image we create three
images named zImage, rd.gz and hddapp.tgz (these filenames
are misleading! They are just required by the old firmware.)
and flash each individually with "mtd" during upgrades.

Since the IB-4220-V has a different layout with a bigger kernel
space we parameterize this so we can handle this too. (More
fixes are needed for that device though.)

A way to upgrade older OpenWrt on these platforms to the latest
and greatest will be to copy the file
target/linux/gemini/base-files/lib/upgrade/platform.sh
to /lib/upgrade/platform.sh
on your running system and then run sysupgrade from the image
produced after this patch.

The script is picky to sanity check the partitions before
commencing upgrade.

This was tested with a full sysupgrade on the iTian SQ201.

Link: https://github.com/openwrt/openwrt/pull/21680
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-01-24 17:29:17 +01:00
Markus Stockhausen
372f2563f6 realtek: phy: fix RTL8214FC fibre/copper initialization
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
A phy is configured in two stages

- phy_probe() for setup of structures
- config_init() for device setup (after reset)

RTL8214FC is a combo phy and the currently active port can be switched
with the SFP helper functions that are triggered during SFP insertion
and removal. In case a fibre SFP is inserted while booting the SFP
trigger is run between the above mentioned stages. During the final
setup in config_init() the phy is reset to the copper port. Thus no
link is available on fibre and the SFP must be reinserted for normal
operation.

For a consistent behaviour the fibre/copper port setup must run before
the SFP probing and not afterwards. Move the setup code from config_init()
into phy_probe().

Fixes: 10ae743 ("realtek: phy: simplify RTL8214FC configuration")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21582
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-24 11:44:10 +01:00
Markus Stockhausen
45fb8f9739 realtek: phy: optimize RTL8214FC register usage during media set
There are some shortcomings in rtl8214fc_media_set()

- It always uses the mdio raw page (4095) of RTL838x for writes.
  That is wrong when the phy is attached to an RTL839x (raw = 8191)
- It uses the internal write only extended page companion (29)
- The extended page content is not preserved

Fix the three issues.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21582
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-24 11:44:10 +01:00
Markus Stockhausen
121f4d90d0 realtek: phy: save RTL8214FC extended page during power set
Changing the fibre/copper power of a RTL8214FC changes the
extended page via register 29. This is the write only companion
of register 30. The register is afterwards overwritten to 0.

Use the proper extended page register 30 and preserve its content
during the operation.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21582
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-24 11:44:09 +01:00
Markus Stockhausen
07bb4f5115 realtek: phy: convert confusing BMCR_PDOWN usage for RTL8214FC
Bit 11 of registers 16, 19, 20, 21 in page 0x266 denotes if a port
of a RTL8214FC is set/favoured to fibre (0) or copper (1). For unknown
reasons the bit was mixed with BMCR_PDOWN. Convert this to a meaningful
define.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21582
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-24 11:44:09 +01:00
Markus Stockhausen
17f12695d0 realtek: mdio: rtl838x: activate combo PHY media detection
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
There is a misunderstanding about BIT(7) aka EX_PHY_MAN_24_27 in
SMI_GLB_CTRL register. The SDK sets/clears it at different places and
it is not clear what it is for. Observation shows that it is essential
for a working MAC_LINK_MEDIA_STS register.

A RTL838x device has usally two configurations

- port 24/26 are 2 serdes driven fiber ports
- port 24-27 are 4 PHY driven combo ports

In the combo case the above bit must be set so that a switch between
copper and fiber can be detected. Cleanup the MDIO initialization
and remove the unneeded bit handling in the DSA driver.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21653
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-24 11:04:55 +01:00
George Sapkin
87b72fefcb build: purge DESCRIPTION
DESCRIPTION field has been deprecated since 2007, yet internal exporting
causes intermittent package build failures due to the deprecation check,
even with packages that don't have that fields set. Replace all
DESCRIPTION exports with alternative variables defined through shexport
and shvar helpers and remove the check.

Fixes: 547b127d ("make kernel module packaging code reusable and use it in madwifi")
Fixes: 7558f028 ("DESCRIPTION:= is obselete, so complain if it is used and use TITLE if no description is set")
Fixes: cc435322 ("build: optimize target metadata dump")
Fixes: d081edf7 ("build: clean up and optimize ipkg control generator code")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21668
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-24 11:03:40 +01:00
George Sapkin
5f889eaacd imagebuilder: fix parsing ABI for apk packages
Fix parsing ABI when package has multiple tags and apk returns them in a
single line.

Fixes: 31cdd13d ("imagebuilder: add ABI suffix to packages when using apk")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21660
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-24 11:02:18 +01:00
Roc Lai
7c26668217 kexec-tools: remove upstreamed patch
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Remove upstreamed patch:
- 020-i386-improve-basename-compatibility.patch

Link: 4fd0553cdf

Fixes: e75218ef4a ("kexec-tools: bump to 2.0.32")
Signed-off-by: Roc Lai <laipeng668@qq.com>
Link: https://github.com/openwrt/openwrt/pull/21652
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 01:44:39 +01:00
Hauke Mehrtens
a4285d7cc0 lantiq: AVM Fritz 736x: fix PCIe reset GPIO
The vr9.dtsi configures the GPIO 38 as reset GPIO. Also the fon LED is
configured on GPIO 38. This conflicts and makes the probing of the PCIe
controller fail in OpenWrt 25.12.

The AVM GPL source code configured GPIO 21 as PCIe reset.

Fixes: https://github.com/openwrt/openwrt/issues/21562
Link: https://github.com/openwrt/openwrt/pull/21641
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-24 01:40:11 +01:00
Shiji Yang
b94de14baf uboot-mediatek: update to v2026.01
Remove upstreamed patches:
  100-08-cmd-mtd-add-markbad-subcommand-for-NMBM-testing.patch [1]
  101-01-mtd-spinand-add-support-for-FORESEE-F35SQA002G.patch [2]
  101-02-mtd-spinand-add-support-for-FORESEE-F35SQA001G.patch [3]
  110-mtd-spi-nand-add-support-for-FudanMicro-FM25S01A.patch [4]

Some SPI-NAND driver macro definitions and function parameters have
been changed in the latest release[3]. Hence we also had to rework
the related local patches to follow the upstream changes.

Tested on MT7981 SPI-NOR/EMMC.

[1] 21c1098cf4
[2] 2a0f8e7da0
[3] 2cbdd3e449
[4] 8b984b5a39

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
[daniel@makrotopia.org: tested MT7622 SNAND and SPI-NOR]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-24 00:17:22 +00:00
Linus Walleij
8dec72061f gemini: Fix up the rootfs device for SQ201
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The rootfs partition is /dev/mtdblock3, fix it up.

Link: https://github.com/openwrt/openwrt/pull/21662
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-01-23 23:50:19 +01:00
Linus Walleij
92682593d5 gemini: Add DTS fix from upstream kernel
This contains small but important DTS fixes for the
RedBoot partitions.

Link: https://github.com/openwrt/openwrt/pull/21662
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-01-23 23:49:37 +01:00
George Sapkin
7bb79b9d53 imagebuilder: skip repository file when standalone
Standalone image builder doesn't have a repositories file as all
packages are included, which causes:

ERROR: failed to read repositories: PATH_TO_BUILDER/repositories: No such file or directory

The images are still built, so this is more of an informational error.

Pass related argument to apk only when CONFIG_IB_STANDALONE is not set.

Fixes: a8d17c21 ("imagebuilder: actually support IB from buildbot")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21658
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-23 22:14:06 +01:00
Robert Marko
78c98abd30
uboot-microchipsw: add FIP update flashing shortcut
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Add env variable to make it easy to flash an FIP update.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-23 11:07:23 +01:00
Robert Marko
19e097e18a microchipsw: update DTS with the latest pending upstream
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Update the DTS to the latest pending upstream version, it looks like this
should get merged soon upstream.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-23 10:55:29 +01:00
Gabriel Roper
088f6e563e d1: Enable LED driver for D1 builds
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This enables the kernel configuration option
to build the SUN50I_A100 driver, which is
the one driver used by the D1 for the RGB
LED controller.

Signed-off-by: Gabriel Roper <lockheedmaniac@gmail.com>
2026-01-23 10:35:36 +01:00
Gabriel Roper
12992dcb7e d1: Add device tree configuration for D1 RGB LED Controller
This adds the device tree patches written by Samuel Holland
to the kernel. The driver was merged into mainline Linux in 6.8,
but the device tree patches were never merged into mainline.

Signed-off-by: Gabriel Roper <lockheedmaniac@gmail.com>
2026-01-23 10:35:36 +01:00
Chukun Pan
8dccd1e44f d1: refresh kernel config
Run 'make kernel_oldconfig' to get an up-to-date config.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-23 10:35:36 +01:00
Chukun Pan
1e7950a45d d1: enable overlay support
Add the loop module and mkfs tool to use f2fs/ext4
based overlays. This fixes the following bug:

mount_root: unable to create loop device
mount_root: no usable overlay filesystem found, using tmpfs overlay

Fixes: 99545b4bb1 ("d1: add new target")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-23 10:35:36 +01:00
Chukun Pan
81580cc92c d1: enable usbgadget feature
The USB of most d1 devices works in otg or peripheral mode.
Enable this feature to use usbgadget and fix musb errors:

musb-sunxi 4100000.usb: Invalid or missing 'dr_mode' property
musb-sunxi 4100000.usb: probe with driver musb-sunxi failed with error -22

Fixes: 99545b4bb1 ("d1: add new target")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-23 10:35:36 +01:00
Chukun Pan
a8a0d9c12f uboot-d1: update to 2024.01
Update to version 2024.01 to remove upstream patches.
The remaining patches come from this repository:
https://github.com/smaeul/u-boot/tree/d1-wip

[for Dongshan Nezha STU, Nezha D1]
Tested-by: Zoltan HERPAI <wigyori@uid0.hu>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-23 10:35:35 +01:00
Roc Lai
e75218ef4a kexec-tools: bump to 2.0.32
Change log is available at: https://github.com/horms/kexec-tools/compare/v2.0.28...v2.0.32

Manually refreshed patch:
- 020-i386-improve-basename-compatibility.patch

Remove upstreamed patch:
- 010-Fix-building-on-x86_64-with-binutils-2.41.patch

Signed-off-by: Roc Lai <laipeng668@qq.com>
Link: https://github.com/openwrt/openwrt/pull/21623
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-23 10:34:12 +01:00
Roc Lai
9fb645fa20 kexec-tools: add aarch64 architecture support
To update kexec and kdump dependencies for supporting the aarch64 architecture.

Signed-off-by: Roc Lai <laipeng668@qq.com>
Link: https://github.com/openwrt/openwrt/pull/21623
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-23 10:34:12 +01:00
Rosen Penev
45f3543385 ath79: rb91x_nand: fix some issues in probe
Add devm for ioremap to proper cleanup.

Test gpiod_direction_input for failure.

Remove rb91x_nand_release and fix wrong usage.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21165
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-23 10:33:05 +01:00
Markus Stockhausen
3ddcd5265f realtek: phy: add RTL8218D initialization
The RTL8218D currently relies on proper U-Boot configuration. In
case that is not possible, provide a basic setup sequence that can
bring the PHY "alive". The SDK provides multiple configuration
sequences for two operation modes (XSGMII or QSGMII) and the different
SoC families. Due to limited testing resources only provide a setup
for RTL93xx devices and both modes at the moment.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21551
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-23 10:31:01 +01:00
gongzi miao
3af12632ef dnsmasq: bump release to 2.92
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
bump dnsmasq to latest 2.92

updated 200-ubus_dns.patch
no changes to 100-remove-old-runtime-kernel-support.patch
all remaining patches not required

Changelog for version 2.92 https://thekelleys.org.uk/dnsmasq/CHANGELOG

Signed-off-by: gongzi miao <miaogongzi0227@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21598
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-22 20:55:32 +01:00
Felix Fietkau
e855f32bdd wifi-scripts: iwinfo.uc: cache survey data in iface object
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Extract survey fetching into get_survey() and store results in iface.survey,
allowing access to full survey info (not just noise) for later use.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-22 11:25:49 +01:00
John Crispin
26eab84f81 wifi-scripts: refactor iwinfo.uc to support dynamic data updates
Moved interface discovery and data population into an exported update()
function that can be called on-demand to refresh wireless interface
information. This allows using iwinfo.uc as a library inside daemons.

Signed-off-by: John Crispin <john@phrozen.org>
2026-01-22 11:24:17 +01:00
Felix Fietkau
55c498eb7b udebug: update to Git HEAD (2026-01-16)
c5c493ed5787 udebug-cli: fix reference to invalid variable in error message
875e1a7af6ca udebug-cli: add logdump command

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-22 10:20:17 +00:00
Felix Fietkau
bb22a514dc build: fix stale package install stamps for unselected variants
When a package variant changes from =y to =m, its .install stamp file
was not being cleaned up, causing both variants to appear in the
package install list.

Fix by making compile depend on prepare-package-install, ensuring
the stamp file is always cleared. Only =y packages recreate it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-22 10:20:17 +00:00
Felix Fietkau
6d5c71f748 build: auto-generate CONFLICTS for package variants sharing PROVIDES
Packages using PROVIDES to declare virtual package alternatives (like
tc-tiny, tc-bpf, tc-full all providing 'tc') could be simultaneously
selected as =y, causing installation conflicts. The PROVIDES mechanism
only handles dependency resolution, not mutual exclusion.

Add add_implicit_provides_conflicts() to automatically generate CONFLICTS
from default variants to non-default variants sharing the same PROVIDES.
This ensures only one variant can be built-in (=y) at a time.

Skip generating implicit conflicts when the non-default already has
explicit CONFLICTS with the default, to avoid Kconfig dependency cycles
with the select-based dependency resolution.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-22 10:20:17 +00:00
Shiji Yang
46129bbbf5 mediatek: dts: mt7981: fix spi clocks
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Fix spi1 sel-clk source and add missing assigned-clocks.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21108
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-22 00:10:56 +01:00
Shiji Yang
3462789923 mediatek: dts: mt7981: remove internal phy LED pinctrl
This default pinctrl doesn't work at all. We must add pinctrl phandle
to the ethernet-phy node or mac node. This patch removed the internal
phy LED pinctrl group definitions from the SOC dtsi because it is
currently only used by one device. Some incorrect LED pinctrls also
have been removed because these devices do not have hardware phy LED.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21108
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-22 00:10:56 +01:00
Shiji Yang
c9cae03d35 mediatek: dts: mt7981: add mediatek,wed-pcie syscon phandle
The PCIe NIC WED offload features depend on it. Also add the missing
"syscon" compatible for the wed_pcie node as it's accessed by
syscon_regmap_lookup_by_phandle().

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21108
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-22 00:10:56 +01:00
Shiji Yang
5e3e73c969 mediatek: dts: mt7981: load xhci phy efuse by default
This should improve the stability of the USB 3.0 port[1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=6f2b033cb883f64ad084a75f13634242c7e179a6
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21108
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-22 00:10:56 +01:00
Shiji Yang
0d13738ef4 mediatek: dts: mt7981: remove useless nodes
These stuffs were copied from the vendor SDK. There are currently
no drivers compatible with them. The pending upstream patches did
not include them either.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21108
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-22 00:10:56 +01:00
Caleb James DeLisle
b4b12a8239 econet: add clock/reset support
This is in preparation for the next update to EcoNet Ethernet driver
which will be using real resets rather than bit-bashing. Patches are
backported up to the current state of clk-next because I intend on
upstreaming these patches soon.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/21545
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-22 00:03:52 +01:00
Tianling Shen
609deedd87 rockchip: fix set default serial_{addr,port} in boot script
On some SoCs like RK3399, U-Boot no longer export the serial
address in $stdout variable, it has been changed to something like
`stdout=serial,vidconsole` since video supported was added. So
detect $soc variable instead, this also makes the script more clear.

Addtional note: rk3566 is reported as rk3568, rk3582 is reported as
rk3588 in $soc.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/21610
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:56:42 +01:00
Paul Donald
a82738d83f ucode: update to Git 85922056ef7 (2026-01-16)
45bf891e1d8d rtnl: add module documentation
8bbf01215ce3 nl80211: add module documentation
40a6aeb698e1 nl80211: add new attribute "mlo_links" for per link information
376e8733609e ubus: complete pending requests when disconnecting locally
32449bfb69d6 io: add ptsname, tcgetattr, tcsetattr, grantpt, unlockpt
76bf32679d86 digest: fix jsdoc to reveal sha512 functions
58b4597fa2ae build: drop remnant
6ef0b3ada3fd build: respect bin/lib paths
28132276a426 build: adjust flags and definitions
cb1b1c1a097b zlib: make chunk size configurable
6f80655c88c3 debian: refresh packaging
9fc4889c6e8e debian: adjust LTO build
a503a49f5cef debian: build "digest" and "zlib" modules
ffc48a2a4db9 socket: fix off-by-one in uv_to_sockaddr()

Fixes: https://github.com/jow-/ucode/issues/366

dropped patch 130 - integrated at source.
refreshed patches

https://github.com/openwrt/openwrt/pull/21585
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21585
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:50:52 +01:00
Markus Stockhausen
7e39a2d485 realtek: mdio: derive phy smi-bus from parent node
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
The dts for RTL93xx devices has duplicate data about the
smi bus of a phy node. The parent node declares the number
of the bus and the realtek,smi-address attribute does the
same.

Remove the bus part from the realtek,smi-address attribute
and lookup the bus from the parent node. While we are here
remove all realtek,smi-address attributes where phy id
matches the bus address. The driver will use that as a
fallback.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21438
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:32:54 +01:00
Markus Stockhausen
b948cc17b4 realtek: dts: convert devices to mdio bus 1-3
Switch the mdio bus topology for devices that have their phys
attached to bus 1-3. This does not have any impact because
the mdio driver was completly redisgned

With this commit the bus id is stored twice. Once in the (new)
bus and in the (old) realtek,smi-address property. E.g.

&mdio_bus1 {
  reg = <1>; <<< bus id
  phy24: ethernet-phy@24 {
    reg = <26>;
    compatible = "ethernet-phy-ieee802.3-c22";
    realtek,smi-address = <1 2>; <<< bus & address id
  };
};

This redundancy will be removed later.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21438
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:32:54 +01:00
Markus Stockhausen
cfe534dc8e realtek: dts: add mdio bus 1-3 to RTL93xx
RTL93xx devices have 4 smi busses (0-3). Add them to the dts.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21438
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:32:54 +01:00
Markus Stockhausen
3b73474f71 realtek: mdio/dsa: refactor mdio bus initialization
The mdio driver currently determines the smi bus and address from the
realtek,smi-address attribute of the phy. To better reflect the
topology and align with upstream, the phys should be relocated below
their associated bus. As an interim solution the following dts notation
is in focus.

mdio_ctrl: mdio-controller {
  mdio_bus0: mdio-bus@0 {
    reg = <0>;
    phy0: ethernet-phy@0 {
      reg = <0>;
      compatible = "ethernet-phy-ieee802.3-c45";
      realtek,smi-address = <8>;
    };

  &mdio_bus1 {
    reg = <1>;
    phy16: ethernet-phy@16 {
      reg = <16>;
      compatible = "ethernet-phy-ieee802.3-c45";
      realtek,smi-address = <2>;
  };
}

With this

- the phy reg property still denotes the port number
- the bus number can be derived from the parent bus node.
- the bus address is taken from realtek,smi-address

Refactor bus initialization so it can handle phy nodes below
multiple bus nodes.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21438
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:32:54 +01:00
Markus Stockhausen
3722b006a6 realtek: mdio: rename iterator to "addr"
During initialization the mdio driver registers phys with the
iterator "pn". To make clear that it is a phy address rename it
to "addr".

While we are here improve the upper bound check of the maximum
possible address. This is the family specific cpu port and not
the generic upper bound constant for all devices.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21438
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:32:54 +01:00
Markus Stockhausen
631e066bc3 realtek: mdio: register mdio bus at controller node
In the future the mdio controller will have multiple busses
defined in the dts below the controller node. Nevertheless
it will still hand out only one single bus to the kernel.
Attach the (exported) bus to the controller node instead of
the single (dts) bus subnode.

With this change the mdio lookup in the dsa driver must
be changed to point to the mdio controller node too.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21438
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 23:32:54 +01:00
Markus Stockhausen
84a6288a08 realtek: dsa: Remove family check from port_get_stp_state()
The device specific stp_get() functions can return the state
of a given port individually. No need to disassemble the
device specific state table. Additionally change function
prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21527
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 22:54:46 +01:00
Markus Stockhausen
92121e6aa5 realtek: dsa: enrich stp_get() return value
The family specific stp_get() functions have a new return value
that gives the stp status of a given port. Instead of a constant
zero value provide the real data.

While we are here align the RTL930x implementation with the
other ones.

- Drop the debug output
- Make use of priv->r->tbl_access_data_0()

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21527
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 22:54:46 +01:00
Markus Stockhausen
f70ea84215 realtek: dsa: convert stp_get signature
The device specific stp_get() function returns a device specific
state to the generic caller. So the caller must use a if/else
statement depending on the family to look into the retrieved data.

Change the signature of the function so it can return a device
independent state of a given port in the future. Additionally
use the new function prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21527
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 22:54:46 +01:00
Qingfang Deng
5b61a50244 netfilter: remove nf-conntrack6
nf_conntrack_ipv6 is no longer a separate kernel module, so remove it.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21612
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-21 22:42:20 +01:00
Ryan Chen
a8bdb1e6d6 wifi-scripts: fix WiFi 6E discovery for 6GHz 320MHz operation
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
WiFi 6E (802.11ax) clients cannot discover 6GHz APs operating at
320MHz because the HE Operation element contains uninitialized
center frequency values.

For EHT320 mode, the code sets eht_oper_centr_freq_seg0_idx but not
the corresponding HE values. Later, the HE values are copied from
VHT values, but VHT is not used on 6GHz, leaving he_oper_chwidth
and he_oper_centr_freq_seg0_idx at 0. This causes WiFi 6E clients
to see incorrect channel width information, making the AP invisible
to them during scanning.

Fix this by:
1. Setting he_oper_chwidth to 3 (160MHz) for EHT320 mode
2. Computing he_oper_centr_freq_seg0_idx based on the 160MHz segment
   that contains the primary channel
3. Preserving these pre-set values instead of overwriting them with
   uninitialized VHT values

WiFi 7 clients continue to see 320MHz operation via the EHT Operation
element, while WiFi 6E clients can now discover and connect at 160MHz.

Signed-off-by: Ryan Chen <rchen14b@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21588
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-21 22:30:05 +01:00
Robert Marko
b300a9e63d microchipsw: lan969x: use network driver as a module
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Due to PTP conflicts with CONFIG_ALL_KMODS which causes the end images
to end up with no switchdev driver included, lets switch to using the
switchdev and PHY drivers as modules instead.

Fixes: 88a404a2d1 ("microchipsw: add support for Microchip LAN969x switches")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-21 16:25:42 +01:00
Robert Marko
9a4c6550a7 kernel: modules: package Microchip SparX-5 switchdev driver as a module
Package the Microchip SparX-5 switchdev driver as a module.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-21 16:25:38 +01:00
Jonas Gorski
e7873c4d7e strace: use bundled kernel headers
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build against the bundled kernel headers instead of using the current
kernel ones. This ensures strace is using the kernel headers it is
written against, and not a random one that may contain breaking uapi
changes (which happen from time to time).

Fixes build against 6.18 final and recent LTS/stable kernels that got
minor uapi breakages (rename of a 6.18 introduced #define and a struct
field).

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
2026-01-21 11:41:59 +01:00
Hauke Mehrtens
8076376aca Revert "kernel: pcs-mtk-lynxi: backport fix for in-band status capabilities"
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This reverts commit 7390e63374.

This broke SFP handling on some Mediatek SoCs.
Some SFPs are configured for inband/2500base-x link mode and were
rejected with this change.

Fixes: https://github.com/openwrt/openwrt/issues/21436
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-21 01:19:28 +01:00
Jan Hoffmann
30f8ceaa7e realtek: make all link speeds work for RTL8221B in Zyxel XGS1210-12 rev B1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
SGMII only works correctly on this device if inband auto-negotiation is
enabled. Configure the PHY for SGMII and in-band mode in the device tree
to make this happen.

For 2.5G link speeds the PHY will still switch to 2500Base-X without AN.

The same configuration also works on RTL8226, so it is fine to apply
this change to the A1 revision of XGS1010-12/XGS1210-12 as well.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/21605
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-20 15:25:10 +01:00
Kamil Jońca
1c62e21a8d ramips: mt76x8: add support for Cudy LT400E v1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This commit adds support for the Cudy LT400E v1,
an indoor 4G/LTE WiFi router.
It has 4x10/100 Mbps Ethernet ports, a 2.4 GHz radio,
and a Quectel 4G/LTE EC200A modem.

Hardware:

SoC: MediaTek MT7628NN
Flash: 8 MiB SPI
RAM: 64 MiB
Ethernet: 4x10/100 Mbps
WiFi: 2.4 GHz (embedded MT7628, 802.11n)
WWAN: Quectel EC200A-EL 4G/LTE Cat 4 modem
SIM: nano-SIM slot
Buttons: 1 Reset button, 1 WPS button
LEDs: 10x (blue)
Power: 12 V DC barrel jack

Installation:
The stock firmware is a customized variant of OpenWrt, which implements
a signature check that only allows flashing official firmware. Cudy
offers, on their website [1][6], intermediate OpenWrt firmware images
which do not implement the signature check. After flashing the
intermediate image, the upstream (i.e., official) OpenWrt image can be
installed.  See the device's entry in OpenWrt's Wiki for more details [2].

Cellular network:
The Quectel EC200A modem is internally connected to the SoC via USB, and
operates in ECM mode, supported by the CDC Ether driver [3]. When
inserting a SIM card in the slot, if no PIN is needed, the network
interface "usb0" is brought up and the cellular connection works out of
the box. To interact with the modem directly (unlock the PIN, change APN
and PDP settings, etc.), AT commands can be sent with picocom to serial
port /dev/ttyUSB2 [4].

Recovery:
The stock firmware can be recovered via TFTP, as the bootloader (based
on U-Boot) implements a recovery client. Set up a TFTP server on your
computer with IP 192.168.88.1/24 serving the stock firmware from Cudy's
website renamed to "recovery.bin". Press the Reset button (keep it
pressed), power on the device, wait for the TFTP server to send the
recovery.bin file, then release the Reset button. The router will take a
couple of minutes to reboot and set up the stock firmware. See the
device's entry in OpenWrt's Wiki for more details [2].

Discussion:
Use the dedicated thread in OpenWrt's forum to discuss any aspects [5].

Acknowledgments:
The code to support this device is largely based on the sources kindly
provided by Cudy in compliance with the GPL license. Thanks for
supporting the OpenWrt community.

Links:
[1] https://www.cudy.com/blogs/faq/openwrt-software-download
[2] https://openwrt.org/toh/cudy/lt400e_v1
[3] https://openwrt.org/docs/guide-user/network/wan/wwan/ethernetoverusb_cdc
[4] https://openwrt.org/docs/guide-user/network/wan/wwan/at_commands
[5] https://forum.openwrt.org/t/242466
[6] https://drive.google.com/drive/folders/1BKVarlwlNxf7uJUtRhuMGUqeCa5KpMnj

Co-authored-by: rogerpueyo <roger.pueyo@guifi.net>

Signed-off-by: Kamil Jońca <kjonca@onet.pl>
Link: https://github.com/openwrt/openwrt/pull/21246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-20 01:47:00 +01:00
John Audia
c0fb8e1f35 kernel: bump 6.12 to 6.12.66
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.66

All patches automatically rebased

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21591
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-20 01:15:32 +01:00
Chen Minqiang
7d79346581 mediatek: filogic: add support for Tenda BE12 Pro
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
This patch adds support for Tenda BE12 Pro.

The stock bootloader requires a specific 16-byte header (Magic: "God1")
to correctly verify and boot the Linux kernel from flash. A new image
command `tenda-mkdualimageheader` is added to generate this header and
append the checksum/size information required for the device to boot
successfully.

Hardware Specification:
- SoC: MediaTek MT7987A (Quad-core ARM Cortex-A53 2.0 GHz)
- RAM: 512 MiB DDR4
- Flash: 128 MiB SPI-NAND
- WiFi: MediaTek MT7992E (WiFi 7)
  - 2.4GHz: b/g/n/ax/be (4x4 MIMO)
  - 5GHz: a/n/ac/ax/be (4x4 MIMO)
- Ethernet:
  - 3x 10/100/1000 Mbps LAN (Airoha AN8855AE Switch)
  - 1x 10/100/1000/2500 Mbps LAN (SoC internal PHY)
  - 1x 10/100/1000/2500 Mbps WAN (Airoha EN8811H PHY)
- Buttons: Reset, WPS
- LEDs: 2x (Blue: System/Run, Red: Alarm)
- UART: 115200 8n1 (VCC, RX, TX, GND)

Flash Layout:
- 0x000000 - 0x300000 : Bootloader
- 0x300000 - 0x380000 : u-boot-env
- 0x380000 - 0x780000 : Factory
- 0x780000 - 0xd80000 : kernel
- 0xd80000 - 0x6780000 : ubi (rootfs)
- 0x6780000 - 0x6b80000 : CFG
- 0x6b80000 - 0x6f80000 : MISC2

MAC Addresses (NVMEM):
- Base MAC located at Factory partition offset 0x4
- gmac2 (WAN) : Base - 2 (Label MAC)
- gmac0 (LAN) : Base - 1
- gmac1 (LAN) : Base - 3
- 2.4 GHz     : Base
- 5 GHz       : Base + 1

Installation:
1. Connect via UART and interrupt U-Boot by pressing 'Ctrl+C' during boot.
2. Set up a TFTP server on a computer (IP 192.168.1.2) containing
   'openwrt-initramfs.bin'.
3. Load the initramfs image:
   tftpboot openwrt-initramfs.bin
4. Boot the image:
   bootm
5. Once booted into OpenWrt initramfs, perform a sysupgrade with the
   sysupgrade image.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21461
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-20 00:58:22 +01:00
Paul Donald
16ae5c23e5 ucode: enable ucode-mod-zlib
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
The module exists in ucode and has been present for a while
but has not been enabled. It provides the ucode zlib module
for handling gzip and zlib compression in ucode scripts.

The package is ~ 5Kb. Installed ~18Kb.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21417
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-19 21:21:17 +01:00
Daniel Golle
468ee567c9 kernel: net: phy: realtek: backport upstream commits
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Backport a bunch of upstream commits simplifying the RealTek PHY driver
and re-unifying the C22 and C45 driver instances.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-19 13:51:41 +00:00
Chukun Pan
e8997e7e03 rockchip: add HINLINK H28K support
Hardware:
- RK3528 SoC
- 1x USB 2.0
- 8/32GB eMMC
- 1/2/4GB LPDDR4
- 1x 1GbE RTL8111H
- 1x 1GbE RTL8211F
- MicroSD card slot

Installation:
  Use dd or balenaEtcher to flash the firmware.

Note:
  The RK3528 SoC does not support MSI-X, so it can't
  adjust the interrupts of r8169 to other CPU cores.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-19 13:44:58 +00:00
Chukun Pan
384127320e uboot-rockchip: add HINLINK H28K support
Add pending uboot support for the HINLINK H28K.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-19 13:44:58 +00:00
Chukun Pan
7a07d38f33 rockchip: correct MAC address for Radxa E20C
Use the unique MAC address in EEPROM for eth0.
The MAC address of RTL8111H (eth1) is correct.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-19 13:44:58 +00:00
Chukun Pan
dccfc10957 rockchip: configure WAN port LED of Radxa E20C
The WAN(eth1) port LED on the Radxa E20C is completely off.
Since the r8169 driver supports configuring LEDs, using it.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-19 13:44:58 +00:00
Chukun Pan
eb87c8b82b generic: restore network port name for r8169 LED
Currently, the LED names generated by the r8169 driver are the
network port names renamed by udev, such as enp1s0. Add a hack
patch to restore the interface name to match OpenWrt.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-19 13:44:58 +00:00
Pierre-Emmanuel Frot
e45ba0ef6e x86: cs5535audio: add support for subtarget legacy
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build kernel module for cs5535 internal audio for target x86 "legacy" also
(so far only for target x86 "geode")

Signed-off-by: Pierre-Emmanuel Frot <piemfrot@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21596
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-19 12:50:00 +01:00
Maximilian Baumgartner
687a2535d5 mediatek: fix gmac definition for cudy m3000
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
The gmac definition has an offset of 1 compared to the label MAC.
Fixes: a55ab9e134 ("mediatek: filogic: prevent faulty mac address assignment")

Signed-off-by: Maximilian Baumgartner <aufhaxer@googlemail.com>
Link: https://github.com/openwrt/openwrt/pull/21560
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:36:17 +01:00
Stijn Tintel
294945b8e9 generic: filter out more rust related symbols
More rust symbols that are detected using scripts or based on the rust
version have been added. Filter them out.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Link: https://github.com/openwrt/openwrt/pull/21554
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:22:15 +01:00
Jonas Jelonek
a20ea50dec realtek: pcs: rtl930x: rework SerDes mode setting
Rework the SerDes mode setting to have a better logical structure,
similar to how RTL931x currently does it. Mode setting is grouped into a
MAC setup and IP core setup. Most modes just need to trigger the MAC
setup and then they work, otherwise some complex sequence is needed.

To achieve that, rename several functions and group their content
differently. While at it, rename some constants to use the RTPCS_ prefix.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:19:09 +01:00
Jonas Jelonek
13f7a9977b realtek: pcs: rtl930x: rename internal mode helpers
RTL930x has some helpers which take care of writing the actual mode
value to the corresponding register. They exist for the MAC setup SerDes
mode, the USXGMII submode and the SerDes IP core mode.

To reflect that, adjust the naming of these helpers accordingly. Most
importantly, prefix the helper names with '__'. This is a common
convention to denote helpers/functions which are internal, not intended
for general use and skip certain checks. Those conditions apply to these
helpers. Though they are still used quite often here, this might change
with further cleanups.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:19:09 +01:00
Jonas Jelonek
a282999087 realtek: pcs: rtl930x: use SerDes hw mode in calibration
Completely replace usage of PHY_INTERFACE_MODE_* in the vast amount of
calibration functions with the SerDes hardware mode.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:19:09 +01:00
Jonas Jelonek
eba83bc57e realtek: pcs: rtl930x: use SerDes hw mode for mode setting
Set and configure the SerDes mode using the SerDes hardware mode types
instead of PHY_INTERFACE_MODE_*.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:19:08 +01:00
Jonas Jelonek
d48e7bbacd realtek: pcs: rtl930x: use SerDes hw mode in TX config
Use SerDes hardware mode in RTL930x SerDes TX config instead of
PHY_INTERFACE_MODE_* modes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:19:08 +01:00
Jonas Jelonek
2df05f8b84 realtek: pcs: rtl930x: use SerDes hw mode in patching
Switch to using the SerDes hardware mode in RTL930x SerDes patching aka
rtpcs_930x_sds_patch.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:19:08 +01:00
Jonas Jelonek
4406f96e3b realtek: pcs: rtl930x: use SerDes hw mode in setup entry
Start using the SerDes hardware in the RTL930x SerDes setup entrypoint.
Use the generic mapper (which will be moved out later to pcs_config) to
determine the mode. In the next steps, switch to solely using that
step-by-step.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:19:08 +01:00
Markus Stockhausen
4a66133724 realtek: eth: adapt counter() and irq() functions
Convert the update_counter() and net_irq() functions to the
new prefix. For better readability rename "cntr" to "counter".

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21569
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:17:54 +01:00
Markus Stockhausen
b7eb2fdcab realtek: eth: use device specifc hardware reset
The hardware reset is a combined function for all device families.
So it uses several family specific branches to decide what is
really needed. Refactor this into device specific variants to make
it easier to understand.

The cpu port and nic reset sequence is the same for all families.
Provide this with a dedicated function.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21569
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:17:54 +01:00
Markus Stockhausen
41acf8f4f7 realtek: image: switch cameo devices from gzip to lzma
The cameo based RTL83xx devices have a simple U-Boot that only
supports gzip compression. Actual models are mainly D-Link
DGS-1210 and the Apresia Light GS120GT-SS. Reduce the image
size by ~1MB by switching over to lzma compression and rt-loader.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21577
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:15:10 +01:00
Chukun Pan
1c582f7c73 qualcommax: ipq60xx: add JDCloud RE-CS-07 support
Specifications:
  SoC:     Qualcomm IPQ6010 1.8GHz
  RAM:     K4A8G165WC-BCTD x2 2GiB
  ETH:     QCA8075 (3x LAN, 1x WAN)
  Flash:   ICMAX 8GB eMMC
  Power:   DC 12V 2A
  USB:     1x 3.0
  Button:  Reset

Flash instructions:
  1. Download the initramfs image, rename it to
     initramfs.itb, host it with the tftp server.
  2. Enter "jdmt018R" to interrupt U-Boot
     when the following statement appears:
     "disabled console and autoboot in 2 seconds"
  3. Run these commands in U-Boot console:
     tftpboot initramfs.itb
     bootm
  4. After openwrt boots up, use scp or luci web
     to upload sysupgrade.bin to upgrade.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/19840
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:13:54 +01:00
Chukun Pan
53a8e7b2d4 qualcommax: ipq60xx: add JDCloud RE-CS-02 support
Specifications:
  SoC:     Qualcomm IPQ6010 1.8GHz
  RAM:     K4A4G165WF-BCTD x2 1GiB
  Flash:   FORESEE 128GB/256GB eMMC
  ETH:     4x 1Gbps + 1x 2.5Gbps
  WLAN1:   QCN5022 2.4GHz AX 2x2
  WLAN2:   QCN5052 5.8GHz AX 2x2
  WLAN2:   QCN9024 5.2GHz AX 4x4
  Button:  Reset, Screen, Wps
  Power:   DC 12V 3A
  USB:     1x 3.0

Flash instructions:
  1. Download the initramfs image, rename it to
     initramfs.itb, host it with the tftp server.
  2. If the stock firmware version is 4.3.0.r4211
     or higher, enter "jdmt018R" to interrupt
     U-Boot when the following statement appears:
     "disabled console and autoboot in 2 seconds"
  3. Run these commands in U-Boot console:
     tftpboot initramfs.itb
     bootm
  4. After openwrt boots up, use scp or luci web
     to upload sysupgrade.bin to upgrade.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/19840
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 11:13:54 +01:00
Chukun Pan
16422510b5 qualcommax: ipq60xx: add JDCloud RE-SS-01 support
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Specifications:
  SoC:     Qualcomm IPQ6000 1.2GHz
  RAM:     NT52CB256MB16DP 512MiB
  Flash:   FORESEE 64GB/128GB eMMC
  ETH:     QCA8075 (3x LAN, 1x WAN)
  WLAN1:   QCN5022 2.4GHz AX 2x2
  WLAN2:   QCN5052 5GHz AX 2x2
  Power:   DC 12V 2A
  Button:  Reset, Wps
  USB:     1x 3.0

Flash instructions:
  1. Download the initramfs image, rename it to
     initramfs.itb, host it with the tftp server.
  2. If the stock firmware version is 4.3.0.r4211
     or higher, enter "jdmt018R" to interrupt
     U-Boot when the following statement appears:
     "disabled console and autoboot in 2 seconds"
  3. Run these commands in U-Boot console:
     tftpboot initramfs.itb
     bootm
  4. After openwrt boots up, use scp or luci web
     to upload sysupgrade.bin to upgrade.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/19780
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-17 16:18:13 +01:00
George Moussalem
9d1f6ec49d qualcommax: ipq50xx: match QDSK ports unit address with port id
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Match the unit address of both QSDK switch ports with the node's port_id
property. Purely cleanup, no functional change.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21456
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-16 19:46:45 +01:00
Eric Fahlgren
63c2add66e realtek: imagebuilder: add guard around loader generation
The imagebuilder cannot compile source, so we must guard against
generation of artifact targets that require this.  Without this
guard we see an error when building the zyxel,gs1920-24hp-v1 profile.

  Create standalone rt-loader, loading uimage from address 0xb40c0000
  mips-openwrt-linux-musl-gcc -fpic -msoft-float -Iinclude -c -o ... src/startup.S
  make[4]: mips-openwrt-linux-musl-gcc: No such file or directory

Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21556
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-16 19:45:45 +01:00
Paul Spooren
8cff0d8ca0 ci: rework and move build-on-comment action
Run this only when a PR is created, so either author or anyone who can
edit the PR message (all maintainers) can trigger such build.

Instead of maintaining it in the main repository, move it to the
external repository to bloat this repository less with further CI
commits.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-01-16 18:42:20 +07:00
Steffen Förster
66b6791abe ramips: fix gmac definition for cudy ap1300 outdoor
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The gmac definition has an offset of 1 at the moment. This leads to an
off by one error in downstream projects that rely on the package label mac.

Signed-off-by: Steffen Förster <nemesis@chemnitz.freifunk.net>
Link: https://github.com/openwrt/openwrt/pull/21543
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 23:08:37 +01:00
Markus Stockhausen
63c596f46c realtek: eth: convert prefix of net_device_ops
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Rename some of the net_device_ops to the new driver prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21476
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 23:06:02 +01:00
Markus Stockhausen
7073fb4657 realtek: eth: adapt prefix of tx functions
Rename transmit related functions with the new prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21476
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 23:06:02 +01:00
Markus Stockhausen
53b6593f04 realtek: eth: adapt prefix for mac functions
Convert the mac functions to the new prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21476
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 23:06:02 +01:00
Markus Stockhausen
bca14f3a02 realtek: eth: convert tag decoder/encoder to new prefix
Rename the header tag encoding/decoding functions according
to the new prefix naming convention.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21476
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 23:06:02 +01:00
Markus Stockhausen
a3003725e8 realtek: eth: rename priv to ctrl (as in other drivers)
All Realtek drivers use ctrl (control) als the central driver
structure. Align that for the ethernet driver. Additionally
use the rteth prefix for the device independent structure
definition. Its current prefix "rtl838x_" is only confusing.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21476
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 23:06:02 +01:00
Val Kulkov
c7f585bfc3 wifi-scripts: fix wifi failure on specifying value of DAE client
Some checks failed
Build all core packages / Build all core packages for selected target (push) Has been cancelled
The code to be replaced is a glorious no-op. A default value for
config.radius_das_client does not need to be assigned. This parameter
already has non-empty value: see the enclosing 'if' block.

As a result, the value of config.radius_das_client never gets modified
to contain both dae_client and dae_secret. This breaks hostapd.add_iface()
that expects config.radius_das_client to contain both dae_client and
dae_secret separated by a whitespace.

Fixes: #21519
Signed-off-by: Val Kulkov <val.kulkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21522
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 21:09:36 +01:00
Stijn Tintel
bd1cf1b18a uboot-rockchip: bump to 2026.01
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Drop upstreamed patches, refresh others.

Tested on Radxa ROCK 5B+.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-15 16:33:26 +02:00
Stijn Tintel
0d8e4ebeb9 arm-trusted-firmware-rockchip: bump to 2.14.0
Tested on Radxa ROCK 5B+.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-15 16:33:26 +02:00
Markus Stockhausen
168f5609af realtek: rt-loader: fix chip revision printout
There is currently a mismatch in the detection of the chip type.
rt-loader and the kernel give different revisions. E.g.

rt-loader: Running on RTL9313 (chip id 6567A) with 256MB
kernel: Realtek RTL9313 rev B (6567) SoC with 256 MB

Realtek internal version numbering is

- for RTL838x: 1=A, 2=B, ...
- for others: 0=A, 1=B, ...

rt-loader does not differentiate that. Adapt the calculation to
give a consistent picture.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21498
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-15 15:27:49 +01:00
Markus Stockhausen
10ae743260 realtek: phy: simplify RTL8214FC configuration
Initialization of the RTL8214FC was coded like "put the cart
before the horse". Configuration was called from probing
and only when called for the last port.

Testing showed that there is no need to overcomplicate things.
Reorganize the setup as follows:

- Let probe() & config() do what they are meant for
- Split the config part between a package and a port sequence

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21508
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-15 15:26:44 +01:00
Markus Stockhausen
1e3139d483 realtek: phy: drop unused firmware setup for RTL8214FC
The RTL8214FC is initialized with a minimum driver sequence.
The firmware usage has been made obsolete. Drop leftovers.
These include:

- old code
- firmware file
- kernel config (to include the firmware file into the build)

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21508
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-15 15:26:44 +01:00
Markus Stockhausen
2c2817d3a4 realtek: phy: Use single initialization for RTL8214FC
There are currently two code paths to initialize the RTL8214FC. One is
for RTL838x, the other for RTL839x. With the recently added minimum
setup sequence the phy will come up and pass traffic on any device.
Use this als the reference implementation and drop the usage of the
magic firmware based setup.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21508
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-15 15:26:44 +01:00
Markus Stockhausen
d891c747fc realtek: dts: fix Zyxel GS1920 port section
For the GS1920 the build system throws errors like

../dts/rtl8392_zyxel_gs1920-24hp-v1.dts:256.19-29:
Warning (reg_format): /switch@1b000000/ports/port@0:reg:
property has invalid length (4 bytes)
(#address-cells == 2, #size-cells == 1)

The dts misses the address and size properties for the
ports section. Fix that.

Fixes: 2a55846 ("realtek: add support for ZyXEL GS1920-24HPv1")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21534
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-15 15:22:39 +01:00
John Audia
226981d49c kernel: bump 6.12 to 6.12.65
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.65

Manually rebased:
  generic/hack-6.12/904-debloat_dma_buf.patch
  econet/patches-6.12/010-v6.16-MAINTAINERS-Add-entry-for-newly-added-EcoNet-platfor.patch

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21431
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 01:22:47 +01:00
John Audia
ba6b07a4ab kernel: bump 6.12 to 6.12.64
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.64

Manually rebased:
  bcm27xx/patches-6.12/950-0019-BCM2708-Add-core-Device-Tree-support.patch
  bcm27xx/patches-6.12/950-0446-i2c-designware-Add-support-for-bus-clear-feature.patch
  bcm27xx/patches-6.12/950-0875-PCI-brcmstb-Add-bcm2712-support.patch
  ipq40xx/patches-6.12/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch

Removed upstreamed:
  generic-backport/403-v6.19-mtd-mtdpart-ignore-error-ENOENT-from-parsers-on-subp.patch[1]
  bcm27xx/patches-6.12/950-0873-PCI-brcmstb-Reuse-config-structure.patch[2]
  bcm27xx/patches-6.12/950-0888-PCI-brcmstb-don-t-use-ASPM-state-defines-for-registe.patch[3]
  bcm27xx/patches-6.12/950-0951-media-i2c-imx219-Restore-the-1920x1080-to-using-a-1-.patch[4]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.64&id=846ceb1a94460f7331e879c02ff2dd505435b51b
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.64&id=8d185636a6299ff9d2e9eec3a4a25026c13d2351
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.64&id=38aa6ca6285ff76a7570e5b9acd1151f5cea783a
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.64&id=620f9d7bcf771b532bce67ffecf2d97759a4747f

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3
Run-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Co-Authored-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/21431
[Fixed: 950-0019-BCM2708-Add-core-Device-Tree-support.patch]
[remove 950-0888-PCI-brcmstb-don-t-use-ASPM-state-defines-for-registe.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 01:22:47 +01:00
Hauke Mehrtens
39700aeaa1 bcm27xx: refresh kernel patches
The patch 950-0019-BCM2708-Add-core-Device-Tree-support.patch creates a
symbolic link. It looks like quilt does not support this and never
refreshed it.

I removed the symbolic link, refreshed the patch and then added it
back again.

Link: https://github.com/openwrt/openwrt/pull/21431
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 01:21:41 +01:00
John Audia
5b887135ba mac80211: fix build for 6.12.64 bump
Disable the backport shim on 6.12.64 and newer where the function
is provided by the kernel.

References:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/hrtimer.h?h=v6.12.64&id=12493e7e888d266453d1c3898dc160178749afb3
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/hrtimer.h?h=v6.12.64&id=d579cc549298a02ba90b7a6d20a2ba8e160f3f31

Co-Authored-by: Pascal Ernster <git@hardfalcon.net>
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21431
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-15 00:42:28 +01:00
Álvaro Fernández Rojas
e1c125c167 netifd: use stable IAID for DHCPv4
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Commit 9151c7015e introduced support for the global DHCP DUID to
generate a RFC4361-style client identifier.
However, the IAID introduced in those changes is based on ifindex, which
is subject to changes and causes issues on environments requiring a stable
IAID.

This commit switches the IAID to a stable one based on MD5.

Fixes: 9151c7015e ("netifd: use the global DHCP DUID for DHCPv4")
Link: https://github.com/openwrt/openwrt/pull/21489
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2026-01-14 18:07:38 +01:00
Álvaro Fernández Rojas
e1f2b666ff base-files: introduce a function to generate IAID
Add new function "network_generate_iface_iaid()" to generate a stable IAID
from an interface name.

Link: https://github.com/openwrt/openwrt/pull/21489
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2026-01-14 18:07:27 +01:00
Aleksander Jan Bajkowski
4953db3aef airoha: show link rate and duplex
Implement the .get_link_ksettings to get the rate, duplex, and
auto-negotiation status.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/21530
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-14 18:03:12 +01:00
FUKAUMI Naoki
43039157ba rockchip: add "compat_version": "1.1" for Radxa E52C
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This is something I missed in https://github.com/openwrt/openwrt/pull/20608

Fixes: 1f1db75432 ("rockchip: make NIC name predictable for Radxa E52C/ROCK 5 ITX/ROCK 5T")
Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Link: https://github.com/openwrt/openwrt/pull/21533
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-14 11:20:00 +01:00
Stijn Tintel
cb82479475 kernel: add kmod-hwmon-adt7470
This driver supports the ADT7470 thermal monitoring chip, which is used
in the ECS4100-12PH switch.

Fixes: fa9f925951 ("realtek/rtl839x: Edgecore ECS4100-12PH support")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Link: https://github.com/openwrt/openwrt/pull/21505
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-14 10:43:15 +01:00
Hauke Mehrtens
f6429413d9 libiwinfo: update to Git HEAD (2026-01-14)
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
f5dd57a84cc3 nl80211: fix 5Ghz frequency calculations

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-14 00:35:07 +01:00
Pawel Dembicki
a73db6d0a0 mpc85xx: fix failsafe iface selection for mpc85xx boards
Some mpc85xx boards still boot with failsafe configured on a non-LAN
interface. Align the preinit interface with the first DSA port or the
interface that LAN is connected to.

This makes failsafe reachable on devices where the default selection does
not map to the primary LAN port.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21516
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-14 00:26:31 +01:00
Fil Dunsky
6ff4557317 mediatek: add support for Airpi AP3000M
This adds support for the Airpi AP3000M 5G CPE based on MediaTek MT7981B.

Specifications:

SoC: MediaTek MT7981B (dual-core ARM Cortex-A53)
RAM: 1GB DDR4
Storage: 8GB or 16GB eMMC
Ethernet: 1x 2.5GbE LAN, 1x 1GbE WAN
Wireless: 2.4GHz/5GHz 802.11ax
Buttons: Reset, WPS
LEDs: System, 2.4GHz WiFi, 5GHz WiFi
Cooling: PWM-controlled fan
Expansion: M.2 slot for 5G modem

The factory partition (mmcblk0p2) is empty in stock firmware.
Execute via SSH before flashing OpenWrt:
```
dd if=/lib/firmware/MT7981_iPAiLNA_EEPROM.bin of=/dev/mmcblk0p2 bs=4k count=1
MAC addresses
```
Fixed MAC addresses are derived by macaddr_generate_from_mmc_cid.

Installation via U-Boot web page

Set static IP 192.168.88.2/255.255.255.0 on your computer.
Connect to the 1GbE port (WAN) and hold the reset button while booting the device. Wait for about 6 seconds, and release the reset button.
Open U-boot web page on your browser at http://192.168.88.1
Select the OpenWRT sysupgrade image, upload it, and start the upgrade.
Wait for automatic reboot.
Installation via sysupgrade

Flash the sysupgrade file via LuCI upgrade page without saving the settings.

Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21397
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-14 00:16:34 +01:00
George Sapkin
31cdd13d22 imagebuilder: add ABI suffix to packages when using apk
If an apk package with an ABI version doesn't have priority set, it
can't be selected by its base name:

$ make manifest PACKAGES='libustream-openssl libsqlite3'
ERROR: unable to select packages:
  libsqlite3 (virtual):
    note: please select one of the 'provided by'
          packages explicitly
    provided by: libsqlite3-0
    required by: world[libsqlite3]
  libustream-openssl (virtual):
    note: please select one of the 'provided by'
          packages explicitly
    provided by: libustream-openssl20201210
    required by: world[libustream-openssl]

Look up the ABI version in apk index and if present, add an ABI suffix
to all requested packages.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21449
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-13 10:20:24 +01:00
Jakub Vaněk
02f0efd60b mediatek: fix PHY autodetection on Cudy WR3000H
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Newer Cudy WR3000H units have a Motorcomm YT8821 PHY instead of a
Realtek PHY on the WAN port. Before this commit, the Motorcomm PHY
could not be autodetected by the kernel -- the PHY would show up as
just a generic clause 45 PHY and the proper driver would not be loaded.

The cause of the detection failure likely was that the YT8821 PHY was
held in reset during PHY detection. To fix this, move the reset GPIO
definition to the MDIO bus level. This reset line is deasserted before
the autodetection process, see also [1]. With this change, both Realtek
and Motorcomm PHYs can be supported with a single device tree.

[1]: https://lore.kernel.org/all/20251119134750.394655-1-horatiu.vultur@microchip.com/

Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21399
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-13 00:18:04 +01:00
Andrew MacIntyre
dbafbab876 mediatek: add Motorcomm PHY driver to Cudy WR3000H
Recent Cudy WR3000H v1 units have a Motorcomm YT8821 2.5G PHY for
the WAN interface instead of the RTL8221B PHY used in earlier units,
so add kmod-phy-motorcomm to be able to use it.

Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
[linuxtardis@gmail.com: slightly reworded the commit description]
Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21399
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-13 00:18:04 +01:00
Andrew MacIntyre
96a1337374 kernel: add kmod-phy-motorcomm
The Motorcomm YT8821 2.5G PHY is being used in some devices as an
alternative to devices like the RTL8221B.  Package it as a kmod
so it can be used as a device package rather than requiring changes
to the target kernel config.

Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
Link: https://github.com/openwrt/openwrt/pull/21399
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-13 00:18:04 +01:00
Robert Marko
082fe669f7 boot: arm-trusted-firmware-microchipsw: depend on host Ruby
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Microchip ATF depends on Ruby scripts to generate the FWU monitor HTML
and more, so make sure that host Ruby is available.

We also need to call the scripts directly via Ruby executable as shebang
wont work due to lack of Ruby in the Buildbot container.

Fixes: 5205c0c426 ("microchipsw: lan969x: add Microchip EV23X71A")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-12 18:01:17 +01:00
Robert Marko
410277ca12 boot: arm-trusted-firmware-microchipsw: fix compilation against LibreSSL
LibreSSL 3.9+ has dropped support for X509V3 extension API so cert_create
tool does not compile against it at all.

This was hidden by the fact that it was compiling against OpenSSL on my
host which still has that API, however we do not ship libssl-dev in the
Buildbot containers so compiling against distro OpenSSL is not possible.

So, after a long time trying to find any docs on that API I resorted to
LLM(Gemini 3 Pro) to get it to compile.

Our libcrypto is linked against pthread so we must pass -lpthread as well
for cert_tool.

Fixes: 5205c0c426 ("microchipsw: lan969x: add Microchip EV23X71A")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-12 18:01:11 +01:00
Markus Stockhausen
5c5823afdc realtek: mdio: drop interfaces attribute
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
The interfaces attribute of the mdio bus held the information
about the connection mode (qsgmii, sgmii, ...). This was only
used during the old RTL930x setup. Drop it because it is not
needed any longer.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21469
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 15:43:35 +02:00
Markus Stockhausen
b2717357a7 realtek: mdio: Simplify RTL930x phy polling setup
Cleanup the RTL930x polling setup. Make use of the
new phy fixup helper to initialize the polling registers.

As an integral update to the logic before only write
register bits that are really in scope. This might save
some bits set by U-Boot.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21469
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 15:43:03 +02:00
Markus Stockhausen
93711307e0 realtek: mdio: provide phy info helper
The mdio driver currently initializes the phy polling registers
with some nasty magic. It identifies the interface mode from the
dts and draws some strange conclusions.

Looking at the SDK one can see that this is basically dependent
of the attached phy type. So the code location is quite right
inside the mdio driver.

Provide a new get_phy_info() function that determines the phy
characteristics that are important for the polling unit . It will
be later needed by the RTL93xx setup code.

Some explanation about the fields of the structure:

- has_res_reg: phy has a special Realtek resolution polling
  register. It is unclear if this gives more details or if it
  simply allows faster polling.

- has_giga_lite: This is a phy that allows for Realtek proprietary
  1G/2.5G lite connectivity. In this case data is only transmitted
  over two wire pairs.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21469
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 15:43:03 +02:00
Markus Stockhausen
4acbbf6f05 realtek: mdio: improve iterator readability
Currently there are several places where the driver uses the
classic "i" as iterator. In these cases where it iterates
phy ports use "addr" instead to make it easier to read. Do
the same for the smi bus. Additionally forthcomming commits
will show nicer diffs.

While we are here fix the initialization sequence of the private
structure. There is no need to set data to zero that has already
been zero-allocated before. Instead initialize smi_bus[] with
a value of "-1" to denote that a phy is not in scope. This is
essential as some functions already have a matching check in
place.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21469
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 15:43:03 +02:00
George Sapkin
470e030a5e build: add default priority to ABI-versioned packages
If a package has an ABI version defined, set priority to 10. The enables
packages with an ABI version to be installed by their base name instead
of a name and an ABI version, e.g.:

libfoo3, where 3 is the ABI version can be installed by just libfoo.

This affects manual installation only, as the dependency resolution
takes care of ABI versions.

Refactor apk priority logic into a helper define.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
1dec4683f6 build: remove redundant shebang from apk lifecycle scripts
Due to the way apk lifecycle scripts are defined, they might end up with
multiple shebangs. Remove them.

Before:

  post-upgrade: |
    #!/bin/sh
    export PKG_UPGRADE=1
    #!/bin/sh
    [ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
    [ -s ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
    . ${IPKG_INSTROOT}/lib/functions.sh
    export root="${IPKG_INSTROOT}"
    export pkgname="adblock-fast"
    add_group_and_user
    default_postinst
    #!/bin/sh
    # check if we are on real system
    if [ -z "${IPKG_INSTROOT}" ]; then
    	/etc/init.d/adblock-fast enable
    fi
    exit 0

After:

  post-upgrade: |
    #!/bin/sh
    export PKG_UPGRADE=1
    [ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
    [ -s ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
    . ${IPKG_INSTROOT}/lib/functions.sh
    export root="${IPKG_INSTROOT}"
    export pkgname="adblock-fast"
    add_group_and_user
    default_postinst
    # check if we are on real system
    if [ -z "${IPKG_INSTROOT}" ]; then
    	/etc/init.d/adblock-fast enable
    fi
    exit 0

Fixes: b52e897 ("include/package-pack: remove leading whitespace from install scripts")
Fixes: 03880e2 ("include/package-pack: add missing apk package lifecycle events")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
2d844a0770 build: fix implicit self-provides
Fix setting implicit self-provides for packages when they don't have any
PROVIDES specified.

Remove redundant self-provide for kmods, since kmods are packages and
will have a self-provide added already.

Fixes: 5ed650a ("build: add support for virtual provides")
Fixes: 9b37b71 ("build: provide virtual self in kmods")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
8cc2743c48 elfutils: drop libelf1 provide
ABI version is added to a package name during packaging, so there's no
need to specify it manually. And nothing explicitly depends on libelf1.

Fixes: d7bf089 ("elfutils: rename libelf1 to libelf")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
af1fa176c3 uclient: provide virtual wget-any
Packages shouldn't provide a package that another package, in this case
wget from packages provides. Explicitly provide a virtual @wget-any
instead to match the implicit wget provide and switch the only consumer
to use the new provider.

Set uclient-fetch as the default variant for wget-any.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
952c918028 build: fix provides logic when ABI version is set
Same as for the base package name, when a package has an ABI version,
provide both unversioned provider in addition to one with ABI version
and version.

So for each provide instead of providing only:

$provide$ABI_version=$package_version

now provide:

$provide $provide$ABI_version=$package_version

When a provide ends in a number, the ABI version will be prefixed with
a - sign, e.g.: provide1-0

Fixes: 18029977 ("build: fix apk packaging and ABI-versioning")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
779fa7ff6c build: refactor dependency formatting
Refactor dependencies and extra dependencies logic into a helper define
and document it.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
2a1977a4b8 build: don't auto mark all provides as virtual
Don't mark all provides as virtual when ALTERNATIVES is set.
Automatically marking all provides as virtual prevents variants from
conflicting between each other. Alternatives have nothing to do with
packaging and packages are expected to manage their own provides.

Updated internal provides explanation.

Remove unnecessary back slashes from FormatProvides.

Fixes: 18029977 ("build: fix apk packaging and ABI-versioning")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
George Sapkin
49fc319033 build: remove default provider priority
Remove default provider priority since packages are expected to
explicitly declare virtual provides and set default variants. With
default priority some package variants without PROVIDES and not marked
as default end up with priority 0 and are not picked for installation.

Before the change dnsmasq-dhcpv6 is selected for dnsmasq, because the
former has higher priority:

name <dnsmasq> selected from selectable list
select_package: dnsmasq (requirers=1, autosel=1, iif=0, order_id=0x4000005f)
  consider dnsmasq-2.91-r2 iif_triggered=0, tag_ok=1, selectable=1, available=1, flags=0x0, provider_priority=0, installed=0
   prefer existing package
    choose as new provider
  consider dnsmasq-dhcpv6-2.91-r2 iif_triggered=0, tag_ok=1, selectable=1, available=1, flags=0x0, provider_priority=1, installed=0
    prefer highest declared provider priority
    choose as new provider
  consider dnsmasq-full-2.91-r2 iif_triggered=0, tag_ok=1, selectable=1, available=1, flags=0x0, provider_priority=1, installed=0
    prefer lowest available repository
selecting: dnsmasq-dhcpv6-2.91-r2, available: 1
assign dnsmasq-dhcpv6 to dnsmasq-dhcpv6-2.91-r2
assign dnsmasq to dnsmasq-dhcpv6-2.91-r2
disqualify_package: dnsmasq-2.91-r2 (conflicting provides)
disqualify_package: dnsmasq-full-2.91-r2 (conflicting provides)
    apply_constraint: libc
    apply_constraint: provider: libc-1.2.5-r5: 1

After the change dnsmasq is selected for dnsmasq based on
lexicographical order:

name <dnsmasq> selected from selectable list
select_package: dnsmasq (requirers=1, autosel=1, iif=0, order_id=0x4000005f)
  consider dnsmasq-2.91-r2 iif_triggered=0, tag_ok=1, selectable=1, available=1, flags=0x0, provider_priority=0, installed=0
   prefer existing package
    choose as new provider
  consider dnsmasq-dhcpv6-2.91-r2 iif_triggered=0, tag_ok=1, selectable=1, available=1, flags=0x0, provider_priority=0, installed=0
    prefer lowest available repository
  consider dnsmasq-full-2.91-r2 iif_triggered=0, tag_ok=1, selectable=1, available=1, flags=0x0, provider_priority=0, installed=0
    prefer lowest available repository
selecting: dnsmasq-2.91-r2, available: 1
assign dnsmasq to dnsmasq-2.91-r2
disqualify_package: dnsmasq-dhcpv6-2.91-r2 (conflicting provides)
disqualify_package: dnsmasq-full-2.91-r2 (conflicting provides)
    apply_constraint: libc
    apply_constraint: provider: libc-1.2.5-r5: 1

Fixes: dea8397 ("include/package-pack: add default 'provider_priority' for APK packages")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 14:28:52 +01:00
Markus Stockhausen
80dbf932a3 realtek: eth: remove mdio leftovers
The mdio driver was carved out from the ethernet driver long
ago. Remove some leftover defines.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21502
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 15:13:32 +02:00
Pawel Dembicki
20727f89d5 package: uboot-qoriq: fix T4240RDB u-boot selection
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Mark T4240RDB u-boot variants as device-built and avoid installing them into rootfs.

Without this buildbot crashes during package install with:

ERROR: unable to select packages:

  u-boot-fsl_T4240RDB-nor (no such package):

    required by: world[u-boot-fsl_T4240RDB-nor]

  u-boot-fsl_T4240RDB-sdboot (no such package):

    required by: world[u-boot-fsl_T4240RDB-sdboot]

Fixes: c5d3d5fe28 ("package: u-boot: initial support for qoriq arch")
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21514
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-12 13:59:30 +01:00
Carl-Daniel Hailfinger
19b8d391a9 realtek: ethernet: avoid using unitialized memory
The mac_addr variable was not zero-initialized, causing weird side effects
when the memory contents were a valid MAC address.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Link: https://github.com/openwrt/openwrt/pull/21504
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 14:47:39 +02:00
Carl-Daniel Hailfinger
a91c3abe83 realtek: dsa: avoid use-after-free
The realtek target uses some functions marked __init for initialization.
However, that means they can only be called once when compiled in and
afterwards the memory occupied by them is freed and potentially reused.
Some "impossible" (code at a given location can't crash in the way it
does) crashes can be caused by this because upon re-execution of those
functions, garbage gets executed. Such re-execution can happen for
deferred probes or repeated probes.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Link: https://github.com/openwrt/openwrt/pull/21504
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 14:47:39 +02:00
Daniel Golle
6ac605e4c6 kernel: net: phy: mxl-gpy: replace patch with upstream commit
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Replace accepted patch with backported upstream commit and refresh
patches.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-12 03:27:25 +00:00
Markus Stockhausen
0bab65dfa7 realtek: phy: add RTL8214FC initialization for RTL839x
Until now the RTL8214FC is initialized either by U-Boot (all
devices) or by some magic firmware file (RTL838x). On RTL839x
devices without U-Boot (e.g. ZyXEL GS1920) this PHY cannot
be used.

Provide the most basic setup sequence for RTL839x so that
copper/fiber work. Later it can be taken over for all devices
and the firmware helpers can be dropped.

Remark! This should not (but might) break RTL839x devices with
RTL8214FC U-Boot setup.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21435
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 04:44:48 +02:00
Markus Stockhausen
4fa90d879b realtek: phy: enhance RTL8218B initialization
The RTL8214FC and the RTL8218B share the same register set and
need to be initialized quite similar. In the future the RTl8214FC
will get its own setup sequence. To keep the codebase small the
common parts (serdes & copper) will be covered by the existing
RTL8218B configuration.

Enhance the RTL8218B setup with this separate commit to ensure
that nothing breaks.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21435
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 04:44:48 +02:00
Markus Stockhausen
b209174c43 realtek: phy: use lock helpers
No need to open code bus locking.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21435
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-12 04:44:48 +02:00
Rany Hany
9b1b5a6aec wifi-scripts: move no_probe_resp_if_max_sta to wifi-iface
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
It is a BSS-level option and not radio-level. As such,
move it to wifi-iface and ap.uc.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/21412
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 20:21:54 +01:00
Til Kaiser
9653fd423b kernel: modules: add kmod-pmbus-sensors package
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Introduce the kmod-pmbus-sensors package to provide the
generic PMBus hwmon driver (CONFIG_SENSORS_PMBUS).

This enables support for a wide range of PMBus-based devices
including ADP4000, BMR310, BMR480, MAX20796, TPS544B25, and others.

Signed-off-by: Til Kaiser <mail@tk154.de>
Link: https://github.com/openwrt/openwrt/pull/21444
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 19:40:08 +01:00
Eric Fahlgren
54c7ad8d8a base-files: uci-defaults: migrate time zonename on upgrade
Timezone names no longer allow spaces, so older installations
upgrading to new will have their timezone reset to UTC.

For example, on 24.10:
  $ uci get system.@system[0].zonename
  America/Los Angeles

After upgrade to 25.12:
  $ uci get system.@system[0].zonename
  UTC

Add a migration script to edit zonename on first boot.

Fixes: https://github.com/openwrt/luci/commit/d9a087e4
Link: https://github.com/openwrt/luci/issues/8203
Link: https://forum.openwrt.org/t/openwrt-25-12-0-rc1-release-candidate/244364/98
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-11 19:12:41 +01:00
Leo Barsky
cffc2a9102 econet: refresh patches 6.12
Manually rebased:
econet/patches-6.12/901-nand-enable-en75-bbt.patch

Fixes: 5230157a16 ("kernel: QCOM SPI NAND: backport multiple fixes")
Signed-off-by: Leo Barsky <leobrsky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21500
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-11 19:09:32 +01:00
Anari Jalakas
4ff0f496a4 readline: add $(FPIC) to LDFLAGS
Ensure -fPIC is passed during the linking stage to fix LTO build
failures (relocation errors) on MIPS and other architectures.

Fixes: #20436
Signed-off-by: Anari Jalakas <anari.jalakas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21455
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-11 18:49:55 +01:00
Rany Hany
ee60b65643 wifi-scripts: ucode: fix RRM defaults
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
They are being default enabled unconditionally when they should
depend on 802.11k. 802.11k should not be enabled by default
either as it can cause issues with certain older drivers and
is useless without a userspace program like usteer or DAWN.

If users want to enable 802.11k they will enable it when they
set such programs up.

Another inconsistency with rnr was dealt with so that it is not
default enabled. This is also not done with old wifi-scripts
and is generally unexpected and surprising behavior.

Moreoever, this introduces an inconsistency between old shell
wifi-scripts and ucode version. Old wifi-scripts does not do this.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/21425
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 17:24:59 +01:00
Stijn Tintel
f7c5334c4c kernel: cleanup CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Commit ab805ec316 ("generic: add missing squashfs config") enabled
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU in the generic config, so it is no
longer needed in the target configs.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Link: https://github.com/openwrt/openwrt/pull/21465
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 12:52:54 +01:00
Jonas Jelonek
e4fd28e989 realtek: pcs: rtl838x: use SerDes hardware modes
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Switch RTL838X SerDes setup to use the internal SerDes hardware modes
instead of the PHY_INTERFACE_MODE_* modes.

Use the generic mapper in the beginning of the SerDes setup and convert
all affected functions to the different mode type. This will be moved
out to the generic pcs_config later.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21480
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 11:13:42 +01:00
Jonas Jelonek
f47453863f realtek: pcs: drop legacy comment and warning
We finally reached the point where PCS has full control over SerDes and
no parts of this are scattered in other drivers anymore. To make that
clear, drop the comment in pcs_config that explains this former state
and remove a warning which states that pcs_config isn't fully
implemented yet.

Add a generic output to at least keep a generic sign of life from the
PCS driver, independently from what the variant-specific code currently
prints.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21481
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 11:13:09 +01:00
Jonas Jelonek
dc78b80f4a realtek: phy: add comment to firmware file definition
Add a comment stating the situation around a specific RTL838x firmware
file. After SerDes setup has been moved to the PCS driver, this firmware
file is partially unused. If the remaining bits are pulled out or just
replaced, this firmware file can be dropped. The comment ensures that we
do not forget about that.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21481
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 11:13:09 +01:00
Jonas Jelonek
0917569dc2 realtek: eth: remove unused SerDes defines
Remove some unused defines for SerDes in the ethernet driver. They have
been missed before but are completely out of place here now.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21481
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 11:13:09 +01:00
Robert Marko
93665d0aa3 linux: crypto: fix dependencies for curve25519 and poly1305
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Currently, kmod-crypto-kpp is only implied for curve25519 and thus it
can get unselected and then building will fail due to missing kpp.ko.

Same issue happens with kmod-crypto-hash for poly1305.

So, lets drop the whole implies logic and make sure to always select
them as dependencies.

Fixes: #21386
Link: https://github.com/openwrt/openwrt/pull/21483
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-11 00:25:06 +01:00
Thomas Perale
dd519f6c05 ppp: update deprecated cpe
The CPE 'samba:ppp' added in OpenWrt commit [1], has been deprecated in
favour of 'point-to-point_protocol_project:point-to-point_protocol'
(see [2]).

[1] c61a239514 add PKG_CPE_ID ids to package and tools
[2] https://nvd.nist.gov/products/cpe/detail/1224B76D-6BB3-4088-9F42-23AC04A764F2

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Link: https://github.com/openwrt/openwrt/pull/21441
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-11 00:16:11 +01:00
Andreas Böhler
2a55846bf4 realtek: add support for ZyXEL GS1920-24HPv1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
The GS1920-24HPv1 is a switch with 24 copper ports and 4 combo SFP/copper
ports and PoE on the first 24 ports.

Specifications:
---------------
  * SoC: Realtek RTL8292M
  * Flash: 16 MiB SPI flash
  * RAM: 128 MiB
  * Ethernet: 24x 10/100/1000 Mbps
  * Buttons: 1x "Reset" button
  * UART: 1x serial header, standard DCE pinout (Tx = 2, Rx = 3, Gnd = 5);
          9600 baud, 8n1, +- 5.6V logic levels
  * SFP: 4 combo copper/SFP ports
  * PoE: 24x
  * Fans: ADT7468 fan controller

Works:
------
  - (24) RJ-45 ethernet ports
  - Switch functions
  - Buttons
  - LEDs (partial support, the wrong LEDs light up)
  - Manual fan control

Not yet enabled:
----------------
  - PoE (requires patches to realtek-poe to support i2c)
  - Combo ports (link is up, but no data is transferred)

Fans:
-----
After boot, the fans are running in full speed mode. You can interact
with the fan controller at /sys/class/hwmon/

Installation:
-------------

This device uses ZyNOS instead of Linux, this makes installation a bit
more cumbersome. Serial console is required!

1. Set the switch to boot from the first image. This step is crucial,
   it will fail to boot if this is not set properly.

2. Connect to the switch using serial and interrupt the boot process
   to enter debug/recovery mode.

3. Load the OpenWrt initramfs image via XMODEM. You need to obtain an
   unlock code, based on your MAC address, first. See the excellent write
   up at https://www.ixo.de/info/zyxel_uclinux/ for details. Replace
   unlock_code in the commands below by the code obtained.
   After running ATBA5, the terminal needs to be closed and re-opened
   with 115200 baud. This speeds up the file transfer significantly!
   The file length in bytes need to be given instead of file_length below.
   You also need an XMODEM upload utility like "lrzsz-sx -X" to transfer
   the file. Start the XMODEM upload after running the ATUPxxxx command:

     > ATEN1,unlock_code
     > ATBA5
     > ATUP80100000,file_length
     > ATGO80100000

4. Wait for OpenWrt to boot. Once this is done, transfer the loader binary
   and the sysupgrade image to "/tmp" using scp.

5. Install OpenWrt permanently by running the following two commands on
   the switch (over SSH):

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

6. Reboot the switch and enjoy OpenWrt.

NB: You do not need to touch the loader binary unless it's recommended.
    The loader is not part of a regular sysupgrade file and will be left
    untouched. The boot loader only checks if the loader is valid to be
    able to boot.

Recovery/ Return to stock:
--------------------------

Just spam the "u" key during (or "z" for 9600 baud) during memory testing
to trigger a recovery XMODEM upload at 115200 baud. A standard OEM upgrade
image works properly.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
Link: https://github.com/openwrt/openwrt/pull/20439
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-10 22:30:56 +01:00
Andreas Böhler
1c63273d8d realtek: Makefile: add rt-loader-standalone and zynsig recipes
This adds the build recipes for rt-loader-standalone and zynsig to the
Makefile. The recipes are required for the upcoming ZyXEL GS1920 series.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
Link: https://github.com/openwrt/openwrt/pull/20439
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-10 22:30:56 +01:00
Pawel Dembicki
6150f9ceab mpc85xx: p2020: add support for WatchGuard XTM330 (NC5AE7)
Hardware specifications:
  - CPU: Freescale/NXP P2020, dual-core PowerPC @ 1 GHz
  - RAM: 1 GB DDR3
  - Flash: 2 MB NOR, 512 MB NAND
  - Networking: 7x Gigabit Ethernet ports (via two Marvell 88E6171
    switches,  each attached to a different MAC)
  - USB: 2x USB 2.0 ports (front panel)
  - mini-PCIe slot
  - RTC: Ricoh RS5C372A
  - 4 buttons (via external MCU)
  - 3 LEDs (via external MCU)
  - LCD display (via external MCU)

Installation procedure:

1. Obtain the original MAC address table from the stock bootlog, for
   example:

     setting device eth0 to 00:90:7f:00:00:01
     setting device eth1 to 00:90:7f:00:00:02
     setting device eth2 to 00:90:7f:00:00:03
     setting device eth3 to 00:90:7f:00:00:04
     setting device eth4 to 00:90:7f:00:00:05
     setting device eth5 to 00:90:7f:00:00:06
     setting device eth6 to 00:90:7f:00:00:07

2. Open the case and move jumper JP1 from 2-3 to 1-2 to enter FAILSAFE
   mode.
3. Power on the device and interrupt the boot process to access the U-Boot
   shell.
4. Program the MAC base address into the EEPROM (text after '#' is a
   comment):

     mac ports 3
     mac 2 00:90:7f:00:00:01   # first MAC address from bootlog
     mac save

5. Reset the device and enter the U-Boot console again.
6. Connect a TFTP server to port 6 and boot the initramfs image:

     setenv ipaddr 192.168.1.3
     setenv serverip 192.168.1.2
     setenv loadaddr 1000000
     tftpboot $loadaddr openwrt-mpc85xx-p2020-watchguard_xtm330-initramfs-kernel.bin
     bootm $loadaddr

7. (Optional) Backup all MTD partitions if you want the ability to restore
   stock firmware.
8. Perform a normal sysupgrade from the initramfs environment.
9. Power off the device and move jumper JP1 back to 2-3.
10. The device will now boot OpenWrt.

Known issues:
  - LCD, buttons and LEDs are controlled by an external MCU; the protocol is
    currently unknown.
  - The internal connection between the two Marvell switches is unused by
    OpenWrt.
  - The stock firmware uses an empty U-Boot environment; saving variables
    modifies the environment and prevents a normal boot. FAILSAFE U-Boot
    remains functional.
  - WatchGuard configuration is encrypted; DSA MAC addresses are stored in
    this configuration.
  - Failsafe Ethernet works on port1.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21020
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-10 21:30:58 +01:00
Yanase Yuki
e4b8d3f294 projectsmirrors: switch to HTTPS
apache.mirrors.ovh.net supports HTTPS,
so let's use it.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21268
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-10 19:52:23 +01:00
Yanase Yuki
b378868a39 projectsmirrors: drop some sites
This commit drop ftp.nara.wide.ad.jp and
www.ring.gr.jp from projectsmirrors.

These mirrors only supports plain HTTP.
Drop mirrors that does no meet modern
security standards.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21268
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-10 19:52:23 +01:00
JINLIANG GU
89d982d723 netifd: dhcp: suppress udhcpc default vendor class if specified in sendopts
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
When DHCP Option 60 is specified via sendopts (hex, decimal, or named
formats), udhcpc sends its default "udhcp <version>" string alongside
the custom value, which causes authentication failures with some ISPs.

This fix detects Option 60 in sendopts and automatically passes -V ""
to udhcpc to suppress the default version string while allowing
multiple user-defined vendor classes.

Supported formats:
- Hexadecimal: 0x3c
- Decimal: 60
- Named: vendor

Fixes: #21242
Signed-off-by: JINLIANG GU <ihipop@gmail.com>
https://github.com/openwrt/openwrt/pull/21450
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2026-01-10 13:00:15 +01:00
Goetz Goerisch
93e98b4082 feeds: revert to git.openwrt.org
This reverts the feeds.conf.default to git.openwrt.org

Fixes: 66e6ebbc1e (microchipsw: drop source-only)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21475
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-09 21:55:00 +01:00
Stijn Tintel
fa9f925951 realtek/rtl839x: Edgecore ECS4100-12PH support
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Add support for the Edgecore ECS4100-12PH, an 8-port 802.3bt PoE Gigabit
Ethernet switch with 2 combo RJ45/SFP and 2 SFP ports.

Hardware:
* SoC: RTL8393M
* RAM: 256MiB
* Flash: 32MiB SPI-NOR
* Ethernet:
  * 8x GbE RJ45 PoE (external RTL8218B)
  * 2x GbE RJ45 / SFP combo (external RTL8214FC)
  * 2x SFP (external RTL8214FC)
* Console: RJ45 RS232 port on front panel
* PoE: Nuvoton M0516 + 2x Broadcom BCM59121 PSE

Installation via bootloader:
* open serial console (baud rate 115200)
* interrupt boot process by pressing any key during boot
* boot the OpenWrt initramfs:
  # rtk network on
  # tftpboot 0x8f000000 /tftpboot/openwrt-realtek-rtl839x-edgecore_ecs4100-12ph-initramfs-kernel.bin
  # bootm
* copy openwrt-realtek-rtl839x-edgecore_ecs4100-12ph-squashfs-sysupgrade.bin
  to /tmp and use sysupgrade to install it:
  # sysupgrade /tmp/openwrt-realtek-rtl839x-edgecore_ecs4100-12ph-squashfs-sysupgrade.bin

Even though U-Boot claims the switch is based on the RTL8392M SoC, my
device is based on the RTL8393M SoC. I have confirmed this by removing
the heatsink, and the Linux kernel agrees with this. Therefore the DTS
has the rtl8393_ prefix.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 21:03:41 +02:00
Markus Stockhausen
7b351062d2 realtek: eth: move init_mac() into configuration structure
Avoid family checks where possible. Now that the init_mac()
functions are in perfect shape include them into the
configuration structure. While we are here rename them
to the new driver prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21391
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 21:03:04 +02:00
Markus Stockhausen
320e6f3188 realtek: eth: add init_mac() for RTL930x
This function does nothing at the moment. Simply add it for
completeness.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21391
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 21:03:04 +02:00
Markus Stockhausen
f8ec6a3b5f realtek: eth: reorder init_mac() functions
Move the functions close to each other and sort them.
No functional changes here.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21391
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 21:03:04 +02:00
Markus Stockhausen
7fb393fa7d realtek: eth: simplify rtl8380_init_mac()
This function is now only called on RTL838x devices. Remove all
obsolete family checks.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21391
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 21:03:04 +02:00
Markus Stockhausen
28c7524e78 realtek: eth: harmonize mac (aka chip) init
The ethernet driver must initialize the chip for proper operation.
Currently there exist functions for RTL838x, RTL839x and RTL931x.
All of them are called differently. Combine them in a central call
location.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21391
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 21:03:04 +02:00
Markus Stockhausen
985f30d576 realtek: dts: RTL93xx whitespace cleanup
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Replace spaces with tabs. No functional changes.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21474
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 20:39:50 +02:00
Jonas Jelonek
a2e49c4d72 realtek: replace remove_new with remove
Replace remove_new callback in struct platform_driver with remove. This
was just meant for a transition period. remove_new is dropped with 6.13.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21430
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 20:37:15 +02:00
Robert Marko
66e6ebbc1e microchipsw: drop source-only
Now that there is a consumer board available, lets drop source-only so that
buildbots provide official images.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-09 18:53:32 +01:00
Robert Marko
29b3d929a6
microchipsw: lan969x: add Novarq Tactical 1000
Novarq Tactical 1000 is a LAN9696 based switch.

Specifications:
* CPU: Microchip LAN9696 switch SoC
* DRAM: 2GB DDR4
* Storage:
	* 32MB QSPI NOR
	* 16GB eMMC
* Networking:
	* 24 x 10/100/1000 RJ45 via LAN8804 Quad PHY-s over QSGMII
	* 4 x 100/1000/2500/5000/10000 SFP+ ports
	* 1 x 10/100/1000 management RJ45 via LAN8840 PHY over RGMII (U-Boot too)
* USB: 1 x USB2.0 Type-A
* Management via USB-C (MCP2200):
	* UART @ 115200 baud (Default), 921600 possible
	* GPIO-s for bootstrap and reset
* LED-s:
	* 2 per networking port (Green and Yellow)
	* Green status LED
* Soft reset GPIO
* Power: 12V DC barrel jack
* External PoE:
	* Option for PoE add-on
* Temperature Sensors:
	* TMP1075 onboard
	* CPU temperature
* Microchip MCP79402 RTC with battery back-up
* Microchip ATECC608C secure peripheral
* CPU heatsink with PWM fan
* Onboard header for case fan

Installation instructions:

1. Connect to UART via the USB-C port
2. Connect the management port
3. Boot and interrupt U-Boot
4. TFTP the OpenWrt initramfs image and boot it
5. SCP the OpenWrt eMMC GPT image to a running OpenWrt initramfs to /tmp
openwrt-microchipsw-lan969x-novarq_tactical-1000-squashfs-emmc-gpt.img.gz

And decompress it via:
gzip -d /tmp/openwrt-microchipsw-lan969x-novarq_tactical-1000-squashfs-emmc-gpt.img.gz

6. Wipe eMMC with:
dd if=/dev/zero of=/dev/mmcblk0 bs=1M

7. Flash OpenWrt eMMC image with:
dd if=/tmp/openwrt-microchipsw-lan969x-novarq_tactical-1000-squashfs-emmc-gpt.img
of=/dev/mmcblk0

After a restart OpenWrt will boot, and then regular sysupgrade can be used
for upgrades.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-09 18:50:23 +01:00
Robert Marko
7b7a559976
microchipsw: use upstreamed patches
Replace some of the pending patches with the upstreamed versions and mark
them accordingly.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-09 18:50:23 +01:00
Robert Marko
6e0379deb9
boot: arm-trusted-firmware-microchipsw: update to latest
Update microchipsw TF-A to the latest bugfix release that fixes
SHA checksum validation if large files are uploaded via the monitor mode.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-09 18:50:23 +01:00
Robert Marko
6944f1c6a0
microchipsw: use latest DTS
Use the latest v3 that is sent upstream, it now uses a DTS header for clock
indices.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-01-09 18:50:23 +01:00
Jonas Jelonek
de9faf9e75 realtek: mdio: drop SerDes access functionality
The SerDes access functionality in the mdio-realtek-otto drivers was
meant to be temporary, at least from a certain point on. The user was
all the SerDes configuration that lived in the PHY and DSA drivers.

Now that SerDes configuration has moved completely to the PCS driver,
there is no user of this code anymore. Instead, the PCS driver uses a
separate driver 'mdio-realtek-otto-serdes' to access the SerDes. Thus,
drop all that unused functionality from the "normal" mdio driver.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21439
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 19:40:46 +02:00
Pawel Dembicki
ffda7e6748 qoriq: kernel: refresh config
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Done by 'make kernel_oldconfig'.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 18:45:02 +02:00
Pawel Dembicki
0a2b3b66db qoriq: add support for NXP T4240RDB board
Hardware specs:
  - NXP T4240, 12C/24T @ 1.67 GHz
  - 3 × 2 GB DDR3 SO-DIMM
  - 128 MB NOR flash
  - 2 GB SLC NAND
  - SD card interface
  - PCIe: x4 and x8
  - SATA 3 Gbps
  - 8 × 1 GbE
  - 4 × 10 GbE SFP
  - RTC

This commit adds the sysupgrade and factory images for T4240RDB board in
both variants:
  - nor: for booting and read whole system from NOR memory
  - sdboot: for booting and read whole system from SD card

SD Card images install:

  - Burn image to sdcard. E.g:
      gunzip -c gunzip -c openwrt-qoriq-generic-fsl_T4240RDB-squashfs-sdcard.img.gz | \
      sudo dd of=/dev/mmcblk0 conv=fsync,notrunc status=progress bs=4M && sync
  - Download lastest Cortina PHY firmware from NXP github [1], if you accept their
    EULA [2].
  - Install Cortina PHY on image, E.g:
      dd if=cs4315-cs4340-PHY-ucode.txt of=/dev/mmcblk0 bs=1 seek=2M
  - Insert SD-Card to SD slot
  - Switch SW3.4 to OFF
  - Configre mac addresses from sticker in u-boot. E.g:
      setenv ethaddr 00:10:f3:3a:a8:66
      setenv eth1addr 00:10:f3:3a:a8:67
      setenv eth2addr 00:10:f3:3a:a8:68
      setenv eth3addr 00:10:f3:3a:a8:69
      setenv eth4addr 00:10:f3:3a:a8:6a
      setenv eth5addr 00:10:f3:3a:a8:6b
      setenv eth6addr 00:10:f3:3a:a8:6c
      setenv eth7addr 00:10:f3:3a:a8:6d
      setenv eth8addr 00:10:f3:3a:a8:6e
      setenv eth9addr 00:10:f3:3a:a8:6f
      setenv eth10addr 00:10:f3:3a:a8:70
      setenv eth11addr 00:10:f3:3a:a8:71
      saveenv
  - reset and boot

NOR images install:

  - download and extract factory image on tftp server root
  - boot device and stop in u-boot (from nor or sd card u-boot)
  - configure server and ip address. E.g:
      setenv ipaddr 192.168.1.2
      setenv serverip 192.168.1.1
  - Download image and run flashing:
      tftpboot $loadaddr openwrt-qoriq-generic-fsl_T4240RDB-squashfs-factory-nor.bin
      protect off all
      erase $fwaddr +$filesize
      cp.b $loadaddr $fwaddr $filesize
  - Switch SW3.4 to ON
  - Switch SW3.1-3 to OFF
  - reboot
  - Do postprocessing (see bellow)

NOR images post processing:

  - Configre mac addresses from sticker in u-boot. E.g:
      setenv ethaddr 00:10:f3:3a:a8:66
      setenv eth1addr 00:10:f3:3a:a8:67
      setenv eth2addr 00:10:f3:3a:a8:68
      setenv eth3addr 00:10:f3:3a:a8:69
      setenv eth4addr 00:10:f3:3a:a8:6a
      setenv eth5addr 00:10:f3:3a:a8:6b
      setenv eth6addr 00:10:f3:3a:a8:6c
      setenv eth7addr 00:10:f3:3a:a8:6d
      setenv eth8addr 00:10:f3:3a:a8:6e
      setenv eth9addr 00:10:f3:3a:a8:6f
      setenv eth10addr 00:10:f3:3a:a8:70
      setenv eth11addr 00:10:f3:3a:a8:71
      saveenv
  - boot
  - Download and refresh RCW stored in eeprom:
      tr '\0' '\377' < /dev/zero | dd bs=256 of=/sys/bus/i2c/devices/0-0050/eeprom
      cat /tmp/openwrt-qoriq-generic-fsl_T4240RDB-squashfs-rcw.bin > /sys/bus/i2c/devices/0-0050/eeprom
  - Download lastest Cortina PHY firmware from NXP github [1], if you accept their
    EULA [2].
  - Install Cortina PHY on image, E.g:
      mtd write cs4315-cs4340-PHY-ucode.txt /dev/mtd4
  - reset and boot

[1] https://raw.githubusercontent.com/nxp-qoriq/qoriq-firmware-cortina/refs/tags/lf-6.12.34-2.1.0/cs4315-cs4340-PHY-ucode.txt
[2] https://github.com/nxp-qoriq/qoriq-firmware-cortina/blob/lf-6.12.34-2.1.0/EULA.txt

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 18:45:02 +02:00
Pawel Dembicki
c5d3d5fe28 package: u-boot: initial support for qoriq arch
This package adds initial u-boot support for qoriq target.

U-boot for qoriq devices must be compiled with 32-bit compiler and
linked with 32-bit linker. It's part of mpc 85xx target. But qoriq
target is 64-bit. As workaround, mpc85xx binary toolchain is downloaded
only for this u-boot.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 18:45:02 +02:00
Pawel Dembicki
5ed0f5a6dd kernel: move patch from mpc85xx to pending
The patch "Revert "powerpc: dts: mpc85xx: remove "simple-bus" compatible
from ifc node" has been sent upstream [0].

It is also required for qoriq target and in this commit it is moved to
the generic/pending folder.

[0] https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20251105205524.17362-1-rosenp@gmail.com/

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 18:45:02 +02:00
Daniel Golle
e5812c7a8c kernel: net: phy: mxl-gpy: replace downstream SGMII AN hack
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Replace downstream hack disabling SGMII in-band AN on the MediaTek platform
with pending upstream patch announcing in-band AN capabilities and implementing
configuring in-band AN in the PHY driver.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-09 16:09:56 +00:00
John Audia
92ff3dfd84 x86: switch from CONFIG_HZ_PERIODIC to CONFIG_NO_HZ_IDLE
Running with CONFIG_HZ_PERIODIC=y keeps the scheduler tick running
continuously, which produces higher jitter and lower power efficiency.
In contrast, CONFIG_NO_HZ_IDLE=y (the upstream default) stops the tick
only when the CPU is idle, giving lower idle power and normal runtime
jitter.

An Intel N150-based router/firewall was tested using two kernel builds:
one with CONFIG_HZ_PERIODIC=y, and one with CONFIG_NO_HZ_IDLE=y. Power
consumption was measured while the system was essentially idle (no
meaningful traffic). The CONFIG_NO_HZ_IDLE=y build consistently used
less power.

Details: The two power-measurement methods were:

 1. PkgWatt from turbostat (software)
 2. Wall-power measurement using a Kill-A-Watt (hardware)

The test began by zeroing the Kill-A-Watt and simultaneously running:
turbostat --quiet --Summary --interval 10 --show Busy%,PkgWatt

The test duration was defined by the time required for the Kill-A-Watt
to accumulate 0.005 kWh, after which the average wattage was calculated.

Results:
+----------------------+-----------------+----------------+-----------+
|  Metric              |   HZ_PERIODIC   |   NO_HZ_IDLE   | Delta %   |
+----------------------+-----------------+----------------+-----------+
|  PkgWatt             |  3.59 ± 0.38    |  3.38 ± 0.34   |  -5.9 %   |
+----------------------+-----------------+----------------+-----------+
| Avg wattage at wall  |      12.47      |     12.00      |  -3.77 %  |
+----------------------+-----------------+----------------+-----------+

The mean PkgWatt difference is 210 mW (5.9%) in favor of
CONFIG_NO_HZ_IDLE=y, with a t-statistic of ~3.17 and p ≈ 0.002.

Wall-power measurements show a 470 mW (3.77%) reduction under
CONFIG_NO_HZ_IDLE=y.

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21470
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-09 16:35:34 +01:00
Markus Stockhausen
1137aaa1c9 realtek: phy: keep register state during RTL8214FC fibre check
Reading the fibre status of a RTL8214FC needs access to the
page register (31) and the extended page register (30).

The current implementation has two issues.

- The extended page register is not restored after changes
- Instead of register 30 its write-only sibling 29 is used.

This has the following side effect:

During regular polling kernel calls rtl8214fc_read_status
and determines the media status via __rtl8214fc_media_is_fibre.
Writing to register 29 a copy of that value is handed over
to register 30. This makes use of mdio tools for the first
port of the RTL8214FC hard. Register 30 is overwritten with
zero every second.

Change access from register 29 to register 30 and adapt
the sequence to restore register 30 contents at the end.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21393
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 17:20:35 +02:00
Chukun Pan
b5195cd473 mediatek: fix 2.5G PHY LED polarity for MT7987
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
The patch that adds MT7987 support to the mtk-2p5ge
driver does the following:

case MTK_2P5GPHY_ID_MT7987:
	phy_clear_bits_mmd MTK_PHY_LED_ON_POLARITY
case MTK_2P5GPHY_ID_MT7988:
	phy_set_bits_mmd.. MTK_PHY_LED_ON_POLARITY

phy_set_bits_mmd... MTK_PHY_LED_ON_POLARITY | xxx

This clearly resulted in the LED polarity of the 2.5G PHY
on the MT7987 being reversed. Remove redundant MMD operations
to fix the 2.5G PHY LED error on Bananapi BPi-R4 Lite.

Fixes: d62fc50f ("mediatek: import patches from SDK to support MT7987 Ethernet")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-09 12:59:54 +00:00
Chukun Pan
0827720e04 uboot-mediatek: fix LED on Bananapi BPi-R4 Lite
Create a common dtsi for Bananapi BPi-R4 Lite and add missing
gpio-leds. This reduced code and fixed the following LED bug:

LED 'green:status' not found (err=-19)

Fixes: 3a71dd58 ("uboot-mediatek: add support for the BananaPi BPi-R4 Lite")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2026-01-09 12:59:54 +00:00
Daniel Golle
2a7d374dcd kernel: net: phy: realtek: replace patches with upstream backports
Replace downstream patches with backports of commits accepted upstream.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-09 12:55:02 +00:00
Shiji Yang
d93429888c tools/squashfs4: fix rare data corruption issue
There is a chance that the squashfs4 tool may create a broken image
under certain conditions. Backport the fix from upstream to address
this issue.

Report: https://forum.openwrt.org/t/bug-squashfs4-tools-4-7-4-create-corrupted-image/244894
Fixes: 64432358e0 ("tools/squashfs4: update to 4.7.3")
Reported-by: Oleg S <remittor@gmail.com>
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21458
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-09 13:50:38 +01:00
Jonas Jelonek
a9254a593b realtek: dsa,phy: rtl839x: remove SerDes PHY leftovers
Drop several leftovers of SerDes configuration from PHY and DSA drivers.
Both drivers can be seen as free from any SoC-side SerDes stuff.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21360
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 14:32:53 +02:00
Jonas Jelonek
9c0dfa339f realtek: pcs: rtl839x: setup SerDes in PCS driver
Add the SerDes setup hooks in the PCS driver for RTL839x so that
pcs_config actually triggers configuration. Adjust the DTS of all
devices accordingly by adding pcs-handles and dropping phy-handles.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21360
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 14:32:52 +02:00
Jonas Jelonek
6e2c676076 realtek: pcs: rtl839x: add initialization patch sequence
Add a patch sequence needed to properly initialize 10G SerDes. This is
taken from the SDK mostly as-is ([1]).

Exit early from SerDes reset for now because it seems to cause some
issues on lower 5G SerDes.

[1] 30e7d6c8c2/sources/rtk-dms1250/src/dal/cypress/dal_cypress_construct.c (L215)

Co-authored-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21360
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 14:32:52 +02:00
Jonas Jelonek
afec14aee1 realtek: pcs: rtl839x: add SerDes setup functionality
Add basic SerDes setup functionality which determines and sets the
hardware mode of a SerDes, and does a SerDes reset. This is restricted
to the 10G SerDes only as the 5G SerDes are setup properly by default.
Further initialization will be needed for the modes to function properly

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21360
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 14:32:52 +02:00
Jonas Jelonek
7de5ba2e98 realtek: pcs: rtl839x: refactor SerDes reset sequence
Refactor the previously added SerDes reset sequence. Use the SerDes
MDIO interface instead of plain writes into the switchcore's register
space. Moreover, simplify the sequence because the SDK version is
unnecessarily complex.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21360
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 14:32:52 +02:00
Jonas Jelonek
82d0ae3134 realtek: pcs: rtl893x: add SerDes reset sequence
Add SerDes reset sequence mostly as-is from the SDK (except for
adjusting the register write calls to work with regmap).

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21360
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2026-01-09 14:32:52 +02:00
George Moussalem
e1a9636959 qualcommax: ipq50xx: Correct USB DWC3 wrapper interrupts
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Interrupts for DWC3 node were completely mixed up - SPI interrupt 62 is
not listed in reference manual at all.  It was also causing dtbs_check
warnings:

  ipq5018-rdp432-c2.dtb: usb@8af8800 (qcom,ipq5018-dwc3): interrupt-names:0: 'pwr_event' was expected
  ipq5018-rdp432-c2.dtb: usb@8af8800 (qcom,ipq5018-dwc3): interrupt-names: ['hs_phy_irq'] is too short

Warning itself was introduced by commit 53c6d854be4e ("dt-bindings: usb:
dwc3: Clean up hs_phy_irq in binding"), but this was trying to bring
sanity to the interrupts overall, although did a mistake for IPQ5018.
IPQ5018 does not have QUSB2 PHY and its interrupts should rather match
ones used in IPQ5332.

Correct it by using interrupts matching the bindings and reference
manual.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21454
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-08 18:38:51 +01:00
Robert Marko
0ff1553bd7 ipq-wifi: rename BDF for EAP623-Outdoor HD v1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
BDF for EAP623-Outdoor HD v1 was renamed in the repo, but ipq-wifi
was not updated to reflect that, so do it now to fix broken wifi.

Fixes: #21432
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-08 11:18:23 +01:00
George Moussalem
d6ab889e45 qualcommax: ipq50xx: correct assigned cmn pll clock rate
In IPQ5018, the reference clock to the CMN PLL block from the on-board
Wi-Fi has its divider set to 2. This divider wasn't taken into
consideration when calculating the CMN PLL clock rate which meant the
resulting clock rate was doubled.

With the reference clock divider being accounted for in the driver,
correct the assigned clock rate to 4.8GHz.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21453
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-08 10:41:36 +01:00
George Moussalem
fdce6f99be qualcommax: ipq50xx: enable ipq-cmn-pll driver compilation
Add missing dt-bindings/include files needed for compilation of driver.
Enable compilation of the CMN PLL driver by adding the symbols to
Kconfig and Makefile.

Fixes: 468975a985 ("qualcommax: ipq50xx: backport upstreamed patches for adding ipq5018 CMN PLL support")
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21453
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-08 10:41:35 +01:00
Robert Senderek
f948f71300 qualcommax: ipq50xx: Add support for Zyxel SCR50AXE
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
This is tri-band WiFi6E capable router. Also Zyxel Nebula managed so no real local GUI. To open device 4 screws must be located uder the label.
Four latches are on front and two on each side. Better start from ethernet port side where 3 small latches are easy to handle.
FCC shows It's identical to WSQ65 sold as Zyxel Multy M6E but that's nowhare to be found yet. WSQ65 is not covered by this PR

Speficiations:
* SoC: Qualcomm IPQ5018
* RAM: 1GB DDR3
* Flash: Winbond W25N02KWZEIR 256MB
* UART: PCB "J3"  is located left from front LED strip
              (VCC/TX/RX/     /GND)   3.3V 115200n8
* Wi-Fi1: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax)
* Wi-Fi2: QCN6102 (2x2:2 5 Ghz 802.11an/ac/ax)
* Wi-Fi3: QCN6122 (2x2:2 6 Ghz 802.11an/ac/ax)
* Ethernet: QCA8337 4xLAN 1Gbit / 1xWAN 1Gbit
* Buttons: WPS , Reset
* LEDs: 13 in total
   RGB power, RGB wan, RGB status (cloud), RGB wifi, Green wps
* FCCID: I8803891

*Flash Instructions starts with getting root:
connect uart to J3 connector next to the front LEDs
go to failsafe when this shows up in log:
"Press the [f] key and hit [enter] to enter failsafe mode"
execute:
mount_root
passwd -d root
reboot

logon as root:
look for 'Please press Enter to activate this console.'
login is root password is empty
execute:
fw_setenv DebugFlag=0x1
fw_setenv bootdelay=0x2
passwd -d root
backup ubi partition "rootfs" into safe space
reboot

*OpenWrt installation
stop uboot and execute:
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.10
tftpboot *-factory.ubi
flash rootfs
reset

or:
tftpboot *-initramfs-uImage.itb
bootm
use sysupgrade as usual

*restore OEM from backup
stop uboot and execute:
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.10
tftpboot *-initramfs-uImage.itb
bootm
transfer rootfs.bin backup and execute:
ubiformat /dev/mtd16 -y -f /tmp/rootfs.bin

Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
Link: https://github.com/openwrt/openwrt/pull/21042
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 11:05:20 +01:00
Robert Marko
95a3dc83f1 ipq-wifi: update to Git HEAD (2026-01-07)
11715a4fe783 ipq5018: add SCR50AXE BDF's

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 11:04:20 +01:00
Jonas Jelonek
b94c3ba0ff realtek: pcs: rtl931x: improve port media handling
The port media handling introduced before was to some extent just taken
over from the SDK. As a second step, improve that code now. Some code
can be deduplicated, a few statements removed and improved in general.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21385
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 11:01:11 +01:00
Jonas Jelonek
7971386514 realtek: pcs: rtl931x: add port media handling
SFP modules still do not work that well across different devices. One
missing piece seems to be the bunch of magic values and bits set by the
SDK depending on which media is used on a port.

Take over code from the SDK for port media handling [1]. This applies
different sequences depending on whether it's 10G fiber, 1G fiber or DAC
cables to make it work best for each variant. Place the call to that
code below the configuration of a SerDes mode but before actually
activating that mode and powering on the SerDes. The SDK and our code
for RTL930x do that similarly.

Though we do not have any notion of media in pcs_config right now, do
similar to some SDK versions and set an appropriate media type for fiber
modes and SGMII (otherwise it doesn't work).

[1] 51c3390e0e/sources/rtk-dms1250/src/hal/phy/phy_rtl9310.c (L2302)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21385
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 11:01:11 +01:00
Jonas Jelonek
b4bd85d504 realtek: pcs: add enum for port media
The Realtek SDK includes a lot of code around specific port media,
usually having quite some differences between 10G fiber, 1G fiber and
DAC cables. For each type, several magic values are set which in the end
usually make different kinds of links work optimal.

While there is currently no way to get that media information from the
kernel, add some fields as an enum to have a notion of different media
kinds. In additional steps, code for the subtargets can be taken over
from the SDK to handle different media.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21385
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 11:01:11 +01:00
Jonas Jelonek
b435b5bc61 realtek: pcs: drop some unneeded unused attributes
Drop the '__always_unused' tags from two functions which are actually
used. This was missed during the big transition before.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21410
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 10:46:54 +01:00
Jonas Jelonek
84f2ecba4d realtek: pcs: fix naming of RTL931X sds config data
Those config arrays still do not lineup with common conventions in the
driver in terms of naming. They are missing the driver and variant
prefix. Thus, line that up with how RTL930X code looks like.

- add 'rtpcs_' prefix since it's part of the PCS driver
- add '931x_' prefix because it's for RTL931X
- use 'cfg' instead of 'config' to shorten that a bit

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21410
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 10:46:54 +01:00
Jonas Jelonek
3753805b2a realtek: pcs: use ARRAY_SIZE kernel macro
In the RTL931X configuration code, the array size of configuration
arrays was still calculated with 'sizeof(...) / sizeof(...)'. There's a
dedicated macro in the kernel for exactly that usecase. Use that instead
to avoid possible errors and make the line shorter. The RTL930X code is
already doing it the good way.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21410
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 10:46:54 +01:00
Jonas Jelonek
7aa7e97e53 realtek: pcs: fix sds_config struct definition
In kernel coding style, it is highly disregarded to hide structures
behind typedefs ([1]). The PCS driver still contains a typedef for the
sds_config which was taken over from the PHY driver.

- drop the typedef, just declaring it as a struct
- give it the common 'rtpcs_' prefix
- adjust all usage locations

[1] https://www.kernel.org/doc/html/v6.18/process/coding-style.html#typedefs

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21410
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 10:46:54 +01:00
Jonas Jelonek
fe0f6f82c1 realtek: pcs: add myself as module author
I have contributed quite a lot changes recently and should be made
responsible for most of the code that has been added to the PCS driver
after it has been introduced by Markus.

FWIW, add myself as another module author so anything I produced here
doesn't fall back to someone else, i.e. Markus as currently the single
module author.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21410
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 10:46:54 +01:00
Tianling Shen
c79fa27cbf rockchip: fix kernel tag for backported patches
These patches were actually merged in kernel 6.19 instead of 6.18,
fix them to avoid confusing when moving to new kernel version.

While at it, refresh the RK3528 PCIE L1ss patch since it was
accepted in 6.19 as well.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/21419
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-07 10:44:11 +01:00
Daniel Golle
6aaffddf27 kernel: net: phy: realtek: fix C22-only mode on 2.5GE PHYs
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Import 2 patches completing and fixing the RealTek's 2.5GE PHYs when being
used in Clause-22 mode.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-07 01:30:26 +00:00
Daniel Golle
96ff31b94a kernel: net: phy: c45: check validity of 10GbE LPA
Only use link-partner advertisement bits for 10GbE modes if they are
actually valid. Check LOCALOK and REMOTEOK bits and clear 10GbE modes
unless both of them are set.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-07 01:30:26 +00:00
Daniel Golle
dfce21df96 kernel: net: phy: realtek: replace in-band AN hack
Replace downstream hack for RealTek PHYs with a more clean solution
which could make it upstream.

As SGMII in-band AN is broken on some platforms, or simply expected to
be disabled by default in phy/sgmii mode (ie. on-board PHYs with MDIO
for out-of-band configuration and status), a hack for the RealTek PHY
driver was introduced to unconditionally disable SGMII in-band
autonegotiation.

Meanwhile the kernel has gained a proper interface for PHY and PCS to
report in-band AN capabilities and enable/disable in-band, matching
PHY and PCS capabilities.

Thanks to Bevan Weiss' knowledge about how RealTek PHY SerDes registers
are being handled in RealTek's SDK this can now be greatly improved:
 - report in-band capabilties
 - let phylink set in-band matching PCS and PHY capabilities
 - properly abstracted indirect access of SerDes registers

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-07 01:30:26 +00:00
Daniel Golle
5652b98952 kernel: net: phy: realtek: replace hack with proper fix
RealTek's 2.5G PHYs suffer from an up to now inexplicable problem which
results in the SerDes mode not being properly setup and disabling
in-band AN leading to a timeout waiting for a busy-bit to clear. Up to
now there has been a crude work-around: resetting the PHY and trying
another time.

The cause has now been found as a wrong access to register PHYCR1 on
MDIO_MMD_VEND1 instead of MDIO_MMD_VEND2 when setting up ALDPS as well
as disabling the MDIO broadcast address 0.

In order to access MDIO_MMD_VEND2 on Clause-22-only busses a custom
.read_mmd and .write_mmd ops are implemented, mapping MDIO_MMD_VEND2 to
paged access as this is required.

Also, as ALDPS by design disables the SerDes PCS of the PHY in case the
link has been down for a while, move enabling ALDPS to the end of the
config_init function to not face problems when configuring the interface
mode and in-band AN.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-01-07 01:30:26 +00:00
Felix Fietkau
e06c4125fd ucode: remove the fs.read_nb patch
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
It is obsolete since the io module was added

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-06 20:09:35 +01:00
Felix Fietkau
ed2587c73d ucode: add package for ucode-mod-io
It was included in the last update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-06 20:09:35 +01:00
Felix Fietkau
79a0aebd81 wifi-scripts: move the "disabled" option to the wifi-iface section
This helps for setups where the wifi interfaces are added dynamically
via procd data by avoiding automatically bringing up interfaces with
the default config. Internally, they are treated pretty much the same
by netifd.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-06 20:09:35 +01:00
Linus Walleij
12d47550e6 uboot-bcm53xx: bump U-Boot to 2025.10
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Bump to the latest version used by other OpenWrt platforms so
we don't bitrot.

Tested on the D-Link DIR-890L.

Link: https://github.com/openwrt/openwrt/pull/21377
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-01-06 01:15:46 +01:00
George Sapkin
838a9ff1ca build: restore opkg-related provides logic
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Re-add opkg provides logic to CONTROL when USE_APK is not set and remove
virtual provider prefix.

Fixes: cefbf11 ("build: refactor provides logic")
Fixes: https://github.com/openwrt/openwrt/issues/21372
Fixes: https://github.com/openwrt/openwrt/issues/21382
Fixes: https://github.com/openwrt/openwrt/issues/21402
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21409
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 23:27:40 +01:00
Felix Fietkau
bf46d119a2 ucode-mod-ubus: complete pending requests when disconnecting locally
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
libubus only completes pending requests when the socket receives EOF.
When explicitly disconnecting, we need to call ubus_flush_requests().

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-05 12:43:40 +01:00
Felix Fietkau
bdc3c1a820 unetmsg: remove redundant socket close
channel.disconnect() already closes the fd via ubus_shutdown(),
so calling socket.close() afterwards is redundant and causes EBADF.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-05 12:43:40 +01:00
Felix Fietkau
8a304d051f unetmsg: add timeout for outgoing auth requests
Add a 10-second timeout for outgoing auth requests to prevent
connections from getting stuck when the remote peer goes silent
after the hello handshake but before responding to auth.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-05 12:43:40 +01:00
Felix Fietkau
f631d1576d unetmsg: add null check in TX disconnect callback
The network may be deleted before the disconnect callback fires.
Check for null to avoid crash when accessing net.tx_channels.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-05 12:43:40 +01:00
Ziyang Huang
f5bf8c2b94 airoha: an7581: correct led nodename
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Use standard name.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:25 +01:00
Ziyang Huang
077120fb64 airoha: an7581: correct phy nodename
Let node unit address same as reg.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
ea54b6a478 airoha: an7581: move the switch led label from soc-level to board-level
Different boards use different port map. For example, some board may use
a GE port as WAN. So defining the led label in board-level is better.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
e2f7ad08c7 airoha: an7581: move the switch port label from soc-level to board-level
Different boards use different port map. Defining the port labels in
board-level is better.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
007aa5a51c airoha: an7581: disable all switch port and phy by default
Some board only use some of them, so enable as necessary in
board-level dts.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
65aed6aa12 airoha: an7581: correct the pinctrl-name of phy leds
address the following issues:

    [    3.542844] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
    [    3.552550] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
    [    3.562449] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
    [    3.574350] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Markus Stockhausen
17b90c59fa realtek: eth: adapt prefix of ops structures
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Convert all ops structures to the new rteth prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
f14fed9a92 realtek: eth: move netdev_ops to config structure
Simplify netdev_ops initialization by moving the data
into the configuration structure.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
2d8212e8a4 realtek: eth: reorder configuration data
The configuration data needs to reference the netdev_ops
in the future. Reorder it in a separate commit to avoid
confusion later.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
b8c6713ce4 realtek: eth: move cpu_port to config structure
There is no need to set the cpu port depending on the
given family. Remove it from the private control structure
and add the fixed value to the configuration structure.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
e6d282eee7 realtek: eth: Rename configuration structure
The name of the configuration structure suggests that it
contains a list of registers. As it contains functions too
change the name according to other realtek drivers.

- "Invent" a new driver prefix "rteth"
- Rename the structure and variables to config/cfg

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Eric Fahlgren
8630fa09c7 packages: ethtool: restore CONFLICTS
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Inadvertent removal of 'CONFLICTS' breaks kconfig selection.
Restore it.

Fixes: ded99c2984 ("treewide: add explicit default variant part 2")
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21388
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 18:40:52 +01:00
John Audia
6c9c641777 nat46: fix reproducible-build failure and use latest git
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Bump to 2025-11-04 snapshot.

Added 100-gcc15-fix.patch which drops __DATE__/__TIME__ usage and provides
a stable fallback ("unknown"). This fixes build failures with GCC 15 and
-Werror=date-time in kernel builds.

% git log --oneline 04923c5..adb2f72
adb2f72e6fb8 get rid of spurious ubsan complaint for nat46_instance_t pairs field
d5f88686a4a8 Add a test harness which boots the kernel under kvm with a custom init which runs the tests
b983bab221f0 nat46-core: Fix FIXMEs about ICMPv6 parameter pointers
1aca482d6917 Add support for ignoring traffic class or TOS translation at the same time

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21284
[Removed "Replace printk with pr_* macros" patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 17:13:11 +01:00
Valent Turkovic
7214acd759 wifi-scripts: wdev.uc: fix mesh mode frequency handling
Mesh mode interface creation fails when the freq parameter is empty or
undefined. Unlike adhoc mode which checks if freq exists before using it,
mesh mode blindly constructs the iw command with freq parameter, resulting
in invalid syntax like:

  iw dev mesh0 mesh join ssid freq  NOHT

This causes the mesh interface to be created without joining the mesh
network, leaving it in a DOWN state with no channel assigned.

Fix by adding freq validation check similar to adhoc mode.

Tested on two routers in parallel as mesh peers:
- Xiaomi AX3000T (MediaTek MT7981)
- OpenWrt One (MediaTek MT7981)
- OpenWrt 6.6.119, 802.11s mesh on 5GHz (Channel 36, HE80)

Signed-off-by: Valent Turkovic <valent@meshpointone.com>
Link: https://github.com/openwrt/openwrt/pull/21373
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:54:48 +01:00
Linus Walleij
b73fd273b3 ixp4xx: fix bug in Actiontec DTS file
This misassigned ethernet port bug was merged in the upstream
kernel.

Link: https://github.com/openwrt/openwrt/pull/21367
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-01-04 16:51:31 +01:00
Hauke Mehrtens
5230157a16 kernel: QCOM SPI NAND: backport multiple fixes
These patches fix bugs in a patch we backported.

These patch were cherry picked from upstream Linux because it references
a patch we backported in the fixes tag.

The patches were reordered to match the ordering in the upstream Linux kernel.

Fixes: 93173aee96 ("qualcommbe: ipq95xx: Add initial support for new target")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
69d76e3a14 kernel: phylink: disable autoneg for interfaces that have no inband
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

The first two patches are providing function needed by the last patch.

Fixes: 813ecda1f3 ("generic: backport phylink patches for PCS/PHY caps OPs")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
2c7241b209 kernel: RTL8211FVD: restore disabling of PHY-mode EEE
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 48c9e55094 ("kernel: backport upstream Realtek PHY patches")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
9c4b7fbaad kernel: mv88e6xxx: backport fixes
These patches fix bugs in a patch we backported.

These patch were cherry picked from upstream Linux because it references
a patch we backported in the fixes tag.

Fixes: c990f6e156 ("linux: generic: net: dsa: mv88e6xxx LED support")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
b3cc77eead kernel: reserved_mem: add missing IORESOURCE_MEM flag on resources
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 9d3009f426 ("airoha: major backport of Airoha Ethernet driver feature support")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
b3318fe819 kernel: as21xxx: backport patch improve PHY HW reset
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

The function phy_id_compare_vendor() is needed by the fix.
Refresh 782-05-v6.16-net-phy-Add-support-for-Aeonsemi-AS21xxx-PHYs.patch with the upstream code.

Fixes: 08a616b216 ("generic: backport support for Aeonsemi AS21xxx PHY")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
7390e63374 kernel: pcs-mtk-lynxi: backport fix for in-band status capabilities
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 813ecda1f3 ("generic: backport phylink patches for PCS/PHY caps OPs")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
63b45a10c0 kernel: PHY: backport led fixes commit
This patch fixes a bug in some patches we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
6ac5e28902 kernel: r8169: backport upstream fix
This fixes a bug introduced in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 91ce7f606a ("generic: backport upstream v6.16 r8169 patches")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
3c821c19a8 kernel: move patches to backported
These formally pending patches were merged into upstream Linux some time
ago. Move them to the backports folder and add the kernel version they
were added to the file name.

Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
7130053695 kernel: refresh upstreamed patches
Replace pending patches which are already integrated in upstream Linux
with their upstream versions.

These patches were exported with:
git format-patch -1 -k

Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:28 +01:00
Eric Fahlgren
ded99c2984 treewide: add explicit default variant part 2
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Add 'DEFAULT_VARIANT' to two packages, 'iw' and 'eapol-test',
that were missed in the first pass.  Refactor 'iw' and 'ethtool'
package definitions to be consistent with the pattern used in most
other packages.

Fixes: https://github.com/openwrt/openwrt/commit/f4fdb996
Fixes: https://github.com/openwrt/openwrt/commit/7a78dc4a
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21380
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 11:25:12 +01:00
Felix Fietkau
a10d10edd7 cli: fix typo in error reporting
Return the proper error code for COMMAND_FAILED

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-04 10:59:38 +01:00
Rosen Penev
9934c716ed treewide: replace remove_new with remove
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Preparation for kernel 6.18. It removes the former.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21226
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 17:27:25 +01:00
Aleksander Jan Bajkowski
79ff31104c airoha: an7583: fix scuclk unit-address
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Fix the unit-address of the scuclk node.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20985
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 17:04:58 +01:00
Aleksander Jan Bajkowski
914fe44647 airoha: en7583: dts: fix typo disable
No functional changes intended.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20985
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 17:04:58 +01:00
Jonas Jelonek
2055a4df78 realtek: pcs: rtl931x: soften early exit for USXGMII
Now that the PCS driver keeps track of how many links are registered per
SerDes, we can also decide which real hardware mode to use when USXGMII
is set. While there is still no proper setup for 10G-QXGMII or XSGMII,
the existing USXGMII 10G-SXGMII setup seems to work properly.

Soften the condition when to exit early so that single 10G port USXGMII
can be setup properly.

Fixes: c18476d0c5 ("realtek: RTL931x: disable USXGMII SerDes setup")
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:49 +01:00
Jonas Jelonek
b63f68e409 realtek: pcs: select OFF mode with no links on SerDes
Because the PCS driver keeps track of the number of registered links for
each SerDes now, we now know when there is no link on a SerDes. In this
case, determine to turn off the SerDes in the mode mapper.

Though the phylink subsystem shouldn't attempt to config something
different when no link/port references a Serdes, be on the safe side.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Jonas Jelonek
7cd3407fde realtek: pcs: cover number of links per SerDes for USXGMII
A SerDes may supply multiple ports and depending on that number,
different hardware modes need to be used. While there are corresponding
modes in the kernel in some cases (e.g. USXGMII with 4 2.5G ports aka
10G-QXGMII), this doesn't always map to Realtek hardware modes. Use the
previously added link number accounting for that.

An obvious example of this is the SerDes on XGS12xx-12 switches which
is connected to an octa-PHY. This runs Realtek proprietary XSGMII mode
(10G-pumped SGMII interface) for which there is no corresponding mode
in the kernel.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Jonas Jelonek
76f392194b realtek: pcs: keep track of number of links per SerDes
Add a field to the rtpcs_serdes structure to keep track of how many
links (aka ports) are used on a single SerDes. This is needed to be
known to map kernel interface modes to SerDes hardware modes properly
(e.g. USXGMII --> USXGMII/10G-QXGMII/XSGMII).

While working in rtpcs_create, optimize referencing the SerDes instance
for cleaner code.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Jonas Jelonek
dfd6a4212f realtek: pcs: add missing SerDes modes
100Base-X mode was missing before in the enum rtpcs_sds_mode. So add it
to be able to support this mode too. Handle this mode in the
_determine_hw_mode mapper.

10G_QXGMII mode was missing in the mode mapper. Add it and map it to
USXGMII_10GQXGMII mode.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Hannu Nyman
93e9e67ee9 mediatek: remove erroneous pipe action from BE7200 recipe
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Remove the errorneous pipe action from the BE7200 device package list.

It causes visible errors into config:

 perus@ub2510:/OpenWrt/aarch64$ make defconfig
 ...
 tmp/.config-target.in:55023:warning: ignoring unsupported character '|'
 tmp/.config-target.in:191877:warning: ignoring unsupported character '|'
 tmp/.config-target.in:191878:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285812:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285815:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285819:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285820:warning: ignoring unsupported character '|'
 #
 # configuration written to .config
 #

 File tmp/.config-target.in:

  55020         select DEFAULT_urandom-seed
  55021         select DEFAULT_urngd
  55022         select DEFAULT_wpad-basic-mbedtls
  55023         select DEFAULT_|
  55024         help
  55025           Build firmware images for Routerich BE7200

Fixes: ff5e66a920 ("mediatek: add support for Routerich BE7200")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/21376
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 12:38:10 +01:00
Michel Promonet
ce282459e7 kernel: add kernel module sun6i_csi and ov5640
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This is adding SUN6I-CSI and OV5640 driver for AllWinner platform for NanoPi

Signed-off-by: Michel Promonet <michel.promonet@free.fr>
Link: https://github.com/openwrt/openwrt/pull/20085
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 01:11:09 +01:00
Jörg Seitz
479f1403f2 mediatek: add support for device zbt-z8103ax-c
- adopted MTD partition size increase from 64M to 128M
  -> this allows boot to complete
- moved MAC addressing stuff out of partition definitions
- all MAC addressing stuff is in .dtsi

Specifications:

SoC: MediaTek MT7981B
RAM: 256MiB
Flash: Winbond SPI-NAND 128 MiB
Switch: 1 WAN, 3 LAN (Gigabit) MediaTek MT7531
Buttons: Reset, Mesh
Power: DC 12V 1A
WiFi: MT7981B 2.4Ghz & 5.8Ghz

Led Layout from bottom to top:

    Power
    Mesh (RGB Led, user controllable, default set to OpenWrt Status)
    WLAN 2 GHz (user controllable)
    WAN (user controllable)
    LAN3
    LAN2
    LAN1
    WLAN 5 GHz (Not on front panel but blinks through enclosure,
               user controllable)

Buttons:

    Reset
    Mesh (user controllable, no default function)

Installation:

A. Through U-Boot menu:

 -  Prepare your connecting computer to use a static IP in
	network 192.168.1.0/24
 -  Power down the router and hold in the Reset button.
 -  While holding in the button power up the router again.
 -  Hold the button in for 10 seconds and then release.
 -  Use your browser to go to 192.168.1.1
 -  If you see a GUI allowing for flashing firmware then
	you got the right model.
 -  Upload the sysupgrade file.

Note: Recovery GUI can be used to recover from an incorrect
      firmware flash.

B. Through OpenWrt Dashboard:

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

MAC Addresses were found in Factory partition:

offset 0x4 F8:5E:3C:xx:xx:aa --> Router Label -2
offset 0xa F8:5E:3C:xx:xx:bb --> Router Label -1
offset 0x24 F8:5E:3C:xx:xx:cc --> Router Label +1
offset 0x2a F8:5E:3C:xx:xx:yy --> printed on Router Label

Signed-off-by: Jörg Seitz <github.joeterminal@xoxy.net>
Link: https://github.com/openwrt/openwrt/pull/19823
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:58:39 +01:00
Jörg Seitz
b21b019af4 mediatek: extract DTS include for zbt z8103ax
- Use .dtsi for old z8103ax featuring a 64M Nand
- Prepare .dtsi for model C of z8103ax featuring a 128M Nand

This .dtsi is supposed to match boards labeled as hardware
revision Z8103AX_V01. Model variant D of zbt-z8103ax appears
to use very same board.

DTS include does also

- set wifi mac addresses in &wifi section
- set eth mac addresses in &eth section
- set LAN switch mac addresses in &switch section

All of the above allows to get rid of 11_fix_wifi_mac script

Signed-off-by: Jörg Seitz <github.joeterminal@xoxy.net>
Link: https://github.com/openwrt/openwrt/pull/19823
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:58:39 +01:00
Tan Zien
34836dffb1 openssl: add kTLS support option
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This commit add option to enable kTLS support, improving
performance by offloading TLS encryption and decryption to
kernel space.

- Reduced CPU usage by minimizing data copying between user space
  and kernel space.
- Enables the use of the sendfile() system call with encrypted
  sockets for zero-copy data transmission.
- Leverages hardware-accelerated NIC that support TLS offloading.

Signed-off-by: Tan Zien <nabsdh9@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21306
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:30:27 +01:00
Aleksander Jan Bajkowski
f49b452cc0 airoha: replace patches with upstream version
Replace patches with version accepted upstream.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/21333
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:02:46 +01:00
Derek Denk
afad4c71f8 mediatek: filogic: add support for Cudy AP3000 Wall v1
This commit adds support for the Cudy AP3000 Wall v1.

SoC: MediaTek MT7981b
RAM: 256MiB
Flash: spi-nand spi0.0: 128 MiB
Wifi: MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5)
LEDs: 1 LED in two colors (red & white)
Buttons: 1 reset, 1 led on/off
Ethernet: 5x 1GbE
Power: PoE powered (standalone)

The stock firmware is a customized variant of OpenWrt, which implements
a signature check that only allows flashing official firmware. Cudy offers
intermediate OpenWrt firmware images on their website [1][2] which do not
implement the signature check. After flashing the intermediate image the
upstream official OpenWrt image can be installed.

The stock firmware can be recovered via TFTP using the U-Boot based boot
loader[3]. Set up a TFTP server on your computer with IP 192.168.1.88/24
serving the stock firmware from Cudy's website renamed to "recovery.bin".
Press and hold the reset button while powering on the device, wait for the
TFTP server to send the recovery.bin file, then release the reset button.
The router will take a couple of minutes to reboot and set up the stock
firmware.

[1] https://www.cudy.com/blogs/faq/openwrt-software-download
[2] https://drive.google.com/drive/folders/1BKVarlwlNxf7uJUtRhuMGUqeCa5KpMnj
[3] https://www.cudy.com/en-us/blogs/faq/how-to-recovery-the-cudy-router-from-openwrt-firmware-to-cudy-official-firmware

Signed-off-by: Derek Denk <derek.denk@live.com>
Link: https://github.com/openwrt/openwrt/pull/21266
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:01:24 +01:00
Mikhail Zhilkin
ff5e66a920 mediatek: add support for Routerich BE7200
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This PR adds support for Routerich BE7200 router.

Specification
-------------
- SoC       : MediaTek MT7987A Quad-core ARM Cortex-A53 2.0 GHz
- RAM       : 1024 MiB DDR4
- Flash     : SPI-NAND 512 MiB (Giga Device)
- WLAN      : MediaTek MT7992E, WiFi 7
  - 2.4 GHz : b/g/n/ax, MIMO 4x4
  - 5 GHz   : a/n/ac/ax, MIMO 4x4
- Ethernet  : 10/100/1000 Mbps x3 (LAN, Airoha AN8855AE)
              10/100/1000/2500 Mbps x1 (WAN, SoC internal phy)
- USB       : 3.0 x1
- Buttons   : Mesh, Reset
- LEDs      : 1x Status (blue), gpio-controlled
              1x WiFi (blue), gpio-controlled
              1x mesh (blue), gpio-controlled
              3x LAN activity (blue), gpio-controlled
              1x WAN activity (blue), gpio-controlled
              1x WAN no-link (red), gpio-controlled
- Power     : 12 VDC, 1.5 A

Installation
------------
1. Update stock firmware via the web interface (don't keep settings).

Update U-Boot (optional)
------------------------
After installing OpenWrt, you may want to install opensource U-Boot.
1. Install kmod-mtd-rw:
   apk update && apk add kmod-mtd-rw
2. Unlock bootloader:
   insmod mtd-rw i_want_a_brick=1
   mtd unlock BL2
   mtd unlock FIP
3. Download and write open-source BL2 and FIP:
   cd /tmp
   wget https://.../openwrt-mediatek-filogic-routerich_be7200-preloader.bin
   wget https://.../openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip
   mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-preloader.bin BL2
   mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip FIP
4. Reboot the router.

Return to stock
---------------
1. Update OpenWrt wirh the vendor's firmware (don't keep settings).

Recovery (original U-Boot)
-----------------------------
1. Press Reset button and power on the router. After ~10 sec release
   the button;
2. Upload and flash squashfs-sysupgrade.itb image via the web interface.

Recovery (open-source U-Boot)
-----------------------------
1. Place OpenWrt
   'openwrt-mediatek-filogic-routerich_be7200-initramfs-recovery.itb'
   image on the tftp server (IP: 192.168.1.254)
2. Press Reset button and power on the router. After ~10 sec release
   the button.
3. Use OpenWrt initramfs system for recovery

Recovery (full disaster)
------------------------
Use UART and mtk_uartboot tool.
Link: https://github.com/981213/mtk_uartboot

USB power control
-----------------
Disable: echo disabled > /sys/devices/platform/usb-power/state
Enable: echo enabled > /sys/devices/platform/usb-power/state

UART
----
UART pins are silkscreened on the PCB. Don't connect Vcc.
Serial connection parameters: 115200, 8n1, 3.3V

MAC addresses
-------------
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 24:0f:5e:xx:xx:30 | label     |
| LAN     | 24:0f:5e:xx:xx:31 | label+1   |
| WLAN 2g | 24:0f:5e:xx:xx:32 | label+2   |
| WLAN 5g | 24:0f:5e:xx:xx:33 | label+3   |
+---------+-------------------+-----------+
The WLAN 2g MAC was found in 'Factory', 0x4

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21235
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 23:30:27 +01:00
Mikhail Zhilkin
8398a03e29 arm-trusted-firmware-mediatek: add mt7987-spim-nand0 build
This commit adds a new non-ubi spim-nand build for mt7987.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21235
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 23:30:27 +01:00
Jonas Jelonek
e581929341 realtek: dsa: rtl931x: configure phy ability source
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The MAC can get PHY abilities, link status, etc. via different ways. In
RTL931x, the corresponding register needs to be setup properly. By
default, all ports use out-of-band MDIO polling to retrieve that
information. Thus, PHY-backed ports usually work with the default
setting.

For SFP ports, there is no MDIO polling available. Instead, the SerDes
ability bus needs to be used to retrieve the link information.

So far, the bootloader (e.g. U-boot) had to properly initialize that
setting. Instead of relying on that, do that properly during MAC setup.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21351
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 21:35:28 +01:00
Felix Fietkau
e782341848 unetmsg: fix variable shadowing bug in network_rx_cleanup_state()
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
The for-in loop variable 'name' was shadowing the function parameter,
causing remote subscription cleanup to fail when hosts disconnect.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-01-02 20:20:16 +01:00
Jacob Potter
b2c0182f26 realtek: rtl838x: fix lan9 and lan10 on Netgear GS110TUP
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
The GS110TUP's lan9 port is connected via a QSGMII PHY to SERDES 2, and
therefore should use the SWITCH_PORT_SDS macro instead of SWITCH_PORT. This
was missed in e956adfe because the GS110TUP is not particularly well
documented and the old code was confusing.

lan10 is an SFP and doesn't have an onboard PHY, so also remove its
associated PHY references and update it to match other devices' SFP ports.

Fixes: https://github.com/openwrt/openwrt/issues/21324
Signed-off-by: Jacob Potter <jacob@j4cbo.com>
Link: https://github.com/openwrt/openwrt/pull/21346
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 18:10:05 +01:00
Robert Senderek
96ad29a0f3 mvebu: Add support for WD MyCloud EX2 Ultra
Hardware
--------
Marvell Armada 385 (MV88F6820)
1GB RAM
256MB NAND
1x 1Gbit
2x USB 3.0
2x SATA-III
UART: 115200 8N1 3.3V
RTC
Weltrend MCU WT6703F connected via UART1 for Power LED / PWM Fan / hw reset / WoL

Installation
------------
Connect UART 3.3V adapter to JP2  pins: 1-RX / 2-GND / 5-TX

Use USB2.0 FAT32 pendrive with openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin
 1. stop boot by pressing 1
 2. usb start
 3. fatload usb 0:1  0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin;bootm 0x02000000 -
 4. do backup mtd1 mtd3
 5. use sysupgrade

Or tftp
 1. stop boot by pressing 1
 2. setenv ethact egiga2;setenv serverip 192.168.11.114;setenv ipaddr 192.168.11.113
 3. tftpboot 0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin; bootm 0x02000000 -
 4. do backup mtd1 mtd3
 5. use sysupgrade

or Evgeny Kolesnikov <evgenyz@gmail.com> method from his failed PR 2040

- Using original firmware's network settings obtain SSH access to the device.
- Put *-image-cfs-factory.bin and *-uImage-factory.bin images into device's /tmp directory.
- Write kernel (uImage) image 'flash_eraseall /dev/mtd1 && nandwrite --markbad -p /dev/mtd1 /tmp/*-uImage-factory.bin'.
- Write rootfs (image-cfs) image 'ubiformat /dev/mtd3 -f /tmp/*-image.cfs-factory.bin -y'.
- Reboot the device.

Installation (upgrade):

Use *-sysupgrade.bin in a usual way.
Weltrend MCU control is done via uart1 19200
install coreutils-stty
stty -F /dev/ttyS1 raw speed 19200
stty -F /dev/ttyS1 raw speed 19200

PWM Fan Control
off: 00
echo -n -e '\xfa\x02\x00\x00\x00\x00\xfb' > /dev/ttyS1
slow: 5F
echo -n -e '\xfa\x02\x00\x5f\x00\x00\xfb' > /dev/ttyS1
max: FF
echo -n -e '\xfa\x02\x00\xff\x00\x00\xfb' > /dev/ttyS1

Power LED Control
Blue
echo -n -e '\xfa\x26\x00\x11\x00\x01\xfb' > /dev/ttyS1
Red
echo -n -e '\xfa\x26\x00\x14\x00\x01\xfb' > /dev/ttyS1
Orange
echo -n -e '\xfa\x26\x00\x12\x00\x01\xfb' > /dev/ttyS1

more here: https://github.com/c-MM/mcm-daemon/blob/master/mcm.h

Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
Link: https://github.com/openwrt/openwrt/pull/17779
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 18:07:42 +01:00
Yanase Yuki
f92ee7a8e5 treewide: switch to HTTPS URL
Avoids insecure plain HTTP.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
edc3e82349 f2fs-tools: update project URL
Use redirected new URL.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
9d71d20125 adb: update project URL
It seems old website has been retired.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
ac4f2e178b iw: update project URL
It seems project URL has been changed.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
85cc7393ed iproute2: update project URL
It seems project URL has been changed.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
69e90f0bc9 ebtables: update project URL
Website has been moved to netfilter.org.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
605879f232 sysfsutils: update project URL
Project has been moved to GitHub.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
1be208d805 readline: update project URL
It seems domain has been changed.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
c965e82328 libxml2: update project URL
It seems old website has been retired.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
c8756e825f treewide: update SELinux project URL
It seems old website has been retired.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
69e33d2c3f lantiq: remove intel.com from URL
Intel doesn't have lantiq anymore.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
ef6d7ba43f jansson: update project URL
Old website redirects to github.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
7772a958cd treewide: remove lantiq dot com URL
This website is offline.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
c95e03c7b7 treewide: use HTTPS URL for www.kernel.org
Avoids insecure plain HTTP.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
00f924abad treewide: use HTTPS URL for GNU websites
Avoids insecure plain HTTP.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Yanase Yuki
ac755f983a treewide: update u-boot URL
U-Boot website has been moved to docs.u-boot.org.

Signed-off-by: Yanase Yuki <dev@zpc.st>
Link: https://github.com/openwrt/openwrt/pull/21279
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:07:02 +01:00
Markus Stockhausen
7bfa1fa83b realtek: rename smi-address dts property
The rtl9300,smi-address property was first developed for the RTL930x
targets. So it got a device specific prefix. Nowadays it is used for
RTL931x targets too. Convert it to our gerneric realtek prefix.

find ./realtek -type f -exec sed -i 's/rtl9300,smi-address/realtek,smi-address/g' {} +

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21343
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:05:02 +01:00
Markus Stockhausen
cd13ed6fcf realtek: rt-loader: allow piggy-backed uimage
Until now rt-loader expects a piggy-backed lzma compressed data
stream. Be more flexible and allow a piggy-backed uimage as well.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Markus Stockhausen
4491f1d233 realtek: rt-loader: rename flash loading function
The loading function searches the image on flash (or its memory
copy). Rename it to make clearer what the function does. Adapt
comments accordingly.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Markus Stockhausen
2e74ef5be1 realtek: rt-loader: make search_image() generic
Until now search_image() is used for searching a uImage on
flash (or the memory mapped equivalent). In a future commit
this will be reused to search for a piggy-backed uimage.
Make this function generic by

- replacing "flash" with "image" in variables
- Search bytewise and do not rely on 4 byte alignment
- remove 2 obsolete variables
- move console output to caller

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Markus Stockhausen
8f66b33503 realtek: rt-loader: enhance is_uimage()
Until now is_uimage() is only a crc check and the caller
still needs to check other bits of the uimage header. Make
this function what it is meant to be.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Eric Fahlgren
7a78dc4a5d package: ethtool: specify just one default variant
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Inadvertently defining 'DEFAULT_VARIANT' on both ethool and
ethtool-full variants resulted in

    $ make defconfig
    tmp/.config-package.in:121615:error: recursive dependency detected!
    tmp/.config-package.in:121615:  symbol PACKAGE_ethtool-full is selected by PACKAGE_ethtool
    tmp/.config-package.in:121605:  symbol PACKAGE_ethtool depends on PACKAGE_ethtool-full

Fix this by simply undefining 'DEFAULT_VARIANT' on the ethtool-full
variant, which is ugly, but expedient.

Fixes: https://github.com/openwrt/openwrt/commit/f4fdb996
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21363
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 17:49:56 +01:00
Eric Fahlgren
f4fdb9964a treewide: add explicit default variant
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Some packages with variants did not specify the default among the
alternatives, so were left without any apk 'provider_priority'
for that package.  This caused the apk solver to select the wrong
variant, silently changing the requested package list.

Notable among these were busybox, procd and the hostapd/wpad suite.
This behavior presented in the imagebuilders when creating the
image as follows, silently replacing packages even when explicitly
requested:

    $ make image PACKAGES=busybox
    ...
    ( 14/148) Installing busybox-selinux (1.37.0-r6)
    ...

We add 'DEFAULT_VARIANT:=1' to the packages that were missing one,
providing apk with sufficient information to choose the correct
package.

See link below for further examples and discussion.

Link: https://github.com/openwrt/openwrt/pull/21288#issuecomment-3704101422
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21358
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 14:46:30 +01:00
Wei-Ting Yang
c1281a501e util-linux: update to 2.41.3
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Release notes:
https://www.kernel.org/pub/linux/utils/util-linux/v2.41/v2.41.3-ReleaseNotes

Also update URL to use HTTPS.

Signed-off-by: Wei-Ting Yang <williamatcg@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21276
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 01:24:55 +01:00
Wei-Ting Yang
99fd5aa496 tools: util-linux: update to 2.41.3
Release notes:
https://www.kernel.org/pub/linux/utils/util-linux/v2.41/v2.41.3-ReleaseNotes

Remove upstreamed:
110-meson-fix-a-bug-in-posixipc_libs-configuration.patch

Signed-off-by: Wei-Ting Yang <williamatcg@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21276
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 01:24:55 +01:00
Hauke Mehrtens
2139360a78 libiwinfo: update to Git HEAD (2025-11-29)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
2ebef3da84e8 iwinfo: Query hostapd for 'ssid2'

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/21347
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-01 17:12:23 +01:00
Markus Stockhausen
8e6cd2608a realtek: setup cpu port in soc_info structure
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
A lot of soc_info usage has been reorganized. Nevertheless there
are some consumers left. A very critical one is the dsa/qos coding.
It makes use of the cpu_port in this shared structure. This is
totally broken as that info is never properly initialized. Fill
the cpu_port according to the identified hardware.

Remark: Looking at the prom.c history soc_info.cpu_port was never
setup since the beginning of time. So no "fixes" tag here.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00
Markus Stockhausen
6b2e7ffd4b realtek: RTL930x: setup highmem registers during init
For some reason the highmem configuration of RTL930x
devices was totally missed until now. Take over the
setup from the SDK. This will avoid boot stalls on
switches with more than 256 MB RAM when switching
over to kernel 6.18.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00
Markus Stockhausen
88e79af543 realtek: determine memory size during initialization
For proper highmem initialization on RTL930x the size of the
installed memory is needed during early bootup. Enhance the
soc_info structure and fill the data from the registers.

While we are here remove the obsolete compatible variable from
the soc_info structure.

Adapt boot message to show the memory size.

old: SoC Type: Realtek RTL9301 rev B (6487)
new: Realtek RTL9301 rev B (6487) SoC with 512 MB

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00
Markus Stockhausen
8337573422 realtek: harmonize variables in prom.c
There is mix of variable naming in prom.c. Use a fixed
prefix of "rtl_" for all static variables. Additionally
remove the prefix from rtl83xx_set_system_type as it is
a generic function for all SoC types.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00
George Sapkin
2c81176f2b kernel/rtl8812au-ct: provide a virtual kmod
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Switch rtl8812au-ct to use the new virtual kmod provides semantic.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 18:16:48 +01:00
George Sapkin
8f4c64b930 kernel/ath10k: provide a virtual kmod
Switch ath10k and related kmods to use the new virtual kmod provides
semantic and mark ath10k as the default variant.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 18:16:48 +01:00
George Sapkin
01fa50b774 kernel/r8169: provide a virtual kmod
Switch r8169 and related kmods to use the new virtual kmod provides
semantic and mark r8169 as the default variant.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 18:16:48 +01:00
George Sapkin
d75a6bed7a ca-certificates: provide a virtual package
Switch ca-certs provides to use the new virtual provides semantic that
enables ca-bundle and ca-certificates to be installed side-by-side.

Provide the new format virtual ca-certificates-any in ca-bundle.

Fixes: https://github.com/openwrt/openwrt/issues/21257
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 18:16:48 +01:00
George Sapkin
9b37b7185c build: provide virtual self in kmods
Add an implicit self-provide to kmods. apk can't handle self provides,
be it versioned or virtual, so opt for a prefix and a suffix instead.
Package name without a prefix/suffix is too generic and might conflict
with other packages, e.g. wireguard. This allows several variants to
provide the same virtual package without adding extra provides to the
default one, e.g. r8169 implicitly provides kmod-r8169-any and is marked
as default, so r8125 can explicitly provide @kmod-r8169-any as well.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 18:16:48 +01:00
George Sapkin
5ed650acbf build: add support for virtual provides
Allow defining virtual provides using the PROVIDES field by prefixing
them with @, e.g.:

PROVIDES:=@ca-certs

Virtual provides don't own the provided name and multiple packages with
the same virtual provides can be installed side-by-side. Packages must
still take care not to override each other's files.

Add an implicit self-provide to packages. apk can't handle self
provides, be it versioned or virtual, so opt for a suffix instead. This
allows several variants to provide the same virtual package without
adding extra provides to the default one, e.g. wget implicitly provides
wget-any and is marked as default, so wget-ssl can explicitly provide
@wget-any as well.

Filter out virtual provides when generating metadata.

Filter out virtual provides prefix and self provide where appropriate.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 18:16:48 +01:00
George Sapkin
cefbf1184f build: refactor provides logic
Refactor provides logic into a helper define and use it for both apk and
control. Document the behavior.

Store preformatted provides in Package/$(1)/PROVIDES similar to defines.

Remove unnecessary logging.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21288
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 18:16:48 +01:00
John Audia
b638d886f0 kernel: bump 6.12 to 6.12.63
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.63

Manually rebased:
  qualcommax/patches-6.12/0113-remoteproc-qcom-Add-secure-PIL-support.patch
  qualcommax/patches-6.12/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch

Removed upstreamed:
  airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.63&id=7be679104357439ff6eab076975f5f74368acd69

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc

Co-authored-by: Goetz Goerisch <ggoerisch@gmail.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21329
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 17:55:44 +01:00
John Audia
b3d1da9115 generic: add missing symbol
Set SND_SOC_NAU8325 to no

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21329
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-31 17:55:44 +01:00
Álvaro Fernández Rojas
8b93c563ad kernel: r8168: fix CFLAGS with linux 6.15+
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Fix r8168 module CFLAGS with kernels >= v6.15.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-31 09:43:02 +01:00
Álvaro Fernández Rojas
b3d27b0115 kernel: r8101: fix CFLAGS with linux 6.15+
Fix r8101 module CFLAGS with kernels >= v6.15.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-31 09:43:02 +01:00
Eric Fahlgren
b71f4665cd mediatek: filogic: fix supported_devices list for gl-mt2500
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
The SUPPORTED_DEVICES sets for both Maxlinear (v1) and Airoha (v2)
devices were identical, so sysupgrade was unable to detect when an
incorrect image was being installed.  This caused "soft bricking" of
devices when a v1 image was installed on a v2 device, and vice versa.

Fix this by making the supported_devices distinct for each device
version, by renaming the devices with a version-specific name.
This is reflected in the file name and the image metadata.

Fixes: https://github.com/openwrt/openwrt/issues/20566
Fixes: https://github.com/openwrt/asu/issues/1525
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20632
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-30 22:59:44 +01:00
Andrii Kuiukoff
3af16b2359 uboot-mediatek: comfast,cf-wr632ax: fix missing escape sequence
Add missing escape sequence to restore terminal coloring in the OpenWrt U-Boot boot menu.

Signed-off-by: Andrii Kuiukoff <andros.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21283
[Fix _bootmenu_update_title too]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-30 22:34:20 +01:00
Fil Dunsky
15df98f3b5 mediatek: add ubootmod layout for Cudy WBR3000UAX v1
This allows us to use the full size of nand,
which extends ubi size from 64Mb to 122.25Mb.

If you are at factory firmware, please refer
to [PR](https://github.com/openwrt/openwrt/pull/21141)
to boot into OpenWrt first.

1. Log in to the device and backup all the partitions,
especially unique `Factory` and `bdata` partitions
from System -> Backup / Flash Firmware -> Save mtdblock contents.
2. Install kmod-mtd-rw to unlock mtd partitions for writing:
```bash
apk update && apk add kmod-mtd-rw && insmod mtd-rw i_want_a_brick=1
```
3. Write new OpenWrt (U-Boot Layout) `BL2` and `FIP`:
```bash
mtd write openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-preloader.bin BL2
mtd write openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-bl31-uboot.fip FIP
```
4. Set static IP on your PC: `192.168.1.254`, gateway `192.168.1.1`
5. Serve openwrt-mediatek-filogic-cudy_wbr3000uax-v1-ubootmod-initramfs-recovery.itb
using TFTP server.
6. Connect Router LAN with PC LAN.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After OpenWrt initramfs recovery has booted,
clean `/dev/mtd5` ubi partition to utilize maximum of free space & create ubootenvs:
```bash
ubidetach -p /dev/mtd5; ubiformat /dev/mtd5 -y; ubiattach -p /dev/mtd5
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
```
4. Perform sysupgrade.

Tested-by: 4pda users
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21225
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-30 22:20:33 +01:00
Fil Dunsky
d7d6faf26f mediatek: add support for Cudy WBR3000UAX v1
Another OEM variation of a Cudy WR3000 series device made for Russian market.

Hardware:
 - SoC: MediaTek MT7981B
 - CPU: 2x 1.3 GHz Cortex-A53
 - Flash: 128 MiB GigaDevice SPI NAND. Flash Model: F50L1G41LB, ID: C801
 - RAM: DDR3, 512 MiB
 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
 - 1x WAN MT7531 (JXD 2531Z) 10/100/1000 Mbps
 - 4x LAN 2x MT7530 (JXD 2529S) 10/100/1000 Mbps
 - USB 3.0 port
 - Buttons: Reset, WPS
 - 8x LEDs: 2x Red, 6x Blue
 - Serial console: no need to solder, just open the case and unskrew the radiator, TX-RX, RX-TX, GND-GND, VCC do not connect, 115200 8n1
 - Power: 12 VDC, 1.5 A

+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 80:AF:CA:xx:xx:x1 | label+1   |
| 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 | label+1   |
+---------+-------------------+-----------+

Based on a factory layout with only 64mb partition for easier transition from factory to OpenWrt for users if the "intermediate" RSA signed firmware will be provided by Cudy.

**Installation**
The installation must be done via UART & TFTP by disassembling the router. On other occasions Cudy has distributed intermediate firmware and dts to make installation easier, but since this router is OEM special WB order for local RU market there is a possibility they will not provide it.

**Install using UART & TFTP**
1. Connect to UART.
2. Since the factory BL is locked and the boot process can not be stopped, you have to use mtkuartboot, hold reset, engage the power, boot into your payloaded bl2 & fip.
3. Connect to LAN and set your IP to 192.168.1.254.
4. Configure a TFTP server to serve openwrt-mediatek-filogic-cudy_wbr3000uax-v1-initramfs-kernel.bin file.
5. Run these steps in u-boot using the name of your file:

```
setenv bootfile openwrt-mediatek-filogic-cudy_wbr3000uax-v1-initramfs-kernel.bin
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.254
tftpboot
bootm
```

6. Router will boot into OpenWrt initramfs recovery, just open your browser `192.168.1.1` and sysupgrade with the `Keep settings` option turned off.

Tested-by: many 4pda users
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21225
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-30 22:20:30 +01:00
Fil Dunsky
f4c9ab6591 arm-trusted-firmware-mediatek: add Cudy DDR3 target
Since there are many similar devices from Cudy (TR3000 / WR3000E / WR3000P / WR3000S / WBR3000UAX) this will allow to create OpenWrt U-Boot layout for all of them using same DDR3 target.

Tested-by: 4pda users
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21225
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-30 22:19:09 +01:00
Hauke Mehrtens
01a87f4bd0 wifi-scripts: use OWE + country for 6GHz
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Wifi on the 6GHz band does not support open networks, configure owe by
default. 6GHz wifi also needs a country code, configure a broken country
code '00' by default to hint the user to change it.

Link: https://github.com/openwrt/openwrt/pull/21313
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-30 14:43:08 +01:00
John Audia
ed836b1a9d package: gpio-nct5104d: adapt to kernel 6.18
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
- Changing return type from void to int
- Returning error code instead of void on superio_enter() failure
- Returning 0 on success

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21218
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-30 10:44:05 +01:00
Leon M. Busch-George
bc4e7fd38e wifi-scripts: don't set wpa_pairwise for wpa=0
Without this patch, the

    if (!config.wpa)
	  	config.wpa_pairwise = null;

is overwritten immediately.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/21215
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-30 10:39:06 +01:00
Álvaro Fernández Rojas
fb15ef4b23 odhcp6c: update to Git HEAD (2025-12-29)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
8abb45065f5e dhcpv6: omit IA_NA on Request
988d5fb306b3 dhcpv6: dhcpv6_send: convert whitespaces to tabs
5e1ab3bc1be8 ra: convert if block to switch
2e6682bfcaff odhcp6c: do cleanup at exit
610e4bddb8d7 config: fix potential memory leaks in error paths
bfd7597cada1 all: add log helpers
0bb93c26d14b dhcpv6: clarifying comments
65f9ee25e5eb dhcpv6: offload FQDN construction to init_dhcpv6
48dbd38122e4 dhcpv6: migrate dhcpv6_response_is_valid to switch case

9a4d6fe802...8abb45065f

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-30 09:42:50 +01:00
Hal Martin
5578eb69c2 ipq40xx: add support for Cisco Meraki MR20
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This commit adds support for the Cisco Meraki MR20/Go GR10.

The Meraki MR20 is a Cisco 802.11ac/WiFi 5 AP with 1 Ethernet port.
It can be powered by a 12V DC barrel jack (5.5x2.5mm, center positive)
or via 802.3af POE.

The Meraki Go GR10 (codename: Maggot) is identical to the MR20
(codename: Grub), so this document will refer to both devices as the MR20.

MR20 hardware info:
* CPU: Qualcomm IPQ4029
* RAM: 256MB DDR3
* Storage: 128 MB (MX30LF1G18AC)
* Networking: 1 Gigabit Ethernet
* WiFi: QCA4019 802.11b/g/n/ac
* Serial: Internal header (J10, 2.54mm, unpopulated)

This device ships with secure boot, and cannot be flashed without
external programmers (TSOP48 NAND and I2C EEEPROM)!

Disassembly:

Remove the four rubber feet on the rear of the AP and the four
Torx T8 screws under the feet.

Using a guitar pick or similar plastic tool, insert it on the side
along the seam around the edge. Push in gently while gently lifting
the front of the housing to release the plastic retention clips.

There are 15 clips in total.

Once you have removed the plastic front (shown above already removed
so you know where the clips are), remove the 4 Philips screws holding
down the two metal WiFi antennas.

Lift the PCB gently while pushing the Ethernet port into the housing
to release it. The PCB should come free from the metal heat spreader.

The TSOP48 NAND flash (U9, Macronix/MXIC MX30LF1G18AC) is located on
the opposite side of the PCB.

To flash, you need to desolder the TSOP48 or use a 360 clip.

You also need to reprogram the I2C EEPROM (U20, Atmel 24c64).

Installation:

The dumps to flash can be found in this repository:
https://github.com/halmartin/meraki-openwrt-docs/tree/main/mr20_gr10

The device has the following flash layout (offsets with OOB data):
```
0x000000000000-0x000000100000 : "sbl1"
0x000000100000-0x000000200000 : "mibib"
0x000000200000-0x000000300000 : "bootconfig"
0x000000300000-0x000000400000 : "qsee"
0x000000400000-0x000000500000 : "qsee_alt"
0x000000500000-0x000000580000 : "cdt"
0x000000580000-0x000000600000 : "cdt_alt"
0x000000600000-0x000000680000 : "ddrparams"
0x000000700000-0x000000900000 : "u-boot"
0x000000900000-0x000000b00000 : "u-boot-backup"
0x000000b00000-0x000000b80000 : "ART"
0x000000c00000-0x000007c00000 : "ubi"
```

* Dump your original NAND (if using nanddump, include OOB data).

* Decompress `u-boot.bin.gz` dump from the GitHub repository above (dump
contains OOB data) and overwrite the `u-boot` portion of NAND from
`0x738000`-`0x948000` (length `0x210000`). Offsets here include OOB data.

* Decompress `ubi.bin.gz` dump from the GitHub repository above (dump
contains OOB data) and overwrite the `ubi` portion of NAND from
`0xc60000`-`0x8400000` (length `0x77a0000`). Offsets here include OOB data.

* Dump your original EEPROM. Change the byte at offset `0x49` to `0x1e`
(originally `0x2c` or `0x25`). Remember to re-write the EEPROM with the
modified data.
    * This can be done on Linux via the following command:
    `printf "\x1e" | dd of=/tmp/eeprom.bin bs=1 seek=$((0x49)) conv=notrunc`

**Note**: the device will not boot if you modify the board major number and
have not yet overwritten the `ubi` and `u-boot` regions of NAND.

* Resolder the NAND after overwriting the `u-boot` and `ubi` regions.

OpenWrt Installation:

* After flashing NAND and EEPROM with external programmers. Plug in an
Ethernet cable and power up the device.

* The new U-Boot build uses the space character `" "` (without quotes) to
interrupt boot.

* Interrupt U-Boot and `tftpboot` the OpenWrt initramfs image from your
tftp server
```
dhcp
setenv serverip <your_tftp>
tftpboot openwrt-ipq40xx-generic-meraki_mr20-initramfs-uImage.itb
```

* Once booted into the OpenWrt initramfs, created the `ART` ubivol with
the WiFi radio calibration from the mtd partition:
```
cat /dev/mtd10 > /tmp/ART.bin
ubiupdatevol /dev/ubi0_1 /tmp/ART.bin
```

* `scp` the `sysupgrade` image to
the device and run the normal `sysupgrade` procedure:
```
scp -O openwrt-ipq40xx-generic-meraki_mr20-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/
ssh root@192.168.1.1 "sysupgrade -n /tmp/openwrt-ipq40xx-generic-meraki_mr20-squashfs-sysupgrade.bin"
```

* OpenWrt should now be installed on the device.

Signed-off-by: Hal Martin <hal.martin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20646
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 19:41:24 +01:00
Hal Martin
593e399568 ipq40xx/meraki: refactor common device tree
qcom-ipq4029-insect-common.dtsi was common to the MR33 and MR74, but was no
longer common with the other supported Meraki devices. I have refactored
insect-common and wired-qca-common into qcom-ipq4029-meraki-common.dtsi
which contains the actual common components (e.g. NAND partitions, ART nvmem).

Individual devices reference qcom-ipq4029-meraki-insect.dtsi
plus their own individual configuration.

Signed-off-by: Hal Martin <hal.martin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20646
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 19:41:24 +01:00
Jonas Jelonek
a0805af66c realtek: pcs: rtl931x: fix SerDes mode application
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The SerDes mode setting at the end of rtpcs_931x_setup_serdes is
currently broken although it is mostly similar to what the SDK does [1].
It prevents several modes from being set, especially fiber modes. This
seems to be one (if not the only) issue for currently missing SFP
support.

Add a small helper function which takes cares of setting the mode, to
keep the still valid different procedure when using XSGMII mode. Only
this helper is called in rtpcs_931x_setup_serdes to keep it clean there.

As a functional change, call mode application in every case, not just
for SGMII, QSGMII and USXGMII. We can assume the SDK is misleading in
this case, either accidentially or on purpose. This makes SFP modules
work in theory. In practice, there still seem to be device-specific
issues which need to be fixed later. These issues may include no link
detection or link flapping.

[1] f7f85ffc14/sources/rtk-dms1250/src/dal/mango/dal_mango_construct.c (L2266)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
9efcc52a7b realtek: pcs: rtl931x: streamline hardware mode setting
The SDK and our code for finally applying the hardware mode are quite
confusing. There are two different "places" where a mode can be set,
in a SerDes register and in a global SerDes mode register. Neither the
SDK nor any of the datasheet/documentation serve any explanation for
that. The functions are just named "fiber_mode_set" and "mii_mode_set"
which is basically as useless as it can be to understand it.

Try to get rid off this confusion by naming the functions
'sds_set_mac_mode' and 'sds_set_ip_mode' to make clear where the mode
is set. While at it, also clarify the naming of 'config_mode' by
renaming it to 'config_hw_mode'.

The naming is based on the following assumption:

> Realtek uses an SerDes IP core design (probably from another vendor)
> in their switch. This supports a variety of modes and must be
> configured properly for each mode. Usually, changing the mode in the
> MAC's registers triggers a proper configuration of the SerDes IP block
> in the background.

> However, for some modes this seems to be incomplete, at least missing
> important parts so it doesn't work on its own in the end. In this
> case, the SerDes IP block needs to be configured manually with the
> missing bits to make it work.

There are several places in the SDK that support this assumption, both
for RTL931X and RTL930X (as they are somewhat similar), e.g. [1].

[1] f7f85ffc14/sources/rtk-dms1250/src/dal/longan/dal_longan_sds.c (L1746)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
d5a4387ac5 realtek: pcs: rtl931x: improve mode setting functions
Improve the current mode setting functions to address a few issues:
- add missing mode from SDK reference (instead of using the
  corresponding value as a default value)
- use and return error values
- give internal variable a more meaningful name
- consistently use lowercase letters in hex values

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
75493a812f realtek: pcs: rtl931x: merge and drop unused helper
Merge the unused helper 'rtpcs_931x_sds_fiber_disable' into Fiber mode
setting, and drop the helper itself. As with the MII helper in a
previous commit, functionality is basically the same just with a value
for OFF mode. If functionality is required later, Fiber mode setting can
be used with the OFF mode instead of carrying the unused helper until
it's used.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
65dc1ecf49 realtek: pcs: rtl931x: use hardware mode for mode setting
Use the hardware mode instead of PHY_INTERFACE_MODE_* mode for mode
setting. Adjust all affected functions and switch cases accordingly.

In MII mode setting, drop the case for 2500Base-X as this is a mistake.
In the SDK reference code, this doesn't exist [1].

[1] 69d2890a2e/sources/rtk-dms1250/src/hal/phy/phy_rtl9310.c (L817)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
f67d9ed9b4 realtek: pcs: rtl931x: merge helper into mode setting
Merge the 'rtpcs_931x_sds_disable' helper into the MII mode setting and
use that instead. The helper was essentially doing same just with a
value for OFF state.

Moreover, the name of the helper was confusing. It implied it disables
the whole SerDes. However, this is used in Fiber mode setting and thus,
cannot completely disable the SerDes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
6614fcb95e realtek: pcs: rtl931x: fix MII mode setting
The function 'rtpcs_931x_sds_mii_mode_set' does not correctly write the
register. It just write a plain value at the determined register
address. While this works for SerDes with (id mod 4 == 0), it doesn't
for the other SerDes.

Fix that by using a corresponding shift and writing only some bits
instead of the whole register.

While at it, drop an unneeded blank line, add comment to explain a bit
that is set and use the BIT(..) helper for that instead of manual shift.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
90cddeb75e realtek: pcs: rtl931x: reorder functions
Bring the RTL931X functions into a proper order for two purposes:
- be able to reuse code
- have blocks of logically connected functions

This just moves code, no functional changes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Jonas Jelonek
19585a7966 realtek: pcs: rtl931x: fix clearing symbol errors
Fix the implementation to clear symbol errors. Up to now, it was barely
functional because important modes weren't handled. Add another function
(which is needed in the future anyway) and pick to missing bits from
that function into the symbol clearing function to handle the modes
1000Base-X and 10GBaseR too. All that is based on [1].

While at it, rename the function to adhere to a common naming scheme and
fix some minor style issues.

[1] 69d2890a2e/sources/rtk-dms1250/src/hal/phy/phy_rtl9310.c (L703)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 17:06:19 +01:00
Markus Stockhausen
b8a596e40b realtek: mdio: drop family leftovers
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Now that the bus is completely configured by the dts
compatible, drop the hard coded family detection.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21274
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 12:57:05 +01:00
Markus Stockhausen
96bcabe1bf realtek: mdio: relocate reset function
Place the reset function into the config structure.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21274
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 12:57:05 +01:00
Markus Stockhausen
87a3c62e32 realtek: mdio: give bus a family independent name
There is no need to give the mdio bus a family dependent name.
Name the bus similar to the SerDes mdio bus.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21274
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 12:57:05 +01:00
Markus Stockhausen
b7f519ff3d realtek: mdio: move read/write functions to config structure
Move the read/write functions to where they belong.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21274
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 12:57:05 +01:00
Markus Stockhausen
3fb1c9c625 realtek: mdio: configure bus read/write only once.
For all families the driver uses the same read/write functions.
Drop the duplicate per-family initialization.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21274
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 12:57:05 +01:00
Markus Stockhausen
89f5678948 realtek: mdio: move cpu_port to configuration structure
Relocate the cpu port definition over to the new configuration
structure. There are several family specific places where the
driver checks port ranges. These are a wild mix of arbitrary
values (64) or constant defines. Remove them as the the central
read/write functions already have a proper check with -ENODEV
bail out in place.

With the cleanup drop the port defines as there is only one
consumer (config structure) left.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21274
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 12:57:05 +01:00
Markus Stockhausen
36f56f27ae realtek: mdio: add per family configuration structure
The mdio driver already has a family specific compatible that
is used in the dts to denote the device type. Nevertheless it
is not evaluated. The driver determines the family on its own
in rtmdio_get_family().

Break up this dependency by providing a configuration structure
that can be automatically assigned by device_get_match_data().
For now only move the rawpage variable over there.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21274
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 12:57:05 +01:00
Markus Stockhausen
349040eeb5 realtek: ethernet/dsa: Reduce mach include dependency
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The ethernet and dsa drivers still rely on several defines from
the central mach include. Move important defines over to the
driver specific includes as a first decoupling step.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21263
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-29 11:11:29 +01:00
Mikhail Kshevetskiy
d9b1c74780 airoha: spi: update airoha-snfi patches and en7523 dts
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Changes:
* use upstream patches for airoha-snfi driver
* update in kernel en7523 dts to add spinand support

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/21299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-28 12:48:12 +01:00
Zhenyu Qi
fa3b9f5149 qualcommax: ipq60xx: enable dual-boot for 360v6
Add dual-partition upgrade support for Qihoo 360v6 using the generic
bootconfig.sh library. This enables safe system upgrades with automatic
failover capability.

The device uses Qualcomm's bootconfig structure to control A/B partition
switching. The bootloader dynamically maps physical NAND partitions to
logical MTD devices based on the bootconfig, ensuring firmware always
writes to the inactive partition.

Implementation details:
- Use bootconfig.sh library (copied from ipq50xx) for bootconfig operations
- Operate on 'rootfs' partition by name instead of hardcoded offset
- Add magic header validation for safety
- Remove OEM UBI volumes (wifi_fw and ubi_rootfs) before sysupgrade
- Toggle bootconfig before removing OEM volumes

Hardware details:
- SoC: Qualcomm IPQ6000
- Flash: NAND with dual rootfs partitions (mtd16/mtd17)
- Bootconfig: controls slot selection via partition name lookup

Installation:
Standard sysupgrade process. After upgrade, the system will boot
from the new partition while preserving the old system as backup.

The OEM volume cleanup is necessary because these volumes are created
by the stock firmware and are not automatically cleaned by the standard
nand_upgrade_prepare_ubi() function, which only removes volumes named
'kernel', 'rootfs', and 'rootfs_data'. Without this cleanup, the remaining
OEM volumes consume available space, causing the creation of rootfs_data
to fail during sysupgrade.

Tested on Qihoo 360v6 running stock firmware and OpenWrt.

Signed-off-by: Zhenyu Qi <qzydustin@hotmail.com>
Link: https://github.com/openwrt/openwrt/pull/21154
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-28 12:45:40 +01:00
Álvaro Fernández Rojas
08a1cace9f kernel: r8101: fix build with linux v6.16+
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Fix r8101 module build with kernels >= v6.16.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-27 19:26:10 +01:00
Florian Maurer
7f3537ee2c ath79: cf-ew71-v2: set label-mac-device to eth1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The EW71v2 has the WAN port configured at eth1.
The printed label-mac is configured on this iface in openwrt.

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
2025-12-27 18:27:34 +01:00
Nick Hainke
2015a40c38 wifi-scripts: fix race in wireless interface creation
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
When wdev interfaces and hostapd interfaces are mixed, race conditions
can occur. Sometimes all interfaces are started correctly, sometimes only
the wdev interface and some of the hostapd interfaces, and sometimes only
the wdev interface.

Fix this by creating the wdev interfaces first, before processing
wpa_supplicant or hostapd interfaces.

Link: https://github.com/openwrt/openwrt/pull/21303
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-12-27 16:26:25 +01:00
Markus Stockhausen
5d7470d4ca realtek: fix Linksys LGS328C dts memory definition
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
RTL930x devices have highmem starting address at 0x20000000.
The Linksys LGS328C highmem definition is wrongly shared with
the larger LGS352C RTL931x model and starts at 0x90000000.
Fix it by splitting the definition.

Fixes: 853d73f ("realtek: add support for Linksys LGS328C")

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21262
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-27 14:15:11 +01:00
Robert Marko
6a1f105e72 Revert "qualcommax: ipq50xx: remove ipq5018 and qcn6122 wifi m3 fw"
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
This reverts commit 423cda97f9.

It appears that this broke remoteproc on some devices, so revert for now.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-27 12:16:15 +01:00
Nick Hainke
a6eb3d9536 wifi-scripts: fix mcast_rate type (number, not array)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
The multicast rate (mcast_rate) is defined as a single numeric value,
not an array. The ucode scripts already expect a single number, and
the OpenWrt documentation specifies this option as an integer [0].

Adjust the wireless schema accordingly. This also fixes the wdev.uc
call path for the iw fallback mesh setup.

[0] - https://openwrt.org/docs/guide-user/network/wifi/basic

Link: https://github.com/openwrt/openwrt/pull/21291
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-12-27 11:18:49 +01:00
Nick Hainke
a18ef412ae wifi-scripts: fix wdev fallback for mesh interfaces
The previous wdev.uc invocation failed for mesh interfaces.
Rewrite it as a loop so the mesh interface is created correctly
when no wpa_supplicant mesh support is installed.

Link: https://github.com/openwrt/openwrt/pull/21291
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-12-27 11:18:49 +01:00
Yuhei Amemiya
436c9af039 mediatek: add support for Elecom WRC-G01
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Hardware is identical to WRC-X3200GST3.
- SoC: MediaTek MT7622
- RAM: 512MB
- Flash: 128MB SPI-NAND

The -W suffix in the retail name (WRC-G01-W) denotes the casing color
and is omitted from the model name in the OpenWrt configuration to
maintain consistency with other Elecom devices.

Signed-off-by: Yuhei Amemiya <minihui@me.com>
Link: https://github.com/openwrt/openwrt/pull/21238
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-26 20:07:31 +01:00
Liangbin Lian
e9fd3facd0 base-files: fix default_postinst clearing luci cache
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
The path to the LuCI index cache file has changed to
/tmp/luci-indexcache.*.json since OpenWrt 22.03.

Update functions.sh to align with luci.mk.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21280
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-26 20:02:59 +01:00
Dmitry Mostovoy
9da57e2f82 mediatek: add kmod-usb3 to default package set of WR3000P
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Include XHCI USB drivers on the Cudy WR3000P v1 router, the drivers are
required to be able to use the USB port for USD devices.

Closes: https://github.com/openwrt/openwrt/issues/21231
Fixes: 04e9d154f2 ("mediatek: filogic: add support for Cudy WR3000P v1")
Signed-off-by: Dmitry Mostovoy <dmitry.mostovoy@ceifx.com>
Link: https://github.com/openwrt/openwrt/pull/21281
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-26 13:55:18 +01:00
Nick French
cb94962ac4 ath79: Fix syntax error in 10_fix_wifi_mac
This typo makes the script fail with:
-ash: /etc/hotplug.d/ieee80211/10_fix_wifi_mac: line 66: syntax error: unexpected word (expecting ")")

which ultimately prevents the mac address for certain devices wireless cards being set correctly

Signed-off-by: Nick French <nickfrench@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21287
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-26 13:37:02 +01:00
Robert Senderek
c1290fa48c qualcommax: ipq50xx: remove cpufreq scaling
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
ipq5018 do not support freq scaling and therefore stuck on 800Mhz
This patch allows CPU to run with 1.008 Ghz as designed

Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
Link: https://github.com/openwrt/openwrt/pull/21185
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-26 12:23:58 +01:00
Nick Hainke
00e6c18a93 wifi-scripts: ucode: fix wpa_supplicant mesh
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Mesh interfaces may not define an encryption setting. This results in
a ucode runtime error when parse_encryption() is called:
  Reference error: left-hand side expression is null
  In parse_encryption(), file /usr/share/ucode/wifi/iface.uc, line 20, byte 32:
    called from function setup_sta (/usr/share/ucode/wifi/supplicant.uc:59:31)
    called from function generate (/usr/share/ucode/wifi/supplicant.uc:243:41)
    called from function setup (./mac80211.sh:254:61)
    called from anonymous function (./mac80211.sh:342:14)
   `    config.auth_type = encryption[0] ?? 'none';`
    Near here ------------------------^

Link: https://github.com/openwrt/openwrt/pull/21293
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-12-25 22:00:38 +01:00
Elwin Huang
95112a4939 wifi-scripts: add missing 802.11be type in hwmodelist
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Add EHT* check so that the hwmode will display 802.11be capability correctly.

Signed-off-by: Elwin Huang <s09289728096@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21267
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-12-25 19:45:41 +01:00
Harin Lee
2ebcda1ea6 wifi-scripts: fix macaddr check in mac80211.uc
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
This fixes a simple logic error in the macaddr existence check in mac80211.uc.

Signed-off-by: Harin Lee <me@harin.net>
Link: https://github.com/openwrt/openwrt/pull/21277
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-25 17:00:12 +01:00
Robert Marko
3602a98f55 ipq-wifi: update to Git HEAD (2025-12-25)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
ed56ad0 qcn6122: Add BDF for Linksys MX6200
1f83ec8 ipq5018: Add BDF for Linksys MX6200

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-25 12:44:20 +01:00
George Moussalem
501e54b6c2 qualcommax: ipq50xx: fix reo2host-status interrupt vector
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Interrupt vector for reo2host-status is wrongly assigned.
Status interrupts weren't received and a workaround was applied to
mac80211 to periodically poll the reo status ring. Therefore, the
workaround can be removed with the proper hardware interrupt line
assigned.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21271
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 12:44:14 +01:00
Robert Marko
bce8432bbd microchipsw: sync with DTS sent upstream
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Sync the DTS with the version sent upstream, clock bindings also.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2025-12-24 10:57:17 +01:00
George Moussalem
d992d95b52 qualcommax: ipq50xx: add support for Linksys MX6200
Linksys MX6200 is a triband Wi-Fi 6E wireless router.

Speficiations:
* SoC: Qualcomm IPQ5018 (64-bit dual-core ARM Cortex-A53 @ 1.0Ghz)
* Memory: Nanya NT5CC256M16ER-EK (512 MiB DDR3-933)
* Serial Port: 3v3 TTL 115200n8
* Wi-Fi: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax)
	 QCN6102 (2x2:2 5 Ghz 802.11an/ac/ax)
	 QCN6122 (2x2:2 6 Ghz 802.11an/ac/ax)
* Ethernet: IPQ5018 integrated virtual switch connected to:
	    - LAN Port: Internal IPQ5018 GE PHY
	    - WAN Port: Maxlinear Ethernet GPY115C PHY
* Flash: Macronix MX35UF2GE4AD (256 MiB)
* LEDs: 1x multi-color PWM LED
* Buttons: 1x WPS (GPIO 27 Active Low)
           1x Reset (GPIO 28 Acive Low)
* FCC ID: 2AYRA-08436

Flash instructions:
************************************************************************
NOTE: serial access is required! Although the web UI allows you to
install the Openwrt image, secure boot is enabled which will prevent
booting an unsigned image. The boot sequence must be adjusted in U-boot
to allow booting unsigned images.
************************************************************************

1. On OEM firmware, login to the web UI (typically @ http://192.168.1.1)
and click 'CA' in the bottom right corner.
Then click -> Connectivity -> Manual Upgrade.
Alternatively, browse to
http://<router IP>/fwupdate.html.
Upload openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi.
Continue with step 5.
2. Installation on alternate partition using serial connection from OEM
firmware (default login: root, password: admin):
flash_erase /dev/mtd19 0 0
nandwrite -p /dev/mtd19 openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi
reboot
Continue with step 5.
3. Installation using serial connection from initramfs
setup tftp server listening on IP in 192.168.1.0/24 (other than the
router IP 192.168.1.1). In U-boot, load the initramfs image to memory:
tftp $loadaddr <your IP>:openwrt-qualcommax-ipq50xx-linksys_mx6200-initramfs-uImage.itb
boot the image using command:
bootm $loadaddr
when fully booted, scp the sysupgrade image to your router IP (default:
192.168.1.1):
scp -O <path>/openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-sysypgrade.bin root@192.168.1.1:/tmp/
use sysupgrade to flash the image to nand:
sysupgrade -n -v /tmp/openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-sysupgrade.bin
Continue with step 5.
4. Optionally install on alternate partition. From Openwrt:
mtd -r -e rootfs_1 -n write openwrt-qualcommax-ipq50xx-linksys_mx6200-squashfs-factory.ubi rootfs_1
Continue with step 5.
5. Setup U-boot for ability to dual boot signed (stock) and non-signed
(Openwrt) images with auto-detection.
From U-boot, run (be aware: copy line by line):
setenv setnandbootargs 'setenv bootargs init=/sbin/init ubi.mtd=rootfs rootfstype=squashfs rootwait'
setenv nandinitcmd 'setenv mtdids nand0=nand0; run setrootfscmd; ubi part rootfs 2048'
setenv setrootfscmd 'if test $boot_part = 1; then setenv mtdparts mtdparts=nand0:0x${imgsize}@0x${prikern}(rootfs); else setenv mtdparts mtdparts=nand0:0x${imgsize}@0x${altkern}(rootfs); fi'
setenv readhdr1cmd 'ubi read $loadaddr kernel 0x40; setexpr IMGOFF $loadaddr + 0x10; setexpr CODEOFF $loadaddr + 0x14; setexpr SIGOFF $loadaddr + 0x1c; setexpr CERTOFF $loadaddr + 0x24'
setenv readhdr2cmd 'setexpr.l HDR *$loadaddr; setexpr.l IMGSZ *$IMGOFF; setexpr.l CODESZ *$CODEOFF; setexpr.l SIGSZ *$SIGOFF; setexpr.l CERTSZ *$CERTOFF; setexpr TSIZE $CODESZ + $SIGSZ; setexpr TSIZE $TSIZE + $CERTSZ'
setenv testmbncmd 'if test $HDR -ne edfe0dd0 -a $IMGSZ -eq $TSIZE; then bootipq; else ubi read $loadaddr kernel $kernsize; run setnandbootargs; bootm $loadaddr; fi'
setenv bootcmd2 'if test $auto_recovery = no; then bootipq; else run nandinitcmd; run readhdr1cmd; run readhdr2cmd; run testmbncmd; fi'
setenv bootcmd 'run bootcmd2'
saveenv
6. Back to the OEM firmware.
Download firmware from OEM website:
MX6200: https://support.linksys.com/kb/article/408-en/
From serial/SSH, in Openwrt, flash OEM firmware to alternate partition:
mtd -r -e rootfs_1 -n write FW_MX6200_1.0.11.216041_prod.signed.img rootfs_1

Switching active partition:
1. From U-boot, executive the following to switch to partition 1:
setenv boot_part 1
for partition 2:
setenv boot_part 2
2. From Openwrt:
fw_printenv boot_part
In case it's 1:
fw_setenv boot_part 2
. /lib/upgrade/platform.sh
linksys_bootconfig_set_primaryboot "0:bootconfig" 1
linksys_bootconfig_set_primaryboot "0:bootconfig1" 1
In case it's 2:
fw_setenv boot_part 1
. /lib/upgrade/platform.sh
linksys_bootconfig_set_primaryboot "0:bootconfig" 0
linksys_bootconfig_set_primaryboot "0:bootconfig1" 0
and
reboot

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:42:39 +01:00
George Moussalem
7d68582579 qualcommax: ipq50xx: upgrade SMEM dualboot Linksys devices
Add support for upgrades on dual firmware Linksys devices with the
partition table stored in SMEM and that store both the kernel and rootfs
in a single partition. Switching the active boot partition requires
updating the partition info table in SMEM in addition to setting
the active boot partition in a U-boot variable as U-boot will keep them
in sync upon reboot if they're not.

U-boot always sets the name of the active partition to rootfs and that
of the inactive partition to rootfs_1 in SMEM. when Linux loads the
partition table from SMEM it will load the right partition based on the
offset set in the SMEM partition table. For upgrades, flashing to the
alternate partition will always be to rootfs_1, while flashing the
current partition will be on rootfs.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:42:39 +01:00
George Moussalem
d02de1d35a qualcommax: ipq50xx: functions for bootconfig partition
The BOOTCONFIG partition is used by Qualcomm's boot chain to store
metadata about the device's startup configuration. It contains info such
as versioning, configuration flags, primary boot partition, and more.

Newer devices with dual boot partitions not only store the active boot
partition in a U-boot variable but also in partition info in the
BOOTCONFIG partition. As such, add library functions to set and toggle
the active boot partition.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:42:39 +01:00
George Moussalem
606a87ec44 qualcommax: ipq50xx: move bootargs to Linksys board files
Move setting kernel bootargs from the base template down to the
respective Linksys board files. This allows for having devices which
require different bootargs use the base template device tree file.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:42:39 +01:00
George Moussalem
597a2d7d18 qualcommax: ipq50xx: load Linksys partition tables from SMEM
The partition table on Linksys devices with a Qualcomm AX IPQ SoC is
stored in SMEM. As such, load partition table from SMEM rather than
statically defining them in their respective device trees. This helps
generalize the base template and requires less maintenance.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:42:39 +01:00
George Moussalem
423cda97f9 qualcommax: ipq50xx: remove ipq5018 and qcn6122 wifi m3 fw
The current ath11k driver does not support loading m3 firmware for
IPQ5018 and QCN6122 wifi. Although m3 firmware entries are specified
in Q6 WCSS nodes, the driver actually skips loading them. Editing the
driver to force loading m3 results in Q6 crashes and non-functioning
wifi. As such, remove m3 firmware entries for all boards until there's
proper support in the ath11k driver.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21110
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:36:31 +01:00
George Sapkin
5e32bfbf4b toolchain: fix libgcc ABI for libc
libc depends on knowing libgcc's ABI, so it needs to be evaluated first.
Otherwise libc will depend on an ABI-less libgcc causing the rest of the
toolchain to fail.

Building package index...
ERROR: unable to select packages:
  libgcc (virtual):
    note: please select one of the 'provided by'
          packages explicitly
    provided by: libgcc1
    required by: world[libgcc]

Before:

libc fused dependencies: libgcc
libgcc fused dependencies:
libatomic fused dependencies: libgcc1

After:

libgcc fused dependencies:
libc fused dependencies: libgcc1
libatomic fused dependencies: libgcc1

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21265
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:05:52 +01:00
George Sapkin
56bc4a0d89 build: fix missing PKG_INFO_DIR
If the first built package has an ABI, PKG_INFO_DIR might not exist, so
ensure it does.

Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21265
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-24 10:05:52 +01:00
Jonas Jelonek
b43f7bc9c2 realtek: pcs: rtl931x: add helper for SerDes power up/down
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Add a dedicated helper 'rtpcs_931x_sds_power' to power down/up a SerDes.
Up to now, plain register writes to the corresponding register were used
in several places and with slightly different syntax. Use the helper to
replace the existing boilerplate code for powering on/off SerDes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:34 +01:00
Jonas Jelonek
7899dfa6ef realtek: pcs: rtl931x: separate and reuse 1000base-x config
Move the configuration of 1000Base-X mode into its own function. This
way, redundant code can be replaced by a single function call.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:34 +01:00
Jonas Jelonek
5334b41b00 realtek: pcs: rtl931x: reorder modes in mode configuration
Reorder the modes within the switch statement in
rtpcs_931x_sds_config_mode to have a proper and non-confusing order.
Have fiber modes first and MII modes after, and sort all modes in
ascending speed/capabilities order.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:33 +01:00
Jonas Jelonek
6079228b11 realtek: pcs: rtl931x: use hardware mode for configuration
Pass the SerDes hardware mode to rtpcs_931x_sds_config_mode instead of
the PHY_INTERFACE_MODE_* mode and use it. Replace matched modes
accordingly.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:33 +01:00
Jonas Jelonek
d7a184e3b1 realtek: pcs: rtl931x: map interface mode to hardware mode
The PCS driver is intended to use a dedicated hardware mode in the
future because the hardware capabilities and modes of the SerDes do not
align with the PHY_INTERFACE_MODE_* modes.

For the beginning, use the previously introduced generic mode mapping
in the SerDes setup and assign the determined hardware mode to the
corresponding field of a SerDes instance. This allows parallel usage of
both mode representations for the time being, until the phy_interface_t
modes can be dropped from internal functions completely.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:33 +01:00
Jonas Jelonek
9856f6b0aa realtek: pcs: rtl931x: move SerDes config out of setup
Slim the rtpcs_931x_setup_serdes entrypoint by moving the SerDes
configuration sequences for the different SerDes modes into a dedicated
function called rtpcs_931x_sds_config_mode. They form a logical block
similar to what the SDK does and can be taken out to follow the
'divide & conquer' principle.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:33 +01:00
Jonas Jelonek
93296c9e85 realtek: pcs: rtl931x: don't return error on USXGMII setup
Configuring USXGMII on RTL931X was disable because it is not setup
properly right now. Affected devices need to rely on U-boot setup for
now. However, it is not the proper way to return an error in case we
just want to skip USXGMII configuration. Thus, just return 0 in that
case indicating it is properly configured.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:33 +01:00
Jonas Jelonek
0f176ef961 realtek: pcs: add mapping for SerDes hardware mode
Add a generic mapper for mapping the PHY_INTERFACE_MODE_* modes to the
SerDes hardware modes RTPCS_SDS_MODE_*. This is to be used by all
subtargets step-by-step and avoids having subtarget-specific code for
that simple mapping.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:33 +01:00
Jonas Jelonek
1912f45b48 realtek: pcs: rename SerDes mode field
Rename the mode field in rtpcs_serdes from 'mode' to 'hw_mode' to make
clear what it actually is, to avoid confusion with the phy_interface_t
'mode' usually passed to functions.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21184
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:53:33 +01:00
Shiji Yang
dbf2cf1f00 treewide: dts: update rtl836x switch sck/sda gpio properties
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Rename them to follow the rtl836x driver gpiod changes.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21143
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:22:02 +01:00
Shiji Yang
f36e9e9888 kernel: rtl836x: convert to gpiod API
This is the recommended way for the OF based platform.

Tested-on TP-Link TL-WR2543N with RTL8367 switch:
```
root@OpenWrt:~# dmesg |grep -i rtl
[    7.941126] rtl8367 rtl8367: cannot find mdio node phandle
[    7.947562] rtl8367 rtl8367: RTL8367R ver. 0 chip found
[    9.056830] rtl8367 rtl8367: cpu_port:9, assigned to extif0
root@OpenWrt:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 512-529, parent: platform/18040000.gpio, 18040000.gpio:
 gpio-512 (                    |lime:status         ) out lo ACTIVE LOW
 gpio-513 (                    |rtl836x-sda         ) in  hi
 gpio-518 (                    |rtl836x-sck         ) in  lo
 gpio-520 (                    |lime:usb            ) out hi ACTIVE LOW
 gpio-523 (                    |reset               ) in  hi IRQ ACTIVE LOW
 gpio-524 (                    |wps                 ) in  hi IRQ ACTIVE LOW
```

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21143
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:22:02 +01:00
Shiji Yang
f8af185ec5 kernel: rtl836x: change missing mdio node log level to info
mdio node is optional for the rtl836x switch. Some devices use GPIO to
control the switch chip. Missing mdio is a normal behavior.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21143
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:22:01 +01:00
Shiji Yang
52924bf194 kernel: rtl836x: directly defer probe when mdio is missing
If the switch is directly controlled by the mdio bus, we must ensure
that the mdio bus is ready instead of trying GPIO simulated bus.

Fixes: d4ac26ec49 ("kernel: rtl8366-smi: add Realtek switch management via mii-bus")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21143
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:22:01 +01:00
John Audia
045007c24c cryptodev-linux: add backport to build for 6.18
Add 08644db02d
to allow builds against the 6.18 series of kernels.

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21190
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:06:23 +01:00
John Audia
539352352a strace: update to 6.18
Release Notes:
- https://github.com/strace/strace/releases/tag/v6.18

Note this updated is needed in order to fix a build failure with
the 6.18 kernel.

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21206
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 18:04:03 +01:00
Markus Stockhausen
68422b59ae realtek: ethernet: decouple from soc_info
The ethernet driver gets all the data from the DTS now. No need
to access the shared soc_info structure any longer.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21183
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:59:12 +01:00
Markus Stockhausen
e8dba8fb17 realtek: ethernet: switch to new family_id location
family_id is now part of the register set and automatically assigned
during initialization. Make use of it. This is basically a conversion
from priv->family_id to priv->r->family_id.

While we are here convert some hard coded family ids to their proper
defines.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21183
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:59:12 +01:00
Markus Stockhausen
abb11b542f realtek: ethernet: switch to device_get_match_data()
Now that the register configuration contains the family data derive it
from the DTS via device_get_match_data().

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21183
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:59:12 +01:00
Markus Stockhausen
bbafac0816 realtek: ethernet: provide soc family in register config
The ethernet driver currently determines the family from the soc_info
structure. To avoid the dependency add the family to the local register
structure.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21183
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:59:12 +01:00
Markus Stockhausen
20a25b9ffa realtek: ethernet: relocate ethernet below switchcore in DTS
The ethernet driver uses registers in the switchcore range.
Rearrange the DTS nodes accordingly. This allows to make use
of regmap with syscon_node_to_regmap(np->parent) later.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21183
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:59:11 +01:00
Markus Stockhausen
48305cccce realtek: ethernet: drop devm_request_mem_region()
The ethernet driver currently "requests" the memory region of the
ethernet device according to the DTS settings. This is wrong in
two ways:

- The DTS uses arbitrary regions out of the switchcore memory
- The variable is afterwards overwritten by DMA allocation

Drop it.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21183
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:59:11 +01:00
Markus Stockhausen
b8f4fb2f3d realtek: ethernet: split ethernet compatibles
The Realtek Otto ethernet driver currently uses a single compatible
for all different models. Split this into the the four well known
subtargets. This allows to get rid of the central mach/soc include
later.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21183
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:59:11 +01:00
Markus Stockhausen
53dfb3e2e8 realtek: phy: reorganize package handling
With kernel 6.18 the package shared structure will be hidden from
the phy drivers. Workaround that in advance by providing a shared
private structure that covers all information that is needed for
normal operation.

For further simplification provide a new join() function that takes
care of a consistent initialization.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21204
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 17:49:11 +01:00
Daniel Golle
f79a2a57f5 mediatek: filogic: asus,rt-ax57m: remove unused pinctrl groups
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Remove unused pinctrl groups defined in the device tree, probably as a
result of importing the vendor device tree which is based on the
reference board from MediaTek's SDK.

114b5c2063 ("mediatek: filogic: Add support ASUS RT-AX57M")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-12-23 14:51:17 +00:00
Garrett Mesmer
114b5c2063 mediatek: filogic: Add support ASUS RT-AX57M
ASUS RT-AX57M, RT-AX54HP V2, RT-AX1800HP V2, RT-AX1800S V2, and RT-AX3000S all use the same firmware and have identical hardware

Hardware
--------
SOC: MediaTek MT7981b
RAM: 256MB DDR3L (Winbond W632GU6NB-09)
FLASH: 128MB SPI-NAND (Winbond W25N01KVZEIR)
WIFI: Mediatek MT7981b + Mediatek MT7976DAN 802.11ax 2.4/5 GHz
ETH: MediaTek MT7531AE Switch
UART: 3V3 115200 8N1 (Pinout silkscreened / Do not connect VCC)

MAC addresses
-------------
LAN	Label MAC (stored in mtd ubi Factory partition at offset 0x4)
WAN	LAN
2.4G	LAN + 2 in first octet
5G	LAN

Installation
-----------------------------------------------------------
Vendor-UI Method
-----------------------------------------------------------
1. Download 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.1.1 (or whatever your router IP is configured as)

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 initramfs.trx image.

6. Wait for OpenWrt to boot. Open the default OpenWrt IP in a web browser and perform a system upgrade using the sysupgrade image as instructed in the top banner.

---------------------------------------------------------------------------
Revert to stock firmware:
1: Install package facinstall -> https://forum.openwrt.org/t/facinstall-package-for-easy-installation-factory-images/177587
2. Install Asus stock trx image via OpenWRT LuCI interface.

Signed-off-by: Garrett Mesmer <garrettmesm@gmail.com>
Co-authored-by: Oleg S <remittor@gmail.com>
Signed-off-by: Oleg S <remittor@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20491
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 15:36:24 +01:00
Jonas Jelonek
74b5a63cf9 realtek: image: add rt-loader-no-uimage recipe
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Add a new recipe 'rt-loader-no-uimage' that passes the kernel load
address to rt-loader, causing it to use that instead of it's initial run
address.

The usual behavior is fine for uImages where the load address is
predefined in the header, U-boot loads the image to that address and
then runs it, rt-loader just takes over that address. For non-uImage
instead, the address is tightly coupled to where the image has been
transferred during serial or TFTP upload. This may not be possible on
several devices. Passing a separate kernel load address to rt-loader
decouples that and avoids taking the pain to change the load address of
the kernel itself.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21248
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 00:26:35 +01:00
Jonas Jelonek
b1c1b713f0 realtek: rt-loader: allow arbitrary kernel load address
rt-loader currently has two operation modes, piggy-backed and
standalone. In standalone mode, the kernel load address is read from the
uImage in flash. In piggy-backed mode, rt-loader instead uses its
initial run address (aka run address during first run) as the kernel
load address. This is safe and works fine for all devices either using
U-boot or having no issue uploading an image to the default kernel load
address 0x80100000.

To extend usecases, allow to specify a kernel load address when
building rt-loader. In this case, rt-loader uses this address instead of
the address inferred at runtime.

On certain Zyxel devices, this allows to upload and boot an rt-loader
piggy-backed image to an alternate address but keep the default kernel
load address of 0x80100000. BootExt on these devices occupies memory
above and will crash during transfer when this address is used as upload
location. Using this extension, the image can be uploaded to e.g.
0x80300000 and rt-loader will use 0x80100000 as the final load address.
This avoid taking the pain the adjust the load address of the kernel
itself.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21248
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-23 00:26:34 +01:00
Radek Dostál
bdbb4bdfa0 ath79: fix build of big images for TP RE355v1, RE450v1 & v2
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
After merge of https://github.com/openwrt/openwrt/pull/20709 I noticed,
that https://mirror-03.infra.openwrt.org/snapshots/targets/ath79/tiny/
still does not contain the build for RE450.

I analyzed the problem and noticed, that only builds which fits into
original size can be build and if the image is larger, it fails with
the following error: "WARNING: Image file .../openwrt/build_dir/
target-mips_24kc_musl/linux-ath79_tiny/tmp/
openwrt-ath79-tiny-tplink_re450-v1-squashfs-sysupgrade.bin is too big:
  > 7864320".

This error is quite misleading as the image is smaller than 7864320. The
reason for this error is that default tplink-safeloader has hardcoded
factory partition structure and fails to generate any file.

Rather then fixing tplink-safeloader I followed approach from commit
ebd5e5fb53 ("ramips: switched TP-Link RE305 v1 to new partition layout")
and switched away from "tplink-safeloader sysupgrade".

I did not include "IMAGES := sysupgrade.bin", because with tiny target it
is still possible to locally build even factory image.

Fixes commit e768731dc8 ("ath79: switch TP-Link RE355 v1, RE450 v1 and
RE450 v2 to mtd-concat").

Signed-off-by: Radek Dostál <rd@radekdostal.com>
Link: https://github.com/openwrt/openwrt/pull/21158
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-22 18:49:39 +01:00
George Sapkin
18029977f6 build: fix apk packaging and ABI-versioning
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
The updated logic for the APK dependencies and provides is as follows:

- If ABI version is defined:
  - package is named `package_name-ABI_version`
  - package implicitly provides
    `package_name-ABI_version=package_version`
    this implies that only one version of a package per ABI can be
    installed at the same time
  - additionally provide `package_name` so multiple packages can be
    looked up by its base name
  - for each `provides`, provide `provide-ABI_version=package_version`
    this implies that only one version of a provide can be installed at
    the same time

- else if ABI version is _not_ defined
  - package is named `package_name`
  - package implicitly provides `package_name=package_version`
    this implies that only one version of a package can be installed at
    the same time
  - if `alternatives` is defined
    - for each `provides`, provide `provide`
      this implies that multiple versions of a provide can be installed
      at the same time
  - else if `alternatives` is _not_ defined
    - for each `provides`, provide `provide=package_version`
      this implies that only one version of a provide can be installed
      at the same time

Both cases a package can be looked up by its base name.

ABI version `alternatives`, `conffiles`, `conffiles_static`, `list` and
`rusers` files so multiple versions of the same ABI package can be
installed side by side, and so they don't overwrite each other's
packaging files.

ABI version `EXTRA_DEPENDS` so dependencies can be correctly looked up
using the existing OpenWrt semantics without the ABI specified. This is
needed since ABI-versioned libraries no longer provide
`package_name=package_version`, so that they can be installed side by
side.

Remove duplicate dependencies when `EXTRA_DEPENDS` specifies a versioned
one that is already in `DEPENDS`.

ABI is defined
------------------------------------------------------------------------

`libsqlite3` has `PROVIDES` set to `libfake` and has two different ABI
versions installed. `libfake` is just an example to demonstrate the
mechanics, as the library can already be depended upon using e.g.
`libsqlite3-0=3.51.0-r1`. Note the ABI-versioned lists.

```
root@OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-0-3.51.0-r1.apk
(1/1) Installing libsqlite3-0 (3.51.0-r1)
libsqlite3-0-3.51.0-r1.post-install: Executing script...
OK: 22 MiB in 157 packages

root@OpenWrt:/tmp# apk add --allow-untrusted ./libsqlite3-1-4.00.0-r1.apk
(1/1) Installing libsqlite3-1 (4.00.0-r1)
libsqlite3-1-4.00.0-r1.post-install: Executing script...
OK: 23 MiB in 158 packages

root@OpenWrt:/tmp# apk query --fields name,version,contents,provides libsqlite3-0 libsqlite3-1
Name: libsqlite3-0
Version: 3.51.0-r2
Provides: libfake-0=3.51.0-r2 libsqlite3
Contents:
  lib/apk/packages/libsqlite3-0.list
  usr/lib/libsqlite3.so.0
  usr/lib/libsqlite3.so.3.51.0

Name: libsqlite3-1
Version: 4.00.0-r1
Provides: libfake-1=4.00.0-r1 libsqlite3
Contents:
  lib/apk/packages/libsqlite3-1.list
  usr/lib/libsqlite3.so.1
  usr/lib/libsqlite3.so.4.00.0

root@OpenWrt:/tmp# ls -lh /usr/lib/libsqlite3.so.*
lrwxrwxrwx    1 root     root          20 Nov 20 00:23 /usr/lib/libsqlite3.so.0 -> libsqlite3.so.3.51.0
lrwxrwxrwx    1 root     root          20 Nov 20 00:27 /usr/lib/libsqlite3.so.1 -> libsqlite3.so.4.00.0
-rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.3.51.0
-rwxr-xr-x    1 root     root        1.0M Nov  6 18:19 /usr/lib/libsqlite3.so.4.00.0
```

ABI is not defined
------------------------------------------------------------------------

Both `avahi-dbus-daemon` and `avahi-nodbus-daemon` provide `avahi-daemon`,
but have no ABI specified. This results in `avahi-daemon=0.8-r11` provides
for both packages and only one being able to be installed at the same time:

```
root@OpenWrt:/tmp# apk add --allow-untrusted ./avahi-nodbus-daemon-0.8-r11.apk
(1/4) Installing libavahi-nodbus-support (0.8-r10)
libavahi-nodbus-support-0.8-r10.post-install: Executing script...
(2/4) Installing libdaemon (0.14-r5)
libdaemon-0.14-r5.post-install: Executing script...
(3/4) Installing libexpat (2.7.3-r1)
libexpat-2.7.3-r1.post-install: Executing script...
(4/4) Installing avahi-nodbus-daemon (0.8-r11)
avahi-nodbus-daemon-0.8-r11.post-install: Executing script...
23 MiB in 160 packages

root@OpenWrt:/tmp# apk query --fields provides avahi-nodbus-daemon
Provides: avahi-daemon=0.8-r11

root@OpenWrt:/tmp# apk add --allow-untrusted ./avahi-dbus-daemon-0.8-r11.apk
ERROR: unable to select packages:
  avahi-dbus-daemon-0.8-r11:
    conflicts: avahi-nodbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
    satisfies: world[avahi-dbus-daemon><Q1R111s+ke9Vf+eCxDHX2BZVUK54Q=]
  avahi-nodbus-daemon-0.8-r11:
    conflicts: avahi-dbus-daemon-0.8-r11[avahi-daemon=0.8-r11]
    satisfies: world[avahi-nodbus-daemon><Q1BAu7nLI2MgRabpveLTGO2ksQz7E=]
```

Provides and alternatives
------------------------------------------------------------------------

Both `uclient-fetch` and `wget-nossl` provide `wget` and specify
alternatives, so provides are not versioned and both packages can be
installed at the same time:

```
root@OpenWrt:/tmp# apk query --fields name,version,contents,provides uclient-fetch wget-nossl
Name: uclient-fetch
Version: 2025.10.03~dc909ca7-r1
Provides: wget
Contents:
  bin/uclient-fetch
  lib/apk/packages/uclient-fetch.alternatives
  lib/apk/packages/uclient-fetch.list

Name: wget-nossl
Version: 1.25.0-r1
Provides: gnu-wget wget
Contents:
  lib/apk/packages/wget-nossl.alternatives
  lib/apk/packages/wget-nossl.list
  usr/libexec/wget-nossl

```

Fixes: https://github.com/openwrt/openwrt/issues/20582
Fixes: https://github.com/openwrt/openwrt/issues/20802
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/20819
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-22 10:44:46 +01:00
Mikhail Kshevetskiy
095151b235 mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)
Popular cheap PWM fans for this machine, like the ones coming in
heatsink+fan combos will not work properly at the currently defined
medium speed. Trying different pwm setting using a command

  echo $value > /sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1

I found:

  pwm1 value     fan rotation speed   cpu temperature     notes
  -----------------------------------------------------------------
    0            maximal              31.5 Celsius        too noisy
   40            optimal              35.2 Celsius        no noise hearable
   95            minimal
   above 95      does not rotate      55.5 Celsius
  -----------------------------------------------------------------

Current cooling levels are:

	cooling-levels = <255 96 0>;

Thus only cpu-active-high and cpu-active-low modes are usable.
This patch fixes cpu-active-medium settings for bpi-r3 board.

This patch may not be enough. Users may wants to tweak their thermal_zone0
trip points, thus tuning fan rotation speed depending on cpu temperature.
That can be done on the base of the following example:

  === example =========
  # cpu temperature below 25 Celsius degrees, no rotation
  echo 25000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp
  # cpu temperature in [25..32] Celsius degrees, normal rotation speed
  echo 32000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
  # cpu temperature above 50 Celsius degrees, max rotation speed
  echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
  =====================

Changes v2:
* put patch to a proper directory
* updated patch description
* tested with latest openwrt based on linux-6.6

Changes v3:
* use upstream linux patch
* update patch description

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17130
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-22 10:33:44 +01:00
Shiji Yang
def7548867 tools/xz: update to 5.8.2
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Release Notes:
https://github.com/tukaani-project/xz/releases/tag/v5.8.2

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21208
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-21 20:49:22 +01:00
Qingfang Deng
c13f299918 mvebu: enable tickless idle
Switch to NO_HZ_IDLE for energy saving. Also enable Menu cpuidle
governor for tickless systems.

Run-tested: Linksys WRT1900AC v2

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21136
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-21 20:42:06 +01:00
Shiji Yang
79dac8f57c arm-trusted-firmware-mediatek: use MT/s as DDR speed unit
Usually we do not use MHz to describe the DDR transmission rate. In
fact, the clock frequency of the DDR3-1866 is only 933 MHz. MT/s is
a more commonly used unit.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
2025-12-21 19:18:43 +00:00
Dominic Germain
22a69dfa4a kernel: add option for USB FunctionFS gadget
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Add menuconfig option 'kmod-usb-gadget-fs' for the USB FunctionFS gadget
module

OpenWRT is perfect for USB gadgets that are network-enabled, since it
provides everything needed to easily manage the device. Having support
for the FunctionFS gadget enables the use of any custom USB devices
that does not have a specific module, like Media Transfer Protocol.

Signed-off-by: Dominic Germain <dominic@germain.cc>
Link: https://github.com/openwrt/openwrt/pull/21207
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-20 18:32:43 +01:00
Emre Yavuzalp
6bfb305394 mediatek: filogic: TP-Link Archer AX80 v1 (EU) support
Device specification

SoC Type: MediaTek MT7986B, Cortex-A53, 64-bit 1.6GHz Quad Core
RAM: ESMT M15T4G16256 (512MB)
Flash: ESMT F50L1G41LB (128 MB)
Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8)
Ethernet: 1x2.5Gbe (WAN/LAN 2.5Gbps), 4xGbE (WAN/LAN 1Gbps, LAN1, LAN2, LAN3)
WLAN 2g: MediaTek MT7975
WLAN 5g: MediaTek MT7975
LEDs: All White(probably)

Buttons: 4 (Reset,ledswitch,wps,wlan),
USB ports: 1 (USB 3.0)
Power: 12 VDC, 2.0 A
Connector: Barrel
Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, both UBI
slots contain "seconduboot" (also U-Boot 2022.01-rc4)
Serial console (UART)

                            V
+-------+-------+-------+-------+
| +3.3V |  GND  |  TX   |  RX   |
+---+---+-------+-------+-------+
    |
    +--- Don't connect

CPU BLOCK HERE                                                         LAN PORTS HERE

Installation (UART)
Note: There might be methods without UART possible soon.
Place OpenWrt initramfs image on tftp server with IP 192.168.1.2

Attach UART, switch on the router and interrupt the boot process by pressing 'Ctrl-C'

Load and run OpenWrt initramfs image:

      tftpboot initramfs-kernel.bin
      bootm

!!Attention!! is very important! After entering OpenWrt, please set / update the environment variables:

fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data),8M(mali_data)"
fw_setenv tp_boot_idx 0

Run 'sysupgrade -n' with the sysupgrade OpenWrt image from console or Luci WebUI.

Recovery

Press Reset button and power on the router
Navigate to U-Boot recovery web server (192.168.1.1) and upload the OEM firmware

Stock layout

0x000000000000-0x000000200000 : "boot"
0x000000200000-0x000000300000 : "u-boot-env"
0x000000300000-0x000003500000 : "ubi0"
0x000003500000-0x000006700000 : "ubi1"
0x000006700000-0x000006f00000 : "userconfig"
0x000006f00000-0x000007300000 : "tp_data"
0x000007300000-0x000007B00000 : "mali_data"

ubi0/ubi1 format
U-Boot at boot checks that all volumes are in place:

+-------------------------------+
| Volume Name: uboot Vol ID: 0|
| Volume Name: kernel Vol ID: 1|
| Volume Name: rootfs Vol ID: 2|
+-------------------------------+
MAC addresses
+---------+-------------------+-----------+
| label | 00:eb:xx:xx:xx:be | label |
| LAN | 00:eb:xx:xx:xx:be | label |
| WAN | 00:eb:xx:xx:xx:bf | label+1 |
| WLAN 2g | 00:eb:xx:xx:xx:be | label |
| WLAN 5g | 00:eb:xx:xx:xx:bd | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there (file "MT7986_EEPROM.bin").

Signed-off-by: Emre Yavuzalp <emreyavuzalp2@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20630
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-20 17:59:58 +01:00
Alexander Patrakov
b289edd84b comgt-ncm: fix setting ip[46]table and MTU
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
The ncm proto handler ignored ip4table, ip6table, and mtu settings.

The fix is based on the existing code in the mbim proto handler.

Fixes: #20216.
Signed-off-by: Alexander Patrakov <patrakov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20217
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-20 15:07:22 +01:00
Markus Stockhausen
d34cef823e build: avoid errors during release candidate kernel packaging
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
The build system allows to use Linux release candidate kernels (-rcX).
For this a target/linux/generic/kernel-6.XY as follows is needed:

LINUX_VERSION-6.XY = -rc1
LINUX_KERNEL_HASH-6.XY-rc1 = 18ba6ebd72f46b881e0d73e390b2888b7b43...

Sadly the builds fail with a packaging error.

fakeroot /home/openwrt/openwrt/openwrt/staging_dir/host/bin/apk
mkpkg --info "name:kernel" --info "version:6.15-rc1~c4bf...1f6-r1"
ERROR: info field 'version' has invalid value: package version is invalid

The apk metadata specification reads:

"... Currently the APK version specification is as follows:
number{.number}...{letter}{_suffix{number}}...{~hash}{-r#} ...
Optionally one or more _suffix{number} components can follow.
The list of valid suffixes (and their sorting order) is: alpha,
beta, pre, rc, <no suffix>, cvs, svn, git, hg, p."

Given that the kernel uses "-rcX" naming scheme and apk requires
"_rcX" instead, simply translate the dash to an underscore for
these builds.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21214
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-20 11:06:47 +01:00
Álvaro Fernández Rojas
caef0a839a odhcpd: update to Git HEAD (2025-12-18)
Some checks failed
Build all core packages / Build all core packages for selected target (push) Has been cancelled
3fda5f8b121b dhcpv6-ia: reconfigure message length bug fix
6152cf5dab49 all: remove dead code

1450e1e2b7...3fda5f8b12

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-18 21:24:09 +01:00
Álvaro Fernández Rojas
740f5dc175 odhcp6c: update to Git HEAD (2025-12-18)
9a4d6fe802d2 dhcpv6: use stable IAID for IA_NA
d99528f7a91a odhcp6c: avoid clearing CLIENT_ID

02e783c2f6...9a4d6fe802

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-18 21:22:06 +01:00
Chester A. Unal
cd2ad6c464 packages: nvram: add set_bcm43602_variables quirk for ASUS RT-AC3200
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Broadcom BCM43602 needs certain NVRAM variables to be set to function. Add
a quirk for it and add ASUS RT-AC3200 which has got Broadcom BCM43602 to
the quirk. Thanks to Tom Brautaset for finding the needed variables.

Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
2025-12-18 18:18:48 +00:00
Chester A. Unal
64b6293eb7 packages: nvram: add asus,rt-ac{3200,5300} to set_wireless_led_behaviour
Add ASUS RT-AC3200 and ASUS RT-AC5300 to the set wireless LED behaviour
quirk. ASUS RT-AC3200's wireless chip is different than ASUS RT-AC5300's,
the environment variables for it are 0:ledbh10 and 1:ledbh10.

Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
2025-12-18 18:18:48 +00:00
Chester A. Unal
4284d56568 bcm53xx: add support for ASUS RT-AC3200 and ASUS RT-AC5300
ASUS RT-AC3200 and ASUS RT-AC5300 are AC3200 and AC5300 routers,
respectively, featuring 5 Ethernet ports over the integrated Broadcom
switch.

ASUS RT-AC3200 hardware info:
* Processor: Broadcom BCM4709A0 dual-core @ 1.0 GHz
* Switch: BCM53012 in BCM4709A0
* DDR3 RAM: 256 MB
* Flash: 128 MB
* 2.4GHz: BCM43602 3x3 single chip 802.11b/g/n SoC
* 5GHz: BCM43602 3x3 two chips 802.11a/n/ac SoC
* Ports: 4 LAN Ports, 1 WAN Port

ASUS RT-AC5300 hardware info:
* Processor: Broadcom BCM4709C0 dual-core @ 1.4 GHz
* Switch: BCM53012 in BCM4709C0
* DDR3 RAM: 512 MB
* Flash: 128 MB
* 2.4GHz: BCM4366 4x4 single chip 802.11b/g/n SoC
* 5GHz: BCM4366 4x4 two chips 802.11a/n/ac SoC
* Ports: 4 LAN Ports, 1 WAN Port

Flashing instructions:
* Boot to CFE Recovery Mode by holding the reset button while power-on.
* Connect to the router with an ethernet cable.
* Set IPv4 address of the computer to 192.168.1.2 subnet 255.255.255.0.
* Head to http://192.168.1.1.
* Reset NVRAM.
* Upload the OpenWrt image.

CFE bootloader may reject flashing the image due to image integrity check.
In that case, follow the instructions below.

* Rename the OpenWrt image as firmware.trx.
* Run a TFTP server and make it serve the firmware.trx file.
* Run the URL below on a browser or curl.
  http://192.168.1.1/do.htm?cmd=flash+-noheader+192.168.1.2:firmware.trx+flash0.trx

Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
2025-12-18 18:18:48 +00:00
Álvaro Fernández Rojas
41a1874c70 odhcp6c: update to Git HEAD (2025-12-17)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
02e783c2f68c dhcpv6: fix NA/PD=try when NA/PD aren't provided
0f64e66b92ba odhcp6c: fix "-S" usage
13805fce5aa6 odhcp6c: reset res variable on INIT state

5212a1019d...02e783c2f6

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-17 23:35:28 +01:00
Álvaro Fernández Rojas
3b58539817 odhcpd: update to Git HEAD (2025-12-14)
1450e1e2b7ff odhcpd: remove fallback DNS search domain
5b0e5c412f6c router: remove some log spam in send_router_advert()
eddd0f8f0d00 router: improve send_router_advert()
35f0e05a16a0 config: add default value for dhcpv6_pd_min_len
62113d007a6a config: allow minimum PD len up to 64
03c1468355c0 Revert "router: optimize duplicated PIO comparison"
6b88c314a59e statefiles: don't consider no hostname as broken

cf51aeb932...1450e1e2b7

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-17 23:34:42 +01:00
Markus Petri
487178f8b0 vrx518_tc: fix rx_len_adj
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
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>
2025-12-17 22:03:53 +01:00
Janusz Dziedzic
7bfe7788b1 linux-firmware: intel: bump BE200 wifi firmware
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Latest backports require newer firmware (bump to 101).
8788f6b3c6

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21194
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-17 21:21:21 +01:00
Petr Štetiar
70a4da1ceb
dropbear: bump to 2025.89 (CVE-2025-14282, CVE-2019-6111)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
- Security: Avoid privilege escalation via unix stream forwarding in Dropbear
  server. Other programs on a system may authenticate unix sockets via
  SO_PEERCRED, which would be root user for Dropbear forwarded connections,
  allowing root privilege escalation.
  Reported by Turistu, and thanks for advice on the fix.
  This is tracked as CVE-2025-14282, and affects 2024.84 to 2025.88.

  It is fixed by dropping privileges of the dropbear process after
  authentication. Unix stream sockets are now disallowed when a
  forced command is used, either with authorized_key restrictions or
  "dropbear -c command".

  In previous affected releases running with "dropbear -j" (will also disable
  TCP fowarding) or building with localoptions.h/distrooptions.h
  "#define DROPBEAR_SVR_LOCALSTREAMFWD 0" is a mitigation.

- Security: Include scp fix for CVE-2019-6111. This allowed
  a malicious server to overwrite arbitrary local files.
  The missing fix was reported by Ashish Kunwar.

- Server dropping privileges post-auth is enabled by default. This requires
  setresgid() support, so some platforms such as netbsd or macos will have to
  disable DROPBEAR_SVR_DROP_PRIVS in localoptions.h. Unix stream forwarding is
  not available if DROPBEAR_SVR_DROP_PRIVS is disabled.

  Remote server TCP socket forwarding will now use OS privileged port
  restrictions rather than having a fixed "allow >=1024 for non-root" rule.

  A future release may implement privilege dropping for netbsd/macos.

- Fix a regression in 2025.87 when RSA and DSS are not built. This would lead
  to a crash at startup with bad_bufptr().
  Reported by Dani Schmitt and Sebastian Priebe.

- Don't limit channel window to 500MB. That is could cause stuck connections
  if peers advise a large window and don't send an increment within 500MB.
  Affects SSH.NET https://github.com/sshnet/SSH.NET/issues/1671
  Reported by Rob Hague.

- Ignore -g -s when passwords arent enabled. Patch from Norbert Lange.
  Ignore -m (disable MOTD), -j/-k (tcp forwarding) when not enabled.

- Report SIGBUS and SIGTRAP signals. Patch from Loïc Mangeonjean.

- Fix incorrect server auth delay. Was meant to be 250-350ms, it was actually
  150-350ms or possibly negative (zero). Reported by pickaxprograms.

- Fix building without public key options. Thanks to Konstantin Demin

- Fix building with proxycmd but without netcat. Thanks to Konstantin Demin

- Fix incorrect path documentation for distrooptions, thanks to Todd Zullinger

- Fix SO_REUSEADDR for TCP tests, reported by vt-alt.

Dropped:

 * 050-dropbear-multihop-fix.patch as its included in the release 5cc0127000db5f
 * 051-fix-pubkey-options.patch as its included in the release 1d4c4a542cd5df
 * 052-fix-missing-depends-for-sntrup761x25519-sha512.patch as its included
   in the release 1a2c1e649a1824
 * 053-Don-t-limit-channel-window-to-500MB.patch as its included in the release a8610f7b98ad

Manually rebased:

 * 110-change_user.patch

Fixes: CVE-2025-14282, CVE-2019-6111
Reviewed-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Konstantin Demin <rockdrilla@gmail.com>
Tested-by: Konstantin Demin <rockdrilla@gmail.com> [mediatek/filogic (GL.iNet GL-MT6000)]
Link: https://github.com/openwrt/openwrt/pull/21186
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-12-17 03:57:50 +00:00
Hauke Mehrtens
0bfc66e7b5 kernel: Fix boot of realtek rtl838x
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Revert two patches from upstream Linux:
135178e90a
63a93d1cd6

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: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21126
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-17 00:30:46 +01:00
John Audia
97e9d7038e kernel: bump 6.12 to 6.12.62
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.62

Manually rebased:
  bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch

Removed upstreamed:
  backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.62&id=e31194bf494f6900a5f96f55ed194a00e458f8d1

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21126
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-17 00:27:21 +01:00
Hauke Mehrtens
86996634f0 uboot-sunxi: fix u-boot build
The u-boot target name has to match the u-boot configuration. Switch
this back to the old names.

Fixes: d871e95e7f ("sunxi: image: sync target profiles names with DT compatible")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-17 00:06:24 +01:00
Rany Hany
e4d5e76af0 wifi-scripts: update phys after rename_phy_by_name call
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
This fixes a failed bring up of the radio on bootup
if the model defines a rename of phy in its /etc/board.json.
This specifically impacts Redmi AX6S and any router that does so
in its /etc/board.json. The fix fortunately is simple, just update
phy name in phys after rename.

The entry that specifically causes this issue is the following:

{
	<omitted>
	"wlan": {
		"wl0": {
			"path": "platform/18000000.wmac",
			"info": {
				"antenna_rx": 15,
				"antenna_tx": 15,
				"bands": {
					"2G": {
						"ht": true,
						"max_width": 40,
						"modes": [
							"NOHT",
							"HT20",
							"HT40"
						],
						"default_channel": 1
					}
				},
				"radios": [
				]
			}
		},
	...
}

The issue is that after rename, referenced phy in config is going to be
wl0 but in phys array it is still phy0; and so it fails to find phy
and does not bring up radio.

Fixes: https://github.com/openwrt/openwrt/issues/20250
Fixes: https://github.com/openwrt/openwrt/issues/20339
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/21175
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 20:22:51 +01:00
Jonas Jelonek
d519a3ee86 realtek: mdio-serdes: use correct device table identifier
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Use the correct identifier 'rtsds_of_match' instead of
'rtsds_mdio_of_match' because the latter doesn't exist.

This doesn't cause an error for 6.12. However, with 6.18 the
implementation of MODULE_DEVICE_TABLE has changed to use 'static' and
'used' [1] instead of 'extern' and 'unused' [2].

[1] 7d0a66e4bb/include/linux/module.h (L260)
[2] adc218676e/include/linux/module.h (L249)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21182
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 14:01:59 +01:00
Jonas Jelonek
56a71f3c82 realtek: pcs: move polarity into SerDes struct
As a first real usage of the new SerDes struct, move the polarity
configuration there. It was previously located in the global rtpcs_ctrl
struct as an array, indexed by SerDes id. Because this is per-SerDes
information, the new SerDes struct is the correct place to live in.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
18eea05483 realtek: pcs: drop unneeded SerDes number range checks
By using references to pre-initiated SerDes instances instead of plain
SerDes number, there is no need to check for the range anymore in
various places. During driver/pcs init it is ensured that only valid
SerDes will reach the configuration functions.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
d8dd8bd88f realtek: pcs: make use of SerDes struct in set_autoneg
Also switch set_autoneg (and related helper rtpcs_sds_modify) to the
SerDes struct instead of the plain SerDes id by using just the reference
to the SerDes instance instead of (ctrl, sds_id) tuple. This completes
the transition.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
1fccb0eb16 realtek: pcs: make use of SerDes struct in SerDes setup
Make use of the previously added SerDes struct in SerDes setup and all
functions in its call path by removing (ctrl, sds_num) being passed to
every function call and instead just pass the reference to the
corresponding SerDes instance.

Various SerDes calculations for even, odd and neighbor are unified by
switching to previously introduced helpers.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
4d9400f86b realtek: pcs: switch to id from SerDes struct
Drop usage of the to-be-phased-out SerDes id stored in rtpcs_link and
use the reference to the SerDes instance to use the embedded id in
rtpcs_serdes instead.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
69bbcc685b realtek: pcs: assign SerDes reference upon PCS creation
Upon creation of a phylink_pcs instance by calling rtpcs_create, assign
a reference to the corresponding SerDes to the link structure. In the
next step, this should be used everywhere instead of the plain SerDes
number.

Rename the field used to hold the SerDes number from 'sds' to 'sds_num'
and name the new field 'sds' to make clear what is what.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
232c1fb14a realtek: pcs: add helpers for even, odd, neighbor SerDes
Add dedicated helpers to get references to even, odd and neigbor SerDes
if needed. This should replace the various calculations scattered
throughout the code, providing a unified way to work with adjacent
SerDes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
6b3f8fb16f realtek: pcs: add separate SerDes struct
Add a separate structure for a SerDes. This is needed to appropriately
store per-SerDes information, which in turn is needed for future work.
Additionally, it's intended to reduce boilerplate and several
inconsistencies.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
6cf33aacfe realtek: pcs: use per-variant SerDes count
Use a separate configuration field for the number of SerDes for each
variant of the Realtek Otto family. Add this field to the config
structure, assign it and use it during driver probe. This narrows
possible error cases and is needed for upcoming extensions.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
a4d6e10bf2 realtek: pcs: add dedicated enum for SerDes modes
The Realtek SerDes mode capabilities do not map 1:1 to the
PHY_INTERFACE_MODE_* modes used in the kernel and passed to the PCS.
For example, some PHY chips use the proprietary XSGMII mode for which
there isn't an equivalent in the kernel, or HSGMII.

In the past, this led to problems and confusion using kernel's XGMII to
handle the XSGMII mode, and needed a downstream patch for HSGMII. They
have been solved/worked around for now, but XSGMII is currently not
implemented at all. And who knows what might come in the future.

To make our life easier, introduce a dedicated internal representation
of SerDes modes which differs from kernel's PHY_INTERFACE_MODE_*. This
allows us to map "external" modes to different internal modes as needed
instead of carrying the PHY_INTERFACE_MODE_* through the whole SerDes
configuration code. The PCS driver needs to map PHY_INTERFACE_MODE_* to
RTPCS_SDS_MODE_* in pcs_config, and the latter should be used as the
only one.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:31 +01:00
Jonas Jelonek
decc4f6ba8 realtek: pcs: rtl930x: drop unused and broken function
Drop the unused and broken function rtpcs_930x_sds_clock_wait from the
PCS driver. The proper working variant is already some lines above and
called rtpcs_930x_sds_wait_clock_ready.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:31 +01:00
Jonas Jelonek
a58e41e522 realtek: pcs: drop PCS creation without SerDes ref
Since the beginning, the PCS driver had the ability to call its
rtpcs_create without a reference to a valid PCS node. A comment in the
code mentions that this is done for RTL838X and its built-in octa-PHY
which is connected directly instead of via a SerDes. Further
explanations are not provided.

Drop this ability and make the rtpcs_create call in the dsa driver
conditional. As the built-in PHY of RTL838X isn't attached to a SerDes,
there is no obvious point of having the PCS driver in that chain. The
ports are marked as internal and have no pcs-handle, thus no phylink_pcs
instance should be created.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:31 +01:00
Jonas Jelonek
8e4730fd60 realtek: mdio-serdes: improve debugfs creation
Commit 3c073b5cb2 cleaned up the debugfs creation in
mdio-realtek-otto-serdes driver to not explicitly check if the root
directory already exists. This is fine because kernel handles the case
properly so there's no need to check anymore.

However, this pollutes the boot log with:
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'

Now, the root directory creation is attempted multiple times, causing
the kernel to print an error message because the directory already
exists.

Fix this by moving the SerDes loop into rtsds_debug_init and only try
to create the root debugfs directory once.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21179
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:11:34 +01:00
Christoph Krapp
3045f205b3 ipq40xx: convert Orbi led labels to function/color
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
The eight leds controlled by the LED controller are RGB leds themselves
but are flashing white by default. The color part is controlled by GPIOs
53 (green), 54 (red), 57 (blue) and 60 (white).
Therefore define the led nodes of the controller as white instead of RBG
as well as backlight as their function.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:33 +01:00
Christoph Krapp
f0909f7a05 ipq40xx: fix second 5ghz radio on Netgear RBx40
When support was added for the RBR40 and RBS40 it was assumed that they
also share the same second 5ghz wifi chip as their bigger siblings.
Turns out that instead of QCA9984 (RBx50, SRx60) these devices use
QCA9886 like the RBx20 devices to.
They also load different boardfiles for the IPQ4019 chip.

This moves the wifi nodes from the orbi.dtsi to each device dts file and
change the RBx40 boardfile variants.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:33 +01:00
Christoph Krapp
e9d6015bef ipq-wifi: add entry for Netgear RBK40
Add boardfile override packages for Netgear RBK40 devices.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:33 +01:00
Christoph Krapp
0f0f578d0a ipq40xx: fix Netgear RBR40 wan mac
The WAN port currently has the same MAC set as all the other LAN ports.
Fix this by adding the missing case in ipq40xx_setup_macs().

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:32 +01:00
Christoph Krapp
314dbb7fec ipq40xx: split orbi devices in router and satellite
Netgear Orbi devices are split into router and satellite units. Even
though the hardware is mostly the same, the network configuration is
different. Router units have a designated WAN port while satellite units
have all available ports labeled as "Ethernet".
This splits the device trees into both unit types and adjusts the port
labels.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:32 +01:00
Robert Marko
4e688db5a8 ipq-wifi: update to Git HEAD (2025-12-16)
10eddd6f1cba qca4019: qca9888: add bdfs for Netgear RBK40

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:27:47 +01:00
Christoph Krapp
f0c5348775 qualcommax: ipq807x: use ascii-env driver for Linksys MX4200v1
Just like it has already been changed for v2, use the ascii-eq-delim-env
driver to extract the label mac from the devinfo partition.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20732
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:22:33 +01:00
Mario Andrés Pérez
d871e95e7f sunxi: image: sync target profiles names with DT compatible
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Following up with errors reported in the ASU repo, these bananapi cases
do not match the DT compatible "bpi", sync with dts sources.
Also some profiles were overwriting SUPPORTED_DEVICES.
Sysupgrade would be failing in SUPPORTED_DEVICES check since
the DT compatible(/tmp/sysinfo/board_name) is not in SUPPORTED_DEVICES.
This should also fix errors when using ASU sysupgrade clients.
- Sync profile makefile target names with DT compatibles.
- Fix overwrites of SUPPORTED_DEVICES instead of appending.
- Adapt the uboot-sunxi profiles accordingly.
*bpi-p2-zero dts is still not upstream.

V2:
- Include fixes for arm926ejs(ARM926EJ-S) subtarget (LicheePi Nano and
PopStick v1.1) (profile rename for correct default SUPPORTED_DEVICES)

Fixes: https://forum.openwrt.org/t/luci-attended-sysupgrade-support-thread/230552/246
Fixes: https://github.com/openwrt/asu/issues/486
Fixes: https://github.com/openwrt/asu/issues/524
Fixes: 9aa66b8ce7 "sunxi: add support for Banana Pi M2 Berry"
Fixes: d5f615bf2a "sunxi: add support for Sinovoip Banana Pi M2 Plus"
Fixes: 3819c1638a "sunxi: Add support for Banana Pi M2 Ultra"
Fixes: 6bf8193b25 "sunxi: add support for Bananapi P2 Zero"
Fixes: 80edfaf675 "sunxi: add support for Banana Pi M3"
Fixes: 3c24a1d423 "sunxi: add support for NanoPi NEO Plus2 board"
Fixes: a689307c97 "sunxi: build image/uboot for the NanoPi NEO2"
Fixes: fde68cb809 "sunxi: add support for FriendlyARM NanoPi R1S H5"
Fixes: 3ec468ff4f "sunxi: add F1C100 (arm926ej-s) support"

Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21095
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-16 01:44:34 +01:00
Karsten Sperling
63bf77b801 scripts,ipkg-build: Fix error message for invalid package name
Use the correct variable ($pkg instead of $name) in the error message.

Signed-off-by: Karsten Sperling <ksperling@apple.com>
Link: https://github.com/openwrt/openwrt/pull/20077
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-16 01:39:54 +01:00
Hauke Mehrtens
5b0617ae1f libcap: Revert "libcap: update to 2.77"
This reverts commit c25265953b.

Linking of libpsx.so from libcap 2.77 fails on powerpc 464fp. Revert
back to the older version which works.

Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=220860
Fixes: c25265953b ("libcap: update to 2.77")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-16 01:24:47 +01:00
Martin Nadvornik
e5cd6461c9 mediatek: fix IPv4 address missing on interface in failsafe mode for cudy ap3000-v1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
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>
2025-12-16 00:17:32 +01:00
Rany Hany
36da03a6c1 wifi-scripts: ucode: improve formatting of expected throughput
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Convert to MBit/s like all other fields and specify the unit.
Most users probably aren't aware that this is in kilobits/s.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20567
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 12:39:14 +01:00
Rany Hany
1ead4e6e16 wifi-scripts: add support for using list for iface in wifi-station/vlan
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
This is a trivial change to allow users to use 'list' on iface.
Old wifi-scripts already implements this, so this just ensures
that shell-based and ucode wifi-scripts are on-par with each other.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20977
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 12:30:15 +01:00
Rany Hany
211b11a56e wifi-scripts: fix broken match all case for wifi-vlan
When iface is omitted, wifi-vlan will apply to all interfaces.
However, netifd.set_vlan call is not successful as it assumes
that every wifi-vlan section corresponds to one VIF.

For this reason in the wifi-vlan case (cur_type == "vlan")
we create a composite key in the form `${vif.name}/${vlan.name}`
allowing the same vlan section to correspond to multiple VAPs.
`/` was decided as a delimiter as it is an invalid character
for a network interface name and UCI identifier; so it is
impossible for it to cause conflicts.

It was verified that the `ubus call network.wireless status`
works as expected with this change. Moreover, wifi-station
is not susceptible to this problem.

This also means that it is now possible for wifi-vlan
to support `list` iface similar to old shell-based wifi-scripts.
This will be done in a follow-up commit.

Fixes: 98435a37a7 ("wifi-scripts: iface should be optional in wifi-vlan definition")
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20977
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 12:30:15 +01:00
Robert Marko
b4bc9ed318 ipq-wifi: update to Git HEAD (2025-12-15)
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
c6202981872e ipq5018: use correct board for GL-iNet B3000 IPQ5018 radio
ec72376cadf1 qca4019: Add Meraki Underdog
059b7114c77b ipq6018: add tp-link eap620hd v2

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:55:56 +01:00
Shiji Yang
852d17ed82 kernel: rtl836x: remove legacy platform_data support
There are no platform_data based devices using it anymore. Also move
header files to the driver folder.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21138
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:31:20 +01:00
Markus Stockhausen
a4011797c2 realtek: use devm_kzalloc() for serdes debugfs setup
This will free memory automatically during driver unloading.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:29:17 +01:00
Markus Stockhausen
3c073b5cb2 realtek: cleanup debugfs creation in serdes driver
debugfs_create_dir() has a proper logic to handle existing directories.
Skip the manual test. Additionally quit early if directory creation fails.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:29:17 +01:00
Markus Stockhausen
dcbc8722e9 realtek: simplify backing serdes calculation
Calculating the backing serdes of a given frontend serdes does
not need any info about the control structure. Drop the reference.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:29:17 +01:00
Álvaro Fernández Rojas
ff4546093e odhcpd: update to Git HEAD (2025-12-13)
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
cf51aeb93220 odhcpd: fix captive_portal_uri reset
e8b7fdea8d5e dhcpv4: fix DNS server option
b84553e496a3 router: Modify relayed RA PIO P flag according to interface policy
da3e2a9829cc router: Modify relayed RA PIO A flags according to interface policy
bad7138b70f0 README.md: update dhcp ubus events

ca00527e5f...cf51aeb932

Also remove duplicated /usr/share/libubox/jshn.sh include.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-13 13:01:45 +01:00
David Woodhouse
24b8db118b
image: add CONFIG_EXTRA_IMAGE_NAME
This allows an optional tag to be put in the .config file which is
included in the filename of the resulting images, so it's easier to
build images with different functionality for the same target hardware.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Link: https://github.com/openwrt/openwrt/pull/20984
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-12-12 22:06:06 +00:00
Paul Donald
b15628ec80 apk: bump to 3.0.2
We drop patch 0020-apk-fix-compile: integrated at source.
Compressed help now functions normally.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21127
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-12 13:59:39 +01:00
David Härdeman
52fa3728e5
base-files: always generate default DUID
The previous logic was copied from 12_network-generate-ula, but fails to
account for upgrades where the "auto" value isn't set (it is set by
base-files/files/bin/config_generate). Fix this to always set the
default duid if it isn't set.

Also, rename the file to better reflect what it does.

Closes: #21029
Fixes: a660a076db ("base-files: generate a global DHCP DUID")
Link: https://github.com/openwrt/openwrt/pull/21118
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [fixes,closes tag]
2025-12-11 06:39:34 +00:00
Shiji Yang
86bd55c4fd bcm27xx: fix patch wrong CRLF line-ending
Use Unix LF style instead of Windows CRLF style.

Fixes: 738876e76b ("kernel: bump 6.12 to 6.12.58")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20973
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 00:26:37 +01:00
Chukun Pan
bb2d9c1a65 arm-trusted-firmware-mediatek: remove DDR combo for MT7987
The DRAM_USE_COMB option is only valid for the MT7988. There
is no DRAM type selection for the MT7987, so remove it.

Fixes: de8fc8b ("arm-trusted-firmware-mediatek: add builds for MT7987")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/21000
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 00:00:51 +01:00
Chukun Pan
f037a2e8bb arm-trusted-firmware-mediatek: add MT7987 DDR4 4BG images
Add the DDR4_4BG_MODE option, which supports 4GB DDR4 RAM
for the MT7987 and 8GB DDR4 RAM for the MT7988. If this mode
is not enabled, bl2 can only recognize half the size of RAM.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/21000
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 00:00:51 +01:00
Chukun Pan
3b14ace444 arm-trusted-firmware-mediatek: add MT7981 sdmmc images
Add bl2 images for mt7981 sdmmc ddr4 devices.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/21000
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 00:00:50 +01:00
Chukun Pan
69918d1e0b arm-trusted-firmware-mediatek: rearrange some images
Rearrange some images to maintain consistency.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/21000
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 00:00:50 +01:00
Qingfang Deng
8b05db405b kernel: add network teaming modules
Teaming is a link aggregation implementation similar to bonding, but
it's configured by a userspace program.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21120
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:54:39 +01:00
Shine
be7aa5bda4 mpc85xx: add support for Watchguard Firebox T10-W, T15(-W)
This commit adds support for the Watchguard Firebox models
T10-W, T15 and T15-W.

CPU:      Freescale P1010
RAM:      512MB (T10) / 1024MB (T15)
Flash:    1MB SPI-NOR, 512MB NAND (T10) / 1024MB NAND (T15)
WiFi:     802.11abgn 2T2R AR9582 based Mini-PCIe card (-W models only)
Ethernet: 3x GBE (via AR8033 PHY)
LEDs:     7x hard-wired (6x LAN, 1x Power)
          4x GPIO single-colored (Attn/Status/Mode/Failover)
          1x GPIO dual-colored (2.4/5G WiFi, -W models only)
Serial:   RJ45, Cisco pinout, 115200/8N1
Other:    Battery backed RTC
          Atmel TPM 1.2 chip (unsupported)

Based on 35f6d79, which introduced Watchguard Firebox T10 support.

The T10 and T15 are identical hardware, with the exception of the T15
having twice the flash and RAM size.

The T10-W and T15-W models have their Mini-PCIe slot populated with an ath9
(AR9582) based WiFi card. The slot is either unpopulated or empty for
non-WiFi models. All required drivers are present by default on the mpc85xx
target, so T10/T10-W resp. T15/T15-W can use the same OpenWrt image.

This commit also introduces the zImage loader from 7d768a9 to boot the
kernel. This is required, since the U-Boot version used in these devices
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.

Installation (replaces previous instructions for T10):

1. If the U-Boot password is known, proceed with step 2.

   If the U-Boot password is unknown, dump the NOR flash using a SPI
   programmer and patch the unknown password to a known one. You can use
   blocktrron's Python script:

   https://github.com/blocktrron/t10-uboot-patcher/

   This script will patch the password to '1234' (without quotes).

   Alternatively, you can search for the hashed password in the NOR dump
   yourself and overwrite it with a known one. The SHA1 hash is:

   E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA

   Write the patched NOR dump back to the device.

2. Connect the device via serial cable, power it on and interrupt
   the boot process by pressing Ctrl+C. Enter the U-Boot password to access
   the CLI.

3. (Optional) Populate the uboot-env partition by entering:

   saveenv

   This will allow you to use uboot-envtools from within OpenWrt later,
   e.g. to increase the loadable kernel size.

   The default loadable kernel size is 5MB, the compressed kernel size at
   the time of this commit is 3.1MB.

4. Serve the initramfs OpenWrt image from a TFTP server at 10.0.1.13/24,
   connected to eth0 (WAN) of the device. File name must be 'uImage'. Boot
   with:

   tftpboot; bootm;

   Make sure to use the correct image for your device (T10 resp. T15)!

5. After booting, connect to OpenWrt on eth1 (LAN) via SSH. Verify
   that the UBI partiton is mtd7, format it and install the sysupgrade
   image.

   $ cat /proc/mtd
   $ ubiformat /dev/mtd7 -y
   $ sysupgrade -n <path to sysupgrade.bin>

6. The device should now boot OpenWrt from NAND flash. Enjoy.

Back to stock:

Use the vendor recovery procedure.

Stock recovery might also be necessary in case you have accidentally used
the fw_setenv command from within OpenWrt without using saveenv in U-Boot
first.

In order to use the vendor firmware recovery procedure, the NAND partitions
mtd3 to mtd6 must remain intact. Make sure not to overwrite them, or keep
dumps of them for later recovery.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:48:48 +01:00
Shine
15ef024805 mpc85xx: p1010: use common DTSI for Watchguard Firebox T1X
In preparation of adding support for additional Watchguard Firebox devices
based on Freescale P1010, introduce a common DTSI.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:48:48 +01:00
Hauke Mehrtens
e40ca676ee ucode: update to Git HEAD (2025-12-01)
afe4be60628a lib/fs: fix return value for flush
5f08ecf8e372 lib/uloop: fix return value doc for run()
1affe484f302 lib/uloop: pass eof and error to cb
559860cbd76d lib: introduce io library
ef07e2448a56 vm: optimize string+string concat with ucv_string_alloc

Changes: 48ed18d253...f7c2b97a82

Backport PR to fix compilation with Ubuntu 18.04:
https://github.com/jow-/ucode/pull/355

Link: https://github.com/openwrt/openwrt/pull/21100
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:38:08 +01:00
1090 changed files with 33368 additions and 26824 deletions

View file

@ -1,164 +0,0 @@
name: Build on Comment
on:
issue_comment:
types: [created, edited]
permissions:
pull-requests: write
concurrency:
group: build-on-comment-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check-and-build:
if: github.event.issue.pull_request != null
runs-on: ubuntu-latest
steps:
- name: Check if user is in reviewers team
id: check-reviewer
run: |
USERNAME="${{ github.event.comment.user.login }}"
STATUS_CODE=$(curl -s -H "Authorization: token ${{ secrets.LOOKUP_MEMBERS }}" \
-o response.json -w "%{http_code}" \
https://api.github.com/orgs/openwrt/teams/reviewers/memberships/$USERNAME)
if grep -q '"state": "active"' response.json && [ "$STATUS_CODE" -eq 200 ]; then
echo "authorized=true" >> $GITHUB_OUTPUT
else
echo "authorized=false" >> $GITHUB_OUTPUT
fi
- name: Parse build command
if: steps.check-reviewer.outputs.authorized == 'true'
id: parse-command
run: |
COMMENT="${{ github.event.comment.body }}"
if echo "$COMMENT" | grep -q "build [a-zA-Z0-9_-]\+/[a-zA-Z0-9_-]\+/[a-zA-Z0-9_-]\+"; then
BUILD_PATH=$(echo "$COMMENT" | grep -o "build [a-zA-Z0-9_-]\+/[a-zA-Z0-9_-]\+/[a-zA-Z0-9_-]\+" | sed 's/build //')
TARGET=$(echo "$BUILD_PATH" | cut -d'/' -f1)
SUBTARGET=$(echo "$BUILD_PATH" | cut -d'/' -f2)
PROFILE=$(echo "$BUILD_PATH" | cut -d'/' -f3)
echo "build_requested=true" >> $GITHUB_OUTPUT
echo "target=$TARGET" >> $GITHUB_OUTPUT
echo "subtarget=$SUBTARGET" >> $GITHUB_OUTPUT
echo "profile=$PROFILE" >> $GITHUB_OUTPUT
echo "build_path=$BUILD_PATH" >> $GITHUB_OUTPUT
else
echo "build_requested=false" >> $GITHUB_OUTPUT
fi
- name: Find existing build comment
if: steps.parse-command.outputs.build_requested == 'true'
id: find-comment
uses: peter-evans/find-comment@v2
with:
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
comment-author: "github-actions[bot]"
- name: Create early build comment
if: steps.parse-command.outputs.build_requested == 'true'
id: start-comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
🚧 **Build in progress for** `${{ steps.parse-command.outputs.build_path }}`...
You can follow progress [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
*Triggered by: @${{ github.event.comment.user.login }}*
edit-mode: replace
- name: Checkout repository
if: steps.parse-command.outputs.build_requested == 'true'
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: refs/pull/${{ github.event.issue.number }}/merge
- name: Setup build environment
if: steps.parse-command.outputs.build_requested == 'true'
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install -y build-essential libncurses5-dev gawk git subversion libssl-dev gettext zlib1g-dev swig unzip time rsync
- name: Build target
if: steps.parse-command.outputs.build_requested == 'true'
id: build
run: |
make defconfig
echo "CONFIG_DEVEL=y" > .config
echo "CONFIG_BPF_TOOLCHAIN_HOST=y" >> .config
echo "CONFIG_TARGET_${{ steps.parse-command.outputs.target }}=y" >> .config
echo "CONFIG_TARGET_${{ steps.parse-command.outputs.target }}_${{ steps.parse-command.outputs.subtarget }}=y" >> .config
echo "CONFIG_TARGET_${{ steps.parse-command.outputs.target }}_${{ steps.parse-command.outputs.subtarget }}_DEVICE_${{ steps.parse-command.outputs.profile }}=y" >> .config
make defconfig
make -j$(nproc) BUILD_LOG=1
echo "build_success=true" >> $GITHUB_OUTPUT
- name: Upload log
uses: actions/upload-artifact@v4
if: steps.check-reviewer.outputs.authorized == 'true' && (success() || failure())
with:
name: build-log-${{ steps.parse-command.outputs.target }}-${{ steps.parse-command.outputs.subtarget }}-${{ steps.parse-command.outputs.profile }}
path: logs/
- name: Create artifact archive
if: steps.build.outputs.build_success == 'true'
run: |
cd bin/
tar -czf ../build-artifacts.tar.gz *
cd ..
- name: Upload build artifacts
if: steps.build.outputs.build_success == 'true'
uses: actions/upload-artifact@v4
with:
name: build-${{ steps.parse-command.outputs.target }}-${{ steps.parse-command.outputs.subtarget }}-${{ steps.parse-command.outputs.profile }}
path: build-artifacts.tar.gz
- name: Update comment with build results
if: steps.build.outputs.build_success == 'true'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.start-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
body: |
## Build Results for `${{ steps.parse-command.outputs.build_path }}`
✅ **Build completed successfully!**
**Target:** `${{ steps.parse-command.outputs.target }}`
**Subtarget:** `${{ steps.parse-command.outputs.subtarget }}`
**Profile:** `${{ steps.parse-command.outputs.profile }}`
📦 **Artifacts:** [Download build-${{ steps.parse-command.outputs.target }}-${{ steps.parse-command.outputs.subtarget }}-${{ steps.parse-command.outputs.profile }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
*Build triggered by: @${{ github.event.comment.user.login }}*
*Last updated: ${{ github.event.comment.created_at }}*
edit-mode: replace
- name: Update comment on build failure
if: steps.parse-command.outputs.build_requested == 'true' && steps.build.outputs.build_success == 'false'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.start-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
body: |
## Build Results for `${{ steps.parse-command.outputs.build_path }}`
❌ **Build failed!**
Please check the [action logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.
*Build triggered by: @${{ github.event.comment.user.login }}*
edit-mode: replace

12
.github/workflows/build-pr-profile.yml vendored Normal file
View file

@ -0,0 +1,12 @@
name: Build PR Profile
on:
pull_request:
types: [opened, edited, synchronize]
permissions:
pull-requests: write
jobs:
build-pr-profile:
uses: openwrt/actions-shared-workflows/.github/workflows/build-pr-profile.yml@main

View file

@ -413,6 +413,102 @@ config KERNEL_PREEMPT_TRACER
enabled. This option and the irqs-off timing option can be
used together or separately.)
config KERNEL_HWLAT_TRACER
bool "Tracer to detect hardware latencies (like SMIs)"
depends on KERNEL_FTRACE
help
This tracer, when enabled will create one or more kernel threads,
depending on what the cpumask file is set to, which each thread
spinning in a loop looking for interruptions caused by
something other than the kernel. For example, if a
System Management Interrupt (SMI) takes a noticeable amount of
time, this tracer will detect it. This is useful for testing
if a system is reliable for Real Time tasks.
Some files are created in the tracing directory when this
is enabled:
hwlat_detector/width - time in usecs for how long to spin for
hwlat_detector/window - time in usecs between the start of each
iteration
A kernel thread is created that will spin with interrupts disabled
for "width" microseconds in every "window" cycle. It will not spin
for "window - width" microseconds, where the system can
continue to operate.
The output will appear in the trace and trace_pipe files.
When the tracer is not running, it has no affect on the system,
but when it is running, it can cause the system to be
periodically non responsive. Do not run this tracer on a
production system.
To enable this tracer, echo in "hwlat" into the current_tracer
file. Every time a latency is greater than tracing_thresh, it will
be recorded into the ring buffer.
config KERNEL_OSNOISE_TRACER
bool "OS Noise tracer"
depends on KERNEL_FTRACE
help
In the context of high-performance computing (HPC), the Operating
System Noise (osnoise) refers to the interference experienced by an
application due to activities inside the operating system. In the
context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
can cause noise to the system. Moreover, hardware-related jobs can
also cause noise, for example, via SMIs.
The osnoise tracer leverages the hwlat_detector by running a similar
loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
the sources of osnoise during its execution. The osnoise tracer takes
note of the entry and exit point of any source of interferences,
increasing a per-cpu interference counter. It saves an interference
counter for each source of interference. The interference counter for
NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
observes these interferences' entry events. When a noise happens
without any interference from the operating system level, the
hardware noise counter increases, pointing to a hardware-related
noise. In this way, osnoise can account for any source of
interference. At the end of the period, the osnoise tracer prints
the sum of all noise, the max single noise, the percentage of CPU
available for the thread, and the counters for the noise sources.
In addition to the tracer, a set of tracepoints were added to
facilitate the identification of the osnoise source.
The output will appear in the trace and trace_pipe files.
To enable this tracer, echo in "osnoise" into the current_tracer
file.
config KERNEL_TIMERLAT_TRACER
bool "Timerlat tracer"
depends on KERNEL_FTRACE
help
The timerlat tracer aims to help the preemptive kernel developers
to find sources of wakeup latencies of real-time threads.
The tracer creates a per-cpu kernel thread with real-time priority.
The tracer thread sets a periodic timer to wakeup itself, and goes
to sleep waiting for the timer to fire. At the wakeup, the thread
then computes a wakeup latency value as the difference between
the current time and the absolute time that the timer was set
to expire.
The tracer prints two lines at every activation. The first is the
timer latency observed at the hardirq context before the
activation of the thread. The second is the timer latency observed
by the thread, which is the same level that cyclictest reports. The
ACTIVATION ID field serves to relate the irq execution to its
respective thread execution.
The tracer is build on top of osnoise tracer, and the osnoise:
events can be used to trace the source of interference from NMI,
IRQs and other threads. It also enables the capture of the
stacktrace at the IRQ context, which helps to identify the code
path that can cause thread delay.
config KERNEL_HIST_TRIGGERS
bool "Histogram triggers"
depends on KERNEL_FTRACE
@ -1181,6 +1277,7 @@ config KERNEL_NET_L3_MASTER_DEV
config KERNEL_DCB
bool "Data Center Bridging support"
default y if TARGET_armsr_armv8
default y if TARGET_microchipsw
default y if TARGET_x86_64
help
This enables support for configuring Data Center Bridging (DCB)
@ -1492,3 +1589,72 @@ config KERNEL_WERROR
and unusual warnings, or you have some architecture with problems,
you may need to disable this config option in order to
successfully build the kernel.
choice
prompt "Preemption Model"
default KERNEL_PREEMPT_NONE
config KERNEL_PREEMPT_NONE
bool "No Forced Preemption (Server)"
help
This is the traditional Linux preemption model, geared towards
throughput. It will still provide good latencies most of the
time, but there are no guarantees and occasional longer delays
are possible.
Select this option if you are building a kernel for a server or
scientific/computation system, or if you want to maximize the
raw processing power of the kernel, irrespective of scheduling
latencies.
config KERNEL_PREEMPT_VOLUNTARY
bool "Voluntary Kernel Preemption (Desktop)"
help
This option reduces the latency of the kernel by adding more
"explicit preemption points" to the kernel code. These new
preemption points have been selected to reduce the maximum
latency of rescheduling, providing faster application reactions,
at the cost of slightly lower throughput.
This allows reaction to interactive events by allowing a
low priority process to voluntarily preempt itself even if it
is in kernel mode executing a system call. This allows
applications to run more 'smoothly' even when the system is
under load.
Select this if you are building a kernel for a desktop system.
config KERNEL_PREEMPT
bool "Preemptible Kernel (Low-Latency Desktop)"
help
This option reduces the latency of the kernel by making
all kernel code (that is not executing in a critical section)
preemptible. This allows reaction to interactive events by
permitting a low priority process to be preempted involuntarily
even if it is in kernel mode executing a system call and would
otherwise not be about to reach a natural preemption point.
This allows applications to run more 'smoothly' even when the
system is under load, at the cost of slightly lower throughput
and a slight runtime overhead to kernel code.
Select this if you are building a kernel for a desktop or
embedded system with latency requirements in the milliseconds
range.
config KERNEL_PREEMPT_RT
bool "Fully Preemptible Kernel (Real-Time)"
depends on (x86_64 || aarch64 || riscv64)
help
This option turns the kernel into a real-time kernel by replacing
various locking primitives (spinlocks, rwlocks, etc.) with
preemptible priority-inheritance aware variants, enforcing
interrupt threading and introducing mechanisms to break up long
non-preemptible sections. This makes the kernel, except for very
low level and critical code paths (entry code, scheduler, low
level interrupt handling) fully preemptible and brings most
execution contexts under scheduler control.
Select this if you are building a kernel for systems which
require real-time guarantees.
endchoice

View file

@ -41,6 +41,9 @@ KDIR=$(KERNEL_BUILD_DIR)
KDIR_TMP=$(KDIR)/tmp
DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
ifeq ($(EXTRA_IMAGE_NAME),)
EXTRA_IMAGE_NAME:=$(call qstrip,$(CONFIG_EXTRA_IMAGE_NAME))
endif
IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))-)
IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-)
IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERSION_CODE))-)

View file

@ -212,9 +212,8 @@ define KernelPackage
TITLE:=$(TITLE)
SECTION:=kernel
CATEGORY:=Kernel modules
DESCRIPTION:=$(DESCRIPTION)
EXTRA_DEPENDS:=kernel (=$(LINUX_VERSION)~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
VERSION:=$(LINUX_VERSION)$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
EXTRA_DEPENDS:=kernel (=$(subst -rc,_rc,$(LINUX_VERSION))~$(LINUX_VERMAGIC)-r$(LINUX_RELEASE))
VERSION:=$(subst -rc,_rc,$(LINUX_VERSION))$(if $(PKG_VERSION),.$(PKG_VERSION))-r$(if $(PKG_RELEASE),$(PKG_RELEASE),$(LINUX_RELEASE))
PKGFLAGS:=$(PKGFLAGS)
$(call KernelPackage/$(1))
$(call KernelPackage/$(1)/$(BOARD))
@ -306,4 +305,3 @@ kernel_patchver_ge=$(call kernel_version_cmp,-ge,$(KERNEL_PATCHVER),$(1))
kernel_patchver_eq=$(call kernel_version_cmp,-eq,$(KERNEL_PATCHVER),$(1))
kernel_patchver_le=$(call kernel_version_cmp,-le,$(KERNEL_PATCHVER),$(1))
kernel_patchver_lt=$(call kernel_version_cmp,-lt,$(KERNEL_PATCHVER),$(1))

View file

@ -358,7 +358,6 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CONNLIMIT,CONFIG_NFT_CONNLIMIT, $(P_XT)
IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
IPT_BUILTIN += $(IPT_CORE-y) $(IPT_CORE-m)
IPT_BUILTIN += $(NF_CONNTRACK-y)
IPT_BUILTIN += $(NF_CONNTRACK6-y)
IPT_BUILTIN += $(IPT_CONNTRACK-y)
IPT_BUILTIN += $(IPT_CONNTRACK_EXTRA-y)
IPT_BUILTIN += $(IPT_EXTRA-y)

View file

@ -78,6 +78,196 @@ define FixupDependencies
$(call AddDependency,$(1),$$(DEPS))
endef
# Format dependencies and extra dependencies
#
# ABI-version EXTRA_DEPENDS so dependencies can be correctly looked up using the
# existing semantics without the ABI specified. This is needed since ABI-
# versioned libraries don't provide `${package_name}=${package_version}`, so
# that same library but with different ABI versions can be installed side by
# side.
#
# Remove duplicate dependencies when EXTRA_DEPENDS specifies a versioned one
# that is already in DEPENDS.
#
# 1: list of dependencies
# 2: list of extra dependencies
define FormatDepends
$(strip
$(eval _COMMA_SEP := __COMMA_SEP__)
$(eval _SPACE_SEP := __SPACE_SEP__)
$(eval _DEPENDS := $(1))
$(eval _EXTRA_DEPENDS_ABI := )
$(eval _DEP_ITEMS := $(subst $(_COMMA_SEP),$(space),$(subst $(space),$(_SPACE_SEP),$(subst $(comma),$(_COMMA_SEP),$(2)))))
$(foreach dep,$(_DEP_ITEMS),
$(eval _EXTRA_DEP := )
$(eval _CUR_DEP := $(subst $(_SPACE_SEP),$(space),$(strip $(dep))))
$(eval _PKG_NAME := $(word 1,$(_CUR_DEP)))
$(if $(findstring $(paren_left), $(_PKG_NAME)),
$(error "Unsupported extra dependency format: no space before '(': $(_CUR_DEP)"))
)
$(eval _ABI_SUFFIX := $(call GetABISuffix,$(_PKG_NAME)))
$(eval _PKG_NAME_ABI := $(_PKG_NAME)$(_ABI_SUFFIX))
$(eval _VERSION_CONSTRAINT := $(word 2,$(_CUR_DEP)))
$(if $(_VERSION_CONSTRAINT),
$(eval _EXTRA_DEP := $(_PKG_NAME_ABI) $(_VERSION_CONSTRAINT)),
$(error "Extra dependencies must have version constraints. $(_PKG_NAME) seems to be unversioned.")
)
$(if $(and $(_EXTRA_DEPENDS_ABI),$(_EXTRA_DEP)),
$(eval _EXTRA_DEPENDS_ABI := $(_EXTRA_DEPENDS_ABI)$(comma)$(_EXTRA_DEP)),
$(eval _EXTRA_DEPENDS_ABI := $(_EXTRA_DEP))
)
$(if $(_DEPENDS),
$(eval _DEPENDS := $(filter-out $(_PKG_NAME_ABI),$(_DEPENDS)))
)
)
$(eval _DEPENDS := $(call mergelist,$(_DEPENDS)))
$(_EXTRA_DEPENDS_ABI)$(if $(_DEPENDS),$(comma) $(_DEPENDS))
)
endef
# Format provide and add ABI and version if it's not a virtual provide marked
# with an @.
#
# Same as for the base package name, if ABI version is set, provide both
# unversioned provide and one with ABI version and version.
#
# 1: provide name
# 2: provide version
# 3: (optional) ABI version
define AddProvide
$(strip
$(if $(filter @%,$(1)),
$(patsubst @%,%,$(1)),
$(if $(3),
$(1) $(1)$(call FormatABISuffix,$(1),$(3))=$(2),
$(1)=$(2)
)
)
)
endef
# Remove virtual provides prefix and self. apk doesn't like it when packages
# specify a redundant provide pointing to self.
#
# 1: package name
# 2: list of provides
define SanitizeProvides
$(filter-out $(1),$(patsubst @%,%,$(2)))
endef
# Format provides both for apk and control
#
# - If ABI version is defined:
# - package is named `${package_name}${ABI_version}`
# if a `package_name` ends in a number, the `ABI_version` will be prefixed
# with a - sign, e.g.: libsqlite3-0
# - package implicitly provides
# `${package_name}${ABI_version}=${package_version}`
# this implies that only one version of a package per ABI can be installed
# at the same time
# - additionally provide `${package_name}` so multiple packages can be looked
# up by its base name
# - for each `provides`:
# - provide `${provide}${ABI_version}=${package_version}`
# this implies that only one version of a provide can be installed at the
# same time
# - if a `provide` ends in a number, the `ABI_version` will be prefixed with
# a - sign, e.g.: provide1-0
# - additionally provide `${provide}` so multiple packages can be looked up
# by its base name
#
# - else if ABI version is _not_ defined
# - package is named `${package_name}`
# - package implicitly provides `${package_name}=${package_version}`
# this implies that only one version of a package can be installed at the
# same time
# - for each `provides`, provide `${provide}=${package_version}` this implies
# that only one version of a provide can be installed at the same time
#
# - Both with and without an ABI, if a provide starts with an @, treat it as a
# virtual provide, that doesn't own the name by not appending version.
# Multiple packages with the same virtual provides can be installed
# side-by-side.
#
# - apk doesn't like it when packages specify a redundant provide pointing to
# self. Filter it out, but keep virtual self provides, in the form of
# @(kmod-)?${package_name}-any.
#
# - Packages implicitly add a virtual @${package_name}-any provide in Package,
# which implies that kmods, which are also packages, will have a virtual
# @kmod-${package_name}-any provide.
#
# - Aside from the two aforementioned implicit provides, packages are expected
# to manage their provides themselves.
#
# - When multiple variants inside the same package have the same provide, a
# default variant must be set using DEFAULT_VARIANT:=1.
#
# - Cross-package provides must be virtual and a default variant must be set. If
# different packages provide the same versioned (i.e. non-virtual) provide the
# package with a higher version will be preferred, which results in unintended
# behavior, because the order might change with package updates.
#
# Example:
# - both uclient-fetch and wget provide wget
# - wget doesn't have a default variant called wget that would provide an
# implicit @wget-any
# - add wget to PROVIDES for both wget-ssl and wget-nossl variants so they
# can't be installed at the same time
# - add @wget-any to both packages so packages outside of wget can provide
# it
# - uclient-fetch has only one variant
# - add @wget-any to PROVIDES
# - mark uclient-fetch as the default variant using DEFAULT_VARIANT:=1
# - switch wget consumer that don't depend on a specific version like apk to
# depend on @wget-any
#
# - Alternatives don't affect the packaging.
#
# 1: package name
# 2: package version
# 3: ABI version
# 4: list of provides
define FormatProvides
$(strip
$(if $(call FormatABISuffix,$(1),$(3)),
$(1) $(foreach provide,
$(filter-out $(1),$(4)),
$(call AddProvide,$(provide),$(2),$(3))
),
$(foreach provide,
$(filter-out $(1),$(4)),
$(call AddProvide,$(provide),$(2))
)
)
)
endef
# Get apk provider priority
#
# - if a package is marked as a default variant, set it to 100.
#
# - if a package has an ABI version defined, set it to 10.
# The enables packages with an ABI version to be installed by their base name
# instead of a name and an ABI version, e.g.:
# libfoo3, where 3 is the ABI version can be installed by just libfoo.
# This affects manual installation only, as the dependency resolution takes
# care of ABI versions.
#
# - otherwise return nothing, i.e. package will have the default priority 0.
#
# 1: Default variant
# 2: ABI version
define GetProviderPriority
$(strip
$(if $(1),100,
$(if $(2),10)
)
)
endef
ifneq ($(PKG_NAME),toolchain)
define CheckDependencies
@( \
@ -191,17 +381,33 @@ endif
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
mkdir -p $(STAGING_DIR_ROOT)/stamp
$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || { \
mkdir -p $(PKG_INFO_DIR); \
echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version; \
$(foreach pkg,$(filter-out $(1),$(PROVIDES)), \
$(foreach pkg,$(call SanitizeProvides,$(1),$(PROVIDES)), \
cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version; \
) \
} )
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
touch $$@
Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
Package/$(1)/DEPENDS := $$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep)))
ifneq ($$(EXTRA_DEPENDS),)
Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
ifeq ($(CONFIG_USE_APK),)
Package/$(1)/DEPENDS := $$(call mergelist,$$(Package/$(1)/DEPENDS))
Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
else
Package/$(1)/DEPENDS := $$(call FormatDepends,$$(Package/$(1)/DEPENDS),$$(EXTRA_DEPENDS))
endif
else
Package/$(1)/DEPENDS := $$(call mergelist,$$(Package/$(1)/DEPENDS))
endif
ifeq ($(CONFIG_USE_APK),)
Package/$(1)/PROVIDES := $$(patsubst @%,%,$(PROVIDES))
Package/$(1)/PROVIDES := $$(filter-out $(1)$$(ABIV_$(1)),$$(Package/$(1)/PROVIDES)$$(if $$(ABIV_$(1)), $(1) $$(foreach provide,$$(Package/$(1)/PROVIDES),$$(provide)$$(ABIV_$(1)))))
else
Package/$(1)/PROVIDES := $$(call FormatProvides,$(1),$(VERSION),$(ABI_VERSION),$(PROVIDES))
Package/$(1)/PRIORITY := $$(call GetProviderPriority,$(DEFAULT_VARIANT),$(ABI_VERSION))
endif
$(_define) Package/$(1)/CONTROL
@ -209,7 +415,7 @@ Package: $(1)$$(ABIV_$(1))
Version: $(VERSION)
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
)$$(call addfield,Provides,$$(call mergelist,$$(filter-out $(1)$$(ABIV_$(1)),$(PROVIDES)$$(if $$(ABIV_$(1)), $(1) $(foreach provide,$(PROVIDES),$(provide)$$(ABIV_$(1))))))
)$$(call addfield,Provides,$$(call mergelist,$$(Package/$(1)/PROVIDES))
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
)$$(call addfield,Source,$(SOURCE)
)$$(call addfield,SourceName,$(PKG_NAME)
@ -229,7 +435,7 @@ Installed-Size: 0
$(_endef)
$$(PACK_$(1)) : export CONTROL=$$(Package/$(1)/CONTROL)
$$(PACK_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
$$(PACK_$(1)) : $(call shexport,Package/$(1)/description)
$$(PACK_$(1)) : export PATH=$$(TARGET_PATH_PKG)
$$(PACK_$(1)) : export PKG_SOURCE_DATE_EPOCH:=$(PKG_SOURCE_DATE_EPOCH)
$$(PACK_$(1)) : export SOURCE_DATE_EPOCH:=$(PKG_SOURCE_DATE_EPOCH)
@ -253,7 +459,7 @@ endif
fi; \
done; $(Package/$(1)/extra_provides) \
) | sort -u > $(PKG_INFO_DIR)/$(1).provides
$(if $(PROVIDES),@for pkg in $(filter-out $(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
$(if $(PROVIDES),@for pkg in $(call SanitizeProvides,$(1),$(PROVIDES)); do cp $(PKG_INFO_DIR)/$(1).provides $(PKG_INFO_DIR)/$$$$pkg.provides; done)
$(CheckDependencies)
$(RSTRIP) $$(IDIR_$(1))
@ -287,7 +493,7 @@ ifeq ($(CONFIG_USE_APK),)
(cd $$(IDIR_$(1))/CONTROL; \
( \
echo "$$$$CONTROL"; \
printf "Description: "; echo "$$$$DESCRIPTION" | sed -e 's,^[[:space:]]*, ,g'; \
printf "Description: "; echo "$$$$$(call shvar,Package/$(1)/description)" | sed -e 's,^[[:space:]]*, ,g'; \
) > control; \
chmod 644 control; \
( \
@ -320,24 +526,24 @@ else
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
echo 'export root="$$$${IPKG_INSTROOT}"'; \
echo 'export pkgname="$(1)"'; \
echo 'export pkgname="$(1)$$(ABIV_$(1))"'; \
echo "add_group_and_user"; \
echo "default_postinst"; \
[ ! -f $$(ADIR_$(1))/postinst-pkg ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/postinst-pkg"; \
[ ! -f $$(ADIR_$(1))/postinst-pkg ] || sed '/^\s*#!/d' "$$(ADIR_$(1))/postinst-pkg"; \
) > $$(ADIR_$(1))/post-install;
ifdef Package/$(1)/preinst
( \
echo "#!/bin/sh"; \
echo 'export PKG_UPGRADE=1'; \
[ ! -f $$(ADIR_$(1))/preinst ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/preinst"; \
[ ! -f $$(ADIR_$(1))/preinst ] || sed '/^\s*#!/d' "$$(ADIR_$(1))/preinst"; \
) > $$(ADIR_$(1))/pre-upgrade;
endif
( \
echo "#!/bin/sh"; \
echo 'export PKG_UPGRADE=1'; \
[ ! -f $$(ADIR_$(1))/post-install ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/post-install"; \
[ ! -f $$(ADIR_$(1))/post-install ] || sed '/^\s*#!/d' "$$(ADIR_$(1))/post-install"; \
) > $$(ADIR_$(1))/post-upgrade;
( \
@ -345,34 +551,34 @@ else
echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
echo 'export root="$$$${IPKG_INSTROOT}"'; \
echo 'export pkgname="$(1)"'; \
echo 'export pkgname="$(1)$$(ABIV_$(1))"'; \
echo "default_prerm"; \
[ ! -f $$(ADIR_$(1))/prerm-pkg ] || sed -z 's/^\s*#!/#!/' "$$(ADIR_$(1))/prerm-pkg"; \
[ ! -f $$(ADIR_$(1))/prerm-pkg ] || sed '/^\s*#!/d' "$$(ADIR_$(1))/prerm-pkg"; \
) > $$(ADIR_$(1))/pre-deinstall;
[ ! -f $$(ADIR_$(1))/postrm ] || sed -zi 's/^\s*#!/#!/' "$$(ADIR_$(1))/postrm";
if [ -n "$(USERID)" ]; then echo $(USERID) > $$(IDIR_$(1))/lib/apk/packages/$(1).rusers; fi;
if [ -n "$(ALTERNATIVES)" ]; then echo $(ALTERNATIVES) > $$(IDIR_$(1))/lib/apk/packages/$(1).alternatives; fi;
(cd $$(IDIR_$(1)) && find . -type f,l -printf "/%P\n" | sort > $(TMP_DIR)/$(1).list && mv $(TMP_DIR)/$(1).list $$(IDIR_$(1))/lib/apk/packages/$(1).list)
if [ -n "$(USERID)" ]; then echo $(USERID) > $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).rusers; fi;
if [ -n "$(ALTERNATIVES)" ]; then echo $(ALTERNATIVES) > $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).alternatives; fi;
(cd $$(IDIR_$(1)) && find . -type f,l -printf "/%P\n" | sort > $(TMP_DIR)/$(1).list && mv $(TMP_DIR)/$(1).list $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).list)
# Move conffiles to IDIR and build conffiles_static with csums
if [ -f $$(ADIR_$(1))/conffiles ]; then \
mv -f $$(ADIR_$(1))/conffiles $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
for file in $$$$(cat $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles); do \
mv -f $$(ADIR_$(1))/conffiles $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles; \
for file in $$$$(cat $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles); do \
[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles_static; \
done; \
fi
# Some package (base-files) manually append stuff to conffiles
# Append stuff from it and delete the CONTROL directory since everything else should be migrated
if [ -f $$(IDIR_$(1))/CONTROL/conffiles ]; then \
echo $$$$(IDIR_$(1))/CONTROL/conffiles >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles; \
echo $$$$(IDIR_$(1))/CONTROL/conffiles >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles; \
for file in $$$$(cat $$(IDIR_$(1))/CONTROL/conffiles); do \
[ -f $$(IDIR_$(1))/$$$$file ] || continue; \
csum=$$$$($(MKHASH) sha256 $$(IDIR_$(1))/$$$$file); \
echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1).conffiles_static; \
echo $$$$file $$$$csum >> $$(IDIR_$(1))/lib/apk/packages/$(1)$$(ABIV_$(1)).conffiles_static; \
done; \
rm -rf $$(IDIR_$(1))/CONTROL/conffiles; \
fi
@ -394,17 +600,8 @@ else
--info "origin:$(SOURCE)" \
--info "url:$(URL)" \
--info "maintainer:$(MAINTAINER)" \
--info "provides:$$(foreach prov,\
$$(filter-out $(1)$$(ABIV_$(1)), \
$(PROVIDES)$$(if $$(ABIV_$(1)), \
$(1)=$(VERSION) $(foreach provide, \
$(PROVIDES), \
$(provide)$$(ABIV_$(1))=$(VERSION) \
) \
) \
), \
$$(prov) )" \
$(if $(DEFAULT_VARIANT),--info "provider-priority:100",$(if $(PROVIDES),--info "provider-priority:1")) \
$$(if $$(Package/$(1)/PROVIDES),--info "provides:$$(Package/$(1)/PROVIDES)") \
$$(if $$(Package/$(1)/PRIORITY),--info "provider-priority:$$(Package/$(1)/PRIORITY)") \
$$(APK_SCRIPTS_$(1)) \
--info "depends:$$(foreach depends,$$(subst $$(comma),$$(space),$$(subst $$(space),,$$(subst $$(paren_right),,$$(subst $$(paren_left),,$$(Package/$(1)/DEPENDS))))),$$(depends))" \
--files "$$(IDIR_$(1))" \

View file

@ -332,9 +332,12 @@ define BuildPackage
$(eval $(Package/Default))
$(eval $(Package/$(1)))
ifdef DESCRIPTION
$$(error DESCRIPTION:= is obsolete, use Package/PKG_NAME/description)
endif
# Add an implicit self-provide. apk can't handle self provides, be it
# versioned or virtual, so opt for a suffix instead. This allows several
# variants to provide the same virtual package without adding extra provides
# to the default one, e.g. wget implicitly provides wget-any and is marked as
# default, so wget-ssl can explicitly provide @wget-any as well.
$(eval PROVIDES:=$(strip @$(1)-any $(PROVIDES)))
ifndef Package/$(1)/description
define Package/$(1)/description
@ -388,7 +391,7 @@ prepare-package-install:
$(PACKAGE_DIR):
mkdir -p $@
compile:
compile: prepare-package-install
.install: .compile
install: compile

View file

@ -359,7 +359,7 @@ endif
define BuildTargets/DumpCurrent
.PHONY: dumpinfo
dumpinfo : export DESCRIPTION=$$(Target/Description)
dumpinfo: $(call shexport,Target/Description)
dumpinfo:
@echo 'Target: $(TARGETID)'; \
echo 'Target-Board: $(BOARD)'; \
@ -376,7 +376,7 @@ define BuildTargets/DumpCurrent
echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
$(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; )) \
echo 'Target-Description:'; \
echo "$$$$DESCRIPTION"; \
echo "$$$$$(call shvar,Target/Description);"; \
echo '@@'; \
$(if $(DEFAULT_PROFILE),echo 'Target-Default-Profile: $(DEFAULT_PROFILE)';) \
echo 'Default-Packages: $(DEFAULT_PACKAGES)'; \

View file

@ -104,7 +104,7 @@ define Build/U-Boot/Target
endif
endif
$(if $(DEFAULT),DEFAULT:=$(DEFAULT))
URL:=http://www.denx.de/wiki/U-Boot
URL:=https://docs.u-boot.org/en/latest/
endef
define Package/u-boot-$(1)/install

View file

@ -105,7 +105,7 @@ ifneq ($(CONFIG_USE_APK),)
$$(cat $(TMP_DIR)/apk_install_list) \
"base-files=$(shell cat $(TMP_DIR)/base-files.version)" \
"libc=$(shell cat $(TMP_DIR)/libc.version)" \
"kernel=$(shell cat $(TMP_DIR)/kernel.version)"
"kernel=$(subst -rc,_rc,$(shell cat $(TMP_DIR)/kernel.version))"
rm -rf $(TARGET_DIR)/run
else

View file

@ -45,7 +45,7 @@ define Package/base-files
+SELINUX:procd-selinux +!SELINUX:procd +USE_SECCOMP:procd-seccomp \
+SELINUX:busybox-selinux +!SELINUX:busybox
TITLE:=Base filesystem for OpenWrt
URL:=http://openwrt.org/
URL:=https://openwrt.org/
VERSION:=$(PKG_RELEASE)~$(lastword $(subst -, ,$(REVISION)))
endef

View file

@ -5,7 +5,6 @@ mail:x:8:
dialout:x:20:
audio:x:29:
www-data:x:33:
ftp:x:55:
users:x:100:
network:x:101:
nogroup:x:65534:

View file

@ -1,5 +1,4 @@
root:x:0:0:root:/root:/bin/ash
daemon:*:1:1:daemon:/var:/bin/false
ftp:*:55:55:ftp:/home/ftp:/bin/false
network:*:101:101:network:/var:/bin/false
nobody:*:65534:65534:nobody:/var:/bin/false

View file

@ -1,5 +1,4 @@
root:::0:99999:7:::
daemon:*:0:0:99999:7:::
ftp:*:0:0:99999:7:::
network:*:0:0:99999:7:::
nobody:*:0:0:99999:7:::

View file

@ -1,4 +1,4 @@
[ "$(uci -q get network.globals.dhcp_default_duid)" != "auto" ] && exit 0
[ "$(uci -q get network.globals.dhcp_default_duid || echo "auto")" != "auto" ] && exit 0
uci -q batch <<-EOF >/dev/null
# DUID-UUID - RFC6355

View file

@ -0,0 +1,6 @@
zonename="$(uci -q get system.@system[0].zonename)"
case "$zonename" in
*[[:space:]]*) uci set system.@system[0].zonename="${zonename// /_}" ;;
esac
exit 0

View file

@ -382,7 +382,7 @@ default_postinst() {
uci commit
fi
rm -f /tmp/luci-indexcache
rm -f /tmp/luci-indexcache.*
fi
if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then

View file

@ -24,6 +24,17 @@ __network_ifstatus() {
eval "$__tmp"
}
# determine the IAID of the given logical interface
# 1: destination variable
# 2: interface
network_generate_iface_iaid() {
local __iaid
__iaid=$(printf '%s' "$2" | md5sum | cut -c 1-8)
export "$1=$__iaid"
}
# determine first IPv4 address of given logical interface
# 1: destination variable
# 2: interface

View file

@ -5,6 +5,14 @@
# See /LICENSE for more information.
#
config EXTRA_IMAGE_NAME
string
prompt "Extra image filename" if IMAGEOPT
default ""
help
Add this to the output image filenames, to distinguish between
different builds for the same hardware type.
config TARGET_DEFAULT_LAN_IP_FROM_PREINIT
bool "Use preinit IP configuration as default LAN IP" if IMAGEOPT
default n

View file

@ -30,6 +30,7 @@ define Trusted-Firmware-A/Default
BOOT_DEVICE:=
DDR3_FLYBY:=
DDR3_FREQ_1866:=
DDR4_4BG_MODE:=
DDR_TYPE:=
NAND_TYPE:=
BOARD_QFN:=
@ -139,6 +140,14 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr
DDR3_FLYBY:=1
endef
define Trusted-Firmware-A/mt7981-nor-ddr4
NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
BOOT_DEVICE:=nor
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
endef
define Trusted-Firmware-A/mt7981-ram-ddr4
NAME:=MediaTek MT7981 (RAM, DDR4)
BOOT_DEVICE:=ram
@ -158,6 +167,14 @@ define Trusted-Firmware-A/mt7981-emmc-ddr4
DDR_TYPE:=ddr4
endef
define Trusted-Firmware-A/mt7981-sdmmc-ddr4
NAME:=MediaTek MT7981 (SD card, DDR4)
BOOT_DEVICE:=sdmmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
endef
define Trusted-Firmware-A/mt7981-spim-nand-ddr4
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
BOOT_DEVICE:=spim-nand
@ -186,14 +203,6 @@ define Trusted-Firmware-A/mt7981-ram-ddr3
DEFAULT:=TARGET_mediatek_filogic
endef
define Trusted-Firmware-A/mt7981-nor-ddr4
NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
BOOT_DEVICE:=nor
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
endef
define Trusted-Firmware-A/mt7981-emmc-ddr3
NAME:=MediaTek MT7981 (eMMC, DDR3)
BOOT_DEVICE:=emmc
@ -202,8 +211,8 @@ define Trusted-Firmware-A/mt7981-emmc-ddr3
DDR_TYPE:=ddr3
endef
define Trusted-Firmware-A/mt7981-emmc-ddr3-1866mhz
NAME:=MediaTek MT7981 (eMMC, DDR3 1866 MHz)
define Trusted-Firmware-A/mt7981-emmc-ddr3-1866
NAME:=MediaTek MT7981 (eMMC, DDR3 1866 MT/s)
BOOT_DEVICE:=emmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
@ -235,8 +244,8 @@ define Trusted-Firmware-A/mt7981-spim-nand-ddr3
DDR_TYPE:=ddr3
endef
define Trusted-Firmware-A/mt7981-spim-nand-ddr3-1866mhz
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR3 1866 MHz)
define Trusted-Firmware-A/mt7981-spim-nand-ddr3-1866
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR3 1866 MT/s)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
@ -244,8 +253,17 @@ define Trusted-Firmware-A/mt7981-spim-nand-ddr3-1866mhz
DDR3_FREQ_1866:=1
endef
define Trusted-Firmware-A/mt7981-cudy-tr3000-v1
NAME:=Cudy TR3000 v1 (SPI-NAND via SPIM, DDR3)
define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
USE_UBI:=1
endef
define Trusted-Firmware-A/mt7981-cudy-ddr3
NAME:=Cudy (SPI-NAND via SPIM, DDR3)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
@ -265,15 +283,6 @@ define Trusted-Firmware-A/mt7986-ram-ddr4
DEFAULT:=TARGET_mediatek_filogic
endef
define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
USE_UBI:=1
endef
define Trusted-Firmware-A/mt7986-nor-ddr4
NAME:=MediaTek MT7986 (SPI-NOR, DDR4)
BOOT_DEVICE:=nor
@ -399,7 +408,14 @@ define Trusted-Firmware-A/mt7987-emmc-comb
BOOT_DEVICE:=emmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DRAM_USE_COMB:=1
endef
define Trusted-Firmware-A/mt7987-emmc-ddr4-4bg
NAME:=MediaTek MT7987 (eMMC, DDR4 4GB)
BOOT_DEVICE:=emmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DDR4_4BG_MODE:=1
endef
define Trusted-Firmware-A/mt7987-nor-comb
@ -407,7 +423,6 @@ define Trusted-Firmware-A/mt7987-nor-comb
BOOT_DEVICE:=nor
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DRAM_USE_COMB:=1
endef
define Trusted-Firmware-A/mt7987-sdmmc-comb
@ -415,7 +430,22 @@ define Trusted-Firmware-A/mt7987-sdmmc-comb
BOOT_DEVICE:=sdmmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DRAM_USE_COMB:=1
endef
define Trusted-Firmware-A/mt7987-sdmmc-ddr4-4bg
NAME:=MediaTek MT7987 (SD card, DDR4 4GB)
BOOT_DEVICE:=sdmmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DDR4_4BG_MODE:=1
endef
define Trusted-Firmware-A/mt7987-spim-nand0
NAME:=MediaTek MT7987 (SPI-NAND via SPIM)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
SPIM_CTRL:=0
endef
define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
@ -423,7 +453,6 @@ define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DRAM_USE_COMB:=1
USE_UBI:=1
SPIM_CTRL:=0
endef
@ -433,7 +462,6 @@ define Trusted-Firmware-A/mt7987-spim-nand2-ubi-comb
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DRAM_USE_COMB:=1
USE_UBI:=1
SPIM_CTRL:=2
endef
@ -443,7 +471,6 @@ define Trusted-Firmware-A/mt7987-ram-comb
BOOT_DEVICE:=ram
BUILD_SUBTARGET:=filogic
PLAT:=mt7987
DRAM_USE_COMB:=1
RAM_BOOT_UART_DL:=1
HIDDEN:=
DEFAULT:=TARGET_mediatek_filogic
@ -618,6 +645,34 @@ define Trusted-Firmware-A/mt7988-spim-nand-ubi-ddr4
USE_UBI:=1
endef
define Trusted-Firmware-A/mt7988-emmc-comb-4bg
NAME:=MediaTek MT7988 (eMMC, DDR4 8GB)
BOOT_DEVICE:=emmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7988
DRAM_USE_COMB:=1
DDR4_4BG_MODE:=1
endef
define Trusted-Firmware-A/mt7988-sdmmc-comb-4bg
NAME:=MediaTek MT7988 (SD card, DDR4 8GB)
BOOT_DEVICE:=sdmmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7988
DRAM_USE_COMB:=1
DDR4_4BG_MODE:=1
endef
define Trusted-Firmware-A/mt7988-spim-nand-ubi-comb-4bg
NAME:=MediaTek MT7988 (SPI-NAND via SPIM, UBI, DDR4 8GB)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7988
DRAM_USE_COMB:=1
DDR4_4BG_MODE:=1
USE_UBI:=1
endef
TFA_TARGETS:= \
mt7622-nor-1ddr \
mt7622-nor-2ddr \
@ -633,18 +688,19 @@ TFA_TARGETS:= \
mt7622-sdmmc-2ddr \
mt7981-ram-ddr3 \
mt7981-emmc-ddr3 \
mt7981-emmc-ddr3-1866mhz \
mt7981-emmc-ddr3-1866 \
mt7981-nor-ddr3 \
mt7981-nor-ddr4 \
mt7981-sdmmc-ddr3 \
mt7981-snand-ddr3 \
mt7981-spim-nand-ddr3 \
mt7981-spim-nand-ddr3-1866mhz \
mt7981-spim-nand-ddr3-1866 \
mt7981-spim-nand-ubi-ddr4 \
mt7981-ram-ddr4 \
mt7981-emmc-ddr4 \
mt7981-sdmmc-ddr4 \
mt7981-spim-nand-ddr4 \
mt7981-cudy-tr3000-v1 \
mt7981-cudy-ddr3 \
mt7986-ram-ddr3 \
mt7986-emmc-ddr3 \
mt7986-nor-ddr3 \
@ -661,8 +717,11 @@ TFA_TARGETS:= \
mt7986-spim-nand-ubi-ddr4 \
mt7986-spim-nand-4k-ddr4 \
mt7987-emmc-comb \
mt7987-emmc-ddr4-4bg \
mt7987-nor-comb \
mt7987-sdmmc-comb \
mt7987-sdmmc-ddr4-4bg \
mt7987-spim-nand0 \
mt7987-spim-nand0-ubi-comb \
mt7987-spim-nand2-ubi-comb \
mt7987-ram-comb \
@ -685,7 +744,10 @@ TFA_TARGETS:= \
mt7988-snand-ubi-comb \
mt7988-spim-nand-comb \
mt7988-spim-nand-ubi-comb \
mt7988-spim-nand-ubi-ddr4
mt7988-spim-nand-ubi-ddr4 \
mt7988-emmc-comb-4bg \
mt7988-sdmmc-comb-4bg \
mt7988-spim-nand-ubi-comb-4bg
TFA_MAKE_FLAGS += \
BOOT_DEVICE=$(BOOT_DEVICE) \
@ -696,6 +758,7 @@ TFA_MAKE_FLAGS += \
HAVE_DRAM_OBJ_FILE=yes \
$(if $(DDR3_FLYBY),DDR3_FLYBY=1) \
$(if $(DDR3_FREQ_1866),DDR3_FREQ_1866=1) \
$(if $(DDR4_4BG_MODE),DDR4_4BG_MODE=1) \
$(if $(DRAM_USE_COMB),DRAM_USE_COMB=1) \
$(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \

View file

@ -5,10 +5,11 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/microchip-ung/arm-trusted-firmware.git
PKG_SOURCE_DATE:=2024-08-13
PKG_SOURCE_VERSION:=67fcfcab71f78ac7d4af834c37b29f8c98dd5ff1
PKG_MIRROR_HASH:=777c68273e84028de77750f3fe8a1219b02f01d43ce35948893ac642d8eb10d7
PKG_SOURCE_DATE:=2026-01-07
PKG_SOURCE_VERSION:=7696c9aaaae7c677f4c373a61a1289cba7f824aa
PKG_MIRROR_HASH:=331548d7c73896bd5e4438c0ec9c71bbe58d3bf9a29350496ad94c382e922b9c
PKG_BUILD_DEPENDS:=ruby/host
PKG_MAINTAINER:=Robert Marko <robert.marko@sartura.hr>
include $(INCLUDE_DIR)/kernel.mk
@ -28,7 +29,17 @@ define Trusted-Firmware-A/ev23x71a
DEPENDS:=+u-boot-ev23x71a
endef
TFA_TARGETS:= ev23x71a
define Trusted-Firmware-A/tactical-1000
NAME:=Novarq Tactical 1000
BUILD_SUBTARGET:=lan969x
BUILD_DEVICES:=novarq_tactical-1000
PLAT:=novarq_tactical_1000_v3
DEPENDS:=+u-boot-tactical-1000
endef
TFA_TARGETS:= \
ev23x71a \
tactical-1000
MBEDTLS_NAME:=mbedtls
MBEDTLS_RELEASE:=2.28.10
@ -52,17 +63,6 @@ define Build/Prepare
$(TAR) -C $(PKG_BUILD_DIR) -xf $(DL_DIR)/$(MBEDTLS_SOURCE)
endef
# We must not pass OPENSSL_DIR as locally built mbedtls is used
define Build/Compile
+unset CC; \
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS) \
$(if $(DTC),DTC="$(DTC)") \
PLAT=$(PLAT) \
BUILD_STRING="OpenWrt $(PKG_VERSION_PREFIX)$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
$(TFA_MAKE_FLAGS)
endef
TFA_MAKE_FLAGS += \
MBEDTLS_DIR=$(PKG_BUILD_DIR)/$(MBEDTLS_NAME) \
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.bin \

View file

@ -0,0 +1,171 @@
From 190202583edb9dcab5ca49638169d08a332f0fdf Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Sun, 2 Nov 2025 16:57:45 +0100
Subject: [PATCH] microchip: lan969x: add Novarq Tactical 1000 v3
Add support for Novarq Tactical 1000 v3 board as a separate platform since
it uses 2GB of RAM and requires a different RAM configuration.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
.../fdts/lan969x-tactical-1000-v3-ddr.dtsi | 90 +++++++++++++++++++
.../novarq_tactical_1000_v3_tb_fw_config.dts | 30 +++++++
.../novarq_tactical_1000_v3/platform.mk | 12 +++
scripts/fwu/fwu.js | 2 +-
4 files changed, 133 insertions(+), 1 deletion(-)
create mode 100644 plat/microchip/lan969x/fdts/lan969x-tactical-1000-v3-ddr.dtsi
create mode 100644 plat/microchip/lan969x/novarq_tactical_1000_v3/fdts/novarq_tactical_1000_v3_tb_fw_config.dts
create mode 100644 plat/microchip/lan969x/novarq_tactical_1000_v3/platform.mk
--- /dev/null
+++ b/plat/microchip/lan969x/fdts/lan969x-tactical-1000-v3-ddr.dtsi
@@ -0,0 +1,90 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries.
+ *
+ */
+
+&ddr {
+ microchip,mem-name = "lan969x_tactical_1000_2gb 2025-11-02-13:03:23 7391dfb-dirty";
+ microchip,mem-speed = <2400>;
+ microchip,mem-size = <0x80000000>;
+ microchip,mem-bus-width = <16>;
+
+ microchip,main-reg = <
+ 0x00001091 /* crcparctl1 */
+ 0x00000001 /* dbictl */
+ 0x00000040 /* dfimisc */
+ 0x0391820f /* dfitmg0 */
+ 0x00040201 /* dfitmg1 */
+ 0x40400003 /* dfiupd0 */
+ 0x004000ff /* dfiupd1 */
+ 0x003f7f40 /* ecccfg0 */
+ 0x00020248 /* init0 */
+ 0x00e80000 /* init1 */
+ 0x0c340101 /* init3 */
+ 0x10180200 /* init4 */
+ 0x00110000 /* init5 */
+ 0x00000402 /* init6 */
+ 0x00000c19 /* init7 */
+ 0x81040010 /* mstr */
+ 0x00000000 /* pccfg */
+ 0x00000000 /* pwrctl */
+ 0x00210020 /* rfshctl0 */
+ 0x00000000 /* rfshctl3 */
+ >;
+
+ microchip,timing-reg = <
+ 0x17131413 /* dramtmg0 */
+ 0x0007051b /* dramtmg1 */
+ 0x1a000010 /* dramtmg12 */
+ 0x090b0512 /* dramtmg2 */
+ 0x0000400c /* dramtmg3 */
+ 0x08040409 /* dramtmg4 */
+ 0x07070404 /* dramtmg5 */
+ 0x07060c0b /* dramtmg8 */
+ 0x0003040d /* dramtmg9 */
+ 0x07000610 /* odtcfg */
+ 0x0049014b /* rfshtmg */
+ >;
+
+ microchip,mapping-reg = <
+ 0x0000001f /* addrmap0 */
+ 0x003f0909 /* addrmap1 */
+ 0x00000700 /* addrmap2 */
+ 0x00000000 /* addrmap3 */
+ 0x00001f1f /* addrmap4 */
+ 0x07070707 /* addrmap5 */
+ 0x07070707 /* addrmap6 */
+ 0x00000f07 /* addrmap7 */
+ 0x00003f01 /* addrmap8 */
+ >;
+
+ microchip,phy-reg = <
+ 0x0000040c /* dcr */
+ 0x0064401b /* dsgcr */
+ 0x8000b0cf /* dtcr0 */
+ 0x00010a37 /* dtcr1 */
+ 0x00c01884 /* dxccr */
+ 0x000010ba /* pgcr2 */
+ 0x00000000 /* schcr1 */
+ 0x00079900 /* zq0pr */
+ 0x10077900 /* zq1pr */
+ 0x00000000 /* zq2pr */
+ 0x00058f00 /* zqcr */
+ >;
+
+ microchip,phy_timing-reg = <
+ 0x0827100a /* dtpr0 */
+ 0x28250018 /* dtpr1 */
+ 0x000702a1 /* dtpr2 */
+ 0x03000101 /* dtpr3 */
+ 0x02950808 /* dtpr4 */
+ 0x00361009 /* dtpr5 */
+ 0x4ae25710 /* ptr0 */
+ 0x74f4950e /* ptr1 */
+ 0x00083def /* ptr2 */
+ 0x2a192000 /* ptr3 */
+ 0x1003a000 /* ptr4 */
+ >;
+
+};
--- /dev/null
+++ b/plat/microchip/lan969x/novarq_tactical_1000_v3/fdts/novarq_tactical_1000_v3_tb_fw_config.dts
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2022, Microchip Technology Inc. and its subsidiaries.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/dts-v1/;
+
+#include "lan969x.dtsi"
+#include "lan969x-tactical-1000-v3-ddr.dtsi"
+
+&emmc_clk {
+ clock-frequency = <100000000>;
+};
+
+&sdmmc0 {
+ status = "okay";
+ bus-width = <8>;
+};
+
+&qspi0 {
+ status = "okay";
+ spi-flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <100000000>;
+ spi-tx-bus-width = <4>;
+ spi-rx-bus-width = <4>;
+ };
+};
--- /dev/null
+++ b/plat/microchip/lan969x/novarq_tactical_1000_v3/platform.mk
@@ -0,0 +1,12 @@
+#
+# Copyright (c) 2021, Microchip Technology Inc. and its subsidiaries.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+include plat/microchip/lan969x/common/common.mk
+
+# This is used in lan969x code
+$(eval $(call add_define,LAN969X_ASIC))
+# This is used in common drivers
+$(eval $(call add_define,LAN966X_ASIC))
--- a/scripts/fwu/fwu.js
+++ b/scripts/fwu/fwu.js
@@ -91,7 +91,7 @@ const platforms = [
"ddr_diag": ddr_diag_regs_lan969x,
"ddr_regs": ddr_regs_lan969x,
"ddr_speed": lan969x_speeds,
- "bl2u_compat": ["lan969x_a0", "lan969x_svb"],
+ "bl2u_compat": ["lan969x_a0", "lan969x_svb", "novarq_tactical_1000_v3"],
},
];

View file

@ -0,0 +1,95 @@
From 40166fd8d88f33c621d3cca0b936f31816f3fe2e Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Mon, 12 Jan 2026 14:40:23 +0100
Subject: [PATCH] cert_create: add LibreSSL 3.9+ compatibility
LibreSSL 3.9+ has dropped the whole support for X509V3 extensions.
Generated by Gemini 3 Pro.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
tools/cert_create/src/ext.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
--- a/tools/cert_create/src/ext.c
+++ b/tools/cert_create/src/ext.c
@@ -51,15 +51,18 @@ int ext_init(void)
{
cmd_opt_t cmd_opt;
ext_t *ext;
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x40200000L
X509V3_EXT_METHOD *m;
- int nid, ret;
+ int ret, nid;
+#endif
unsigned int i;
extensions = malloc((num_def_extensions * sizeof(def_extensions[0]))
#ifdef PDEF_EXTS
+ (num_pdef_extensions * sizeof(pdef_extensions[0]))
#endif
- );
+ );
+
if (extensions == NULL) {
ERROR("%s:%d Failed to allocate memory.\n", __func__, __LINE__);
return 1;
@@ -69,7 +72,7 @@ int ext_init(void)
(num_def_extensions * sizeof(def_extensions[0])));
#ifdef PDEF_EXTS
memcpy(&extensions[num_def_extensions], &pdef_extensions[0],
- (num_pdef_extensions * sizeof(pdef_extensions[0])));
+ (num_pdef_extensions * sizeof(pdef_extensions[0])));
num_extensions = num_def_extensions + num_pdef_extensions;
#else
num_extensions = num_def_extensions;
@@ -86,11 +89,15 @@ int ext_init(void)
cmd_opt.help_msg = ext->help_msg;
cmd_opt_add(&cmd_opt);
}
+
/* Register the extension OID in OpenSSL */
if (ext->oid == NULL) {
continue;
}
+
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x40200000L
nid = OBJ_create(ext->oid, ext->sn, ext->ln);
+
if (ext->alias) {
X509V3_EXT_add_alias(nid, ext->alias);
} else {
@@ -117,7 +124,16 @@ int ext_init(void)
return 1;
}
}
+#else
+ /*
+ * LibreSSL 4.2.0+ removed X509V3_EXT_add/alias.
+ * We still register the OID, but ignore the returned NID
+ * as we skip method registration.
+ */
+ OBJ_create(ext->oid, ext->sn, ext->ln);
+#endif
}
+
return 0;
}
@@ -323,12 +339,14 @@ void ext_cleanup(void)
for (i = 0; i < num_extensions; i++) {
if (extensions[i].arg != NULL) {
void *ptr = (void *)extensions[i].arg;
-
extensions[i].arg = NULL;
free(ptr);
}
}
free(extensions);
+
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x40200000L
X509V3_EXT_cleanup();
+#endif
}

View file

@ -0,0 +1,36 @@
From 11ff8b5e67830d5a09f39e8c1f000b0ddcf8e88f Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Mon, 12 Jan 2026 15:16:07 +0100
Subject: [PATCH] cert_create: pass pthread in LDFLAGS
OpenWrt-s LibreSSL is linked against pthread, so we have to make sure to
pass -lpthread in LDFLAGS to avoid:
/usr/bin/ld: /openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-crypto_init.o): in function `OPENSSL_init_crypto':
crypto_init.c:(.text+0x67): undefined reference to `pthread_once'
/usr/bin/ld: /openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-err.o): in function `ERR_load_ERR_strings':
err.c:(.text+0x812): undefined reference to `pthread_once'
/usr/bin/ld: /openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-conf_sap.o): in function `OpenSSL_config':
conf_sap.c:(.text+0xc0): undefined reference to `pthread_once'
/usr/bin/ld: /openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-conf_sap.o): in function `OpenSSL_no_config':
conf_sap.c:(.text+0x107): undefined reference to `pthread_once'
/usr/bin/ld: /openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-err_all.o): in function `ERR_load_crypto_strings':
err_all.c:(.text+0xa3): undefined reference to `pthread_once'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:93: cert_create] Error 1
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
tools/cert_create/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/cert_create/Makefile
+++ b/tools/cert_create/Makefile
@@ -79,7 +79,7 @@ INC_DIR += -I ./include -I ${PLAT_INCLUD
# located under the main project directory (i.e.: ${OPENSSL_DIR}, not
# ${OPENSSL_DIR}/lib/).
LIB_DIR := -L ${OPENSSL_DIR}/lib -L ${OPENSSL_DIR}
-LIB := -lssl -lcrypto
+LIB := -lssl -lcrypto -pthread
HOSTCC ?= gcc

View file

@ -0,0 +1,29 @@
From f78f934710394822a36bd74043ed93a812c1c690 Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Mon, 12 Jan 2026 15:36:35 +0100
Subject: [PATCH] microchip: lan969x: do not rely on Ruby shebang
Host Ruby build in the staging dir must be used, so we cannot rely on the
shebang as that will fail.
So, call the script via Ruby executable instead.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
plat/microchip/lan969x/common/common.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/plat/microchip/lan969x/common/common.mk
+++ b/plat/microchip/lan969x/common/common.mk
@@ -218,9 +218,9 @@ FWU_HTML := ${BUILD_PLAT}/fwu.html
FWU_JS := ${BUILD_PLAT}/fwu_app.js
${FWU_JS}: ${BUILD_PLAT}/${FWU_FIP_NAME}
- ./plat/microchip/scripts/mkjs.rb -p ${PLAT} -o ${FWU_JS} $<
+ $(Q)ruby ./plat/microchip/scripts/mkjs.rb -p ${PLAT} -o ${FWU_JS} $<
${FWU_HTML}: ${FWU_JS}
- ./plat/microchip/scripts/html_inline.rb -i ${BUILD_PLAT} ./scripts/fwu/serial.html > ${FWU_HTML}
+ $(Q)ruby ./plat/microchip/scripts/html_inline.rb -i ${BUILD_PLAT} ./scripts/fwu/serial.html > ${FWU_HTML}
all: ${FWU_HTML}

View file

@ -7,10 +7,10 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=2.13
PKG_VERSION:=2.14.0
PKG_RELEASE:=1
PKG_HASH:=afb5c408392fcec840bd30de9b02a236b0108142024f9853b542b596b0d894e3
PKG_HASH:=b2a3bc360307c929714ffd8e7f1441c4888cd5d80531276e809c2de54db5dc16
PKG_MAINTAINER:=Sarah Maedel <openwrt@tbspace.de>

View file

@ -34,7 +34,7 @@ define Package/grub2/Default
CATEGORY:=Boot Loaders
SECTION:=boot
TITLE:=GRand Unified Bootloader ($(2))
URL:=http://www.gnu.org/software/grub/
URL:=https://www.gnu.org/software/grub/
DEPENDS:=@TARGET_$(1)
VARIANT:=$(2)
endef
@ -49,7 +49,7 @@ define Package/grub2-editenv
SECTION:=utils
SUBMENU:=Boot Loaders
TITLE:=Grub2 Environment editor
URL:=http://www.gnu.org/software/grub/
URL:=https://www.gnu.org/software/grub/
DEPENDS:=@TARGET_x86
VARIANT:=none
endef
@ -63,7 +63,7 @@ define Package/grub2-bios-setup
SECTION:=utils
SUBMENU:=Boot Loaders
TITLE:=Grub2 BIOS boot setup tool
URL:=http://www.gnu.org/software/grub/
URL:=https://www.gnu.org/software/grub/
DEPENDS:=@TARGET_x86
VARIANT:=none
endef

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=kexec-tools
PKG_VERSION:=2.0.28
PKG_VERSION:=2.0.32
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
PKG_HASH:=d2f0ef872f39e2fe4b1b01feb62b0001383207239b9f8041f98a95564161d053
PKG_HASH:=8f81422a5fd2362cf6cb001b511e535565ed0f32c2f4451fb5eb68fed6710a5d
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
@ -47,7 +47,7 @@ define Package/kexec
$(call Package/kexec-tools/Default)
TITLE:=Kernel boots kernel
DEPENDS:=\
@(armeb||arm||i386||x86_64||powerpc64||mipsel||mips) \
@(armeb||arm||aarch64||i386||x86_64||powerpc64||mipsel||mips) \
+KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC
endef
@ -58,7 +58,7 @@ endef
define Package/kdump
$(call Package/kexec-tools/Default)
TITLE:=Kernel crash analysis
DEPENDS:=+kexec @(i386||x86_64||arm) @KERNEL_CRASH_DUMP
DEPENDS:=+kexec @(i386||x86_64||arm||aarch64) @KERNEL_CRASH_DUMP
endef
define Package/kdump/description

View file

@ -1,81 +0,0 @@
From 328de8e00e298f00d7ba6b25dc3950147e9642e6 Mon Sep 17 00:00:00 2001
From: Michel Lind <salimma@fedoraproject.org>
Date: Tue, 30 Jan 2024 04:14:31 -0600
Subject: [PATCH] Fix building on x86_64 with binutils 2.41
Newer versions of the GNU assembler (observed with binutils 2.41) will
complain about the ".arch i386" in files assembled with "as --64",
with the message "Error: 64bit mode not supported on 'i386'".
Fix by moving ".arch i386" below the relevant ".code32" directive, so
that the assembler is no longer expecting 64-bit instructions to be used
by the time that the ".arch i386" directive is encountered.
Based on similar iPXE fix:
https://github.com/ipxe/ipxe/commit/6ca597eee
Signed-off-by: Michel Lind <michel@michel-slm.name>
Signed-off-by: Simon Horman <horms@kernel.org>
---
purgatory/arch/i386/entry32-16-debug.S | 2 +-
purgatory/arch/i386/entry32-16.S | 2 +-
purgatory/arch/i386/entry32.S | 2 +-
purgatory/arch/i386/setup-x86.S | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
--- a/purgatory/arch/i386/entry32-16-debug.S
+++ b/purgatory/arch/i386/entry32-16-debug.S
@@ -25,10 +25,10 @@
.globl entry16_debug_pre32
.globl entry16_debug_first32
.globl entry16_debug_old_first32
- .arch i386
.balign 16
entry16_debug:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
--- a/purgatory/arch/i386/entry32-16.S
+++ b/purgatory/arch/i386/entry32-16.S
@@ -20,10 +20,10 @@
#undef i386
.text
.globl entry16, entry16_regs
- .arch i386
.balign 16
entry16:
.code32
+ .arch i386
/* Compute where I am running at (assumes esp valid) */
call 1f
1: popl %ebx
--- a/purgatory/arch/i386/entry32.S
+++ b/purgatory/arch/i386/entry32.S
@@ -20,10 +20,10 @@
#undef i386
.text
- .arch i386
.globl entry32, entry32_regs
entry32:
.code32
+ .arch i386
/* Setup a gdt that should that is generally usefully */
lgdt %cs:gdt
--- a/purgatory/arch/i386/setup-x86.S
+++ b/purgatory/arch/i386/setup-x86.S
@@ -21,10 +21,10 @@
#undef i386
.text
- .arch i386
.globl purgatory_start
purgatory_start:
.code32
+ .arch i386
/* Load a gdt so I know what the segment registers are */
lgdt %cs:gdt

View file

@ -1,37 +0,0 @@
From 99f62f58fac57214ecc3c9aabf6bf61ac1e1201d Mon Sep 17 00:00:00 2001
From: Tony Ambardar <itugrok@yahoo.com>
Date: Fri, 7 Jun 2024 21:54:56 -0700
Subject: [PATCH] i386: improve basename() compatibility
Drop usage of glibc basename() in favour of a simpler implementation that
works across GNU and musl libc, and is similar to existing code in fs2dt.c.
This fixes compile errors seen building against musl.
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
---
kexec/arch/i386/x86-linux-setup.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -318,6 +318,7 @@ static int add_edd_entry(struct x86_linu
uint8_t devnum, version;
uint32_t mbr_sig;
struct edd_info *edd_info;
+ char *basename = strrchr(sysfs_name,'/') + 1;
if (!current_mbr || !current_edd) {
fprintf(stderr, "%s: current_edd and current_edd "
@@ -329,9 +330,9 @@ static int add_edd_entry(struct x86_linu
memset(edd_info, 0, sizeof(struct edd_info));
/* extract the device number */
- if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
+ if (sscanf(basename, "int13_dev%hhx", &devnum) != 1) {
fprintf(stderr, "Invalid format of int13_dev dir "
- "entry: %s\n", basename(sysfs_name));
+ "entry: %s\n", basename);
return -1;
}

View file

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=2024.01
PKG_HASH:=b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3
PKG_RELEASE:=2
PKG_VERSION:=2025.10
PKG_HASH:=b4f032848e56cc8f213ad59f9132c084dbbb632bc29176d024e58220e0efdf4a
PKG_RELEASE:=1
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk

View file

@ -6,13 +6,10 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2023.01
PKG_VERSION:=2024.01
PKG_RELEASE:=1
PKG_HASH:=69423bad380f89a0916636e89e6dcbd2e4512d584308d922d1039d1e4331950f
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
PKG_HASH:=b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk

View file

@ -1,197 +0,0 @@
From d45e64aad18e5e324425b9efbe6a0ec9e1a343da Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 20 Nov 2021 13:19:13 -0600
Subject: [PATCH 01/90] ARM: dts: sun8i: A33: Add iNet U70B REV01
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/sun8i-a33-inet-u70b-rev1.dts | 172 ++++++++++++++++++++++
2 files changed, 173 insertions(+)
create mode 100644 arch/arm/dts/sun8i-a33-inet-u70b-rev1.dts
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -644,6 +644,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
sun8i-a33-et-q8-v1.6.dtb \
sun8i-a33-ga10h-v1.1.dtb \
sun8i-a33-inet-d978-rev2.dtb \
+ sun8i-a33-inet-u70b-rev1.dtb \
sun8i-a33-ippo-q8h-v1.2.dtb \
sun8i-a33-olinuxino.dtb \
sun8i-a33-q8-tablet.dtb \
--- /dev/null
+++ b/arch/arm/dts/sun8i-a33-inet-u70b-rev1.dts
@@ -0,0 +1,172 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+
+/dts-v1/;
+
+#include "sun8i-a33.dtsi"
+#include "sun8i-reference-design-tablet.dtsi"
+
+/ {
+ model = "iNet U70B REV01";
+ compatible = "inet-tek,inet-u70b-rev01", "allwinner,sun8i-a33";
+
+ aliases {
+ ethernet0 = &rtl8723cs;
+ };
+
+ panel: panel {
+ compatible = "panel-dpi";
+ backlight = <&backlight>;
+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+ power-supply = <&reg_dc1sw>;
+
+ panel-timing {
+ clock-frequency = <51000000>;
+ hactive = <1024>;
+ vactive = <600>;
+ hfront-porch = <162>;
+ hback-porch = <158>;
+ hsync-len = <20>;
+ vback-porch = <25>;
+ vfront-porch = <10>;
+ vsync-len = <3>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ };
+
+ port {
+ panel_in_tcon0: endpoint {
+ remote-endpoint = <&tcon0_out_panel>;
+ };
+ };
+ };
+
+ speaker_amp: audio-amplifier {
+ compatible = "simple-audio-amplifier";
+ enable-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+ sound-name-prefix = "Speaker Amp";
+ };
+
+ wifi_pwrseq: wifi-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL6 */
+ post-power-on-delay-ms = <200>;
+ };
+};
+
+&codec {
+ status = "okay";
+};
+
+&dai {
+ status = "okay";
+};
+
+&de {
+ status = "okay";
+};
+
+&i2c1 {
+ clock-frequency = <400000>;
+
+ accelerometer@18 {
+ compatible = "bosch,bma250";
+ reg = <0x18>;
+ interrupt-parent = <&pio>;
+ interrupts = <7 10 IRQ_TYPE_EDGE_RISING>; /* PH10 / EINT10 */
+ };
+};
+
+&mmc1 {
+ pinctrl-0 = <&mmc1_pg_pins>;
+ pinctrl-names = "default";
+ bus-width = <4>;
+ non-removable;
+ vmmc-supply = <&reg_dldo1>;
+ vqmmc-supply = <&reg_dldo2>;
+ status = "okay";
+
+ rtl8723cs: wifi@1 {
+ reg = <1>;
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>; /* PL7 */
+ };
+};
+
+&nfc {
+ status = "okay";
+
+ nand@0 {
+ reg = <0>;
+ allwinner,rb = <0>;
+ nand-ecc-maximize;
+ };
+};
+
+&r_uart {
+ status = "disabled";
+};
+
+&reg_dldo2 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-wifi-io";
+};
+
+&simplefb_lcd {
+ status = "okay";
+};
+
+&sound {
+ simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
+ simple-audio-card,widgets = "Headphone", "Headphone Jack",
+ "Microphone", "Internal Microphone",
+ "Speaker", "Internal Speaker";
+ simple-audio-card,routing = "Headphone Jack", "HP",
+ "Internal Speaker", "Speaker Amp OUTL",
+ "Internal Speaker", "Speaker Amp OUTR",
+ "Speaker Amp INL", "HP", /* PHONEOUT ??? */
+ "Speaker Amp INR", "HP", /* PHONEOUT ??? */
+ "Left DAC", "DACL",
+ "Right DAC", "DACR",
+ "ADCL", "Left ADC",
+ "ADCR", "Right ADC",
+ "MIC1", "Internal Microphone",
+ "MIC2", "Headset Microphone",
+ "Headset Microphone", "HBIAS",
+ "Internal Microphone", "MBIAS";
+ status = "okay";
+};
+
+&tcon0 {
+ pinctrl-0 = <&lcd_rgb666_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
+&tcon0_out {
+ tcon0_out_panel: endpoint {
+ remote-endpoint = <&panel_in_tcon0>;
+ };
+};
+
+&touchscreen {
+ reg = <0x40>;
+ compatible = "silead,gsl1680";
+ avdd-supply = <&reg_ldo_io1>;
+ touchscreen-size-x = <1024>;
+ touchscreen-size-y = <600>;
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pg_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ bluetooth {
+ compatible = "realtek,rtl8723cs-bt";
+ device-wake-gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */
+ enable-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
+ host-wake-gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
+ };
+};

View file

@ -0,0 +1,74 @@
From ddbe65963dec1e261c23d027602b89d18d90ae63 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 4 Feb 2023 13:58:20 -0600
Subject: [PATCH 02/68] riscv: cpu: Add skeleton for T-HEAD CPUs
This is a direct copy of the existing generic CPU code.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/riscv/cpu/thead/Makefile | 4 ++++
arch/riscv/cpu/thead/cpu.c | 22 ++++++++++++++++++++++
arch/riscv/cpu/thead/dram.c | 22 ++++++++++++++++++++++
3 files changed, 48 insertions(+)
create mode 100644 arch/riscv/cpu/thead/Makefile
create mode 100644 arch/riscv/cpu/thead/cpu.c
create mode 100644 arch/riscv/cpu/thead/dram.c
--- /dev/null
+++ b/arch/riscv/cpu/thead/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y += cpu.o
+obj-y += dram.o
--- /dev/null
+++ b/arch/riscv/cpu/thead/cpu.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <irq_func.h>
+#include <asm/cache.h>
+
+/*
+ * cleanup_before_linux() is called just before we call linux
+ * it prepares the processor for linux
+ *
+ * we disable interrupt and caches.
+ */
+int cleanup_before_linux(void)
+{
+ disable_interrupts();
+
+ cache_flush();
+
+ return 0;
+}
--- /dev/null
+++ b/arch/riscv/cpu/thead/dram.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <common.h>
+#include <fdtdec.h>
+#include <init.h>
+#include <asm/global_data.h>
+#include <linux/sizes.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+ return fdtdec_setup_mem_size_base();
+}
+
+int dram_init_banksize(void)
+{
+ return fdtdec_setup_memory_banksize();
+}

View file

@ -1,46 +0,0 @@
From ddb1f06d1c7758c538e286c0c7a9c8545d2af6b1 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 20 Nov 2021 13:26:36 -0600
Subject: [PATCH 02/90] sunxi: Add iNet_U70B_rev1_defconfig
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
configs/iNet_U70B_rev1_defconfig | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 configs/iNet_U70B_rev1_defconfig
--- /dev/null
+++ b/configs/iNet_U70B_rev1_defconfig
@@ -0,0 +1,32 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-inet-u70b-rev1"
+# CONFIG_SPL_SERIAL is not set
+CONFIG_SPL=y
+CONFIG_MACH_SUN8I_A33=y
+CONFIG_DRAM_CLK=480
+CONFIG_DRAM_ZQ=31675
+CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC0_CD_PIN="PB4"
+CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:158,ri:162,up:25,lo:10,hs:20,vs:3,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_DCLK_PHASE=0
+CONFIG_VIDEO_LCD_POWER="PH7"
+CONFIG_VIDEO_LCD_BL_EN="PH6"
+CONFIG_VIDEO_LCD_BL_PWM="PH0"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_CMD_BIND=y
+CONFIG_CMD_CLK=y
+CONFIG_CMD_PWM=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_WDT=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+# CONFIG_NET is not set
+CONFIG_AXP_GPIO=y
+CONFIG_REGULATOR_AXP=y
+CONFIG_REGULATOR_AXP_USB_POWER=y
+CONFIG_AXP_DLDO1_VOLT=3300
+CONFIG_DM_PWM=y
+CONFIG_PWM_SUNXI=y
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+CONFIG_USB_MUSB_HOST=y

View file

@ -1,85 +0,0 @@
From ef808412055d1ef6fe77ff130d3f5a9432fef2d7 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Tue, 3 May 2022 22:35:12 -0500
Subject: [PATCH 03/90] Adapt iNet U70B REV01 for development (FEL + serial)
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/dts/sun8i-a33-inet-u70b-rev1.dts | 11 +++++++++++
configs/iNet_U70B_rev1_defconfig | 14 +++++---------
2 files changed, 16 insertions(+), 9 deletions(-)
--- a/arch/arm/dts/sun8i-a33-inet-u70b-rev1.dts
+++ b/arch/arm/dts/sun8i-a33-inet-u70b-rev1.dts
@@ -11,6 +11,7 @@
aliases {
ethernet0 = &rtl8723cs;
+ serial0 = &uart0;
};
panel: panel {
@@ -76,6 +77,10 @@
};
};
+&mmc0 {
+ status = "disabled";
+};
+
&mmc1 {
pinctrl-0 = <&mmc1_pg_pins>;
pinctrl-names = "default";
@@ -158,6 +163,12 @@
status = "okay";
};
+&uart0 {
+ pinctrl-0 = <&uart0_pf_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
&uart1 {
pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pg_pins>;
pinctrl-names = "default";
--- a/configs/iNet_U70B_rev1_defconfig
+++ b/configs/iNet_U70B_rev1_defconfig
@@ -1,12 +1,12 @@
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-inet-u70b-rev1"
-# CONFIG_SPL_SERIAL is not set
CONFIG_SPL=y
CONFIG_MACH_SUN8I_A33=y
CONFIG_DRAM_CLK=480
CONFIG_DRAM_ZQ=31675
CONFIG_DRAM_ODT_EN=y
+CONFIG_UART0_PORT_F=y
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:158,ri:162,up:25,lo:10,hs:20,vs:3,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=0
@@ -14,19 +14,15 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_CMD_BIND=y
-CONFIG_CMD_CLK=y
-CONFIG_CMD_PWM=y
-CONFIG_CMD_I2C=y
-CONFIG_CMD_WDT=y
+CONFIG_PREBOOT="fastboot usb 0"
CONFIG_CMD_PMIC=y
CONFIG_CMD_REGULATOR=y
-# CONFIG_NET is not set
CONFIG_AXP_GPIO=y
CONFIG_REGULATOR_AXP=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_DM_PWM=y
CONFIG_PWM_SUNXI=y
-# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
-CONFIG_USB_MUSB_HOST=y
+CONFIG_REMOTEPROC_SUN6I_AR100=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_WATCHDOG_AUTOSTART=y

View file

@ -0,0 +1,53 @@
From 63ba3ddfaddeb963a959e709aac249d61f51bb3f Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 5 Feb 2023 09:56:34 -0600
Subject: [PATCH 03/68] riscv: cpu: thead: Add extension CSR definitions
T-HEAD C9xx and E9xx CPUs contain some extra CSRs which control the
branch predictor and cache-related functionality.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/riscv/cpu/thead/thead_csr.h | 36 ++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 arch/riscv/cpu/thead/thead_csr.h
--- /dev/null
+++ b/arch/riscv/cpu/thead/thead_csr.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef _THEAD_CSR_H_
+#define _THEAD_CSR_H_
+
+#define CSR_MXSTATUS 0x7c0
+#define CSR_MHCR 0x7c1
+#define CSR_MHINT 0x7c5
+
+#define MXSTATUS_THEADISAEE BIT(22) /* T-HEAD ISA extensions enable */
+#define MXSTATUS_MM BIT(15) /* misaligned access enable */
+
+#define MHCR_IE BIT(0) /* icache enable */
+#define MHCR_DE BIT(1) /* dcache enable */
+#define MHCR_WA BIT(2) /* dcache write allocate */
+#define MHCR_WB BIT(3) /* dcache write back */
+#define MHCR_RS BIT(4) /* return stack enable */
+#define MHCR_BPE BIT(5) /* branch prediction enable */
+#define MHCR_BTB_C906 BIT(6) /* branch target prediction enable */
+#define MHCR_WBR BIT(8) /* write burst enable */
+#define MHCR_BTB_E906 BIT(12) /* branch target prediction enable */
+
+#define MHINT_DPLD BIT(2) /* dcache prefetch enable */
+#define MHINT_AMR_PAGE (0x0 << 3)
+#define MHINT_AMR_LIMIT_3 (0x1 << 3)
+#define MHINT_AMR_LIMIT_64 (0x2 << 3)
+#define MHINT_AMR_LIMIT_128 (0x3 << 3)
+#define MHINT_IPLD BIT(8) /* icache prefetch enable */
+#define MHINT_IWPE BIT(9) /* icache way prediction enable */
+#define MHINT_D_DIS_PREFETCH_2 (0x0 << 13)
+#define MHINT_D_DIS_PREFETCH_4 (0x1 << 13)
+#define MHINT_D_DIS_PREFETCH_8 (0x2 << 13)
+#define MHINT_D_DIS_PREFETCH_16 (0x3 << 13)
+#define MHINT_AEE BIT(20) /* accurate exception enable */
+
+#endif /* _THEAD_CSR_H_ */

View file

@ -1,54 +0,0 @@
From 40a0ec0fdb6a110d69151de5480148772877f267 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 26 Aug 2021 20:39:33 -0500
Subject: [PATCH 04/90] ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator
This board is configured with CONFIG_USB1_VBUS_PIN="PH24", but no
regulator exists in its device tree. Add the regulator, so USB will
continue to work when the PHY driver switches to using the regulator
uclass instead of a GPIO.
Update the device tree here because it does not exist in Linux.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/dts/sun6i-a31-mixtile-loftq.dts | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
+++ b/arch/arm/dts/sun6i-a31-mixtile-loftq.dts
@@ -6,6 +6,9 @@
*/
/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+
#include "sun6i-a31.dtsi"
/ {
@@ -19,6 +22,15 @@
chosen {
stdout-path = "serial0:115200n8";
};
+
+ reg_usb1_vbus: usb1-vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb1-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+ };
};
&ehci0 {
@@ -56,3 +68,8 @@
pinctrl-0 = <&uart0_ph_pins>;
status = "okay";
};
+
+&usbphy {
+ usb1_vbus-supply = <&reg_usb1_vbus>;
+ status = "okay";
+};

View file

@ -0,0 +1,72 @@
From 5159250118c6f58a469fc9185ea4227f852e51d0 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 5 Feb 2023 09:44:05 -0600
Subject: [PATCH 04/68] riscv: cpu: thead: Initialize extension CSRs
Enable the T-HEAD ISA extensions, as these are required to use the cache
maintenance instructions. Enable the branch predictor and BTB to improve
performance. Some bits are only available on specific CPU models, so
provide Kconfig symbols for selecting the right model.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/riscv/Kconfig | 1 +
arch/riscv/cpu/thead/Kconfig | 7 +++++++
arch/riscv/cpu/thead/cpu.c | 21 +++++++++++++++++++++
3 files changed, 29 insertions(+)
create mode 100644 arch/riscv/cpu/thead/Kconfig
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -89,6 +89,7 @@ source "arch/riscv/cpu/fu540/Kconfig"
source "arch/riscv/cpu/fu740/Kconfig"
source "arch/riscv/cpu/generic/Kconfig"
source "arch/riscv/cpu/jh7110/Kconfig"
+source "arch/riscv/cpu/thead/Kconfig"
# architecture-specific options below
--- /dev/null
+++ b/arch/riscv/cpu/thead/Kconfig
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+config THEAD_C906
+ bool
+
+config THEAD_E906
+ bool
--- a/arch/riscv/cpu/thead/cpu.c
+++ b/arch/riscv/cpu/thead/cpu.c
@@ -5,6 +5,10 @@
#include <irq_func.h>
#include <asm/cache.h>
+#include <asm/csr.h>
+#include <linux/bitops.h>
+
+#include "thead_csr.h"
/*
* cleanup_before_linux() is called just before we call linux
@@ -20,3 +24,20 @@ int cleanup_before_linux(void)
return 0;
}
+
+void harts_early_init(void)
+{
+ if (!CONFIG_IS_ENABLED(RISCV_MMODE))
+ return;
+
+ csr_set(CSR_MXSTATUS, MXSTATUS_THEADISAEE | MXSTATUS_MM);
+ if (IS_ENABLED(THEAD_C906)) {
+ csr_set(CSR_MHCR,
+ MHCR_BTB_C906 | MHCR_BPE | MHCR_RS | MHCR_WB | MHCR_WA);
+ csr_set(CSR_MHINT, MHINT_IWPE | MHINT_IPLD | MHINT_IPLD);
+ }
+ if (IS_ENABLED(THEAD_E906)) {
+ csr_set(CSR_MHCR,
+ MHCR_BTB_E906 | MHCR_BPE | MHCR_RS | MHCR_WB | MHCR_WA);
+ }
+}

View file

@ -1,97 +0,0 @@
From e07c1d516c1a7842510d22a7cf88666d500a9a9a Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 22 Aug 2021 21:35:45 -0500
Subject: [PATCH 05/90] power: regulator: Add a driver for the AXP USB power
supply
This driver reports the presence/absence of voltage on the PMIC's USB
VBUS pin. This information is used by the USB PHY driver. The
corresponding Linux driver uses the power supply class, which does not
exist in U-Boot. UCLASS_REGULATOR seems to be the closest match.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/power/regulator/Kconfig | 7 ++++
drivers/power/regulator/Makefile | 1 +
drivers/power/regulator/axp_usb_power.c | 49 +++++++++++++++++++++++++
3 files changed, 57 insertions(+)
create mode 100644 drivers/power/regulator/axp_usb_power.c
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -43,6 +43,13 @@ config REGULATOR_AS3722
but does not yet support change voltages. Currently this must be
done using direct register writes to the PMIC.
+config REGULATOR_AXP_USB_POWER
+ bool "Enable driver for X-Powers AXP PMIC USB power supply"
+ depends on DM_REGULATOR && PMIC_AXP
+ help
+ Enable support for reading the USB power supply status from
+ X-Powers AXP2xx and AXP8xx PMICs.
+
config DM_REGULATOR_BD71837
bool "Enable Driver Model for ROHM BD71837/BD71847 regulators"
depends on DM_REGULATOR && DM_PMIC_BD71837
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -7,6 +7,7 @@
obj-$(CONFIG_$(SPL_)DM_REGULATOR) += regulator-uclass.o
obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
obj-$(CONFIG_REGULATOR_AS3722) += as3722_regulator.o
+obj-$(CONFIG_$(SPL_)REGULATOR_AXP_USB_POWER) += axp_usb_power.o
obj-$(CONFIG_$(SPL_)DM_REGULATOR_DA9063) += da9063.o
obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
obj-$(CONFIG_DM_REGULATOR_NPCM8XX) += npcm8xx_regulator.o
--- /dev/null
+++ b/drivers/power/regulator/axp_usb_power.c
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <dm/device.h>
+#include <errno.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+
+#define AXP_POWER_STATUS 0x00
+#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
+
+static int axp_usb_power_get_enable(struct udevice *dev)
+{
+ int ret;
+
+ ret = pmic_reg_read(dev->parent, AXP_POWER_STATUS);
+ if (ret < 0)
+ return ret;
+
+ return !!(ret & AXP_POWER_STATUS_VBUS_PRESENT);
+}
+
+static const struct dm_regulator_ops axp_usb_power_ops = {
+ .get_enable = axp_usb_power_get_enable,
+};
+
+static int axp_usb_power_probe(struct udevice *dev)
+{
+ struct dm_regulator_uclass_plat *uc_plat = dev_get_uclass_plat(dev);
+
+ uc_plat->type = REGULATOR_TYPE_FIXED;
+
+ return 0;
+}
+
+static const struct udevice_id axp_usb_power_ids[] = {
+ { .compatible = "x-powers,axp202-usb-power-supply" },
+ { .compatible = "x-powers,axp221-usb-power-supply" },
+ { .compatible = "x-powers,axp223-usb-power-supply" },
+ { .compatible = "x-powers,axp813-usb-power-supply" },
+ { }
+};
+
+U_BOOT_DRIVER(axp_usb_power) = {
+ .name = "axp_usb_power",
+ .id = UCLASS_REGULATOR,
+ .of_match = axp_usb_power_ids,
+ .probe = axp_usb_power_probe,
+ .ops = &axp_usb_power_ops,
+};

View file

@ -0,0 +1,134 @@
From a2615b3b161929df1ae151585d4638cc4ab09bf9 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 4 Feb 2023 14:29:20 -0600
Subject: [PATCH 05/68] riscv: cpu: thead: Add CPU-specific cache operations
Use the vendor CSRs for enabling/disabling the caches, and the ISA
extension for cache maintenance.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/riscv/cpu/thead/Kconfig | 2 +
arch/riscv/cpu/thead/Makefile | 1 +
arch/riscv/cpu/thead/cache.c | 96 +++++++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+)
create mode 100644 arch/riscv/cpu/thead/cache.c
--- a/arch/riscv/cpu/thead/Kconfig
+++ b/arch/riscv/cpu/thead/Kconfig
@@ -2,6 +2,8 @@
config THEAD_C906
bool
+ select SYS_CACHE_SHIFT_6
config THEAD_E906
bool
+ select SYS_CACHE_SHIFT_5
--- a/arch/riscv/cpu/thead/Makefile
+++ b/arch/riscv/cpu/thead/Makefile
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0+
+obj-y += cache.o
obj-y += cpu.o
obj-y += dram.o
--- /dev/null
+++ b/arch/riscv/cpu/thead/cache.c
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <cpu_func.h>
+#include <asm/cache.h>
+#include <asm/csr.h>
+#include <linux/bitops.h>
+
+#include "thead_csr.h"
+
+#define THEAD_SYNC_I ".long 0x01a0000b"
+#define THEAD_DCACHE_CIALL ".long 0x0030000b"
+#define THEAD_DCACHE_CIPA_A0 ".long 0x02b5000b"
+#define THEAD_DCACHE_IALL ".long 0x0020000b"
+#define THEAD_DCACHE_IPA_A0 ".long 0x02a5000b"
+#define THEAD_ICACHE_IPA_A0 ".long 0x0385000b"
+
+static inline void sync_i(void)
+{
+ asm volatile (THEAD_SYNC_I ::: "memory");
+}
+
+void flush_dcache_all(void)
+{
+ asm volatile (THEAD_DCACHE_CIALL ::: "memory");
+ sync_i();
+}
+
+void flush_dcache_range(unsigned long start, unsigned long end)
+{
+ register ulong addr asm ("a0") = start & -CONFIG_SYS_CACHELINE_SIZE;
+
+ for (; addr < end; addr += CONFIG_SYS_CACHELINE_SIZE)
+ asm volatile (THEAD_DCACHE_CIPA_A0 :: "r" (addr) : "memory");
+ sync_i();
+}
+
+void invalidate_dcache_all(void)
+{
+ asm volatile (THEAD_DCACHE_IALL ::: "memory");
+ sync_i();
+}
+
+void invalidate_dcache_range(unsigned long start, unsigned long end)
+{
+ register ulong addr asm ("a0") = start & -CONFIG_SYS_CACHELINE_SIZE;
+
+ for (; addr < end; addr += CONFIG_SYS_CACHELINE_SIZE)
+ asm volatile (THEAD_DCACHE_IPA_A0 :: "r" (addr) : "memory");
+ sync_i();
+}
+
+void invalidate_icache_range(unsigned long start, unsigned long end)
+{
+ register ulong addr asm ("a0") = start & -CONFIG_SYS_CACHELINE_SIZE;
+
+ for (; addr < end; addr += CONFIG_SYS_CACHELINE_SIZE)
+ asm volatile (THEAD_ICACHE_IPA_A0 :: "r" (addr) : "memory");
+ sync_i();
+}
+
+#if CONFIG_IS_ENABLED(RISCV_MMODE)
+
+void icache_enable(void)
+{
+ invalidate_icache_all();
+ csr_set(CSR_MHCR, MHCR_IE);
+}
+
+void icache_disable(void)
+{
+ csr_clear(CSR_MHCR, MHCR_IE);
+}
+
+int icache_status(void)
+{
+ return csr_read(CSR_MHCR) & MHCR_IE;
+}
+
+void dcache_enable(void)
+{
+ invalidate_dcache_all();
+ csr_set(CSR_MHCR, MHCR_DE);
+}
+
+void dcache_disable(void)
+{
+ flush_dcache_all();
+ csr_clear(CSR_MHCR, MHCR_DE);
+}
+
+int dcache_status(void)
+{
+ return csr_read(CSR_MHCR) & MHCR_DE;
+}
+
+#endif

View file

@ -1,122 +0,0 @@
From c750151e1107a8d46ca0f9bd30c1da276b142ec1 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 26 Aug 2021 18:02:54 -0500
Subject: [PATCH 06/90] gpio: axp/sunxi: Remove virtual VBUS detection GPIO
Now that this functionality is modeled using the device tree and
regulator uclass, the named GPIO is not referenced anywhere. Remove it.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/include/asm/arch-sunxi/gpio.h | 1 -
drivers/gpio/axp_gpio.c | 21 ++++-----------------
drivers/gpio/sunxi_gpio.c | 6 +-----
include/axp209.h | 1 -
include/axp221.h | 1 -
include/axp809.h | 1 -
include/axp818.h | 1 -
7 files changed, 5 insertions(+), 27 deletions(-)
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -209,7 +209,6 @@ enum sunxi_gpio_number {
/* Virtual AXP0 GPIOs */
#define SUNXI_GPIO_AXP0_PREFIX "AXP0-"
-#define SUNXI_GPIO_AXP0_VBUS_DETECT 4
#define SUNXI_GPIO_AXP0_VBUS_ENABLE 5
#define SUNXI_GPIO_AXP0_GPIO_COUNT 6
--- a/drivers/gpio/axp_gpio.c
+++ b/drivers/gpio/axp_gpio.c
@@ -36,18 +36,11 @@ static int axp_gpio_direction_input(stru
{
u8 reg;
- switch (pin) {
-#ifndef CONFIG_AXP152_POWER /* NA on axp152 */
- case SUNXI_GPIO_AXP0_VBUS_DETECT:
- return 0;
-#endif
- default:
- reg = axp_get_gpio_ctrl_reg(pin);
- if (reg == 0)
- return -EINVAL;
+ reg = axp_get_gpio_ctrl_reg(pin);
+ if (reg == 0)
+ return -EINVAL;
- return pmic_bus_write(reg, AXP_GPIO_CTRL_INPUT);
- }
+ return pmic_bus_write(reg, AXP_GPIO_CTRL_INPUT);
}
static int axp_gpio_direction_output(struct udevice *dev, unsigned pin,
@@ -83,12 +76,6 @@ static int axp_gpio_get_value(struct ude
int ret;
switch (pin) {
-#ifndef CONFIG_AXP152_POWER /* NA on axp152 */
- case SUNXI_GPIO_AXP0_VBUS_DETECT:
- ret = pmic_bus_read(AXP_POWER_STATUS, &val);
- mask = AXP_POWER_STATUS_VBUS_PRESENT;
- break;
-#endif
#ifdef AXP_MISC_CTRL_N_VBUSEN_FUNC
/* Only available on later PMICs */
case SUNXI_GPIO_AXP0_VBUS_ENABLE:
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -117,11 +117,7 @@ int sunxi_name_to_gpio(const char *name)
#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
char lookup[8];
- if (strcasecmp(name, "AXP0-VBUS-DETECT") == 0) {
- sprintf(lookup, SUNXI_GPIO_AXP0_PREFIX "%d",
- SUNXI_GPIO_AXP0_VBUS_DETECT);
- name = lookup;
- } else if (strcasecmp(name, "AXP0-VBUS-ENABLE") == 0) {
+ if (strcasecmp(name, "AXP0-VBUS-ENABLE") == 0) {
sprintf(lookup, SUNXI_GPIO_AXP0_PREFIX "%d",
SUNXI_GPIO_AXP0_VBUS_ENABLE);
name = lookup;
--- a/include/axp209.h
+++ b/include/axp209.h
@@ -77,7 +77,6 @@ enum axp209_reg {
#ifdef CONFIG_AXP209_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_ALDO_IN BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
#define AXP_GPIO0_CTRL 0x90
#define AXP_GPIO1_CTRL 0x92
#define AXP_GPIO2_CTRL 0x93
--- a/include/axp221.h
+++ b/include/axp221.h
@@ -53,7 +53,6 @@
#ifdef CONFIG_AXP221_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_ALDO_IN BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
#define AXP_VBUS_IPSOUT 0x30
#define AXP_VBUS_IPSOUT_DRIVEBUS (1 << 2)
#define AXP_MISC_CTRL 0x8f
--- a/include/axp809.h
+++ b/include/axp809.h
@@ -47,7 +47,6 @@
#ifdef CONFIG_AXP809_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_ALDO_IN BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
#define AXP_VBUS_IPSOUT 0x30
#define AXP_VBUS_IPSOUT_DRIVEBUS (1 << 2)
#define AXP_MISC_CTRL 0x8f
--- a/include/axp818.h
+++ b/include/axp818.h
@@ -61,7 +61,6 @@
#ifdef CONFIG_AXP818_POWER
#define AXP_POWER_STATUS 0x00
#define AXP_POWER_STATUS_ALDO_IN BIT(0)
-#define AXP_POWER_STATUS_VBUS_PRESENT BIT(5)
#define AXP_VBUS_IPSOUT 0x30
#define AXP_VBUS_IPSOUT_DRIVEBUS (1 << 2)
#define AXP_MISC_CTRL 0x8f

View file

@ -1,7 +1,7 @@
From 0e4edc3a01f179337bb0bd0d31855dbce338a23e Mon Sep 17 00:00:00 2001
From 8d12d6e5730c80503840e3c18fafb9bed4133dc9 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 30 Oct 2022 14:53:45 -0500
Subject: [PATCH 22/90] fdt: Fix bounds check in devfdt_get_addr_index
Subject: [PATCH 07/68] fdt: Fix bounds check in devfdt_get_addr_index
reg must contain enough cells for the entire next address/size pair
after skipping `index` pairs. The previous code allows an out-of-bounds
@ -17,7 +17,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/drivers/core/fdtaddr.c
+++ b/drivers/core/fdtaddr.c
@@ -43,7 +43,7 @@ fdt_addr_t devfdt_get_addr_index(const s
@@ -44,7 +44,7 @@ fdt_addr_t devfdt_get_addr_index(const s
}
reg = fdt_getprop(gd->fdt_blob, offset, "reg", &len);

View file

@ -0,0 +1,21 @@
From 1c5558f39481911fdb730fd686e710c7f696f17f Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 17 Nov 2022 22:08:39 -0600
Subject: [PATCH 08/68] fdt: Use correct parent in devfdt_get_addr_index
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/core/fdtaddr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/core/fdtaddr.c
+++ b/drivers/core/fdtaddr.c
@@ -23,7 +23,7 @@ fdt_addr_t devfdt_get_addr_index(const s
{
#if CONFIG_IS_ENABLED(OF_REAL)
int offset = dev_of_offset(dev);
- int parent = dev_of_offset(dev->parent);
+ int parent = fdt_parent_offset(gd->fdt_blob, offset);
fdt_addr_t addr;
if (CONFIG_IS_ENABLED(OF_TRANSLATE)) {

View file

@ -1,41 +0,0 @@
From a588c97f146b67bae47099bc419cf10c02eca169 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 26 Aug 2021 21:34:33 -0500
Subject: [PATCH 08/90] power: pmic: axp: Probe the drivevbus regulator from
the DT
Now that some regulator driver exists for this PMIC, add support for
probing regulator drivers from the device tree subnodes.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/power/pmic/axp.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/power/pmic/axp.c
+++ b/drivers/power/pmic/axp.c
@@ -45,14 +45,24 @@ static struct dm_pmic_ops axp_pmic_ops =
.write = dm_i2c_write,
};
+static const struct pmic_child_info axp_pmic_child_info[] = {
+ { "drivevbus", "axp_drivevbus" },
+ { }
+};
+
static int axp_pmic_bind(struct udevice *dev)
{
+ ofnode regulators_node;
int ret;
ret = dm_scan_fdt_dev(dev);
if (ret)
return ret;
+ regulators_node = dev_read_subnode(dev, "regulators");
+ if (ofnode_valid(regulators_node))
+ pmic_bind_children(dev, regulators_node, axp_pmic_child_info);
+
if (CONFIG_IS_ENABLED(SYSRESET)) {
ret = device_bind_driver_to_node(dev, "axp_sysreset", "axp_sysreset",
dev_ofnode(dev), NULL);

View file

@ -1,7 +1,7 @@
From 64de4fd71d35c6154a0f7b4c7c02cb24e978a4ce Mon Sep 17 00:00:00 2001
From 621a4aa15b1b3afbbb364cd6dddeab5a84e68d32 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:45:19 -0500
Subject: [PATCH 54/90] sunxi: Fix default-enablement of USB host drivers
Subject: [PATCH 09/68] sunxi: Fix default-enablement of USB host drivers
We tried to enable USB_EHCI_GENERIC and USB_OHCI_GENERIC by default.
This did not work because those symbols depend on USB_EHCI_HCD and
@ -15,7 +15,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1142,7 +1142,11 @@ config ARCH_SUNXI
@@ -1173,7 +1173,11 @@ config ARCH_SUNXI
imply SYSRESET
imply SYSRESET_WATCHDOG
imply SYSRESET_WATCHDOG_AUTO
@ -29,7 +29,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
config ARCH_U8500
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -281,7 +281,6 @@ config USB_EHCI_ZYNQ
@@ -293,7 +293,6 @@ config USB_EHCI_ZYNQ
config USB_EHCI_GENERIC
bool "Support for generic EHCI USB controller"
depends on DM_USB
@ -37,7 +37,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
---help---
Enables support for generic EHCI controller.
@@ -343,7 +342,6 @@ config USB_OHCI_PCI
@@ -355,7 +354,6 @@ config USB_OHCI_PCI
config USB_OHCI_GENERIC
bool "Support for generic OHCI USB controller"

View file

@ -1,58 +0,0 @@
From 649bb7845e30805c66f62fc5725c4dbf350f21cb Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 26 Aug 2021 22:26:40 -0500
Subject: [PATCH 10/90] sunxi: Remove obsolete USBx_VBUS_PIN Kconfig symbols
Now that the USB PHY driver uses the device tree to get VBUS supply
regulators, these Kconfig symbols are unused. Remove them.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/mach-sunxi/Kconfig | 29 -----------------------------
1 file changed, 29 deletions(-)
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -693,13 +693,6 @@ config MMC_SUNXI_SLOT_EXTRA
slot or emmc on mmc1 - mmc3. Setting this to 1, 2 or 3 will enable
support for this.
-config USB0_VBUS_PIN
- string "Vbus enable pin for usb0 (otg)"
- default ""
- ---help---
- Set the Vbus enable pin for usb0 (otg). This takes a string in the
- format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
-
config USB0_VBUS_DET
string "Vbus detect pin for usb0 (otg)"
default ""
@@ -714,28 +707,6 @@ config USB0_ID_DET
Set the ID detect pin for usb0 (otg). This takes a string in the
format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
-config USB1_VBUS_PIN
- string "Vbus enable pin for usb1 (ehci0)"
- default "PH6" if MACH_SUN4I || MACH_SUN7I
- default "PH27" if MACH_SUN6I
- ---help---
- Set the Vbus enable pin for usb1 (ehci0, usb0 is the otg). This takes
- a string in the format understood by sunxi_name_to_gpio, e.g.
- PH1 for pin 1 of port H.
-
-config USB2_VBUS_PIN
- string "Vbus enable pin for usb2 (ehci1)"
- default "PH3" if MACH_SUN4I || MACH_SUN7I
- default "PH24" if MACH_SUN6I
- ---help---
- See USB1_VBUS_PIN help text.
-
-config USB3_VBUS_PIN
- string "Vbus enable pin for usb3 (ehci2)"
- default ""
- ---help---
- See USB1_VBUS_PIN help text.
-
config I2C0_ENABLE
bool "Enable I2C/TWI controller 0"
default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I_R40

View file

@ -1,7 +1,7 @@
From 891fef47500dbf4aecb16e08c1d8ade3fbc8caec Mon Sep 17 00:00:00 2001
From 5cde123b1d04da567899fe29e78cb98d6d66b54b Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 4 Aug 2022 23:22:05 -0500
Subject: [PATCH 55/90] sunxi: Remove unnecessary Kconfig selections
Subject: [PATCH 10/68] sunxi: Remove unnecessary Kconfig selections
Two of these selections are redundant and have no effect:
- DM_KEYBOARD is selected by USB_KEYBOARD
@ -17,7 +17,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1100,8 +1100,6 @@ config ARCH_SUNXI
@@ -1131,8 +1131,6 @@ config ARCH_SUNXI
select DM_I2C if I2C
select DM_SPI if SPI
select DM_SPI_FLASH if SPI
@ -25,8 +25,8 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
- select DM_MMC if MMC
select DM_SCSI if SCSI
select DM_SERIAL
select GPIO_EXTRA_HEADER
@@ -1119,7 +1117,6 @@ config ARCH_SUNXI
select OF_BOARD_SETUP
@@ -1149,7 +1147,6 @@ config ARCH_SUNXI
select SYS_THUMB_BUILD if !ARM64
select USB if DISTRO_DEFAULTS
select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST

View file

@ -1,393 +0,0 @@
From 73d6c82e34e89cfde880d1948b3e0dc714adead8 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 30 Apr 2022 22:34:19 -0500
Subject: [PATCH 11/90] clk: sunxi: Add support for the D1 CCU
Since the D1 CCU binding is defined, we can add support for its
gates/resets, following the pattern of the existing drivers.
Series-to: sunxi
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/clk/sunxi/Kconfig | 6 +
drivers/clk/sunxi/Makefile | 1 +
drivers/clk/sunxi/clk_d1.c | 82 ++++++++++++
drivers/clk/sunxi/clk_sunxi.c | 5 +
include/dt-bindings/clock/sun20i-d1-ccu.h | 156 ++++++++++++++++++++++
include/dt-bindings/reset/sun20i-d1-ccu.h | 77 +++++++++++
6 files changed, 327 insertions(+)
create mode 100644 drivers/clk/sunxi/clk_d1.c
create mode 100644 include/dt-bindings/clock/sun20i-d1-ccu.h
create mode 100644 include/dt-bindings/reset/sun20i-d1-ccu.h
--- a/drivers/clk/sunxi/Kconfig
+++ b/drivers/clk/sunxi/Kconfig
@@ -87,6 +87,12 @@ config CLK_SUN8I_H3
This enables common clock driver support for platforms based
on Allwinner H3/H5 SoC.
+config CLK_SUN20I_D1
+ bool "Clock driver for Allwinner D1"
+ help
+ This enables common clock driver support for platforms based
+ on Allwinner D1 SoC.
+
config CLK_SUN50I_H6
bool "Clock driver for Allwinner H6"
default MACH_SUN50I_H6
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_CLK_SUN8I_R40) += clk_r40.o
obj-$(CONFIG_CLK_SUN8I_V3S) += clk_v3s.o
obj-$(CONFIG_CLK_SUN9I_A80) += clk_a80.o
obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o
+obj-$(CONFIG_CLK_SUN20I_D1) += clk_d1.o
obj-$(CONFIG_CLK_SUN50I_H6) += clk_h6.o
obj-$(CONFIG_CLK_SUN50I_H6_R) += clk_h6_r.o
obj-$(CONFIG_CLK_SUN50I_H616) += clk_h616.o
--- /dev/null
+++ b/drivers/clk/sunxi/clk_d1.c
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2021 Samuel Holland <samuel@sholland.org>
+ */
+
+#include <common.h>
+#include <clk-uclass.h>
+#include <dm.h>
+#include <errno.h>
+#include <clk/sunxi.h>
+#include <dt-bindings/clock/sun20i-d1-ccu.h>
+#include <dt-bindings/reset/sun20i-d1-ccu.h>
+#include <linux/bitops.h>
+
+static struct ccu_clk_gate d1_gates[] = {
+ [CLK_BUS_MMC0] = GATE(0x84c, BIT(0)),
+ [CLK_BUS_MMC1] = GATE(0x84c, BIT(1)),
+ [CLK_BUS_MMC2] = GATE(0x84c, BIT(2)),
+ [CLK_BUS_UART0] = GATE(0x90c, BIT(0)),
+ [CLK_BUS_UART1] = GATE(0x90c, BIT(1)),
+ [CLK_BUS_UART2] = GATE(0x90c, BIT(2)),
+ [CLK_BUS_UART3] = GATE(0x90c, BIT(3)),
+ [CLK_BUS_UART4] = GATE(0x90c, BIT(4)),
+ [CLK_BUS_UART5] = GATE(0x90c, BIT(5)),
+ [CLK_BUS_I2C0] = GATE(0x91c, BIT(0)),
+ [CLK_BUS_I2C1] = GATE(0x91c, BIT(1)),
+ [CLK_BUS_I2C2] = GATE(0x91c, BIT(2)),
+ [CLK_BUS_I2C3] = GATE(0x91c, BIT(3)),
+ [CLK_SPI0] = GATE(0x940, BIT(31)),
+ [CLK_SPI1] = GATE(0x944, BIT(31)),
+ [CLK_BUS_SPI0] = GATE(0x96c, BIT(0)),
+ [CLK_BUS_SPI1] = GATE(0x96c, BIT(1)),
+
+ [CLK_BUS_EMAC] = GATE(0x97c, BIT(0)),
+
+ [CLK_USB_OHCI0] = GATE(0xa70, BIT(31)),
+ [CLK_USB_OHCI1] = GATE(0xa74, BIT(31)),
+ [CLK_BUS_OHCI0] = GATE(0xa8c, BIT(0)),
+ [CLK_BUS_OHCI1] = GATE(0xa8c, BIT(1)),
+ [CLK_BUS_EHCI0] = GATE(0xa8c, BIT(4)),
+ [CLK_BUS_EHCI1] = GATE(0xa8c, BIT(5)),
+ [CLK_BUS_OTG] = GATE(0xa8c, BIT(8)),
+ [CLK_BUS_LRADC] = GATE(0xa9c, BIT(0)),
+
+ [CLK_RISCV] = GATE(0xd04, BIT(31)),
+};
+
+static struct ccu_reset d1_resets[] = {
+ [RST_BUS_MMC0] = RESET(0x84c, BIT(16)),
+ [RST_BUS_MMC1] = RESET(0x84c, BIT(17)),
+ [RST_BUS_MMC2] = RESET(0x84c, BIT(18)),
+ [RST_BUS_UART0] = RESET(0x90c, BIT(16)),
+ [RST_BUS_UART1] = RESET(0x90c, BIT(17)),
+ [RST_BUS_UART2] = RESET(0x90c, BIT(18)),
+ [RST_BUS_UART3] = RESET(0x90c, BIT(19)),
+ [RST_BUS_UART4] = RESET(0x90c, BIT(20)),
+ [RST_BUS_UART5] = RESET(0x90c, BIT(21)),
+ [RST_BUS_I2C0] = RESET(0x91c, BIT(16)),
+ [RST_BUS_I2C1] = RESET(0x91c, BIT(17)),
+ [RST_BUS_I2C2] = RESET(0x91c, BIT(18)),
+ [RST_BUS_I2C3] = RESET(0x91c, BIT(19)),
+ [RST_BUS_SPI0] = RESET(0x96c, BIT(16)),
+ [RST_BUS_SPI1] = RESET(0x96c, BIT(17)),
+
+ [RST_BUS_EMAC] = RESET(0x97c, BIT(16)),
+
+ [RST_USB_PHY0] = RESET(0xa70, BIT(30)),
+ [RST_USB_PHY1] = RESET(0xa74, BIT(30)),
+ [RST_BUS_OHCI0] = RESET(0xa8c, BIT(16)),
+ [RST_BUS_OHCI1] = RESET(0xa8c, BIT(17)),
+ [RST_BUS_EHCI0] = RESET(0xa8c, BIT(20)),
+ [RST_BUS_EHCI1] = RESET(0xa8c, BIT(21)),
+ [RST_BUS_OTG] = RESET(0xa8c, BIT(24)),
+ [RST_BUS_LRADC] = RESET(0xa9c, BIT(16)),
+};
+
+const struct ccu_desc d1_ccu_desc = {
+ .gates = d1_gates,
+ .resets = d1_resets,
+ .num_gates = ARRAY_SIZE(d1_gates),
+ .num_resets = ARRAY_SIZE(d1_resets),
+};
--- a/drivers/clk/sunxi/clk_sunxi.c
+++ b/drivers/clk/sunxi/clk_sunxi.c
@@ -118,6 +118,7 @@ extern const struct ccu_desc a64_ccu_des
extern const struct ccu_desc a80_ccu_desc;
extern const struct ccu_desc a80_mmc_clk_desc;
extern const struct ccu_desc a83t_ccu_desc;
+extern const struct ccu_desc d1_ccu_desc;
extern const struct ccu_desc f1c100s_ccu_desc;
extern const struct ccu_desc h3_ccu_desc;
extern const struct ccu_desc h6_ccu_desc;
@@ -183,6 +184,10 @@ static const struct udevice_id sunxi_clk
{ .compatible = "allwinner,sun9i-a80-mmc-config-clk",
.data = (ulong)&a80_mmc_clk_desc },
#endif
+#ifdef CONFIG_CLK_SUN20I_D1
+ { .compatible = "allwinner,sun20i-d1-ccu",
+ .data = (ulong)&d1_ccu_desc },
+#endif
#ifdef CONFIG_CLK_SUN50I_A64
{ .compatible = "allwinner,sun50i-a64-ccu",
.data = (ulong)&a64_ccu_desc },
--- /dev/null
+++ b/include/dt-bindings/clock/sun20i-d1-ccu.h
@@ -0,0 +1,156 @@
+/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
+/*
+ * Copyright (C) 2020 huangzhenwei@allwinnertech.com
+ * Copyright (C) 2021 Samuel Holland <samuel@sholland.org>
+ */
+
+#ifndef _DT_BINDINGS_CLK_SUN20I_D1_CCU_H_
+#define _DT_BINDINGS_CLK_SUN20I_D1_CCU_H_
+
+#define CLK_PLL_CPUX 0
+#define CLK_PLL_DDR0 1
+#define CLK_PLL_PERIPH0_4X 2
+#define CLK_PLL_PERIPH0_2X 3
+#define CLK_PLL_PERIPH0_800M 4
+#define CLK_PLL_PERIPH0 5
+#define CLK_PLL_PERIPH0_DIV3 6
+#define CLK_PLL_VIDEO0_4X 7
+#define CLK_PLL_VIDEO0_2X 8
+#define CLK_PLL_VIDEO0 9
+#define CLK_PLL_VIDEO1_4X 10
+#define CLK_PLL_VIDEO1_2X 11
+#define CLK_PLL_VIDEO1 12
+#define CLK_PLL_VE 13
+#define CLK_PLL_AUDIO0_4X 14
+#define CLK_PLL_AUDIO0_2X 15
+#define CLK_PLL_AUDIO0 16
+#define CLK_PLL_AUDIO1 17
+#define CLK_PLL_AUDIO1_DIV2 18
+#define CLK_PLL_AUDIO1_DIV5 19
+#define CLK_CPUX 20
+#define CLK_CPUX_AXI 21
+#define CLK_CPUX_APB 22
+#define CLK_PSI_AHB 23
+#define CLK_APB0 24
+#define CLK_APB1 25
+#define CLK_MBUS 26
+#define CLK_DE 27
+#define CLK_BUS_DE 28
+#define CLK_DI 29
+#define CLK_BUS_DI 30
+#define CLK_G2D 31
+#define CLK_BUS_G2D 32
+#define CLK_CE 33
+#define CLK_BUS_CE 34
+#define CLK_VE 35
+#define CLK_BUS_VE 36
+#define CLK_BUS_DMA 37
+#define CLK_BUS_MSGBOX0 38
+#define CLK_BUS_MSGBOX1 39
+#define CLK_BUS_MSGBOX2 40
+#define CLK_BUS_SPINLOCK 41
+#define CLK_BUS_HSTIMER 42
+#define CLK_AVS 43
+#define CLK_BUS_DBG 44
+#define CLK_BUS_PWM 45
+#define CLK_BUS_IOMMU 46
+#define CLK_DRAM 47
+#define CLK_MBUS_DMA 48
+#define CLK_MBUS_VE 49
+#define CLK_MBUS_CE 50
+#define CLK_MBUS_TVIN 51
+#define CLK_MBUS_CSI 52
+#define CLK_MBUS_G2D 53
+#define CLK_MBUS_RISCV 54
+#define CLK_BUS_DRAM 55
+#define CLK_MMC0 56
+#define CLK_MMC1 57
+#define CLK_MMC2 58
+#define CLK_BUS_MMC0 59
+#define CLK_BUS_MMC1 60
+#define CLK_BUS_MMC2 61
+#define CLK_BUS_UART0 62
+#define CLK_BUS_UART1 63
+#define CLK_BUS_UART2 64
+#define CLK_BUS_UART3 65
+#define CLK_BUS_UART4 66
+#define CLK_BUS_UART5 67
+#define CLK_BUS_I2C0 68
+#define CLK_BUS_I2C1 69
+#define CLK_BUS_I2C2 70
+#define CLK_BUS_I2C3 71
+#define CLK_SPI0 72
+#define CLK_SPI1 73
+#define CLK_BUS_SPI0 74
+#define CLK_BUS_SPI1 75
+#define CLK_EMAC_25M 76
+#define CLK_BUS_EMAC 77
+#define CLK_IR_TX 78
+#define CLK_BUS_IR_TX 79
+#define CLK_BUS_GPADC 80
+#define CLK_BUS_THS 81
+#define CLK_I2S0 82
+#define CLK_I2S1 83
+#define CLK_I2S2 84
+#define CLK_I2S2_ASRC 85
+#define CLK_BUS_I2S0 86
+#define CLK_BUS_I2S1 87
+#define CLK_BUS_I2S2 88
+#define CLK_SPDIF_TX 89
+#define CLK_SPDIF_RX 90
+#define CLK_BUS_SPDIF 91
+#define CLK_DMIC 92
+#define CLK_BUS_DMIC 93
+#define CLK_AUDIO_DAC 94
+#define CLK_AUDIO_ADC 95
+#define CLK_BUS_AUDIO 96
+#define CLK_USB_OHCI0 97
+#define CLK_USB_OHCI1 98
+#define CLK_BUS_OHCI0 99
+#define CLK_BUS_OHCI1 100
+#define CLK_BUS_EHCI0 101
+#define CLK_BUS_EHCI1 102
+#define CLK_BUS_OTG 103
+#define CLK_BUS_LRADC 104
+#define CLK_BUS_DPSS_TOP 105
+#define CLK_HDMI_24M 106
+#define CLK_HDMI_CEC_32K 107
+#define CLK_HDMI_CEC 108
+#define CLK_BUS_HDMI 109
+#define CLK_MIPI_DSI 110
+#define CLK_BUS_MIPI_DSI 111
+#define CLK_TCON_LCD0 112
+#define CLK_BUS_TCON_LCD0 113
+#define CLK_TCON_TV 114
+#define CLK_BUS_TCON_TV 115
+#define CLK_TVE 116
+#define CLK_BUS_TVE_TOP 117
+#define CLK_BUS_TVE 118
+#define CLK_TVD 119
+#define CLK_BUS_TVD_TOP 120
+#define CLK_BUS_TVD 121
+#define CLK_LEDC 122
+#define CLK_BUS_LEDC 123
+#define CLK_CSI_TOP 124
+#define CLK_CSI_MCLK 125
+#define CLK_BUS_CSI 126
+#define CLK_TPADC 127
+#define CLK_BUS_TPADC 128
+#define CLK_BUS_TZMA 129
+#define CLK_DSP 130
+#define CLK_BUS_DSP_CFG 131
+#define CLK_RISCV 132
+#define CLK_RISCV_AXI 133
+#define CLK_BUS_RISCV_CFG 134
+#define CLK_FANOUT_24M 135
+#define CLK_FANOUT_12M 136
+#define CLK_FANOUT_16M 137
+#define CLK_FANOUT_25M 138
+#define CLK_FANOUT_32K 139
+#define CLK_FANOUT_27M 140
+#define CLK_FANOUT_PCLK 141
+#define CLK_FANOUT0 142
+#define CLK_FANOUT1 143
+#define CLK_FANOUT2 144
+
+#endif /* _DT_BINDINGS_CLK_SUN20I_D1_CCU_H_ */
--- /dev/null
+++ b/include/dt-bindings/reset/sun20i-d1-ccu.h
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
+/*
+ * Copyright (c) 2020 huangzhenwei@allwinnertech.com
+ * Copyright (C) 2021 Samuel Holland <samuel@sholland.org>
+ */
+
+#ifndef _DT_BINDINGS_RST_SUN20I_D1_CCU_H_
+#define _DT_BINDINGS_RST_SUN20I_D1_CCU_H_
+
+#define RST_MBUS 0
+#define RST_BUS_DE 1
+#define RST_BUS_DI 2
+#define RST_BUS_G2D 3
+#define RST_BUS_CE 4
+#define RST_BUS_VE 5
+#define RST_BUS_DMA 6
+#define RST_BUS_MSGBOX0 7
+#define RST_BUS_MSGBOX1 8
+#define RST_BUS_MSGBOX2 9
+#define RST_BUS_SPINLOCK 10
+#define RST_BUS_HSTIMER 11
+#define RST_BUS_DBG 12
+#define RST_BUS_PWM 13
+#define RST_BUS_DRAM 14
+#define RST_BUS_MMC0 15
+#define RST_BUS_MMC1 16
+#define RST_BUS_MMC2 17
+#define RST_BUS_UART0 18
+#define RST_BUS_UART1 19
+#define RST_BUS_UART2 20
+#define RST_BUS_UART3 21
+#define RST_BUS_UART4 22
+#define RST_BUS_UART5 23
+#define RST_BUS_I2C0 24
+#define RST_BUS_I2C1 25
+#define RST_BUS_I2C2 26
+#define RST_BUS_I2C3 27
+#define RST_BUS_SPI0 28
+#define RST_BUS_SPI1 29
+#define RST_BUS_EMAC 30
+#define RST_BUS_IR_TX 31
+#define RST_BUS_GPADC 32
+#define RST_BUS_THS 33
+#define RST_BUS_I2S0 34
+#define RST_BUS_I2S1 35
+#define RST_BUS_I2S2 36
+#define RST_BUS_SPDIF 37
+#define RST_BUS_DMIC 38
+#define RST_BUS_AUDIO 39
+#define RST_USB_PHY0 40
+#define RST_USB_PHY1 41
+#define RST_BUS_OHCI0 42
+#define RST_BUS_OHCI1 43
+#define RST_BUS_EHCI0 44
+#define RST_BUS_EHCI1 45
+#define RST_BUS_OTG 46
+#define RST_BUS_LRADC 47
+#define RST_BUS_DPSS_TOP 48
+#define RST_BUS_HDMI_SUB 49
+#define RST_BUS_HDMI_MAIN 50
+#define RST_BUS_MIPI_DSI 51
+#define RST_BUS_TCON_LCD0 52
+#define RST_BUS_TCON_TV 53
+#define RST_BUS_LVDS0 54
+#define RST_BUS_TVE 55
+#define RST_BUS_TVE_TOP 56
+#define RST_BUS_TVD 57
+#define RST_BUS_TVD_TOP 58
+#define RST_BUS_LEDC 59
+#define RST_BUS_CSI 60
+#define RST_BUS_TPADC 61
+#define RST_DSP 62
+#define RST_BUS_DSP_CFG 63
+#define RST_BUS_DSP_DBG 64
+#define RST_BUS_RISCV_CFG 65
+
+#endif /* _DT_BINDINGS_RST_SUN20I_D1_CCU_H_ */

View file

@ -1,7 +1,7 @@
From 9e12a7fd80276092da3a43b7dbaf572bad294419 Mon Sep 17 00:00:00 2001
From cfe45b43247eca1f3ca82c76a114dd0201b23b40 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 4 Aug 2022 23:29:13 -0500
Subject: [PATCH 56/90] sunxi: Add missing dependencies to Kconfig selections
Subject: [PATCH 11/68] sunxi: Add missing dependencies to Kconfig selections
Some of the selected symbols have a user-visible dependency. Make the
selections conditional on that dependency to avoid creating invalid
@ -9,12 +9,12 @@ configurations.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/Kconfig | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm/Kconfig | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1090,30 +1090,30 @@ config ARCH_SOCFPGA
@@ -1122,28 +1122,28 @@ config ARCH_SOCFPGA
config ARCH_SUNXI
bool "Support sunxi (Allwinner) SoCs"
select BINMAN
@ -24,18 +24,15 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
select CMD_USB if DISTRO_DEFAULTS && USB_HOST
select CLK
select DM
- select DM_ETH
- select DM_GPIO
+ select DM_ETH if NET
+ select DM_GPIO if GPIO
select DM_I2C if I2C
+ select DM_SCSI if BLK && SCSI
+ select DM_SCSI if SCSI
+ select DM_SERIAL if SERIAL
select DM_SPI if SPI
select DM_SPI_FLASH if SPI
- select DM_SCSI if SCSI
- select DM_SERIAL
select GPIO_EXTRA_HEADER
select OF_BOARD_SETUP
select OF_CONTROL
select OF_SEPARATE

View file

@ -1,7 +1,7 @@
From 2ba626d36e622f29528ce953618dde9a01bdacd6 Mon Sep 17 00:00:00 2001
From a80637f9492a79c6e1b6d7a5f1a48aae08a0f004 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 21:56:43 -0500
Subject: [PATCH 57/90] sunxi: Hide image type selection if SPL is disabled
Subject: [PATCH 12/68] sunxi: Hide image type selection if SPL is disabled
This choice is meaningless when SPL is disabled. Hide it to avoid any
possible confusion.

View file

@ -1,160 +0,0 @@
From 5a909f4d4d10f3a7a59b3b75eee502937e166891 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 2 May 2022 22:00:05 -0500
Subject: [PATCH 13/90] clk: sunxi: Add a driver for the legacy A31/A23/A33
PRCM
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/clk/sunxi/Kconfig | 13 ++++-
drivers/clk/sunxi/Makefile | 1 +
drivers/clk/sunxi/clk_a31_apb0.c | 97 ++++++++++++++++++++++++++++++++
include/clk/sunxi.h | 1 +
4 files changed, 110 insertions(+), 2 deletions(-)
create mode 100644 drivers/clk/sunxi/clk_a31_apb0.c
--- a/drivers/clk/sunxi/Kconfig
+++ b/drivers/clk/sunxi/Kconfig
@@ -38,12 +38,21 @@ config CLK_SUN6I_A31
This enables common clock driver support for platforms based
on Allwinner A31/A31s SoC.
+config CLK_SUN6I_A31_APB0
+ bool "Clock driver for Allwinner A31 generation PRCM (legacy)"
+ default MACH_SUN6I || MACH_SUN8I_A23 || MACH_SUN8I_A33
+ help
+ This enables common clock driver support for the PRCM
+ in Allwinner A31/A31s/A23/A33 SoCs using the legacy PRCM
+ MFD binding.
+
config CLK_SUN6I_A31_R
- bool "Clock driver for Allwinner A31 generation PRCM"
+ bool "Clock driver for Allwinner A31 generation PRCM (CCU)"
default SUNXI_GEN_SUN6I
help
This enables common clock driver support for the PRCM
- in Allwinner A31/A31s/A23/A33/A83T/H3/A64/H5 SoCs.
+ in Allwinner A31/A31s/A23/A33/A83T/H3/A64/H5 SoCs using
+ the new CCU binding.
config CLK_SUN8I_A23
bool "Clock driver for Allwinner A23/A33"
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_CLK_SUNIV_F1C100S) += clk_f
obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o
obj-$(CONFIG_CLK_SUN5I_A10S) += clk_a10s.o
obj-$(CONFIG_CLK_SUN6I_A31) += clk_a31.o
+obj-$(CONFIG_CLK_SUN6I_A31_APB0) += clk_a31_apb0.o
obj-$(CONFIG_CLK_SUN6I_A31_R) += clk_a31_r.o
obj-$(CONFIG_CLK_SUN8I_A23) += clk_a23.o
obj-$(CONFIG_CLK_SUN8I_A83T) += clk_a83t.o
--- /dev/null
+++ b/drivers/clk/sunxi/clk_a31_apb0.c
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) Samuel Holland <samuel@sholland.org>
+ */
+
+#include <clk-uclass.h>
+#include <dm.h>
+#include <clk/sunxi.h>
+#include <linux/bitops.h>
+
+static struct ccu_clk_gate sun6i_apb0_gates[] = {
+ [0] = GATE(0x028, BIT(0)),
+ [1] = GATE(0x028, BIT(1)),
+ [2] = GATE(0x028, BIT(2)),
+ [3] = GATE(0x028, BIT(3)),
+ [4] = GATE(0x028, BIT(4)),
+ [5] = GATE(0x028, BIT(5)),
+ [6] = GATE(0x028, BIT(6)),
+ [7] = GATE(0x028, BIT(7)),
+};
+
+static struct ccu_reset sun6i_apb0_resets[] = {
+ [0] = RESET(0x0b0, BIT(0)),
+ [1] = RESET(0x0b0, BIT(1)),
+ [2] = RESET(0x0b0, BIT(2)),
+ [3] = RESET(0x0b0, BIT(3)),
+ [4] = RESET(0x0b0, BIT(4)),
+ [5] = RESET(0x0b0, BIT(5)),
+ [6] = RESET(0x0b0, BIT(6)),
+ [7] = RESET(0x0b0, BIT(7)),
+};
+
+const struct ccu_desc sun6i_apb0_clk_desc = {
+ .gates = sun6i_apb0_gates,
+ .resets = sun6i_apb0_resets,
+ .num_gates = ARRAY_SIZE(sun6i_apb0_gates),
+ .num_resets = ARRAY_SIZE(sun6i_apb0_resets),
+};
+
+static int sun6i_apb0_of_to_plat(struct udevice *dev)
+{
+ struct ccu_plat *plat = dev_get_plat(dev);
+
+ plat->base = dev_read_addr_ptr(dev->parent);
+ if (!plat->base)
+ return -ENOMEM;
+
+ plat->desc = (const struct ccu_desc *)dev_get_driver_data(dev);
+ if (!plat->desc)
+ return -EINVAL;
+
+ return 0;
+}
+
+static const struct udevice_id sun6i_apb0_clk_ids[] = {
+ { .compatible = "allwinner,sun6i-a31-apb0-gates-clk",
+ .data = (ulong)&sun6i_apb0_clk_desc },
+ { .compatible = "allwinner,sun8i-a23-apb0-gates-clk",
+ .data = (ulong)&sun6i_apb0_clk_desc },
+ { }
+};
+
+U_BOOT_DRIVER(sun6i_apb0_clk) = {
+ .name = "sun6i_apb0_clk",
+ .id = UCLASS_CLK,
+ .of_match = sun6i_apb0_clk_ids,
+ .of_to_plat = sun6i_apb0_of_to_plat,
+ .plat_auto = sizeof(struct ccu_plat),
+ .ops = &sunxi_clk_ops,
+};
+
+static const struct udevice_id sun6i_apb0_reset_ids[] = {
+ { .compatible = "allwinner,sun6i-a31-clock-reset",
+ .data = (ulong)&sun6i_apb0_clk_desc },
+ { }
+};
+
+U_BOOT_DRIVER(sun6i_apb0_reset) = {
+ .name = "sun6i_apb0_reset",
+ .id = UCLASS_RESET,
+ .of_match = sun6i_apb0_reset_ids,
+ .of_to_plat = sun6i_apb0_of_to_plat,
+ .plat_auto = sizeof(struct ccu_plat),
+ .ops = &sunxi_reset_ops,
+};
+
+static const struct udevice_id sun6i_prcm_mfd_ids[] = {
+ { .compatible = "allwinner,sun6i-a31-prcm" },
+ { .compatible = "allwinner,sun8i-a23-prcm" },
+ { }
+};
+
+U_BOOT_DRIVER(sun6i_prcm_mfd) = {
+ .name = "sun6i_prcm_mfd",
+ .id = UCLASS_SIMPLE_BUS,
+ .of_match = sun6i_prcm_mfd_ids,
+};
--- a/include/clk/sunxi.h
+++ b/include/clk/sunxi.h
@@ -86,5 +86,6 @@ struct ccu_plat {
};
extern struct clk_ops sunxi_clk_ops;
+extern struct reset_ops sunxi_reset_ops;
#endif /* _CLK_SUNXI_H */

View file

@ -1,7 +1,7 @@
From 5d197433cd54085306e369ac260e09fe6077bfbb Mon Sep 17 00:00:00 2001
From 64c72d292e8ed6c2aa183d966a5c2a844f76be96 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 4 Aug 2022 21:30:57 -0500
Subject: [PATCH 58/90] sunxi: Share the board Kconfig across architectures
Subject: [PATCH 13/68] sunxi: Share the board Kconfig across architectures
With the introduction of the Allwinner D1, the sunxi board family now
spans multiple architectures (ARM and RISC-V). Since ARCH_SUNXI depends
@ -23,7 +23,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -482,6 +482,7 @@ source "arch/Kconfig.nxp"
@@ -494,6 +494,7 @@ source "arch/Kconfig.nxp"
endif
source "board/keymile/Kconfig"
@ -33,7 +33,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1090,6 +1090,7 @@ config ARCH_SOCFPGA
@@ -1122,6 +1122,7 @@ config ARCH_SOCFPGA
config ARCH_SUNXI
bool "Support sunxi (Allwinner) SoCs"
select BINMAN
@ -43,7 +43,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
select CMD_USB if DISTRO_DEFAULTS && USB_HOST
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -959,8 +959,6 @@ config BLUETOOTH_DT_DEVICE_FIXUP
@@ -1095,8 +1095,6 @@ config BLUETOOTH_DT_DEVICE_FIXUP
The used address is "bdaddr" if set, and "ethaddr" with the LSB
flipped elsewise.

View file

@ -1,21 +0,0 @@
From 3d97f99cb173422ee8a15b7ec1df83ff61e68204 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 30 Oct 2022 14:28:23 -0500
Subject: [PATCH 14/90] clk: sunxi: Use the right symbol in the Makefile
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/clk/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -25,7 +25,7 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
obj-$(CONFIG_ARCH_SOCFPGA) += altera/
obj-$(CONFIG_ARCH_STM32) += stm32/
obj-$(CONFIG_ARCH_STM32MP) += stm32/
-obj-$(CONFIG_ARCH_SUNXI) += sunxi/
+obj-$(CONFIG_CLK_SUNXI) += sunxi/
obj-$(CONFIG_CLK_AT91) += at91/
obj-$(CONFIG_CLK_BCM6345) += clk_bcm6345.o
obj-$(CONFIG_CLK_BOSTON) += clk_boston.o

View file

@ -1,7 +1,7 @@
From 963331be1cc924ad7c928f88b3ee46bc20a41bcd Mon Sep 17 00:00:00 2001
From: Zoltan HERPAI <wigyori@uid0.hu>
Date: Tue, 6 Jun 2023 18:06:20 +0000
Subject: [PATCH 59/90] sunxi: Move most Kconfig selections to the board
From 957c017647a8bcd9908fc67dc106c438d79fd6c6 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 4 Aug 2022 22:42:29 -0500
Subject: [PATCH 14/68] sunxi: Move most Kconfig selections to the board
Kconfig
To maintain consistent behavior across architectures, most of the
@ -11,16 +11,14 @@ well. To accomplish this, select them from BOARD_SUNXI instead.
No functional change here. Lines are only moved and alphabetized.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---
arch/arm/Kconfig | 47 ---------------------------------------------
board/sunxi/Kconfig | 46 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 47 deletions(-)
board/sunxi/Kconfig | 47 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 47 deletions(-)
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1089,63 +1089,16 @@ config ARCH_SOCFPGA
@@ -1121,62 +1121,15 @@ config ARCH_SOCFPGA
config ARCH_SUNXI
bool "Support sunxi (Allwinner) SoCs"
@ -31,14 +29,12 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
- select CMD_USB if DISTRO_DEFAULTS && USB_HOST
- select CLK
- select DM
- select DM_ETH if NET
- select DM_GPIO if GPIO
- select DM_I2C if I2C
- select DM_SCSI if BLK && SCSI
- select DM_SCSI if SCSI
- select DM_SERIAL if SERIAL
- select DM_SPI if SPI
- select DM_SPI_FLASH if SPI
select GPIO_EXTRA_HEADER
- select OF_BOARD_SETUP
select OF_CONTROL
select OF_SEPARATE
@ -61,6 +57,8 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
- imply CMD_GPT
- imply CMD_UBI if MTD_RAW_NAND
- imply DISTRO_DEFAULTS
- imply DM_REGULATOR
- imply DM_REGULATOR_FIXED
- imply FAT_WRITE
- imply FIT
- imply OF_LIBFDT_OVERLAY
@ -68,7 +66,6 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
- imply SPL_GPIO
- imply SPL_LIBCOMMON_SUPPORT
- imply SPL_LIBGENERIC_SUPPORT
- imply SPL_LOAD_FIT
- imply SPL_MMC if MMC
- imply SPL_POWER
- imply SPL_SERIAL
@ -86,7 +83,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
bool "ST-Ericsson U8500 Series"
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -1,5 +1,51 @@
@@ -1,5 +1,52 @@
config BOARD_SUNXI
bool
+ select BINMAN
@ -95,10 +92,9 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
+ select CMD_MMC if MMC
+ select CMD_USB if DISTRO_DEFAULTS && USB_HOST
+ select DM
+ select DM_ETH if NET
+ select DM_GPIO if GPIO
+ select DM_I2C if I2C
+ select DM_SCSI if BLK && SCSI
+ select DM_SCSI if SCSI
+ select DM_SERIAL if SERIAL
+ select DM_SPI if SPI
+ select DM_SPI_FLASH if SPI
@ -116,6 +112,8 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
+ imply CMD_GPT
+ imply CMD_UBI if MTD_RAW_NAND
+ imply DISTRO_DEFAULTS
+ imply DM_REGULATOR
+ imply DM_REGULATOR_FIXED
+ imply FAT_WRITE
+ imply FIT
+ imply OF_LIBFDT_OVERLAY

View file

@ -1,100 +0,0 @@
From 9766169812418aee10dbc8d40aca27c1c576f521 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 14 Jul 2022 23:39:46 -0500
Subject: [PATCH 15/90] net: sun8i-emac: Use common syscon setup for R40
While R40 puts the EMAC syscon register at a different address from
other variants, the relevant portion of the register's layout is the
same. Factor out the register offset so the same code can be shared
by all variants. This matches what the Linux driver does.
This change provides two benefits beyond the simplification:
- R40 boards now respect the RX delays from the devicetree
- This resolves a warning on architectures where readl/writel
expect the address to have a pointer type, not phys_addr_t.
Series-to: sunxi
Cover-letter:
net: sun8i-emac: Allwinner D1 Support
D1 is a RISC-V SoC containing an EMAC compatible with the A64 EMAC.
However, there are a couple of issues with the driver preventing it
being built for RISC-V. These are resolved by patches 2-3. Patch 1 is
a general cleanup.
END
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/net/sun8i_emac.c | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -162,7 +162,7 @@ struct emac_eth_dev {
enum emac_variant variant;
void *mac_reg;
- phys_addr_t sysctl_reg;
+ void *sysctl_reg;
struct phy_device *phydev;
struct mii_dev *bus;
struct clk tx_clk;
@@ -317,18 +317,7 @@ static int sun8i_emac_set_syscon(struct
{
u32 reg;
- if (priv->variant == R40_GMAC) {
- /* Select RGMII for R40 */
- reg = readl(priv->sysctl_reg + 0x164);
- reg |= SC_ETCS_INT_GMII |
- SC_EPIT |
- (CONFIG_GMAC_TX_DELAY << SC_ETXDC_OFFSET);
-
- writel(reg, priv->sysctl_reg + 0x164);
- return 0;
- }
-
- reg = readl(priv->sysctl_reg + 0x30);
+ reg = readl(priv->sysctl_reg);
reg = sun8i_emac_set_syscon_ephy(priv, reg);
@@ -369,7 +358,7 @@ static int sun8i_emac_set_syscon(struct
reg |= ((pdata->rx_delay_ps / 100) << SC_ERXDC_OFFSET)
& SC_ERXDC_MASK;
- writel(reg, priv->sysctl_reg + 0x30);
+ writel(reg, priv->sysctl_reg);
return 0;
}
@@ -792,6 +781,7 @@ static int sun8i_emac_eth_of_to_plat(str
struct sun8i_eth_pdata *sun8i_pdata = dev_get_plat(dev);
struct eth_pdata *pdata = &sun8i_pdata->eth_pdata;
struct emac_eth_dev *priv = dev_get_priv(dev);
+ phys_addr_t syscon_base;
const fdt32_t *reg;
int node = dev_of_offset(dev);
int offset = 0;
@@ -837,13 +827,18 @@ static int sun8i_emac_eth_of_to_plat(str
__func__);
return -EINVAL;
}
- priv->sysctl_reg = fdt_translate_address((void *)gd->fdt_blob,
- offset, reg);
- if (priv->sysctl_reg == FDT_ADDR_T_NONE) {
+
+ syscon_base = fdt_translate_address((void *)gd->fdt_blob, offset, reg);
+ if (syscon_base == FDT_ADDR_T_NONE) {
debug("%s: Cannot find syscon base address\n", __func__);
return -EINVAL;
}
+ if (priv->variant == R40_GMAC)
+ priv->sysctl_reg = (void *)syscon_base + 0x164;
+ else
+ priv->sysctl_reg = (void *)syscon_base + 0x30;
+
pdata->phy_interface = -1;
priv->phyaddr = -1;
priv->use_internal_phy = false;

View file

@ -1,13 +1,12 @@
From 5838fd3a53e613312d46ab4cb6015a502c4c45d0 Mon Sep 17 00:00:00 2001
From: Zoltan HERPAI <wigyori@uid0.hu>
Date: Tue, 6 Jun 2023 18:07:24 +0000
Subject: [PATCH 60/90] sunxi: Globally enable SUPPORT_SPL
From 0c6f608a682d2ba1e28e7d0f54186e78a44916f4 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:31:04 -0500
Subject: [PATCH 15/68] sunxi: Globally enable SUPPORT_SPL
This was already supported by every machine type. It is unlikely that
any new SoC support will be added without SPL support.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---
arch/arm/mach-sunxi/Kconfig | 14 --------------
board/sunxi/Kconfig | 2 ++
@ -15,7 +14,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -133,7 +133,6 @@ config SUN50I_GEN_H6
@@ -184,7 +184,6 @@ config SUN50I_GEN_H6
select FIT
select SPL_LOAD_FIT
select MMC_SUNXI_HAS_NEW_MODE
@ -23,7 +22,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---help---
Select this for sunxi SoCs which have H6 like peripherals, clocks
and memory map.
@@ -166,7 +165,6 @@ config MACH_SUNXI_H3_H5
@@ -225,7 +224,6 @@ config MACH_SUNXI_H3_H5
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
select SUNXI_GEN_SUN6I
@ -31,7 +30,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
# TODO: try out A80's 8GiB DRAM space
config SUNXI_DRAM_MAX_SIZE
@@ -183,7 +181,6 @@ config MACH_SUNIV
@@ -242,7 +240,6 @@ config MACH_SUNIV
bool "suniv (Allwinner F1C100s/F1C200s/F1C600/R6)"
select CPU_ARM926EJS
select SUNXI_GEN_SUN6I
@ -39,7 +38,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select SKIP_LOWLEVEL_INIT_ONLY
select SPL_SKIP_LOWLEVEL_INIT_ONLY
@@ -192,7 +189,6 @@ config MACH_SUN4I
@@ -251,7 +248,6 @@ config MACH_SUN4I
select CPU_V7A
select DRAM_SUN4I
select SUNXI_GEN_SUN4I
@ -47,7 +46,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
imply SPL_SYS_I2C_LEGACY
imply SYS_I2C_LEGACY
@@ -201,7 +197,6 @@ config MACH_SUN5I
@@ -260,7 +256,6 @@ config MACH_SUN5I
select CPU_V7A
select DRAM_SUN4I
select SUNXI_GEN_SUN4I
@ -55,7 +54,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
imply SPL_SYS_I2C_LEGACY
imply SYS_I2C_LEGACY
@@ -216,7 +211,6 @@ config MACH_SUN6I
@@ -275,7 +270,6 @@ config MACH_SUN6I
select SPL_I2C
select SUN6I_PRCM
select SUNXI_GEN_SUN6I
@ -63,7 +62,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select SYS_I2C_SUN6I_P2WI
select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
@@ -229,7 +223,6 @@ config MACH_SUN7I
@@ -288,7 +282,6 @@ config MACH_SUN7I
select SPL_ARMV7_SET_CORTEX_SMPEN
select DRAM_SUN4I
select SUNXI_GEN_SUN4I
@ -71,7 +70,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
imply SPL_SYS_I2C_LEGACY
imply SYS_I2C_LEGACY
@@ -243,7 +236,6 @@ config MACH_SUN8I_A23
@@ -302,7 +295,6 @@ config MACH_SUN8I_A23
select DRAM_SUN8I_A23
select SPL_I2C
select SUNXI_GEN_SUN6I
@ -79,7 +78,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select SYS_I2C_SUN8I_RSB
select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
@@ -256,7 +248,6 @@ config MACH_SUN8I_A33
@@ -315,7 +307,6 @@ config MACH_SUN8I_A33
select DRAM_SUN8I_A33
select SPL_I2C
select SUNXI_GEN_SUN6I
@ -87,7 +86,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select SYS_I2C_SUN8I_RSB
select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
@@ -268,7 +259,6 @@ config MACH_SUN8I_A83T
@@ -327,7 +318,6 @@ config MACH_SUN8I_A83T
select SUNXI_GEN_SUN6I
select MMC_SUNXI_HAS_NEW_MODE
select MMC_SUNXI_HAS_MODE_SWITCH
@ -95,7 +94,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select SYS_I2C_SUN8I_RSB
config MACH_SUN8I_H3
@@ -288,7 +278,6 @@ config MACH_SUN8I_R40
@@ -347,7 +337,6 @@ config MACH_SUN8I_R40
select ARCH_SUPPORT_PSCI
select SUNXI_GEN_SUN6I
select MMC_SUNXI_HAS_NEW_MODE
@ -103,7 +102,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
imply SPL_SYS_I2C_LEGACY
@@ -302,7 +291,6 @@ config MACH_SUN8I_V3S
@@ -374,7 +363,6 @@ config MACH_SUN8I_V3S
select SUNXI_GEN_SUN6I
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_16BIT
@ -111,7 +110,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN9I
@@ -313,7 +301,6 @@ config MACH_SUN9I
@@ -385,7 +373,6 @@ config MACH_SUN9I
select SPL_I2C
select SUN6I_PRCM
select SUNXI_GEN_SUN6I
@ -119,7 +118,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
config MACH_SUN50I
bool "sun50i (Allwinner A64)"
@@ -322,7 +309,6 @@ config MACH_SUN50I
@@ -394,7 +381,6 @@ config MACH_SUN50I
select SUNXI_DE2
select SUNXI_GEN_SUN6I
select MMC_SUNXI_HAS_NEW_MODE
@ -129,7 +128,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select FIT
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -18,6 +18,7 @@ config BOARD_SUNXI
@@ -17,6 +17,7 @@ config BOARD_SUNXI
select SPL_SEPARATE_BSS if SPL
select SUNXI_GPIO if GPIO
select SYS_NS16550 if SERIAL
@ -137,7 +136,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select SYS_RELOC_GD_ENV_ADDR
select USB if DISTRO_DEFAULTS
select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST
@@ -31,6 +32,7 @@ config BOARD_SUNXI
@@ -32,6 +33,7 @@ config BOARD_SUNXI
imply FIT
imply OF_LIBFDT_OVERLAY
imply PRE_CONSOLE_BUFFER

View file

@ -1,7 +1,7 @@
From 6c8707fcd3372015829a1e8b8d5e8030c5806382 Mon Sep 17 00:00:00 2001
From 3e5ec1535312a3d413ba8300227e5601841d3f6b Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Aug 2022 00:10:46 -0500
Subject: [PATCH 61/90] sunxi: Downgrade driver selections to implications
Subject: [PATCH 16/68] sunxi: Downgrade driver selections to implications
While not especially likely, it is plausible that someone wants to build
U-Boot without GPIO or UART support. Don't force building these drivers.
@ -13,7 +13,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -16,8 +16,6 @@ config BOARD_SUNXI
@@ -15,8 +15,6 @@ config BOARD_SUNXI
select OF_BOARD_SETUP
select PINCTRL
select SPL_SEPARATE_BSS if SPL
@ -22,7 +22,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
select SUPPORT_SPL
select SYS_RELOC_GD_ENV_ADDR
select USB if DISTRO_DEFAULTS
@@ -39,6 +37,8 @@ config BOARD_SUNXI
@@ -40,6 +38,8 @@ config BOARD_SUNXI
imply SPL_MMC if MMC
imply SPL_POWER
imply SPL_SERIAL

View file

@ -1,92 +0,0 @@
From 2cde6c8a7c41c13137298c19b4e104e4f5d6851c Mon Sep 17 00:00:00 2001
From: Andre Przywara <andre.przywara@arm.com>
Date: Wed, 13 Jul 2022 17:21:43 +0100
Subject: [PATCH 16/90] sunxi: mmc: ignore card detect in SPL
The sunxi MMC code does not use the DM in the SPL, as we don't have a
device tree available that early, also no space for it.
This also means we cannot access the card-detect GPIO information from
there, so we have Kconfig symbols called CONFIG_MMCx_CD_PIN, which each
board has to define. This is a burden, also requires extra GPIO code in
the SPL.
As the SPL is the natural successor of the BootROM (from which we are
loaded), we can actually ignore the CD pin completely, as this is what
the BootROM does as well: CD GPIOs are board specific, but the BootROM
is not, so accesses the MMC devices anyway.
Remove the card detect code from the non-DM implementation of the sunxi
MMC driver, to get rid of this unneeded code.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/mmc/sunxi_mmc.c | 37 ++-----------------------------------
1 file changed, 2 insertions(+), 35 deletions(-)
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -44,22 +44,10 @@ struct sunxi_mmc_priv {
/* support 4 mmc hosts */
struct sunxi_mmc_priv mmc_host[4];
-static int sunxi_mmc_getcd_gpio(int sdc_no)
-{
- switch (sdc_no) {
- case 0: return sunxi_name_to_gpio(CONFIG_MMC0_CD_PIN);
- case 1: return sunxi_name_to_gpio(CONFIG_MMC1_CD_PIN);
- case 2: return sunxi_name_to_gpio(CONFIG_MMC2_CD_PIN);
- case 3: return sunxi_name_to_gpio(CONFIG_MMC3_CD_PIN);
- }
- return -EINVAL;
-}
-
static int mmc_resource_init(int sdc_no)
{
struct sunxi_mmc_priv *priv = &mmc_host[sdc_no];
struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
- int cd_pin, ret = 0;
debug("init mmc %d resource\n", sdc_no);
@@ -90,16 +78,7 @@ static int mmc_resource_init(int sdc_no)
}
priv->mmc_no = sdc_no;
- cd_pin = sunxi_mmc_getcd_gpio(sdc_no);
- if (cd_pin >= 0) {
- ret = gpio_request(cd_pin, "mmc_cd");
- if (!ret) {
- sunxi_gpio_set_pull(cd_pin, SUNXI_GPIO_PULL_UP);
- ret = gpio_direction_input(cd_pin);
- }
- }
-
- return ret;
+ return 0;
}
#endif
@@ -523,23 +502,11 @@ static int sunxi_mmc_send_cmd_legacy(str
return sunxi_mmc_send_cmd_common(priv, mmc, cmd, data);
}
-static int sunxi_mmc_getcd_legacy(struct mmc *mmc)
-{
- struct sunxi_mmc_priv *priv = mmc->priv;
- int cd_pin;
-
- cd_pin = sunxi_mmc_getcd_gpio(priv->mmc_no);
- if (cd_pin < 0)
- return 1;
-
- return !gpio_get_value(cd_pin);
-}
-
+/* .get_cd is not needed by the SPL */
static const struct mmc_ops sunxi_mmc_ops = {
.send_cmd = sunxi_mmc_send_cmd_legacy,
.set_ios = sunxi_mmc_set_ios_legacy,
.init = sunxi_mmc_core_init,
- .getcd = sunxi_mmc_getcd_legacy,
};
struct mmc *sunxi_mmc_init(int sdc_no)

View file

@ -1,7 +1,7 @@
From ad619478827b825d7b88dce22eb9b5e1c6ea7eb0 Mon Sep 17 00:00:00 2001
From 0289892858b876c5a11cce944c006ed0fd41e011 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Aug 2022 00:11:54 -0500
Subject: [PATCH 62/90] sunxi: Enable the I2C driver by default
Subject: [PATCH 17/68] sunxi: Enable the I2C driver by default
This is used by quite a large number of boards, for PMIC/regulator or
LCD panel control.
@ -13,7 +13,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -38,6 +38,7 @@ config BOARD_SUNXI
@@ -39,6 +39,7 @@ config BOARD_SUNXI
imply SPL_POWER
imply SPL_SERIAL
imply SUNXI_GPIO

View file

@ -1,177 +0,0 @@
From 74afc3a4e0ff780eddd859a25de7142e4baeeed5 Mon Sep 17 00:00:00 2001
From: Andre Przywara <andre.przywara@arm.com>
Date: Wed, 13 Jul 2022 17:21:44 +0100
Subject: [PATCH 17/90] sunxi: mmc: group non-DM specific functions
As the SPL code for sunxi boards does not use the driver model, we have
two mmc_ops structures, one for DM, one for non-DM. The actual hardware
access code is shared, with the respective callback functions using that
common code.
To make this more obvious and easier to read, reorder the functions to
group them: we first have the common code, then the non-DM bits, and
the proper DM implementation at the end.
Also document this structure in the comment at the beginning of the file.
No functional change intended.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/mmc/sunxi_mmc.c | 117 +++++++++++++++++++++-------------------
1 file changed, 61 insertions(+), 56 deletions(-)
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -5,6 +5,12 @@
* Aaron <leafy.myeh@allwinnertech.com>
*
* MMC driver for allwinner sunxi platform.
+ *
+ * This driver is used by the (ARM) SPL with the legacy MMC interface, and
+ * by U-Boot proper using the full DM interface. The actual hardware access
+ * code is common, and comes first in this file.
+ * The legacy MMC interface implementation comes next, followed by the
+ * proper DM_MMC implementation at the end.
*/
#include <common.h>
@@ -40,48 +46,6 @@ struct sunxi_mmc_priv {
struct mmc_config cfg;
};
-#if !CONFIG_IS_ENABLED(DM_MMC)
-/* support 4 mmc hosts */
-struct sunxi_mmc_priv mmc_host[4];
-
-static int mmc_resource_init(int sdc_no)
-{
- struct sunxi_mmc_priv *priv = &mmc_host[sdc_no];
- struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
-
- debug("init mmc %d resource\n", sdc_no);
-
- switch (sdc_no) {
- case 0:
- priv->reg = (struct sunxi_mmc *)SUNXI_MMC0_BASE;
- priv->mclkreg = &ccm->sd0_clk_cfg;
- break;
- case 1:
- priv->reg = (struct sunxi_mmc *)SUNXI_MMC1_BASE;
- priv->mclkreg = &ccm->sd1_clk_cfg;
- break;
-#ifdef SUNXI_MMC2_BASE
- case 2:
- priv->reg = (struct sunxi_mmc *)SUNXI_MMC2_BASE;
- priv->mclkreg = &ccm->sd2_clk_cfg;
- break;
-#endif
-#ifdef SUNXI_MMC3_BASE
- case 3:
- priv->reg = (struct sunxi_mmc *)SUNXI_MMC3_BASE;
- priv->mclkreg = &ccm->sd3_clk_cfg;
- break;
-#endif
- default:
- printf("Wrong mmc number %d\n", sdc_no);
- return -1;
- }
- priv->mmc_no = sdc_no;
-
- return 0;
-}
-#endif
-
/*
* All A64 and later MMC controllers feature auto-calibration. This would
* normally be detected via the compatible string, but we need something
@@ -269,19 +233,6 @@ static int sunxi_mmc_set_ios_common(stru
return 0;
}
-#if !CONFIG_IS_ENABLED(DM_MMC)
-static int sunxi_mmc_core_init(struct mmc *mmc)
-{
- struct sunxi_mmc_priv *priv = mmc->priv;
-
- /* Reset controller */
- writel(SUNXI_MMC_GCTRL_RESET, &priv->reg->gctrl);
- udelay(1000);
-
- return 0;
-}
-#endif
-
static int mmc_trans_data_by_cpu(struct sunxi_mmc_priv *priv, struct mmc *mmc,
struct mmc_data *data)
{
@@ -486,7 +437,60 @@ out:
return error;
}
+/* non-DM code here is used by the (ARM) SPL only */
+
#if !CONFIG_IS_ENABLED(DM_MMC)
+/* support 4 mmc hosts */
+struct sunxi_mmc_priv mmc_host[4];
+
+static int mmc_resource_init(int sdc_no)
+{
+ struct sunxi_mmc_priv *priv = &mmc_host[sdc_no];
+ struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
+ debug("init mmc %d resource\n", sdc_no);
+
+ switch (sdc_no) {
+ case 0:
+ priv->reg = (struct sunxi_mmc *)SUNXI_MMC0_BASE;
+ priv->mclkreg = &ccm->sd0_clk_cfg;
+ break;
+ case 1:
+ priv->reg = (struct sunxi_mmc *)SUNXI_MMC1_BASE;
+ priv->mclkreg = &ccm->sd1_clk_cfg;
+ break;
+#ifdef SUNXI_MMC2_BASE
+ case 2:
+ priv->reg = (struct sunxi_mmc *)SUNXI_MMC2_BASE;
+ priv->mclkreg = &ccm->sd2_clk_cfg;
+ break;
+#endif
+#ifdef SUNXI_MMC3_BASE
+ case 3:
+ priv->reg = (struct sunxi_mmc *)SUNXI_MMC3_BASE;
+ priv->mclkreg = &ccm->sd3_clk_cfg;
+ break;
+#endif
+ default:
+ printf("Wrong mmc number %d\n", sdc_no);
+ return -1;
+ }
+ priv->mmc_no = sdc_no;
+
+ return 0;
+}
+
+static int sunxi_mmc_core_init(struct mmc *mmc)
+{
+ struct sunxi_mmc_priv *priv = mmc->priv;
+
+ /* Reset controller */
+ writel(SUNXI_MMC_GCTRL_RESET, &priv->reg->gctrl);
+ udelay(1000);
+
+ return 0;
+}
+
static int sunxi_mmc_set_ios_legacy(struct mmc *mmc)
{
struct sunxi_mmc_priv *priv = mmc->priv;
@@ -562,7 +566,8 @@ struct mmc *sunxi_mmc_init(int sdc_no)
return mmc_create(cfg, priv);
}
-#else
+
+#else /* CONFIG_DM_MMC code below, as used by U-Boot proper */
static int sunxi_mmc_set_ios(struct udevice *dev)
{

View file

@ -1,7 +1,7 @@
From fde804c2ece090eb7802a218781e38c7c6d6f00d Mon Sep 17 00:00:00 2001
From 1cc94e4599cd4ab31afe58cb5e6438b30a4e6a24 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:10:11 -0500
Subject: [PATCH 63/90] sunxi: Move default values to the board Kconfig
Subject: [PATCH 18/68] sunxi: Move default values to the board Kconfig
This keeps all of the defaults for sunxi platforms in one place. Most of
these only depend on architecture-independent features of the SoC (clock
@ -11,9 +11,9 @@ No functional change; just some minor help text cleanup.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/mach-sunxi/Kconfig | 67 ------------------------------------
board/sunxi/Kconfig | 68 +++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+), 67 deletions(-)
arch/arm/mach-sunxi/Kconfig | 70 ------------------------------------
board/sunxi/Kconfig | 71 +++++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+), 70 deletions(-)
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@ -26,14 +26,14 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
config DRAM_SUN4I
bool
help
@@ -99,17 +96,6 @@ config AXP_PMIC_BUS
@@ -124,17 +121,6 @@ config AXP_PMIC_BUS
Select this PMIC bus access helpers for Sunxi platform PRCM or other
AXP family PMIC devices.
-config SUNXI_SRAM_ADDRESS
- hex
- default 0x10000 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5
- default 0x20000 if SUN50I_GEN_H6
- default 0x20000 if SUN50I_GEN_H6 || SUNXI_GEN_NCAT2
- default 0x0
- ---help---
- Older Allwinner SoCs have their mask boot ROM mapped just below 4GB,
@ -41,10 +41,10 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
- Some newer SoCs map the boot ROM at address 0 instead and move the
- SRAM to a different address.
-
config SUNXI_A64_TIMER_ERRATUM
bool
@@ -562,48 +548,6 @@ config DRAM_ODT_CORRECTION
config SUNXI_RVBAR_ADDRESS
hex
depends on ARM64
@@ -661,50 +647,6 @@ config DRAM_ODT_CORRECTION
then the correction is negative. Usually the value for this is 0.
endif
@ -59,6 +59,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
- default 1008000000 if MACH_SUN9I
- default 888000000 if MACH_SUN50I_H6
- default 1008000000 if MACH_SUN50I_H616
- default 1008000000 if MACH_SUN8I_R528
-
-config SYS_CONFIG_NAME
- default "suniv" if MACH_SUNIV
@ -67,6 +68,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
- default "sun6i" if MACH_SUN6I
- default "sun7i" if MACH_SUN7I
- default "sun8i" if MACH_SUN8I
- default "sun8i" if MACH_SUN8I_R528
- default "sun9i" if MACH_SUN9I
- default "sun50i" if MACH_SUN50I
- default "sun50i" if MACH_SUN50I_H6
@ -93,7 +95,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
config UART0_PORT_F
bool "UART0 on MicroSD breakout board"
---help---
@@ -898,17 +842,6 @@ config GMAC_TX_DELAY
@@ -1033,18 +975,6 @@ config GMAC_TX_DELAY
---help---
Set the GMAC Transmit Clock Delay Chain value.
@ -107,13 +109,14 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
- default 0x2fe00000 if MACH_SUN9I
- default 0x4fe00000 if MACH_SUN50I
- default 0x4fe00000 if SUN50I_GEN_H6
- default 0x4fe00000 if SUNXI_GEN_NCAT2
-
config SPL_SPI_SUNXI
bool "Support for SPI Flash on Allwinner SoCs in SPL"
depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || SUN50I_GEN_H6 || MACH_SUNIV
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -52,6 +52,74 @@ config BOARD_SUNXI
@@ -53,6 +53,77 @@ config BOARD_SUNXI
if BOARD_SUNXI
@ -130,6 +133,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
+ default 0x2fe00000 if MACH_SUN9I
+ default 0x4fe00000 if MACH_SUN50I
+ default 0x4fe00000 if SUN50I_GEN_H6
+ default 0x4fe00000 if SUNXI_GEN_NCAT2
+
+config SUNXI_MINIMUM_DRAM_MB
+ int "minimum DRAM size"
@ -147,7 +151,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
+config SUNXI_SRAM_ADDRESS
+ hex
+ default 0x10000 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5
+ default 0x20000 if SUN50I_GEN_H6
+ default 0x20000 if SUN50I_GEN_H6 || SUNXI_GEN_NCAT2
+ default 0x0
+ help
+ Older Allwinner SoCs have their boot mask ROM mapped just
@ -165,6 +169,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
+ default 1008000000 if MACH_SUN6I
+ default 912000000 if MACH_SUN7I
+ default 1008000000 if MACH_SUN8I
+ default 1008000000 if MACH_SUN8I_R528
+ default 1008000000 if MACH_SUN9I
+ default 816000000 if MACH_SUN50I || MACH_SUN50I_H5
+ default 888000000 if MACH_SUN50I_H6
@ -177,6 +182,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
+ default "sun6i" if MACH_SUN6I
+ default "sun7i" if MACH_SUN7I
+ default "sun8i" if MACH_SUN8I
+ default "sun8i" if MACH_SUN8I_R528
+ default "sun9i" if MACH_SUN9I
+ default "sun50i" if MACH_SUN50I
+ default "sun50i" if MACH_SUN50I_H6

View file

@ -1,509 +0,0 @@
From bcc2e01668041c146d964ed5f77b819dcc35b3e2 Mon Sep 17 00:00:00 2001
From: Zoltan HERPAI <wigyori@uid0.hu>
Date: Tue, 6 Jun 2023 15:07:47 +0000
Subject: [PATCH 18/90] sunxi: remove CONFIG_MMC?_CD_PIN
For legacy reasons we were defining the card detect GPIO for all sunxi
boards in each board's defconfig.
There is actually no need for a card-detect check in the SPL code (which
consequently has been removed already), and also in U-Boot proper we
have DM code to query the CD GPIO name from the device tree.
That means we don't have any user of that information left, so can
remove the definitions from the defconfigs.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---
arch/arm/mach-sunxi/Kconfig | 27 --------------------
configs/A10-OLinuXino-Lime_defconfig | 1 -
configs/A10s-OLinuXino-M_defconfig | 2 --
configs/A13-OLinuXino_defconfig | 1 -
configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 -
configs/A20-OLinuXino-Lime_defconfig | 1 -
configs/A20-OLinuXino_MICRO-eMMC_defconfig | 1 -
configs/A20-OLinuXino_MICRO_defconfig | 2 --
configs/A20-Olimex-SOM-EVB_defconfig | 2 --
configs/A20-Olimex-SOM204-EVB-eMMC_defconfig | 1 -
configs/Bananapi_M2_Ultra_defconfig | 1 -
configs/Bananapi_m2m_defconfig | 1 -
configs/Cubieboard2_defconfig | 1 -
configs/Cubieboard4_defconfig | 1 -
configs/Cubieboard_defconfig | 1 -
configs/Itead_Ibox_A20_defconfig | 1 -
configs/Lamobo_R1_defconfig | 1 -
configs/Mele_M3_defconfig | 1 -
configs/Mele_M5_defconfig | 1 -
configs/Merrii_A80_Optimus_defconfig | 1 -
configs/Orangepi_mini_defconfig | 2 --
configs/Sinlinx_SinA31s_defconfig | 1 -
configs/Sinlinx_SinA33_defconfig | 1 -
configs/Sunchip_CX-A99_defconfig | 1 -
configs/UTOO_P66_defconfig | 1 -
configs/Yones_Toptech_BD1078_defconfig | 2 --
configs/bananapi_m2_zero_defconfig | 1 -
configs/bananapi_m64_defconfig | 1 -
configs/beelink_gs1_defconfig | 1 -
configs/nanopi_m1_plus_defconfig | 1 -
configs/oceanic_5205_5inmfd_defconfig | 1 -
configs/orangepi_3_defconfig | 1 -
configs/orangepi_lite2_defconfig | 1 -
configs/orangepi_one_plus_defconfig | 1 -
configs/orangepi_zero2_defconfig | 1 -
configs/orangepi_zero_plus2_defconfig | 1 -
configs/orangepi_zero_plus2_h3_defconfig | 1 -
configs/parrot_r16_defconfig | 1 -
configs/pine64-lts_defconfig | 1 -
configs/pine_h64_defconfig | 1 -
configs/sopine_baseboard_defconfig | 1 -
configs/tanix_tx6_defconfig | 1 -
42 files changed, 73 deletions(-)
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -652,33 +652,6 @@ config MACPWR
Set the pin used to power the MAC. This takes a string in the format
understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
-config MMC0_CD_PIN
- string "Card detect pin for mmc0"
- default "PF6" if MACH_SUN8I_A83T || MACH_SUNXI_H3_H5 || MACH_SUN50I
- default ""
- ---help---
- Set the card detect pin for mmc0, leave empty to not use cd. This
- takes a string in the format understood by sunxi_name_to_gpio, e.g.
- PH1 for pin 1 of port H.
-
-config MMC1_CD_PIN
- string "Card detect pin for mmc1"
- default ""
- ---help---
- See MMC0_CD_PIN help text.
-
-config MMC2_CD_PIN
- string "Card detect pin for mmc2"
- default ""
- ---help---
- See MMC0_CD_PIN help text.
-
-config MMC3_CD_PIN
- string "Card detect pin for mmc3"
- default ""
- ---help---
- See MMC0_CD_PIN help text.
-
config MMC1_PINS_PH
bool "Pins for mmc1 are on Port H"
depends on MACH_SUN4I || MACH_SUN7I || MACH_SUN8I_R40
--- a/configs/A10-OLinuXino-Lime_defconfig
+++ b/configs/A10-OLinuXino-Lime_defconfig
@@ -6,7 +6,6 @@ CONFIG_MACH_SUN4I=y
CONFIG_DRAM_CLK=480
CONFIG_DRAM_EMR1=4
CONFIG_SYS_CLK_FREQ=912000000
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_I2C1_ENABLE=y
CONFIG_SATAPWR="PC3"
CONFIG_AHCI=y
--- a/configs/A10s-OLinuXino-M_defconfig
+++ b/configs/A10s-OLinuXino-M_defconfig
@@ -4,8 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-o
CONFIG_SPL=y
CONFIG_MACH_SUN5I=y
CONFIG_DRAM_CLK=432
-CONFIG_MMC0_CD_PIN="PG1"
-CONFIG_MMC1_CD_PIN="PG13"
CONFIG_MMC_SUNXI_SLOT_EXTRA=1
CONFIG_USB1_VBUS_PIN="PB10"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/A13-OLinuXino_defconfig
+++ b/configs/A13-OLinuXino_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN5I=y
CONFIG_DRAM_CLK=408
CONFIG_DRAM_EMR1=0
-CONFIG_MMC0_CD_PIN="PG0"
CONFIG_USB0_VBUS_DET="PG1"
CONFIG_USB1_VBUS_PIN="PG11"
CONFIG_AXP_GPIO=y
--- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ol
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="PC17"
CONFIG_USB0_VBUS_DET="PH5"
--- a/configs/A20-OLinuXino-Lime_defconfig
+++ b/configs/A20-OLinuXino-Lime_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ol
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_I2C1_ENABLE=y
CONFIG_SATAPWR="PC3"
CONFIG_AHCI=y
--- a/configs/A20-OLinuXino_MICRO-eMMC_defconfig
+++ b/configs/A20-OLinuXino_MICRO-eMMC_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ol
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_I2C1_ENABLE=y
CONFIG_VIDEO_VGA=y
--- a/configs/A20-OLinuXino_MICRO_defconfig
+++ b/configs/A20-OLinuXino_MICRO_defconfig
@@ -4,8 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ol
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_MMC0_CD_PIN="PH1"
-CONFIG_MMC3_CD_PIN="PH11"
CONFIG_MMC_SUNXI_SLOT_EXTRA=3
CONFIG_I2C1_ENABLE=y
CONFIG_VIDEO_VGA=y
--- a/configs/A20-Olimex-SOM-EVB_defconfig
+++ b/configs/A20-Olimex-SOM-EVB_defconfig
@@ -4,8 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ol
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_MMC0_CD_PIN="PH1"
-CONFIG_MMC3_CD_PIN="PH0"
CONFIG_MMC_SUNXI_SLOT_EXTRA=3
CONFIG_USB0_VBUS_PIN="PB9"
CONFIG_USB0_VBUS_DET="PH5"
--- a/configs/A20-Olimex-SOM204-EVB-eMMC_defconfig
+++ b/configs/A20-Olimex-SOM204-EVB-eMMC_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ol
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="PC17"
CONFIG_USB0_VBUS_DET="PH5"
--- a/configs/Bananapi_M2_Ultra_defconfig
+++ b/configs/Bananapi_M2_Ultra_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN8I_R40=y
CONFIG_DRAM_CLK=576
CONFIG_MACPWR="PA17"
-CONFIG_MMC0_CD_PIN="PH13"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB1_VBUS_PIN="PH23"
CONFIG_USB2_VBUS_PIN="PH23"
--- a/configs/Bananapi_m2m_defconfig
+++ b/configs/Bananapi_m2m_defconfig
@@ -6,7 +6,6 @@ CONFIG_MACH_SUN8I_A33=y
CONFIG_DRAM_CLK=600
CONFIG_DRAM_ZQ=15291
CONFIG_DRAM_ODT_EN=y
-CONFIG_MMC0_CD_PIN="PB4"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_ID_DET="PH8"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/Cubieboard2_defconfig
+++ b/configs/Cubieboard2_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-cu
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=480
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_SATAPWR="PB8"
CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/Cubieboard4_defconfig
+++ b/configs/Cubieboard4_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-cu
CONFIG_SPL=y
CONFIG_MACH_SUN9I=y
CONFIG_DRAM_CLK=672
-CONFIG_MMC0_CD_PIN="PH18"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
--- a/configs/Cubieboard_defconfig
+++ b/configs/Cubieboard_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-cu
CONFIG_SPL=y
CONFIG_MACH_SUN4I=y
CONFIG_DRAM_CLK=480
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_SATAPWR="PB8"
CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/Itead_Ibox_A20_defconfig
+++ b/configs/Itead_Ibox_A20_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-it
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=480
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_SATAPWR="PB8"
CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/Lamobo_R1_defconfig
+++ b/configs/Lamobo_R1_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=432
CONFIG_MACPWR="PH23"
-CONFIG_MMC0_CD_PIN="PH10"
CONFIG_SATAPWR="PB3"
CONFIG_GMAC_TX_DELAY=4
CONFIG_AHCI=y
--- a/configs/Mele_M3_defconfig
+++ b/configs/Mele_M3_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-m3
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_VIDEO_VGA=y
CONFIG_VIDEO_COMPOSITE=y
--- a/configs/Mele_M5_defconfig
+++ b/configs/Mele_M5_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=122
-CONFIG_MMC0_CD_PIN="PH1"
CONFIG_VIDEO_COMPOSITE=y
CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/Merrii_A80_Optimus_defconfig
+++ b/configs/Merrii_A80_Optimus_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-op
CONFIG_SPL=y
CONFIG_MACH_SUN9I=y
CONFIG_DRAM_CLK=672
-CONFIG_MMC0_CD_PIN="PH18"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
--- a/configs/Orangepi_mini_defconfig
+++ b/configs/Orangepi_mini_defconfig
@@ -5,8 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=432
CONFIG_MACPWR="PH23"
-CONFIG_MMC0_CD_PIN="PH10"
-CONFIG_MMC3_CD_PIN="PH11"
CONFIG_MMC_SUNXI_SLOT_EXTRA=3
CONFIG_USB1_VBUS_PIN="PH26"
CONFIG_USB2_VBUS_PIN="PH22"
--- a/configs/Sinlinx_SinA31s_defconfig
+++ b/configs/Sinlinx_SinA31s_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN6I=y
CONFIG_DRAM_CLK=432
CONFIG_DRAM_ZQ=251
-CONFIG_MMC0_CD_PIN="PA4"
CONFIG_MMC_SUNXI_SLOT_EXTRA=3
CONFIG_USB1_VBUS_PIN=""
CONFIG_USB2_VBUS_PIN=""
--- a/configs/Sinlinx_SinA33_defconfig
+++ b/configs/Sinlinx_SinA33_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN8I_A33=y
CONFIG_DRAM_CLK=552
CONFIG_DRAM_ZQ=15291
-CONFIG_MMC0_CD_PIN="PB4"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_ID_DET="PH8"
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:66000,le:90,ri:160,up:3,lo:127,hs:70,vs:20,sync:3,vmode:0"
--- a/configs/Sunchip_CX-A99_defconfig
+++ b/configs/Sunchip_CX-A99_defconfig
@@ -6,7 +6,6 @@ CONFIG_MACH_SUN9I=y
CONFIG_DRAM_CLK=600
CONFIG_DRAM_ZQ=3881915
CONFIG_DRAM_ODT_EN=y
-CONFIG_MMC0_CD_PIN="PH17"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="PH15"
CONFIG_USB1_VBUS_PIN="PL7"
--- a/configs/UTOO_P66_defconfig
+++ b/configs/UTOO_P66_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN5I=y
CONFIG_DRAM_CLK=432
CONFIG_DRAM_EMR1=0
-CONFIG_MMC0_CD_PIN="PG0"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="PB04"
CONFIG_USB0_VBUS_DET="PG01"
--- a/configs/Yones_Toptech_BD1078_defconfig
+++ b/configs/Yones_Toptech_BD1078_defconfig
@@ -4,8 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-yo
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=408
-CONFIG_MMC0_CD_PIN="PH1"
-CONFIG_MMC1_CD_PIN="PH2"
CONFIG_MMC1_PINS_PH=y
CONFIG_MMC_SUNXI_SLOT_EXTRA=1
CONFIG_USB0_VBUS_PIN="PB9"
--- a/configs/bananapi_m2_zero_defconfig
+++ b/configs/bananapi_m2_zero_defconfig
@@ -4,5 +4,4 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plu
CONFIG_SPL=y
CONFIG_MACH_SUN8I_H3=y
CONFIG_DRAM_CLK=408
-CONFIG_MMC0_CD_PIN=""
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/bananapi_m64_defconfig
+++ b/configs/bananapi_m64_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-b
CONFIG_SPL=y
CONFIG_MACH_SUN50I=y
CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
-CONFIG_MMC0_CD_PIN="PH13"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SUPPORT_EMMC_BOOT=y
--- a/configs/beelink_gs1_defconfig
+++ b/configs/beelink_gs1_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h6-be
CONFIG_SPL=y
CONFIG_MACH_SUN50I_H6=y
CONFIG_SUNXI_DRAM_H6_LPDDR3=y
-CONFIG_MMC0_CD_PIN="PF6"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_PSCI_RESET is not set
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/nanopi_m1_plus_defconfig
+++ b/configs/nanopi_m1_plus_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN8I_H3=y
CONFIG_DRAM_CLK=408
CONFIG_MACPWR="PD6"
-CONFIG_MMC0_CD_PIN="PH13"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SUN8I_EMAC=y
--- a/configs/oceanic_5205_5inmfd_defconfig
+++ b/configs/oceanic_5205_5inmfd_defconfig
@@ -7,7 +7,6 @@ CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
CONFIG_DRAM_CLK=552
CONFIG_DRAM_ZQ=3881949
-CONFIG_MMC0_CD_PIN=""
CONFIG_SPL_SPI_SUNXI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SUN8I_EMAC=y
--- a/configs/orangepi_3_defconfig
+++ b/configs/orangepi_3_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h6-or
CONFIG_SPL=y
CONFIG_MACH_SUN50I_H6=y
CONFIG_SUNXI_DRAM_H6_LPDDR3=y
-CONFIG_MMC0_CD_PIN="PF6"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_BLUETOOTH_DT_DEVICE_FIXUP="brcm,bcm4345c5"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/orangepi_lite2_defconfig
+++ b/configs/orangepi_lite2_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h6-or
CONFIG_SPL=y
CONFIG_MACH_SUN50I_H6=y
CONFIG_SUNXI_DRAM_H6_LPDDR3=y
-CONFIG_MMC0_CD_PIN="PF6"
# CONFIG_PSCI_RESET is not set
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_USB_EHCI_HCD=y
--- a/configs/orangepi_one_plus_defconfig
+++ b/configs/orangepi_one_plus_defconfig
@@ -4,7 +4,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h6-or
CONFIG_SPL=y
CONFIG_MACH_SUN50I_H6=y
CONFIG_SUNXI_DRAM_H6_LPDDR3=y
-CONFIG_MMC0_CD_PIN="PF6"
# CONFIG_PSCI_RESET is not set
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_USB_EHCI_HCD=y
--- a/configs/orangepi_zero2_defconfig
+++ b/configs/orangepi_zero2_defconfig
@@ -7,7 +7,6 @@ CONFIG_DRAM_SUN50I_H616_READ_CALIBRATION
CONFIG_DRAM_SUN50I_H616_READ_TRAINING=y
CONFIG_DRAM_SUN50I_H616_WRITE_TRAINING=y
CONFIG_MACH_SUN50I_H616=y
-CONFIG_MMC0_CD_PIN="PF6"
CONFIG_R_I2C_ENABLE=y
CONFIG_SPL_SPI_SUNXI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/orangepi_zero_plus2_defconfig
+++ b/configs/orangepi_zero_plus2_defconfig
@@ -6,7 +6,6 @@ CONFIG_MACH_SUN50I_H5=y
CONFIG_DRAM_CLK=672
CONFIG_DRAM_ZQ=3881977
# CONFIG_DRAM_ODT_EN is not set
-CONFIG_MMC0_CD_PIN="PH13"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SUN8I_EMAC=y
--- a/configs/orangepi_zero_plus2_h3_defconfig
+++ b/configs/orangepi_zero_plus2_h3_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN8I_H3=y
CONFIG_DRAM_CLK=672
# CONFIG_DRAM_ODT_EN is not set
-CONFIG_MMC0_CD_PIN="PH13"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SUN8I_EMAC=y
--- a/configs/parrot_r16_defconfig
+++ b/configs/parrot_r16_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN8I_A33=y
CONFIG_DRAM_CLK=600
CONFIG_DRAM_ZQ=15291
-CONFIG_MMC0_CD_PIN="PD14"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_ID_DET="PD10"
CONFIG_USB1_VBUS_PIN="PD12"
--- a/configs/pine64-lts_defconfig
+++ b/configs/pine64-lts_defconfig
@@ -6,7 +6,6 @@ CONFIG_MACH_SUN50I=y
CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
CONFIG_DRAM_CLK=552
CONFIG_DRAM_ZQ=3881949
-CONFIG_MMC0_CD_PIN=""
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_SPL_SPI_SUNXI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/pine_h64_defconfig
+++ b/configs/pine_h64_defconfig
@@ -5,7 +5,6 @@ CONFIG_SPL=y
CONFIG_MACH_SUN50I_H6=y
CONFIG_SUNXI_DRAM_H6_LPDDR3=y
CONFIG_MACPWR="PC16"
-CONFIG_MMC0_CD_PIN="PF6"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB3_VBUS_PIN="PL5"
CONFIG_SPL_SPI_SUNXI=y
--- a/configs/sopine_baseboard_defconfig
+++ b/configs/sopine_baseboard_defconfig
@@ -7,7 +7,6 @@ CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
CONFIG_DRAM_CLK=552
CONFIG_DRAM_ZQ=3881949
-CONFIG_MMC0_CD_PIN=""
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_SPL_SPI_SUNXI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
--- a/configs/tanix_tx6_defconfig
+++ b/configs/tanix_tx6_defconfig
@@ -5,6 +5,5 @@ CONFIG_SPL=y
CONFIG_MACH_SUN50I_H6=y
CONFIG_SUNXI_DRAM_H6_DDR3_1333=y
CONFIG_DRAM_CLK=648
-CONFIG_MMC0_CD_PIN="PF6"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set

View file

@ -1,7 +1,7 @@
From 8377aa2162d0a7fda76597eae59725a298dda5e6 Mon Sep 17 00:00:00 2001
From f79f14a2b777f20150d4ffa9bb0ec1cf77f786f0 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 31 Oct 2022 22:14:36 -0500
Subject: [PATCH 64/90] sunxi: Hide the SUNXI_MINIMUM_DRAM_MB symbol
Subject: [PATCH 19/68] sunxi: Hide the SUNXI_MINIMUM_DRAM_MB symbol
This option affects the ABI between SPL/U-Boot and U-Boot/scripts, so it
should not normally be changed by the user.
@ -13,8 +13,8 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -67,7 +67,7 @@ config SPL_STACK_R_ADDR
default 0x4fe00000 if SUN50I_GEN_H6
@@ -69,7 +69,7 @@ config SPL_STACK_R_ADDR
default 0x4fe00000 if SUNXI_GEN_NCAT2
config SUNXI_MINIMUM_DRAM_MB
- int "minimum DRAM size"

View file

@ -1,323 +0,0 @@
From 4c0c00e7131baf410702555342337c178dd0de98 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 30 Oct 2022 16:04:47 -0500
Subject: [PATCH 19/90] sunxi: mmc: Move header to the driver directory
The MMC controller driver is (and ought to be) the only user of these
register definitions. Put them in a header next to the driver to remove
the dependency on a specific ARM platform's headers.
Due to the sunxi_mmc_init() prototype, the file was not renamed. None of
the register definitions were changed.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/include/asm/arch-sunxi/mmc.h | 139 +-------------------------
drivers/mmc/sunxi_mmc.c | 4 +
drivers/mmc/sunxi_mmc.h | 138 +++++++++++++++++++++++++
3 files changed, 146 insertions(+), 135 deletions(-)
create mode 100644 drivers/mmc/sunxi_mmc.h
--- a/arch/arm/include/asm/arch-sunxi/mmc.h
+++ b/arch/arm/include/asm/arch-sunxi/mmc.h
@@ -1,139 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2007-2011
- * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
- * Aaron <leafy.myeh@allwinnertech.com>
- *
- * MMC register definition for allwinner sunxi platform.
- */
-#ifndef _SUNXI_MMC_H
-#define _SUNXI_MMC_H
-
-#include <linux/types.h>
-
-struct sunxi_mmc {
- u32 gctrl; /* 0x00 global control */
- u32 clkcr; /* 0x04 clock control */
- u32 timeout; /* 0x08 time out */
- u32 width; /* 0x0c bus width */
- u32 blksz; /* 0x10 block size */
- u32 bytecnt; /* 0x14 byte count */
- u32 cmd; /* 0x18 command */
- u32 arg; /* 0x1c argument */
- u32 resp0; /* 0x20 response 0 */
- u32 resp1; /* 0x24 response 1 */
- u32 resp2; /* 0x28 response 2 */
- u32 resp3; /* 0x2c response 3 */
- u32 imask; /* 0x30 interrupt mask */
- u32 mint; /* 0x34 masked interrupt status */
- u32 rint; /* 0x38 raw interrupt status */
- u32 status; /* 0x3c status */
- u32 ftrglevel; /* 0x40 FIFO threshold watermark*/
- u32 funcsel; /* 0x44 function select */
- u32 cbcr; /* 0x48 CIU byte count */
- u32 bbcr; /* 0x4c BIU byte count */
- u32 dbgc; /* 0x50 debug enable */
- u32 res0; /* 0x54 reserved */
- u32 a12a; /* 0x58 Auto command 12 argument */
- u32 ntsr; /* 0x5c New timing set register */
- u32 res1[8];
- u32 dmac; /* 0x80 internal DMA control */
- u32 dlba; /* 0x84 internal DMA descr list base address */
- u32 idst; /* 0x88 internal DMA status */
- u32 idie; /* 0x8c internal DMA interrupt enable */
- u32 chda; /* 0x90 */
- u32 cbda; /* 0x94 */
- u32 res2[26];
-#if defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_SUN50I_GEN_H6)
- u32 res3[17];
- u32 samp_dl;
- u32 res4[46];
-#endif
- u32 fifo; /* 0x100 / 0x200 FIFO access address */
-};
-
-#define SUNXI_MMC_CLK_POWERSAVE (0x1 << 17)
-#define SUNXI_MMC_CLK_ENABLE (0x1 << 16)
-#define SUNXI_MMC_CLK_DIVIDER_MASK (0xff)
-
-#define SUNXI_MMC_GCTRL_SOFT_RESET (0x1 << 0)
-#define SUNXI_MMC_GCTRL_FIFO_RESET (0x1 << 1)
-#define SUNXI_MMC_GCTRL_DMA_RESET (0x1 << 2)
-#define SUNXI_MMC_GCTRL_RESET (SUNXI_MMC_GCTRL_SOFT_RESET|\
- SUNXI_MMC_GCTRL_FIFO_RESET|\
- SUNXI_MMC_GCTRL_DMA_RESET)
-#define SUNXI_MMC_GCTRL_DMA_ENABLE (0x1 << 5)
-#define SUNXI_MMC_GCTRL_ACCESS_BY_AHB (0x1 << 31)
-
-#define SUNXI_MMC_CMD_RESP_EXPIRE (0x1 << 6)
-#define SUNXI_MMC_CMD_LONG_RESPONSE (0x1 << 7)
-#define SUNXI_MMC_CMD_CHK_RESPONSE_CRC (0x1 << 8)
-#define SUNXI_MMC_CMD_DATA_EXPIRE (0x1 << 9)
-#define SUNXI_MMC_CMD_WRITE (0x1 << 10)
-#define SUNXI_MMC_CMD_AUTO_STOP (0x1 << 12)
-#define SUNXI_MMC_CMD_WAIT_PRE_OVER (0x1 << 13)
-#define SUNXI_MMC_CMD_SEND_INIT_SEQ (0x1 << 15)
-#define SUNXI_MMC_CMD_UPCLK_ONLY (0x1 << 21)
-#define SUNXI_MMC_CMD_START (0x1 << 31)
-
-#define SUNXI_MMC_RINT_RESP_ERROR (0x1 << 1)
-#define SUNXI_MMC_RINT_COMMAND_DONE (0x1 << 2)
-#define SUNXI_MMC_RINT_DATA_OVER (0x1 << 3)
-#define SUNXI_MMC_RINT_TX_DATA_REQUEST (0x1 << 4)
-#define SUNXI_MMC_RINT_RX_DATA_REQUEST (0x1 << 5)
-#define SUNXI_MMC_RINT_RESP_CRC_ERROR (0x1 << 6)
-#define SUNXI_MMC_RINT_DATA_CRC_ERROR (0x1 << 7)
-#define SUNXI_MMC_RINT_RESP_TIMEOUT (0x1 << 8)
-#define SUNXI_MMC_RINT_DATA_TIMEOUT (0x1 << 9)
-#define SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE (0x1 << 10)
-#define SUNXI_MMC_RINT_FIFO_RUN_ERROR (0x1 << 11)
-#define SUNXI_MMC_RINT_HARD_WARE_LOCKED (0x1 << 12)
-#define SUNXI_MMC_RINT_START_BIT_ERROR (0x1 << 13)
-#define SUNXI_MMC_RINT_AUTO_COMMAND_DONE (0x1 << 14)
-#define SUNXI_MMC_RINT_END_BIT_ERROR (0x1 << 15)
-#define SUNXI_MMC_RINT_SDIO_INTERRUPT (0x1 << 16)
-#define SUNXI_MMC_RINT_CARD_INSERT (0x1 << 30)
-#define SUNXI_MMC_RINT_CARD_REMOVE (0x1 << 31)
-#define SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT \
- (SUNXI_MMC_RINT_RESP_ERROR | \
- SUNXI_MMC_RINT_RESP_CRC_ERROR | \
- SUNXI_MMC_RINT_DATA_CRC_ERROR | \
- SUNXI_MMC_RINT_RESP_TIMEOUT | \
- SUNXI_MMC_RINT_DATA_TIMEOUT | \
- SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE | \
- SUNXI_MMC_RINT_FIFO_RUN_ERROR | \
- SUNXI_MMC_RINT_HARD_WARE_LOCKED | \
- SUNXI_MMC_RINT_START_BIT_ERROR | \
- SUNXI_MMC_RINT_END_BIT_ERROR) /* 0xbfc2 */
-#define SUNXI_MMC_RINT_INTERRUPT_DONE_BIT \
- (SUNXI_MMC_RINT_AUTO_COMMAND_DONE | \
- SUNXI_MMC_RINT_DATA_OVER | \
- SUNXI_MMC_RINT_COMMAND_DONE | \
- SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE)
-
-#define SUNXI_MMC_STATUS_RXWL_FLAG (0x1 << 0)
-#define SUNXI_MMC_STATUS_TXWL_FLAG (0x1 << 1)
-#define SUNXI_MMC_STATUS_FIFO_EMPTY (0x1 << 2)
-#define SUNXI_MMC_STATUS_FIFO_FULL (0x1 << 3)
-#define SUNXI_MMC_STATUS_CARD_PRESENT (0x1 << 8)
-#define SUNXI_MMC_STATUS_CARD_DATA_BUSY (0x1 << 9)
-#define SUNXI_MMC_STATUS_DATA_FSM_BUSY (0x1 << 10)
-#define SUNXI_MMC_STATUS_FIFO_LEVEL(reg) (((reg) >> 17) & 0x3fff)
-
-#define SUNXI_MMC_NTSR_MODE_SEL_NEW (0x1 << 31)
-
-#define SUNXI_MMC_IDMAC_RESET (0x1 << 0)
-#define SUNXI_MMC_IDMAC_FIXBURST (0x1 << 1)
-#define SUNXI_MMC_IDMAC_ENABLE (0x1 << 7)
-
-#define SUNXI_MMC_IDIE_TXIRQ (0x1 << 0)
-#define SUNXI_MMC_IDIE_RXIRQ (0x1 << 1)
-
-#define SUNXI_MMC_COMMON_CLK_GATE (1 << 16)
-#define SUNXI_MMC_COMMON_RESET (1 << 18)
-
-#define SUNXI_MMC_CAL_DL_SW_EN (0x1 << 7)
+#ifndef _ASM_ARCH_MMC_H_
+#define _ASM_ARCH_MMC_H_
struct mmc *sunxi_mmc_init(int sdc_no);
-#endif /* _SUNXI_MMC_H */
+
+#endif /* _ASM_ARCH_MMC_H_ */
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -25,9 +25,13 @@
#include <asm/io.h>
#include <asm/arch/clock.h>
#include <asm/arch/cpu.h>
+#if !CONFIG_IS_ENABLED(DM_MMC)
#include <asm/arch/mmc.h>
+#endif
#include <linux/delay.h>
+#include "sunxi_mmc.h"
+
#ifndef CCM_MMC_CTRL_MODE_SEL_NEW
#define CCM_MMC_CTRL_MODE_SEL_NEW 0
#endif
--- /dev/null
+++ b/drivers/mmc/sunxi_mmc.h
@@ -0,0 +1,138 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2007-2011
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
+ * Aaron <leafy.myeh@allwinnertech.com>
+ *
+ * MMC register definition for allwinner sunxi platform.
+ */
+
+#ifndef _SUNXI_MMC_H
+#define _SUNXI_MMC_H
+
+#include <linux/types.h>
+
+struct sunxi_mmc {
+ u32 gctrl; /* 0x00 global control */
+ u32 clkcr; /* 0x04 clock control */
+ u32 timeout; /* 0x08 time out */
+ u32 width; /* 0x0c bus width */
+ u32 blksz; /* 0x10 block size */
+ u32 bytecnt; /* 0x14 byte count */
+ u32 cmd; /* 0x18 command */
+ u32 arg; /* 0x1c argument */
+ u32 resp0; /* 0x20 response 0 */
+ u32 resp1; /* 0x24 response 1 */
+ u32 resp2; /* 0x28 response 2 */
+ u32 resp3; /* 0x2c response 3 */
+ u32 imask; /* 0x30 interrupt mask */
+ u32 mint; /* 0x34 masked interrupt status */
+ u32 rint; /* 0x38 raw interrupt status */
+ u32 status; /* 0x3c status */
+ u32 ftrglevel; /* 0x40 FIFO threshold watermark*/
+ u32 funcsel; /* 0x44 function select */
+ u32 cbcr; /* 0x48 CIU byte count */
+ u32 bbcr; /* 0x4c BIU byte count */
+ u32 dbgc; /* 0x50 debug enable */
+ u32 res0; /* 0x54 reserved */
+ u32 a12a; /* 0x58 Auto command 12 argument */
+ u32 ntsr; /* 0x5c New timing set register */
+ u32 res1[8];
+ u32 dmac; /* 0x80 internal DMA control */
+ u32 dlba; /* 0x84 internal DMA descr list base address */
+ u32 idst; /* 0x88 internal DMA status */
+ u32 idie; /* 0x8c internal DMA interrupt enable */
+ u32 chda; /* 0x90 */
+ u32 cbda; /* 0x94 */
+ u32 res2[26];
+#if defined(CONFIG_SUNXI_GEN_SUN6I) || defined(CONFIG_SUN50I_GEN_H6)
+ u32 res3[17];
+ u32 samp_dl;
+ u32 res4[46];
+#endif
+ u32 fifo; /* 0x100 / 0x200 FIFO access address */
+};
+
+#define SUNXI_MMC_CLK_POWERSAVE (0x1 << 17)
+#define SUNXI_MMC_CLK_ENABLE (0x1 << 16)
+#define SUNXI_MMC_CLK_DIVIDER_MASK (0xff)
+
+#define SUNXI_MMC_GCTRL_SOFT_RESET (0x1 << 0)
+#define SUNXI_MMC_GCTRL_FIFO_RESET (0x1 << 1)
+#define SUNXI_MMC_GCTRL_DMA_RESET (0x1 << 2)
+#define SUNXI_MMC_GCTRL_RESET (SUNXI_MMC_GCTRL_SOFT_RESET|\
+ SUNXI_MMC_GCTRL_FIFO_RESET|\
+ SUNXI_MMC_GCTRL_DMA_RESET)
+#define SUNXI_MMC_GCTRL_DMA_ENABLE (0x1 << 5)
+#define SUNXI_MMC_GCTRL_ACCESS_BY_AHB (0x1 << 31)
+
+#define SUNXI_MMC_CMD_RESP_EXPIRE (0x1 << 6)
+#define SUNXI_MMC_CMD_LONG_RESPONSE (0x1 << 7)
+#define SUNXI_MMC_CMD_CHK_RESPONSE_CRC (0x1 << 8)
+#define SUNXI_MMC_CMD_DATA_EXPIRE (0x1 << 9)
+#define SUNXI_MMC_CMD_WRITE (0x1 << 10)
+#define SUNXI_MMC_CMD_AUTO_STOP (0x1 << 12)
+#define SUNXI_MMC_CMD_WAIT_PRE_OVER (0x1 << 13)
+#define SUNXI_MMC_CMD_SEND_INIT_SEQ (0x1 << 15)
+#define SUNXI_MMC_CMD_UPCLK_ONLY (0x1 << 21)
+#define SUNXI_MMC_CMD_START (0x1 << 31)
+
+#define SUNXI_MMC_RINT_RESP_ERROR (0x1 << 1)
+#define SUNXI_MMC_RINT_COMMAND_DONE (0x1 << 2)
+#define SUNXI_MMC_RINT_DATA_OVER (0x1 << 3)
+#define SUNXI_MMC_RINT_TX_DATA_REQUEST (0x1 << 4)
+#define SUNXI_MMC_RINT_RX_DATA_REQUEST (0x1 << 5)
+#define SUNXI_MMC_RINT_RESP_CRC_ERROR (0x1 << 6)
+#define SUNXI_MMC_RINT_DATA_CRC_ERROR (0x1 << 7)
+#define SUNXI_MMC_RINT_RESP_TIMEOUT (0x1 << 8)
+#define SUNXI_MMC_RINT_DATA_TIMEOUT (0x1 << 9)
+#define SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE (0x1 << 10)
+#define SUNXI_MMC_RINT_FIFO_RUN_ERROR (0x1 << 11)
+#define SUNXI_MMC_RINT_HARD_WARE_LOCKED (0x1 << 12)
+#define SUNXI_MMC_RINT_START_BIT_ERROR (0x1 << 13)
+#define SUNXI_MMC_RINT_AUTO_COMMAND_DONE (0x1 << 14)
+#define SUNXI_MMC_RINT_END_BIT_ERROR (0x1 << 15)
+#define SUNXI_MMC_RINT_SDIO_INTERRUPT (0x1 << 16)
+#define SUNXI_MMC_RINT_CARD_INSERT (0x1 << 30)
+#define SUNXI_MMC_RINT_CARD_REMOVE (0x1 << 31)
+#define SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT \
+ (SUNXI_MMC_RINT_RESP_ERROR | \
+ SUNXI_MMC_RINT_RESP_CRC_ERROR | \
+ SUNXI_MMC_RINT_DATA_CRC_ERROR | \
+ SUNXI_MMC_RINT_RESP_TIMEOUT | \
+ SUNXI_MMC_RINT_DATA_TIMEOUT | \
+ SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE | \
+ SUNXI_MMC_RINT_FIFO_RUN_ERROR | \
+ SUNXI_MMC_RINT_HARD_WARE_LOCKED | \
+ SUNXI_MMC_RINT_START_BIT_ERROR | \
+ SUNXI_MMC_RINT_END_BIT_ERROR) /* 0xbfc2 */
+#define SUNXI_MMC_RINT_INTERRUPT_DONE_BIT \
+ (SUNXI_MMC_RINT_AUTO_COMMAND_DONE | \
+ SUNXI_MMC_RINT_DATA_OVER | \
+ SUNXI_MMC_RINT_COMMAND_DONE | \
+ SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE)
+
+#define SUNXI_MMC_STATUS_RXWL_FLAG (0x1 << 0)
+#define SUNXI_MMC_STATUS_TXWL_FLAG (0x1 << 1)
+#define SUNXI_MMC_STATUS_FIFO_EMPTY (0x1 << 2)
+#define SUNXI_MMC_STATUS_FIFO_FULL (0x1 << 3)
+#define SUNXI_MMC_STATUS_CARD_PRESENT (0x1 << 8)
+#define SUNXI_MMC_STATUS_CARD_DATA_BUSY (0x1 << 9)
+#define SUNXI_MMC_STATUS_DATA_FSM_BUSY (0x1 << 10)
+#define SUNXI_MMC_STATUS_FIFO_LEVEL(reg) (((reg) >> 17) & 0x3fff)
+
+#define SUNXI_MMC_NTSR_MODE_SEL_NEW (0x1 << 31)
+
+#define SUNXI_MMC_IDMAC_RESET (0x1 << 0)
+#define SUNXI_MMC_IDMAC_FIXBURST (0x1 << 1)
+#define SUNXI_MMC_IDMAC_ENABLE (0x1 << 7)
+
+#define SUNXI_MMC_IDIE_TXIRQ (0x1 << 0)
+#define SUNXI_MMC_IDIE_RXIRQ (0x1 << 1)
+
+#define SUNXI_MMC_COMMON_CLK_GATE (1 << 16)
+#define SUNXI_MMC_COMMON_RESET (1 << 18)
+
+#define SUNXI_MMC_CAL_DL_SW_EN (0x1 << 7)
+
+#endif /* _SUNXI_MMC_H */

View file

@ -1,72 +0,0 @@
From fdf871a6089ee2f56439880b69d33a7d0d707d15 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 28 Aug 2021 22:24:28 -0500
Subject: [PATCH 20/90] pinctrl: sunxi: Add support for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/pinctrl/sunxi/Kconfig | 5 +++++
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 31 +++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
--- a/drivers/pinctrl/sunxi/Kconfig
+++ b/drivers/pinctrl/sunxi/Kconfig
@@ -89,6 +89,11 @@ config PINCTRL_SUN9I_A80_R
default MACH_SUN9I
select PINCTRL_SUNXI
+config PINCTRL_SUN20I_D1
+ bool "Support for the Allwinner D1 PIO"
+ default TARGET_SUN20I_D1
+ select PINCTRL_SUNXI
+
config PINCTRL_SUN50I_A64
bool "Support for the Allwinner A64 PIO"
default MACH_SUN50I
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -588,6 +588,31 @@ static const struct sunxi_pinctrl_desc _
.num_banks = 3,
};
+static const struct sunxi_pinctrl_function sun20i_d1_pinctrl_functions[] = {
+ { "emac", 8 }, /* PE0-PE15 */
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2c0", 4 }, /* PB10-PB11 */
+ { "mmc0", 2 }, /* PF0-PF5 */
+ { "mmc1", 2 }, /* PG0-PG5 */
+ { "mmc2", 3 }, /* PC2-PC7 */
+ { "spi0", 2 }, /* PC2-PC7 */
+#if IS_ENABLED(CONFIG_UART0_PORT_F)
+ { "uart0", 3 }, /* PF2-PF4 */
+#else
+ { "uart0", 6 }, /* PB8-PB9 */
+#endif
+ { "uart1", 2 }, /* PG6-PG7 */
+ { "uart2", 7 }, /* PB0-PB1 */
+};
+
+static const struct sunxi_pinctrl_desc __maybe_unused sun20i_d1_pinctrl_desc = {
+ .functions = sun20i_d1_pinctrl_functions,
+ .num_functions = ARRAY_SIZE(sun20i_d1_pinctrl_functions),
+ .first_bank = SUNXI_GPIO_A,
+ .num_banks = 7,
+};
+
static const struct sunxi_pinctrl_function sun50i_a64_pinctrl_functions[] = {
{ "emac", 4 }, /* PD8-PD23 */
{ "gpio_in", 0 },
@@ -849,6 +874,12 @@ static const struct udevice_id sunxi_pin
.data = (ulong)&sun9i_a80_r_pinctrl_desc,
},
#endif
+#ifdef CONFIG_PINCTRL_SUN20I_D1
+ {
+ .compatible = "allwinner,sun20i-d1-pinctrl",
+ .data = (ulong)&sun20i_d1_pinctrl_desc,
+ },
+#endif
#ifdef CONFIG_PINCTRL_SUN50I_A64
{
.compatible = "allwinner,sun50i-a64-pinctrl",

View file

@ -1,7 +1,7 @@
From 41e5a94533e9744b8eac718dd2c359eca57573f8 Mon Sep 17 00:00:00 2001
From b9b70c8a9e9a9bf4971279ec93dac945d415d44a Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:25:26 -0500
Subject: [PATCH 65/90] sunxi: Clean up the SPL_STACK_R_ADDR defaults
Subject: [PATCH 20/68] sunxi: Clean up the SPL_STACK_R_ADDR defaults
Update this option to be based on SUNXI_MINIMUM_DRAM_MB. This corrects
the value used on V3s, which previously was the MACH_SUN8I default, and
@ -9,12 +9,12 @@ so relied on addresses wrapping modulo the DRAM size.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
board/sunxi/Kconfig | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
board/sunxi/Kconfig | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -57,14 +57,9 @@ config IDENT_STRING
@@ -58,15 +58,9 @@ config IDENT_STRING
config SPL_STACK_R_ADDR
default 0x81e00000 if MACH_SUNIV
@ -26,6 +26,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0x2fe00000 if MACH_SUN9I
- default 0x4fe00000 if MACH_SUN50I
- default 0x4fe00000 if SUN50I_GEN_H6
- default 0x4fe00000 if SUNXI_GEN_NCAT2
+ default 0x4fe00000 if SUNXI_MINIMUM_DRAM_MB >= 256
+ default 0x43e00000 if SUNXI_MINIMUM_DRAM_MB >= 64

View file

@ -1,7 +1,7 @@
From e947c7377b90897e4c638dad6e64201361dc8a9e Mon Sep 17 00:00:00 2001
From 6ab5eb744647c9af3204756d2c2ce4180d7a4248 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Aug 2022 00:45:10 -0500
Subject: [PATCH 66/90] sunxi: Move PRE_CON_BUF_ADDR to the board Kconfig
Subject: [PATCH 21/68] sunxi: Move PRE_CON_BUF_ADDR to the board Kconfig
This provides a default value for RISC-V when that is added, and it
makes sense to put this option next to the other DRAM layout options.
@ -16,7 +16,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -55,6 +55,12 @@ if BOARD_SUNXI
@@ -56,6 +56,12 @@ if BOARD_SUNXI
config IDENT_STRING
default " Allwinner Technology"
@ -31,7 +31,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0x2fe00000 if MACH_SUN9I
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -195,8 +195,6 @@ config PRE_CON_BUF_SZ
@@ -205,8 +205,6 @@ config PRE_CON_BUF_SZ
config PRE_CON_BUF_ADDR
hex "Address of the pre-console buffer"
depends on PRE_CONSOLE_BUFFER

View file

@ -1,7 +1,7 @@
From 71796f9d47a6b7e0dd6bb276436950463039c1b8 Mon Sep 17 00:00:00 2001
From bbb8fa9934270f2a8d63ea4a62612f5f7969dc15 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 31 Oct 2022 00:08:26 -0500
Subject: [PATCH 67/90] sunxi: Move SPL_BSS_START_ADDR to the board Kconfig
Subject: [PATCH 22/68] sunxi: Move SPL_BSS_START_ADDR to the board Kconfig
This provides a default value for RISC-V when that is added, and it
makes sense to put this option next to the other DRAM layout options.
@ -16,7 +16,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -61,6 +61,12 @@ config PRE_CON_BUF_ADDR
@@ -62,6 +62,12 @@ config PRE_CON_BUF_ADDR
default 0x4f000000 if SUNXI_MINIMUM_DRAM_MB >= 256
default 0x43000000 if SUNXI_MINIMUM_DRAM_MB >= 64

View file

@ -1,25 +0,0 @@
From 2d85df851c590b454749ac989a778bb226637bfc Mon Sep 17 00:00:00 2001
From: Zoltan HERPAI <wigyori@uid0.hu>
Date: Tue, 6 Jun 2023 15:08:39 +0000
Subject: [PATCH 23/90] Kconfig: Remove an impossible condition
ARCH_SUNXI selects BINMAN, so the condition "!BINMAN && ARCH_SUNXI"
is impossible to satisfy.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---
Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Kconfig
+++ b/Kconfig
@@ -459,7 +459,7 @@ config BUILD_TARGET
default "u-boot-with-spl.kwb" if ARCH_MVEBU && SPL
default "u-boot-elf.srec" if RCAR_GEN3
default "u-boot.itb" if !BINMAN && SPL_LOAD_FIT && (ARCH_ROCKCHIP || \
- ARCH_SUNXI || RISCV || ARCH_ZYNQMP)
+ RISCV || ARCH_ZYNQMP)
default "u-boot.kwb" if ARCH_KIRKWOOD
default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
default "u-boot-with-spl.imx" if ARCH_MX6 && SPL

View file

@ -1,7 +1,7 @@
From 5d60490d0f0ca0a5d414ba9a4e41ceea8a98b4d2 Mon Sep 17 00:00:00 2001
From b36106cc8b53c11c21f4fcc398479756cbdc3b07 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Aug 2022 00:07:47 -0500
Subject: [PATCH 68/90] sunxi: Move SPL_TEXT_BASE to the board Kconfig
Subject: [PATCH 23/68] sunxi: Move SPL_TEXT_BASE to the board Kconfig
It makes sense to put this near the definition of SUNXI_SRAM_ADDRESS.
@ -13,13 +13,13 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -73,6 +73,11 @@ config SPL_STACK_R_ADDR
@@ -74,6 +74,11 @@ config SPL_STACK_R_ADDR
default 0x4fe00000 if SUNXI_MINIMUM_DRAM_MB >= 256
default 0x43e00000 if SUNXI_MINIMUM_DRAM_MB >= 64
+config SPL_TEXT_BASE
+ default 0x10060 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5
+ default 0x20060 if SUN50I_GEN_H6
+ default 0x20060 if SUN50I_GEN_H6 || SUNXI_GEN_NCAT2
+ default 0x00060
+
config SUNXI_MINIMUM_DRAM_MB
@ -32,7 +32,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0x402F0400 if AM33XX
default 0x40301350 if OMAP54XX
- default 0x10060 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN9I
- default 0x20060 if SUN50I_GEN_H6
- default 0x20060 if SUN50I_GEN_H6 || SUNXI_GEN_NCAT2
- default 0x00060 if ARCH_SUNXI
default 0xfffc0000 if ARCH_ZYNQMP
default 0x0

View file

@ -1,33 +0,0 @@
From b7150f7dd885012868c94b29ac4fe6152c065a95 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 9 Oct 2021 10:43:56 -0500
Subject: [PATCH 24/90] binman: Prevent entries in a section from overlapping
Currently, if the "offset" property is given for an entry, the section's
running offset is completely ignored. This causes entries to overlap if
the provided offset is less than the size of the entries earlier in the
section. Avoid the overlap by only using the provided offset when it is
greater than the running offset.
The motivation for this change is the rule used by SPL to find U-Boot on
sunxi boards: U-Boot starts 32 KiB after the start of SPL, unless SPL is
larger than 32 KiB, in which case U-Boot immediately follows SPL.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
tools/binman/entry.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -483,7 +483,9 @@ class Entry(object):
if self.offset_unset:
self.Raise('No offset set with offset-unset: should another '
'entry provide this correct offset?')
- self.offset = tools.align(offset, self.align)
+ elif self.offset > offset:
+ offset = self.offset
+ self.offset = tools.align(offset, self.align)
needed = self.pad_before + self.contents_size + self.pad_after
needed = tools.align(needed, self.align_size)
size = self.size

View file

@ -1,7 +1,7 @@
From 03f3ba82e9dfb67f1ae0812f72aea6559aa61bb4 Mon Sep 17 00:00:00 2001
From ee9d6f9ec6d75a9f38323fa0f957825b6dd27b8b Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:23:34 -0500
Subject: [PATCH 69/90] sunxi: Move SYS_LOAD_ADDR to the board Kconfig
Subject: [PATCH 24/68] sunxi: Move SYS_LOAD_ADDR to the board Kconfig
This will provide a default value for RISC-V when that is added, and it
makes sense to put this option next to the other DRAM layout options.
@ -14,7 +14,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/Kconfig
+++ b/Kconfig
@@ -508,9 +508,6 @@ config SYS_LOAD_ADDR
@@ -536,9 +536,6 @@ config SYS_LOAD_ADDR
hex "Address in memory to use by default"
default 0x01000000 if ARCH_SOCFPGA
default 0x02000000 if PPC || X86
@ -26,7 +26,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0x12000000 if ARCH_MX6 && !(MX6SL || MX6SLL || MX6SX || MX6UL || MX6ULL)
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -129,6 +129,11 @@ config SYS_CONFIG_NAME
@@ -132,6 +132,11 @@ config SYS_CONFIG_NAME
default "sun50i" if MACH_SUN50I_H6
default "sun50i" if MACH_SUN50I_H616

View file

@ -1,20 +1,33 @@
From 08b45a89c7b25eb7828589360cf4ca2d9910cc59 Mon Sep 17 00:00:00 2001
From 09c73b7633470574f338a005818dd4942dd0139e Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 21:48:53 -0500
Subject: [PATCH 70/90] sunxi: Move TEXT_BASE to the board Kconfig
Subject: [PATCH 25/68] sunxi: Move TEXT_BASE to the board Kconfig
This is how the vast majority of platforms provided TEXT_BASE.
sunxi was the exception here.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
Kconfig | 4 ----
board/sunxi/Kconfig | 6 ++++++
boot/Kconfig | 4 ----
2 files changed, 6 insertions(+), 4 deletions(-)
--- a/Kconfig
+++ b/Kconfig
@@ -636,10 +636,6 @@ config TEXT_BASE
depends on HAVE_TEXT_BASE
default 0x0 if POSITION_INDEPENDENT
default 0x80800000 if ARCH_OMAP2PLUS || ARCH_K3
- default 0x81700000 if MACH_SUNIV
- default 0x2a000000 if MACH_SUN9I
- default 0x4a000000 if SUNXI_MINIMUM_DRAM_MB >= 256
- default 0x42e00000 if SUNXI_MINIMUM_DRAM_MB >= 64
hex "Text Base"
help
The address in memory that U-Boot will be copied and executed from
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -137,6 +137,12 @@ config SYS_LOAD_ADDR
@@ -140,6 +140,12 @@ config SYS_LOAD_ADDR
config SYS_SOC
default "sunxi"
@ -27,16 +40,3 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
menu "sunxi board options"
choice
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -633,10 +633,6 @@ config TEXT_BASE
depends on HAVE_TEXT_BASE
default 0x0 if POSITION_INDEPENDENT
default 0x80800000 if ARCH_OMAP2PLUS || ARCH_K3
- default 0x81700000 if MACH_SUNIV
- default 0x2a000000 if MACH_SUN9I
- default 0x4a000000 if SUNXI_MINIMUM_DRAM_MB >= 256
- default 0x42e00000 if SUNXI_MINIMUM_DRAM_MB >= 64
hex "Text Base"
help
The address in memory that U-Boot will be running from, initially.

View file

@ -1,192 +0,0 @@
From b641ca5f4d272b83ef77ebcf5c75678cf139c69a Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 17 Apr 2021 13:33:54 -0500
Subject: [PATCH 25/90] sunxi: binman: Enable SPL FIT loading for 32-bit SoCs
Now that Crust (SCP firmware) has support for H3, we need a FIT image to
load it. H3 also needs to load a SoC-specific eGon blob to support CPU 0
hotplug. Let's first enable FIT support before adding extra firmware.
Update the binman description to work on either 32-bit or 64-bit SoCs:
- Make BL31 optional, since it is not used on 32-bit SoCs (though BL32
may be used in the future).
- Explicitly set the minimum offset of the FIT to 32 KiB, since SPL on
some boards is still only 24 KiB large even with FIT support enabled.
CONFIG_SPL_PAD_TO cannot be used because it is not defined for H616.
FIT unlocks more features (signatures, multiple DTBs, etc.), so enable
it by default. A10 (sun4i) only has 24 KiB of SRAM A1, so it needs
SPL_FIT_IMAGE_TINY. For simplicity, enable that option everywhere.
Cover-letter:
sunxi: SPL FIT support for 32-bit sunxi SoCs
This series makes the necessary changes so 32-bit sunxi SoCs can load
additional device trees or firmware from SPL along with U-Boot proper.
There was no existing binman entry property that put the FIT at the
right offset. The minimum offset is 32k, but this matches neither the
SPL size (which is no more than 24k on some SoCs) nor the FIT alignment
(which is 512 bytes in practice due to SPL size constraints). So instead
of adding a new property, I fixed what is arguably a bug in the offset
property -- though this strategy will not work if someone is
intentionally creating overlapping entries.
END
Series-to: sunxi
Series-to: sjg
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/Kconfig | 1 +
arch/arm/dts/sunxi-u-boot.dtsi | 46 ++++++++++++++++++++++------------
common/spl/Kconfig | 9 +++----
3 files changed, 35 insertions(+), 21 deletions(-)
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1135,6 +1135,7 @@ config ARCH_SUNXI
imply SPL_GPIO
imply SPL_LIBCOMMON_SUPPORT
imply SPL_LIBGENERIC_SUPPORT
+ imply SPL_LOAD_FIT
imply SPL_MMC if MMC
imply SPL_POWER
imply SPL_SERIAL
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -1,13 +1,19 @@
#include <config.h>
-#ifdef CONFIG_MACH_SUN50I_H6
-#define BL31_ADDR 0x104000
-#define SCP_ADDR 0x114000
-#elif defined(CONFIG_MACH_SUN50I_H616)
-#define BL31_ADDR 0x40000000
+#ifdef CONFIG_ARM64
+#define ARCH "arm64"
#else
-#define BL31_ADDR 0x44000
-#define SCP_ADDR 0x50000
+#define ARCH "arm"
+#endif
+
+#if defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H5)
+#define BL31_ADDR 0x00044000
+#define SCP_ADDR 0x00050000
+#elif defined(CONFIG_MACH_SUN50I_H6)
+#define BL31_ADDR 0x00104000
+#define SCP_ADDR 0x00114000
+#elif defined(CONFIG_MACH_SUN50I_H616)
+#define BL31_ADDR 0x40000000
#endif
/ {
@@ -34,30 +40,33 @@
filename = "spl/sunxi-spl.bin";
};
-#ifdef CONFIG_ARM64
+#ifdef CONFIG_SPL_LOAD_FIT
fit {
- description = "Configuration to load ATF before U-Boot";
+ description = "Configuration to load U-Boot and firmware";
+ offset = <32768>;
#address-cells = <1>;
fit,fdt-list = "of-list";
images {
uboot {
- description = "U-Boot (64-bit)";
+ description = "U-Boot";
type = "standalone";
os = "u-boot";
- arch = "arm64";
+ arch = ARCH;
compression = "none";
load = <CONFIG_TEXT_BASE>;
+ entry = <CONFIG_TEXT_BASE>;
u-boot-nodtb {
};
};
+#ifdef BL31_ADDR
atf {
description = "ARM Trusted Firmware";
type = "firmware";
os = "arm-trusted-firmware";
- arch = "arm64";
+ arch = ARCH;
compression = "none";
load = <BL31_ADDR>;
entry = <BL31_ADDR>;
@@ -67,6 +76,7 @@
missing-msg = "atf-bl31-sunxi";
};
};
+#endif
#ifdef SCP_ADDR
scp {
@@ -95,19 +105,23 @@
@config-SEQ {
description = "NAME";
+#ifdef BL31_ADDR
firmware = "atf";
-#ifndef SCP_ADDR
- loadables = "uboot";
#else
- loadables = "scp", "uboot";
+ firmware = "uboot";
+#endif
+ loadables =
+#ifdef SCP_ADDR
+ "scp",
#endif
+ "uboot";
fdt = "fdt-SEQ";
};
};
};
#else
u-boot-img {
- offset = <CONFIG_SPL_PAD_TO>;
+ offset = <32768>;
};
#endif
};
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -76,12 +76,12 @@ config SPL_SIZE_LIMIT_PROVIDE_STACK
config SPL_MAX_SIZE
hex "Maximum size of the SPL image, excluding BSS"
+ default 0x37fa0 if MACH_SUN50I_H616
default 0x30000 if ARCH_MX6 && MX6_OCRAM_256KB
+ default 0x25fa0 if MACH_SUN50I_H6
default 0x1b000 if AM33XX && !TI_SECURE_DEVICE
default 0x10000 if ARCH_MX6 && !MX6_OCRAM_256KB
default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x10000
- default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x20000 && !MACH_SUN50I_H616
- default 0xbfa0 if MACH_SUN50I_H616
default 0x7000 if RCAR_GEN3
default 0x5fa0 if SUNXI_SRAM_ADDRESS = 0x0
default 0x10000 if ASPEED_AST2600
@@ -97,7 +97,7 @@ config SPL_PAD_TO
default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
default 0x11000 if ARCH_MX7 || (ARCH_MX6 && !MX6_OCRAM_256KB)
default 0x10000 if ARCH_KEYSTONE
- default 0x8000 if ARCH_SUNXI && !MACH_SUN50I_H616
+ default 0x0 if ARCH_SUNXI
default 0x0 if ARCH_MTMIPS
default TPL_MAX_SIZE if TPL_MAX_SIZE > SPL_MAX_SIZE
default SPL_MAX_SIZE
@@ -575,8 +575,7 @@ config SPL_MD5
config SPL_FIT_IMAGE_TINY
bool "Remove functionality from SPL FIT loading to reduce size"
depends on SPL_FIT
- default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6
- default y if ARCH_IMX8M || ARCH_IMX9
+ default y if ARCH_IMX8M || ARCH_IMX9 || ARCH_SUNXI
help
Enable this to reduce the size of the FIT image loading code
in SPL, if space for the SPL binary is very tight.

View file

@ -1,7 +1,7 @@
From 6a1b660a83b262237b6bebed26e44db923a86a6b Mon Sep 17 00:00:00 2001
From: Zoltan HERPAI <wigyori@uid0.hu>
Date: Tue, 6 Jun 2023 18:09:19 +0000
Subject: [PATCH 71/90] sunxi: Move most board options to the board Kconfig
From 7e7430bd742f4474152c37d96d398936bf6d5a49 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:18:11 -0500
Subject: [PATCH 26/68] sunxi: Move most board options to the board Kconfig
This excludes options that are inherently ARM-specific or are specific
to legacy non-DM drivers.
@ -9,15 +9,14 @@ to legacy non-DM drivers.
Some help text is cleaned up along the way.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---
arch/arm/mach-sunxi/Kconfig | 71 ------------------------------------
arch/arm/mach-sunxi/Kconfig | 70 ------------------------------------
board/sunxi/Kconfig | 72 +++++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+), 71 deletions(-)
2 files changed, 72 insertions(+), 70 deletions(-)
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -548,16 +548,6 @@ config DRAM_ODT_CORRECTION
@@ -647,36 +647,12 @@ config DRAM_ODT_CORRECTION
then the correction is negative. Usually the value for this is 0.
endif
@ -34,9 +33,8 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
config OLD_SUNXI_KERNEL_COMPAT
bool "Enable workarounds for booting old kernels"
---help---
@@ -571,20 +561,6 @@ config MACPWR
Set the pin used to power the MAC. This takes a string in the format
understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
Set this to enable various workarounds for old kernels, this results in
sub-optimal settings for newer kernels, only enable if needed.
-config MMC1_PINS_PH
- bool "Pins for mmc1 are on Port H"
@ -52,17 +50,16 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
- slot or emmc on mmc1 - mmc3. Setting this to 1, 2 or 3 will enable
- support for this.
-
config I2C0_ENABLE
bool "Enable I2C/TWI controller 0"
default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I_R40
@@ -612,16 +588,6 @@ config R_I2C_ENABLE
Set this to y to enable the I2C controller which is part of the PRCM.
endif
config USB0_VBUS_PIN
string "Vbus enable pin for usb0 (otg)"
default ""
@@ -753,15 +729,6 @@ config AXP_GPIO
---help---
Say Y here to enable support for the gpio pins of the axp PMIC ICs.
-config AXP_DISABLE_BOOT_ON_POWERON
- bool "Disable device boot on power plug-in"
- depends on AXP209_POWER || AXP221_POWER || AXP809_POWER || AXP818_POWER
- default n
- ---help---
- Say Y here to prevent the device from booting up because of a plug-in
- event. When set, the device will boot into the SPL briefly to
@ -72,7 +69,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
config VIDEO_SUNXI
bool "Enable graphical uboot console on HDMI, LCD or VGA"
depends on !MACH_SUN8I_A83T
@@ -850,41 +816,4 @@ config SPL_SPI_SUNXI
@@ -983,41 +950,4 @@ config SPL_SPI_SUNXI
sunxi SPI Flash. It uses the same method as the boot ROM, so does
not need any extra configuration.
@ -116,7 +113,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
- select CMD_EXTENSION
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -171,6 +171,78 @@ config SPL_IMAGE_TYPE
@@ -174,6 +174,78 @@ config SPL_IMAGE_TYPE
default "sunxi_egon" if SPL_IMAGE_TYPE_SUNXI_EGON
default "sunxi_toc0" if SPL_IMAGE_TYPE_SUNXI_TOC0

View file

@ -1,51 +0,0 @@
From ca1e6f4491981432c3e88441131c8e25067da95e Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 9 Oct 2021 22:00:22 -0500
Subject: [PATCH 26/90] sunxi: psci: Avoid hanging when CPU 0 is hot-unplugged
Do not try to send an SGI from CPU 0 to itself. Since FIQs are masked
when entering monitor mode, this will hang. Plus, CPU 0 cannot fully
power itself off anyway. Instead, have it turn FIQs back on and continue
servicing SGIs from other cores.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/cpu/armv7/sunxi/psci.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
--- a/arch/arm/cpu/armv7/sunxi/psci.c
+++ b/arch/arm/cpu/armv7/sunxi/psci.c
@@ -38,6 +38,15 @@
#define SUN8I_R40_PWR_CLAMP(cpu) (0x120 + (cpu) * 0x4)
#define SUN8I_R40_SRAMC_SOFT_ENTRY_REG0 (0xbc)
+static inline u32 __secure cp15_read_mpidr(void)
+{
+ u32 val;
+
+ asm volatile ("mrc p15, 0, %0, c0, c0, 5" : "=r" (val));
+
+ return val;
+}
+
static void __secure cp15_write_cntp_tval(u32 tval)
{
asm volatile ("mcr p15, 0, %0, c14, c2, 0" : : "r" (tval));
@@ -281,9 +290,14 @@ s32 __secure psci_cpu_off(void)
{
psci_cpu_off_common();
- /* Ask CPU0 via SGI15 to pull the rug... */
- writel(BIT(16) | 15, GICD_BASE + GICD_SGIR);
- dsb();
+ if (cp15_read_mpidr() & 3) {
+ /* Ask CPU0 via SGI15 to pull the rug... */
+ writel(BIT(16) | 15, GICD_BASE + GICD_SGIR);
+ dsb();
+ } else {
+ /* Unmask FIQs to service SGI15. */
+ asm volatile ("cpsie f");
+ }
/* Wait to be turned off */
while (1)

View file

@ -1,295 +0,0 @@
From 2f48dfc23d612f6f1798ff761854fd3141d0671f Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 15 May 2022 21:29:22 -0500
Subject: [PATCH 27/90] clk: sunxi: Add NAND clocks and resets
Currently NAND clock setup is done in board code, both in SPL and in
U-Boot proper. Add the NAND clocks/resets here so they can be used by
the "full" NAND driver once it is converted to the driver model.
The bit locations are copied from the Linux CCU drivers.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/clk/sunxi/clk_a10.c | 2 ++
drivers/clk/sunxi/clk_a10s.c | 2 ++
drivers/clk/sunxi/clk_a23.c | 3 +++
drivers/clk/sunxi/clk_a31.c | 6 ++++++
drivers/clk/sunxi/clk_a64.c | 3 +++
drivers/clk/sunxi/clk_a80.c | 8 ++++++++
drivers/clk/sunxi/clk_a83t.c | 3 +++
drivers/clk/sunxi/clk_h3.c | 3 +++
drivers/clk/sunxi/clk_h6.c | 6 ++++++
drivers/clk/sunxi/clk_h616.c | 6 ++++++
drivers/clk/sunxi/clk_r40.c | 3 +++
11 files changed, 45 insertions(+)
--- a/drivers/clk/sunxi/clk_a10.c
+++ b/drivers/clk/sunxi/clk_a10.c
@@ -23,6 +23,7 @@ static struct ccu_clk_gate a10_gates[] =
[CLK_AHB_MMC1] = GATE(0x060, BIT(9)),
[CLK_AHB_MMC2] = GATE(0x060, BIT(10)),
[CLK_AHB_MMC3] = GATE(0x060, BIT(11)),
+ [CLK_AHB_NAND] = GATE(0x060, BIT(13)),
[CLK_AHB_EMAC] = GATE(0x060, BIT(17)),
[CLK_AHB_SPI0] = GATE(0x060, BIT(20)),
[CLK_AHB_SPI1] = GATE(0x060, BIT(21)),
@@ -47,6 +48,7 @@ static struct ccu_clk_gate a10_gates[] =
[CLK_APB1_UART6] = GATE(0x06c, BIT(22)),
[CLK_APB1_UART7] = GATE(0x06c, BIT(23)),
+ [CLK_NAND] = GATE(0x080, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
[CLK_SPI2] = GATE(0x0a8, BIT(31)),
--- a/drivers/clk/sunxi/clk_a10s.c
+++ b/drivers/clk/sunxi/clk_a10s.c
@@ -20,6 +20,7 @@ static struct ccu_clk_gate a10s_gates[]
[CLK_AHB_MMC0] = GATE(0x060, BIT(8)),
[CLK_AHB_MMC1] = GATE(0x060, BIT(9)),
[CLK_AHB_MMC2] = GATE(0x060, BIT(10)),
+ [CLK_AHB_NAND] = GATE(0x060, BIT(13)),
[CLK_AHB_EMAC] = GATE(0x060, BIT(17)),
[CLK_AHB_SPI0] = GATE(0x060, BIT(20)),
[CLK_AHB_SPI1] = GATE(0x060, BIT(21)),
@@ -35,6 +36,7 @@ static struct ccu_clk_gate a10s_gates[]
[CLK_APB1_UART2] = GATE(0x06c, BIT(18)),
[CLK_APB1_UART3] = GATE(0x06c, BIT(19)),
+ [CLK_NAND] = GATE(0x080, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
[CLK_SPI2] = GATE(0x0a8, BIT(31)),
--- a/drivers/clk/sunxi/clk_a23.c
+++ b/drivers/clk/sunxi/clk_a23.c
@@ -17,6 +17,7 @@ static struct ccu_clk_gate a23_gates[] =
[CLK_BUS_MMC0] = GATE(0x060, BIT(8)),
[CLK_BUS_MMC1] = GATE(0x060, BIT(9)),
[CLK_BUS_MMC2] = GATE(0x060, BIT(10)),
+ [CLK_BUS_NAND] = GATE(0x060, BIT(13)),
[CLK_BUS_SPI0] = GATE(0x060, BIT(20)),
[CLK_BUS_SPI1] = GATE(0x060, BIT(21)),
[CLK_BUS_OTG] = GATE(0x060, BIT(24)),
@@ -34,6 +35,7 @@ static struct ccu_clk_gate a23_gates[] =
[CLK_BUS_UART3] = GATE(0x06c, BIT(19)),
[CLK_BUS_UART4] = GATE(0x06c, BIT(20)),
+ [CLK_NAND] = GATE(0x080, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
@@ -52,6 +54,7 @@ static struct ccu_reset a23_resets[] = {
[RST_BUS_MMC0] = RESET(0x2c0, BIT(8)),
[RST_BUS_MMC1] = RESET(0x2c0, BIT(9)),
[RST_BUS_MMC2] = RESET(0x2c0, BIT(10)),
+ [RST_BUS_NAND] = RESET(0x2c0, BIT(13)),
[RST_BUS_SPI0] = RESET(0x2c0, BIT(20)),
[RST_BUS_SPI1] = RESET(0x2c0, BIT(21)),
[RST_BUS_OTG] = RESET(0x2c0, BIT(24)),
--- a/drivers/clk/sunxi/clk_a31.c
+++ b/drivers/clk/sunxi/clk_a31.c
@@ -18,6 +18,8 @@ static struct ccu_clk_gate a31_gates[] =
[CLK_AHB1_MMC1] = GATE(0x060, BIT(9)),
[CLK_AHB1_MMC2] = GATE(0x060, BIT(10)),
[CLK_AHB1_MMC3] = GATE(0x060, BIT(11)),
+ [CLK_AHB1_NAND1] = GATE(0x060, BIT(12)),
+ [CLK_AHB1_NAND0] = GATE(0x060, BIT(13)),
[CLK_AHB1_EMAC] = GATE(0x060, BIT(17)),
[CLK_AHB1_SPI0] = GATE(0x060, BIT(20)),
[CLK_AHB1_SPI1] = GATE(0x060, BIT(21)),
@@ -43,6 +45,8 @@ static struct ccu_clk_gate a31_gates[] =
[CLK_APB2_UART4] = GATE(0x06c, BIT(20)),
[CLK_APB2_UART5] = GATE(0x06c, BIT(21)),
+ [CLK_NAND0] = GATE(0x080, BIT(31)),
+ [CLK_NAND1] = GATE(0x084, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
[CLK_SPI2] = GATE(0x0a8, BIT(31)),
@@ -65,6 +69,8 @@ static struct ccu_reset a31_resets[] = {
[RST_AHB1_MMC1] = RESET(0x2c0, BIT(9)),
[RST_AHB1_MMC2] = RESET(0x2c0, BIT(10)),
[RST_AHB1_MMC3] = RESET(0x2c0, BIT(11)),
+ [RST_AHB1_NAND1] = RESET(0x2c0, BIT(12)),
+ [RST_AHB1_NAND0] = RESET(0x2c0, BIT(13)),
[RST_AHB1_EMAC] = RESET(0x2c0, BIT(17)),
[RST_AHB1_SPI0] = RESET(0x2c0, BIT(20)),
[RST_AHB1_SPI1] = RESET(0x2c0, BIT(21)),
--- a/drivers/clk/sunxi/clk_a64.c
+++ b/drivers/clk/sunxi/clk_a64.c
@@ -19,6 +19,7 @@ static const struct ccu_clk_gate a64_gat
[CLK_BUS_MMC0] = GATE(0x060, BIT(8)),
[CLK_BUS_MMC1] = GATE(0x060, BIT(9)),
[CLK_BUS_MMC2] = GATE(0x060, BIT(10)),
+ [CLK_BUS_NAND] = GATE(0x060, BIT(13)),
[CLK_BUS_EMAC] = GATE(0x060, BIT(17)),
[CLK_BUS_SPI0] = GATE(0x060, BIT(20)),
[CLK_BUS_SPI1] = GATE(0x060, BIT(21)),
@@ -39,6 +40,7 @@ static const struct ccu_clk_gate a64_gat
[CLK_BUS_UART3] = GATE(0x06c, BIT(19)),
[CLK_BUS_UART4] = GATE(0x06c, BIT(20)),
+ [CLK_NAND] = GATE(0x080, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
@@ -58,6 +60,7 @@ static const struct ccu_reset a64_resets
[RST_BUS_MMC0] = RESET(0x2c0, BIT(8)),
[RST_BUS_MMC1] = RESET(0x2c0, BIT(9)),
[RST_BUS_MMC2] = RESET(0x2c0, BIT(10)),
+ [RST_BUS_NAND] = RESET(0x2c0, BIT(13)),
[RST_BUS_EMAC] = RESET(0x2c0, BIT(17)),
[RST_BUS_SPI0] = RESET(0x2c0, BIT(20)),
[RST_BUS_SPI1] = RESET(0x2c0, BIT(21)),
--- a/drivers/clk/sunxi/clk_a80.c
+++ b/drivers/clk/sunxi/clk_a80.c
@@ -14,12 +14,18 @@
#include <linux/bitops.h>
static const struct ccu_clk_gate a80_gates[] = {
+ [CLK_NAND0_0] = GATE(0x400, BIT(31)),
+ [CLK_NAND0_1] = GATE(0x404, BIT(31)),
+ [CLK_NAND1_0] = GATE(0x408, BIT(31)),
+ [CLK_NAND1_1] = GATE(0x40c, BIT(31)),
[CLK_SPI0] = GATE(0x430, BIT(31)),
[CLK_SPI1] = GATE(0x434, BIT(31)),
[CLK_SPI2] = GATE(0x438, BIT(31)),
[CLK_SPI3] = GATE(0x43c, BIT(31)),
[CLK_BUS_MMC] = GATE(0x580, BIT(8)),
+ [CLK_BUS_NAND0] = GATE(0x580, BIT(12)),
+ [CLK_BUS_NAND1] = GATE(0x580, BIT(13)),
[CLK_BUS_SPI0] = GATE(0x580, BIT(20)),
[CLK_BUS_SPI1] = GATE(0x580, BIT(21)),
[CLK_BUS_SPI2] = GATE(0x580, BIT(22)),
@@ -42,6 +48,8 @@ static const struct ccu_clk_gate a80_gat
static const struct ccu_reset a80_resets[] = {
[RST_BUS_MMC] = RESET(0x5a0, BIT(8)),
+ [RST_BUS_NAND0] = RESET(0x5a0, BIT(12)),
+ [RST_BUS_NAND1] = RESET(0x5a0, BIT(13)),
[RST_BUS_SPI0] = RESET(0x5a0, BIT(20)),
[RST_BUS_SPI1] = RESET(0x5a0, BIT(21)),
[RST_BUS_SPI2] = RESET(0x5a0, BIT(22)),
--- a/drivers/clk/sunxi/clk_a83t.c
+++ b/drivers/clk/sunxi/clk_a83t.c
@@ -17,6 +17,7 @@ static struct ccu_clk_gate a83t_gates[]
[CLK_BUS_MMC0] = GATE(0x060, BIT(8)),
[CLK_BUS_MMC1] = GATE(0x060, BIT(9)),
[CLK_BUS_MMC2] = GATE(0x060, BIT(10)),
+ [CLK_BUS_NAND] = GATE(0x060, BIT(13)),
[CLK_BUS_EMAC] = GATE(0x060, BIT(17)),
[CLK_BUS_SPI0] = GATE(0x060, BIT(20)),
[CLK_BUS_SPI1] = GATE(0x060, BIT(21)),
@@ -36,6 +37,7 @@ static struct ccu_clk_gate a83t_gates[]
[CLK_BUS_UART3] = GATE(0x06c, BIT(19)),
[CLK_BUS_UART4] = GATE(0x06c, BIT(20)),
+ [CLK_NAND] = GATE(0x080, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
@@ -54,6 +56,7 @@ static struct ccu_reset a83t_resets[] =
[RST_BUS_MMC0] = RESET(0x2c0, BIT(8)),
[RST_BUS_MMC1] = RESET(0x2c0, BIT(9)),
[RST_BUS_MMC2] = RESET(0x2c0, BIT(10)),
+ [RST_BUS_NAND] = RESET(0x2c0, BIT(13)),
[RST_BUS_EMAC] = RESET(0x2c0, BIT(17)),
[RST_BUS_SPI0] = RESET(0x2c0, BIT(20)),
[RST_BUS_SPI1] = RESET(0x2c0, BIT(21)),
--- a/drivers/clk/sunxi/clk_h3.c
+++ b/drivers/clk/sunxi/clk_h3.c
@@ -19,6 +19,7 @@ static struct ccu_clk_gate h3_gates[] =
[CLK_BUS_MMC0] = GATE(0x060, BIT(8)),
[CLK_BUS_MMC1] = GATE(0x060, BIT(9)),
[CLK_BUS_MMC2] = GATE(0x060, BIT(10)),
+ [CLK_BUS_NAND] = GATE(0x060, BIT(13)),
[CLK_BUS_EMAC] = GATE(0x060, BIT(17)),
[CLK_BUS_SPI0] = GATE(0x060, BIT(20)),
[CLK_BUS_SPI1] = GATE(0x060, BIT(21)),
@@ -44,6 +45,7 @@ static struct ccu_clk_gate h3_gates[] =
[CLK_BUS_EPHY] = GATE(0x070, BIT(0)),
+ [CLK_NAND] = GATE(0x080, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
@@ -66,6 +68,7 @@ static struct ccu_reset h3_resets[] = {
[RST_BUS_MMC0] = RESET(0x2c0, BIT(8)),
[RST_BUS_MMC1] = RESET(0x2c0, BIT(9)),
[RST_BUS_MMC2] = RESET(0x2c0, BIT(10)),
+ [RST_BUS_NAND] = RESET(0x2c0, BIT(13)),
[RST_BUS_EMAC] = RESET(0x2c0, BIT(17)),
[RST_BUS_SPI0] = RESET(0x2c0, BIT(20)),
[RST_BUS_SPI1] = RESET(0x2c0, BIT(21)),
--- a/drivers/clk/sunxi/clk_h6.c
+++ b/drivers/clk/sunxi/clk_h6.c
@@ -18,6 +18,10 @@ static struct ccu_clk_gate h6_gates[] =
[CLK_APB1] = GATE_DUMMY,
+ [CLK_NAND0] = GATE(0x810, BIT(31)),
+ [CLK_NAND1] = GATE(0x814, BIT(31)),
+ [CLK_BUS_NAND] = GATE(0x82c, BIT(0)),
+
[CLK_BUS_MMC0] = GATE(0x84c, BIT(0)),
[CLK_BUS_MMC1] = GATE(0x84c, BIT(1)),
[CLK_BUS_MMC2] = GATE(0x84c, BIT(2)),
@@ -58,6 +62,8 @@ static struct ccu_clk_gate h6_gates[] =
};
static struct ccu_reset h6_resets[] = {
+ [RST_BUS_NAND] = RESET(0x82c, BIT(16)),
+
[RST_BUS_MMC0] = RESET(0x84c, BIT(16)),
[RST_BUS_MMC1] = RESET(0x84c, BIT(17)),
[RST_BUS_MMC2] = RESET(0x84c, BIT(18)),
--- a/drivers/clk/sunxi/clk_h616.c
+++ b/drivers/clk/sunxi/clk_h616.c
@@ -17,6 +17,10 @@ static struct ccu_clk_gate h616_gates[]
[CLK_APB1] = GATE_DUMMY,
+ [CLK_NAND0] = GATE(0x810, BIT(31)),
+ [CLK_NAND1] = GATE(0x814, BIT(31)),
+ [CLK_BUS_NAND] = GATE(0x82c, BIT(0)),
+
[CLK_BUS_MMC0] = GATE(0x84c, BIT(0)),
[CLK_BUS_MMC1] = GATE(0x84c, BIT(1)),
[CLK_BUS_MMC2] = GATE(0x84c, BIT(2)),
@@ -67,6 +71,8 @@ static struct ccu_clk_gate h616_gates[]
};
static struct ccu_reset h616_resets[] = {
+ [RST_BUS_NAND] = RESET(0x82c, BIT(16)),
+
[RST_BUS_MMC0] = RESET(0x84c, BIT(16)),
[RST_BUS_MMC1] = RESET(0x84c, BIT(17)),
[RST_BUS_MMC2] = RESET(0x84c, BIT(18)),
--- a/drivers/clk/sunxi/clk_r40.c
+++ b/drivers/clk/sunxi/clk_r40.c
@@ -18,6 +18,7 @@ static struct ccu_clk_gate r40_gates[] =
[CLK_BUS_MMC1] = GATE(0x060, BIT(9)),
[CLK_BUS_MMC2] = GATE(0x060, BIT(10)),
[CLK_BUS_MMC3] = GATE(0x060, BIT(11)),
+ [CLK_BUS_NAND] = GATE(0x060, BIT(13)),
[CLK_BUS_SPI0] = GATE(0x060, BIT(20)),
[CLK_BUS_SPI1] = GATE(0x060, BIT(21)),
[CLK_BUS_SPI2] = GATE(0x060, BIT(22)),
@@ -48,6 +49,7 @@ static struct ccu_clk_gate r40_gates[] =
[CLK_BUS_UART6] = GATE(0x06c, BIT(22)),
[CLK_BUS_UART7] = GATE(0x06c, BIT(23)),
+ [CLK_NAND] = GATE(0x080, BIT(31)),
[CLK_SPI0] = GATE(0x0a0, BIT(31)),
[CLK_SPI1] = GATE(0x0a4, BIT(31)),
[CLK_SPI2] = GATE(0x0a8, BIT(31)),
@@ -70,6 +72,7 @@ static struct ccu_reset r40_resets[] = {
[RST_BUS_MMC1] = RESET(0x2c0, BIT(9)),
[RST_BUS_MMC2] = RESET(0x2c0, BIT(10)),
[RST_BUS_MMC3] = RESET(0x2c0, BIT(11)),
+ [RST_BUS_NAND] = RESET(0x2c0, BIT(13)),
[RST_BUS_SPI0] = RESET(0x2c0, BIT(20)),
[RST_BUS_SPI1] = RESET(0x2c0, BIT(21)),
[RST_BUS_SPI2] = RESET(0x2c0, BIT(22)),

View file

@ -1,7 +1,7 @@
From 27834df51087a005b0330f094492b984cc225f6a Mon Sep 17 00:00:00 2001
From f82100d7f3b58014b2642be8f9366f7b11b06a73 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:28:54 -0500
Subject: [PATCH 72/90] env: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
Subject: [PATCH 27/68] env: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
This ensures the same environment layout will be used across all sunxi
boards, regardless of CPU architecture.
@ -13,7 +13,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -92,7 +92,7 @@ config ENV_IS_IN_FAT
@@ -97,7 +97,7 @@ config ENV_IS_IN_FAT
bool "Environment is in a FAT filesystem"
depends on !CHAIN_OF_TRUST
default y if ARCH_BCM283X
@ -22,7 +22,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default y if MMC_OMAP_HS && TI_COMMON_CMD_OPTIONS
select FS_FAT
select FAT_WRITE
@@ -338,7 +338,7 @@ config ENV_IS_IN_SPI_FLASH
@@ -350,7 +350,7 @@ config ENV_IS_IN_SPI_FLASH
default y if NORTHBRIDGE_INTEL_IVYBRIDGE
default y if INTEL_QUARK
default y if INTEL_QUEENSBAY
@ -31,7 +31,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
help
Define this if you have a SPI Flash memory device which you
want to use for the environment.
@@ -461,7 +461,7 @@ config ENV_FAT_DEVICE_AND_PART
@@ -473,7 +473,7 @@ config ENV_FAT_DEVICE_AND_PART
depends on ENV_IS_IN_FAT
default "0:1" if TI_COMMON_CMD_OPTIONS
default "0:auto" if ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
@ -40,7 +40,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default "0" if ARCH_AT91
help
Define this to a string to specify the partition of the device. It can
@@ -555,7 +555,7 @@ config ENV_OFFSET
@@ -567,7 +567,7 @@ config ENV_OFFSET
ENV_IS_IN_SPI_FLASH
default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
@ -49,7 +49,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0xE0000 if ARCH_ZYNQ
default 0x1E00000 if ARCH_ZYNQMP
default 0x7F40000 if ARCH_VERSAL || ARCH_VERSAL_NET
@@ -580,7 +580,7 @@ config ENV_SIZE
@@ -602,7 +602,7 @@ config ENV_SIZE
hex "Environment Size"
default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
@ -58,7 +58,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0x8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
default 0x2000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
default 0x8000 if ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET
@@ -596,7 +596,7 @@ config ENV_SECT_SIZE
@@ -618,7 +618,7 @@ config ENV_SECT_SIZE
default 0x40000 if ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET
default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
default 0x20000 if MICROBLAZE && ENV_IS_IN_SPI_FLASH

View file

@ -1,13 +1,12 @@
From 666d3c2bc058268a976397ec3e258f532edcfeb2 Mon Sep 17 00:00:00 2001
From: Zoltan HERPAI <wigyori@uid0.hu>
Date: Tue, 6 Jun 2023 18:12:11 +0000
Subject: [PATCH 73/90] drivers: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
From bb75b5b2a46a87e6582dc1b48062b77812fb53c1 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:53:23 -0500
Subject: [PATCH 28/68] drivers: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
This provides a unified configuration across all sunxi boards,
regardless of CPU architecture.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
---
drivers/clk/sunxi/Kconfig | 2 +-
drivers/fastboot/Kconfig | 13 ++++++-------
@ -37,7 +36,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
default y
--- a/drivers/fastboot/Kconfig
+++ b/drivers/fastboot/Kconfig
@@ -8,7 +8,7 @@ config FASTBOOT
@@ -15,7 +15,7 @@ config FASTBOOT
config USB_FUNCTION_FASTBOOT
bool "Enable USB fastboot gadget"
depends on USB_GADGET
@ -46,7 +45,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
select FASTBOOT
select USB_GADGET_DOWNLOAD
help
@@ -32,10 +32,9 @@ if FASTBOOT
@@ -46,10 +46,9 @@ if FASTBOOT
config FASTBOOT_BUF_ADDR
hex "Define FASTBOOT buffer address"
@ -58,7 +57,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
default 0x60800800 if ROCKCHIP_RK3036 || ROCKCHIP_RK3188 || \
ROCKCHIP_RK322X
default 0x800800 if ROCKCHIP_RK3288 || ROCKCHIP_RK3329 || \
@@ -52,7 +51,7 @@ config FASTBOOT_BUF_SIZE
@@ -66,7 +65,7 @@ config FASTBOOT_BUF_SIZE
hex "Define FASTBOOT buffer size"
default 0x8000000 if ARCH_ROCKCHIP
default 0x6000000 if ARCH_ZYNQMP
@ -67,7 +66,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
default 0x8192 if SANDBOX
default 0x7000000
help
@@ -71,7 +70,7 @@ config FASTBOOT_USB_DEV
@@ -85,7 +84,7 @@ config FASTBOOT_USB_DEV
config FASTBOOT_FLASH
bool "Enable FASTBOOT FLASH command"
@ -76,7 +75,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS)
select IMAGE_SPARSE
help
@@ -105,8 +104,8 @@ config FASTBOOT_FLASH_MMC_DEV
@@ -120,8 +119,8 @@ config FASTBOOT_FLASH_MMC_DEV
int "Define FASTBOOT MMC FLASH default device"
depends on FASTBOOT_FLASH_MMC
default 0 if ARCH_ROCKCHIP
@ -89,7 +88,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
regarding the non-volatile storage device. Define this to
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -370,7 +370,7 @@ config SANDBOX_GPIO_COUNT
@@ -367,7 +367,7 @@ config SANDBOX_GPIO_COUNT
config SUNXI_GPIO
bool "Allwinner GPIO driver"
@ -100,7 +99,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Support the GPIO device in Allwinner SoCs.
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -756,7 +756,7 @@ config ZYNQ_HISPD_BROKEN
@@ -753,7 +753,7 @@ config ZYNQ_HISPD_BROKEN
config MMC_SUNXI
bool "Allwinner sunxi SD/MMC Host Controller support"
@ -134,11 +133,11 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
#
config PHY_SUN4I_USB
bool "Allwinner Sun4I USB PHY driver"
- depends on ARCH_SUNXI && !MACH_SUN9I
+ depends on depends on BOARD_SUNXI
- depends on ARCH_SUNXI
+ depends on BOARD_SUNXI
depends on !MACH_SUN9I
default n if MACH_SUN8I_V3S
default y
select DM_REGULATOR
select PHY
--- a/drivers/pinctrl/sunxi/Kconfig
+++ b/drivers/pinctrl/sunxi/Kconfig
@@ -1,6 +1,6 @@
@ -162,7 +161,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
This enables support for common reset driver for
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -453,7 +453,7 @@ config SOFT_SPI
@@ -488,7 +488,7 @@ config SPI_SN_F_OSPI
config SPI_SUNXI
bool "Allwinner SoC SPI controllers"
@ -173,7 +172,7 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -116,7 +116,7 @@ config USB_KEYBOARD_FN_KEYS
@@ -158,7 +158,7 @@ config USB_KEYBOARD_FN_KEYS
choice
prompt "USB keyboard polling"
@ -184,34 +183,34 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Enable a polling mechanism for USB keyboard.
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -40,7 +40,7 @@ if USB_GADGET
@@ -47,7 +47,7 @@ if USB_GADGET
config USB_GADGET_MANUFACTURER
string "Vendor name of the USB device"
default "NVIDIA" if ARCH_TEGRA
- default "Allwinner Technology" if ARCH_SUNXI
+ default "Allwinner Technology" if BOARD_SUNXI
default "Rockchip" if ARCH_ROCKCHIP
default "U-Boot"
help
@@ -49,7 +49,7 @@ config USB_GADGET_MANUFACTURER
@@ -57,7 +57,7 @@ config USB_GADGET_MANUFACTURER
config USB_GADGET_VENDOR_NUM
hex "Vendor ID of the USB device"
default 0x0955 if ARCH_TEGRA
- default 0x1f3a if ARCH_SUNXI
+ default 0x1f3a if BOARD_SUNXI
default 0x2207 if ARCH_ROCKCHIP
default 0x0
help
@@ -59,7 +59,7 @@ config USB_GADGET_VENDOR_NUM
@@ -68,7 +68,7 @@ config USB_GADGET_VENDOR_NUM
config USB_GADGET_PRODUCT_NUM
hex "Product ID of the USB device"
default 0x701a if ARCH_TEGRA
- default 0x1010 if ARCH_SUNXI
+ default 0x1010 if BOARD_SUNXI
default 0x310a if ROCKCHIP_RK3036
default 0x300a if ROCKCHIP_RK3066
default 0x310c if ROCKCHIP_RK3128
@@ -202,7 +202,7 @@ endif # USB_GADGET_DOWNLOAD
@@ -215,7 +215,7 @@ endif # USB_GADGET_DOWNLOAD
config USB_ETHER
bool "USB Ethernet Gadget"
depends on NET
@ -228,12 +227,12 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
bool "Enable sunxi OTG / DRC USB controller"
- depends on ARCH_SUNXI
+ depends on BOARD_SUNXI
depends on PHY_SUN4I_USB
select USB_MUSB_PIO_ONLY
default y
---help---
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -183,7 +183,7 @@ config CONSOLE_TRUETYPE_MAX_METRICS
@@ -217,7 +217,7 @@ config CONSOLE_TRUETYPE_MAX_METRICS
config SYS_WHITE_ON_BLACK
bool "Display console as white on a black background"
@ -250,10 +249,10 @@ Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
default 30000 if ARCH_SOCFPGA
- default 16000 if ARCH_SUNXI
+ default 16000 if BOARD_SUNXI
default 5376 if ULP_WATCHDOG
default 15000 if ARCH_BCM283X
default 60000
help
Watchdog timeout in msec
@@ -321,7 +321,7 @@ config WDT_STM32MP
@@ -353,7 +353,7 @@ config WDT_STARFIVE
config WDT_SUNXI
bool "Allwinner sunxi watchdog timer support"

View file

@ -1,120 +0,0 @@
From 7be2405244565973cff0a40196bbed08df90f6a3 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 16 May 2022 00:31:36 -0500
Subject: [PATCH 28/90] pinctrl: sunxi: Add NAND pinmuxes
NAND is always at function 2 on port C.
Pin lists and mux values were taken from the Linux drivers.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -269,6 +269,7 @@ static const struct sunxi_pinctrl_functi
#endif
{ "mmc2", 3 }, /* PC6-PC15 */
{ "mmc3", 2 }, /* PI4-PI9 */
+ { "nand0", 2 }, /* PC0-PC24 */
{ "spi0", 3 }, /* PC0-PC2, PC23 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 4 }, /* PF2-PF4 */
@@ -293,6 +294,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG3-PG8 */
{ "mmc2", 3 }, /* PC6-PC15 */
+ { "nand0", 2 }, /* PC0-PC19 */
{ "spi0", 3 }, /* PC0-PC3 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 4 }, /* PF2-PF4 */
@@ -319,6 +321,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC6-PC15, PC24 */
{ "mmc3", 4 }, /* PC6-PC15, PC24 */
+ { "nand0", 2 }, /* PC0-PC26 */
{ "spi0", 3 }, /* PC0-PC2, PC27 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
@@ -363,6 +366,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc1", 4 }, /* PG0-PG5 */
#endif
{ "mmc2", 3 }, /* PC5-PC15, PC24 */
+ { "nand0", 2 }, /* PC0-PC24 */
{ "spi0", 3 }, /* PC0-PC2, PC23 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 4 }, /* PF2-PF4 */
@@ -386,6 +390,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC5-PC16 */
+ { "nand0", 2 }, /* PC0-PC16 */
{ "spi0", 3 }, /* PC0-PC3 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
@@ -424,6 +429,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC5-PC16 */
+ { "nand0", 2 }, /* PC0-PC16 */
{ "spi0", 3 }, /* PC0-PC3 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
@@ -450,6 +456,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC5-PC16 */
+ { "nand0", 2 }, /* PC0-PC18 */
{ "spi0", 3 }, /* PC0-PC3 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
@@ -491,6 +498,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC5-PC16 */
+ { "nand0", 2 }, /* PC0-PC16 */
{ "spi0", 3 }, /* PC0-PC3 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
@@ -557,6 +565,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC6-PC16 */
+ { "nand0", 2 }, /* PC0-PC18 */
{ "spi0", 3 }, /* PC0-PC2, PC19 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 4 }, /* PF2-PF4 */
@@ -622,6 +631,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC1-PC16 */
+ { "nand0", 2 }, /* PC0-PC16 */
{ "pwm", 2 }, /* PD22 */
{ "spi0", 4 }, /* PC0-PC3 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
@@ -664,6 +674,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC1-PC16 */
+ { "nand0", 2 }, /* PC0-PC16 */
{ "spi0", 3 }, /* PC0-PC3 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
@@ -690,6 +701,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC1-PC14 */
+ { "nand0", 2 }, /* PC0-PC16 */
{ "spi0", 4 }, /* PC0-PC7 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
@@ -728,6 +740,7 @@ static const struct sunxi_pinctrl_functi
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC0-PC16 */
+ { "nand0", 2 }, /* PC0-PC16 */
{ "spi0", 4 }, /* PC0-PC7, PC15-PC16 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */

View file

@ -1,7 +1,7 @@
From 98fb93ceb936b375d7f8f2908f0703a93e27fbc4 Mon Sep 17 00:00:00 2001
From 1cad18bc1db10fe6fad78a0e1261968260722f0c Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Aug 2022 00:05:52 -0500
Subject: [PATCH 74/90] disk: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
Subject: [PATCH 29/68] disk: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
This provides a unified configuration across all sunxi boards,
regardless of CPU architecture.

View file

@ -1,32 +0,0 @@
From 8e793af8598a8429c9dc0f096c72a92adb360a57 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 15 May 2022 21:51:47 -0500
Subject: [PATCH 29/90] mtd: nand: sunxi: Remove an unnecessary check
Each chip is required to have a unique CS number ("reg" property) in the
range 0-7, so there is no need to separately count the number of chips.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/mtd/nand/raw/sunxi_nand.c | 10 ----------
1 file changed, 10 deletions(-)
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -1767,16 +1767,6 @@ static int sunxi_nand_chips_init(int nod
int ret, i = 0;
for (nand_node = fdt_first_subnode(blob, node); nand_node >= 0;
- nand_node = fdt_next_subnode(blob, nand_node))
- i++;
-
- if (i > 8) {
- dev_err(nfc->dev, "too many NAND chips: %d (max = 8)\n", i);
- return -EINVAL;
- }
-
- i = 0;
- for (nand_node = fdt_first_subnode(blob, node); nand_node >= 0;
nand_node = fdt_next_subnode(blob, nand_node)) {
ret = sunxi_nand_chip_init(nand_node, nfc, i++);
if (ret)

View file

@ -1,203 +0,0 @@
From 61b63cbb3526e19a0e299f95a3435a237c7c4b4b Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 15 May 2022 21:54:25 -0500
Subject: [PATCH 30/90] mtd: nand: sunxi: Convert from fdtdec to ofnode
As a first step toward converting this driver to the driver model, use
the ofnode abstraction to replace direct references to the FDT blob.
Using ofnode_read_u32_index removes an extra pair of loops and makes the
allwinner,rb property optional, matching the devicetree binding.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/mtd/nand/raw/sunxi_nand.c | 73 +++++++++++--------------------
include/fdtdec.h | 1 -
lib/fdtdec.c | 1 -
3 files changed, 26 insertions(+), 49 deletions(-)
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -25,11 +25,10 @@
*/
#include <common.h>
-#include <fdtdec.h>
+#include <dm.h>
#include <malloc.h>
#include <memalign.h>
#include <nand.h>
-#include <asm/global_data.h>
#include <dm/device_compat.h>
#include <dm/devres.h>
#include <linux/bitops.h>
@@ -45,8 +44,6 @@
#include <asm/gpio.h>
#include <asm/arch/clock.h>
-DECLARE_GLOBAL_DATA_PTR;
-
#define NFC_REG_CTL 0x0000
#define NFC_REG_ST 0x0004
#define NFC_REG_INT 0x0008
@@ -1605,19 +1602,18 @@ static int sunxi_nand_ecc_init(struct mt
return 0;
}
-static int sunxi_nand_chip_init(int node, struct sunxi_nfc *nfc, int devnum)
+static int sunxi_nand_chip_init(ofnode np, struct sunxi_nfc *nfc, int devnum)
{
const struct nand_sdr_timings *timings;
- const void *blob = gd->fdt_blob;
struct sunxi_nand_chip *chip;
struct mtd_info *mtd;
struct nand_chip *nand;
int nsels;
int ret;
int i;
- u32 cs[8], rb[8];
+ u32 tmp;
- if (!fdt_getprop(blob, node, "reg", &nsels))
+ if (!ofnode_get_property(np, "reg", &nsels))
return -EINVAL;
nsels /= sizeof(u32);
@@ -1638,25 +1634,12 @@ static int sunxi_nand_chip_init(int node
chip->selected = -1;
for (i = 0; i < nsels; i++) {
- cs[i] = -1;
- rb[i] = -1;
- }
-
- ret = fdtdec_get_int_array(gd->fdt_blob, node, "reg", cs, nsels);
- if (ret) {
- dev_err(nfc->dev, "could not retrieve reg property: %d\n", ret);
- return ret;
- }
-
- ret = fdtdec_get_int_array(gd->fdt_blob, node, "allwinner,rb", rb,
- nsels);
- if (ret) {
- dev_err(nfc->dev, "could not retrieve reg property: %d\n", ret);
- return ret;
- }
-
- for (i = 0; i < nsels; i++) {
- int tmp = cs[i];
+ ret = ofnode_read_u32_index(np, "reg", i, &tmp);
+ if (ret) {
+ dev_err(nfc->dev, "could not retrieve reg property: %d\n",
+ ret);
+ return ret;
+ }
if (tmp > NFC_MAX_CS) {
dev_err(nfc->dev,
@@ -1671,15 +1654,14 @@ static int sunxi_nand_chip_init(int node
chip->sels[i].cs = tmp;
- tmp = rb[i];
- if (tmp >= 0 && tmp < 2) {
+ if (!ofnode_read_u32_index(np, "allwinner,rb", i, &tmp) &&
+ tmp < 2) {
chip->sels[i].rb.type = RB_NATIVE;
chip->sels[i].rb.info.nativeid = tmp;
} else {
- ret = gpio_request_by_name_nodev(offset_to_ofnode(node),
- "rb-gpios", i,
- &chip->sels[i].rb.info.gpio,
- GPIOD_IS_IN);
+ ret = gpio_request_by_name_nodev(np, "rb-gpios", i,
+ &chip->sels[i].rb.info.gpio,
+ GPIOD_IS_IN);
if (ret)
chip->sels[i].rb.type = RB_GPIO;
else
@@ -1711,7 +1693,7 @@ static int sunxi_nand_chip_init(int node
* in the DT.
*/
nand->ecc.mode = NAND_ECC_HW;
- nand->flash_node = offset_to_ofnode(node);
+ nand->flash_node = np;
nand->select_chip = sunxi_nfc_select_chip;
nand->cmd_ctrl = sunxi_nfc_cmd_ctrl;
nand->read_buf = sunxi_nfc_read_buf;
@@ -1760,15 +1742,13 @@ static int sunxi_nand_chip_init(int node
return 0;
}
-static int sunxi_nand_chips_init(int node, struct sunxi_nfc *nfc)
+static int sunxi_nand_chips_init(ofnode node, struct sunxi_nfc *nfc)
{
- const void *blob = gd->fdt_blob;
- int nand_node;
+ ofnode nand_np;
int ret, i = 0;
- for (nand_node = fdt_first_subnode(blob, node); nand_node >= 0;
- nand_node = fdt_next_subnode(blob, nand_node)) {
- ret = sunxi_nand_chip_init(nand_node, nfc, i++);
+ ofnode_for_each_subnode(nand_np, node) {
+ ret = sunxi_nand_chip_init(nand_np, nfc, i++);
if (ret)
return ret;
}
@@ -1794,10 +1774,9 @@ static void sunxi_nand_chips_cleanup(str
void sunxi_nand_init(void)
{
- const void *blob = gd->fdt_blob;
struct sunxi_nfc *nfc;
- fdt_addr_t regs;
- int node;
+ phys_addr_t regs;
+ ofnode node;
int ret;
nfc = kzalloc(sizeof(*nfc), GFP_KERNEL);
@@ -1808,18 +1787,18 @@ void sunxi_nand_init(void)
init_waitqueue_head(&nfc->controller.wq);
INIT_LIST_HEAD(&nfc->chips);
- node = fdtdec_next_compatible(blob, 0, COMPAT_SUNXI_NAND);
- if (node < 0) {
+ node = ofnode_by_compatible(ofnode_null(), "allwinner,sun4i-a10-nand");
+ if (!ofnode_valid(node)) {
pr_err("unable to find nfc node in device tree\n");
goto err;
}
- if (!fdtdec_get_is_enabled(blob, node)) {
+ if (!ofnode_is_enabled(node)) {
pr_err("nfc disabled in device tree\n");
goto err;
}
- regs = fdtdec_get_addr(blob, node, "reg");
+ regs = ofnode_get_addr(node);
if (regs == FDT_ADDR_T_NONE) {
pr_err("unable to find nfc address in device tree\n");
goto err;
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -187,7 +187,6 @@ enum fdt_compat_id {
COMPAT_INTEL_BAYTRAIL_FSP, /* Intel Bay Trail FSP */
COMPAT_INTEL_BAYTRAIL_FSP_MDP, /* Intel FSP memory-down params */
COMPAT_INTEL_IVYBRIDGE_FSP, /* Intel Ivy Bridge FSP */
- COMPAT_SUNXI_NAND, /* SUNXI NAND controller */
COMPAT_ALTERA_SOCFPGA_CLK, /* SoCFPGA Clock initialization */
COMPAT_ALTERA_SOCFPGA_PINCTRL_SINGLE, /* SoCFPGA pinctrl-single */
COMPAT_ALTERA_SOCFPGA_H2F_BRG, /* SoCFPGA hps2fpga bridge */
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -64,7 +64,6 @@ static const char * const compat_names[C
COMPAT(INTEL_BAYTRAIL_FSP, "intel,baytrail-fsp"),
COMPAT(INTEL_BAYTRAIL_FSP_MDP, "intel,baytrail-fsp-mdp"),
COMPAT(INTEL_IVYBRIDGE_FSP, "intel,ivybridge-fsp"),
- COMPAT(COMPAT_SUNXI_NAND, "allwinner,sun4i-a10-nand"),
COMPAT(ALTERA_SOCFPGA_CLK, "altr,clk-mgr"),
COMPAT(ALTERA_SOCFPGA_PINCTRL_SINGLE, "pinctrl-single"),
COMPAT(ALTERA_SOCFPGA_H2F_BRG, "altr,socfpga-hps2fpga-bridge"),

View file

@ -1,7 +1,7 @@
From 7f06dca4df9302a22a8d27af887da50a67b7dd1d Mon Sep 17 00:00:00 2001
From c222a0e36919f6529190cfd3e362d25f1c876bf8 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 6 Aug 2022 00:09:38 -0500
Subject: [PATCH 75/90] spl: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
Subject: [PATCH 30/68] spl: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
This provides a unified configuration across all sunxi boards,
regardless of CPU architecture.
@ -23,7 +23,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
config SPL_BSS_START_ADDR
hex "Link address for the BSS within the SPL binary"
@@ -335,7 +335,7 @@ config SPL_SYS_MALLOC_SIMPLE
@@ -349,7 +349,7 @@ config SPL_SYS_MALLOC_SIMPLE
config SPL_SHARES_INIT_SP_ADDR
bool "SPL and U-Boot use the same initial stack pointer location"
depends on (ARM || ARCH_JZ47XX || MICROBLAZE || RISCV) && SPL_FRAMEWORK
@ -32,7 +32,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default y
help
In many cases, we can use the same initial stack pointer address for
@@ -453,7 +453,7 @@ config SPL_DISPLAY_PRINT
@@ -469,7 +469,7 @@ config SPL_DISPLAY_PRINT
config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
bool "MMC raw mode: by sector"
@ -41,7 +41,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
ARCH_MX6 || ARCH_MX7 || \
ARCH_ROCKCHIP || ARCH_MVEBU || ARCH_SOCFPGA || \
ARCH_AT91 || ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
@@ -466,7 +466,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SEC
@@ -482,7 +482,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SEC
config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
hex "Address on the MMC to load U-Boot from"
depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
@ -50,7 +50,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0x75 if ARCH_DAVINCI
default 0x8a if ARCH_MX6 || ARCH_MX7
default 0x100 if ARCH_UNIPHIER
@@ -483,7 +483,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
@@ -499,7 +499,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
config SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET
hex "U-Boot main hardware partition image offset"
depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
@ -59,7 +59,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
default 0x0
help
On some platforms SPL location depends on hardware partition. The ROM
@@ -1308,7 +1308,7 @@ endif # SPL_SPI_FLASH_SUPPORT
@@ -1344,7 +1344,7 @@ endif # SPL_SPI_FLASH_SUPPORT
config SYS_SPI_U_BOOT_OFFS
hex "address of u-boot payload in SPI flash"

View file

@ -1,172 +0,0 @@
From 3411a9a1be9a8d8fef236a81edbce2a1a8218a32 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 16 May 2022 00:16:48 -0500
Subject: [PATCH 31/90] mtd: nand: sunxi: Convert to the driver model
Clocks, resets, and pinmuxes are now handled by the driver model, so the
only thing the "board" code needs to do is load the driver. This matches
the pattern used by other DM raw NAND drivers (there is no NAND uclass).
The actual board code is now only needed in SPL.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
board/sunxi/board.c | 5 +-
drivers/mtd/nand/raw/sunxi_nand.c | 81 ++++++++++++++++++-------------
2 files changed, 49 insertions(+), 37 deletions(-)
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -311,7 +311,7 @@ int dram_init(void)
return 0;
}
-#if defined(CONFIG_NAND_SUNXI)
+#if defined(CONFIG_NAND_SUNXI) && defined(CONFIG_SPL_BUILD)
static void nand_pinmux_setup(void)
{
unsigned int pin;
@@ -347,9 +347,6 @@ void board_nand_init(void)
{
nand_pinmux_setup();
nand_clock_setup();
-#ifndef CONFIG_SPL_BUILD
- sunxi_nand_init();
-#endif
}
#endif /* CONFIG_NAND_SUNXI */
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -24,11 +24,13 @@
* GNU General Public License for more details.
*/
+#include <clk.h>
#include <common.h>
#include <dm.h>
#include <malloc.h>
#include <memalign.h>
#include <nand.h>
+#include <reset.h>
#include <dm/device_compat.h>
#include <dm/devres.h>
#include <linux/bitops.h>
@@ -260,7 +262,7 @@ static inline struct sunxi_nand_chip *to
* NAND Controller structure: stores sunxi NAND controller information
*
* @controller: base controller structure
- * @dev: parent device (used to print error messages)
+ * @dev: DM device (used to print error messages)
* @regs: NAND controller registers
* @ahb_clk: NAND Controller AHB clock
* @mod_clk: NAND Controller mod clock
@@ -273,7 +275,7 @@ static inline struct sunxi_nand_chip *to
*/
struct sunxi_nfc {
struct nand_hw_control controller;
- struct device *dev;
+ struct udevice *dev;
void __iomem *regs;
struct clk *ahb_clk;
struct clk *mod_clk;
@@ -1772,54 +1774,67 @@ static void sunxi_nand_chips_cleanup(str
}
#endif /* __UBOOT__ */
-void sunxi_nand_init(void)
+static int sunxi_nand_probe(struct udevice *dev)
{
- struct sunxi_nfc *nfc;
- phys_addr_t regs;
- ofnode node;
+ struct sunxi_nfc *nfc = dev_get_priv(dev);
+ struct reset_ctl_bulk rst_bulk;
+ struct clk_bulk clk_bulk;
int ret;
- nfc = kzalloc(sizeof(*nfc), GFP_KERNEL);
- if (!nfc)
- return;
-
+ nfc->dev = dev;
spin_lock_init(&nfc->controller.lock);
init_waitqueue_head(&nfc->controller.wq);
INIT_LIST_HEAD(&nfc->chips);
- node = ofnode_by_compatible(ofnode_null(), "allwinner,sun4i-a10-nand");
- if (!ofnode_valid(node)) {
- pr_err("unable to find nfc node in device tree\n");
- goto err;
- }
-
- if (!ofnode_is_enabled(node)) {
- pr_err("nfc disabled in device tree\n");
- goto err;
- }
-
- regs = ofnode_get_addr(node);
- if (regs == FDT_ADDR_T_NONE) {
- pr_err("unable to find nfc address in device tree\n");
- goto err;
- }
+ nfc->regs = dev_read_addr_ptr(dev);
+ if (!nfc->regs)
+ return -EINVAL;
- nfc->regs = (void *)regs;
+ ret = reset_get_bulk(dev, &rst_bulk);
+ if (!ret)
+ reset_deassert_bulk(&rst_bulk);
+
+ ret = clk_get_bulk(dev, &clk_bulk);
+ if (!ret)
+ clk_enable_bulk(&clk_bulk);
ret = sunxi_nfc_rst(nfc);
if (ret)
- goto err;
+ return ret;
- ret = sunxi_nand_chips_init(node, nfc);
+ ret = sunxi_nand_chips_init(dev_ofnode(dev), nfc);
if (ret) {
- dev_err(nfc->dev, "failed to init nand chips\n");
- goto err;
+ dev_err(dev, "failed to init nand chips\n");
+ return ret;
}
- return;
+ return 0;
+}
-err:
- kfree(nfc);
+static const struct udevice_id sunxi_nand_ids[] = {
+ {
+ .compatible = "allwinner,sun4i-a10-nand",
+ },
+ { }
+};
+
+U_BOOT_DRIVER(sunxi_nand) = {
+ .name = "sunxi_nand",
+ .id = UCLASS_MTD,
+ .of_match = sunxi_nand_ids,
+ .probe = sunxi_nand_probe,
+ .priv_auto = sizeof(struct sunxi_nfc),
+};
+
+void board_nand_init(void)
+{
+ struct udevice *dev;
+ int ret;
+
+ ret = uclass_get_device_by_driver(UCLASS_MTD,
+ DM_DRIVER_GET(sunxi_nand), &dev);
+ if (ret && ret != -ENODEV)
+ pr_err("Failed to initialize sunxi NAND controller: %d\n", ret);
}
MODULE_LICENSE("GPL v2");

View file

@ -1,11 +1,12 @@
From 8fde85b609273f8389178d4c0d066390a0e0773d Mon Sep 17 00:00:00 2001
From 0617377a2555031f02a459b3451fa33ce53e9b74 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 30 Oct 2022 14:56:10 -0500
Subject: [PATCH 21/90] serial: ns16550: Enable clocks during probe
Subject: [PATCH 33/68] serial: ns16550: Enable clocks during probe
If the UART bus or baud clock has a gate, it must be enabled before the
UART can be used.
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/serial/ns16550.c | 5 +++++
@ -13,15 +14,15 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -506,6 +506,7 @@ int ns16550_serial_probe(struct udevice
@@ -514,6 +514,7 @@ int ns16550_serial_probe(struct udevice
struct ns16550_plat *plat = dev_get_plat(dev);
struct ns16550 *const com_port = dev_get_priv(dev);
struct reset_ctl_bulk reset_bulk;
+ struct clk_bulk clk_bulk;
fdt_addr_t addr;
fdt_addr_t size;
int ret;
@@ -524,6 +525,10 @@ int ns16550_serial_probe(struct udevice
@@ -533,6 +534,10 @@ int ns16550_serial_probe(struct udevice
if (!ret)
reset_deassert_bulk(&reset_bulk);

View file

@ -1,31 +0,0 @@
From 6fdd7e8d2758f69f5c8e3cb2a0f06da47c1f2cb4 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 17 Apr 2021 14:21:45 -0500
Subject: [PATCH 32/90] sunxi: DT: H6: Add USB3 to Pine H64 DTS
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/dts/sun50i-h6-pine-h64.dts | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/arch/arm/dts/sun50i-h6-pine-h64.dts
+++ b/arch/arm/dts/sun50i-h6-pine-h64.dts
@@ -89,6 +89,10 @@
status = "okay";
};
+&dwc3 {
+ status = "okay";
+};
+
&ehci0 {
status = "okay";
};
@@ -332,3 +336,7 @@
usb3_vbus-supply = <&reg_usb_vbus>;
status = "okay";
};
+
+&usb3phy {
+ status = "okay";
+};

View file

@ -0,0 +1,102 @@
From fa31297e5f79d6eb97aed3cf94326124b308e337 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 22 Jan 2023 11:46:34 -0600
Subject: [PATCH 34/68] sunxi: binman: Move BL31 and SCP firmware addresses to
Kconfig
This is easier to read than the #ifdef staircase, provides better
visibility into the memory map (alongside the other Kconfig
definitions), and allows these addresses to be reused from code.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/dts/sunxi-u-boot.dtsi | 24 +++++++-----------------
arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++++
2 files changed, 24 insertions(+), 17 deletions(-)
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -1,15 +1,5 @@
#include <config.h>
-#ifdef CONFIG_MACH_SUN50I_H6
-#define BL31_ADDR 0x104000
-#define SCP_ADDR 0x114000
-#elif defined(CONFIG_MACH_SUN50I_H616)
-#define BL31_ADDR 0x40000000
-#else
-#define BL31_ADDR 0x44000
-#define SCP_ADDR 0x50000
-#endif
-
/ {
aliases {
mmc0 = &mmc0;
@@ -69,8 +59,8 @@
os = "arm-trusted-firmware";
arch = "arm64";
compression = "none";
- load = <BL31_ADDR>;
- entry = <BL31_ADDR>;
+ load = <CONFIG_SUNXI_BL31_BASE>;
+ entry = <CONFIG_SUNXI_BL31_BASE>;
atf-bl31 {
filename = "bl31.bin";
@@ -78,13 +68,13 @@
};
};
-#ifdef SCP_ADDR
+#if CONFIG_SUNXI_SCP_BASE
scp {
description = "SCP firmware";
type = "firmware";
arch = "or1k";
compression = "none";
- load = <SCP_ADDR>;
+ load = <CONFIG_SUNXI_SCP_BASE>;
scp {
filename = "scp.bin";
@@ -106,10 +96,10 @@
@config-SEQ {
description = "NAME";
firmware = "atf";
-#ifndef SCP_ADDR
- loadables = "uboot";
-#else
+#if CONFIG_SUNXI_SCP_BASE
loadables = "scp", "uboot";
+#else
+ loadables = "uboot";
#endif
fdt = "fdt-SEQ";
};
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -147,6 +147,23 @@ config SUNXI_RVBAR_ALTERNATIVE
for all other SoCs, so the content of the SRAM_VER_REG becomes
irrelevant there, and we can use the same code.
+config SUNXI_BL31_BASE
+ hex
+ default 0x00044000 if MACH_SUN50I || MACH_SUN50I_H5
+ default 0x00104000 if MACH_SUN50I_H6
+ default 0x40000000 if MACH_SUN50I_H616
+ default 0x0
+ help
+ Address where BL31 (TF-A) is loaded, or zero if BL31 is not used.
+
+config SUNXI_SCP_BASE
+ hex
+ default 0x00050000 if MACH_SUN50I || MACH_SUN50I_H5
+ default 0x00114000 if MACH_SUN50I_H6
+ default 0x0
+ help
+ Address where SCP firmware is loaded, or zero if it is not used.
+
config SUNXI_A64_TIMER_ERRATUM
bool

View file

@ -0,0 +1,90 @@
From 50ec5566a9eb50288c7aca9d85182e152aaf47d9 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 22 Jan 2023 11:57:42 -0600
Subject: [PATCH 35/68] sunxi: binman: Support FIT generation for 32-bit SoCs
Some 32-bit SoCs can use SCP firmware to implement additional PSCI
functionality, such as system suspend. In order to load this firmware
from SPL, we need to generate and use a FIT instead of a legacy image.
Adjust the binman FIT definition so it does not rely on TF-A BL31, as
this is not used on 32-bit SoCs. Instead, after loading the firmware,
U-Boot proper is executed directly.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/dts/sunxi-u-boot.dtsi | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -1,5 +1,11 @@
#include <config.h>
+#ifdef CONFIG_ARM64
+#define ARCH "arm64"
+#else
+#define ARCH "arm"
+#endif
+
/ {
aliases {
mmc0 = &mmc0;
@@ -34,30 +40,32 @@
filename = "spl/sunxi-spl.bin";
};
-#ifdef CONFIG_ARM64
+#ifdef CONFIG_SPL_LOAD_FIT
fit {
- description = "Configuration to load ATF before U-Boot";
+ description = "Configuration to load U-Boot and firmware";
#address-cells = <1>;
fit,fdt-list = "of-list";
images {
uboot {
- description = "U-Boot (64-bit)";
+ description = "U-Boot";
type = "standalone";
os = "u-boot";
- arch = "arm64";
+ arch = ARCH;
compression = "none";
load = <CONFIG_TEXT_BASE>;
+ entry = <CONFIG_TEXT_BASE>;
u-boot-nodtb {
};
};
+#if CONFIG_SUNXI_BL31_BASE
atf {
description = "ARM Trusted Firmware";
type = "firmware";
os = "arm-trusted-firmware";
- arch = "arm64";
+ arch = ARCH;
compression = "none";
load = <CONFIG_SUNXI_BL31_BASE>;
entry = <CONFIG_SUNXI_BL31_BASE>;
@@ -67,6 +75,7 @@
missing-msg = "atf-bl31-sunxi";
};
};
+#endif
#if CONFIG_SUNXI_SCP_BASE
scp {
@@ -95,7 +104,11 @@
@config-SEQ {
description = "NAME";
+#if CONFIG_SUNXI_BL31_BASE
firmware = "atf";
+#else
+ firmware = "uboot";
+#endif
#if CONFIG_SUNXI_SCP_BASE
loadables = "scp", "uboot";
#else

View file

@ -1,441 +0,0 @@
From ff0e952a3a380ba191375d5f68609cdbe026d535 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 7 Aug 2021 19:55:20 -0500
Subject: [PATCH 33/90] tools: mkimage: Add Allwinner TOC1 support
TOC1 is an container format used by Allwinner's boot0 that can hold
multiple images. It supports encryption and signatures, but that
functionality is not implemented, only the basic "non-secure" subset.
A config file is used to provide the list of data files to include. Its
path is passed as the argument to "-d". It contains sections of the
following form:
[name]
file = /path/to/file
addr = 0x12345678
Specific well-known names, such as "dtb", "opensbi", and "u-boot", are
used by the bootloader to distinguish the items inside the image.
Cover-letter:
tools: mkimage: Add Allwinner TOC1 support
The SPL port for the Allwinner D1 RISC-V SoC will probably take a while
longer than porting U-Boot proper, as none of the relevant drivers are
set up for DM in SPL. In the meantime, we are using[1][2] a fork[3] of
Allwinner's boot0 loader, which they also call "spl" in their BSP. boot0
uses this TOC1 image format.
The vendor tools for generating TOC1 images require a binary config file
generated by their FEX compiler. Instead of trying to support that, I
made up a simple human-readable config file format. I didn't see any
existing platform-agnostic parser for multi-image containers in mkimage.
I am sending this as RFC because it is only of temporary/limited use.
It only works with one specific fork of boot0 which was modified to
"behave" (the the original vendor version monkey-patches a custom header
inside the U-Boot image during boot). So it will be obsolete once U-Boot
SPL is ported. And it is Yet Another Image Format. On the other hand, it
does work, and it is currently being used.
[1]: https://linux-sunxi.org/Allwinner_Nezha#U-Boot
[2]: https://fedoraproject.org/wiki/Architectures/RISC-V/Allwinner
[3]: https://github.com/smaeul/sun20i_d1_spl
END
Series-prefix: RFC
Series-to: sunxi
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
boot/image.c | 1 +
include/image.h | 1 +
include/sunxi_image.h | 26 ++++
tools/Makefile | 1 +
tools/sunxi_toc1.c | 318 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 347 insertions(+)
create mode 100644 tools/sunxi_toc1.c
--- a/boot/image.c
+++ b/boot/image.c
@@ -180,6 +180,7 @@ static const table_entry_t uimage_type[]
{ IH_TYPE_COPRO, "copro", "Coprocessor Image"},
{ IH_TYPE_SUNXI_EGON, "sunxi_egon", "Allwinner eGON Boot Image" },
{ IH_TYPE_SUNXI_TOC0, "sunxi_toc0", "Allwinner TOC0 Boot Image" },
+ { IH_TYPE_SUNXI_TOC1, "sunxi_toc1", "Allwinner TOC1 Boot Image" },
{ -1, "", "", },
};
--- a/include/image.h
+++ b/include/image.h
@@ -229,6 +229,7 @@ enum image_type_t {
IH_TYPE_COPRO, /* Coprocessor Image for remoteproc*/
IH_TYPE_SUNXI_EGON, /* Allwinner eGON Boot Image */
IH_TYPE_SUNXI_TOC0, /* Allwinner TOC0 Boot Image */
+ IH_TYPE_SUNXI_TOC1, /* Allwinner TOC1 Boot Image */
IH_TYPE_COUNT, /* Number of image types */
};
--- a/include/sunxi_image.h
+++ b/include/sunxi_image.h
@@ -116,4 +116,30 @@ struct __packed toc0_item_info {
#define TOC0_ITEM_INFO_NAME_KEY 0x00010303
#define TOC0_ITEM_INFO_END "IIE;"
+struct __packed toc1_main_info {
+ uint8_t name[16];
+ __le32 magic;
+ __le32 checksum;
+ __le32 serial;
+ __le32 status;
+ __le32 num_items;
+ __le32 length;
+ __le32 major_version;
+ __le32 minor_version;
+ __le32 reserved[3];
+ uint8_t end[4];
+};
+
+struct __packed toc1_item_info {
+ uint8_t name[64];
+ __le32 offset;
+ __le32 length;
+ __le32 encryption;
+ __le32 type;
+ __le32 load_addr;
+ __le32 index;
+ __le32 reserved[69];
+ uint8_t end[4];
+};
+
#endif
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -132,6 +132,7 @@ dumpimage-mkimage-objs := aisimage.o \
$(ROCKCHIP_OBS) \
socfpgaimage.o \
sunxi_egon.o \
+ sunxi_toc1.o \
lib/crc16-ccitt.o \
lib/hash-checksum.o \
lib/sha1.o \
--- /dev/null
+++ b/tools/sunxi_toc1.c
@@ -0,0 +1,318 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2018 Arm Ltd.
+ * (C) Copyright 2020-2021 Samuel Holland <samuel@sholland.org>
+ */
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <image.h>
+#include <sunxi_image.h>
+
+#include "imagetool.h"
+#include "mkimage.h"
+
+#define SECTOR_SIZE 512
+
+struct item_desc {
+ const char *name;
+ const char *file;
+ unsigned long addr;
+ long length;
+};
+
+static uint32_t toc1_header_length(uint32_t num_items)
+{
+ return ALIGN(sizeof(struct toc1_main_info) +
+ sizeof(struct toc1_item_info) * num_items, SECTOR_SIZE);
+}
+
+static int toc1_parse_cfg(const char *file, struct item_desc **desc,
+ uint32_t *main_length, uint32_t *num_items)
+{
+ struct item_desc *descs = NULL;
+ int ret = EXIT_FAILURE;
+ FILE *cfg, *fp = NULL;
+ uint32_t ndescs = 0;
+ char *line = NULL;
+ size_t len = 0;
+
+ *desc = NULL;
+ *main_length = 0;
+ *num_items = 0;
+
+ cfg = fopen(file, "r");
+ if (!cfg)
+ return ret;
+
+ while (getline(&line, &len, cfg) > 0) {
+ char *end, *s;
+
+ if (line[0] == '[') {
+ s = line + 1;
+ end = strchr(s, ']');
+ if (!end || end[1] != '\n')
+ goto err;
+ end[0] = '\0';
+
+ ndescs++;
+ descs = reallocarray(descs, ndescs, sizeof(*descs));
+ if (!descs)
+ goto err;
+
+ descs[ndescs - 1].name = strdup(s);
+ } else if (line[0] != '#' && line[0] != '\n') {
+ s = strchr(line, '=');
+ if (!s)
+ goto err;
+ while ((++s)[0] == ' ')
+ ;
+ end = strchr(s, '\n');
+ if (!end)
+ goto err;
+ end[0] = '\0';
+
+ if (!strncmp(line, "file", strlen("file"))) {
+ fp = fopen(s, "rb");
+ if (!fp)
+ goto err;
+ if (fseek(fp, 0, SEEK_END) < 0)
+ goto err;
+ descs[ndescs - 1].file = strdup(s);
+ descs[ndescs - 1].length = ftell(fp);
+ *main_length += ALIGN(descs[ndescs - 1].length,
+ SECTOR_SIZE);
+ fclose(fp);
+ fp = NULL;
+ } else if (!strncmp(line, "addr", strlen("addr"))) {
+ descs[ndescs - 1].addr = strtoul(s, NULL, 0);
+ } else {
+ goto err;
+ }
+ }
+ }
+
+ *desc = descs;
+ *main_length += toc1_header_length(ndescs);
+ *num_items = ndescs;
+
+ ret = EXIT_SUCCESS;
+
+err:
+ if (fp)
+ fclose(fp);
+ if (ret)
+ free(descs);
+ free(line);
+ fclose(cfg);
+
+ return ret;
+}
+
+static int toc1_create(uint8_t *buf, uint32_t len,
+ const struct item_desc *desc, uint32_t num_items)
+{
+ struct toc1_main_info *main = (void *)buf;
+ struct toc1_item_info *item = (void *)(main + 1);
+ uint32_t item_offset, item_length;
+ uint32_t *buf32 = (void *)buf;
+ int ret = EXIT_FAILURE;
+ uint32_t checksum = 0;
+ FILE *fp = NULL;
+ int i;
+
+ /* Create the main TOC1 header. */
+ main->magic = cpu_to_le32(TOC0_MAIN_INFO_MAGIC);
+ main->checksum = cpu_to_le32(BROM_STAMP_VALUE);
+ main->num_items = cpu_to_le32(num_items);
+ memcpy(main->end, TOC0_MAIN_INFO_END, sizeof(main->end));
+
+ item_offset = 0;
+ item_length = toc1_header_length(num_items);
+
+ for (i = 0; i < num_items; ++i, ++item, ++desc) {
+ item_offset = item_offset + item_length;
+ item_length = desc->length;
+
+ /* Create the item header. */
+ memcpy(item->name, desc->name,
+ strnlen(desc->name, sizeof(item->name)));
+ item->offset = cpu_to_le32(item_offset);
+ item->length = cpu_to_le32(item_length);
+ item->load_addr = cpu_to_le32(desc->addr);
+ memcpy(item->end, TOC0_ITEM_INFO_END, sizeof(item->end));
+
+ /* Read in the data. */
+ fp = fopen(desc->file, "rb");
+ if (!fp)
+ goto err;
+ if (!fread(buf + item_offset, item_length, 1, fp))
+ goto err;
+ fclose(fp);
+ fp = NULL;
+
+ /* Pad the sectors with 0xff to be flash-friendly. */
+ item_offset = item_offset + item_length;
+ item_length = ALIGN(item_offset, SECTOR_SIZE) - item_offset;
+ memset(buf + item_offset, 0xff, item_length);
+ }
+
+ /* Fill in the total padded file length. */
+ item_offset = item_offset + item_length;
+ main->length = cpu_to_le32(item_offset);
+
+ /* Verify enough space was provided when creating the image. */
+ assert(len >= item_offset);
+
+ /* Calculate the checksum. Yes, it's that simple. */
+ for (i = 0; i < item_offset / 4; ++i)
+ checksum += le32_to_cpu(buf32[i]);
+ main->checksum = cpu_to_le32(checksum);
+
+ ret = EXIT_SUCCESS;
+
+err:
+ if (fp)
+ fclose(fp);
+
+ return ret;
+}
+
+static int toc1_verify(const uint8_t *buf, uint32_t len)
+{
+ const struct toc1_main_info *main = (void *)buf;
+ const struct toc1_item_info *item = (void *)(main + 1);
+ uint32_t checksum = BROM_STAMP_VALUE;
+ uint32_t main_length, num_items;
+ uint32_t *buf32 = (void *)buf;
+ int ret = EXIT_FAILURE;
+ int i;
+
+ num_items = le32_to_cpu(main->num_items);
+ main_length = le32_to_cpu(main->length);
+
+ if (len < main_length || main_length < toc1_header_length(num_items))
+ goto err;
+
+ /* Verify the main header. */
+ if (le32_to_cpu(main->magic) != TOC0_MAIN_INFO_MAGIC)
+ goto err;
+ /* Verify the checksum without modifying the buffer. */
+ for (i = 0; i < main_length / 4; ++i)
+ checksum += le32_to_cpu(buf32[i]);
+ if (checksum != 2 * le32_to_cpu(main->checksum))
+ goto err;
+ /* The length must be at least 512 byte aligned. */
+ if (main_length % SECTOR_SIZE)
+ goto err;
+ if (memcmp(main->end, TOC0_MAIN_INFO_END, sizeof(main->end)))
+ goto err;
+
+ /* Verify each item header. */
+ for (i = 0; i < num_items; ++i, ++item)
+ if (memcmp(item->end, TOC0_ITEM_INFO_END, sizeof(item->end)))
+ goto err;
+
+ ret = EXIT_SUCCESS;
+
+err:
+ return ret;
+}
+
+static int toc1_check_params(struct image_tool_params *params)
+{
+ if (!params->dflag)
+ return -EINVAL;
+
+ return 0;
+}
+
+static int toc1_verify_header(unsigned char *buf, int image_size,
+ struct image_tool_params *params)
+{
+ return toc1_verify(buf, image_size);
+}
+
+static void toc1_print_header(const void *buf)
+{
+ const struct toc1_main_info *main = buf;
+ const struct toc1_item_info *item = (void *)(main + 1);
+ uint32_t head_length, main_length, num_items;
+ uint32_t item_offset, item_length, item_addr;
+ int i;
+
+ num_items = le32_to_cpu(main->num_items);
+ head_length = sizeof(*main) + num_items * sizeof(*item);
+ main_length = le32_to_cpu(main->length);
+
+ printf("Allwinner TOC1 Image\n"
+ "Size: %d bytes\n"
+ "Contents: %d items\n"
+ " 00000000:%08x Headers\n",
+ main_length, num_items, head_length);
+
+ for (i = 0; i < num_items; ++i, ++item) {
+ item_offset = le32_to_cpu(item->offset);
+ item_length = le32_to_cpu(item->length);
+ item_addr = le32_to_cpu(item->load_addr);
+
+ printf(" %08x:%08x => %08x %s\n",
+ item_offset, item_length, item_addr, item->name);
+ }
+}
+
+static void toc1_set_header(void *buf, struct stat *sbuf, int ifd,
+ struct image_tool_params *params)
+{
+ /* Image is already written below. */
+}
+
+static int toc1_check_image_type(uint8_t type)
+{
+ return type == IH_TYPE_SUNXI_TOC1 ? 0 : 1;
+}
+
+static int toc1_vrec_header(struct image_tool_params *params,
+ struct image_type_params *tparams)
+{
+ uint32_t main_length, num_items;
+ struct item_desc *desc;
+ int ret;
+
+ /* This "header" contains the entire image. */
+ params->skipcpy = 1;
+
+ ret = toc1_parse_cfg(params->datafile, &desc, &main_length, &num_items);
+ if (ret)
+ exit(ret);
+
+ tparams->header_size = main_length;
+ tparams->hdr = calloc(tparams->header_size, 1);
+ if (!tparams->hdr)
+ exit(ret);
+
+ ret = toc1_create(tparams->hdr, tparams->header_size, desc, num_items);
+ if (ret)
+ exit(ret);
+
+ return 0;
+}
+
+U_BOOT_IMAGE_TYPE(
+ sunxi_toc1,
+ "Allwinner TOC1 Boot Image support",
+ 0,
+ NULL,
+ toc1_check_params,
+ toc1_verify_header,
+ toc1_print_header,
+ toc1_set_header,
+ NULL,
+ toc1_check_image_type,
+ NULL,
+ toc1_vrec_header
+);

View file

@ -1,33 +0,0 @@
From 79f7d883d980beea9989d06f9fba4fcc0430176a Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 14 Jul 2022 22:14:38 -0500
Subject: [PATCH 34/90] phy: sun4i-usb: Do not drive VBUS with external VBUS
present
It is possible to use host-side USB with externally-provided VBUS. For
example, some USB OTG cables have an extra power input which powers
both the board and the USB peripheral.
To support this setup, skip enabling the VBUS switch/regulator if VBUS
voltage is already present. This behavior matches the Linux PHY driver.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -220,6 +220,12 @@ static int sun4i_usb_phy_power_on(struct
initial_usb_scan_delay = 0;
}
+ /* For phy0 only turn on Vbus if we don't have an ext. Vbus */
+ if (phy->id == 0 && sun4i_usb_phy_vbus_detect(phy)) {
+ dev_warn(phy->dev, "External vbus detected, not enabling our own vbus\n");
+ return 0;
+ }
+
if (usb_phy->vbus) {
ret = regulator_set_enable(usb_phy->vbus, true);
if (ret && ret != -ENOSYS)

View file

@ -0,0 +1,38 @@
From 11b7f4963a4e87ca2c71a8e9c9767b82b024508b Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sun, 22 Jan 2023 12:19:10 -0600
Subject: [PATCH 36/68] sunxi: Enable SPL FIT loading for 32-bit SoCs
Now that 32-bit SoCs can load U-Boot proper (and possibly other
firmware) from a FIT, use this method by default. SPL_FIT_IMAGE_TINY is
required to stay within the 24 or 32 KiB SPL size limit on early SoCs;
for consistency, enable it everywhere.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/Kconfig | 1 +
common/spl/Kconfig | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -35,6 +35,7 @@ config BOARD_SUNXI
imply SPL_GPIO
imply SPL_LIBCOMMON_SUPPORT
imply SPL_LIBGENERIC_SUPPORT
+ imply SPL_LOAD_FIT
imply SPL_MMC if MMC
imply SPL_POWER
imply SPL_SERIAL
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -562,8 +562,7 @@ config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PART
config SPL_FIT_IMAGE_TINY
bool "Remove functionality from SPL FIT loading to reduce size"
depends on SPL_FIT
- default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6
- default y if ARCH_IMX8M || ARCH_IMX9
+ default y if ARCH_IMX8M || ARCH_IMX9 || ARCH_SUNXI
help
Enable this to reduce the size of the FIT image loading code
in SPL, if space for the SPL binary is very tight.

View file

@ -1,163 +0,0 @@
From 4bc5cec5361dd6a2ae3bd044c79a4b5227bb9627 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 16 May 2022 00:47:32 -0500
Subject: [PATCH 35/90] mtd: nand: sunxi: Pass the device to the init function
This more closely matches the U-Boot driver to the Linux version.
Series-to: sunxi
Cover-letter:
mtd: nand: sunxi: Convert to devicetree and the driver model
This series converts the sunxi NAND driver to get its resources (clocks,
resets, pins) from the devicetree, and probe using the driver model.
In addition to the immediate cleanup, this allows backporting more
patches (bugfixes, newer SoC support) from the Linux driver.
END
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/mtd/nand/raw/sunxi_nand.c | 39 ++++++++++++++++---------------
1 file changed, 20 insertions(+), 19 deletions(-)
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -1604,7 +1604,8 @@ static int sunxi_nand_ecc_init(struct mt
return 0;
}
-static int sunxi_nand_chip_init(ofnode np, struct sunxi_nfc *nfc, int devnum)
+static int sunxi_nand_chip_init(struct udevice *dev, struct sunxi_nfc *nfc,
+ ofnode np, int devnum)
{
const struct nand_sdr_timings *timings;
struct sunxi_nand_chip *chip;
@@ -1620,7 +1621,7 @@ static int sunxi_nand_chip_init(ofnode n
nsels /= sizeof(u32);
if (!nsels || nsels > 8) {
- dev_err(nfc->dev, "invalid reg property size\n");
+ dev_err(dev, "invalid reg property size\n");
return -EINVAL;
}
@@ -1628,7 +1629,7 @@ static int sunxi_nand_chip_init(ofnode n
(nsels * sizeof(struct sunxi_nand_chip_sel)),
GFP_KERNEL);
if (!chip) {
- dev_err(nfc->dev, "could not allocate chip\n");
+ dev_err(dev, "could not allocate chip\n");
return -ENOMEM;
}
@@ -1638,19 +1639,19 @@ static int sunxi_nand_chip_init(ofnode n
for (i = 0; i < nsels; i++) {
ret = ofnode_read_u32_index(np, "reg", i, &tmp);
if (ret) {
- dev_err(nfc->dev, "could not retrieve reg property: %d\n",
+ dev_err(dev, "could not retrieve reg property: %d\n",
ret);
return ret;
}
if (tmp > NFC_MAX_CS) {
- dev_err(nfc->dev,
+ dev_err(dev,
"invalid reg value: %u (max CS = 7)\n", tmp);
return -EINVAL;
}
if (test_and_set_bit(tmp, &nfc->assigned_cs)) {
- dev_err(nfc->dev, "CS %d already assigned\n", tmp);
+ dev_err(dev, "CS %d already assigned\n", tmp);
return -EINVAL;
}
@@ -1661,9 +1662,9 @@ static int sunxi_nand_chip_init(ofnode n
chip->sels[i].rb.type = RB_NATIVE;
chip->sels[i].rb.info.nativeid = tmp;
} else {
- ret = gpio_request_by_name_nodev(np, "rb-gpios", i,
- &chip->sels[i].rb.info.gpio,
- GPIOD_IS_IN);
+ ret = gpio_request_by_name(dev, "rb-gpios", i,
+ &chip->sels[i].rb.info.gpio,
+ GPIOD_IS_IN);
if (ret)
chip->sels[i].rb.type = RB_GPIO;
else
@@ -1674,7 +1675,7 @@ static int sunxi_nand_chip_init(ofnode n
timings = onfi_async_timing_mode_to_sdr_timings(0);
if (IS_ERR(timings)) {
ret = PTR_ERR(timings);
- dev_err(nfc->dev,
+ dev_err(dev,
"could not retrieve timings for ONFI mode 0: %d\n",
ret);
return ret;
@@ -1682,7 +1683,7 @@ static int sunxi_nand_chip_init(ofnode n
ret = sunxi_nand_chip_set_timings(nfc, chip, timings);
if (ret) {
- dev_err(nfc->dev, "could not configure chip timings: %d\n", ret);
+ dev_err(dev, "could not configure chip timings: %d\n", ret);
return ret;
}
@@ -1717,25 +1718,25 @@ static int sunxi_nand_chip_init(ofnode n
ret = sunxi_nand_chip_init_timings(nfc, chip);
if (ret) {
- dev_err(nfc->dev, "could not configure chip timings: %d\n", ret);
+ dev_err(dev, "could not configure chip timings: %d\n", ret);
return ret;
}
ret = sunxi_nand_ecc_init(mtd, &nand->ecc);
if (ret) {
- dev_err(nfc->dev, "ECC init failed: %d\n", ret);
+ dev_err(dev, "ECC init failed: %d\n", ret);
return ret;
}
ret = nand_scan_tail(mtd);
if (ret) {
- dev_err(nfc->dev, "nand_scan_tail failed: %d\n", ret);
+ dev_err(dev, "nand_scan_tail failed: %d\n", ret);
return ret;
}
ret = nand_register(devnum, mtd);
if (ret) {
- dev_err(nfc->dev, "failed to register mtd device: %d\n", ret);
+ dev_err(dev, "failed to register mtd device: %d\n", ret);
return ret;
}
@@ -1744,13 +1745,13 @@ static int sunxi_nand_chip_init(ofnode n
return 0;
}
-static int sunxi_nand_chips_init(ofnode node, struct sunxi_nfc *nfc)
+static int sunxi_nand_chips_init(struct udevice *dev, struct sunxi_nfc *nfc)
{
ofnode nand_np;
int ret, i = 0;
- ofnode_for_each_subnode(nand_np, node) {
- ret = sunxi_nand_chip_init(nand_np, nfc, i++);
+ dev_for_each_subnode(nand_np, dev) {
+ ret = sunxi_nand_chip_init(dev, nfc, nand_np, i++);
if (ret)
return ret;
}
@@ -1802,7 +1803,7 @@ static int sunxi_nand_probe(struct udevi
if (ret)
return ret;
- ret = sunxi_nand_chips_init(dev_ofnode(dev), nfc);
+ ret = sunxi_nand_chips_init(dev, nfc);
if (ret) {
dev_err(dev, "failed to init nand chips\n");
return ret;

View file

@ -1,60 +1,65 @@
From 25434a394705d2de92c50981e31347db4074204a Mon Sep 17 00:00:00 2001
From 967499870f79fb2f0cfa006186d44ba1330eb2e2 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 26 Aug 2021 21:32:15 -0500
Subject: [PATCH 07/90] power: regulator: Add a driver for the AXP PMIC
Subject: [PATCH 43/68] power: regulator: Add a driver for the AXP PMIC
drivevbus
The first AXP regulator converted to use the regulator uclass is the
drivevbus switch, since it is used by the USB PHY driver.
AXP PMICs have a pin which can either report the USB VBUS state, or
driving a regulator that supplies USB VBUS. Add a regulator driver for
controlling this pin. The selection between input and output is done via
the x-powers,drive-vbus-en pin on the PMIC (parent) node.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/power/regulator/Kconfig | 14 ++++++
drivers/power/pmic/axp.c | 1 +
drivers/power/regulator/Kconfig | 7 +++
drivers/power/regulator/Makefile | 1 +
drivers/power/regulator/axp_regulator.c | 58 +++++++++++++++++++++++++
3 files changed, 73 insertions(+)
create mode 100644 drivers/power/regulator/axp_regulator.c
drivers/power/regulator/axp_drivevbus.c | 57 +++++++++++++++++++++++++
4 files changed, 66 insertions(+)
create mode 100644 drivers/power/regulator/axp_drivevbus.c
--- a/drivers/power/pmic/axp.c
+++ b/drivers/power/pmic/axp.c
@@ -51,6 +51,7 @@ static const struct pmic_child_info axp_
{ "cldo", "axp_regulator" },
{ "dc", "axp_regulator" },
{ "dldo", "axp_regulator" },
+ { "drivevbus", "axp_drivevbus" },
{ "eldo", "axp_regulator" },
{ "fldo", "axp_regulator" },
{ "ldo", "axp_regulator" },
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -43,6 +43,20 @@ config REGULATOR_AS3722
but does not yet support change voltages. Currently this must be
done using direct register writes to the PMIC.
@@ -57,6 +57,13 @@ config SPL_REGULATOR_AXP
Enable support in SPL for the regulators (DCDCs, LDOs) in the
X-Powers AXP152, AXP2xx, and AXP8xx PMICs.
+config REGULATOR_AXP
+ bool "Enable driver for X-Powers AXP PMIC regulators"
+config REGULATOR_AXP_DRIVEVBUS
+ bool "Enable driver for X-Powers AXP PMIC drivevbus"
+ depends on DM_REGULATOR && PMIC_AXP
+ help
+ Enable support for the regulators (DCDCs, LDOs) in the
+ X-Powers AXP152, AXP2xx, and AXP8xx PMICs.
+
+config SPL_REGULATOR_AXP
+ bool "Enable driver for X-Powers AXP PMIC regulators in SPL"
+ depends on SPL_DM_REGULATOR && SPL_PMIC_AXP
+ help
+ Enable support in SPL for the regulators (DCDCs, LDOs) in the
+ X-Powers AXP152, AXP2xx, and AXP8xx PMICs.
+ Enable support for sensing or driving the USB VBUS on
+ X-Powers AXP2xx and AXP8xx PMICs.
+
config REGULATOR_AXP_USB_POWER
bool "Enable driver for X-Powers AXP PMIC USB power supply"
depends on DM_REGULATOR && PMIC_AXP
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -7,6 +7,7 @@
obj-$(CONFIG_$(SPL_)DM_REGULATOR) += regulator-uclass.o
@@ -8,6 +8,7 @@ obj-$(CONFIG_$(SPL_)DM_REGULATOR) += reg
obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
obj-$(CONFIG_REGULATOR_AS3722) += as3722_regulator.o
+obj-$(CONFIG_$(SPL_)REGULATOR_AXP) += axp_regulator.o
obj-$(CONFIG_$(SPL_)REGULATOR_AXP) += axp_regulator.o
+obj-$(CONFIG_$(SPL_)REGULATOR_AXP_DRIVEVBUS) += axp_drivevbus.o
obj-$(CONFIG_$(SPL_)REGULATOR_AXP_USB_POWER) += axp_usb_power.o
obj-$(CONFIG_$(SPL_)DM_REGULATOR_DA9063) += da9063.o
obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
obj-$(CONFIG_$(SPL_)DM_REGULATOR_MAX77663) += max77663_regulator.o
--- /dev/null
+++ b/drivers/power/regulator/axp_regulator.c
@@ -0,0 +1,58 @@
+++ b/drivers/power/regulator/axp_drivevbus.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <dm.h>
+#include <errno.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+

View file

@ -1,120 +0,0 @@
From b13140a914199dcdd80331fef6f33d47f008f1b4 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 5 Aug 2022 23:40:22 -0500
Subject: [PATCH 36/90] sunxi: Enable PHY_SUN4I_USB by default for new SoCs
With one exception (sun9i), all sunxi SoCs released to date use variants
of the same USB PHY. Instead of requiring each new SoC to duplicate the
PHY driver selection, enable it by default.
Series-to: Andre Przywara <andre.przywara@arm.com>
Series-to: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/mach-sunxi/Kconfig | 11 -----------
drivers/phy/allwinner/Kconfig | 3 ++-
2 files changed, 2 insertions(+), 12 deletions(-)
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -162,7 +162,6 @@ endif
config MACH_SUNXI_H3_H5
bool
- select PHY_SUN4I_USB
select SUNXI_DE2
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
@@ -191,7 +190,6 @@ config MACH_SUNIV
config MACH_SUN4I
bool "sun4i (Allwinner A10)"
select CPU_V7A
- select PHY_SUN4I_USB
select DRAM_SUN4I
select SUNXI_GEN_SUN4I
select SUPPORT_SPL
@@ -202,7 +200,6 @@ config MACH_SUN5I
bool "sun5i (Allwinner A13)"
select CPU_V7A
select DRAM_SUN4I
- select PHY_SUN4I_USB
select SUNXI_GEN_SUN4I
select SUPPORT_SPL
imply SPL_SYS_I2C_LEGACY
@@ -216,7 +213,6 @@ config MACH_SUN6I
select ARCH_SUPPORT_PSCI
select SPL_ARMV7_SET_CORTEX_SMPEN
select DRAM_SUN6I
- select PHY_SUN4I_USB
select SPL_I2C
select SUN6I_PRCM
select SUNXI_GEN_SUN6I
@@ -232,7 +228,6 @@ config MACH_SUN7I
select ARCH_SUPPORT_PSCI
select SPL_ARMV7_SET_CORTEX_SMPEN
select DRAM_SUN4I
- select PHY_SUN4I_USB
select SUNXI_GEN_SUN4I
select SUPPORT_SPL
select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
@@ -246,7 +241,6 @@ config MACH_SUN8I_A23
select CPU_V7_HAS_VIRT
select ARCH_SUPPORT_PSCI
select DRAM_SUN8I_A23
- select PHY_SUN4I_USB
select SPL_I2C
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
@@ -260,7 +254,6 @@ config MACH_SUN8I_A33
select CPU_V7_HAS_VIRT
select ARCH_SUPPORT_PSCI
select DRAM_SUN8I_A33
- select PHY_SUN4I_USB
select SPL_I2C
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
@@ -271,7 +264,6 @@ config MACH_SUN8I_A83T
bool "sun8i (Allwinner A83T)"
select CPU_V7A
select DRAM_SUN8I_A83T
- select PHY_SUN4I_USB
select SPL_I2C
select SUNXI_GEN_SUN6I
select MMC_SUNXI_HAS_NEW_MODE
@@ -299,7 +291,6 @@ config MACH_SUN8I_R40
select SUPPORT_SPL
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
- select PHY_SUN4I_USB
imply SPL_SYS_I2C_LEGACY
config MACH_SUN8I_V3S
@@ -327,7 +318,6 @@ config MACH_SUN9I
config MACH_SUN50I
bool "sun50i (Allwinner A64)"
select ARM64
- select PHY_SUN4I_USB
select SUN6I_PRCM
select SUNXI_DE2
select SUNXI_GEN_SUN6I
@@ -350,7 +340,6 @@ config MACH_SUN50I_H5
config MACH_SUN50I_H6
bool "sun50i (Allwinner H6)"
select ARM64
- select PHY_SUN4I_USB
select DRAM_SUN50I_H6
select SUN50I_GEN_H6
--- a/drivers/phy/allwinner/Kconfig
+++ b/drivers/phy/allwinner/Kconfig
@@ -3,7 +3,8 @@
#
config PHY_SUN4I_USB
bool "Allwinner Sun4I USB PHY driver"
- depends on ARCH_SUNXI
+ depends on ARCH_SUNXI && !MACH_SUN9I
+ default y
select DM_REGULATOR
select PHY
help

View file

@ -0,0 +1,222 @@
From 1c71f4fd1b2b3d7145780dc5516e4d6f38539b1c Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 26 Aug 2021 21:05:33 -0500
Subject: [PATCH 44/68] sunxi: Enable PMIC drivevbus regulator support for USB
supplies
On many boards, the USB ports are powered by the PMIC's "drivevbus"
regulator. In preparation for switching the USB PHY driver to use the
regulator uclass instead of a virtual GPIO pin, ensure these boards
have AXP PMIC regulator support enabled.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
configs/A33-OLinuXino_defconfig | 1 +
configs/Cubieboard4_defconfig | 1 +
configs/Cubietruck_plus_defconfig | 1 +
configs/MSI_Primo81_defconfig | 1 +
configs/Merrii_A80_Optimus_defconfig | 1 +
configs/Sinovoip_BPI_M3_defconfig | 1 +
configs/Yones_Toptech_BS1078_V2_defconfig | 1 +
configs/colorfly_e708_q1_defconfig | 1 +
configs/ga10h_v1_1_defconfig | 1 +
configs/gt90h_v4_defconfig | 1 +
configs/iNet_D978_rev2_defconfig | 1 +
configs/inet86dz_defconfig | 1 +
configs/inet_q972_defconfig | 1 +
configs/polaroid_mid2407pxe03_defconfig | 1 +
configs/polaroid_mid2809pxe04_defconfig | 1 +
configs/q8_a23_tablet_800x480_defconfig | 1 +
configs/q8_a33_tablet_1024x600_defconfig | 1 +
configs/q8_a33_tablet_800x480_defconfig | 1 +
configs/tbs_a711_defconfig | 1 +
19 files changed, 19 insertions(+)
--- a/configs/A33-OLinuXino_defconfig
+++ b/configs/A33-OLinuXino_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
CONFIG_VIDEO_LCD_BL_EN="PB2"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DCDC1_VOLT=3300
CONFIG_USB_MUSB_HOST=y
--- a/configs/Cubieboard4_defconfig
+++ b/configs/Cubieboard4_defconfig
@@ -11,5 +11,6 @@ CONFIG_USB1_VBUS_PIN="PH14"
CONFIG_USB3_VBUS_PIN="PH15"
CONFIG_AXP_GPIO=y
CONFIG_SYS_I2C_SUN8I_RSB=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP809_POWER=y
--- a/configs/Cubietruck_plus_defconfig
+++ b/configs/Cubietruck_plus_defconfig
@@ -21,6 +21,7 @@ CONFIG_SYS_I2C_SLAVE=0x7f
CONFIG_SYS_I2C_SPEED=400000
CONFIG_PHY_REALTEK=y
CONFIG_SUN8I_EMAC=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO3_VOLT=2500
CONFIG_AXP_DLDO4_VOLT=3300
--- a/configs/MSI_Primo81_defconfig
+++ b/configs/MSI_Primo81_defconfig
@@ -12,6 +12,7 @@ CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
--- a/configs/Merrii_A80_Optimus_defconfig
+++ b/configs/Merrii_A80_Optimus_defconfig
@@ -11,5 +11,6 @@ CONFIG_USB1_VBUS_PIN="PH4"
CONFIG_USB3_VBUS_PIN="PH5"
CONFIG_AXP_GPIO=y
CONFIG_SYS_I2C_SUN8I_RSB=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP809_POWER=y
--- a/configs/Sinovoip_BPI_M3_defconfig
+++ b/configs/Sinovoip_BPI_M3_defconfig
@@ -17,6 +17,7 @@ CONFIG_CONSOLE_MUX=y
CONFIG_PHY_REALTEK=y
CONFIG_SUN8I_EMAC=y
CONFIG_INITIAL_USB_SCAN_DELAY=500
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DCDC5_VOLT=1200
CONFIG_AXP_DLDO3_VOLT=3300
--- a/configs/Yones_Toptech_BS1078_V2_defconfig
+++ b/configs/Yones_Toptech_BS1078_V2_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_USB_MUSB_HOST=y
--- a/configs/colorfly_e708_q1_defconfig
+++ b/configs/colorfly_e708_q1_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_DLDO2_VOLT=1800
--- a/configs/ga10h_v1_1_defconfig
+++ b/configs/ga10h_v1_1_defconfig
@@ -16,6 +16,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/gt90h_v4_defconfig
+++ b/configs/gt90h_v4_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/iNet_D978_rev2_defconfig
+++ b/configs/iNet_D978_rev2_defconfig
@@ -15,6 +15,7 @@ CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
--- a/configs/inet86dz_defconfig
+++ b/configs/inet86dz_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/inet_q972_defconfig
+++ b/configs/inet_q972_defconfig
@@ -13,6 +13,7 @@ CONFIG_VIDEO_LCD_DCLK_PHASE=0
CONFIG_VIDEO_LCD_BL_EN="PA25"
CONFIG_VIDEO_LCD_BL_PWM="PH13"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y
--- a/configs/polaroid_mid2407pxe03_defconfig
+++ b/configs/polaroid_mid2407pxe03_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/polaroid_mid2809pxe04_defconfig
+++ b/configs/polaroid_mid2809pxe04_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/q8_a23_tablet_800x480_defconfig
+++ b/configs/q8_a23_tablet_800x480_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/q8_a33_tablet_1024x600_defconfig
+++ b/configs/q8_a33_tablet_1024x600_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/q8_a33_tablet_800x480_defconfig
+++ b/configs/q8_a33_tablet_800x480_defconfig
@@ -14,6 +14,7 @@ CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_CONS_INDEX=5
--- a/configs/tbs_a711_defconfig
+++ b/configs/tbs_a711_defconfig
@@ -13,6 +13,7 @@ CONFIG_USB0_ID_DET="PH11"
CONFIG_AXP_GPIO=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
CONFIG_REGULATOR_AXP_USB_POWER=y
CONFIG_AXP_DCDC5_VOLT=1200
CONFIG_USB_EHCI_HCD=y

View file

@ -1,7 +1,7 @@
From e8fb34342dfb79cd2059431dd1a0f03202a244ca Mon Sep 17 00:00:00 2001
From 5ea3e3e37ec14a1d90a6764879c38d80f4ffe008 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 26 Aug 2021 22:11:37 -0500
Subject: [PATCH 09/90] phy: sun4i-usb: Control USB supplies via regulator
Subject: [PATCH 45/68] phy: sun4i-usb: Control supplies via the regulator
uclass
The device tree binding for the PHY provides VBUS supplies as regulator
@ -53,7 +53,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -97,27 +97,22 @@ struct sun4i_usb_phy_cfg {
@@ -87,27 +87,22 @@ struct sun4i_usb_phy_cfg {
};
struct sun4i_usb_phy_info {
@ -81,7 +81,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
.gpio_vbus_det = NULL,
.gpio_id_det = NULL,
},
@@ -125,11 +120,11 @@ struct sun4i_usb_phy_info {
@@ -115,12 +110,12 @@ struct sun4i_usb_phy_info {
struct sun4i_usb_phy_plat {
void __iomem *pmu;
@ -89,12 +89,13 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
struct gpio_desc gpio_vbus_det;
struct gpio_desc gpio_id_det;
struct clk clocks;
struct clk clk2;
struct reset_ctl resets;
+ struct udevice *vbus;
int id;
};
@@ -218,14 +213,18 @@ static int sun4i_usb_phy_power_on(struct
@@ -209,6 +204,7 @@ static int sun4i_usb_phy_power_on(struct
{
struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
@ -102,7 +103,8 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
if (initial_usb_scan_delay) {
mdelay(initial_usb_scan_delay);
initial_usb_scan_delay = 0;
@@ -221,8 +217,11 @@ static int sun4i_usb_phy_power_on(struct
return 0;
}
- if (dm_gpio_is_valid(&usb_phy->gpio_vbus))
@ -115,7 +117,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
return 0;
}
@@ -234,9 +233,13 @@ static int sun4i_usb_phy_power_off(struc
@@ -231,9 +230,13 @@ static int sun4i_usb_phy_power_off(struc
{
struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];
@ -131,12 +133,12 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
return 0;
}
@@ -450,22 +453,16 @@ static int sun4i_usb_phy_probe(struct ud
@@ -483,22 +486,16 @@ static int sun4i_usb_phy_probe(struct ud
for (i = 0; i < data->cfg->num_phys; i++) {
struct sun4i_usb_phy_plat *phy = &plat[i];
struct sun4i_usb_phy_info *info = &phy_info[i];
- char name[16];
+ char name[20];
+ char name[32];
if (data->cfg->missing_phys & BIT(i))
continue;

View file

@ -1,183 +0,0 @@
From d11c5971f60d482c05f807c24f3ccd37cf7d0f70 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 9 Oct 2021 17:12:57 -0500
Subject: [PATCH 37/90] sunxi: psci: Add support for H3 CPU 0 hotplug
Due to a bug in the H3 SoC, where the CPU 0 hotplug flag cannot be
written, resuming CPU 0 requires using the "Super Standby" code path in
the BROM instead of the hotplug path. This path requires jumping to an
eGON image in SRAM.
Add support to the build system to generate this eGON image and include
it in the FIT, and add code to direct the BROM to its location in SRAM.
Since the Super Standby code path in the BROM initializes the CPU and
AHB1 clocks to 24 MHz, those registers need to be restored after control
passes back to U-Boot. Furthermore, because the BROM lowers the AHB1
clock divider to /1 before switching to the lower-frequency parent,
PLL_PERIPH0 must be bypassed to prevent AHB1 from temporarily running at
600 MHz. Otherwise, this locks up the SoC.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
Makefile | 17 +++++++++++++++++
arch/arm/cpu/armv7/sunxi/psci.c | 31 +++++++++++++++++++++++++++++++
arch/arm/dts/sunxi-u-boot.dtsi | 23 ++++++++++++++++++++++-
include/configs/sun8i.h | 4 ++++
4 files changed, 74 insertions(+), 1 deletion(-)
--- a/Makefile
+++ b/Makefile
@@ -1013,6 +1013,23 @@ INPUTS-y += u-boot.img
endif
endif
+ifeq ($(CONFIG_MACH_SUN8I_H3)$(CONFIG_ARMV7_PSCI),yy)
+INPUTS-$(CONFIG_ARMV7_PSCI) += u-boot-resume.img
+
+MKIMAGEFLAGS_u-boot-resume.img := -B 0x400 -T sunxi_egon
+
+u-boot-resume.img: u-boot-resume.bin
+ $(call if_changed,mkimage)
+
+OBJCOPYFLAGS_u-boot-resume.bin := -O binary
+
+u-boot-resume.bin: u-boot-resume.o
+ $(call if_changed,objcopy)
+
+u-boot-resume.S: u-boot
+ @sed -En 's/(0x[[:xdigit:]]+) +psci_cpu_entry/ldr pc, =\1/p' $<.map > $@
+endif
+
INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \
$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
$(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin)
--- a/arch/arm/cpu/armv7/sunxi/psci.c
+++ b/arch/arm/cpu/armv7/sunxi/psci.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <asm/cache.h>
+#include <asm/arch/clock.h>
#include <asm/arch/cpu.h>
#include <asm/arch/cpucfg.h>
#include <asm/arch/prcm.h>
@@ -141,6 +142,13 @@ static void __secure sunxi_set_entry_add
(struct sunxi_cpucfg_reg *)SUNXI_CPUCFG_BASE;
writel((u32)entry, &cpucfg->priv0);
+
+#ifdef CONFIG_MACH_SUN8I_H3
+ /* Redirect CPU 0 to the secure monitor via the resume shim. */
+ writel(0x16aaefe8, &cpucfg->super_standy_flag);
+ writel(0xaa16efe8, &cpucfg->super_standy_flag);
+ writel(SUNXI_RESUME_BASE, &cpucfg->priv1);
+#endif
}
#endif
@@ -255,9 +263,12 @@ out:
int __secure psci_cpu_on(u32 __always_unused unused, u32 mpidr, u32 pc,
u32 context_id)
{
+ struct sunxi_ccm_reg *ccu = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
struct sunxi_cpucfg_reg *cpucfg =
(struct sunxi_cpucfg_reg *)SUNXI_CPUCFG_BASE;
u32 cpu = (mpidr & 0x3);
+ u32 cpu_clk;
+ u32 bus_clk;
/* store target PC and context id */
psci_save(cpu, pc, context_id);
@@ -274,12 +285,32 @@ int __secure psci_cpu_on(u32 __always_un
/* Lock CPU (Disable external debug access) */
clrbits_le32(&cpucfg->dbg_ctrl1, BIT(cpu));
+ if (IS_ENABLED(CONFIG_MACH_SUN8I_H3) && cpu == 0) {
+ /* Save registers that will be clobbered by the BROM. */
+ cpu_clk = readl(&ccu->cpu_axi_cfg);
+ bus_clk = readl(&ccu->ahb1_apb1_div);
+
+ /* Bypass PLL_PERIPH0 so AHB1 frequency does not spike. */
+ setbits_le32(&ccu->pll6_cfg, BIT(25));
+ }
+
/* Power up target CPU */
sunxi_cpu_set_power(cpu, true);
/* De-assert reset on target CPU */
writel(BIT(1) | BIT(0), &cpucfg->cpu[cpu].rst);
+ if (IS_ENABLED(CONFIG_MACH_SUN8I_H3) && cpu == 0) {
+ /* Spin until the BROM has clobbered the clock registers. */
+ while (readl(&ccu->ahb1_apb1_div) != 0x00001100);
+
+ /* Restore the registers and turn off PLL_PERIPH0 bypass. */
+ writel(cpu_clk, &ccu->cpu_axi_cfg);
+ writel(bus_clk, &ccu->ahb1_apb1_div);
+
+ clrbits_le32(&ccu->pll6_cfg, BIT(25));
+ }
+
/* Unlock CPU (Disable external debug access) */
setbits_le32(&cpucfg->dbg_ctrl1, BIT(cpu));
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -6,7 +6,11 @@
#define ARCH "arm"
#endif
-#if defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H5)
+#if defined(CONFIG_MACH_SUN8I_H3)
+#ifdef CONFIG_ARMV7_PSCI
+#define RESUME_ADDR SUNXI_RESUME_BASE
+#endif
+#elif defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H5)
#define BL31_ADDR 0x00044000
#define SCP_ADDR 0x00050000
#elif defined(CONFIG_MACH_SUN50I_H6)
@@ -78,6 +82,20 @@
};
#endif
+#ifdef RESUME_ADDR
+ resume {
+ description = "Super Standby resume image";
+ type = "standalone";
+ arch = ARCH;
+ compression = "none";
+ load = <RESUME_ADDR>;
+
+ blob-ext {
+ filename = "u-boot-resume.img";
+ };
+ };
+#endif
+
#ifdef SCP_ADDR
scp {
description = "SCP firmware";
@@ -111,6 +129,9 @@
firmware = "uboot";
#endif
loadables =
+#ifdef RESUME_ADDR
+ "resume",
+#endif
#ifdef SCP_ADDR
"scp",
#endif
--- a/include/configs/sun8i.h
+++ b/include/configs/sun8i.h
@@ -8,6 +8,10 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#define SUNXI_RESUME_BASE (CONFIG_ARMV7_SECURE_BASE + \
+ CONFIG_ARMV7_SECURE_MAX_SIZE)
+#define SUNXI_RESUME_SIZE 1024
+
#include <configs/sunxi-common.h>
#endif /* __CONFIG_H */

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