Commit Graph

27588 Commits

Author SHA1 Message Date
Rafał Miłecki
69ea580882 treewide: update NVMEM symbols
Fixes: 8dfe69cdfc ("kernel: update nvmem subsystem to the latest upstream")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-01-07 01:30:31 +01:00
Rafał Miłecki
8dfe69cdfc kernel: update nvmem subsystem to the latest upstream
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-01-06 22:08:03 +01:00
Enrico Mioso
d3e89e69c5 mvebu: harmonize GL.iNet GL-MV1000 MTD partitions layout with vendor
The GL-MV1000 ships with a 16MB spi-nor flash, containing a copy of the stock GL.iNet firmware.
Add the corresponding flash areas, so our view matches the one of the in-flash stock firmware.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
2023-01-06 19:59:42 +01:00
Tim Harvey
af5635e6ca octeontx: add sqaushfs and ramdisk to features
Add squashfs and ramdisk to features as these are commonly used images
for the octeontx.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2023-01-06 19:44:35 +01:00
Leon M. Busch-George
f6d394e9f2 ramips: add support for Cudy M1800
Specifications

  SoC:       MT7621
  CPU:       880 MHz
  Flash:     32 MiB
  RAM:       256 MiB
  WLAN:      MT7915 WiFi 6 (2.4/5 GHz)
  Ethernet:  2x Gbit ports

                  MAC
LAN        b4:4b:d6:2e:c7:b0 (label)
WAN        b4:4b:d6:2e:c7:b1
WiFi 2.4   00:0c:43:26:46:08
WiFi 5     00:0c:43:26:59:97

Installation

There are two known options:
1) The Luci-based UI.
2) Press and hold the reset button during power up.
   The router will request 'recovery.bin' from a TFTP server at
   192.168.1.88.

Both options require a signed firmware binary.
The openwrt image supplied by cudy is signed and can be used to
install unsigned images.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
2023-01-06 19:22:52 +01:00
Leon M. Busch-George
ed7c1a504e kernel: add patch to support en25qh256a
The EN25QH256A variant of the EN25QH256 doesn't initialize correctly from SFDP
alone and only accesses memory below 8m (addr_width is 4 but read_opcode takes
only 3 bytes).

Set SNOR_F_4B_OPCODES if the flash chip variant was detected using hwcaps.

The fix submitted upstream uses the PARSE_SFDP initializer that is not
available in the kernel used with Openwrt.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
2023-01-06 19:22:52 +01:00
Joe Mullally
4965cbd259 ath79: tiny: Do not build TPLink WPA8630Pv2 by default
22.03.1+ and snapshot builds no longer fit the 6M flash space
available for these models.

This disables failing buildbot image builds for these devices.
Images can still be built manually with ImageBuilder.

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
2023-01-06 18:52:01 +01:00
Florian Eckert
744a5ab9ce target/imagebuilder: add help text and rename whatdepends to package_whatdepens
Add the command `package_whatdepends` to show all package that have a
dependency to this packages.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-01-06 18:44:45 +01:00
Florian Eckert
c75a565d2c target/imagebuilder: update help text for manifest target
- Add a help text for the manifest command.
- Unify command detail help text to use `manifest`.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-01-06 18:44:45 +01:00
Florian Eckert
e1cf4688ec target/imagebuilder: change help text for image build
Using command `image` to unify help text.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-01-06 18:44:44 +01:00
Florian Eckert
7b60dba954 target/imagebuilder: add depends target to show all package that gets installed
This commits adds the makefile targets `depends` this wrapper is a call
to `opkg depends`. This command shows which runtime dependencies exist
if this package is installed into the image.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-01-06 18:44:44 +01:00
Stefan Kalscheuer
f193f2d1a0 ath79: convert UBNT Aircube AC WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Merge art into partition node.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
2023-01-06 18:20:31 +01:00
Maxim Anisimov
dbebfb88b5 ramips: add support for Keenetic KN-1613
Keenetic KN-1613 is a 2.4/5 Ghz band 11ac (Wi-Fi 5) router, based on MT7628AN.

Specification:
- System-On-Chip: MT7628AN
- CPU/Speed: 580 MHz
- Flash-Chip: Winbond w25q256
- Flash size: 32768 KiB
- RAM: 128 MiB
- 4x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- Wireless No1 (2T2R): SoC Built-in 2.4 GHz 802.11bgn
- Wireless No2 (2T2R): MT7613BE 5 GHz 802.11ac
- 4x LED, 2x button, 1x mode switch

Notes:
- The device supports dual boot mode
- The firmware partitions were concatinated into one
- The FN button led indicator has been reassigned as the 2.4GHz
  wifi indicator.

Flash instruction:
The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24 and tftp server.
2. Rename "openwrt-ramips-mt76x8-keenetic_kn-1613-squashfs-factory.bin"
   to "KN-1613_recovery.bin" and place it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed until power led start blinking.
4. Router will download file from server, write it to flash and reboot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2023-01-06 17:53:10 +01:00
Maxim Anisimov
4eeecf41cf ramips: enable mtd virtual concat support for mt76x8 subtarget
This is required for upcoming Keenetic KN-1613 support

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2023-01-06 17:53:10 +01:00
Vincent Tremblay
2fab942ce1 generic: fix silicon labs spidev bindings
Fix Silicon Labs bindings in the spidev driver

Some bindings for Silicon Labs chips already exists upstream.
These bindings can be found in trivial-devices.yaml.

The existing bindings are using "silabs" instead of "siliconlabs" to
identify the manufacturer.

This commit add two submitted patches for silabs chips and rename the
manufacturer in the different DTS for more coherence.

Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
2023-01-06 16:01:10 +01:00
Michael Pratt
e085812a7d ath79: add support for Fortinet FAP-221-B
FCC ID: U2M-CAP4100AG

Fortinet FAP-221-B is an indoor access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

Hardware and board design from Senao

**Specification:**

 - AR9344 SOC		2G 2x2, 5G 2x2, 25 MHz CLK
 - AR9382 WLAN		2G 2x2 PCIe, 40 MHz CLK
 - AR8035-A PHY		RGMII, PoE+ IN, 25 MHz CLK
 - 16 MB FLASH		MX25L12845EMI-10G
 - 2x 32 MB RAM		W9725G6JB-25
 - UART at J11		populated, 9600 baud
 - 6 LEDs, 1 button	power, ethernet, wlan, reset

  Note:	ethernet LEDs are not enabled
	because a new netifd hotplug is required
	in order to operate like OEM.
	Board has 1 amber and 1 green
	for each of the 3 case viewports.

**MAC addresses:**

1 MAC Address in flash at end of uboot
ASCII encoded, no delimiters
Labeled as "MAC Address" on case
OEM firmware sets offsets 1 and 8 for wlan

  eth0 *:1e	uboot 0x3ff80
  phy0 *:1f	uboot 0x3ff80 +1
  phy1 *:26	uboot 0x3ff80 +8

**Serial Access:**

Pinout: (arrow) VCC GND RX TX

Pins are populated with a header and traces not blocked.
Bootloader is set to 9600 baud, 8 data, 1 stop.

**Console Access:**

Bootloader:

Interrupt boot with Ctrl+C
Press "k" and enter password "1"
OR
Hold reset button for 5 sec during power on
Interrupt the TFTP transfer with Ctrl+C

to print commands available, enter "help"

OEM:

default username is "admin", password blank
telnet is available at default address 192.168.1.2
serial is available with baud 9600

to print commands available, enter "help"
or tab-tab (busybox list of commands)

**Installation:**

Use factory.bin with OEM upgrade procedures
OR
Use initramfs.bin with uboot TFTP commands.
Then perform a sysupgrade with sysupgrade.bin

**TFTP Recovery:**

Using serial console, load initramfs.bin using TFTP
to boot openwrt without touching the flash.
TFTP is not reliable due to bugged bootloader,
set MTU to 600 and try many times.
If your TFTP server supports setting block size,
higher block size is better.
Splitting the file into 1 MB parts may be necessary

example:

$ tftpboot 0x80100000 image1.bin
$ tftpboot 0x80200000 image2.bin
$ tftpboot 0x80300000 image3.bin
$ tftpboot 0x80400000 image4.bin
$ tftpboot 0x80500000 image5.bin
$ tftpboot 0x80600000 image6.bin
$ bootm 0x80100000

**Return to OEM:**

The best way to return to OEM firmware
is to have a copy of the MTD partitions
before flashing Openwrt.

Backup copies should be made of partitions
"fwconcat0", "loader", and "fwconcat1"
which together is the same flash range
as OEM's "rootfs" and "uimage"
by loading an initramfs.bin
and using LuCI to download the mtdblocks.

It is also possible to extract from the
OEM firmware upgrade image by splitting it up
in parts of lengths that correspond
to the partitions in openwrt
and write them to flash,
after gzip decompression.

After writing to the firmware partitions,
erase the "reserved" partition and reboot.

**OEM firmware image format:**

Images from Fortinet for this device
ending with the suffix .out
are actually a .gz file

The gzip metadata stores the original filename
before compression, which is a special string
used to verify the image during OEM upgrade.

After gzip decompression, the resulting file
is an exact copy of the MTD partitions
"rootfs" and "uimage" combined in the same order and size
that they appear in /proc/mtd and as they are on flash.

OEM upgrade is performed by a customized busybox
with the command "upgrade".
Another binary, "restore"
is a wrapper for busybox's "tftp" and "upgrade".

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-01-06 15:34:07 +01:00
Michael Pratt
766de7013f ath79: allow skipping hash for Senao sysupgrade
Some vendors of Senao boards have a similar flash layout
situation that causes the need to split the firmware partition
and use the lzma-loader, but do not store
checksums of the partitions or otherwise
do not even have a uboot environment partition.

This adds simple shell logic to skip that part.

Also, simplify some lines and variable usage.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-01-06 15:34:07 +01:00
Michael Pratt
8342c092a0 ath79: use lzma-loader for Senao initramfs images
Some vendors of Senao boards have put a bootloader
that cannot handle both large gzip or large lzma files.

There is no disadvantage by doing this for all of them.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-01-06 15:34:07 +01:00
Rafał Miłecki
457cc59795 kernel: 5.10: update nvmem subsystem to the 5.15 state
This allows cleanly backporting more recent stuff that's important for
OpenWrt.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-01-06 14:34:37 +01:00
John Audia
2621ddb0be kernel: bump 5.10 to 5.10.162
All patches automatically rebased.

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-01-06 12:13:49 +01:00
Pascal Ernster
720b243171 realtek: 5.15: Improve error handling in rtl838x_pie_rule_write()
In target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c,
make rtl838x_pie_rule_write() return non-zero value case of error.

Signed-off-by: Pascal Ernster <git@hardfalcon.net>
2023-01-05 23:09:23 +01:00
Pascal Ernster
a188536ef6 realtek: 5.15: Improve rtl838x dsa driver error handling
Make sure functions calling rtl838x_smi_wait_op() return its return
value in target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c.
This brings the code style in line with the rtl839x implementation.

Suggested-by: Sander Vanheule <sander@svanheule.net>
Signed-off-by: Pascal Ernster <git@hardfalcon.net>
2023-01-05 23:08:13 +01:00
Pascal Ernster
de2dc3feae realtek: return correct error value for phy ops
A behavioural change was introduced with commit 758c88b969 ("realtek:
Whitespace and codestyle cleanup") causing rtl838x_read_phy() and
rtl838x_write_phy() to unconditionally return -ETIMEDOUT. As a result,
probing the device during boot fails:

    Error setting up netdev, freeing it again.
    rtl838x-eth: probe of 1b00a300.ethernet failed with error -5

Fix the bootloop caused by this regression with kernel 5.15 on rtl838x
devices, by properly returning 0 on success.

Tested on a Netgear GS108T v3, a Netgear GS310TP v1, a Zyxel GS1900-8HP
v1 and an HPE 1920-8G.

Fixes: 758c88b969 ("realtek: Whitespace and codestyle cleanup")
Tested-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Jan Hoffmann <jan@3e8.eu>
Signed-off-by: Pascal Ernster <git@hardfalcon.net>
2023-01-05 23:08:04 +01:00
Olliver Schinagl
44e0785285 realtek: Migrate to upstream generic MIPS addresses
Upstream generic MIPS uses 0x80100000 and 0x80100400 for the LOADADDR
and ENTRY addresses. As we do not want to diverge from upstream and
patch upstream when not needed, adjust our addresses as well to be
future proof.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Tested-by: Jan Hoffmann <jan@3e8.eu> # HPE 1920-8G, HPE 1920-48G
2023-01-05 21:59:20 +01:00
Ignas Poklad
7801e814dd ramips: add Unielec U7621-06 32M build target
Add 32M build target

Rest of the details as per commit 46ab81e405 ("ramips add support for
UniElec U7621-06")

Signed-off-by: Ignas Poklad <ignas2526@gmail.com>
2023-01-05 00:10:14 +01:00
Nick Hainke
aa6c8c38ea ath79: convert Netgear WNDAP360 WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Merge art into partition node.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-01-04 23:59:09 +01:00
Florian Maurer
0820d62012 lantiq-xrx200: fix wan LED on o2 box 6431
The WIFI LED already worked for me with the latest openwrt 22.03 version.
Wifi LED did not with an older 22.x version (in gluon - there phy0radio did nothing but phy0tpt did show activity

the WAN interface has the name "wan" and not "pppoe-wan" on this device

fixes #7757 (and FS#2987)

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
2023-01-04 23:50:48 +01:00
Shiji Yang
6760c7cbe5 ramips: enable Wi-Fi LED support for Afoundry EW1200
Add LED properties to PCIe node to enable Wi-Fi LED support.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-01-04 23:32:27 +01:00
Shiji Yang
0eefea2ed7 ramips: enable Wi-Fi LED support for Zbtlink ZBT-WE1326
Add LED properties to PCIe node to enable Wi-Fi LED support.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-01-04 23:32:27 +01:00
Nikolay Martynov
665c2154ef ramips: add basic support for tp-link er605-v2
This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port.
The board has headers to attach console. In order for them to work two solder
bridges near those pads need to be made.

The defice has the following partition table:

```
0x000000000000-0x000000080000 : "u-boot"
0x000000080000-0x000000100000 : "u-boot-env"
0x000000100000-0x000000140000 : "factory"
0x000000140000-0x000007e00000 : "firmware"
0x000007e00000-0x000008000000 : "panic-ops"
```

`firmware` partition contains UBI volumes. Unfortunately I accidentally wiped
partition and I no longer have access to it.

`firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot.
It also contains various configuration partitions that include device info and
MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes.

U-boot has `mtkupgrade` command that just overrides data on firmware partitions.
Firmware file provided by TP-Link cannot be used with that command.

U-boot also has 'recovery' http server. Unfortunately I was not able to make it
work with manufacturer's firmware.

Manufacturer's firmware essentially contains multiple UBI volumes along with
'partition table'. Unfortunately I no longer can properly run manufacturer's
firmware so I cannot at the moment try to a support for building 'factory' images.

This patch adds support for initramfs image as well as sysupgrade image.

This seems to be pretty standard MT7621 board otherwise.

Things that work:
* network
* leds
* usb
* factory MAC detection

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2023-01-04 23:19:19 +01:00
Marian Sarcinschi
c4b806d5c4 ramips: add missing LEDs to Asus RT-AX53U
This patch adds the missing LEDs to Asus RT-AX53U.
Based on PR #10400 and patch provided in #11068
 - enable the two LEDs controlled by mt7915e for wireless;
 - add label to power LED so it works properly and fix formatting;
 - add the USB LED;
 - switch LEDs are best left to be controlled by hardware for now.

Co-Authored-By: Ivan Rozhuk <rozhuk.im@gmail.com>
Co-Authored-By: Shiji Yang <yangshiji66@qq.com>
Co-Authored-By: Hartmut Birr <e9hack@gmail.com>
Tested-by: Felix Baumann <felix.bau@gmx.de>
Tested-by: Marian Sarcinschi <znevna@gmail.com>
Signed-off-by: Marian Sarcinschi <znevna@gmail.com>
2023-01-04 21:56:49 +01:00
Bjoern Dobe
1036545b00
ipq40xx: fix wlan mac address for Aruba AP-303H
Assigns the correct mac address from nvmen to the wlan interfaces.
This Mac address corresponds to the label "Wireless MAC" on the device
and the stock firmware.
Removes duplicate entry of calibration variant for both radios.

Fixes: cfc13c4459 ("ipq40xx: utilize nvmem-cells for macs & (pre-)calibration data")
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Bjoern Dobe <bjoern@dobecom.de>
2023-01-04 19:17:56 +01:00
Christian Marangi
f4d949b404
generic: 5.15: backport qca8k fixup for mgmt and mdio read/write
Backport qca8k fixup for mgmt and mdio read/write for kernel 5.15 fixup
port dropping and configuration issue.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
2023-01-04 16:54:19 +01:00
Seth David Schoen
68f983ba41 generic: 5.10: backport Treat IPv4 segment's lowest address as unicast
Backport patch from kernel 5.14.

Treat only the highest, not the lowest, IPv4 address within a local
subnet as a broadcast address, as subnets do not need two different
broadcast addresses and networking documentation consistently prefers
the highest address as broadcast.

This patch was merged in upstream net-next tree in May 2021 at

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=94c821c74bf5

This eventually frees up one address per subnet. It matches behavior
suggested in our Internet-Draft, and also the default behavior of OpenBSD
and FreeBSD.

Signed-off-by: Seth David Schoen <schoen@loyalty.org>
2023-01-04 00:48:15 +01:00
John Audia
738b04c881 kernel: bump 5.15 to 5.15.86
Removed upstreamed:
  pending-5.15/101-Use-stddefs.h-instead-of-compiler.h.patch[1]
  ipq806x/patches-5.15/122-01-clk-qcom-clk-krait-fix-wrong-div2-functions.patch[2]
  bcm27xx/patches-5.15/950-0198-drm-fourcc-Add-packed-10bit-YUV-4-2-0-format.patch[3]

Manually rebased:
  ramips/patches-5.15/100-PCI-mt7621-Add-MediaTek-MT7621-PCIe-host-controller-.patch[4]

Added patch/backported:
  ramips/patches-5.15/107-PCI-mt7621-Add-sentinel-to-quirks-table.patch[5]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.86&id=c160505c9b574b346031fdf2c649d19e7939ca11
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.86&id=a051e10bfc6906d29dae7a31f0773f2702edfe1b
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.86&id=ec1727f89ecd6f2252c0c75e200058819f7ce47a
4. Quilt gave this output when I applied the patch to rebase it:
% quilt push -f
Applying patch platform/100-PCI-mt7621-Add-MediaTek-MT7621-PCIe-host-controller-.patch
patching file arch/mips/ralink/Kconfig
patching file drivers/pci/controller/Kconfig
patching file drivers/pci/controller/Makefile
patching file drivers/staging/Kconfig
patching file drivers/staging/Makefile
patching file drivers/staging/mt7621-pci/Kconfig
patching file drivers/staging/mt7621-pci/Makefile
patching file drivers/staging/mt7621-pci/TODO
patching file drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt
patching file drivers/staging/mt7621-pci/pci-mt7621.c
Hunk #1 FAILED at 1.
Not deleting file drivers/staging/mt7621-pci/pci-mt7621.c as content differs from patch
1 out of 1 hunk FAILED -- saving rejects to file drivers/staging/mt7621-pci/pci-mt7621.c.rej
patching file drivers/pci/controller/pcie-mt7621.c
Applied patch platform/100-PCI-mt7621-Add-MediaTek-MT7621-PCIe-host-controller-.patch (forced; needs refresh)

Upon inspecting drivers/staging/mt7621-pci/pci-mt7621.c.rej, it seems that
the original patch wants to delete drivers/staging/mt7621-pci/pci-mt7621.c
but upstream's version was not an exact match.  I opted to delete that
file.

5. Suggestion by hauke: 19098934f9
"This patch is in upstream kernel, but it was backported to the old
staging driver in kernel 5.15."

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

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-01-03 23:55:45 +01:00
Robert Marko
a80e630131 oxnas: sata_oxnas: use ata_link_err
Kernel 5.15.86 has backported ("ata: libata: move ata_{port,link,dev}_dbg
to standard pr_XXX() macros") and this is now causing compilation errors
for oxnas SATA driver due to usage of ata_link_printk().

Upstream has migrated to using the appropriate
ata_link_{err, warn, notice, info} calls a while ago so its not affected.

Lets do the same for oxnas SATA driver and use ata_link_err() instead of
ata_link_printk().

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-03 23:40:30 +01:00
Nick Hainke
b069d4ac6d octeontx: add 5.15 testing kernel
Add 5.15 as testing.

Refreshed:
- 0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch

Acked-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-01-03 20:56:01 +01:00
Nick Hainke
c6edf3bf8c octeontx: 5.15: copy config
Copy config from kernel 5.10 to kernel 5.15.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-01-03 20:56:01 +01:00
Nick Hainke
bb39ed3f36 zynq: add 5.15 testing kernel
Enable testing kernel.

Reviewed-by: Luis Araneda <luaraneda@gmail.com>
Tested-by: Luis Araneda <luaraneda@gmail.com> (Digilent Zybo Z7-20)
Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-01-03 20:56:01 +01:00
Nick Hainke
45cb7336cb zynq: 5.15: copy config
Copy config from kernel 5.10 to kernel 5.15.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-01-03 20:56:01 +01:00
Nick Hainke
65f606fb82 ipq40xx: delete files used for building 5.10 kernel
The kernel 5.15 now defaults. Remove unnecessary files.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-01-03 20:56:01 +01:00
Olliver Schinagl
9260027535 realtek: Migrate to libdeflate
Libdeflate is a more advanced gzip compressor, which allows for faster
decompression, higher compression speed (factor 3-4), while being fully
gzip compatible.

Some comparison
gzip    | libdeflate-gzip | delta  | image [openwrt-realtek-rtl839x-*]
--------+-----------------+--------+-----------------------------------------------
6589174 | 6298794         | 290380 | d-link_dgs-1210-52-initramfs-kernel.bin
6291632 | 6029488         | 262144 | d-link_dgs-1210-52-squashfs-factory_image1.bin
6292270 | 6030128         | 262142 | d-link_dgs-1210-52-squashfs-sysupgrade.bin
6589142 | 6298760         | 290382 | zyxel_gs1900-48-initramfs-kernel.bin
6292264 | 6030122         | 262142 | zyxel_gs1900-48-squashfs-sysupgrade.bin

and changing lzma to (libdeflate-)gzip on existing rtl930x target:
gzip    | libdeflate-gzip | delta  | image [openwrt-realtek-rtl930x-*]
--------+-----------------+--------+--------------------------------------
6816230 | 6510382         | 305848 | zyxel_xgs1250-12-initramfs-kernel.bin

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
2023-01-02 10:18:44 +01:00
Olliver Schinagl
c9a7c00f80 realtek: Disable boston clock
We are not on the 'boston' platform so no point in having that clock
driver enabled.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2023-01-01 22:31:20 +01:00
Hauke Mehrtens
55d176fd0b tfa-layerscape: Use trusted-firmware-a.mk
This converts the trusted firmware arm build Makefile to make use of
the common trusted-firmware-a.mk file. This also fixes the build with
binutils 2.39.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-31 20:02:09 +01:00
Tony Ambardar
6fc334cbdc ipq40xx: sysupgrade: allow flashing Linksys factory firmware
Allow forced flashing of a factory firmware image, after checking for the
correct FIT magic header and Linksys board-specific footer. Details of the
footer are already described in scripts/linksys-image.sh.

This is convenient as it avoids using a TFTP server or OEM GUI, and allows
restoring OEM firmware or installing a "breaking" OpenWrt update (e.g DSA
migration and kernel repartition) directly from the command line.

Devices supported at this time include EA6350v3, EA8300, MR8300 and WHW01.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by:  Wyatt Martin <wawowl@gmail.com> # WHW01
Tested-by:  Tony Ambardar <itugrok@yahoo.com> # EA6350v3
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2022-12-31 05:02:38 -08:00
Tony Ambardar
4b367e2b60 ipq40xx: migrate Linksys WHW01 to DSA and re-enable
Convert Linksys WHW01 network configuration to DSA and re-enable builds.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2022-12-31 05:02:38 -08:00
Tony Ambardar
2a9f3b7717 ipq40xx: fix up Linksys WHW01 board name, device definition
Update the board name defined in DTS to match online documentation and the
name encoded into factory firmware. This helps supports flashing firmware
factory images using 'sysupgrade'.

Original WHW01 device definition assumes the rootfs IMAGE_SIZE is 33 MB
instead of the correct 74 MB, and defines factory images which include
extra adjustments/padding that do not match OEM factory images and may
cause problems flashing. Update image size and build recipe to fix these.

Suggested-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2022-12-31 05:02:38 -08:00
Tony Ambardar
cda6f1c832 ipq40xx: re-enable EA6350v3, EA8300, MR8300 builds
Raise the kernel size from 3 MB to 5 MB for EA6350v3, EA8300 and MR8300,
and correspondingly reduce the rootfs size by 2 MB:
  * modify partition definitions in related .dts files
  * modify device kernel/image sizes in generic.mk

Update to compat-version 2.0 to force factory image usage on sysupgrade,
noting the current version 1.1 is an unreleased update for DSA migration.

Also update the compat-version message, explaining the need to run one of
the following console commands to update U-Boot's kernel-size variable
before flashing the OpenWrt factory image.

    fw_setenv kernsize 500000          # (OpenWrt command line)

    setenv kernsize 500000 ; saveenv   # (U-Boot serial console)

Finally, re-enable the 3 devices.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Nicolas TORMO <badulesia.granieri@gmail.com> # MR8300
Tested-by: Tony Ambardar <itugrok@yahoo.com> # EA6350v3
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2022-12-31 05:02:38 -08:00
Nick Hainke
00952fb0ca
bcm47xx: replace "Devices-database-update-patch" with upstream patches
Replace "320-MIPS-BCM47XX-Devices-database-update-for-4.x.patch" with
upstream patches:
- 320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
- 321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
- 322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
- 323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
- 324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
- 325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-30 20:03:59 +01:00
Nick Hainke
defd016aef
bcm47xx: add tags to upstreamed patches
All of the mtd patches are upstreamed to 5.18. Add tags indicating this.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-30 20:03:56 +01:00
INAGAKI Hiroshi
ef4e1ae18d ramips: enable BBT on NAND in I-O DATA devices
This patch enables MediaTek NAND BBT on I-O DATA devices manufactured by
MSTC (MitraStar Technology Corp.).

[WN-AX2033GR]
Tested-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
[WN-AX1167GR2, WN-DX1167R, WN-DX1200GR, WN-DX2033GR]
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-12-30 16:12:15 +08:00
Chuanhong Guo
d29dbf052a
mediatek: drop redmi-ax6000 variant with modified env
This variant uses xiaomi factory u-boot and modified u-boot-env &
bootcmd.
By modifying uboot-env, the xiaomi firmware recovery provided in
the vendor u-boot doesn't work anymore. It's possible to put
u-boot into a state where it refuese to take any serial input.
If the u-boot is in this state, users can't restore their
firmware without taking the flash off the board.
We now have a -stock variant where the vendor u-boot is used in
a way that xiaomi firmware recovery still works, and a -ubootmod
variant where we get rid of all xiaomi components, have more
usable space and no uart console lock. These two should cover all
use cases and we don't need this variant anymore.
Drop this redmi-ax6000 variant. Existing users of this variant
should perform a u-boot mod or restore to the -stock layout.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-12-30 16:11:59 +08:00
Hauke Mehrtens
7272203022 ramips: Refresh patches
The patch was not applying cleanly any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-29 19:01:15 +01:00
Nick Hainke
3195a992d6
ipq40xx: convert Aruba AP-303H to DSA and enable target again
The target was disabled since noone did the DSA conversion. Add the
conversion and enable it again.

Tested-by: John Walshaw <jjw@myself.com>
Signed-off-by: Bjoern Dobe <bjoern@dobecom.de>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-29 17:39:30 +01:00
Šimon Bořek
2cad88b99f
mpc85xx: change CPU_TYPE from 8540 to 8548
All subtargets as p1010, p1020, p2020 uses e500v2 cores [1] [2] [3] [4],
 so let's force cpu type to 8545 for all mpc85xx target even though
there might exist device with e500v1, but there is no such router supported in OpenWrt
and because of that it does not make sense to to set CPU_TYPE for each subtarget.

All MPC85xx SoC can be found here:
https://www.nxp.com/products/processors-and-microcontrollers/legacy-mpu-mcus/powerquicc-processors:POWERQUICC_HOME#powerquicc-iii-mpc85xx

[1] https://www.nxp.com/docs/en/application-note/AN2807.pdf
[2] https://www.nxp.com/docs/en/fact-sheet/QP1010FS.pdf
[3] https://www.nxp.com/docs/en/product-brief/P1020PB.pdf
[4] https://www.nxp.com/docs/en/fact-sheet/QP20XXFS.pdf

Co-authored-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
2022-12-29 16:49:09 +01:00
Furong Xu
8bac5dc18a mediatek: add new layout for Xiaomi Redmi Router AX6000 for OpenWrt U-Boot
This new layout is only bootable with OpenWrt U-Boot. It reuses the
two crash partions and expands the ubi partion to the end of whole flash.

Do not use this layout with stock U-Boot!

Signed-off-by: Furong Xu <xfr@outlook.com>
2022-12-29 03:00:31 +00:00
Sander Vanheule
045baca10b realtek: deduplicate GS1900 recipes
ZyXEL GS1900 devices with SoCs from both the RTL838x and RTL839x
families share the same image structure and size of the firmware
partition. Additionally, the GS1900-48 recipe provided a parameter for
the zyxel-vers command, but this parameter is not used. Deduplicate the
recipes by moving it to target/linux/realtek/image/common.mk.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-12-28 22:44:10 +01:00
Sander Vanheule
1e13081064 realtek: fix GS1900-48 firwmare partition
The listed partition size doesn't match the original partition size, and
actually overlaps with the following partition. The partition node name
for the "firmware" partition also has an extra 'b' compared to the
partition offset.

Fixes: 47f5a0a3ee ("realtek: Add support for ZyXEL GS1900-48 Switch")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-12-28 22:44:10 +01:00
Sander Vanheule
80be0fea03 realtek: fix ZYXELS_VERS for GS1900-48
The GS1900-48 firmware image is identified by the 'AAHN' ID, while the
GS1900-48HP is identified by 'AAHO' [1]. The latter was used, resulting
in the following error message when upgrading via the stock web UI:

  Device only can support firmware from V1.00(AAHN.0) and later version

Fix image generation by using the correct ID.

[1] https://download.zyxel.com/GS1900-48/firmware/GS1900-48_2.70(AAHN.3)C0_2.pdf

Link: https://forum.openwrt.org/t/146533
Fixes: 47f5a0a3ee ("realtek: Add support for ZyXEL GS1900-48 Switch")
Suggested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-12-28 22:44:10 +01:00
Sander Vanheule
ab8a5f2ea0 realtek: fix default image generation
While cleaning up the makefiles for the realtek target, the order of the
default image generating commands was accidentally changed. This caused
the image signature to end up somewhere in the middle, misaligning the
rootfs. As a result, sysupgrade couldn't verify upgrade images anymore,
and devices end up in a boot loop due to the unaligned (and not found)
rootfs.

Fixes: 94d8b4852b ("realtek: Cleanup Makefiles")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-12-28 22:44:10 +01:00
Nick Hainke
a14170b6e9 ath79: fix calibration-art for some boards
"0x1000" looks suspicious. By looking at data provided
by @DragonBluep I was able to identify the correct size for
AR9380, AR9287 WiFis. Furthermore, PowerCloud Systems CAP324
has a AR9344 WiFi.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-28 22:36:32 +01:00
Felix Fietkau
6c85c343d2 kernel: fix ethernet regression on mt7986
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-28 20:06:12 +01:00
Felix Baumann
3f1e9f6f3b
ramips: add support for read/write uboot env to Asus RX-AX53U
Add support for read/writing uboot env by renaming the second partition
to its stock label "nvram" and remove the deemed unnecessary
"read-only". Split the first partition "u-boot" in two, in order
to allow `fw_setenv` safe write-access to the uboot environment
variables.

This implements hauke's request from [1].
Based on the patch provided by Shiji Yang.

[1] https://github.com/openwrt/openwrt/pull/10400#discussion_r945153224

Co-Authored-By: Shiji Yang <yangshiji66@qq.com>
Signed-off-by: Felix Baumann <felix.bau@gmx.de>
[ improve commit title and description, fix some whitespace problem ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-28 14:04:57 +01:00
Birger Koblitz
e143e27c8c realtek: Fix reset register access
The reset register on RTL93xx not merely have bits to execute
a reset of a hardware component, but also configuration bits for
reset procedures. Keep them during executing a reset.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
[backport to 5.10 kernel]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-12-28 16:53:56 +01:00
Álvaro Fernández Rojas
5863363493 bcm27xx: fix BCMGENET kernel config
Revert backported upstream commits 421f8663b3a7 and 8d820bc9d12b, which have
introduced a regression in BCMGENET kconfig that disabled the network driver
for the Raspberry Pi.

Fixes: 0c405bceba ("kernel: bump 5.15 to 5.15.85")
Fixes: e900822326 ("kernel: bump 5.15 to 5.15.84")

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-12-28 13:41:04 +01:00
Felix Fietkau
425945c313 kernel: mediatek: fix WED offload regression on MT7622
Fix dealing with DSA untagging offload

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-27 19:10:05 +01:00
Felix Fietkau
78c51de847 kernel: mediatek: improve ethernet fix for dealing with small fragments
Replace the workaround on MT7986 with a proper fix. Software workaround is
still needed on older chips.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-27 19:10:04 +01:00
Olliver Schinagl
0a83889e89 realtek: Reduce variable scopes
Linus prefers to have loop initializers nice and tightly scoped. In
OpenWRT this has been possible since 41a1a652fb ("kernel: backport
gnu11 upgrade").

This patch cleans up variable scope while trying to do the above for
'simple for loops'.

This cleans up and simplifies some functions and code, and pulls in
variables to a smaller scope.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-12-27 16:33:15 +01:00
Olliver Schinagl
94d8b4852b realtek: Cleanup Makefiles
Our current Makefiles a little bit messy and can be improved somewhat,
both in whitespace and in style.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-12-27 16:33:15 +01:00
Olliver Schinagl
0a931767cf realtek: Replace C++ style comments
The only exception to C++ style comments are SPDX license identifier
markers at the start of C files (even headers have C style markers).

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-12-27 16:33:01 +01:00
Olliver Schinagl
758c88b969 realtek: Whitespace and codestyle cleanup
Fix some ugly whitepsaces and codestyle issues around the realtek sources.

While this is by no means perfect, it catches what it caught.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-12-27 16:31:48 +01:00
Jan Hoffmann
2c40359c5c realtek: add cond_resched to loops accessing the FDB table
A full loop accessing all FDB entries can take several milliseconds
(on RTL839x about 20 ms), so give other kernel tasks a chance to run.
This is especially important for rtl83xx_port_fdb_dump which is itself
called in a loop for all ports by the kernel.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2022-12-27 16:29:57 +01:00
Jan Hoffmann
ae0a3f88ac realtek: restructure rtl_table_read/write
These two functions are identical apart from writing different values to
the read/write bit. Create a new function rtl_table_exec to reduce code
duplication.

Also replace the unbounded busy-waiting loop. The new implementation may
sleep, but as the hardware typically responds before the first poll, any
callers doing many table accesses still need to make sure not to block
other kernel tasks themselves.

So far, polling timeout errors are only handled by logging an error, but
a return value is added to allow proper handling in the future.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2022-12-27 16:29:57 +01:00
Jan Hoffmann
9aa123d778 realtek: simplify log messages in rtl83xx_mdio_probe
This function currently prints three messages for every switch port at
KERN_INFO level. This takes a considerable amount of time during bootup
and can even trigger an external watchdog.

Replace these log messages by a single one at KERN_DEBUG level.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2022-12-27 16:29:57 +01:00
Jan Hoffmann
c94ca63ed4 realtek: don't set L2LEARNING flag in rtl83xx TX header
As learning for the CPU port is now disabled globally, the bit in the
TX header doesn't have any effect anymore. Remove it to make the header
consistent with the global configuration.

Originally, this change was intended to be applied before commit
eb456aedfe ("realtek: use assisted learning on CPU port"), which is
why the commit message incorrectly mentions that the TX header already
disables learning.

The reason for disabling learning on the CPU port in the first place is
that it doesn't work correctly when packets are trapped to the CPU and
then forwarded by the CPU to other ports. In that case, the switch would
incorrectly learn the CPU port as source. An example that triggered this
issue are Multicast Listener Reports and IGMP membership reports.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2022-12-27 16:29:39 +01:00
Jan-Niklas Burfeind
c7d3bbb909 sunxi: ensure NanoPi R1 has unique MAC address
Ensure the MAC address for all NanoPi R1 boards is assigned uniquely for
each board.

The vendor ships the device in two variants; one with and one without
eMMC; but both without static mac-addresses.
In order to assign both board types unique MAC addresses, fall back on
the same method used for the NanoPi R2S and R4S in case the EEPROM
chip is not present by generating the board MAC from the SD card CID.

[0] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R1#Hardware_Spec

Similar too and based on:

commit b5675f500d ("rockchip: ensure NanoPi R4S has unique MAC address")

Co-authored-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2022-12-25 02:27:55 +01:00
John Audia
5925401007 kernel: bump 5.10 to 5.10.161
All patches automatically rebased.

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-12-24 15:24:18 +01:00
John Audia
0c405bceba kernel: bump 5.15 to 5.15.85
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-12-24 15:22:33 +01:00
Josef Schlehofer
b4da12c2a0
mpc85xx: drop empty patch as it backported to LTS kernel 5.15.70
This patch is part of Linux kernel 5.15.70, the content was removed, but
the empty file is still being carried over the repository, so remove it
once for all

Fixes: e1b009c ("kernel: bump 5.15 to 5.15.70")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-12-24 12:24:46 +01:00
Olliver Schinagl
f649a7b5f3
realtek: 5.15: Fix incorrect switch patches
Add correct header to patche(s) to be correctly used
by git am and have better tracking of it.

See commit f1f97db627 ("realtek: Convert incorrect v5.10 patches").

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-12-24 11:56:21 +01:00
Olliver Schinagl
113fd5b93b
realtek: 5.10: Fix incorrect switch patches
Add correct header to patche(s) to be correctly used
by git am and have better tracking of it.

See commit f1f97db627 ("realtek: Convert incorrect v5.10 patches").

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-12-24 11:56:21 +01:00
Christian Marangi
b2bfea481e
omap: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:22 +01:00
Christian Marangi
314d997e26
pistachio: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:22 +01:00
Christian Marangi
8e2e67d117
octeontx: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:21 +01:00
Christian Marangi
c028e1b1a0
tegra: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:21 +01:00
Christian Marangi
6d7129ef04
zynq: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:21 +01:00
Christian Marangi
64ef920bb7
mxs: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:20 +01:00
Christian Marangi
cada395a50
kirkwood: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:20 +01:00
Christian Marangi
cf49c7d522
gemini: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:20 +01:00
Christian Marangi
13d6048e06
ath25: add generic subtarget
Same game as for 853e4dd306. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-23 19:44:14 +01:00
Hauke Mehrtens
376eb2d924 ramips: Fix drivers/pwm/pwm-mediatek-ramips.c compile
The pwmchip_remove() function returns void now. Fix a compile problem in
the drivers/pwm/pwm-mediatek-ramips.c driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-23 00:43:39 +01:00
Hauke Mehrtens
92eb787d08 kernel: Move CONFIG_PWM_IMG and CONFIG_PWM_MEDIATEK to generic configuration
In the build of the ramips/mt76x8 target the user gets asked about these
two configuration options, add them to the generic kernel configuration.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-23 00:43:33 +01:00
Hauke Mehrtens
259c014555 kernel: Move CONFIG_DRM_XEN_FRONTEND to generic configuration
The CONFIG_DRM_XEN_FRONTEND configuration symbol is also used by the
layerscape target, move it to the generic kernel configuration.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-23 00:43:23 +01:00
Hauke Mehrtens
f620eb70f1 kernel: Add missing kernel configuration options
This fixes compile of the bmips target.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-21 15:15:00 +01:00
Hauke Mehrtens
fbd5573dca kernel: Reorder kernel configuration options
./scripts/kconfig.pl '+' target/linux/generic/config-5.10 /dev/null > target/linux/generic/config-5.10-new
mv target/linux/generic/config-5.10-new target/linux/generic/config-5.10

./scripts/kconfig.pl '+' target/linux/generic/config-5.15 /dev/null > target/linux/generic/config-5.15-new
mv target/linux/generic/config-5.15-new target/linux/generic/config-5.15

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-21 15:14:51 +01:00
Petr Štetiar
5f973c1eef Revert "Revert "mvebu: switch default kernel to 5.15""
This reverts commit 97c77fff28 as commit
8be6350f66 ("generic: 5.15: allow MV88E6xxx built-in when PTP support
disabled") contains the fix, so lets enable kernel 5.15 on mvebu again.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-12-20 14:00:35 +01:00
John Audia
e900822326 kernel: bump 5.15 to 5.15.84
All patches automatically rebased

Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-12-19 23:51:10 +01:00
Alexander Couzens
17c6fb1054 ath79: image: don't depend on other COMPILE targets
A device COMPILE target should not depend on another COMPILE.
Otherwise race condition may happen.
The loader is very small. Compiling it twice shouldn't
have a huge impact.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2022-12-19 12:27:35 +00:00
Julien Dusser
b893aa7992 ramips: add support for Linksys E5400 and clones
Linksys E5400 is a 2.4/5GHz dual band AC router, based on MediaTek
MT7628AN. This device is also sold as Linksys E2500v4, E5300 and E5350
with the same hardware, but software speed limitations in vendor
firmwares.

Specification:
 * SoC: MT7628AN (580 MHz)
 * RAM: DDR2 64 MiB
 * Flash: 16 MiB NOR (W25Q128BV)
 * Wi-Fi:
   * 2.4GHz: SoC Built-in
   * 5GHz: MT7612EN
 * Ethernet: 5x 100Mbps
   * Switch: SoC built-in
 * UART:
   * 115200, 8N1, 3.3V (real u-boot speed: 119050)
   * Pinout JB4: 1:[3V3] (TXD) (RXD) [NC] (GND)

Flash Layout:
  0x0000000-0x0030000 : "Bootloader"
  0x0030000-0x0040000 : "Config"
  0x0040000-0x0050000 : "Factory"
  0x0050000-0x0ff0000 : "Kernel"
  0x0ff0000-0x1000000 : "CBTinfo"

MAC address:
  LAN: factory 0x28
  WAN: LAN + 1
  2.4G: LAN + 2
  5G: LAN + 3

Installation:
1. Connect to UART, use LF as EOL (not CRLF)
2. Set IP address
  - Press 4 during boot
  - setenv serverip <TFTPSERVER_IP>
  - setenv ipaddr <DEVICE_IP>
  - setenv bootfile openwrt-ramips-mt76x8-linksys_e5400-initramfs-kernel.bin
  - saveenv
  - reset
3. Load Openwrt Kernel image from TFTP:
  - Press 1 during boot
  - IP and filename should be already set
4. Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
2022-12-18 21:24:57 +01:00
Johnny S. Lee
8be6350f66 generic: 5.15: allow MV88E6xxx built-in when PTP support disabled
As described in commit 97c77fff28
MV88E6xxx driver (NET_DSA_MV88E6XXX) cannot be built-in when PTP
(PTP_1588_CLOCK) is a module in Linux 5.15. But actually it should be
allowed to be built-in when its PTP support (NET_DSA_MV88E6XXX_PTP) is
disabled.

This adds a patch to fix that.

Signed-off-by: Johnny S. Lee <foss@jsl.io>
2022-12-18 16:38:37 +01:00
Alexey Bartenev
3f201d1f8e ramips: add support for SNR-CPE-W4N-MT router
General specification:
- SoC Type: MediaTek MT7620N (580MHz)
- ROM: 8 MB SPI-NOR (W25Q64FV)
- RAM: 64 MB DDR (M13S5121632A)
- Switch: MediaTek MT7530
- Ethernet: 5 ports - 5×100MbE (WAN, LAN1-4)
- Wireless 2.4 GHz: b/g/n
- Buttons: 1 button (RESET)
- Bootloader: U-Boot 1.1.3, MediaTek U-Boot: 5.0.0.5
- Power: 12 VDC, 1.0 A

Flash by the native uploader in 2 stages:
1. Use the native uploader to flash an initramfs image. Choose
 openwrt-ramips-mt7620-snr_cpe-w4n-mt-initramfs-kernel.bin file by
 "Administration/Management/Firmware update/Choose File" in vendor's
 web interface (ip: 192.168.1.10, login: Admin, password: Admin).
 Wait ~160 seconds.
2. Flash a sysupgrade image via the initramfs image. Choose
 openwrt-ramips-mt7620-snr_cpe-w4n-mt-squashfs-sysupgrade.bin
 file by "System/Backup/Flash Firmware/Flash image..." in
 LuCI web interface (ip: 192.168.1.1, login: root, no password).
 Wait ~240 seconds.

Flash by U-Boot TFTP method:
1. Configure your PC with IP 192.168.1.131
2. Set up TFTP server and put the
 openwrt-ramips-mt7620-snr_cpe-w4n-mt-squashfs-sysupgrade.bin
 image on your PC
3. Connect serial port (57600 8N1) and turn on the router.
 Then interrupt "U-Boot Boot Menu" by hitting 2 key (select "2:
 Load system code then write to Flash via TFTP.").
Press Y key when show "Warning!! Erase Linux in Flash then burn
 new one. Are you sure? (Y/N)"
Input device IP (192.168.1.1) ==:192.168.1.1
Input server IP (192.168.1.131) ==:192.168.1.131
Input Linux Kernel filename () ==:
openwrt-ramips-mt7620-snr_cpe-w4n-mt-squashfs-sysupgrade.bin
3. Wait ~120 seconds to complete flashing

Signed-off-by: Alexey Bartenev <41exey@proton.me>
2022-12-17 22:34:44 +01:00
Davide Fioravanti
d9566d059c ath79: add support for KuWFi C910
KuWFi C910 is an 802.11n (300N) indoor router with LTE support.

I can't find anywhere the OEM firmware. So if you want to restore the
original firmware you must do a dump before the OpenWrt flash.

According to the U-Boot, the board name is Iyunlink MINI_V2.

Hardware
--------
SoC:   Qualcomm QCA9533 650/400/200/25/25 MHz (CPU/RAM/AHB/SPI/REF)
RAM:   128 MB DDR2 16-bit CL3-4-4-10 (Nanya NT5TU64M16HG-AC)
FLASH: 16 MB Winbond W25Q128
ETH:
  - 2x 100M LAN (QCA9533 internal AR8229 switch, eth0)
  - 1x 100M WAN (QCA9533 internal PHY, eth1)
WIFI:
  - 2.4GHz: 1x QCA9533 2T2R (b/g/n)
  - 2 external non detachable antennas (near the power barrel side)
LTE:
  - Quectel EC200T-EU (or -CN or -AU depending on markets)
  - 2 external non detachable antennas (near the sim slot side)
BTN:
  - 1x Reset button
LEDS:
  - 5x White leds (Power, Wifi, Wan, Lan1, Lan2)
  - 1x RGB led (Internet)
UART: 115200-8-N-1 (Starting from lan ports in order: GND, RX, TX, VCC)

Everything works correctly.

MAC Addresses
-------------
LAN XX:XX:XX:XX:XX:48 (art@0x1002)
WAN XX:XX:XX:XX:XX:49 (art@0x1002 + 1)
WIFI XX:XX:XX:XX:XX:48

LABEL XX:XX:XX:XX:XX:48

Installation
------------
Turn the router on while pressing the reset button for 4 seconds.
You can simply count the flashes of the first lan led. (See notes)
If done correctly you should see the first lan led glowing slowly and
you should be able to enter the U-Boot web interface.

Click on the second tab ("固件") and select the -factory.bin firmware
then click "Update firmware".

A screen "Update in progress" should appear.

After few minutes the flash should be completed.

This procedure can be used also to recover the router in case of soft
brick.

Backup the original firmware
----------------------------
The following steps are intended for a linux pc. However using the
right software this guide should also work for Windows and MacOS.

1) Install a tftp server on your pc. For example tftpd-hpa.

2) Create two empty files in your tftp folder called:
	kuwfi_c910_all_nor.bin
	kuwfi_c910_firmware_only.bin

3) Give global write permissions to these files:
	chmod 666 kuwfi_c910_all_nor.bin
	chmod 666 kuwfi_c910_firmware_only.bin

4) Start a netcat session on your pc with this command:
	nc -u -p 6666 192.168.1.1 6666

5) Set the static address on your pc: 192.168.1.2. Connect the router
	to your pc.

6) Turn the router on while pressing the reset button for 8-9 seconds.
	You can simply count the flashes of the first lan led. If you
	press the reset button for too many seconds it will continue
	the normal boot, so you have to restart the router. (See notes)

7) If done correctly you should see the U-Boot network console and you
	should see the following lines on the netcat session:
Version and build date:
  U-Boot 1.1.4-55f1bca8-dirty, 2020-05-07

Modification by:
  Piotr Dymacz <piotr@dymacz.pl>
  https://github.com/pepe2k/u-boot_mod

u-boot>

8) Start the transfer of the whole NOR:
	tftpput 0x9f000000 0x1000000 kuwfi_c910_all_nor.bin

9) The router should start the transfer and it should end with a
	message like this (pay attention to the bytes transferred):
TFTP transfer complete!

Bytes transferred: 16777216 (0x1000000)

10) Repeat the same transfer for the firmware:
	tftpput 0x9f050000 0xfa0000 kuwfi_c910_firmware_only.bin

11) The router should start the transfer and it should end with a
	message like this (pay attention to the bytes transferred):
TFTP transfer complete!

Bytes transferred: 16384000 (0xfa0000)

12) Now you have the backup for the whole nor and for the firmware
	partition. If you want to restore the OEM firmware from OpenWrt
	you have to flash the kuwfi_c910_firmware_only.bin from the
	U-Boot web interface.

	WARNING: Don't use the kuwfi_c910_all_nor.bin file. This file
	is only useful if you manage to	hard brick the router or you
	damage the art partition (ask on the forum)

Notes
-----
This router (or at least my unit) has the pepe2k's U-Boot. It's a
modded U-Boot version with a lot of cool features. You can read more
here: https://github.com/pepe2k/u-boot_mod

With this version of U-Boot, pushing the reset button while turning on
the router starts different tools:
 - 3-5 seconds: U-Boot web interface that can be used to replace the
 	firmware, the art or the U-Boot itself
 - 5-7 seconds: U-Boot uart console
 - 7-10 seconds: U-Boot network console
 - 11+ seconds: Normal boot

The LTE modem can be used in cdc_ether (ECM) or RNDIS mode.
The default mode is ECM and in this commit only the ECM software is
included. In order to set RNDIS mode you must use this AT command:
	AT+QCFG="usbnet",3
In order to use again the ECM mode you must use this AT command:
	AT+QCFG="usbnet",1

Look for "Quectel_EC200T_Linux_USB_Driver_User_Guide_V1.0.pdf" for
other AT commands

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
2022-12-17 22:28:10 +01:00
Shiji Yang
6361a952af ramips: improve support for SIM SIMAX1800T and Haier HAR-20S2U1
1. Use ARTIFACTS to build factory image. This change allows users to
   generate initramfs factory image using OpenWrt ImageBuilder.

2. Override the default bootargs property defined in "mt7621.dtsi".
   Although we use the "bootargs-override" property to set bootargs,
   the default "bootargs" property will still be written into the
   device tree, so it is better to override it.

Tested on SIM SIMAX1800T

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-12-17 21:08:14 +01:00
Shiji Yang
a7d8b54f86 ramips: improve support for H3C TX180x series devices
1. Explicitly declare gpio pin groups to ensure that gpio works properly.

2. Override bootargs in device tree to avoid modifying u-boot envs during
   initial installation.

Tested on H3C TX1801 Plus

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-12-17 21:08:14 +01:00
Chukun Pan
53123b93b0 sunxi: fix board_name for MarsBoard A10
The compatible in the device tree is "haoyu,a10-marsboard",
modify the board_name to keep it consistent.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2022-12-17 20:55:47 +01:00
Chukun Pan
7bcf6b54fc sunxi: fix typo in device packages for MarsBoard A10
The kmod prefix for sound-soc-sunxi is missing, fix it.
Also add kmod-sound-core as dependence.

Fixes: 6a35659 ("sunxi: Added profile for HAOYU Electronics Marsboard A10")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2022-12-17 20:55:47 +01:00
Nick Hainke
af5306ba70 ath79: convert WiFis based on ar7241_ubnt_unifi.dtsi to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

While working on it remove stale uboot partition label and merge art
into partition node.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-17 20:48:57 +01:00
Nick Hainke
b7ad3c5c5d ath79: convert Buffalo WZR-HP-G302H A1A0 WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Merge art into partition node.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-17 20:48:57 +01:00
Nick Hainke
d4ec4f9d0b ath79: convert OpenMesh OM2P v1 WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Merge art into partition node.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-17 20:40:30 +01:00
Nick Hainke
f6ca84bf02 ath79: convert OpenMesh OM5P-AN WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Merge art into partition node.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-17 20:40:30 +01:00
Nick Hainke
46077860c2 ath79: convert boards based on ar9344_openmesh_mr600.dtsi to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Merge art into partition node.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-17 20:40:29 +01:00
Chuanhong Guo
7fb32285d5
mediatek: redmi-ax6000: drop cs-gpios
'cs-gpios = <0>, <0>' is a hack in ath79 to override the incorrectly
specified maximum number of chipselects available in spi-ath79.c.
It's not needed here and must have been copied here by mistake.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-12-17 15:07:54 +08:00
Chen Minqiang
18bea173a6 mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000
In this implementation, the flash partition layout is adjusted to avoid
modifying the uboot environment of mtdparts. This ensures that the 30M
ubi_kernel partition remains aligned with the stock ubi partition, and
the kernel volume is placed in it. This allows the stock uboot to boot
from it without changing the mtdparts, which is useful for reverting back
to the stock firmware using Xiaomi Firmware Tools. In actual testing,
modifying mtdparts has been found to break Xiaomi Firmware Tools.

1. use ARTIFACTS to generate initramfs-factory.ubi for easy installation.
2. The NAND flash layout is changed to allow for reverting back to the
   stock firmware.
3. Before performing sysupgrade, do some cleanup in platform_pre_upgrade
   to ensure a clean installation of OpenWRT.
4. Setup the uboot env to ensure that the system always boot, which can
   be helpful for users who may forget to do this before sysupgrade in
   the initramfs.

New flash instructions:
1. Gain ssh access. Please refer to:
   https://openwrt.org/toh/xiaomi/redmi_ax6000#installation)

2. Check which system current u-boot is loading from:
   COMMAND: `cat /proc/cmdline`
   sample OUTPUT: `console=ttyS0,115200n1 loglevel=8 firmware=1 uart_en=1`
   if firmware=1, current system is ubi1
   if firmware=0, current system is ubi0

3. Setup nvram and write the firmware:
   If the current system is ubi1, please set it up so that the next time
   it will boot from ubi, and write the firmware to ubi:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd8 -y -f /tmp/initramfs-factory.ubi
```
   If the current system is ubi, please set it up so that the next time
   it will boot from ubi1, and write the firmware to ubi1:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd9 -y -f /tmp/initramfs-factory.ubi
```

4. After rebooting, the system should now boot into the openwrt initramfs.
   Flash the squashfs-sysupgrade.bin via using ssh or luci.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```
Done.

For existing users of the Redmi AX6000 running OpenWrt, here are the steps to
switch to this new layout:

1. Flash initramfs-factory.ubi
```
mtd -r -e ubi write /tmp/initramfs-factory.ubi ubi
```

2. After rebooting, the system will boot into the new openwrt-initramfs.
Log in and perform a sysupgrade to complete the process.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-12-17 15:04:16 +08:00
Christian Marangi
d7876daf65
generic: add support for EON EN25QX128A spi nor flash
Add support for EON EN25QX128A spi nor flash with no flags as it does
support SFDP parsing.

Fixes: #9442
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Szabolcs Hubai <szab.hu@gmail.com> [ramips/mt7621: xiaomi_mi-router-4a-gigabit]
2022-12-16 20:58:36 +01:00
Furong Xu
d9e1362581 mediatek: add LED support for Xiaomi Redmi AX6000
add DT nodes and default package for the LEDs on Redmi AX6000

Signed-off-by: Furong Xu <xfr@outlook.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-12-16 21:42:02 +08:00
Furong Xu
335c1e7cfd mediatek: enable sel_clk for spi-mt65xx
Without explicitly enabling sel_clk, clk_disable_unused() will disable
it when boot is done, causing CPU hang on SPI1 register access on MT7986.
Explicitly enable sel_clk to make SPI1 functional.

Signed-off-by: Furong Xu <xfr@outlook.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-12-16 21:42:02 +08:00
INAGAKI Hiroshi
88db7461cf realtek: add Linux Kernel 5.15 as testing version
Add Linux Kernel 5.15 support for testing.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[APRESIA ApresiaLightGS120GT-SS, Panasonic Switch-M24eG PN28240K, Switch-M48eG PN28480K]
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com>
TP-Link TL-SG2008P
Tested-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[D-Link DGS-1210-20, DGS-1210-52, Zyxel XGS1010-12]
Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
[Zyxel XGS1250-12]
Tested-by: Lucian Cristian <lucian.cristian@gmail.com> # Zyxel
[HPE 1920-8G, 1920-48G]
Tested-by: Jan Hoffmann <jan@3e8.eu>
2022-12-15 20:54:12 +01:00
INAGAKI Hiroshi
69055a5412 realtek: enable needs_standalone_vlan_filtering on DSA driver in 5.15
To configure VLAN 0, enable needs_standalone_vlan_filtering option
of dsa_switch struct.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-12-15 20:54:03 +01:00
INAGAKI Hiroshi
109962d8bf realtek: update dsa.c of DSA driver for 5.15
- rtl83xx_vlan_filtering()

  "struct switchdev_trans *trans" parameter was removed[1] and
  "struct netlink_ext_ack *extack" was added[2].

[1]: https://www.spinics.net/lists/netdev/msg712250.html
[2]: https://www.spinics.net/lists/netdev/msg722496.html

- rtl83xx_vlan_add/del()

  vlan->vid_begin and vlan->vid_end were removed and vlan->vid was
  added[3].

[3]: https://www.spinics.net/lists/netdev/msg712248.html

- rtl83xx_vlan_prepare()

  "port_vlan_prepare" member was removed from "dsa_switch_ops" struct
  in dsa.h[4] and vlan_prepare function should be called from vlan_add
  function. Also, change return type of vlan_add function to int.

[4]: https://www.spinics.net/lists/netdev/msg712252.html

- rtl83xx_port_mdb_add()

  "port_mdb_prepare" member in "dsa_switch_ops" struct was removed and
  preparation need to be done in the function of "port_mdb_add" member
  instead. And also, int type need to be returned on "port_mdb_add"
  member[5].

[5]: https://www.spinics.net/lists/netdev/msg712251.html

- rtl83xx_port_pre_bridge_flags(), rtl83xx_port_bridge_flags()

  The current "port_pre_bridge_flags" member and "port_bridge_flags"
  member in "dsa_switch_ops" in dsa.h has flags of
  "struct switchdev_brport_flags" type instead[6], so adjust to it.
  And, the changed features are passed by flags.mask[7] in
  rtl83xx_port_bridge_flags(), so check it before calling function
  to enable/disable fieature.

[6]: https://lore.kernel.org/lkml/20210212151600.3357121-7-olteanv@gmail.com/
[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e18f4c18ab5b0dd47caaf8377c2e36d66f632a8c

Suggested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[shorten final return statement of rtl83xx_port_mdb_add()]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-12-15 20:52:40 +01:00
INAGAKI Hiroshi
1f153558a3 realtek: update platform support for 5.15
- fw_passed_dtb and others were replaced to get_fdt() function[1]
- __appended_dtb defined by asm/bootinfo.h[2]

[1]: https://www.spinics.net/lists/linux-mips/msg03332.html
[2]: https://www.spinics.net/lists/linux-mips/msg03332.html

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-12-15 20:52:40 +01:00
INAGAKI Hiroshi
f3a9975549 realtek: refresh config-5.15 in all subtargets
Refresh config-5.15 in all subtargets by kernel_menuconfig.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-12-15 20:52:40 +01:00
INAGAKI Hiroshi
aa528eec73 realtek: refresh patches in 5.15
Adjust patches for kernel 5.15.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-12-15 20:52:40 +01:00
INAGAKI Hiroshi
23881c91e5 realtek: drop patches of upstreamed fix and changes from 5.15
- 007-5.16-gpio-realtek...: upstreamed on 5.16 and backported to 5.15.3
- 708-brflood-spi.patch   : upstreamed
- 709-lag-offloading.patch: upstreamed
- 713-v5.12-net-dsa-...   : upstreamed and some implementations are
                            replaced

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-12-15 20:52:40 +01:00
INAGAKI Hiroshi
a9d5a8bc79 realtek: drop patches of upstreamed drivers from 5.15
The following drivers were upstreamed and available on 5.15, so drop
from OpenWrt tree.

- realtek-otto-gpio (5.13)
- realtek-rtl-spi (5.12)
- realtek-rtl-intc (5.12)

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-12-15 20:52:40 +01:00
INAGAKI Hiroshi
8fb15ea52a realtek: copy dts/files/patches/configs for 5.15
Copy dts/files/patches/configs from 5.10 to 5.15.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[refresh with updated DGS-1210 dts files]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-12-15 20:52:09 +01:00
Christian Lamparter
d8da5002a2 ath79: fix dtc warnings in ruckus zf7372
|:69.4-14: Warning (reg_format): beamforming-2g-gpio@0:reg: property has invalid length (4 bytes)
|:85.4-14: Warning (reg_format): beamforming-5g-gpio@0:reg: property has invalid length (4 bytes)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:45:47 +01:00
Christian Lamparter
0dacf14495 ath79: fix dtc warnings in eap1750h
|109.3-19: Warning (reg_format): macaddr@0:reg:property has invalid length (8 bytes)
|113.3-24: Warning (reg_format): calibration@1000:reg: property has invalid length (8 bytes)
|117.3-24: Warning (reg_format): calibration@5000:reg: property has invalid length (8 bytes)

also integrate the art-nodes nodes back into the partition-subnode
and change the calibration labels to match what everyone else is
doing.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:45:47 +01:00
Christian Lamparter
0f227720f9 ath79: fix dtc warnings in eap1200h
|109.3-19: Warning (reg_format): macaddr@0:reg:property has invalid length (8 bytes)
|113.3-24: Warning (reg_format): calibration@1000:reg: property has invalid length (8 bytes)
|117.3-24: Warning (reg_format): calibration@5000:reg: property has invalid length (8 bytes)

also integrate the art-nodes nodes back into the partition-subnode
and change the calibration labels to match what everyone else is
doing.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:45:47 +01:00
Nick Hainke
4146701469 ath79: replace reference to legacy qca,disable-2ghz in WatchGuard AP100
Commit 4c8dd973ef ("ath9k: OF: qca,disable-(2|5)ghz => ieee80211-freq-limit")
removed "qca,disable-5ghz" and "qca,disable-2ghz".

Signed-off-by: Nick Hainke <vincent@systemli.org>
(converted patch to remove the ieee80211-freq-limit property instead)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:45:47 +01:00
Nick Hainke
ae5cb164cd ath79: switch to upstream ieee80211-freq-limit for Araknis AN-300-AP-I-N
Commit 4c8dd973ef ("ath9k: OF: qca,disable-(2|5)ghz => ieee80211-freq-limit")
removed "qca,disable-5ghz" and "qca,disable-2ghz". Switch to upstream
ieee80211-freq-limit.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-15 15:45:47 +01:00
Nick Hainke
08c114ee16 ath79: convert Winchannel WB2000 WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(removed mtd-cal-data property, merged art + addr nodes back into
partition)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:45:47 +01:00
Nick Hainke
fd456106aa ath79: convert Ubiquiti UniFi AP Pro WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(merged art node back into partition-node)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:45:47 +01:00
Nick Hainke
f63cf33aa7 ath79: convert OCEDO Raccoon WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(merged art into partition node, removed stale uboot label)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:45:47 +01:00
Nick Hainke
783936c1f7 ath79: Mercury MW4530R v1 already uses nvmem-cells
Remove the caldata extraction in userspace. The board already uses
nvmem-cells since
commit e354b01baf ("ath79: calibrate all ar9344 tl-WDRxxxx with nvmem")

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-15 15:45:35 +01:00
Nick Hainke
4845b60525 ath79: convert boards based on senao_ap-dual.dtsi WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-15 15:08:09 +01:00
Nick Hainke
21495c92dc ath79: convert Atheros DB120 WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(merged art-node back into partition-node)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:08:09 +01:00
Nick Hainke
1b125aabf4 ath79: convert Araknis AN-300-AP-I-N WiFis to nvmem-cells
Pull the calibration data from the nvmem subsystem. This allows us to
move userspace caldata extraction into the device-tree definition.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-12-15 15:08:08 +01:00
Johannes Heimansberg
708ea56fb9 bcm27xx: bcm2711: add kmod-r8169
Some carrier boards [1][2] for the Raspberry Pi CM4 that are specifically
designed to be used as routers come with secondary NICs using a Realtek
RTL8111 Gigabit Ethernet chip.

When using such a board as a router with OpenWrt, it is very helpful
when both NICs are working by default. Since the Raspberry Pi 4 and the
CM4 have plenty of disk space, it should cause no harm to include the
kmod-r8169.

[1] https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767
[2] https://www.waveshare.com/wiki/CM4-DUAL-ETH-MINI

Signed-off-by: Johannes Heimansberg <git@jhe.dedyn.io>
(r8169 should pull in the necessary dependencies.)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-12-15 15:08:08 +01:00
Linus Walleij
1bef8d62d4 bcm53xx: Patch to support BCMA rev 11
A backported patch to the BCMA driver necessary to support the
DWL-8610AP and DIR-890L. Patch will be in upstream v6.2.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2022-12-15 15:08:08 +01:00
John Audia
90120a1552 kernel: bump 5.10 to 5.10.159
Removed upstreamed:
	backport-5.10/888-v6.1-ca8210-Fix-crash-by-zero-initializing-data.patch[1]

All patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.159&id=0a8e66e375736ea12c11f0ef238ba2a8efec460b

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-12-14 23:37:28 +01:00
John Audia
b6fa423907 kernel: bump 5.15 to 5.15.83
Removed upstreamed:
	backport-5.15/883-v6.1-ca8210-Fix-crash-by-zero-initializing-data.patch[1]

All patches automatically rebased

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.83&id=246bcd05ba6cc43b34ac0bb4bac3ea94a4efa07c

Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-12-14 23:34:50 +01:00
Stijn Tintel
b3dd15ca0a kernel: add missing symbol to 5.10 config
Kernel 5.10.158 added a prompt for the FUNCTION_ERROR_INJECTION symbol.
This is exposed in builds with CONFIG_KERNEL_KPROBES enabled, causing
those builds to fail due to a missing symbol. Add the symbol to fix
this.

Fixes: 6801c460b6 ("kernel: bump 5.10 to 5.10.158")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-12-14 20:29:36 +02:00
Stijn Tintel
f9bd655f16 kernel: add missing symbol to 5.15 config
Kernel 5.15.82 added a prompt for the FUNCTION_ERROR_INJECTION symbol.
This is exposed in builds with CONFIG_KERNEL_KPROBES enabled, causing
those builds to fail due to a missing symbol. Add the symbol to fix
this.

Fixes: 68426e54ed ("kernel: bump 5.15 to 5.15.82")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-12-14 19:12:33 +02:00
Stijn Tintel
230f2fccd1 qoriq: switch to kernel 5.15
The testing kernel has been running fine for months on a rather complex
network setup, with one exception being a crash in
__xfrm_state_delete(). This crash has been fixed in kernel 5.15.82, so
let's switch the qoriq target to kernel 5.15 by default.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-12-14 18:53:39 +02:00
Christian Marangi
823ddab80e
ipq806x: 5.15: standardize wpq864 partition table
Compex WPQ864 contains a non standard partition table. Each partition
node should be named partition and should contain a valid reg.
Fix an extra "-" present after the reg for SBL2_1 partition.

Also add "0:" to each qcom default partition following smem naming.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-14 02:23:22 +01:00
Christian Marangi
266b261d39
ipq806x: 5.15: fix wrong boot-partitions values for split partitions
The refreshed patch actually use the format of <start size start size>
instead of <start end start end>. This cause boot fail since the rootfs
can't be mounted with these wrong values.

Fix it to the correct format in each affected dts.

Fixes: #11498
Fixes: 6134ba4a34 ("ipq806x: 5.15: add boot-partitions binding to fix block warning")
Tested-by: Matt Buczko <mbuczko@hotmail.com> # Askey RT4230W
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-14 02:23:22 +01:00
Andrew Cameron
550e5b2184 ath79: add support for TP-Link CPE605-v1
TP-Link CPE605-v1 is an outdoor wireless CPE for 5 GHz with
one Ethernet port based on Atheros AR9344

Specifications:
 - 560/450/225 MHz (CPU/DDR/AHB)
 - 1x 10/100 Mbps Ethernet
 - 64 MB of DDR2 RAM
 - 8 MB of SPI-NOR Flash
 - 23dBi high-gain directional antenna and a dedicated metal reflector
 - Power, LAN, WLAN5G green LEDs
 - 3x green RSSI 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 4-5 seconds and release.
 Rename factory image to recovery.bin
 Stock TFTP server IP:192.168.0.100
 Stock device TFTP adress:192.168.0.254

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
2022-12-13 23:17:27 +01:00
Mikhail Zhilkin
0ec8d991c2 ramips: add support for Etisalat S3
Etisalat S3 is a wireless WiFi 5 router manufactured by Sercomm company.

Device specification
--------------------
SoC Type: MediaTek MT7621AT
RAM: 256 MiB
Flash: 128 MiB
Wireless 2.4 GHz (MT7603EN): b/g/n, 2x2
Wireless 5 GHz (MT7615E): a/n/ac, 4x4
Ethernet: 5x GbE (WAN, LAN1, LAN2, LAN3, LAN4)
USB ports: 1x USB3.0
Button: 2 buttons (Reset & WPS)
LEDs:
   - 1x Status (RGB)
   - 1x 2.4G (blue, hardware, mt76-phy0)
   - 1x 5G (blue, hardware, mt76-phy1)
Power: 12 VDC, 1.5 A
Connector type: barrel
Bootloader: U-Boot

Installation
-----------------
1.  Login to the router web interface under admin account
2.  Navigate to Settings -> Configuration -> Save to Computer
3.  Decode the configuration. For example, using cfgtool.py tool (see
    related section):
       cfgtool.py -u configurationBackup.cfg
4.  Open configurationBackup.xml and find the following line:
    <PARAMETER name="Password" type="string" value="<your router serial \
       is here>" writable="1" encryption="1" password="1"/>
5.  Insert the following line after and save:
<PARAMETER name="Enable" type="boolean" value="1" writable="1" encryption="0"/>
6.  Encode the configuration. For example, using cfgtool.py tool:
       cfgtool.py -p configurationBackup.xml
7.  Upload the changed configuration (configurationBackup_changed.cfg) to
    the router
8.  Login to the router web interface (SuperUser:ETxxxxxxxxxx, where
    ETxxxxxxxxxx is the serial number from the backplate label)
9.  Navigate to Settings -> WAN -> Add static IP interface (e.g.
    10.0.0.1/255.255.255.0)
10. Navigate to Settings -> Remote cotrol -> Add SSH, port 22,
    10.0.0.0/255.255.255.0 and interface created before
11. Change IP of your client to 10.0.0.2/255.255.255.0 and connect the
    ethernet cable to the WAN port of the router
12. Connect to the router using SSH shell under SuperUser account
13. Run in SSH shell:
       sh
14. Make a mtd backup (optional, see related section)
15. Change bootflag to Sercomm1 and reboot:
       printf 1 | dd bs=1 seek=7 count=1 of=/dev/mtdblock3
       reboot
16. Login to the router web interface under admin account
17. Remove dots from the OpenWrt factory image filename
18. Update firmware via web using OpenWrt factory image

Revert to stock
---------------
Change bootflag to Sercomm1 in OpenWrt CLI and then reboot:
   printf 1 | dd bs=1 seek=7 count=1 of=/dev/mtdblock3

mtd backup
----------
1. Set up a tftp server (e.g. tftpd64 for windows)
2. Connect to a router using SSH shell and run the following commands:
      cd /tmp
      for i in 0 1 2 3 4 5 6 7 8 9 10; do nanddump -f mtd$i /dev/mtd$i; \
      tftp -l mtd$i -p 10.0.0.2; md5sum mtd$i >> mtd.md5; rm mtd$i; done
      tftp -l mtd.md5 -p 10.0.0.2

Recovery
--------
Use sercomm-recovery tool.
Link: https://github.com/danitool/sercomm-recovery

MAC Addresses
-------------
+-----+------------+---------+
| use | address    | example |
+-----+------------+---------+
| LAN | label      | *:50    |
| WAN | label + 11 | *:5b    |
| 2g  | label + 2  | *:52    |
| 5g  | label + 3  | *:53    |
+-----+------------+---------+
The label MAC address was found in Factory 0x21000

cfgtool.py
----------
A tool for decoding and encoding Sercomm configs.
Link: https://github.com/r3d5ky/sercomm_cfg_unpacker

Co-authored-by: Karim Dehouche <karimdplay@gmail.com>
Co-authored-by: Maximilian Weinmann <x1@disroot.org>
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2022-12-13 23:06:20 +01:00
Christian Marangi
05dbdcbd32
generic: move pending 870 ca8210 fix crash patch to backport
Patch got merged upstream in kernel 6.1. Move it to backport to better
track it.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-13 02:05:29 +01:00
Christian Marangi
c3c9ef598c
generic: fix wrong PTR_ERR use in of net mac address ascii patch
nvmem_cell_read return a pointer error when an error occurs. Currently
we convert the pointer error to an int while the rest of the function
return a void* and expcet an error pointer. Fix this PTR_ERR msuse
fixing compilation warning.

Fixes the following compilation warning:
net/ethernet/eth.c: In function 'nvmem_cell_get_mac_address':
net/ethernet/eth.c:547:24: warning: returning 'long int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
  547 |                 return PTR_ERR(mac);
      |                        ^~~~~~~~~~~~
net/ethernet/eth.c: In function 'nvmem_cell_get_mac_address_ascii':
net/ethernet/eth.c:564:24: warning: returning 'long int' from a function with return type 'void *' makes pointer from integer without a cast [-Wint-conversion]
  564 |                 return PTR_ERR(mac_ascii);
      |                        ^~~~~~~~~~~~~~~~~~

Fixes: 7b863af180 ("kernel: move mac-address-ascii patches to generic")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-12-13 00:33:19 +01:00