Compare commits

...

263 Commits

Author SHA1 Message Date
Tianling Shen
b912a96ab4
ImmortalWrt v24.10.0-rc2: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-21 15:00:06 +08:00
Tianling Shen
56e91d0bbe
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-21 14:59:24 +08:00
Hauke Mehrtens
975811921e OpenWrt v24.10.0-rc3: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-21 01:51:34 +01:00
Hauke Mehrtens
dd04edfba2 OpenWrt v24.10.0-rc3: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-21 01:51:30 +01:00
Marco von Rosenberg
8667ca841b generic: fix BCM54612E suspend/resume backport patch
This backport patch inserted suspend/resume callbacks
for the wrong PHY driver.
The fixed patch is needed for Huawei AP5030DN
to initialize its second PHY.

Refresh all affected patch with make target/linux/refresh.

Fixes: 06cdc07f8cc7 ("ath79: add support for Huawei AP5030DN")
Signed-off-by: Marco von Rosenberg <marcovr@selfnet.de>
Link: https://github.com/openwrt/openwrt/pull/17312
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d7f638bc692a7a81cf13c8ca50c7dc4a73c0fed9)
2024-12-20 19:36:33 +01:00
Tianling Shen
2d6c57397f
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-20 14:30:00 +08:00
David Bauer
5289460fd0 wifi-scripts: don't fail on unset PSK
Don't fail wireless interface bringup on empty PSK set. This is a valid
configuration, resulting in a PSK network which can't be connected to.
It does not fail the bringup of the hostapd process.

Keep failing the interface setup in case a password with invalid length
is used.

This is also beneficial when intending to configure a PPSK network. It
allows to create a network where no PPSK is yet set.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 17a71f0c154cebd2e52cd8407531a9a88c931474)
2024-12-20 01:20:00 +01:00
Tianling Shen
7c0f6f4d05
linux-firmware: add panthor firmware
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit aea6227660cceb9797e39facf9bdf085a6477523)
2024-12-19 20:47:36 +08:00
Tianling Shen
f67ecd3baf
rockchip: backport rk3588 usb reset fixes
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit edca1d0019d8a2f2a41ac68a1fdbc5aae6e57a17)
2024-12-19 20:18:06 +08:00
Isaac de Wolff
9f76cda378 lantiq: grow kernel partition Zyxel P-2812HNU-F1
Change partition table in dts file.
Change DEVICE_COMPAT_VERSION
Enable automatic build.

To take advantage of the bigger kernel partition,
the uboot environment has to be changed:
setenv nboot 'nand read 0x81000000 0x60000 0x500000; bootm 0x81000000'
setenv bootcmd 'run nboot'
saveenv

Of course you need a u-boot capable of handling this.
The u-boot discussed in this forum thread:
https://forum.openwrt.org/t/zyxel-p2812hnu-f1-u-boot/100281
should be able to handle kernels up to an uncompressed size of 16MiB.

Signed-off-by: Isaac de Wolff <idewolff@gmx.com>
Link: https://github.com/openwrt/openwrt/pull/17209
Link: https://github.com/openwrt/openwrt/pull/17300
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0d21cc8a92ea3b2cc94efefd60eae968a4296543)
2024-12-19 11:30:45 +01:00
Andrew MacIntyre
5415fb06d2 lantiq/xrx200: move 8M flash devices to a small flash subtarget
Images for xrx200 8M flash are either not building due to image
size (TD-W8970, TD-W8980) or building such that the available
free space in the overlayfs is too little to be useful.

To keep images for these devices buildable, move them into a
small flash variant of the xrx200 subtarget.  As these devices
are NOR flash only, remove NAND and UBI references from the
kernel config to gain some additional image size reduction.

The apparent 8M flash devices Arcadyan VGV7510KW22-brn,
Arcadyan VGV7519-brn and Lantiq Easy80920-nor seem to exist in
order to create special "factory" installation images for these
devices (which actually have larger flash: 16MB for the
Arcardyan devices; 64MB for the Lantiq device).  As a
considerable amount of surgery would appear to be required to
the uboot-lantiq package structure to separate the "factory"
from the "sysupgrade" device recipes for these devices they
remain in the xrx200 target - if factory images aren't now
created, 23.05.x factory images should suffice for initial
installation.

Tested on: Netgear DM200, TP-Link TD-W8980,
           AVM Fritz7490 (xrx200 subtarget: image build only)

Fixes: https://github.com/openwrt/openwrt/issues/16761
Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
Link: https://github.com/openwrt/openwrt/pull/17113
(cherry picked from commit e63326e26a82cb083eec602b3a2f71d4cd8e2ea4)
Link: https://github.com/openwrt/openwrt/pull/17303
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-19 11:25:30 +01:00
John Audia
21549dbf7b kernel: bump 6.6 to 6.6.66
Update patch set for new release and add required kernel option
CONFIG_ZRAM_TRACK_ENTRY_ACTIME to generic config

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

Manually rebased:
	bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch
	bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
	starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch

Removed upstreamed:
	bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.66&id=e0388a95736abd1f5f5a94221dd1ac24eacbd4d7

Build system: x86/64
Build-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64
Run-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17271
(cherry picked from commit 28f534d953b1163548610554981763d24fde6d03)
Link: https://github.com/openwrt/openwrt/pull/17302
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-19 11:22:12 +01:00
Tianling Shen
ab4c83d4f9
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-19 16:41:49 +08:00
Florian Maurer
5a715cdbcd hostapd: fix call to hostapd reload
access to undeclared variable radio In [anonymous function](), file /usr/share/hostap/hostapd.uc, line 830, byte 45:

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
(cherry picked from commit 31e45f62cafbc9361c72d320241e589b31e2b5ed)
2024-12-19 09:02:51 +01:00
Felix Fietkau
e40367fa99 hostapd: fix passing radio parameter in wpa_supplicant calls
Fixes accessing PHY status in AP+STA configurations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8943430b9f8046d49842de6b40f9c90fb57fff04)
2024-12-19 09:02:36 +01:00
Felix Fietkau
f0ff244c69 firewall4: update to Git HEAD (2024-12-18)
e00958884416 fw4: do not add physical devices for soft offload
dfbcc1cd127c fw4: skip not existing netdev names in flowtable device list
18fc0ead19fa init: use the reload data trigger to reload firewall on procd data changes

Fixes: https://github.com/openwrt/openwrt/issues/13410
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 47c75a25cdeed6fda9608d61926799dbd1b1fef3)
2024-12-18 12:47:50 +01:00
Felix Fietkau
cc69be0c13 unetd: update to Git HEAD (2024-12-17)
93461ca4c827 unet-cli: only apply defaults on create
3e5766783d5d unet-tool: add support for confirming password
074d3659ca4a unet-cli: confirm password when creating new seed based key
bf3488a3807a unet-cli: add add/set-local-host command
9eb57c528461 unet-cli: add support for setting interface zone
a0a2d80f3459 ubus: add firewall rules for network port/pex_port via procd

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit f077e058fd485ab87f0995351a3ddc0a009e4593)
2024-12-17 22:00:37 +01:00
Felix Fietkau
6642ee73bc procd: add support for reload triggers on data change
This can be useful to reload the firewall when procd firewall data changes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 49d92d3e933c45e3684da2fbf0a198d195635581)
2024-12-17 22:00:37 +01:00
Felix Fietkau
f760f74209 procd: do not overwrite service data by default
Allows a running servie to manage its own data if untouched by the init script

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8c5826b140b6288b9270d232ecda0d540e380d4e)
2024-12-17 22:00:37 +01:00
Felix Fietkau
5dca1d6a41 procd: update to Git HEAD (2024-12-17)
2e206dbe77ec service: add support for triggers on service/instance data changes
735b48728fca service: remove leftover lines from previous commit
32469644a029 service: allow incremental changes to service properties
fd01fb852302 service: fix double free bug when dealing with data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 3d900bd055b5d8f07a879c9c8c4f7783d35dd4ba)
2024-12-17 22:00:37 +01:00
John Crispin
e109caeec4 procd: update to latest HEAD
e2f05de state: set_stdio: chdir back to / in case of failure
30542c9 inittab: Disable implicit controlling TTY.

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 2bcc49aef93f454950d425b8de69d230b52cc63c)
2024-12-17 22:00:37 +01:00
Felix Fietkau
a964e96289 netifd: update to Git HEAD (2024-12-17)
058a099f5bc5 interface: fix memleak and reload issue for the zone attribute
ea01ed41f321 interface: remove unnecessary NULL checks before free()

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 53e312e19313dd738eabed3a4af5fb42a8f9e8fb)
2024-12-17 21:58:55 +01:00
Felix Fietkau
acf52fed43 unetd: add firewall input rule for global port
Ensure that peers can be exchanged over any interface

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit f8a16524c4a4070d61a32f6203ea5e26cea125d4)
2024-12-17 21:58:55 +01:00
Tianling Shen
b9eb5bc327
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-17 17:37:25 +08:00
Felix Fietkau
25268f724b unetd: update to Git HEAD (2024-12-16)
d22d7db581d5 bpf_skb_utils.h: add missing include to fix build against newer kernel headers
bbd3e0eb1419 host: fix peer routes on a node acting as gateway
b17164751fc7 unet-tool: add support for generating keys from salt + seed passphrase
041e05870c20 unet-tool: add support for dumping pubkey from signed file
b58920d420cb unet-tool: add support for extracting network data from signed bin file
f335f5b40b4e unet-cli: add support for generating key from seed
8b1f1d099352 unet-cli: add support for importing networks from signed data
188ba05eadf2 unet-cli: add missing command line help for import
8f15fc306a40 unet-cli: fix add-ssh-host with seed keys
486bc3b86dc2 pex-msg: enable broadcast for global PEX socket
e4a24cdfbc1c unet-cli: fix defaults on create

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit af1740a28b63ecc6683dceb249a1f75af5e9098d)
2024-12-16 13:04:21 +01:00
Rosen Penev
6435025f9c ath79: fix tl-wa eth1 mac
This is using mac-base and so a 0 needs to be added.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17274
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 0634ebed9f74dca6d008b00f9fa00cc1220fa425)
2024-12-16 11:07:11 +01:00
John Audia
6d0d4ce72f kernel: generic: tg3: Fix DMA allocations on 57766 devices
At the request of rsalvaterra, add this patch to fix an issue
affecting tg3 ethernet interfaces[1].

1. https://github.com/openwrt/openwrt/pull/17271#issuecomment-2543836518

Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17282
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit a3c484c3b9468a7bd9190b0fee027bb133cee3d5)
2024-12-16 01:10:42 +01:00
Shiji Yang
28602452df ath79: fix ath9k calibration data size for AR9132
For ath9k NICs older than AR9287, The eeprom size is 0xeb8.

Fixes: https://github.com/openwrt/openwrt/issues/17196
Fixes: 74f2df9dbccd ("ath79: mtd-cal-data removals")
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/17261
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 96eb12e961748373a38738de92f5ef1a87f0cc75)
2024-12-16 01:10:36 +01:00
Andreas Böhler
28bde50c1d ath79: add support for KuWFi N650 CPE
The KuWFi N650 is a 5GHz outdoor wireless bridge based on QCA9563.

Specs
=====

CPU: QCA9563, 775MHz
RAM: 128MiB
Flash: 16MiB
Wireless: QCA9888 (5GHz only)
Ethernet: 2x GBit (via QCA8337), 48V passive PoE

Installation
============

From OEM firmware
-----------------

The OEM firmware has telnet enabled by default. If not, it can be enabled
from the firmware web interface. You need a TFTP server on your computer
and the OpenWrt factory image should be available as "n650factory.bin".
It is assumed that your computer has the IP 192.168.1.1 and the N650
192.168.1.20 (default IP address).

1. Connect via Telnet to the device and log in with the default credentials
   "admin:admin"
2. Exploit the limited interface by typing "ps & /bin/sh"
3. Press <ENTER> to start the shell
4. Enter the following commands:

$ cd /tmp
$ tftp -r n650factory.bin -g 192.168.1.1
$ cat << EOF > /tmp/openwrt.sh

IMAGE_NAME="\$1"

if [ ! -e \${IMAGE_NAME} ]; then
  echo "Image file not found: \${IMAGE_NAME}"
  exit 1
fi

. /usr/sbin/common.sh

kill_remaining TERM
sleep 3
kill_remaining KILL

run_ramfs mtd write \${IMAGE_NAME} firmware
sleep 2
reboot -f
EOF

$ chmod +x /tmp/openwrt.sh
$ /tmp/openwrt.sh n650factory.bin

Once the device reboots, it should load OpenWrt.

From UART
---------

UART installation is possible since the serial header is already soldered
on. The pinout is GND - Tx - Rx - VCC from top to bottom (RJ45 ports are
at the bottom). Connect with 115200 8N1.

First, boot OpenWrt from TFTP. Enter the following commands in the U-Boot
shell, assuming your computer has the IP address 192.168.1.1 and a TFTP
server running where the initramfs image is provided as n650.bin:

  setenv ipaddr 192.168.1.20
  setenv serverip 192.168.1.1
  tftpboot 0x84000000 n650.bin
  bootm

Once booted, transfer -loader.bin and -sysupgrade.bin images to the device
at /tmp. Enter the following commands, replacing the filenames:

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

Reboot and OpenWrt should load from flash.

Back to Stock
-------------

Back to stock is only possible if you saved a partition backup before
installing OpenWrt. Assuming you have fullbackup.bin covering the whole
flash, you need to prepare the image as follows:

$ dd if=fullbackup.bin of=fwconcat0.bin bs=65536 skip=4 count=212
$ dd if=fullbackup.bin of=loader.bin bs=65536 skip=216 count=1
$ dd if=fullbackup.bin of=fwconcat1.bin bs=65536 skip=217 count=22
$ cat fwconcat0.bin fwconcat1.bin > firmware.bin

Transfer firmware.bin and loader.bin to the OpenWrt device. First, flash
loader.bin to mtd device loader, then force sysupgrade:

$ mtd write loader.bin loader
$ sysupgrade -F firmware.bin

The reason for the two-step process is the way the flash layout is designed
for OpenWrt in contrast to the OEM firmware partition.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
Link: https://github.com/openwrt/openwrt/pull/17089
Link: https://github.com/openwrt/openwrt/pull/17247
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit dde510cf979e896a622b7ed738009910a27de94e)
2024-12-15 01:46:49 +01:00
John Audia
efcb0ec713 kernel: bump 6.6 to 6.6.65
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.65

Update to checksum only/no patches required a rebase.
Per the changelog, this is a trivial upstream bump with only 4
commits, 2 of which being reverts.

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17217
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 15e173bf7e873d004d6c665ee81d54a10ce1f868)
2024-12-15 01:43:51 +01:00
John Audia
9af0e94fa6 kernel: bump 6.6 to 6.6.64
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.64

Manually rebased:
	generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch
	bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch
	bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch
	bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch

Removed upstreamed:
	bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch[1]
	bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch[2]
	bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch[3]
	bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch[4]
	ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch[5]
	ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch[6]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=223ee2567a55e4f80315c768d2969e6a3b9fb23d
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=8182b5ca19c6f173b6498d1c6d3e4b034b76bbde
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=52c1716f65a558174e381360bd88f18dae4be85c
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=9728b508b01a5eeeac79ceb676364c674dd951ac
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=f85a1d06afbcc57ac44176db8f9d7a934979952c
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=fbb13732c6ffa9d58cedafabcd5ce8fd7ef8ae5a

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Co-authored-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17217
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5158e28769cb5e5c6a59bd9a176f55cf2d568742)
2024-12-15 01:43:39 +01:00
Shiji Yang
bf284ed4af ramips: fix 2.4G wmac eeprom offset for TL-WR902AC v4
The eeprom data offset on 2.4GHz wmac is wrong. It is obvious that
this is a copy & paste issue.

Suggested-by: @cgm999 on https://github.com/openwrt/openwrt/issues/13969
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/17263
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5a24850de1418510c421d45eb2436bdcb2b243c6)
2024-12-14 20:34:55 +01:00
Tianling Shen
31335d165a
mediatek: update leds for openembed som7981
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 91cfc2b296c7fd48a50d7dec0639ae2490106def)
2024-12-14 20:27:31 +08:00
Tianling Shen
f3f8a8ea83
mediatek: fix wifi mac assignment for bpi r4
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-14 20:24:17 +08:00
Tianling Shen
ab3dee65f9
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-13 20:02:01 +08:00
David Bauer
aa1241e979 wifi-scripts: fix failing mesh setup with missing wpa_supplicant
The initialization of mesh interfaces currently fail when wpa_supplicant
is not installed. This is due to the script calling the wpa_supplicant
feature indicator without verifying wpa_supplicant is installed at all.

To avoid failing, first check if wpa_supplicant is installed before
determining the available featureset.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 1be18c6daad83bc4198dc7aefd9979b7fe8fbfd4)
2024-12-12 16:41:10 +01:00
Tianling Shen
610b73e8b6
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-11 14:21:00 +08:00
Andris PE
28de3ffefa netifd: check if /sbin/wifi exists before calling it
Avoid harmless error from network script by checking presence of
now-optional wifi support script, most notably confusing users of x86
snapshots.

Fixes: #14964
Signed-off-by: Andris PE <neandris@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14986
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 207bfee855320dc938f39e179b1d2e3b008140cb)
2024-12-10 01:22:05 +01:00
Paul Donald
6c664135f9 netifd: update to Git 768027c5a7640137857f412f554227abd6160cdd (2024-11-27)
86da5cbcdb9d system-linux: do not pull ifindex/flags from netlink messages on rtnl events
cd96f61ba63e proto-shell: fix spurious interface teardowns with host deps
a39fe3a8b150 wireless: add support for adding a list of devices for a wifi-iface
d29cf707478c iprule: add ipproto property
768027c5a764 system-linux: restore reading flags from netlink messages

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17074
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f4492b6b1c5373a27c911ad675e96ccf1ce542d2)
Link: https://github.com/openwrt/openwrt/pull/17110
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-10 01:19:13 +01:00
Mikhail Zhilkin
620aa80064 mediatek: MERCUSYS MR90X v1: add OpenWrt U-Boot (UBI) layout
This commit adds OpenWrt U-Boot (UBI) layout support for MERCUSYS MR90X
v1.

Stock U-Boot UBI size:   50 MiB
OpenWrt U-boot UBI size: 126 MiB

Install
-------
1. Perform steps 1-14 of the OpenWrt installation guide (use OpenWrt
   initramfs-recovery.itb instead of initramfs-kernel.bin at the step 10,
   12 and 14).
Link: https://openwrt.org/toh/mercusys/mr90x_v1#installation

2. Make backups:
```
cat /dev/mtd0 > /tmp/boot.bin
cat /dev/mtd5 > /tmp/tp_data.bin
```
   Copy /tp_data dir content, /tmp/boot.bin and /tmp/tp_data.bin and to
   your PC using scp. You can also backup the remaining partititons. Copy
   backups to a safe place, they are required for the next steps and stock
   firmware recovery.

3. Reboot to OpenWrt initramfs:
```
reboot
```

4. Copy OpenWrt ubi-bl31-uboot.fip, ubi-preloader.bin,
   ubi-squashfs-sysupgrade.itb and MT7986_EEPROM.bin, default-mac (from
   /tp_data backup) to the /tmp folder of the router using scp.

5. Prepare UBI:
```
ubidetach -p /dev/mtd3; ubiformat /dev/mtd3 -y; ubiattach -p /dev/mtd3
ubimkvol /dev/ubi0 -N fip -t static -s 1MiB
ubiupdatevol /dev/ubi0_0 /tmp/ubi-bl31-uboot.fip
ubimkvol /dev/ubi0 -N ubootenv -s 0x1f000
ubimkvol /dev/ubi0 -N ubootenv2 -s 0x1f000
```

6.  Install kmod-mtd-rw and unlock partitions:
```
opkg update && opkg install kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd unlock boot
mtd unlock bl2
mtd unlock factory
```

7. Prepare "factory" partition:
```
dd if=/dev/zero bs=$((0x8000)) count=1 | tr '\000' '\377' > /tmp/factory.bin
dd if=/tmp/MT7986_EEPROM.bin of=/tmp/factory.bin conv=notrunc
dd if=/tmp/default-mac >> /tmp/factory.bin
```

8. Write "factory" partition:
```
mtd erase factory
mtd write /tmp/factory.bin factory
```

9. Write preloader partition:
```
mtd erase bl2
mtd write /tmp/ubi-preloader.bin bl2
```

10. Write OpenWrt sysupgrade image:
```
sysupgrade -n /tmp/ubi-squashfs-sysupgrade.itb
```

Recovery
--------
1. Place OpenWrt initramfs-recovery.itb image (with original name) 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.

BL2 and FIP recovery
--------------------
Use mtk_uartboot and UART connetion if BL2 or FIP in UBI is destroyed:
Link: https://github.com/981213/mtk_uartboot
Link: https://openwrt.org/toh/mercusys/mr90x_v1#serial

Return to stock:
----------------
1. Copy "boot" partition backup (boot.bin) to the /tmp dir of the router
   using scp.

2. Install kmod-mtd-rw:
```
opkg update && opkg install kmod-mtd-rw
```

3. Restore stock U-Boot:
```
   insmod mtd-rw i_want_a_brick=1
   mtd unlock boot
   mtd erase boot
   mtd write /tmp/boot.bin boot
```

4. Erase UBI and reboot:
```
mtd erase ubi
reboot
```

5. Open U-Boot web recovery, upload stock firmware image and start
   upgrade.
Link: http://192.168.1.1

6. Complete steps 1-9 of the OpenWrt installation guide to get root
   rights.
Link: https://openwrt.org/toh/mercusys/mr90x_v1#installation

7. Upload "tp_data" partition backup (tp_data.bin) to the /tmp folder of
   the router using scp.

8. Restore stock calibrations:
```
mtd write /tmp/tp_data.bin tp_data
reboot
```

9. Perform "factory restore" via stock firmware web interface.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16744
(cherry picked from commit ee8df790cae843f11f78511dd9ffac7e80a4d707)
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17129
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-10 01:08:03 +01:00
Mikhail Zhilkin
24bddf68bd uboot-mediatek: add MERCUSYS MR90X v1 support
Add U-Boot replacement loader for the MERCUSYS MR90X. This is required
to increase available flash space in OpenWrt.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16744
(cherry picked from commit 77cc4b712700e51f5d779e4e7385639fa4e16ca9)
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17129
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-10 01:08:03 +01:00
Mikhail Zhilkin
d79a70542b arm-trusted-firmware-mediatek: add mt7986-spim-nand-ddr3 build
This commit adds mt7986-spim-nand-ddr3 build required for MERCUSYS MR90X
v1.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16744
(cherry picked from commit 2ea9ede7a8a94bddef599decfe6948c5c20dbfa5)
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17129
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-10 01:08:03 +01:00
Hauke Mehrtens
d48e499fc1 mediatek: filogic: Migrate wifi configuration device paths
The device path to the devices changed. Migrate the wifi
configurations from the old path to the new one. This is needed to
migrate Wireless configurations from OpenWrt 23.05 to OpenWrt 24.10.

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

Fixes: 0ef927472148 ("mediatek: filogic: move mt7981 on-SoC blocks to "soc" node in DT")
Fixes: https://github.com/openwrt/openwrt/issues/17174
Link: https://github.com/openwrt/openwrt/pull/17210
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit f8b93e2d12ef01fc565178c71c39470da798155a)
2024-12-10 01:06:10 +01:00
Ondřej Niesner
b9df2d79b6 mediatek: filogic: prevent faulty mac address assignment
The vendor U-Boot on the Cudy WR3000 assign random mac addresses on boot
and set the 'local-mac-address' property which prevents Openwrt from
assigning the correct address from evmem.

This patch removes the alias for ethernet0 so that U-Boot doesn't add
the property.

Related to: a55ab9e1343e ("mediatek: filogic: prevent faulty mac address assignment")
Fixes: https://github.com/openwrt/openwrt/issues/15587
Signed-off-by: Ondřej Niesner <ondra.niesner@seznam.cz>
Link: https://github.com/openwrt/openwrt/pull/17201
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit a498a84393a80de9f828b8465906761896ca4940)
2024-12-10 01:06:10 +01:00
Eric Long
5afd3daeba bpftool: turn off libbfd feature in host build
libbfd feature is not used when building eBPF program, and it makes bpftool fail to build in a clean environment, since binutils in toolchain have libbfd disabled.

Signed-off-by: Eric Long <i@hack3r.moe>
Link: https://github.com/openwrt/openwrt/pull/17073
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 3d8d81883fb2e607590bcb523587e37e1485b3b8)
2024-12-10 01:06:10 +01:00
Marty Jones
1eba94e67b mac80211: realtek: add RTL8812au/RTL8821au support
This adds support for RTL8812au/RTL8821au USB adapters.
Run-tested: x86/64/rockchip
USB adapters tested: Alfa AWUS036ACS, D-Link DWA-171 A1.

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17079
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ac8d30a645965ad4e1f1ca9b71e49613166b8a29)
2024-12-10 01:06:10 +01:00
Marty Jones
8a4ce69eea mac80211: realtek: backport support for RTL8812AU/RTL8821AU
Backport support for RTL8812AU/RTL8821AU USB adapters
Manually backported patch:
045-v6.13-wifi-rtw88-Enable-the-new-RTL8821AU-RTL8812AU-driver
Patches from 046 to 051 are pending.

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17079
[Move BPAUTO_WANT_DEV_COREDUMP to original patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 36f6d6ddcd67e7e32e2281baf5814ece81fad402)
2024-12-10 01:06:10 +01:00
Marty Jones
2b45e93113 linux-firmware: realtek: add RTL8812AU/RTL8821AU firmware
This adds firmware support for the RTL8812AU/RTL8821AU USB wireless adapters.

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17079
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c48a48e65889e00df598757cca1f6226ac173e89)
2024-12-10 01:06:10 +01:00
Marty Jones
4bfe5ccd11 linux-firmware: update to 20241110
linux-firmware update to 20241110
Move WCN6750 firmware to the device-specific subdir

git log --no-merges --pretty=oneline --abbrev-commit 20241110...20241017

1dbc4cfa rtl_bt: Update RTL8852BT/RTL8852BE-VT BT USB FW to 0x04D7_63F7
8a976e23 cnm: update chips&media wave521c firmware.
3636204f mediatek MT7920: update bluetooth firmware to 20241104091246
6627b025 linux-firmware: update firmware for MT7920 WiFi device
554c4761 copy-firmware.sh: Run check_whence.py only if in a git repo
1486d9aa cirrus: cs35l56: Add firmware for Cirrus CS35L56 for various Dell laptops
c99eeb4d amdgpu: update DMCUB to v9.0.10.0 for DCN351
b6bfff1a rtw89: 8852a: update fw to v0.13.36.2
ddf25515 rtw88: Add firmware v52.14.0 for RTL8812AU
dbb219d7 i915: Update Xe2LPD DMC to v2.23
937e463b linux-firmware: update firmware for mediatek bluetooth chip (MT7925)
62ee1c4b linux-firmware: update firmware for MT7925 WiFi device
a142ad72 WHENCE: Add sof-tolg for mt8195
fe16af92  linux-firmware: Update firmware file for Intel BlazarI core
c69bd749 qcom: Add link for QCS6490 GPU firmware
f4f5689f qcom: update gpu firmwares for qcs615 chipset
a6f3ab98 cirrus: cs35l56: Update firmware for Cirrus Amps for some HP laptops
048795ee ath11k: move WCN6750 firmware to the device-specific subdir
8a7bde2c xe: Update LNL GSC to v104.0.0.1263
e0ee2f91 i915: Update MTL/ARL GSC to v102.1.15.1926
987607d6 amdgpu: DMCUB updates for various AMDGPU ASICs
f9a502ab mediatek: Add sof-tolg for mt8195
1c289f28 i915: Add Xe3LPD DMC
c2379c61 cnm: update chips&media wave521c firmware.
71f8f3e0 linux-firmware: Add firmware for Cirrus CS35L41
65c4b9b7 linux-firmware: Update firmware file for Intel BlazarU core
4f397306 Makefile: error out of 'install' if COPYOPTS is set
2f046411 check_whence.py: skip some validation if git ls-files fails
feb324e3 qcom: Add Audio firmware for X1E80100 CRD/QCPs
3d45353e amdgpu: DMCUB updates forvarious AMDGPU ASICs
c569ca45 brcm: replace NVRAM for Jetson TX1

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17079
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 24c8f06807181a5fb3a63a74e5ee73d68c6d59f0)
2024-12-10 01:06:10 +01:00
Robert Marko
863d1a634e qualcommax: ipq807x: add Netgear DEVICE_VARS
Add NETGEAR_BOARD_ID and NETGEAR_HW_ID to DEVICE_VARS as multiple devices
set them in their recipes, so without them being added to DEVICE_VARS then
simply the value from last recipe that gets evaluated is used and images
are generated with the wrong ID-s.

Link: https://github.com/openwrt/openwrt/pull/17203
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 1b6f7ec6794233fbf7c1cf17dcee34053c08fa9c)
2024-12-08 09:59:16 +01:00
Tianling Shen
50ec871dc6
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-08 14:20:00 +08:00
Bohdan Chubuk
45f9f15512
generic: mtd: spinand: add support for FORESEE F35SQA001G
Add support for FORESEE F35SQA001G SPI NAND.

Similar to F35SQA002G, but differs in capacity.
Datasheet:
  -  https://cdn.ozdisan.com/ETicaret_Dosya/704795_871495.pdf

Tested on Xiaomi AX3000T flashed with OpenWRT.

Signed-off-by: Bohdan Chubuk <chbgdn@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16915
(cherry picked from commit 1269a836edc45a42ab1e76dcd20e8cd8325529da)
Link: https://github.com/openwrt/openwrt/pull/17188
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-12-06 15:12:46 +01:00
Bohdan Chubuk
f483de4767
generic: mtd: spinand: add support for FORESEE F35SQA002G
Add support for FORESEE F35SQA002G SPI NAND.
Datasheet:
  https://www.longsys.com/uploads/LM-00006FORESEEF35SQA002GDatasheet_1650183701.pdf

Refresh all affected patch with make target/linux/refresh.

Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Bohdan Chubuk <chbgdn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16915
(cherry picked from commit 5348e2e81ad9d6cc34bee1511bff7805386205d4)
Link: https://github.com/openwrt/openwrt/pull/17188
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-12-06 15:12:42 +01:00
Hauke Mehrtens
c995dd97c7 OpenWrt v24.10.0-rc2: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-03 22:24:36 +01:00
Hauke Mehrtens
66e76aa94f OpenWrt v24.10.0-rc2: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-03 22:24:32 +01:00
Christian Marangi
ea17e958b9
build: Unconditionally append kmod feed for BuildBot
Recent changes to BuildBot config moved the kmods to a dedicated
directory and dropped them from the packages dir. This was needed as
both OPKG and APK gets confused if both entry are present.

To fix this, unconditionally append the kmod feed line if
CONFIG_BUILDBOT is enabled.

Fixes: #17146
Link: https://github.com/openwrt/openwrt/pull/17151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 53ee2e8c0339c1d7ace47b8cf390147b86ea8d1d)
2024-12-03 12:41:08 +01:00
Tianling Shen
189865d080
ImmortalWrt v24.10.0-rc1: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-02 18:20:23 +08:00
Tianling Shen
e91303616c
ImmortalWrt v24.10.0-rc1: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-02 18:20:23 +08:00
Tianling Shen
ed4f046c35
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-02 18:17:58 +08:00
Hauke Mehrtens
5601274444 OpenWrt v24.10.0-rc1: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-02 00:22:14 +01:00
Hauke Mehrtens
41714984df OpenWrt v24.10.0-rc1: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-02 00:22:08 +01:00
Tianling Shen
06513b1850
x86: update intel i915 fw package name
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-01 15:42:23 +08:00
Tianling Shen
260d5fbf9a
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-01 15:40:18 +08:00
INAGAKI Hiroshi
d276b4c91a Revert "ath79: elecom,wab: use nvmem"
This reverts commit 70e41d0205d95386881fa1cdf6ee00f6cca1b3f6.

"ethaddr" is stored into the "u-boot-env" (stock: "Config") partition
and it's quoted with double-quotations, but that format is not supported
by the current NVMEM u-boot-env driver (and mac_pton() function) and the
MAC address won't be parsed to byte array.
This causes random MAC addresses on the adapters, so revert the above
commit.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17116
(cherry picked from commit af611bce44d3dcffd47c47f46b95400445498be9)
Link: https://github.com/openwrt/openwrt/pull/17117
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-29 18:25:36 +01:00
Petr Štetiar
c981096416
tools: ccache update to 4.10.2
Fixes since 4.10:

 * Fixed detection of Fmt version 11 and newer.
 * Fixed prefix command lookup from PATH.

Suggested-by: Jen Wolf <jenwolf@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/17105
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 08f12283c7436814cdd10d93b5cb913f49acad3e)
2024-11-29 11:29:42 +00:00
Petr Štetiar
de8a1a1e3a
mediatek: filogic: Cudy WR3000S v1: fix CRLF line endings
DTS file for this device seems to be using CRLF line endings, so lets
convert them into Unix-style LF.

Fixes: faf4b3e0f7a5 ("mediatek: filogic: add support for Cudy WR3000S v1")
Link: https://github.com/openwrt/openwrt/pull/17096
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 30ae0b3f1e331646054d8110e931dfaa32f7b414)
2024-11-29 11:29:06 +00:00
Petr Štetiar
17bdccb4a5
apk: mark package as broken to hide it by default
During the last OpenWrt developer meeting 2024-11-26 it was decided,
that 24.10 will be the last release using opkg package manager and thus
apk won't be supported, so make it explicit and mark apk package manager
as broken.

References: https://openwrt.org/meetings/20241126#release_2410
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:43 +00:00
Hauke Mehrtens
2c3d036fe7
config: Mark USE_APK broken
This will hide the USE_APK setting in OpenWrt 24.10 by default.

APK is not stable yet and we do not want to support it in OpenWrt 24.10 branch.

References: https://openwrt.org/meetings/20241126#release_2410
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [meeting notes ref, config]
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:41 +00:00
Hannu Nyman
7eec852c06
gdb: Fix description for apk, remove backtick
Remove backtick from gdb description text, as that seems to
be recognized as a shell action by compilation with apk,
causing error.

Example from test buildbot:
 rstrip.sh: /builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/gdb-15.2/ipkg-aarch64_generic/gdb/usr/bin/gdb: executable
 bash: -c: line 1: unexpected EOF while looking for matching ``'
 bash: -c: line 2: syntax error: unexpected end of file
 make[3]: *** [Makefile:123: /builder/shared-workdir/build/sdk/bin/packages/aarch64_generic/base/gdb-15.2-r1.apk] Error 2

Local compilation:
 rstrip.sh: /OpenWrt/aarch64/build_dir/target-aarch64_cortex-a53_musl/gdb-15.2/ipkg-aarch64_cortex-a53/gdb/usr/bin/gdb: executable
 bash: -c: line 1: unexpected EOF while looking for matching ``'
 make[2]: *** [Makefile:123: /OpenWrt/aarch64/bin/packages/aarch64_cortex-a53/base/gdb-15.2-r1.apk] Error 2

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/16908
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit adb921c34ff220951a699665bb35dc0e3538b3b2)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:39 +00:00
George Oldfort
8c616ccf24
mediatek: remove ktd-202x driver filogic image (Aer Vero W6m)
Image build fails with PR #16861 merged while PR #16860 not merged.

Removing kmod-leds-ktd202x from filogic.mk will fix the build process.

Fixes: 2898d1d1269a ("mediatek: add support for Acer Predator W6d and Acer Vero W6m")
Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/17087
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1bdb6d84046ec1c47f28c57651358470ed212ec3)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:37 +00:00
John Audia
9e73f794ad
kernel: enable pressure interface
PSI provides a canonical way to see resource pressure increases as
they develop, with pressure metrics for three major resources:
memory, CPU, and IO. PSI stats are like barometers that provide
fair warning of impending resource shortages, enabling users to
take more proactive, granular, and nuanced steps when resources
start becoming scarce.

References:
* https://www.kernel.org/doc/html/latest/accounting/psi.html
* https://lwn.net/Articles/759781/

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/13819
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit eed39d45c2ff901b5327c7ab63c9131166e3140e)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:35 +00:00
Mikhail Zhilkin
c312295b56
mediatek: Routerich AX3000: add OpenWrt U-Boot layout
This commit adds OpenWrt U-Boot layout support for Routerich AX3000. The
aims:
1. Get open-source U-Boot;
2. Get maximum available free space in OpenWrt.

Install
-------
1. Copy OpenWrt ubootmod-bl31-uboot.fip, ubootmod-preloader.bin, to the
   /tmp folder of the router using scp.

2. Make mtd partitions backups:
   http://192.168.1.1/cgi-bin/luci/admin/system/flash -> Save mtdblock
   contents

3. Install kmod-mtd-rw:
```
opkg update && opkg install kmod-mtd-rw
```

4. Write FIP and preloader:
```
insmod mtd-rw i_want_a_brick=1
mtd unlock BL2
mtd erase BL2
mtd write /tmp/ubootmod-preloader.bin BL2
mtd unlock FIP
mtd erase FIP
mtd write /tmp/ubootmod-bl31-uboot.fip FIP
```

5. Copy OpenWrt ubootmod-initramfs-recovery.itb to the tftp server root
   with IP 192.168.1.254.

6. Reboot router:
```
reboot
```
U-Boot will automatically download from the tftp server and boot OpenWrt
initramfs system.

7. Copy OpenWrt ubootmod-squashfs-sysupgrade.itb to the /tmp dir of the
   router using scp.

8. Run sysupgrade:
```
sysupgrade -n /tmp/squashfs-sysupgrade.itb
```

Recovery
--------
1. Place OpenWrt initramfs-recovery.itb image (with original name) 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.

BL2 and FIP recovery
--------------------
Use mtk_uartboot and UART connection if BL2 or FIP in UBI is destroyed:
Link: https://github.com/981213/mtk_uartboot

Return to stock:
----------------
1. Copy partition backups (BL2.bin and FIP.bin) to the /tmp dir of the
   router using scp.

2. Install kmod-mtd-rw:
```
opkg update && opkg install kmod-mtd-rw
```

3. Restore stock U-Boot and reboot:
```
insmod mtd-rw i_want_a_brick=1
mtd unlock BL2
mtd erase BL2
mtd write /tmp/BL2.bin BL2
mtd unlock FIP
mtd erase FIP
mtd write /tmp/FIP.bin FIP
reboot
```

4. Open U-Boot web recovery, upload stock firmware image and start
   upgrade.
Link: http://192.168.1.1

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16791
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d413163832df93c321eef3fce8c4f72c350d5308)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:33 +00:00
Mikhail Zhilkin
ba95a01cbf
uboot-mediatek: add Routerich AX3000 support
Add U-Boot replacement loader for Routerich AX3000.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16791
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c0581520b1c53fe2fc4a310f916590dcc428474a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:31 +00:00
Mauri Sandberg
fd7b1f60ea
ramips: dna_valokuitu-plus-ex400: clean-up image creation
Code cleanup. Simplify and unify how kernel image is passed to
Build/dna-bootfs

Signed-off-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/16811
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ec839c786ca56c6143257b89f146aeafbb6cfd3a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:29 +00:00
Shiji Yang
0a0950614b
ramips: mt76x8: disable unused Ralink systick driver
The mt76x8 series SoCs use the MIPS generic systick timer. Sync the
upstream Ralink systick driver changes and disable it for mt76x8
target to reduce the kernel size.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16844
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0c57510cedeff9caf795930ff86a436aa54bcc6d)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:27 +00:00
Hauke Mehrtens
67269ae51e
kernel: usb: kmod-usb-audio: Fix dependency
Change the dependency on the kmod-media-controller from depends to
select.

Fixes: 109592524663 ("kernel: add kmod-media-controller dependency for kmod-usb-audio")
Link: https://github.com/openwrt/openwrt/pull/17058
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b7dd70a0d708b7f8fe9f5c95d09013245e3dcb6b)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:25 +00:00
Hauke Mehrtens
1b2adb8000
stm32: Remove unnecessary kernel options
These options are filtered out since some weeks, remove them also from
the new stm32 target.

Fixes: 851e7f77e424 ("stm32: add new stm32 target")
Link: https://github.com/openwrt/openwrt/pull/17058
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ea2c860225b8bbda98ed0526dc670825866835b6)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:23 +00:00
Hauke Mehrtens
888e879d7f
CI: labeler: Add stm32 target
Add a label for changes in the stm32 target.

Fixes: 851e7f77e424 ("stm32: add new stm32 target")
Link: https://github.com/openwrt/openwrt/pull/17058
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit eb7aa07a0e23e931579de07e0dbdec735b8e35b2)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:21 +00:00
Hauke Mehrtens
2544e03d10
dropbear: bump to 2024.86
- update dropbear to latest stable 2024.86;
  for the changes see https://matt.ucc.asn.au/dropbear/CHANGES

Link: https://github.com/openwrt/openwrt/pull/17053
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit a9d3c5b4c9bf910d4b3b42109161b1f6526b76eb)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:19 +00:00
Hauke Mehrtens
005f086752
x86: Deactivate kernel options with extra overhead
Deactivate CONFIG_CONTEXT_TRACKING_USER_FORCE: Force user context
tracking: This is a testing feature which should not be activate in
production environments according to the Kconfig help. It adds an extra
overhead.

Deactivate CONFIG_RCU_NOCB_CPU_DEFAULT_ALL: Offload RCU callback
processing from all CPUs by default: This option should only be used in
aggressive HPC or real-time workloads which we do not have in OpenWrt.
For normal workloads it increases the number of context switches.

In the default Arch Linux kernel both options are not activated.

Fixes: 31111680f6fc ("x86: switch config to a tickless kernel")
Link: https://github.com/openwrt/openwrt/pull/17057
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ed523454454965da07c9c7a009ae0a3995aa7c33)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:17 +00:00
David Ignjic
4779e954fa
mediatek: filogic: add support for Cudy WR3000S v1
Hardware
--------
MediaTek MT7981 WiSoC
256MB DDR3 RAM
128MB SPI-NAND (XMC XM25QH128C)
MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5)
UART: 115200 8N1 3.3V

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

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

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

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

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

4. Download and boot the OpenWrt initramfs image.

   $ tftpboot 0x46000000 cudy3000s.bin; bootm 0x46000000

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

Signed-off-by: David Ignjic <ignjic@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16939
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit faf4b3e0f7a583a8fa1a65b302ac74457e48575f)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:15 +00:00
George Oldfort
60e21548e5
mediatek: add support for Acer Predator W6d and Acer Vero W6m
This commit adds support for two variants of the already supported router
Acer Predator Connect W6: The Acer Predator Connect W6d (W6 without 6 GHz
wifi) and the Acer Connect Vero W6m (W6 without 2.5G eth1 port, usb3 port,
and the 6 on-board gpio RGB LEDs, and with a KTD2026 RGB LED controller
instead of the KTD2061 LED controller of the W6/W6d).

The device tree for the W6m refers to the KTD202x driver suggested in
PR #16860.

Patching target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
removes the code repetition in (old) lines 121 to 124 on the occasion.

This is the last of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 2898d1d1269a841e5bb8673801bd2a04ad120031)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:13 +00:00
George Oldfort
d491100f01
mediatek: improve device tree for Acer Predator Connect W6
In order to prepare for OpenWrt support other Acer W6 devices and to get
a step further to full hardware support for Acer Predator Connect W6, this
commit
- adjusts the product name ("Acer Predator Connect W6")
- updates gpio LED labels to function/color scheme
- show router status by using first rgb led instead of it's red color only
  (blue: booting/failsafe mode; red: sysupgrade; green: running – was: red)
- changes switch/eth1 led configuration to reflect RX/TX activity and speed
  (green: full 1Gbps/2.5Gbps speed; amber: lower speed; blink: RX/TX)
- shortens dummy dm-mod.create string in bootargs
- enables W6's i2c interface

This is the third of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d42075dcefa407a03a30663879688475bb912729)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:11 +00:00
George Oldfort
fd0f608d66
mediatek: make use of Acer Predator Connect W6's u-boot environment
In order to prepare OpenWrt support for other Acer W6 devices and to adapt
the procedure to read and set mac addresses which other devices of the same
target are using (instead of needing an additional script and creating an
additional structure in the file system), this commit
- reads device mac addresses from u-boot environment
- avoids the detour via the file system to set the mac addresses
- drops redundant file /lib/preinit/05_extract_factory_data.sh

The idea and the implementation were thankfully taken from PR #16410.

This is the second of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e7aaba2587e57dbd157899f7a2215ec6b7af5f89)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:09 +00:00
George Oldfort
a07c241b81
mediatek: split Acer/W6 dts into W6 common dtsi and device specific dts
In order to prepare OpenWrt support for other Acer W6 devices, this commit
moves all device tree components that are used by all Acer W6/W6e/W6d/W6m
routers from mt7986a-acer-predator-w6.dts to mt7986a-acer-w6-common.dtsi
(new file) and includes this dtsi file in mt7986a-acer-predator-w6.dts.

Minor changes had to be made to the device tree in order to improve clarity
and – notably – to reduce the number of dtc warnings:
- replace (obviously wrong) led@<N> gpio led entities by led-<N>
- remove unnecessary (default-state = "off") gpio led statements
- rename entity “memory” to “memory@0”
- add missing #address-cells and #address-size in /soc/mmc@11230000
- add missing #address-cells and #address-size in /soc/pcie@11280000
- introduce symbols “nvmem” and “swport0” in dtsi (referenced in dts)

The changes were checked with `diff -BEZbdtwy --suppress-common-lines ...`
(comparing two dts files created using old and new fdt-1 blobs again), see
https://github.com/openwrt/openwrt/pull/16861/#issuecomment-2455680020 .

This is the first of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ce3b36b3d5374709b9b091390cb9053657be17fa)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:07 +00:00
Joerg Bayer
25973eab22
linux-firmware: Add support for Intel AX411
Add support for Intel AX411 CNVio2 device.

Signed-off-by: Joerg Bayer <sg-o@live.de>
Link: https://github.com/openwrt/openwrt/pull/15153
[squashed and updated commit description, update to version 89]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c89ed7acc897794b06b61f10d8f641ee06fbaacf)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:05 +00:00
Tim Noack
0b4d831886
ath79: add support for TP-Link CPE710-v2
TP-Link CPE710-v2 is an outdoor wireless CPE for 5 GHz with one Ethernet
port based on the AP152 reference board. Compared to the CPE710-v1, the
only change observed in hardware is that the mdio address of the ethernet
physical changed from 0x4 to 0x0.

Specifications:
- SoC: QCA9563-AL3A MIPS 74kc @ 775MHz, AHB @ 258MHz
- RAM: 128MiB DDR2 @ 650MHz
- Flash: 16MiB SPI NOR Based on the GD25Q128
- Wi-Fi 5Ghz: ath10k chip (802.11ac for up to 867Mbps on 5GHz wireless
  data rate), based on the QCA9896
- Ethernet: one 1GbE port
- 23dBi high-gain directional 2×2 MIMO parabolic antenna
- Power, LAN, WLAN5G Blue LEDs

Flashing instructions:
Flash factory image through stock firmware WEB UI or through TFTP
To get to TFTP recovery just hold reset button while powering on for around
30-40 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP address:192.168.0.254

Signed-off-by: Tim Noack <tim@noack.id>
Link: https://github.com/openwrt/openwrt/pull/16637
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5572e0196a93604716ec36ebb8db6737fc6677aa)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:03 +00:00
Tim Noack
1e0f790d23
ath79: refactor dts of TP-Link CPE710-v1
This is done in preparation of adding support for the CPE710-v2,
which uses a similiar device tree.

Signed-off-by: Tim Noack <tim@noack.id>
Link: https://github.com/openwrt/openwrt/pull/16637
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 832cc8ce04122ea726178687b5168187b2465f7f)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:49:01 +00:00
Vaclav Svoboda
50ee6adc5a
ramips: mt76x8: Add support for Zbtlink ZBT-WE2426-B
The Zbtlink ZBT-WE2426-B is an indoor dual band WiFi router
with 4 external non detachable antennas and 5 Fast Ethernet ports.

Hardware of ZBT-WE2426-B:
- SoC: MT7628AN
- RAM: 64 MB (Winbond W9751G6K8-25)
- Storage: 8 MB SPI flash (S25FL064K)
- Ethernet: 5x 10/100 Mbps LAN1,LAN2,LAN3,LAN4 & WAN
- Wireless: 2.4GHz: on SoC (802.11b/g/n)
- Wireless: 5GHz: Mediatek MT7612EN (802.11n/ac)
- LEDs: 8x
- Buttons: 1x reset
- USB: 1x 2.0
- MicroSD slot: 1x
- Power: 9 VDC, 1 A
- Uart: GND TX RX PWR - J1 on the PCB
- Board silkscreen: "ZBT-WE2426-C V04" "2018-02-28" "CTT" "13 18"

Backup the stock firmware, settings and calibration data:
This router comes with PandoraBox OpenWrt firmware, so it is
possible to get all MTD partitions using scp.

Installation:
- Using the bootloader web server. Hold the reset button while turning
  the power on. Upload the sysupgrade image on http://192.168.1.1.
- Using the sysupgrade command in PandoraBox OpenWrt.

LEDs:
- LAN1,LAN2,LAN3,LAN4,WAN,WLAN2G use GPIO pins of the MT7628AN SoC
  (GPIOs 43,42,41,40,39,44)
- WLAN5G uses pin of MT7612EN.
- The POWER LED is directly connected to the VCC. It can be reconnected to
  the GPIO 37 of the MT7628AN SoC by resoldering SMD resistor on the PCB.

Buttons:
- The RESET button is connected to the GPIO 38 of the MT7628AN SoC.

MAC addresses as verified by OEM firmware:
use   address   source
2g    *:b0      factory 0x4 (label)
5g    *:b1      factory 0x8004
LAN   *:b2      factory 0x28
WAN   *:b3      factory 0x2e

Signed-off-by: Vaclav Svoboda <svoboda@neng.cz>
Link: https://github.com/openwrt/openwrt/pull/16927
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 3a9752ea027b8969750c0dd7f89b6afc357dcffa)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:59 +00:00
Rosen Penev
1b513604c3
mvebu: devm for mutex_init
It's common to avoid calling mutex_destroy when done. It's not correct
strictly speaking.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16753
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6280b4abfbc087157bc233083a67a42bffa31010)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:57 +00:00
Rosen Penev
35b7bbf355
mxs: run kernel_oldconfig
small change.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16913
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 55644397cd3cb3d8c77d74c9d22872502d091257)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:55 +00:00
Antonio Pastor
b2f3713801
kernel: modules: appletalk: add for Netatalk v4
Netatalk v4 reintroduces AppleTalk and this module is required for
layer 3 protocol support.

Module was removed in kernel 4.14 for OpenWrt 18.06 (commmit
14a0131, 22/02/2018). At the time nothing used it as Netatalk v3
did not support AppleTalk.

Not building ipddp feature/module like it was in the past, as
recommended by upstream Netatalk maintainers.

Signed-off-by: Antonio Pastor <antonio.pastor@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16979
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5eb25dddb17fa3cf4958e91dfc9fc868c9eb03ac)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:53 +00:00
Thomas Richard
58f4667a37
stm32: add new stm32 target
New stm32 target introduces support for stm32mp1 based devices.
For now it includes an initial support of the STM32MP135F-DK device.
The specifications bellow only list supported features.

Specifications
--------------

SOC: STM32MP135FAF7
RAM: 512 MiB
Storage: SD Card
Ethernet: 2x 100 Mbps
Wireless: 2.4GHz Cypress CYW43455 (802.11b/g/n)
LEDs: Heartbeat (Blue)
Buttons: 1x Reset, 1x User (USER2)
USB: 4x 2.0 Type-A

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 851e7f77e424f24cda8531330f2d82ebc942c0a4)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:51 +00:00
Thomas Richard
4eb85c47bd
kernel: package v4l2-async and v4l2-fwnode drivers
These packages are needed for the stm32/stm32mp1 subtarget.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e109831e07e398cc50839a30a1cf18c4436983f4)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:49 +00:00
Thomas Richard
e654d55446
kernel: add kmod-media-controller dependency for kmod-usb-audio
The snd-usb-audio drivers uses media controller if media controller is set.
So add kmod-media-controller as dependency.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 109592524663ae8bbda47e4ad51a124153a1c903)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:48 +00:00
Thomas Richard
c584683a7f
kernel: package media controller driver
It is needed for the stm32/stm32mp1 subtarget.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit bb3418f21f7b8fe0dcd335375d183dd2a81772bf)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:46 +00:00
Thomas Richard
27afd9e1ca
kernel: package industrialio-buffer-cb driver
It is needed for the stm32/stm32mp1 subtarget.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b0adf5e0fdc0d4b449bced9191a95bf08124c1ac)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:44 +00:00
Thomas Richard
2f99171de3
kernel: package crypto_engine driver
It is needed for the stm32/stm32mp1 subtarget.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 7bcc68ede36dcc66ec6cdb45c3201e0af0f90708)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:42 +00:00
Thomas Richard
0f301db3ff
kernel: unset CONFIG_DEVFREQ_THERMAL in kmod-thermal package
It is needed for the stm32/stm32mp1 subtarget.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6b9df468f05fefa21a8cbce2fdb2e59692b4d246)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:40 +00:00
Thomas Richard
2950e189ce
kernel: package snd-soc-dmic driver
It is needed for the stm32/stm32mp1 subtarget.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e606366a2e018e0a3b25e3dd4b3a937bb53c70e1)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:38 +00:00
Thomas Richard
956bb0c2a4
kernel: package industrialio-hw-consumer driver
It is needed for the stm32/stm32mp1 subtarget.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ff96bd84ce0bae633007cf0de82d69796cf3508a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:36 +00:00
Thomas Richard
72bf1db35c
murata-nvram: add new package
This package contains nvram files for Murata's Wi-Fi/Bluetooth modules.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit be937952fdf8f78fb45ea001258074ddb45e0891)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:34 +00:00
Thomas Richard
c3db0cca0f
murata-firmware: add new package
This package contains firmwares provided by Murata.
See https://community.murata.com/.

Murata firmwares are used by wifi chip on stm32 boards.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 960f5f94d7cefe89abd41347124fd3f0fbb945ae)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:32 +00:00
Thomas Richard
911b25d618
mac80211: enable CONFIG_BRCMFMAC_SDIO for stm32
All stm32 devices use BCM43430 Wi-Fi interface in SDIO mode.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 456e0aad97413816aee41e68b3d3cfdfadc2fd43)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:30 +00:00
Thomas Richard
d921c2db0b
arm-trusted-firmware-stm32: add ATF for stm32 boards
Add ATF for stm32 boards, with the first being STM32MP135F-DK.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 08dcb73c8d05aa774957422731bfed1b322648d7)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:28 +00:00
Thomas Richard
fd9de585d7
uboot-stm32: add U-Boot for stm32 boards
Add U-Boot for stm32 boards, with the first being STM32MP135F-DK.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ac79ad0757764028a138d0138c8d9aa74420f9ed)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:26 +00:00
Thomas Richard
c93e7700d4
optee-os-stm32: add OP-TEE for stm32 boards
Add OP-TEE for stm32 boards, with the first being STM32MP135F-DK.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit fae25d4001bcbae0bb1ce60b676bd421e97d78fc)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:24 +00:00
Thomas Richard
480aed0c72
build: add generic build template for optee-os packages
Add a generic template include/optee-os.mk to build OP-TEE.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit dedb90e8f82a179ad67b6eac3b6f8862b9183077)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:22 +00:00
Romanov Danila
fb4088cdec
mediatek: change Routerich AX3000 ubi size
All new routers are shipped with ubi size 112MB since early September.
Bootloader update required (ask vendor , see wiki)

These partitions weren't used:
firmware_backup
zrsave
config2

Signed-off-by: Romanov Danila <pervokur@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16686
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d8a9669093359d60f4d6f183b58a22f24cf01731)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:20 +00:00
Til Kaiser
8eb07120a2
x86: add all ports to the Gowin 1U default network config
Commit e52c57bb1b30375e0bcc5523db76a672a4a8b4a4 renamed all
network ports to match the faceplate of the Gowin 1U Rack
Mount Server and added the br-lan bridge for the eth* ports.

This commit adds the PoE port to the br-lan bridge and a
br-wan bridge for the two SFP ports so that all ports are
part of the default network configuration.

Signed-off-by: Til Kaiser <mail@tk154.de>
Link: https://github.com/openwrt/openwrt/pull/16965
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 75af6a0d736a696ca726cb44d813791858c29f0c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:18 +00:00
Shiji Yang
2d3ad35537
ramips: sync upstream Ralink clock patches
1. Add sdhc clock for MT7620 and MT76x8 SoCs.
2. Fix clock driver warning for RT2880, RT305x and RT3883.

Link: https://lore.kernel.org/all/20240910044024.120009-1-sergio.paracuellos@gmail.com/
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/17037
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 7bb99bca3dfd878e6ad950b218c0cb96d36d14f4)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:16 +00:00
Robert Marko
7a945bf88b
Revert "mediatek: fix pwn fan settings for sinovoip bpi-r3"
This reverts commit 3467ea905b40f0df87700a15b716b1f5a4efc955.

I merged it by accident.

Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 52b6c9247997e51a97f13bb9e94749bc34e2d52e)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:14 +00:00
Mikhail Kshevetskiy
f93bba30d7
mediatek: fix pwn fan settings for sinovoip bpi-r3
Popular bpi-r3 pwm fans like this one

  https://www.amazon.com/youyeetoo-Barebone-Fan-BPI-R3-Integrated/dp/B0CCCTY8PS

will not work properly with current openwrt-23.05/24.10 firmware.
Trying different pwm setting

  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
  -----------------------------------------------------------------

At the moment we have following cooling levels:

  cooling-levels = <255 96 0>;

for cpu-active-high, cpu-active-medium and cpu-active-low modes correspondingly.
Thus only cpu-active-high and cpu-active-low are usable. I think this is wrong.

This patch fixes cpu-active-medium settings for bpi-r3 board.

PS: I know, the patch is not ideal as it can break pwm fan for some users.
    There are some peoples that use handmade cooling solutions, but:
      * discussed cooler is the only 'official' pwm cooler for bpi-r3
        available on the market.
      * most peoples will use passive cooling available on the market or
        the discussed cooler.
      * the pwm-fan dts section was added before the official cooler
        appears on the market.
    Thus it should not be a lot of harm from this fix.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16974
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 3467ea905b40f0df87700a15b716b1f5a4efc955)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:12 +00:00
Rosen Penev
77de80d9db
mpc85xx: p2020: add missing symbols
Since kernel_oldconfig doesn't work properly with it, I ran that first
and then moved all the config symbols to config-6.6 and found the
differences.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16847
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 22664498ebdd47aad9b15f62edbcaadd851fd62c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:10 +00:00
Rosen Penev
b17413117d
mpc85xx: p1020: add missing symbols
Since kernel_oldconfig doesn't work properly with it, I ran that first
and then moved all the config symbols to config-6.6 and found the
differences.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16847
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit bec8edb6d61eb74e8d7578749560cbb5040f307a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:08 +00:00
Rosen Penev
ac2d91329e
mpc85xx: p1010: add missing symbols
Since kernel_oldconfig doesn't work properly with it, I ran that first
and then moved all the config symbols to config-6.6 and found the
differences.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16847
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit e9dd6da91661612d2330c2b633f3dd55b93218f8)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:06 +00:00
Rosen Penev
7afbe22599
mpc85xx: run make kernel_oldconfig
Adjusts the default config to modern kernels.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16847
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 890d47b60a221328bbf05518eedc35ac5bd922f1)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:04 +00:00
He Ping
9a09c54449
odhcp6c: update to Git HEAD (2024-09-25)
b6ae9ffaeb0e odhcp6c: allow to request specific ipv6 prefix

Signed-off-by: He Ping <pinghejk@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17013
Signed-off-by: Petr Štetiar <ynezz@true.cz> [hash, commit]
(cherry picked from commit b0312c10818f36bc6e61a518bb528d2809562796)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:02 +00:00
Robert Marko
57ac0965cf
omnia-eeprom: depend only on subtarget
Now that omnia-eeprom is marked nonshared building the cortex-a9 mvebu
subtarget will fail with:
ERROR: unable to select packages:
  omnia-eeprom (no such package):
    required by: world[omnia-eeprom]

This is because omnia-eeprom depends on TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia
which will not be satisfied in buildbots since CONFIG_TARGET_ALL_PROFILES
and CONFIG_TARGET_PER_DEVICE_ROOTFS are set in which case
CONFIG_TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia is not set.

So, lets simply depend on the mvebu/cortex-a9 subtarget.

Fixes: 371e7bef4046 ("omnia-eeprom: Mark it nonshared")
Link: https://github.com/openwrt/openwrt/pull/17007
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 90de3b277b8e1d121b2f7023578979c6b616167f)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:48:00 +00:00
Robert Marko
69eecbef91
generic: add CONFIG_FB_INTEL
CONFIG_FB_INTEL is now visible on x86 since i915 driver is packaged as kmod
now and it stops compilation, so add it to the generic config.

Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 57daea682e1c6e6da91f92efed717159f9ffffb0)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:58 +00:00
Sergey Ponomarev
908975850d
dropbear: use config_get_bool enable
The config_get_bool also works with on/off, yes/no, true/false.
Add 'main' section name. This will make it easier to change settings from uci.
Add a link to documentation.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15579
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 4511fa4b30f73185597990ce563bbf3f96385292)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:56 +00:00
Rosen Penev
7142e35777
kernel: filter out compiler opts from config
These get dynamically set based on compiler version. Not relevant for
targets.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16770
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit cd92cbddf8c473507a9af290c99f2aef8c368784)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:54 +00:00
Rosen Penev
4b9739a0f1
kernel: remove GCC11_NO_ARRAY_BOUNDS
This symbol is no longer present.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16770
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit da8abd4a1e86a37ddcd4fa0e6acc5bf8b1b4c70e)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:52 +00:00
Mieczyslaw Nalewaj
2884aded40
kernel: move CONFIG_INTEL_MEI settings to target generic
Move settings CONFIG_INTEL_MEI_GSC_PROXY, CONFIG_INTEL_MEI_HDCP
and CONFIG_INTEL_MEI_PXP to target generic.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16971
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 84665993d6beed8ac2b557f8d3e005a29e3fd09c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:50 +00:00
Hauke Mehrtens
dae203bd94
omnia-eeprom: Mark it nonshared
This tool was build in the phase 2 build, there the
TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia dependecy was probably
not meat. Mark it as non shared to build it together with the target
where this option is set.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/16975
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 371e7bef4046fb3992ecfb92b5b741c22fa3ade6)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:48 +00:00
Mieczyslaw Nalewaj
abf78dd5d8
kernel: disable drm-i915 module for x86/geode
Disable drm-i915 module for target x86/geode.

Fixes: 77cfe8f ("x86: make i915 as a kmod with required firmware")
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16977
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 226f74badd61fb1586dd3531835aeaa3bf6fe467)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:46 +00:00
Rodrigo Balerdi
05989f69d8
ipq807x: delete unused legacy eMMC sysupgrade code
All ipq807x devices that were using the legacy 'mmc_do_upgrade' eMMC
sysupgrade code were ported to the replacement 'emmc_do_upgrade' code.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16505
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 491121288eaa9d20f3db8215a4790e8f0ee1f8ca)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:44 +00:00
Rodrigo Balerdi
b1c01cd4b5
ipq807x: order devices alphabetically
Alphabetically sort devices in platform.sh

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16505
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 17f84bba44dbee248b3a79935657a74b21caa280)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:42 +00:00
Rodrigo Balerdi
16eb043062
ipq807x: prpl haze & qnap 301w: use the standard eMMC sysupgrade code
Note that the old ad-hoc method did not explicitly align backup data
to 64 KiB boundaries.

Also note that the qnap 301w has a 'rootfs_data' partition in the eMMC
that is being ignored by fstools during boot, presumably due to a bug.
This is why the partition is also ignored in the sysupgrade code and
there is no definition of CI_DATAPART="rootfs_data".

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16505
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit fe481c9c47d97ebde1bc3c959924f4f9227c6c16)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:40 +00:00
Rodrigo Balerdi
1eade612f9
ipq807x: nbg7815: use the standard eMMC sysupgrade code
Note that the old ad-hoc method did not explicitly align backup data
to 64 KiB boundaries.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16505
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 5583d2318966d5d5dcdbdec2e34b8815d3f6419a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:38 +00:00
Ryan Keane
9591c1631d
elfutils: Backport some patches to fix errors
On aarch64 musl gcc 14.x compiler, trying compiling elfutils 0.192 with
lto option enabled will cause null-dereference error.
Example error message:

...
elf_compress.c: In function 'elf_compress':
elf_compress.c:675:26: error: potential null pointer dereference [-Werror=null-dereference]
  675 |           shdr->sh_flags |= SHF_COMPRESSED;
      |                          ^
elf_compress_gnu.c: In function 'elf_compress_gnu':
elf_compress_gnu.c:127:25: error: potential null pointer dereference [-Werror=null-dereference]
  127 |           shdr->sh_size = new_size;
      |                         ^                      ^
...

This is a false postive warning but will abort compilation if gcc has
`-Werror` flag. This commit add a patch for this, see the bugzilla
report below.

This commit backports a series of patches to fix some errors.

Add patch:
- 007-add-libeu-symbols-to-libelf.patch
- 008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch
- 009-fix-null-dereference-with-lto.patch

Link: https://sourceware.org/bugzilla/show_bug.cgi?id=32311
Signed-off-by: Ryan Keane <the.ra2.ifv@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16886
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit afffcd09e5f15be53f327a80ee87d391312eb805)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:36 +00:00
Ryan Keane
d5e45df9c2
elfutils: Add mirrors.kernel.org as mirrror
Add mirrors.kernel.org as mirror, listed on sourceware mirror sites
page.

Link: https://sourceware.org/mirrors.html
Signed-off-by: Ryan Keane <the.ra2.ifv@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16886
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 63caa2b1685ef5d2b4259784085f64cb9e5574a8)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:35 +00:00
Ryan Keane
4166aaf98a
elfutils: Update to 0.192
Add a patch still under review to fix some errors.

Refresh patch:
- 003-libintl-compatibility.patch
- 005-build_only_libs.patch
- 006-Fix-build-on-aarch64-musl.patch

Add patch:
- 102-fix-potential-deref-of-null-error.patch

Release notes are in the link below.

Link: https://inbox.sourceware.org/elfutils-devel/CAJDtP-T3+gXqHWp3T0mejWWbPr0_1tHetEXwfB67-o+zz7ShiA@mail.gmail.com/T/#u
Signed-off-by: Ryan Keane <the.ra2.ifv@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16886
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit f5132df69db50a99e556e6fbd165002aac0e3e38)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:33 +00:00
Markus Stockhausen
d4a26ffd1a
realtek: align kernel config with upstream
Since the start of the Realtek target OpenWrt works with RTL83XX as the
target architecture. Upstream is using MACH_REALTEK_RTL instead. To
simplify further development align that.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16963
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 65964c42f8744ed8ca09448a155b99e3a99be283)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:31 +00:00
Jeronimo Pellegrini
994a95584a
libreadlne: create symlinks for .so
Currently, libreadline only installs

```
 /usr/lib/libhistory.so.8 -> libhistory.so.8.2
 /usr/lib/libhistory.so.8.2
 /usr/lib/libreadline.so.8 -> libreadline.so.8.2
 /usr/lib/libreadline.so.8.2
```

But there is no `libreadline.so` or `libhistory.so` available.

So this happens:

```
root@OpenWRT:~# cat a.c
int main() {
}
root@OpenWRT:~# gcc a.c -lreadline
/usr/bin/ld: cannot find -lreadline: No such file or directory
collect2: error: ld returned 1 exit status
```

Unless, of course, one uses `-l:libreadline.so.8`... But that
doesn't help with binaries that try to dynamically open

`libreadline.so`. I have one of those here (the STklos Scheme
compiler -- I didn't make a PR for it because it's far from
being ready, but one issue is that it does use dlopen to use
readline...)

With the symlink, it works:

```
root@OpenWRT:~# ln -s /usr/lib/libreadline.so.8 /usr/lib/libreadline.so
root@OpenWRT:~#
root@OpenWRT:~# gcc a.c -lreadline
root@OpenWRT:~#
```

Another example: when trying to package rlwrap, the build failed
complaining it could not find readline (using `-lreadline`).
It would then be necessary to change rlwrap's `configure.ac`
(and also in all packages that use readline), but it seems
simpler to add the symlinks...

This PR changes the Makefile so it will include the links.

Signed-off-by: Jeronimo Pellegrini <j_p@aleph0.info>
Link: https://github.com/openwrt/openwrt/pull/16445
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 0000ba6ab8062f965d8fed240b76d36f9a493b55)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:29 +00:00
John Audia
4c22224bcc
x86: switch config to a tickless kernel
This commit fixes and closes #16313.

Switch the x86 kernel's timer to tickless operation which is
more power efficient since it is not woken up by periodic timer
interrupts when idle.  Also add several other options for CPU
idle governors particularly the upstream default for tickless
kernels, CONFIG_CPU_IDLE_GOV_MENU. Without this commit, my AMD
Ryzen 7 5800U can only achieve a minimum core frequency of 1,384
MHz which is over 3x higher than the processor's minimum
frequency of 400 MHz which is accessible with this modification.
In addition to the lower clock rate, I have seen a concomitant
reduction in both idle temps and at-the-wall power consumption.

Summary:
* Idle CPU freqs dropped from 1,384 MHz to 400 Mhz.
* Idle power consumption dropped from 7 W avg to 5 W.
* Idle temps have dropped from 50C on avg to 43C.

There are other well known reasons to switch to a tickless
timer including: reduced interrupt overhead, better use of CPU
resources, and reduced latency to name a few.

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16317
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 31111680f6fc5f17201b02b8ce656b955be56d7a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:27 +00:00
Shiji Yang
be082a7c7e
ppp: remove more unnecessary kernel checks
The ppp package can support all features since Linux 4.7.0 kernel.
Therefore, most kernel version checks can pass unconditionally on
OpenWrt v18.06 and later version. This patch can reduce the size
of ppp package by approximately 2.5 KB.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16695
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3dbe730080e70e96990a5e89cbe2035adcca8d4b)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:25 +00:00
Hauke Mehrtens
7d4be068da
base-files: Mount debugfs and pstore with nosuid,nodev,noexec
These permissions are not needed. Systemd also mounts these file systems
without these permissions on other Linux distributions.

Dropping these permissions should make the system more secure.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/16960
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit b88d51898d126d2f918cb476d4158e9fcd62492c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:23 +00:00
Hauke Mehrtens
71d60c6983
base-files: Create /run and /run/lock folder
Create the folder /run and /run/lock using symlinks. Other Linux
distributions also have these folders and some applications might already
depend on them. Just create symlinks pointing to the older folder.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/16961
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3b710375dd97af1e0416904c4174d11c51e3f09c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:21 +00:00
Joe Zheng
756c955a9c
x86: make i915 as a kmod with required firmware
i915 driver requires to load correct firmware to work on latest x86
GPU, it is more reasonable to make it as a kernel module, so that
initramfs is not required, and it can also save some space from the
kernel image comparing being a built-in driver

Signed-off-by: Joe Zheng <joe.zheng@intel.com>
Link: https://github.com/openwrt/openwrt/pull/16276
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 77cfe8fd15d3d0f77ee16660d06a174f41b53444)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:19 +00:00
Joe Zheng
f59c665660
linux-firmware: rename packages for i915 firmware
Change the package name from intel-igpu-firmware-* to i915-firmware-*,
the prefix "intel-igpu" is misleading, i915 firmware is not only for
iGPU but also for dGPU now.

Remove the redundant "intel" as i915 is already well known.

More accurate file classification to handle following files correctly:

  adlp_dmc.bin
  mtl_huc.bin
  mtl_huc_gsc.bin
  mtl_gsc_1.bin

The pattern in regex is "([[:alnum:]]+)_([[:alnum:]]+)(_[\w-.]+)?\.bin",
where $1 is the platform, $2 is the firmware type (dmc, guc, huc, etc.),
and the optional $3 which is revision or other suffix.

Glob first to narrow down the target file set, and then split with "_"
to extract the firmware type (remove the ".bin" in case there is no $3)

Add package "i915-firmware" as a meta package to install all the i915
firmwares, it is a balance between simplicity and optimization.

* Installing all the available firmwares as a whole, can support all the
  platforms, not only the current one but also the future ones. The
  price to pay is the increased size.
* If we want to minimize the storage, we can customize to install the
  necessary ones only, even for the target platform only (e.g. ADL) and
  skip the others. The price to pay is the time to tune.

What I am going to do is:

* Let drm-i915 driver depend on i915-firmware-dmc, which is small and
  can cover most of the old platforms
* Let the user select i915-firmware to install all the i915 firmwares as
  a whole to cover the latest or future platforms

Signed-off-by: Joe Zheng <joe.zheng@intel.com>
Link: https://github.com/openwrt/openwrt/pull/16276
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit ca00bafd7e05b3f77e38acac6add223ce46df585)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:17 +00:00
Marek Behún
77af73050c
utils: Add the omnia-eeprom utility
Add a new utility, `omnia-eeprom`, which can be used to print / set
EEPROM fields on Turris Omnia.

One example when this utility might be useful is if the board
experiences random crashes due to newer versions of the DDR training
algorithm in newer U-Boot. The user can change the DDR speed from 1600K
to 1333H to solve these issues, with

  ```
  omnia-eeprom set ddr_speed 1333H
  ```

Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://github.com/openwrt/openwrt/pull/16264
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 749a43325b98afe4430fa7e2f23ac3ee44791ad6)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:15 +00:00
Enrico Mioso
f2a40e1117
mediatek: filogic: add support for GatoNetworks GDSP
The GatoNetworks GDSP is a re-branded version of the R5000 5G Industrial
router from Yinghua Technologies.
The re-branded device comes with OpenWrt preinstalled, and an OpenWrt-based
U-Boot bootloader version. While the flash layout has been kept compatible
with the OpenWrt version found on the stock device (see [5]), the image format
changed, making a bootloader upgrade necessary.

Specifications:
SoC: Mediatek MT7981BA
RAM: 256MB
Flash: SPI-NOR 32 MiB (Winbond W25Q256)
WLAN: MT7976CN DBDC AX Wi-Fi
Switch: MT7531AE (4x LAN Gigabit ports, 1x WAN Gigabit port)
5G: Quectel RM520N modem
Watchdog: an external WDT connected to GPIO 6 is present and always running;
          the built-in Mediatek watchdog is also present and effective, but
          not used at the moment.

This porting has been tested only with 1x 5G modems installed (the device
supports up to two).

Installation:
Installation is possible via sysupgrade both in the stock device and
re-branded version. However, in the former case, updating the bootloader is
required.

OpenWrt-based U-Boot Bootloader installation
--------------------------------------------
The firmware flashed in the re-branded device at manifacturing time will
flash an OpenWrt-based U-Boot bootloader with some extra recovery features
(see [1]) at first boot.
To update the bootloader, you need to install the mtd-rw module and
insmod it:

insmod mtd-rw i_want_a_brick=1

Then update relevant flash partitions:

mtd erase u-boot-env
mtd erase BL2
mtd erase FIP
mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-preloader.bin BL2
mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-bl31-uboot.fip FIP

And reboot, making sure all previous commands ran succesfully.
If something goes wrong, you can recover your device via the mtk_uartboot
tool.
In my testing, it was possible to start the process even without (un)-plugging
the device, may be handy for remote recovery.

Installation from stock device and firmware
-------------------------------------------
To install vanilla OpenWrt in the stock device (R5000 5G Industrial router
from Yinghua Technologies) running the stock vendor firmware, you will need
to update your bootloader as described in previous section. Remember to use
-F (force upgrade) and -n (not keeping settings).

U-Boot Recovery
---------------
This procedure has been tested only with the OpenWrt-based U-boot bootloader.
Assign your system static IP address 192.168.1.1 and start a TFTP server. The
device will look for an initramfs image named
openwrt-mediatek-filogic-gatonetworks_gdsp-initramfs-kernel.bin
(so you may use openwrt/bin/targets/mediatek/filogic as root dir for your
TFTP server).
Power on the device while keeping the reset button pressed, until you see
a TFTP request from 192.168.1.10. Your environment will be restored to it's
default state.

MAC addresses assignment
------------------------
MAC addresses are assigned slightly differently than in stock firmware. In
particular, the 5 GHz Wi-Fi uses 2.4 GHZ MAC + 1, rather than reusing it with
LA bit set as done in stock firmware. This MAC address is allocated to the
device, so it can be used.
The 2.4 GHz Wi-Fi MAC address is the label MAC. LAN MAC is used to set the
special U-Boot environment ethaddr variable.

device					MAC address		U-Boot env variable		factory partition offset
2.4 GHz Wi-Fi		:84						wifi_mac							0x4
5.8 GHz Wi-Fi		:85						not present						not present
WAN							:86						wan_mac								0x24
LAN							:87						lan_mac								0x2A

Notes
-----
[1]: the OpenWrt-based U-Boot bootloader you will find installed in the
re-branded device is configured to request for the initramfs image via
TFTP for $gdsp_tftp_tries times before trying normal boot from NOR flash.
Setting this U-Boot environment variable to 0x0 will disable the feature,
which is not implemented in this patch.
[2]: the exposed UART port is connected to ttyS1; the ttyS0 console port is
not exposed.
[3]: the provided bootloader environment has no provision for operating on
BL2 and the FIP partitions. This is an intentional choice to make it
(slightly) more difficult to brick the device.
[4]: it seems GPIO 6 is used both for the "SYS" LED and external WDT.
[5] BL2 expects to find FIP payload at a fixed offset, so some constraints
apply.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
(cherry picked from commit b43194e041b17fbb574fb3721dafedcc30a20ab5)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:13 +00:00
Enrico Mioso
7d9fc260a1
uboot-envtools: add support for GatoNetworks GDSP
This configuration should work with both stock and OpenWrt-based U-Boot.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
(cherry picked from commit 785ebf2baff4adadf818d71a99fdb2d2300590ba)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:11 +00:00
Enrico Mioso
2226546e1c
uboot-mediatek: add support for GatoNetworks GDSP
The GatoNetworks GDSP is a re-branded version of the R5000 5G Industrial
router from Yinghua Technologies.

Advantages over stock bootloader:
1. supports serving the external GPIO WDT, allowing for easier work in U-Boot
   shell
2. supports cool features like netconsole, easy recovery, scripting and so on
3. allows using FIT image and image integrity validation

and ultimately gives you much more flexibility to implement your tweaks.

Known issues
------------
To make it easier to operate the device, console I/O multiplexing support has
been enabled in U-Boot configuration. Setting I/O related U-Boot environment
variables to something like "serial,nc" will have the desired effect. Still,
setting these variables to such a value in the persistent environment will
lead to a crash and make it impossible to boot the system or recover it. I
decided to leave it on anyway since I think it can be very practical in
development.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
(cherry picked from commit 7f2c7b3238ee26180d44528ae98fd2f54e874511)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:09 +00:00
Petr Štetiar
8f0d52d8c4
scripts: download-check-artifact.sh: fix shellcheck and improve
Fixes following shellcheck's recommendations:

 In scripts/download-check-artifact.sh line 24:
	exit $1
             ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

 In scripts/download-check-artifact.sh line 53:
		local sum="$(shasum -a 256 "$image_file")";
                      ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values.

 In scripts/download-check-artifact.sh line 72:
 cd "/tmp/verify.$$"
 ^-----------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

 In scripts/download-check-artifact.sh line 114:
		printf "Keyserver to use? [$keyserver_url] > "
                       ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo".

 In scripts/download-check-artifact.sh line 115:
		read url; case "${url:-$keyserver_url}" in
                ^--^ SC2162 (info): read without -r will mangle backslashes.

While at it make it clear, that it is possible to download/check any
build artifacts like even SDK or ImageBuilder.

Link: https://github.com/openwrt/openwrt/pull/16871
(cherry picked from commit 27c2c140b16cb490f20c1c2259b3decf50ae5762)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:07 +00:00
David S. H. Rosenthal
2942ee0a8d
scripts: add download-check-artifact.sh script
While checking wiki documentation about GPG signatures checking I found
this nice script and I've thought, that it would be nice to provide it
officially instead of some random internet site.

Usage example:

  $ ./scripts/download-check-artifact.sh https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb

  1) Downloading image file
  =========================
  ########################################### 100.0%

  2) Downloading checksum file
  ============================
  ########################################### 100.0%

  3) Downloading the GPG signature
  ================================
  ########################################### 100.0%

  4) Verifying GPG signature
  ==========================
  gpg: Signature made Tue 05 Nov 2024 05:21:50 PM UTC
  gpg:                using EDDSA key 92C561DE55AE6552F3C736B82B0151090606D1D9
  gpg: Good signature from "OpenWrt Build System (Nitrokey3) <contact@openwrt.org>" [ultimate]
  Primary key fingerprint: 8A8B C12F 46B8 36C0 F9CD  B36F 1D53 D187 7742 E911
       Subkey fingerprint: 92C5 61DE 55AE 6552 F3C7  36B8 2B01 5109 0606 D1D9

  5) Verifying SHA256 checksum
  ============================
  openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb: OK

  Verification done!
  ==================
  Downloaded artifact placed in '/var/home/ynezz/dev/openwrt/openwrt.git/openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb'

  Cleaning up.

Adding file in a state as downloaded from https://www.abitare.org/bin/download.sh

References: https://openwrt.org/docs/guide-quick-start/verify_firmware_checksum?s[]=gpg#linux
Signed-off-by: David S. H. Rosenthal <dshr@abitare.org>
Link: https://github.com/openwrt/openwrt/pull/16871
(cherry picked from commit 4c9031fda271ed7d4503642f63ff824faa6cc3a0)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:05 +00:00
Sergey Matsievskiy
11d36818b9
build: add comments to makefiles
Add comments to build system makefile functions and variables to help
developers in understanding build system internals and ease the
development process.

This patch adds some documentation examples with proposed doxygen-like
syntax. Hopefully, this would start the discussion and result in
generation of the makefile documentation guidelines.

Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16888
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a72c8c770584075782959f2aa5c1487d68517edd)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:03 +00:00
Robert Marko
03984356bd
qualcommax: ipq60xx: add NSS reserved memory
It seems that despite NSS not being supported in OpenWrt the memory it
usually uses needs to be reserved anyway for stability reasons.

Link: https://github.com/openwrt/openwrt/pull/16928
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 8729d2a64d282d37b69c0853269af401a0102517)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:47:01 +00:00
Paul Donald
7424f58eb6
cryptodev-linux: change home-page URL
Most links and info on the org page are broken or defunct, and all new
versions are available on the github based repo anyway.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16910
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ce0b843ac7d27e124cb9ca13e9a1aeb115fcaf23)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:59 +00:00
Paul Donald
9d44e00fc5
cryptodev-linux: give a coherent description
For the last ten years, nobody has noticed that this driver doesn't
actually say what it is for. ;)

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16910
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 3df5966f9453ecefcabc893f6449c8c4f1054aef)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:57 +00:00
Rosen Penev
655874713e
realtek: rtl83xx: use devm for mutex_init
mutex_destroy is missing in remove.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16926
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 1125ed408c7f0d130b5606ab39e4dd98a41d5f0a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:55 +00:00
Rosen Penev
96ab90a9aa
ramips: mt7621: fix typo
Missing u caused the regulator to fail probe.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16925
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 3e42526404f021094ae3fa41524c396d753f4c6c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:53 +00:00
Rosen Penev
25427d7942
mdadm: backport musl patch
Needed to fix compilation with GCC14.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16912
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 1f3d5858b441cf4e1195b96242dd08d68538e83d)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:51 +00:00
Rosen Penev
67da3d33f3
lantiq: use devm for mutex_init
It's common to avoid calling mutex_destroy when done. It's not correct strictly speaking.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16832
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit fccff963c0a6ba035455daea61566f4d121643e3)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:49 +00:00
Rosen Penev
62690e3b51
lantiq: use more devm for i2c
i2c_add_numbered_adapter is the wrong function to use here. It requires
setting nr to some value, otherwise it behaves the same as
i2c_add_adapter. nr is not set.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16825
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 44824f0b787b13e2f2fccc58256b2c42fa3f9f5d)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:47 +00:00
Rosen Penev
2af51fbdab
treewide: remove THIS_MODULE assignment
Matches upstream coccinelle check: api/platform_no_drv_owner.cocci.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16846
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit cc98cfafd799d502fbe09ddb62bab68633d570f5)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:45 +00:00
Leon M. Busch-George
69fd722edd
hostapd: split long lines
These two were getting rather long.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/16849
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8b6d5874b88bbe2e7a53bcab0e102b8781480880)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:43 +00:00
Marius Dinu
f05d49cfbd
menuconfig: add help description for Stack Smashing Protection options
Descriptions taken from:
https://wiki.osdev.org/Stack_Smashing_Protector

Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
Link: https://github.com/openwrt/openwrt/pull/16897
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit cbf7be9fb37baaaf7ee5c2b6315028bd47c764bc)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:41 +00:00
Rosen Penev
68465e524b
ramips: mt7621: add missing regulator-boot-on
What seems to be happening is that the kernel requests an ACTIVE_LOW
gpio initially and sets it to high later based on gpios in dts.

This seems to break some devices where the bootloader sets it to high.

Fixes: e612900ae0 ("ramips: mt7621: convert usb power to regulators")

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16877
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit a7bc6bf7dba98c77724cb8284d21a9c77c263d56)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:39 +00:00
Tim Lunn
79c711a035
rampis: mt7621: Edgerouter-X adjust IMAGE_SIZE to reflect new kernel size
IMAGE_SIZE was previously set to kernel1 + ubi size = 256768k, now
kernel1 is 6MB adjust this value to add 3072k to total image size.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit 5b406bccaccadb494cad139b3f69e17ab62d3968)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:37 +00:00
Tim Lunn
d582b369c3
ramips: mt7621: Edgerouter-X drop factory image
Edgerouter-X factory images have not built automatically since 19.x due
to images being over 3MB. While it was possible to build custom images
with very stripped down config, this is no longer possible with the size
increases of linux 6.1 and 6.6.

Drop code for generation of factory images, if some dev later wishes to
try custom images they can revert this commit.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit 4d90b79704efba57ab158c47ae6936ce4c1ef185)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:35 +00:00
Tim Lunn
14880209d5
rampis: mt7621: Re-enable Edgerouter-X image builds
With the new layout providing 6MB for kernel there will be no issues
with kernel size affecting build of images.

Re-enable image builds for Edgerouter-X and X-SFP.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Tested-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit 71b4842e3bdaed91cd2daa4b28a208559c3de7c6)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:33 +00:00
Tim Lunn
1c934c7dc7
rampis: mt7621: Edgerouter-X update compat version to 2.0
Use compat version to indicate that the new layout for larger kernels
is in place. This handled by the patch to ubnt.sh to always select
the kernel1 slot for flashing and as active kernel slot.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Tested-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit 1bdbd511b27017157e92ffe128e66853d169dcbf)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:31 +00:00
Tim Lunn
a5efcbd327
rampis: mt7621: Edgerouter-X set compat version message
Refer user to the wiki page for instructions on how to migrate to the
new kernel layout.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Tested-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit 70c371d91cda300d7c655f019cb2076d2dd537fb)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:30 +00:00
Tim Lunn
1fd7e5124e
rampis: mt7621: resize Edgerouter-X kernel size to 6MB
With the updated partition layout set in dts, set the KERNEL_SIZE
parameter to 6MB allowing builds of Linux 6.1 and later to fit.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Tested-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit 09a6bffb6e0a714f20d71043ae8382af4c5925b6)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:28 +00:00
Tim Lunn
c2cde63ae6
rampis: mt7621: Edgerouter-X disable toggling of kernel slots
Uboot selects which kernel slot to boot based on a flag in the factory
mtd partition. Patch ubnt.sh to ensure always flash to kernel1 slot and
update flag if required.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Tested-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit 5e355f1f9084c1b6de3151fbcde948d736292d6c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:26 +00:00
Tim Lunn
4b9e9a0310
rampis: mt7621: Convert Edgerouter-X dts to single kernel config
The OEM layout for Edgerouter X provides for two 3MB kernel slots.
As of linux 6.1 the kernel images no longer fit and as such
Edgerouter X builds have been disabled in Main.

Revise the layout to make kernel1 slot 6MB and drop kernel2 slot.

This patch applies the required changes to the dts file.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Tested-by: Mauri Sandberg <maukka@ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/15194
(cherry picked from commit dc51c4355d48e91ed8fd06d70f0bf71b0b4bc4d2)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:24 +00:00
David Bauer
c4c1bb523f
fritz-tools: fix mixed indentation
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 685e979d470a09361defe1612b001dfc3b7d9832)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:22 +00:00
Paul Spooren
70ee25f70f
packages: drop DEVICE specific dependency for omnia
Both packages `ombnia-mcu-firmware` and `omnia-mcutool` would depend on
a specific device. The buildbots however build all devices and therefore
the package isn't build at all, due to unmet dependencies.

While this didn't cause issues with OPKG, APK fails actively due to the
missing packages. Drop the specific dependency, however wants to install
unrelated firmware on any device can do that anyway.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit f35a29d63f445d784f1e266eaa6d3825a249cd6c)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:20 +00:00
Rosen Penev
ec774fafe6
ath79: gpio-rb91x-key: use gpiochip_get_data
No need for a custom function that does the same thing.

Oversight from devm conversion.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16748
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit e99b5832e801fdf2ec366419797360e09c2348c6)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:18 +00:00
Rosen Penev
e5a20b0f49
ath79: gpio-latch-miktorik: use gpiochip_get_data
Oversight from devm conversion. No need for a custom static inline
function.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16747
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 6d2ed484fa2f62e355893f5e1fe3734c88201bfc)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:16 +00:00
Rosen Penev
0cf557876a
ramips: mt7621: convert usb power to regulators
These things are regulators. Should silence dmesg messages about using
dummy regulators.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16804
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit e612900ae0fd6c4624fa661e004536216409107f)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:14 +00:00
Chuanhong Guo
3451a70356
kernel: can: package driver for Geschwister Schneider interface
Package gs_usb CAN driver, which is for Geschwister Schneider and
bytewerk.org candleLight compatible USB/CAN interfaces.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit ef4df2b5e9d66a6461982a0a81f928abb0f6a074)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:12 +00:00
Rosen Penev
fbe50c67c6
ipq40xx: use devm for mutex_init
Avoids having to call mutex_destroy in remove.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16755
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 57f2c72505f24b41fd9beaef3a8aa713b436cdb9)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-28 18:46:10 +00:00
Tianling Shen
9eb5a8552f
ath79: disable build for small flash devices
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-29 00:34:57 +08:00
Tianling Shen
45d14bfbd2
ramips: disable build for rostelecom sercomm series by default
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-29 00:33:39 +08:00
Tianling Shen
5233ff3698
ramips: mt7620: disable build for small flash devices
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-27 21:54:41 +08:00
Eric Fahlgren
7ef734deac
build: profiles.json: add kernel version information
Currently downstream tools like ASU lack information about kernel
version to find out the relevant kmod build folder on downloads server.

So lets fix it by providing a new `linux_kernel` JSON array which would
for the start provide Linux kernel version, revision and vermagic
information.

  "linux_kernel": {
     "release": "1",
     "vermagic": "b57450c07d3a786158c3601fc5cee57d",
     "version": "6.6.61"
   },

Fixes: openwrt/openwrt#17036
Fixes: efahl/owut#9
Co-developed-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17042
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c857145e034f623e31ab2028049a547ecd94ce85)
2024-11-26 22:48:38 +00:00
Daniel Golle
39d6d318a6 mtd-utils: add ubihealthd to nand-utils
Add ubihealthd to the nand-utils package, auto-create UCI config for
each UBI device and launch the daemon on boot.

The default time interval between scrubbing a random PED is 120 seconds
which means that a fully used 128 MiB flash chip gets scrubbed in about
a day and a half. The interval can be adjusted in UCI using the
'interval' option.

Suggested-by: Rodrigo Balerdi <lanchon@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://github.com/openwrt/openwrt/pull/16973
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 7e287b563aa1043a1af54d5e2b0bd96326371732)
2024-11-26 12:23:06 +00:00
Daniel Golle
0de3c201b1 procd: update to git HEAD
7330fa5 initd: mount /sys and /proc with MS_RELATIME

Fixes mounting /proc in unpriviledged user namespace.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 1e8505ac4e88212106fe78486cfcbe9cae7660f9)
2024-11-26 12:23:06 +00:00
Daniel Golle
634ac989e9 include: meson.mk: honor CONFIG_DEBUG
Set buildtype according to CONFIG_DEBUG.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit be3e7a84bd37f29e14e4c6a89b8c79bc9808c36c)
2024-11-26 12:23:06 +00:00
Daniel Golle
1d612c33de include: cmake.mk: honor CONFIG_DEBUG
Set CMAKE_BUILD_TYPE according to CONFIG_DEBUG.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit fc9ec5bd3d22d50654af154fc779517fa7aecb33)
2024-11-26 12:23:06 +00:00
Daniel Golle
79dafe4ad1 kernel: modules: package driver for generic MIPI DBI TFT panels
Package kmod-drm-panel-mipi-dbi as well as modules it depends on in
order to support a wide range of MIPI DBI complaint SPI-connected
TFT panels.

See https://github.com/notro/panel-mipi-dbi/ for more information on
how to use specific panels.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 0a7b7ef27cfc00521a0f99de073a7168f1b79e8f)
2024-11-26 12:23:06 +00:00
Tianling Shen
2152acb7da
ath79: disable build for dlink dap-13xx by default
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-26 19:57:36 +08:00
Robert Marko
141ccfd548 ramips: mt7621: support openwrt,netdev-name for renaming interfaces
Edgerouter X currently has its eth1 port on the switch missing since there
is a naming conflict currently.

So, as the root cause is mixing kernel support for DSA interfaces having
predictable names set via "label" property vs others having it assigned
dynamically lets avoid the conflict by using our own custom property as
suggested upstream [1].

So, add support via "openwrt,netdev-name" property and use it on ERX.

Fixes: 2a25c6ace8d8 ("ramips: get rid of downstream network device label patch")
Fixes: #15643
Link: https://github.com/openwrt/openwrt/pull/17062
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 5695267847c2fe51290fdbde6ecd7114654f7988)
2024-11-25 16:42:03 +01:00
Tianling Shen
d0d646abcb
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-25 17:36:32 +08:00
Hauke Mehrtens
a5b291116b wifi-scripts: Fix parsing of Capabilities
Fixup capabilities parsing in iw output.

In addition to the normal capabilities iw now also outputs HE MAC, HE
PHY and EHT MAC and EHT PHY capabilities. Exclude them in the parsing.

The grep returns this with mac80211-hwsim:
```
root@OpenWrt:~# iw phy phy0 info | grep 'Capabilities:'
		Capabilities: 0x107e
			HE PHY Capabilities: (0x02bfce0000000000000000):
			EHT PHY Capabilities: (0x7c0000feffff7f01):
			HE PHY Capabilities: (0x02bfce0000000000000000):
			EHT PHY Capabilities: (0x7c0000feffff7f01):
			HE PHY Capabilities: (0x02bf000000000000000000):
		Capabilities: 0x107e
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfc1f3ffeffff7f37):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfc1f3ffeffff7f37):
			HE PHY Capabilities: (0x1cbf000000000000000000):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfefffffeffffff7f):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfefffffeffffff7f):
			HE PHY Capabilities: (0x1cbf000000000000000000):
		Capabilities: 0x107e
```

With busybox 1.36.1 the ht_cap_mask variable will be set to
-72057598332895361. With busybox 1.37.0 it will be set to -1.
Both values are wrong, after this change it will be set to 4222
(0x107E).

Link: https://github.com/openwrt/openwrt/pull/17043
(cherry picked from commit adf958c9192d94fbeeb0ec8e16800b0071455909)
Link: https://github.com/openwrt/openwrt/pull/17055
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 22:46:21 +01:00
John Audia
7402e7dd86 kernel: bump 6.6 to 6.6.63
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.63

Manually rebased:
	bcm27xx/patches-6.6/950-0297-staging-vchiq_arm-Add-36-bit-address-support.patch

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16997
(cherry picked from commit eb395585ae1b7560bbcea9544f428db2a9105152)
Link: https://github.com/openwrt/openwrt/pull/17055
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 22:46:21 +01:00
John Audia
610652090d kernel: bump 6.6 to 6.6.62
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.62

All patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16997
(cherry picked from commit 611bfa4d72c87e8163d7193d9557479fc7312467)
Link: https://github.com/openwrt/openwrt/pull/17055
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 22:46:21 +01:00
Hauke Mehrtens
a2e7d8761b debugcc: Mark it nonshared
This tool was build in the phase 2 build, there the TARGET dependencies
are probably not meat. Mark it as non shared to build it together with
the targets where this option is set.

Link: https://github.com/openwrt/openwrt/pull/16975
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit febe1db43d1a01f83e474bcb143dcb3997bd35a3)
Link: https://github.com/openwrt/openwrt/pull/17055
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 22:46:21 +01:00
Shiji Yang
d665be7c1e ath79: lzma-loader: fix syntax error
C compiler can't parse '#else if'.

Fixes: f84a9f7dc095 ("ath79: add support for Huawei AP6010DN")
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16989
(cherry picked from commit 98f26346cbbb45e5c0417f57846ce1783e884ea2)
Link: https://github.com/openwrt/openwrt/pull/17055
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 22:46:21 +01:00
John Audia
b506c964a2 kernel: bump 6.6 to 6.6.61
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.61

Manually rebased:
	bcm27xx/patches-6.6/950-0998-i2c-designware-Add-support-for-bus-clear-feature.patch

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16959
(cherry picked from commit 487ca61f917f9308222faf481ad8be4e2cef0c90)
Link: https://github.com/openwrt/openwrt/pull/17055
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 22:46:21 +01:00
David Bauer
c279ca8b79 mediatek: fix Cudy AP3000 Outdoor label-mac
The label-mac does not match the one assigned to the ethernet interface.
Use the mac-address assigned to the wifi interface instead, as it
matches the one found on the device label.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit b8b658bc0d22df31e7ac2d07cdd2af7155d12630)
2024-11-23 20:04:54 +01:00
Tianling Shen
b89bad8523
target: enable tweaked packages
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-21 17:52:51 +08:00
MkQtS
5331e3bc31
target.mk: rename luci-app-opkg to luci-app-package-manager
(cherry picked from commit 572fa41dfba4be0486c97f3bc6ac13b39271d7a7)
2024-11-21 17:46:06 +08:00
Robert Marko
1abaf051d2 imagebuilder: fix OPKG package_whatdepends support
Trying to use 'package_whatdepends' feature of the ImageBuilder with OPKG
will currently fail as OPKG does not support "list --depends" call at all,
it seems that this is a mixup from the original APK support commit.

So, lets restore 'package_whatdepends' support for OPKG by calling
"whatdepends -A" instead as we used to before APK support.

Fixes: d788ab376f85 ("build: add APK package build capabilities")
Link: https://github.com/openwrt/openwrt/pull/17022
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 52519a59a859d349f154ed79e0a3d63457b6aa6a)
2024-11-20 09:49:57 +01:00
Rodrigo Balerdi
5ad5677067 ipq806x: tr4400v2: fix dtc warnings by deleting stock partitions
The original set of stock partitions was kept in the TR4400 v2 port,
with the same partition numbers but their names prefixed with 'stock_'.
This allowed scripts (installation, back to stock, etc) to run on both
stock and OpenWrt firmware. But this triggers warnings in the device
tree compiler, as partitions of the old and new schemes overlap.

This commit fixes the dtc warnings by deleting the stock partitions,
also renumbering some of the remaining MTD partitions in the process.
Additionally, the 'fw_env' partition is set to read-only.

These changes can break existing scripts as well as user configurations
that utilize the 'extra' partition. Users wanting to run old scripts can
do so by reverting to the 23.05 series releases.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16958
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 8ec35a2a1533ccff8a4b0e6f4f0a0954d1bee6a6)
2024-11-19 13:45:05 +01:00
Tianling Shen
fafd6c4b57
mac80211: mark upstreamed rtl patches
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 4611eb82bb8aaf772d0cecdafbd456bcbbe425b6)
2024-11-19 16:58:56 +08:00
Tianling Shen
7503540810
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-19 16:55:35 +08:00
David Bauer
112adbee68 net: phy: broadcom: update dependency condition
The broadcom PHY driver only has to depend upon PTP_1588_CLOCK_OPTIONAL
if NETWORK_PHY_TIMESTAMPING is enabled. The PTP functionality is stubbed
in this case.

Reflect this circumstance in the dependence condition. This allows to
build the driver as a built-in module even if PTP is built as a module.

This is required to include the broadcom PHY module regardless of the
built-setting of the PTP subsystem. On ath79 (and probably more)
targets with Broadcom PHY, Gigabit operation is currently broken as the
PHY driver is only built as a module in case all kernel-packages are
built. Due to this circumstance, affected devices fall back to using the
generic PHY driver.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit cbce32e30c29dc69907c6f4c0ab79dd5d9a8fb28)
2024-11-18 23:02:09 +01:00
Christian Marangi
3ecfc24c51
airoha: an7581: sync patch with upstream version and tag them
Sync patch with upstream version and tag them.
Minor changes done to Pinctrl patch to support older kernel.

Patch automatically refreshed with make target/linux/refresh.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a5d23e3aee9bd616044c3eadfe2dbcad5d18b163)
2024-11-18 15:05:58 +01:00
Felix Fietkau
585eb0d6c8 mac80211: backport some upstream fixes
Fix various issues, including potential crashes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 53eab6198bf87d12055409bc4a38d58b68291b2f)
2024-11-18 11:47:41 +01:00
Tianling Shen
8e62f8583f
rockchip: backport upstream usb3 support for nanopc t6
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 5347be4854871ff261c10fb53eac713a1f87cddb)
2024-11-17 19:36:02 +08:00
Tianling Shen
63d27611ab
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-17 15:43:43 +08:00
David Lutz
2d465fbf57 ath79: Add support for Sophos AP15C
The Sophos AP15C uses the same hardware as the AP15, but has a reset button.

Based on:
commit 6f1efb289837 ("ath79: add support for Sophos AP100/AP55 family")
author    Andrew Powers-Holmes <andrew@omnom.net>
          Fri, 3 Sep 2021 15:53:57 +0200 (23:53 +1000)
committer Hauke Mehrtens <hauke@hauke-m.de>
          Sat, 16 Apr 2022 16:59:29 +0200 (16:59 +0200)

Unique to AP15C:
 - Reset button
 - External RJ45 serial console port

Flashing instructions:

This firmware can be flashed either via a compatible Sophos SG or XG
firewall appliance, which does not require disassembling the device, or via
the U-Boot console available on the internal UART header.

To flash via XG appliance:
 - Register on Sophos' website for a no-cost Home Use XG firewall license
 - Download and install the XG software on a compatible PC or virtual
   machine, complete initial appliance setup, and enable SSH console access
 - Connect the target AP device to the XG appliance's LAN interface
 - Approve the AP from the XG Web UI and wait until it shows as Active
   (this can take 3-5 minutes)
 - Connect to the XG appliance over SSH and access the Advanced Console
   (Menu option 5, then menu option 3)
 - Run `sudo awetool` and select the menu option to connect to an AP via
   SSH. When prompted to enable SSH on the target AP, select Yes.
 - Wait 2-3 minutes, then select the AP from the awetool menu again. This
   will connect you to a root shell on the target AP.
 - Copy the firmware to /tmp/openwrt.bin on the target AP via SCP/TFTP/etc
 - Run `mtd -r write /tmp/openwrt.bin astaro_image`
 - When complete, the access point will reboot to OpenWRT.

To flash via U-Boot serial console:
 - Configure a TFTP server on your PC, and set IP address 192.168.99.8 with
   netmask 255.255.255.0
 - Copy the firmware .bin to the TFTP server and rename to 'uImage_AP15C'
 - Open the target AP's enclosure and locate the 4-pin 3.3V UART header [4]
 - Connect the AP ethernet to your PC's ethernet port
 - Connect a terminal to the UART at 115200 8/N/1 as usual
 - Power on the AP and press a key to cancel autoboot when prompted
 - Run the following commands at the U-Boot console:
    - `tftpboot`
    - `cp.b $fileaddr 0x9f070000 $filesize`
    - `boot`
 - The access point will boot to OpenWRT.

Signed-off-by: David Lutz <kpanic@hirnduenger.de>
(cherry picked from commit a7abc7ec3b61be553f33c49e5acc90a4d539d992)
2024-11-16 21:03:52 +01:00
Tianling Shen
8afe292cbc
ipq806x: fix typo error for xiaomi r3d device packages
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 2c7c8d1619481940fc243381f0c5748608809efa)
2024-11-16 17:20:55 +08:00
Hauke Mehrtens
faebcc61eb nftables: update to 1.1.1
Release Announcement:
https://lwn.net/Articles/982283/
https://lwn.net/Articles/992760/

Link: https://github.com/openwrt/openwrt/pull/16769
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c11a18be0dc38c81280baa948500fe1a57de0685)
2024-11-16 00:11:29 +01:00
Hauke Mehrtens
3e094777e7 libnftnl: update to 1.2.8
Release Announcement:
https://www.spinics.net/lists/netfilter-devel/msg87287.html
https://www.spinics.net/lists/netfilter-devel/msg88520.html

Link: https://github.com/openwrt/openwrt/pull/16769
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d9ed0d438b0ec7d813764d629be7a753dc3fbac5)
2024-11-16 00:11:27 +01:00
Tianling Shen
1ee47119c9
linux-firmware: update firmware for wcn6750
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 251fca13e81d2ed6975471bf004ab54b4b8db5eb)
2024-11-15 18:05:38 +08:00
Hauke Mehrtens
740052e84e base-files: Remove pkg_check when using apk
/sbin/pkg_check uses opkg and is not even packaged when using the
default opkg configuration. remove it when using apk too.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0ce237a20cc5168c62afcacb3b47d77a952d64c1)
2024-11-14 23:22:48 +01:00
Felix Fietkau
fe048b5e87 mt76: update to Git HEAD (2024-10-28)
8dfead68c202 wifi: mt76: mt7915: hold dev->mutex while interacting with the thermal state
d508a6eb935d wifi: mt76: mt7996: use mac80211 .sta_state op
57019e663f57 wifi: mt76: add code for emulating hardware scanning
dc4c2bdf7c56 wifi: mt76: add support for allocating a phy without hw
8cd0263f92e1 wifi: mt76: rename struct mt76_vif to mt76_vif_link
99df84d62883 wifi: mt76: add vif link specific data structure
dcc6f158d759 wifi: mt76: mt7996: split link specific data from struct mt7996_vif
d388deab9e73 wifi: mt76: initialize more wcid fields mt76_wcid_init
d026be405c54 wifi: mt76: add chanctx functions for multi-channel phy support
0b05795ca81c wifi: mt76: remove dev->wcid_phy_mask
0b526090de95 wifi: mt76: add multi-radio support to a few core hw ops
aeedee5c0a2c wifi: mt76: add multi-radio support to tx scheduling
fc0ff17b53ff wifi: mt76: add multi-radio support to scanning code
f19cbcf83400 wifi: mt76: add multi-radio remain_on_channel functions
42429ae0eaf6 wifi: mt76: mt7996: use emulated hardware scan support
f9d593d4a6b4 wifi: mt76: mt7996: pass wcid to mt7996_mcu_sta_hdr_trans_tlv
807090b28661 wifi: mt76: mt7996: prepare mt7996_mcu_add_dev/bss_info for MLO support
252baa7bf477 wifi: mt76: mt7996: prepare mt7996_mcu_add_beacon for MLO support
9ee990050305 wifi: mt76: mt7996: prepare mt7996_mcu_set_tx for MLO support
bf12cc404334 wifi: mt76: mt7996: prepare mt7996_mcu_set_timing for MLO support
60bf2bef95dc wifi: mt76: connac: prepare mt76_connac_mcu_sta_basic_tlv for MLO support
1289737e12a8 wifi: mt76: mt7996: prepare mt7996_mcu_update_bss_color for MLO support
7c00df0e7e57 wifi: mt76: connac: rework connac helpers
484e3f289a40 wifi: mt76: mt7996: move all debugfs files to the primary phy
d258f4e3e1ca wifi: mt76: mt7996: switch to single multi-radio wiphy
c246fa545119 wifi: mt76: mt7996: fix monitor mode

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 6720c4ccba256186bf2f1b1edadb851c447e62a5)
2024-11-14 22:41:57 +01:00
Felix Fietkau
13f166763f netifd: update to Git HEAD (2024-11-08)
e93f6c3fc729 main: fix format string related warnings for log/debug printf functions
6ab44a2413f9 fix signed/unsigned comparison warnings
4fe997b61d7d system-dummy: add system_if_apply_settings_after_up
992d33cb42a6 ubus: add notifications on wireless device state changes
34eb11eb6f5c device/interface: add "tags" attribute from config to status dump

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 5f68e243338a653f44f079acc001de369aa42efa)
2024-11-14 22:41:57 +01:00
Felix Fietkau
c02af3fd85 wifi-scripts: add free-form "tags" array option for wifi-iface
This allows annotating wifi interfaces in the config in a way that can be
queried through wifi status. One example use case is to mark wifi interfaces
for use with specific services without having to explicitly reference the
(often unnamed) sections from elsewhere.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit a3ec35cadb77265c0e00c8d3789734586a6f7111)
2024-11-14 22:41:57 +01:00
Rodrigo Balerdi
1fdc4b144b ipq806x: tr4400v2: revert nesting of MTD partitions that bricks device
This reverts commit e1043a746a1030062e73ea027d9a35c58bce6c6a, that
attempts to nest partitions that overlap but are not nested. This
causes the 'ubi' partition to be truncated, making rootfs inaccessible
and bricking the device.

Also, had this commit worked, it would have renumbered MTD partitions
in a way that would have broken documented scripts for installation and
update of main and recovery OSes, making backups, return to stock, etc,
and broken user configurations that put the 'extra' partition to use.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16944
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 0e59eaa7962fc21635af5c9d2f6552a4accdc7ea)
2024-11-14 10:05:12 +01:00
Tianling Shen
6e7537a049
ramips: fix read mac for jdcloud re-sp-01b again
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 7ec8108be5ba99148fd7a4fbb316157695a30449)
2024-11-14 13:42:30 +08:00
Tianling Shen
a24c3500f3
ramips: fix mac for jdcloud re-sp-01b 128g emmc version
The MAC address offset in 128G version is 0x442a (+1 compared to 64g
version). As the mac stored in config partition is plain text format
so simply call mtd_get_mac_ascii to work on both version.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit c0c480daa7a5f8f58cefcaebc268422e27ada701)
2024-11-14 13:42:26 +08:00
Tianling Shen
553324f247
automount: fix dependencies
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 2546d5098ffa722a81062e11ba3e1491e93989d3)
2024-11-14 12:05:34 +08:00
Tianling Shen
f13d5d7e2e
mac80211: add more USB vid pid to rtw8812au/rtw8821au driver
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit f32cd19e9ddb6add485e9c638452300cf6b119d6)
2024-11-13 21:15:09 +08:00
Tianling Shen
069987cf7b
rtl8812au-ac: drop package
use kmod-rtw88-8812au and kmod-rtw88-8821au instead.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit af9acb87aaa6d2d9e89975d0caf7da38b2548ff6)
2024-11-13 20:28:05 +08:00
Tianling Shen
6f52643bde
mac80211: backport RTL8812AU/RTL8821AU support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 1ef0d0e422dfb78d7db42fb3834a5d2d38c750c3)
2024-11-13 20:28:04 +08:00
Tianling Shen
dc38100548
linux-firmware: add firmware for Realtek RTL8812AU/RTL8821AU
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 10da84b58813a2d727b1e8344cb992eef87299fb)
2024-11-13 20:28:04 +08:00
Tianling Shen
31fabcbdb9
linux-firmware: Update to 20241110
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 264c5725f2fc8629f218329fae611862c729db0c)
2024-11-13 20:28:04 +08:00
John Crispin
e39f5d4b36 base-files: improve default root-passwd script
The script was not exiting cleanly causing it to not be removed from the
uci-defaults folder.

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-13 07:54:40 +01:00
Tianling Shen
b10dfedebb
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-12 22:45:57 +08:00
Christian Marangi
d83ae23d08
airoha: an7581: backport upstream ethernet fixes
Backport patches fixing some ethernet problem merged upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-11-12 13:57:20 +01:00
John Audia
92eb867873 kernel: bump 6.6 to 6.6.60
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.60

Removed upstreamed:
	generic/backport-6.6/409-mtd-spi-nor-winbond-fix-w25q128-regression.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.60&id=27a58a19bd20a7afe369da2ce6d4ebea70768acd

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16892
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 85844cfc5c591d00997ade665340315d54bc5822)
2024-11-10 17:09:14 +01:00
Mieczyslaw Nalewaj
4b413687e6 mac80211: compatibility with kernel 6.6.59
Fix genlmsg_multicast_allns() build error on kernel 6.6.59.
Based on kernel patch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v6.6.59&id=e0f83d268974dab0361d11904dfc9acec53f96a6

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16835
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 31f1dabb4b9727b300ddaa2801903ae4b72e4e1e)
Link: https://github.com/openwrt/openwrt/pull/16894
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-10 11:42:52 +01:00
Mieczyslaw Nalewaj
7a1815f64d kernel: bump 6.6 to 6.6.59
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.59

Removed upstreamed:
 - generic/backport-6.6/777-netfilter-xtables-fix-typo-causing-some-targets-to-not-load-on-IPv6.patch[1]
 - generic/backport-6.6/780-24-v6.12-r8169-avoid-unsolicited-interrupts.patch[2]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.59&id=433742ba96baf30c21e654ce3e698ad87100593b
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.59&id=7d6d46b429804b1a182106e27e2f8c0e84689e1a

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16835
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 4fc47c60006ccacda5ef644c5447ebfcb26c0680)
2024-11-09 17:35:58 +01:00
Tianling Shen
1ba85d6ab7
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-09 20:26:29 +08:00
Andrew MacIntyre
c0a50b1d59 vrx518_tc: allow larger MTU to support RFC4638
vrx518_tc currently sets the interface maximum MTU to the ethernet default
of 1500 bytes by default via ether_setup() called from ptm_setup().

To support 1508 byte baby jumbo frames (RFC4638) for PPPoE connections
over VDSL links as already supported by the VR9 ltq_ptm driver ([1], [2])
set the interface maximum MTU to MAX_MTU.

MAX_MTU is defined in dcdp/inc/tc_common.h to 2002 bytes and this value is
used in ptm_change_mtu() and elsewhere as the maximum MTU, however this is
short circuited by checks against the interface maximum MTU.

[1]: https://forum.openwrt.org/t/fritzbox-7530-and-rfc4638-baby-jumbo-frames/181327
[2]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=8a2a20e71e2909f84dab47e51dfda9e292a6c1ae

Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
Link: https://github.com/openwrt/openwrt/pull/16856
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit ca53f2d430ce1f9ff5a560291de1e93380963417)
2024-11-08 17:23:16 +01:00
Edward Chow
983a753f38 ath79: linksys_ea4500-v3: take over the space for user data
The last "syscfg" partition of the OEM firmware turns out to be a
UBIFS used to store user data, just as the "rootfs_data" of OpenWrt,
so it should be reasonable to absorb it into the "ubi" partition.

Factory installations via either OEM firmware or tftp, or by forcibly
flashing factory image to mtd5 (firmware) partition with mtd tool are
confirmed working, but the UBI remaining inside "syscfg" partition
could break upgrade. Fortunately, installing kmod-mtd-rw and erasing
"syscfg" partition before upgrade is confirmed working, in which case,
"ubi" will automatically expand to the blank space once occupied by
the former mtd8 (syscfg), with the total block number increased, but
the UBIFS for rootfs_data will not automatically claim the newly
available space (since it is created when mtd8 still exists, and
sysupgrade does not set "autoresize" flag to rootfs_data). These space
will be claimed during the next upgrade, when rootfs_data is removed
and created again.

Fixes: 50f727b7737d1 ("ath79: add support for Linksys EA4500 v3")

Signed-off-by: Edward Chow <equu@openmail.cc>
Link: https://github.com/openwrt/openwrt/pull/14791
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-07 14:57:37 +01:00
Álvaro Fernández Rojas
f3359da4b8 kernel: r8125: update to v9.014.01
Changelog: https://github.com/openwrt/rtl8125/compare/9.013.02...9.014.01

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit e29bc67f9d8451d3baf80da9358b3a01dc4b20b7)
2024-11-06 11:42:35 +01:00
Christian Marangi
a82b097635
procd: update to Git HEAD (2024-11-06)
109fa41b2321 system: fix description value from os-release

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 09a8b4920cf117942561237d639d5101283a53c4)
2024-11-06 10:39:42 +01:00
Tianling Shen
0861ce7fb2
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-05 21:40:21 +08:00
Álvaro Fernández Rojas
49d8f4b833 kernel: r8168: refresh patch
Patches weren't refreshed when r8168 was updated to v8.054.00 in a85e18b53f0f.

Fixes: a85e18b53f0f ("kernel: r8168: update to v8.054.00")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 6490c88c75b3392aca9dae5f4d47a13a0aa35220)
2024-11-05 14:08:28 +01:00
Álvaro Fernández Rojas
7763c5aabc kernel: r8126: update to v10.014.01
Changelog: https://github.com/openwrt/rtl8126/compare/10.013.00...10.014.01

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 562b2c22fff363f060e72c9018d243981b7d6447)
2024-11-05 14:08:07 +01:00
John Crispin
0d97e775ac mediatek: set 7 MACs per wifi band in board.json on OpenWrt One
Mass production units will get 16 assigned MAC addresses. This allows each phy
to spawn up to 7 VAPs which will each have unique MAC without needing the
private bit.

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-05 13:30:21 +01:00
John Crispin
895f30e31a mediatek: set mac increment to 7 for the 5G radio on OpenWrt One
Mass production units will get 16 assigned MAC addresses. This allows each phy
to spawn up to 7 VAPs which will each have unique MAC without needing the
private bit.

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-05 13:30:21 +01:00
Daniel Golle
5b7357e0a1 mediatek: refresh patches
The mediatek target requires refreshing after recent additions.

Fixes: cfe8e6e75f ("mediatek: add support for Realtek RTL8261n 10G PHYs")
Fixes: ddfae94a14 ("mediatek: add support for swapping the polarity on usxgmii interfaces")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-11-05 13:30:21 +01:00
Daniel Golle
ccd30b9ed7 mediatek: filogic: BPi-R4: wire up pinctrl for pwm-fan
Assign pwm function of PWM0 pin to the pwm-fan.
This is mostly just cosmetics as it basically reflects the default
setting of that pin.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-11-05 13:30:21 +01:00
Daniel Golle
4b4e307a01 mediatek: pinctrl-mt7988: add missing PWM pingroups
Add additionals possible pinctrl group for pwm2~7 on pins
pin  4 (GPIO_A)        pwm7
pin 58 (JTAG_JTDI)     pwm2
pin 59 (JTAG_JTDO)     pwm3
pin 60 (JTAG_JTMS)     pwm4
pin 61 (JTAG_JTCLK)    pwm5
pin 62 (JTAG_JTRST_N)  pwm6

They can be useful e.g. on the BPi-R4 as in that way pwm2~6 can be exposed
on the 26-pin header (pwm6 always, pwm2~5 instead of the full UART).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-11-05 13:30:21 +01:00
Daniel Golle
de3dfe5714 uboot-mediatek: import patches improving menu navigation
Using the arrow keys to navigate the U-Boot menu often leads to being
dropped into the U-Boot shell unexpectedly.
This can be prevented in most cases by improving the logic to detect the
arrow key ESC sequence and only reprinting the menu if actually needed.
Also enable CONFIG_SERIAL_RX_BUFFER for all boards as it helps preventing
the remaining cases.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-11-05 13:30:21 +01:00
John Crispin
f4b62a6b28 mediatek: filogic: add Arcadyan Mozart platform
* Mediatek MT7988A (4x Cortex-A73, up to 1.8 GHz clock speed)
* 8 GiB eMMC
* 4 GiB DDR4 RAM
* 2x 10000M + 1x 1000M  ports
* MT7996 Tri-band (2.4G, 5G, 6G) 4T4R 802.11be Wi-Fi
* 2 buttons (Reset, WPS)
* 2x LED for each GMAC
* USB-C PD power input

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-05 13:30:21 +01:00
John Crispin
ab5c090077 mediatek: add support for swapping the polarity on usxgmii interfaces
This patch comes from the MTK SDK.

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-05 13:30:21 +01:00
John Crispin
0f6aafcc24 mediatek: add support for Realtek RTL8261n 10G PHYs
There is no upstream driver yet. Merge the RTL SDK driver for now.

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-05 13:30:21 +01:00
John Crispin
7c8bfc0be5 uboot-mediatek: add support for arcadyan,mozart
Signed-off-by: John Crispin <john@phrozen.org>
2024-11-05 13:30:21 +01:00
Robert Marko
4ec95518de nu801: Mark as nonshared to build in step 1
Mark the package as nonshared to build it in the target specific build
step 1 of the build bots instead of the architecture generic build step 2.

In the build step 2 it may be left out if we build it using a different
target.

Fixes: #16857
Link: https://github.com/openwrt/openwrt/pull/16859
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-05 10:58:37 +01:00
Tianling Shen
595aaa36fc
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-05 16:01:26 +08:00
Tianling Shen
ec3c6d959b
r8152: Update to 2.19.2
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 778e34c00f765cc501393df534efb68309a2bf25)
2024-11-05 16:01:03 +08:00
Tianling Shen
54a586a5b7
kernel: backport BPF-programmable network device support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 41758671677bf8c85e5decf8fc1933c5f062769c)
2024-11-05 16:00:58 +08:00
Mauri Sandberg
a923d1f9ec ramips: Fix EX400 imagebuilder
A factory image for DNA EX400 depends on an initramfs image and they
were explicitly removed from the imagebuilder recently. Now the factory
image creation fails miserably and it also affects custom image creation
with the firmware selector.

Add the initramfs kernel to the staging so that it's shipped with the
imagebuilder. Also remove a image build target added solely for DNA EX400.

Tested by creating a factory and syspupgrade images locally with
the imagebuilder and verified their functionality.

Related work
  c85348d9abf4 ("imagebuilder: remove initramfs image files")

Fixes: fea2264d9fdd ("ramips: mt7621: Add DNA Valokuitu Plus EX400")
Signed-off-by: Mauri Sandberg <maukka@ext.kapsi.fi>
---
v4: use append-image-stage, remove Build/kernel-initramfs-bin
v3: adjust commit subject
v2: remove fix for inconsistent line ending elsewhere in the file
Link: https://github.com/openwrt/openwrt/pull/16659
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-04 11:26:12 +01:00
Enrico Mioso
de3d57a60c uboot-mediatek: fix boot media for mt7981 RFB NOR profile
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
CC: Daniel Golle <daniel@makrotopia.org>
2024-11-04 10:55:38 +01:00
Rosen Penev
547feaca2c gpio-button-hotplug: use flexible array member
zero length arrays are deprecated.

Fixes coccinelle warning:

WARNING use flexible-array member instead

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16848
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-04 10:51:11 +01:00
Linus Walleij
d92306d020 mtd: Add backported Winbond fix
Upstream stable is slow at picking this up and several systems
are regressing. Add the patch locally in OpenWrt.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-11-04 10:49:49 +01:00
Leon M. Busch-George
6bc930c47d mediatek: YunCore AX835: fix voltage regulator
Specifying GPIO_ACTIVE_HIGH on the GPIO for the voltage regulator doesn't
suffice. The regulator itself requires enable-active-high to be set.

Fixes: #16292
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/16839
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-04 10:36:11 +01:00
Kuan-Yi Li
92fd12e7fd
openwrt-keyring: fix missing 24.10 usign key by installing it
@KA2107 reported that opkg is not able to verify the artifact signatures
produced by buildbot using the usign 24.10 release keys. So lets fix it
by actually adding the 24.10 usign key with d310c6f2833e97f7 fingerprint
into the openwrt-keyring package.

Fixes: #16850
Reported-by: @KA2107
Fixes: a535cfc09e1c ("openwrt-keyring: add OpenWrt 24.10 release build usign key")
References: 2d03f27f0f07 ("openwrt-keyring: make opkg use 22.03 usign key")
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit description]
2024-11-04 09:23:40 +00:00
Paul Donald
e3bbeabe92 kernel: KERNEL_NET_L3_MASTER_DEV default to y if !SMALL_FLASH
Follow-up for 45d541bb409355f090b971d96ebebd8610ef84a7

This change allows features such as kmod-vrf

```
KERNEL_NET_L3_MASTER_DEV=n

x86_64 generic
	bzImage 6,927,360 bytes
aarch64 coretex-a53
	kernel  4,268,836 bytes

KERNEL_NET_L3_MASTER_DEV=y

x86_64 generic
	bzImage 6,931,456 bytes
aarch64 coretex-a53
	kernel  4,273,042 bytes

Delta:
x86_64 generic
	+4096 bytes
aarch64 coretex-a53
	+4206 bytes

x86_64 generic vrf.ko - 258,792 bytes
aarch64 coretex-a53 vrf.ko - 263,632 bytes
```

See:
https://forum.openwrt.org/t/vrf-support-testing-out-evpn-at-home/181108
https://forum.openwrt.org/t/please-enable-net-l3-master-dev-in-kernel-build-by-default/201825

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16819
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-02 11:23:37 +01:00
Álvaro Fernández Rojas
a4f3e17029 bcm27xx-gpu-fw: fix package
Install definition was accidentally removed in 7afdbc0955a5 and IB fails.

Fixes: 7afdbc0955a5 ("bcm27xx-gpu-fw: update to latest version")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit efd1ec51a1)
2024-11-01 21:47:58 +01:00
Tianling Shen
9da8dfc1b9
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-01 16:39:46 +08:00
Daniel Golle
05b3adc0db
mediatek: mt7988: fix peripheral SPI busses
The clocks for SPI busses were named wrongly which resulted in the
spi-mt65xx driver not requesting them. This has apparently been
worked around by marking the clocks required for SPI0 which is used
for SPI-NOR and SPI-NAND flash chips as critical.
Fix the device tree for all 3 generic SPI host controllers and no
longer mark clocks as critical.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 2b173ab730897f53539cab39e87e2b4638cb482a)
2024-11-01 06:54:33 +00:00
Petr Štetiar
07e5dd4c4f
openwrt-keyring: add OpenWrt 24.10 release build usign key
fbae29d730f8 usign: add OpenWrt 24.10 release build public key

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit a535cfc09e1ced5785d65bee0a0116a71585128e)
2024-11-01 06:32:51 +00:00
Christian Marangi
4ae45b1f4a
OpenWrt v24.10: set branch defaults
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-31 22:16:29 +01:00
722 changed files with 38940 additions and 3926 deletions

View File

@ -70,7 +70,8 @@ menu "Global build settings"
config USE_APK
imply PACKAGE_apk-mbedtls
bool "Use APK instead of OPKG to build distribution (EXPERIMENTAL)"
bool "Use APK instead of OPKG to build distribution (BROKEN)"
depends on BROKEN
comment "General build options"
@ -295,12 +296,22 @@ menu "Global build settings"
Enable GCC Stack Smashing Protection (SSP) for userspace applications
config PKG_CC_STACKPROTECTOR_NONE
bool "None"
help
No stack smashing protection.
config PKG_CC_STACKPROTECTOR_REGULAR
bool "Regular"
help
Protects functions with vulnerable objects.
This includes functions with buffers larger than 8 bytes or calls to alloca.
config PKG_CC_STACKPROTECTOR_STRONG
bool "Strong"
help
Like Regular, but also protects functions with
local arrays or references to local frame addresses.
config PKG_CC_STACKPROTECTOR_ALL
bool "All"
help
Protects all functions.
endchoice
choice
@ -310,10 +321,18 @@ menu "Global build settings"
Enable GCC Stack-Smashing Protection (SSP) for the kernel
config KERNEL_CC_STACKPROTECTOR_NONE
bool "None"
help
No stack smashing protection.
config KERNEL_CC_STACKPROTECTOR_REGULAR
bool "Regular"
help
Protects functions with vulnerable objects.
This includes functions with buffers larger than 8 bytes or calls to alloca.
config KERNEL_CC_STACKPROTECTOR_STRONG
bool "Strong"
help
Like Regular, but also protects functions with
local arrays or references to local frame addresses.
endchoice
config KERNEL_STACKPROTECTOR

View File

@ -333,6 +333,25 @@ if KERNEL_TASKSTATS
endif
config KERNEL_PSI
bool "Compile the kernel with pressure stall information tracking"
help
Collect metrics that indicate how overcommitted the CPU, memory,
and IO capacity are in the system.
If you say Y here, the kernel will create /proc/pressure/ with the
pressure statistics files cpu, memory, and io. These will indicate
the share of walltime in which some or all tasks in the system are
delayed due to contention of the respective resource.
In kernels with cgroup support, cgroups (cgroup2 only) will
have cpu.pressure, memory.pressure, and io.pressure files,
which aggregate pressure stalls for the grouped tasks only.
For more details see Documentation/accounting/psi.rst.
Say N if unsure.
config KERNEL_KALLSYMS
bool "Compile the kernel with symbol table information"
default y if !SMALL_FLASH
@ -563,6 +582,15 @@ config KERNEL_BPF_STREAM_PARSER
depends on KERNEL_CGROUP_BPF
default y if KERNEL_DEBUG_INFO_BTF
config KERNEL_NETKIT
bool "Compile the kernel with BPF-programmable network device support"
default y if KERNEL_DEBUG_INFO_BTF
help
The netkit device is a virtual networking device where BPF programs
can be attached to the device(s) transmission routine in order to
implement the driver's internal logic. The device can be configured
to operate in L3 or L2 mode.
config KERNEL_AIO
bool "Compile the kernel with asynchronous IO support"
default y if !SMALL_FLASH
@ -1195,9 +1223,11 @@ endif
config KERNEL_NET_L3_MASTER_DEV
bool "L3 Master device support"
default y if !SMALL_FLASH
help
This module provides glue between core networking code and device
drivers to support L3 master devices like VRF.
Increases the compressed kernel size by ~4kB (as of Linux 6.6).
config KERNEL_XDP_SOCKETS
bool "XDP sockets support"

View File

@ -1,8 +1,4 @@
src-git packages https://github.com/immortalwrt/packages.git
src-git luci https://github.com/immortalwrt/luci.git
src-git routing https://github.com/openwrt/routing.git
src-git telephony https://github.com/openwrt/telephony.git
#src-git-full video https://github.com/openwrt/video.git
#src-git-full targets https://github.com/openwrt/targets.git
#src-git-full oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed
src-git packages https://github.com/immortalwrt/packages.git^4e64a5891e40dab3a2ec2949cc6c4eb111905d86
src-git luci https://github.com/immortalwrt/luci.git^314b140efc5d6e9eec69155330d84962887e464d
src-git routing https://github.com/openwrt/routing.git^84d97e684bcb6a63dbfdfbfd9ec7407192861239
src-git telephony https://github.com/openwrt/telephony.git^fd605af7143165a2490681ec1752f259873b9147

View File

@ -97,7 +97,7 @@ define Build/Configure/Default
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_VERSION=1 \
-DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=$(if $(CONFIG_DEBUG),Debug,Release) \
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \

View File

@ -37,7 +37,7 @@ define FeedSourcesAppendOPKG
echo 'src/gz %d_core %U/targets/%S/packages'; \
$(strip $(if $(CONFIG_PER_FEED_REPO), \
echo 'src/gz %d_base %U/packages/%A/base'; \
$(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \
$(if $(CONFIG_BUILDBOT), \
echo 'src/gz %d_kmods %U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)';) \
$(foreach feed,$(FEEDS_AVAILABLE), \
$(if $(CONFIG_FEED_$(feed)), \
@ -51,7 +51,7 @@ define FeedSourcesAppendAPK
echo '%U/targets/%S/packages/packages.adb'; \
$(strip $(if $(CONFIG_PER_FEED_REPO), \
echo '%U/packages/%A/base/packages.adb'; \
$(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \
$(if $(CONFIG_BUILDBOT), \
echo '%U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)/packages.adb';) \
$(foreach feed,$(FEEDS_AVAILABLE), \
$(if $(CONFIG_FEED_$(feed)), \

View File

@ -21,6 +21,11 @@ include $(INCLUDE_DIR)/rootfs.mk
override MAKE:=$(_SINGLE)$(SUBMAKE)
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
##@
# @brief Convert size with unit postfix to unitless expression in bytes.
#
# @param 1: Size with unit. Possible unit postfix are `g`, `m`, `k`.
##
exp_units = $(subst k, * 1024,$(subst m, * 1024k,$(subst g, * 1024m,$(1))))
target_params = $(subst +,$(space),$*)
@ -111,6 +116,12 @@ endef
PROFILE_SANITIZED := $(call tolower,$(subst DEVICE_,,$(subst $(space),-,$(PROFILE))))
##@
# @brief Call function for each group of arguments.
#
# @param 1: List of lists of arguments. Lists are separated by `|`.
# @param 2: Function to call for list of arguments.
##
define split_args
$(foreach data, \
$(subst |,$(space),\
@ -118,12 +129,24 @@ $(foreach data, \
$(call $(2),$(strip $(subst ^,$(space),$(data)))))
endef
##@
# @brief Call build function with arguments.
#
# @param 1: Function to call. Function name is prepended with `Build/`.
# @param 2...: Function arguments.
##
define build_cmd
$(if $(Build/$(word 1,$(1))),,$(error Missing Build/$(word 1,$(1))))
$(call Build/$(word 1,$(1)),$(wordlist 2,$(words $(1)),$(1)))
endef
##@
# @brief Call build functions from the list.
#
# @param 1: List of build functions with arguments, separated by `|`.
# First word in each group is a build command without `Build/` prefix.
##
define concat_cmd
$(call split_args,$(1),build_cmd)
endef
@ -163,6 +186,12 @@ DTC_WARN_FLAGS := \
DTC_FLAGS += $(DTC_WARN_FLAGS)
DTCO_FLAGS += $(DTC_WARN_FLAGS)
##@
# @brief Pad file to specified size.
#
# @param 1: File.
# @param 2: Padding.
##
define Image/pad-to
dd if=$(1) of=$(1).new bs=$(2) conv=sync
mv $(1).new $(1)
@ -403,26 +432,53 @@ define Device/InitProfile
DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE)
endef
##@
# @brief Image configuration variables.
#
# @param 1: Device name.
##
define Device/Init
##@ Device name.
DEVICE_NAME := $(1)
##@ Commands to build kernel.
# Commands with arguments are separated by `|`.
##
KERNEL:=
##@ Commands to build initramfs.
# Commands with arguments are separated by `|`.
##
KERNEL_INITRAMFS = $$(KERNEL)
##@ Kernel command line.
CMDLINE:=
##@ Images to build.
IMAGES :=
##@ Artifacts to build.
ARTIFACTS :=
##@ Device image prefix.
DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
##@ Device image name.
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
##@ Factory image name.
FACTORY_IMG_NAME :=
##@ Maximum image size. Optional.
IMAGE_SIZE :=
##@ Maximum image size. Optional.
NAND_SIZE :=
##@ Kernel image prefix.
KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
##@ Kernel image suffix.
KERNEL_SUFFIX := -kernel.bin
##@ Initramfs image suffix.
KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
##@ Kernel image name.
KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX)
##@ Initramfs image prefix.
KERNEL_INITRAMFS_PREFIX = $$(DEVICE_IMG_PREFIX)-initramfs
KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_INITRAMFS_SUFFIX)
##@ Initramfs image name.
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
##@ Kernel install flag.
KERNEL_INSTALL :=
KERNEL_NAME := vmlinux
KERNEL_DEPENDS :=

View File

@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .58
LINUX_KERNEL_HASH-6.6.58 = e7df81e588d70fab5ec3ec3bb04ac53d51f0860fc3b1ec45e0a4167a026899db
LINUX_VERSION-6.6 = .66
LINUX_KERNEL_HASH-6.6.66 = 9d757937c4661c2f512c62641b74ef74eff9bb13dc5dbcbaaa108c21152f1e52

View File

@ -124,7 +124,7 @@ define Build/Configure/Meson
$(call Meson/CreateCrossFile,$(PKG_BUILD_DIR)/openwrt-cross.txt)
$(call Meson, \
setup \
--buildtype plain \
--buildtype $(if $(CONFIG_DEBUG),debug,plain) \
--native-file $(PKG_BUILD_DIR)/openwrt-native.txt \
--cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \
-Ddefault_library=both \

113
include/optee-os.mk Normal file
View File

@ -0,0 +1,113 @@
include $(INCLUDE_DIR)/prereq.mk
PKG_NAME ?= optee-os
ifndef PKG_SOURCE_PROTO
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL_FILE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL = https://github.com/OP-TEE/optee_os/archive/refs/tags/
TAR_OPTIONS+= --transform 's/optee_os/$(PKG_NAME)/'
endif
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_TARGETS := bin
PKG_FLAGS:=nonshared
PKG_LICENSE:=BSD 2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_PARALLEL ?= 1
$(eval $(call TestHostCommand,python3-cryptography, \
Please install the Python3 cryptography module, \
$(STAGING_DIR_HOST)/bin/python3 -c 'import cryptography'))
$(eval $(call TestHostCommand,python3-pyelftools, \
Please install the Python3 pyelftools module, \
$(STAGING_DIR_HOST)/bin/python3 -c 'import elftools'))
export GCC_HONOUR_COPTS=s
define Package/optee-os/install/default
$(CP) $(patsubst %,$(PKG_BUILD_DIR)/out/arm-plat-$(PLAT)/core/%,$(OPTEE_IMAGE)) $(1)/
endef
Package/optee-os/install = $(Package/optee-os/install/default)
define Optee-os/Init
BUILD_TARGET:=
BUILD_SUBTARGET:=
BUILD_DEVICES:=
NAME:=
DEPENDS:=
HIDDEN:=
DEFAULT:=
VARIANT:=$(1)
PLAT:=$(1)
PLAT_FLAVOR:=
OPTEE_IMAGE:=tee-header_v2.bin tee-pager_v2.bin tee-pageable_v2.bin
endef
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
define Build/Optee-os/Target
$(eval $(call Optee-os/Init,$(1)))
$(eval $(call Optee-os/Default,$(1)))
$(eval $(call Optee-os/$(1),$(1)))
define Package/optee-os-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
TITLE:=OPTEE-OS for $(NAME)
VARIANT:=$(VARIANT)
DEPENDS:=@!IN_SDK $(DEPENDS)
HIDDEN:=$(HIDDEN)
ifneq ($(BUILD_TARGET),)
DEPENDS += @$(TARGET_DEP)
ifneq ($(BUILD_DEVICES),)
DEFAULT := y if ($(TARGET_DEP)_Default \
$(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \
$(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%,$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
endif
endif
$(if $(DEFAULT),DEFAULT:=$(DEFAULT))
URL:=https://optee.readthedocs.io
endef
define Package/optee-os-$(1)/install
$$(Package/optee-os/install)
endef
endef
define Build/Configure/Optee-os
endef
define Build/Compile/Optee-os
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
PATH=$(LINUX_DIR)/scripts/dtc/:$(PATH) \
CROSS_COMPILE=$(TARGET_CROSS) \
CROSS_COMPILE_core="$(TARGET_CROSS)" \
CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)" \
CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)" \
$(if $(CONFIG_ARCH_64BIT), CFG_ARM64_core=y CFG_USER_TA_TARGETS=ta_arm64, CFG_ARM32_core=y) \
PLATFORM="$(PLAT)" \
PLATFORM_FLAVOR="$(call qstrip,$(PLAT_FLAVOR))" \
$(OPTEE_MAKE_FLAGS)
endef
define BuildPackage/Optee-os/Defaults
Build/Configure/Default = $$$$(Build/Configure/Optee-os)
Build/Compile/Default = $$$$(Build/Compile/Optee-os)
endef
define BuildPackage/Optee-os
$(eval $(call BuildPackage/Optee-os/Defaults))
$(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \
$(eval $(call Build/Optee-os/Target,$(type)))
)
$(eval $(call Build/DefaultTargets))
$(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \
$(call BuildPackage,optee-os-$(type))
)
endef

View File

@ -7,10 +7,17 @@ ifneq ($(__target_inc),1)
__target_inc=1
# default device type
##@
# @brief Default device type ( basic | nas | router ).
##
DEVICE_TYPE?=router
# Default packages - the really basic set
##@
# @brief Default packages.
#
# The really basic set. Additional packages are added based on @DEVICE_TYPE and
# @CONFIG_* values.
##
DEFAULT_PACKAGES:=\
base-files \
ca-bundle \
@ -27,15 +34,21 @@ DEFAULT_PACKAGES:=\
urandom-seed \
urngd
# For the basic set
##@
# @brief Default packages for @DEVICE_TYPE basic.
##
DEFAULT_PACKAGES.basic:=
# For nas targets
##@
# @brief Default packages for @DEVICE_TYPE nas.
##
DEFAULT_PACKAGES.nas:=\
block-mount \
fdisk \
lsblk \
mdadm
# For router targets
##@
# @brief Default packages for @DEVICE_TYPE router.
##
DEFAULT_PACKAGES.router:=\
dnsmasq-full \
firewall4 \
@ -45,16 +58,16 @@ DEFAULT_PACKAGES.router:=\
odhcpd-ipv6only \
ppp \
ppp-mod-pppoe
# For easy usage
##@
# @brief For easy usage
##
DEFAULT_PACKAGES.tweak:=\
autocore \
block-mount \
default-settings-chn \
kmod-nf-nathelper \
kmod-nf-nathelper-extra \
luci-light \
luci-app-cpufreq \
luci-app-opkg \
luci-app-package-manager \
luci-compat \
luci-lib-base \
luci-lib-ipkg
@ -135,9 +148,20 @@ endif
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
# Add tweaked packages
# DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.tweak)
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.tweak)
##@
# @brief Filter out packages, prepended with `-`.
#
# @param 1: Package list.
##
filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1))
##@
# @brief Append extra package dependencies.
#
# @param 1: Package list.
##
extra_packages = $(if $(filter wpad wpad-% nas,$(1)),iwinfo)
define ProfileDefault

View File

@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.0-rc2)
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r32566-56e91d0bbea5)
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/snapshots)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/24.10.0-rc2)
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),ImmortalWrt)

View File

@ -251,6 +251,7 @@ ifneq ($(CONFIG_USE_APK),)
$(VERSION_SED_SCRIPT) $(1)/etc/apk/repositories
rm -f $(1)/etc/uci-defaults/13_fix-group-user
rm -f $(1)/sbin/pkg_check
else
$(if $(CONFIG_CLEAN_IPKG),, \
mkdir -p $(1)/etc/opkg; \

View File

@ -24,6 +24,8 @@ boot() {
chmod 1777 /var/lock
mkdir -p /var/log
mkdir -p /var/run
ln -s /var/run /run
ln -s /var/lock /run/lock
mkdir -p /var/state
mkdir -p /var/tmp
mkdir -p /tmp/.uci
@ -34,9 +36,9 @@ boot() {
touch /tmp/resolv.conf.d/resolv.conf.auto
ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf.auto
ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf
grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
grep -q debugfs /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t debugfs debugfs /sys/kernel/debug
grep -q bpf /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime,mode=0700 -t bpf bpffs /sys/fs/bpf
grep -q pstore /proc/filesystems && /bin/mount -o noatime -t pstore pstore /sys/fs/pstore
grep -q pstore /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t pstore pstore /sys/fs/pstore
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
touch /tmp/.config_pending

View File

@ -100,10 +100,6 @@ service_triggers() {
return 0
}
service_data() {
return 0
}
service_running() {
local instance="${1:-*}"

View File

@ -3,10 +3,16 @@
json_init
json_load "$(cat /etc/board.json)"
json_select credentials
json_get_vars root_password_hash root_password_hash
[ -z "$root_password_hash" ] || sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow
if json_is_a credentials object; then
json_select credentials
json_get_vars root_password_hash root_password_hash
if [ -n "$root_password_hash" ]; then
sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow
fi
json_get_vars root_password_plain root_password_plain
[ -z "$root_password_plain" ] || { (echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root }
json_select ..
json_get_vars root_password_plain root_password_plain
if [ -n "$root_password_plain" ]; then
(echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root
fi
json_select ..
fi

View File

@ -190,7 +190,7 @@ if VERSIONOPT
config VERSION_REPO
string
prompt "Release repository"
default "https://downloads.immortalwrt.org/snapshots"
default "https://downloads.immortalwrt.org/releases/24.10.0-rc2"
help
This is the repository address embedded in the image, it defaults
to the trunk snapshot repo; the url may contain the following placeholders:
@ -266,7 +266,7 @@ if VERSIONOPT
config VERSION_CODE_FILENAMES
bool
prompt "Revision code in filenames"
default y
default n
help
Enable this to include the revision identifier or the configured
version code into the firmware image, SDK- and Image Builder archive

View File

@ -352,6 +352,15 @@ define Trusted-Firmware-A/mt7986-spim-nand-ddr3
DDR_TYPE:=ddr3
endef
define Trusted-Firmware-A/mt7986-spim-nand-ubi-ddr3
NAME:=MediaTek MT7986 (SPI-NAND via SPIM using UBI, DDR3)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7986
DDR_TYPE:=ddr3
USE_UBI:=1
endef
define Trusted-Firmware-A/mt7988-nor-ddr3
NAME:=MediaTek MT7988 (SPI-NOR, DDR3)
BOOT_DEVICE:=nor
@ -531,6 +540,7 @@ TFA_TARGETS:= \
mt7986-sdmmc-ddr3 \
mt7986-snand-ddr3 \
mt7986-spim-nand-ddr3 \
mt7986-spim-nand-ubi-ddr3 \
mt7986-ram-ddr4 \
mt7986-emmc-ddr4 \
mt7986-nor-ddr4 \
@ -570,6 +580,7 @@ TFA_MAKE_FLAGS += \
$(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7981,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x100000)) \
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7986,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x200000)) \
$(if $(RAM_BOOT_UART_DL),bl2,all)
define Package/trusted-firmware-a-ram/install

View File

@ -0,0 +1,63 @@
#
# Copyright (C) 2024 Bootlin
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_VERSION:=2.10
PKG_RELEASE:=1
PKG_HASH:=88215a62291b9ba87da8e50b077741103cdc08fb6c9e1ebd34dfaace746d3201
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/trusted-firmware-a.mk
include $(INCLUDE_DIR)/package.mk
define Trusted-Firmware-A/Default
BUILD_TARGET:=stm32
BUILD_DEVICES:=$(1)
DEPENDS:=+u-boot-$(1) +optee-os-$(1)
endef
define Trusted-Firmware-A/stm32mp1
BUILD_SUBTARGET:=stm32mp1
PLAT:=stm32mp1
MAKE_ARGS += BL32_EXTRA2=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pageable_v2.bin \
STM32MP_USB_PROGRAMMER=1 \
STM32MP1_OPTEE_IN_SYSRAM=1 \
ARM_ARCH_MAJOR=7
endef
define Trusted-Firmware-A/stm32mp135f-dk
$(call Trusted-Firmware-A/stm32mp1)
NAME:=STM32MP135F-DK
DTB_FILE_NAME=stm32mp135f-dk.dtb
endef
TFA_TARGETS := stm32mp135f-dk
TFA_MAKE_FLAGS += \
ARCH=aarch32 AARCH32_SP=optee \
BL32=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-header_v2.bin \
BL32_EXTRA1=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pager_v2.bin \
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.bin \
BL33_CFG=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.dtb \
DTB_FILE_NAME=$(DTB_FILE_NAME) \
STM32MP_SDMMC=1 \
TARGET_BOARD="" \
$(MAKE_ARGS) \
all fip
define Package/trusted-firmware-a/install
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/tf-a-$(BUILD_VARIANT).stm32 \
$(STAGING_DIR_IMAGE)/tf-a-$(BUILD_VARIANT).stm32
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \
$(STAGING_DIR_IMAGE)/fip-$(BUILD_VARIANT).bin
endef
$(eval $(call BuildPackage/Trusted-Firmware-A))

View File

@ -0,0 +1,49 @@
#
# Copyright (C) 2024 Bootlin
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_VERSION:=4.3.0
PKG_RELEASE:=1
PKG_HASH:=390b271905c828d6def9fa6a77bbaa425f3b434d733c8eb18f582ccbc6896096
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
OPTEE_USE_INTREE_DTC:=1
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/optee-os.mk
include $(INCLUDE_DIR)/package.mk
define Optee-os/Default
BUILD_TARGET:=stm32
endef
define Optee-os/stm32mp1
BUILD_SUBTARGET:=stm32mp1
PLAT:=stm32mp1
endef
define Optee-os/stm32mp135f-dk
$(call Optee-os/stm32mp1)
NAME:=STM32MP135F-DK
PLAT_FLAVOR:=135F_DK
endef
OPTEE_TARGETS := stm32mp135f-dk
define Package/optee-os/install/default
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(foreach img,$(OPTEE_IMAGE), \
$(CP) $(PKG_BUILD_DIR)/out/arm-plat-$(PLAT)/core/$(img) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(img); \
)
endef
$(eval $(call BuildPackage/Optee-os))

View File

@ -163,6 +163,7 @@ ruckus,zf7372)
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x40000" "0x10000"
;;
sophos,ap15|\
sophos,ap15c|\
sophos,ap55|\
sophos,ap55c|\
sophos,ap100|\

View File

@ -40,9 +40,11 @@ h3c,magic-nx30-pro|\
imou,lc-hx3001|\
jcg,q30-pro|\
livinet,zr-3020-ubootmod|\
mercusys,mr90x-v1-ubi|\
netcore,n60|\
nokia,ea0326gmp|\
qihoo,360t7|\
routerich,ax3000-ubootmod|\
tplink,tl-xdr4288|\
tplink,tl-xdr6086|\
tplink,tl-xdr6088|\
@ -53,6 +55,16 @@ xiaomi,redmi-router-ax6000-ubootmod|\
zyxel,ex5601-t0-ubootmod)
ubootenv_add_ubi_default
;;
acer,predator-w6|\
acer,predator-w6d|\
acer,vero-w6m|\
glinet,gl-mt2500|\
glinet,gl-mt6000|\
glinet,gl-x3000|\
glinet,gl-xe3000)
local envdev=$(find_mmc_part "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
;;
asus,rt-ax59u)
ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000"
;;
@ -92,12 +104,8 @@ comfast,cf-e393ax)
dlink,aquila-pro-ai-m30-a1)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
;;
glinet,gl-x3000|\
glinet,gl-xe3000|\
glinet,gl-mt2500|\
glinet,gl-mt6000)
local envdev=$(find_mmc_part "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
gatonetworks,gdsp)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
glinet,gl-mt3000)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"

View File

@ -449,13 +449,26 @@ define U-Boot/mt7981_rfb-emmc
DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr3
endef
define U-Boot/mt7981_gatonetworks_gdsp
NAME:=GatoNetworks GDSP
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=gatonetworks_gdsp
UBOOT_CONFIG:=mt7981_gatonetworks_gdsp
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=nor
BL2_SOC:=mt7981
BL2_DDRTYPE:=ddr3
DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr3
FIP_COMPRESS:=1
endef
define U-Boot/mt7981_rfb-nor
NAME:=MT7981 Reference Board
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=mediatek_mt7981-rfb
UBOOT_CONFIG:=mt7981_nor_rfb
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand
BL2_BOOTDEV:=nor
BL2_SOC:=mt7981
BL2_DDRTYPE:=ddr3
DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr3
@ -485,6 +498,18 @@ define U-Boot/mt7981_rfb-snfi
DEPENDS:=+trusted-firmware-a-mt7981-snand-ddr3
endef
define U-Boot/mt7981_routerich_ax3000
NAME:=Routerich AX3000
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=routerich_ax3000-ubootmod
UBOOT_CONFIG:=mt7981_routerich_ax3000
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand
BL2_SOC:=mt7981
BL2_DDRTYPE:=ddr3
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
endef
define U-Boot/mt7981_qihoo_360t7
NAME:=Qihoo 360T7
BUILD_SUBTARGET:=filogic
@ -630,6 +655,18 @@ define U-Boot/mt7986_jdcloud_re-cp-03
DEPENDS:=+trusted-firmware-a-mt7986-emmc-ddr4
endef
define U-Boot/mt7986_mercusys_mr90x-v1
NAME:=MERCUSYS MR90X v1
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=mercusys_mr90x-v1-ubi
UBOOT_CONFIG:=mt7986_mercusys_mr90x-v1
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand-ubi
BL2_SOC:=mt7986
BL2_DDRTYPE:=ddr3
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ubi-ddr3
endef
define U-Boot/mt7986_netcore_n60
NAME:=Netcore N60
BUILD_SUBTARGET:=filogic
@ -714,6 +751,18 @@ define U-Boot/mt7986_zyxel_ex5601-t0
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-4k-ddr4
endef
define U-Boot/mt7988_arcadyan_mozart
NAME:=Arcadyan Mozart
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=arcadyan_mozart
UBOOT_CONFIG:=mt7988a_arcadyan_mozart
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=emmc
BL2_SOC:=mt7988
BL2_DDRTYPE:=comb
DEPENDS:=+trusted-firmware-a-mt7988-emmc-comb
endef
define U-Boot/mt7988_bananapi_bpi-r4-emmc
NAME:=BananaPi BPi-R4
BUILD_SUBTARGET:=filogic
@ -872,6 +921,7 @@ UBOOT_TARGETS := \
mt7981_cmcc_a10 \
mt7981_cmcc_rax3000m-emmc \
mt7981_cmcc_rax3000m-nand \
mt7981_gatonetworks_gdsp \
mt7981_glinet_gl-x3000 \
mt7981_glinet_gl-xe3000 \
mt7981_h3c_magic-nx30-pro \
@ -889,6 +939,7 @@ UBOOT_TARGETS := \
mt7981_rfb-nor \
mt7981_rfb-sd \
mt7981_rfb-snfi \
mt7981_routerich_ax3000 \
mt7981_qihoo_360t7 \
mt7981_xiaomi_mi-router-ax3000t \
mt7981_xiaomi_mi-router-wr30u \
@ -900,6 +951,7 @@ UBOOT_TARGETS := \
mt7986_bananapi_bpi-r3-mini-snand \
mt7986_glinet_gl-mt6000 \
mt7986_jdcloud_re-cp-03 \
mt7986_mercusys_mr90x-v1 \
mt7986_netcore_n60 \
mt7986_tplink_tl-xdr4288 \
mt7986_tplink_tl-xdr6086 \
@ -908,6 +960,7 @@ UBOOT_TARGETS := \
mt7986_xiaomi_redmi-router-ax6000 \
mt7986_zyxel_ex5601-t0 \
mt7986_rfb \
mt7988_arcadyan_mozart \
mt7988_bananapi_bpi-r4-emmc \
mt7988_bananapi_bpi-r4-sdmmc \
mt7988_bananapi_bpi-r4-snand \
@ -923,7 +976,8 @@ UBOOT_TARGETS := \
UBOOT_CUSTOMIZE_CONFIG := \
--disable TOOLS_KWBIMAGE \
--disable TOOLS_LIBCRYPTO \
--disable TOOLS_MKEFICAPSULE
--disable TOOLS_MKEFICAPSULE \
--enable SERIAL_RX_BUFFER
ifdef CONFIG_TARGET_mediatek
UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE:.fip=.bin)

View File

@ -0,0 +1,63 @@
From 72b4ba8417d33516b8489bac3c90dbbbf781a3d2 Mon Sep 17 00:00:00 2001
From: Weijie Gao <weijie.gao@mediatek.com>
Date: Tue, 29 Oct 2024 17:47:10 +0800
Subject: [PATCH 1/3] menu: fix the logic checking whether ESC key is pressed
It's observed that the bootmenu on a serial console sometimes
incorrectly quitted with superfluous characters filled to command
line input:
> *** U-Boot Boot Menu ***
>
> 1. Startup system (Default)
> 2. Upgrade firmware
> 3. Upgrade ATF BL2
> 4. Upgrade ATF FIP
> 5. Load image
> 0. U-Boot console
>
>
> Press UP/DOWN to move, ENTER to select, ESC to quit
>MT7988> [B
Analysis shows it was caused by the wrong logic of bootmenu_loop:
At first the bootmenu_loop received the first ESC char correctly.
However, during the second call to bootmenu_loop, there's no data
in the UART Rx FIFO. Due to the low baudrate, the second char of
the down array key sequence hasn't be fully received.
But bootmenu_loop just did a mdelay(10), and then treated it as a
single ESC key press event. It didn't even try tstc() again after
the 10ms timeout.
This patch fixes this issue by letting bootmenu_loop check tstc()
twice.
Tested-By: E Shattow <lucent@gmail.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
---
common/menu.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/common/menu.c
+++ b/common/menu.c
@@ -525,14 +525,15 @@ enum bootmenu_key bootmenu_loop(struct b
struct cli_ch_state *cch)
{
enum bootmenu_key key;
- int c;
+ int c, errchar = 0;
c = cli_ch_process(cch, 0);
if (!c) {
while (!c && !tstc()) {
schedule();
mdelay(10);
- c = cli_ch_process(cch, -ETIMEDOUT);
+ c = cli_ch_process(cch, errchar);
+ errchar = -ETIMEDOUT;
}
if (!c) {
c = getchar();

View File

@ -0,0 +1,112 @@
From f1cbdd3330f0055dfbff0ef7d86276c4cc3cff2a Mon Sep 17 00:00:00 2001
From: Weijie Gao <weijie.gao@mediatek.com>
Date: Tue, 29 Oct 2024 17:47:16 +0800
Subject: [PATCH 2/3] menu: add support to check if menu needs to be reprinted
This patch adds a new callback named need_reprint for menu.
The need_reprint will be called before printing the menu. If the
callback exists and returns FALSE, menu printing will be canceled.
This is very useful if the menu was not changed. It can save time
for serial-based menu to handle more input data.
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
---
boot/pxe_utils.c | 2 +-
cmd/bootmenu.c | 2 +-
cmd/eficonfig.c | 2 +-
common/menu.c | 11 +++++++++++
include/menu.h | 1 +
5 files changed, 15 insertions(+), 3 deletions(-)
--- a/boot/pxe_utils.c
+++ b/boot/pxe_utils.c
@@ -1449,7 +1449,7 @@ static struct menu *pxe_menu_to_menu(str
* Create a menu and add items for all the labels.
*/
m = menu_create(cfg->title, DIV_ROUND_UP(cfg->timeout, 10),
- cfg->prompt, NULL, label_print, NULL, NULL);
+ cfg->prompt, NULL, label_print, NULL, NULL, NULL);
if (!m)
return NULL;
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -506,7 +506,7 @@ static enum bootmenu_ret bootmenu_show(i
menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline,
bootmenu_print_entry, bootmenu_choice_entry,
- bootmenu);
+ NULL, bootmenu);
if (!menu) {
bootmenu_destroy(bootmenu);
return BOOTMENU_RET_FAIL;
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -443,7 +443,7 @@ efi_status_t eficonfig_process_common(st
efi_menu->menu_desc = menu_desc;
menu = menu_create(NULL, 0, 1, display_statusline, item_data_print,
- item_choice, efi_menu);
+ item_choice, NULL, efi_menu);
if (!menu)
return EFI_INVALID_PARAMETER;
--- a/common/menu.c
+++ b/common/menu.c
@@ -43,6 +43,7 @@ struct menu {
void (*display_statusline)(struct menu *);
void (*item_data_print)(void *);
char *(*item_choice)(void *);
+ bool (*need_reprint)(void *);
void *item_choice_data;
struct list_head items;
int item_cnt;
@@ -117,6 +118,11 @@ static inline void *menu_item_destroy(st
*/
static inline void menu_display(struct menu *m)
{
+ if (m->need_reprint) {
+ if (!m->need_reprint(m->item_choice_data))
+ return;
+ }
+
if (m->title) {
puts(m->title);
putc('\n');
@@ -362,6 +368,9 @@ int menu_item_add(struct menu *m, char *
* item. Returns a key string corresponding to the chosen item or NULL if
* no item has been selected.
*
+ * need_reprint - If not NULL, will be called before printing the menu.
+ * Returning FALSE means the menu does not need reprint.
+ *
* item_choice_data - Will be passed as the argument to the item_choice function
*
* Returns a pointer to the menu if successful, or NULL if there is
@@ -371,6 +380,7 @@ struct menu *menu_create(char *title, in
void (*display_statusline)(struct menu *),
void (*item_data_print)(void *),
char *(*item_choice)(void *),
+ bool (*need_reprint)(void *),
void *item_choice_data)
{
struct menu *m;
@@ -386,6 +396,7 @@ struct menu *menu_create(char *title, in
m->display_statusline = display_statusline;
m->item_data_print = item_data_print;
m->item_choice = item_choice;
+ m->need_reprint = need_reprint;
m->item_choice_data = item_choice_data;
m->item_cnt = 0;
--- a/include/menu.h
+++ b/include/menu.h
@@ -13,6 +13,7 @@ struct menu *menu_create(char *title, in
void (*display_statusline)(struct menu *),
void (*item_data_print)(void *),
char *(*item_choice)(void *),
+ bool (*need_reprint)(void *),
void *item_choice_data);
int menu_default_set(struct menu *m, char *item_key);
int menu_get_choice(struct menu *m, void **choice);

View File

@ -0,0 +1,75 @@
From 702752cfae954648d6133bdff19283343b3339ef Mon Sep 17 00:00:00 2001
From: Weijie Gao <weijie.gao@mediatek.com>
Date: Tue, 29 Oct 2024 17:47:22 +0800
Subject: [PATCH 3/3] bootmenu: add reprint check
Record the last active menu item and check if it equals to the
current selected item before reprint.
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
---
cmd/bootmenu.c | 16 +++++++++++++++-
include/menu.h | 1 +
2 files changed, 16 insertions(+), 1 deletion(-)
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -103,11 +103,13 @@ static char *bootmenu_choice_entry(void
switch (key) {
case BKEY_UP:
+ menu->last_active = menu->active;
if (menu->active > 0)
--menu->active;
/* no menu key selected, regenerate menu */
return NULL;
case BKEY_DOWN:
+ menu->last_active = menu->active;
if (menu->active < menu->count - 1)
++menu->active;
/* no menu key selected, regenerate menu */
@@ -133,6 +135,17 @@ static char *bootmenu_choice_entry(void
return NULL;
}
+static bool bootmenu_need_reprint(void *data)
+{
+ struct bootmenu_data *menu = data;
+ bool need_reprint;
+
+ need_reprint = menu->last_active != menu->active;
+ menu->last_active = menu->active;
+
+ return need_reprint;
+}
+
static void bootmenu_destroy(struct bootmenu_data *menu)
{
struct bootmenu_entry *iter = menu->first;
@@ -332,6 +345,7 @@ static struct bootmenu_data *bootmenu_cr
menu->delay = delay;
menu->active = 0;
+ menu->last_active = -1;
menu->first = NULL;
default_str = env_get("bootmenu_default");
@@ -506,7 +520,7 @@ static enum bootmenu_ret bootmenu_show(i
menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline,
bootmenu_print_entry, bootmenu_choice_entry,
- NULL, bootmenu);
+ bootmenu_need_reprint, bootmenu);
if (!menu) {
bootmenu_destroy(bootmenu);
return BOOTMENU_RET_FAIL;
--- a/include/menu.h
+++ b/include/menu.h
@@ -40,6 +40,7 @@ int menu_show(int bootdelay);
struct bootmenu_data {
int delay; /* delay for autoboot */
int active; /* active menu entry */
+ int last_active; /* last active menu entry */
int count; /* total count of menu entries */
struct bootmenu_entry *first; /* first menu entry */
};

View File

@ -35,7 +35,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
}
switch (key) {
@@ -112,6 +113,12 @@ static char *bootmenu_choice_entry(void
@@ -114,6 +115,12 @@ static char *bootmenu_choice_entry(void
++menu->active;
/* no menu key selected, regenerate menu */
return NULL;
@ -48,7 +48,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
case BKEY_SELECT:
iter = menu->first;
for (i = 0; i < menu->active; ++i)
@@ -169,6 +176,9 @@ static int prepare_bootmenu_entry(struct
@@ -182,6 +189,9 @@ static int prepare_bootmenu_entry(struct
unsigned short int i = *index;
struct bootmenu_entry *entry = NULL;
struct bootmenu_entry *iter = *current;
@ -58,7 +58,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
while ((option = bootmenu_getoption(i))) {
@@ -183,11 +193,24 @@ static int prepare_bootmenu_entry(struct
@@ -196,11 +206,24 @@ static int prepare_bootmenu_entry(struct
if (!entry)
return -ENOMEM;
@ -84,15 +84,15 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
entry->command = strdup(sep + 1);
if (!entry->command) {
@@ -333,6 +356,7 @@ static struct bootmenu_data *bootmenu_cr
menu->delay = delay;
@@ -347,6 +370,7 @@ static struct bootmenu_data *bootmenu_cr
menu->active = 0;
menu->last_active = -1;
menu->first = NULL;
+ menu->last_choiced = false;
default_str = env_get("bootmenu_default");
if (default_str)
@@ -368,9 +392,9 @@ static struct bootmenu_data *bootmenu_cr
@@ -382,9 +406,9 @@ static struct bootmenu_data *bootmenu_cr
/* Add Quit entry if exiting bootmenu is disabled */
if (!IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE))
@ -106,7 +106,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
free(entry);
--- a/common/menu.c
+++ b/common/menu.c
@@ -48,6 +48,33 @@ struct menu {
@@ -49,6 +49,33 @@ struct menu {
int item_cnt;
};
@ -140,7 +140,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
/*
* An iterator function for menu items. callback will be called for each item
* in m, with m, a pointer to the item, and extra being passed to callback. If
@@ -426,7 +453,7 @@ int menu_destroy(struct menu *m)
@@ -437,7 +464,7 @@ int menu_destroy(struct menu *m)
}
enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
@ -149,7 +149,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
{
enum bootmenu_key key = BKEY_NONE;
int i, c;
@@ -461,6 +488,19 @@ enum bootmenu_key bootmenu_autoboot_loop
@@ -472,6 +499,19 @@ enum bootmenu_key bootmenu_autoboot_loop
break;
default:
key = BKEY_NONE;
@ -169,7 +169,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
break;
}
break;
@@ -481,7 +521,8 @@ enum bootmenu_key bootmenu_autoboot_loop
@@ -492,7 +532,8 @@ enum bootmenu_key bootmenu_autoboot_loop
return key;
}
@ -179,7 +179,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
{
enum bootmenu_key key;
@@ -513,6 +554,20 @@ enum bootmenu_key bootmenu_conv_key(int
@@ -524,6 +565,20 @@ enum bootmenu_key bootmenu_conv_key(int
case ' ':
key = BKEY_SPACE;
break;
@ -200,15 +200,16 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
default:
key = BKEY_NONE;
break;
@@ -522,11 +577,16 @@ enum bootmenu_key bootmenu_conv_key(int
@@ -533,11 +588,17 @@ enum bootmenu_key bootmenu_conv_key(int
}
enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
- struct cli_ch_state *cch)
+ struct cli_ch_state *cch, int *choice)
+ struct cli_ch_state *cch,
+ int *choice)
{
enum bootmenu_key key;
int c;
int c, errchar = 0;
+ if (menu->last_choiced) {
+ menu->last_choiced = false;
@ -218,7 +219,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
c = cli_ch_process(cch, 0);
if (!c) {
while (!c && !tstc()) {
@@ -540,7 +600,7 @@ enum bootmenu_key bootmenu_loop(struct b
@@ -552,7 +613,7 @@ enum bootmenu_key bootmenu_loop(struct b
}
}
@ -238,7 +239,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
struct cli_ch_state;
struct menu;
@@ -19,6 +21,8 @@ int menu_get_choice(struct menu *m, void
@@ -20,6 +22,8 @@ int menu_get_choice(struct menu *m, void
int menu_item_add(struct menu *m, char *item_key, void *item_data);
int menu_destroy(struct menu *m);
int menu_default_choice(struct menu *m, void **choice);
@ -247,15 +248,15 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
/**
* menu_show() Show a boot menu
@@ -41,6 +45,7 @@ struct bootmenu_data {
int active; /* active menu entry */
@@ -43,6 +47,7 @@ struct bootmenu_data {
int last_active; /* last active menu entry */
int count; /* total count of menu entries */
struct bootmenu_entry *first; /* first menu entry */
+ bool last_choiced;
};
/** enum bootmenu_key - keys that can be returned by the bootmenu */
@@ -51,6 +56,7 @@ enum bootmenu_key {
@@ -53,6 +58,7 @@ enum bootmenu_key {
BKEY_SELECT,
BKEY_QUIT,
BKEY_SAVE,
@ -263,7 +264,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
/* 'extra' keys, which are used by menus but not cedit */
BKEY_PLUS,
@@ -81,7 +87,7 @@ enum bootmenu_key {
@@ -83,7 +89,7 @@ enum bootmenu_key {
* anything else: KEY_NONE
*/
enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
@ -272,7 +273,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
/**
* bootmenu_loop() - handle waiting for a keypress when autoboot is disabled
@@ -107,7 +113,7 @@ enum bootmenu_key bootmenu_autoboot_loop
@@ -109,7 +115,7 @@ enum bootmenu_key bootmenu_autoboot_loop
* Space: BKEY_SPACE
*/
enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
@ -281,7 +282,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
/**
* bootmenu_conv_key() - Convert a U-Boot keypress into a menu key
@@ -115,6 +121,7 @@ enum bootmenu_key bootmenu_loop(struct b
@@ -117,6 +123,7 @@ enum bootmenu_key bootmenu_loop(struct b
* @ichar: Keypress to convert (ASCII, including control characters)
* Returns: Menu key that corresponds to @ichar, or BKEY_NONE if none
*/

View File

@ -1,6 +1,6 @@
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -451,7 +451,11 @@ static void menu_display_statusline(stru
@@ -465,7 +465,11 @@ static void menu_display_statusline(stru
printf(ANSI_CURSOR_POSITION, 1, 1);
puts(ANSI_CLEAR_LINE);
printf(ANSI_CURSOR_POSITION, 2, 3);
@ -13,7 +13,7 @@
puts(ANSI_CLEAR_LINE_TO_END);
printf(ANSI_CURSOR_POSITION, 3, 1);
puts(ANSI_CLEAR_LINE);
@@ -536,6 +540,7 @@ static enum bootmenu_ret bootmenu_show(i
@@ -550,6 +554,7 @@ static enum bootmenu_ret bootmenu_show(i
return BOOTMENU_RET_FAIL;
}
@ -23,8 +23,8 @@
goto cleanup;
--- a/include/menu.h
+++ b/include/menu.h
@@ -45,6 +45,7 @@ struct bootmenu_data {
int active; /* active menu entry */
@@ -47,6 +47,7 @@ struct bootmenu_data {
int last_active; /* last active menu entry */
int count; /* total count of menu entries */
struct bootmenu_entry *first; /* first menu entry */
+ char *mtitle; /* custom menu title */

View File

@ -0,0 +1,308 @@
--- /dev/null
+++ b/configs/mt7988a_arcadyan_mozart_defconfig
@@ -0,0 +1,119 @@
+CONFIG_ARM=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x40000
+CONFIG_ENV_OFFSET=0x400000
+CONFIG_DEFAULT_DEVICE_TREE="mt7988a-arcadyan-mozart"
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_TARGET_MT7988=y
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
+CONFIG_DEBUG_UART_BASE=0x11000000
+CONFIG_DEBUG_UART_CLOCK=40000000
+CONFIG_ENV_OFFSET_REDUND=0x440000
+CONFIG_SYS_LOAD_ADDR=0x50000000
+CONFIG_PCI=y
+CONFIG_DEBUG_UART=y
+CONFIG_AHCI=y
+CONFIG_FIT=y
+CONFIG_BOOTDELAY=30
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7988a-arcadyan-mozart.dtb"
+CONFIG_SYS_CBSIZE=512
+CONFIG_SYS_PBSIZE=1049
+CONFIG_LOGLEVEL=7
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_LOG=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="MT7988> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
+# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
+CONFIG_CMD_BOOTMENU=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_PWM=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_SF_TEST=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_TFTPSRV=y
+CONFIG_CMD_RARP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CDP=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_LINK_LOCAL=y
+CONFIG_CMD_PXE=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_PSTORE=y
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
+CONFIG_CMD_UUID=y
+CONFIG_CMD_HASH=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_FS_UUID=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="arcadyan_mozart_env"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
+CONFIG_USE_IPADDR=y
+CONFIG_IPADDR="192.168.1.1"
+CONFIG_USE_SERVERIP=y
+CONFIG_SERVERIP="192.168.1.254"
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
+CONFIG_CLK=y
+CONFIG_GPIO_HOG=y
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_MMC_HS200_SUPPORT=y
+CONFIG_MMC_MTK=y
+CONFIG_PHY_FIXED=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PHY=y
+CONFIG_PHY_MTK_TPHY=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7988=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_MTK=y
+CONFIG_RAM=y
+CONFIG_SCSI=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_ZSTD=y
+CONFIG_HEXDUMP=y
+CONFIG_LMB_MAX_REGIONS=64
--- /dev/null
+++ b/arcadyan_mozart_env
@@ -0,0 +1,55 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x50000000
+bootargs=console=ttyS0,115200n1 pci=pcie_bus_perf root=/dev/fit0 rootwait
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
+bootconf=config-1
+bootconf_extra=
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-arcadyan_mozart-initramfs.itb
+bootfile_bl2=openwrt-mediatek-filogic-arcadyan_mozart-emmc-preloader.bin
+bootfile_fip=openwrt-mediatek-filogic-arcadyan_mozart-emmc-bl31-uboot.fip
+bootfile_upg=openwrt-mediatek-filogic-arcadyan_mozart-squashfs-sysupgrade.itb
+bootled_pwr=blue:status
+bootled_rec=red:status
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
+bootmenu_default=0
+bootmenu_delay=0
+bootmenu_title= ( ( ( OpenWrt ) ) ) [eMMC]
+bootmenu_0=Initialize environment.=run _firstboot
+bootmenu_0d=Run default boot command.=run boot_default
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
+bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return
+bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return
+bootmenu_4=Load production system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
+bootmenu_5=Load recovery system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
+bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to eMMC.=run boot_tftp_write_fip ; run bootmenu_confirm_return
+bootmenu_7=Load BL2 preloader via TFTP then write to eMMC.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
+bootmenu_8=Reboot.=reset
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
+boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf#$bootconf_extra ; led $bootled_pwr off
+boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf#$bootconf_extra ; led $bootled_rec off
+boot_emmc=run boot_production ; run boot_recovery
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run emmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf#$bootconf_extra ; fi
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run emmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
+mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
+part_default=production
+part_recovery=recovery
+reset_factory=eraseenv && reset
+emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol
+emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol
+emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0
+emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800
+emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
+_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"
--- /dev/null
+++ b/arch/arm/dts/mt7988a-arcadyan-mozart.dts
@@ -0,0 +1,125 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+#include "mt7988.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+
+/ {
+ model = "MediaTek / Arcadyan - Mozart";
+ compatible = "arcadyan,mozart", "mediatek,mt7988";
+
+ chosen {
+ stdout-path = &uart0;
+ };
+
+ memory@40000000 {
+ device_type = "memory";
+ reg = <0 0x40000000 0 0x40000000>;
+ };
+
+ reg_3p3v: regulator-3p3v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ reg_1p8v: regulator-1p8v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-1.8V";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ wps {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 143 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-red {
+ label = "red:status";
+ gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
+ };
+
+ led-green {
+ label = "blue:status";
+ gpios = <&gpio 30 GPIO_ACTIVE_HIGH>;
+ };
+
+ led-blue {
+ label = "blue:status";
+ gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "usxgmii";
+ mediatek,switch = "mt7988";
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ pause;
+ };
+};
+
+&pinctrl {
+ mmc0_pins_default: mmc0default {
+ mux {
+ function = "flash";
+ groups = "emmc_51";
+ };
+
+ conf-cmd-dat {
+ pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
+ "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
+ "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
+ input-enable;
+ };
+
+ conf-clk {
+ pins = "EMMC_CK";
+ };
+
+ conf-dsl {
+ pins = "EMMC_DSL";
+ };
+
+ conf-rst {
+ pins = "EMMC_RSTB";
+ };
+ };
+};
+
+&mmc0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins_default>;
+ max-frequency = <52000000>;
+ bus-width = <8>;
+ cap-mmc-highspeed;
+ cap-mmc-hw-reset;
+ vmmc-supply = <&reg_3p3v>;
+ vqmmc-supply = <&reg_1p8v>;
+ non-removable;
+ status = "okay";
+};

View File

@ -0,0 +1,54 @@
From 9c1ad8a18ac1a20aee7a617964bcae3e90dac700 Mon Sep 17 00:00:00 2001
From: Enrico Mioso <mrkiko.rs@gmail.com>
Date: Wed, 23 Oct 2024 17:46:35 +0200
Subject: [PATCH] uboot-mediatek: initialized the watchdog subsystem later
Initialize the watchdog subsystem later during initialization, to allow for
the gpio-wdt driver to work.
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
---
common/board_r.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -663,19 +663,13 @@ static init_fnc_t init_sequence_r[] = {
serial_initialize,
initr_announce,
dm_announce,
-#if CONFIG_IS_ENABLED(WDT)
- initr_watchdog,
-#endif
- INIT_FUNC_WATCHDOG_RESET
arch_initr_trap,
#if defined(CONFIG_BOARD_EARLY_INIT_R)
board_early_init_r,
#endif
- INIT_FUNC_WATCHDOG_RESET
#ifdef CONFIG_POST
post_output_backlog,
#endif
- INIT_FUNC_WATCHDOG_RESET
#if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT)
/*
* Do early PCI configuration _before_ the flash gets initialised,
@@ -690,7 +684,6 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_MTD_NOR_FLASH
initr_flash,
#endif
- INIT_FUNC_WATCHDOG_RESET
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86)
/* initialize higher level parts of CPU like time base and timers */
cpu_init_r,
@@ -719,6 +712,10 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_PVBLOCK
initr_pvblock,
#endif
+#if CONFIG_IS_ENABLED(WDT)
+ initr_watchdog,
+#endif
+ INIT_FUNC_WATCHDOG_RESET
initr_env,
#ifdef CONFIG_SYS_MALLOC_BOOTPARAMS
initr_malloc_bootparams,

View File

@ -0,0 +1,406 @@
From 57d0f608d925cb688b5c9b71512fca7d228f07f6 Mon Sep 17 00:00:00 2001
From: Enrico Mioso <mrkiko.rs@gmail.com>
Date: Wed, 23 Oct 2024 20:39:28 +0200
Subject: [PATCH] add GatoNetworks GDSP
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
---
arch/arm/dts/mt7981-gatonetworks_gdsp.dts | 200 +++++++++++++++++++++
configs/mt7981_gatonetworks_gdsp_defconfig | 144 +++++++++++++++
gatonetworks_gdsp_env | 38 ++++
3 files changed, 382 insertions(+)
create mode 100644 arch/arm/dts/mt7981-gatonetworks_gdsp.dts
create mode 100644 configs/mt7981_gatonetworks_gdsp_defconfig
create mode 100644 gatonetworks_gdsp_env
--- /dev/null
+++ b/arch/arm/dts/mt7981-gatonetworks_gdsp.dts
@@ -0,0 +1,200 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+#include "mt7981.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "GatoNetworks GDSP";
+ compatible = "gatonetworks,gdsp", "mediatek,mt7981";
+ chosen {
+ stdout-path = &uart0;
+ tick-timer = &timer0;
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x40000000 0x10000000>;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ sim1 {
+ label = "sim1";
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+ };
+
+ sim2 {
+ label = "sim2";
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+ };
+
+ sg1 {
+ label = "sg1";
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+ };
+
+ sg2 {
+ label = "sg2";
+ gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+ };
+
+ sg3 {
+ label = "sg3";
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+ };
+
+ sg4 {
+ label = "sg4";
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
+ };
+
+ sg5 {
+ label = "sg5";
+ gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+ };
+
+ sg6 {
+ label = "sg6";
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+ };
+ };
+ gpio-watchdog {
+ compatible = "linux,wdt-gpio";
+ gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
+ hw_algo = "toggle";
+ hw_margin_ms = <25000>;
+ always-running;
+ u-boot,autostart;
+ };
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "2500base-x";
+ mediatek,switch = "mt7531";
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
+
+ fixed-link {
+ speed = <2500>;
+ full-duplex;
+ };
+};
+
+&spi2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi2_flash_pins>;
+ status = "okay";
+ must_tx;
+ enhance_timing;
+ dma_ext;
+ ipm_design;
+ support_quad;
+ tick_dly = <2>;
+ sample_sel = <0>;
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <52000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@00000 {
+ label = "BL2";
+ reg = <0x00000 0x0040000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "u-boot-env";
+ reg = <0x40000 0x0010000>;
+ };
+
+ partition@50000 {
+ label = "Factory";
+ reg = <0x50000 0x00B0000>;
+ read-only;
+ };
+
+ partition@100000 {
+ label = "FIP";
+ reg = <0x100000 0x0080000>;
+ };
+
+ partition@180000 {
+ label = "firmware";
+ reg = <0x180000 0x1E80000>;
+ };
+ };
+ };
+};
+
+&pinctrl {
+ uart1_pins: uart1-pins {
+ mux {
+ function = "uart";
+ groups = "uart1_0";
+ };
+ };
+
+ uart2_pins: uart2-pins {
+ mux {
+ function = "uart";
+ groups = "uart2_0_tx_rx";
+ };
+ };
+
+ spi2_flash_pins: spi2-pins {
+ mux {
+ function = "spi";
+ groups = "spi2", "spi2_wp_hold";
+ };
+
+ conf-pu {
+ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+ };
+
+ conf-pd {
+ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+ status = "okay";
+};
+
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins>;
+ status = "okay";
+};
--- /dev/null
+++ b/configs/mt7981_gatonetworks_gdsp_defconfig
@@ -0,0 +1,144 @@
+CONFIG_ARM=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x0
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-gatonetworks_gdsp"
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_TARGET_MT7981=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=25000
+CONFIG_DEBUG_UART_BASE=0x11002000
+CONFIG_DEBUG_UART_CLOCK=40000000
+CONFIG_SYS_LOAD_ADDR=0x46000000
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+CONFIG_SPI_BOOT=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_USE_PREBOOT=y
+CONFIG_DEFAULT_FDT_FILE="mt7981-gatonetworks_gdsp"
+CONFIG_SYS_CBSIZE=512
+CONFIG_SYS_PBSIZE=1049
+CONFIG_LOGLEVEL=7
+CONFIG_CONSOLE_MUX=y
+CONFIG_LOG=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="GDSP> "
+CONFIG_SYS_MAXARGS=16
+CONFIG_CMD_BDINFO_EXTRA=y
+CONFIG_CMD_CPU=y
+CONFIG_CMD_HISTORY=y
+CONFIG_CMD_LICENSE=y
+# CONFIG_BOOTM_NETBSD is not set
+# CONFIG_BOOTM_PLAN9 is not set
+# CONFIG_BOOTM_RTEMS is not set
+# CONFIG_BOOTM_VXWORKS is not set
+# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
+CONFIG_CMD_BOOTMENU=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_CALLBACK=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CRC32_VERIFY=y
+CONFIG_LOOPW=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_STRINGS=y
+# CONFIG_CMD_UNLZ4 is not set
+# CONFIG_CMD_UNZIP is not set
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPIO_READ=y
+CONFIG_CMD_PWM=y
+CONFIG_CMD_MTD=y
+# CONFIG_CMD_NAND_EXT is not set
+CONFIG_CMD_SF_TEST=y
+CONFIG_CMD_CAT=y
+CONFIG_CMD_SETEXPR_FMT=y
+CONFIG_CMD_XXD=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_TFTPPUT=y
+CONFIG_CMD_TFTPSRV=y
+CONFIG_CMD_RARP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CDP=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_LINK_LOCAL=y
+CONFIG_CMD_PXE=y
+CONFIG_CMD_CACHE=y
+# CONFIG_CMD_EFICONFIG is not set
+CONFIG_CMD_PSTORE=y
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
+CONFIG_CMD_UUID=y
+CONFIG_CMD_HASH=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_FS_UUID=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_MTD=y
+CONFIG_ENV_MTD_NAME="u-boot-env"
+CONFIG_ENV_SIZE_REDUND=0x0
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="gatonetworks_gdsp_env"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
+CONFIG_CLK=y
+CONFIG_GPIO_HOG=y
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_MTD_SPI_NAND=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_EON=y
+CONFIG_SPI_FLASH_GIGADEVICE=y
+CONFIG_SPI_FLASH_ISSI=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_XMC=y
+CONFIG_SPI_FLASH_XTX=y
+CONFIG_SPI_FLASH_MTD=y
+CONFIG_UBI_SILENCE_MSG=y
+CONFIG_PHY_FIXED=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PHY=y
+CONFIG_PHY_MTK_TPHY=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7981=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_MTK=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_MTK_SPIM=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_MTK=y
+CONFIG_USB_STORAGE=y
+CONFIG_WDT=y
+CONFIG_WDT_GPIO=y
+CONFIG_UBIFS_SILENCE_MSG=y
+CONFIG_HEXDUMP=y
+CONFIG_LMB_MAX_REGIONS=64
--- /dev/null
+++ b/gatonetworks_gdsp_env
@@ -0,0 +1,38 @@
+load_factory_data=if env exists factory_data_present ; then else mtd read Factory $loadaddr 0x0 0x1000 ; setenv factory_data_present 1 ; fi
+lan_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x2a ; env readmem -b lan_mac $macoffs 0x6 ; setenv lan_mac_factory ; setenv macoffs
+wan_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x24 ; env readmem -b wan_mac $macoffs 0x6 ; setenv wan_mac_factory ; setenv macoffs
+label_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x4 ; env readmem -b label_mac $macoffs 0x6 ; setenv label_mac_factory ; setenv macoffs
+ethaddr_factory=setenv ethaddr $lan_mac ; setenv ethaddr_factory
+wifi_mac_factory=setenv wifi_mac $label_mac ; setenv wifi_mac_factory
+env_cleanup=setenv load_factory_data ; setenv factory_data_present ; setenv env_cleanup
+ipaddr=192.168.1.1
+serverip=192.168.1.10
+loadaddr=0x46000000
+bootcmd=run boot_nor
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-gatonetworks_gdsp-initramfs-kernel.bin
+bootfile_upg=openwrt-mediatek-filogic-gatonetworks_gdsp-squashfs-sysupgrade.bin
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
+bootmenu_default=0
+bootmenu_delay=0
+bootmenu_title= ( ( ( OpenWrt ) ) )
+bootmenu_0=Initialize environment.=run _firstboot
+bootmenu_0d=Run default boot command.=run boot_default
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
+bootmenu_2=Boot system from flash.=run boot_nor ; run bootmenu_confirm_return
+bootmenu_3=Load system via TFTP then write to flash.=run boot_tftp_sysupgrade ; run bootmenu_confirm_return
+bootmenu_4=Reset all settings to factory defaults.=run reset_factory ; reset
+bootmenu_5=Reboot.=reset
+boot_first=if button reset ; then run boot_tftp ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_tftp_forever
+boot_nor=mtd read firmware ${loadaddr} ; bootm $loadaddr
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr
+boot_tftp_forever=while true ; do run boot_tftp ; sleep 1 ; done
+boot_tftp_sysupgrade=tftpboot $loadaddr $bootfile_upg && iminfo $loadaddr && run nor_write_production
+reset_factory=env default -a && saveenv && reset
+nor_pad_size=setexpr image_eb $filesize / 0x1000 ; setexpr tmp1 image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb $image_eb + 1 ; setexpr image_eb $image_eb * 0x1000
+nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x1e80000 && mtd erase firmware 0x0 0x$image_eb && mtd write firmware $loadaddr 0x0 $filesize
+_init_env=setenv _init_env ; saveenv
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run lan_mac_factory ; run wan_mac_factory ; run label_mac_factory ; run env_cleanup ; run ethaddr_factory ; run wifi_mac_factory ; run _init_env ; run boot_first
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"

View File

@ -0,0 +1,343 @@
--- /dev/null
+++ b/configs/mt7986_mercusys_mr90x-v1_defconfig
@@ -0,0 +1,107 @@
+CONFIG_ARM=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEFAULT_DEVICE_TREE="mt7986b-mercusys_mr90x-v1"
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_TARGET_MT7986=y
+CONFIG_PRE_CON_BUF_ADDR=0x4007ef00
+CONFIG_DEBUG_UART_BASE=0x11002000
+CONFIG_DEBUG_UART_CLOCK=40000000
+CONFIG_SYS_LOAD_ADDR=0x46000000
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+CONFIG_BOOTDELAY=30
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986b-mercusys_mr90x-v1.dtb"
+CONFIG_LOGLEVEL=7
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_LOG=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="MT7986> "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
+CONFIG_CMD_BOOTMENU=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_TFTPSRV=y
+CONFIG_CMD_RARP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CDP=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_LINK_LOCAL=y
+CONFIG_CMD_PXE=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_PSTORE=y
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
+CONFIG_CMD_UUID=y
+CONFIG_CMD_HASH=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_UBI=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_ENV_UBI_PART="ubi"
+CONFIG_ENV_UBI_VOLUME="ubootenv"
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="mercusys_mr90x-v1_env"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
+CONFIG_USE_IPADDR=y
+CONFIG_IPADDR="192.168.1.1"
+CONFIG_USE_SERVERIP=y
+CONFIG_SERVERIP="192.168.1.254"
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
+CONFIG_CLK=y
+CONFIG_GPIO_HOG=y
+# CONFIG_I2C is not set
+# CONFIG_MMC is not set
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_MTD_SPI_NAND=y
+CONFIG_MTD_UBI_FASTMAP=y
+CONFIG_PHY_FIXED=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PHY=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7986=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_RAM=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_MTK_SPIM=y
+CONFIG_RANDOM_UUID=y
+CONFIG_ZSTD=y
+CONFIG_HEXDUMP=y
+CONFIG_LMB_MAX_REGIONS=64
--- /dev/null
+++ b/arch/arm/dts/mt7986b-mercusys_mr90x-v1.dts
@@ -0,0 +1,174 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2024
+ * Author: Mikhail Zhilkin <csharper2005@gmail.com>
+ */
+
+/dts-v1/;
+#include "mt7986.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "MERCUSYS MR90X v1";
+ compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";
+
+ chosen {
+ stdout-path = &uart0;
+ tick-timer = &timer0;
+ };
+
+ memory@40000000 {
+ device_type = "memory";
+ reg = <0x40000000 0x20000000>;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-0 {
+ label = "green:lan2";
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
+ };
+
+ led-1 {
+ label = "green:lan1";
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+ };
+
+ led-2 {
+ label = "green:lan0";
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+ };
+
+ led-3 {
+ label = "green:wan";
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+ };
+
+ led-4 {
+ label = "amber:status";
+ gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_status_green: led-5 {
+ label = "green:status";
+ gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+ status = "disabled";
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "2500base-x";
+ mediatek,switch = "mt7531";
+ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+
+ fixed-link {
+ speed = <2500>;
+ full-duplex;
+ };
+};
+
+&pinctrl {
+ spi_flash_pins: spi0-pins-func-1 {
+ mux {
+ function = "flash";
+ groups = "spi0", "spi0_wp_hold";
+ };
+
+ conf-pu {
+ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
+ };
+
+ conf-pd {
+ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
+ };
+ };
+
+ spic_pins: spi1-pins-func-1 {
+ mux {
+ function = "spi";
+ groups = "spi1_2";
+ };
+ };
+
+ uart1_pins: spi1-pins-func-3 {
+ mux {
+ function = "uart";
+ groups = "uart1_2";
+ };
+ };
+};
+
+&spi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_flash_pins>;
+ status = "okay";
+ must_tx;
+ enhance_timing;
+ dma_ext;
+ ipm_design;
+ tick_dly = <2>;
+ sample_sel = <0>;
+
+ spi_nand@1 {
+ compatible = "spi-nand";
+ reg = <1>;
+ spi-max-frequency = <20000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ reg = <0x0 0x100000>;
+ label = "bl2";
+ };
+
+ partition@100000 {
+ reg = <0x100000 0x100000>;
+ label = "factory";
+ };
+
+ partition@200000 {
+ reg = <0x200000 0x7e00000>;
+ label = "ubi";
+ };
+ };
+ };
+};
+
+&watchdog {
+ status = "disabled";
+};
--- /dev/null
+++ b/mercusys_mr90x-v1_env
@@ -0,0 +1,53 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=console=ttyS0,115200n8 console_msg_format=syslog
+bootcmd=run check_buttons ; run boot_production ; run boot_recovery
+bootconf=config-1
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-initramfs-recovery.itb
+bootfile_bl2=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-preloader.bin
+bootfile_fip=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-bl31-uboot.fip
+bootfile_upg=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-squashfs-sysupgrade.itb
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
+bootmenu_default=0
+bootmenu_delay=0
+bootmenu_title= ( ( ( OpenWrt ) ) ) [SPI-NAND]
+bootmenu_0=Initialize environment.=run _firstboot
+bootmenu_0d=Run default boot command.=run boot_default
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
+bootmenu_4=Load production system via TFTP then write to NAND.=noboot=1 ; replacevol=1 ; run boot_tftp_production ; noboot= ; replacevol= ; run bootmenu_confirm_return
+bootmenu_5=Load recovery system via TFTP then write to NAND.=noboot=1 ; replacevol=1 ; run boot_tftp_recovery ; noboot= ; replacevol= ; run bootmenu_confirm_return
+bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return
+bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
+bootmenu_8=Reboot.=reset
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
+boot_default=run led_boot ; run bootcmd ; run boot_recovery ; replacevol=1 ; run boot_tftp_forever
+boot_production=run led_boot ; run ubi_read_production && bootm $loadaddr#$bootconf
+boot_recovery=run led_boot ; run ubi_read_recovery && bootm $loadaddr#$bootconf
+boot_tftp=run led_boot ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+boot_tftp_forever=run led_boot ; while true ; do run boot_tftp ; sleep 1 ; done
+boot_tftp_production=run led_boot ; tftpboot $loadaddr $bootfile_upg && test $replacevol = 1 && iminfo $loadaddr && run ubi_write_production ; if test $noboot = 1 ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp_recovery=run led_boot ; tftpboot $loadaddr $bootfile && test $replacevol = 1 && iminfo $loadaddr && run ubi_write_recovery ; if test $noboot = 1 ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp_write_fip=run led_boot ; tftpboot $loadaddr $bootfile_fip && run ubi_write_fip && run reset_factory
+boot_tftp_write_bl2=run led_boot ; tftpboot $loadaddr $bootfile_bl2 && run snand_write_bl2
+check_buttons=if button reset ; then run boot_tftp ; fi
+ethaddr_factory=mtd read factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x40088000 0x6 ; setenv ethaddr_factory
+led_boot=led green:status off ; led amber:status on
+reset_factory=mw $loadaddr 0xff 0x1f000 ; ubi write $loadaddr ubootenv 0x1f000 ; ubi write $loadaddr ubootenv2 0x1f000 ; ubi remove rootfs_data
+snand_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr 0x0 0x40000
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x1f000 dynamic ; ubi check ubootenv2 || ubi create ubootenv2 0x1f000 dynamic
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
+ubi_write_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip $filesize static && ubi write $loadaddr fip $filesize
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; bootmenu
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"

View File

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

View File

@ -0,0 +1,51 @@
#
# Copyright (C) 2024 Bootlin
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_VERSION:=2024.07
PKG_RELEASE:=1
PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
UBOOT_USE_INTREE_DTC:=1
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define U-Boot/Default
BUILD_TARGET:=stm32
UBOOT_IMAGE:=u-boot.bin u-boot.dtb
endef
define U-Boot/stm32mp13
BUILD_SUBTARGET:=stm32mp1
UBOOT_CONFIG:=stm32mp13
endef
define U-Boot/stm32mp135f-dk
$(call U-Boot/stm32mp13)
NAME:=STM32MP135F-DK
DEVICE_TREE:=stm32mp135f-dk
endef
UBOOT_TARGETS := stm32mp135f-dk
UBOOT_MAKE_FLAGS += DEVICE_TREE=$(DEVICE_TREE)
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(foreach img,$(UBOOT_IMAGE), \
$(CP) $(PKG_BUILD_DIR)/$(img) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(img); \
)
endef
define Package/u-boot/install/default
endef
$(eval $(call BuildPackage/U-Boot))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gdb
PKG_VERSION:=15.2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gdb
@ -37,7 +37,7 @@ $(call Package/gdb/Default)
endef
define Package/gdb/description
GDB, the GNU Project debugger, allows you to see what is going on `inside'
GDB, the GNU Project debugger, allows you to see what is going on 'inside'
another program while it executes -- or what another program was doing at the
moment it crashed.
endef

View File

@ -12,7 +12,8 @@ PKG_FLAGS:=nonshared
PKG_RELEASE:=10
PKG_CONFIG_DEPENDS:= \
CONFIG_TARGET_ramips
CONFIG_TARGET_ramips \
CONFIG_USB_SUPPORT
include $(INCLUDE_DIR)/package.mk
@ -22,9 +23,9 @@ define Package/automount
DEPENDS:= \
+block-mount \
+e2fsprogs \
+kmod-usb-storage \
+kmod-usb-storage-extras \
+!TARGET_ramips:kmod-usb-storage-uas \
+USB_SUPPORT:kmod-usb-storage \
+USB_SUPPORT:kmod-usb-storage-extras \
+(!TARGET_ramips&&USB_SUPPORT):kmod-usb-storage-uas \
+kmod-fs-ext4 \
+kmod-fs-exfat \
+kmod-fs-vfat \

View File

@ -40,7 +40,7 @@ define Package/dsl-vrx200-firmware-xdsl-a
CATEGORY:=Firmware
TITLE:=VRX200 / VR9 CPE xDSL Annex A firmware
URL:=http://www.lantiq.com/
DEPENDS:=@TARGET_lantiq_xrx200
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
endef
define Package/dsl-vrx200-firmware-xdsl-a/description
@ -52,7 +52,7 @@ define Package/dsl-vrx200-firmware-xdsl-b
CATEGORY:=Firmware
TITLE:=VRX200 / VR9 CPE xDSL Annex B firmware
URL:=http://www.lantiq.com/
DEPENDS:=@TARGET_lantiq_xrx200
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
endef
define Package/dsl-vrx200-firmware-xdsl-b/description
@ -64,7 +64,7 @@ define Package/dsl-vrx200-firmware-xdsl-a-patch
CATEGORY:=Firmware
TITLE:=VRX200 / VR9 CPE xDSL Annex B to Annex A firmware patch
URL:=http://www.lantiq.com/
DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-b +bspatch
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +dsl-vrx200-firmware-xdsl-b +bspatch
endef
define Package/dsl-vrx200-firmware-xdsl-a-patch/description
@ -76,7 +76,7 @@ define Package/dsl-vrx200-firmware-xdsl-b-patch
CATEGORY:=Firmware
TITLE:=VRX200 / VR9 CPE xDSL Annex A to Annex B firmware patch
URL:=http://www.lantiq.com/
DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-a +bspatch
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +dsl-vrx200-firmware-xdsl-a +bspatch
endef
define Package/dsl-vrx200-firmware-xdsl-b-patch/description

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=linux-firmware
PKG_VERSION:=20241017
PKG_VERSION:=20241110
PKG_RELEASE:=1
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=a26c38ef5a83272f2b98ce8bf8ca1865a852a3deea49ce5a8dd804b914351273
PKG_HASH:=32e6d3eb5c7fcb69fe5d58976c6deafa0d6552719c6e74835064aff049d25bd7
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>

View File

@ -199,6 +199,14 @@ define Package/iwlwifi-firmware-ax210/install
endef
$(eval $(call BuildPackage,iwlwifi-firmware-ax210))
Package/iwlwifi-firmware-ax411 = $(call Package/firmware-default,Intel AX411 firmware)
define Package/iwlwifi-firmware-ax411/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0-89.ucode $(1)/lib/firmware
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0.pnvm $(1)/lib/firmware
endef
$(eval $(call BuildPackage,iwlwifi-firmware-ax411))
Package/iwlwifi-firmware-be200 = $(call Package/firmware-default,Intel BE200 firmware)
define Package/iwlwifi-firmware-be200/install
$(INSTALL_DIR) $(1)/lib/firmware
@ -216,29 +224,49 @@ define Package/e100-firmware/install
endef
$(eval $(call BuildPackage,e100-firmware))
Package/intel-igpu-firmware-dmc = $(call Package/firmware-default,Intel iGPU DMC Display MC firmware)
define Package/intel-igpu-firmware-dmc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
$(CP) \
$(PKG_BUILD_DIR)/i915/*_dmc_*.bin* \
$(1)/lib/firmware/i915/
i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc +i915-firmware-gsc
Package/i915-firmware = $(call Package/firmware-default,Intel I915 firmware \(meta package\),$(i915_deps),LICENSE.i915)
define Package/i915-firmware/install
true
endef
$(eval $(call BuildPackage,intel-igpu-firmware-dmc))
$(eval $(call BuildPackage,i915-firmware))
Package/intel-igpu-firmware-guc = $(call Package/firmware-default,Intel iGPU GUC Graphics MC firmware)
define Package/intel-igpu-firmware-guc/install
Package/i915-firmware-dmc = $(call Package/firmware-default,Intel I915 DMC firmware,,LICENSE.i915)
define Package/i915-firmware-dmc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
$(CP) \
$(PKG_BUILD_DIR)/i915/*_guc_*.bin* \
$(1)/lib/firmware/i915/
for f in $(PKG_BUILD_DIR)/i915/*_dmc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = dmc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,intel-igpu-firmware-guc))
$(eval $(call BuildPackage,i915-firmware-dmc))
Package/intel-igpu-firmware-huc = $(call Package/firmware-default,Intel iGPU HUC H.265 MC firmware)
define Package/intel-igpu-firmware-huc/install
Package/i915-firmware-guc = $(call Package/firmware-default,Intel I915 GUC firmware,,LICENSE.i915)
define Package/i915-firmware-guc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
$(CP) \
$(PKG_BUILD_DIR)/i915/*_huc_*.bin* \
$(1)/lib/firmware/i915/
for f in $(PKG_BUILD_DIR)/i915/*_guc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = guc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,intel-igpu-firmware-huc))
$(eval $(call BuildPackage,i915-firmware-guc))
Package/i915-firmware-huc = $(call Package/firmware-default,Intel I915 HUC firmware,,LICENSE.i915)
define Package/i915-firmware-huc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
for f in $(PKG_BUILD_DIR)/i915/*_huc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = huc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,i915-firmware-huc))
Package/i915-firmware-gsc = $(call Package/firmware-default,Intel I915 GSC firmware,,LICENSE.i915)
define Package/i915-firmware-gsc/install
$(INSTALL_DIR) $(1)/lib/firmware/i915
for f in $(PKG_BUILD_DIR)/i915/*_gsc*.bin; do \
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
if [ "$$$$t" = gsc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
done
endef
$(eval $(call BuildPackage,i915-firmware-gsc))

View File

@ -0,0 +1,8 @@
Package/panthor-firmware = $(call Package/firmware-default,Gen10 Arm Mali GPUs firmware)
define Package/panthor-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/arm/mali/arch10.8
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/arm/mali/arch10.8/mali_csffw.bin \
$(1)/lib/firmware/arm/mali/arch10.8/
endef
$(eval $(call BuildPackage,panthor-firmware))

View File

@ -10,7 +10,11 @@ Package/ath11k-firmware-wcn6750 = $(call Package/firmware-default,WCN6750 ath11k
define Package/ath11k-firmware-wcn6750/install
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/WCN6750/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/* $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/board-2.bin $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/Notice.txt $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/sc7280/wpss.mbn $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
endef
$(eval $(call BuildPackage,ath11k-firmware-wcn6750))

View File

@ -140,6 +140,20 @@ define Package/rtl8761bu-firmware/install
endef
$(eval $(call BuildPackage,rtl8761bu-firmware))
Package/rtl8812a-firmware = $(call Package/firmware-default,RealTek RTL8812AU firmware)
define Package/rtl8812a-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8812a_fw.bin $(1)/lib/firmware/rtw88
endef
$(eval $(call BuildPackage,rtl8812a-firmware))
Package/rtl8821a-firmware = $(call Package/firmware-default,RealTek RTL8821AU firmware)
define Package/rtl8821a-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8821a_fw.bin $(1)/lib/firmware/rtw88
endef
$(eval $(call BuildPackage,rtl8821a-firmware))
Package/rtl8821ae-firmware = $(call Package/firmware-default,RealTek RTL8821AE firmware,,LICENCE.rtlwifi_firmware.txt)
define Package/rtl8821ae-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi

View File

@ -0,0 +1,57 @@
#
# Copyright (C) 2024 Bootlin
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=murata-firmware
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-09-12
PKG_SOURCE_URL:=https://github.com/murata-wireless/cyw-fmac-fw.git
PKG_MIRROR_HASH:=26f8a2df800666daab183b2842e5b3d591b1e5b31769d5429f9d70527f43d152
PKG_SOURCE_VERSION:=50ac17bb65b2342cd954d49d9bc492709d431c3c
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
PKG_LICENSE_FILES:=LICENCE
include $(INCLUDE_DIR)/package.mk
define Package/murata-firmware-default
SECTION:=firmware
CATEGORY:=Firmware
URL:=https://community.murata.com/
endef
define Build/Compile
endef
define Package/murata-firmware-43430-sdio
$(Package/murata-firmware-default)
TITLE:=BCM43430 FullMac SDIO firmware
CONFLICTS:=cypress-firmware-43430-sdio
endef
define Package/murata-firmware-43430-sdio/install
$(INSTALL_DIR) $(1)/lib/firmware/murata
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/cyfmac43430-sdio.bin \
$(1)/lib/firmware/murata/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/cyfmac43430-sdio.1DX.clm_blob \
$(1)/lib/firmware/murata/
$(INSTALL_DIR) $(1)/lib/firmware/brcm
$(LN) \
../murata/cyfmac43430-sdio.bin \
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin
$(LN) \
../murata/cyfmac43430-sdio.1DX.clm_blob \
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob
endef
$(eval $(call BuildPackage,murata-firmware-43430-sdio))

View File

@ -0,0 +1,48 @@
#
# Copyright (C) 2024 Bootlin
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=murata-nvram
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-09-28
PKG_SOURCE_URL:=https://github.com/murata-wireless/cyw-fmac-nvram.git
PKG_MIRROR_HASH:=e2fc6f1f9898edfd67f5495e615882700f03b42a75efa2e3f4e2d524aed0efb8
PKG_SOURCE_VERSION:=255819aab07572d87576a13329ef9d4c654167aa
PKG_MAINTAINER:=Thomas Richard <thomas.richard@bootlin.com>
PKG_LICENSE_FILES:=LICENCE.cypress
include $(INCLUDE_DIR)/package.mk
define Package/murata-nvram-default
SECTION:=firmware
CATEGORY:=Firmware
URL:=https://community.murata.com/
endef
define Build/Compile
endef
define Package/murata-nvram-43430-sdio
$(Package/murata-nvram-default)
TITLE:=BCM43430 SDIO NVRAM
CONFLICTS:=brcmfmac-nvram-43430-sdio
endef
define Package/murata-nvram-43430-sdio/install
$(INSTALL_DIR) $(1)/lib/firmware/brcm
$(INSTALL_DATA) ./files/cyfmac43430-sdio.1DX.stm32.txt \
$(1)/lib/firmware/brcm/
$(LN) \
cyfmac43430-sdio.1DX.stm32.txt \
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp135f-dk.txt
endef
$(eval $(call BuildPackage,murata-nvram-43430-sdio))

View File

@ -0,0 +1,47 @@
# This NVRAM file is based on cyfmac43430-sdio.1DX.txt, except that the muxenab
# parameter was unset to enable IB IRQ (OOB IRQ is not stable on STM32
# platforms).
# 2.4 GHz, 20 MHz BW mode
manfid=0x2d0
prodid=0x0726
vendid=0x14e4
devid=0x43e2
boardtype=0x0726
boardrev=0x1202
boardnum=22
macaddr=00:90:4c:c5:12:38
sromrev=11
boardflags=0x00404201
boardflags3=0x08000000
xtalfreq=37400
nocrc=1
ag0=0
aa2g=1
ccode=ALL
#pa0itssit=0x20
extpagain2g=0
pa2ga0=-145,6667,-751
AvVmid_c0=0x0,0xc8
cckpwroffset0=2
maxp2ga0=74
#txpwrbckof=6
cckbw202gpo=0
legofdmbw202gpo=0x88888888
mcsbw202gpo=0xaaaaaaaa
propbw202gpo=0xdd
ofdmdigfilttype=18
ofdmdigfilttypebe=18
papdmode=1
papdvalidtest=1
pacalidx2g=48
papdepsoffset=-22
papdendidx=58
il0macaddr=00:90:4c:c5:12:38
wl0id=0x431b
# muxenab defined to enable OOB IRQ. Level sensitive interrupt via WL_HOST_WAKE line.
# muxenab=0x10
#BT COEX deferral limit setting
#btc_params 8 45000
#btc_params 10 20000
#spurconfig=0x3
# End of NVRAM - do not remove this line #

View File

@ -29,7 +29,6 @@ define Package/omnia-mcu-firmware
CATEGORY:=Firmware
URL:=https://gitlab.nic.cz/turris/hw/$(PKG_DISTNAME)/-/releases
TITLE:=CZ.NIC Turris Omnia MCU firmware
DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia
endef
define Package/omnia-mcu-firmware/description

View File

@ -4,7 +4,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=bcm27xx-gpu-fw
PKG_VERSION:=2024.10.08
PKG_VERSION_REAL:=1.$(subst .,,$(PKG_VERSION))
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=raspi-firmware_$(PKG_VERSION_REAL).orig.tar.xz
PKG_SOURCE_URL:=https://github.com/raspberrypi/firmware/releases/download/$(PKG_VERSION_REAL)
@ -33,6 +33,10 @@ define Build/Compile
true
endef
define Package/bcm27xx-gpu-fw/install
true
endef
define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/boot/bootcode.bin $(KERNEL_BUILD_DIR)
$(CP) $(PKG_BUILD_DIR)/boot/LICENCE.broadcom $(KERNEL_BUILD_DIR)

View File

@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/cryptodev
SUBMENU:=Cryptographic API modules
TITLE:=Driver for cryptographic acceleration
URL:=http://cryptodev-linux.org/
URL:=https://github.com/cryptodev-linux/cryptodev-linux
DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash
FILES:=$(PKG_BUILD_DIR)/cryptodev.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,50,cryptodev)
@ -36,8 +36,9 @@ define KernelPackage/cryptodev
endef
define KernelPackage/cryptodev/description
This is a driver for that allows to use the Linux kernel supported
hardware ciphers by user-space applications.
This driver allows use of the Linux kernel supported hardware-based
cryptographic and hash accelerators by user-space applications,
via a "/dev/crypto" device.
endef
define Build/Configure

View File

@ -302,7 +302,7 @@ struct gpio_keys_button_dev {
struct device *dev;
struct gpio_keys_platform_data *pdata;
struct gpio_keys_button_data data[0];
struct gpio_keys_button_data data[];
};
static void gpio_keys_polled_queue_work(struct gpio_keys_button_dev *bdev)
@ -693,7 +693,6 @@ static struct platform_driver gpio_keys_driver = {
.remove = gpio_keys_remove,
.driver = {
.name = "gpio-keys",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(gpio_keys_of_match),
},
};
@ -703,7 +702,6 @@ static struct platform_driver gpio_keys_polled_driver = {
.remove = gpio_keys_remove,
.driver = {
.name = "gpio-keys-polled",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(gpio_keys_polled_of_match),
},
};

View File

@ -366,7 +366,6 @@ err:
static struct platform_driver nct5104d_gpio_driver = {
.driver = {
.owner = THIS_MODULE,
.name = DRVNAME,
},
.probe = nct5104d_gpio_probe,

View File

@ -2807,7 +2807,6 @@ static struct platform_driver ltq_mei_driver = {
.remove = ltq_mei_remove,
.driver = {
.name = "lantiq,mei-xway",
.owner = THIS_MODULE,
.of_match_table = ltq_mei_match,
},
};

View File

@ -36,7 +36,7 @@
}
#ifndef _lint
@@ -1159,8 +1159,30 @@ module_param(debug_level, byte, 0);
@@ -1159,8 +1159,29 @@ module_param(debug_level, byte, 0);
MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs");
#endif /* #ifndef DSL_DEBUG_DISABLE*/
@ -59,7 +59,6 @@
+ .remove = __devexit_p(ltq_adsl_remove),
+ .driver = {
+ .name = "adsl",
+ .owner = THIS_MODULE,
+ .of_match_table = ltq_adsl_match,
+ },
+};

View File

@ -33,7 +33,7 @@ endef
KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway)
KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase)
KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200)
KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy))
define Build/Configure
endef

View File

@ -1894,7 +1894,6 @@ static struct platform_driver ltq_atm_driver = {
.remove = ltq_atm_remove,
.driver = {
.name = "atm",
.owner = THIS_MODULE,
.of_match_table = ltq_atm_match,
},
};

View File

@ -21,14 +21,14 @@ define KernelPackage/ltq-deu-template
TITLE:=deu driver for $(1)
URL:=http://www.lantiq.com/
VARIANT:=$(1)
DEPENDS:=@TARGET_lantiq_$(2) +kmod-crypto-manager +kmod-crypto-des
DEPENDS:=@$(2) +kmod-crypto-manager +kmod-crypto-des
FILES:=$(PKG_BUILD_DIR)/ltq_deu_$(1).ko
AUTOLOAD:=$(call AutoProbe,ltq_deu_$(1))
endef
KernelPackage/ltq-deu-danube=$(call KernelPackage/ltq-deu-template,danube,xway)
KernelPackage/ltq-deu-ar9=$(call KernelPackage/ltq-deu-template,ar9,xway)
KernelPackage/ltq-deu-vr9=$(call KernelPackage/ltq-deu-template,vr9,xrx200)
KernelPackage/ltq-deu-danube=$(call KernelPackage/ltq-deu-template,danube,TARGET_lantiq_xway)
KernelPackage/ltq-deu-ar9=$(call KernelPackage/ltq-deu-template,ar9,TARGET_lantiq_xway)
KernelPackage/ltq-deu-vr9=$(call KernelPackage/ltq-deu-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy))
define Build/Configure
endef

View File

@ -196,7 +196,6 @@ static struct platform_driver ltq_deu_driver = {
.remove = ltq_deu_remove,
.driver = {
.name = "deu",
.owner = THIS_MODULE,
.of_match_table = ltq_deu_match,
},
};

View File

@ -22,7 +22,7 @@ define KernelPackage/ltq-ptm-template
TITLE:=ptm driver for $(1)
URL:=http://www.lantiq.com/
VARIANT:=$(1)
DEPENDS:=@TARGET_lantiq_$(2)
DEPENDS:=@$(2)
ifeq ($(1),vr9)
DEPENDS+= +PACKAGE_kmod-ltq-ptm-$(1):kmod-ltq-vdsl-vr9-mei
else
@ -34,10 +34,10 @@ endif
FILES:=$(PKG_BUILD_DIR)/ltq_ptm_$(1).ko
endef
KernelPackage/ltq-ptm-danube=$(call KernelPackage/ltq-ptm-template,danube,xway)
KernelPackage/ltq-ptm-ar9=$(call KernelPackage/ltq-ptm-template,ar9,xway)
KernelPackage/ltq-ptm-ase=$(call KernelPackage/ltq-ptm-template,ase,ase)
KernelPackage/ltq-ptm-vr9=$(call KernelPackage/ltq-ptm-template,vr9,xrx200)
KernelPackage/ltq-ptm-danube=$(call KernelPackage/ltq-ptm-template,danube,TARGET_lantiq_xway)
KernelPackage/ltq-ptm-ar9=$(call KernelPackage/ltq-ptm-template,ar9,TARGET_lantiq_xway)
KernelPackage/ltq-ptm-ase=$(call KernelPackage/ltq-ptm-template,ase,TARGET_lantiq_ase)
KernelPackage/ltq-ptm-vr9=$(call KernelPackage/ltq-ptm-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy))
define Build/Configure
endef

View File

@ -1600,7 +1600,6 @@ static struct platform_driver ltq_ptm_driver = {
.remove = ltq_ptm_remove,
.driver = {
.name = "ptm",
.owner = THIS_MODULE,
.of_match_table = ltq_ptm_match,
},
};

View File

@ -1138,7 +1138,6 @@ static struct platform_driver ltq_ptm_driver = {
.remove = ltq_ptm_remove,
.driver = {
.name = "ptm",
.owner = THIS_MODULE,
.of_match_table = ltq_ptm_match,
},
};

View File

@ -19,7 +19,7 @@ define Package/ltq-vdsl-vr9-vectoring-fw-installer
TITLE:=VDSL2 Vectoring Firmware installer
SECTION:=net
CATEGORY:=Network
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vdsl-vr9
endef
define Build/Prepare

View File

@ -29,7 +29,7 @@ define KernelPackage/ltq-vdsl-vr9-mei
TITLE:=mei driver for vdsl
SECTION:=sys
SUBMENU:=Network Devices
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-ifxos +kmod-ltq-vectoring
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-ifxos +kmod-ltq-vectoring
FILES:=$(PKG_BUILD_DIR)/src/drv_mei_cpe.ko
AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe)
endef
@ -44,7 +44,7 @@ define Package/ltq-vdsl-vr9-mei-test
CATEGORY:=Network
TITLE:=Lantiq mei driver test tool
URL:=http://www.lantiq.com/
DEPENDS:=@TARGET_lantiq_xrx200
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
endef
define Package/ltq-vdsl-vr9-mei-test/description

View File

@ -29,7 +29,7 @@ define KernelPackage/ltq-vdsl-vr9
TITLE:=vdsl driver
SECTION:=sys
SUBMENU:=Network Devices
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9-mei
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vdsl-vr9-mei
FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko
AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api)
endef

View File

@ -20,7 +20,7 @@ define KernelPackage/ltq-vectoring
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
TITLE:=driver for sending vectoring error samples
DEPENDS:=@TARGET_lantiq_xrx200
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)
FILES:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/ltq_vectoring.ko
AUTOLOAD:=$(call AutoLoad,49,ltq_vectoring)
endef
@ -38,7 +38,7 @@ define KernelPackage/ltq-vectoring-test
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
TITLE:=driver for testing the vectoring driver
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vectoring
DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vectoring
FILES:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/ltq_vectoring_test.ko
endef

View File

@ -0,0 +1,34 @@
From 3983dc1674fec43beb8ce9d9bfdd6302fef86eae Mon Sep 17 00:00:00 2001
From: Andrew MacIntyre <andymac@pcug.org.au>
Date: Mon, 4 Nov 2024 22:41:25 +1100
Subject: [PATCH] vrx518_tc: allow larger MTU to support RFC4638
vrx518_tc currently sets the interface maximum MTU to the ethernet default
of 1500 bytes by default via ether_setup() called from ptm_setup().
To support 1508 byte baby jumbo frames (RFC4638) for PPPoE connections
over VDSL links as already supported by the VR9 ltq_ptm driver ([1], [2])
set the interface maximum MTU to MAX_MTU.
MAX_MTU is defined in dcdp/inc/tc_common.h to 2002 bytes and this value is
used in ptm_change_mtu() and elsewhere as the maximum MTU, however this is
short circuited by checks against the interface maximum MTU.
[1]: https://forum.openwrt.org/t/fritzbox-7530-and-rfc4638-baby-jumbo-frames/181327
[2]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=8a2a20e71e2909f84dab47e51dfda9e292a6c1ae
Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
---
dcdp/ptm_tc.c | 1 +
1 file changed, 1 insertion(+)
--- a/dcdp/ptm_tc.c 2023-12-17 16:11:22.503500398 +1100
+++ b/dcdp/ptm_tc.c 2024-01-26 16:48:49.881623474 +1100
@@ -657,6 +657,7 @@ static void ptm_setup(struct net_device
ether_setup(dev);
dev->watchdog_timeo = 10 * HZ;
dev->netdev_ops = &g_ptm_netdev_ops;
+ dev->max_mtu = MAX_MTU;
}
static int ptm_dev_init(struct tc_priv *tc_priv, u32 id,

View File

@ -245,6 +245,25 @@ endef
$(eval $(call KernelPackage,can-usb-esd))
define KernelPackage/can-usb-gs
TITLE:=Geschwister Schneider UG interfaces
KCONFIG:=CONFIG_CAN_GS_USB
FILES:= \
$(LINUX_DIR)/drivers/net/can/usb/gs_usb.ko
AUTOLOAD:=$(call AutoProbe,gs_usb)
$(call AddDepends/can,+kmod-usb-core)
endef
define KernelPackage/can-usb-gsr/description
This driver supports the Geschwister Schneider and
bytewerk.org candleLight compatible
(https://github.com/candle-usb/candleLight_fw) USB/CAN
interfaces.
endef
$(eval $(call KernelPackage,can-usb-gs))
define KernelPackage/can-usb-kvaser
TITLE:=Kvaser CAN/USB interface
KCONFIG:=CONFIG_CAN_KVASER_USB

View File

@ -249,6 +249,15 @@ endef
$(eval $(call KernelPackage,crypto-echainiv))
define KernelPackage/crypto-engine
TITLE:=Crypto engine
KCONFIG:=CONFIG_CRYPTO_ENGINE
FILES:=$(LINUX_DIR)/crypto/crypto_engine.ko
AUTOLOAD:=$(call AutoLoad,09,crypto_engine)
$(call AddDepends/crypto, +kmod-crypto-rsa +kmod-crypto-kpp)
endef
$(eval $(call KernelPackage,crypto-engine))
define KernelPackage/crypto-essiv
TITLE:=ESSIV support for block encryption

View File

@ -46,6 +46,38 @@ endef
$(eval $(call KernelPackage,iio-kfifo-buf))
define KernelPackage/industrialio-hw-consumer
TITLE:=Provides a bonding way to an other device in hardware
KCONFIG:=CONFIG_IIO_BUFFER_HW_CONSUMER
FILES:=$(LINUX_DIR)/drivers/iio/buffer/industrialio-hw-consumer.ko
AUTOLOAD:=$(call AutoLoad,55,industrialio-hw-consumer)
$(call AddDepends/iio,+kmod-iio-kfifo-buf)
endef
define KernelPackage/industrialio-hw-consumer/description
Provides a way to bonding when an IIO device has a direct connection
to another device in hardware. In this case buffers for data transfers
are handled by hardware.
endef
$(eval $(call KernelPackage,industrialio-hw-consumer))
define KernelPackage/industrialio-buffer-cb
TITLE:=Provides callback buffer used for push in-kernel interfaces
KCONFIG:=CONFIG_IIO_BUFFER_CB
FILES:=$(LINUX_DIR)/drivers/iio/buffer/industrialio-buffer-cb.ko
AUTOLOAD:=$(call AutoLoad,55,industrialio-triggered-buffer-cb)
$(call AddDepends/iio)
endef
define KernelPackage/industrialio-buffer-cb/description
Should be selected by any drivers that do in-kernel push usage.
endef
$(eval $(call KernelPackage,industrialio-buffer-cb))
define KernelPackage/industrialio-triggered-buffer
TITLE:=Provides helper functions for setting up triggered buffers.
DEPENDS:=+kmod-iio-kfifo-buf

View File

@ -42,6 +42,24 @@ endef
$(eval $(call KernelPackage,atmtcp))
define KernelPackage/appletalk
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=Appletalk protocol support
KCONFIG:= \
CONFIG_ATALK \
CONFIG_DEV_APPLETALK \
CONFIG_IPDDP=n
FILES:=$(LINUX_DIR)/net/appletalk/appletalk.ko
AUTOLOAD:=$(call AutoLoad,40,appletalk)
endef
define KernelPackage/appletalk/description
Kernel module for AppleTalk protocol.
endef
$(eval $(call KernelPackage,appletalk))
define KernelPackage/bonding
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=Ethernet bonding driver

View File

@ -962,6 +962,7 @@ define KernelPackage/thermal
CONFIG_THERMAL=y \
CONFIG_THERMAL_OF=y \
CONFIG_CPU_THERMAL=y \
CONFIG_DEVFREQ_THERMAL=n \
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y \
CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE=n \
CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE=n \

View File

@ -314,6 +314,17 @@ endef
$(eval $(call KernelPackage,sound-soc-spdif))
define KernelPackage/sound-soc-dmic
TITLE:=Generic Digital Microphone CODEC
KCONFIG:=CONFIG_SND_SOC_DMIC
FILES:=$(LINUX_DIR)/sound/soc/codecs/snd-soc-dmic.ko
AUTOLOAD:=$(call AutoProbe,snd-soc-dmic)
$(call AddDepends/sound,+kmod-sound-soc-core)
endef
$(eval $(call KernelPackage,sound-soc-dmic))
define KernelPackage/pcspkr
DEPENDS:=@TARGET_x86 +kmod-input-core
TITLE:=PC speaker support

View File

@ -576,6 +576,7 @@ define KernelPackage/usb-audio
CONFIG_SND_USB_AUDIO
$(call AddDepends/usb)
$(call AddDepends/sound)
DEPENDS+=+kmod-media-controller
FILES:= \
$(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko \
$(LINUX_DIR)/sound/usb/snd-usb-audio.ko

View File

@ -12,6 +12,28 @@ V4L2_DIR=v4l2-core
V4L2_USB_DIR=usb
V4L2_MEM2MEM_DIR=platform
#
# Media
#
define KernelPackage/media-controller
SUBMENU:=$(VIDEO_MENU)
TITLE:=Media Controller API
KCONFIG:= \
CONFIG_MEDIA_SUPPORT \
CONFIG_MEDIA_CONTROLLER=y
FILES:= \
$(LINUX_DIR)/drivers/media/mc/mc.ko
AUTOLOAD:=$(call AutoProbe,mc)
endef
define KernelPackage/media-controller/description
Kernel modules for media controller API used to query media devices
internal topology and configure it dynamically.
endef
$(eval $(call KernelPackage,media-controller))
#
# Video Display
#
@ -336,7 +358,7 @@ $(eval $(call KernelPackage,drm-exec))
define KernelPackage/drm-gem-shmem-helper
SUBMENU:=$(VIDEO_MENU)
TITLE:=GEM shmem helper functions
DEPENDS:=@DISPLAY_SUPPORT +kmod-drm @!LINUX_5_15
DEPENDS:=@DISPLAY_SUPPORT +kmod-drm
KCONFIG:=CONFIG_DRM_GEM_SHMEM_HELPER
FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_shmem_helper.ko
AUTOLOAD:=$(call AutoProbe,drm_shmem_helper)
@ -345,6 +367,38 @@ endef
$(eval $(call KernelPackage,drm-gem-shmem-helper))
define KernelPackage/drm-dma-helper
SUBMENU:=$(VIDEO_MENU)
HIDDEN:=1
TITLE:=GEM DMA helper functions
DEPENDS:=@DISPLAY_SUPPORT +kmod-drm-kms-helper
KCONFIG:=CONFIG_DRM_GEM_DMA_HELPER
FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_dma_helper.ko
AUTOLOAD:=$(call AutoProbe,drm_dma_helper)
endef
define KernelPackage/drm-dma-helper/description
GEM DMA helper functions.
endef
$(eval $(call KernelPackage,drm-dma-helper))
define KernelPackage/drm-mipi-dbi
SUBMENU:=$(VIDEO_MENU)
HIDDEN:=1
TITLE:=MIPI DBI helpers
DEPENDS:=@DISPLAY_SUPPORT +kmod-backlight +kmod-drm-kms-helper
KCONFIG:=CONFIG_DRM_MIPI_DBI
FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_mipi_dbi.ko
AUTOLOAD:=$(call AutoProbe,drm_mipi_dbi)
endef
define KernelPackage/drm-mipi-dbi/description
MIPI Display Bus Interface (DBI) LCD controller support.
endef
$(eval $(call KernelPackage,drm-mipi-dbi))
define KernelPackage/drm-ttm
SUBMENU:=$(VIDEO_MENU)
TITLE:=GPU memory management subsystem
@ -440,6 +494,49 @@ endef
$(eval $(call KernelPackage,drm-amdgpu))
define KernelPackage/drm-i915
SUBMENU:=$(VIDEO_MENU)
TITLE:=Intel i915 DRM support
DEPENDS:=@(TARGET_x86_64||TARGET_x86_generic||TARGET_x86_legacy) \
@DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \
+kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +i915-firmware-dmc \
+kmod-drm-display-helper +kmod-drm-buddy +kmod-acpi-video \
+kmod-drm-exec +kmod-drm-suballoc-helper
KCONFIG:=CONFIG_DRM_I915 \
CONFIG_DRM_I915_CAPTURE_ERROR=y \
CONFIG_DRM_I915_COMPRESS_ERROR=y \
CONFIG_DRM_I915_DEBUG=n \
CONFIG_DRM_I915_DEBUG_GUC=n \
CONFIG_DRM_I915_DEBUG_MMIO=n \
CONFIG_DRM_I915_DEBUG_RUNTIME_PM=n \
CONFIG_DRM_I915_DEBUG_VBLANK_EVADE=n \
CONFIG_DRM_I915_FENCE_TIMEOUT=10000 \
CONFIG_DRM_I915_FORCE_PROBE="" \
CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 \
CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=n \
CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 \
CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 \
CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 \
CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 \
CONFIG_DRM_I915_SELFTEST=n \
CONFIG_DRM_I915_STOP_TIMEOUT=100 \
CONFIG_DRM_I915_SW_FENCE_CHECK_DAG=n \
CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS=n \
CONFIG_DRM_I915_TIMESLICE_DURATION=1 \
CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 \
CONFIG_DRM_I915_USERPTR=y \
CONFIG_DRM_I915_WERROR=n \
CONFIG_FB_INTEL=n
FILES:=$(LINUX_DIR)/drivers/gpu/drm/i915/i915.ko
AUTOLOAD:=$(call AutoProbe,i915)
endef
define KernelPackage/drm-i915/description
Direct Rendering Manager (DRM) support for Intel GPU
endef
$(eval $(call KernelPackage,drm-i915))
define KernelPackage/drm-imx
SUBMENU:=$(VIDEO_MENU)
@ -521,7 +618,7 @@ $(eval $(call KernelPackage,drm-imx-ldb))
define KernelPackage/drm-lima
SUBMENU:=$(VIDEO_MENU)
TITLE:=Mali-4xx GPU support
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +!LINUX_5_15:kmod-drm-gem-shmem-helper
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +kmod-drm-gem-shmem-helper
KCONFIG:= \
CONFIG_DRM_VGEM \
CONFIG_DRM_GEM_CMA_HELPER=y \
@ -542,7 +639,7 @@ $(eval $(call KernelPackage,drm-lima))
define KernelPackage/drm-panfrost
SUBMENU:=$(VIDEO_MENU)
TITLE:=DRM support for ARM Mali Midgard/Bifrost GPUs
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +!LINUX_5_15:kmod-drm-gem-shmem-helper
DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +kmod-drm-gem-shmem-helper
KCONFIG:=CONFIG_DRM_PANFROST
FILES:= \
$(LINUX_DIR)/drivers/gpu/drm/panfrost/panfrost.ko \
@ -560,7 +657,8 @@ $(eval $(call KernelPackage,drm-panfrost))
define KernelPackage/drm-panthor
SUBMENU:=$(VIDEO_MENU)
TITLE:=DRM support for ARM Mali CSF-based GPUs
DEPENDS:=@TARGET_rockchip +kmod-drm +kmod-drm-exec +kmod-drm-gem-shmem-helper
DEPENDS:=@TARGET_rockchip +kmod-drm +kmod-drm-exec +kmod-drm-gem-shmem-helper \
panthor-firmware
KCONFIG:= \
CONFIG_DRM_GPUVM \
CONFIG_DRM_PANTHOR
@ -577,6 +675,24 @@ endef
$(eval $(call KernelPackage,drm-panthor))
define KernelPackage/drm-panel-mipi-dbi
SUBMENU:=$(VIDEO_MENU)
TITLE:=Generic MIPI DBI LCD panel
DEPENDS:=+kmod-drm-mipi-dbi +kmod-drm-dma-helper
KCONFIG:=CONFIG_DRM_PANEL_MIPI_DBI \
CONFIG_DRM_FBDEV_EMULATION=y \
CONFIG_DRM_FBDEV_OVERALLOC=100
FILES:= \
$(LINUX_DIR)/drivers/gpu/drm/tiny/panel-mipi-dbi.ko
AUTOLOAD:=$(call AutoProbe,panel-mipi-dbi)
endef
define KernelPackage/drm-panel-mipi-dbi/description
Generic driver for MIPI Alliance Display Bus Interface
endef
$(eval $(call KernelPackage,drm-panel-mipi-dbi))
define KernelPackage/drm-radeon
SUBMENU:=$(VIDEO_MENU)
TITLE:=Radeon DRM support
@ -601,9 +717,8 @@ $(eval $(call KernelPackage,drm-radeon))
define KernelPackage/video-core
SUBMENU:=$(VIDEO_MENU)
TITLE=Video4Linux support
DEPENDS:=+PACKAGE_kmod-i2c-core:kmod-i2c-core
DEPENDS:=+PACKAGE_kmod-i2c-core:kmod-i2c-core +kmod-media-controller
KCONFIG:= \
CONFIG_MEDIA_SUPPORT \
CONFIG_MEDIA_CAMERA_SUPPORT=y \
CONFIG_VIDEO_DEV \
CONFIG_V4L_PLATFORM_DRIVERS=y \
@ -659,6 +774,25 @@ endef
$(eval $(call KernelPackage,video-videobuf2))
define KernelPackage/video-async
TITLE:=V4L2 ASYNC support
KCONFIG:=CONFIG_V4L2_ASYNC
FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-async.ko
$(call AddDepends/video)
AUTOLOAD:=$(call AutoProbe,v4l2-async)
endef
$(eval $(call KernelPackage,video-async))
define KernelPackage/video-fwnode
TITLE:=V4L2 FWNODE support
KCONFIG:=CONFIG_V4L2_FWNODE
FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-fwnode.ko
$(call AddDepends/video,+kmod-video-async)
AUTOLOAD:=$(call AutoProbe,v4l2-fwnode)
endef
$(eval $(call KernelPackage,video-fwnode))
define KernelPackage/video-cpia2
TITLE:=CPIA2 video driver

View File

@ -437,6 +437,7 @@ define KernelPackage/brcmfmac/config
default y if TARGET_starfive
default y if TARGET_rockchip
default y if TARGET_sunxi
default y if TARGET_stm32
default n
help
Enable support for cards attached to an SDIO bus.

View File

@ -121,7 +121,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
};
static __le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len)
@@ -2363,7 +2365,10 @@ int ath12k_wmi_send_scan_start_cmd(struc
@@ -2364,7 +2366,10 @@ int ath12k_wmi_send_scan_start_cmd(struc
cmd->scan_id = cpu_to_le32(arg->scan_id);
cmd->scan_req_id = cpu_to_le32(arg->scan_req_id);
cmd->vdev_id = cpu_to_le32(arg->vdev_id);
@ -133,7 +133,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
cmd->notify_scan_events = cpu_to_le32(arg->notify_scan_events);
ath12k_wmi_copy_scan_event_cntrl_flags(cmd, arg);
@@ -3083,6 +3088,110 @@ out:
@@ -3084,6 +3089,110 @@ out:
return ret;
}
@ -244,7 +244,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
int
ath12k_wmi_send_twt_enable_cmd(struct ath12k *ar, u32 pdev_id)
{
@@ -5668,6 +5777,50 @@ static void ath12k_wmi_op_ep_tx_credits(
@@ -5669,6 +5778,50 @@ static void ath12k_wmi_op_ep_tx_credits(
wake_up(&ab->wmi_ab.tx_credits_wq);
}
@ -295,7 +295,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
static void ath12k_wmi_htc_tx_complete(struct ath12k_base *ab,
struct sk_buff *skb)
{
@@ -7269,6 +7422,9 @@ static void ath12k_wmi_op_rx(struct ath1
@@ -7270,6 +7423,9 @@ static void ath12k_wmi_op_rx(struct ath1
case WMI_GTK_OFFLOAD_STATUS_EVENTID:
ath12k_wmi_gtk_offload_status_event(ab, skb);
break;
@ -307,7 +307,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id);
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -3859,6 +3859,28 @@ struct wmi_init_country_cmd {
@@ -3860,6 +3860,28 @@ struct wmi_init_country_cmd {
} cc_info;
} __packed;
@ -336,7 +336,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
struct wmi_delba_send_cmd {
__le32 tlv_header;
__le32 vdev_id;
@@ -3944,6 +3966,16 @@ struct ath12k_wmi_eht_rate_set_params {
@@ -3945,6 +3967,16 @@ struct ath12k_wmi_eht_rate_set_params {
#define MAX_6G_REG_RULES 5
#define REG_US_5G_NUM_REG_RULES 4
@ -353,7 +353,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
enum wmi_start_event_param {
WMI_VDEV_START_RESP_EVENT = 0,
WMI_VDEV_RESTART_RESP_EVENT,
@@ -5546,11 +5578,17 @@ int ath12k_wmi_send_bcn_offload_control_
@@ -5547,11 +5579,17 @@ int ath12k_wmi_send_bcn_offload_control_
u32 vdev_id, u32 bcn_ctrl_op);
int ath12k_wmi_send_init_country_cmd(struct ath12k *ar,
struct ath12k_wmi_init_country_arg *arg);
@ -485,7 +485,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
u32 fw_crash_counter;
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2947,6 +2947,11 @@ static void ath12k_bss_assoc(struct ath1
@@ -2946,6 +2946,11 @@ static void ath12k_bss_assoc(struct ath1
if (ret)
ath12k_warn(ar->ab, "failed to set vdev %i OBSS PD parameters: %d\n",
arvif->vdev_id, ret);
@ -497,7 +497,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
}
static void ath12k_bss_disassoc(struct ath12k *ar,
@@ -3522,7 +3527,7 @@ void __ath12k_mac_scan_finish(struct ath
@@ -3521,7 +3526,7 @@ void __ath12k_mac_scan_finish(struct ath
ar->scan_channel = NULL;
ar->scan.roc_freq = 0;
cancel_delayed_work(&ar->scan.timeout);
@ -506,7 +506,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
break;
}
}
@@ -3783,7 +3788,12 @@ scan:
@@ -3782,7 +3787,12 @@ scan:
ret = ath12k_start_scan(ar, &arg);
if (ret) {
@ -520,7 +520,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
spin_lock_bh(&ar->data_lock);
ar->scan.state = ATH12K_SCAN_IDLE;
spin_unlock_bh(&ar->data_lock);
@@ -3802,6 +3812,11 @@ exit:
@@ -3801,6 +3811,11 @@ exit:
mutex_unlock(&ar->conf_mutex);
@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
return ret;
}
@@ -5986,7 +6001,7 @@ static int ath12k_mac_start(struct ath12
@@ -5985,7 +6000,7 @@ static int ath12k_mac_start(struct ath12
/* TODO: Do we need to enable ANI? */
@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
ar->num_started_vdevs = 0;
ar->num_created_vdevs = 0;
@@ -6166,6 +6181,9 @@ static void ath12k_mac_stop(struct ath12
@@ -6165,6 +6180,9 @@ static void ath12k_mac_stop(struct ath12
cancel_delayed_work_sync(&ar->scan.timeout);
cancel_work_sync(&ar->regd_update_work);
cancel_work_sync(&ar->ab->rfkill_work);
@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
spin_lock_bh(&ar->data_lock);
list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
@@ -6412,6 +6430,117 @@ static void ath12k_mac_op_update_vif_off
@@ -6411,6 +6429,117 @@ static void ath12k_mac_op_update_vif_off
ath12k_mac_update_vif_offload(arvif);
}
@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
{
struct ath12k_hw *ah = ar->ah;
@@ -6526,6 +6655,7 @@ static int ath12k_mac_vdev_create(struct
@@ -6525,6 +6654,7 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
break;
case WMI_VDEV_TYPE_STA:
param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
@@ -6564,6 +6694,13 @@ static int ath12k_mac_vdev_create(struct
@@ -6563,6 +6693,13 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
break;
default:
break;
@@ -6904,6 +7041,11 @@ static void ath12k_mac_op_remove_interfa
@@ -6903,6 +7040,11 @@ static void ath12k_mac_op_remove_interfa
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
arvif->vdev_id);
@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
if (ret)
@@ -7744,6 +7886,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
@@ -7743,6 +7885,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
ath12k_mac_monitor_stop(ar);
@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
mutex_unlock(&ar->conf_mutex);
}
@@ -8282,6 +8432,14 @@ ath12k_mac_op_reconfig_complete(struct i
@@ -8281,6 +8431,14 @@ ath12k_mac_op_reconfig_complete(struct i
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
ar->pdev->pdev_id);
@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
if (ab->is_reset) {
recovery_count = atomic_inc_return(&ab->recovery_count);
@@ -9331,6 +9489,9 @@ static void ath12k_mac_setup(struct ath1
@@ -9330,6 +9488,9 @@ static void ath12k_mac_setup(struct ath1
INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
skb_queue_head_init(&ar->wmi_mgmt_tx_queue);

View File

@ -0,0 +1,169 @@
From e0f83d268974dab0361d11904dfc9acec53f96a6 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Fri, 11 Oct 2024 17:12:17 +0000
Subject: [PATCH] genetlink: hold RCU in genlmsg_mcast()
[ Upstream commit 56440d7ec28d60f8da3bfa09062b3368ff9b16db ]
While running net selftests with CONFIG_PROVE_RCU_LIST=y I saw
one lockdep splat [1].
genlmsg_mcast() uses for_each_net_rcu(), and must therefore hold RCU.
Instead of letting all callers guard genlmsg_multicast_allns()
with a rcu_read_lock()/rcu_read_unlock() pair, do it in genlmsg_mcast().
This also means the @flags parameter is useless, we need to always use
GFP_ATOMIC.
[1]
[10882.424136] =============================
[10882.424166] WARNING: suspicious RCU usage
[10882.424309] 6.12.0-rc2-virtme #1156 Not tainted
[10882.424400] -----------------------------
[10882.424423] net/netlink/genetlink.c:1940 RCU-list traversed in non-reader section!!
[10882.424469]
other info that might help us debug this:
[10882.424500]
rcu_scheduler_active = 2, debug_locks = 1
[10882.424744] 2 locks held by ip/15677:
[10882.424791] #0: ffffffffb6b491b0 (cb_lock){++++}-{3:3}, at: genl_rcv (net/netlink/genetlink.c:1219)
[10882.426334] #1: ffffffffb6b49248 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg (net/netlink/genetlink.c:61 net/netlink/genetlink.c:57 net/netlink/genetlink.c:1209)
[10882.426465]
stack backtrace:
[10882.426805] CPU: 14 UID: 0 PID: 15677 Comm: ip Not tainted 6.12.0-rc2-virtme #1156
[10882.426919] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[10882.427046] Call Trace:
[10882.427131] <TASK>
[10882.427244] dump_stack_lvl (lib/dump_stack.c:123)
[10882.427335] lockdep_rcu_suspicious (kernel/locking/lockdep.c:6822)
[10882.427387] genlmsg_multicast_allns (net/netlink/genetlink.c:1940 (discriminator 7) net/netlink/genetlink.c:1977 (discriminator 7))
[10882.427436] l2tp_tunnel_notify.constprop.0 (net/l2tp/l2tp_netlink.c:119) l2tp_netlink
[10882.427683] l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:253) l2tp_netlink
[10882.427748] genl_family_rcv_msg_doit (net/netlink/genetlink.c:1115)
[10882.427834] genl_rcv_msg (net/netlink/genetlink.c:1195 net/netlink/genetlink.c:1210)
[10882.427877] ? __pfx_l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:186) l2tp_netlink
[10882.427927] ? __pfx_genl_rcv_msg (net/netlink/genetlink.c:1201)
[10882.427959] netlink_rcv_skb (net/netlink/af_netlink.c:2551)
[10882.428069] genl_rcv (net/netlink/genetlink.c:1220)
[10882.428095] netlink_unicast (net/netlink/af_netlink.c:1332 net/netlink/af_netlink.c:1357)
[10882.428140] netlink_sendmsg (net/netlink/af_netlink.c:1901)
[10882.428210] ____sys_sendmsg (net/socket.c:729 (discriminator 1) net/socket.c:744 (discriminator 1) net/socket.c:2607 (discriminator 1))
Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Chapman <jchapman@katalix.com>
Cc: Tom Parkin <tparkin@katalix.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241011171217.3166614-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/target_core_user.c | 2 +-
include/net/genetlink.h | 3 +--
net/l2tp/l2tp_netlink.c | 4 ++--
net/netlink/genetlink.c | 28 ++++++++++++++--------------
net/wireless/nl80211.c | 8 ++------
5 files changed, 20 insertions(+), 25 deletions(-)
--- a/backport-include/net/genetlink.h
+++ b/backport-include/net/genetlink.h
@@ -150,7 +150,7 @@ int genlmsg_multicast(const struct genl_
#define genlmsg_multicast_allns LINUX_BACKPORT(genlmsg_multicast_allns)
int backport_genlmsg_multicast_allns(const struct genl_family *family,
struct sk_buff *skb, u32 portid,
- unsigned int group, gfp_t flags);
+ unsigned int group);
#define genl_family_attrbuf LINUX_BACKPORT(genl_family_attrbuf)
static inline struct nlattr **genl_family_attrbuf(struct genl_family *family)
--- a/compat/backport-genetlink.c
+++ b/compat/backport-genetlink.c
@@ -198,23 +198,23 @@ int genlmsg_multicast(const struct genl_
}
EXPORT_SYMBOL_GPL(genlmsg_multicast);
-static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
- gfp_t flags)
+static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group)
{
struct sk_buff *tmp;
struct net *net, *prev = NULL;
bool delivered = false;
int err;
+ rcu_read_lock();
for_each_net_rcu(net) {
if (prev) {
- tmp = skb_clone(skb, flags);
+ tmp = skb_clone(skb, GFP_ATOMIC);
if (!tmp) {
err = -ENOMEM;
goto error;
}
err = nlmsg_multicast(prev->genl_sock, tmp,
- portid, group, flags);
+ portid, group, GFP_ATOMIC);
if (!err)
delivered = true;
else if (err != -ESRCH)
@@ -223,25 +223,29 @@ static int genlmsg_mcast(struct sk_buff
prev = net;
}
+ err = nlmsg_multicast(prev->genl_sock, skb, portid, group, GFP_ATOMIC);
+
+ rcu_read_unlock();
- err = nlmsg_multicast(prev->genl_sock, skb, portid, group, flags);
if (!err)
delivered = true;
else if (err != -ESRCH)
return err;
return delivered ? 0 : -ESRCH;
error:
+ rcu_read_unlock();
+
kfree_skb(skb);
return err;
}
int backport_genlmsg_multicast_allns(const struct genl_family *family,
struct sk_buff *skb, u32 portid,
- unsigned int group, gfp_t flags)
+ unsigned int group)
{
group = __backport_genl_group(family, group);
if (group == INVALID_GROUP)
return -EINVAL;
- return genlmsg_mcast(skb, portid, group, flags);
+ return genlmsg_mcast(skb, portid, group);
}
EXPORT_SYMBOL_GPL(backport_genlmsg_multicast_allns);
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -17956,10 +17956,8 @@ void nl80211_common_reg_change_event(enu
genlmsg_end(msg, hdr);
- rcu_read_lock();
genlmsg_multicast_allns(&nl80211_fam, msg, 0,
- NL80211_MCGRP_REGULATORY, GFP_ATOMIC);
- rcu_read_unlock();
+ NL80211_MCGRP_REGULATORY);
return;
@@ -18692,10 +18690,8 @@ void nl80211_send_beacon_hint_event(stru
genlmsg_end(msg, hdr);
- rcu_read_lock();
genlmsg_multicast_allns(&nl80211_fam, msg, 0,
- NL80211_MCGRP_REGULATORY, GFP_ATOMIC);
- rcu_read_unlock();
+ NL80211_MCGRP_REGULATORY);
return;

View File

@ -0,0 +1,30 @@
From 8fbcaa308591b91e9037ab6a8d733873b749a70d Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Sat, 6 Jul 2024 01:40:58 +0300
Subject: [PATCH] wifi: rtw88: Set efuse->ext_lna_5g - fix typo
efuse->ext_lna_2g is set twice and efuse->ext_lna_5g is not set at all.
Set each one once.
Nothing uses these members right now. They will be used by the RTL8821AU
and RTL8812AU drivers.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/8ccc9e13-0d45-417d-8f88-93a0ad294f77@gmail.com
---
drivers/net/wireless/realtek/rtw88/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2006,7 +2006,7 @@ static int rtw_chip_efuse_info_setup(str
efuse->ext_pa_2g = efuse->pa_type_2g & BIT(4) ? 1 : 0;
efuse->ext_lna_2g = efuse->lna_type_2g & BIT(3) ? 1 : 0;
efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0;
- efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0;
+ efuse->ext_lna_5g = efuse->lna_type_5g & BIT(3) ? 1 : 0;
if (!is_valid_ether_addr(efuse->addr)) {
eth_random_addr(efuse->addr);

View File

@ -0,0 +1,284 @@
From 315c23a64e99552502dd4d18d6ddc073fad9a7c3 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Thu, 11 Jul 2024 01:11:33 +0300
Subject: [PATCH] wifi: rtw88: usb: Support USB 3 with RTL8822CU/RTL8822BU
The Realtek wifi 5 devices which support USB 3 are weird: when first
plugged in, they pretend to be USB 2. The driver needs to send some
commands to the device, which make it disappear and come back as a
USB 3 device.
Implement the required commands in rtw88.
When a USB 3 device is plugged into a USB 2 port, rtw88 will try to
switch it to USB 3 mode only once. The device will disappear and come
back still in USB 2 mode, of course.
Some people experience heavy interference in the 2.4 GHz band in
USB 3 mode, so add a module parameter switch_usb_mode with the
default value 1 to let people disable the switching.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/77906c62-5674-426f-bde1-1b2a12a0339d@gmail.com
---
drivers/net/wireless/realtek/rtw88/debug.h | 1 +
drivers/net/wireless/realtek/rtw88/main.h | 2 +
drivers/net/wireless/realtek/rtw88/reg.h | 11 +++
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822b.h | 4 +-
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822c.h | 24 +++---
drivers/net/wireless/realtek/rtw88/usb.c | 84 +++++++++++++++++++
8 files changed, 116 insertions(+), 12 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/debug.h
+++ b/drivers/net/wireless/realtek/rtw88/debug.h
@@ -25,6 +25,7 @@ enum rtw_debug_mask {
RTW_DBG_HW_SCAN = 0x00010000,
RTW_DBG_STATE = 0x00020000,
RTW_DBG_SDIO = 0x00040000,
+ RTW_DBG_USB = 0x00080000,
RTW_DBG_UNEXP = 0x80000000,
RTW_DBG_ALL = 0xffffffff
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1785,6 +1785,8 @@ struct rtw_efuse {
bool share_ant;
u8 bt_setting;
+ u8 usb_mode_switch;
+
struct {
u8 hci;
u8 bw;
--- a/drivers/net/wireless/realtek/rtw88/reg.h
+++ b/drivers/net/wireless/realtek/rtw88/reg.h
@@ -15,6 +15,7 @@
#define BIT_WLOCK_1C_B6 BIT(5)
#define REG_SYS_PW_CTRL 0x0004
#define BIT_PFM_WOWL BIT(3)
+#define BIT_APFM_OFFMAC BIT(9)
#define REG_SYS_CLK_CTRL 0x0008
#define BIT_CPU_CLK_EN BIT(14)
@@ -133,6 +134,14 @@
#define REG_PMC_DBG_CTRL1 0xa8
#define BITS_PMC_BT_IQK_STS GENMASK(22, 21)
+#define REG_PAD_CTRL2 0x00C4
+#define BIT_RSM_EN_V1 BIT(16)
+#define BIT_NO_PDN_CHIPOFF_V1 BIT(17)
+#define BIT_MASK_USB23_SW_MODE_V1 GENMASK(19, 18)
+#define BIT_USB3_USB2_TRANSITION BIT(20)
+#define BIT_USB_MODE_U2 1
+#define BIT_USB_MODE_U3 2
+
#define REG_EFUSE_ACCESS 0x00CF
#define EFUSE_ACCESS_ON 0x69
#define EFUSE_ACCESS_OFF 0x00
@@ -568,6 +577,8 @@
#define BIT_WL_SECURITY_CLK BIT(15)
#define BIT_DDMA_EN BIT(8)
+#define REG_SW_MDIO 0x10C0
+
#define REG_H2C_PKT_READADDR 0x10D0
#define REG_H2C_PKT_WRITEADDR 0x10D4
#define REG_FW_DBG6 0x10F8
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -46,6 +46,7 @@ static int rtw8822b_read_efuse(struct rt
map = (struct rtw8822b_efuse *)log_map;
+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7));
efuse->rfe_option = map->rfe_option;
efuse->rf_board_option = map->rf_board_option;
efuse->crystal_cap = map->xtal_k;
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
@@ -72,7 +72,9 @@ struct rtw8822bs_efuse {
struct rtw8822b_efuse {
__le16 rtl_id;
- u8 res0[0x0e];
+ u8 res0[4];
+ u8 usb_mode;
+ u8 res1[0x09];
/* power index for four RF paths */
struct rtw_txpwr_idx txpwr_idx_table[4];
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -49,6 +49,7 @@ static int rtw8822c_read_efuse(struct rt
map = (struct rtw8822c_efuse *)log_map;
+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7));
efuse->rfe_option = map->rfe_option;
efuse->rf_board_option = map->rf_board_option;
efuse->crystal_cap = map->xtal_k & XCAP_MASK;
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.h
@@ -59,16 +59,18 @@ struct rtw8822ce_efuse {
struct rtw8822c_efuse {
__le16 rtl_id;
- u8 res0[0x0e];
+ u8 res0[4];
+ u8 usb_mode;
+ u8 res1[0x09];
/* power index for four RF paths */
struct rtw_txpwr_idx txpwr_idx_table[4];
u8 channel_plan; /* 0xb8 */
u8 xtal_k;
- u8 res1;
+ u8 res2;
u8 iqk_lck;
- u8 res2[5]; /* 0xbc */
+ u8 res3[5]; /* 0xbc */
u8 rf_board_option;
u8 rf_feature_option;
u8 rf_bt_setting;
@@ -80,21 +82,21 @@ struct rtw8822c_efuse {
u8 rf_antenna_option; /* 0xc9 */
u8 rfe_option;
u8 country_code[2];
- u8 res3[3];
+ u8 res4[3];
u8 path_a_thermal; /* 0xd0 */
u8 path_b_thermal;
- u8 res4[2];
+ u8 res5[2];
u8 rx_gain_gap_2g_ofdm;
- u8 res5;
- u8 rx_gain_gap_2g_cck;
u8 res6;
- u8 rx_gain_gap_5gl;
+ u8 rx_gain_gap_2g_cck;
u8 res7;
- u8 rx_gain_gap_5gm;
+ u8 rx_gain_gap_5gl;
u8 res8;
- u8 rx_gain_gap_5gh;
+ u8 rx_gain_gap_5gm;
u8 res9;
- u8 res10[0x42];
+ u8 rx_gain_gap_5gh;
+ u8 res10;
+ u8 res11[0x42];
union {
struct rtw8822ce_efuse e;
struct rtw8822cu_efuse u;
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -14,6 +14,11 @@
#include "ps.h"
#include "usb.h"
+static bool rtw_switch_usb_mode = true;
+module_param_named(switch_usb_mode, rtw_switch_usb_mode, bool, 0644);
+MODULE_PARM_DESC(switch_usb_mode,
+ "Set to N to disable switching to USB 3 mode to avoid potential interference in the 2.4 GHz band (default: Y)");
+
#define RTW_USB_MAX_RXQ_LEN 512
struct rtw_usb_txcb {
@@ -841,6 +846,77 @@ static void rtw_usb_intf_deinit(struct r
usb_set_intfdata(intf, NULL);
}
+static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev)
+{
+ enum usb_device_speed cur_speed;
+ u8 id = rtwdev->chip->id;
+ bool can_switch;
+ u32 pad_ctrl2;
+
+ if (rtw_read8(rtwdev, REG_SYS_CFG2 + 3) == 0x20)
+ cur_speed = USB_SPEED_SUPER;
+ else
+ cur_speed = USB_SPEED_HIGH;
+
+ if (cur_speed == USB_SPEED_SUPER)
+ return 0;
+
+ pad_ctrl2 = rtw_read32(rtwdev, REG_PAD_CTRL2);
+
+ can_switch = !!(pad_ctrl2 & (BIT_MASK_USB23_SW_MODE_V1 |
+ BIT_USB3_USB2_TRANSITION));
+
+ if (!can_switch) {
+ rtw_dbg(rtwdev, RTW_DBG_USB,
+ "Switching to USB 3 mode unsupported by the chip\n");
+ return 0;
+ }
+
+ /* At this point cur_speed is USB_SPEED_HIGH. If we already tried
+ * to switch don't try again - it's a USB 2 port.
+ */
+ if (u32_get_bits(pad_ctrl2, BIT_MASK_USB23_SW_MODE_V1) == BIT_USB_MODE_U3)
+ return 0;
+
+ /* Enable IO wrapper timeout */
+ if (id == RTW_CHIP_TYPE_8822B || id == RTW_CHIP_TYPE_8821C)
+ rtw_write8_clr(rtwdev, REG_SW_MDIO + 3, BIT(0));
+
+ u32p_replace_bits(&pad_ctrl2, BIT_USB_MODE_U3, BIT_MASK_USB23_SW_MODE_V1);
+ pad_ctrl2 |= BIT_RSM_EN_V1;
+
+ rtw_write32(rtwdev, REG_PAD_CTRL2, pad_ctrl2);
+ rtw_write8(rtwdev, REG_PAD_CTRL2 + 1, 4);
+
+ rtw_write16_set(rtwdev, REG_SYS_PW_CTRL, BIT_APFM_OFFMAC);
+ usleep_range(1000, 1001);
+ rtw_write32_set(rtwdev, REG_PAD_CTRL2, BIT_NO_PDN_CHIPOFF_V1);
+
+ return 1;
+}
+
+static int rtw_usb_switch_mode(struct rtw_dev *rtwdev)
+{
+ u8 id = rtwdev->chip->id;
+
+ if (id != RTW_CHIP_TYPE_8822C && id != RTW_CHIP_TYPE_8822B)
+ return 0;
+
+ if (!rtwdev->efuse.usb_mode_switch) {
+ rtw_dbg(rtwdev, RTW_DBG_USB,
+ "Switching to USB 3 mode disabled by chip's efuse\n");
+ return 0;
+ }
+
+ if (!rtw_switch_usb_mode) {
+ rtw_dbg(rtwdev, RTW_DBG_USB,
+ "Switching to USB 3 mode disabled by module parameter\n");
+ return 0;
+ }
+
+ return rtw_usb_switch_mode_new(rtwdev);
+}
+
int rtw_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct rtw_dev *rtwdev;
@@ -896,6 +972,14 @@ int rtw_usb_probe(struct usb_interface *
goto err_destroy_rxwq;
}
+ ret = rtw_usb_switch_mode(rtwdev);
+ if (ret) {
+ /* Not a fail, but we do need to skip rtw_register_hw. */
+ rtw_dbg(rtwdev, RTW_DBG_USB, "switching to USB 3 mode\n");
+ ret = 0;
+ goto err_destroy_rxwq;
+ }
+
ret = rtw_register_hw(rtwdev, rtwdev->hw);
if (ret) {
rtw_err(rtwdev, "failed to register hw\n");

View File

@ -0,0 +1,454 @@
From 8db6c1ca64664ef9b071e6eeb646023ac5b240a8 Mon Sep 17 00:00:00 2001
From: Ping-Ke Shih <pkshih@realtek.com>
Date: Thu, 18 Jul 2024 14:41:55 +0800
Subject: [PATCH] wifi: rtw88: debugfs: support multiple adapters debugging
Originally in order to read partial registers from large area, we write
a range value stored into a static variable and read registers according
to the static variable.
However, if we install more than one adapters supported by this driver,
the static variables will be overwritten by latter adapters. To resolve
the problem, move the static variables to struct rtw_dev for each adapter.
With changes, smatch spends too much time to parse rtw_debugfs_init():
debug.c:1289 rtw_debugfs_init() parse error: turning off implications
after 60 seconds
Move stuffs of adding debugfs entries to three rtw_debugfs_add_xxx()
functions.
Reported-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/cd6a2acf3c2c36d938b40140b52a779516f446a9.camel@realtek.com/T/#m27662022c70d9f893ba96f6c6a8dd8fce2434dfe
Tested-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240718064155.38955-1-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/debug.c | 303 ++++++++++++---------
drivers/net/wireless/realtek/rtw88/debug.h | 2 +
drivers/net/wireless/realtek/rtw88/main.c | 1 +
drivers/net/wireless/realtek/rtw88/main.h | 3 +-
4 files changed, 180 insertions(+), 129 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -43,6 +43,62 @@ struct rtw_debugfs_priv {
};
};
+struct rtw_debugfs {
+ struct rtw_debugfs_priv mac_0;
+ struct rtw_debugfs_priv mac_1;
+ struct rtw_debugfs_priv mac_2;
+ struct rtw_debugfs_priv mac_3;
+ struct rtw_debugfs_priv mac_4;
+ struct rtw_debugfs_priv mac_5;
+ struct rtw_debugfs_priv mac_6;
+ struct rtw_debugfs_priv mac_7;
+ struct rtw_debugfs_priv mac_10;
+ struct rtw_debugfs_priv mac_11;
+ struct rtw_debugfs_priv mac_12;
+ struct rtw_debugfs_priv mac_13;
+ struct rtw_debugfs_priv mac_14;
+ struct rtw_debugfs_priv mac_15;
+ struct rtw_debugfs_priv mac_16;
+ struct rtw_debugfs_priv mac_17;
+ struct rtw_debugfs_priv bb_8;
+ struct rtw_debugfs_priv bb_9;
+ struct rtw_debugfs_priv bb_a;
+ struct rtw_debugfs_priv bb_b;
+ struct rtw_debugfs_priv bb_c;
+ struct rtw_debugfs_priv bb_d;
+ struct rtw_debugfs_priv bb_e;
+ struct rtw_debugfs_priv bb_f;
+ struct rtw_debugfs_priv bb_18;
+ struct rtw_debugfs_priv bb_19;
+ struct rtw_debugfs_priv bb_1a;
+ struct rtw_debugfs_priv bb_1b;
+ struct rtw_debugfs_priv bb_1c;
+ struct rtw_debugfs_priv bb_1d;
+ struct rtw_debugfs_priv bb_1e;
+ struct rtw_debugfs_priv bb_1f;
+ struct rtw_debugfs_priv bb_2c;
+ struct rtw_debugfs_priv bb_2d;
+ struct rtw_debugfs_priv bb_40;
+ struct rtw_debugfs_priv bb_41;
+ struct rtw_debugfs_priv rf_dump;
+ struct rtw_debugfs_priv tx_pwr_tbl;
+ struct rtw_debugfs_priv write_reg;
+ struct rtw_debugfs_priv h2c;
+ struct rtw_debugfs_priv rf_write;
+ struct rtw_debugfs_priv rf_read;
+ struct rtw_debugfs_priv read_reg;
+ struct rtw_debugfs_priv fix_rate;
+ struct rtw_debugfs_priv dump_cam;
+ struct rtw_debugfs_priv rsvd_page;
+ struct rtw_debugfs_priv phy_info;
+ struct rtw_debugfs_priv coex_enable;
+ struct rtw_debugfs_priv coex_info;
+ struct rtw_debugfs_priv edcca_enable;
+ struct rtw_debugfs_priv fw_crash;
+ struct rtw_debugfs_priv force_lowest_basic_rate;
+ struct rtw_debugfs_priv dm_cap;
+};
+
static const char * const rtw_dm_cap_strs[] = {
[RTW_DM_CAP_NA] = "NA",
[RTW_DM_CAP_TXGAPK] = "TXGAPK",
@@ -524,7 +580,7 @@ static int rtw_debug_get_bb_page(struct
return 0;
}
-static int rtw_debug_get_rf_dump(struct seq_file *m, void *v)
+static int rtw_debugfs_get_rf_dump(struct seq_file *m, void *v)
{
struct rtw_debugfs_priv *debugfs_priv = m->private;
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
@@ -1074,139 +1130,102 @@ static int rtw_debugfs_get_dm_cap(struct
return 0;
}
-#define rtw_debug_impl_mac(page, addr) \
-static struct rtw_debugfs_priv rtw_debug_priv_mac_ ##page = { \
+#define rtw_debug_priv_mac(addr) \
+{ \
.cb_read = rtw_debug_get_mac_page, \
.cb_data = addr, \
}
-rtw_debug_impl_mac(0, 0x0000);
-rtw_debug_impl_mac(1, 0x0100);
-rtw_debug_impl_mac(2, 0x0200);
-rtw_debug_impl_mac(3, 0x0300);
-rtw_debug_impl_mac(4, 0x0400);
-rtw_debug_impl_mac(5, 0x0500);
-rtw_debug_impl_mac(6, 0x0600);
-rtw_debug_impl_mac(7, 0x0700);
-rtw_debug_impl_mac(10, 0x1000);
-rtw_debug_impl_mac(11, 0x1100);
-rtw_debug_impl_mac(12, 0x1200);
-rtw_debug_impl_mac(13, 0x1300);
-rtw_debug_impl_mac(14, 0x1400);
-rtw_debug_impl_mac(15, 0x1500);
-rtw_debug_impl_mac(16, 0x1600);
-rtw_debug_impl_mac(17, 0x1700);
-
-#define rtw_debug_impl_bb(page, addr) \
-static struct rtw_debugfs_priv rtw_debug_priv_bb_ ##page = { \
+#define rtw_debug_priv_bb(addr) \
+{ \
.cb_read = rtw_debug_get_bb_page, \
.cb_data = addr, \
}
-rtw_debug_impl_bb(8, 0x0800);
-rtw_debug_impl_bb(9, 0x0900);
-rtw_debug_impl_bb(a, 0x0a00);
-rtw_debug_impl_bb(b, 0x0b00);
-rtw_debug_impl_bb(c, 0x0c00);
-rtw_debug_impl_bb(d, 0x0d00);
-rtw_debug_impl_bb(e, 0x0e00);
-rtw_debug_impl_bb(f, 0x0f00);
-rtw_debug_impl_bb(18, 0x1800);
-rtw_debug_impl_bb(19, 0x1900);
-rtw_debug_impl_bb(1a, 0x1a00);
-rtw_debug_impl_bb(1b, 0x1b00);
-rtw_debug_impl_bb(1c, 0x1c00);
-rtw_debug_impl_bb(1d, 0x1d00);
-rtw_debug_impl_bb(1e, 0x1e00);
-rtw_debug_impl_bb(1f, 0x1f00);
-rtw_debug_impl_bb(2c, 0x2c00);
-rtw_debug_impl_bb(2d, 0x2d00);
-rtw_debug_impl_bb(40, 0x4000);
-rtw_debug_impl_bb(41, 0x4100);
-
-static struct rtw_debugfs_priv rtw_debug_priv_rf_dump = {
- .cb_read = rtw_debug_get_rf_dump,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_tx_pwr_tbl = {
- .cb_read = rtw_debugfs_get_tx_pwr_tbl,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_write_reg = {
- .cb_write = rtw_debugfs_set_write_reg,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_h2c = {
- .cb_write = rtw_debugfs_set_h2c,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_rf_write = {
- .cb_write = rtw_debugfs_set_rf_write,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_rf_read = {
- .cb_write = rtw_debugfs_set_rf_read,
- .cb_read = rtw_debugfs_get_rf_read,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_read_reg = {
- .cb_write = rtw_debugfs_set_read_reg,
- .cb_read = rtw_debugfs_get_read_reg,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_fix_rate = {
- .cb_write = rtw_debugfs_set_fix_rate,
- .cb_read = rtw_debugfs_get_fix_rate,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_dump_cam = {
- .cb_write = rtw_debugfs_set_single_input,
- .cb_read = rtw_debugfs_get_dump_cam,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_rsvd_page = {
- .cb_write = rtw_debugfs_set_rsvd_page,
- .cb_read = rtw_debugfs_get_rsvd_page,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_phy_info = {
- .cb_read = rtw_debugfs_get_phy_info,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_coex_enable = {
- .cb_write = rtw_debugfs_set_coex_enable,
- .cb_read = rtw_debugfs_get_coex_enable,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_coex_info = {
- .cb_read = rtw_debugfs_get_coex_info,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_edcca_enable = {
- .cb_write = rtw_debugfs_set_edcca_enable,
- .cb_read = rtw_debugfs_get_edcca_enable,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_fw_crash = {
- .cb_write = rtw_debugfs_set_fw_crash,
- .cb_read = rtw_debugfs_get_fw_crash,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_force_lowest_basic_rate = {
- .cb_write = rtw_debugfs_set_force_lowest_basic_rate,
- .cb_read = rtw_debugfs_get_force_lowest_basic_rate,
-};
-
-static struct rtw_debugfs_priv rtw_debug_priv_dm_cap = {
- .cb_write = rtw_debugfs_set_dm_cap,
- .cb_read = rtw_debugfs_get_dm_cap,
+#define rtw_debug_priv_get(name) \
+{ \
+ .cb_read = rtw_debugfs_get_ ##name, \
+}
+
+#define rtw_debug_priv_set(name) \
+{ \
+ .cb_write = rtw_debugfs_set_ ##name, \
+}
+
+#define rtw_debug_priv_set_and_get(name) \
+{ \
+ .cb_write = rtw_debugfs_set_ ##name, \
+ .cb_read = rtw_debugfs_get_ ##name, \
+}
+
+#define rtw_debug_priv_set_single_and_get(name) \
+{ \
+ .cb_write = rtw_debugfs_set_single_input, \
+ .cb_read = rtw_debugfs_get_ ##name, \
+}
+
+static const struct rtw_debugfs rtw_debugfs_templ = {
+ .mac_0 = rtw_debug_priv_mac(0x0000),
+ .mac_1 = rtw_debug_priv_mac(0x0100),
+ .mac_2 = rtw_debug_priv_mac(0x0200),
+ .mac_3 = rtw_debug_priv_mac(0x0300),
+ .mac_4 = rtw_debug_priv_mac(0x0400),
+ .mac_5 = rtw_debug_priv_mac(0x0500),
+ .mac_6 = rtw_debug_priv_mac(0x0600),
+ .mac_7 = rtw_debug_priv_mac(0x0700),
+ .mac_10 = rtw_debug_priv_mac(0x1000),
+ .mac_11 = rtw_debug_priv_mac(0x1100),
+ .mac_12 = rtw_debug_priv_mac(0x1200),
+ .mac_13 = rtw_debug_priv_mac(0x1300),
+ .mac_14 = rtw_debug_priv_mac(0x1400),
+ .mac_15 = rtw_debug_priv_mac(0x1500),
+ .mac_16 = rtw_debug_priv_mac(0x1600),
+ .mac_17 = rtw_debug_priv_mac(0x1700),
+ .bb_8 = rtw_debug_priv_bb(0x0800),
+ .bb_9 = rtw_debug_priv_bb(0x0900),
+ .bb_a = rtw_debug_priv_bb(0x0a00),
+ .bb_b = rtw_debug_priv_bb(0x0b00),
+ .bb_c = rtw_debug_priv_bb(0x0c00),
+ .bb_d = rtw_debug_priv_bb(0x0d00),
+ .bb_e = rtw_debug_priv_bb(0x0e00),
+ .bb_f = rtw_debug_priv_bb(0x0f00),
+ .bb_18 = rtw_debug_priv_bb(0x1800),
+ .bb_19 = rtw_debug_priv_bb(0x1900),
+ .bb_1a = rtw_debug_priv_bb(0x1a00),
+ .bb_1b = rtw_debug_priv_bb(0x1b00),
+ .bb_1c = rtw_debug_priv_bb(0x1c00),
+ .bb_1d = rtw_debug_priv_bb(0x1d00),
+ .bb_1e = rtw_debug_priv_bb(0x1e00),
+ .bb_1f = rtw_debug_priv_bb(0x1f00),
+ .bb_2c = rtw_debug_priv_bb(0x2c00),
+ .bb_2d = rtw_debug_priv_bb(0x2d00),
+ .bb_40 = rtw_debug_priv_bb(0x4000),
+ .bb_41 = rtw_debug_priv_bb(0x4100),
+ .rf_dump = rtw_debug_priv_get(rf_dump),
+ .tx_pwr_tbl = rtw_debug_priv_get(tx_pwr_tbl),
+ .write_reg = rtw_debug_priv_set(write_reg),
+ .h2c = rtw_debug_priv_set(h2c),
+ .rf_write = rtw_debug_priv_set(rf_write),
+ .rf_read = rtw_debug_priv_set_and_get(rf_read),
+ .read_reg = rtw_debug_priv_set_and_get(read_reg),
+ .fix_rate = rtw_debug_priv_set_and_get(fix_rate),
+ .dump_cam = rtw_debug_priv_set_single_and_get(dump_cam),
+ .rsvd_page = rtw_debug_priv_set_and_get(rsvd_page),
+ .phy_info = rtw_debug_priv_get(phy_info),
+ .coex_enable = rtw_debug_priv_set_and_get(coex_enable),
+ .coex_info = rtw_debug_priv_get(coex_info),
+ .edcca_enable = rtw_debug_priv_set_and_get(edcca_enable),
+ .fw_crash = rtw_debug_priv_set_and_get(fw_crash),
+ .force_lowest_basic_rate = rtw_debug_priv_set_and_get(force_lowest_basic_rate),
+ .dm_cap = rtw_debug_priv_set_and_get(dm_cap),
};
#define rtw_debugfs_add_core(name, mode, fopname, parent) \
do { \
- rtw_debug_priv_ ##name.rtwdev = rtwdev; \
+ struct rtw_debugfs_priv *priv = &rtwdev->debugfs->name; \
+ priv->rtwdev = rtwdev; \
if (IS_ERR(debugfs_create_file(#name, mode, \
- parent, &rtw_debug_priv_ ##name,\
+ parent, priv, \
&file_ops_ ##fopname))) \
pr_debug("Unable to initialize debugfs:%s\n", \
#name); \
@@ -1219,12 +1238,9 @@ static struct rtw_debugfs_priv rtw_debug
#define rtw_debugfs_add_r(name) \
rtw_debugfs_add_core(name, S_IFREG | 0444, single_r, debugfs_topdir)
-void rtw_debugfs_init(struct rtw_dev *rtwdev)
+static
+void rtw_debugfs_add_basic(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir)
{
- struct dentry *debugfs_topdir;
-
- debugfs_topdir = debugfs_create_dir("rtw88",
- rtwdev->hw->wiphy->debugfsdir);
rtw_debugfs_add_w(write_reg);
rtw_debugfs_add_rw(read_reg);
rtw_debugfs_add_w(rf_write);
@@ -1236,6 +1252,17 @@ void rtw_debugfs_init(struct rtw_dev *rt
rtw_debugfs_add_r(coex_info);
rtw_debugfs_add_rw(coex_enable);
rtw_debugfs_add_w(h2c);
+ rtw_debugfs_add_r(rf_dump);
+ rtw_debugfs_add_r(tx_pwr_tbl);
+ rtw_debugfs_add_rw(edcca_enable);
+ rtw_debugfs_add_rw(fw_crash);
+ rtw_debugfs_add_rw(force_lowest_basic_rate);
+ rtw_debugfs_add_rw(dm_cap);
+}
+
+static
+void rtw_debugfs_add_sec0(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir)
+{
rtw_debugfs_add_r(mac_0);
rtw_debugfs_add_r(mac_1);
rtw_debugfs_add_r(mac_2);
@@ -1252,6 +1279,11 @@ void rtw_debugfs_init(struct rtw_dev *rt
rtw_debugfs_add_r(bb_d);
rtw_debugfs_add_r(bb_e);
rtw_debugfs_add_r(bb_f);
+}
+
+static
+void rtw_debugfs_add_sec1(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir)
+{
rtw_debugfs_add_r(mac_10);
rtw_debugfs_add_r(mac_11);
rtw_debugfs_add_r(mac_12);
@@ -1274,14 +1306,29 @@ void rtw_debugfs_init(struct rtw_dev *rt
rtw_debugfs_add_r(bb_40);
rtw_debugfs_add_r(bb_41);
}
- rtw_debugfs_add_r(rf_dump);
- rtw_debugfs_add_r(tx_pwr_tbl);
- rtw_debugfs_add_rw(edcca_enable);
- rtw_debugfs_add_rw(fw_crash);
- rtw_debugfs_add_rw(force_lowest_basic_rate);
- rtw_debugfs_add_rw(dm_cap);
}
+void rtw_debugfs_init(struct rtw_dev *rtwdev)
+{
+ struct dentry *debugfs_topdir;
+
+ rtwdev->debugfs = kmemdup(&rtw_debugfs_templ, sizeof(rtw_debugfs_templ),
+ GFP_KERNEL);
+ if (!rtwdev->debugfs)
+ return;
+
+ debugfs_topdir = debugfs_create_dir("rtw88",
+ rtwdev->hw->wiphy->debugfsdir);
+
+ rtw_debugfs_add_basic(rtwdev, debugfs_topdir);
+ rtw_debugfs_add_sec0(rtwdev, debugfs_topdir);
+ rtw_debugfs_add_sec1(rtwdev, debugfs_topdir);
+}
+
+void rtw_debugfs_deinit(struct rtw_dev *rtwdev)
+{
+ kfree(rtwdev->debugfs);
+}
#endif /* CPTCFG_RTW88_DEBUGFS */
#ifdef CPTCFG_RTW88_DEBUG
--- a/drivers/net/wireless/realtek/rtw88/debug.h
+++ b/drivers/net/wireless/realtek/rtw88/debug.h
@@ -34,11 +34,13 @@ enum rtw_debug_mask {
#ifdef CPTCFG_RTW88_DEBUGFS
void rtw_debugfs_init(struct rtw_dev *rtwdev);
+void rtw_debugfs_deinit(struct rtw_dev *rtwdev);
void rtw_debugfs_get_simple_phy_info(struct seq_file *m);
#else
static inline void rtw_debugfs_init(struct rtw_dev *rtwdev) {}
+static inline void rtw_debugfs_deinit(struct rtw_dev *rtwdev) {}
#endif /* CPTCFG_RTW88_DEBUGFS */
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2300,6 +2300,7 @@ void rtw_unregister_hw(struct rtw_dev *r
ieee80211_unregister_hw(hw);
rtw_unset_supported_band(hw, chip);
+ rtw_debugfs_deinit(rtwdev);
}
EXPORT_SYMBOL(rtw_unregister_hw);
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -50,6 +50,7 @@ extern const struct ieee80211_ops rtw_op
#define RTW_MAX_CHANNEL_NUM_5G 49
struct rtw_dev;
+struct rtw_debugfs;
enum rtw_hci_type {
RTW_HCI_TYPE_PCIE,
@@ -2053,7 +2054,7 @@ struct rtw_dev {
bool beacon_loss;
struct completion lps_leave_check;
- struct dentry *debugfs;
+ struct rtw_debugfs *debugfs;
u8 sta_cnt;
u32 rts_threshold;

View File

@ -0,0 +1,25 @@
From 7e989b0c1e33210c07340bf5228aa83ea52515b5 Mon Sep 17 00:00:00 2001
From: Zong-Zhe Yang <kevin_yang@realtek.com>
Date: Thu, 18 Jul 2024 15:06:15 +0800
Subject: [PATCH] wifi: rtw88: select WANT_DEV_COREDUMP
We have invoked device coredump when fw crash.
Should select WANT_DEV_COREDUMP by ourselves.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240718070616.42217-1-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/Kconfig | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/wireless/realtek/rtw88/Kconfig
+++ b/drivers/net/wireless/realtek/rtw88/Kconfig
@@ -14,6 +14,7 @@ if RTW88
config RTW88_CORE
tristate
depends on m
+ select BPAUTO_WANT_DEV_COREDUMP
config RTW88_PCI
tristate

View File

@ -0,0 +1,151 @@
From 53ed4b25a79aeec5991c2dc579e635b136ef7676 Mon Sep 17 00:00:00 2001
From: Po-Hao Huang <phhuang@realtek.com>
Date: Wed, 24 Jul 2024 13:05:01 +0800
Subject: [PATCH] wifi: rtw88: 8822c: Parse channel from IE to correct invalid
hardware reports
For CCK packets we could get incorrect reports from hardware.
And this causes wrong frequencies being reported. Parse the channel
information from IE if provided by AP to fix this.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240724050501.7550-1-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/main.h | 1 +
drivers/net/wireless/realtek/rtw88/pci.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 7 ++--
drivers/net/wireless/realtek/rtw88/rx.c | 41 +++++++++++++++++++
drivers/net/wireless/realtek/rtw88/rx.h | 13 ++++++
drivers/net/wireless/realtek/rtw88/sdio.c | 1 +
drivers/net/wireless/realtek/rtw88/usb.c | 2 +
7 files changed, 63 insertions(+), 3 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -623,6 +623,7 @@ struct rtw_rx_pkt_stat {
bool crc_err;
bool decrypted;
bool is_c2h;
+ bool channel_invalid;
s32 signal_power;
u16 pkt_len;
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1088,6 +1088,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de
/* remove rx_desc */
skb_pull(new, pkt_offset);
+ rtw_update_rx_freq_for_invalid(rtwdev, new, &rx_status, &pkt_stat);
rtw_rx_stats(rtwdev, pkt_stat.vif, new);
memcpy(new->cb, &rx_status, sizeof(rx_status));
ieee80211_rx_napi(rtwdev->hw, NULL, new, napi);
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -2576,9 +2576,10 @@ static void query_phy_status_page0(struc
rx_power[RF_PATH_B] -= 110;
channel = GET_PHY_STAT_P0_CHANNEL(phy_status);
- if (channel == 0)
- channel = rtwdev->hal.current_channel;
- rtw_set_rx_freq_band(pkt_stat, channel);
+ if (channel != 0)
+ rtw_set_rx_freq_band(pkt_stat, channel);
+ else
+ pkt_stat->channel_invalid = true;
pkt_stat->rx_power[RF_PATH_A] = rx_power[RF_PATH_A];
pkt_stat->rx_power[RF_PATH_B] = rx_power[RF_PATH_B];
--- a/drivers/net/wireless/realtek/rtw88/rx.c
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
@@ -146,6 +146,47 @@ static void rtw_set_rx_freq_by_pktstat(s
rx_status->band = pkt_stat->band;
}
+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb,
+ struct ieee80211_rx_status *rx_status,
+ struct rtw_rx_pkt_stat *pkt_stat)
+{
+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
+ int channel = rtwdev->hal.current_channel;
+ size_t hdr_len, ielen;
+ int channel_number;
+ u8 *variable;
+
+ if (!test_bit(RTW_FLAG_SCANNING, rtwdev->flags))
+ goto fill_rx_status;
+
+ if (ieee80211_is_beacon(mgmt->frame_control)) {
+ variable = mgmt->u.beacon.variable;
+ hdr_len = offsetof(struct ieee80211_mgmt,
+ u.beacon.variable);
+ } else if (ieee80211_is_probe_resp(mgmt->frame_control)) {
+ variable = mgmt->u.probe_resp.variable;
+ hdr_len = offsetof(struct ieee80211_mgmt,
+ u.probe_resp.variable);
+ } else {
+ goto fill_rx_status;
+ }
+
+ if (skb->len > hdr_len)
+ ielen = skb->len - hdr_len;
+ else
+ goto fill_rx_status;
+
+ channel_number = cfg80211_get_ies_channel_number(variable, ielen,
+ NL80211_BAND_2GHZ);
+ if (channel_number != -1)
+ channel = channel_number;
+
+fill_rx_status:
+ rtw_set_rx_freq_band(pkt_stat, channel);
+ rtw_set_rx_freq_by_pktstat(pkt_stat, rx_status);
+}
+EXPORT_SYMBOL(rtw_update_rx_freq_from_ie);
+
void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
struct rtw_rx_pkt_stat *pkt_stat,
struct ieee80211_hdr *hdr,
--- a/drivers/net/wireless/realtek/rtw88/rx.h
+++ b/drivers/net/wireless/realtek/rtw88/rx.h
@@ -50,5 +50,18 @@ void rtw_rx_fill_rx_status(struct rtw_de
struct ieee80211_hdr *hdr,
struct ieee80211_rx_status *rx_status,
u8 *phy_status);
+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb,
+ struct ieee80211_rx_status *rx_status,
+ struct rtw_rx_pkt_stat *pkt_stat);
+
+static inline
+void rtw_update_rx_freq_for_invalid(struct rtw_dev *rtwdev, struct sk_buff *skb,
+ struct ieee80211_rx_status *rx_status,
+ struct rtw_rx_pkt_stat *pkt_stat)
+{
+ if (pkt_stat->channel_invalid)
+ rtw_update_rx_freq_from_ie(rtwdev, skb, rx_status, pkt_stat);
+}
+
#endif
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -948,6 +948,7 @@ static void rtw_sdio_rx_skb(struct rtw_d
skb_put(skb, pkt_stat->pkt_len);
skb_reserve(skb, pkt_offset);
+ rtw_update_rx_freq_for_invalid(rtwdev, skb, rx_status, pkt_stat);
rtw_rx_stats(rtwdev, pkt_stat->vif, skb);
ieee80211_rx_irqsafe(rtwdev->hw, skb);
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -579,6 +579,8 @@ static void rtw_usb_rx_handler(struct wo
skb_put(skb, pkt_stat.pkt_len);
skb_reserve(skb, pkt_offset);
+
+ rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat);
memcpy(skb->cb, &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(rtwdev->hw, skb);
}

View File

@ -0,0 +1,73 @@
From fbbd8cb347e25b68d25c4f3871821afc495ee7a9 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Thu, 8 Aug 2024 01:19:36 +0300
Subject: [PATCH] wifi: rtw88: usb: Init RX burst length according to USB speed
This is needed in order to make USB RX aggregation work with RTL8811CU
(and presumably RTL8822BU and RTL8822CU also).
I don't know what BIT_DMA_BURST_CNT, BIT_DMA_MODE, and BIT_DROP_DATA_EN
are doing.
Tested with RTL8822CU, RTL8811CU, and RTL8723DU.
The RX speed is unchanged in my tests.
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/ac569c6f-7129-4341-b523-901fe10cabff@gmail.com
---
drivers/net/wireless/realtek/rtw88/reg.h | 6 ++++++
drivers/net/wireless/realtek/rtw88/usb.c | 23 ++++++++++++++++++++++-
2 files changed, 28 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/realtek/rtw88/reg.h
+++ b/drivers/net/wireless/realtek/rtw88/reg.h
@@ -322,6 +322,12 @@
#define REG_RXDMA_DPR 0x028C
#define REG_RXDMA_MODE 0x0290
#define BIT_DMA_MODE BIT(1)
+#define BIT_DMA_BURST_CNT GENMASK(3, 2)
+#define BIT_DMA_BURST_SIZE GENMASK(5, 4)
+#define BIT_DMA_BURST_SIZE_64 2
+#define BIT_DMA_BURST_SIZE_512 1
+#define BIT_DMA_BURST_SIZE_1024 0
+
#define REG_RXPKTNUM 0x02B0
#define REG_INT_MIG 0x0304
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -720,9 +720,30 @@ static void rtw_usb_link_ps(struct rtw_d
/* empty function for rtw_hci_ops */
}
+static void rtw_usb_init_burst_pkt_len(struct rtw_dev *rtwdev)
+{
+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
+ enum usb_device_speed speed = rtwusb->udev->speed;
+ u8 rxdma, burst_size;
+
+ rxdma = BIT_DMA_BURST_CNT | BIT_DMA_MODE;
+
+ if (speed == USB_SPEED_SUPER)
+ burst_size = BIT_DMA_BURST_SIZE_1024;
+ else if (speed == USB_SPEED_HIGH)
+ burst_size = BIT_DMA_BURST_SIZE_512;
+ else
+ burst_size = BIT_DMA_BURST_SIZE_64;
+
+ u8p_replace_bits(&rxdma, burst_size, BIT_DMA_BURST_SIZE);
+
+ rtw_write8(rtwdev, REG_RXDMA_MODE, rxdma);
+ rtw_write16_set(rtwdev, REG_TXDMA_OFFSET_CHK, BIT_DROP_DATA_EN);
+}
+
static void rtw_usb_interface_cfg(struct rtw_dev *rtwdev)
{
- /* empty function for rtw_hci_ops */
+ rtw_usb_init_burst_pkt_len(rtwdev);
}
static struct rtw_hci_ops rtw_usb_ops = {

View File

@ -0,0 +1,31 @@
From 38ea04a79ad0f8cc30bb5e9ad98d665e4ae5060c Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Thu, 8 Aug 2024 01:20:36 +0300
Subject: [PATCH] wifi: rtw88: usb: Update the RX stats after every frame
Update the number of received unicast data frames and bytes every time
a frame is received. This is what the PCI and SDIO drivers do.
This has an influence on the power saving, bluetooth coexistence, and
(in a future patch) the use of RX aggregation.
Tested with RTL8822CU, RTL8811CU, and RTL8723DU.
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/75a2ca52-8f01-45c5-926f-d3a68ae3b284@gmail.com
---
drivers/net/wireless/realtek/rtw88/usb.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -581,6 +581,7 @@ static void rtw_usb_rx_handler(struct wo
skb_reserve(skb, pkt_offset);
rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat);
+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb);
memcpy(skb->cb, &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(rtwdev->hw, skb);
}

View File

@ -0,0 +1,118 @@
From df3d8f463b1dfc7cb8f4fb52b1b81d290b850d03 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Thu, 8 Aug 2024 01:21:36 +0300
Subject: [PATCH] wifi: rtw88: usb: Support RX aggregation
The chips can be configured to aggregate several frames into a single
USB transfer. Modify rtw_usb_rx_handler() to support this case.
RX aggregation improves the RX speed of RTL8811CU on certain ARM
systems, like the NanoPi NEO Core2. It also improves the RX speed of
RTL8822CU on some x86_64 systems.
Currently none of the chips are configured to aggregate frames.
Tested with RTL8822CU, RTL8811CU, and RTL8723DU.
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/f845826d-de71-492d-9a22-e48c07989a1f@gmail.com
---
drivers/net/wireless/realtek/rtw88/usb.c | 61 ++++++++++++++++--------
1 file changed, 40 insertions(+), 21 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -546,11 +546,12 @@ static void rtw_usb_rx_handler(struct wo
struct rtw_usb *rtwusb = container_of(work, struct rtw_usb, rx_work);
struct rtw_dev *rtwdev = rtwusb->rtwdev;
const struct rtw_chip_info *chip = rtwdev->chip;
- struct rtw_rx_pkt_stat pkt_stat;
+ u32 pkt_desc_sz = chip->rx_pkt_desc_sz;
struct ieee80211_rx_status rx_status;
+ u32 pkt_offset, next_pkt, urb_len;
+ struct rtw_rx_pkt_stat pkt_stat;
+ struct sk_buff *next_skb;
struct sk_buff *skb;
- u32 pkt_desc_sz = chip->rx_pkt_desc_sz;
- u32 pkt_offset;
u8 *rx_desc;
int limit;
@@ -559,31 +560,48 @@ static void rtw_usb_rx_handler(struct wo
if (!skb)
break;
- rx_desc = skb->data;
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
- &rx_status);
- pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
- pkt_stat.shift;
-
- if (pkt_stat.is_c2h) {
- skb_put(skb, pkt_stat.pkt_len + pkt_offset);
- rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb);
- continue;
- }
-
if (skb_queue_len(&rtwusb->rx_queue) >= RTW_USB_MAX_RXQ_LEN) {
dev_dbg_ratelimited(rtwdev->dev, "failed to get rx_queue, overflow\n");
dev_kfree_skb_any(skb);
continue;
}
- skb_put(skb, pkt_stat.pkt_len);
- skb_reserve(skb, pkt_offset);
+ urb_len = skb->len;
+
+ do {
+ rx_desc = skb->data;
+ chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
+ &rx_status);
+ pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
+ pkt_stat.shift;
+
+ next_pkt = round_up(pkt_stat.pkt_len + pkt_offset, 8);
+
+ if (urb_len >= next_pkt + pkt_desc_sz)
+ next_skb = skb_clone(skb, GFP_KERNEL);
+ else
+ next_skb = NULL;
+
+ if (pkt_stat.is_c2h) {
+ skb_trim(skb, pkt_stat.pkt_len + pkt_offset);
+ rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb);
+ } else {
+ skb_pull(skb, pkt_offset);
+ skb_trim(skb, pkt_stat.pkt_len);
+ rtw_update_rx_freq_for_invalid(rtwdev, skb,
+ &rx_status,
+ &pkt_stat);
+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb);
+ memcpy(skb->cb, &rx_status, sizeof(rx_status));
+ ieee80211_rx_irqsafe(rtwdev->hw, skb);
+ }
+
+ skb = next_skb;
+ if (skb)
+ skb_pull(skb, next_pkt);
- rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat);
- rtw_rx_stats(rtwdev, pkt_stat.vif, skb);
- memcpy(skb->cb, &rx_status, sizeof(rx_status));
- ieee80211_rx_irqsafe(rtwdev->hw, skb);
+ urb_len -= next_pkt;
+ } while (skb);
}
}
@@ -627,6 +645,7 @@ static void rtw_usb_read_port_complete(s
if (skb)
dev_kfree_skb_any(skb);
} else {
+ skb_put(skb, urb->actual_length);
skb_queue_tail(&rtwusb->rx_queue, skb);
queue_work(rtwusb->rxwq, &rtwusb->rx_work);
}

View File

@ -0,0 +1,168 @@
From 002a5db9a52a0e7af0fa9a450d31049748435748 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Thu, 8 Aug 2024 01:23:06 +0300
Subject: [PATCH] wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c
Enable USB RX aggregation when there is at least 1 Mbps RX or TX
traffic, otherwise disable it.
USB RX aggregation improves the RX speed of RTL8811CU on certain ARM
systems, like the NanoPi NEO Core2. Before: 28 Mbps, after: 231 Mbps.
It also improves the RX speed of RTL8822CU on some x86_64 systems.
Before: ~200 Mbps, after: ~300 Mbps.
The official drivers for these chips use the same logic for SDIO, but
for some reason the SDIO driver in rtw88 always enables RX aggregation,
so this patch only toggles aggregation for USB devices.
RTL8703B is likely not found in USB devices, and RTL8723DU doesn't like
aggregation.
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/b4c0d54c-6755-4b0f-9dd7-f9196fd74b68@gmail.com
---
drivers/net/wireless/realtek/rtw88/hci.h | 7 ++++
drivers/net/wireless/realtek/rtw88/main.c | 13 +++++---
drivers/net/wireless/realtek/rtw88/pci.c | 1 +
drivers/net/wireless/realtek/rtw88/sdio.c | 1 +
drivers/net/wireless/realtek/rtw88/usb.c | 40 +++++++++++++++++++++++
5 files changed, 58 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/hci.h
+++ b/drivers/net/wireless/realtek/rtw88/hci.h
@@ -18,6 +18,7 @@ struct rtw_hci_ops {
void (*deep_ps)(struct rtw_dev *rtwdev, bool enter);
void (*link_ps)(struct rtw_dev *rtwdev, bool enter);
void (*interface_cfg)(struct rtw_dev *rtwdev);
+ void (*dynamic_rx_agg)(struct rtw_dev *rtwdev, bool enable);
int (*write_data_rsvd_page)(struct rtw_dev *rtwdev, u8 *buf, u32 size);
int (*write_data_h2c)(struct rtw_dev *rtwdev, u8 *buf, u32 size);
@@ -72,6 +73,12 @@ static inline void rtw_hci_interface_cfg
rtwdev->hci.ops->interface_cfg(rtwdev);
}
+static inline void rtw_hci_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable)
+{
+ if (rtwdev->hci.ops->dynamic_rx_agg)
+ rtwdev->hci.ops->dynamic_rx_agg(rtwdev, enable);
+}
+
static inline int
rtw_hci_write_data_rsvd_page(struct rtw_dev *rtwdev, u8 *buf, u32 size)
{
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -212,6 +212,7 @@ static void rtw_watch_dog_work(struct wo
struct rtw_traffic_stats *stats = &rtwdev->stats;
struct rtw_watch_dog_iter_data data = {};
bool busy_traffic = test_bit(RTW_FLAG_BUSY_TRAFFIC, rtwdev->flags);
+ u32 tx_unicast_mbps, rx_unicast_mbps;
bool ps_active;
mutex_lock(&rtwdev->mutex);
@@ -236,10 +237,11 @@ static void rtw_watch_dog_work(struct wo
else
ps_active = false;
- ewma_tp_add(&stats->tx_ewma_tp,
- (u32)(stats->tx_unicast >> RTW_TP_SHIFT));
- ewma_tp_add(&stats->rx_ewma_tp,
- (u32)(stats->rx_unicast >> RTW_TP_SHIFT));
+ tx_unicast_mbps = stats->tx_unicast >> RTW_TP_SHIFT;
+ rx_unicast_mbps = stats->rx_unicast >> RTW_TP_SHIFT;
+
+ ewma_tp_add(&stats->tx_ewma_tp, tx_unicast_mbps);
+ ewma_tp_add(&stats->rx_ewma_tp, rx_unicast_mbps);
stats->tx_throughput = ewma_tp_read(&stats->tx_ewma_tp);
stats->rx_throughput = ewma_tp_read(&stats->rx_ewma_tp);
@@ -259,6 +261,9 @@ static void rtw_watch_dog_work(struct wo
rtw_phy_dynamic_mechanism(rtwdev);
+ rtw_hci_dynamic_rx_agg(rtwdev,
+ tx_unicast_mbps >= 1 || rx_unicast_mbps >= 1);
+
data.rtwdev = rtwdev;
/* rtw_iterate_vifs internally uses an atomic iterator which is needed
* to avoid taking local->iflist_mtx mutex
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1601,6 +1601,7 @@ static struct rtw_hci_ops rtw_pci_ops =
.deep_ps = rtw_pci_deep_ps,
.link_ps = rtw_pci_link_ps,
.interface_cfg = rtw_pci_interface_cfg,
+ .dynamic_rx_agg = NULL,
.read8 = rtw_pci_read8,
.read16 = rtw_pci_read16,
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -1157,6 +1157,7 @@ static struct rtw_hci_ops rtw_sdio_ops =
.deep_ps = rtw_sdio_deep_ps,
.link_ps = rtw_sdio_link_ps,
.interface_cfg = rtw_sdio_interface_cfg,
+ .dynamic_rx_agg = NULL,
.read8 = rtw_sdio_read8,
.read16 = rtw_sdio_read16,
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -766,6 +766,45 @@ static void rtw_usb_interface_cfg(struct
rtw_usb_init_burst_pkt_len(rtwdev);
}
+static void rtw_usb_dynamic_rx_agg_v1(struct rtw_dev *rtwdev, bool enable)
+{
+ u8 size, timeout;
+ u16 val16;
+
+ rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC);
+ rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
+ rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
+
+ if (enable) {
+ size = 0x5;
+ timeout = 0x20;
+ } else {
+ size = 0x0;
+ timeout = 0x1;
+ }
+ val16 = u16_encode_bits(size, BIT_RXDMA_AGG_PG_TH) |
+ u16_encode_bits(timeout, BIT_DMA_AGG_TO_V1);
+
+ rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16);
+}
+
+static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable)
+{
+ switch (rtwdev->chip->id) {
+ case RTW_CHIP_TYPE_8822C:
+ case RTW_CHIP_TYPE_8822B:
+ case RTW_CHIP_TYPE_8821C:
+ rtw_usb_dynamic_rx_agg_v1(rtwdev, enable);
+ break;
+ case RTW_CHIP_TYPE_8723D:
+ /* Doesn't like aggregation. */
+ break;
+ case RTW_CHIP_TYPE_8703B:
+ /* Likely not found in USB devices. */
+ break;
+ }
+}
+
static struct rtw_hci_ops rtw_usb_ops = {
.tx_write = rtw_usb_tx_write,
.tx_kick_off = rtw_usb_tx_kick_off,
@@ -775,6 +814,7 @@ static struct rtw_hci_ops rtw_usb_ops =
.deep_ps = rtw_usb_deep_ps,
.link_ps = rtw_usb_link_ps,
.interface_cfg = rtw_usb_interface_cfg,
+ .dynamic_rx_agg = rtw_usb_dynamic_rx_agg,
.write8 = rtw_usb_write8,
.write16 = rtw_usb_write16,

View File

@ -0,0 +1,231 @@
From 902cb7b11f9a7ff07233cc4c626b54c3e4703149 Mon Sep 17 00:00:00 2001
From: Ping-Ke Shih <pkshih@realtek.com>
Date: Mon, 19 Aug 2024 10:52:48 +0800
Subject: [PATCH] wifi: rtw88: assign mac_id for vif/sta and update to TX desc
A mac_id as an instance in firmware has to be assigned for each station
including AP and connected stations. Firmware will use the mac_id to
control TX rate and do statistics.
Assignment rule is to assign mac_id to each vif when adding vif.
For station mode, sta->mac_id will reuse vif->mac_id. For AP mode,
dynamically allocate an sta->mac_id to a station, and vif->mac_id is
used to send broadcast/multicast packets which are not belong to
a station. For example,
vif->mac_id sta->mac_id
vif0 (STA mode) 0 0
vif1 (AP mode) 1 2...
By the way, remove unused RTW_BC_MC_MACID, which was planed to send
broadcast/multicast packets on fixed mac_id.
Tested-on RTL8822CE with STA + AP SCC mode.
Link: https://lore.kernel.org/linux-wireless/e4be0a75-43b2-4ae5-9aab-5c4a88e78097@gmail.com/
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240819025248.17939-1-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/mac80211.c | 13 ++++++--
drivers/net/wireless/realtek/rtw88/main.c | 30 ++++++++-----------
drivers/net/wireless/realtek/rtw88/main.h | 14 +++++++--
drivers/net/wireless/realtek/rtw88/tx.c | 11 +++++--
drivers/net/wireless/realtek/rtw88/tx.h | 1 +
5 files changed, 44 insertions(+), 25 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -167,6 +167,12 @@ static int rtw_ops_add_interface(struct
mutex_lock(&rtwdev->mutex);
+ rtwvif->mac_id = rtw_acquire_macid(rtwdev);
+ if (rtwvif->mac_id >= RTW_MAX_MAC_ID_NUM) {
+ mutex_unlock(&rtwdev->mutex);
+ return -ENOSPC;
+ }
+
port = find_first_zero_bit(rtwdev->hw_port, RTW_PORT_NUM);
if (port >= RTW_PORT_NUM) {
mutex_unlock(&rtwdev->mutex);
@@ -214,7 +220,8 @@ static int rtw_ops_add_interface(struct
mutex_unlock(&rtwdev->mutex);
- rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM on port %d\n", vif->addr, rtwvif->port);
+ rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM mac_id %d on port %d\n",
+ vif->addr, rtwvif->mac_id, rtwvif->port);
return 0;
}
@@ -225,7 +232,8 @@ static void rtw_ops_remove_interface(str
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
u32 config = 0;
- rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM on port %d\n", vif->addr, rtwvif->port);
+ rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM mac_id %d on port %d\n",
+ vif->addr, rtwvif->mac_id, rtwvif->port);
mutex_lock(&rtwdev->mutex);
@@ -242,6 +250,7 @@ static void rtw_ops_remove_interface(str
config |= PORT_SET_BCN_CTRL;
rtw_vif_port_config(rtwdev, rtwvif, config);
clear_bit(rtwvif->port, rtwdev->hw_port);
+ rtw_release_macid(rtwdev, rtwvif->mac_id);
rtw_recalc_lps(rtwdev, NULL);
mutex_unlock(&rtwdev->mutex);
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -311,17 +311,6 @@ static void rtw_ips_work(struct work_str
mutex_unlock(&rtwdev->mutex);
}
-static u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
-{
- unsigned long mac_id;
-
- mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
- if (mac_id < RTW_MAX_MAC_ID_NUM)
- set_bit(mac_id, rtwdev->mac_id_map);
-
- return mac_id;
-}
-
static void rtw_sta_rc_work(struct work_struct *work)
{
struct rtw_sta_info *si = container_of(work, struct rtw_sta_info,
@@ -340,12 +329,14 @@ int rtw_sta_add(struct rtw_dev *rtwdev,
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
int i;
- si->mac_id = rtw_acquire_macid(rtwdev);
- if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
- return -ENOSPC;
+ if (vif->type == NL80211_IFTYPE_STATION) {
+ si->mac_id = rtwvif->mac_id;
+ } else {
+ si->mac_id = rtw_acquire_macid(rtwdev);
+ if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
+ return -ENOSPC;
+ }
- if (vif->type == NL80211_IFTYPE_STATION && vif->cfg.assoc == 0)
- rtwvif->mac_id = si->mac_id;
si->rtwdev = rtwdev;
si->sta = sta;
si->vif = vif;
@@ -370,11 +361,13 @@ void rtw_sta_remove(struct rtw_dev *rtwd
bool fw_exist)
{
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
+ struct ieee80211_vif *vif = si->vif;
int i;
cancel_work_sync(&si->rc_work);
- rtw_release_macid(rtwdev, si->mac_id);
+ if (vif->type != NL80211_IFTYPE_STATION)
+ rtw_release_macid(rtwdev, si->mac_id);
if (fw_exist)
rtw_fw_media_status_report(rtwdev, si->mac_id, false);
@@ -614,6 +607,8 @@ static void rtw_reset_vif_iter(void *dat
rtw_bf_disassoc(rtwdev, vif, NULL);
rtw_vif_assoc_changed(rtwvif, NULL);
rtw_txq_cleanup(rtwdev, vif->txq);
+
+ rtw_release_macid(rtwdev, rtwvif->mac_id);
}
void rtw_fw_recovery(struct rtw_dev *rtwdev)
@@ -2139,7 +2134,6 @@ int rtw_core_init(struct rtw_dev *rtwdev
rtwdev->sec.total_cam_num = 32;
rtwdev->hal.current_channel = 1;
rtwdev->dm_info.fix_rate = U8_MAX;
- set_bit(RTW_BC_MC_MACID, rtwdev->mac_id_map);
rtw_stats_init(rtwdev);
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -742,7 +742,6 @@ struct rtw_txq {
unsigned long flags;
};
-#define RTW_BC_MC_MACID 1
DECLARE_EWMA(rssi, 10, 16);
struct rtw_sta_info {
@@ -805,7 +804,7 @@ struct rtw_bf_info {
struct rtw_vif {
enum rtw_net_type net_type;
u16 aid;
- u8 mac_id; /* for STA mode only */
+ u8 mac_id;
u8 mac_addr[ETH_ALEN];
u8 bssid[ETH_ALEN];
u8 port;
@@ -2131,6 +2130,17 @@ static inline bool rtw_chip_has_tx_stbc(
return rtwdev->chip->tx_stbc;
}
+static inline u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
+{
+ unsigned long mac_id;
+
+ mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
+ if (mac_id < RTW_MAX_MAC_ID_NUM)
+ set_bit(mac_id, rtwdev->mac_id_map);
+
+ return mac_id;
+}
+
static inline void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id)
{
clear_bit(mac_id, rtwdev->mac_id_map);
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -46,7 +46,8 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_p
le32_encode_bits(pkt_info->ls, RTW_TX_DESC_W0_LS) |
le32_encode_bits(pkt_info->dis_qselseq, RTW_TX_DESC_W0_DISQSELSEQ);
- tx_desc->w1 = le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) |
+ tx_desc->w1 = le32_encode_bits(pkt_info->mac_id, RTW_TX_DESC_W1_MACID) |
+ le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) |
le32_encode_bits(pkt_info->rate_id, RTW_TX_DESC_W1_RATE_ID) |
le32_encode_bits(pkt_info->sec_type, RTW_TX_DESC_W1_SEC_TYPE) |
le32_encode_bits(pkt_info->pkt_offset, RTW_TX_DESC_W1_PKT_OFFSET) |
@@ -401,14 +402,18 @@ void rtw_tx_pkt_info_update(struct rtw_d
const struct rtw_chip_info *chip = rtwdev->chip;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ struct ieee80211_vif *vif = info->control.vif;
struct rtw_sta_info *si;
- struct ieee80211_vif *vif = NULL;
+ struct rtw_vif *rtwvif;
__le16 fc = hdr->frame_control;
bool bmc;
if (sta) {
si = (struct rtw_sta_info *)sta->drv_priv;
- vif = si->vif;
+ pkt_info->mac_id = si->mac_id;
+ } else if (vif) {
+ rtwvif = (struct rtw_vif *)vif->drv_priv;
+ pkt_info->mac_id = rtwvif->mac_id;
}
if (ieee80211_is_mgmt(fc) || ieee80211_is_nullfunc(fc))
--- a/drivers/net/wireless/realtek/rtw88/tx.h
+++ b/drivers/net/wireless/realtek/rtw88/tx.h
@@ -27,6 +27,7 @@ struct rtw_tx_desc {
#define RTW_TX_DESC_W0_BMC BIT(24)
#define RTW_TX_DESC_W0_LS BIT(26)
#define RTW_TX_DESC_W0_DISQSELSEQ BIT(31)
+#define RTW_TX_DESC_W1_MACID GENMASK(7, 0)
#define RTW_TX_DESC_W1_QSEL GENMASK(12, 8)
#define RTW_TX_DESC_W1_RATE_ID GENMASK(20, 16)
#define RTW_TX_DESC_W1_SEC_TYPE GENMASK(23, 22)

View File

@ -0,0 +1,374 @@
From 140403599b74839b0a57c5397b7e8579e5332364 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 18 Sep 2024 01:53:55 +0300
Subject: [PATCH] wifi: rtw88: Constify some arrays and structs
These are never modified, so make them const:
card_enable_flow_8703b
card_disable_flow_8703b
rtw8703b_ops
rtw8723d_ops
card_enable_flow_8723d
card_disable_flow_8723d
trans_carddis_to_cardemu_8821c
trans_cardemu_to_act_8821c
trans_act_to_cardemu_8821c
trans_cardemu_to_carddis_8821c
card_enable_flow_8821c
card_disable_flow_8821c
rtw8821c_dig
page_table_8821c
rqpn_table_8821c
prioq_addrs_8821c
rtw8821c_ops
card_enable_flow_8822b
card_disable_flow_8822b
prioq_addrs_8822b
rtw8822b_ops
rtw8822b_edcca_th
card_enable_flow_8822c
card_disable_flow_8822c
prioq_addrs_8822c
rtw8822c_ops
rtw8822c_edcca_th
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/dae7994f-3491-40de-b537-ebf68df084bb@gmail.com
---
drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
drivers/net/wireless/realtek/rtw88/mac.c | 4 ++--
drivers/net/wireless/realtek/rtw88/main.h | 8 +++----
drivers/net/wireless/realtek/rtw88/phy.c | 2 +-
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 6 ++---
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 6 ++---
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 22 +++++++++----------
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 10 ++++-----
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 10 ++++-----
9 files changed, 35 insertions(+), 35 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -267,7 +267,7 @@ static void rtw_fw_scan_result(struct rt
static void rtw_fw_adaptivity_result(struct rtw_dev *rtwdev, u8 *payload,
u8 length)
{
- struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
+ const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
struct rtw_c2h_adaptivity *result = (struct rtw_c2h_adaptivity *)payload;
rtw_dbg(rtwdev, RTW_DBG_ADAPTIVITY,
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -228,7 +228,7 @@ static int rtw_sub_pwr_seq_parser(struct
}
static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
- const struct rtw_pwr_seq_cmd **cmd_seq)
+ const struct rtw_pwr_seq_cmd * const *cmd_seq)
{
u8 cut_mask;
u8 intf_mask;
@@ -271,7 +271,7 @@ static int rtw_pwr_seq_parser(struct rtw
static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
{
const struct rtw_chip_info *chip = rtwdev->chip;
- const struct rtw_pwr_seq_cmd **pwr_seq;
+ const struct rtw_pwr_seq_cmd * const *pwr_seq;
u32 imr = 0;
u8 rpwm;
bool cur_pwr;
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1167,7 +1167,7 @@ enum rtw_fwcd_item {
/* hardware configuration for each IC */
struct rtw_chip_info {
- struct rtw_chip_ops *ops;
+ const struct rtw_chip_ops *ops;
u8 id;
const char *fw_name;
@@ -1209,8 +1209,8 @@ struct rtw_chip_info {
/* init values */
u8 sys_func_en;
- const struct rtw_pwr_seq_cmd **pwr_on_seq;
- const struct rtw_pwr_seq_cmd **pwr_off_seq;
+ const struct rtw_pwr_seq_cmd * const *pwr_on_seq;
+ const struct rtw_pwr_seq_cmd * const *pwr_off_seq;
const struct rtw_rqpn *rqpn_table;
const struct rtw_prioq_addrs *prioq_addrs;
const struct rtw_page_table *page_table;
@@ -1242,7 +1242,7 @@ struct rtw_chip_info {
u8 bfer_su_max_num;
u8 bfer_mu_max_num;
- struct rtw_hw_reg_offset *edcca_th;
+ const struct rtw_hw_reg_offset *edcca_th;
s8 l2h_th_ini_cs;
s8 l2h_th_ini_ad;
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -123,7 +123,7 @@ static void rtw_phy_cck_pd_init(struct r
void rtw_phy_set_edcca_th(struct rtw_dev *rtwdev, u8 l2h, u8 h2l)
{
- struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
+ const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
rtw_write32_mask(rtwdev,
edcca_th[EDCCA_TH_L2H_IDX].hw_reg.addr,
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -481,14 +481,14 @@ static const struct rtw_pwr_seq_cmd tran
{TRANS_SEQ_END},
};
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8703b[] = {
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8703b[] = {
trans_pre_enable_8703b,
trans_carddis_to_cardemu_8703b,
trans_cardemu_to_act_8703b,
NULL
};
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8703b[] = {
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8703b[] = {
trans_act_to_lps_8703b,
trans_act_to_reset_mcu_8703b,
trans_act_to_cardemu_8703b,
@@ -1941,7 +1941,7 @@ static const struct coex_tdma_para tdma_
{ {0x61, 0x08, 0x03, 0x11, 0x11} },
};
-static struct rtw_chip_ops rtw8703b_ops = {
+static const struct rtw_chip_ops rtw8703b_ops = {
.mac_init = rtw8723x_mac_init,
.dump_fw_crash = NULL,
.shutdown = NULL,
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -1430,7 +1430,7 @@ static void rtw8723d_pwr_track(struct rt
dm_info->pwr_trk_triggered = false;
}
-static struct rtw_chip_ops rtw8723d_ops = {
+static const struct rtw_chip_ops rtw8723d_ops = {
.phy_set_param = rtw8723d_phy_set_param,
.read_efuse = rtw8723x_read_efuse,
.query_rx_desc = rtw8723d_query_rx_desc,
@@ -1788,7 +1788,7 @@ static const struct rtw_pwr_seq_cmd tran
RTW_PWR_CMD_END, 0, 0},
};
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8723d[] = {
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8723d[] = {
trans_carddis_to_cardemu_8723d,
trans_cardemu_to_act_8723d,
NULL
@@ -2004,7 +2004,7 @@ static const struct rtw_pwr_seq_cmd tran
RTW_PWR_CMD_END, 0, 0},
};
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8723d[] = {
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8723d[] = {
trans_act_to_lps_8723d,
trans_act_to_pre_carddis_8723d,
trans_act_to_cardemu_8723d,
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -1254,7 +1254,7 @@ static void rtw8821c_fill_txdesc_checksu
fill_txdesc_checksum_common(txdesc, 16);
}
-static struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821c[] = {
+static const struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821c[] = {
{0x0086,
RTW_PWR_CUT_ALL_MSK,
RTW_PWR_INTF_SDIO_MSK,
@@ -1292,7 +1292,7 @@ static struct rtw_pwr_seq_cmd trans_card
RTW_PWR_CMD_END, 0, 0},
};
-static struct rtw_pwr_seq_cmd trans_cardemu_to_act_8821c[] = {
+static const struct rtw_pwr_seq_cmd trans_cardemu_to_act_8821c[] = {
{0x0020,
RTW_PWR_CUT_ALL_MSK,
RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK,
@@ -1396,7 +1396,7 @@ static struct rtw_pwr_seq_cmd trans_card
RTW_PWR_CMD_END, 0, 0},
};
-static struct rtw_pwr_seq_cmd trans_act_to_cardemu_8821c[] = {
+static const struct rtw_pwr_seq_cmd trans_act_to_cardemu_8821c[] = {
{0x0093,
RTW_PWR_CUT_ALL_MSK,
RTW_PWR_INTF_ALL_MSK,
@@ -1454,7 +1454,7 @@ static struct rtw_pwr_seq_cmd trans_act_
RTW_PWR_CMD_END, 0, 0},
};
-static struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8821c[] = {
+static const struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8821c[] = {
{0x0007,
RTW_PWR_CUT_ALL_MSK,
RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK,
@@ -1567,13 +1567,13 @@ static struct rtw_pwr_seq_cmd trans_card
RTW_PWR_CMD_END, 0, 0},
};
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8821c[] = {
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8821c[] = {
trans_carddis_to_cardemu_8821c,
trans_cardemu_to_act_8821c,
NULL
};
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8821c[] = {
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8821c[] = {
trans_act_to_cardemu_8821c,
trans_cardemu_to_carddis_8821c,
NULL
@@ -1629,7 +1629,7 @@ static const struct rtw_rfe_def rtw8821c
[6] = RTW_DEF_RFE(8821c, 0, 0),
};
-static struct rtw_hw_reg rtw8821c_dig[] = {
+static const struct rtw_hw_reg rtw8821c_dig[] = {
[0] = { .addr = 0xc50, .mask = 0x7f },
};
@@ -1639,7 +1639,7 @@ static const struct rtw_ltecoex_addr rtw
.rdata = LTECOEX_READ_DATA,
};
-static struct rtw_page_table page_table_8821c[] = {
+static const struct rtw_page_table page_table_8821c[] = {
/* not sure what [0] stands for */
{16, 16, 16, 14, 1},
{16, 16, 16, 14, 1},
@@ -1648,7 +1648,7 @@ static struct rtw_page_table page_table_
{16, 16, 16, 14, 1},
};
-static struct rtw_rqpn rqpn_table_8821c[] = {
+static const struct rtw_rqpn rqpn_table_8821c[] = {
/* not sure what [0] stands for */
{RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL,
RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW,
@@ -1667,7 +1667,7 @@ static struct rtw_rqpn rqpn_table_8821c[
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
};
-static struct rtw_prioq_addrs prioq_addrs_8821c = {
+static const struct rtw_prioq_addrs prioq_addrs_8821c = {
.prio[RTW_DMA_MAPPING_EXTRA] = {
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
},
@@ -1683,7 +1683,7 @@ static struct rtw_prioq_addrs prioq_addr
.wsize = true,
};
-static struct rtw_chip_ops rtw8821c_ops = {
+static const struct rtw_chip_ops rtw8821c_ops = {
.phy_set_param = rtw8821c_phy_set_param,
.read_efuse = rtw8821c_read_efuse,
.query_rx_desc = rtw8821c_query_rx_desc,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -1978,13 +1978,13 @@ static const struct rtw_pwr_seq_cmd tran
RTW_PWR_CMD_END, 0, 0},
};
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8822b[] = {
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8822b[] = {
trans_carddis_to_cardemu_8822b,
trans_cardemu_to_act_8822b,
NULL
};
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8822b[] = {
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8822b[] = {
trans_act_to_cardemu_8822b,
trans_cardemu_to_carddis_8822b,
NULL
@@ -2156,7 +2156,7 @@ static const struct rtw_rqpn rqpn_table_
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
};
-static struct rtw_prioq_addrs prioq_addrs_8822b = {
+static const struct rtw_prioq_addrs prioq_addrs_8822b = {
.prio[RTW_DMA_MAPPING_EXTRA] = {
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
},
@@ -2172,7 +2172,7 @@ static struct rtw_prioq_addrs prioq_addr
.wsize = true,
};
-static struct rtw_chip_ops rtw8822b_ops = {
+static const struct rtw_chip_ops rtw8822b_ops = {
.phy_set_param = rtw8822b_phy_set_param,
.read_efuse = rtw8822b_read_efuse,
.query_rx_desc = rtw8822b_query_rx_desc,
@@ -2521,7 +2521,7 @@ static const struct rtw_reg_domain coex_
{0xc50, MASKBYTE0, RTW_REG_DOMAIN_MAC8},
};
-static struct rtw_hw_reg_offset rtw8822b_edcca_th[] = {
+static const struct rtw_hw_reg_offset rtw8822b_edcca_th[] = {
[EDCCA_TH_L2H_IDX] = {{.addr = 0x8a4, .mask = MASKBYTE0}, .offset = 0},
[EDCCA_TH_H2L_IDX] = {{.addr = 0x8a4, .mask = MASKBYTE1}, .offset = 0},
};
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -4874,13 +4874,13 @@ static const struct rtw_pwr_seq_cmd tran
RTW_PWR_CMD_END, 0, 0},
};
-static const struct rtw_pwr_seq_cmd *card_enable_flow_8822c[] = {
+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8822c[] = {
trans_carddis_to_cardemu_8822c,
trans_cardemu_to_act_8822c,
NULL
};
-static const struct rtw_pwr_seq_cmd *card_disable_flow_8822c[] = {
+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8822c[] = {
trans_act_to_cardemu_8822c,
trans_cardemu_to_carddis_8822c,
NULL
@@ -4972,7 +4972,7 @@ static const struct rtw_rqpn rqpn_table_
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
};
-static struct rtw_prioq_addrs prioq_addrs_8822c = {
+static const struct rtw_prioq_addrs prioq_addrs_8822c = {
.prio[RTW_DMA_MAPPING_EXTRA] = {
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
},
@@ -4988,7 +4988,7 @@ static struct rtw_prioq_addrs prioq_addr
.wsize = true,
};
-static struct rtw_chip_ops rtw8822c_ops = {
+static const struct rtw_chip_ops rtw8822c_ops = {
.phy_set_param = rtw8822c_phy_set_param,
.read_efuse = rtw8822c_read_efuse,
.query_rx_desc = rtw8822c_query_rx_desc,
@@ -5301,7 +5301,7 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p,
};
-static struct rtw_hw_reg_offset rtw8822c_edcca_th[] = {
+static const struct rtw_hw_reg_offset rtw8822c_edcca_th[] = {
[EDCCA_TH_L2H_IDX] = {
{.addr = 0x84c, .mask = MASKBYTE2}, .offset = 0x80
},

View File

@ -0,0 +1,560 @@
From bbb6f9be7f99464d5ab7e2f321fa728d33eeec9a Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Fri, 20 Sep 2024 22:27:30 +0300
Subject: [PATCH] wifi: rtw88: Parse the RX descriptor with a single function
rtw8703b_query_rx_desc(), rtw8723d_query_rx_desc(),
rtw8821c_query_rx_desc(), rtw8822b_query_rx_desc(), and
rtw8822c_query_rx_desc() are almost identical, so replace them all with
a single function, rtw_rx_query_rx_desc().
Also, access the RX descriptor using a struct with __le32 members and
le32_get_bits().
Tested with RTL8811CU, RTL8811AU, and RTL8812AU.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Tested-by: Ping-Ke Shih <pkshih@realtek.com> # RTL8723DE and RTL8822CE
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com
---
drivers/net/wireless/realtek/rtw88/main.h | 5 +-
drivers/net/wireless/realtek/rtw88/pci.c | 2 +-
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 56 +--------------
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 43 +-----------
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 43 +-----------
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 43 +-----------
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 44 +-----------
drivers/net/wireless/realtek/rtw88/rx.c | 70 +++++++++++++++++--
drivers/net/wireless/realtek/rtw88/rx.h | 64 ++++++++---------
drivers/net/wireless/realtek/rtw88/sdio.c | 3 +-
drivers/net/wireless/realtek/rtw88/usb.c | 4 +-
11 files changed, 106 insertions(+), 271 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -848,9 +848,8 @@ struct rtw_chip_ops {
void (*phy_set_param)(struct rtw_dev *rtwdev);
void (*set_channel)(struct rtw_dev *rtwdev, u8 channel,
u8 bandwidth, u8 primary_chan_idx);
- void (*query_rx_desc)(struct rtw_dev *rtwdev, u8 *rx_desc,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_rx_status *rx_status);
+ void (*query_phy_status)(struct rtw_dev *rtwdev, u8 *phy_status,
+ struct rtw_rx_pkt_stat *pkt_stat);
u32 (*read_rf)(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
u32 addr, u32 mask);
bool (*write_rf)(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1065,7 +1065,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de
dma_sync_single_for_cpu(rtwdev->dev, dma, RTK_PCI_RX_BUF_SIZE,
DMA_FROM_DEVICE);
rx_desc = skb->data;
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status);
+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status);
/* offset from rx_desc to payload */
pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -29,9 +29,6 @@
#define TBTT_PROHIBIT_HOLD_TIME 0x80
#define TBTT_PROHIBIT_HOLD_TIME_STOP_BCN 0x64
-/* raw pkt_stat->drv_info_sz is in unit of 8-bytes */
-#define RX_DRV_INFO_SZ_UNIT_8703B 8
-
#define TRANS_SEQ_END \
0xFFFF, \
RTW_PWR_CUT_ALL_MSK, \
@@ -1032,57 +1029,6 @@ static void query_phy_status(struct rtw_
query_phy_status_ofdm(rtwdev, phy_status, pkt_stat);
}
-static void rtw8703b_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_rx_status *rx_status)
-{
- struct ieee80211_hdr *hdr;
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
- u8 *phy_status = NULL;
-
- memset(pkt_stat, 0, sizeof(*pkt_stat));
-
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
- pkt_stat->ppdu_cnt = 0;
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
-
- pkt_stat->drv_info_sz *= RX_DRV_INFO_SZ_UNIT_8703B;
-
- if (pkt_stat->is_c2h)
- return;
-
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
- pkt_stat->drv_info_sz);
-
- pkt_stat->bw = GET_RX_DESC_BW(rx_desc);
-
- if (pkt_stat->phy_status) {
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
- query_phy_status(rtwdev, phy_status, pkt_stat);
- }
-
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
-
- /* Rtl8723cs driver checks for size < 14 or size > 8192 and
- * simply drops the packet. Maybe this should go into
- * rtw_rx_fill_rx_status()?
- */
- if (pkt_stat->pkt_len == 0) {
- rx_status->flag |= RX_FLAG_NO_PSDU;
- rtw_dbg(rtwdev, RTW_DBG_RX, "zero length packet");
- }
-}
-
#define ADDA_ON_VAL_8703B 0x03c00014
static
@@ -1948,7 +1894,7 @@ static const struct rtw_chip_ops rtw8703
.read_efuse = rtw8703b_read_efuse,
.phy_set_param = rtw8703b_phy_set_param,
.set_channel = rtw8703b_set_channel,
- .query_rx_desc = rtw8703b_query_rx_desc,
+ .query_phy_status = query_phy_status,
.read_rf = rtw_phy_read_rf_sipi,
.write_rf = rtw_phy_write_rf_reg_sipi,
.set_tx_power_index = rtw8723x_set_tx_power_index,
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -227,47 +227,6 @@ static void query_phy_status(struct rtw_
}
}
-static void rtw8723d_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_rx_status *rx_status)
-{
- struct ieee80211_hdr *hdr;
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
- u8 *phy_status = NULL;
-
- memset(pkt_stat, 0, sizeof(*pkt_stat));
-
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
- pkt_stat->ppdu_cnt = 0;
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
-
- /* drv_info_sz is in unit of 8-bytes */
- pkt_stat->drv_info_sz *= 8;
-
- /* c2h cmd pkt's rx/phy status is not interested */
- if (pkt_stat->is_c2h)
- return;
-
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
- pkt_stat->drv_info_sz);
- if (pkt_stat->phy_status) {
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
- query_phy_status(rtwdev, phy_status, pkt_stat);
- }
-
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
-}
-
static bool rtw8723d_check_spur_ov_thres(struct rtw_dev *rtwdev,
u8 channel, u32 thres)
{
@@ -1433,7 +1392,7 @@ static void rtw8723d_pwr_track(struct rt
static const struct rtw_chip_ops rtw8723d_ops = {
.phy_set_param = rtw8723d_phy_set_param,
.read_efuse = rtw8723x_read_efuse,
- .query_rx_desc = rtw8723d_query_rx_desc,
+ .query_phy_status = query_phy_status,
.set_channel = rtw8723d_set_channel,
.mac_init = rtw8723x_mac_init,
.shutdown = rtw8723d_shutdown,
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -679,47 +679,6 @@ static void query_phy_status(struct rtw_
}
}
-static void rtw8821c_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_rx_status *rx_status)
-{
- struct ieee80211_hdr *hdr;
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
- u8 *phy_status = NULL;
-
- memset(pkt_stat, 0, sizeof(*pkt_stat));
-
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc);
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
-
- /* drv_info_sz is in unit of 8-bytes */
- pkt_stat->drv_info_sz *= 8;
-
- /* c2h cmd pkt's rx/phy status is not interested */
- if (pkt_stat->is_c2h)
- return;
-
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
- pkt_stat->drv_info_sz);
- if (pkt_stat->phy_status) {
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
- query_phy_status(rtwdev, phy_status, pkt_stat);
- }
-
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
-}
-
static void
rtw8821c_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs)
{
@@ -1686,7 +1645,7 @@ static const struct rtw_prioq_addrs prio
static const struct rtw_chip_ops rtw8821c_ops = {
.phy_set_param = rtw8821c_phy_set_param,
.read_efuse = rtw8821c_read_efuse,
- .query_rx_desc = rtw8821c_query_rx_desc,
+ .query_phy_status = query_phy_status,
.set_channel = rtw8821c_set_channel,
.mac_init = rtw8821c_mac_init,
.read_rf = rtw_phy_read_rf,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -934,47 +934,6 @@ static void query_phy_status(struct rtw_
}
}
-static void rtw8822b_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_rx_status *rx_status)
-{
- struct ieee80211_hdr *hdr;
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
- u8 *phy_status = NULL;
-
- memset(pkt_stat, 0, sizeof(*pkt_stat));
-
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc);
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
-
- /* drv_info_sz is in unit of 8-bytes */
- pkt_stat->drv_info_sz *= 8;
-
- /* c2h cmd pkt's rx/phy status is not interested */
- if (pkt_stat->is_c2h)
- return;
-
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
- pkt_stat->drv_info_sz);
- if (pkt_stat->phy_status) {
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
- query_phy_status(rtwdev, phy_status, pkt_stat);
- }
-
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
-}
-
static void
rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs)
{
@@ -2175,7 +2134,7 @@ static const struct rtw_prioq_addrs prio
static const struct rtw_chip_ops rtw8822b_ops = {
.phy_set_param = rtw8822b_phy_set_param,
.read_efuse = rtw8822b_read_efuse,
- .query_rx_desc = rtw8822b_query_rx_desc,
+ .query_phy_status = query_phy_status,
.set_channel = rtw8822b_set_channel,
.mac_init = rtw8822b_mac_init,
.read_rf = rtw_phy_read_rf,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -2690,48 +2690,6 @@ static void query_phy_status(struct rtw_
}
}
-static void rtw8822c_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_rx_status *rx_status)
-{
- struct ieee80211_hdr *hdr;
- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
- u8 *phy_status = NULL;
-
- memset(pkt_stat, 0, sizeof(*pkt_stat));
-
- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc);
- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc);
- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc);
- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) &&
- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE;
- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc);
- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc);
- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc);
- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc);
- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc);
- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc);
- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc);
- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc);
-
- /* drv_info_sz is in unit of 8-bytes */
- pkt_stat->drv_info_sz *= 8;
-
- /* c2h cmd pkt's rx/phy status is not interested */
- if (pkt_stat->is_c2h)
- return;
-
- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift +
- pkt_stat->drv_info_sz);
- pkt_stat->hdr = hdr;
- if (pkt_stat->phy_status) {
- phy_status = rx_desc + desc_sz + pkt_stat->shift;
- query_phy_status(rtwdev, phy_status, pkt_stat);
- }
-
- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status);
-}
-
static void
rtw8822c_set_write_tx_power_ref(struct rtw_dev *rtwdev, u8 *tx_pwr_ref_cck,
u8 *tx_pwr_ref_ofdm)
@@ -4991,7 +4949,7 @@ static const struct rtw_prioq_addrs prio
static const struct rtw_chip_ops rtw8822c_ops = {
.phy_set_param = rtw8822c_phy_set_param,
.read_efuse = rtw8822c_read_efuse,
- .query_rx_desc = rtw8822c_query_rx_desc,
+ .query_phy_status = query_phy_status,
.set_channel = rtw8822c_set_channel,
.mac_init = rtw8822c_mac_init,
.dump_fw_crash = rtw8822c_dump_fw_crash,
--- a/drivers/net/wireless/realtek/rtw88/rx.c
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
@@ -187,11 +187,10 @@ fill_rx_status:
}
EXPORT_SYMBOL(rtw_update_rx_freq_from_ie);
-void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_hdr *hdr,
- struct ieee80211_rx_status *rx_status,
- u8 *phy_status)
+static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
+ struct rtw_rx_pkt_stat *pkt_stat,
+ struct ieee80211_hdr *hdr,
+ struct ieee80211_rx_status *rx_status)
{
struct ieee80211_hw *hw = rtwdev->hw;
u8 path;
@@ -242,5 +241,64 @@ void rtw_rx_fill_rx_status(struct rtw_de
}
rtw_rx_addr_match(rtwdev, pkt_stat, hdr);
+
+ /* Rtl8723cs driver checks for size < 14 or size > 8192 and
+ * simply drops the packet.
+ */
+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8703B && pkt_stat->pkt_len == 0) {
+ rx_status->flag |= RX_FLAG_NO_PSDU;
+ rtw_dbg(rtwdev, RTW_DBG_RX, "zero length packet");
+ }
+}
+
+void rtw_rx_query_rx_desc(struct rtw_dev *rtwdev, void *rx_desc8,
+ struct rtw_rx_pkt_stat *pkt_stat,
+ struct ieee80211_rx_status *rx_status)
+{
+ u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz;
+ struct rtw_rx_desc *rx_desc = rx_desc8;
+ struct ieee80211_hdr *hdr;
+ u32 enc_type, swdec;
+ void *phy_status;
+
+ memset(pkt_stat, 0, sizeof(*pkt_stat));
+
+ pkt_stat->pkt_len = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_PKT_LEN);
+ pkt_stat->crc_err = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_CRC32);
+ pkt_stat->icv_err = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_ICV_ERR);
+ pkt_stat->drv_info_sz = le32_get_bits(rx_desc->w0,
+ RTW_RX_DESC_W0_DRV_INFO_SIZE);
+ enc_type = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_ENC_TYPE);
+ pkt_stat->shift = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_SHIFT);
+ pkt_stat->phy_status = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_PHYST);
+ swdec = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_SWDEC);
+ pkt_stat->decrypted = !swdec && enc_type != RX_DESC_ENC_NONE;
+
+ pkt_stat->cam_id = le32_get_bits(rx_desc->w1, RTW_RX_DESC_W1_MACID);
+
+ pkt_stat->is_c2h = le32_get_bits(rx_desc->w2, RTW_RX_DESC_W2_C2H);
+ pkt_stat->ppdu_cnt = le32_get_bits(rx_desc->w2, RTW_RX_DESC_W2_PPDU_CNT);
+
+ pkt_stat->rate = le32_get_bits(rx_desc->w3, RTW_RX_DESC_W3_RX_RATE);
+
+ pkt_stat->bw = le32_get_bits(rx_desc->w4, RTW_RX_DESC_W4_BW);
+
+ pkt_stat->tsf_low = le32_get_bits(rx_desc->w5, RTW_RX_DESC_W5_TSFL);
+
+ /* drv_info_sz is in unit of 8-bytes */
+ pkt_stat->drv_info_sz *= 8;
+
+ /* c2h cmd pkt's rx/phy status is not interested */
+ if (pkt_stat->is_c2h)
+ return;
+
+ phy_status = rx_desc8 + desc_sz + pkt_stat->shift;
+ hdr = phy_status + pkt_stat->drv_info_sz;
+ pkt_stat->hdr = hdr;
+
+ if (pkt_stat->phy_status)
+ rtwdev->chip->ops->query_phy_status(rtwdev, phy_status, pkt_stat);
+
+ rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status);
}
-EXPORT_SYMBOL(rtw_rx_fill_rx_status);
+EXPORT_SYMBOL(rtw_rx_query_rx_desc);
--- a/drivers/net/wireless/realtek/rtw88/rx.h
+++ b/drivers/net/wireless/realtek/rtw88/rx.h
@@ -14,42 +14,40 @@ enum rtw_rx_desc_enc {
RX_DESC_ENC_WEP104 = 5,
};
-#define GET_RX_DESC_PHYST(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(26))
-#define GET_RX_DESC_ICV_ERR(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(15))
-#define GET_RX_DESC_CRC32(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(14))
-#define GET_RX_DESC_SWDEC(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(27))
-#define GET_RX_DESC_C2H(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x02), BIT(28))
-#define GET_RX_DESC_PKT_LEN(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(13, 0))
-#define GET_RX_DESC_DRV_INFO_SIZE(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(19, 16))
-#define GET_RX_DESC_SHIFT(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(25, 24))
-#define GET_RX_DESC_ENC_TYPE(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(22, 20))
-#define GET_RX_DESC_RX_RATE(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x03), GENMASK(6, 0))
-#define GET_RX_DESC_MACID(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x01), GENMASK(6, 0))
-#define GET_RX_DESC_PPDU_CNT(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x02), GENMASK(30, 29))
-#define GET_RX_DESC_TSFL(rxdesc) \
- le32_get_bits(*((__le32 *)(rxdesc) + 0x05), GENMASK(31, 0))
-#define GET_RX_DESC_BW(rxdesc) \
- (le32_get_bits(*((__le32 *)(rxdesc) + 0x04), GENMASK(5, 4)))
+struct rtw_rx_desc {
+ __le32 w0;
+ __le32 w1;
+ __le32 w2;
+ __le32 w3;
+ __le32 w4;
+ __le32 w5;
+} __packed;
+
+#define RTW_RX_DESC_W0_PKT_LEN GENMASK(13, 0)
+#define RTW_RX_DESC_W0_CRC32 BIT(14)
+#define RTW_RX_DESC_W0_ICV_ERR BIT(15)
+#define RTW_RX_DESC_W0_DRV_INFO_SIZE GENMASK(19, 16)
+#define RTW_RX_DESC_W0_ENC_TYPE GENMASK(22, 20)
+#define RTW_RX_DESC_W0_SHIFT GENMASK(25, 24)
+#define RTW_RX_DESC_W0_PHYST BIT(26)
+#define RTW_RX_DESC_W0_SWDEC BIT(27)
+
+#define RTW_RX_DESC_W1_MACID GENMASK(6, 0)
+
+#define RTW_RX_DESC_W2_C2H BIT(28)
+#define RTW_RX_DESC_W2_PPDU_CNT GENMASK(30, 29)
+
+#define RTW_RX_DESC_W3_RX_RATE GENMASK(6, 0)
+
+#define RTW_RX_DESC_W4_BW GENMASK(5, 4)
+
+#define RTW_RX_DESC_W5_TSFL GENMASK(31, 0)
void rtw_rx_stats(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
struct sk_buff *skb);
-void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
- struct rtw_rx_pkt_stat *pkt_stat,
- struct ieee80211_hdr *hdr,
- struct ieee80211_rx_status *rx_status,
- u8 *phy_status);
+void rtw_rx_query_rx_desc(struct rtw_dev *rtwdev, void *rx_desc8,
+ struct rtw_rx_pkt_stat *pkt_stat,
+ struct ieee80211_rx_status *rx_status);
void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb,
struct ieee80211_rx_status *rx_status,
struct rtw_rx_pkt_stat *pkt_stat);
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -981,8 +981,7 @@ static void rtw_sdio_rxfifo_recv(struct
while (true) {
rx_desc = skb->data;
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
- &rx_status);
+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status);
pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
pkt_stat.shift;
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -570,8 +570,8 @@ static void rtw_usb_rx_handler(struct wo
do {
rx_desc = skb->data;
- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
- &rx_status);
+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat,
+ &rx_status);
pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
pkt_stat.shift;

View File

@ -0,0 +1,70 @@
From 4aefde403da7af30757915e0462d88398c9388c5 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Tue, 8 Oct 2024 21:44:02 +0300
Subject: [PATCH] wifi: rtw88: Fix the RX aggregation in USB 3 mode
RTL8822CU, RTL8822BU, and RTL8821CU don't need BIT_EN_PRE_CALC.
In fact, RTL8822BU in USB 3 mode doesn't pass all the frames to the
driver, resulting in much lower download speed than normal:
$ iperf3 -c 192.168.0.1 -R
Connecting to host 192.168.0.1, port 5201
Reverse mode, remote host 192.168.0.1 is sending
[ 5] local 192.168.0.50 port 43062 connected to 192.168.0.1 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 26.9 MBytes 225 Mbits/sec
[ 5] 1.00-2.00 sec 7.50 MBytes 62.9 Mbits/sec
[ 5] 2.00-3.00 sec 8.50 MBytes 71.3 Mbits/sec
[ 5] 3.00-4.00 sec 8.38 MBytes 70.3 Mbits/sec
[ 5] 4.00-5.00 sec 7.75 MBytes 65.0 Mbits/sec
[ 5] 5.00-6.00 sec 8.00 MBytes 67.1 Mbits/sec
[ 5] 6.00-7.00 sec 8.00 MBytes 67.1 Mbits/sec
[ 5] 7.00-8.00 sec 7.75 MBytes 65.0 Mbits/sec
[ 5] 8.00-9.00 sec 7.88 MBytes 66.1 Mbits/sec
[ 5] 9.00-10.00 sec 7.88 MBytes 66.1 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.02 sec 102 MBytes 85.1 Mbits/sec 224 sender
[ 5] 0.00-10.00 sec 98.6 MBytes 82.7 Mbits/sec receiver
Don't set BIT_EN_PRE_CALC. Then the speed is much better:
% iperf3 -c 192.168.0.1 -R
Connecting to host 192.168.0.1, port 5201
Reverse mode, remote host 192.168.0.1 is sending
[ 5] local 192.168.0.50 port 39000 connected to 192.168.0.1 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 52.8 MBytes 442 Mbits/sec
[ 5] 1.00-2.00 sec 71.9 MBytes 603 Mbits/sec
[ 5] 2.00-3.00 sec 74.8 MBytes 627 Mbits/sec
[ 5] 3.00-4.00 sec 75.9 MBytes 636 Mbits/sec
[ 5] 4.00-5.00 sec 76.0 MBytes 638 Mbits/sec
[ 5] 5.00-6.00 sec 74.1 MBytes 622 Mbits/sec
[ 5] 6.00-7.00 sec 74.0 MBytes 621 Mbits/sec
[ 5] 7.00-8.00 sec 76.0 MBytes 638 Mbits/sec
[ 5] 8.00-9.00 sec 74.4 MBytes 624 Mbits/sec
[ 5] 9.00-10.00 sec 63.9 MBytes 536 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 717 MBytes 601 Mbits/sec 24 sender
[ 5] 0.00-10.00 sec 714 MBytes 599 Mbits/sec receiver
Fixes: 002a5db9a52a ("wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/afb94a82-3d18-459e-97fc-1a217608cdf0@gmail.com
---
drivers/net/wireless/realtek/rtw88/usb.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -771,7 +771,6 @@ static void rtw_usb_dynamic_rx_agg_v1(st
u8 size, timeout;
u16 val16;
- rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC);
rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));

View File

@ -0,0 +1,34 @@
From 7846f0b63562f4db45f712cc7dab091985baf07b Mon Sep 17 00:00:00 2001
From: Mohammed Anees <pvmohammedanees2003@gmail.com>
Date: Thu, 17 Oct 2024 13:36:38 +0530
Subject: [PATCH] wifi: rtw88: Refactor looping in
rtw_phy_store_tx_power_by_rate
The previous implementation included an unnecessary else
condition paired with a continue statement. Since a check
is already performed to determine if the band is either
2G or 5G, the else condition will never be triggered.
We can remove this check.
Signed-off-by: Mohammed Anees <pvmohammedanees2003@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20241017080638.13074-1-pvmohammedanees2003@gmail.com
---
drivers/net/wireless/realtek/rtw88/phy.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -1470,10 +1470,8 @@ static void rtw_phy_store_tx_power_by_ra
rate = rates[i];
if (band == PHY_BAND_2G)
hal->tx_pwr_by_rate_offset_2g[rfpath][rate] = offset;
- else if (band == PHY_BAND_5G)
- hal->tx_pwr_by_rate_offset_5g[rfpath][rate] = offset;
else
- continue;
+ hal->tx_pwr_by_rate_offset_5g[rfpath][rate] = offset;
}
}

View File

@ -0,0 +1,39 @@
From 47f754b3f838205f3b25c4839f74801d180995bf Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Tue, 22 Oct 2024 20:20:26 +0300
Subject: [PATCH] wifi: rtw88: Report the signal strength only if it's known
RTL8811CU doesn't report the signal strength for many (any?) data
frames. When the signal strength is not known, set
RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal
strength of 0.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/f7e1e448-2c9b-498f-b8b1-a14dd967d7d3@gmail.com
---
drivers/net/wireless/realtek/rtw88/rx.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/rx.c
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
@@ -234,10 +234,14 @@ static void rtw_rx_fill_rx_status(struct
else
rx_status->bw = RATE_INFO_BW_20;
- rx_status->signal = pkt_stat->signal_power;
- for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
- rx_status->chains |= BIT(path);
- rx_status->chain_signal[path] = pkt_stat->rx_power[path];
+ if (pkt_stat->phy_status) {
+ rx_status->signal = pkt_stat->signal_power;
+ for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
+ rx_status->chains |= BIT(path);
+ rx_status->chain_signal[path] = pkt_stat->rx_power[path];
+ }
+ } else {
+ rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
}
rtw_rx_addr_match(rtwdev, pkt_stat, hdr);

View File

@ -0,0 +1,490 @@
From d12722830ea4f562e91586927ec21b64d0369544 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:00:59 +0300
Subject: [PATCH] wifi: rtw88: Add some definitions for RTL8821AU/RTL8812AU
Add 8821A and 8812A chip type enums.
Add cck_high_power member to struct rtw_hal. This will be used to
calculate the RX signal strength of RTL8812AU.
Add various register definitions which will be used by the new drivers.
Move some existing register definitions from rtw8821c.h and rtw8822b.h.
They were duplicated in those headers and will also be used by the new
drivers.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/9279a9cd-6f86-4dc3-a095-7c36cb9b9d06@gmail.com
---
drivers/net/wireless/realtek/rtw88/main.h | 3 +
drivers/net/wireless/realtek/rtw88/reg.h | 174 ++++++++++++++++++
drivers/net/wireless/realtek/rtw88/rtw8821c.h | 24 ---
drivers/net/wireless/realtek/rtw88/rtw8822b.h | 12 --
4 files changed, 177 insertions(+), 36 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -189,6 +189,8 @@ enum rtw_chip_type {
RTW_CHIP_TYPE_8723D,
RTW_CHIP_TYPE_8821C,
RTW_CHIP_TYPE_8703B,
+ RTW_CHIP_TYPE_8821A,
+ RTW_CHIP_TYPE_8812A,
};
enum rtw_tx_queue_type {
@@ -1934,6 +1936,7 @@ struct rtw_hal {
u32 antenna_rx;
u8 bfee_sts_cap;
bool txrx_1ss;
+ bool cck_high_power;
/* protect tx power section */
struct mutex tx_power_mutex;
--- a/drivers/net/wireless/realtek/rtw88/reg.h
+++ b/drivers/net/wireless/realtek/rtw88/reg.h
@@ -9,6 +9,7 @@
#define BIT_FEN_EN_25_1 BIT(13)
#define BIT_FEN_ELDR BIT(12)
#define BIT_FEN_CPUEN BIT(2)
+#define BIT_FEN_USBA BIT(2)
#define BIT_FEN_BB_GLB_RST BIT(1)
#define BIT_FEN_BB_RSTB BIT(0)
#define BIT_R_DIS_PRST BIT(6)
@@ -16,6 +17,10 @@
#define REG_SYS_PW_CTRL 0x0004
#define BIT_PFM_WOWL BIT(3)
#define BIT_APFM_OFFMAC BIT(9)
+#define REG_APS_FSMCO 0x0004
+#define APS_FSMCO_MAC_ENABLE BIT(8)
+#define APS_FSMCO_MAC_OFF BIT(9)
+#define APS_FSMCO_HW_POWERDOWN BIT(15)
#define REG_SYS_CLK_CTRL 0x0008
#define BIT_CPU_CLK_EN BIT(14)
@@ -58,6 +63,8 @@
#define BIT_SHIFT_LDO25_VOLTAGE 4
#define BIT_LDO25_EN BIT(7)
+#define REG_ACLK_MON 0x3e
+
#define REG_GPIO_MUXCFG 0x0040
#define BIT_FSPI_EN BIT(19)
#define BIT_EN_SIC BIT(12)
@@ -90,6 +97,8 @@
#define BIT_USB_SUS_DIS BIT(8)
#define BIT_SDIO_PAD_E5 BIT(18)
+#define REG_RF_B_CTRL 0x76
+
#define REG_AFE_CTRL_4 0x0078
#define BIT_CK320M_AFE_EN BIT(4)
#define BIT_EN_SYN BIT(15)
@@ -134,6 +143,11 @@
#define REG_PMC_DBG_CTRL1 0xa8
#define BITS_PMC_BT_IQK_STS GENMASK(22, 21)
+#define REG_HIMR0 0xb0
+#define REG_HISR0 0xb4
+#define REG_HIMR1 0xb8
+#define REG_HISR1 0xbc
+
#define REG_PAD_CTRL2 0x00C4
#define BIT_RSM_EN_V1 BIT(16)
#define BIT_NO_PDN_CHIPOFF_V1 BIT(17)
@@ -185,6 +199,15 @@
#define MAC_TRX_ENABLE (BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | \
BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | \
BIT_MACTXEN | BIT_MACRXEN)
+#define REG_PBP 0x104
+#define PBP_RX_MASK 0x0f
+#define PBP_TX_MASK 0xf0
+#define PBP_64 0x0
+#define PBP_128 0x1
+#define PBP_256 0x2
+#define PBP_512 0x3
+#define PBP_1024 0x4
+
#define BIT_SHIFT_TXDMA_VOQ_MAP 4
#define BIT_MASK_TXDMA_VOQ_MAP 0x3
#define BIT_TXDMA_VOQ_MAP(x) \
@@ -256,6 +279,8 @@
#define REG_HMEBOX1 0x01D4
#define REG_HMEBOX2 0x01D8
#define REG_HMEBOX3 0x01DC
+#define REG_LLT_INIT 0x01E0
+#define BIT_LLT_WRITE_ACCESS BIT(30)
#define REG_HMEBOX0_EX 0x01F0
#define REG_HMEBOX1_EX 0x01F4
#define REG_HMEBOX2_EX 0x01F8
@@ -298,6 +323,7 @@
#define REG_AUTO_LLT 0x0224
#define BIT_AUTO_INIT_LLT BIT(16)
+#define REG_DWBCN1_CTRL 0x0228
#define REG_RQPN_CTRL_1 0x0228
#define REG_RQPN_CTRL_2 0x022C
#define BIT_LD_RQPN BIT(31)
@@ -329,6 +355,7 @@
#define BIT_DMA_BURST_SIZE_1024 0
#define REG_RXPKTNUM 0x02B0
+#define REG_EARLY_MODE_CONTROL 0x02BC
#define REG_INT_MIG 0x0304
#define REG_HCI_MIX_CFG 0x03FC
@@ -336,6 +363,7 @@
#define REG_BCNQ_INFO 0x0418
#define BIT_MGQ_CPU_EMPTY BIT(24)
+#define REG_TXPKT_EMPTY 0x041A
#define REG_FWHW_TXQ_CTRL 0x0420
#define BIT_EN_BCNQ_DL BIT(22)
#define BIT_EN_WR_FREE_TAIL BIT(20)
@@ -362,10 +390,12 @@
#define REG_AMPDU_MAX_TIME_V1 0x0455
#define REG_BCNQ1_BDNY_V1 0x0456
#define REG_AMPDU_MAX_TIME 0x0456
+#define REG_AMPDU_MAX_LENGTH 0x0458
#define REG_WMAC_LBK_BF_HD 0x045D
#define REG_TX_HANG_CTRL 0x045E
#define BIT_EN_GNT_BT_AWAKE BIT(3)
#define BIT_EN_EOF_V1 BIT(2)
+#define REG_FAST_EDCA_CTRL 0x0460
#define REG_DATA_SC 0x0483
#define REG_ARFR2_V1 0x048C
#define REG_ARFRH2_V1 0x0490
@@ -390,6 +420,8 @@
#define REG_PRECNT_CTRL 0x04E5
#define BIT_BTCCA_CTRL (BIT(0) | BIT(1))
#define BIT_EN_PRECNT BIT(11)
+#define REG_TX_RPT_CTRL 0x04EC
+#define REG_TX_RPT_TIME 0x04F0
#define REG_DUMMY_PAGE4_V1 0x04FC
#define REG_EDCA_VO_PARAM 0x0500
@@ -400,6 +432,7 @@
#define BIT_MASK_CWMAX GENMASK(15, 12)
#define BIT_MASK_CWMIN GENMASK(11, 8)
#define BIT_MASK_AIFS GENMASK(7, 0)
+#define REG_BCNTCFG 0x0510
#define REG_PIFS 0x0512
#define REG_SIFS 0x0514
#define BIT_SHIFT_SIFS_OFDM_CTX 8
@@ -526,6 +559,8 @@
#define REG_BT_COEX_V2 0x0762
#define BIT_GNT_BT_POLARITY BIT(12)
#define BIT_LTE_COEX_EN BIT(7)
+#define REG_GNT_BT 0x0765
+#define BIT_PTA_SW_CTL GENMASK(4, 3)
#define REG_BT_COEX_ENH_INTR_CTRL 0x76E
#define BIT_R_GRANTALL_WLMASK BIT(3)
#define BIT_STATIS_BT_EN BIT(2)
@@ -543,14 +578,43 @@
#define REG_FPGA0_RFMOD 0x0800
#define BIT_CCKEN BIT(24)
#define BIT_OFDMEN BIT(25)
+#define REG_CCK_RPT_FORMAT 0x0804
+#define BIT_CCK_RPT_FORMAT BIT(16)
+#define REG_RXPSEL 0x0808
+#define BIT_RX_PSEL_RST (BIT(28) | BIT(29))
+#define REG_TXPSEL 0x080C
#define REG_RX_GAIN_EN 0x081c
+#define REG_CCASEL 0x082C
+#define REG_PDMFTH 0x0830
+#define REG_BWINDICATION 0x0834
+#define REG_CCA2ND 0x0838
+#define REG_L1PKTH 0x0848
+#define REG_CLKTRK 0x0860
+#define REG_ADCCLK 0x08AC
+#define REG_HSSI_READ 0x08B0
+#define REG_FPGA0_XCD_RF_PARA 0x08B4
+#define REG_RX_MCS_LIMIT 0x08BC
+#define REG_ADC160 0x08C4
+#define REG_ANTSEL_SW 0x0900
+#define REG_DAC_RSTB 0x090c
+#define REG_SINGLE_TONE_CONT_TX 0x0914
#define REG_RFE_CTRL_E 0x0974
#define REG_2ND_CCA_CTRL 0x0976
+#define REG_IQK_COM00 0x0978
+#define REG_IQK_COM32 0x097c
+#define REG_IQK_COM64 0x0980
+#define REG_IQK_COM96 0x0984
+
+#define REG_FAS 0x09a4
+#define REG_RXSB 0x0a00
+#define REG_CCK_RX 0x0a04
+#define REG_CCK_PD_TH 0x0a0a
#define REG_CCK0_FAREPORT 0xa2c
#define BIT_CCK0_2RX BIT(18)
#define BIT_CCK0_MRC BIT(22)
+#define REG_FA_CCK 0x0a5c
#define REG_DIS_DPD 0x0a70
#define DIS_DPD_MASK GENMASK(9, 0)
@@ -566,13 +630,109 @@
#define DIS_DPD_RATEVHT2SS_MCS1 BIT(9)
#define DIS_DPD_RATEALL GENMASK(9, 0)
+#define REG_CNTRST 0x0b58
+
+#define REG_3WIRE_SWA 0x0c00
+#define REG_RX_IQC_AB_A 0x0c10
+#define REG_TXSCALE_A 0x0c1c
+#define BB_SWING_MASK GENMASK(31, 21)
+#define REG_TX_AGC_A_CCK_11_CCK_1 0xc20
+#define REG_TX_AGC_A_OFDM18_OFDM6 0xc24
+#define REG_TX_AGC_A_OFDM54_OFDM24 0xc28
+#define REG_TX_AGC_A_MCS3_MCS0 0xc2c
+#define REG_TX_AGC_A_MCS7_MCS4 0xc30
+#define REG_TX_AGC_A_MCS11_MCS8 0xc34
+#define REG_TX_AGC_A_MCS15_MCS12 0xc38
+#define REG_TX_AGC_A_NSS1_INDEX3_NSS1_INDEX0 0xc3c
+#define REG_TX_AGC_A_NSS1_INDEX7_NSS1_INDEX4 0xc40
+#define REG_TX_AGC_A_NSS2_INDEX1_NSS1_INDEX8 0xc44
+#define REG_TX_AGC_A_NSS2_INDEX5_NSS2_INDEX2 0xc48
+#define REG_TX_AGC_A_NSS2_INDEX9_NSS2_INDEX6 0xc4c
+#define REG_RXIGI_A 0x0c50
+#define REG_TX_PWR_TRAINING_A 0x0c54
+#define REG_CK_MONHA 0x0c5c
+#define REG_AFE_PWR1_A 0x0c60
+#define REG_AFE_PWR2_A 0x0c64
+#define REG_RX_WAIT_CCA_TX_CCK_RFON_A 0x0c68
+#define REG_OFDM0_XA_TX_IQ_IMBALANCE 0x0c80
+#define REG_OFDM0_A_TX_AFE 0x0c84
+#define REG_OFDM0_XB_TX_IQ_IMBALANCE 0x0c88
+#define REG_TSSI_TRK_SW 0x0c8c
+#define REG_LSSI_WRITE_A 0x0c90
+#define REG_PREDISTA 0x0c90
+#define REG_TXAGCIDX 0x0c94
+
+#define REG_RFE_PINMUX_A 0x0cb0
+#define REG_RFE_INV_A 0x0cb4
#define REG_RFE_CTRL8 0x0cb4
#define BIT_MASK_RFE_SEL89 GENMASK(7, 0)
+#define PTA_CTRL_PIN 0x66
+#define DPDT_CTRL_PIN 0x77
+#define RFE_INV_MASK 0x3ff00000
+#define REG_RFECTL_A 0x0cb8
#define REG_RFE_INV8 0x0cbd
#define BIT_MASK_RFE_INV89 GENMASK(1, 0)
#define REG_RFE_INV16 0x0cbe
#define BIT_RFE_BUF_EN BIT(3)
+#define REG_IQK_DPD_CFG 0x0cc4
+#define REG_CFG_PMPD 0x0cc8
+#define REG_IQC_Y 0x0ccc
+#define REG_IQC_X 0x0cd4
+#define REG_INTPO_SETA 0x0ce8
+
+#define REG_IQKA_END 0x0d00
+#define REG_PI_READ_A 0x0d04
+#define REG_SI_READ_A 0x0d08
+#define REG_IQKB_END 0x0d40
+#define REG_PI_READ_B 0x0d44
+#define REG_SI_READ_B 0x0d48
+
+#define REG_3WIRE_SWB 0x0e00
+#define REG_RX_IQC_AB_B 0x0e10
+#define REG_TXSCALE_B 0x0e1c
+#define REG_TX_AGC_B_CCK_11_CCK_1 0xe20
+#define REG_TX_AGC_B_OFDM18_OFDM6 0xe24
+#define REG_TX_AGC_B_OFDM54_OFDM24 0xe28
+#define REG_TX_AGC_B_MCS3_MCS0 0xe2c
+#define REG_TX_AGC_B_MCS7_MCS4 0xe30
+#define REG_TX_AGC_B_MCS11_MCS8 0xe34
+#define REG_TX_AGC_B_MCS15_MCS12 0xe38
+#define REG_TX_AGC_B_NSS1_INDEX3_NSS1_INDEX0 0xe3c
+#define REG_TX_AGC_B_NSS1_INDEX7_NSS1_INDEX4 0xe40
+#define REG_TX_AGC_B_NSS2_INDEX1_NSS1_INDEX8 0xe44
+#define REG_TX_AGC_B_NSS2_INDEX5_NSS2_INDEX2 0xe48
+#define REG_TX_AGC_B_NSS2_INDEX9_NSS2_INDEX6 0xe4c
+#define REG_RXIGI_B 0x0e50
+#define REG_TX_PWR_TRAINING_B 0x0e54
+#define REG_CK_MONHB 0x0e5c
+#define REG_AFE_PWR1_B 0x0e60
+#define REG_AFE_PWR2_B 0x0e64
+#define REG_RX_WAIT_CCA_TX_CCK_RFON_B 0x0e68
+#define REG_TXTONEB 0x0e80
+#define REG_RXTONEB 0x0e84
+#define REG_TXPITMB 0x0e88
+#define REG_RXPITMB 0x0e8c
+#define REG_LSSI_WRITE_B 0x0e90
+#define REG_PREDISTB 0x0e90
+#define REG_INIDLYB 0x0e94
+#define REG_RFE_PINMUX_B 0x0eb0
+#define REG_RFE_INV_B 0x0eb4
+#define REG_RFECTL_B 0x0eb8
+#define REG_BPBDB 0x0ec4
+#define REG_PHYTXONB 0x0ec8
+#define REG_IQKYB 0x0ecc
+#define REG_IQKXB 0x0ed4
+#define REG_INTPO_SETB 0x0ee8
+
+#define REG_CRC_CCK 0x0f04
+#define REG_CCA_OFDM 0x0f08
+#define REG_CRC_VHT 0x0f0c
+#define REG_CRC_HT 0x0f10
+#define REG_CRC_OFDM 0x0f14
+#define REG_FA_OFDM 0x0f48
+#define REG_CCA_CCK 0x0fcc
+
#define REG_ANAPARSW_MAC_0 0x1010
#define BIT_CF_L_V2 GENMASK(29, 28)
@@ -709,6 +869,10 @@
#define REG_IGN_GNTBT4 0x4160
+#define REG_USB_MOD 0xf008
+#define REG_USB3_RXITV 0xf050
+#define REG_USB_HRPWM 0xfe58
+
#define RF_MODE 0x00
#define RF_MODOPT 0x01
#define RF_WLINT 0x01
@@ -716,7 +880,13 @@
#define RF_DTXLOK 0x08
#define RF_CFGCH 0x18
#define BIT_BAND GENMASK(18, 16)
+#define RF18_BAND_MASK (BIT(16) | BIT(9) | BIT(8))
+#define RF18_CHANNEL_MASK (MASKBYTE0)
+#define RF18_RFSI_MASK (BIT(18) | BIT(17))
#define RF_RCK 0x1d
+#define RF_MODE_TABLE_ADDR 0x30
+#define RF_MODE_TABLE_DATA0 0x31
+#define RF_MODE_TABLE_DATA1 0x32
#define RF_LUTWA 0x33
#define RF_LUTWD1 0x3e
#define RF_LUTWD0 0x3f
@@ -725,10 +895,14 @@
#define RF_T_METER 0x42
#define RF_BSPAD 0x54
#define RF_GAINTX 0x56
+#define RF_TXMOD 0x58
#define RF_TXATANK 0x64
+#define RF_TXA_PREPAD 0x65
#define RF_TRXIQ 0x66
#define RF_RXIQGEN 0x8d
+#define RF_RXBB2 0x8f
#define RF_SYN_PFD 0xb0
+#define RF_LCK 0xb4
#define RF_XTALX2 0xb8
#define RF_SYN_CTRL 0xbb
#define RF_MALSEL 0xbe
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.h
@@ -214,19 +214,10 @@ extern const struct rtw_chip_info rtw882
#define BIT_FEN_EN BIT(26)
#define REG_INIRTS_RATE_SEL 0x0480
#define REG_HTSTFWT 0x800
-#define REG_RXPSEL 0x808
-#define BIT_RX_PSEL_RST (BIT(28) | BIT(29))
-#define REG_TXPSEL 0x80c
#define REG_RXCCAMSK 0x814
-#define REG_CCASEL 0x82c
-#define REG_PDMFTH 0x830
-#define REG_CCA2ND 0x838
#define REG_L1WT 0x83c
#define REG_L1PKWT 0x840
#define REG_MRC 0x850
-#define REG_CLKTRK 0x860
-#define REG_ADCCLK 0x8ac
-#define REG_ADC160 0x8c4
#define REG_ADC40 0x8c8
#define REG_CHFIR 0x8f0
#define REG_CDDTXP 0x93c
@@ -234,14 +225,11 @@ extern const struct rtw_chip_info rtw882
#define REG_ACBB0 0x948
#define REG_ACBBRXFIR 0x94c
#define REG_ACGG2TBL 0x958
-#define REG_FAS 0x9a4
-#define REG_RXSB 0xa00
#define REG_ADCINI 0xa04
#define REG_PWRTH 0xa08
#define REG_CCA_FLTR 0xa20
#define REG_TXSF2 0xa24
#define REG_TXSF6 0xa28
-#define REG_FA_CCK 0xa5c
#define REG_RXDESC 0xa2c
#define REG_ENTXCCK 0xa80
#define BTG_LNA 0xfc84
@@ -252,12 +240,8 @@ extern const struct rtw_chip_info rtw882
#define REG_PWRTH2 0xaa8
#define REG_CSRATIO 0xaaa
#define REG_TXFILTER 0xaac
-#define REG_CNTRST 0xb58
#define REG_AGCTR_A 0xc08
-#define REG_TXSCALE_A 0xc1c
#define REG_TXDFIR 0xc20
-#define REG_RXIGI_A 0xc50
-#define REG_TXAGCIDX 0xc94
#define REG_TRSW 0xca0
#define REG_RFESEL0 0xcb0
#define REG_RFESEL8 0xcb4
@@ -269,14 +253,6 @@ extern const struct rtw_chip_info rtw882
#define B_WLA_SWITCH BIT(23)
#define REG_RFEINV 0xcbc
#define REG_AGCTR_B 0xe08
-#define REG_RXIGI_B 0xe50
-#define REG_CRC_CCK 0xf04
-#define REG_CRC_OFDM 0xf14
-#define REG_CRC_HT 0xf10
-#define REG_CRC_VHT 0xf0c
-#define REG_CCA_OFDM 0xf08
-#define REG_FA_OFDM 0xf48
-#define REG_CCA_CCK 0xfcc
#define REG_DMEM_CTRL 0x1080
#define BIT_WL_RST BIT(16)
#define REG_ANTWT 0x1904
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
@@ -151,21 +151,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
#define RTW8822B_EDCCA_MAX 0x7f
#define RTW8822B_EDCCA_SRC_DEF 1
#define REG_HTSTFWT 0x800
-#define REG_RXPSEL 0x808
-#define BIT_RX_PSEL_RST (BIT(28) | BIT(29))
-#define REG_TXPSEL 0x80c
#define REG_RXCCAMSK 0x814
-#define REG_CCASEL 0x82c
-#define REG_PDMFTH 0x830
-#define REG_CCA2ND 0x838
#define REG_L1WT 0x83c
#define REG_L1PKWT 0x840
#define REG_MRC 0x850
-#define REG_CLKTRK 0x860
#define REG_EDCCA_POW_MA 0x8a0
#define BIT_MA_LEVEL GENMASK(1, 0)
-#define REG_ADCCLK 0x8ac
-#define REG_ADC160 0x8c4
#define REG_ADC40 0x8c8
#define REG_EDCCA_DECISION 0x8dc
#define BIT_EDCCA_OPTION BIT(5)
@@ -176,7 +167,6 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
#define REG_ACBB0 0x948
#define REG_ACBBRXFIR 0x94c
#define REG_ACGG2TBL 0x958
-#define REG_RXSB 0xa00
#define REG_ADCINI 0xa04
#define REG_TXSF2 0xa24
#define REG_TXSF6 0xa28
@@ -184,14 +174,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
#define REG_ENTXCCK 0xa80
#define REG_AGCTR_A 0xc08
#define REG_TXDFIR 0xc20
-#define REG_RXIGI_A 0xc50
#define REG_TRSW 0xca0
#define REG_RFESEL0 0xcb0
#define REG_RFESEL8 0xcb4
#define REG_RFECTL 0xcb8
#define REG_RFEINV 0xcbc
#define REG_AGCTR_B 0xe08
-#define REG_RXIGI_B 0xe50
#define REG_ANTWT 0x1904
#define REG_IQKFAILMSK 0x1bf0

View File

@ -0,0 +1,93 @@
From 87341ca1eac9a3bac23bd41f6e24f3c93b77452f Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:02:05 +0300
Subject: [PATCH] wifi: rtw88: Dump the HW features only for some chips
RTL8821AU and RTL8812AU don't support this. They hit the "failed to read
hw feature report" error.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/8becd851-8760-4480-8e8c-c4869ce72507@gmail.com
---
drivers/net/wireless/realtek/rtw88/main.c | 3 +++
drivers/net/wireless/realtek/rtw88/main.h | 1 +
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
7 files changed, 9 insertions(+)
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1917,6 +1917,9 @@ static int rtw_dump_hw_feature(struct rt
u8 bw;
int i;
+ if (!rtwdev->chip->hw_feature_report)
+ return 0;
+
id = rtw_read8(rtwdev, REG_C2HEVT);
if (id != C2H_HW_FEATURE_REPORT) {
rtw_err(rtwdev, "failed to read hw feature report\n");
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1200,6 +1200,7 @@ struct rtw_chip_info {
const struct rtw_fwcd_segs *fwcd_segs;
u8 usb_tx_agg_desc_num;
+ bool hw_feature_report;
u8 default_1ss_tx_path;
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -1960,6 +1960,7 @@ const struct rtw_chip_info rtw8703b_hw_s
.max_power_index = 0x3f,
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
.usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */
+ .hw_feature_report = true,
.path_div_supported = false,
.ht_supported = true,
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -2131,6 +2131,7 @@ const struct rtw_chip_info rtw8723d_hw_s
.page_size = TX_PAGE_SIZE,
.dig_min = 0x20,
.usb_tx_agg_desc_num = 1,
+ .hw_feature_report = true,
.ht_supported = true,
.vht_supported = false,
.lps_deep_mode_supported = 0,
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -1968,6 +1968,7 @@ const struct rtw_chip_info rtw8821c_hw_s
.page_size = TX_PAGE_SIZE,
.dig_min = 0x1c,
.usb_tx_agg_desc_num = 3,
+ .hw_feature_report = true,
.ht_supported = true,
.vht_supported = true,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -2509,6 +2509,7 @@ const struct rtw_chip_info rtw8822b_hw_s
.page_size = TX_PAGE_SIZE,
.dig_min = 0x1c,
.usb_tx_agg_desc_num = 3,
+ .hw_feature_report = true,
.ht_supported = true,
.vht_supported = true,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -5329,6 +5329,7 @@ const struct rtw_chip_info rtw8822c_hw_s
.page_size = TX_PAGE_SIZE,
.dig_min = 0x20,
.usb_tx_agg_desc_num = 3,
+ .hw_feature_report = true,
.default_1ss_tx_path = BB_PATH_A,
.path_div_supported = true,
.ht_supported = true,

View File

@ -0,0 +1,175 @@
From d9018f4373517d4560ce2ebf12684f77f5fbdad6 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:06:14 +0300
Subject: [PATCH] wifi: rtw88: Allow different C2H RA report sizes
The RTL8821AU and RTL8812AU have smaller RA report size, only 4 bytes.
Avoid the "invalid ra report c2h length" error.
Also, use a struct and u8_get_bits() to access the RA report C2H.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/c3e73c3a-fb2f-4013-9f06-d5274211e282@gmail.com
---
drivers/net/wireless/realtek/rtw88/fw.c | 21 +++++++++++++------
drivers/net/wireless/realtek/rtw88/fw.h | 17 +++++++++++----
drivers/net/wireless/realtek/rtw88/main.h | 1 +
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
8 files changed, 34 insertions(+), 10 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -139,25 +139,30 @@ static u16 get_max_amsdu_len(u32 bit_rat
struct rtw_fw_iter_ra_data {
struct rtw_dev *rtwdev;
u8 *payload;
+ u8 length;
};
static void rtw_fw_ra_report_iter(void *data, struct ieee80211_sta *sta)
{
struct rtw_fw_iter_ra_data *ra_data = data;
+ struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)ra_data->payload;
struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
u8 mac_id, rate, sgi, bw;
u8 mcs, nss;
u32 bit_rate;
- mac_id = GET_RA_REPORT_MACID(ra_data->payload);
+ mac_id = ra_rpt->mac_id;
if (si->mac_id != mac_id)
return;
si->ra_report.txrate.flags = 0;
- rate = GET_RA_REPORT_RATE(ra_data->payload);
- sgi = GET_RA_REPORT_SGI(ra_data->payload);
- bw = GET_RA_REPORT_BW(ra_data->payload);
+ rate = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_RATE);
+ sgi = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_SGI);
+ if (ra_data->length >= offsetofend(typeof(*ra_rpt), bw))
+ bw = ra_rpt->bw;
+ else
+ bw = si->bw_mode;
if (rate < DESC_RATEMCS0) {
si->ra_report.txrate.legacy = rtw_desc_to_bitrate(rate);
@@ -197,14 +202,18 @@ legacy:
static void rtw_fw_ra_report_handle(struct rtw_dev *rtwdev, u8 *payload,
u8 length)
{
+ struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)payload;
struct rtw_fw_iter_ra_data ra_data;
- if (WARN(length < 7, "invalid ra report c2h length\n"))
+ if (WARN(length < rtwdev->chip->c2h_ra_report_size,
+ "invalid ra report c2h length %d\n", length))
return;
- rtwdev->dm_info.tx_rate = GET_RA_REPORT_RATE(payload);
+ rtwdev->dm_info.tx_rate = u8_get_bits(ra_rpt->rate_sgi,
+ RTW_C2H_RA_RPT_RATE);
ra_data.rtwdev = rtwdev;
ra_data.payload = payload;
+ ra_data.length = length;
rtw_iterate_stas_atomic(rtwdev, rtw_fw_ra_report_iter, &ra_data);
}
--- a/drivers/net/wireless/realtek/rtw88/fw.h
+++ b/drivers/net/wireless/realtek/rtw88/fw.h
@@ -85,6 +85,19 @@ struct rtw_c2h_adaptivity {
u8 option;
} __packed;
+struct rtw_c2h_ra_rpt {
+ u8 rate_sgi;
+ u8 mac_id;
+ u8 byte2;
+ u8 status;
+ u8 byte4;
+ u8 ra_ratio;
+ u8 bw;
+} __packed;
+
+#define RTW_C2H_RA_RPT_RATE GENMASK(6, 0)
+#define RTW_C2H_RA_RPT_SGI BIT(7)
+
struct rtw_h2c_register {
u32 w0;
u32 w1;
@@ -364,10 +377,6 @@ struct rtw_fw_hdr_legacy {
#define GET_CHAN_SWITCH_CENTRAL_CH(c2h_payload) (c2h_payload[2])
#define GET_CHAN_SWITCH_ID(c2h_payload) (c2h_payload[3])
#define GET_CHAN_SWITCH_STATUS(c2h_payload) (c2h_payload[4])
-#define GET_RA_REPORT_RATE(c2h_payload) (c2h_payload[0] & 0x7f)
-#define GET_RA_REPORT_SGI(c2h_payload) ((c2h_payload[0] & 0x80) >> 7)
-#define GET_RA_REPORT_BW(c2h_payload) (c2h_payload[6])
-#define GET_RA_REPORT_MACID(c2h_payload) (c2h_payload[1])
#define GET_BCN_FILTER_NOTIFY_TYPE(c2h_payload) (c2h_payload[1] & 0xf)
#define GET_BCN_FILTER_NOTIFY_EVENT(c2h_payload) (c2h_payload[1] & 0x10)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1201,6 +1201,7 @@ struct rtw_chip_info {
u8 usb_tx_agg_desc_num;
bool hw_feature_report;
+ u8 c2h_ra_report_size;
u8 default_1ss_tx_path;
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -1961,6 +1961,7 @@ const struct rtw_chip_info rtw8703b_hw_s
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
.usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */
.hw_feature_report = true,
+ .c2h_ra_report_size = 7,
.path_div_supported = false,
.ht_supported = true,
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -2132,6 +2132,7 @@ const struct rtw_chip_info rtw8723d_hw_s
.dig_min = 0x20,
.usb_tx_agg_desc_num = 1,
.hw_feature_report = true,
+ .c2h_ra_report_size = 7,
.ht_supported = true,
.vht_supported = false,
.lps_deep_mode_supported = 0,
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -1969,6 +1969,7 @@ const struct rtw_chip_info rtw8821c_hw_s
.dig_min = 0x1c,
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
+ .c2h_ra_report_size = 7,
.ht_supported = true,
.vht_supported = true,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -2510,6 +2510,7 @@ const struct rtw_chip_info rtw8822b_hw_s
.dig_min = 0x1c,
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
+ .c2h_ra_report_size = 7,
.ht_supported = true,
.vht_supported = true,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -5330,6 +5330,7 @@ const struct rtw_chip_info rtw8822c_hw_s
.dig_min = 0x20,
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
+ .c2h_ra_report_size = 7,
.default_1ss_tx_path = BB_PATH_A,
.path_div_supported = true,
.ht_supported = true,

View File

@ -0,0 +1,165 @@
From 95a772e30b60e7954d03f3372268722475aa303f Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:08:24 +0300
Subject: [PATCH] wifi: rtw88: Extend the init table parsing for RTL8812AU
The chips supported so far only use the first condition, and so the
parsing code ignores the second condition. RTL8812AU's init tables use
the second condition also. Make the parsing code check it.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/1bee6b74-6eab-44a3-9f40-794ca006c72d@gmail.com
---
drivers/net/wireless/realtek/rtw88/main.h | 15 ++++++
drivers/net/wireless/realtek/rtw88/phy.c | 62 ++++++++++++++++++++---
2 files changed, 69 insertions(+), 8 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1835,6 +1835,20 @@ struct rtw_phy_cond {
#define BRANCH_ENDIF 3
};
+struct rtw_phy_cond2 {
+#ifdef __LITTLE_ENDIAN
+ u8 type_glna;
+ u8 type_gpa;
+ u8 type_alna;
+ u8 type_apa;
+#else
+ u8 type_apa;
+ u8 type_alna;
+ u8 type_gpa;
+ u8 type_glna;
+#endif
+};
+
struct rtw_fifo_conf {
/* tx fifo information */
u16 rsvd_boundary;
@@ -1916,6 +1930,7 @@ struct rtw_hal {
u8 oem_id;
u8 pkg_type;
struct rtw_phy_cond phy_cond;
+ struct rtw_phy_cond2 phy_cond2;
bool rfe_btg;
u8 ps_mode;
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -18,7 +18,10 @@ struct phy_cfg_pair {
};
union phy_table_tile {
- struct rtw_phy_cond cond;
+ struct {
+ struct rtw_phy_cond cond;
+ struct rtw_phy_cond2 cond2;
+ } __packed;
struct phy_cfg_pair cfg;
};
@@ -1041,7 +1044,8 @@ void rtw_phy_setup_phy_cond(struct rtw_d
{
struct rtw_hal *hal = &rtwdev->hal;
struct rtw_efuse *efuse = &rtwdev->efuse;
- struct rtw_phy_cond cond = {0};
+ struct rtw_phy_cond cond = {};
+ struct rtw_phy_cond2 cond2 = {};
cond.cut = hal->cut_version ? hal->cut_version : 15;
cond.pkg = pkg ? pkg : 15;
@@ -1061,15 +1065,34 @@ void rtw_phy_setup_phy_cond(struct rtw_d
break;
}
+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A ||
+ rtwdev->chip->id == RTW_CHIP_TYPE_8821A) {
+ cond.rfe = 0;
+ cond.rfe |= efuse->ext_lna_2g;
+ cond.rfe |= efuse->ext_pa_2g << 1;
+ cond.rfe |= efuse->ext_lna_5g << 2;
+ cond.rfe |= efuse->ext_pa_5g << 3;
+ cond.rfe |= efuse->btcoex << 4;
+
+ cond2.type_alna = efuse->alna_type;
+ cond2.type_glna = efuse->glna_type;
+ cond2.type_apa = efuse->apa_type;
+ cond2.type_gpa = efuse->gpa_type;
+ }
+
hal->phy_cond = cond;
+ hal->phy_cond2 = cond2;
- rtw_dbg(rtwdev, RTW_DBG_PHY, "phy cond=0x%08x\n", *((u32 *)&hal->phy_cond));
+ rtw_dbg(rtwdev, RTW_DBG_PHY, "phy cond=0x%08x cond2=0x%08x\n",
+ *((u32 *)&hal->phy_cond), *((u32 *)&hal->phy_cond2));
}
-static bool check_positive(struct rtw_dev *rtwdev, struct rtw_phy_cond cond)
+static bool check_positive(struct rtw_dev *rtwdev, struct rtw_phy_cond cond,
+ struct rtw_phy_cond2 cond2)
{
struct rtw_hal *hal = &rtwdev->hal;
struct rtw_phy_cond drv_cond = hal->phy_cond;
+ struct rtw_phy_cond2 drv_cond2 = hal->phy_cond2;
if (cond.cut && cond.cut != drv_cond.cut)
return false;
@@ -1080,8 +1103,29 @@ static bool check_positive(struct rtw_de
if (cond.intf && cond.intf != drv_cond.intf)
return false;
- if (cond.rfe != drv_cond.rfe)
- return false;
+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A ||
+ rtwdev->chip->id == RTW_CHIP_TYPE_8821A) {
+ if (!(cond.rfe & 0x0f))
+ return true;
+
+ if ((cond.rfe & drv_cond.rfe) != cond.rfe)
+ return false;
+
+ if ((cond.rfe & BIT(0)) && cond2.type_glna != drv_cond2.type_glna)
+ return false;
+
+ if ((cond.rfe & BIT(1)) && cond2.type_gpa != drv_cond2.type_gpa)
+ return false;
+
+ if ((cond.rfe & BIT(2)) && cond2.type_alna != drv_cond2.type_alna)
+ return false;
+
+ if ((cond.rfe & BIT(3)) && cond2.type_apa != drv_cond2.type_apa)
+ return false;
+ } else {
+ if (cond.rfe != drv_cond.rfe)
+ return false;
+ }
return true;
}
@@ -1090,7 +1134,8 @@ void rtw_parse_tbl_phy_cond(struct rtw_d
{
const union phy_table_tile *p = tbl->data;
const union phy_table_tile *end = p + tbl->size / 2;
- struct rtw_phy_cond pos_cond = {0};
+ struct rtw_phy_cond pos_cond = {};
+ struct rtw_phy_cond2 pos_cond2 = {};
bool is_matched = true, is_skipped = false;
BUILD_BUG_ON(sizeof(union phy_table_tile) != sizeof(struct phy_cfg_pair));
@@ -1109,11 +1154,12 @@ void rtw_parse_tbl_phy_cond(struct rtw_d
case BRANCH_ELIF:
default:
pos_cond = p->cond;
+ pos_cond2 = p->cond2;
break;
}
} else if (p->cond.neg) {
if (!is_skipped) {
- if (check_positive(rtwdev, pos_cond)) {
+ if (check_positive(rtwdev, pos_cond, pos_cond2)) {
is_matched = true;
is_skipped = true;
} else {

View File

@ -0,0 +1,58 @@
From 7c5bbeba7c36575a3a57ef4be775b2f3fb68c3f9 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:09:04 +0300
Subject: [PATCH] wifi: rtw88: Allow rtw_chip_info.ltecoex_addr to be NULL
RTL8821A doesn't have this. Trying to use it results in error messages,
so don't try if ltecoex_addr is NULL.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/d1004817-1760-41d1-9136-3d799757c444@gmail.com
---
drivers/net/wireless/realtek/rtw88/coex.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -950,12 +950,18 @@ static void rtw_coex_coex_ctrl_owner(str
static void rtw_coex_set_gnt_bt(struct rtw_dev *rtwdev, u8 state)
{
+ if (!rtwdev->chip->ltecoex_addr)
+ return;
+
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0xc000, state);
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0c00, state);
}
static void rtw_coex_set_gnt_wl(struct rtw_dev *rtwdev, u8 state)
{
+ if (!rtwdev->chip->ltecoex_addr)
+ return;
+
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x3000, state);
rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0300, state);
}
@@ -3904,7 +3910,7 @@ void rtw_coex_display_coex_info(struct r
u8 sys_lte;
u16 score_board_WB, score_board_BW;
u32 wl_reg_6c0, wl_reg_6c4, wl_reg_6c8, wl_reg_778, wl_reg_6cc;
- u32 lte_coex, bt_coex;
+ u32 lte_coex = 0, bt_coex = 0;
int i;
score_board_BW = rtw_coex_read_scbd(rtwdev);
@@ -3916,8 +3922,10 @@ void rtw_coex_display_coex_info(struct r
wl_reg_778 = rtw_read8(rtwdev, REG_BT_STAT_CTRL);
sys_lte = rtw_read8(rtwdev, 0x73);
- lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
- bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);
+ if (rtwdev->chip->ltecoex_addr) {
+ lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
+ bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);
+ }
if (!coex_stat->wl_under_ips &&
(!coex_stat->wl_under_lps || coex_stat->wl_force_lps_ctrl) &&

View File

@ -0,0 +1,272 @@
From fbb5e1b3637a720c83c91a7b1476ab0429bfc747 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:09:47 +0300
Subject: [PATCH] wifi: rtw88: Let each driver control the power on/off process
RTL8821AU and RTL8812AU have to do some things differently, so let
them have full control.
The other chips use the same functions as before.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/98ab839f-9100-44ae-9551-9af743a4aa3a@gmail.com
---
drivers/net/wireless/realtek/rtw88/coex.c | 3 +++
drivers/net/wireless/realtek/rtw88/mac.c | 11 +++++++----
drivers/net/wireless/realtek/rtw88/mac.h | 3 +++
drivers/net/wireless/realtek/rtw88/main.c | 13 ++++++++-----
drivers/net/wireless/realtek/rtw88/main.h | 5 +++++
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2 ++
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 2 ++
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 ++
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 2 ++
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 2 ++
10 files changed, 36 insertions(+), 9 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -2753,16 +2753,19 @@ void rtw_coex_power_on_setting(struct rt
rtw_write8(rtwdev, 0xff1a, 0x0);
rtw_coex_set_gnt_debug(rtwdev);
}
+EXPORT_SYMBOL(rtw_coex_power_on_setting);
void rtw_coex_power_off_setting(struct rtw_dev *rtwdev)
{
rtw_write16(rtwdev, REG_WIFI_BT_INFO, BIT_BT_INT_EN);
}
+EXPORT_SYMBOL(rtw_coex_power_off_setting);
void rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only)
{
__rtw_coex_init_hw_config(rtwdev, wifi_only);
}
+EXPORT_SYMBOL(rtw_coex_init_hw_config);
void rtw_coex_ips_notify(struct rtw_dev *rtwdev, u8 type)
{
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -227,8 +227,8 @@ static int rtw_sub_pwr_seq_parser(struct
return 0;
}
-static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
- const struct rtw_pwr_seq_cmd * const *cmd_seq)
+int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
+ const struct rtw_pwr_seq_cmd * const *cmd_seq)
{
u8 cut_mask;
u8 intf_mask;
@@ -267,6 +267,7 @@ static int rtw_pwr_seq_parser(struct rtw
return 0;
}
+EXPORT_SYMBOL(rtw_pwr_seq_parser);
static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
{
@@ -994,6 +995,7 @@ int rtw_download_firmware(struct rtw_dev
return 0;
}
+EXPORT_SYMBOL(rtw_download_firmware);
static u32 get_priority_queues(struct rtw_dev *rtwdev, u32 queues)
{
@@ -1127,7 +1129,7 @@ static int txdma_queue_mapping(struct rt
return 0;
}
-static int set_trx_fifo_info(struct rtw_dev *rtwdev)
+int rtw_set_trx_fifo_info(struct rtw_dev *rtwdev)
{
const struct rtw_chip_info *chip = rtwdev->chip;
struct rtw_fifo_conf *fifo = &rtwdev->fifo;
@@ -1179,6 +1181,7 @@ static int set_trx_fifo_info(struct rtw_
return 0;
}
+EXPORT_SYMBOL(rtw_set_trx_fifo_info);
static int __priority_queue_cfg(struct rtw_dev *rtwdev,
const struct rtw_page_table *pg_tbl,
@@ -1256,7 +1259,7 @@ static int priority_queue_cfg(struct rtw
u16 pubq_num;
int ret;
- ret = set_trx_fifo_info(rtwdev);
+ ret = rtw_set_trx_fifo_info(rtwdev);
if (ret)
return ret;
--- a/drivers/net/wireless/realtek/rtw88/mac.h
+++ b/drivers/net/wireless/realtek/rtw88/mac.h
@@ -30,11 +30,14 @@
void rtw_set_channel_mac(struct rtw_dev *rtwdev, u8 channel, u8 bw,
u8 primary_ch_idx);
+int rtw_pwr_seq_parser(struct rtw_dev *rtwdev,
+ const struct rtw_pwr_seq_cmd * const *cmd_seq);
int rtw_mac_power_on(struct rtw_dev *rtwdev);
void rtw_mac_power_off(struct rtw_dev *rtwdev);
int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw);
int rtw_mac_init(struct rtw_dev *rtwdev);
void rtw_mac_flush_queues(struct rtw_dev *rtwdev, u32 queues, bool drop);
+int rtw_set_trx_fifo_info(struct rtw_dev *rtwdev);
int rtw_ddma_to_fw_fifo(struct rtw_dev *rtwdev, u32 ocp_src, u32 size);
static inline void rtw_mac_flush_all_queues(struct rtw_dev *rtwdev, bool drop)
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1309,7 +1309,7 @@ void rtw_update_sta_info(struct rtw_dev
rtw_fw_send_ra_info(rtwdev, si, reset_ra_mask);
}
-static int rtw_wait_firmware_completion(struct rtw_dev *rtwdev)
+int rtw_wait_firmware_completion(struct rtw_dev *rtwdev)
{
const struct rtw_chip_info *chip = rtwdev->chip;
struct rtw_fw_state *fw;
@@ -1329,6 +1329,7 @@ static int rtw_wait_firmware_completion(
return ret;
}
+EXPORT_SYMBOL(rtw_wait_firmware_completion);
static enum rtw_lps_deep_mode rtw_update_lps_deep_mode(struct rtw_dev *rtwdev,
struct rtw_fw_state *fw)
@@ -1350,7 +1351,7 @@ static enum rtw_lps_deep_mode rtw_update
return LPS_DEEP_MODE_NONE;
}
-static int rtw_power_on(struct rtw_dev *rtwdev)
+int rtw_power_on(struct rtw_dev *rtwdev)
{
const struct rtw_chip_info *chip = rtwdev->chip;
struct rtw_fw_state *fw = &rtwdev->fw;
@@ -1413,6 +1414,7 @@ err_off:
err:
return ret;
}
+EXPORT_SYMBOL(rtw_power_on);
void rtw_core_fw_scan_notify(struct rtw_dev *rtwdev, bool start)
{
@@ -1485,7 +1487,7 @@ int rtw_core_start(struct rtw_dev *rtwde
{
int ret;
- ret = rtw_power_on(rtwdev);
+ ret = rtwdev->chip->ops->power_on(rtwdev);
if (ret)
return ret;
@@ -1505,12 +1507,13 @@ int rtw_core_start(struct rtw_dev *rtwde
return 0;
}
-static void rtw_power_off(struct rtw_dev *rtwdev)
+void rtw_power_off(struct rtw_dev *rtwdev)
{
rtw_hci_stop(rtwdev);
rtw_coex_power_off_setting(rtwdev);
rtw_mac_power_off(rtwdev);
}
+EXPORT_SYMBOL(rtw_power_off);
void rtw_core_stop(struct rtw_dev *rtwdev)
{
@@ -1535,7 +1538,7 @@ void rtw_core_stop(struct rtw_dev *rtwde
mutex_lock(&rtwdev->mutex);
- rtw_power_off(rtwdev);
+ rtwdev->chip->ops->power_off(rtwdev);
}
static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -843,6 +843,8 @@ struct rtw_regd {
};
struct rtw_chip_ops {
+ int (*power_on)(struct rtw_dev *rtwdev);
+ void (*power_off)(struct rtw_dev *rtwdev);
int (*mac_init)(struct rtw_dev *rtwdev);
int (*dump_fw_crash)(struct rtw_dev *rtwdev);
void (*shutdown)(struct rtw_dev *rtwdev);
@@ -2209,6 +2211,7 @@ void rtw_core_scan_start(struct rtw_dev
void rtw_core_scan_complete(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
bool hw_scan);
int rtw_core_start(struct rtw_dev *rtwdev);
+void rtw_power_off(struct rtw_dev *rtwdev);
void rtw_core_stop(struct rtw_dev *rtwdev);
int rtw_chip_info_setup(struct rtw_dev *rtwdev);
int rtw_core_init(struct rtw_dev *rtwdev);
@@ -2223,6 +2226,8 @@ int rtw_sta_add(struct rtw_dev *rtwdev,
void rtw_sta_remove(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
bool fw_exist);
void rtw_fw_recovery(struct rtw_dev *rtwdev);
+int rtw_wait_firmware_completion(struct rtw_dev *rtwdev);
+int rtw_power_on(struct rtw_dev *rtwdev);
void rtw_core_fw_scan_notify(struct rtw_dev *rtwdev, bool start);
int rtw_dump_fw(struct rtw_dev *rtwdev, const u32 ocp_src, u32 size,
u32 fwcd_item);
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -1888,6 +1888,8 @@ static const struct coex_tdma_para tdma_
};
static const struct rtw_chip_ops rtw8703b_ops = {
+ .power_on = rtw_power_on,
+ .power_off = rtw_power_off,
.mac_init = rtw8723x_mac_init,
.dump_fw_crash = NULL,
.shutdown = NULL,
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -1390,6 +1390,8 @@ static void rtw8723d_pwr_track(struct rt
}
static const struct rtw_chip_ops rtw8723d_ops = {
+ .power_on = rtw_power_on,
+ .power_off = rtw_power_off,
.phy_set_param = rtw8723d_phy_set_param,
.read_efuse = rtw8723x_read_efuse,
.query_phy_status = query_phy_status,
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -1643,6 +1643,8 @@ static const struct rtw_prioq_addrs prio
};
static const struct rtw_chip_ops rtw8821c_ops = {
+ .power_on = rtw_power_on,
+ .power_off = rtw_power_off,
.phy_set_param = rtw8821c_phy_set_param,
.read_efuse = rtw8821c_read_efuse,
.query_phy_status = query_phy_status,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -2132,6 +2132,8 @@ static const struct rtw_prioq_addrs prio
};
static const struct rtw_chip_ops rtw8822b_ops = {
+ .power_on = rtw_power_on,
+ .power_off = rtw_power_off,
.phy_set_param = rtw8822b_phy_set_param,
.read_efuse = rtw8822b_read_efuse,
.query_phy_status = query_phy_status,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -4947,6 +4947,8 @@ static const struct rtw_prioq_addrs prio
};
static const struct rtw_chip_ops rtw8822c_ops = {
+ .power_on = rtw_power_on,
+ .power_off = rtw_power_off,
.phy_set_param = rtw8822c_phy_set_param,
.read_efuse = rtw8822c_read_efuse,
.query_phy_status = query_phy_status,

View File

@ -0,0 +1,194 @@
From c7706b1173c77185a2ef40c7d1811021566563f3 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:10:32 +0300
Subject: [PATCH] wifi: rtw88: Enable data rate fallback for older chips
RTL8811AU fails to perform the 4-way handshake when the AP is too far
because it transmits the EAPOL frames at MCS9 and when that doesn't
work it retries 48 times with the same rate, to no avail.
Retrying 48 times with the same rate seems pointless. Set the
appropriate field in the TX descriptor to allow it to use lower rates
when retrying.
Set it for RTL8723D and RTL8703B because they interpret this field the
same way as RTL8811A.
The newer RTL8822C, RTL8822B, RTL8821C seem to interpret this field in
the TX descriptor differently, so leave it alone for those chips.
Tested with RTL8811AU and RTL8723DU.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com
---
drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
drivers/net/wireless/realtek/rtw88/main.h | 1 +
drivers/net/wireless/realtek/rtw88/pci.c | 2 +-
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 +
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 +
drivers/net/wireless/realtek/rtw88/sdio.c | 2 +-
drivers/net/wireless/realtek/rtw88/tx.c | 6 +++++-
drivers/net/wireless/realtek/rtw88/tx.h | 4 +++-
drivers/net/wireless/realtek/rtw88/usb.c | 4 ++--
12 files changed, 19 insertions(+), 7 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -1290,7 +1290,7 @@ static void rtw_fill_rsvd_page_desc(stru
rtw_tx_rsvd_page_pkt_info_update(rtwdev, &pkt_info, skb, type);
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
memset(pkt_desc, 0, chip->tx_pkt_desc_sz);
- rtw_tx_fill_tx_desc(&pkt_info, skb);
+ rtw_tx_fill_tx_desc(rtwdev, &pkt_info, skb);
}
static inline u8 rtw_len_to_page(unsigned int len, u8 page_size)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1204,6 +1204,7 @@ struct rtw_chip_info {
u8 usb_tx_agg_desc_num;
bool hw_feature_report;
u8 c2h_ra_report_size;
+ bool old_datarate_fb_limit;
u8 default_1ss_tx_path;
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -824,7 +824,7 @@ static int rtw_pci_tx_write_data(struct
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
memset(pkt_desc, 0, tx_pkt_desc_sz);
pkt_info->qsel = rtw_pci_get_tx_qsel(skb, queue);
- rtw_tx_fill_tx_desc(pkt_info, skb);
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
dma = dma_map_single(&rtwpci->pdev->dev, skb->data, skb->len,
DMA_TO_DEVICE);
if (dma_mapping_error(&rtwpci->pdev->dev, dma))
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -1964,6 +1964,7 @@ const struct rtw_chip_info rtw8703b_hw_s
.usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */
.hw_feature_report = true,
.c2h_ra_report_size = 7,
+ .old_datarate_fb_limit = true,
.path_div_supported = false,
.ht_supported = true,
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -2135,6 +2135,7 @@ const struct rtw_chip_info rtw8723d_hw_s
.usb_tx_agg_desc_num = 1,
.hw_feature_report = true,
.c2h_ra_report_size = 7,
+ .old_datarate_fb_limit = true,
.ht_supported = true,
.vht_supported = false,
.lps_deep_mode_supported = 0,
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -1972,6 +1972,7 @@ const struct rtw_chip_info rtw8821c_hw_s
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
.c2h_ra_report_size = 7,
+ .old_datarate_fb_limit = false,
.ht_supported = true,
.vht_supported = true,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -2513,6 +2513,7 @@ const struct rtw_chip_info rtw8822b_hw_s
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
.c2h_ra_report_size = 7,
+ .old_datarate_fb_limit = false,
.ht_supported = true,
.vht_supported = true,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -5333,6 +5333,7 @@ const struct rtw_chip_info rtw8822c_hw_s
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
.c2h_ra_report_size = 7,
+ .old_datarate_fb_limit = false,
.default_1ss_tx_path = BB_PATH_A,
.path_div_supported = true,
.ht_supported = true,
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -864,7 +864,7 @@ static void rtw_sdio_tx_skb_prepare(stru
pkt_info->qsel = rtw_sdio_get_tx_qsel(rtwdev, skb, queue);
- rtw_tx_fill_tx_desc(pkt_info, skb);
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, pkt_desc);
}
--- a/drivers/net/wireless/realtek/rtw88/tx.c
+++ b/drivers/net/wireless/realtek/rtw88/tx.c
@@ -32,7 +32,8 @@ void rtw_tx_stats(struct rtw_dev *rtwdev
}
}
-void rtw_tx_fill_tx_desc(struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb)
+void rtw_tx_fill_tx_desc(struct rtw_dev *rtwdev,
+ struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb)
{
struct rtw_tx_desc *tx_desc = (struct rtw_tx_desc *)skb->data;
bool more_data = false;
@@ -67,6 +68,9 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_p
tx_desc->w4 = le32_encode_bits(pkt_info->rate, RTW_TX_DESC_W4_DATARATE);
+ if (rtwdev->chip->old_datarate_fb_limit)
+ tx_desc->w4 |= le32_encode_bits(0x1f, RTW_TX_DESC_W4_DATARATE_FB_LIMIT);
+
tx_desc->w5 = le32_encode_bits(pkt_info->short_gi, RTW_TX_DESC_W5_DATA_SHORT) |
le32_encode_bits(pkt_info->bw, RTW_TX_DESC_W5_DATA_BW) |
le32_encode_bits(pkt_info->ldpc, RTW_TX_DESC_W5_DATA_LDPC) |
--- a/drivers/net/wireless/realtek/rtw88/tx.h
+++ b/drivers/net/wireless/realtek/rtw88/tx.h
@@ -44,6 +44,7 @@ struct rtw_tx_desc {
#define RTW_TX_DESC_W3_NAVUSEHDR BIT(15)
#define RTW_TX_DESC_W3_MAX_AGG_NUM GENMASK(21, 17)
#define RTW_TX_DESC_W4_DATARATE GENMASK(6, 0)
+#define RTW_TX_DESC_W4_DATARATE_FB_LIMIT GENMASK(12, 8)
#define RTW_TX_DESC_W4_RTSRATE GENMASK(28, 24)
#define RTW_TX_DESC_W5_DATA_SHORT BIT(4)
#define RTW_TX_DESC_W5_DATA_BW GENMASK(6, 5)
@@ -94,7 +95,8 @@ void rtw_tx_pkt_info_update(struct rtw_d
struct rtw_tx_pkt_info *pkt_info,
struct ieee80211_sta *sta,
struct sk_buff *skb);
-void rtw_tx_fill_tx_desc(struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb);
+void rtw_tx_fill_tx_desc(struct rtw_dev *rtwdev,
+ struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb);
void rtw_tx_report_enqueue(struct rtw_dev *rtwdev, struct sk_buff *skb, u8 sn);
void rtw_tx_report_handle(struct rtw_dev *rtwdev, struct sk_buff *skb, int src);
void rtw_tx_rsvd_page_pkt_info_update(struct rtw_dev *rtwdev,
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -457,7 +457,7 @@ static int rtw_usb_write_data(struct rtw
skb_put_data(skb, buf, size);
skb_push(skb, chip->tx_pkt_desc_sz);
memset(skb->data, 0, chip->tx_pkt_desc_sz);
- rtw_tx_fill_tx_desc(pkt_info, skb);
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data);
ret = rtw_usb_write_port(rtwdev, qsel, skb,
@@ -524,7 +524,7 @@ static int rtw_usb_tx_write(struct rtw_d
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
memset(pkt_desc, 0, chip->tx_pkt_desc_sz);
ep = qsel_to_ep(rtwusb, pkt_info->qsel);
- rtw_tx_fill_tx_desc(pkt_info, skb);
+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb);
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data);
tx_data = rtw_usb_get_tx_data(skb);
tx_data->sn = pkt_info->sn;

View File

@ -0,0 +1,85 @@
From abb0f19492ba6289ffba6ec1057c0426240958af Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:10:54 +0300
Subject: [PATCH] wifi: rtw88: Make txagc_remnant_ofdm an array
txagc_remnant_ofdm member of struct rtw_dm_info should be different for
each RF path, so make it an array of size RTW_RF_PATH_MAX (4).
Until now all the chips using this had only one RF path, but RTL8812AU
has two, and RTL8814AU has four.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/68571ba9-e504-4b2d-bfa1-62f468753649@gmail.com
---
drivers/net/wireless/realtek/rtw88/main.h | 2 +-
drivers/net/wireless/realtek/rtw88/phy.c | 4 ++--
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 4 ++--
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1715,7 +1715,7 @@ struct rtw_dm_info {
bool pwr_trk_init_trigger;
struct ewma_thermal avg_thermal[RTW_RF_PATH_MAX];
s8 txagc_remnant_cck;
- s8 txagc_remnant_ofdm;
+ s8 txagc_remnant_ofdm[RTW_RF_PATH_MAX];
u8 rx_cck_agc_report_type;
/* backup dack results for each path and I/Q */
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -2169,8 +2169,8 @@ void rtw_get_tx_power_params(struct rtw_
*limit = rtw_phy_get_tx_power_limit(rtwdev, band, bw, path,
rate, ch, regd);
- *remnant = (rate <= DESC_RATE11M ? dm_info->txagc_remnant_cck :
- dm_info->txagc_remnant_ofdm);
+ *remnant = rate <= DESC_RATE11M ? dm_info->txagc_remnant_cck :
+ dm_info->txagc_remnant_ofdm[path];
*sar = rtw_phy_get_tx_power_sar(rtwdev, hal->sar_band, path, rate);
}
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -637,7 +637,7 @@ static void rtw8703b_pwrtrack_init(struc
dm_info->pwr_trk_init_trigger = true;
dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k;
dm_info->txagc_remnant_cck = 0;
- dm_info->txagc_remnant_ofdm = 0;
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = 0;
}
static void rtw8703b_phy_set_param(struct rtw_dev *rtwdev)
@@ -1589,7 +1589,7 @@ static void rtw8703b_pwrtrack_set_ofdm_p
{
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
- dm_info->txagc_remnant_ofdm = txagc_idx;
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = txagc_idx;
/* Only path A is calibrated for rtl8703b */
rtw8703b_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_A);
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -79,7 +79,7 @@ static void rtw8723d_pwrtrack_init(struc
dm_info->pwr_trk_init_trigger = true;
dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k;
dm_info->txagc_remnant_cck = 0;
- dm_info->txagc_remnant_ofdm = 0;
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = 0;
}
static void rtw8723d_phy_set_param(struct rtw_dev *rtwdev)
@@ -1265,7 +1265,7 @@ static void rtw8723d_pwrtrack_set_ofdm_p
{
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
- dm_info->txagc_remnant_ofdm = txagc_idx;
+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = txagc_idx;
rtw8723d_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_A);
rtw8723d_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_B);

View File

@ -0,0 +1,115 @@
From 82a617413e8545775ec03a1970809ac5f549ef32 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:12:06 +0300
Subject: [PATCH] wifi: rtw88: Support TX page sizes bigger than 128
All the chips supported so far have a TX page size of 128 bytes.
Change the type of the page_size member of struct rtw_chip_info from u8
to u16 in order to support RTL8821AU (page size of 256 bytes) and
RTL8812AU (page size of 512 bytes). Also change the types of several
related variables and function parameters from u8 to u16.
The TX page size is used, among other things, to construct the beacon,
null data, QOS null data, and PS poll templates which are uploaded to
the chip's reserved page. Each template needs to be aligned on a
multiple of the TX page size. Power saving can't work if the TX page
size is wrong.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/acdefbb1-3daf-4349-9e03-9472754d5f1e@gmail.com
---
drivers/net/wireless/realtek/rtw88/debug.c | 2 +-
drivers/net/wireless/realtek/rtw88/fw.c | 21 +++++++++++----------
drivers/net/wireless/realtek/rtw88/mac.c | 2 +-
drivers/net/wireless/realtek/rtw88/main.h | 2 +-
4 files changed, 14 insertions(+), 13 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -308,7 +308,7 @@ static int rtw_debugfs_get_rsvd_page(str
{
struct rtw_debugfs_priv *debugfs_priv = m->private;
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
- u8 page_size = rtwdev->chip->page_size;
+ u16 page_size = rtwdev->chip->page_size;
u32 buf_size = debugfs_priv->rsvd_page.page_num * page_size;
u32 offset = debugfs_priv->rsvd_page.page_offset * page_size;
u8 *buf;
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -1293,13 +1293,13 @@ static void rtw_fill_rsvd_page_desc(stru
rtw_tx_fill_tx_desc(rtwdev, &pkt_info, skb);
}
-static inline u8 rtw_len_to_page(unsigned int len, u8 page_size)
+static inline u8 rtw_len_to_page(unsigned int len, u16 page_size)
{
return DIV_ROUND_UP(len, page_size);
}
-static void rtw_rsvd_page_list_to_buf(struct rtw_dev *rtwdev, u8 page_size,
- u8 page_margin, u32 page, u8 *buf,
+static void rtw_rsvd_page_list_to_buf(struct rtw_dev *rtwdev, u16 page_size,
+ u16 page_margin, u32 page, u8 *buf,
struct rtw_rsvd_page *rsvd_pkt)
{
struct sk_buff *skb = rsvd_pkt->skb;
@@ -1601,13 +1601,13 @@ static int __rtw_build_rsvd_page_from_v
static u8 *rtw_build_rsvd_page(struct rtw_dev *rtwdev, u32 *size)
{
- struct ieee80211_hw *hw = rtwdev->hw;
const struct rtw_chip_info *chip = rtwdev->chip;
- struct sk_buff *iter;
+ struct ieee80211_hw *hw = rtwdev->hw;
struct rtw_rsvd_page *rsvd_pkt;
- u32 page = 0;
+ struct sk_buff *iter;
+ u16 page_size, page_margin, tx_desc_sz;
u8 total_page = 0;
- u8 page_size, page_margin, tx_desc_sz;
+ u32 page = 0;
u8 *buf;
int ret;
@@ -2013,12 +2013,13 @@ static int _rtw_hw_scan_update_probe_req
{
const struct rtw_chip_info *chip = rtwdev->chip;
struct sk_buff *skb, *tmp;
- u8 page_offset = 1, *buf, page_size = chip->page_size;
u16 pg_addr = rtwdev->fifo.rsvd_h2c_info_addr, loc;
- u16 buf_offset = page_size * page_offset;
u8 tx_desc_sz = chip->tx_pkt_desc_sz;
- u8 page_cnt, pages;
+ u16 page_size = chip->page_size;
+ u8 page_offset = 1, *buf;
+ u16 buf_offset = page_size * page_offset;
unsigned int pkt_len;
+ u8 page_cnt, pages;
int ret;
if (rtw_fw_feature_ext_check(&rtwdev->fw, FW_FEATURE_EXT_OLD_PAGE_NUM))
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -1138,7 +1138,7 @@ int rtw_set_trx_fifo_info(struct rtw_dev
/* config rsvd page num */
fifo->rsvd_drv_pg_num = chip->rsvd_drv_pg_num;
- fifo->txff_pg_num = chip->txff_size >> 7;
+ fifo->txff_pg_num = chip->txff_size / chip->page_size;
if (rtw_chip_wcpu_11n(rtwdev))
fifo->rsvd_pg_num = fifo->rsvd_drv_pg_num;
else
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1187,7 +1187,7 @@ struct rtw_chip_info {
u32 fw_rxff_size;
u16 rsvd_drv_pg_num;
u8 band;
- u8 page_size;
+ u16 page_size;
u8 csi_buf_pg_num;
u8 dig_max;
u8 dig_min;

View File

@ -0,0 +1,297 @@
From 67d915604e6993ff627ac001983a2de63ff71b13 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:12:39 +0300
Subject: [PATCH] wifi: rtw88: Move pwr_track_tbl to struct rtw_rfe_def
RTL8812AU uses one set of TX power tracking tables for RFE 3, and
another set for everything else.
Move pwr_track_tbl from struct rtw_chip_info to struct rtw_rfe_def in
order to load the right set of tables for each RFE (RF front end) type.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/904d0ab1-c046-40cd-a3a3-d4fdcf663c9d@gmail.com
---
drivers/net/wireless/realtek/rtw88/main.h | 8 ++++---
drivers/net/wireless/realtek/rtw88/phy.c | 3 ++-
drivers/net/wireless/realtek/rtw88/rtw8703b.c | 12 +++++-----
drivers/net/wireless/realtek/rtw88/rtw8723d.c | 12 +++++-----
drivers/net/wireless/realtek/rtw88/rtw8723x.c | 3 ++-
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 17 +++++++-------
drivers/net/wireless/realtek/rtw88/rtw8822b.c | 15 ++++++------
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 23 +++++++++----------
8 files changed, 47 insertions(+), 46 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1099,17 +1099,20 @@ enum rtw_rfe_fem {
struct rtw_rfe_def {
const struct rtw_table *phy_pg_tbl;
const struct rtw_table *txpwr_lmt_tbl;
+ const struct rtw_pwr_track_tbl *pwr_track_tbl;
const struct rtw_table *agc_btg_tbl;
};
-#define RTW_DEF_RFE(chip, bb_pg, pwrlmt) { \
+#define RTW_DEF_RFE(chip, bb_pg, pwrlmt, track) { \
.phy_pg_tbl = &rtw ## chip ## _bb_pg_type ## bb_pg ## _tbl, \
.txpwr_lmt_tbl = &rtw ## chip ## _txpwr_lmt_type ## pwrlmt ## _tbl, \
+ .pwr_track_tbl = &rtw ## chip ## _pwr_track_type ## track ## _tbl, \
}
-#define RTW_DEF_RFE_EXT(chip, bb_pg, pwrlmt, btg) { \
+#define RTW_DEF_RFE_EXT(chip, bb_pg, pwrlmt, track, btg) { \
.phy_pg_tbl = &rtw ## chip ## _bb_pg_type ## bb_pg ## _tbl, \
.txpwr_lmt_tbl = &rtw ## chip ## _txpwr_lmt_type ## pwrlmt ## _tbl, \
+ .pwr_track_tbl = &rtw ## chip ## _pwr_track_type ## track ## _tbl, \
.agc_btg_tbl = &rtw ## chip ## _agc_btg_type ## btg ## _tbl, \
}
@@ -1243,7 +1246,6 @@ struct rtw_chip_info {
u16 dpd_ratemask;
u8 iqk_threshold;
u8 lck_threshold;
- const struct rtw_pwr_track_tbl *pwr_track_tbl;
u8 bfer_su_max_num;
u8 bfer_mu_max_num;
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -2384,7 +2384,8 @@ void rtw_phy_init_tx_power(struct rtw_de
void rtw_phy_config_swing_table(struct rtw_dev *rtwdev,
struct rtw_swing_table *swing_table)
{
- const struct rtw_pwr_track_tbl *tbl = rtwdev->chip->pwr_track_tbl;
+ const struct rtw_rfe_def *rfe_def = rtw_get_rfe_def(rtwdev);
+ const struct rtw_pwr_track_tbl *tbl = rfe_def->pwr_track_tbl;
u8 channel = rtwdev->hal.current_channel;
if (IS_CH_2G_BAND(channel)) {
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -493,11 +493,6 @@ static const struct rtw_pwr_seq_cmd * co
NULL
};
-static const struct rtw_rfe_def rtw8703b_rfe_defs[] = {
- [0] = { .phy_pg_tbl = &rtw8703b_bb_pg_tbl,
- .txpwr_lmt_tbl = &rtw8703b_txpwr_lmt_tbl,},
-};
-
static const struct rtw_page_table page_table_8703b[] = {
{12, 2, 2, 0, 1},
{12, 2, 2, 0, 1},
@@ -1818,6 +1813,12 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_xtal_p = rtw8703b_pwrtrk_xtal_p,
};
+static const struct rtw_rfe_def rtw8703b_rfe_defs[] = {
+ [0] = { .phy_pg_tbl = &rtw8703b_bb_pg_tbl,
+ .txpwr_lmt_tbl = &rtw8703b_txpwr_lmt_tbl,
+ .pwr_track_tbl = &rtw8703b_rtw_pwr_track_tbl, },
+};
+
/* Shared-Antenna Coex Table */
static const struct coex_table_para table_sant_8703b[] = {
{0xffffffff, 0xffffffff}, /* case-0 */
@@ -1997,7 +1998,6 @@ const struct rtw_chip_info rtw8703b_hw_s
.rfe_defs_size = ARRAY_SIZE(rtw8703b_rfe_defs),
.iqk_threshold = 8,
- .pwr_track_tbl = &rtw8703b_rtw_pwr_track_tbl,
/* WOWLAN firmware exists, but not implemented yet */
.wow_fw_name = "rtw88/rtw8703b_wow_fw.bin",
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -2020,11 +2020,6 @@ static const struct rtw_intf_phy_para_ta
.n_gen1_para = ARRAY_SIZE(pcie_gen1_param_8723d),
};
-static const struct rtw_rfe_def rtw8723d_rfe_defs[] = {
- [0] = { .phy_pg_tbl = &rtw8723d_bb_pg_tbl,
- .txpwr_lmt_tbl = &rtw8723d_txpwr_lmt_tbl,},
-};
-
static const u8 rtw8723d_pwrtrk_2gb_n[] = {
0, 0, 1, 1, 1, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5,
6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10
@@ -2088,6 +2083,12 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_xtal_n = rtw8723d_pwrtrk_xtal_n,
};
+static const struct rtw_rfe_def rtw8723d_rfe_defs[] = {
+ [0] = { .phy_pg_tbl = &rtw8723d_bb_pg_tbl,
+ .txpwr_lmt_tbl = &rtw8723d_txpwr_lmt_tbl,
+ .pwr_track_tbl = &rtw8723d_rtw_pwr_track_tbl, },
+};
+
static const struct rtw_reg_domain coex_info_hw_regs_8723d[] = {
{0x948, MASKDWORD, RTW_REG_DOMAIN_MAC32},
{0x67, BIT(7), RTW_REG_DOMAIN_MAC8},
@@ -2159,7 +2160,6 @@ const struct rtw_chip_info rtw8723d_hw_s
.rfe_defs = rtw8723d_rfe_defs,
.rfe_defs_size = ARRAY_SIZE(rtw8723d_rfe_defs),
.rx_ldpc = false,
- .pwr_track_tbl = &rtw8723d_rtw_pwr_track_tbl,
.iqk_threshold = 8,
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
.max_scan_ie_len = IEEE80211_MAX_DATA_LEN,
--- a/drivers/net/wireless/realtek/rtw88/rtw8723x.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723x.c
@@ -595,7 +595,8 @@ void __rtw8723x_pwrtrack_set_xtal(struct
u8 delta)
{
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
- const struct rtw_pwr_track_tbl *tbl = rtwdev->chip->pwr_track_tbl;
+ const struct rtw_rfe_def *rfe_def = rtw_get_rfe_def(rtwdev);
+ const struct rtw_pwr_track_tbl *tbl = rfe_def->pwr_track_tbl;
const s8 *pwrtrk_xtal;
s8 xtal_cap;
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
@@ -1581,13 +1581,6 @@ static const struct rtw_intf_phy_para_ta
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8821c),
};
-static const struct rtw_rfe_def rtw8821c_rfe_defs[] = {
- [0] = RTW_DEF_RFE(8821c, 0, 0),
- [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2),
- [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2),
- [6] = RTW_DEF_RFE(8821c, 0, 0),
-};
-
static const struct rtw_hw_reg rtw8821c_dig[] = {
[0] = { .addr = 0xc50, .mask = 0x7f },
};
@@ -1899,7 +1892,7 @@ static const u8 rtw8821c_pwrtrk_2g_cck_a
5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9
};
-static const struct rtw_pwr_track_tbl rtw8821c_rtw_pwr_track_tbl = {
+static const struct rtw_pwr_track_tbl rtw8821c_pwr_track_type0_tbl = {
.pwrtrk_5gb_n[0] = rtw8821c_pwrtrk_5gb_n[0],
.pwrtrk_5gb_n[1] = rtw8821c_pwrtrk_5gb_n[1],
.pwrtrk_5gb_n[2] = rtw8821c_pwrtrk_5gb_n[2],
@@ -1922,6 +1915,13 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_2g_ccka_p = rtw8821c_pwrtrk_2g_cck_a_p,
};
+static const struct rtw_rfe_def rtw8821c_rfe_defs[] = {
+ [0] = RTW_DEF_RFE(8821c, 0, 0, 0),
+ [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 0, 2),
+ [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 0, 2),
+ [6] = RTW_DEF_RFE(8821c, 0, 0, 0),
+};
+
static const struct rtw_reg_domain coex_info_hw_regs_8821c[] = {
{0xCB0, MASKDWORD, RTW_REG_DOMAIN_MAC32},
{0xCB4, MASKDWORD, RTW_REG_DOMAIN_MAC32},
@@ -1994,7 +1994,6 @@ const struct rtw_chip_info rtw8821c_hw_s
.rfe_defs = rtw8821c_rfe_defs,
.rfe_defs_size = ARRAY_SIZE(rtw8821c_rfe_defs),
.rx_ldpc = false,
- .pwr_track_tbl = &rtw8821c_rtw_pwr_track_tbl,
.iqk_threshold = 8,
.bfer_su_max_num = 2,
.bfer_mu_max_num = 1,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -2072,12 +2072,6 @@ static const struct rtw_intf_phy_para_ta
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822b),
};
-static const struct rtw_rfe_def rtw8822b_rfe_defs[] = {
- [2] = RTW_DEF_RFE(8822b, 2, 2),
- [3] = RTW_DEF_RFE(8822b, 3, 0),
- [5] = RTW_DEF_RFE(8822b, 5, 5),
-};
-
static const struct rtw_hw_reg rtw8822b_dig[] = {
[0] = { .addr = 0xc50, .mask = 0x7f },
[1] = { .addr = 0xe50, .mask = 0x7f },
@@ -2432,7 +2426,7 @@ static const u8 rtw8822b_pwrtrk_2g_cck_a
10, 11, 11, 12, 12, 13, 13, 14, 14, 15
};
-static const struct rtw_pwr_track_tbl rtw8822b_rtw_pwr_track_tbl = {
+static const struct rtw_pwr_track_tbl rtw8822b_pwr_track_type0_tbl = {
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_1] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_1],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_2] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_2],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_3] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_3],
@@ -2455,6 +2449,12 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_2g_ccka_p = rtw8822b_pwrtrk_2g_cck_a_p,
};
+static const struct rtw_rfe_def rtw8822b_rfe_defs[] = {
+ [2] = RTW_DEF_RFE(8822b, 2, 2, 0),
+ [3] = RTW_DEF_RFE(8822b, 3, 0, 0),
+ [5] = RTW_DEF_RFE(8822b, 5, 5, 0),
+};
+
static const struct rtw_reg_domain coex_info_hw_regs_8822b[] = {
{0xcb0, MASKDWORD, RTW_REG_DOMAIN_MAC32},
{0xcb4, MASKDWORD, RTW_REG_DOMAIN_MAC32},
@@ -2535,7 +2535,6 @@ const struct rtw_chip_info rtw8822b_hw_s
.rf_tbl = {&rtw8822b_rf_a_tbl, &rtw8822b_rf_b_tbl},
.rfe_defs = rtw8822b_rfe_defs,
.rfe_defs_size = ARRAY_SIZE(rtw8822b_rfe_defs),
- .pwr_track_tbl = &rtw8822b_rtw_pwr_track_tbl,
.iqk_threshold = 8,
.bfer_su_max_num = 2,
.bfer_mu_max_num = 1,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -4883,16 +4883,6 @@ static const struct rtw_intf_phy_para_ta
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822c),
};
-static const struct rtw_rfe_def rtw8822c_rfe_defs[] = {
- [0] = RTW_DEF_RFE(8822c, 0, 0),
- [1] = RTW_DEF_RFE(8822c, 0, 0),
- [2] = RTW_DEF_RFE(8822c, 0, 0),
- [3] = RTW_DEF_RFE(8822c, 0, 0),
- [4] = RTW_DEF_RFE(8822c, 0, 0),
- [5] = RTW_DEF_RFE(8822c, 0, 5),
- [6] = RTW_DEF_RFE(8822c, 0, 0),
-};
-
static const struct rtw_hw_reg rtw8822c_dig[] = {
[0] = { .addr = 0x1d70, .mask = 0x7f },
[1] = { .addr = 0x1d70, .mask = 0x7f00 },
@@ -5238,7 +5228,7 @@ static const u8 rtw8822c_pwrtrk_2g_cck_a
18, 18, 19, 20, 21, 22, 23, 24, 24, 25
};
-static const struct rtw_pwr_track_tbl rtw8822c_rtw_pwr_track_tbl = {
+static const struct rtw_pwr_track_tbl rtw8822c_pwr_track_type0_tbl = {
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_1] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_1],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_2] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_2],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_3] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_3],
@@ -5261,6 +5251,16 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p,
};
+static const struct rtw_rfe_def rtw8822c_rfe_defs[] = {
+ [0] = RTW_DEF_RFE(8822c, 0, 0, 0),
+ [1] = RTW_DEF_RFE(8822c, 0, 0, 0),
+ [2] = RTW_DEF_RFE(8822c, 0, 0, 0),
+ [3] = RTW_DEF_RFE(8822c, 0, 0, 0),
+ [4] = RTW_DEF_RFE(8822c, 0, 0, 0),
+ [5] = RTW_DEF_RFE(8822c, 0, 5, 0),
+ [6] = RTW_DEF_RFE(8822c, 0, 0, 0),
+};
+
static const struct rtw_hw_reg_offset rtw8822c_edcca_th[] = {
[EDCCA_TH_L2H_IDX] = {
{.addr = 0x84c, .mask = MASKBYTE2}, .offset = 0x80
@@ -5360,7 +5360,6 @@ const struct rtw_chip_info rtw8822c_hw_s
.rfe_defs_size = ARRAY_SIZE(rtw8822c_rfe_defs),
.en_dis_dpd = true,
.dpd_ratemask = DIS_DPD_RATEALL,
- .pwr_track_tbl = &rtw8822c_rtw_pwr_track_tbl,
.iqk_threshold = 8,
.lck_threshold = 8,
.bfer_su_max_num = 2,

View File

@ -0,0 +1,27 @@
From 85bf3041a0ea40a60b5295749268e179f056546a Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Wed, 23 Oct 2024 17:13:10 +0300
Subject: [PATCH] wifi: rtw88: usb: Set pkt_info.ls for the reserved page
"ls" meaning "last segment". Without this RTL8812AU can't upload the
reserved page in USB 2 mode. (Somehow it's fine in USB 3 mode.)
Also tested with RTL8822CU, RTL8812BU, RTL8811CU, RTL8723DU, RTL8811AU.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/e443f5d9-4b53-4f64-985c-64313ec80bef@gmail.com
---
drivers/net/wireless/realtek/rtw88/usb.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -477,6 +477,7 @@ static int rtw_usb_write_data_rsvd_page(
pkt_info.tx_pkt_size = size;
pkt_info.qsel = TX_DESC_QSEL_BEACON;
pkt_info.offset = chip->tx_pkt_desc_sz;
+ pkt_info.ls = true;
return rtw_usb_write_data(rtwdev, &pkt_info, buf);
}

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