Commit Graph

24507 Commits

Author SHA1 Message Date
Sungbo Eo
1322150b0c kirkwood: set testing kernel version to 5.10
Tested on Pogoplug V4.

Linksys EA3500 will not build with buildbot settings and should be
disabled when the target is switched, unless the image size is
reduced again.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[add EA3500 comment]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-24 02:53:53 +01:00
Sungbo Eo
1bb3f593ee kirkwood: update config for kernel 5.10
Update config with make kernel_oldconfig.

CONFIG_SATA_PMP=y is added manually as done for 5.4.
This should be resolved properly in a separate issue.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[add back CONFIG_SATA_PMP, rebase/refresh]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-24 02:53:53 +01:00
Sungbo Eo
58ebc50724 kirkwood: refresh patches for kernel 5.10
Refresh patches to make them apply to kernel 5.10.
The removed patch has been merged upstream.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-02-24 02:53:53 +01:00
Sungbo Eo
e464d365fe kirkwood: copy files to kernel 5.10
Copy config and patches to kernel 5.10.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-02-24 02:53:53 +01:00
Adrian Schmutzler
8d766aa669 kernel: add further missing symbols
CONFIG_NET_DSA_MV88E6XXX_PTP was simply missing in generic config.

CONFIG_I2C_PXA_SLAVE was previously enabled via i2c-pxa package,
but got removed there without moving the symbol to generic config.

Fixes: dd13add3ce ("kernel: i2c-pxa: remove slave")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-24 02:53:53 +01:00
Daniel Golle
330bd380e8 image: allow building FIT and uImage with ramdisk
Instead of embedding the initrd cpio archive into the kernel, allow
for having an external ramdisk added to the FIT or uImage.
This is useful to overcome kernel size limitations present in many
stock bootloaders, as the ramdisk is then loaded seperately and doesn't
add to the kernel size. Hence we can have larger ramdisks to host ie.
installers with all binaries to flash included (or a web-based
firmware selector).
In terms of performance and total size the differences are neglectible.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-02-24 01:35:20 +00:00
Daniel Golle
e6aac8d98f image: add support for building FIT image with filesystem
Allow for single (external-data) FIT image to hold kernel, dtb and
squashfs. In that way, the bootloader verifies the system integrity
including the rootfs, because what's the point of checking that the
hash of the kernel is correct if it won't boot in case of squashfs
being corrupted? Better allow bootloader to check everything needed
to make it at least up to failsafe mode. As a positive side effect
this change also makes the sysupgrade process on nand potentially
much easier as it is now.
In short: mkimage has a parameter '-E' which allows generating FIT
images with 'external' data rather than embedding the data into the
device-tree blob itself. In this way, the FIT structure itself remains
small and can be parsed easily (rather than having to page around
megabytes of image content). This patch makes use of that and adds
support for adding sub-images of type 'filesystem' which are used to
store the squashfs. Now U-Boot can verify the whole OS and the new
partition parsers added in the Linux kernel can detect the filesystem
sub-images, create partitions for them, and select the active rootfs
volume based on the configuration in FIT (passing configuration via
device tree could be implemented easily at a later stage).

This new FIT partition parser works for NOR flash (on top of mtdblock),
NAND flash (on top of ubiblock) as well as classic block devices
(ie. eMMC, SDcard, SATA, NVME, ...).
It could even be used to mount such FIT images via `losetup -P` on a
user PC if this patch gets included in Linux upstream one day ;)

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-02-24 01:35:20 +00:00
DENG Qingfang
06af45ec05 ramips: remove obsolete mx25l25635f compatible hack
The kernel bump to 5.4 has removed the mx25l25635f hack, and the
mx25l25635f compatible is no longer required.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
2021-02-24 00:30:40 +01:00
Stijn Segers
06356f0020 ramips: overwrite reset gpio properties in DIR-860L DTS
As suggested by Sergio, this adds GPIOs 19 and 8 explicitly into the
DIR-860L DTS, so the PCI-E ports get reset and the N radio (radio1)
on PCI-E port 1 comes up reliably.

Fixes the following error that popped up in dmesg:

    [    1.638942] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK)

Suggested-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
2021-02-23 21:10:56 +01:00
Sander Vanheule
773949c152 ramips: mt7621: enable SX150x driver
The Netgear R6800 and R6700v2 devices have a Semtech SX1503 GPIO
expander controlling the device LEDs. This expander was initially
supported on 4.14, but support was lost in the transition to 5.4.

Since this driver cannot be built as a kernel module, enable it in the
kernel config for all mt7621 devices.

Run-tested on a Netgear R6800.

Cc: Stijn Segers <foss@volatilesystems.org>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Tested-by: Stijn Segers <foss@volatilesystems.org>
2021-02-23 21:10:56 +01:00
DENG Qingfang
920eaab1d8 kernel: DSA roaming fix for Marvell mv88e6xxx
Marvell mv88e6xxx switch series cannot perform MAC learning from
CPU-injected (FROM_CPU) DSA frames, which results in 2 issues.
- excessive flooding, due to the fact that DSA treats those addresses
as unknown
- the risk of stale routes, which can lead to temporary packet loss

Backport those patch series from netdev mailing list, which solve these
issues by adding and clearing static entries to the switch's FDB.

Add a hack patch to set default VID to 1 in port_fdb_{add,del}. Otherwise
the static entries will be added to the switch's private FDB if VLAN
filtering disabled, which will not work.

The switch may generate an "ATU violation" warning when a client moves
from the CPU port to a switch port because the static ATU entry added by
DSA core still points to the CPU port. DSA core will then clear the static
entry so it is not fatal. Disable the warning so it will not confuse users.

Link: https://lore.kernel.org/netdev/20210106095136.224739-1-olteanv@gmail.com/
Link: https://lore.kernel.org/netdev/20210116012515.3152-1-tobias@waldekranz.com/
Ref: https://gitlab.nic.cz/turris/turris-build/-/issues/165
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
2021-02-23 21:10:56 +01:00
Adrian Schmutzler
5e9b07ff36 kernel: add symbol CONFIG_POWER_RESET_LINKSTATION
Add symbol to generic config (this was added between 5.4 and 5.10),
and remove it from the targets where it was added by kernel_oldconfig
in the meantime.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 21:08:21 +01:00
David Bauer
55ed4bf6d7 generic: add missing symbols
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-23 20:13:37 +01:00
Shiji Yang
d1176ad95a ramips: improve gpio control for Phicomm PSG1218
Description:
1. From key and led config setting, we can find only "uartf" and "i2c" are used
as gpio by check mt7620 datasheet. It's time to remove unused pin group.

2. PSG1218 only have three led, so we can remove ethernet led pinctrl. refer to
Phicomm K2G.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
fde9703a48 mvebu: add 5.10 as a testing kernel
Keep 5.4 as stable until further validation.

Tested on Turris Omnia (Rui Salvaterra) and ESPRESSObin v5 (Tomasz
Maciej Nowak). Cortex-A{53,72} subtargets are only build-tested.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[added comment about tests]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
b0cdc5ae46 mvebu: fix the Turris Omnia device tree
Enable and fix hardware buffer management. Also fix the IRQ storm caused by a
misconfiguration of the PCA9538 interrupt pin.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
23ebb2e9c3 mvebu: fix the patch numbering
Make each logical patch group numbering contiguous.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[add kernel version to backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
b43f5a9359 mvebu: refresh 5.10 kconfigs/patches
Also delete already upstreamed patches/changes.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-02-23 18:31:35 +01:00
Adrian Schmutzler
7be8ab4f7b mvebu: remove upstreamed DTS files in 5.10
Some armada-3720-espressobin-* files have been upstreamed, move
these to files-5.4.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
202515b901 mvebu: copy 5.4 patches/kconfigs to 5.10
Just a simple copy, no refresh yet.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[do not duplicate files]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
4d9ae8ca07 mvebu: refresh the 5.4 kernel configs
Remove the implicit/inherited symbols. While not strictly necessary, this will
make reviewing the diff between 5.4 and 5.10 easier.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-02-23 18:31:35 +01:00
Rui Salvaterra
dc6ac62046 kernel: 5.10: add further generic kconfig symbols
This will make the specific kconfig smaller.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[improved commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 18:31:35 +01:00
Álvaro Fernández Rojas
4dd5845f49 bmips: fix SMP CPU mapping
SMP isn't supported on BCM6358 since it has a shared TLB. Some boards boot
with CPU #1 instead of CPU #0, and this is currently not supported do to a
smp-bmips bug.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-23 15:25:13 +01:00
Álvaro Fernández Rojas
c015d18cd7 bmips: switch to accepted upstream patch
This patch has been accepted and is going to be in linux v5.12.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-23 15:22:27 +01:00
Álvaro Fernández Rojas
de3066bef7 bmips: rename upstream patches
These patches were applied in linux v5.11, not v5.12.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-23 15:14:41 +01:00
Álvaro Fernández Rojas
fc2a4e5682 bmips: bcm6358: add watchdog
Watchdog node was missing in commit 029093a302.

Fixes: 029093a302 ("bmips: add new target")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-23 12:57:28 +01:00
Álvaro Fernández Rojas
f0d5eb149e bmips: remove unneeded downstream serial patch
Disabling CONFIG_SERIAL_8250 makes the upstream serial driver work OOB.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-23 12:35:52 +01:00
Daniel González Cabanelas
50cb3a750f bcm63xx: pinctrl: fix BCM6348 groups
The current driver has some troubles:
 - Some groupings are wrong.
 - The pinctrl group0 owns pins never used (at least in Openwrt) for any
   pinmux. The driver hijacks all the pins on the group avoiding any other
   use, spite they're free. I.e. for buttons, causing this kernel error:
   [  4.735928] gpio-keys-polled keys: unable to claim gpio 479, err=-22
   [  4.742642] gpio-keys-polled: probe of keys failed with error -22
 - Minor errors about groupings on the documentation
 - Missing "diag" grouping in dtsi
 - Wrong groupings in dtsi

Fix it by setting the correct groups.
And relax the pin capturing, letting the gpios belonging to any group to
be used for other purposes like buttons. This was the behavior with stock
firmwares and old OpenWrt versions which never caused any trouble.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2021-02-23 11:01:20 +01:00
Álvaro Fernández Rojas
09bbf55817 bmips: bcm6358: fix EHCI/OHCI kernel panics
ARCH_HAS_SYNC_DMA_FOR_CPU_ALL is causing kernel panics when EHCI or OHCI are
enabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-23 10:52:06 +01:00
Adrian Schmutzler
e4d1163de4 imx6: remove redundant IMAGE_NAME
IMAGE_NAME is set twice for ventana, and the second value
actually matches the default in image.mk. Remove both.

Fixes: ded905ce43 ("imx6: extend cubox support to hummingboard,
add support for building full images")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 00:26:40 +01:00
Paul Spooren
6ab33103af treewide: remove redundant KERNEL_PREFIX definitions
The variables KERNEL_INITRAMFS_PREFIX and KERNEL_PREFIX are already
defined in include/image.mk and don't have to be redefined in the
target Makefiles.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[also cover imx6]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 00:26:40 +01:00
Adrian Schmutzler
020e51facf bmips: split base-files into subtargets
Like done for several targets already, splitting base-files into
subtarget will provide smaller images due to more specific
distribution of files per subtarget and allow to use default cases
more effectively.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-23 00:26:40 +01:00
Álvaro Fernández Rojas
117b833d61 bmips: add JFFS2 unaligned access patch
This patch is also needed on bmips if SMP is enabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-22 21:37:56 +01:00
Álvaro Fernández Rojas
626add3394 bmips: bcm6368: fix bcm2835-rng
IPSEC needs a reset before using its HW RNG.
Otherwise, the numbers generated won't be random at all.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-22 21:37:56 +01:00
Shiji Yang
567a88e4b9 ramips: fix Phicomm PSG1218A switch port labels
The lan port sequence was reversed compared to the labels.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[improve commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-22 18:49:57 +01:00
Adrian Schmutzler
d4520d75a1 ramips: move aliases to the top in SoC DTSI files
The aliases node is expected as one of the first entries, and
having it there matches alphabetic sorting as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-22 18:49:57 +01:00
Adrian Schmutzler
86a4d78022 ramips: drop redundant definitions of serial0 in aliases
These were redefines of the same value already set in the SoC dtsi
files.

Reported-by: Shiji Yang <yangshiji66@qq.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-22 18:49:57 +01:00
Álvaro Fernández Rojas
029093a302 bmips: add new target
This target has full device tree support, thus reducing the number of
patches needed for bcm63xx, in which there's a patch for every board.

The intention is to start with a minimal amount of downstream patches and
start upstreaming all of them.

Current status:
 - Enabling EHCI/OHCI on BCM6358 causes a kernel panic.
 - BCM63268 lacks Timer Clocks/Reset support.
 - No PCI/PCIe drivers.
 - No ethernet drivers.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-22 18:29:44 +01:00
Álvaro Fernández Rojas
c27532742d bcm63xx: limit name metadata to model name
Since there are only 16 characters available, on most cases the vendor name
will fit in the metadata, but the model name won't fit.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-22 18:29:44 +01:00
Álvaro Fernández Rojas
7405ff5d4b kernel: mtdsplit: add support for BCM63XX CFE firmware
Broadcom CFE bootloader relies on a tag for identifying the current firmware,
such as version, image start address, kernel address and size, rootfs size,
board id, signatures, etc.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-22 18:09:03 +01:00
Shiji Yang
55263ffedb ramips: correct/add Phicomm K2x WAN/label MAC address
Phicomm K2G:
add missing label_mac

Phicomm PSG1218A & PSG1218B:
The previous wan mac was set as factory@0x28 +1 (originally based
on the default case for the ramips target), but the correct wan mac
is factory@0x28 -1, being equal to factory@0x2e.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-22 17:32:35 +01:00
Álvaro Fernández Rojas
36e35b8d81 bcm63xx: bcm63268: fix GPIO interrupts
pinctrl should rely on external interrupt controller for GPIO interrupts.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-22 09:04:04 +01:00
David Bauer
f79f496ed6 generic: add missing symbol
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-22 00:57:34 +01:00
David Bauer
2a26cb51fe ath79: enable Regulator support for target
Regulator support was enabled on all subtargets except for ath79-nand.
With Kernel 5.10, AT803x requires Regulator support, thus enabling on
the complete target, as ath79-nand requires AT803x.

While this is only required on Kernel 5.10, enable it also on 5.4. We
have no major size-constraint, so enabling it on 5.4 allows us to clean
up the occurences in the subtarget configuration.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-22 00:57:25 +01:00
David Bauer
08826595fc mpc85xx: add testing kernel for p1020
CONFIG_REGULATOR is required for the p1020 subtarget, as the AT803X
driver depends on it.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-22 00:56:16 +01:00
David Bauer
81b44a3626 ath79: use ioremap kernel version independent
As mangix pointed out on IRC, ioremap and ioremap_nocache are
functionally equivalent on kenrel 5.4 and 5.10.

Therefore we can use ioremap regardless of the kernel the driver
gets compiled for.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-22 00:55:42 +01:00
Aleksander Jan Bajkowski
777e67301a kernel: sort config
This was done by executing this script:

find . -name "config-*"  > ../configs.txt
for config in $(cat ../configs.txt); do
	./scripts/kconfig.pl '+' $config /dev/null > $config-new
	mv $config-new $config
done
rm ../configs.txt

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
2021-02-21 23:52:26 +01:00
Álvaro Fernández Rojas
9dc84018ee bcm27xx: remove urngd package
Now that khwrngd is working on all subtargets we can remove urgnd.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-20 19:55:14 +01:00
Álvaro Fernández Rojas
670526efa3 bcm27xx: enable bcm2711 HW RNG
Also add a patch setting its quality, which should make it usable by khwrngd.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-20 19:53:50 +01:00
Álvaro Fernández Rojas
7747b3fa36 generic: add bcm2835-rng quality patch
This patch allows devices without a high resolution timer to boot up faster.
It should speed up boots for bcm2708 and bcm63xx.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-20 18:59:25 +01:00
Andreas Eberlein
a3e6521c1a x86: add led driver for PC Engines APU1
This driver adds the LED support for the PC Engines APU1.
This integrates the Linux kernel driver and includes a patch to support
 newer firmware versions. Also the default LED configuration is updated
 to use the correct devices.

Signed-off-by: Andreas Eberlein <foodeas@aeberlein.de>
2021-02-20 00:29:18 -10:00
David Bauer
bb817bb4b8 sdk: expose binary strip settings
Expose the SDK options for binary stripping to the menuconfig. This
way, packages can easily be built with debug symbols using the SDK.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:29:36 +01:00
Stijn Segers
af1b6799c6 ramips: overwrite reset gpio properties in EX6150 DTS
The Netgear EX6150 can, just like the D-Link DIR-860L rev B1, fail to
initialise both radios in some cases. Add the reset GPIOs explicitly
so the PCI-E devices get re-initialised properly. See also FS #3632.

Error shows up in dmesg as follows:

  [    1.560764] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK)

Tested-by: Kurt Roeckx <kurt@roeckx.be>
Signed-off-by: Stijn Segers <foss@volatilesystems.org>
[removed period from commit title]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:27:00 +01:00
David Bauer
d6b785d477 ath79: add kernel 5.10 support
This adds Kernel 5.10 support for the generic, nand and tiny subtargets.

The following patch is not contained, as it needs to be reworked:
platform/920-mikrotik-rb4xx.patch

Tested-on:
 - Siemens WS-AP3610
 - Enterasys WS-AP3710
 - Aerohive HiveAP 121
 - TP-Link TL-WA901 v2
 - TP-Link TL-WR741 v1

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:26:33 +01:00
David Bauer
fb64e2c30f ath79: ar934x-nand: add kernel 5.10 compatibility
Adapt the driver to make it work with the NAND subsystem changes between
kernel 5.4 and 5.10.

Tested-on: Aerohive HiveAP121

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:26:22 +01:00
David Bauer
da55758cc5 ath79: specify device-type for PCI controllers
Specify the device_type property for PCI as well as PCIe controllers.
Otherwise, the PCI range parser will not be selected when using kernel
5.10.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:26:14 +01:00
David Bauer
3832403771 ath79: ag71xx: make kernel 5.10 compatible
Add the necessary kernel version ifdef switches in order to support the
kernel version 5.10.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:26:04 +01:00
David Bauer
5bd6d9377d mpc85xx-p1010: add Kernel 5.10 support
Tested on: Sophos RED 15W

The TP-Link WL-WDR4900 needs to be disabled when 5.10 becomes the
default kernel.

When building with all kmods enabled, the resulting kernel image
exceeds the maximum size the bootloader reads from the flash.

For more information, see GitHub issue #1773

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:26:00 +01:00
David Bauer
422b3e1993 rockchip: add Kernel 5.10 support
Remove all upstreamed patches and add the kernel configuration for
version 5.10.

The Rock Pi 4 was split in multiple versions. Add a DTS with the old
name in order to keep compatibility while having kernel 5.4 and 5.10 in
parallel. Switch to the Rock Pi 4A DTS once Kernel 5.4 support is
removed.

Tested-on: Nanoi R2S

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-20 01:26:00 +01:00
Sungbo Eo
2ff9686040 kirkwood: rename files-5.4 to files
Move local DTS files from "files-5.4" to "files" directory so kernel 5.10
can use it.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-02-19 15:56:04 +01:00
Yangbo Lu
a31842e7fd layerscape: add new devices in README and clean up
Support new devices LS1046AFRWY and LX2160ARDB in README.
Clean up README, and add missing LS1021ATWR deploy guide.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
[adjust set of devices added, update commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-19 15:30:10 +01:00
Yangbo Lu
80dcd14abe layerscape: add LX2160ARDB (Rev2.0 silicon) board support
The QorIQ LX2160A reference design board provides a comprehensive platform
that enables design and evaluation of the LX2160A processor.

- Enables network intelligence with the next generation Datapath (DPPA2)
  which provides differentiated offload and a rich set of IO, including
  10GE, 25GE, 40GE, and PCIe Gen4

- Delivers unprecedented efficiency and new virtualized networks

- Supports designs in 5G packet processing, network function
  virtualization, storage controller, white box switching, network
  interface cards, and mobile edge computing

- Supports all three LX2 family members (16-core LX2160A; 12-core LX2120A;
  and 8-core LX2080A)

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
[use AUTORELEASE, add dtb to firmware part]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-19 15:29:46 +01:00
Yangbo Lu
2c2d77bd3b layerscape: add FRWY-LS1046A board support
The LS1046A Freeway board (FRWY) is a high-performance computing,
evaluation, and development platform that supports the QorIQ
LS1046A architecture processor capable of support more than 32,000
CoreMark performance. The FRWY-LS1046A board supports the QorIQ
LS1046A processor, onboard DDR4 memory, multiple Gigabit Ethernet,
USB3.0 and M2_Type_E interfaces for Wi-Fi.

The FRWY-LS1046A-TP includes the Coral Tensor Flow Processing Unit
that offloads AI/ML inferencing from the CPU to provide significant
boost for AI/ML applications. The FRWY-LS1046A-TP includes one M.2
TPU module and more modules can easily be added including USB
versions of the module to scale the AI/ML performance.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
[rebase, use AUTORELEASE, fix sorting, add dtb to firmware part]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-19 15:27:15 +01:00
Adrian Schmutzler
a9075d42d7 layerscape: move rework-sdcard-images out of fsl-sdboot
Upcoming devices will not need the migration setup, so let's move
it out of the common definition.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-19 15:23:52 +01:00
Seo Suchan
ca6954e2dc ramips: use lzma-loader for Wevo devices
As kernel size increased it start to fail to load squishfs image,
using lzma-loader fixed it.
wevo_11acnas is almost same device as w2914ns-v2 except ram size,
so I expect same thing would've happen in that device too.

Signed-off-by: Seo Suchan <abnoeh@mail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
2021-02-19 14:09:50 +01:00
Sander Vanheule
1e75909a35 ramips: mt7621: add TP-Link EAP235-Wall support
The TP-Link EAP235-Wall is a wall-mounted, PoE-powered AC1200 access
point with four gigabit ethernet ports.

When connecting to the device's serial port, it is strongly advised to
use an isolated UART adapter. This prevents linking different power
domains created by the PoE power supply, which may damage your devices.

The device's U-Boot supports saving modified environments with
`saveenv`. However, there is no u-boot-env partition, and saving
modifications will cause the partition table to be overwritten. This is
not an issue for running OpenWrt, but will prevent the vendor FW from
functioning properly.

Device specifications:
* SoC: MT7621DAT
* RAM: 128MiB
* Flash: 16MiB SPI-NOR
* Wireless 2.4GHz (MT7603EN): b/g/n, 2x2
* Wireless 5GHz (MT7613BEN): a/n/ac, 2x2
* Ethernet: 4× GbE
  * Back side: ETH0, PoE PD port
  * Bottom side: ETH1, ETH2, ETH3
* Single white device LED
* LED button, reset button (available for failsafe)
* PoE pass-through on port ETH3 (enabled with GPIO)

Datasheet of the flash chip specifies a maximum frequency of 33MHz, but
that didn't work. 20MHz gives no errors with reading (flash dump) or
writing (sysupgrade).

Device mac addresses:
Stock firmware uses the same MAC address for ethernet (on device label)
and 2.4GHz wireless. The 5GHz wireless address is incremented by one.
This address is stored in the 'info' ('default-mac') partition at an
offset of 8 bytes.
From OEM ifconfig:
    eth     a4:2b:b0:...:88
    ra0     a4:2b:b0:...:88
    rai0    a4:2b:b0:...:89

Flashing instructions:
* Enable SSH in the web interface, and SSH into the target device
* run `cliclientd stopcs`, this should return "success"
* upload the factory image via the web interface

Debricking:
U-boot can be interrupted during boot, serial console is 57600 baud, 8n1
This allows installing a sysupgrade image, or fixing the device in
another way.
* Access serial header from the side of the board, close to ETH3,
  pin-out is (1:TX, 2:RX, 3:GND, 4:3.3V), with pin 1 closest to ETH3.
* Interrupt bootloader by holding '4' during boot, which drops the
  bootloader into its shell
* Change default 'serverip' and 'ipaddr' variables (optional)
* Download initramfs with `tftpboot`, and boot image with `bootm`
    # tftpboot 84000000 openwrt-initramfs.bin
    # bootm

Revert to stock:
Using the tplink-safeloader utility from the firmware-utils package,
TP-Link's firmware image can be converted to an OpenWrt-compatible
sysupgrade image:
  $ ./staging_dir/host/bin/tplink-safeloader -B EAP235-WALL-V1 \
      -z EAP235-WALLv1_XXX_up_signed.bin -o eap235-sysupgrade.bin

This can then be flashed using the OpenWrt sysupgrade interface. The
image will appear to be incompatible and must be force flashed, without
keeping the current configuration.

Known issues:
- DFS support is incomplete (known issue with MT7613)
- MT7613 radio may stop responding when idling, reboot required.
  This was an issue with the ddc75ff704 version of mt76, but appears to
  have improved/disappeared with bc3963764d.
  Error notice example:
  [ 7099.554067] mt7615e 0000:02:00.0: Message 73 (seq 1) timeout

Hardware was kindly provided for porting by Stijn Segers.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2021-02-19 14:00:08 +01:00
Stijn Segers
0265cba40a ramips: remove factory image for TP-Link Archer C20 v1
Similarly to the Archer C2 v1, the Archer C20 v1 will brick when one
tries to flash an OpenWrt factory image through the TP-Link web UI.
The wiki page contains an explicit warning about this [1].

Disable the factory image altogether since it serves no purpose.

[1] https://openwrt.org/toh/tp-link/tp-link_archer_c20_v1#installation

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
2021-02-19 13:56:27 +01:00
Adrian Schmutzler
63e1ce3e09 ath79: fix position of SPDX license identifier
Strictly, the identifier needs to be in the line directly after the
shebang.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-19 13:53:22 +01:00
Adrian Schmutzler
45e8d9b480 mediatek: fix SPDX license identifier on local DTS files
The SPDX license identifier must be in the first line of a file,
unless there is a shebang (then it's the second line).

Fix this for the local files, do not care about the upstream patches.

While at it, update the identifiers where necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-19 13:47:45 +01:00
Álvaro Fernández Rojas
31a06f8fcc bcm63xx: update ethernet kernel panics fix
Use new patch from Sieng Piaw Liew.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-19 12:28:19 +01:00
Daniel Golle
c7293bcfcc
mediatek: move mt7623a-unielec-u7623*.dts* out of patch
Instead of adding those device tree sources using a patch, simply move
them to the newly created dts folder.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-02-19 10:00:46 +00:00
Álvaro Fernández Rojas
5bab472a11 bcm27xx: add diag LEDs
We can now use the power LED for diag in more devices thanks to the latest
patches from the RPi foundation.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-19 08:09:11 +01:00
Álvaro Fernández Rojas
0aaa2cce1c bcm27xx: bcm2708: add missing RPi B DTS file
RPI 1B DTS has been splitted into 2 files:
 - bcm2708-rpi-b.dts: Newest (rev2) RPI 1B
 - bcm2708-rpi-b-rev1.dts: Old (rev1) RPI 1B

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-19 08:09:11 +01:00
Daniel Golle
e3b8849088
mediatek: more clean solution for out-of-tree DTS
Use approach suggested by Adrian Schmutzler instead of introducing
another device variable.
Also revert the unnecessary white-space changes accidentally introduced
by the previous commit.

Fixed: c067b1e79b ("mediatek: move out-of-tree DTS files to dedicated dts folder")
Suggested-by: Adrian Schmutzler <mail@adrianschmutzler.de>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-02-19 01:25:49 +00:00
Daniel Golle
c067b1e79b
mediatek: move out-of-tree DTS files to dedicated dts folder
Use dedicated dts folder like on ramips to store device tree source
files for boards not already supported in vanilla Linux.
Doing so instead of having them in files-* has several advantages:
 * we don't need to duplicate them for several kernel versions
 * changes to a device tree don't trigger a complete kernel rebuild
 * the files are more obvious to find

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-02-19 00:05:53 +00:00
Álvaro Fernández Rojas
8ad61118fd bcm27xx: add support for RPI CM4 and RPI 400
Support added to bcm2709 (32 bits) and bcm2711 (64 bits).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-18 23:43:18 +01:00
Álvaro Fernández Rojas
f07e572f64 bcm27xx: import latest patches from the RPi foundation
bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 3B v1.2 and RPi 4B v1.1 4G
bcm2710: boot tested on RPi 3B v1.2
bcm2711: boot tested on RPi 4B v1.1 4G

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-18 23:42:32 +01:00
John Audia
5d3a6fd970 kernel: bump 5.4 to 5.4.99
Ran update_kernel.sh in a fresh clone without any existing toolchains.
No manual changes needed.

Build system: x86_64
Build-tested: bcm27xx/bcm2711

Signed-off-by: John Audia <graysky@archlinux.us>
2021-02-18 20:04:50 +01:00
Mathias Kresin
ba07cc0cbb lantiq: fritz7320: enable USB power supply
The USB ports if a FRIZZ!Box 7320 do not supply power to connected
devices.

Add the GPIOs enabling USB power as regulator, to enable USB power
supply as soon as the USB driver is loaded.

Fixes FS#3624

Signed-off-by: Mathias Kresin <dev@kresin.me>
2021-02-18 08:43:08 +01:00
David Bauer
5408399fcb generic: don't lock when recursively deleting partitions
When recursively deleting partitions, don't acquire the masters
partition lock twice. Otherwise the process endy up in a deadlocked
state.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-18 01:16:40 +01:00
David Bauer
0621b23efb generic: add various kernel 5.10 config symbols
These symbols were unset when configuring for ath79.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-18 01:16:20 +01:00
David Bauer
634c13c186 mediatek: add support for Ubiquiti UniFi 6 LR
Hardware
--------

MediaTek MT7622
512MB DDR3 RAM
64M SPI-NOR Flash (Winbond W25Q512JV)
MediaTek MT7622 802.11bgn 4T4R WMAC
MediaTek MT7915 802.11ax 4T4R
Marvell AQR1112 100/1000/2500 NBase-T PHY
Holtek HT32F52241 LED controller
Reset Switch

UART
----

CPU UART0 at the pinout next to the Holtek MCU.

Pinout (first pin next to SoC / MCU)

0 3V3
1 RX
2 TX
3 GND

Settings are 115200 8N1.

Opening the case
----------------

Opening the case is not a nice task, as itis glued together. Insert a
flat knife between the front and back casing below the ethernet port.
Open up a gap this way and insert a flat scredriver, remove the knife.

Work your way around the casing by applying force to seperate the front
and back casing. This losens the glue and opens the plastic clips. Be
gentle, as these clips are very cheap and break quickly.

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

1. Connect to the booted device at 192.168.1.20 using username/password
   "ubnt".

2. Transfer the OpenWrt sysupgrade image to the device using SCP.

3. Check the mtd partition number for bs / kernel0 / kernel1

   $ cat /proc/mtd

4. Set the bootselect flag to boot from kernel0

   $ dd if=/dev/zero bs=1 count=1 of=/dev/mtdblock6

5. Write the OpenWrt sysupgrade image to both kernel0 as well as kernel1

   $ dd if=openwrt.bin of=/dev/mtdblock8
   $ dd if=openwrt.bin of=/dev/mtdblock9

6. Reboot the device. It should boot into OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-18 01:15:45 +01:00
David Bauer
c9137e2ddf mediatek: add Ubiquiti LED driver
Add a driver for controlling the RGB LED via Ubiquitis own "LEDBAR" LED
controller based on the Holtek HT32F52241 MCU.

This driver is initially used by the Ubiquiti UniFi 6 LR, however
judging from FCC pictures the MCU is also found on the U6-Mesh as well
as the U6-Extender.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-18 01:15:33 +01:00
Álvaro Fernández Rojas
f323dec4f8 bcm63xx: add kernel 5.10 support
Runtime-tested on Comtrend AR-5387un.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-17 20:40:16 +01:00
Daniel Golle
5bb9954826 kernel: update kernel 5.10 to 5.10.16
Compile and runtime-tested on mediatek/mt7622

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-02-17 13:48:43 +00:00
Adrian Schmutzler
0e43f62f21 kernel: 5.10: refresh patches
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-16 23:48:23 +01:00
Adrian Schmutzler
0c7340f0a2 kernel: 5.10: add missing partitions doc syntax commit
This patch has been added to 5.4, but not been copied to 5.10:
7495acb555 ("kernel: backport mtd commit converting partitions doc syntax")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-16 23:48:23 +01:00
Adrian Schmutzler
1013bf433b kernel: hack-5.10: make UDP tunneling user-selectable
This applies another patch from 5.4 to 5.10 as well:
de09355f74 ("kernel/hack-5.4: make UDP tunneling user-selectable")

UDP tunneling support isn't user-selectable, but it's required by WireGuard
which is, for the time being, an out-of-tree module. We currently work around
this issue by selecting an unrelated module which depends on UDP tunnelling
(VXLAN). This is inconvenient, as it implies this unrelated module needs to be
built-in when doing a monolithic build.

Fix this inconvenience by making UDP tunneling user-selectable in the kernel
configuration.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-16 23:48:23 +01:00
Adrian Schmutzler
487b7ae5eb kernel: 5.4: fix .patch file extension
File extension was truncated for
pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.pa

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-16 23:48:23 +01:00
Adrian Schmutzler
99f2b464b4 kernel: 5.10: fix busy wait loop in mediatek PPE code
Reapply changes added to 5.4 but not copied to 5.10:
3da4acaa7b ("kernel: fix busy wait loop in mediatek PPE code")

The intention is for the loop to timeout if the body does not succeed.
The current logic calls time_is_before_jiffies(timeout) which is false
until after the timeout, so the loop body never executes.

time_is_after_jiffies(timeout) will return true until timeout is less
than jiffies, which is the intended behavior here.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-16 23:46:30 +01:00
Adrian Schmutzler
0e407dfe8b generic: ar8216: update version switch for of_get_phy_mode fix
Kernel has changed the of_get_phy_mode API in commit 0c65b2b90d13
("net: of_get_phy_mode: Change API to solve int/unit warnings").

This is already included in kernel 5.5, so fix the version switch
(though this will not actually matter for the versions we support).

Similar driver adjustments to account for the API change will
probably be necessary to various other local drivers.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-16 23:42:43 +01:00
David Bauer
a24df045db generic: ar8216: fix kernel 5.10 compile error
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-16 22:53:10 +01:00
Felix Fietkau
b10d604459 kernel: add linux 5.10 support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-16 20:06:51 +01:00
Rafał Miłecki
ad8b759fd1 bcm4908: add bcm_sf2 fixes for the 5th GPHY
This allows using the last integrated PHY (and so e.g. WAN port on the
ASUS GT-AC5300).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-16 07:10:33 +01:00
Rafał Miłecki
f0933303d6 bcm4908: fix GPIOs support by limiting them to 64
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-15 22:18:50 +01:00
Rafał Miłecki
da92e9825a bcm4908: use DTS patches sent upstream
There are 2 new patches:
1. Netgear R8000P switch ports
2. Netgear R8000P LEDs

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-15 22:18:45 +01:00
Rafał Miłecki
95359dac82 bcm4908: add USB packages to the DEFAULT_PACKAGES
All known 41 BCM4908 devices have USB ports so it makes sense to include
those packages by default.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-15 16:54:28 +01:00
Rafał Miłecki
26052fb355 bcm4908: fix backport of PMB driver
Missing Makefile change was preventing kernel from actually compiling
the driver.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-15 16:54:25 +01:00
Rafał Miłecki
09fbc79bf6 kernel: drop ofpart patch dropped from upstream mtd tree
It stopped ofpart_parser_init() from being called

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-15 15:06:40 +01:00
Rafał Miłecki
ac7d45b5e7 kernel: backport "ofpart" mtd parser upstream quirks support
This adds quirks support to the "ofpart" parser. It's required to
support fixed partitions that require some extra logic.

Right now only BCM4908 binding is supported (BCM4908 requires detecting
currently used "firmware" partition).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-15 12:02:33 +01:00
Ilya Lipnitskiy
3da4acaa7b kernel: fix busy wait loop in mediatek PPE code
The intention is for the loop to timeout if the body does not succeed.
The current logic calls time_is_before_jiffies(timeout) which is false
until after the timeout, so the loop body never executes.

time_is_after_jiffies(timeout) will return true until timeout is less
than jiffies, which is the intended behavior here.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-15 08:13:16 +01:00
Kurt Roeckx
539966554d ramips: mark toggle input on EX6150 as a switch
The Netgear EX6150 has an Access Point/Extender switch. Set it as
an EV_SW. Otherwise when it's set to Access Point, it will trigger
failsafe mode during boot.

Fixes: FS#3590
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
2021-02-15 00:00:38 +01:00
Petr Štetiar
0fde111702 Revert "imx6: bootscript-apalis: make it working on v2021.01 release"
This reverts commit 4968fc8fb1 as the bump
to v2021.01 needs swig on the host for pylibfdt which is needed by dtoc
tool to generate .h/.c files from DTBs in SPL for mx6cuboxi_config.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-02-14 23:28:07 +01:00
Adrian Schmutzler
4894a3ff28 target: fix copying of licenses for SDK/toolchain
The SDK and target/toolchain copy the license file into their
directories. During the rename/move from LICENSE to a LICENSES
folder, this has not been updated.

Update it now, and include the new COPYING file.

While at it, improve formatting/indent.

Fixes: 882e301461 ("LICENSES: include all used licenses in
LICENSES directory")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-14 21:56:29 +01:00
Paul Fertser
25d6af98d0 ath79: fix factory image generation for Netgear and Zyxel boards
The factory images need to embed specific IDs to pass verification with
the OEM firmware (including TFTP recovery), so they need to be
per-device variables.

Fixes: ab1584a797 ("ath79: netgear: trim down uImage customisations")
Fixes: 459c8c9ef8 ("ath79: add support for ZyXEL NBG6616")
Reported-by: Marcin Juszkiewicz <marcin-openwrt@juszkiewicz.com.pl>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
[minor commit message adjustments, sort DEVICE_VARS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-14 19:21:38 +01:00
Tomasz Maciej Nowak
1caa81e505 mvebu: espressobin: drop COMPHY removement patch
There are proper workarounds merged to 5.4 stable tree for ESPRESSObin
boards with older bootloader:
4e1a23779bde ("ata: ahci: mvebu: Make SATA PHY optional for Armada 3720")
40af962eb1d4 ("usb: host: xhci: mvebu: make USB 3.0 PHY optional for
Armada 3720")

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2021-02-14 09:34:57 +01:00
Sander Vanheule
69551a2442 ramips: manage low reset lines
The bootloader of a number of recent TP-Link devices does not properly
initialise the MT7621's internal switch when booting from flash. To
enable the mt7530 driver to clear the reset on the switch, the ramips
reset controller must be allowed to toggle these.

Backport upstream commit 3f9ef7785a9c from mips-next to allow control of
the "mcm" reset line.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2021-02-14 09:33:42 +01:00
Petr Štetiar
4968fc8fb1 imx6: bootscript-apalis: make it working on v2021.01 release
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>
2021-02-14 09:31:30 +01:00
Adrian Schmutzler
a45953c2f2 bcm4908: refresh patches
Our patch refresh tool creates quite a big diff for these patches,
as it does not use rename syntax.

Push the refresh separately so it does not pollute the next kernel
bump. This is a purely cosmetic change.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-13 21:21:01 +01:00
Martin Kennedy
e2db870398 ath79: fix chip used for Meraki MR12 caldata_extract
The original setup fails to trigger ART calibration data
extraction for the AR9287. Instead, it would only have extracted
calibration data for an internal WMAC chip which is not present on
this board.

Fixes: 55d2db0e8c ("ath79: add support for Meraki MR12")

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-13 21:21:01 +01:00
Stijn Segers
ad5e29d38a ramips: remove factory image for TP-Link Archer C2 v1
Initial commit 8375623a06 ("ramips: add support for TP-Link Archer
C2") contains detailed installation instructions, which do not mention
a factory image. From what I can see, no support to install OpenWrt
through the vendor web interface has been added since. The factory
image is also conspicuously absent from the device page in the wiki.
Yet, it is available for download.

I bricked my Archer C2 loading the factory image through the web UI.
Serial showed this error during bootloop:

  Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover

This patch disables the undocumented factory image so users won't get
tricked into thinking easy web UI flashing actually works.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
2021-02-13 21:21:01 +01:00
Rafał Miłecki
d8afae0be8 bcm4908: fix handling Ethernet frames of size 1506 - 1514
MTU needs to be explicitly set as default value is too low.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-12 16:30:14 +01:00
Rafał Miłecki
87efff6329 bcm4908: use upstream accepted Ethernet driver patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-12 16:30:14 +01:00
Michael Mohr
8cbd6f5117 realtek: add support for Netgear GS108T v3
The Netgear GS108T v3 is an 8 port gigabit switch with PoE-PD support
on port 1.  The two prior versions were built using eCos and are not
currently compatible with OpenWRT.

The GS108T v3 is quite similar to both the GS110TPP v1 and GS110TP v3,
all of which use the same firmware image from Netgear.  For this reason,
the device tree is identical aside from the model and compatible values.

All of the above feature a dual firmware layout, referred to as Image0
and Image1 in the Netgear firmware.

Hardware specification
----------------------

 * RTL8380M SoC, 1 MIPS 4KEc core @ 500MHz
 * 128MB DDR3-1600 DRAM (Winbond W631GG8MB-12)
 * 32MB 3v NOR SPI Flash (Macronix MX25L25635F or Winbond W25Q256JVFIQ)
 * RTL8231 GPIO extender to control the LEDs and the reset button
 * 8 x 10/100/1000BASE-T ports, internal PHY (RTL8218B)
 * UART (115200 8N1) via unpopulated standard 0.1" pin header marked J1
 * Power is supplied via a 12V 1A barrel connector or 802.3af

UART pinout
-----------

J1 | [o]ooo
      ^ ||`------ GND
      | |`------- RX         [TX out of the serial adapter]
      | `-------- TX         [RX into the serial adapter]
      `---------- Vcc (3V3)  [the square pin]

The through holes are filled with PB-free solder which melts at 375C.
They can also be drilled using a 0.9mm bit.

Build configuration
-------------------

 * Target System: Realtek MIPS
 * Target Profile: Netgear GS108T v3
 * Target Images -> ramdisk -> Compression: lzma
 * Disable other target images

Boot initramfs image from U-Boot
--------------------------------

 1. Press the Escape key at the `Hit Esc key to stop autoboot` prompt
 2. Init network with `rtk network on` command
 3. Load image with `tftpboot 0x8f000000 openwrt-realtek-generic-netgear_gs108t-v3-initramfs-kernel.bin` command
 4. Boot the image with `bootm` command

The switch defaults to IP 192.168.1.1 and tries to fetch the image via
TFTP from 192.168.1.111.

Updating the installed firmware
-------------------------------

The OpenWRT ramdisk image can be flashed directly from the Netgear UI.
The Image0 slot should be used in order to enable sysupgrade.

As with similar switches, changing the active boot partition can be
accomplished in U-Boot as follows:

 1. Press the Escape key at the `Hit Esc key to stop autoboot` prompt
 2. Run `setsys bootpartition {0|1}` to select the boot partition
 3. Run `savesys` followed by `boota` to proceed with the boot process

Signed-off-by: Michael Mohr <akihana@gmail.com>
2021-02-12 08:52:41 +01:00
Michael Mohr
9fe90e4e5a realtek: refactor the Netgear GS110TPP v1 device tree
Move most of the GS110TPP v1 device tree into a dtsi so that it can be
shared with the GS108T v3.  Additionally:

  * Use macros to simplify the ethernet and switch definitions
  * Zero-pad the offsets and sizes in the partition map to 8 digits each

The spi-max-frequency value has been changed from 10MHz to 50MHz based
on an analysis of the relevant datasheets.  The current driver doesn't
use this property, as the clock speed is fixed. However, it's required
for this type of DT node, so that's why it's present here.

The firmware partition has been split in half, since this is how the
stock firmware uses it.  This can be used to easily revert to a stock
firmware if one is written to the second image area.

Signed-off-by: Michael Mohr <akihana@gmail.com>
2021-02-12 08:52:41 +01:00
Michael Mohr
9877393fd1 realtek: add and use netgear_nge for the GS110PP v1
The netgear_nge device will be shared between the GS108T v3 (to be added
in a later commit) and the GS110PP v1.  It also enables LZMA compression
for the ramdisk image.

Signed-off-by: Michael Mohr <akihana@gmail.com>
2021-02-12 08:52:41 +01:00
Adrian Schmutzler
6934d30cf8 ath79: fix USB power GPIO for TP-Link TL-WR810N v1
The TP-Link TL-WR810N v1 is known to cause soft-brick on ath79 and
work fine for ar71xx [1]. On closer inspection, the only apparent
difference is the GPIO used for the USB regulator, which deviates
between the two targets.

This applies the value from ar71xx to ath79.

Tested successfully by a forum user.

[1] https://forum.openwrt.org/t/tp-link-tl-wr810n-v1-ath79/48267

Fixes: cdbf2de777 ("ath79: Add support for TP-Link WR810N")
Fixes: FS#3522

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-11 23:58:32 +01:00
INAGAKI Hiroshi
08768b44d9 ramips: add support for ELECOM WRC-1167FS
ELECOM WRC-1167FS is a 2.4/5 GHz band 11ac (WiFi-5) router, based on
MT7628AN.

Specification:

- SoC		: MediaTek MT7628AN
- RAM		: DDR2 64 MiB (NT5TU32M16FG-AC)
- Flash		: SPI-NOR 16 MiB (W25Q128JVSIQ)
- WLAN		: 2.4/5 GHz 2T2R
  - 2.4 GHz	: MediaTek MT7628AN (SoC)
  - 5 GHz	: MediaTek MT7612E
- Ethernet	: 10/100 Mbps x2
  - Switch	: MT7628AN (SoC)
- LEDs/Keys	: 6x, 3x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J1: 3.3V, GND, TX, RX from "J1" marking
  - 57600n8
- Power		: 12 VDC, 1 A

Flash instruction using factory image:

1. Boot WRC-1167FS normally
2. Access to "http://192.168.2.1/" and open firmware update page
   ("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button to
   perform firmware update
4. Wait ~120 seconds to complete flashing

Notes:

- Last 0x800000 (8 MiB) in SPI-NOR flash is not used on stock firmware

- Additional padding in factory image is required to avoid incomplete
  flashing on stock firmware

MAC addresses:

- LAN	: BC:5C:4C:xx:xx:68 (Config, ethaddr (text) / Factory, 0x28   (hex))
- WAN	: BC:5C:4C:xx:xx:69 (Config, wanaddr (text) / Factory, 0x22   (hex))
- 2.4GHz: BC:5C:4C:xx:xx:6A (Config, rmac    (text) / Factory, 0x4    (hex))
- 5GHz	: BC:5C:4C:xx:xx:6B (Config, rmac2   (text) / Factory, 0x8004 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-02-11 16:37:53 +01:00
John Audia
e95b1b23f1 kernel: bump 5.4 to 5.4.97
Ran update_kernel.sh in a fresh clone without any existing toolchains.

Manually rebased:
 bcm27xx
  950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch
 bcm53xx
  180-usb-xhci-add-support-for-performing-fake-doorbell.patch
 layerscape
  302-dts-0008-arm64-dts-ls1046a-accumulated-change-to-ls1046a-boar.patch
  820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch
  820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch

Build system: x86_64
Build-tested: bcm27xx/bcm2711, ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions/everything functional.

Signed-off-by: John Audia <graysky@archlinux.us>
[remove quilt comment, fix/adjust 820-usb-* layerscape patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-11 16:08:28 +01:00
Adrian Schmutzler
3cc08b5702 at91: use SPDX license identifiers on DTS files
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-10 15:47:23 +01:00
Adrian Schmutzler
7157c77c6d target: use SPDX license identifiers on scripts
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-10 15:47:23 +01:00
Adrian Schmutzler
598b29585e target: use SPDX license identifiers on Makefiles
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-10 15:47:18 +01:00
Rafał Miłecki
c382fe857d bcm4908: update Ethernet driver
Use the latest version sent upsteram.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-10 11:28:04 +01:00
Andrew Pikler
cd2b661453 ramips: add support for Cudy WR1300
Specifications:
 - SoC: MediaTek MT7621AT
 - RAM: 128 MB (DDR3)
 - Flash: 16 MB (SPI NOR)
 - WiFi: MediaTek MT7603E, MediaTek MT7612E
 - Switch: 1 WAN, 4 LAN (Gigabit)
 - Ports: 1 USB 3.0
 - Buttons: Reset, WPS
 - LEDs: Power, System, Wan, Lan 1-4, WiFi 2.4G, WiFi 5G, WPS, USB
 - Power: DC 12V 1A tip positive

UART Serial:
  115200 baud
  Located on unpopulated 4 pin header near J4:

  J4
  [o] Rx
  [o] Tx
  [o] GND
  [ ] Vcc - Do not connect

Installation:

Download and flash the manufacturer's built OpenWRT image available at
http://www.cudytech.com/openwrt_software_download
Install the new OpenWRT image via luci (System -> Backup/Flash firmware)
Be sure to NOT keep settings. The force upgrade may need to be checked
due to differences in router naming conventions.

Recovery:
 - Loads only signed manufacture firmware due to bootloader RSA verification
 - serve tftp-recovery image as /recovery.bin on 192.168.1.88/24
 - connect to any lan ethernet port
 - power on the device while holding the reset button
 - wait at least 8 seconds before releasing reset button for image to
   download
 - See http://www.cudytech.com/newsinfo/547425.html

MAC addresses as verified by OEM firmware:

use   address   source
LAN   *:f0      label
WAN   *:f1      label + 1
2g    *:f0      label
5g    *:f2      label + 2

The label MAC address is found in bdinfo 0xde00.

Signed-off-by: Andrew Pikler <andrew.pikler@gmail.com>
2021-02-09 13:58:18 +01:00
Sebastian Schaper
dc4745da7a ath79: add support for D-Link DAP-3662 A1
Specifications:
 * QCA9557, 16 MiB Flash, 128 MiB RAM, 802.11n 2T2R
 * QCA9882, 802.11ac 2T2R
 * 2x Gigabit LAN (1x 802.11af PoE)
 * IP68 pole-mountable outdoor case

Installation:
 * Factory Web UI is at 192.168.0.50
   login with 'admin' and blank password, flash factory.bin
 * Recovery Web UI is at 192.168.0.50
   connect network cable, hold reset button during power-on and keep it
   pressed until uploading has started (only required when checksum is ok,
   e.g. for reverting back to oem firmware), flash factory.bin

After flashing factory.bin, additional free space can be reclaimed by
flashing sysupgrade.bin, since the factory image requires some padding
to be accepted for upgrading via OEM Web UI.

Both ethernet ports are set to LAN by default, matching the labelling on
the case. However, since both GMAC Interfaces eth0 and eth1 are connected
to the switch (QCA8337), the user may create an additional 'wan' interface
as desired and override the vlan id settings to map br-lan / wan to either
the PoE or non-PoE port, depending on the individual scenario of use.

So, the LAN and WAN ports would then be connected to different GMACs, e.g.

config interface 'lan'
	option ifname 'eth0.1'
	...

config interface 'wan'
	option ifname 'eth1.2'
	...

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '2 6t'

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
[add configuration example]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-09 13:10:33 +01:00
Chukun Pan
82032f3509 ramips: add support for JCG Y2
JCG Y2 is an AC1300M router

Hardware specs:
  SoC: MediaTek MT7621AT
  Flash: Winbond W25Q128JVSQ 16MiB
  RAM: Nanya NT5CB128M16 256MiB
  WLAN: 2.4/5 GHz 2T2R (1x MediaTek MT7615)
  Ethernet: 10/100/1000 Mbps x5
  LED: POWER, INTERNET, 2.4G, 5G
  Button: Reset
  Power: DC 12V,1A

Flash instructions:
  Upload factory.bin in stock firmware's upgrade page.

MAC addresses map:
  0x0004  *:c8  wlan2g/wlan5g/label
  0xe000  *:c7  lan
  0xe006  *:c6  wan

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2021-02-09 13:10:33 +01:00
Michael Pratt
f5f01bcacd ath79: use internal switch for EAP300 v2
Have the port use GMAC1 with internal switch
which fixes the issue of the ethernet LED not functioning
The LED is triggered by the internal switch, not a GPIO.

The GPIO for the ethernet LED was added in ath79
as it was defined in the ar71xx target
but it was not functioning in ath79 for a previously unknown reason.

It is unknown why that GPIO was defined as an LED in ar71xx.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
[drop unrelated changes: model property and SPI max frequency]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-08 16:34:18 +01:00
Michael Pratt
88079bd616 ath79: make all eth ports LAN for Engenius APs
for:
 - ENH202 v1
 - ENS202EXT v1
 - EnstationAC v1
 - EWS511AP

For EWS511AP, have default behavior as static ip
to match the behavior of all other APs in ath79

These boards are sold as
Client Bridge or Point to Point or Access Point
so there is probably no benefit to have WAN by default
for one of the ports, to prevent user confusion.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-02-08 16:34:18 +01:00
John Audia
f3b827a965 kernel: bump 5.4 to 5.4.96
Ran update_kernel.sh in a fresh clone without any existing toolchains.

Build system: x86_64
Build-tested: ipq806x/R7800, bcm27xx/bcm2711
Run-tested: ipq806x/R7800
Run-tested [*]: ramips/mt7621 (R6800, DIR-878 A1, EAP235-Wall)

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Stijn Segers <foss@volatilesystems.org> [*]
2021-02-08 16:34:18 +01:00
Rafał Miłecki
f06c3031a7 bcm4908: add board.d network setup
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-08 12:05:56 +01:00
Rafał Miłecki
81240a9b89 bcm4908: add Ethernet driver
This commit picks up pending netdev patches.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-02-08 11:49:21 +01:00
Szabolcs Hubai
1e9afcca56 ramips: disable default build for HooToo HT-TM02
While the latest version of 19.07 release is usable,
the current master is unbootable on the device in a normal way.

"Normal way" installations includes:
- sysupgrade (e.g. from 19.07)
- RESET button recovery with Ron Curry's (Wingspinner) UBoot image
  (10.10.10.3 + "Kernal.bin")
- RESET button recovery with original U-Boot
  (10.10.10.254 + "kernel")

One could flash and boot the latest master sysupgrade image successfully
with serial access to the device. But a sysupgrade from this state still
breaks the U-Boot and soft-bricks the device.

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2021-02-07 22:06:57 +01:00
Adrian Schmutzler
1c0e13db43 ramips: mt7621: use preferred logic in lib/upgrade/iodata.sh
shellcheck recommends || and && over "-a" and "-o" because the
latter are not well defined.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-07 21:58:51 +01:00
INAGAKI Hiroshi
88fbddb49d ramips: add support for I-O DATA WN-DX1200GR
I-O DATA WN-DX1200GR is a 2.4/5 GHz band 11ac (WiFi-5) router, based on
MT7621A.

Specification:

- SoC		: MediaTek MT7621A
- RAM		: DDR3 128 MiB
- Flash		: raw NAND 128 MiB
- WLAN		: 2.4/5 GHz 2T2R
  - 2.4 GHz	: MediaTek MT7603E
  - 5 GHz	: MediaTek MT7613BE
- Ethernet	: 10/100/1000 Mbps x5
  - Switch	: MediaTek MT7530 (SoC)
- LEDs/keys	: 2x/3x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J5: 3.3V, TX, RX, NC, GND from triangle-mark
  - 57600n8
- Power		: 12 VDC, 1 A

Flash instruction using initramfs image:

1. Boot WN-DX1200GR normally
2. Access to "http://192.168.0.1/" and open firmware update page
   ("ファームウェア")
3. Select the OpenWrt initramfs image and click update ("更新") button
   to perform firmware update
4. On the initramfs image, perform sysupgrade with the
   squashfs-sysupgrade image
5. Wait ~120 seconds to complete flashing

Notes:

- currently, mt7615e driver in mt76 doesn't fully support MT7613
  (MT7663) wifi chip
  - the eeprom data in flash is not used by mt7615e driver and the
    driver reports the tx-power up to 3dBm
  - the correct MAC address for MT7613BE in eeprom data cannot be
    assigned to the phy

- last 0x80000 (512 KiB) in NAND flash is not used on stock firmware

- stock firmware requires "customized uImage header" (called as "combo
  image") by MSTC (MitraStar Technology Corp.), but U-Boot doesn't

  - uImage magic ( 0x0 - 0x3 ) : 0x434F4D43 ("COMC")
  - header crc32 ( 0x4 - 0x7 ) : with "data length" and "data crc32"
  - image name   (0x20 - 0x37) : model ID and firmware versions
  - data length  (0x38 - 0x3b) : kernel + rootfs
  - data crc32   (0x3c - 0x3f) : kernel + rootfs

MAC addresses:

LAN:	50:41:B9:xx:xx:08 (Ubootenv, ethaddr (text) / Factory, 0x1E000 (hex))
WAN:	50:41:B9:xx:xx:0A (Factory,  0x1E006 (hex))
2.4GHz:	50:41:B9:xx:xx:08 (Factory,  0x4     (hex))
5GHz:	50:41:B9:xx:xx:09 (Factory,  0x8004  (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[add check whether dflag_offset is set]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-07 21:58:51 +01:00
Daniel González Cabanelas
07f4e3b5b2 bcm63xx: kernel: reenable the TRNG
The hardware random number generator driver for bcm63xx was merged with
the one used by the Raspberry Pi. Now this driver is lost.

Reenable the HW_RANDOM kernel config with the new driver.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
[refresh kernel config]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-07 19:06:52 +01:00
Pawel Dembicki
17fa01bb79 mpc85xx: refresh kernel config
Simple "make kernel_oldconfig" was done.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2021-02-06 17:13:33 +01:00
Thomas Beckler
450ec48d61 kirkwood: use 3 temperature sensors for Zyxel NSA310B
Instead of taking the input of one temperature sensor (temp1), the
script takes into account three temperature sensors to control the
PWM of the cooling fan.

temp1 -> placed on main board
temp2 -> placed on main board
temp3 -> placed on or close to chipset

All three temperatures give valid input for the PWM of the fan on
NSA310 and are actually changing.

Tested on two NSA310.

Signed-off-by: Thomas Beckler <thomas.beckler@hotmail.com>
Reviewed-by: Alberto Bursi <bobafetthotmail@gmail.com>
[commit title/message facelift, code cleanup]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 22:21:08 +01:00
Adrian Schmutzler
8a79161a82 ath79: wrap ucidef_add_switch in 02_network
Wrap line to be consistent with all other definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 21:57:19 +01:00
Yanase Yuki
d468ff97b7 build: move elx-header into image-commands.mk
ELECOM WAB-I1750-PS will need this in ath79, so move it to common
Makefile.

Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
2021-02-05 21:57:19 +01:00
Sungbo Eo
321035420c kirkwood: refresh kernel config
Refresh config with make kernel_oldconfig.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-02-05 19:05:20 +01:00
Aleksander Jan Bajkowski
c9619fe6a5 lantiq: change phy-mode to mii for FRITZ!Box 7412
FRITZ!Box 7412 loads the firmware for fast ethernet PHY and mii is
more accurate in this case.
Gmii is used by Gigabit ethernet PHYs.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Reviewed-by: Mathias Kresin <dev@kresin.me>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 18:56:19 +01:00
Adrian Schmutzler
04a0e5c082 ipq806x: replace full-text BSC license by SPDX identifier
This replaces a full-text BSD clause by the corresponding SPDX
identifier.

This should make it easier to identify the license both by humans
and machines.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 18:28:30 +01:00
Adrian Schmutzler
3f4d1dad00 ramips: replace full-text licenses by SPDX identifier
This replaces several full-text and abbreviated licenses found in
DTS files by the corresponding SPDX identifiers.

This should make it easier to identify the license both by humans
and machines.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 18:18:00 +01:00
David Bentham
4a18039785 ramips: add support for UniElec U7621-01
UniElec U7621-01 is a router platform board, the smaller model of
the U7621-06.
The device has the following specifications:

- MT7621AT (880 MHz)
- 256 of RAM (DDR3)
- 16 MB of FLASH (SPI NOR)
- 5x 1 Gbps Ethernet (MT7621 built-in switch)
- 1x 2.4Ghz MT7603E
- 1x 5Ghz MT7612
- 1x miniPCIe slots (PCIe bus only)
- 1x miniSIM slot
- 1x USB 2.0 (uses the usb 3.0 driver)
- 8x LEDs (1x GPIO-controlled)
- 1x reset button
- 1x UART header (4-pins)
- 1x GPIO header (30-pins)
- 1x DC jack for main power (12 V)

The following has been tested and is working:

- Ethernet switch
- 1x 2.4Ghz MT7603E (wifi)
- 1x 5Ghz MT7612 (wifi)
- miniPCIe slots (tested with Wi-Fi cards and LTE modem cards)
- miniSIM slot (works with normal size simcard)
- sysupgrade
- reset button

Installation:

This board has no locked down bootloader. The seller can be asked to
install openwrt v18.06, 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.

LEDs list (left to right):

- ESW_P0_LED_0
- ESW_P1_LED_0
- ESW_P2_LED_0
- ESW_P3_LED_0
- ESW_P4_LED_0
- CTS2_N (GPIO10, configured as "status" LED)
- LED_WLAN# (connected with pin 44 in wifi1 slot)

Signed-off-by: David Bentham <db260179@gmail.com>
[add DEVICE_VARIANT, fix DEVICE_PACKAGES, remove &gpio]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 17:31:51 +01:00
Martin Kennedy
55d2db0e8c ath79: add support for Meraki MR12
Port device support for Meraki MR12 from the ar71xx target to ath79.

Specifications:

  - SoC: AR7242-AH1A CPU
  - RAM: 64MiB (NANYA NT5DS32M16DS-5T)
  - NOR Flash: 16MiB (MXIC MX25L12845EMI-10G)
  - Ethernet: 1 x PoE Gigabit Ethernet Port (SoC MAC + AR8021-BL1E PHY)
  - Ethernet: 1 x 100Mbit port (SoC MAC+PHY)
  - Wi-Fi: Atheros AR9283-AL1A (2T2R, 11n)

Installation:

  1. Requires TFTP server at 192.168.1.101, w/ initramfs & sysupgrade .bins
  2. Open shell case
  3. Connect a USB->TTL cable to headers furthest from the RF shield
  4. Power on the router; connect to U-boot over 115200-baud connection
  5. Interrupt U-boot process to boot Openwrt by running:
       setenv bootcmd bootm 0xbf0a0000; saveenv;
       tftpboot 0c00000 <filename-of-initramfs-kernel>.bin;
       bootm 0c00000;
  6. Copy sysupgrade image to /tmp on MR12
  7. sysupgrade /tmp/<filename-of-sysupgrade>.bin

Notes:

  - kmod-owl-loader is still required to load the ART partition into the
    driver.

  - The manner of storing MAC addresses is updated from ar71xx; it is
    at 0x66 of the 'config' partition, where it was discovered that the
    OEM firmware stores it. This is set as read-only. If you are
    migrating from ar71xx and used the method mentioned above to
    upgrade, use kmod-mtd-rw or UCI to add the MAC back in. One more
    method for doing this is described below.

  - Migrating directly from ar71xx has not been thoroughly tested, but
    one method has been used a couple of times with good success,
    migrating 18.06.2 to a full image produced as of this commit. Please
    note that these instructions are only for experienced users, and/or
    those still able to open their device up to flash it via the serial
    headers should anything go wrong.

    1) Install kmod-mtd-rw and uboot-envtools
    2) Run `insmod mtd-rw.ko i_want_a_brick=1`
    3) Modify /etc/fw_env.config to point to the u-boot-env partition.
       The file /etc/fw_env.config should contain:

       # MTD device   env offset  env size    sector size
       /dev/mtd1      0x00000     0x10000     0x10000

       See https://openwrt.org/docs/techref/bootloader/uboot.config
       for more details.

    4) Run `fw_printenv` to verify everything is correct, as per the
       link above.
    5) Run `fw_setenv bootcmd bootm 0xbf0a0000` to set a new boot address.
    6) Manually modify /lib/upgrade/common.sh's get_image function:
       Change ...

       cat "$from" 2>/dev/null | $cmd

       ... into ...

       (
         dd if=/dev/zero bs=1 count=$((0x66)) ; # Pad the first 102 bytes
         echo -ne '\x00\x18\x0a\x12\x34\x56'  ; # Add in MAC address
         dd if=/dev/zero bs=1 count=$((0x20000-0x66-0x6)) ; # Pad the rest
         cat "$from" 2>/dev/null
       ) | $cmd

       ... which, during the upgrade process, will pad the image by
       128K of zeroes-plus-MAC-address, in order for the ar71xx's
       firmware partition -- which starts at 0xbf080000 -- to be
       instead aligned with the ath79 firmware partition, which
       starts 128K later at 0xbf0a0000.

    7) Copy the sysupgrade image into /tmp, as above
    8) Run `sysupgrade -F /tmp/<sysupgrade>.bin`, then wait

    Again, this may BRICK YOUR DEVICE, so make *sure* to have your
    serial cable handy.

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
[add LED migration and extend compat message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 16:56:08 +01:00
Ewan Parker
ddafcc7947 ramips: add support for Hi-Link HLK-7688A
Specifications:

  - SoC: MediaTek MT7688AN
  - RAM: 128 MB
  - Flash: 32 MB
  - Ethernet: 5x 10/100 (1x WAN, 4x LAN)
  - Wireless: built in 2.4GHz (bgn)
  - USB: 1x USB 2.0 port
  - Buttons: 1x Reset
  - LEDs: 1x (WiFi)

Flash instructions:

  - Configure TFTP server with IP address 10.10.10.3
  - Name the firmware file as firmware.bin
  - Connect any Ethernet port to the TFTP server's LAN
  - Choose option 2 in U-Boot
  - Alternatively choose option 7 to upload firmware to the built-in
    web server

MAC addresses as verified by OEM firmware:

  use   address   source
  2g    *:XX      factory 0x4
  LAN   *:XX+1    factory 0x28
  WAN   *:XX+1    factory 0x2e

Notes:

This board is ostensibly a module containing the MediaTek MT7688AN SoC,
128 MB DDR2 SDRAM and 32 MB flash storage.  The SoC can be operated in
IoT Gateway Mode or IoT Device Mode.

From some vendors the U-Boot that comes installed operates on UART 2
which is inaccessible in gateway mode and operates unreliably in the
Linux kernel when using more than 64 MB of RAM.  For those, updating
U-Boot is recommended.

Signed-off-by: Ewan Parker <ewan@ewan.cc>
[add WLAN to 01_leds]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-05 14:54:47 +01:00
John Audia
36c9cf3e51 kernel: bump 5.4 to 5.4.95
Ran update_kernel.sh in a fresh clone without any existing toolchains.

Removed upstreamed patches:
 imx6: 303-ARM-dts-imx6qdl-gw52xx-fix-duplicate-regulator-namin.patch

Build system: x86_64
Build-tested: ipq806x/R7800, bcm27xx/bcm2711
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-02-04 22:07:32 +01:00
Daniel González Cabanelas
a0e0e621ca bcm63xx: sprom: override the PCI device ID
The PCI device ID detected by the wifi drivers on devices using a fallback
SPROM is wrong. Currently the chipnum is used for this parameter.

Most SSB based Broadcom wifi chips are 2.4 and 5GHz capable. But on
devices without a physical SPROM, the only one way to detect if the device
suports both bands or only the 5GHz band, is by reading the device ID from
the fallback SPROM.

In some devices, this may lead to a non working wifi on a 5GHz-only card,
or in the best case a working 2.4GHz-only in a dual band wifi card.

The offset for the deviceid in SSB SPROMs is 0x0008, whereas in BCMA is
0x0060. This is true for any SPROM version.

Override the PCI device ID with the one defined at the fallback SPROM, to
detect the correct wifi card model and allow using the 5GHz band if
supported.

The patch has been tested with the following wifi radios:

BCM43222: b43: both 2.4/5GHz working
          brcm-wl: both 2.4/5GHz working

BCM43225: b43: 2.4GHz, working
	 brcmsmac: working
	 brcm-wl: it lacks support

BCM43217: b43: 2.4GHz, working
	 brcmsmac: it lacks support
	 brcm-wl: it lacks support

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
[amend commit description, rework patch to avoid using a new global variable
and keep ssb sprom extraction code as close to ssb/pci.c as possible]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-02 20:40:31 +01:00
Álvaro Fernández Rojas
e23a90674e bcm63xx: backport upstream SSB SPROM extraction
New upstream changes extract more SPROM values and fix the antenna gain.
These changes can be found in linux drivers/ssb/pci.c.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-02 20:40:29 +01:00
John Audia
d33cd383ed kernel: bump 5.4 to 5.4.94
All modification made by update_kernel.sh in a fresh clone without
existing toolchains.

Build-tested: bcm27xx/bcm2711, ipq806x/R7800,
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-02-01 19:10:43 +01:00
Leon Leijssen
eff03cea27 ath79: ag71xx: add ethtool statistics support
Add statistics to ethtool. The statistics can be useful to
debug network issues.

The code is backported from mainline ag71xx.c driver.

Signed-off-by: Leon Leijssen <leon.git@leijssen.info>
2021-02-01 00:48:12 +01:00
David Bauer
51f578efa5 ath79: add support for Ubiquiti UniFi AP Outdoor+
Hardware
--------
Atheros AR7241
16M SPI-NOR
64M DDR2
Atheros AR9283 2T2R b/g/n
2x Fast Ethernet (built-in)

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

Transfer the Firmware update to the device using SCP.

Install using fwupdate.real -m <openwrt.bin> -d

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-01 00:47:46 +01:00
David Bauer
0c499f6068 mac80211: convert UniFi Outdoor+ HSR support to OF
Enable support for the Ubiquiti UniFi Outdoor+ RF filter via
device-tree. The old way of using platform data is not required anymore,
as it was only used on the now removed ar71xx target.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-01 00:47:36 +01:00
Petr Štetiar
337ff74894 mvebu: omnia: make initramfs image usable out of the box
Currently it's not possible to boot the device with just initramfs image
without additional effort as the initramfs image doesn't contain device
tree.  Fix it by producing FIT based image which could be booted with
following commands:

 setenv bootargs earlyprintk console=ttyS0,115200
 tftpboot ${kernel_addr_r} openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin
 bootm ${kernel_addr_r}

Acked-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-01-31 11:39:19 +01:00
Daniel González Cabanelas
24b910dca2 mvebu: LS421DE: fix the thermal zones
The thermal zones kernel documentation is misleading, we cannot use more
than one sensor in a thermal zone node.

Furthermore the drivetemp driver for some reason it only catches one
sensor from the hard drives array (the first available).

In the Buffalo Linkstation LS421DE board there is also a sensor at the
ethernet phy chip that can also be monitored. Very useful to stop the fan
when there are no hard drives in the bays.

(It might be also possible to add the CPU sensor, but it requires kernel
patching for registering the sensor via device tree, using the function:
devm_thermal_zone_of_sensor_register)

Fix the thermal zones to use only one sensor per node and add the ethernet
phy sensor. Also adjust the hdd temperatures to be more conservative for
a mechanical hard drive.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2021-01-30 01:03:00 +01:00
INAGAKI Hiroshi
eb11cd9ea3 ramips: add support for ELECOM WRC-2533GHBK-I
ELECOM WRC-2533GHBK-I is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based
on MT7621A.

Specification:

- SoC		: MediaTek MT7621A
- RAM		: DDR3 128 MiB
- Flash		: SPI-NOR 16 MiB
- WLAN		: 2.4/5 GHz 4T4R (2x MediaTek MT7615)
- Ethernet	: 10/100/1000 Mbps x5
  - Switch	: MediaTek MT7530 (SoC)
- LED/keys	: 4x/3x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J4: 3.3V, RX, GND, TX from SoC side
  - 57600n8
- Power		: 12VDC, 1.5A

Flash instruction using factory image:

1. Boot WRC-2533GHBK-I normally
2. Access to "http://192.168.2.1/" and open firmware update page
   ("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
4. Wait ~150 seconds to complete flashing

MAC addresses:

LAN	: BC:5C:4C:xx:xx:89 (Config, ethaddr (text))
WAN	: BC:5C:4C:xx:xx:88 (Config, wanaddr (text))
2.4GHz	: BC:5C:4C:xx:xx:8A (Factory, 0x4    (hex))
5GHz	: BC:5C:4C:xx:xx:8B (Factory, 0x8004 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
2021-01-29 15:32:07 +01:00
INAGAKI Hiroshi
0071c7cd82 build: add elecom-product-header for ELECOM devices
A header used in ELECOM WRC-300GHBK2-I and WRC-1750GHBK2-I/C is also
used in ELECOM WRC-2533GHBK-I, so split the code to generate the header
and move it to image-commands.mk to use from ramips target.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
2021-01-29 15:28:12 +01:00
Adrian Schmutzler
331892f85f treewide: drop shebang from non-executable lib files
This drops the shebang from another bunch of files in various /lib
folders, as these are sourced and the shebang is useless.

Fix execute bit in one case, too.

This should cover almost all trivial cases now, i.e. where /lib is
actually used for library files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-29 14:29:41 +01:00
John Audia
2c35899d81 kernel: bump 5.4 to 5.4.93
All modification made by update_kernel.sh in a fresh clone without
existing toolchains.

Build system:       x86_64
Build-tested:       ipq806x/R7800, bcm27xx/bcm2711
Run-tested:         ipq806x/R7800
Compile-tested [*]: ath79/{tiny,generic}, ipq40xx, octeon,
                    ramips/mt7621, realtek, x86/64
Run-tested [*]:     ath79/generic, ipq40xx, octeon, ramips/mt7621

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Stijn Segers <foss@volatilesystems.org> [*]
2021-01-29 14:22:09 +01:00
Álvaro Fernández Rojas
7d12f29ae1 bcm63xx: fix bcm63xx ethernet kernel panics
Calling netdev_reset_queue() from _stop() functions is causing sporadic kernel
panics on bcm63xx, which happen mainly on BCM6318 and BCM6328.
This reverts to the previous behaviour, which called netdev_reset_queue() from
_open() functions.

Tested on Comtrend AR-5315u (BCM6318).

Fixes: 1d6f422e34 ("bcm63xx: sync ethernet driver with net-next")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-01-28 12:01:14 +01:00
Jiang Yongquan
799fca7602 sunxi: add support for linksprite pcDuino3 nano board
Specifications:

 - SoC: Allwinner A20 @ 1Ghz
 - DRAM: 1GiB DDR3 @ 408MHz (K4B4G1646Q-HYK0)
 - NAND: 4GB MLC NAND (H27UBG8T2BTR-BC)
 - Ethernet: 10/100/1000Mbps Ethernet (Realtek RTL8211E)

Flash instructions:

dd if=openwrt-sunxi-cortexa7-linksprite_pcduino3-nano-ext4-sdcard.img
of=/dev/sdX

Signed-off-by: Jiang Yongquan <woxwchc@foxmail.com>
[Remove CONFIG_REALTEK_PHY from sunxi/cortexa53 config]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-01-27 23:14:30 +01:00
Marty Jones
9c29165a4c rockchip: fix SUPPORTED_DEVICES for Radxa ROCK Pi 4
This sets SUPPORTED_DEVICES to match the compatible in the DTS.

While at it, synchronize the capitalization in DEVICE_MODEL and
DTS model.

Signed-off-by: Marty Jones <mj8263788@gmail.com>
[commit title/message facelift, move variable in armv8.mk]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-27 21:31:20 +01:00
Adrian Schmutzler
30651e6834 bcm4908: sort and wrap build recipes
This sorts the Build recipes alphabetically, wraps some long lines
and moves the DEVICE_VARS to the top like common on several other
targets.

Cc: Rafał Miłecki <rafal@milecki.pl>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-27 21:31:20 +01:00
Adrian Schmutzler
44f2d71edd mediatek: remove generic profiles
We have support for reference boards available on this target, so
support for an additional generic profile does not make much sense.

Remove it to have one thing less to maintain.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2021-01-27 21:31:20 +01:00
Adrian Schmutzler
a7904c6b7f kirkwood: remove generic profile
On a platform with many very different devices, like found on kirkwood,
the generic profile seems like a remnant of the past that does not
have a real use anymore.

Remove it to have one thing less to maintain.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2021-01-27 21:31:20 +01:00
Adrian Schmutzler
5b0644b71d ipq806x: remove generic profile
On a platform with many very different devices, like found on ipq806x,
the generic profile seems like a remnant of the past that does not
have a real use anymore.

Remove it to have one thing less to maintain.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2021-01-27 21:31:20 +01:00
Adrian Schmutzler
5697915a18 ipq40xx: remove generic profile
On a platform with many very different devices, like found on ipq40xx,
the generic profile seems like a remnant of the past that does not
have a real use anymore.

Remove it to have one thing less to maintain.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2021-01-27 21:31:20 +01:00
Adrian Schmutzler
703fd8aef4 ramips: remove generic profiles
On a platform with many very different devices, like found on ramips,
the generic profiles seem like remnants of the past that do not
have a real use anymore.

Remove them to have one thing less to maintain.

Actually, rt288x didn't have a default profile in the first place.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2021-01-27 21:31:20 +01:00
Adrian Schmutzler
9b5e9b65cf ath79: remove generic profiles
On a platform with many very different devices, like found on ath79,
the generic profiles seem like remnants of the past that do not
have a real use anymore.

Remove them to have one thing less to maintain.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2021-01-27 21:31:20 +01:00
Felix Fietkau
ff9846dbb9 ramips: use lzma-loader on zbtlink devices
Fixes boot loader LZMA decompression issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-27 18:26:53 +01:00
Birger Koblitz
1b1bb6bf19 realtek: add debugfs support for mirroring
This adds debugfs support to monitor mirroring via debugfs

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
6f67c079e6 realtek: add API for the hw tables of RTL83XX/93XX SoCs
Add a table API that has per accss register locking and uses
register description information to handle all table access
through a single set of api calls.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
27029277f9 realtek: add switch driver support for the RTL93XX based switches
Adds support for the RTL9300 and RTL9310 series of switches
with 10GBit per port and up to 56 ports.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
d140b9fc23 realtek: add internal and external SDS/PHYs of RTL9300 devices
This adds support for the internal SerDes of the RTL9300 SoC
and for the RTL8218D and RTL8226B phys found in combination
with this SoC in switches.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
e1bca7c77d realtek: fix RTL8231 gpio expander usage with RTL839X SoC
This fixes the usage of the RTL8231 GPIO extender chip
when used with the RTL839X SoCs. Specifically,
the PHY addresses may be different from 0.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
6aac20bc01 realtek: enable default rate limiting and qos settings
Enable default rate limiting and QoS support. Remove
previous storm control code.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
56ac4fced0 realtek: correct l2 offloading tag handling
Makes sure the DSA trailer information on any L2 offloading done
by the switch is honoured by the bridge layer

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
dc9cc0d3e2 realtek: add QoS and rate control
This adds support for identifying QoS information in packets
and use this and rate control information to submit to multiple
egress queues. The ethernet driver is also made to support
2 egress and up to 32 egress queues.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
4237488cf3 realtek: add dtsi for RTL930X SoCs
Add a default dtsi to support RTL930X SoCs.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
8faffa00cb realtek: add support for the RTL9300 timer
this adds support for the SoC timer of the RTL9300 chips, it
provides 6 independent timer/counters, of which the first one
is used as a clocksource and the second one as event timer.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
03c79ca269 realtek: add support for the RTL8390 and RTL9300 SoC IRQs
This adds support for the RTL8390 and RTL9300 SoCs
it also cleans up unnecessary definitions in mach-rtl83xx.h
and moves definitions relevant for irq routing to irq.h

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
Birger Koblitz
cb39602399 realtek: add detection of RTL930X SoCs and RTL8313 SoC
This adds support to detect RTL930X based SoCs and the RTL9313 SoC.
Tested on Zyxel XGS1210-10 (RTL9302B SoC) and the
Zyxel XS1930-12 (RTL9313 SoC)

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2021-01-26 15:06:50 +01:00
John Audia
9ad912d159 kernel: bump 5.4 to 5.4.92
All modification made by update_kernel.sh in a fresh clone without
existing toolchains.

Build system:       x86_64
Build-tested:       ipq806x/R7800, bcm27xx/bcm2711
Run-tested:         ipq806x/R7800
Compile-tested [*]: ath79/{tiny,generic}, ipq40xx, octeon,
                    ramips/mt7621, realtek, x86/64.
Run-tested [*]:     ath79/generic, octeon, ramips/mt7621, realtek.

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Stijn Segers <foss@volatilesystems.org> [*]
2021-01-26 00:49:53 +01:00
Tony Ambardar
0faa172356 config: limit CONFIG_PERF_EVENTS to top-level generic configs
Remove redundant target-level settings.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2021-01-25 14:37:41 +01:00
Tony Ambardar
b67d086ef3 malta: update target configs and fix build warnings
Comment out some conflicting target configs that are set from subtarget
configs, which sometimes lead to kernel compile warnings:

  scripts/kconfig/conf  --syncconfig Kconfig
  net/sched/Kconfig:45: warning: menuconfig statement without prompt
  .config:1038:warning: override: CPU_MIPS32_R2 changes choice state

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2021-01-25 14:37:41 +01:00
Bjørn Mork
1fb413e657 realtek: build ZyXEL vendor firmware compatible initramfs
Append a device specific version trailer used by the stock
firmware upgrade application to validate firmwares.

The trailer contains a list of ZyXEL firmware version
numbers, which includes a four letter hardware identifier.
The stock web UI requires that the current hardware matches
one of the listed versions, and that the version number is
larger than a model specific minimum value. The minimum
version varies between V1.00 and V2.60 for the currently
known GS1900 models. The number is not used anywhere else
to our knowlege, and has no direct relation to the version
info in the u-image header.  We can therefore use an
arbitrary value larger than V2.60.

The stock firmware upgrade application will only load and
flash the part of the file specified in the u-image header,
regardless of file size.  It can therefore not be used to
flash images with an appended rootfs. There is therefore no
need to include the trailer in other images than the
initramfs. This prevents accidentally bricking by attempts
to flash other images from the stock web UI.

Stock images support all models in the series, listing
all of them in the version trailer.  OpenWrt provide model
specific images.  We therefore only list the single supported
hardware identifier for each image.  This eliminates the risk
of flashing the wrong OpenWrt image from stock web UI.

OpenWrt can be installed from stock firmware in two steps:

   1) flash OpenWrt initramfs image from stock web gui
   2) boot OpenWrt and sysupgrade to a squasfs image

The OpenWrt squashfs image depends on a static partition
map in the DTS.  It can only be installed to the "firmware"
partition.  This partition is labeled "RUNTIME1" in u-boot
and in stock firmware, and is referred to as "image 0" in
the stock flash management tool.  The OpenWrt initramfs
can be installed and run from either partitions. But if
you want to keep stock irmware in the spare system partition,
then you must make sure stock firmware is installed to the
"RUNTIME2" partition referred to as "image 1" in the stock
web UI. And the initial OpenWrt initramfs must be flashed
to "RUNTIME1"/"image 0".

The stock flash management application supports direct
selection of both which partition to flash and which
partition to boot next.  This allows software controlled
"dual-boot" between OpenWrt and stock firmware, without
using console access to u-boot. u-boot use the "bootpartition"
variable stored in the second u-boot environment to select
which of the two system partitions to boot.  This variable
is set by the stock flash management application, by direct
user input.  It can also be set in OpenWrt using e.g

 fw_setsys bootpartition 1

to select "RUNTIME2"/"image 1" as default, assuming a
stock firmware version is installed in that partition.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-24 18:12:34 +01:00
Bjørn Mork
ca4832fcac realtek: use vendor-specific magic for ZyXEL
The stock firmware of the ZyXEL GS1900 series use a non-standard
u-image magic.  This is not enforced by the stock u-boot, which is
why we could boot images with the default magic.  The flash
management application of the stock firmware will however verify
the magic, and refuse any image with another value.

Convert to vendor-specific value to get flash management support
in stock firmware, including the ability to upgrade to OpenWrt
directly from stock web UI.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-24 18:12:34 +01:00
Adrian Schmutzler
29167cbca3 x86: fix upgrade by emptying SUPPORTED_DEVICES
x86 uses append-metadata, but only for signing and not for the
metadata itself.

Since recently SUPPORTED_DEVICES was assigned with a global value
and is not empty anymore, append-metadata will now actually put
metadata into x86 images. This breaks sysupgrade on x86.

To fix it for the moment, let's just empty SUPPORTED_DEVICES for
this target again.

In the long term, one should either not add metadata to the images
if it is not desired, and/or remove the unintended fwtool check.

Fixes: f52081bcf9 ("treewide: provide global default for SUPPORTED_DEVICES")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-23 23:42:47 +01:00
Adrian Schmutzler
4571ef48d8 bcm53xx: use default SUPPORTED_DEVICES for Meraki MR32
Since the new global SUPPORTED_DEVICES are now available in bcm53xx
as well, we do not need to specify an explicit value for the MR32
anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-23 23:42:47 +01:00
Michael Pratt
96017a6013 ath79: add support for Senao Engenius EAP1200H
FCC ID: A8J-EAP1200H

Engenius EAP1200H is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

**Specification:**

  - QCA9557 SOC
  - QCA9882 WLAN	PCI card, 5 GHz, 2x2, 26dBm
  - AR8035-A PHY	RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 2x 64 MB RAM	NT5TU32M16FG
  - UART at J10		populated
  - 4 internal antenna plates (5 dbi, omni-directional)
  - 5 LEDs, 1 button (power, eth0, 2G, 5G, WPS) (reset)

**MAC addresses:**

  MAC addresses are labeled as ETH, 2.4G, and 5GHz
  Only one Vendor MAC address in flash

  eth0 ETH  *:a2 art 0x0
  phy1 2.4G *:a3 ---
  phy0 5GHz *:a4 ---

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

  2 ways to flash factory.bin from OEM:

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    Navigate to "Firmware Upgrade" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 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.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

**Return to OEM:**

  If you have a serial cable, see Serial Failsafe instructions
  otherwise, uboot-env can be used to make uboot load the failsafe image

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will brick the device
  DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt

  ssh into openwrt and run
  `fw_setenv rootfs_checksum 0`
  reboot, wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

**TFTP recovery:**

  Requires serial console, reset button does nothing

  rename initramfs to 'vmlinux-art-ramdisk'
  make available on TFTP server at 192.168.1.101
  power board, interrupt boot
  execute tftpboot and bootm 0x81000000

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

**Format of OEM firmware image:**

  The OEM software of EAP1200H is a heavily modified version
  of Openwrt Kamikaze. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-ar71xx-generic-eap1200h-uImage-lzma.bin
    openwrt-ar71xx-generic-eap1200h-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring.

  Newer EnGenius software requires more checks but their script
  includes a way to skip them, otherwise the tar must include
  a text file with the version and md5sums in a deprecated format.

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

  OKLI kernel loader is required because the OEM software
  expects the kernel to be no greater than 1536k
  and the factory.bin 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`.
  Therefore the PLL registers for GMAC0
  do not need the bits for 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>
2021-01-23 12:53:22 +01:00
Adrian Schmutzler
f52081bcf9 treewide: provide global default for SUPPORTED_DEVICES
The majority of our targets provide a default value for the variable
SUPPORTED_DEVICES, which is used in images to check against the
compatible on a running device:

  SUPPORTED_DEVICES := $(subst _,$(comma),$(1))

At the moment, this is implemented in the Device/Default block of
the individual targets or even subtargets. However, since we
standardized device names and compatible in the recent past, almost
all targets are following the same scheme now:

  device/image name:  vendor_model
  compatible:         vendor,model

The equal redundant definitions are a symptom of this process.

Consequently, this patch moves the definition to image.mk making it
a global default. For the few targets not using the scheme above,
SUPPORTED_DEVICES will be defined to a different value in
Device/Default anyway, overwriting the default. In other words:
This change is supposed to be cosmetic.

This can be used as a global measure to get the current compatible
with: $(firstword $(SUPPORTED_DEVICES))
(Though this is not precisely an achievement of this commit.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-23 12:45:21 +01:00
Bjørn Mork
402408b368 kernel: mtdsplit_uimage: replace "edimax, uimage" parser
The "edimax,uimage"" parser can be replaced by the generic
parser using device specific openwrt,partition-magic and
openwrt,offset properties.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
3f36dffbde kernel: mtdsplit_uimage: add "openwrt, offset" and "openwrt, partition-magic"
Some devices prepend a standard U-Boot Image with a vendor specific
header, having its own magic. Adding two new properties will support
validation of such images, including the additional magic.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
ff7709d223 kernel: mtdsplit_uimage: replace "netgear, uimage" parser
The "netgear,uimage" parser can be replaced by the generic
parser using device specific openwrt,ih-magic and
openwrt,ih-type properties.

Device tree properties for the following devices have not
been set, as they have been dropped from OpenWrt with the
removal of the ar71xx target:

 FW_MAGIC_WNR2000V1     0x32303031
 FW_MAGIC_WNR2000V4     0x32303034
 FW_MAGIC_WNR1000V2_VC  0x31303030
 FW_MAGIC_WPN824N       0x31313030

Tested-by: Sander Vanheule <sander@svanheule.net>  # WNDR3700v2
Tested-by: Stijn Segers <foss@volatilesystems.org> # WNDR3700v1
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
de64d4b958 kernel: mtdsplit_uimage: add "openwrt, ih-type" device-tree property
Some devices use uimage headers with a non-default ih_type. Add
support for overriding this in device tree.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
647fdafcc5 kernel: mtdsplit_uimage: replace "allnet, uimage" parser
Convert users to the generic "openwrt,uimage" using device specific
"openwrt,ih-magic" properties, and remove "allnet,uimage".

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
01a1e21863 kernel: mtdsplit_uimage: replace "openwrt, okli" parser
The only difference between the "openwrt,okli" and the generic
parser is the magic.  Set this in device tree for all affected
devices and  remove the "openwrt,okli" parser.

Tested-by: Michael Pratt <mcpratt@protonmail.com> # EAP300 v2, ENS202EXT and ENH202
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
ed39f7ec1a kernel: mtdsplit_uimage: add "openwrt, ih-magic" device-tree property
Many devices use uimages with non-standard magic values. Let
device tree override the default magic.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
5ab5bacda2 kernel: mtdsplit_uimage: replace "fonfxc" and "sge" parsers
Convert users of the "fonfxc" and "sge" parsers to the generic
"openwrt,uimage", using device specific "openwrt,padding" properties.

Tested-by: Stijn Segers <foss@volatilesystems.org> [DIR-878 A1]
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
76ea7a91cf kernel: mtdsplit_uimage: read extralen from device tree
An "openwrt,padding" property in device tree can replace two device
specific parsers.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Bjørn Mork
dd5ac0546c dt-bindings: mtd: partitions: add OpenWrt defined U-Boot Image
Add devicetree bindings for vendor specific variants of U-Boot
Images, as defined by OpenWrt.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-01-22 21:03:11 +01:00
Rafał Miłecki
20b4f77bb6 kernel: add parser finding rootfs after CFE bootfs
It's required for BCM4908. It cannot use "bcm-wfi-fw" parser because
that one requires *two* JFFS2 partitions which is untested / unsupported
on the BCM4908 architecture. With a single JFFS2 partition "bcm-wfi-fw"
parser will:
1. Fail to find "vmlinux.lz" as it doesn't follow "1-openwrt" file
2. Create partitions that don't precisely match bootfs layout

The new parser is described in details in the MTD_SPLIT_CFE_BOOTFS
symbol help message.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-22 20:14:39 +01:00
Rafał Miłecki
6ba3a0e889 bcm4908: build valid Asus GT-AC5300 firmware image
Insert Asus specific tail that is required for image identification.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-22 20:11:24 +01:00
Sieng Piaw Liew
1d6f422e34 bcm63xx: sync ethernet driver with net-next
Sync ethernet driver code with upstream Linux kernel:
-Reduce xmit_more code changes.
-Combine rx cleanup code into a function.
-Convert to build_skb.
-Improve rx loop by optimizing loop tracking.

https://lore.kernel.org/netdev/20210106144208.1935-1-liew.s.piaw@gmail.com/
Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
[Amend commit description, move patches to the top since they are going to be
upstreamed]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-01-22 12:42:30 +01:00
Álvaro Fernández Rojas
2d8422842c bcm63xx: nand: fix OOB R/W for non Hamming ECC
Hamming ECC devices do not cover OOB data, as opposed to BCH ECC devices.
Therefore, disabling ECC for all devices is preventing BCH devices from
correctly reading and writing the OOB data.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-01-22 11:36:49 +01:00
Adrian Schmutzler
b3eccbca7c ramips: fix port labels for Xiaomi Mi Router 4
The OEM assignment of LAN ports is swapped.

Fixes: c2a7bb520a ("ramips: mt7621: add support for Xiaomi Mi Router 4")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-21 22:56:43 +01:00
Dmytro Oz
c2a7bb520a ramips: mt7621: add support for Xiaomi Mi Router 4
Xiaomi Mi Router 4 is the same as Xiaomi Mi Router 3G, except for
the RAM (256Mib→128Mib), LEDs and gpio (MiNet button).

Specifications:

Power: 12 VDC, 1 A
Connector type: barrel
CPU1: MediaTek MT7621A (880 MHz, 4 cores)
FLA1: 128 MiB (ESMT F59L1G81MA)
RAM1: 128 MiB (ESMT M15T1G1664A)
WI1 chip1: MediaTek MT7603EN
WI1 802dot11 protocols: bgn
WI1 MIMO config: 2x2:2
WI1 antenna connector: U.FL
WI2 chip1: MediaTek MT7612EN
WI2 802dot11 protocols: an+ac
WI2 MIMO config: 2x2:2
WI2 antenna connector: U.FL
ETH chip1: MediaTek MT7621A
Switch: MediaTek MT7621A

UART Serial
[o] TX
[o] GND
[o] RX
[ ] VCC - Do not connect it

MAC addresses as verified by OEM firmware:

use   address   source
LAN   *:c2      factory 0xe000 (label)
WAN   *:c3      factory 0xe006
2g    *:c4      factory 0x0000
5g    *:c5      factory 0x8000

Flashing instructions:

1.Create a simple http server (nginx etc)
2.set uart enable
To enable writing to the console, you must reset to factory settings
Then you see uboot boot, press the keyboard 4 button (enter uboot command line)
If it is not successful, repeat the above operation of restoring the factory settings.
After entering the uboot command line, type:

setenv uart_en 1
saveenv
boot

3.use shell in uart
cd /tmp
wget http://"your_computer_ip:80"/openwrt-ramips-mt7621-xiaomi_mir4-squashfs-kernel1.bin
wget http://"your_computer_ip:80"/openwrt-ramips-mt7621-xiaomi_mir4-squashfs-rootfs0.bin
mtd write openwrt-ramips-mt7621-xiaomi_mir4-squashfs-kernel1.bin kernel1
mtd write openwrt-ramips-mt7621-xiaomi_mir4-squashfs-rootfs0.bin rootfs0
nvram set flag_try_sys1_failed=1
nvram commit
reboot
4.login to the router http://192.168.1.1/

Installation via Software exploit
Find the instructions in the https://github.com/acecilia/OpenWRTInvasion

Signed-off-by: Dmytro Oz <sequentiality@gmail.com>
[commit message facelift, rebase onto shared DTSI/common device
definition, bump uboot-envtools]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-21 22:53:19 +01:00
Adrian Schmutzler
93be5926a2 ramips: mt7621: create DTSI for Xiaomi NAND devices
This creates a DTSI for Xiaomi devices with 128M NAND.

This allows to consolidate the partitions and a few other nodes for
AC2100 family and Mi Router 3G.

Note that the Mi Router 3 Pro has 256M NAND and differently sized
partitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-21 22:52:02 +01:00
Adrian Schmutzler
5a46b71826 ramips: mt7621: reorganize shared device definitions for Xiaomi
This creates a shared device definition for Xiaomi devices with
NAND and "separate" images, i.e. kernel1.bin and rootfs0.bin.

This allows to consolidate similar/duplicate code for AC2100 family
and Mi Router 3G.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-21 22:52:02 +01:00
Robert Marko
36347d003a ipq40xx: fix boards being shown twice
Since generic images have been split to their own
Makefile boards are showing up twice in menuconfig
as $(eval $(call BuildImage)) was not dropped from
the new generic.mk.

Hence $(eval $(call BuildImage)) was being called
twice.

So, lets simply drop it from generic.mk.

Fixes: 378c7ff282 ("ipq40xx: split generic images into own file")

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2021-01-21 17:08:16 +01:00
Rafał Miłecki
3bd8f660a4 bcm4908: workaround NAND controller #WP issue
There seems to be a problem with setting #WP. On the other hand ignoring
the #WP seems to work. rootfs_data UBI volume seems to persist changes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-21 13:30:20 +01:00
Rafał Miłecki
e78d3e44dd bcm4908: append UBI with rootfs to device images
Also enable UBI kernel support.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-21 13:25:34 +01:00
Rafał Miłecki
4e1e18af65 bcm4908: build flashable & bootable firmware images
BCM4908 bootloader requires firmware with JFFS2 image containing:
1. cferam.000
2. 94908.dtb
3. vmlinux.lz
4. device custom files

cferam.000 can be obtained from the bcm63xx-cfe repository.
device custom files are stored in images dir.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-21 13:18:42 +01:00
Rafał Miłecki
095ed5e8e1 bcm4908: set console in the CONFIG_CMDLINE
procd doesn't work with just serial specified in the DT (using chosen &
stdout-path). It requires tty device to be explicitly specified in the
cmdline.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-21 09:18:31 +01:00
Rafał Miłecki
e6fb4d08a1 bcm4908: add DTS patches for USB PHY and partitions
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-20 22:00:22 +01:00
Rafał Miłecki
bc3dbd68c4 bcm4908: use backported brcmstb soc stubs patch
Final version differs slightly - uses IS_ENABLED()

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-20 22:00:18 +01:00
Rafał Miłecki
707ad89f06 bcm4908: use backported switch & PMB DTS patches
Final versions differ slightly from what was used initially.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-20 22:00:15 +01:00
Rafał Miłecki
20a0d435d8 bcm4908: add pending mtd patches for BCM4908 partitioning
BCM4908 can have multiple firmware partitions. MTD needs to detect which
one is currently used.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-20 07:47:29 +01:00
Rafał Miłecki
7495acb555 kernel: backport mtd commit converting partitions doc syntax
1. It's useful for developing & validating DTS files inside OpenWrt
2. This will allow backporting later changes that depend on it

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-20 07:47:23 +01:00
John Audia
1bd005ea53 kernel: bump 5.4 to 5.4.91
All modification made by update_kernel.sh in a fresh clone without
existing toolchains.

Build system: x86_64
Build-tested: ipq806x/R7800, bcm27xx/bcm2711
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Curtis Deptuck <curtdept@me.com> [x86/64]
2021-01-20 01:57:05 +01:00
Sven Eckelmann
0988e03f0e ath79: Add support for OpenMesh MR1750 v2
Device specifications:
======================

* Qualcomm/Atheros QCA9558 ver 1 rev 0
* 720/600/240 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 3T3R 2.4 GHz Wi-Fi (11n)
* 3T3R 5 GHz Wi-Fi (11ac)
* 6x GPIO-LEDs (2x wifi, 2x status, 1x lan, 1x power)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default))
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 1x ethernet
  - AR8035 ethernet PHY (RGMII)
  - 10/100/1000 Mbps Ethernet
  - 802.3af POE
  - used as LAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[rebase, add LED migration]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 21:41:26 +01:00
Sven Eckelmann
ae7680dc4b ath79: Add support for OpenMesh MR1750 v1
Device specifications:
======================

* Qualcomm/Atheros QCA9558 ver 1 rev 0
* 720/600/240 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 3T3R 2.4 GHz Wi-Fi (11n)
* 3T3R 5 GHz Wi-Fi (11ac)
* 6x GPIO-LEDs (2x wifi, 2x status, 1x lan, 1x power)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default))
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 1x ethernet
  - AR8035 ethernet PHY (RGMII)
  - 10/100/1000 Mbps Ethernet
  - 802.3af POE
  - used as LAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[rebase, apply shared DTSI/device node, add LED migration]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 21:41:26 +01:00
Adrian Schmutzler
847cda16eb ath79: make OpenMesh MR900 DTSI more general
The OpenMesh MR900 and to-be-added MR1750 family are very similar.
Make the existing MR900 DTSI more general so it can be used for
the MR1750 devices as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 21:41:25 +01:00
Adrian Schmutzler
bcb311497d ath79: consolidate common definitions for OpenMesh devices
The shared image definitions for OpenMesh devices are currently
organized based on device families. This introduces some duplicate
code, as the image creation code is mostly the same for those.

This patch thus derives two basic shared definitions that work for
all devices and only requires a few variables to be moved back to
the device definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 21:41:25 +01:00
Sven Eckelmann
4fbdadc0bf ath79: apply Engenius ECB1750 style to OpenMesh MR900 RGMII cfg
The OpenMesh MR900 is a modified version of the Exx900/Exx1750 family.
These devices are shipped with an AR803x PHY and had various problems with
the delay configuration in ar71xx. These problems are now in the past [1]
and parts of the delay configuration should now be done in the PHY only.

Just switch to the configuration of the ECB1750 to have an already well
tested configuration for ath79 with the newer kernel versions.

[1] https://github.com/openwrt/openwrt/pull/3505#issuecomment-716050292

Reported-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-01-19 15:39:36 +01:00
Sven Eckelmann
31172e53f9 ath79: Add support for OpenMesh MR900 v2
Device specifications:
======================

* Qualcomm/Atheros QCA9558 ver 1 rev 0
* 720/600/240 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 3T3R 2.4 GHz Wi-Fi
* 3T3R 5 GHz Wi-Fi
* 6x GPIO-LEDs (2x wifi, 2x status, 1x lan, 1x power)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default))
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 1x ethernet
  - AR8035 ethernet PHY (RGMII)
  - 10/100/1000 Mbps Ethernet
  - 802.3af POE
  - used as LAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[rebase, add LED migration]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 15:39:36 +01:00
Sven Eckelmann
e06c9eec5d ath79: Add support for OpenMesh MR900 v1
Device specifications:
======================

* Qualcomm/Atheros QCA9558 ver 1 rev 0
* 720/600/240 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 3T3R 2.4 GHz Wi-Fi
* 3T3R 5 GHz Wi-Fi
* 6x GPIO-LEDs (2x wifi, 2x status, 1x lan, 1x power)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default))
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 1x ethernet
  - AR8035 ethernet PHY (RGMII)
  - 10/100/1000 Mbps Ethernet
  - 802.3af POE
  - used as LAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[rebase, add LED migration]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 15:39:36 +01:00
Sven Eckelmann
7b772e07ea ath79: apply Engenius EAP600 style to OpenMesh MR600 RGMII cfg
The OpenMesh MR600 is a modified version of the EAP600 family. These
devices are shipped with an AR803x PHY and had various problems with the
delay configuration in ar71xx. These problems are now in the past [1] and
parts of the delay configuration should now be done in the PHY only.

Just switch to the configuration of the EAP600 to have an already well
tested configuration for ath79 with the newer kernel versions.

[1] https://github.com/openwrt/openwrt/pull/3505#issuecomment-716050292

Reported-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-01-19 15:39:36 +01:00
Sven Eckelmann
d9a3af46d8 ath79: Add support for OpenMesh MR600 v2
Device specifications:
======================

* Qualcomm/Atheros AR9344 rev 2
* 560/450/225 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 2T2R 2.4 GHz Wi-Fi
* 2T2R 5 GHz Wi-Fi
* 8x GPIO-LEDs (6x wifi, 1x wps, 1x power)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default))
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 1x ethernet
  - AR8035 ethernet PHY (RGMII)
  - 10/100/1000 Mbps Ethernet
  - 802.3af POE
  - used as LAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[rebase, add LED migration]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 15:39:36 +01:00
Sven Eckelmann
4b35999588 ath79: Add support for OpenMesh MR600 v1
Device specifications:
======================

* Qualcomm/Atheros AR9344 rev 2
* 560/450/225 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 2T2R 2.4 GHz Wi-Fi
* 2T2R 5 GHz Wi-Fi
* 4x GPIO-LEDs (2x wifi, 1x wps, 1x power)
* 1x GPIO-button (reset)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 1x ethernet
  - AR8035 ethernet PHY (RGMII)
  - 10/100/1000 Mbps Ethernet
  - 802.3af POE
  - used as LAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[rebase, make WLAN LEDs consistent, add LED migration]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-19 15:39:36 +01:00
John Audia
38bdff29aa kernel: bump 5.4 to 5.4.90
All modification made by update_kernel.sh in a fresh clone without
existing toolchains.

Build system: x86_64
Build-tested: ipq806x/R7800, bcm27xx/bcm2711
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Curtis Deptuck <curtdept@me.com> [x86/64]
2021-01-19 15:39:36 +01:00
David Bauer
99f50a7535 ath79: rename UniFi AC kernel1 partition
These devices do not run Ubiquiti AirOS. Rename the partition to the
name used by other UniFi devices with vendor dualboot support.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-01-18 17:33:00 +01:00
David Bauer
a8a17fd223 rockchip: use stable MAC-address for NanoPi R2S
The NanoPi R2S does not have a board specific MAC address written inside
e.g. an EEPROM, hence why it is randomly generated on first boot.

The issue with that however is the lack of a driver for the PRNG.
It often results to the same MAC address used on multiple boards by
default, as urngd is not active at this early stage resulting in low
available entropy.

There is however a semi-unique identifier available to us, which is the
CID of the used SD card. It is unique to each SD card, hence we can use
it to generate the MAC address used for LAN and WAN.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-01-18 17:32:52 +01:00
Robert Marko
f4fdd8609c
ipq40xx: mikrotik: enable MikroTik platform driver
This enables the MikroTik platform driver, it enables us to parse
valuable info from hard_config including WLAN calibration data
extraction from sysfs.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2021-01-17 14:31:56 +01:00
Robert Marko
0184889088 ipq40xx: mikrotik: enable MikroTik NOR parser
Needed for SPI-NOR based MikroTik IPQ40xx devices like hAP ac2.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2021-01-17 14:23:05 +01:00
Robert Marko
30a92f55de ipq40xx: mikrotik: enable CONFIG_MTD_ROUTERBOOT_PARTS
This enables the new MikroTik specific partition parser.

This avoids manually specifying the MikroTik specific partitions as they
can be detected by their magic values.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2021-01-17 14:23:05 +01:00
Robert Marko
b779da27ef ipq40xx: add MikroTik subtarget
MikroTik devices require the use of raw vmlinux out of the self
extracting compressed kernels.

They also require 4K sectors, kernel2minor, partition parser as well as
RouterBoard platform drivers.

So in order to not add unnecessary code to the generic sub target lets
introduce a MikroTik sub target.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2021-01-17 14:23:05 +01:00
John Thomson
10d057f84a ipq40xx: kernel compressed boot: reset watchdog countdown
If the watchdog is enabled, set the timeout to 30 seconds before
decompress is started.

Mikrotik ipq40xx devices running with RouterBoot have the SoC watchdog
enabled and running with a timeout that does not allow time for the
kernel to decompress and manage the watchdog.

On ipq40xx RouterBoot TFTP boot the watchdog countdown is reset before:
Jumping to kernel

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
2021-01-17 14:23:05 +01:00
Robert Marko
b6461e4654 ipq40xx: arm: compressed: add appended DTB section
This adds a appended_dtb section to the ARM decompressor
linker script.

This allows using the existing ARM zImage appended DTB support for
appending a DTB to the raw ELF kernel.

Its size is set to 1MB max to match the zImage appended DTB size limit.

To use it to pass the DTB to the kernel, objcopy is used:

objcopy --set-section-flags=.appended_dtb=alloc,contents \
	--update-section=.appended_dtb=<target>.dtb vmlinux

This is based off the following patch:
c063e27e02

Signed-off-by: Robert Marko <robimarko@gmail.com>
2021-01-17 14:23:05 +01:00
Alexander Couzens
378c7ff282
ipq40xx: split generic images into own file
In preparation of the new mikrotik subtarget split the generic images
into generic.mk

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-01-17 07:16:23 +01:00
Rui Salvaterra
41b096b448 ramips: mt7621: refresh the kernel config
The removed config symbols are already enabled by the generic kernel
configuration (or by default), while the added ones are forcefully
enabled by the specific architecture.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-01-15 19:12:57 +01:00
Adrian Schmutzler
3bbdc72b53 ath79: remove USB port definition for TP-Link TL-WR810N v1
The USB port definition is only needed when it is linked to a USB
LED. Since there is none for this device, we might as well remove
the port definition.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-15 19:00:15 +01:00
Russell Senior
591a4c9ed3 ath79: Add support for Ubiquiti Bullet AC
CPU:         Atheros AR9342 rev 3 SoC
RAM:         64 MB DDR2
Flash:       16 MB NOR SPI
WLAN 2.4GHz: Atheros AR9342 v3 (ath9k)
WLAN 5.0GHz: QCA988X
Ports:       1x GbE

Flashing procedure is identical to other ubnt devices.
https://openwrt.org/toh/ubiquiti/common

Flashing through factory firmware
1. Ensure firmware version v8.7.0 is installed.
   Up/downgrade to this exact version.
2. Patch fwupdate.real binary using
   `hexdump -Cv /bin/ubntbox | sed 's/14 40 fe 27/00 00 00 00/g' | \
    hexdump -R > /tmp/fwupdate.real`
3. Make the patched fwupdate.real binary executable using
   `chmod +x /tmp/fwupdate.real`
4. Copy the squashfs factory image to /tmp on the device
5. Flash OpenWrt using `/tmp/fwupdate.real -m <squashfs-factory image>`
6. Wait for the device to reboot
(copied from Ubiquiti NanoBeam AC and modified)

Flashing from serial console
1. Connect serial console (115200 baud)
2. Connect ethernet to a network with a TFTP server, through a
   passive PoE injector.
3. Press a key to obtain a u-boot prompt
4. Set your TFTP server's ip address, with:
   setenv serverip <tftp-server-address>
5. Set the Bullet AC's ip address, with:
   setenv ipaddr <bullet-ac-address>
6. Set the boot file, with:
   setenv bootfile <name-of-initramfs-binary-on-tftp-server>
7. Fetch the binary with tftp:
   tftpboot
8. Boot the initramfs binary:
   bootm
9. From the initramfs, fetch the sysupgrade binary, and flash it with
   sysupgrade.

The Bullet AC is identified as a 2WA board by Ubiquiti. As such, the UBNT_TYPE
must match from the "Flashing through factory firmware" install instructions
to work.

Phy0 is QCA988X which can tune either band (2.4 or 5GHz). Phy1 is AR9342,
on which 5GHz is disabled.  It isn't currently known whether phy1 is
routed to the N connector at all.

Signed-off-by: Russell Senior <russell@personaltelco.net>
2021-01-15 18:32:38 +01:00
Sungbo Eo
583e39e3d5 kernel: drop empty kmod-ledtrig-* packages
The following four led triggers are enabled in generic config.

* kmod-ledtrig-default-on
* kmod-ledtrig-heartbeat
* kmod-ledtrig-netdev
* kmod-ledtrig-timer

Drop the packages and remove them from DEVICE_PACKAGES.
There's no other package depending on them in this repo.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-01-15 18:24:31 +01:00
Sungbo Eo
8451f47b1e treewide: do not disable LED triggers in target config
Those targets have already enabled some other LED triggers, so enabling
a few more won't be a big problem.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-01-15 18:22:45 +01:00
Sungbo Eo
22061b2880 kernel: enable CONFIG_LEDS_TRIGGER_HEARTBEAT
The heartbeat trigger is used by luci-mod-system, which is installed
as a part of the standard luci package set. It seems the LED trigger
will be required quite often, so let's enable it by default.

This increases uncompressed kernel size by about 100 bytes on ath79/generic.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-01-15 18:20:55 +01:00
Jan Alexander
05707e6460 ipq806x: fix Ubiquiti UniFi AC HD partition map
This fixes a typo in the previously committed partition map that led to
the extension of the read-only mtd partition "SSD" into the following
partitions.

Fixes: 4e46beb313 ("ipq806x: add support for Ubiquiti UniFi AC HD")

Signed-off-by: Jan Alexander <jan@nalx.net>
2021-01-15 17:34:04 +01:00
John Audia
945a704fab kernel: bump 5.4 to 5.4.89
All modification made by update_kernel.sh in a fresh clone without
existing toolchains.

Build system: x86_64
Build-tested: ipq806x/R7800, bcm27xx/bcm2711
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Curtis Deptuck <curtdept@me.com> [x86/64]
2021-01-15 17:29:41 +01:00
Rafał Miłecki
c40006e0af bcm4908: prepend kernel images with a custom header
It's required for CFE to accept kernel.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-15 07:45:19 +01:00
Rafał Miłecki
6c90999e2e bcm4908: backport brcmstb USB PHY driver changes
This includes BCM4908 support

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-01-14 12:34:20 +01:00