Commit Graph

26429 Commits

Author SHA1 Message Date
Linus Walleij
bc19ce078d gemini: Create patches and config for kernel v5.15
This creates a v5.15 baseline for the Gemini platform.
The main new attraction is the new crypto driver from
Corentin Labbe that we activate in the new config.
Config was refreshed.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2022-04-14 10:12:34 +02:00
Linus Walleij
30d2fcffeb generic: backport 5.16 RTL8366RB improvements
The prerequisite DSA changes for the nice RTL8366RB improvements
are already backported so bring back these changes as well.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2022-04-14 10:12:34 +02:00
Daniel Golle
9a22943eb2
mediatek: 5.15: re-enable arch timer on MT7623 as well
Re-enable arch timer also on MT7623, yet another time.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-04-14 07:34:50 +01:00
Chuanhong Guo
e30424112e mediatek: 5.15: enable arm arch timer for mt7629
otherwise the system delay is completely broken.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-04-14 13:35:12 +08:00
Chuanhong Guo
10068a2e89 kernel: 5.15: add support for ESMT F50x1G41LB
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-04-14 12:48:39 +08:00
Daniel Golle
acf701a070
malta: add config-5.15
Adding the kernel configuration has accidentally been omitted when
enabling testing kernel 5.15. Add it now.

Fixes: 09f6200198 ("malta: enable testing kernel 5.15")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-04-13 19:50:50 +01:00
Koen Vandeputte
f3fa68e515 ath79: nand: add 5.15 support for nand subtarget
Tested on GL.iNet E750

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-04-13 12:00:22 +02:00
Koen Vandeputte
4bfdb12deb kernel: add missing symbols for 5.15
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-04-13 12:00:22 +02:00
Eneas U de Queiroz
c9c2b01b84 mediatek/mt7622: enable accelerated crypto drivers
Use ARMv8 Crypto Extensions for AES, ghash and sha256.

This results in a 16 times speed gain in speed for aes-128-ctr, 17x in
aes-128-gcm, and 9 times in sha256.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-04-11 20:25:34 +01:00
Daniel Golle
5cf5dce05a
imagebuilder: export SOURCE_DATE_EPOCH to environment
Export SOURCE_DATE_EPOCH to environment so filesystem and image
creation tools will make use of it.
Fixes reproducibility of images generated with the ImageBuilder.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-04-10 00:56:38 +01:00
John Audia
b92ec82235 kernel: bump 5.10 to 5.10.110
Removed upstreamed:
  generic/backport-5.10/350-v5.18-MIPS-pgalloc-fix-memory-leak-caused-by-pgd_free.patch
  generic/pending-5.10/850-0014-PCI-aardvark-Fix-reading-PCI_EXP_RTSTA_PME-bit-on-em.patch
  ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch

All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200
Compile-/run-tested: ath79/generic (Archer C7 v2).

Signed-off-by: John Audia <graysky@archlinux.us>
2022-04-09 19:31:46 +02:00
Rui Salvaterra
be381a7ac7 kernel: bump 5.15 to 5.15.33
Deleted (upstreamed):
generic/backport-5.15/350-v5.18-MIPS-pgalloc-fix-memory-leak-caused-by-pgd_free.patch [1]
generic/backport-5.15/730-v5.16-hv-utils-add-PTP_1588_CLOCK-to-Kconfig-to-fix-build.patch [2]
generic/pending-5.15/850-0014-PCI-aardvark-Fix-reading-PCI_EXP_RTSTA_PME-bit-on-em.patch [3]
generic/pending-5.15/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch [4]

Manually rebased:
generic/pending-5.15/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch
ramips/patches-5.15/710-at803x.patch

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=d29cda15cab086d82d692de016f7249545d4b6b4
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=d5aad7d63b1b5c1f3c4b69e12c05e7c7d196fae8
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=ed750e22e44366e264bcdf7b1cf0713f08f7980a
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=0fe94b84c43cfea867e1721606185e8686d7d32f

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[Refresh patches again]
[Remove generic/pending-5.15/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-09 19:31:46 +02:00
Rui Salvaterra
5a09eb17c2 kernel: bump 5.15 to 5.15.32
Patches automatically rebased.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-04-09 19:31:46 +02:00
Aleksander Jan Bajkowski
a98ded6c5c kernel: move some symbols to generic config
This commit add some enabled symbols to generic config.
LTO is only supported by clang compiler and therefore should
be disabled in the generic config instead of duplicating this
symbol in each target. CONFIG_LTO_NONE do this job.

The second group of symbols is enabled by the options available
in the generic config and is therefore added here:
* CONFIG_AF_UNIX_OOB is selected by CONFIG_NET && CONFIG_UNIX,
* CONFIG_BINARY_PRINTF is selected by CONFIG_BPF_SYSCALL,
* CONFIG_NET_SOCK_MSG is selected by CONFIG_BPF_SYSCALL && CONFIG_NET.

The other symbols are disabled and should be in the generic config.

This commit also removes these symbols from subtargets.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-04-09 19:31:46 +02:00
Ansuel Smith
5b3a75e7a6 generic: 5.15: fix aardvak pci pending patch
Fix aardvak pci controller pending patch. Use generic_handle_domain_irq
and fix rebase error.

Fixes: 483503603c ("generic: 5.15: rework pending patch")
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-04-09 19:31:46 +02:00
Aleksander Jan Bajkowski
848f112c91 armvirt: add 5.15 as testing kernel
Add 5.15 as testing kernel.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-04-09 19:31:46 +02:00
Aleksander Jan Bajkowski
03befa257e armvirt: move common symbols from subtarget to target config
These new symbols are common for all subtargets and
can be moved into target config.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-04-09 19:31:46 +02:00
Aleksander Jan Bajkowski
f551f49424 armvirt: refresh 5.15 config
This was done by executing these commands:
$ make kernel_oldconfig CONFIG_TARGET=subtarget
$ make kernel_oldconfig CONFIG_TARGET=subtarget_platform

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-04-09 19:31:46 +02:00
Aleksander Jan Bajkowski
5064ea8025 armvirt: copy config files from 5.10
Copy config files from 5.10.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-04-09 19:31:46 +02:00
Aleksander Jan Bajkowski
fcb68aa425 armvirt: refresh 5.10 config
This was done by executing these commands:
$ make kernel_oldconfig CONFIG_TARGET=subtarget
$ make kernel_oldconfig CONFIG_TARGET=subtarget_platform

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-04-09 19:31:46 +02:00
Ray Wang
3204906569 ipq40xx: add RT-AC2200 alternative name to RT-AC42U/RT-ACRH17
RT-AC2200 is the same device with a different name. The OEM firmwares have the same MD5.

Signed-off-by: Ray Wang <raywang777@foxmail.com>
2022-04-09 19:31:46 +02:00
Joe Mullally
44e1e5d153 ath79: Move TPLink WPA8630Pv2 to ath79-tiny target
These devices only have 6MiB available for firmware, which is not
enough for recent release images, so move these to the tiny target.

Note for users sysupgrading from the previous ath79-generic snapshot
images:

The tiny target kernel has a 4Kb flash erase block size instead
of the generic target's 64kb. This means the JFFS2 overlay partition
containing settings must be reformatted with the new block size or else
there will be data corruption.

To do this, backup your settings before upgrading, then during the
sysupgrade, de-select "Keep Settings". On the CLI, use "sysupgrade -n".

If you forget to do this and your system becomes unstable after
upgrading, you can do this to format the partition and recover:

* Reboot
* Press RESET when Power LED blinks during boot to enter Failsafe mode
* SSH to 192.168.1.1
* Run "firstboot" and reboot

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Tested-by: Robert Högberg <robert.hogberg@gmail.com>
2022-04-09 19:31:46 +02:00
Felix Matouschek
a5de91a88a kernel: Fix oob layout of XTX XT26G0xA
The correct oob layout is:

ECC:
region->offset = 48;
region->length = 16;

Free:
/* Reserve 1 byte for the BBM. */
region->offset = 1;
region->length = 47;

Signed-off-by: Felix Matouschek <felix@matouschek.org>
2022-04-09 21:08:26 +08:00
Felix Matouschek
3711aee56d kernel: Fix readid method of XTX XT26G0xA
The correct readid method is SPINAND_READID_METHOD_OPCODE_ADDR.

Signed-off-by: Felix Matouschek <felix@matouschek.org>
2022-04-09 21:08:26 +08:00
Chuanhong Guo
6fa50e26e7 kernel: mtk_bmt: skip bitflip check if threshold isn't set
kernel spi-nand driver leaves this field empty and let mtd set it later.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-04-09 21:08:26 +08:00
Chuanhong Guo
55be011a71 kernel: v5.10: backport GigaDevice SPI-NAND supports
This backports GD SPI NAND support from nand/next to v5.10

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-04-09 21:08:19 +08:00
Chuanhong Guo
42186888f5 kernel: v5.15: backport GigaDevice SPI-NAND supports
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-04-09 21:04:40 +08:00
Rafał Miłecki
dd8957604b bcm53xx: refresh kernel 5.15 config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-04-08 10:49:45 +02:00
Hauke Mehrtens
f6d566301e at91: Automatically detect USB feature
The sama7 sub target does not have USB support, the feature should not
be activated there. OpenWrt can automatically detect if the target
supports USB by using the scripts/target-metadata.pl script. With the
automatic detection USB support will only get activated on subtargest
which actually support USB like sam9x and sama5.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-07 21:01:48 +02:00
Hauke Mehrtens
3296881a1d at91/sama7: Do not build in Bluetooth
Bluetooth should be activated as an optional kmod package instead of
compiling it into the kernel.

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-07 21:00:32 +02:00
Hauke Mehrtens
6709b67265 at91/sama7: Use ext4 driver for ext2 and ext3
Use the ext4 driver for ext2 and ext3 too. This feature is activated in
the OpenWrt generic configuration.

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-07 21:00:32 +02:00
Hauke Mehrtens
ac2bc4b893 at91/sama7: Deactivate certification and key system
This was probably activated by mac80211 which was activated before.
mac80211 is build from backports in OpenWrt.

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-07 21:00:32 +02:00
Hauke Mehrtens
a2f1db99f6 at91/sama7: Do not activate cgroups and namespaces
cgroups and namespaces should be configured by the generic OpenWrt
configuration and not for a specific target.

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-07 21:00:32 +02:00
Hauke Mehrtens
5a84a8764d at91/sama7: Remove config options build as module
Remove the configuration options which are building modules for the sub
target configuration.

These kernel modules are not packaged. Kernel options should only be
build as a module when they are selected by a kmod package and not by
setting them to =m in the target kernel configuration.

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-07 21:00:19 +02:00
Felix Fietkau
a5916a53b8 kernel: remove duplicate patch that is already in the 5.15 kernel tree
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-04-07 13:08:09 +02:00
Piotr Dymacz
ff09905a46 bcm27xx: include 'rtc' in target's 'FEATURES'
There are many ways to add external RTC to Raspberry Pi boards. Let's
include support for this for the whole target and while at it, sort
features alphabetically.

Fixes: #9594
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-04-07 10:03:23 +02:00
Piotr Dymacz
a0528cab44 imx: image: use 'u-boot-dtb.img' filename for SPL payload
For targets in U-Boot which were migrated to DM, the correct binary
image filename will be 'u-boot-dtb.img'. For backward compatibility,
keep support for both files and use the one which was generated with
our 'uboot-imx' package.

See also 'CONFIG_SPL_FS_LOAD_PAYLOAD_NAME' and 'CONFIG_OF_CONTROL' in
mainline U-Boot sources.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-04-07 09:58:44 +02:00
Petr Štetiar
bfbf235a12 imx: bootscript-apalis: make it working with U-Boot 2022.01
Upstream in commit 8b9c0cb46471 ("apalis_imx6: boot env configuration
updates") removed emmc legacy wrappers, but so far didn't included any
replacements. Fix it by simply defining the missing variables and UUID
gathering directly into the boot script.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
[pepe2k@gmail.com: updated commit title for 2022.01]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-04-07 09:58:44 +02:00
Daniel Golle
d6a3949922
kernel: add missing CONFIG_SECURITY_LANDLOCK symbol for 5.15
Building with SELinux enabled unveiled a missing Kconfig symbol.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-04-06 21:54:57 +01:00
Koen Vandeputte
d1456a4ad9 ath79: mikrotik: enable ecc hamming algorithm for kernel 5.15
This algorithm has it's own symbol now.
Enable it to fix nand support

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-04-05 17:31:04 +02:00
Koen Vandeputte
5af9aafabb ath79: mikrotik: add 5.15 support for mikrotik subtarget
Tested on RB922

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-04-05 17:31:04 +02:00
Koen Vandeputte
aff4ffb3f0 kernel: add missing symbol for 5.15
Driver for the National Semiconductor DP83640 PHYTER (DP83640_PHY) [N/m/y/?] (NEW)

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-04-05 17:31:04 +02:00
Oskari Lemmela
f8e65fecee ath79: fix ar934x spi driver delays
Backport spi driver delay fixes from the 5.17-rc1 kernel.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
[port also to kernel 5.15]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-04-05 17:31:04 +02:00
Stijn Tintel
d7eba8059b qoriq: enable support for Marvell Alaska PHYs
The WatchGuard Firebox M200 and M300 use a Marvell 88e1543 PHY for the
first 3 ethernet ports. This PHY is supported by the Marvell Alaska PHY
driver, so enable it.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-04-03 22:41:05 +03:00
Stijn Tintel
3e0daca644 Revert "kernel: backport MT7530 VLAN fix"
There are various reports on Github and in the forum that this commit
causes multiple problems.

This reverts commit ee6ba216d8.

Fixes: #9420
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-04-03 19:28:08 +03:00
Donald Hoskins
bf6002e74b octeon: Introduce 5.15 testing kernel
octeon/patches-5.10 -> octeon/patches-5.15
Removed 140-octeon_e300_support.patch as E300 support appears to be upstreamed.
Reworked 130-add_itus_support.patch to compensate for the upstreaming of E300

octeon/config-5.15
The following Kernel Symbols were ADDED:
Line 5: +CONFIG_AF_UNIX_OOB=y
Line 6: +CONFIG_AHCI_OCTEON=y
Line 9: +CONFIG_ARCH_KEEP_MEMBLOCK=y
Line 16: +CONFIG_ATA=y
Line 17: +CONFIG_BINARY_PRINTF=y
Line 29: +CONFIG_CPU_R4K_FPU=y
Line 45: +CONFIG_FWNODE_MDIO=y
Line 51: +CONFIG_GENERIC_FIND_FIRST_BIT=y
Line 59: +CONFIG_GLOB=y
Line 61: +CONFIG_GPIO_CDEV=y
Line 77: +CONFIG_LTO_NONE=y
Line 85: +CONFIG_MIPS_FP_SUPPORT=y
Line 93: +CONFIG_NET_SELFTESTS=y
Line 94: +CONFIG_NET_SOCK_MSG=y
Line 105: +CONFIG_PATA_OCTEON_CF=y
Line 106: +CONFIG_PATA_TIMINGS=y
Line 114: +CONFIG_PTP_1588_CLOCK_OPTIONAL=y
Line 121: +CONFIG_SATA_AHCI_PLATFORM=y
Line 122: +CONFIG_SATA_HOST=y
Line 124: +CONFIG_SCSI_COMMON=y
Line 132: +CONFIG_SOCK_RX_QUEUE_MAPPING=y
Line 157: +CONFIG_USB_XHCI_HCD=y
Line 158: +CONFIG_USB_XHCI_PLATFORM=y

The following kernel symbols were REMOVED:
Line 21: -CONFIG_BLK_SCSI_REQUEST=y
Line 37: -CONFIG_ENABLE_MUST_CHECK=y
Line 69: -CONFIG_HOLES_IN_ZONE=y
Line 102: -CONFIG_OF_NET=y
Line 140: -CONFIG_SYS_SUPPORTS_HUGETLBFS=y

Compiled for Itus Shield, Boots successfully, continuing to test
for existing 5.10 memory leak.

Signed-off-by: Donald Hoskins <grommish@gmail.com>
[refresh patches]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-04-03 05:47:24 +03:00
Stijn Tintel
f6cda9f06b Revert "octeon: mark source-only"
The memory leak is fixed by the kernel patches backported in the
previous commit.

This reverts commit 1fa8780056.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-04-03 05:47:21 +03:00
Stijn Tintel
9283359bd5 kernel: backport pgalloc memory leak fix
Backport a fix for the massive memory leak observed in Octeon after
switching to kernel 5.10.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-04-03 05:23:57 +03:00
Piotr Dymacz
4b1b76de7e imx: base-files: drop redundant space after case keywords
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-04-01 14:32:54 +02:00
Piotr Dymacz
4117b5a133 layerscape: image: drop redundant parameter from kernel build recipe
Neither 'fit', nor target-specific 'traverse-fit' build recipes accept
FDT load address in 3rd parameter.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-04-01 14:32:54 +02:00
Vincent Pelletier
15fbb91666 kernel: scale nf_conntrack_max more reasonably
Use the kernel's built-in formula for computing this value.
The value applied by OpenWRT's sysctl configuration file does not scale
with the available memory, under-using hardware capabilities.
Also, that formula also influences net.netfilter.nf_conntrack_buckets,
which should improve conntrack performance in average (fewer connections
per hashtable bucket).

Backport upstream commit for its effect on the number of connections per
hashtable bucket.

Apply a hack patch to set the RAM size divisor to a more reasonable value (2048,
down from 16384) for our use case, a typical router handling several thousands
of connections.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-04-01 13:23:41 +01:00
Stijn Tintel
1fa8780056 octeon: mark source-only
There is a hard to reproduce, even harder to track down memory leak in
Octeon since kernel 5.10. Mark octeon source-only until it is plugged.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-04-01 13:05:34 +03:00
Petr Štetiar
39d28b84f1 Revert "ipq40xx: stop chromium sub-target builds on the buildbots"
This reverts commit 35d2bbc29b as we
believe we found that it is indeed an openssl issue, where openssl is
trying to use getrandom(2), but fails because this particular builder
has an ancient kernel without that syscall. We didn't get to the bottom
of why openssl doesn't fall back to something like /dev/random.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-04-01 07:41:01 +02:00
Zoltan HERPAI
483fe539c4 mxs: enable 5.15 as testing kernel
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2022-04-01 00:51:40 +02:00
Zoltan HERPAI
e5c697a41c mxs: update config for 5.15
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2022-04-01 00:51:38 +02:00
Zoltan HERPAI
4ab9f9fb45 mxs: copy config from 5.10 to 5.15
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2022-04-01 00:51:36 +02:00
Zoltan HERPAI
00a941a99a generic: add missing symbol for 5.15
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2022-04-01 00:51:32 +02:00
Jan-Niklas Burfeind
c6eb63d48f
ath79: migrate Archer C5 5GHz radio device paths
When upgrading a TP-Link Archer C5 v1 from ar71xx to ath79,
the 5ghz radio stops working because the device path changed.

Same has been done for the Archer C7 before:

commit e19506f206 ("ath79: migrate Archer C7 5GHz radio device paths")

Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2022-03-31 18:07:29 +02:00
Petr Štetiar
bf1c3a5f3c imx: re-enable ARM arch timer
Config option `ARM_ARCH_TIMER` has been removed during rebasing onto
5.15 kernel in commit 2b395c2982 ("imx: update config for 5.15").

Anyway, as stated in commit 8cdc356f8c ("mediatek: mt7623: Re-enable
ARM arch timer") config option `ARM_ARCH_TIMER` cannot be enabled in the
config directly; it is only selected by `HAVE_ARM_ARCH_TIMER`. We need
to enable the latter in our config.

Fixes: 2b395c2982 ("imx: update config for 5.15")
Reported-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-31 17:30:17 +02:00
Petr Štetiar
9d26651174 imx: make 5.15 default kernel and remove 5.10 support
In imx target we're sharing single, version agnostic kernel
`config-default` file, which doesn't work very well with current 5.10
and upcoming 5.15 kernel symbols as recent rebase onto 5.15 kernel
introduced in commit 2b395c2982 ("imx: update config for 5.15) has
introduced following regression with 5.10 kernel:

 Marvell 88E6xxx Ethernet switch fabric support (NET_DSA_MV88E6XXX) [Y/n/m/?] y
   Switch Global 2 Registers support (NET_DSA_MV88E6XXX_GLOBAL2) [Y/n/?] (NEW)

That NET_DSA_MV88E6XXX_GLOBAL2 kernel config symbol has been removed in
upstream commit 63368a7416df ("net: dsa: mv88e6xxx: Make global2 support
mandatory") in kernel version 5.12.

This issue could be probably fixed by introduction of separate kernel
config files for each currently used kernel versions and subtarget, but
it is not worth the hassle and resources as imx target is running mostly
upstream kernel, so lets fix it by switching to 5.15 version instead.

Fixes: 2b395c2982 ("imx: update config for 5.15")
Acked-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-31 17:30:14 +02:00
Petr Štetiar
853686f7a9 kernel: generic: add more missing kernel symbols for 5.15
Found while adding 5.15 support for imx target.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-30 23:39:08 +02:00
Petr Štetiar
2b395c2982 imx: update config for 5.15
Refresh kernel config with `make kernel_oldconfig` make target.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-30 23:39:08 +02:00
Petr Štetiar
5188e43d45 imx: enable 5.15 as testing kernel
So anyone interested can help with new kernel version integration and
testing.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-30 23:39:08 +02:00
Petr Štetiar
059ef70fd3 imx: copy config and patches from 5.10 to 5.15
So the upcoming changes needed for 5.15 can be reviewed easily.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-30 23:39:08 +02:00
Rafał Miłecki
9ac80a47ea bcm53xx: prepare kernel 5.15 support
Tested on Luxul XWR-3150 (boot, NAND, PCIe, switch, Ethernet).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-30 23:22:46 +02:00
John Audia
c41da167d2 kernel: bump 5.10 to 5.10.109
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2022-03-30 18:33:38 +02:00
Matthias Schiffer
aee9ccf5c1
ath79: fix label MAC address for Ubiquiti UniFi AP Outdoor+
The label has the MAC address of eth0, not the WLAN PHY address. We can
merge the definition back into ar7241_ubnt_unifi.dtsi, as both DTS
derived from it use the same interface for their label MAC addresses
after all.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2022-03-30 17:48:30 +02:00
David Bauer
9a0155bc4f ath79: add 5.15 support for generic subtarget
Add Kernel 5.15 patches + config. This is currently only available for
the generic subtarget, as it was exclusively tested with this target.

Tested-on: Siemens WS-AP3610, Enterasys WS-AP3705i

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-03-30 17:28:39 +02:00
SHIMAMOTO Takayoshi
fc94c0d203 bcm53xx: add switch ports for Buffalo WZR-900DHP & re-enable it
Specify the switch ports in the DTS file.
Re-enable it after it was disabled by commit e9672b1a8f ("bcm53xx: switch to the
upstream DSA-based b53 driver").

Signed-off-by: SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
[rmilecki: reword commit & drop unneeded whitespace change]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-30 16:20:50 +02:00
Rafał Miłecki
a721fb9f83 bcm53xx: backport DT changes from 5.17 & 5.18
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-30 16:20:25 +02:00
Rafał Miłecki
a6dc0f680d bcm53xx: drop dead upgrade code
platform_nand_pre_upgrade() is gone since commit 790692dde2
("base-files: drop support for the platform_nand_pre_upgrade()").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-29 16:14:54 +02:00
Arınç ÜNAL
72b9b721d7 bcm53xx: add support for Asus RT-AC88U
Asus RT-AC88U is an AC3100 router featuring 9 Ethernet ports over the
integrated Broadcom and the external Realtek switch.

Hardware info:
* Processor: Broadcom BCM4709C0KFEBG dual-core @ 1.4 GHz
* Switch: BCM53012 in BCM4709C0KFEBG & external RTL8365MB
* DDR3 RAM: 512 MB
* Flash: 128 MB (ESMT F59L1G81LA-25T)
* 2.4GHz: BCM4366 4×4 2.4/5G single chip 802.11ac SoC
* 5GHz: BCM4366 4×4 2.4/5G single chip 802.11ac SoC
* Ports: 8 Ports, 1 WAN Ports

Flashing instructions:
* Boot to CFE Recovery Mode by holding the reset button while power-on.
* Connect to the router with an ethernet cable.
* Set IPv4 address of the computer to 192.168.1.2 subnet 255.255.255.0.
* Head to http://192.168.1.1.
* Reset NVRAM.
* Upload the OpenWrt image.

CFE bootloader may reject flashing the image due to image integrity check.
In that case, follow the instructions below.

* Rename the OpenWrt image as firmware.trx.
* Run a TFTP server and make it serve the firmware.trx file.
* Run the URL below on a browser or curl.
  http://192.168.1.1/do.htm?cmd=flash+-noheader+192.168.1.2:firmware.trx+flash0.trx

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
[rmilecki: mark BROKEN until we sort out nvram & CFE recovery]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-29 16:10:07 +02:00
Hauke Mehrtens
34fb36e165 realtek: Fix tc default package
The tc package does not exits any more, it was split into tc-tiny,
tc-full and tc-bpf. Include tc-bpf by default into realtek images.

This increases the compressed image size by about 232KBytes.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-03-29 13:43:01 +02:00
Hauke Mehrtens
469030659c realtek: Use firewall4
The realtek target is not a router, but basic device, see DEVICE_TYPE.
The basic device type does not come with firewall by default, see
include/target.mk for details. The realtek target extended
DEFAULT_PACKAGES manually with firewall.

This changes the defaults to take firewall4 and nftables instead of
firewall and iptables. This also adds the additional package
kmod-nft-offload.

The only difference to the router type is the missing ppp,
ppp-mod-pppoe, dnsmasq and odhcpd-ipv6only package.

This increases the compressed image size by about 422KBytes.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-03-29 13:42:56 +02:00
Hauke Mehrtens
2acebbdcaa realtek: Remove dnsmasq and odhcpd-ipv6only from default
Do not include the dnsmasq and odhcpd-ipv6only package by default any
more. These services are not needed on a switch. If someone needs this
it is still possible to use opkg or image builder to add them.

This decreases the compressed image size by about 165KBytes.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-03-29 13:42:29 +02:00
Petr Štetiar
f32ecb9665 sunxi: update config for 5.15
Refresh kernel config with `make kernel_oldconfig` make target.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
177e79c218 sunxi: refresh kernel 5.15 patches
So the patches apply cleanly.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
c80088b407 sunxi: rebase sun50i-h5-nanopi-r1s-h5.dts onto 5.15
So the patch can be applied on top of 5.15 kernel.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
6d1dd34732 sunxi: enable 5.15 as testing kernel
So anyone interested can help with new kernel version integration and
testing.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
c707e1bc04 sunxi: copy config and patches from 5.10 to 5.15
So the upcoming changes needed for 5.15 can be reviewed easily.

Removed following upstreamed patches:

 * 062-add-sun8i-h3-zeropi-support.patch
 * 100-sunxi-h3-add-support-for-nanopi-r1.patch
 * 101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
be9a69caa8 kernel: modules: fix kmod-mdio-devres dependency for 5.15
Fixes following build issues:

 Package kmod-r8169 is missing dependencies for the following libraries:
 mdio_devres.ko

 Package kmod-ixgbe is missing dependencies for the following libraries:
 mdio_devres.ko

 Package kmod-amd-xgbe is missing dependencies for the following libraries:
 mdio_devres.ko

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
12c33d99c8 x86: update config for 5.15
Refresh kernel config with `make kernel_oldconfig` make target.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
9b3bc5d119 x86: enable 5.15 as testing kernel
So anyone interested can help with new kernel version integration and
testing.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
7ef75445c5 x86: copy config and patches from 5.10 to 5.15
So the upcoming changes needed for 5.15 can be reviewed easily.
Removing following patches backported from 5.15:

 * 101-v5.15-mfd-lpc_ich-Enable-GPIO-driver-for-DH89xxCC.patch
 * 102-v5.15-platform-x86-add-meraki-mx100-platform-driver.patch

Removed upstreamed patch `300-pcengines_apu1_led.patch` in commit
1b40faf7e4ab ("leds: apu: extend support for PC Engines APU1 with newer
firmware")

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
972f2bff6a generic: backport 5.16 fix for hv utils build failure
Backports following fix:

 hv: utils: add PTP_1588_CLOCK to Kconfig to fix build

 The hyperv utilities use PTP clock interfaces and should depend a
 a kconfig symbol such that they will be built as a loadable module or
 builtin so that linker errors do not happen.

 Prevents these build errors:

 ld: drivers/hv/hv_util.o: in function `hv_timesync_deinit':
 hv_util.c:(.text+0x37d): undefined reference to `ptp_clock_unregister'
 ld: drivers/hv/hv_util.o: in function `hv_timesync_init':
 hv_util.c:(.text+0x738): undefined reference to `ptp_clock_register'

References: https://lore.kernel.org/stable/20220328093115.7486-1-ynezz@true.cz/T/#u
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Petr Štetiar
756e71b03f kernel: generic: add more missing kernel symbols for 5.15
Found while adding 5.15 support for x86/sunxi targets.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-29 12:02:50 +02:00
Daniel Golle
506ddce90f
generic: 5.15: fix FIT partition parser on block partitions
Using set_disk_ro() doesn't have the desired effect and instead of
just setting the single partition to be read-only it affects the
whole disk. Use the bd_read_only flag in struct block_device instead
to mark a partition being read-only.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-29 01:56:05 +01:00
Daniel Golle
1c7e146f7e
layerscape: make boot filesystem reproducible
Set timestamp option for make_ext4fs to make boot filesystem
reproducible.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-28 20:52:54 +01:00
Daniel Golle
44b457168e
mvebu: make boot filesystem reproducible
Set timestamp option for make_ext4fs to make boot filesystem
reproducible.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-28 20:52:49 +01:00
Felix Fietkau
92081f9a34 ramips: fix kernel module build errors on linux 5.15
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-28 11:03:13 +02:00
Daniel Golle
09f6200198 malta: enable testing kernel 5.15
Nothing special is needed here, just add KERNEL_TESTING_PATCHVER.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-28 02:32:29 +01:00
Felix Fietkau
a3764ee29d ramips: add linux 5.15 support for mt7621
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-27 21:36:40 +02:00
Marek Behún
9caa6f0aa7 kernel: Backport mv88e6xxx patch to keep pvid at 0 if VLAN-unaware and remove hack
Backport patch
  8b6836d82470 ("net: dsa: mv88e6xxx: keep the pvid at 0 when VLAN-unaware")
from 5.15.

Keeping the pvid at 0 when VLAN-unaware makes it possible to drop the
hack introduced in commit 920eaab1d8 ("kernel: DSA roaming fix for
Marvell mv88e6xxx"). Dropping the hack makes it possible to use VLAN
interfaces with VID 1 on DSA ports without problems with FDB.

Signed-off-by: Marek Behún <kabel@kernel.org>
2022-03-27 17:38:49 +01:00
Ansuel Smith
876a49ca62 ipq806x: 5:15: fix dedicated krait cpufreq
Fix dedicated cpufreq for kernel 5.15 as they changed module
order and now it can happen that cpufreq probe after cache driver.
Also add lock between cache scaling in set_target as it's now required
by opp functions.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 16:16:07 +01:00
Ansuel Smith
af70a27b38 ipq806x: backport nand raname to kernel 5.10
Rename nand_controller to nand in kernel 5.10 to use the same dts across kernel version.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 16:16:07 +01:00
Ansuel Smith
e86dfd0a44 ipq806x: rework rootfs conflicts patch for smem
Now that smem actually free the leaked parts, when
a rootfs partition is detected, the kernel panics as
it try to free the static space allocated for the "ubi"
name. Change the logic and fix the name at the allocate_partition
function to correctly free the space allocated by smem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 16:16:07 +01:00
Ansuel Smith
8cc2caed58 ipq806x: 5:15: add testing kernel version
Refresh patch for 5.15
Rework tweak patch to sync with upstream ipq8064 dtsi and fix
regression introduced.
Rename nand_controller to nand in every dts.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 16:16:07 +01:00
Ansuel Smith
327677a71d ipq806x: 5:15: drop upstream patch
- Drop stmmac upstream patches
- Drop tsens patches
- Drop ADM driver
- Drop SMEM parser

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 16:16:07 +01:00
Ansuel Smith
4c5d5c66ca ipq806x: 5:15: refresh config
Refreshed using make kernel_menuconfig CONFIG_TARGET=generic

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 16:16:07 +01:00
Ansuel Smith
3064e76c94 ipq806x: 5:15: copy config and patch from 5.10
Copy config and patch from kernel 5.10 to kernel 5.15

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 16:16:07 +01:00
Aleksander Jan Bajkowski
26e7c22757
kernel: sort generic configuration
This was done by executing these commands:

$ ./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: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-27 15:50:14 +01:00
Aleksander Jan Bajkowski
1e83d53fd9 kernel: add more missing config symbols for 5.15
Add more disabled config options found in malta
target to generic.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-03-27 15:45:50 +01:00
Daniel Golle
c3029f3652
mediatek: add 5.15 config for mt7623 and mt7629
Compile tested both with all kernel modules.
Run-time tested mt7623 on BananaPi-R2.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-27 14:51:04 +01:00
Daniel Golle
f08fc0747e
kernel: 5.15: add more missing symbols
Add various Kconfig symbols which surfaced when building with all
kernel modules enabled.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-27 14:50:55 +01:00
Christian Lamparter
35d2bbc29b ipq40xx: stop chromium sub-target builds on the buildbots
the buildbots are having troubles with the image.
They seem to get "Killed" at the last step of the KERNEL rule:

|/cros-vbutil -k zImage.itb.vboot -c "root=PARTUUID=%U/PARTNROFF=1" -o zImage.itb.vboot.new
|make[4]: *** [Makefile:18: zImage.itb.vboot] Killed

Since the Google Wifi (Gale) is currently the only target in
this sub-target. So this means that subtarget has to be disabled
from the time being to not be picked up by the builders.

For people wanting to checkout out OpenWrt on the Google Wifi:
please compile it locally.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-27 15:39:27 +02:00
Christian Lamparter
eeb8fd4ce7 gpio-cdev: move kmod-leds-uleds dependency to MX100
The inclusion of the kmod-leds-uleds into the userspace
nu801 package causes a circular dependency inside the
buildsystem... which causes it to be picked regardless
of other DEPENDS values.

In case of the mx100, this could be solved by moving the
kmod-leds-uled dependency to the kmod-meraki-mx100.

Bonus: drop @!LINUX_5_4 from kmod-meraki-mx100
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-27 15:39:27 +02:00
Daniel Golle
1562e430d4
generic: 5.15: add more missing Kconfig symbols
Add a bunch of missing new Kconfig symbols to generic/config-5.15.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-27 12:31:26 +01:00
Felix Fietkau
ade563ba84 mediatek: add patches for 5.15 and kernel config for mt7622
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-27 12:55:53 +02:00
Felix Fietkau
a92db8abe0 kernel: add missing config symbols for 5.15
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-27 12:55:48 +02:00
Felix Fietkau
0f029b3d2b mediatek: add patches for MT7622 WED (wireless ethernet dispatch)
This series also contains other improvement for hardware flow offload support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-27 12:54:38 +02:00
Ansuel Smith
009f8afe06 generic: 5.15: refresh pending patch
Use 'make target/linux/refresh' to refresh pending patches.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 05:00:50 +01:00
Ansuel Smith
49cb5e501a generic: 5.15: refresh hack patch
Use 'make target/linux/refresh' to refresh hack patches.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 05:00:50 +01:00
Ansuel Smith
39a7c8d809 generic: 5.15: refresh backport patch
Use 'make target/linux/refresh' to refresh backport patches.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 04:51:38 +01:00
Ansuel Smith
49d9d2b210 generic: fix compilation warning for ar8xxx swconfig
There are 2 warning for ar8xxx swconfig.
- Fix not used dev variable when ETHERNET_PACKET_MANGLE
  is not selected
- Convert fallthrough comment to compilation macro

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 04:51:38 +01:00
Ansuel Smith
327b6dbd98 generic: 5.15: backport mdio improvement patch for qca8k
Backport qca8k mdio improvement patch merged upstream,
where we use eth packet when available to send mdio commands.

This should improve speed and cause less load on the CPU.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 04:51:38 +01:00
Daniel Golle
30a5e07390 generic: 5.15: get uImage.FIT partition parser ready
Prepare uImage.FIT partition parser for Linux 5.15

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 04:51:31 +01:00
Robert Marko
71efd34700 generic: 5.15: fix AQR 113C and 813
Patches that add the additional AQR PHY ID-s is just copy/paste from 5.10
and kernel 5.11 dropped the ack_interrupt method for PHY IRQ handling,
instead handle_interrupt is used.

So, simply switch to using handle_interrupt like other upstream AQR PHY-s.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 02:17:24 +01:00
Robert Marko
81fdb6afe3 generic: 5.15: fix new AQR PHY patches
After fixing the original 720 patch, it looks like more were added for
additional AQR ID-s.

Patches that add the additional AQR PHY ID-s is just copy/paste from 5.10
and kernel 5.11 dropped the ack_interrupt method for PHY IRQ handling,
instead handle_interrupt is used.

So, simply switch to using handle_interrupt like other upstream AQR PHY-s.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2022-03-27 02:17:24 +01:00
Ansuel Smith
ec818e5d29 generic: 5.15: backport mirror mode and LAG feature for qca8k
Backport LAG and mirror mode feature for qca8k.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 02:17:24 +01:00
Ansuel Smith
07b92c636a generic: 5.15: refresh config
Refresh kernel 5.15 generic config file

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[added some missing Kconfig symbols]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-27 02:17:24 +01:00
Ansuel Smith
7aa0f9365c generic: 5.15: fix affinity warning for qcom target
Backport a patch from 5.18 that fix affinity warning from qcom pinctrl driver.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:35 +00:00
Ansuel Smith
92fb51bc98 generic: 5.15: standardize tcp_no_window_check pending patch
Standardize pending patch tcp_no_window_check patch as with
new kernel they added a check for global variables.
The 2 new condition are that they must be read-only or
the data pointer should not point to kernel/module global
data.
Remove the global variable and move it to a standard place
following other variables logic.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:34 +00:00
Ansuel Smith
483503603c generic: 5.15: rework pending patch
Rework pending patch for kernel 5.15

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:34 +00:00
Ansuel Smith
1f302afd73 generic: 5.15: rework hack patch
Rework hack patch in dir for kernel 5.15.
For the specific patch of packet mangeling introduce a new extra_priv_flags
as we don't have enough space to add additional flags in priv_flags.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:34 +00:00
Ansuel Smith
7829ae4a2f generic: 5.15: qca8k: refresh backport patches
Refresh qca8k backport patches for 5.15 kernel.
Vlan_prepare is now dropped and there were some changes
to vlan add/remove functions.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:34 +00:00
Ansuel Smith
fc8778981f generic: 5.15: rework backport patch
Rework backport patch for kernel 5.15.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:34 +00:00
Ansuel Smith
79dfa44733 generic: 5.15: drop upstream patch
Drop upstream patch from backport dir for kernel 5.15

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:34 +00:00
Ansuel Smith
9a038e7fd1 generic: 5.15: copy config and patch from 5.10
Copy config and patches from kernel 5.10 to kernel 5.15

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-03-27 00:07:34 +00:00
Daniel Golle
13960fb0e0
generic: sync mtd rootfs hack with part_bits
In commit ab143647ef ("kernel: generic: improve FIT partition parser")
part_bits was bumped to 2 in order to allow up to 3 additional FIT
sub-images mapped into sub-partitions.
This change has to be reflected also in our local patch
420-mtd-set-rootfs-to-be-root-dev.patch
which still assumed part_bits==1 for mtdblock devices in case of
CONFIG_FIT_PARTITION=y.

Fixes: #9557
Fixes: ab143647ef ("kernel: generic: improve FIT partition parser")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-26 22:55:13 +00:00
Rui Salvaterra
2c26eb4e48
kernel: bump 5.10 to 5.10.108
Patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200
Tested-by: John Audia <graysky@archlinux.us>

Build-tested: ath79/generic, ramips/mt76{20,21,x8}, ipq40xx, mvebu, realtek/rtl{838,930}x, x86/64
Run-tested: ramips/mt7621, mvebu
Tested-by: Stijn Segers <foss@volatilesystems.org>

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-03-26 18:14:39 +00:00
Raylynn Knight
c7bcbcd492 x86: Add support for Sophos XG 85 and XG 86 devices
This commit builds on previous efforts to add support
for Sophos devices.

* Add support for Sophos XG 85 with/without wireless
* Add support for Sophos XG 86 with/without wireless

Tested on Sophos XG 85w rev1 and XG 86 rev 1

Signed-off-by: Raylynn Knight <rayknight@me.com>
2022-03-26 02:02:45 +01:00
Christian Lamparter
de4879c1ae kernel: mark CONFIG_PSTORE_COMPRESS_DEFAULT as "is not set"
# CONFIG_PSTORE_COMPRESS_DEFAULT="deflate"
this can lead to confusion. Thankfully, in the KConfig
world this setting is still interpreted as disabled.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-26 02:02:45 +01:00
Shiji Yang
2e6d19ee32 ramips: fix wifi mac address of HiWiFi series devices
For HiWiFi series devices, label_mac can be read from bdinfo partition,
and lan_mac, wlan2g_mac are same as the label_mac. Converting label_mac
to wlan5g_mac only needs to unset 6th bit. (It seems that all HiWiFi's
label_mac start with D4:EE)

For example:
label	D4:EE:07:32:84:88
lan	D4:EE:07:32:84:88
wan	D4:EE:07:32:84:89
wlan2g	D4:EE:07:32:84:88
wlan5g	D0:EE:07:32:84:88

Tested on HiWiFi HC5661.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-03-26 02:02:44 +01:00
Christian Lamparter
6387715093 kernel: add (disabled) ASYMMETRIC_TPM_KEY_SUBTYPE symbol
at91/sama7 fails to build due to:

| Asymmetric (public-key cryptographic) key type (ASYMMETRIC_KEY_TYPE) [Y/?] y
|  Asymmetric public-key crypto algorithm subtype (ASYMMETRIC_PUBLIC_KEY_SUBTYPE) [Y/?] y
|  Asymmetric TPM backed private key subtype (ASYMMETRIC_TPM_KEY_SUBTYPE) [N/m/?] (NEW)
|Error in reading or end of file.

please note that asym_tpm (module) has been removed in 5.17:
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d3cff4a9>

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-26 02:02:44 +01:00
Christian Lamparter
026fda10a5 ipq40xx: WAC510: device-tree overhauling
removes usb-port remains as neither the WAC510 nor the WAC505
come with a USB port. Update the LED properties to phase out
labels and introduce generic node-names as well as adding
the color, function and function-enumerator properties.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-26 02:02:44 +01:00
Christian Lamparter
b034a9e569 kernel: add missing (disabled) GOOGLE_* symbols
ARM Builds like sunxi/cortexa53 or the rpi family failed
to build due to a new symbols showing up:

|Google Firmware Drivers (GOOGLE_FIRMWARE) [Y/n/?] y
|  Coreboot Table Access (GOOGLE_COREBOOT_TABLE) [M/n/y/?] m
|  Coreboot Framebuffer (GOOGLE_FRAMEBUFFER_COREBOOT) [N/m/?] (NEW)
|Error in reading or end of file.

Fixes: e5b009e532 ("kernel: Package GOOGLE_FIRMWARE drivers")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-26 02:02:44 +01:00
David Bauer
4551bfd91f ath79: fix link for long cables with OCEDO Raccoon
The OCEDO Raccoon had significant packet-loss with cables longer than 50
meter. Disabling EEE restores normal operation.

Also change the ethernet config to reduce loss on sub-1G links.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-03-25 23:58:09 +01:00
Felix Fietkau
62fd9f9709 kernel: mtdsplit: support UBI after FIT images
Change the partition name accordingly. Same behavior as mtdsplit_uimage

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
2a8a333ee9 kernel: mtk_bmt: add debugfs file to attempt repair of remapped sectors
This can be used for sectors that are not physically damaged

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
06382d1af7 kernel: add support for mediatek NMBM flash mapping support
This NAND flash remapping method is used on newer MediaTek devices with NAND
flash.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
55e8d52157 ramips: skip bbt scan on mt7621
reduces unnecessary flash reads and speeds up boot time

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
4947623d6c ramips: enable support for mtk_bmt in the nand flash driver
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
73b2a4ca03 ramips: mt7621_nand: initialize ECC_FDMADDR
This is needed for the ECC controller to access FDM data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Stijn Tintel
89c1959251 ramips: mt7621_nand: reduce log verbosity
Avoid flooding the log with the message below by increasing the log
level to debug:

  mt7621-nand 1e003000.nand: Using programmed access timing: 31c07388

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-03-25 21:11:09 +01:00
Stijn Tintel
2f2e81a4ea ramips: move mt7621_nand driver to files
The patch was rejected by upstream. The mtk_nand driver should be
modified to support the mt7621 flash controller instead. As there is no
newer version to backport, or no upstream version to fix bugs, let's
move the driver to the files dir under the ramips target. This makes it
easier to make changes to the driver while waiting for mt7621 support to
land in mtk_nand.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-03-25 21:11:09 +01:00
Felix Fietkau
be1f2b4d9d kernel: mtk_bmt: on error, do not attempt to remap out-of-range blocks
Pass errors to caller instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
7d1e2be160 kernel: mtk_bmt: fix block copying on remap with bmt v2
Copy from the previously mapped block (in case it was remapped already)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
b4c7f8c5f7 kernel: mtk_bmt: allow get_mapping_block to return an error
Used by the mapping implementation to indicate that no backing block is
available

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
601c7b4adb kernel: split up mtk_bmt driver code
Keep a separate source file per variant

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
张 鹏
bdc786e82c ipq40xx: update E2600AC c1/c2 board
Modified the radio frequency hardware part of e2600ac c1/c2,
need to cooperate with the modified board.bin file, the device
can work normally.

Signed-off-by: 张 鹏 <sd20@qxwlan.com>
2022-03-25 18:14:13 +01:00
Aleksander Jan Bajkowski
b4970dab6b lantiq: xrx200: replace patch with upstream version
This commit replaces patch number 0703 with the upstream accepted
version. This patch requires backporting an additional patch to
avoid conflicts.

The only significant change is the lower maximum MTU. Packets with
lengths over 2400 may be dropped.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-03-25 18:14:13 +01:00
Aleksander Jan Bajkowski
210c534ce2 kernel: move rtl8152 patches to generic
This commit moves the patches for the r8152.c driver to the generic
directory. Previously they were only available on the bcm27xx target.
With these patches the Realtek RTL8153C, RTL8153D, RTL8156A and RTL8156B
chips are supported on all targets by the kmod-usb-net-rtl8152 module.
The RTL8156A and RTL8156B are the 2.5Gb/s Ethernet adapters.

The patches have been tested on TP-Link UE300 (RTL8153A) and UNITEK
1313B (RTL8156B).

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-03-25 18:14:13 +01:00
Pascal Coudurier
dd45cc2123 kernel: backport two intel igc patches from 5.15
to allow proper initialization of device

- igc: Remove _I_PHY_ID checking
- igc: Remove phy->type checking

Signed-off-by: Pascal Coudurier <coudu@wanadoo.fr>
(refreshed)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-25 18:14:13 +01:00
Chris Blake
3f874519b4 gpio-cdev: re-add nu801 userspace driver
This reverts commit 80b7a8a7f5.

Now that 5.10 is the default kernel for all platforms, we can
bring back the NU801 userspace driver for platforms that rely
on it. Currently it's used on the MX100 x86_64 target, but
other Meraki platforms use this controller.

Note that we also now change how we load nu801. The way we did
this previously with procd worked, but it meant it didn't load
until everything was up and working.

To fix this, let's call nu801 from boot and re-trigger the
preinit blink sequence. Since nu801 runs as a daemon this is
now something we can do.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
(removed empty line, currently only MX100 uses it so: @TARGET_x86)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-25 18:14:13 +01:00
Andre Heider
cb6f4be137 ipq40xx: add support for FRITZ!Box 7520
This model, also know as "1&1 HomeServer", shares the same features as 7530.

The vendor firmware has artificial software limitations: only 2 of the 4
LAN-Ports are GBit, and the USB-Host is only v2.0.

With OpenWrt, USB is already working at v3.0.

Signed-off-by: Andre Heider <a.heider@gmail.com>
(updated commit message to reflect current state)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-25 18:14:13 +01:00
Brian Norris
f1c041e34f ipq40xx: Add subtarget for Google WiFi (Gale)
Google WiFi (codename: Gale) is an IPQ4019-based AP, with 2 Ethernet
ports, 2x2 2.4+5GHz WiFi, 512 MB RAM, 4 GB eMMC, and a USB type C port.
In its stock configuration, it runs a Chromium OS-based system, but you
wouldn't know it, since you can only manage it via a "cloud" +
mobile-app system.

The "v2" label is coded into the bootloader, which prefers the
"google,gale-v2" compatible string. I believe "v1" must have been
pre-release hardware.

Note: this is *not* the Google Nest WiFi, released in 2019.

I include "factory.bin" support, where we generate a GPT-based disk
image with 2 partitions -- a kernel partition (using the custom "Chrome
OS kernel" GUID type) and a root filesystem partition. See below for
flashing instructions.

Sysupgrade is supported via recent emmc_do_upgrade() helper.

This is a subtarget because it enables different features
(FEATURES=boot-part rootfs-part) whose configurations don't make sense
in the "generic" target, and because it builds in a few USB drivers,
which are necessary for installation (installation is performed by
booting from USB storage, and so these drivers cannot be built as
modules, since we need to load modules from USB storage).

Flashing instructions
=====================

Documented here:
https://openwrt.org/inbox/toh/google/google_wifi

Note this requires booting from USB storage.

Features
========

I've tested:

 * Ethernet, both WAN and LAN ports
 * eMMC
 * USB-C (hub, power-delivery, peripherals)
 * LED0 (R/G/B)
 * WiFi (limited testing)
 * SPI flash
 * Serial console: once in developer mode, console can be accessed via
   the USB-C port with SuzyQable, or other similar "Closed Case
   Debugging" tools:
     https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/master/docs/ccd.md#suzyq-suzyqable
 * Sysupgrade

Not tested:

 * TPM

Known not working:

 * Reboot: this requires some additional TrustZone / SCM
   configuration to disable Qualcomm's SDI. I have a proposal upstream,
   and based on IRC chats, this might be acceptable with additional DT
   logic:
     [RFC PATCH] firmware: qcom_scm: disable SDI at boot
     https://lore.kernel.org/linux-arm-msm/20200721080054.2803881-1-computersforpeace@gmail.com/
 * SMP: enabling secondary CPUs doesn't currently work using the stock
   bootloader, as the qcom_scm driver assumes newer features than this
   TrustZone firmware has. I posted notes here:
     [RFC] qcom_scm: IPQ4019 firmware does not support atomic API?
     https://lore.kernel.org/linux-arm-msm/20200913201608.GA3162100@bDebian/
 * There's a single external button, and a few useful internal GPIO
   switches. I haven't hooked them up.

The first two are fixed with subsequent commits.

Additional notes
================

Much of the DTS is pulled from the Chrome OS kernel 3.18 branch, which
the manufacturer image uses.

Note: the manufacturer bootloader knows how to patch in calibration data
via the wifi{0,1} aliases in the DTB, so while these properties aren't
present in the DTS, they are available at runtime:

  # ls -l
/sys/firmware/devicetree/base/soc/wifi@a*/qcom,ath10k-pre-calibration-data
  -r--r--r--    1 root     root         12064 Jul 15 19:11 /sys/firmware/devicetree/base/soc/wifi@a000000/qcom,ath10k-pre-calibration-data
  -r--r--r--    1 root     root         12064 Jul 15 19:11 /sys/firmware/devicetree/base/soc/wifi@a800000/qcom,ath10k-pre-calibration-data

Ethernet MAC addresses are similarly patched in via the ethernet{0,1} aliases.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(updated 901 - x1pro moved in the process)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-25 18:14:13 +01:00
Brian Norris
26af098e0e ipq40xx: qcom_scm: Fix cold boot address command
See my upstream questions:
https://lore.kernel.org/linux-arm-msm/20200913201608.GA3162100@bDebian/

This effectively reverts upstream Linux commit 13e77747800e ("firmware:
qcom: scm: Use atomic SCM for cold boot"), because Google WiFi boot
firmwares don't support the atomic variant.

This fixes SMP support for Google WiFi.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2022-03-25 18:14:13 +01:00
Brian Norris
a93ec36630 ipq40xx: qcom_scm: Disable SDI at boot
See my upstream RFC of this:
https://lore.kernel.org/linux-arm-msm/20200721080054.2803881-1-computersforpeace@gmail.com/

This fixes warm boot (reboot) for Google WiFi devices using their
factory bootloader/firmware.

I may resend this upstream eventually.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2022-03-25 18:14:13 +01:00
Brian Norris
17b05045bd ipq40xx: Support Chromium OS image-type creation
See firmware-utils.git commits [1], which implemented the cros-vbutil
verified-boot payload-packing tool, and extended ptgen for the CrOS
kernel partition type. With these, it's now possible to package kernel +
rootfs to make disk images that can boot a Chrome OS-based system (e.g.,
Chromebooks, or even a few AP models).

Regarding PARTUUID= changes: Chromium bootloaders work well with a
partition number offset (i.e., relative to the kernel partition), so
we'll be using a slightly different root UUID line.

NB: I've made this support specific to ip40xx for now, because I only
plan to support an IPQ4019-based AP that uses a Chromium-based
bootloader, but this image format can be used for essentially any
Chromebook, as well as the Google OnHub, a prior Chromium-based AP using
an IPQ8064 chipset.

[1]
ptgen: add Chromium OS kernel partition support
https://git.openwrt.org/?p=project/firmware-utils.git;a=commit;h=6c95945b5de973026dc6f52eb088d0943efa96bb

cros-vbutil: add Chrome OS vboot kernel-signing utility
https://git.openwrt.org/?p=project/firmware-utils.git;a=commit;h=8e7274e02fdc6f2cb61b415d6e5b2e1c7e977aa1

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2022-03-25 18:14:13 +01:00
Christian Lamparter
e95dec8116 apm821xx: fix crash/panic related to SATA/SSD choice
Ticerex on the OpenWrt Forum reported a gnarly crash when
he was using Samsung 840 and 850 EVOs with his MyBook Live:

| BUG: Kernel NULL pointer dereference at 0x00000000
| Faulting instruction address: 0xc03ed4b8
| Oops: Kernel access of bad area, sig: 11 [#1]
| BE PAGE_SIZE=4K PowerPC 44x Platform
| CPU: 0 PID: 362 Comm: scsi_eh_1 Not tainted 5.4.163 #0
| NIP:  c03ed4b8 LR: c03d27e8 CTR: c03ed36c
| REGS: cfa59950 TRAP: 0300   Not tainted  (5.4.163)
| MSR:  00021000 <CE,ME>  CR: 42000222  XER: 00000000
| DEAR: 00000000 ESR: 00000000
| GPR00: c03d27e8 cfa59a08 cfa55fe0 00000000 0fa46bc0 [...]
| [..]
| NIP [c03ed4b8] sata_dwc_qc_issue+0x14c/0x254
| LR [c03d27e8] ata_qc_issue+0x1c8/0x2dc
| Call Trace:
| [cfa59a08] [c003f4e0] __cancel_work_timer+0x124/0x194 (unreliable)
| [cfa59a78] [c03d27e8] ata_qc_issue+0x1c8/0x2dc
| [cfa59a98] [c03d2b3c] ata_exec_internal_sg+0x240/0x524
| [cfa59b08] [c03d2e98] ata_exec_internal+0x78/0xe0
| [cfa59b58] [c03d30fc] ata_read_log_page.part.38+0x1dc/0x204
| [cfa59bc8] [c03d324c] ata_identify_page_supported+0x68/0x130
| [...]

This turned out this is an issue with upstream changing
ATA_TAG_INTERNAL's value from 31 to 32 during 4.18 release.
Update "SATA_DWC_QCMD_MAX" to account for that.

Link: https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-25 18:14:13 +01:00
Christian Lamparter
4ce52de450 ipq40xx: disable non-building tel(co Electronics) x1pro
Tel(co Electronics) X1 Pro is preventing ipq40xx generic
from building due to the KERNEL_SIZE.

Whenever bigger kernels are possible, if lzma is supported
is unknown.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-25 18:14:13 +01:00
Matthias Schiffer
8ba71f1f6f
ath79: fix TPLINK_HWREV field for TL-WR1043ND v4
Required to allow sysupgrades from OpenWrt 19.07.

Closes #7071

Fixes: 98fbf2edc0 ("ath79: move TPLINK_HWID/_HWREV to parent for tplink-safeloader")
Tested-by: J. Burfeind <git@aiyionpri.me>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2022-03-25 18:13:11 +01:00
Petr Štetiar
621f39d1f4 imagebuilder: fix broken image generation with external targets
When using external targets there is a symlink being created for the
target under target/linux which then becomes dangling under Image
Builder. Fix it by dereferencing the possible symlink.

Tested on IB with external target, ipq40xx and mvebu.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-25 14:28:00 +01:00
Stijn Tintel
e1de25b68a qoriq: remove CONFIG_GDB_SCRIPTS from kernel config
It is disabled in the generic kernel config and not used in any of the
other targets. There was no specific reason for enabling it, so let's be
consistent and remove it from the qoriq kernel config.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-03-25 12:53:19 +02:00
David Bauer
9024f1e466 mpc85xx: overhaul WS-AP3825i LED setup
As the LED controller is working now, we can make good use of the LEDs
now.

 - Drop the model-name prefix
 - Rename eth0 / eth1 LEDs to LAN1 / LAN2, as they are labeled as such
   on the casing
 - Enable wired LEDs in userspace

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-03-24 23:26:10 +01:00
David Bauer
f0c09d0305 mpc85xx: move Extreme WS-AP3825i GPIO extender
Move the GPIO extender to the SoC node. Otherwise, the legacy PowerPC
init code will not populate the BUS and thus never probe spi-gpio.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-03-24 23:25:42 +01:00
Matthias Schiffer
dc23df8a8c
ath79: change Ubiquiti UniFi AP model name to include "AP"
While it hasn't always been clear whether the "AP" is part of the model
name on the Ubiquiti website, we include it for all other pre-AC
variants (AP Pro and the AP Outdoor+). Add it to the original UniFi AP
as well for consistency.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2022-03-24 09:30:35 +01:00
Matthias Schiffer
2a02b70499
ath79: fix label MAC address for Ubiquiti UniFi
The label has the MAC address of eth0, not the WLAN PHY address.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2022-03-24 09:22:06 +01:00
Daniel Golle
d3a4607fc6 kernel: generic: fix warning in FIT partition parser
Use 'const char *' where necessary to make gcc get quiet.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-24 03:27:12 +00:00
Daniel Golle
ab143647ef kernel: generic: improve FIT partition parser
* only map filesystems configured in 'loadables'
 * allow mapping more than one filesystem (e.g. customization/branding
   or localization in addition to rootfs)
 * small cleaning here and there

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-24 00:46:45 +00:00
Daniel Golle
503f3b9f0e
kernel: generic: use chosen bootconf in FIT partition parser
If the selected boot configuration is stored by U-Boot in '/chosen'
node as 'bootconf' attribute, use that configuration to resolve the
block device used as rootfs. Fall back to use the default configuration
in case 'bootconf' is not present.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-21 23:48:09 +00:00
Petr Štetiar
ffa1088f63 sunxi: cortexa7: fix ethernet link detection on a20-olinuxino-lime2
a20-olinuxino-lime2 is currently having hard time with link detection of
certain 1000Mbit partners due to usage of generic PHY driver, probably
due to following missing workaround introduced in upstream in commit
3aed3e2a143c ("net: phy: micrel: add Asym Pause workaround"):

 The Micrel KSZ9031 PHY may fail to establish a link when the Asymmetric
 Pause capability is set. This issue is described in a Silicon Errata
 (DS80000691D or DS80000692D), which advises to always disable the
 capability. This patch implements the workaround by defining a KSZ9031
 specific get_feature callback to force the Asymmetric Pause capability
 bit to be cleared.

 This fixes issues where the link would not come up at boot time, or when
 the Asym Pause bit was set later on.

As a20-olinuxino-lime2 has Micrel KSZ9031RNXCC-TR Gigabit PHY since
revision H, so we need to use Micrel PHY driver on those devices.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-21 23:05:27 +01:00
Felix Fietkau
fdbb468c59 ramips/mediatek: enable threaded NAPI in the ethernet driver
Improves performance, especially under load

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-21 21:07:14 +01:00
Marek Behún
f811c33b19 kernel: Fix patch header
Remove "a" character from the first line of patch
  738-v5.14-01-net-dsa-qca8k-fix-an-endian-bug-in-qca8k-get-ethtool.patch

Otherwise `git am` fails to apply this patch which is annoying when
trying to do some development / rebasing.

Signed-off-by: Marek Behún <kabel@kernel.org>
2022-03-21 16:56:37 +00:00
Robert Marko
a8b2d35903 mvebu: udpu: include LM75 kmod by default
uDPU has 2 LM75 compatible temperature sensors, so include the driver for
them by default in order to utilize them.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-03-21 14:00:34 +01:00
Robert Marko
80f21e5336 mvebu: udpu: fix initramfs booting
uDPU provides a FIT based initramfs, but currently gets stuck after U-boot
starts the kernel at "Starting kernel..".

It is due to the load address being too low, so increase it in order to get
the initramfs booting again.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2022-03-21 14:00:34 +01:00
Daniel Golle
3a14580411 kernel: delete Linux 5.4 config and patches
As the upcoming release will be based on Linux 5.10 only, remove all
kernel configuration as well as patches for Linux 5.4.
There were no targets still actively using Linux 5.4.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-21 11:36:30 +00:00
Richard Huynh
9f9477b275 mediatek: Add support for Xiaomi Redmi Router AX6S
Also known as the "Xiaomi Router AX3200" in western markets,
but only the AX6S is widely installation-capable at this time.

SoC: MediaTek MT7622B
RAM: DDR3 256 MiB (ESMT M15T2G16128A)
Flash: SPI-NAND 128 MiB (ESMT F50L1G41LB or Gigadevice GD5F1GQ5xExxG)
WLAN: 2.4/5 GHz 4T4R
2.4 GHz: MediaTek MT7622B
5 GHz: MediaTek MT7915E
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531B
LEDs/Keys: 2/2 (Internet + System LED, Mesh button + Reset pin)
UART: Marked J1 on board VCC RX GND TX, beginning from "1". 3.3v, 115200n8
Power: 12 VDC, 1.5 A

Notes:
U-Boot passes through the ethaddr from uboot-env partition,
but also has been known to reset it to a generic mac address
hardcoded in the bootloader.

However, bdata is also populated with the ethernet mac addresses,
but is also typically never written to. Thus this is used instead.

Installation:
1. Flash stock Xiaomi "closed beta" image labelled
'miwifi_rb03_firmware_stable_1.2.7_closedbeta.bin'.
(MD5: 5eedf1632ac97bb5a6bb072c08603ed7)

2. Calculate telnet password from serial number and login

3. Execute commands to prepare device
nvram set ssh_en=1
nvram set uart_en=1
nvram set boot_wait=on
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit

4. Download and flash image
On computer:
python -m http.server
On router:
cd /tmp
wget http://<IP>:8000/factory.bin
mtd -r write factory.bin firmware

Device should reboot at this point.

Reverting to stock:
Stock Xiaomi recovery tftp that accepts their signed images,
with default ips of 192.168.31.1 + 192.168.31.100.
Stock image should be renamed to tftp server ip in hex (Eg. C0A81F64.img)
Triggered by holding reset pin on powerup.

A simple implementation of this would be via dnsmasq's
dhcp-boot option or using the vendor's (Windows only)
recovery tool available on their website.

Signed-off-by: Richard Huynh <voxlympha@gmail.com>
2022-03-20 18:33:39 +00:00
Richard Huynh
4177de10df mediatek: Add GD5F1GQ5xExxG to mtk-snand
Some units of the Xiaomi Redmi Router AX6S/Xiaomi Router AX3200 contain this part.

Signed-off-by: Richard Huynh <voxlympha@gmail.com>
2022-03-20 18:33:39 +00:00
Nicholas Smith
7ea2f3d6e2 ipq40xx: add support for Telco X1 Pro
Telco X1 Pro is a Cat12 LTE-A Pro modem router.
Vendor firmware is based on a recent version of OpenWrt.
Flashing is possible via CLI using sysupgrade -F -n
The serial headers allow bootloader and console access
Serial setting: 115200  8N1

Brief Specifications:
IPQ4019 SoC
32MB flash
512MB RAM
4x gigabit LAN
1x gigabit WAN
Dual-band Wave-2 wifi
2x SMA LTE antenna connectors
2x RP-SMA wifi antennas
1x USB 2.0 port
1x Reset button
Serial headers installed
1x Nano SIM tray
1x Quectel EM-12G LTE-A Pro modem
1x M.2 slot attached to USB 3.0
1x internal micro SD card slot

Signed-off-by: Nicholas Smith <nicholas@nbembedded.com>
2022-03-19 20:05:00 +01:00
Igor Nazarov
42626aef67 ramips: add support for D-Link DIR-878 R1
Specifications:
- SoC: MediaTek MT7621AT
- RAM: 128 MB (DDR3)
- Flash: 16 MB (SPI NOR)
- WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz)
- Switch: 1 WAN, 4 LAN (Gigabit)
- Buttons: Reset, WiFi Toggle, WPS
- LEDs: Power, Internet, WiFi 2.4G WiFi 5G

The R1 revision is identical to the A1 revision except
- No Config2 Parition, therefore
- factory partition resized to 64k from 128K
- Firmware partition offset is 0x50000 not 0x60000
- Firmware partitions size increased by 64K
- Firmware partition type is "denx,uimage", not "sge,uimage"
- Padding of image creation "uimage-padhdr 96" removed

Installation:
Update to the last D-Link firmware through web-ui before OpenWRT
installation then follow the instructions to patch your device using
D-Link FailsafeUI.

- D-Link FailsafeUI:
Power down the router, press and hold the reset button, then
re-plug it. Keep the reset button pressed until the internet LED stops
flashing, then jack into any lan port and manually assign a static IP
address in 192.168.0.0/24 other than 192.168.0.1 (e.g. 192.168.0.2)
and go to http://192.168.0.1
Flash with the factory image.

Signed-off-by: Igor Nazarov <tigron.dev@gmail.com>
2022-03-19 19:51:20 +01:00
John Audia
1eb5d50fd3 kernel: bump 5.10 to 5.10.107
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2022-03-19 17:42:41 +01:00
Mikhail Zhilkin
f8b02130d2 ramips: add support for Beeline SmartBox Flash
Beeline SmartBox Flash is a wireless AC1300 (WiFi 5) router manufactured
by Arcadyan company.

Device specification
--------------------
SoC Type: MediaTek MT7621AT
RAM: 256 MiB, Winbond W632GU6NB
Flash: 128 MiB (NAND), Winbond W29N01HVSINF
Wireless 2.4 GHz (MT7615DN): b/g/n, 2x2
Wireless 5 GHz (MT7615DN): a/n/ac, 2x2
Ethernet: 3xGbE (WAN, LAN1, LAN2)
USB ports: 1xUSB3.0
Button: 1 (Reset/WPS)
LEDs: 1 RGB LED
Power: 12 VDC, 1.5 A
Connector type: Barrel
Bootloader: U-Boot (Ralink UBoot Version: 5.0.0.2)
OEM: Arcadyan WE42022

Installation
------------
1. Place *factory.trx on any web server (192.168.1.2 in this example)
2. Connect to the router using telnet shell (no password required)
3. Save MAC adresses to U-Boot environment:
   uboot_env --set --name eth2macaddr --value $(ifconfig | grep eth2 | \
    awk '{print $5}')
   uboot_env --set --name eth3macaddr --value $(ifconfig | grep eth3 | \
    awk '{print $5}')
   uboot_env --set --name ra0macaddr --value $(ifconfig | grep ra0 | \
    awk '{print $5}')
   uboot_env --set --name rax0macaddr --value $(ifconfig | grep rax0 | \
    awk '{print $5}')
4. Ensure that MACs were saved correctly:
   uboot_env --get --name eth2macaddr
   uboot_env --get --name eth3macaddr
   uboot_env --get --name ra0macaddr
   uboot_env --get --name rax0macaddr
5. Download and write the OpenWrt images:
   cd /tmp
   wget http://192.168.1.2/factory.trx
   mtd_write erase /dev/mtd4
   mtd_write write factory.trx /dev/mtd4
6. Set 1st boot partition and reboot:
   uboot_env --set --name bootpartition --value 0
   reboot

Back to Stock
-------------
1. Run in the OpenWrt shell:
   fw_setenv bootpartition 1
   reboot
2. Optional step. Upgrade the stock firmware with any version to
   overwrite the OpenWrt in Slot 1.

MAC addresses
-------------
+-----------+-------------------+----------------+
| Interface | MAC               | Source         |
+-----------+-------------------+----------------+
| label     | 30:xx:xx:51:xx:09 | No MACs was    |
| LAN       | 30:xx:xx:51:xx:09 | found on Flash |
| WAN       | 30:xx:xx:51:xx:06 | [1]            |
| WLAN_2g   | 30:xx:xx:51:xx:07 |                |
| WLAN_5g   | 32:xx:xx:41:xx:07 |                |
+-----------+-------------------+----------------+
[1]:
a. Label wasb't found neither in factory nor in other places.
b. MAC addresses are stored in encrypted partition "glbcfg". Encryption
   key hasn't known yet. To ensure the correct MACs in OpenWrt, a hack
   with saving of the MACs to u-boot-env during the installation was
   applied.
c. Default Ralink ethernet MAC address (00:0C:43:28:80:36) was found in
   "Factory" 0xfff0. It's the same for all Smartbox Flash devices. OEM
   firmware also uses this MAC when initialazes ethernet driver. In
   OpenWrt we use it only as internal GMAC (eth0), all other MACs are
   unique. Therefore, there is no any barriers to the operation of several
   Smartbox Flash devices even within the same broadcast domain.

Stock firmware image format
---------------------------
+--------------+---------------+----------------------------------------+
| Offset       | 1.0.15        | Description                            |
+==============+===============+========================================+
| 0x0          | 5d 43 6f 74   | TRX magic "]Cot"                       |
+--------------+---------------+----------------------------------------+
| 0x4          | 00 70 ff 00   | Length (reverse)                       |
+--------------+---------------+----------------------------------------+
|              |               | htonl(~crc) from 0xc ("flag_version")  |
| 0x8          | 72 b3 93 16   | to "Length"                            |
+--------------+---------------+----------------------------------------+
| 0xc          | 00 00 01 00   | Flags                                  |
+--------------+---------------+----------------------------------------+
|              |               | Offset (reverse) of Kernel partition   |
| 0x10         | 1c 00 00 00   | from the start of the header           |
+--------------+---------------+----------------------------------------+
|              |               | Offset (reverse) of RootFS partition   |
| 0x14         | 00 00 42 00   | from the start of the header           |
+--------------+---------------+----------------------------------------+
| 0x18         | 00 00 00 00   | Zeroes                                 |
+--------------+---------------+----------------------------------------+
| 0x1c         | 27 05 19 56 … | Kernel data + zero padding             |
+--------------+---------------+----------------------------------------+
|              |               | RootFS data (starting with "hsqs") +   |
| 0x420000     | 68 73 71 73 … | zero padding to "Length"               |
+--------------+---------------+----------------------------------------+
|              |               | Some signature data (format is         |
|              |               | unknown). Necessary for the fw         |
| "Lenght"     | 00 00 00 00 … | update via oem fw web interface.       |
+--------------+---------------+----------------------------------------+
| "Lenght" +   |               | TRX magic "HDR0". U-Boot is            |
| 0x10c        | 48 44 52 30   | checking it at every boot.             |
+--------------+---------------+----------------------------------------+
|              |               | 1.00:                                  |
|              |               |   Zero padding to ("Lenght" + 0x23000) |
|              |               | 1.0.12:                                |
|              |               |   Zero padding to ("Lenght" + 0x2a000) |
| "Lenght" +   |               | 1.0.13, 1.0.15, 1.0.16:                |
| 0x110        | 00 00 00 00   |   Zero padding to ("Lenght" + 0x10000) |
+--------------+---------------+----------------------------------------+

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2022-03-19 16:14:01 +01:00
John Audia
b04d38a2ea kernel: bump 5.10 to 5.10.106
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2022-03-19 16:13:58 +01:00
John Audia
048f0b1702 kernel: bump 5.10 to 5.10.105
Updated default config with new sym (CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y).

Manually rebased:
    generic/hack-5.10/220-arm-gc_sections.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2022-03-19 16:13:58 +01:00
Josef Schlehofer
31ccc27f41 bcm27xx: bcm2711: add kmod-usb-net-lan78xx
Some vendors like Seeedstudio in their product [1] with Raspberry Pi
Compute Module 4 uses Microchip LAN7800 (USB 3.0 to Gigabit
Ethernet Bridge) - USB 3.0 extended from PCIe of CM4.

lsusb output:
```
Bus 002 Device 002: ID 0424:7800 Microchip LAN7800
```

Raspberry Pi 4 and even Compute Module 4 has many resources available
and for just one kernel module it is not necessary to add additional specific CM4 profiles.
Let's include it by default, so the both Ethernet ports will be usable
to have better user-experience. Because previous generation of Raspberry
Pi included LAN7800 Gigabit Ethernet by default and it is enabled there
[2] in kernel without additional kernel module, which was added recently [3].

After this commit in dmesg can be found this:

```
root@OpenWrt:~# dmesg | grep lan
[    7.038889] lan78xx 2-3:1.0 (unnamed net_device) (uninitialized): int urb period 64
[    7.090484] usbcore: registered new interface driver lan78xx
```

Tested and works with sysupgrade image.

[1] https://www.seeedstudio.com/Dual-GbE-Carrier-Board-with-4GB-RAM-32GB-eMMC-RPi-CM4-Case-p-5029.html
[2] 32c74552b2/target/linux/bcm27xx/bcm2709/config-5.4 (L437)
[3] 31647d8be8

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-03-19 16:13:58 +01:00
Stijn Tintel
4ecf8346c0 kernel: enable SERIAL_8250_16550A_VARIANTS
Kernel 5.6 introduced a new config symbol SERIAL_8250_16550A_VARIANTS.
In kernel 5.8, this symbol was changed to default to on on !x86, as some
embedded devices still use 16650A variants. Let's play safe here and
enable this symbol in the generic config, to avoid others from running
into this problem and having to spend several hours trying to bisect
this problem. While we could disable the symbol in the x86 target
configs, a 20ms boot time reduction really isn't worth the time wasted
on bisecting this issue.

Matt discovered this problem while working on adding support for the
WatchGuard Firebox M200 to the qoriq target, where it caused some
characters to be missing on the console output.

Reported-by: Matt Fawcett <mattytap@icloud.com>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Reviewed-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-03-18 14:44:39 +02:00
Pascal Coudurier
0905b07139 ath79: improve support for GL.iNet GL-XE300
- fix eth0 eth1 sharing same mac so it conforms to the behavior stated
  in the original commit and the way it is in vendor firmware :
  WAN is label, LAN is label +1 and WLAN is label +2
- add default leds config
- add default network config

Signed-off-by: Pascal Coudurier <coudu@wanadoo.fr>
2022-03-17 21:55:10 +01:00
Petr Štetiar
83ca16fc43 mpc85xx: fix missing kernel config symbol and DTS whitespace issue
Buildbot has reported following issue while crunching mpc85xx/p1010
subtarget:

 Extreme Networks WS-AP3825i (WS_AP3825I) [N/y/?] (NEW)

Fix it by disabling that config symbol in target kernel config and while
at it fix DTS whitespace issue.

Fixes: 7e614820a8 ("mpc85xx: add support for Extreme Networks WS-AP3825i")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-03-17 08:05:03 +01:00
Jan Hoffmann
a622273876 lantiq: fritz7362sl: add partition subnode for SPI flash
Without a partition subnode ofpart_core still parses direct subnodes as
partitions, but it ignores nodes with a compatible property. Due to
this, the switch to nvmem-cells made the urlader partition inaccessible.
As a result, the wireless network was broken, as the calibration data
is read from that partition by a script.

Fixes: #8983
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2022-03-16 20:48:01 +01:00
Martin Blumenstingl
dadedd5580 lantiq: fritz7362sl: fix SPI flash node reg property
The &spi node has #address-cells = <1> and #size-cells = <0>. Drop the
extra 0 in the reg property from the SPI flash node to ensure it's
number of cells matches the definition in the parent node. This also
makes the reg property for the SPI flash node consistent with all other
VR9 boards.

Fixes: eae6cac6a3 ("lantiq: add support for AVM FRITZ!Box 7362 SL")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
2022-03-16 20:48:01 +01:00
Christian Lamparter
621b0589fb ipq806x: fix TP-Link Archer VR2600v bootlooping
Timo Schroeder reported:
"The TP-Link Archer VR2600v is stuck in a boot loop on written
snapshot image. It's able to boot using the snapshot uimage
though, but there ath10k firmware can't be found.
21.02.2 release version doesn't have either problem."

The VR2600v has a 512 byte header at the beginning of the
firmware that needs to be accounted for.

Fixes: f6a01d7f5c ("ipq806x: convert TP-Link Archer VR2600v to denx,uimage")
Reported-by: Timo Schroeder <der.timosch@gmail.com>
References: <https://github.com/openwrt/openwrt/issues/9467>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-03-16 20:48:01 +01:00
Martin Kennedy
7e614820a8 mpc85xx: add support for Extreme Networks WS-AP3825i
Hardware:

- SoC:     Freescale P1020
  - CPU:     2x e500v2 @ 800MHz
- Flash:   64MiB NOR (1x Intel JS28F512)
- Memory:  256MiB (2x ProMOS DDR3 V73CAG01168RBJ-I9H 1Gb)
- WiFi1:   2.4+5GHz abgn 3x3 (Atheros AR9590)
- Wifi2:   5GHz an+ac 3x3 (Qualcomm Atheros QCA9890)
- ETH:     2x PoE Gigabit Ethernet (2x Atheros AR8035)
- Power:   12V (center-positive barrel) or 48V PoE (active or passive)
- Serial:  Cisco-compatible RJ45 next to 12V power socket (115200 baud)
- LED Driver: TI LV164A
  - LEDs: (not functioning)
    - 2x Power (Green + Orange)
    - 4x ETH (ETH1 + ETH2) x (Green + Orange)
    - 2x WiFi (WiFi2 + WiFi1)

Installation:

1. Grab the OpenWrt initramfs <openwrt-initramfs-bin>, e.g.
   openwrt-mpc85xx-p1020-extreme-networks_ws-ap3825i-initramfs-kernel.bin.
   Place it in the root directory of a DHCP+TFTP server, e.g. OpenWrt
   `dnsmasq` with configuration `dhcp.server.enable_tftp='1'`.

2. Connect to the serial port and boot the AP with options
   e.g. 115200,N,8. Stop autoboot in U-Boot by pressing Enter after
   'Scanning JFFS2 FS:' begins, then waiting for the prompt to be
   interrupted. Credentials are identical to the one in the APs
   interface. By default it is admin / new2day: if these do not work,
   follow the OEM's reset procedure using the reset button.

3. Set the bootcmd so the AP can boot OpenWrt by executing:

```uboot
setenv boot_openwrt "cp.b 0xEC000000 0x2000000 0x2000000; interrupts off; bootm start 0x2000000; bootm loados; fdt resize; fdt boardsetup; fdt chosen; bootm prep; bootm go;"
setenv bootcmd "run boot_openwrt"
saveenv
```

   If you plan on going back to the vendor firmware - the bootcmd for it
   is stored in the boot_flash variable.

4. Load the initramfs image to RAM and boot by executing

```uboot
setenv ipaddr <ipv4 client address>;
setenv serverip <tftp server address>;
tftpboot 0x2000000 <openwrt-initramfs-bin>;
interrupts off;
bootm start 0x2000000;
bootm loados;
fdt resize;
fdt boardsetup;
fdt chosen;
bootm prep;
bootm go;
```

5. Make a backup of the "firmware" partition if you ever wish to go back
   to the vendor firmware.

6. Upload the OpenWrt sysupgrade image via SCP to the devices /tmp
   folder.

7. Flash OpenWrt using sysupgrade.

```ash
sysupgrade /tmp/<openwrt-sysupgrade-bin>
```

Notes:

- We must step through the `bootm` process manually to avoid fdt
  relocation. To explain: the stock U-boot (and stock Linux) are configured
  with a very large CONFIG_SYS_BOOTMAPSZ (and the device's stock Linux
  kernel is configured to be able to handle it). The U-boot version
  predates the check for the `fdt_high` variable, meaning that upon fdt
  relocation, the fdt can (and will) be moved to a very high address; the
  default appears to be 0x9ffa000. This address is so high that when the
  Linux kernel starts reading the fdt at the beginning of the boot process,
  it encounters a memory access exception and panics[5]. While it is
  possible to reduce the highest address the fdt will be relocated to by
  setting `bootm_size`, this also has the side effect of limiting the
  amount of RAM the kernel can use[3].

- Because it is not relocated, the flattened device tree needs to be
  padded in the build process to guarantee that `fdt resize` has
  enough space.

- The primary ethernet MAC address is stored (and set) in U-boot; they are
  shimmed into the device tree by 'fdt boardsetup' through the
  'local-mac-address' property of the respective ethernet node, so OpenWrt
  does not need to set this at runtime. Note that U-boot indexes the
  ethernet nodes by alias, which is why the device tree explicitly aliases
  ethernet1 to enet2.

- LEDs do not function under OpenWrt. Each of 8 LEDs is connected to an
  output of a TI LV164A shift register, which is wired to GPIO lines and
  operates through bit-banged SPI. Unfortunately, I am unable to get the
  spi-gpio driver to recognize the `led_spi` device tree node at all, as
  confirmed by patching in printk messages demonstrating
  spi-gpio.c::spi_gpio_probe never runs. It is possible to manually
  articulate the shift register by exporting the GPIO lines and stepping
  their values through the sysfs.

- Though they do not function under OpenWrt, I have left the pinout details
  of the LEDs and shift register in the device tree to represent real
  hardware.

- An archive of the u-boot and Linux source for the AP3825i (which is one
  device of a range of devices code-named 'CHANTRY') be found here[1].

- The device has an identical case to both the Enterasys WS-AP3725i and
  Adtran BSAP-2030[2] (and potentially other Adtran BSAPs). Given that
  there is no FCC ID for the board itself (only its WLAN modules), it's
  likely these are generic boards, and even that the WS-AP3725i is
  identical, with only a change in WLAN card. I have ordered one to confirm
  this.

- For additional information: the process of porting the board is
  documented in an OpenWrt forum thread[4].

[1]: magnet:?xt=urn:btih:f5306a5dfd06d42319e4554565429f84dde96bbc
[2]: https://forum.openwrt.org/t/support-for-adtran-bluesocket-bsap-2030/48538
[3]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168/29
[4]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168
[5]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168/26

Tested-by: Martin Kennedy <hurricos@gmail.com>
Signed-off-by: Martin Kennedy <hurricos@gmail.com>
2022-03-16 18:53:44 +01:00
Rodolphe de Saint Léger
46c5de5385 ramips: add support for Netgear WN3100RPv2
This patch adds support for the Netgear WN3100RPv2
http://www.netgear.com/support/product/wn3100rpv2.aspx

Specifications:
- SoC: MediaTek MT7620A (580MHz, ramips)
- RAM: 32MB DDR
- Storage: 8MB NOR SPI flash
- Wireless: builtin MT7620A, 2x2:2 with u.FL connectors
- Ethernet: 1x100M
- Stock firmware based on OpenWRT Kamikaze

Like the EX2700, the bootloader expects a secondary image signature,
see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577

This device seems to be same hardware as a WN3000RPv3

Flash instructions:
- Use the Netgear WebUI to upgrade to OpenWRT using the factory image
  (see note below),
- Use the sysupgrade image for upgrading versions from OpenWRT,
- TFTP recovery procedure can be used to flash the factory image
  (preferred method).

Note:
- The WebUI may not reboot automatically, wait at least 5 minutes before
  powercycling the device

Flashing using TFTP:
- Set you IP address to 192.168.1.10/24 (no gateway)
- Connect your machine to the Ethernet port
- Power off the device and wait for 10 seconds,
- Hold the reset button and power on the device (do not release reset),
- Hold the reset button until the green light is flashing (Approx. 15s)
- launch tftp, set mode to binary and connect to 192.168.1.1
- put the factory firmware image
- All leds will switch off (like a power off), this is normal
- Wait for the device to reboot in the new OpenWRT image (max 5 mins)
- The first boot will take longer than usual.
- After boot, the Device IP on the ethernet port is 192.168.1.1

Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com>
[drop unneeded includes in dts, wrap commit message]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-16 23:14:25 +09:00
Sungbo Eo
fe34001ee5 Revert "ramips: add support for Netgear WN3000RPv3"
This reverts commit 7bc20cb614.

It adds support for Netgear WN3100RPv2, but the commit title is wrong.
It will be re-added with the correct title.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-16 23:10:45 +09:00
Rodolphe de Saint Léger
7bc20cb614 ramips: add support for Netgear WN3000RPv3
This patch adds support for the Netgear WN3100RPv2
http://www.netgear.com/support/product/wn3100rpv2.aspx

Specifications:
- SoC: MediaTek MT7620A (580MHz, ramips)
- RAM: 32MB DDR
- Storage: 8MB NOR SPI flash
- Wireless: builtin MT7620A, 2x2:2 with u.FL connectors
- Ethernet: 1x100M
- Stock firmware based on OpenWRT Kamikaze

Like the EX2700, the bootloader expects a secondary image signature,
see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577

This device seems to be same hardware as a WN3000RPv3

Flash instructions:
- Use the Netgear WebUI to upgrade to OpenWRT using the factory image
  (see note below),
- Use the sysupgrade image for upgrading versions from OpenWRT,
- TFTP recovery procedure can be used to flash the factory image
  (preferred method).

Note:
- The WebUI may not reboot automatically, wait at least 5 minutes before
  powercycling the device

Flashing using TFTP:
- Set you IP address to 192.168.1.10/24 (no gateway)
- Connect your machine to the Ethernet port
- Power off the device and wait for 10 seconds,
- Hold the reset button and power on the device (do not release reset),
- Hold the reset button until the green light is flashing (Approx. 15s)
- launch tftp, set mode to binary and connect to 192.168.1.1
- put the factory firmware image
- All leds will switch off (like a power off), this is normal
- Wait for the device to reboot in the new OpenWRT image (max 5 mins)
- The first boot will take longer than usual.
- After boot, the Device IP on the ethernet port is 192.168.1.1

Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com>
[drop unneeded includes in dts, wrap commit message]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-16 22:36:04 +09:00
Pawel Dembicki
be89c9eec4 ramips: mt7620: Add support for D-Link DWR-961 A1
The DWR-961 A1 Wireless Router is based on the MT7620A SoC.
It's a merge of two Amit boards: DWR-960 with ethernet part
of Lava LR-25G001.

ROMID it's taken from Telenor branded version and it works with tested
device. Images from D-Link site for this router are from DWR-953 and it
have ROMID DLK6E2424001. I don't know if it's mistake on web-site
or if it's will require different image.

Specification:

- MediaTek MT7620A (580 Mhz)
- 128 MB of RAM
- 16 MB of FLASH
- 1x 802.11bgn radio
- 1x 802.11ac radio (MT7612 mpcie card)
- 5x 10/100/1000 Mbps Ethernet: 4xLAN and 1xWAN (QCA8337)
- 2x internal, non-detachable antennas (Wifi 2.4G)
- 3x external, detachable antennas (2x LTE, 1x Wifi 5G)
- 1x LTE modem cat 6
- UART (J5) header on PCB (57600 8n1)
- 13x LED, 2x button
- JBOOT bootloader

Installation:
Apply factory image via http web-gui or JBOOT recovery page

How to revert to OEM firmware:
- push the reset button and turn on the power. Wait until LED start
  blinking (~10sec.)
- upload original factory image via JBOOT http (IP: 192.168.123.254)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2022-03-16 22:31:14 +09:00
Stijn Tintel
832b90216f qoriq: enable I2C in target kernel config
The I2C controller used in QorIQ PPC devices requires the mpc-i2c
driver, which is enabled by the I2C_MPC kernel config symbol. Enable
this and its dependencies in the target kernel config, as is done for
the mpc85xx target.

This fixes missing hwmon, rtc and tpm devices on the M300.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-03-16 01:48:24 +02:00
Rafał Miłecki
2de86691b6 bcm4908: include U-Boot DTB files for ASUS GT-AX6000 & Netgear RAX220
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-15 18:43:42 +01:00
Philip Prindeville
23f94aa330 kernel: include CONFIG_KEXEC_SIG in configs
Seeing failure to build because of missing symbols related to provisioning
CONFIG_KEXEC and signed images.  Without this, if you set
CONFIG_KERNEL_KEXEC=y and try to build, target/linux will hang at:

scripts/kconfig/conf  --syncconfig Kconfig
...
kexec system call (KEXEC) [Y/n/?] y
kexec file based system call (KEXEC_FILE) [Y/n/?] y
Verify kernel signature during kexec_file_load() syscall (KEXEC_SIG) [N/y/?] (NEW)

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2022-03-15 08:33:45 +01:00
Marek Behún
fbe2c3feaa kernel: backport DSA patches fixing null-pointer dereference for 5.10
Backport patches
  381a730182f1 ("net: dsa: Move VLAN filtering syncing out of dsa_switch_bridge_leave")
  108dc8741c20 ("net: dsa: Avoid cross-chip syncing of VLAN filtering")
from upstream (currently in net-next) to fix null-pointer dereference.

Signed-off-by: Marek Behún <kabel@kernel.org>
2022-03-15 08:33:45 +01:00
Michael Pratt
41be1a2de2 ath79: add support for Araknis AN-700-AP-I-AC
FCC ID: 2AG6R-AN700APIAC

Araknis AN-700-AP-I-AC is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EAP1750
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - QCA9558 SOC		MIPS 74kc, 2.4 GHz WMAC, 3x3
  - QCA9880 WLAN	PCI card, 5 GHz, 3x3, 26dBm
  - AR8035-A PHY	RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 2x 64 MB RAM	NT5TU32M16
  - UART console	J10, populated, RX shorted to ground
  - 4 antennas		5 dBi, internal omni-directional plates
  - 4 LEDs		power, 2G, 5G, wps
  - 1 button		reset

  NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide
	therefore, the power LED is off for default state

**MAC addresses:**

  MAC address labeled as ETH
  Only one Vendor MAC address in flash at art 0x0

  eth0 ETH  *:xb art 0x0
  phy1 2.4G *:xc ---
  phy0 5GHz *:xd ---

**Serial Access:**

  the RX line on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin at J10

**Installation:**

  Method 1: Firmware upgrade page:

    (if you cannot access the APs webpage)
    factory reset with the reset button
    connect ethernet to a computer
    OEM webpage at 192.168.20.253
    username and password 'araknis'
    make a new password, login again...

    Navigate to 'File Management' page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm
    wait about 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fd70000`
    wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    Select the factory.bin image and upload
    wait about 3 minutes

**Return to OEM:**

  Method 1: Serial to load Failsafe webpage (above)

  Method 2: delete a checksum from uboot-env
  this will make uboot load the failsafe image at next boot
  because it will fail the checksum verification of the image

    ssh into openwrt and run
    `fw_setenv rootfs_checksum 0`
    reboot, wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    select OEM firmware image and click upgrade

  Method 3: backup mtd partitions before upgrade

**TFTP recovery:**

  Requires serial console, reset button does nothing

  rename initramfs-kernel.bin to '0101A8C0.img'
  make available on TFTP server at 192.168.1.101
  power board, interrupt boot with serial console
  execute `tftpboot` and `bootm 0x81000000`

  NOTE: TFTP may not be reliable due to bugged bootloader
	set MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software is built using SDKs from Senao
  which is based on a heavily modified version
  of Openwrt Kamikaze or Altitude Adjustment.
  One of the many modifications is sysupgrade being performed by a custom script.
  Images are verified through successful unpackaging, correct filenames
  and size requirements for both kernel and rootfs files, and that they
  start with the correct magic numbers (first 2 bytes) for the respective headers.

  Newer Senao software requires more checks but their script
  includes a way to skip them.

  The OEM upgrade script is at
  /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be less than 1536k
  and the OEM upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  The clock delay required for RGMII can be applied at the PHY side,
  using the at803x driver `phy-mode` setting through the DTS.
  Therefore, the Ethernet Configuration registers for GMAC0
  do not need the bits for RGMII delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-03-13 19:54:58 +01:00
Michael Pratt
56716b578e ath79: add support for Araknis AN-500-AP-I-AC
FCC ID: 2AG6R-AN500APIAC

Araknis AN-500-AP-I-AC is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EAP1200
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - QCA9557 SOC		MIPS 74kc, 2.4 GHz WMAC, 2x2
  - QCA9882 WLAN	PCI card 168c:003c, 5 GHz, 2x2, 26dBm
  - AR8035-A PHY	RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 2x 64 MB RAM	NT5TU32M16
  - UART console	J10, populated, RX shorted to ground
  - 4 antennas		5 dBi, internal omni-directional plates
  - 4 LEDs		power, 2G, 5G, wps
  - 1 button		reset

  NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide
	therefore, the power LED is off for default state

**MAC addresses:**

  MAC address labeled as ETH
  Only one Vendor MAC address in flash at art 0x0

  eth0 ETH  *:e1 art 0x0
  phy1 2.4G *:e2 ---
  phy0 5GHz *:e3 ---

**Serial Access:**

  the RX line on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin at J10

**Installation:**

  Method 1: Firmware upgrade page:

    (if you cannot access the APs webpage)
    factory reset with the reset button
    connect ethernet to a computer
    OEM webpage at 192.168.20.253
    username and password 'araknis'
    make a new password, login again...

    Navigate to 'File Management' page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm
    wait about 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fd70000`
    wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    Select the factory.bin image and upload
    wait about 3 minutes

**Return to OEM:**

  Method 1: Serial to load Failsafe webpage (above)

  Method 2: delete a checksum from uboot-env
  this will make uboot load the failsafe image at next boot
  because it will fail the checksum verification of the image

    ssh into openwrt and run
    `fw_setenv rootfs_checksum 0`
    reboot, wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    select OEM firmware image and click upgrade

  Method 3: backup mtd partitions before upgrade

**TFTP recovery:**

  Requires serial console, reset button does nothing

  rename initramfs-kernel.bin to '0101A8C0.img'
  make available on TFTP server at 192.168.1.101
  power board, interrupt boot with serial console
  execute `tftpboot` and `bootm 0x81000000`

  NOTE: TFTP may not be reliable due to bugged bootloader
	set MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software is built using SDKs from Senao
  which is based on a heavily modified version
  of Openwrt Kamikaze or Altitude Adjustment.
  One of the many modifications is sysupgrade being performed by a custom script.
  Images are verified through successful unpackaging, correct filenames
  and size requirements for both kernel and rootfs files, and that they
  start with the correct magic numbers (first 2 bytes) for the respective headers.

  Newer Senao software requires more checks but their script
  includes a way to skip them.

  The OEM upgrade script is at
  /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be less than 1536k
  and the OEM upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  The clock delay required for RGMII can be applied at the PHY side,
  using the at803x driver `phy-mode` setting through the DTS.
  Therefore, the Ethernet Configuration registers for GMAC0
  do not need the bits for RGMII delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-03-13 19:54:57 +01:00
Michael Pratt
561f46bd02 ath79: add support for Araknis AN-300-AP-I-N
FCC ID: U2M-AN300APIN

Araknis AN-300-AP-I-N is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EWS310AP
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - AR9344 SOC		MIPS 74kc, 2.4 GHz WMAC, 2x2
  - AR9382 WLAN		PCI on-board 168c:0030, 5 GHz, 2x2
  - AR8035-A PHY	RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 2x 64 MB RAM	1839ZFG V59C1512164QFJ25
  - UART console	J10, populated, RX shorted to ground
  - 4 antennas		5 dBi, internal omni-directional plates
  - 4 LEDs		power, 2G, 5G, wps
  - 1 button		reset

  NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide
	therefore, the power LED is off for default state

**MAC addresses:**

  MAC address labeled as ETH
  Only one Vendor MAC address in flash at art 0x0

  eth0 ETH  *:7d art 0x0
  phy1 2.4G *:7e ---
  phy0 5GHz *:7f ---

**Serial Access:**

  the RX line on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin at J10

**Installation:**

  Method 1: Firmware upgrade page:

    (if you cannot access the APs webpage)
    factory reset with the reset button
    connect ethernet to a computer
    OEM webpage at 192.168.20.253
    username and password 'araknis'
    make a new password, login again...

    Navigate to 'File Management' page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm
    wait about 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fd70000`
    wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    Select the factory.bin image and upload
    wait about 3 minutes

**Return to OEM:**

  Method 1: Serial to load Failsafe webpage (above)

  Method 2: delete a checksum from uboot-env
  this will make uboot load the failsafe image at next boot
  because it will fail the checksum verification of the image

    ssh into openwrt and run
    `fw_setenv rootfs_checksum 0`
    reboot, wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    select OEM firmware image and click upgrade

  Method 3: backup mtd partitions before upgrade

**TFTP recovery:**

  Requires serial console, reset button does nothing

  rename initramfs-kernel.bin to '0101A8C0.img'
  make available on TFTP server at 192.168.1.101
  power board, interrupt boot with serial console
  execute `tftpboot` and `bootm 0x81000000`

  NOTE: TFTP may not be reliable due to bugged bootloader
	set MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software is built using SDKs from Senao
  which is based on a heavily modified version
  of Openwrt Kamikaze or Altitude Adjustment.
  One of the many modifications is sysupgrade being performed by a custom script.
  Images are verified through successful unpackaging, correct filenames
  and size requirements for both kernel and rootfs files, and that they
  start with the correct magic numbers (first 2 bytes) for the respective headers.

  Newer Senao software requires more checks but their script
  includes a way to skip them.

  The OEM upgrade script is at
  /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be less than 1536k
  and the OEM upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  The clock delay required for RGMII can be applied at the PHY side,
  using the at803x driver `phy-mode` setting through the DTS.
  Therefore, the Ethernet Configuration registers for GMAC0
  do not need the bits for RGMII delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-03-13 19:54:57 +01:00
Michael Pratt
07723492e9 ath79: improve factory.bin for some Senao devices
Some boards with firmware made with Senao SDK based on Linux 3.3
have the following lines in the OEM upgrade script at
/etc/fwupgrade.sh

	local append=""
	local CONF_TAR="/tmp/sysupgrade.tgz"
	[ -f "$CONF_TAR" ] && append="-j $CONF_TAR"

and

	\# check FWINFO filename
	[ -z $(ls FWINFO* | grep -i ${modelname}) ] && errcode="1"

This addition also prevents needing to factory reset after flashing
for some boards that also have these lines in the script

	\# Support downgrade but do default (Smart v2.x.x.x -> senaowrt v1.x.x.x)
	[ $(ls FWINFO* | grep -i ${modelname} | cut -d "-" -f4 | cut -c 2) -lt 2 ] && append=""

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2022-03-13 19:54:57 +01:00
INAGAKI Hiroshi
e83ab243be realtek: add support for Panasonic Switch-M8eG PN28080K
Panasonic Switch-M8eG PN28080K is a 8 + 1 port gigabit switch, based on
RTL8380M.

Specification:

- SoC		: Realtek RTL8380M
- RAM		: DDR3 128 MiB (Winbond W631GG8KB-15)
- Flash		: SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G)
- Ethernet	: 10/100/1000 Mbps x8 + 1
  - port 1-8	: TP, RTL8218B (SoC)
  - port 9	: SFP, RTL8380M (SoC)
- LEDs/Keys	: 7x / 1x
- UART		: RS-232 port on the front panel (connector: RJ-45)
  - 3:TX, 4:GND, 5:GND, 6:RX (pin number: RJ-45)
  - 9600n8
- Power		: 100-240 VAC, 50/60 Hz, 0.5 A
  - Plug	: IEC 60320-C13
- Stock OS	: VxWorks based

Flash instruction using initramfs image:

1.  Prepare the TFTP server with the IP address 192.168.1.111
2.  Rename the OpenWrt initramfs image to "0101A8C0.img" and place it to
    the TFTP directory
3.  Download the official upgrading firmware (ex: pn28080k_v30000.rom)
    and place it to the TFTP directory
4.  Boot M8eG and interrupt the U-Boot with Ctrl + C keys
5.  Execute the following commands and boot with the OpenWrt initramfs
    image

    rtk network on
    tftpboot 0x81000000
    bootm

6.  Backup mtdblock files to the computer by scp or anything and reboot
7.  Interrupt the U-Boot and execute the following commands to re-create
    filesystem in the flash

    ffsmount c:/
    ffsfmt c:/

    this step takes a long time, about ~ 4 mins

8.  Execute the following commands to put the official images to the
    filesystem

    updatert <official image>

    example:

      updatert pn28080k_v30000.rom

    this step takes about ~ 40 secs

9.  Set the environment variables of the U-Boot by the following commands

    setenv loadaddr 0xb4e00000
    setenv bootcmd bootm
    saveenv

10: Download the OpenWrt initramfs image and boot with it

    tftpboot 0x81000000 0101A8C0.img
    bootm

11: On the initramfs image, download the sysupgrade image and perform
    sysupgrade with it

    sysupgrade <imagename>

12: Wait ~ 120 seconds to complete flashing

Note:

- "Switch-M8eG" is a model name, and "PN28080K" is a model number.
  Switch-M8eG has an another (old) model number ("PN28080"), it's not a
  Realtek based hardware.

- Switch-M8eG has a "POWER" LED (Green), but it's not connected to any
  GPIO pin.

- The U-Boot checks the runtime images in the flash when booting and
  fails to execute anything in "bootcmd" variable if the images are not
  exsisting.

- A filesystem is formed in the flash (0x100000-0x1DFFFFF) on the stock
  firmware and it includes the stock images, configuration files and
  checksum files. It's unknown format, can't be managed on the OpenWrt.
  To get the enough space for OpenWrt, move the filesystem to the head
  of "fs_reserved" partition by execution of "ffsfmt" and "updatert".

- On the other devices in the same series of Switch-M8eG PN28080K, the
  INT pin on the PCA9555 is not connected to anywhere.

Back to the stock firmware:

1. Delete "loadaddr" variable and set "bootcmd" to the original value

   on U-Boot:

     setenv loadaddr
     setenv bootcmd 'bootm 0x81000000'

   on OpenWrt:

     fw_setenv loadaddr
     fw_setenv bootcmd 'bootm 0x81000000'

2. Perform reset or reboot

  on U-Boot:

    reset

  on OpenWrt:

    reboot

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
2022-03-13 19:54:57 +01:00
INAGAKI Hiroshi
da1347d6d6 realtek: enable pca953x driver for rtl838x subtarget
The system status LED on Panasonic Switch-M8eG PN28080K is connected to
a PCA9539PW. To use the LED as a status LED of OpenWrt while booting,
enable the pca953x driver and built-in to the kernel.
Also enable CONFIG_GPIO_PCA953X_IRQ to use interrupt via RTL83xx GPIO.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Acked-by: Sander Vanheule <sander@svanheule.net>
2022-03-13 19:54:57 +01:00
Martin Kennedy
d1a8690742 realtek: add ZyXEL GS1900-24 v1 support
The ZyXEL GS1900-24 v1 is a 24 port switch with two SFP ports, similar to
the other GS1900 switches.

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

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

Serial connection parameters: 115200 8N1.

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

OEM upgrade method:

* Log in to OEM management web interface

* Navigate to Maintenance > Firmware > Management

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

* Navigate to Maintenance > Firmware > Upload

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

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

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

U-Boot TFTP method:

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

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

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

  > rtk network on

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

  > setsys bootpartition 0
  > savesys

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

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

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

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

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
2022-03-13 19:24:13 +01:00
John Audia
3f5b2d25ee kernel: bump 5.10 to 5.10.104
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2022-03-13 19:24:13 +01:00
Joe Mullally
8d25551243 ramips: Apply pinctrl DTS changes to TL-WPA8631P
Applies changes from 7774b86019 to new device committed later. Fix some
whitespace in the DTS. Use standard model name format in DTS.

Fixes: 6c743c3006 ("ramips: Add support for TP-Link TL-WPA8631P v3")
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Reported-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2022-03-13 12:39:58 +09:00
Sven Schwermer
591a2b9525 ath79: Add LED labels for Airtight C-75
Keep labels since OpenWrt userland tooling (get_dt_led) depends on them
to find the LED instances referenced by the led-* aliases.

The label for the amber power LED was removed in 4eefdc7adb.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2022-03-13 12:39:58 +09:00
Chukun Pan
7fa227ead5 ramips: update WLAN MAC address of JCG Y2
MAC addresses on OEM firmware:
  04:xx:xx:xx:xx:c8  factory 0x4     wlan2g
  06:xx:xx:xx:xx:c8  [not on flash]  wlan5g

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2022-03-13 12:39:58 +09:00
Chukun Pan
285e636b16 ramips: update WLAN MAC address of Phicomm K2P
The wireless mac address difference of this machine is similar
to that of D-Link DIR-853-R1, so use the same practice.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2022-03-13 12:39:58 +09:00
Dawsen Gao
b3da44b647 ramips: Add support for Dual-Q H721
Dual-Q H721 is a router platform board, it is the smaller model of
the U7621-06.

The device has the following specifications:

MT7621AT (880 MHz)
256 of RAM (DDR3)
16 MB of FLASH (MX25l12805d SPI)
5x 1 Gbps Ethernet (MT7621 built-in switch)
1x M.2 (NGFF) 3.7V 3A max for 5G M.2 Modem work at USB3.0 mode
1x Minipcie 3.7V 3A max for LTE Modem work at USB2.0 Mode
2x Minipcie for WIFI card
4x Lan+1x Wan 10/100M/1000M RJ45 port
14x LEDs (1x GPIO-controlled)
1x reset button
1x UART header (4-pins)
1x mico SD-card reader
1x DC jack for main power (5~27 V)

The following has been tested and is working:

Ethernet switch
miniPCIe slots (tested with Wi-Fi cards and LTE modem cards)
miniSIM slot (works with normal size simcard)
sysupgrade
reset button
micro SD-card reader

Installation:

This board has no locked down bootloader. The seller can be asked to
install openwrt, so upgrades are standard sysupgrade method.

Recovery:

This board contains a Chinese, closed-source bootloader called Breed
(Boot and Recovery Environment for Embedded Devices). Breed supports web
recovery and to enter it, you keep the reset button pressed for around
5 seconds during boot. Your machine will be assigned an IP through DHCP
and the router will use IP address 192.168.1.1. The recovery website is
in Chinese, but is easy to use. Click on the second item in the list to
access the recovery page, then the second item on the next page is where
you select the firmware. In order to start the recovery, you click the
button at the bottom.

Signed-off-by: Dawsen Gao <dawsen_gao@163.com>
[change author name (used SoB one), add ethernet pinctrl,
 apply sorting to device recipe]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-13 12:37:25 +09:00
Rafał Miłecki
34fd5e325a bcm4908: include U-Boot in images
This is a step forward in adding support for devices with U-Boot.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-11 08:02:30 +01:00
Piotr Dymacz
25d1c85d1a imx: fix USB support
The ChipIdea USB kernel driver gained support for disabling glue drivers
in 5.8, see upstream commmit: 95caa2ae70fd ("usb: chipidea: allow
disabling glue drivers if EMBEDDED").

This enables 'CONFIG_USB_CHIPIDEA_IMX' in the 'imx' target kernel config
which brings back USB support.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-03-11 00:04:05 +01:00
Matthias Schiffer
c8350dfb3c
x86: legacy: enable pata_sis driver
This driver is needed to boot from CompactFlash on the Siemens Futro S400.
The device has an AMD NX1500 CPU, which seems to be unsupported by the
geode subtarget, so it must use legacy.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2022-03-10 23:31:05 +01:00
Daniel Golle
802df09873
kernel: wwan: add MeigLink SLM750 modem support
Add patch found in Teltonika RUT9_R_00.07.01.4 GPL SDK download[1]
adding USB IDs of the MeigLink SLM750 to the relevant kernel drivers.
Newer versions of Teltonika's 2G/3G/4G RUT9XX WWAN router series come
with this kind of modem.

[1]: https://wiki.teltonika-networks.com/view/GPL
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-10 17:59:07 +00:00
Dmitry Chigiryov
9d06f1a618 ramips: allow USB power control on TP-Link MR3020v3
By switching EPHY_LED4_N_JTRST_N from EPHY_LED4_N to GPIO#39
we can control USB port power an all current revisions of MR3020v3.
It was not a thing on some first revisions, pin was unused.
But for now on all current MR3020v3 boards EPHY_LED4_N_JTRST_N pin
is connected to USB power key.
Also it was not used as EPHY indicator on any revision of the board.

Signed-off-by: Dmitry Chigiryov <dmitry.chigiryov@ya.ru>
[changed author address (used SoB one)]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-09 15:44:51 +09:00
Sungbo Eo
94d4269ec7 ramips: fix DEVICE_VENDOR for unbranded devices
In commit ee66fe4ea9 ("ramips: convert DEVICE_TITLE to new variables"),
DEVICE_VENDOR of some unbranded devices were set incorrectly:
* WR512-3GN is not a dev board from Ralink.
* "XDX-RN502J" is the whole model name and should be not split.

This patch sets their DEVICE_VENDOR to "Unbranded", and changes their DTS
model properties accordingly.

Ref: d0bf15f235 ("ramips: add support for A5-V11 board (resubmit)")
Ref: 9085b05d9e ("ramips: rt305x: support for wr512-3gn-like routers")
Ref: 0e486d2fd2 ("ramips: add support for unbranded XDX-RN502J board")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-09 15:38:36 +09:00
Kim Namu
2876f7534f ramips: mt7621: add support for Zbtlink ZBT-WG1608
Zbtlink ZBT-WG1608 is a Wi-Fi router intendent to use with WWAN (4G/5G)
modems.

Specifications:
* SoC: MediaTek MT7621A
* RAM: 256/512 MiB
* Flash: 16/32 MiB (SPI NOR)
* Wi-Fi:
  * MediaTek MT7603E : 2.4Ghz
  * MediaTek MT7613BE : 5Ghz
* Ethernet: 10/100/1000 Mbps Ethernet x5 ports (4xLAN + WAN)
* M.2: 1x slot with USB&SIM
  * EM7455/EM12-G/EM160R/RM500Q-AE
* USB: 1x 3.0 Type-A port
* External storage: 1x microSD (SDXC) slot
* UART: console (115200 baud)
* LED:
  * 1 power indicator
  * 1 WLAN 2.4G controlled (wlan 2G)
  * 3 SoC controlled (wlan 5G, wwan, internet)
  * 5 per Eth phy (4xLAN + WAN)

MAC Addresses:
* LAN    : f8:5e:3c:xx:xx:e0 (Factory, 0xe000 (hex))
* WAN    : f8:5e:3c:xx:xx:e1 (Factory, 0xe006 (hex))
* 2.4 GHz: f8:5e:3c:xx:xx:de (Factory, 0x0004 (hex))
* 5 GHz  : f8:5e:3c:xx:xx:df (Factory, 0x8004 (hex))

Installation:
* Vendor's firmware is OpenWrt (LEDE) based, so the sysupgrade image can
  be directly used to install OpenWrt. Firmware must be upgraded using the
  'force' and 'do not save configuration' command line options (or
  correspondig web interface checkboxes) since the vendor firmware is from
  the pre-DSA era.

Recovery Mode:
 * Press reset button, power up the device, wait for about 10sec.
 * Upload sysupgrade image through the firmware recovery mode web page at
  192.168.1.1.

Signed-off-by: Kim Namu <namu@theseed.io>
2022-03-09 15:38:32 +09:00
Ray Wang
3c4810fecc ramips: add support for Asus RT-AC1200
Asus RT-AC1200 is a 2.4/5GHz dual band AC router,
based on MediaTek MT7628AN.

Specification:
* SoC: MT7628AN
* 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
* USB: 1x 2.0

Flash Layout:
 0x0000000-0x0030000 : "bootloader"
 0x0030000-0x0040000 : "nvram"
 0x0040000-0x0050000 : "factory"
 0x0050000-0x1000000 : "firmware"

MAC address:
 LAN: factory 0x28
 WAN: factory 0x22
 2.4G: factory 0x4
 5G: factory 0x8004

Installation via **recovery** mode:
1. Download the Asus recovery firmware (windows) tool from
   http://dlcdnet.asus.com/pub/ASUS/LiveUpdate/Release/Wireless/Rescue.zip
2. Set your ethernet IP manually 192.168.1.5 / 255.255.255.0 with NO
   gateway.
3. Plug in your ethernet to LAN port 1 on the router.
4. Load up the recovery software with the firmware file, but don't press
   "Upload" yet.
5. Plug in the router to power WHILE HOLDING the reset button in. While
   CONTINUING to hold the button, select "Upload" Continue to hold the
   reset button in until it finishes and verifies!
6. If that doesn't work try pressing "Upload" first just before you do
   step 5. At some point while holding reset the rescue tool will finally
   detect and upload the firmware. That's when you can let go of the
   reset button.
7. The router will reboot and not much will happen. Wait a minute or 2.
8. Power off and on the router again. Voila. Set everything your Ethernet
   IP back to DHCP (automatically) and you're good to go.

Revert to stock firmware:
1. Install stock image via recovery mode.

Tested-by: Ivan Pavlov <AuthorReflex@gmail.com>
Signed-off-by: Ray Wang <raywang777@foxmail.com>
2022-03-09 15:38:28 +09:00
Birger Koblitz
ed364cd4b0 ramips: add support for Renkforce WS-WN530HP3-A
This adds support for the Renkforce WS-WN530HP3-A ceiling-
mountable Wireless Access Point, which is powered over PoE.
Hardware:
	- SoC: Mediatek MT7621DAT
	- RAM: 128MiB on SoC
	- Flash: 16MiB GigaDevice GD25Q128C
	- 2.4Ghz Wifi: Mediatek MT603EN
	- 5GHz Wifi: MT613BEN
	- Ethernet:
	  - 1x 1GBit WAN port, passive PoE capable
	  - 2x 1GBit LAN ports
	LEDs: 1x Bi-Color LED (red/blue)
	Buttons: 1x Reset Button, 1x Power Button

Installation:
	Power on the access point and immedately press the reset
	button for 10 seconds. Connect web-browser to 192.168.10.1
	and upload sysupgrade image. Flash uploaded image and wait
	about 2 minutes for reboot.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [fixed SoB]
2022-03-08 18:34:32 +01:00
Jeffery To
62125c3ad5 ath79: fix button labels for WZR-HP-AG300H and WZR-600DHP
These were present in ar71xx but overlooked when porting to ath79.

Fixes: 480bf28273 ("ath79: add support for Buffalo WZR-HP-AG300H")

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2022-03-08 18:33:42 +01:00
Thibaut VARÈNE
eb38af7881 ath79: add support for MikroTik RouterBOARD mAP lite
The MikroTik RouterBOARD mAPL-2nd (sold as mAP Lite) is a small
2.4 GHz 802.11b/g/n PoE-capable AP.

See https://mikrotik.com/product/RBmAPL-2nD for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9533
 - RAM: 64 MB
 - Storage: 16 MB NOR
 - Wireless: Atheros AR9531 (SoC) 802.11b/g/n 2x2:2, 1.5 dBi antenna
 - Ethernet: Atheros AR8229 (SoC), 1x 10/100 port, 802.3af/at PoE in
 - 4 user-controllable LEDs:
   · 1x power (green)
   · 1x user (green)
   · 1x lan (green)
   · 1x wlan (green)

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. Follow common
 MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

Note: following 781d4bfb39
 The network setup avoids using the integrated switch and connects the
 single Ethernet port directly. This way, link speed (10/100 Mbps) is
 properly reported by eth0.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2022-03-08 18:33:42 +01:00
Hannu Nyman
549f8694c3 ipq806x: provide ramoops for R7800/XR500 by default
Add kmod-ramoops to the default set of device packages in
R7800 and XR500, so that the ramoops kernel crash logs
are provided by default for these routers.

The capability was earlier defined by 97158fe1 and cf346dfa,
but the feature was not yet turned on by default.

The possible kernel crashes are stored into /sys/fs/pstore/*

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-03-08 18:33:42 +01:00
Sven Schwermer
4eefdc7adb ath79: Add green power LED to Airtight C-75
In addition to the missing green LED definition, the polarity of the
amber power LED was incorrect which is fixed here.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2022-03-08 18:33:42 +01:00
Aleksander Jan Bajkowski
c46621b3f3 lantiq: xrx200: fix use after free bug
The skb->len field is read after the packet is sent to the network
stack. In the meantime, skb can be freed. This patch fixes this bug.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-03-08 18:33:42 +01:00
INAGAKI Hiroshi
7b19770525 realtek: add support for I-O DATA BSH-G24MB
I-O DATA BSH-G24MB is a 24 port gigabit switch, based on RTL8382M.

Specification:

- SoC		: Realtek RTL8382M
- RAM		: DDR2 128 MiB (Nanya NT5TU128M8HE-AC)
- Flash		: SPI-NOR 16 MiB (Macronix MX25L12835FM2I-10G)
- Ethernet	: 10/100/1000 Mbps x24
  - port 1-8	: RTL8218B
  - port 9-16	: RTL8218B (SoC)
  - port 17-24	: RTL8218B
- LEDs/Keys	: 2x, 1x
- UART		: pin header on PCB
  - JP2: 3.3V, TX, RX, GND from rear side
  - 115200n8
- Power		: 100 VAC, 50/60 Hz
  - Plug	: IEC 60320-C13

Flash instruction using sysupgrade image:

1. Boot BSH-G24MB normally
2. Connect BSH-G24MB to the DHCP enabled network
3. Find the device's IP address and open the WebUI and login
   Note: by default, the device obtains IP address from DHCP server of
         the network
4. Open firmware update page ("ファームウェア アップデート")
5. Rename the OpenWrt sysupgrade image to "bsh-g24mb_v100.image" and
   select it
6. Press apply ("適用") button to perform update
7. Wait ~150 seconds to complete flashing

Note:

- BSH-G24MB has a power-related LED ("電源"), but it's not connected to
  the GPIO of the SoC or RTL8231 and cannot be controlled. Instead of
  it, use system status LED on other than running-state.

- "sys_loop" LED indicates system status and loop-detection status in
  stock firmware.

- BSH-G24MB has 2x os-image partitions named as "RUNTIME"/"RUNTIME2" in
  16 MiB SPI-NOR flash and the size of image per partition is only
  6848 KiB. The secondary image is never used on stock firmware, so also
  use it on OpenWrt to get more space.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-07 21:44:53 +01:00
Rafał Miłecki
c45b5abf6f bcm4908: fix init on CFE devices
exit in preinit script was stopping whole process

Fixes: 93259e8ca2 ("bcm4908: support "rootfs_data" on U-Boot devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-07 11:14:29 +01:00
Bjørn Mork
0890fb2df4 realtek: net: dsa: configure better brport flags when ports leave the bridge
Ensures that the DSA driver sets exactly the same default flags as the
bridge when a port joins or leaves.  Without this we end up with a
confusing flag mismatch, where DSA and bridge ports use different sets
of flags.

This is critical as the "learning" mismatch will be harmful to the
network, causing all traffic to be flooded on all ports.

The original commit was buggy, trying to set the flags one-by-one in a
loop.  This was not supported by the API and the end result was that
all but the last flag were cleared.  This bug was implicitly fixed
upstream by commit e18f4c18ab5b ("net: switchdev: pass flags and mask
to both {PRE_,}BRIDGE_FLAGS attributes").

This is a minimum temporary stop measure fix for the critical lack of
"learning" only.  The major API change associated with a full v5.12+
backport is neither required nor wanted. A simpler fix, moving the
call to dsa_port_bridge_flags() out of the loop,  has therefore been
merged into this modified backport.

Fixes: afa3ab54c0 ("realtek: Backport bridge configuration for DSA")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Daniel Golle <daniel@makrotopia.org>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
[fix typos in commit message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-03-06 22:01:04 +02:00
INAGAKI Hiroshi
f7f9e6bd20 ramips: use parser_trx for Buffalo WCR-1166DS
Buffalo WCR-1166DS uses trx-fomatted firmware and the custom magic
number (0x5C436F74, "\Cot") is required for OpenWrt installation from
OEM WebUI.
But the current mtdsplit_trx doesn't support the custom magic number and
fail to parse and split to kernel and rootfs when the factory image is
flashed. Then, the kernel fails to mount rootfs automatically and panics.

Before the commit fddc78bc11, mtdsplit_trx
was patched in ramips target and the device-specific magic number was
supported only for WCR-1166DS[1].
But the patch was not inherited to the later version of the kernel and
deleted by the above commit, then, the custom magic number support was
broken.

[1]: 05d6e92594/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch (L27)

log (factory image):

[    1.165312] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    1.195782] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    1.205353] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.217938] Creating 7 MTD partitions on "spi0.0":
[    1.227436] 0x000000000000-0x000000030000 : "u-boot"
[    1.238427] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.250123] 0x000000040000-0x000000050000 : "factory"
[    1.261306] 0x000000050000-0x000000810000 : "firmware"
[    1.282051] 0x000000810000-0x000000fd0000 : "firmware2"
[    1.293594] 0x000000fd0000-0x000000fe0000 : "glbcfg"
[    1.304719] 0x000000fe0000-0x000000ff0000 : "board_data"
...
[    1.452424] /dev/root: Can't open blockdev
[    1.460619] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.475434] Please append a correct "root=" boot option; here are the available partitions:
[    1.491986] 1f00             192 mtdblock0
[    1.491989]  (driver?)
[    1.504938] 1f01              64 mtdblock1
[    1.504941]  (driver?)
[    1.517885] 1f02              64 mtdblock2
[    1.517888]  (driver?)
[    1.530831] 1f03            7936 mtdblock3
[    1.530834]  (driver?)
[    1.543777] 1f04            7936 mtdblock4
[    1.543781]  (driver?)
[    1.556724] 1f05              64 mtdblock5
[    1.556727]  (driver?)
[    1.569672] 1f06              64 mtdblock6
[    1.569675]  (driver?)
[    1.582617] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.598976] Rebooting in 1 seconds..

This patch fixes this issue by using parser_trx with specifying custom
magic number in dts instead of mtdsplit_trx.

log (fixed factory image):

[    1.202044] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    1.225369] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    1.235015] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.247603] Creating 7 MTD partitions on "spi0.0":
[    1.257106] 0x000000000000-0x000000030000 : "u-boot"
[    1.269447] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.281192] 0x000000040000-0x000000050000 : "factory"
[    1.294208] 0x000000050000-0x000000810000 : "firmware"
[    1.305774] 2 trx partitions found on MTD device firmware
[    1.316540] Creating 2 MTD partitions on "firmware":
[    1.326399] 0x00000000001c-0x000000214754 : "linux"
[    1.336063] mtd: partition "linux" doesn't start on an erase/write block boundary -- force read-only
[    1.357070] 0x000000214754-0x0000007c0000 : "rootfs"
[    1.366994] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    1.386368] mtd: device 5 (rootfs) set to be root filesystem
[    1.398700] 1 squashfs-split partitions found on MTD device rootfs
[    1.411027] 0x000000520000-0x0000007c0000 : "rootfs_data"
[    1.422841] 0x000000810000-0x000000fd0000 : "firmware2"
[    1.436282] 0x000000fd0000-0x000000fe0000 : "glbcfg"
[    1.447408] 0x000000fe0000-0x000000ff0000 : "board_data"
...
[    1.611216] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-06 20:40:35 +01:00
INAGAKI Hiroshi
5403defbec ramips: switch parser of trx for mt76x8 subtarget
This patch enable parser_trx and disable mtdsplit_trx for mt76x8
subtarget.
The trx format is used only on Buffalo WCR-1166DS in mt76x8 subtarget
and the parser need to be switched to parser_trx to use the custom magic
number in the header for WCR-1166DS.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-06 20:40:35 +01:00
INAGAKI Hiroshi
d339de2e21 kernel: backport patch to allow using parser_trx from ramips
This patch adds a patch to allow using parser_trx from ramips target,
mainly for Buffalo devices.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-06 20:40:35 +01:00
INAGAKI Hiroshi
cc49abc06b kernel: move parser_trx patches of custom magic to generic
This patch moves the patches of parser_trx in mediatek target to
generic/backport-5.10 to use the changes from ramips target and
backport the additional patch of the parser.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-06 20:40:07 +01:00
INAGAKI Hiroshi
770cfe9bff ramips: update MAC address configuration for Buffalo WCR-1166DS
This patch converts MAC address configuration of Buffalo WCR-1166DS in
02_network to use the generic function of OpenWrt. And also, add
label_mac.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-06 20:05:45 +01:00
INAGAKI Hiroshi
621d88d741 ramips: increase spi frequency for Buffalo WCR-1166DS
Use higher frequency than current and up the speed to access to the
flash on WCR-1166DS.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-06 20:05:45 +01:00
Joe Mullally
6c743c3006 ramips: Add support for TP-Link TL-WPA8631P v3
AV1300 Gigabit Passthrough Powerline ac Wi-Fi Extender

Specifications
--------------
* SoC: MediaTek MT7621AT
* CPU: 880 MHz MIPS 1004KEc dual-core CPU
* RAM: 64 MiB DDR2 (Zentel A3R12E40DBF-8E)
* Flash: 8 MiB SPI NOR (GigaDevice GD25Q64CSIG)
* Ethernet: SoC built-in Switch 5x 1GbE
  * Port 0: PLC (connected through AR8035-A)
  * Port 1-3: LAN
* WLAN: 2x2 2.4GHz 300 Mbps + 2x2 5GHz 867 Mbps (MT7603EN + MT7613BEN)
* PLC: HomePlug AV2 (Qualcomm QCA7500)
* PLC Flash: 2MiB SPI NOR (GigaDevice GD25Q16CSIG)
* Buttons: Reset, LED, Pair, Wi-Fi
* LEDs: Power (green), PLC (green/amber), LAN (green), 2.4G (green),
  5G (green)
* UART: J1 (57600 baud)
  * Pinout: (3V3) (GND) (RX) (TX)
  * Visually identify GND from connection to PCB ground plane

Installation
------------
Installation is possible from the OEM web interface. Make sure to install
the latest OEM firmware first, so that the PLC firmware is at the latest
version. However, please first check the OpenWRT Wiki page for
confirmation that your OEM firmware version is supported.

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
2022-03-06 18:57:33 +01:00
Langhua Ye
ce8a33b021 mediatek: add support for Ruijie RG-EW3200GX PRO
X32 Pro is another product  name for it in the Chinese market.

Specifications:
- SoC: MT7622B
- RAM: 256MB
- Flash: XMC XM25QH128C or Winbond WQ25Q128JVSQ 16MB SPI NOR
- Ethernet: 5x1GbE
- Switch: MT7531BE
- WiFi: 2.4G: MT7622 5G: MT7915AN+MT7975AN
- 3LEDs: System LED(blue) + Mesh LED(green) + Mesh LED(red)
- 2Keys: Mesh button + Reset button
- UART: Marked J19 on board. 3.3v, 115200n1
- Power: 12V 2.5A

MAC addresses as verified by OEM firmware:
use   address    source
WAN   *:F4       ethaddr@product_info
LAN   *:F5
5g    *:F6
2g    *:F7

Flash instruction:
1. Serve the initramfs.img using a TFTP server with address 10.10.10.3.
2. Interrupt the uboot startup process via UART.
3. Select "System Load Linux to SDRAM via TFTP" item.
4. (important) Back up firmware(mtd7) partitions with:
        dd if=/dev/mtd7 of=/tmp/firmware.bin
   and then download the firmware.bin image via SCP.
5. Flash the OpenWrt sysupgrade firmware.

Recovery stock firmware:
1. Transfer the firmware.bin image to the device.
2. Flash the image with:
        mtd write firmware.bin firmware

Signed-off-by: Langhua Ye <y1248289414@outlook.com>
2022-03-05 21:06:35 +01:00
Langhua Ye
df1383f796 kernel: add support for XMC XM25QH128C
The XMC XM25QH128C is a 16MB SPI NOR chip. The patch is verified on Ruijie RG-EW3200GX PRO.
Datasheet available at https://www.xmcwh.com/uploads/435/XM25QH128C.pdf

Signed-off-by: Langhua Ye <y1248289414@outlook.com>
2022-03-05 21:06:35 +01:00
Rui Salvaterra
05ed7dc50d kernel: bump 5.10 to 5.10.103
Patches automatically rebased.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-03-05 21:05:45 +01:00
Rafał Miłecki
93259e8ca2 bcm4908: support "rootfs_data" on U-Boot devices
1. Create "rootfs_data" dynamicaly

U-Boot firmware images can contain only 2 UBI volumes: bootfs (container
with U-Boot + kernel + DTBs) and rootfs (e.g. squashfs). There is no way
to include "rootfs_data" UBI volume or make firmware file tell U-Boot to
create one.

For that reason "rootfs_data" needs to be created dynamically. Use
preinit script to handle that. Fire it right before "mount_root" one.

2. Relate "rootfs_data" to flashed firmware

As already explained flashing new firmware with U-Boot will do nothing
to the "rootfs_data". It could result in new firmware reusing old
"rootfs_data" overlay UBI volume and its file. Users expect a clean
state after flashing firmware (even if flashing the same one).

Solve that by reading flash counter of running firmware and storing it
in "rootfs_data" UBI volume. Every mismatch will result in wiping old
data.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-03-04 16:14:59 +01:00
Rui Salvaterra
8235723c78 kernel: 5.10: remove CONFIG_DEVTMPFS{,_MOUNT} from kconfigs
They are required for container support, but are handled in Config-kernel.in.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-03-01 22:57:40 +00:00
Rui Salvaterra
72d2c54ccb kernel: 5.10: allocate last level PTEs in high memory
Enable support for allocating user space page table entries in high memory [1],
for the targets which support this feature. This saves precious low memory
(permanently mapped, the only type of memory directly accessible by the kernel).

[1] https://www.kernel.org/doc/html/latest/vm/highmem.html

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-03-01 22:57:34 +00:00
John Audia
0989b7ad3a kernel: bump 5.10 to 5.10.102
Removed upstreamed:
	bcm4908/patches-5.10/180-i2c-brcmstb-fix-support-for-DSL-and-CM-variants.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.102&id=f333c1916fd6b55900029bf8f918cc00009e2111

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2022-03-01 21:38:36 +01:00
John Audia
a2d4b5711a kernel: bump 5.10 to 5.10.101
Removed upstreamed:
  pending-5.10/841-USB-serial-option-add-ZTE-MF286D-modem.patch[1]
  bcm27xx/950-0592-drm-vc4-Allow-DBLCLK-modes-even-if-horz-timing-is-od.patch[2]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.101&id=7113440a36c741efd7c76e3d70b3634100120cdb
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.101&id=21c890ca8eaecea06cabb92be2a53a6f26f56383

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2022-03-01 21:38:36 +01:00
John Audia
d4c20ff948 bcm27xx: bcm2710: update defconfig
Ran `make kernel_menuconfig CONFIG_TARGET=bcm2710` having used the snapshot
config for bcm2710[1].  Manually added back two symbols that the make target
removed, namely:
* # CONFIG_SND_SOC_AD193X_I2C is not set
* # CONFIG_SND_SOC_AD193X_SPI is not set

1. https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/config.buildinfo

Signed-off-by: John Audia <graysky@archlinux.us>
2022-02-28 21:52:01 +01:00
John Audia
a68dd8057c bcm27xx: bcm2711: update defconfig
Ran `make kernel_menuconfig CONFIG_TARGET=bcm2711` having used the snapshot
config for bcm2711[1].  Manually added back two symbols that the make target
removed, namely:
* # CONFIG_SND_SOC_AD193X_I2C is not set
* # CONFIG_SND_SOC_AD193X_SPI is not set

Without adding these back, the build fails due to unsatisfied deps[2].

Build system: x86_64
Build-tested: bcm2711/multidevices

1. https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/config.buildinfo
2. a478202d74 (commitcomment-67096592)

Signed-off-by: John Audia <graysky@archlinux.us>
2022-02-28 21:52:01 +01:00
John Audia
4a956a06f2 kernel: move CONFIG_ASN1 to generic config
Rather than populating this symbol in the individual configs, move it to the
generic config.

Signed-off-by: John Audia <graysky@archlinux.us>
2022-02-28 21:52:01 +01:00
Petr Štetiar
fb2801b82c mt7620: fix missing kernel config symbol
Fixes following missing kernel config symbol after adding GPIO watchdog:

  Software watchdog (SOFT_WATCHDOG) [M/n/y/?] m
  Watchdog device controlled through GPIO-line (GPIO_WATCHDOG) [Y/n/m/?] y
    Register the watchdog as early as possible (GPIO_WATCHDOG_ARCH_INITCALL) [N/y/?] (NEW)

Fixes: 1a97c03d86 ("rampis: feed zbt-we1026 external watchdog")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-02-28 21:32:32 +01:00