Commit Graph

30793 Commits

Author SHA1 Message Date
Tim Lunn
4d90b79704
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
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-08 12:37:12 +00:00
Tim Lunn
71b4842e3b
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
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-08 12:37:10 +00:00
Tim Lunn
1bdbd511b2
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
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-08 12:37:08 +00:00
Tim Lunn
70c371d91c
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
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-08 12:37:06 +00:00
Tim Lunn
09a6bffb6e
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
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-08 12:37:04 +00:00
Tim Lunn
5e355f1f90
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
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-08 12:37:02 +00:00
Tim Lunn
dc51c4355d
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
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-08 12:37:01 +00:00
Edward Chow
6691ff86b7 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: 50f727b773 ("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:56:39 +01:00
John Crispin
48028cd102 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 10:11:44 +01:00
John Crispin
6ec1477b4d 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 10:11:44 +01:00
Mieczyslaw Nalewaj
4fc47c6000 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>
2024-11-04 23:40:12 +01:00
Mauri Sandberg
11ba2b141f 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
  c85348d9ab ("imagebuilder: remove initramfs image files")

Fixes: fea2264d9f ("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:25:36 +01:00
Linus Walleij
7da9d6bfe0 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 08:31:00 +01:00
Leon M. Busch-George
d64e1ed421 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-03 21:40:53 +01:00
Rosen Penev
e99b5832e8 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>
2024-11-03 20:12:35 +01:00
Rosen Penev
6d2ed484fa 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>
2024-11-03 20:12:06 +01:00
Rosen Penev
e612900ae0 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>
2024-11-03 20:08:17 +01:00
Daniel Golle
675d7c8849 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-03 02:39:58 +00:00
Daniel Golle
591272d197 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-02 22:37:34 +00:00
Daniel Golle
2cbd230091 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-02 22:37:34 +00:00
Rosen Penev
57f2c72505 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>
2024-11-02 12:15:12 +01:00
John Crispin
a85f11f191 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-01 07:43:00 +01:00
John Crispin
ddfae94a14 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-01 07:43:00 +01:00
John Crispin
cfe8e6e75f 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-01 07:43:00 +01:00
Daniel Golle
2b173ab730 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>
2024-11-01 03:40:36 +00:00
Lech Perczak
fc236f3b3c ath79: Really fix 5GHz on QCA9886 variant of ZTE MF286
Fix in commit 25eead21c5 ("ath79: fix 5GHz on QCA9886 variant of ZTE MF286")
was incomplete. A user of such variant popped up, and in the boot log
after installation, we discovered that QCA9886 expects different
pre-calibration data size, than the older QCA9880 variant:

ath10k_pci 0000:00:00.0: qca9888 hw2.0 target 0x01000000 chip_id 0x00000000 sub 0000:0000
ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
ath10k_pci 0000:00:00.0: firmware ver 10.4b-ct-9888-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 59e741e7
ath10k_pci 0000:00:00.0: invalid calibration data length in nvmem-cell 'pre-calibration': 2116 != 12064
ath10k_pci 0000:00:00.0: Loading BDF type 0
ath10k_pci 0000:00:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA9888/hw2.0/board-2.bin
ath10k_pci 0000:00:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9888/hw2.0
ath10k_pci 0000:00:00.0: failed to fetch board file: -12
ath10k_pci 0000:00:00.0: could not probe fw (-12)

Explicitly define a pre-calibration nvmem-cell for this variant, and use
it instead of the calibration one, which is shorter.

Fixes: 25eead21c5 ("ath79: fix 5GHz on QCA9886 variant of ZTE MF286")
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16809
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-31 18:58:22 +01:00
Álvaro Fernández Rojas
538a1d740c bcm27xx: update to latest RPi patches
The patches were generated from the RPi repo with the following command:
git format-patch v6.6.58..rpi-6.6.y

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-10-31 13:44:23 +01:00
Rosen Penev
9c6cd2241d ramips: m4r v4: fix typo
It should be debounce-interval, as with the others.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16802
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-31 10:45:11 +01:00
Rafal Boni
b5e1544f4d ipq806x: Revert "ipq806x: swap lan leds for Meraki MR52"
This reverts commit ec8f647d16, as with the
current kernel version, the change actually causes the same bug it once
may have fixed -- that is, the leds are now again reversed.

I suspect this was due to a switch to a newer kernel version between when
the patch was submitted and now reversing the order of the interfaces, so
that eth0 / the LAN interface is also the interface used for PoE, and eth1
/ the WAN interface is the non-PoE interface.

Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16779
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-30 15:51:18 +01:00
Christian Marangi
73edd3a41e
ramips: ignore errors from trx utility
Ignore errors from trx utility to handle case with image too big.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-30 14:17:34 +01:00
Christian Marangi
f9afff8b28
mxs: drop removal of firewall4 package
Drop removal of firewall4 package for I2SE Duckbill device.

With OPKG the firewall4 package was installed anyway as it's a
dependency of luci-app-firewall and was silently installed again later
in such condition. Drop it to fix support for APK.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-30 14:17:33 +01:00
Christian Marangi
d6c6e4f722
mvebu: cortexa9: drop removal of firewall4 package
Drop removal of firewall4 package for Synology DS213j device.

With OPKG the firewall4 package was installed anyway as it's a
dependency of luci-app-firewall and was silently installed again later
in such condition. Drop it to fix support for APK.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-30 14:17:33 +01:00
John Thomson
36834ea340 kernel: mtdsplit_minor: accept bootimage filename
RouterBOOT v7 on NOR devices no longer accepts the YAFFS kernel ELF
method of booting. It will accept an NPK image named bootimage.
Adjust mtdsplit_minor to accept this second possible boot file name.
Use the conservative value of 127 for YAFFS max name length (used when
YAFFS compiled with unicode support) vs 255.

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Acked-by: Thibaut VARENE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/16780
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-30 11:15:34 +01:00
John Thomson
ade045084b kernel: mtdsplit_minor: return 0 if not fatal
Introduced with Linux 6.7, in commit:
5c2f7727d437 ("mtd: mtdpart: check for subpartitions parsing result"),
when a parser returns an error, this will be passed up, and
consequently, all parent mtd partitions get torn down.

Adjust the MiNOR mtdsplit driver to only return an error if there is a
critical problem in reading from the mtd device or allocating memory.
Otherwise return 0 to indicate that no partitions were found.
Also add logging to indicate what went wrong.

This mtdsplit parser makes a very limited check of the first YAFFS
header. For example, this will not match expectations when initially booting
an initramfs image with OEM on MTD.

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Acked-by: Thibaut VARENE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/16780
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-30 11:15:34 +01:00
Rosen Penev
a6a44f94bf ramips: linkit: replace driver with gpio-hog
It does the same thing minus a few dmesg prints.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16788
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-30 11:11:07 +01:00
Andreas Böhler
cbefc64cb3 ramips: Fix WiFi on Sercomm NA502 and NA502s
The WiFi chips are actually on PCIe1 and PCIe2, PCIe0 is empty. Fix the
assignment so that WiFi works properly again.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
Link: https://github.com/openwrt/openwrt/pull/16807
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-29 21:25:04 +01:00
Álvaro Fernández Rojas
57572de43a generic: backport upstream r8169 irq patch
This commit backports an additional patch from linux v6.12 release.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-10-29 12:00:53 +01:00
Christian Marangi
0357372896
armsr: don't limit kmods to armsr armv8 subtarget
Drop limitation on depending on only armv8 for armsr target as those
module should support both 32 and 64 bits systems.

Only thunderx-net actually require 64 bit systems.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:55 +01:00
Christian Marangi
d42a8b25fa
layerscape: drop fmc and fmc-eth-config package
Drop fmc and fmc-eth-config package as they were never actually
submitted to openwrt mainline and they don't exist around.

They are probably part of NXP SDK and were added due to copy-paste
errors.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:55 +01:00
Christian Marangi
1cb7764812
layerscape: set firmware package to skip installation
Add the '~' prefix to package that needs to skip installation as they
are meta-package just to download and compile firmware package for the
final firmware.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:54 +01:00
Christian Marangi
285e200e5e
ramips: mt7621: drop kmod-i2c-ralink from ASUS RP-AC56
Drop kmod-i2c-ralink from ASUS RP-AC56 as it was wrongly added. Such
kmod is not supported on mt7621 as i2c is handled by the mediatek driver
and not bay the ralink downstream one.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:54 +01:00
Christian Marangi
088b83c845
msx: fix wrong device package list for I2SE Duckbill
Fix wrong package device list that is trying to remove deprecated
packages. Replace with new variant where possible.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:53 +01:00
Christian Marangi
1ce7e9403b
ipq40xx: drop ipq-wifi-teltonika_rutx from Teltonika RUTX50
Drop ipq-wifi-teltonika_rutx from Teltonika RUTX50, the board file was
merged upstream but the ipq package was never dropped from
DEVICE_PACKAGES list.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:53 +01:00
Christian Marangi
7e85c30938
bcm53xx: drop kmod-ledtrig-default-on and kmod-ledtrig-netdev
Drop kmod-ledtrig-default-on and kmod-ledtrig-netdev as the kmod were
dropped and are now enabled by default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:52 +01:00
Christian Marangi
c73e231b5c
ath79: replace ancient kmod-ledtrig-usbdev with kmod-usb-ledtrig-usbport
Replace ancient kmod-ledtrig-usbdev dropped from 2016 with
kmod-usb-ledtrig-usbport upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:52 +01:00
Christian Marangi
bcd95cb9c4
airoha: an7581: replace TRNG patch with upstream version
Replace TRNG patch with upstream version.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-28 14:01:52 +01:00
Zoltan HERPAI
e934e67f9c kirkwood: dns320l: export mcu_power GPIO
This GPIO is pulled down by the onboard MCU when the power button
is pressed for 5 seconds, indicating a user-initiated shutdown.

Refresh patches at the same time.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2024-10-28 09:24:32 +01:00
Markus Stockhausen
945a335f66 realtek: ethernet: Improve SMI polling configuration based on DTS
Although Zyxel XGS1210 devices are not yet officially supported there
are several patches floating around to enable them. This is a very imporant
one because it fixes a SMI misconfiguration. In the known DTS the SFP+
port settings are set as follows.

  phy26: ethernet-phy@26 {
    compatible = "ethernet-phy-ieee802.3-c45";
    phy-is-integrated;
    reg = <26>;
    sds = < 8 >;
  };

  phy27: ethernet-phy@27 {
    compatible = "ethernet-phy-ieee802.3-c45";
    phy-is-integrated;
    reg = <27>;
    sds = < 9 >;
  };

So these are PHYs linked to an internal SerDes. During initialization
rtl838x_mdio_init() generates smi_bus=0 & smi_addr=27/28 for these ports.
Although this seems like a valid configuration integrated PHYs attached
to an SerDes do not have an SMI bus. Later on the mdio reset wrongly feeds
the SMI registers and as a result the PHYs on SMI bus 0 do not work.

Without patch (loaded with rtk network on & initramfs):

...
mdio_bus mdio-bus: MDIO device at address 0 is missing.
mdio_bus mdio-bus: MDIO device at address 1 is missing.
mdio_bus mdio-bus: MDIO device at address 2 is missing.
mdio_bus mdio-bus: MDIO device at address 3 is missing.
mdio_bus mdio-bus: MDIO device at address 4 is missing.
mdio_bus mdio-bus: MDIO device at address 5 is missing.
mdio_bus mdio-bus: MDIO device at address 6 is missing.
mdio_bus mdio-bus: MDIO device at address 7 is missing.
...
rtl83xx-switch ... : no phy at 0
rtl83xx-switch ... : failed to connect to PHY: -ENODEV
rtl83xx-switch ... : error -19 setting up PHY for tree 0, switch 0, port 0
rtl83xx-switch ... : no phy at 1
rtl83xx-switch ... : failed to connect to PHY: -ENODEV
rtl83xx-switch ... : error -19 setting up PHY for tree 0, switch 0, port 1
...

With patch (loaded with rtk network on & initramfs):

...
rtl83xx-switch ... : PHY [mdio-bus:00] driver [REALTEK RTL8218D] (irq=POLL)
rtl83xx-switch ... : PHY [mdio-bus:01] driver [REALTEK RTL8218D] (irq=POLL)
...

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Markus Stockhausen
74509c0e7d realtek: remove wrong SMI bus from XGS1250
The RTL930x have only 4 SMI busses (0-3) and the XGS1250 SFP port ist
directly managed. Remove the wrong configuration in the dts.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Markus Stockhausen
8f68e1abe5 realtek: phy: fix RTL8218D detection
Currently RTL8218D detection works for a range of devices. That can lead to
false positives. E.g. RTL8218B or RTL8214FC are covered by the detection mask
as well. That is wrong. Nail detection down to the real RTL8218D phy id.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Markus Stockhausen
0ed688a4d9 realtek: phy: simplify RTL8214C detection
The detection of the RTL8214C is a little complicated. Make it easier.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Markus Stockhausen
597f87ebf5 realtek: phy: proper RTL8218B, RTL8214FC, RTL8214FB detection
Three PHYs share the same identifier. Until now we simply assume
the type depending of the bus address it is attached to. Make it
better and check the chip mode register instead.

The kernel will either detect by id/mask or by match_phy_device().
Remove the unneeded settings.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Markus Stockhausen
d607dc2a06 realtek: phy: adapt raw page for RTL839X
The number of phy pages differ between RTL838X and RTL839X. Make that
clear and adapt the existing defines.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Markus Stockhausen
8e4597297d realtek: dsa: increase RTL839x max phy page to 8191
According to the specs the RTL839x provides up to 8192 phy pages.
Especially the "raw" page 8191 is used for different initialization
tasks. Increase the limit.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Markus Stockhausen
a200f0cee7 realtek: dsa: allow USXGMII mode
RTL930x devices need the USXGMII mode. This is a final leftover
from the 6.6 conversion.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16457
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-27 22:26:25 +01:00
Daniel Golle
388de64d9f mediatek: mt7988: add DT entries for WED
Add memory regions and devices used for wireless offloading to the
device tree for MT7988.

This allows using WED on devices with MT7988 SoC and MT7995E, MT7996E or
MT7992E wireless controllers.

Devices with 4 GiB of RAM (or more) will still need ajustments to avoid
running out of swiotlb entries.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-27 14:27:20 +00:00
Rosen Penev
0f5e5dee1d ramips: modernize pwm driver
Add more devm usage.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16649
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-27 15:21:03 +01:00
Kevin Zhang
b5c7c67b8f rockchip: Add LED aliases for FriendlyElec NanoPi R3S
This commit adds OpenWRT's LED aliases to the board DTS
for showing system status on the NanoPi R3S.

Signed-off-by: Kevin Zhang <kevin@kevinzhang.me>
Link: https://github.com/openwrt/openwrt/pull/16738
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-27 14:57:51 +01:00
Kevin Zhang
2902b0a6fb rockchip: Add support for RK3566 FriendlyElec NanoPi R3S
This commit adds support for the FriendlyElec NanoPi R3S.

CPU: Rockchip RK3566, Quad-core Cortex-A55
RAM: 2GB LPDDR4X
Ethernet: GMAC RTL8211F GbE, PCIe R8111H GbE
USB3.0 Host: Type-A x1
Storage: MicroSD Slot x 1, and optional on-board 32GB eMMC
Debug Serial Port: 3.3V TTL, 3-pin 2.54mm pitch connector, 1500000 bauds
LED: LED x 3
RTC: One low-power RTC, supports backup battery input

Both GbE controllers are working (WAN eth0, LAN eth1).
Appropriate LAN/WAN interface assignments and MAC address generation.
All three LEDs are working.
USB appears to be working and has been tested with mass storage.

Installation - microSD:

-Uncompress the OpenWRT sysupgrade.img.gz
-Write image to microSD card using dd or similar tool

Installation - eMMC:

-Boot from microSD
-Uncompress the OpenWRT sysupgrade.img.gz
-Flash to eMMC : dd if=x.img of=/dev/mmcblk0
-sync
-Remove microSD card
-Reboot

Signed-off-by: Kevin Zhang <kevin@kevinzhang.me>
Link: https://github.com/openwrt/openwrt/pull/16738
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-27 14:57:51 +01:00
Rosen Penev
3cdab2ad44
ramips: use platform_get_irq
No need for irq_of_parse_and_map since this is in _probe.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16771
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-27 14:25:24 +01:00
Marius Dinu
63ea5710d9 kernel: add missing CONFIG_DM_AUDIT
The option shows up when kmod-dm and CONFIG_KERNEL_AUDIT are selected.

Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
Link: https://github.com/openwrt/openwrt/pull/16793
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-27 12:45:16 +01:00
Daniel Golle
b6c2422448 generic: mtk_wed: fix path of MT7988 WO firmware
commit eee3c695f3 ("linux-firmware: add offloading firmware for MT7988")
added mt7988_wo_{0,1}.bin in the 'mediatek/mt7988' directory while driver
currently expects the files in the 'mediatek' directory.

Import pending patch which changes the path in the driver header now
that the firmware has been added.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-26 15:21:03 +01:00
Andreas Gnau
1dc86af356
airoha: Clarify subtarget compatibility
Clarify compatibility of the two subtargets with different SoCs to
reduce confusion. The added SoC names only differ in small details such
as features enabled (PoN vs DSL for example).

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/16785
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-25 19:47:07 +02:00
Shiji Yang
d7ed4c77b5 ramips: rt3883: convert devices to interrupt-driven gpio-keys
This converts all RT3662 and RT3883 devices to use interrupt based
gpio-keys instead of gpio-keys-polled. The poll-interval will be
removed.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16764
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-25 13:56:14 +02:00
Shiji Yang
0bcb64041a ramips: rt305x: convert devices to interrupt-driven gpio-keys
This converts all RT305x and RT5350 devices to use interrupt based
gpio-keys instead of gpio-keys-polled. The poll-interval will be
removed.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16764
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-25 13:56:14 +02:00
Shiji Yang
a3819e23be ramips: rt2880: convert devices to interrupt-driven gpio-keys
This converts all RT2880 devices to use interrupt based gpio-keys
instead of gpio-keys-polled. The poll-interval will be removed.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16764
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-25 13:56:14 +02:00
Shiji Yang
7cc53ef09b ramips: mt76x8: convert Minew G1-C to interrupt-driven gpio-keys
All other MT76x8 devices have already been migrated to gpio-keys.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16764
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-25 13:56:14 +02:00
Shiji Yang
0d4616b838 ramips: dts: add the missing interrupt properties for GPIO nodes
The Ralink GPIO driver supports irqchip function. Hence we need to
add "interrupt-parent" and "interrupt-controller" properties to make
sure it works properly. It is worth noting that all GPIO devices
share the same interrupt line.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16764
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-25 13:56:14 +02:00
Shiji Yang
2b2abdbb75 ramips: ralink-gpio: use irqchip helpers to register driver
The gpiolib has already introduced a general GPIO irqchip framework
to initialize the GPIO irqchip[1]. This patch will make use of it
to simplify the legacy Ralink GPIO driver codes. This patch also
includes some code readability improvements.

[1] 1425052097b5 ("gpio: add IRQ chip helpers in gpiolib")
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16764
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-25 13:56:14 +02:00
Rosen Penev
4175828482 mpc85xx: move CONFIG_MTD_SPLIT_FIRMWARE up
It's shared by all targets. Unlike the other shared symbols, it's not
removed by kernel_oldconfig.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16756
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-24 00:30:11 +02:00
Rosen Penev
dfc8e8d09a apm821xx: move CONFIG_GENERIC_PHY up
It's shared by both subtargets.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16754
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-24 00:25:28 +02:00
John Audia
8e294af41b kernel: bump 6.6 to 6.6.58
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.58

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/16758
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-24 00:23:24 +02:00
Daniel Golle
b27075e12b mediatek: add wireless offloading firmware to MT7988 boards
Install mt7988-wo-firmware by default on boards based on MT7988.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-23 13:40:09 +01:00
Christian Marangi
d7dc5b1b4d
airoha: rename subtarget from en7581 to an7581
The Airoha EN7581 got renamed to AN7581 due to move from Econet to
Airoha.

To save on compatibility, use both compatible for the device.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-23 12:32:03 +02:00
Christian Marangi
43d07feb91
airoha: en7581: refresh and fix PWM patch
Refresh and fix PWM patch with new revision proposed upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-23 12:32:03 +02:00
Hauke Mehrtens
1306885968 kernel: Reorder config files
Reorder the kernel configuration files.

This was done uisng:
./scripts/kconfig-reorder.sh

Link: https://github.com/openwrt/openwrt/pull/16743
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 21:13:26 +02:00
Hauke Mehrtens
d0abb26f40 mediatek: Remove double CONFIG_HARDEN_BRANCH_PREDICTOR
CONFIG_HARDEN_BRANCH_PREDICTOR option is included two times in this
configuration file. Remove one definition. On arm32 SoC it should not be
needed.

Fixes: 54f9744c82 ("treewide: disable spectre mitigation on unaffected Arm32 targets")
Link: https://github.com/openwrt/openwrt/pull/16743
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 21:13:26 +02:00
Piotr Dymacz
861a9dac68 ath79: add support for ALFA Network WiFi CampPro Nano Duo
ALFA Network WiFi CampPro Nano Duo is a dual-radio Wi-Fi signal extender
(router) in USB dongle form-factor (Type-A plug is used only for power),
based on combination of two radio chipsets: Qualcomm QCA9531 (main SOC)
and MediaTek MT7610U (connected over USB 2.0 interface).

Specifications:

- SOC:      QCA9531 v2 (650 MHz)
- DRAM:     DDR2 128 MiB (Nanya NT5TU64M16HG-AC)
- Flash:    16 MiB SPI NOR (Macronix MX25L12835F)
- Ethernet: 1x 10/100 Mbps Ethernet (QCA9531)
- Wi-Fi:    2x2:2 2.4   GHz Wi-Fi 4 (QCA9531)
            1x1:1 2.4/5 GHz Wi-Fi 5 (MT7610U)
- Antenna:  3x RP-SMA (female) antenna connectors
- LED:      1x orange (RJ45, power indicator)
            2x green  (status + RJ45 activity/link)
            1x blue   (Wi-Fi 2.4 GHz status)
- Button:   1x button (reset)
- UART:     1x 4-pin, 2.00 mm pitch header on PCB
- Other:    external h/w watchdog (EM6324QYSP5B, enabled by default)
            GPIO-controlled USB power for MT7610U

MAC addresses:

- LAN:                 00:c0:ca:xx:xx:6d (art 0x2, -1)
- 2.4 GHz (QCA9531):   00:c0:ca:xx:xx:6e (art 0x2, device's label)
- 2.4/5 GHz (MT7610U): 00:c0:ca:xx:xx:6f (from eeprom)

Flash instructions:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with RJ45 port, press the reset button, power up device,
   wait for first blink of status LED (indicates network setup), then
   keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2024-10-22 12:25:58 +02:00
Rosen Penev
8f1332d275 kernel: move CONFIG_DRM_OFDRM to generic
Multiple platforms are affected by this, including mpc85xx's p1020.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16746
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:50:55 +02:00
Rosen Penev
9bc0517b78 kernel: gpio-cascade: use gpiochip_get_data
Instead of passing NULL to gpiochip_add_data, we can populate the
parameter and use gpiochip_get_data instead of a custom function.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16739
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:49:18 +02:00
Rosen Penev
19bd5436c7 treewide: remove platform_get_resoruce
Easier to just use devm_platform_ioremap_resource.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16701
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:44:33 +02:00
Matthew Hagan
7ad9988287 bcm53xx: add support for Cisco Meraki MX64/MX65
This commit adds support for the Cisco Meraki MX64 and MX65 devices which
use the Broadcom NSP SoC, which is compatible with the bcm53xx platform.

MX64 Hardware info:
  - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz
  - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR)
  - Storage: 1 GB (Micron MT29F8G08ABACA)
  - Networking: BCM58625 internal switch (5x 1GbE ports)
  - USB: 1x USB2.0
  - Serial: Internal header

MX65 Hardware info:
  - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz
  - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR)
  - Storage: 1 GB (Micron MT29F8G08ABACA)
  - Networking: BCM58625 switch (2x 1GbE ports, used for WAN ports 1 & 2)
    2x Qualcomm QCA8337 switches (10x 1GbE ports, used for LAN ports 3-12)
  - PSE: Broadcom BCM59111KMLG connected to LAN ports 11 & 12
  - USB: 1x USB2.0
  - Serial: Internal header

Notes:
  - The Meraki provided GPL source are available at [2].
  - Wireless capability on the MX64W and MX65W exists in the form of 2x
    Broadcom BCM43520KMLG, which is not supported. These devices will work
    otherwise as standard MX64 or MX65 devices.
  - Early MX64 units use an A0 variant of the BCM958625 SoC which lacks
    cache coherency and uses a different "secondary-boot-reg". As a
    consequence a different device tree is needed.
  - Installation of OpenWrt requires changing u-boot to a custom version.
    This is due to the stock u-boot "nand read" command being limited to
    load only 2MB, in spite of the bootkernel1 and bootkernel2 partitions
    both being 3MB in the stock layout. It is also required to allow
    booting via USB, enabling cache coherency and setting up the QCA
    switches and Serdes link on the MX65. The modified sources for U-boot
    are available for the MX64[3] and MX65[4].
  - Initial work on this device used a small bootloader within the OEM
    partition scheme. To allow booting of larger kernels, UBI and bootm
    support has been added, along with ability to store env variables to
    the NAND. The Shmoo and newly created env partitions have been moved
    to the extra space available after the nvram data.
  - Users who installed the previous non-UBI supporting bootloader will
    need to convert to the new one before flashing a compatible image.
    These steps are detailed below.

References:

[1] https://www.broadcom.com/products/embedded-and-networking-processors/c
ommunications/bcm5862x
[2] https://dl.meraki.net/wired-14-39-mx64-20190426.tar.bz2
[3] https://github.com/clayface/U-boot-MX64-20190430_MX64
[4] https://github.com/clayface/U-boot-MX64-20190430_MX65

Installation guide:

Initial installation steps:
  1. Compile or obtain OpenWrt files for the MX64 or MX65, including
     u-boot[3][4], initramfs and sysupgrade images.
  2. A USB disk with DOS partition scheme and primary FAT partition is
     required.
  3. If installing onto an MX64, set up a local web server.
  4. On the device, boot into diagnostic mode by holding reset when
     powering on the device. Continue to hold reset until the orange LED
     begins to flash white. On used units the white flash may be difficult
     to see.
  5. Plug an Ethernet cable into the first LAN port, set the host to
     192.168.1.2 and confirm telnet connectivity to 192.168.1.1.

U-boot installation - MX64 Only:
  1. Newer fw versions require extra steps to support OpenWrt. To check,
     please connect via telnet and run:
        `cat /sys/block/mtdblock0/ro`
     If the result is 1, your mtd0 is locked will need to perform extra
     steps 4 and 5 in this section. If the result is 0 then skip these.

  2. Check which SoC is in use by running the following command:
        `devmem 0x18000000`
     If devmem is not found then try:
        `devmem2 0x18000000`
     If the output begins with anything between "0x3F00-0x3F03" you will
     need to use the A0 release. For any other output, eg "0x3F04" or
     higher, use the regular MX64 image.

  3  Confirm the size of the device's boot(mtd0) partition. In most
     cases it should be 0x100000 or larger. If this is the case, please
     proceed to use the uboot_mx64 image. If the reported size is
     0x80000, please use the uboot_mx64_small image, then follow the
     later guide to change to the larger image.
        `cat /proc/mtd`
     Example output:
        `# cat /proc/mtd
        cat /proc/mtd
        dev:    size   erasesize  name
        mtd0: 00100000 00040000 "boot"
        mtd1: 00080000 00040000 "shmoo"
        mtd2: 00300000 00040000 "bootkernel1"
        mtd3: 00100000 00040000 "nvram"
        mtd4: 00300000 00040000 "bootkernel2"
        mtd5: 3f700000 00040000 "ubi"
        mtd6: 40000000 00040000 "all"`

  4. Set up a webserver to serve the appropriate uboot_mx64 from the
     following location and verify the SHA512:
     https://github.com/clayface/U-boot-MX64-20190430_MX64

  5. (Only if mtd0 is locked) You will also need the mtd-rw.ko kernel
     module to unlock the partition from the same repo. An mtd executable
     is also needed to write the mtd block. Place these on the web server
     as well.

  6. (Only if mtd0 is locked) Use wget to retrieve the files on the MX64:
        `wget http://192.168.1.2/mtd-rw.ko`
        `insmod mtd-rw.ko i_want_a_brick=1`
     and confirm the unlock is set with dmesg
        `mtd-rw: mtd0: setting writeable flag`

  7. Download the appropriate u-boot image according to step 3. If you
     did not need to unlock the mtd0 partition then use dd to write the
     file, with caution:
        `wget http://192.168.1.2/uboot_mx64`
        `dd if=uboot_mx64 of=/dev/mtdblock0`
     If you needed to unlock the mtd0 partition using the mtd-rw module,
     run these commands instead to install u-boot instead:
        `wget http://192.168.1.2/mtd`
        `chmod +x mtd`
        `wget http://192.168.1.2/uboot_mx64`
        `./mtd write uboot_mx64 /dev/mtd0`

  8. Once this has successfully completed, power off the device. If you
     did not need to install the small u-boot image, proceed to
     "OpenWrt Installation". Otherwise proceed to "UBI supporting
     bootloader installation".

U-boot installation - MX65 Only:
  1. Obtain telnet access to the MX65.

  2. Confirm the size of the device's boot(mtd0) partition. In most
     cases it should be 0x100000 or larger. If this is the case, please
     proceed to use the uboot_mx65 image. If the reported size is
     0x80000, please use the uboot_mx65_small image, then follow the
     later guide to change to the larger image.
	`cat /proc/mtd`

  3. Prepare a USB drive formatted to FAT. Download the appropriate
     uboot_mx65 to the USB drive from the following location and verify
     the SHA512:
        https://github.com/clayface/U-boot-MX64-20190430_MX65

  3. Once you have telnet access to the MX65, plug in the USB disk and
     run the following commands, with caution. The USB disk should
     automount but if it does not, you will need to power off and on
     again with reset held. Depending on step 2, use the uboot_mx65 or
     uboot_mx65_small image accordingly:
        `cd /tmp/media/sda1`
        `dd if=uboot_mx65 of=/dev/mtdblock0`

  4. Once this has successfully completed, power off the device. If you
     did not need to install the small u-boot image, proceed to
     "OpenWrt Installation". Otherwise proceed to "UBI supporting
     bootloader installation".

UBI supporting bootloader installation:
  These steps need to be followed if the older u-boot image was
  installed, either because the Meraki diagnostic partition scheme used
  0x80000 as the mtd0 size, or because you installed the u-boot provided
  while OpenWrt support was still under development. If using OpenWrt,
  please make a backup before proceeding.

  1. Obtain the relevant image from the MX64(A0) or MX65 u-boot repo:
        `openwrt-bcm5862x-generic-meraki_XXXX-initramfs-kernel.bin`

  2. With the USB drive already inserted, power on the device while
     holding the reset button. A white/orange flashing pattern will
     occur shortly after power on. Let go of the reset button. The
     device is now booting into OpenWrt initramfs stored on the USB
     disk.

  3. Connect by SSH to 192.168.1.1 and flash the embedded u-boot image,
     changing X as appropriate:
        `mtd write /root/uboot_mx6X /dev/mtd0`
     You do not need to reboot as this image can handle "Kernel-in-UBI"
     OpenWrt installation.

  4. You can proceed to obtain and flash the appropriate OpenWrt image
     at "OpenWrt Installation" Step 3.

  5. Reboot will take significantly longer due to Shmoo calibration. In
     case the device does not come online after several minute, power-
     cycle the device and see if it boots. If you see an orange/white
     flashing pattern, this indicates UBI booting was not successful and
     you will need to copy a new bcm53xx image to a USB disk before
     booting it and attempting to install OpenWrt again - refer to
     "OpenWrt Installation" step 1. Do not attempt to reflash u-boot in
     this scenario.

OpenWrt Installation:
  1. Having obtained an OpenWrt image, please copy the file
        `openwrt-bcm53xx-generic-meraki_XXXX-initramfs.bin`
     to the base directory of a FAT formatted USB drive using DOS
     partition scheme ,where XXXX is mx64, mx64_a0 or mx65 depending on
     which device you have.

  2. With the USB drive already inserted, power on the device. Boot time
     will be longer than usual while Shmoo calibration takes place. A
     different white/orange flashing pattern will eventually occur to
     indicate device is now booting into OpenWrt initramfs stored on the
     USB disk.

  3. Ensuring Ethernet is plugged into a LAN port with IP set in the
     192.168.1.0/24 subnet excluding 192.168.1.1, use SCP to copy the
     sysupgrade file to 192.168.1.1:/tmp, eg:
        `scp openwrt-bcm53xx-generic-meraki_XXXX-squashfs.sysupgrade.bin\
        192.168.1.1:/tmp`

  4. Connect by SSH to 192.168.1.1 and run sysupgrade:
        `sysupgrade \
        /tmp/openwrt-bcm53xx-generic-meraki_XXXX-squashfs.sysupgrade.bin`

  5. OpenWrt should now be installed on the device.

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>

[ Rebase kernel configuration for 6.6,
  fix failsafe by making kmod-eeprom-at24 and kmod-dsa-qca8k built-in,
  resolve conflicts,
  add LED aliases,
  fix eth0 MAC address at probe ]

TODO:
- fix multiple LED colors not applied despite aliases - due to custom
  /etc/diag.sh
- fix race condition between preinit and probing of the DSA tree,
  causing no network interface available in failsafe mode (in general
  case - to allow moving drivers back to modules)

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16634
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:39:32 +02:00
Lech Perczak
d2ffd43171 bcm53xx: enable CONFIG_NET_DSA_QCA8K
Enable support for qca8k switch used in Meraki MX65. This is required to
properly support preinit networking on this device, otherwise unit won't
be accessible in failsafe mode.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16634
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:39:32 +02:00
Lech Perczak
a69eaf8079 bcm53xx: enable CONFIG_I2C_BCM_IPROC
This is required for the AT24 EEPROM holding MAC address on Meraki
devices to probe before preinit starts, so all network devices can be
available at the preinit network setup starts

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16634
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:39:32 +02:00
Lech Perczak
64424c2427 bcm53xx: enable CONFIG_EEPROM_AT24
Meraki MX6x devices use them to store MAC address, so it is required to be
built-in for networking to probe properly, before preinit network setup
happens, which in turn is required for proper failsafe mode access.
Enable CONFIG_EEPROM_AT24 for the target.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16634
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:39:32 +02:00
Lech Perczak
8d7c08f884 bcm53xx: meraki: backport NVMEM layout syntax patch
This patch is required to support reading MAC address on Meraki MX64/65
line of devices, but also touches MR32, so let's backport it first.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16634
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:39:32 +02:00
Matthew Hagan
3bd129f8e0 bcm53xx: MR26,MR32: use REQUIRE_IMAGE_METADATA
This patch adds "REQUIRE_IMAGE_METADATA=1" requirement for the MR26 and
MR32, with REQUIRE_IMAGE_METADATA explicitly 0 elsewhere. This is based
upon bcm63xx's base-files/lib/upgrade/platform.sh.

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16634
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:39:32 +02:00
Rosen Penev
caf29ee97b apm821xx: nand: add NVMEM-on-UBI support
Oversight from 8d302f5ebc , which requires
this to work. I couldn't test it as I ended up wiping my UBI volume by
accident.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16580
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-21 20:54:55 +02:00
Rosen Penev
7754924c9e apm821xx: remove ethernet0 node
This is needed in order to get a MAC address from UBI.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16580
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-21 20:54:55 +02:00
Rosen Penev
8b42827b4c apm821xx: fix volume/volname
linux,ubi expects the volname variable, not volume.

This will fix NVMEM-on-UBI.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16580
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-21 20:54:55 +02:00
Rosen Penev
0dfb7529b7 apm821xx: nand: 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/16580
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-21 20:54:55 +02:00
Rosen Penev
684a4f7e94 apm821xx: nand: sort config-default
make kernel_oldconfig doesn't seem to work with this. Handle manually.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16580
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-21 20:54:55 +02:00
Rosen Penev
eb5f0e3507 apm821xx: 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/16580
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-21 20:54:55 +02:00
Rosen Penev
f9da81d32f siflower: gpio: use gpiochip_get_data
No need to use container_of.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16749
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2024-10-21 09:18:21 +08:00
Daniel Golle
e550c6d381 mediatek: fix OpenWrt One ubinized image in IB
The ImageBuilder when using the profile for the OpenWrt One has been
failing because the initramfs image included in the ubinized image could
not be found.

Fix that by using the staged initramfs instead when using the
ImageBuilder.

Fixes: 797904b3cb ("mediatek/filogic: add OpenWrt One support")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-21 00:49:22 +01:00
Christian Marangi
9131cb44ff
airoha: Introduce EN7581 SoC support
Introduce EN7581 SoC support with currently rfb board supported.

This is a new 64bit SoC from Airoha that is currently almost fully
supported upstream with only the DTS missing. Setting source-only
waiting for the full upstream support to be completed.

Link: https://github.com/openwrt/openwrt/pull/16730
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-20 23:24:08 +02:00
Christian Marangi
c5f38c1fd0
generic: backport alloc_netdev_dummy patch from upstream
Backport alloc_netdev_dummy patch from upstream needed for new Airoha
EN7581 SoC.

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

Link: https://github.com/openwrt/openwrt/pull/16730
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-20 23:24:08 +02:00
Christian Marangi
cccf3181a6
airoha: move en7523 in dedicated subtarget
In preparation for EN7581 SoC support, move en7523 in dedicated
subtarget.

This is needed as EN7581 is now 64bit but en7523 is 32bit hence have
very different kernel config.

Also rename patch to a more friendly number sequence.

Link: https://github.com/openwrt/openwrt/pull/16730
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-20 23:24:07 +02:00
Priit Laes
66d2d037ad ath79: add support for COMFAST CF-E355AC v2
COMFAST CF-E355AC v2 is a ceiling mount AP with PoE support,
based on Qualcomm/Atheros QCA9531 + QCA9886.

Short specification:

- 1x 10/100 Mbps Ethernet, with PoE support (wan/eth1)
- 1x 10/100/1000 Mbps Ethernet, with PoE support (lan/eth0)
- 128MB of RAM (DDR2)
- 16 MB of FLASH
- 2T2R 2.4 GHz, 802.11b/g/n (wlan2g)
- 2T2R 5 GHz, 802.11ac/n/a, WAVE 2 (wlan5g)
- built-in 4x 3 dBi antennas
- output power (max): 500 mW (27 dBm)
- 1x RGB LED, 1x button
- separate watchdog chip via GPIO (bottom of PCB?)
- UART header on PCB with proper labelling

Markings on PCB:

* R121QH_VER2.1 (silkscreen, bottom)
* CF-WA800 (sticker, top)

Initial flashing instructions:

Original firmware is based on OpenWrt.

a) Use sysupgrade image directly in vendor GUI.

b) Or via tftp:

  ipaddr=192.168.1.1
  serverip=192.168.1.10
  bootfile="firmware.bin"

c) Or possibly via u-boot's `httpd` command.

MAC-address mapping follows original firmware:

* eth1 (wan) is the lowest mac address (art @ 0x0)
* eth0 (lan) uses eth1 + 1 (art @ 0x1002)
* wlan2g (phy1) uses eth1 + 2 (art @ 0x06)
* wlan5g (phy0) uses eth1 + 10 (not present in art)
* unused MAC (eth1 + 3) (art @ 0x5006)

Art dump (`hexdump /dev/mtd1 |grep ZZZZ`):

  0000000 ZZZZ XXXX XXX0 ZZZZ XXXX XXX2 ffff ffff
  0001000 0202 ZZZZ XXXX XXX1 0000 0000 0000 0000
  0005000 202f bd21 0101 ZZZZ XXXX XXX3 0000 2000

Root access to original firmware (only via UART) can be achieved by
making a backup of configuration from web interface. Backup contains
whole `/etc` directory...

Signed-off-by: Priit Laes <plaes@plaes.org>
Link: https://github.com/openwrt/openwrt/pull/16556
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-20 22:07:32 +02:00
Felix Fietkau
2a1daeaabd kernel: fix forwarding broadcast packets between vlan-on-dsa and non-dsa netdevs
Fix conditions for handling offloaded packets

Fixes: #13430
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-10-20 18:46:33 +02:00