Commit Graph

25301 Commits

Author SHA1 Message Date
Adrian Schmutzler aec97b31ea ramips: provide default BLOCKSIZE for Device/seama
The Device/seama shared definition requires BLOCKSIZE, so it should
have a default value for this variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-30 00:37:47 +02:00
Filip Matijević e2b03c16eb ipq806x: add missing enclosing partitions block for TP-Link C2600
The partitions that have compatible property set are skipped by mtd if
they are not contained inside a partitions node and this breaks
fetching MAC address from "default-mac" partition.

Fix this by defining all the partitions inside partitions node with
compatible = "fixed-partitions" as nvmem requires the standard
partitions scheme to work correctly.

Fixes: FS#3945
Fixes: cd36d71655 ("ipq806x/dts: Add Archer C2600 DTS")
Fixes: 0458a8993c ("ipq806x: convert mtd-mac-address to nvmem
implementation")

Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
Reviewed-by: Ansuel Smith <ansuelsmth@gmail.com>
[adjust commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-30 00:37:35 +02:00
Adrian Schmutzler d37125b3f3 ath79: remove redundant BLOCKSIZE of 64k from devices
BLOCKSIZE = 64k is set in Device/Default, i.e. global default on
the target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-30 00:37:35 +02:00
Rafał Miłecki bce00f47e5 bcm53xx: backport the latest upstream DT changes
This includes:
1. BCM5301X changes from 5.14 and queued 5.15 stuff
2. NSP changes from 5.11 - 5.15 for kernel 5.10

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-29 22:57:13 +02:00
Rui Salvaterra 505b7a2d08 kernel: move two symbols to the generic kconfigs
CONFIG_RCU_{NEED_SEGCBLIST,STALL_COMMON} are set basically everywhere. Move them
to the generic kconfigs. And resort the generic kconfigs while at it.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-29 17:07:19 +02:00
Rui Salvaterra 7e135add24 kernel: disable CONFIG_RCU_EXPERT and friends
Based on the existing documentation [1][2], I dare anyone to demonstrate that
we need to fine-tune these RCU parameters. The (performance) breakage potential
for doing so is immense, so let's just please put down this loaded footgun.

Disable CONFIG_RCU_EXPERT and its dependent symbols. Additionally, remove the
CONFIG_RCU_EXPERT symbol from the target kconfigs which contain it.

[1] https://www.kernel.org/doc/Documentation/RCU/Design/Data-Structures/Data-Structures.html
[2] https://lwn.net/Articles/777214/

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-29 17:03:38 +02:00
Ansuel Smith b8f8d0651c kernel: fix warning about unused try_to_force_load
There is a longlasting warn about unused defined try_to_force_load.
Fix this by including this function only when actually used.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-08-29 16:31:24 +02:00
John Audia be7e0091fe kernel: bump 5.4 to 5.4.143
Manually rebased:
  bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch

Removed upstreamed:
  mvebu/patches-5.4/100-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-29 16:31:02 +02:00
John Audia 6b1cd3e345 kernel: bump 5.10 to 5.10.61
Manually rebased:
  bcm27xx/patches-5.10/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch

Removed upstreamed:
  mvebu/patches-5.10/101-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch

All other patches automatically rebased.

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

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-29 16:30:20 +02:00
Sebastian Schaper 1c8214d6f2 ath79: fix spelling of DEVICE_MODEL for D-Link DAP-2695
Change `DAP-2965` to `DAP-2695` for device selection in menuconfig.

Fixes: cd09f26660 ("ath79: add support for D-Link DAP-2695-A1")

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
[add Fixes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-28 13:24:23 +02:00
David Bauer 90e167abaa ramips: add label-mac for TL-MR3020 v3
The TP-Link TL-MR3020 v3 only has a single MAC address assigned for
ethernet LAN as well as WiFi. This MAC address is also printed on the
casing.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-28 01:35:02 +02:00
David Bauer 9c965893ed ramips: enable fast-read for TL-MR3020 v3
The GigaDevices GD25Q64B found on the TL-MR3020 v3 supports the fast
read instruction. Add the required DT property in order to enable usage
of this property.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-28 01:31:45 +02:00
David Bauer db3545cd02 ramips: increase SPI frequency for TL-MR3020 v3
The GigaDevices GD25Q64B supports higher SPI clocks than 10 MHz. While
100 MHz do not work reliably, 50 MHz works without issues.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-28 01:31:36 +02:00
David Bauer 161ee85bbe ramips: fix input type for TL-MR3020 v3
The modec{1,2} keys are actually switches.

Add the respective DTS properties to avoid accidental activation of
failsafe mode.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-28 01:31:29 +02:00
Daniel Golle cf40141b51
kernel: properly handle paging errors in fit partition parser
The uImage.FIT partition uses page mapping without properly handling
paging errors. This can lead to Kernel Oops in case of read errors
while trying to parse uImage.FIT partitions.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-27 21:32:43 +01:00
Chuanhong Guo 97e32e9702 mediatek: mt7623: replace kconfig symbol for snand driver
this change was missing during the spi-nand driver replacement, causing
build failure.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 22:22:29 +08:00
Chuanhong Guo 472437b93f mediatek: mt7629: manually add missing kconfig
These options doesn't show up unless some kernel packages are selected,
so they are not covered by kernel_menuconfig.
Manually add them so that a build with all kmods can pass without user
interaction.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 15:54:53 +08:00
Chuanhong Guo 8f2cace0b7 mediatek: mt7629: build with linux 5.10
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 10:26:25 +08:00
Chuanhong Guo 9abd2fb6c4 mediatek: bmt: set default bmt oob offset to 0
there's no driver level remapping of oob data in the new spi-nand
driver and bmt oob signature starts at 0x0 of the dumped oob data.
change the default value to 0 for the new spi-nand driver.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 10:26:25 +08:00
Chuanhong Guo 388127abd1 mediatek: mtk-snand: check request size against chip info
mtd->size will be overrided by BMT which makes all mtd requests made by
bmt fail in request size checking.
this commit changes the driver to check against actual chip size in chip
info as a workaround.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 10:26:25 +08:00
Chuanhong Guo b600aee3ed mediatek: attach bmt to the new snand driver
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 10:26:25 +08:00
Chuanhong Guo 01b452fe2d mediatek: change dts to use the new snand driver
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 10:26:25 +08:00
Chuanhong Guo c6ed31630d mediatek: remove spi-nand hacks from 5.10
we now have a standalone mtd driver and the old spi-mem driver along
with the hack in spi-nand core can be removed.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 10:26:25 +08:00
Weijie Gao e8e8487603 mediatek: enable new spi-nand driver for kernel 5.10
This patch enables new spi-nand driver for mt7622 and mt7629.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2021-08-27 10:26:25 +08:00
Weijie Gao 050621aa01 mediatek: add a new spi-nand driver for kernel 5.10
This patch adds a new spi-nand driver which implements the SNFI of mt7622
and mt7629.

Unlike the existing snfi driver which makes use of the spi-mem framework
and the spi-nand framework with modified ecc support, this driver is
implemented directly on the mtd framework with other components untouched,
and provides better performance, and behaves exactly the same as the nand
framework.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
2021-08-27 10:26:24 +08:00
Christian Lamparter a1bd8109f0 ath79: remove obsolete pci-ath9k-fixup.[c,h] files
This was old code from the AR71XXs target days that
doesn't get compiled and used anymore.

Bringing up AR92xx and earlier chips from their
OWL-Emulator state is currently done by the upstream
ath9k-pci-owl-loader module. (see the kmod-owl-loader
package).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-08-26 21:00:26 +02:00
Jan-Niklas Burfeind d98738b5c1 ath79: add support for onion omega
The Onion Omega is a hardware development platform with built-in WiFi.

https://onioniot.github.io/wiki/

Specifications:
 - QCA9331 @ 400 MHz (MIPS 24Kc Big-Endian Processor)
 - 64MB of DDR2 RAM running at 400 MHz
 - 16MB of on-board flash storage
 - Support for USB 2.0
 - Support for Ethernet at 100 Mbps
 - 802.11b/g/n WiFi at 150 Mbps
 - 18 digital GPIOs
 - A single Serial UART
 - Support for SPI
 - Support for I2S

Flash instructions:
The device is running OpenWrt upon release using the ar71xx target.
Both a sysupgrade
and uploading the factory image using u-boots web-UI do work fine.

Depending on the ssh client, it might be necessary to enable outdated
KeyExchange methods e.g. in the clients ssh-config:

Host 192.168.1.1
        KexAlgorithms +diffie-hellman-group1-sha1

The stock credentials are: root onioneer

For u-boots web-UI manually configure `192.168.1.2/24` on your computer,
connect to `192.168.1.1`.

MAC addresses as verified by OEM firmware:
2G       phy0      label
LAN      eth0      label - 1

LAN is only available in combination with an optional expansion dock.

Based on vendor acked commit:
commit 5cd49bb067 ("ar71xx: add support for Onion Omega")

Partly reverts:
commit fc553c7e4c ("ath79: drop unused/incomplete dts")

Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2021-08-26 15:07:18 +02:00
Álvaro Fernández Rojas 4ab0b5fabd bmips: backport accepted watchdog patch
This patch has been accepted for linux v5.14.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-08-25 10:24:33 +02:00
David Yang 38cb500516 ramips: expose ephy leds for miwifi-mini
Give users more control by exposing ephy leds.

Signed-off-by: David Yang <mmyangfl@gmail.com>
[remove execute bit on 01_leds, add status for gpio2]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-25 01:42:17 +02:00
David Yang 5ed11012e7 ramips: lock u-boot partition and unlock u-boot-env for miwifi-mini
Generally u-boot should keep read-only to avoid mis-overwriting and
bricking the device, but u-boot-env could be safely modified with u-boot
setenv tool.

Signed-off-by: David Yang <mmyangfl@gmail.com>
2021-08-25 01:42:17 +02:00
David Yang a6c410ae10 ramips: increase flash freq for miwifi-mini
The flash is Winbond 25Q128. As it has large rom, better to increase flash
frequency to 70MHz according to the flash spec and enable fast-read.

Signed-off-by: David Yang <mmyangfl@gmail.com>
2021-08-25 01:42:17 +02:00
Giovanni Cascione d57ba86e48 ramips: add support for D-Link DAP-1325-A1
This patch adds support for D-Link DAP-1325-A1 (Range Extender Wi-Fi N300)

Specifications:
- SoC: 580Mhz MT7628NN
- RAM: 64MB, DDR2 SDRAM
- Storage: 8MB, SPI (W25Q64JVSSIQ)
- Ethernet: 1x 10/100 LAN port
- WIFI: 2.4 GHz 802.11bgn
- LED: Status (2x to provide 3 colors), Wi-Fi Signal Strength (4x)
- Buttons: Reset, WPS
- UART: Serial console (57600, 8n1)
Row of 4 holes near LAN port, starting from square hole:
3.3V, TX,RX,GND
- FCC ID: fccid.io/KA2AP1325A1/

Installation:

Failsafe UI
Firmware can be uploaded with Failsafe UI web page:
- turn device off
- press and hold reset button
- turn device on
- keep holding reset until red wifi strength led turns on (ab. 10sec)
- connect to device through LAN port
PC must be configured with static ip (192.168.0.x)
- connect to 192.168.0.50
- select image to be flashed and upload.
Device will reboot after successful update

Serial port/TFTP server
- Connect through serial connectors on PCB (e.g. with teraterm)
- Set up a TFTP server, and connect through LAN with static IP
- Put image file in the root of the server
- Boot the device and select '2' at U-Boot startup
- Set device IP, server IP and image file name
- Start upload and flash

Signed-off-by: Giovanni Cascione <ing.cascione@gmail.com>
[fix whitespaces in DTS, convert to nvmem, add mtd-eeprom]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-25 01:42:17 +02:00
Romain Mahoux e2d08084c3 ath79: add support for Compex WPJ558 (16M)
Specifications:
- SoC: QCA9558
- DRAM: 128MB DDR2
- Flash: 16MB SPI-NOR
- Wireless: on-board abgn 2×2 2.4GHz radio
- Ethernet: 2x 10/100/1000 Mbps (1x 802.11af PoE)
- miniPCIe slot

Flash instruction:
- From u-boot

tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj558-16m-squashfs-sysupgrade.bin
erase 0x9f030000 +$filesize
cp.b $fileaddr 0x9f030000 $filesize
boot

- From cpximg loader

The cpximg loader can be started either by holding the reset button
during power up. Once it's running, a TFTP-server under 192.168.1.1 will accept
the image appropriate for the board revision that is etched on the board.

For example, if the board is labelled '6A07':

tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj558-16m-squashfs-cpximg-6a07.bin

Signed-off-by: Romain Mahoux <romain@mahoux.fr>
[convert to nvmem, remove redundant lan_mac in 02_network]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-25 01:42:17 +02:00
Chukun Pan 269758a5bc ipq806x: Askey RT4230W REV6: use usual writing for pcie part
The problem has been fixed in f47cb405ca ("ipq806x: fix pci broken
on bootm command"), now the pcie part can be written in the usual way.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Reviewed-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-08-25 01:42:16 +02:00
Shiji Yang a73a8269e1 ramips: add support for DomyWifi DM202/DM203/DW22D
Specifications:
* SOC: MT7620A + MT7610E
* ROM: 16 MiB spi flash (W25Q128FVSG)
* RAM: 128 MiB DDR2 (W971GG6KB-25)
* WAN: 10/100M *1
* LAN: 10/100M *4
* USB: Type-A USB2.0 *1
* SD: MicroSD *1
* Button: Reset *1
* Antennas: 2.4 GHz *2 + 5 GHz *1
* TTL Baudrate: 57600
* U-Boot Recovery: IP: 10.10.10.123, Server: 10.10.10.3

Installation:
* Web UI Update
  1. Open http://192.168.10.1/upgrade.html in the browser.
  2. Rename firmware to a short name like firmware.bin and then upload it.
  3. Fill in the password column with the following content:
  password | mtd -x mIp2osnRG3qZGdIlQPh1 -r write /tmp/firmware.bin firmware
* TFTP + U-Boot
  1. Connect device with a TTL cable.
  2. Press "2" when booting to select "Load system code then write to Flash via TFTP".
  3. Upload firmware by tftpd64, it will boot when write instruction is executed.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2021-08-25 01:42:16 +02:00
Shiji Yang 09143282bd ramips: add support for Motorola MWR03
Specifications:
* SOC: MT7628AN + MT7612E
* ROM: 8 MiB Flash
* RAM: 64 MiB DDR2
* WAN: 10/100M *1
* LAN: 10/100M *3
* Button: Reset *1
* LEDs: orange *1, white *1
* Antennas: 2.4 GHz *2 + 5 GHz *2
* TTL Baudrate: 57600
* TFTP Upgrade: IP: 192.168.51.1, Server: 192.168.51.100

MAC addresses as verified by OEM firmware:

use   address   source
2g    *:d8      factory 0x0004 (label)
5g    *:d9      factory 0x8004
LAN   *:d7      factory $label -1
WAN   *:da      factory $label +2

Installation (TFTP + U-Boot):
 * Connect device with a TTL cable and open a serial session by
   PuTTY.
 * Press "2" when booting to select "Load system code then write
   to Flash via TFTP".
 * Configure the IP of local host server.
 * Upload firmware by tftpd64, it will boot when write instruction
   is executed.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[fix DTS line endings, fix label MAC address, adjust status LED
 names, convert mtd-mac-address-increment to mac-address-increment]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-25 01:41:35 +02:00
Chukun Pan fcc075e12f ipq806x: Askey RT4230W REV6: fix caldata script
The partition name in the device dts is '0:ART'.
Be independent to prevent this part from becoming
incorrect once the kernel v5.4 gone.

Fixes: da8428d277 ("ipq806x: add support for Askey RT4230W REV6")

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2021-08-24 20:26:00 +02:00
Shiji Yang 80e70be0ab ramips: add new flash layout support to Phicomm K2
Descriptions:
Phicomm K2 (PSG1218) got a new "permanent_config" partition after
update firmware to v22.5. This partition located in front of the
firmware partition, same as The Phicomm K2P and K2G. Due to this
change the new bootloader can't load previous firmware any more.
This commit is aimed at add support for Phicomm K2 which official
firmware version is 22.5.x or newer. For which runs old firmware
version, just update OpenWrt that has a prefix of "k2-v22.4".
For uniform naming, this commit also changed the model name
PSG1218 to a more recognizable name K2, refer to Phicomm K2G,
K2P K2T.

OpenWrt selection table:
official firmware version           OpenWrt
v22.4.x.x or older              phicomm_k2-v22.4
v22.5.x.x or newer              phicomm_k2-v22.5

Installation:
Same as Phicomm K2G, K2P, PSG1208.
a. TFTP + U-Boot
b. Open telnet by some web page vulnerability (Search Baidu by key
   words "K2 telnet"), and then we can upload firmware image to
   /tmp and write it to firmware partition with mtd instruction.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[rebase, add/harmonize version in model variables, fix version typo
 in commit message, wrap commit message properly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-24 20:26:00 +02:00
Adrian Schmutzler c4143505e0 ramips: mt7620: move Phicomm MAC address setup to DTSI
The setup is the same for all devices, so move it up one level.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-24 20:26:00 +02:00
Zoltan HERPAI 98eb95dd00 ath79: add support for Atheros DB120 reference board
Atheros DB120 reference board.

Specifications:

SoC:    QCA9344
DRAM:   128Mb DDR2
Flash:  8Mb SPI-NOR, 128Mb NAND flash
Switch: 5x 10/100Mbps via AR8229 switch (integrated into SoC),
        5x 10/100/1000Mbps via QCA8237 via RGMII
WLAN:   AR9300 (SoC, 2.4G+5G) + AR9340 (PCIe, 5G-only)
USB:    1x 2.0
UART:   standard QCA UART header
JTAG:   yes
Button: 1x reset
LEDs:   a lot
Slots:  2x mPCIe + 1x mini-PCI, but using them requires
        additional undocumented changes.
Misc:   The board allows to boot off NAND, and there is
        I2S audio support as well - also requiring
        additional undocumented changes.

Installation:

1. Original bootloader

   Connect the board to ethernet
   Set up a server with an IP address of 192.168.1.10
   Make the openwrt-ath79-generic-atheros_db120-squashfs-factory.bin
   available via TFTP

   tftpboot 0x80060000 openwrt-ath79-generic-atheros_db120-squashfs-factory.bin
   erase 0x9f050000 +$filesize
   cp.b $fileaddr 0x9f050000 $filesize

2. pepe2k's u-boot_mod

   Connect the board to ethernet
   Set up a server with an IP address of 192.168.1.10
   Make the openwrt-ath79-generic-atheros_db120-squashfs-factory.bin
   available via TFTP, as "firmware.bin"

   run fw_upg

   Reboot the board.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
[explicit factory recipe in generic.mk, sorting in 10-ath9k-eeprom,
 convert to nvmem, use fwconcat* names in DTS, remove unneeded DT
 labels, remove redundant uart node]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-22 23:02:08 +02:00
Russell Senior 61b49cd3f8 ath79: add support for Ubiquiti PowerBeam M2 (XW)
This patch adds support for the Ubiquiti PowerBeam M2 (XW), e.g. PBE-M2-400,
a 802.11n wireless with a feed+dish form factor. This device was previously
supported by the ar71xx loco-m-xw firmware.

Specifications:
 - Atheros AR9342 SoC
 - 64 MB RAM
 - 8 MB SPI flash
 - 1x 10/100 Mbps Ethernet port, 24 Vdc PoE-in
 - Power and LAN green LEDs
 - 4x RSSI LEDs (red, orange, green, green)
 - UART (115200 8N1)

Flashing via stock GUI:
 - Downgrade to AirOS v5.5.x (latest available is 5.5.10-u2) first (see
   https://openwrt.org/toh/ubiquiti/powerbeam installation instructions)
 - Upload the factory image via AirOS web GUI.

Flashing via TFTP:
 - Use a pointy tool (e.g., unbent paperclip) to keep the
   reset button pressed.
 - Power on the device (keep reset button pressed).
 - Keep pressing until LEDs flash alternatively LED1+LED3 =>
   LED2+LED4 => LED1+LED3, etc.
 - Release reset button.
 - The device starts a TFTP server at 192.168.1.20.
 - Set a static IP on the computer (e.g., 192.168.1.21/24).
 - Upload via tftp the factory image:
    $ tftp 192.168.1.20
    tftp> bin
    tftp> trace
    tftp> put openwrt-ath79-generic-ubnt_powerbeam-m2-xw-squashfs-factory.bin

WARNING: so far, no non-destructive method has been discovered for
opening the enclosure to reach the serial console. Internal photos
are available here: https://fcc.io/SWX-NBM2HP

Signed-off-by: Russell Senior <russell@personaltelco.net>
2021-08-22 22:41:52 +02:00
Russell Senior 96db7d2a73 ath79: rename Ubiquiti PowerBeam M (XW) to PowerBeam M5 (XW)
The commit [1] added support for Ubiquiti PowerBeam M (XW), tested
on the PBE-M5-400. But, it turns out the PBE-M2-400 has a different
ethernet configuration, so make the support specific to the m5 version
in anticipation of adding specific support for the m2 in a separate
commit.

[1] 12eb5b2384 ("ath79: add support for Ubiquiti PowerBeam M (XW)")

Signed-off-by: Russell Senior <russell@personaltelco.net>
[fix model name in DTS, format commit reference in commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-22 22:41:41 +02:00
Daniel Golle f4493c647a
mediatek: mt7623: enable clock drivers for Mali-450 and audio
Built clock drivers for G3DSYS and AUDSYS into the kernel to allow
multimedia features (GPU and audio) to work if they exist.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-22 14:34:29 +01:00
Shane Synan 9baca41064 ipq806x: fix min<>target opp-microvolt DTS mixup
Rearrange all voltage triplets for "opp_table0" to match the
specifications.  "opp-microvolt" and "opp-microvolt-<name>" triplets
are in order of <target min max>, and NOT <min target max>.

Previously, the CPU would *always* spend its time at the "minimum"
voltage, ignoring the actual intended target.  This is a regression
from previous behavior.

On an NBG6817 with a Qualcomm CPU of PVS bin #2...
(see &opp_table0 -> opp-1725000000 -> opp-microvolt-speed0-pvs2-v0)

* Before:
/usr/bin/tail -n +1 /sys/kernel/debug/opp/cpu0/opp\:1725000000/supply-0/u_volt_*
==> /sys/kernel/debug/opp/cpu0/opp:1725000000/supply-0/u_volt_max <==
1260000

==> /sys/kernel/debug/opp/cpu0/opp:1725000000/supply-0/u_volt_min <==
1200000

==> /sys/kernel/debug/opp/cpu0/opp:1725000000/supply-0/u_volt_target <==
1140000

* After:
/usr/bin/tail -n +1 /sys/kernel/debug/opp/cpu0/opp\:1725000000/supply-0/u_volt_*
==> /sys/kernel/debug/opp/cpu0/opp:1725000000/supply-0/u_volt_max <==
1260000

==> /sys/kernel/debug/opp/cpu0/opp:1725000000/supply-0/u_volt_min <==
1140000

==> /sys/kernel/debug/opp/cpu0/opp:1725000000/supply-0/u_volt_target <==
1200000

To check voltages and frequencies at run time, use...
/bin/cat /sys/kernel/debug/regulator/regulator_summary &&
  /bin/cat /sys/kernel/debug/clk/clk_summary | grep "hfpll"

See
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/devicetree/bindings/opp/opp.txt?h=v5.4.142#n91

Fixes: 1e25423be8 ("ipq806x: refresh dtsi patches")

Signed-off-by: Shane Synan <digitalcircuit36939@gmail.com>
Reviewed-by: Ansuel Smith <ansuelsmth@gmail.com>
[commit message style cleanup, another kernel refresh]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-21 23:54:31 +02:00
Adrian Schmutzler c23bc5032f ramips: add label MAC address for Onion Omega 2(+)
Thanks to a hint from Michael Siegenthaler in 4b4fa2f9fe ("ramips:
fix ethernet MAC address on Omega2"), the label MAC address of
the Onion Omega 2(+) can be set based on its documentation [1].

[1] https://docs.onion.io/omega2-docs/mac-address.html

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-21 23:42:32 +02:00
Álvaro Fernández Rojas e1142041b0 bcm27xx: switch to kernel 5.10
After testing it on RPi B+ and RPi 4B it seems stable enough to enable it on
OpenWrt master.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-08-21 19:07:07 +02:00
Álvaro Fernández Rojas 8299d1f057 bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted
patches, wireless patches and defconfig patches.

bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 4B v1.1 4G
bcm2711: boot tested on RPi 4B v1.1 4G

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-08-21 19:07:07 +02:00
Álvaro Fernández Rojas 33b6885975 generic: fix debloat dma-buf 5.10 patch
The current patch produces the following error when CONFIG_DMABUF_HEAPS is
enabled:
drivers/built-in.a: member drivers/dma-buf/heaps in archive is not an object

Fixes: b10d604459 ("kernel: add linux 5.10 support")

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-08-21 19:07:06 +02:00
Álvaro Fernández Rojas 41ceec8100 generic: add missing 5.10 config symbols
These symbols are needed for bcm27xx 5.10 kernel support.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-08-21 19:07:06 +02:00
Daniel Golle 4f1c5b01c1
mediatek: mt7623: backport musb, improve HDMI console
Backport support for dual-role USB 2.0 as that's what is actually
built-into MT7623.
Improve HDMI console by enabling VT and setting up tty1..tty6.
Re-add accidentally removed CONFIG_ARM_ARCH_TIMER.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-21 17:23:36 +01:00
Michael Siegenthaler 4b4fa2f9fe ramips: fix ethernet MAC address on Omega2
According to https://docs.onion.io/omega2-docs/mac-address.html, 0x28 is
the correct location to read the address on Onion Omega 2(+) devices.

This fixes a regression introduced by commit 77e850fe76 ("ramips: tidy up
MAC address setup for Linkit Smart and Omega2"), which was a cleanup that
intended to preserve existing behavior. In my testing with v19.07.7,
however, the MAC address determined from the device tree takes precedence
over the one set by 02_network, so the aforementioned commit actually
changed the behavior.

Signed-off-by: Michael Siegenthaler <msiegen@google.com>
[Adapt patch to nvmem usage]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-21 16:30:30 +02:00
John Audia f25cebc43c kernel: bump 5.4 to 5.4.142
Removed upstreamed:
  hack-5.4/991-platform-x86-pcengines-apuv2-revert-simswitch.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-21 15:59:39 +02:00
John Audia 96369a68e7 kernel: bump 5.4 to 5.4.141
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-21 15:59:39 +02:00
Rui Salvaterra 8408e0ff07 kernel: bump 5.10 to 5.10.60
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-21 15:59:39 +02:00
Daniel Golle 0d3f3323a2
mediatek: mt7623: enable more hardware features
In order to make HDMI console available on the BananaPi BPi-R2 select
various Kconfig symbols which are useful for systems with graphics.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-21 04:55:24 +01:00
Hauke Mehrtens c18f91d118 kernel: Do not deactivate staging drivers
Do not deactivate the kernel configuration symbol CONFIG_STAGING in the
target configurations any more. This prevented the build of the exfat.ko
for example.

Fixes: FS#3979
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-21 01:10:17 +02:00
Hauke Mehrtens 469719b4b1 layerscape: Do not activate ext2 and ext3 driver options
The ext3 driver was already removed, the kernel config options are only
there for backwards compatibility. The eth4 driver takes care of ext3
file systems. The ext4 driver also handled ext2 file systems.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-21 00:11:50 +02:00
Hauke Mehrtens 7e757a09ec archs38: Do not activate ext3 driver options
The ext3 driver was already removed, the kernel config options are only
there for backwards compatibility. The eth4 driver takes care of ext3
file systems.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-21 00:11:50 +02:00
Adrian Schmutzler 05ccca031e mediatek: convert mtd-mac-address to nvmem for MT7629 RFB
This conversion appears to have been overlooked since it's in a
kernel patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-20 18:13:55 +02:00
Adrian Schmutzler adb3e46616 lantiq: convert mtd-mac-address to nvmem for Fritz!Box 736x
Convert this series by moving the definitions to the individual
devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-20 18:13:55 +02:00
Adrian Schmutzler 8a78d61299 ramips: convert mtd-mac-address to nvmem for UniElec devices
Convert this series by moving the definitions to the individual
devices.

Now all devices on ramips are converted.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-20 18:13:55 +02:00
Adrian Schmutzler 41aa765946 ath79: remove redundant nvmem definitions
Due to use of a script when migrating from mtd-mac-address, a few
of the definitions are redundant in DTSI and DTS files. Remove
those and consolidate the definitions in parent DTSI files in a
few cases.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-20 18:13:55 +02:00
Adrian Schmutzler f13c7a56f0 ramips: remove redundant nvmem definitions
Due to use of a script when migrating from mtd-mac-address, a few
of the definitions are redundant in DTSI and DTS files. Remove
those.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-20 18:13:50 +02:00
Adrian Schmutzler 9cb5853592 ramips: fix indent in DTS for GL.iNet VIXMINI/microuter-N300
Use correct indent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-20 18:10:48 +02:00
Adrian Schmutzler 7f1b0f68f1 ramips: convert mtd-mac-address to nvmem for D-Link DIR-8xx
Convert this series by moving the definitions to the individual
devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-20 18:10:48 +02:00
Adrian Schmutzler e826b64294 ath79: convert remaining mtd-mac-address cases to nvmem
Since the nvmem-based approach for retrieving MAC addresses
appears to depend on the addresses being set up after the
partitions, it is no longer possible to keep the MAC address
setup in shared DTSI files while the partitions itself are
set up in DTS files for the individual devices.

In ath79 the firmware partition is typically located somewhere
"in the middle" of the partition table. Thus, it's not trivial
to share the partitions containing MAC address information in
a common DTSI (like we did in some cases on ramips).

In this commit, MAC address setup is thus moved to the relevant
partitions, and in most cases needs to be duplicated. While
the duplication is not really nice, it eventually provides a
cleaner and more tidy setup, making the DTS(I) file
fragmentation a bit more logical. This should also help
with adding new devices, as information is distributed across
less locations.

For consistency, this commit also moves the mtd-cal-data property
"down" together with the MAC address setup, so it's not based
on a partition before the latter is defined either. (This is
only done for those files touched due to nvmem conversion.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-18 23:46:02 +02:00
Adrian Schmutzler ba3d92c5a0 ramips: convert most mtd-mac-address cases in DTSI to nvmem
Convert most of the cases from mtd-mac-address to nvmem where
MAC addresses are set in the DTSI, but the partitions are only
located in the device DTS. This posed some problems earlier, since
in these cases we are using partitions before they are defined,
and the nvmem system did not seem to like that.

There have been a few different resolution approaches, based on
the different tradeoffs of deduplication vs. maintainability:

 1. In many cases, the partition tables were identical except for
    the firmware partition size, and the firmware partition was
    the last in the table.
    In these cases, the partition table has been moved to the
    DTSI, and only the firmware partition's "reg" property has
    been kept in the DTS files. So, the updated nvmem definition
    could stay in the DTSI files as well.

 2. For all other cases, splitting up the partition table would
    have introduced additional complexity. Thus, the nodes to be
    converted to nvmem have been moved to the DTS files where the
    partitioning was defined.

 3. For Netgear EX2700 and WN3000RP v3, the remaining DTSI file
    was completely dissolved, as it was quite small and the name
    was not really nice either.

 4. The D-Link DIR-853 A3 was converted to nvmem as well, though
    it is just a plain DTS file not taken care of in the first
    wave.

In addition, some minor rearrangements have been made for tidyness.

Not covered (yet) by this patch are:

 * Various unielec devices
 * The D-Link DIR-8xx family

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-18 23:46:02 +02:00
Stijn Tintel a43da1be43 ipq40xx: fix Edgecore ECW5211 boot
The bootloader will look for a configuration section named ap.dk01.1-c2
in the FIT image. If this doesn't exist, the device won't boot.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-08-18 16:11:11 +03:00
David Yang efca67983d ramips: add WPS button for newifi d1
This device has a WPS button under WiFi antenna cover, add it to dts.

Signed-off-by: David Yang <mmyangfl@gmail.com>
2021-08-17 18:41:17 +02:00
Adrian Schmutzler ad6b077049 ramips: mt7628: move mtd-eeprom out of root DTSI
The mt76x8 subtarget is the only one in ramips that stores the
mediatek,mtd-eeprom property directly in the "root" mt7628an.dtsi.

This is not optimal for a few different reasons:

 * If you don't really know it or are used to other (sub)targets,
   the property will be set somewhat magically.
 * The property is set based on &factory partition before (if at all)
   this partition is defined.
 * There are several devices that have different offset or even
   different partitions to read from, which will then be overwritten
   in the DTS files. Thus, definitions are scattered between root
   DTSI and individual files.

Based on these circumstances, the "root" definition is removed and
the property is added to the device-based DTS(I) files where needed
and applicable. This should be easier to grasp for unexperienced
developers and will move the property closer to the partition
definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-17 18:41:17 +02:00
Rui Salvaterra 9704d25da1 kernel: bump 5.10 to 5.10.59
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-16 20:37:33 +01:00
Daniel Golle 98bccdafd7
base-files: rename 'sdcard' to 'legacy-sdcard'
While an image layout based on MBR and 'bootfs' partition may be easy
to understand for users who are very used to the IBM PC and always have
the option to access the SD card outside of the device (and hence don't
really depend on other recovery methods or dual-boot), in my opinion
it's a dead end for many desirable features on embedded systems,
especially when managed remotely (and hence without an easy option to
access the SD card using another device in case things go wrong, for
example).

Let me explain:

* using a MSDOS/VFAT filesystem to store kernel(s) is problematic, as a
  single corruption of the bootfs can render the system into a state
  that it no longer boots at all. This makes dual-boot useless, or at
  least very tedious to setup with then 2 independent boot partitions
  to avoid the single point of failure on a "hot" block (the FAT index
  of the boot partition, written every time a file is changed in
  bootfs). And well: most targets even store the bootloader environment
  in a file in that very same FAT filesystem, hence it cannot be used
  to script a reliable dual-boot method (as loading the environment
  itself will already fail if the filesystem is corrupted).

* loading the kernel uImage from bootfs and using rootfs inside an
  additional partition means the bootloader can only validate the
  kernel -- if rootfs is broken or corrupted, this can lead to a reboot
  loop, which is often a quite costly thing to happen in terms of
  hardware lifetime.

* imitating MBR-boot behavior with a FAT-formatted bootfs partition
  (like IBM PC in the 80s and 90s) is just one of many choices on
  embedded targets. There are much better options with modern U-Boot
  (which is what we use and build from source for all targets booting
  off SD cards), see examples in mediatek/mt7622 and mediatek/mt7623.

Hence rename the 'sdcard' feature to 'legacy-sdcard', and prefix
functions with 'legacy_sdcard_' instead of 'sdcard_'.

Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-16 12:22:17 +01:00
John Audia ed9341dd78 kernel: bump 5.4 to 5.4.140
Removed upstreamed bcm27xx/patches-5.4:
    950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch
    950-0980-SQUASH-USB-gadget-f_hid-remove-more-spam.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-14 20:25:25 +02:00
John Audia 02e2723ef3 kernel: bump 5.4 to 5.4.139
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-14 20:25:19 +02:00
Rui Salvaterra 6ec859d231 kernel: bump 5.10 to 5.10.58
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-14 16:32:34 +01:00
Rui Salvaterra ce2f31254a kernel: bump 5.10 to 5.10.57
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-14 16:32:34 +01:00
David Bauer 4d81f08771 ipq40xx: ar40xx: reset port status register
This resolves incosnsitencies of the configured RX / TX flow control
modes between different boards or bootloaders.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-14 14:48:07 +02:00
David Bauer 685c790e9f ipq40xx: ar40xx: use FIELD_GET macro
This improves code readability.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-14 14:47:51 +02:00
David Bauer b9162a9c85 ipq40xx: increase EX6150v2 SPI frequency
The chip supports clock speeds up to 50 MHz, however it won't even read
the chip-id correctly at this frequency.

45 MHz however works reliable.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-14 14:47:34 +02:00
David Bauer 0f3f5d47d3 bcm4908: add missing config symbol
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-13 00:52:35 +02:00
David Bauer 101c0c00a7 mediatek: add missing config symbols
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-13 00:52:30 +02:00
David Bauer 1d344c801a tegra: add missing Kconfig symbol
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-13 00:51:38 +02:00
David Bauer cbb42a44ca rockchip: add missing Kconfig symbols
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-13 00:51:30 +02:00
David Bauer 5c88bf896e generic: add missing config symbol
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-11 02:15:22 +02:00
David Bauer 4c2a8b00fe mediatek: add missing config symbol
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-11 02:15:13 +02:00
David Bauer 1c9a9f7c7a treewide: add various missing config symbols
Fixes commit 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-10 20:22:59 +02:00
David Bauer eaa9c94c75 generic: Kconfig: exit on unset symbol
When a target configuration has unser Kconfig symbols, the build will
fail when OpenWrt is compiled with V=s and stdin is connected to a tty.

In case OpenWrt is compiled without either of these preconditions, the
build will uscceed with the symbols in question being unset.

Modify the kernel configuration in a way it fails on unset symbols
regardless of the aformentioned preconditions.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-10 13:14:52 +02:00
David Bauer 29a3967e61 generic: fix kernel panic on existing mac-address node
Calling free for the OF property can result in a kernel panic, as the
buffer in question might be referenced elsewhere. Also, it is not
removed from the tree.

Always allocate a new property and updating the tree with it fixes both
issues.

Fixes commit 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-10 13:13:01 +02:00
Hauke Mehrtens 7057e05485 omap: Remove EXT2 and EXT3 driver config
The EXT4 driver also takes care of EXT2 and EXT3 file systems.
Activating the EXT2 driver kernel config options unlocked some other
ext2 driver related options which OpenWrt did not take care of.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-09 01:17:06 +02:00
Hauke Mehrtens e06544bdbe layerscape: Fix multiple bugs in of_get_mac_address() changes
The change which backported the of_get_mac_address() change broke some
patches in the layerscape target so the patches did not apply any more.

This commit makes them apply again and also fixes some other problems
related to this change.

Fixes commit 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-09 01:16:48 +02:00
Hauke Mehrtens 4e57f83659 kernel: Apply change to of_get_mac_address() to ks8851 too
The code from ks8851.c was moved to ks8851_common.c, so it was not
backported. This broke the compile of the omap target which uses this
driver.

Fixes commit 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-09 01:16:48 +02:00
Josef Schlehofer 4b2dc4dbbf mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz
This patch is backported from linux-arm-kernel [1] to improve situation, when
it was reported that 1.2 GHz variant is unstable with DFS.
It waits to be accepted upstream, however, it waits for Marvell people to respond.

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210630225601.6372-1-kabel@kernel.org/

Fixes: 7b868fe04a ("Revert "mvebu: 5.4 fix DVFS caused random boot crashes"")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 20:42:01 +02:00
Josef Schlehofer 0dcb03dc63 Revert "mvebu: 5.10 fix DVFS caused random boot crashes"
Based on the discussion on the mailing list [1], the patch which was
reverted, it reverts only one patch without the subsequent ones.

This leads to the SoC scaling issue not using a CPU parent clock, but
it uses DDR clock. This is done for all variants, and it's wrong because
commits (hacks) that were using the DDR clock are no longer in the mainline kernel.

If someone has stability issues on 1.2 GHz, it should not affect all
routers (1 GHz, 800 MHz) and it should be rather consulted with guys, who are trying to
improve the situation in the kernel and not making the situation worse.

There are two solutions in cases of instability:
a) disable cpufreq
b) underclock it up to 1 GHz

This reverts commit 080a0b74e3.

[1] https://lists.openwrt.org/pipermail/openwrt-devel/2021-June/035702.html

Fixes: d379476817 ("mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz")
CC: Pali Rohár <pali@kernel.org>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 20:42:01 +02:00
Martin Schiller 6c659fb80c layerscape: armv8_64b: do not disable CONFIG_IP_ADVANCED_ROUTER
This option is needed e.g. to use strongswan for IPSec.

BTW: This was the only target where this option was disabled.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2021-08-08 19:50:46 +02:00
Linus Walleij 83441522a2 gemini: Add hdparm setting
This uses "hdparm" (if present) to get the harddisk into low
power mode on NAS set-ups.

Cc: Adrian Schmutzler <mail@adrianschmutzler.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2021-08-08 19:50:45 +02:00
Josef Schlehofer d379476817 mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz
This patch is backported from linux-arm-kernel [1] to improve situation, when
it was reported that 1.2 GHz variant is unstable with DFS.
It waits to be accepted upstream, however, it waits for Marvell people to respond.

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210630225601.6372-1-kabel@kernel.org/

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 19:50:45 +02:00
Josef Schlehofer 7b868fe04a Revert "mvebu: 5.4 fix DVFS caused random boot crashes"
Based on the discussion on the mailing list [1], the patch which was
reverted, it reverts only one patch without the subsequent ones.

This leads to the SoC scaling issue not using a CPU parent clock, but
it uses DDR clock. This is done for all variants, and it's wrong because
commits (hacks) that were using the DDR clock are no longer in the mainline kernel.

If someone has stability issues on 1.2 GHz, it should not affect all
routers (1 GHz, 800 MHz) and it should be rather consulted with guys, who are trying to
improve the situation in the kernel and not making the situation worse.

There are two solutions in cases of instability:
a) disable cpufreq
b) underclock it up to 1 GHz

This reverts commit 080a0b74e3.

[1] https://lists.openwrt.org/pipermail/openwrt-devel/2021-June/035702.html

CC: Pali Rohár <pali@kernel.org>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-08-08 19:50:45 +02:00
Klaus Kudielka 82620cd610 mvebu: Turris Omnia: use SFP module, if present
Follow the recommendations stated in the Turris Omnia DTS for eth2:

"In case SFP module is present, U-Boot has to enable the sfp node above,
remove phy-handle property, and add managed = "in-band-status" property."

The boot script is written in a way, that it works for all U-Boot
versions deployed by the vendor so far (2015.10-rc2, 2019.07).

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
2021-08-08 19:50:45 +02:00
Klaus Kudielka f2c57a294f mvebu: backport Turris Omnia DTS changes to 5.4
Kernel 5.4 receives a reduced set, just to make the SFP cage work.
While we are at it, move the patches accepted upstream to the 0xx series.

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
2021-08-08 19:50:45 +02:00
Klaus Kudielka b3b855191b mvebu: backport Turris Omnia DTS changes to 5.10
Kernel 5.10 receives the complete set of improvements from 5.11/5.12.
While we are at it, move the patches accepted upstream to the 0xx series.

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
2021-08-08 19:50:45 +02:00
Rui Salvaterra 86c0c12c74 ath79: fix the AR7{1,2}00 USB PHY patches
PHY_SIMPLE is a bogus kconfig symbol, what we really need to select is
GENERIC_PHY.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-08 19:50:45 +02:00
Rui Salvaterra 968dc33299 kernel/generic: add CONFIG_KCSAN to the 5.10 kconfig
Add the missing CONFIG_KCSAN (disabled). Found while making kernel_oldconfig on
an x86-64 subtarget.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-08 19:50:45 +02:00
Damien Mascord 8e10b0181c kernel: backport mdio_find_bus from 5.10.x
mdio-tools (https://github.com/wkz/mdio-tools) requires the use of
mdio_find_bus, which is not present in 5.4.x.

This patch backports the required change from 5.10.x to 5.4.x

The original patch submission for this can be found at
https://patchwork.ozlabs.org/project/netdev/patch/20200201074625.8698-2-jeremy.linton@arm.com/

Signed-off-by: Damien Mascord <tusker@tusker.org>
[Add original patch description]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-08 19:49:29 +02:00
John Audia 3c0a26b43a kernel: bump 5.4 to 5.4.138
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-08 17:57:34 +02:00
Rui Salvaterra 39d12b0155 kernel: bump 5.10 to 5.10.55
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-08 17:57:34 +02:00
Stijn Tintel b1bff5cb57 mvebu: switch to generic sdcard upgrade method
Now that we have a generic sdcard upgrade method, which was copied from
the mvebu platform method, we can switch mvebu to the generic method.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-08-07 01:43:39 +03:00
Stijn Tintel 8347d8b4fb base-files: add generic sdcard upgrade method
Add a generic sdcard upgrade method instead of duplicating code in yet
another target, and add a feature flag to only install this upgrade
method in targets that set this flag. Copied from mvebu.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-08-07 01:34:40 +03:00
Daniel Golle a0b827b916
kirkwood: import patch to fix build and refresh patches
kirkwood build broke due to missing include needed for ETH_ALEN.
Add patch (sent upstream as well) to address that.
Refresh patches for 5.4 and 5.10.

Fixes: 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-05 23:53:07 +01:00
Fabian Bläse c36e9f891b ramips: add missing label-mac-device for Xiaomi Mi Router 4A (100M)
As both the Mi Router 4A (100M) and the Mi Router 4C use the same
label-mac-device, the alias can be moved to the shared dtsi.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2021-08-05 22:55:39 +02:00
Daniel Golle e3096c384c
realtek: fix syntax error introduced by previous commit
A superflus ')' character has slipped into commit 91a52f22a1. Remove it
to fix build.

Fixes: 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-05 15:22:26 +01:00
David Bauer 774b386a92 generic: fix to few arguments to of_get_mac_address
Fixes commit 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-05 13:05:06 +02:00
David Bauer c3d99ae792 mediatek: mt7622: enable HW RNG
MT7622 provides are hardware RNG with upstream Linux driver. Enable
compilation of this driver to make use of the hardware RNG.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-05 01:48:55 +02:00
John Marrett 252466a0ce ath79: add support for GL.iNet GL-X300B
The GL-X300B is a industrial 4G LTE router based on the Qualcomm
QCA9531 SoC.

Specifications:
 - Qualcomm QCA9531 @ 650 MHz
 - 128 MB of RAM
 - 16 MB of SPI NOR FLASH
 - 2x 10/100 Mbps Ethernet
 - 2.4GHz 802.11b/g/n
 - 1x USB 2.0 (vbus driven by GPIO)
 - 4x LED, driven by GPIO
 - 1x button (reset)
 - 1x mini pci-e slot (vcc driven by GPIO)
 - RS-485 Serial Port (untested)

Flash instructions:

This firmware can be flashed using either sysupgrade from the GL.iNet
firmware or the recovery console as follows:

 - Press and hold the reset button
 - Connect power to the router, wait five seconds
 - Manually configure 192.168.1.2/24 on your computer, connect to
   192.168.1.1
 - Upload the firmware image using the web interface

RS-485 serial port is untested and may depend on the following commit in
the GL.iNet repo:

202e83a32a

MAC addresses as verified by OEM firmware:

vendor   OpenWrt   address
WAN      eth0      label
LAN      eth1      label + 1
2g       phy0      label + 2

The label MAC address was found in the art partition at 0x0

Based on vendor commit:

16c5708b20

Signed-off-by: John Marrett <johnf@zioncluster.ca>
2021-08-05 01:48:17 +02:00
Hannu Nyman 13d6d27422 generic: add missing Kconfig symbol ARM_SCMI_PROTOCOL
Add the missing ARM_SCMI_PROTOCOL symbol. Apparently it was exposed
for 5.10.53 with a kernel dependency change.
Missing symbol observed with mediatek/7622 E8450/RT3200 router.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-08-05 01:48:17 +02:00
David Bauer 1e37399235 generic: enable netlink ethtool interface
The virtual cable tester depends on the netlink interface for ethtool.
Thus, enable it in the generic kernel configuration.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-05 01:47:07 +02:00
Ansuel Smith 91a52f22a1 treewide: backport support for nvmem on non platform devices
In the current state, nvmem cells are only detected on platform device.
To quickly fix the problem, we register the affected problematic driver
with the of_platform but that is more an hack than a real solution.
Backport from net-next the required patch so that nvmem can work also
with non-platform devices and rework our current patch.
Drop the mediatek and dsa workaround and rework the ath10k patches.
Rework every driver that use the of_get_mac_address api.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-08-05 01:46:26 +02:00
Rafał Miłecki b37f0dde78 kernel: fix kernel 5.5 and 5.9 PCI DT regressions
This fixes PCI on bcm53xx.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-04 08:42:30 +02:00
David Bauer 191c4ff5e1 generic: add missing ARM64 crypto Kconfig symbols
bcm27xx-bcm2710 builds are stalling when compiled with V=s.

Explitily disable these unset symbols to avoid stalling
builds.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-31 22:14:02 +02:00
John Audia bd3cb93034 kernel: bump 5.4 to 5.4.136
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-31 19:13:00 +02:00
John Audia 28ef764026 kernel: bump 5.4 to 5.4.135
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-31 19:13:00 +02:00
David Bauer f038a169a0 generic: add missing Kconfig symbol
Fixes build errors for sunxi as well as rockchip targets.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-31 11:49:02 +02:00
Rui Salvaterra a20e6149b3 kernel: bump 5.10 to 5.10.54
Deleted (upstreamed) patches:
mediatek/patches-5.10/000-spi-fix-fifo.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-29 19:50:16 +01:00
Rui Salvaterra f2961c9c2b kernel: bump 5.10 to 5.10.53
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-29 19:50:15 +01:00
David Bauer a57d7c29a4 generic: fix build warning
Fixes a unused variable warning:

drivers/of/of_net.c: In function 'of_get_mac_address_mtd':
drivers/of/of_net.c:92:19: warning: unused variable 'prop' [-Wunused-variable]

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-29 20:49:57 +02:00
Nick Hainke e8e2b88f5f mediatek: mt7623: import patch to fix msi warning
The 1st generation MediaTek PCIe host bridge cannot handle Message
Signaled Interrupts (MSIs). The core PCI code is not aware that MSI is
not available. This results in warnings of the form:

WARNING: CPU: 2 PID: 112 at include/linux/msi.h:219
  pci_msi_setup_msi_irqs.constprop.8+0x64/0x6c
Modules linked in: ahci(+) libahci libata sd_mod scsi_mod
  gpio_button_hotplug
CPU: 2 PID: 112 Comm: kmodloader Not tainted 5.10.52 #0
Hardware name: Mediatek Cortex-A7 (Device Tree)

Import patches that introduce the 'no_msi' attribute to signal missing
MSI support to the core PCI.

Refresh patches:
- 000-spi-fix-fifo.patch
- 330-mtk-bmt-support.patch
- 510-net-mediatek-add-flow-offload-for-mt7623.patch
- 601-PCI-mediatek-Use-regmap-to-get-shared-pcie-cfg-base.patch
- 610-pcie-mediatek-fix-clearing-interrupt-status.patch
- 700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
- 710-pci-pcie-mediatek-add-support-for-coherent-DMA.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-07-29 15:08:17 +01:00
Rafał Miłecki e88ab3b629 bcm53xx: refresh kernel 5.10 config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-07-29 14:56:14 +02:00
Rafał Miłecki d8e8a2a8db bcm53xx: add testing support for kernel 5.10
It still requires fixing PCIe support:
[    6.644699] pcie_iproc_bcma bcma0:7: host bridge /axi@18000000/pcie@12000 ranges:
[    6.652217] pcie_iproc_bcma bcma0:7:   No bus range found for /axi@18000000/pcie@12000, using [bus 00-ff]
[    6.661833] OF: /axi@18000000/pcie@12000: Missing device_type
[    6.667622] pcie_iproc_bcma: probe of bcma0:7 failed with error -12
[    6.673985] pcie_iproc_bcma bcma0:8: host bridge /axi@18000000/pcie@13000 ranges:
[    6.681514] pcie_iproc_bcma bcma0:8:   No bus range found for /axi@18000000/pcie@13000, using [bus 00-ff]
[    6.691137] pcie_iproc_bcma: probe of bcma0:8 failed with error -12
[    6.697522] pcie_iproc_bcma bcma0:9: host bridge /axi@18000000/pcie@14000 ranges:
[    6.705048] pcie_iproc_bcma bcma0:9:   No bus range found for /axi@18000000/pcie@14000, using [bus 00-ff]
[    6.714669] pcie_iproc_bcma: probe of bcma0:9 failed with error -12

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-07-29 14:56:14 +02:00
Rafał Miłecki 5be1c022fe kernel: fix bgmac compilation in kernel 5.10
It's required since upstream kernel commit 4bdc0d676a64 ("remove
ioremap_nocache and devm_ioremap_nocache").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-07-29 13:53:47 +02:00
David Bauer 9928236d16 generic: fix compile-error for non-mtd platforms
Fixes commit cd39aba402 ("generic: write back netdev MAC-address to device-tree")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-29 08:51:08 +02:00
David Bauer cd39aba402 generic: write back netdev MAC-address to device-tree
The label-mac logic relies on the mac-address property of a netdev
devices of-node. However, the mac address can also be stored as a
different property or read from e.g. an mtd device.

Create this node when reading a mac-address from OF if it does not
already exist and copy the mac-address used for the device to this
property. This way, the MAC address can be accessed using procfs.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-29 00:30:05 +02:00
David Bauer f0a885ed86 ath79: fix JT-OR750i switch LED assignment
The LEDs for LAN1 and LAN3 were swapped. Link on port 1 would illuminate
the LED on port 3 and vice versa.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-28 14:25:53 +02:00
David Bauer 4feb9a4211 ath79: enable missing pinmux for JT-OR750i
Without explicit configuration of these pins the ethernet as well as
status LED of the device do not work correctly.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-28 14:25:46 +02:00
David Bauer bd521f2a83 Revert "generic: add mac-address property for NVMEM mac addresses"
This reverts commit b309248730.

This commit could create a property without allocated memory, breaking
subsequent reads over a nodes property. Also, the mac-address-increment
was not applied when reading from nvmem.

Revert this commit for now, which breaks the label-mac-address logic.
Possibly, traversing the device-tree from the netdev side is easier
anyways.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-28 13:48:24 +02:00
Vincent Wiemann 55b4b36552 ath79: add support for Joy-IT JT-OR750i
Specifications:
 * QCA9531, 16 MiB flash (Winbond W25Q128JVSQ), 128 MiB RAM
 * 802.11n 2T2R (external antennas)
 * QCA9887, 802.11ac 1T1R (connected with diplexer to one of the antennas)
 * 3x 10/100 LAN, 1x 10/100 WAN
 * UART header with pinout printed on PCB

Installation:
 * The device comes with a bootloader installed only
 * The bootloader offers DHCP and is reachable at http://10.123.123.1
 * Accept the agreement and flash sysupgrade.bin
 * Use Firefox if flashing does not work

TFTP recovery with static IP:
 * Rename sysupgrade.bin to jt-or750i_firmware.bin
 * Offer it via TFTP server at 192.168.0.66
 * Keep the reset button pressed for 4 seconds after connecting power

TFTP recovery with dynamic IP:
 * Rename sysupgrade.bin to jt-or750i_firmware.bin
 * Offer it via TFTP server with a DHCP server running at the same address
 * Keep the reset button pressed for 6 seconds after connecting power

Co-authored-by: Sebastian Schaper <openwrt@sebastianschaper.net>
Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
2021-07-28 13:48:15 +02:00
Hauke Mehrtens 8c2509dc5f mediatek: Fix Fidelix-FM35X1GA patch
This patch did not apply cleanly any more after support for the XTX
flash was added to the generic patches.

Fixes: 92012dd867 ("kernel: Add support for XTX XT26G02A SPI NAND")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-07-25 16:11:29 +02:00
Tomasz Maciej Nowak cbdd2b62e4 mvebu: limit mvneta tx queue workaround to 32 bit SoC
This patch has been carried since introduction throughout every kernel
major bump and no one has tested if the later kernels improved the
situation. The Armada 3720 SoC can only process GbE interrupts on Core 0
and this is already limited in all stable kernels, so ditch this
workaround for 64 bit SoCs.

Ref: https://git.kernel.org/torvalds/c/cf9bf871280d

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2021-07-25 13:52:38 +02:00
Martin Schiller bbfb142f2a layerscape: armv8_64b: enable Microsemi phy driver for FRWY-LS1046A
Enable the Microsemi phy driver to support the VSC8514 QSGMII phy on the
FRWY-LS1046A board.

Otherwise, the "Generic PHY" driver is used.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2021-07-25 13:52:38 +02:00
Martin Schiller 3f97a04e6c layerscape: fix config restore for FRWY-LS1046A
commit 2c2d77bd3b ("layerscape: add FRWY-LS1046A board support")
missed to add an entry to the 79_move_config preinit script.

Therefore, the config transfer on sysupgrade wass broken for this device.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2021-07-25 13:52:38 +02:00
Thomas Nixon cdb5acac20 Revert "realtek: Fix failsafe mode"
This reverts commit b7ee0786b5.

With the previous commit "realtek: remove rtl83xx vlan 1 special cases"
this is no longer required.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
2021-07-25 13:52:38 +02:00
Thomas Nixon ad712c71ce realtek: remove rtl83xx vlan 1 special cases
On reset, the PVID of all ports is set to 1; if this is reset to 0,
the special cases for VLAN 1 are no longer required.

port_vlan_add is called with vid=0 when the DSA port interfaces are
enabled with no VLAN; previously the VLAN was not configured in this
case, relying on VLAN 1 being present, but with the PVID set to 0,
configuring VLAN 0 as normal works as expected.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
2021-07-25 13:52:38 +02:00
Rui Salvaterra fb6b824bff kernel/generic: sort the 5.10 kconfig symbols
Sort the kernel configuration using scripts/kconfig.pl.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-25 13:52:38 +02:00
Rui Salvaterra 2f1bd91d33 kernel/generic: add a missing symbol to the 5.10 kconfig
Add CONFIG_HAVE_ARM_ARCH_TIMER (disabled). A make kernel_oldconfig on cortexa9
will otherwise prompt for its selection. The 5.4 configuration already contains
the same symbol.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-25 13:52:38 +02:00
John Audia d15db2fe4d kernel: bump 5.4 to 5.4.134
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-25 13:52:38 +02:00
John Audia 5408e811b2 kernel: bump 5.4 to 5.4.133
Manually rebased:
  pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-25 13:52:38 +02:00
Rui Salvaterra 2b2ac841e0 kernel: bump 5.10 to 5.10.52
Add the new CONFIG_BATTERY_RT5033 to the generic configuration, as reported by
Paul Blazejowski. Resort the kconfig while at it.

No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-25 13:52:38 +02:00
Felix Matouschek 92012dd867 kernel: Add support for XTX XT26G02A SPI NAND
This chip is used on Teltonika RUTX boards.

Signed-off-by: Felix Matouschek <felix@matouschek.org>
2021-07-25 13:52:38 +02:00
Vladimir Markovets f032601ed7 kernel: backport workaround for Realtek RTL8672 and RTL9601C chips
Adds support for GPON SFP modules based on the Realtek RTL8672 and
RTL9601C chips, including but not limited to:
* V-SOL V2801F
* C-Data FD511GX-RM0
* OPTON GP801R
* BAUDCOM BD-1234-SFM
* CPGOS03-0490 v2.0
* Ubiquiti U-Fiber Instant
* EXOT EGS1

Signed-off-by: Vladimir Markovets <abam_a@yahoo.com>
2021-07-25 13:52:38 +02:00
Rui Salvaterra 023a1366ee kernel/generic: fix the arm gc-sections patch
Latest binutils (2.37) exposed a long-standing bug. The kernel linking stage
would break at the SORTTAB step, due to the exception table having been
previously purged from vmlinux, as its section wasn't marked as unconditionally
kept. Fix thusly.

Additionally, the "#define ARM_MMU_DISCARD(x) KEEP(x)" change is bogus. It
would only apply to !CONFIG_MMU devices (which we don't support in OpenWrt), and
it would even break the build if referenced. Drop it.

While at it, rename the patch in order to make it obvious that it's
arm-specific.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[Add same changes for kernel 5.4 too]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-07-25 13:52:34 +02:00
Nick Hainke 90db922f88 mediatek: mt7623: import patch to fix spi
The patch fixes the fifo rx mode for the mt7623. It is already accepted
upstream for Linux Kernel 5.15.

To test the spi we can change the dts file to

&spi0 {
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_pins_a>;
	status = "okay";
	spidev: spidev@0 {
		compatible = "linux,spidev";
		spi-max-frequency = <1000000>;
		reg = <0>;
	};
};

Afterwards we should see a spidev device under /dev/.
To test it we can further use spidev-test.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-07-24 13:10:53 +01:00
Ansuel Smith 6bc6a41685 generic: fix mediatek and dsa not detecting mac-addr from nvmem
Nvmem require the device node to be registered with the of_platform.
Register the device node so that nvmem can correctly find the dev and
correctly load the mac-addr stored in the nvmem cell declared in the dts.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-23 16:06:06 +01:00
DENG Qingfang 6dc18649a0 ramips: mt7621: remove bring up DSA master init script
With commit 2e17c71095, there is no need to bring up DSA master port
manually.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
2021-07-23 02:52:02 +01:00
Paul Blazejowski f7374bce00 ath79: kernel: Add missing quote to drivers/mfd/Kconfig
A missing quote in target/linux/ath79/patches-5.x/920-mikrotik-rb4xx.patch
produces:

...
scripts/kconfig/conf  --syncconfig Kconfig
drivers/mfd/Kconfig:2016:warning: multi-line strings not supported
...

This patch adds missing closing quote, fixing the above warning.

Signed-off-by: Paul Blazejowski <paulb@blazebox.homeip.net>
2021-07-23 02:38:22 +01:00
David Bauer b309248730 generic: add mac-address property for NVMEM mac addresses
Traversing the device-tree by referencing a network device to determine
a devices labe-mac does not work with the generic nvmem implementation,
as the userspace expects the MAC-address to be available as a
device-tree property.

The legacy mtd-mac-address implementation did create such a node. Do the
same when using the nvmem implementation to allow reading the MAC
address.

Fixes commit d284e6ef0f ("treewide: convert mtd-mac-address-increment*
to generic implementation")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-22 04:32:28 +02:00
Daniel Golle 089c2bb217 mediatek: mt7623: yet another legacy image variable restored
Restore BOOTFS_BLOCKS variable until U7623 gets brushed, so things
hopefully build now.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-21 16:48:35 +01:00
Daniel Golle 5096f0513b mediatek: mt7623: allow build without ext4 rootfs
The image generation code for the U7623 board expects ext4 filesystem
to be selected in menuconfig and CONFIG_TARGET_ROOTFS_PARTSIZE to be
defined. Now that ext4 isn't enabled any more, the variable was missing
and broke the build.
Set the default (104) instead of using the config variable to fix that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-21 15:34:21 +01:00
David Bauer 373c08bcbb ramips: fix missing NVMEM subsystem
MAC address retrieval was switched to more generic upstream (5.13) NVMEM
based solution in commit 06bb4a5018 ("ramips: convert mtd-mac-address
to nvmem implementation") , but NVMEM subsystem wasn't enabled in the
kernel, so fix it now.

References: https://github.com/openwrt/openwrt/pull/4041#issuecomment-883322801
Fixes: 06bb4a5018 ("ramips: convert mtd-mac-address to nvmem implementation")
Signed-off-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit message]
2021-07-21 11:39:39 +02:00
Petr Štetiar f33fbfa4de bmips: fix missing NVMEM subsystem
MAC address retrieval was switched to more generic upstream (5.13) NVMEM
based solution in commit 32adbfc789 ("bmips: convert mtd-mac-address
to nvmem implementation"), but NVMEM subsystem wasn't enabled in the
kernel, so fix it now.

References: https://github.com/openwrt/openwrt/pull/4041#issuecomment-883322801
Fixes: 32adbfc789 ("bmips: convert mtd-mac-address to nvmem implementation")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-07-21 11:39:39 +02:00
Daniel Golle c5b3c13b60 mediatek: mt7623: add back needed build steps for U7623 board
When reworking the BPi-R2 the mtk-mmc-img build step was removed
despite it was still needed to build the image for the UniElec U7623
board. Add it back for now until U7623 gets its facelift.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-21 10:26:44 +01:00
Daniel Golle fe7596192e mediatek: remove ext4 images from mt7623 build
A full read-write rootfs cannot work inside uImage.FIT as the hash
will obviously change once writing to it. Disable generating ext4
rootfs images.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 18:43:56 +01:00
Rui Salvaterra f7ab41acc9 linux/rockchip: update the USB 3.0 controller node patch
This has been added in Linux 5.10.51 [1], but it's broken/incomplete. Update our
patch and refresh the remaining patches.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.51&id=421aff50af5e4cdc56b3ac8d6b670e09697bc8ac

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-20 18:38:23 +01:00
Daniel Golle 27deb35af3 mediatek: fix typo in kernel mt7623/config-5.10
Fix typo reported by github user @mans0n.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 17:03:44 +01:00
Daniel Golle ddec752890 mediatek: drop kmod-mmc
Support for MMC is built-into the kernel anyway, no need to select the
(empty/stub) kmod package.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 17:01:02 +01:00
Daniel Golle 86a61e716e mediatek: rework Bananapi BPi-R2
* introduce recovery (=initramfs) vs. production dual boot scheme
 * make use of uImage.FIT (instead of FAT partition)
 * generate images using build steps (instead of external scripts)
 * simplify sysupgrade and config restore (thanks to uImage.FIT)
 * make sure mmc devices are ordered persistently (set DT aliases)

This commit breaks sysupgrade from existing installations, you will
have to re-install using the sdcard.img.gz image.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 04:16:48 +01:00
Daniel Golle 8d633bf9f7 kernel: make uImage.FIT partition parser work on MBR partitions
Introduce new partition type 0x2e representing uImage.FIT and trigger
FIT partition parser on partitions having that type.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 04:11:05 +01:00
Daniel Golle 932366fdd9 mediatek: mt7623: import patch to fix flow offloading
Hardware flow offloading was reported to work when setting the right
version identifier. Import a patch from Frank Wunderlich doing that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 04:11:05 +01:00
Daniel Golle bce7777222 mediatek: mt7623: build with Linux 5.10
Update Kernel config and set Linux 5.10 for mediatek/mt7623.
(patches have already been updated to 5.10 when mt7622 was bumped)
Tested on Bananapi BPi-R2.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 04:11:05 +01:00
Rui Salvaterra a395cd00d2 kernel: bump 5.10 to 5.10.51
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-20 04:11:05 +01:00
Daniel Golle aaf1028296 x86: include kmod-fs-vfat by default in generic images
As x86/64 and x86/generic may be using UEFI, mounting the FAT-32 /boot
is necessary in order not to loose configuration files accross
sysupgrades. Include kmod-fs-vfat by default to make sure /boot can
always be mounted.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-07-20 04:11:05 +01:00
Ansuel Smith 32adbfc789 bmips: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 821b664099 ipq40xx: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 1e6f330ccf mediatek: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 8ec21d6bb2 mpc85xx: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 293d4e61c2 octeon: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 06bb4a5018 ramips: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith abc17bf306 ath79: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 2ca8e424b9 mvebu: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 939c0030db lantiq: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith 0458a8993c ipq806x: convert mtd-mac-address to nvmem implementation
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Ansuel Smith d284e6ef0f treewide: convert mtd-mac-address-increment* to generic implementation
Rework patch 681-NET-add-mtd-mac-address-support to implement
only the function to read the mac-address from mtd.
Generalize mtd-mac-address-increment function so it can be applied
to any source of of_get_mac_address.
Rename any mtd-mac-address-increment to mac-address-increment.
Rename any mtd-mac-address-increment-byte to mac-address-increment-byte.

This should make simplify the conversion of target to nvmem implementation.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-07-19 14:51:22 +02:00
Edgar Su df554e6fca x86: kernel: set NR_CPUS to 512
NR_CPUS limits the number of CPUs supported to 8. This makes total sense
on hardware-restircted platforms, but not on x86_64, where CPUs with
more than 8 cores can be easily acquired and with less physical limitaions.

see also: https://forum.openwrt.org/t/x86-64-8-cpu-limitation-on-vanilla-release/100946

Signed-off-by: Edgar Su <sjs333@outlook.com>
2021-07-18 03:04:53 -10:00
David Bauer 3446baad07 generic: add missing symbol
When compiling with all modules enabled, Kconfig complains about
CONFIG_I2C_DESIGNWARE_SLAVE being unset. Disable this symbol by default.

Fixes commit e9c9b5ec72 ("kernel: package Synopsys Designware PCI to I2C controller")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-17 22:34:12 +02:00
David Bauer f9d1828105 ipq40xx: fix FRITZRepeater 1200 RGMII delay
When the AVM FRITZ!Repeater 1200 was introduced on Kernel 4.19, the
at803x PHY driver incorrectly set up the delays, not disabling delays
set by the bootloader.

The PHY was always operating with RX as well as TX delays enabled, but
with kernel 5.4 and later, the required TX delay is disabled, breaking
ethernet operation.

Correct the PHY mode, so the driver enables both delays.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-17 20:06:49 +02:00
Rui Salvaterra b71767d8e0 kernel: bump 5.10 to 5.10.50
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-17 13:27:03 +02:00
Rui Salvaterra 2e324c0a2c kernel: bump 5.10 to 5.10.49
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-17 13:26:24 +02:00
Rui Salvaterra 9a0de5e1a1 kernel: bump 5.10 to 5.10.48
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-17 13:23:10 +02:00
Rui Salvaterra b607b06b91 kernel: bump 5.10 to 5.10.47
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-17 13:22:28 +02:00
John Audia 2fe1b32156 kernel: bump 5.4 to 5.4.132
Manually rebased:
  layerscape/patches-5.4/805-display-0002-drm-rockchip-prepare-common-code-for-cdns-and-rk-dpi.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-17 13:21:03 +02:00
John Audia 968aa64e61 kernel: bump 5.4 to 5.4.130
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-17 13:21:03 +02:00
John Audia f529c8463f kernel: bump 5.4 to 5.4.129
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-07-17 13:21:03 +02:00
Adrian Schmutzler 3ac13416ca ramips: fix Wifi MAC address setup for D-Link DIR-853 R1
Commands in 10_fix_wifi_mac were not properly concatenated, so
this was also triggered for the second phy without giving a
MAC address as argument.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-07-12 00:19:36 +02:00
Karim Dehouche 6639623e75 ramips: add support for D-Link DIR-853 A3
Specifications:
* SoC: MT7621AT
* RAM: 256MB
* Flash: 128MB NAND flash
* WiFi: MT7615DN (2.4GHz+5Ghz) with DBDC
* LAN: 5x1000M
* Firmware layout is Uboot with extra 96 bytes in header
* Base PCB is DIR-1360 REV1.0
* LEDs Power Blue+Orange,Wan Blue+Orange,WPS Blue,"2.4G"Blue, "5G" Blue,
  USB Blue
* Buttons Reset,WPS, Wifi

MAC addresses on OEM firmware:

lan      factory 0xe000   f4:*:*:a8:*:65  (label)
wan      factory 0xe006   f4:*:*:a8:*:68
2.4 GHz  [not on flash]   f6:*:*:c8:*:66
5.0 GHz  factory 0x4      f4:*:*:a8:*:66

The increment of the 4th byte for the 2.4g address appears to vary.
Reported cases:

       5g                 2.4g         increment
 f4:XX:XX:a8:XX:66  f6:XX:XX:c8:XX:66  +0x20
 x0:xx:xx:68:xx:xx  x2:xx:xx:48:xx:xx  -0x20
 x4:xx:xx:6a:xx:xx  x6:xx:xx:4a:xx:xx  -0x20

Since increment is inconsistent and there is no obvious pattern
in swapping bytes, and the 2.4g address has local bit set anyway,
it seems safer to use the LAN address with flipped byte here in
order to prevent collisions between OpenWrt devices and OEM devices
for this interface. This way we at least use an address as base
that is definitely owned by the device at hand.

Flashing instruction:

The Dlink "Emergency Room" cannot be accessed through the reset
button on this device. You can either use console or use the
encrypted factory image availble in the openwrt forum.

Once the encrypted image is flashed throuh the stock Dlink web
interface, the sysupgrade images can be used.

Header pins needs to be soldered near the WPS and Wifi buttons.

The layout for the pins is (VCC,RX,TX,GND). No need to connect the VCC.

the settings are:

Bps/Par/Bits          : 57600 8N1
Hardware Flow Control : No
Software Flow Control : No

Connect your client computer to LAN1 of the device
Set your client IP address manually to 192.168.0.101 / 255.255.255.0.
Call the recovery page or tftp for the device at http://192.168.0.1
Use the provided emergency web GUI to upload and flash a new firmware to
the device

At the time of adding support the wireless config needs to be set up by
editing the wireless config file:

 * Setting the country code is mandatory, otherwise the router loses
   connectivity at the next reboot. This is mandatory and can be done
   from luci. After setting the country code the router boots correctly.
   A reset with the reset button will fix the issue and the user has to
   reconfigure.

 * This is minor since the 5g interface does not come up online although
   it is not set as disabled. 2 options here:

   1- Either run the "wifi" command. Can be added from LUCI in system -
      startup - local startup and just add wifi above "exit 0".

   2- Or add the serialize option in the wireless config file as shown
      below. This one would work and bring both interfaces automatically
      at every boot:

      config wifi-device 'radio0'
          option serialize '1'

      config wifi-device 'radio1'
          option serialize '1'

Signed-off-by: Karim Dehouche <karimdplay@gmail.com>
[rebase, improve MAC table, update wireless config comment, fix
 2.4g macaddr setup]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-07-12 00:19:14 +02:00
Roberto Valentini af56075a8f ath79: add support for TP-Link RE455 v1
TP-Link RE455 v1 is a dual band router/range-extender based on
Qualcomm/Atheros QCA9563 + QCA9880.

This device is nearly identical to RE450 v3

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
- UART header on PCB[1]

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

[1] Didn't work, probably need to short unpopulated resistor R64
    and R69 as RE450v3

Signed-off-by: Roberto Valentini <valantin89@gmail.com>
2021-07-11 16:58:12 +02:00
Tee Hao Wei 0c721434ea ramips: add support for Linksys EA8100 v2
Specifications:
- SoC: MT7621AT
- RAM: 256MB
- Flash: 128MB NAND
- Ethernet: 5 Gigabit ports
- WiFi: 2.4G/5G MT7615N
- USB: 1 USB 3.0, 1 USB 2.0

This device is very similar to the EA7300 v1/v2, EA7500 v2, and EA8100 v1.

Installation:

Upload the generated factory image through the factory web interface.

(following part taken from EA7300 v2 commit message:)

This might fail due to the A/B nature of this device. When flashing, OEM
firmware writes over the non-booted partition. If booted from 'A',
flashing over 'B' won't work. To get around this, you should flash the
OEM image over itself. This will then boot the router from 'B' and
allow you to flash OpenWRT without problems.

Reverting to factory firmware:

Hard-reset the router three times to force it to boot from 'B.' This is
where the stock firmware resides. To remove any traces of OpenWRT from
your router simply flash the OEM image at this point.

With thanks to Tom Wizetek (@wizetek) for testing.

Signed-off-by: Tee Hao Wei <angelsl@in04.sg>
2021-07-11 16:58:12 +02:00
Dmitry Tunin 88f39b72da ipq40xx: increase SPI frequency for Zyxel NBG6617
The mx25l25635f supports clock speed up to 50Mhz.

Also remove obsolete "mx25l25635f" hack and rename
the matching device-tree flash node.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
[mention node rename as well. chip is very very likely
always the "f" revision for all NBG6617]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-07-11 01:38:52 +02:00
Adrian Schmutzler 5e8eaac8c3 ramips: mt7628an: remove redundant console setup for bootargs
This is already set in mt7628an.dtsi

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-07-10 20:35:11 +02:00
Stas Fiduchi b8168f4716 ramips: add support for D-Link DIR-853-R1
This PR adds support for router D-Link DIR-853-R1

Specifications:

    SoC: MT7621AT
    RAM: 128MB
    Flash: 16MB SPI
    WiFi: MT7615DN (2.4GHz+5Ghz) with DBDC (This mode allows this
      single chip act as an 2x2 11n radio and an 2x2 11ac radio at the
      same time)
    LAN: 5x1000M
    LEDs Power Blue+Orange,Wan Blue+Orange,WPS Blue,"2.4G"Blue, "5G" Blue
    USB Blue
    Buttons Reset,WPS, Wifi

MAC addresses:

|Interface   |        MAC      |    Factory  |Comment
|------------|-----------------|-------------|----------------
|WAN sticker |C4:XX:XX:6E:XX:2A|             |Sticker
|LAN         |C4:XX:XX:6E:XX:2B|             |
|Wifi (5g)   |C4:XX:XX:6E:XX:2C|0x4          |
|Wifi (2.4g) |C6:XX:XX:7E:XX:2C|             |
|            |                 |             |
|            |C4:XX:XX:6E:XX:2E|0x8004 0xe000|
|            |C4:XX:XX:6E:XX:2F|0xe006       |

The increment of the 4th byte for the 2.4g address appears to vary.
Reported cases:

       5g                 2.4g         increment
 C4:XX:XX:6E:XX:2C  C6:XX:XX:7E:XX:2C  0x10
 f4:XX:XX:16:XX:32  f6:XX:XX:36:XX:32  0x20
 F4:XX:XX:A6:XX:E3  F6:XX:XX:B6:XX:E3  0x10

Since increment is inconsistent and there is no obvious pattern
in swapping bytes, and the 2.4g address has local bit set anyway,
it seems safer to use the LAN address with flipped byte here in
order to prevent collisions between OpenWrt devices and OEM devices
for this interface. This way we at least use an address as base
that is definitely owned by the device at hand.

Flashing instruction:

The Dlink "Emergency Room"

Connect your client computer to LAN1 of the device
Set your client IP address manually to 192.168.0.101 / 255.255.255.0.
Then, power down the router, press and hold the reset button, then
re-plug it. Keep the reset button pressed until the internet LED stops
flashing
Call the recovery page or tftp for the device at http://192.168.0.1
Use the provided emergency web GUI to upload and flash a new firmware to
the device.

Signed-off-by: Stas Fiduchi <fiduchi@protonmail.com>
[commit title/message improvements, use correct label MAC address,
 calculate MAC addresses based on 0x4, minor DTS style fixes, add
 uart2 to state_default, remove factory image, add 2.4g MAC address,
 use partition DTSI, add macaddr comment in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-07-10 20:01:29 +02:00
Adrian Schmutzler cce8d16bf1 treewide: call check-size before append-metadata
sysupgrade metadata is not flashed to the device, so check-size
should be called _before_ adding metadata to the image.

While at it, do some obvious wrapping improvements.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2021-07-10 19:40:10 +02:00
Koen Vandeputte 918908fe76 ath79: add missing MTD_NAND_RB91X symbol
Looks like the symbol was forgotten for 5.4

Fixes: 820e660cd7 ("ath79: add NAND driver for MikroTik RB91xG series")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2021-07-09 17:11:12 +02:00
Felix Fietkau f4e3ff5b07 mediatek: prevent duplicate hardware flow offload entries
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-08 07:38:41 +02:00
Felix Fietkau 64ed3d8056 kernel: backport a few upstream flow offloading fixes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-08 07:38:41 +02:00
Alexander Couzens 0fac6f5562
ramips: minew g1-c: add the old device name to the supported devices
Allow to use the sysupgrade image as factory image without
additional force.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-07-07 18:32:14 +02:00
David Bauer 5b58545f44 ath79: increase SPI frequency for OCEDO boards
The MX25L12805D used on all ath79 OCEDO boards supports clock
speeds up to 50 MHz.

Thus, we can increase the maximum SPI frequency the flash chip is
controlled at to 50 MHz, increasing transfer speed.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-07 17:13:23 +02:00
David Bauer 8a3f19023b ath79: increase WS-AP3610 SPI frequency
The M25P80 used on the Siemens WS-AP3610 supports clock speeds up to 54
MHz. Thus, we can safely increase the maximum SPI frequency the flash
chip is controlled at to 50 MHz, increasing transfer speed.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-07 17:13:16 +02:00
Alexander Couzens 8d497b6570
ramips: add support for minew g1-c
The minew g1-c is a smart home gateway / BLE gateway.
A Nordic nRF52832 is available via USB UART (cp210x) to support BLE.
The LED ring is a ring of 24x ws2812b connect to a generic GPIO (unsupported).
There is a small LED which is only visible when the device is open which
will be used as LED until the ws2812b is supported.
The board has also a micro sdcard/tfcard slot (untested).
The Nordic nRF52832 exposes SWD over a 5pin header (GND, VCC, SWD, SWC, RST).
The vendor uses an older OpenWrt version, sysupgrade can be used via
serial or ssh.

CPU:		MT7628AN / 580MHz
RAM:		DDR2 128 MiB RAM
Flash:		SPI NOR 16 MiB W25Q128
Ethernet:	1x 100 mbit (Port 0) (PoE in)
USB:		USB hub, 2x external, 1x internal to USB UART
Power:		via micro usb or PoE 802.11af
UART:		3.3V, 115200 8n1

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-07-05 17:27:13 +02:00
Petr Štetiar bb2a9af6f1 ath79: base-files: fix broken network config
Fix bash syntax error introduced in commit cce2e8db56 ("ath79: add
support for TP-Link TL-WR941HP v1") which resulted in broken default
network configuration.

 In target/linux/ath79/generic/base-files/etc/board.d/02_network line 402:
	tplink,tl-wr842n-v2)\
        ^-- SC1073: Couldn't parse this case item. Fix to allow more checks.

References: https://gitlab.com/ynezz/openwrt-device-runtime-testing/-/jobs/1398837698/artifacts/file/cram-result-archer-c7-v5-initramfs.txt
Fixes: cce2e8db56 ("ath79: add support for TP-Link TL-WR941HP v1")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-07-05 08:53:38 +02:00
Evgeniy Isaev 6c148116f7 ath79: add support for Xiaomi AIoT Router AC2350
Device specifications
* SoC: QCA9563 @ 775MHz (MIPS 74Kc)
* RAM: 128MiB DDR2
* Flash: 16MiB SPI-NOR (EN25QH128)
* Wireless 2.4GHz (SoC): b/g/n, 3x3
* Wireless 5Ghz (QCA9988): a/n/ac, 4x4 MU-MIMO
* IoT Wireless 2.4GHz (QCA6006): currently unusable
* Ethernet (AR8327): 3 LAN × 1GbE, 1 WAN × 1GbE
* LEDs: Internet (blue/orange), System (blue/orange)
* Buttons: Reset
* UART: through-hole on PCB ([VCC 3.3v](RX)(GND)(TX) 115200, 8n1)
* Power: 12VDC, 1,5A

MAC addresses map (like in OEM firmware)
  art@0x0     88:C3:97:*:57  wan/label
  art@0x1002  88:C3:97:*:2D  lan/wlan2g
  art@0x5006  88:C3:97:*:2C  wlan5g

Obtain SSH Access
1. Download and flash the firmware version 1.3.8 (China).
2. Login to the router web interface and get the value of `stok=` from the
   URL
3. Open a new tab and go to the following URL (replace <STOK> with the stok
   value gained above; line breaks are only for easier handling, please put
   together all four lines into a single URL without any spaces):
     http://192.168.31.1/cgi-bin/luci/;stok=<STOK>/api/misystem/set_config_iotdev
       ?bssid=any&user_id=any&ssid=-h%0Anvram%20set%20ssh_en%3D1%0Anvram%20commit
       %0Ased%20-i%20%27s%2Fchannel%3D.%2A%2Fchannel%3D%5C%5C%22debug%5C%5C%22%2F
       g%27%20%2Fetc%2Finit.d%2Fdropbear%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A
4. Wait 30-60 seconds (this is the time required to generate keys for the
   SSH server on the router).

Create Full Backup
1. Obtain SSH Access.
2. Create backup of all flash (on router):
    dd if=/dev/mtd0 of=/tmp/ALL.backup
3. Copy backup to PC (on PC):
    scp root@192.168.31.1:/tmp/ALL.backup ./
Tip: backup of the original firmware, taken three times, increases the
chances of recovery :)

Calculate The Password
* Locally using shell (replace "12345/E0QM98765" with your router's serial
  number):
  On Linux
    printf "%s6d2df50a-250f-4a30-a5e6-d44fb0960aa0" "12345/E0QM98765" | \
    md5sum - | head -c8 && echo
  On macOS
    printf "%s6d2df50a-250f-4a30-a5e6-d44fb0960aa0" "12345/E0QM98765" | \
    md5 | head -c8
* Locally using python script (replace "12345/E0QM98765" with your
  router's serial number):
    wget https://raw.githubusercontent.com/eisaev/ax3600-files/master/scripts/calc_passwd.py
    python3.7 -c 'from calc_passwd import calc_passwd; print(calc_passwd("12345/E0QM98765"))'
* Online
    https://www.oxygen7.cn/miwifi/

Debricking (lite)
If you have a healthy bootloader, you can use recovery via TFTP using
programs like TinyPXE on Windows or dnsmasq on Linux. To switch the router
to TFTP recovery mode, hold down the reset button, connect the power
supply, and release the button after about 10 seconds. The router must be
connected directly to the PC via the LAN port.

Debricking
You will need a full dump of your flash, a CH341 programmer, and a clip
for in-circuit programming.

Install OpenWRT
1. Obtain SSH Access.
2. Create script (on router):
    echo '#!/bin/sh' > /tmp/flash_fw.sh
    echo >> /tmp/flash_fw.sh
    echo '. /bin/boardupgrade.sh' >> /tmp/flash_fw.sh
    echo >> /tmp/flash_fw.sh
    echo 'board_prepare_upgrade' >> /tmp/flash_fw.sh
    echo 'mtd erase rootfs_data' >> /tmp/flash_fw.sh
    echo 'mtd write /tmp/openwrt.bin firmware' >> /tmp/flash_fw.sh
    echo 'sleep 3' >> /tmp/flash_fw.sh
    echo 'reboot' >> /tmp/flash_fw.sh
    echo >> /tmp/flash_fw.sh
    chmod +x /tmp/flash_fw.sh
3. Copy `openwrt-ath79-generic-xiaomi_aiot-ac2350-squashfs-sysupgrade.bin`
   to the router (on PC):
    scp openwrt-ath79-generic-xiaomi_aiot-ac2350-squashfs-sysupgrade.bin \
    root@192.168.31.1:/tmp/openwrt.bin
4. Flash OpenWRT (on router):
    /bin/ash /tmp/flash_fw.sh &
5. SSH connection will be interrupted - this is normal.
6. Wait for the indicator to turn blue.

Signed-off-by: Evgeniy Isaev <isaev.evgeniy@gmail.com>
[improve commit message formatting slightly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-07-05 00:28:04 +02:00
Diogenes Rengo cce2e8db56 ath79: add support for TP-Link TL-WR941HP v1
Specifications:
    SOC:        Qualcomm Atheros TP9343 (750 MHz)
    Flash:      8 Mb (GigaDevice GD25Q64CSIG)
    RAM:        64 Mb (Zentel A3R12E40DBF-8E)
    Serial:     yes, 4-pin header
    Wlan:       Qualcomm Atheros TP9343, antenna: MIM0 3x3:3 RP-SMA
                3 x 2.4GHz power amp module Skyworks (SiGe) SE2576L
    Ethernet:   Qualcomm Atheros TP9343
    Lan speed:  100M ports: 4
    Lan speed:  100M ports: 1
    Other info: same case, ram and flash that TP-Link TL-WR841HP,
                different SOC

    https://forum.openwrt.org/t/adding-device-support-tp-link-wr941hp/

Label MAC addresses based on vendor firmware:
    LAN   *:ee  label
    WAN   *:ef  label +1
    WLAN  *:ee  label

    The label MAC address found in "config" partition at 0x8

Flash instruction:
    Upload the generated factory firmware on web interface.

Signed-off-by: Diogenes Rengo <rengocbx250@gmail.com>
[remove various whitespace issues, squash commits, use short 0x0]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-07-04 18:07:35 +02:00
Russell Senior 12eb5b2384 ath79: add support for Ubiquiti PowerBeam M (XW)
This patch adds support for the Ubiquiti PowerBeam M (XW), e.g. PBE-M5-400,
a 802.11n wireless with a feed+dish form factor. This device was previously
supported by the ar71xx loco-m-xw firmware.

Specifications:
 - Atheros AR9342 SoC
 - 64 MB RAM
 - 8 MB SPI flash
 - 1x 10/100 Mbps Ethernet port, 24 Vdc PoE-in
 - Power and LAN green LEDs
 - 4x RSSI LEDs (red, orange, green, green)
 - UART (115200 8N1)

Flashing via stock GUI:
 - Downgrade to AirOS v5.5.x (latest available is 5.5.10-u2) first (see
   https://openwrt.org/toh/ubiquiti/powerbeam installation instructions)
 - Upload the factory image via AirOS web GUI.

Flashing via TFTP:
 - Use a pointy tool (e.g., unbent paperclip) to keep the
   reset button pressed.
 - Power on the device (keep reset button pressed).
 - Keep pressing until LEDs flash alternatively LED1+LED3 =>
   LED2+LED4 => LED1+LED3, etc.
 - Release reset button.
 - The device starts a TFTP server at 192.168.1.20.
 - Set a static IP on the computer (e.g., 192.168.1.21/24).
 - Upload via tftp the factory image:
    $ tftp 192.168.1.20
    tftp> bin
    tftp> trace
    tftp> put openwrt-ath79-generic-xxxxx-ubnt_powerbeam-m-xw-squashfs-factory.bin

WARNING: so far, no non-destructive method has been discovered for
opening the enclosure to reach the serial console. Internal photos
are available here: https://fcc.io/SWX-NBM5HP

Signed-off-by: Russell Senior <russell@personaltelco.net>
2021-07-04 14:42:08 +02:00
David Bauer 0494278073 ath79: resolve GPIO address conflicts
The ar71xx GPIO driver only uses 0x24 registers, all following GPIO
registers are using to control pinmux functions, which are not handles
by the GPIO driver but the generic Linux pinctrl driver.

For some SoC conflicting address ranges were defined for these (AR7240 &
AR9330).

Resolve these cases and align the address space of the GPIO controller
between all SoCs, as the used address space of the driver is identical
for all these.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-07-01 23:26:49 +02:00
Koen Vandeputte a58bcc9e67 ath79: mikrotik: fix beeper phantom noise on RB912
Analysis done by Denis Kalashnikov:

It seems that some ROS versions on some routerboard models have this bug:
after silence boot (no output to uart, no beeps) beeper clicks when wireless traffic is.

https://forum.mikrotik.com/viewtopic.php?f=3&t=92269
https://forum.mikrotik.com/viewtopic.php?t=63399

From these links:

1)
Hello, I have RB951G-2HnD and I noticed strange thing
when I loaded the device with some wireless traffic it
produced strange sound - like hissing, fizzing etc.

2)
Same problem still on 6.33, with silent boot enabled
I hear buzzing noise on wireless load.

3)
The sound is fixed in v5.19, it was a bug that caused beeper to make clicks.

It also got fixed in RouterOS:

* What's new in 5.19 (2012-Jul-16 10:51):
fix ticking sound on RB411UAHL;

* What's new in 6.38.3 (2017-Feb-07 09:52):
rb3011 - fixed noise from buzzer after silent boot;

I've checked with an oscilloscope that:
* When on the ssr beeper pin is 0,
  on the beeper itself is 1 (~5V),
  and when on the ssr beeper pin is 1,
  on the beeper is 0
  The beeper doesn't consume power,
  so 1 should be a default/idle value for the ssr beeper pin).
* When there is wireless traffic (ping packets)
  in the background and the beeper clicks, I see
  pulses on the beeper itself,
  but no pulses on the ssr beeper pin (Q5 pin of 74hc595).
  When I manually toggle the ssr beeper pin I see pulses on both.
  So, it is likely that the phantom beeper clicks are caused by the EMI.

Suggested-by: Denis Kalashnikov <denis281089@gmail.com>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2021-07-01 11:58:36 +02:00
Hauke Mehrtens 964863bb23 ltq-deu: Mark lantiq DEU broken
When the ltq_deu_vr9 kernel module is loaded, hostapd does not start any
more. It fails with this error message:
daemon.err hostapd: nl80211: kernel reports: key addition failed
daemon.err hostapd: Interface initialization failed

OpenWrt uses the standard Linux crypto API in the wifi drivers now
and this probably makes the system offload more crypto operations to
special hardware like the Lantiq DEU. There is probably a bug in the DEU
and these operations fail and then hostapd does not start the interface.

Do not include the Lantiq DEU by default any more.

Fixes: FS#3901
Fixes: 53b6783907 ("mac80211: remove patches stripping down crypto support")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Notupus <notpp46@gmail.com>
2021-06-30 23:14:43 +02:00
Ansuel Smith 5e52f96714 ipq806x: fix dedicated cpufreq driver
2 small fix for the dedicated cpufreq driver:
- Fix index wrongly used as the current cpu
- Exit early if a bad freq is detected. In the current state the freq
is applied anyway even with invalid state.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-06-30 23:14:43 +02:00
Ansuel Smith 014aac7944 ipq806x: fix missing 1.4ghz cache freq for ipq8065 SoC
With the new implementation of the dedicated cpufreq driver,
the 1.4 Ghz was only dropped and not added to the ipq8065 SoC.
Fix this to improve performance.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-06-30 23:14:43 +02:00
Ansuel Smith aeee1bd2da ipq806x: fix missing changes in 5.4 for new cpufreq implementation
The new cpufreq dedicated driver changed the node structure
on how the cache should be defined in the dts. The 5.4 dtsi addition
patch has not been updated to follow the new implementation.
Fix this to restore correct cache scaling and restore any performance
regression.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-06-30 23:14:43 +02:00
David Bauer 6cf1dfd7e1 ath79: add support for Teltonika RUT230 v1
This commit adds support for the Teltonika RUT230 v1, a Atheros AR9331
based router with a Quectel UC20 UMTS modem.

Hardware
--------
Atheros AR9331
16 MB SPI-NOR XTX XT25F128B
64M DDR2 memory
Atheros AR9331 1T1R 802.11bgn Wireless
Boootloader: pepe2k U-Boot mod

Hardware-Revision
-----------------
There are two board revisions of the RUT230, a v0 and v1.

A HW version is silkscreened on the top of the PCBs front side as well
as shown in the Teltonika UI. However, this looks to be a different
identifier, as the GPl dump shows this silkscreened / UI shown version
are internally treated identically.

Th following mapping has been obtained from the latest GPl dump.

HW Ver   01 - 04 --> v0
HW Ver > 05      --> v1

My board was a HW Ver 09 and is treated as a v1.

Installation
------------
While attaching power, hold down the reset button and release it after
the signal LEDs flashed 3 times.

Attach your Computer with the devices LAN port and assign yourself the
IPv4 address 192.168.1.10/24. Open a web browser, navigate to
192.168.1.1. Upload the OpenWrt factory image.

The device will install OpenWrt and automatically reboots afterwards.

You can use the smae procedure with the stock firmware to return back to
the vendor firmware.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-30 21:39:59 +02:00
Koen Vandeputte 39e53f72f7 ath79: mikrotik: remove rb912 gpio-beeper module dependency
The beeper is currently not fully functional and has also
been removed from DTS.

Also remove the dependency for the gpio-beeper module.

Fixes: 695a1cd53c ("ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2021-06-28 11:07:35 +02:00
John Audia f727005ae9 ipq806x: refresh config for kernel 5.4
* With kernel 5.4.128, ran: make kernel_menuconfig CONFIG_TARGET=generic
* Manually added back CONFIG_LEDS_TRIGGER_DISK=y so as not to revert
  f93fcf8923 ("ipq806x: enable disk-activity LED trigger")

Signed-off-by: John Audia <graysky@archlinux.us>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-28 01:06:08 +02:00
Adrian Schmutzler fac6096ad6 ipq40xx: add missing case closing symbol
Though not strictly necessary, add the closing symbol to make the
job easier for future developers editing this file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-28 01:06:08 +02:00
David Bauer 51b61fd570 ramips: add support for Tenbay T-MB5EU-V01
Hardware
--------
MediaTek MT7621 SoC
256M DDR3
16MB BoHong SPI-NOR
MediaTek MT7905+7975 2x2T2R DBDC bgnax / acax
RGB LED
WPS + RESET Button
UART on compute module (silkscreened / 115200n8)

The router itself is just a board with Power / USB / RJ-45 connectors
and DC/DC converters. The SoC and WiFi components are on a
daughterboard which connect using two M.2 connectors.

The compute module has the model number "T-CB1800K-DM2 V02" printed on
it. The main baord has "T-MB5EU V01" printed on it. This information
might be useful, as it's highly likely either of these two will be
reused in similar designs.

The router itself is sold as Tenbay T-MB5EU directly from the OEM as
well as "KuWFI AX1800 Smart WiFi 6 Eouter" on Amazon.de for ~50€ in a
slightly different case.

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

A Tool for creating a factory image for the Vendor Web Interface can be
found here: https://github.com/blocktrron/t-mb5eu-v01-factory-creator/

As the OEM Firmware is just a modified LEDE 17.01, you can also access
failsafe mode via UART while the OS boots, by connecting to UART
and pressing "f" when prompted. The Router is reachable at
192.168.1.1 via root without password.

Transfer the OpenWrt sysupgrade image via scp and apply with sysupgrade
using the -n and -F flags.

Alternatively, the board can be flashed by attaching to the UART
console, interrupting the boot process by keeping "0" pressed while
attaching power.

Serve the OpenWrt initramfs using a TFTP server with address
192.168.1.66. Rename the initramfs to ax1800.bin.

Attach your TFTP server to one of the LAN ports. Execute the following
commands.

 $ setenv ipaddr 192.168.1.67
 $ setenv serverip 192.168.1.66
 $ tftpboot 0x84000000 ax1800.bin
 $ bootm

Wait for the device to boot. Then transfer the OpenWrt sysupgrade image
to the device using SCP and apply sysupgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-27 21:40:27 +02:00
David Bauer 38db2f12d6 ramips: add AW9523 I2C GPIO expander driver
This adds a driver for the AW9523 I2C GPIO expander.

This driver is required to make LEDs as well as buttons on the Tenbay
T-MB5EU-V01 work.

This driver already had several upstream iterations. I'm working to
push this driver to mainline.

Ref: https://patchwork.ozlabs.org/project/linux-gpio/list/?series=226287

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-27 21:40:15 +02:00
David Bauer 54ed38d5ea ramips: fix AR8033 fiber operation
It was reported AR8033 did not work in fiber operation mode on the ER-X.

While the earlier attempt of fixing this mitigated the issue of 1000
Base-X link mode not being supported, it also switched to the copper
page, breaking fiber operation altogether.

Extend the hack adding fiber operation so it does not switch to the
copper page. Also remove the part where the supported link mode bit for
1000 Base-X is removed, as this is required for fiber operation.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-27 13:19:36 +02:00
David Bauer 1f5afbab5b generic: at803x: mask 1000 Base-X link mode
AR8031/AR8033 have different status registers for copper
and fiber operation. However, the extended status register
is the same for both operation modes.

As a result of that, ESTATUS_1000_XFULL is set to 1 even when
operating in copper TP mode.

Remove this mode from the supported link modes, as this driver
currently only supports copper operation.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-27 13:19:20 +02:00
Martin Blumenstingl b1df48caac lantiq: xrx200: switch the subtarget to the mainline DSA driver
Enable the XRX200 PMAC, GSWIP DSA tag and GSIP DSA drivers in the 5.4
kernel config. Update the existing vr9_*.dts{,i} to use the new
Ethernet and switch drivers. Drop the swconfig package from the xrx200
target because swconfig doesn't manage DSA based switches.

The new /etc/config/network format for the DSA driver is not compatible
with the old (swconfig) based one. Show a message during sysupgrade
notifying users about this change and asking them to start with a fresh
config (or forcefully update and then migrate the config manually).

Failsafe mode can now automatically bring up the first lan interface
based on board.json including DSA based setups. Drop
05_set_preinit_iface_lantiq from the xRX200 sub-target as this is not
needed anymore. For now we are keeping it for the ase, xway and
xway_legacy until there's some confirmation that it can be dropped from
there as well.

While here, some boards also receive minor fixups:
- Use LAN1 as LAN1 (according to a photo this port can also be
  configured as WAN) on the Buffalo WBMR-300HPD. This makes it easier to
  read the port mapping because otherwise we would have LAN{2,3,4} and
  WAN (which was the case for the non-DSA version previously).
- vr9_avm_fritz3390.dts: move the "gpio" comment from port 0 and 1 to
  their corresponding PHYs
- vr9_tplink_vr200.dtsi: move the "gpio" comment from port 0 to PHY 0
- vr9_tplink_tdw89x0.dtsi: move the "gpio" comment from port 0 to PHY 0

Acked-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Tested-by: Notupus <notpp46@googlemail.com> # TD-W9980/DM200/FRITZ 7430
Tested-by: Martin Schiller <ms@dev.tdt.de> # tested on TDT VR2020
Tested-by: Martin Schiller <ms@dev.tdt.de> # tested on TP-Link TD-W8980B
Tested-by: Martin Schiller <ms@dev.tdt.de> # tested on ZyXEL P-2812HNU-F1
Tested-by: Daniel Kestrel <kestrel1974@t-online.de> # tested on Fritzbox 7490
Tested-by: Daniel Kestrel <kestrel1974@t-online.de> # tested on Fritzbox 3490
Tested-by: @jospezial <jospezial@gmx.de> # tested on VGV7510KW22 (o2 Box 6431)
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
2021-06-26 16:05:36 +02:00
John Audia e6bb0b6ad9 kernel: bump 5.4 to 5.4.128
Removed upstreamed:
  mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-06-26 12:49:15 +02:00
John Audia 7ddee03808 kernel: bump 5.4 to 5.4.127
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-06-26 12:49:15 +02:00
John Audia d8dc9f108a kernel: bump 5.4 to 5.4.126
Manually rebased:
  bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch

All other patches automatically rebased.

Signed-off-by: John Audia <graysky@archlinux.us>
2021-06-26 12:49:15 +02:00
John Audia 697e80d12b kernel: bump 5.4 to 5.4.125
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

Signed-off-by: John Audia <graysky@archlinux.us>
2021-06-26 12:45:42 +02:00
Rui Salvaterra b92794f4d0 kernel: bump 5.10 to 5.10.46
Add the new symbol to the generic kconfig.

No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-06-26 12:43:54 +02:00
Alexander Couzens 8569bc5e0d
ramips: ethernet: ralink: rewrite esw_rt3050 to support link states
Ensure the esw is initialized before the ethernet device is sending
packets. Further implement carrier detection similar to mt7620.
If any port has a link, the ethernet device will detect a carrier.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-06-25 12:30:20 +02:00
Alexander Couzens 74c58c9d58 ramips: ethernet: ralink: allow to return EPROBE_DEFER on switch_init
For rt3050 the switch needs to be initialized before the ethernet start sending
packets. Allow switch_init to return -EPROBE_DEFER.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-06-25 10:52:50 +02:00
Alexander Couzens 60fadae62b ramips: ethernet: ralink: move reset of the esw into the esw instead of fe
The esw reset should only done by the esw driver and not by the fe itself.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-06-25 10:52:50 +02:00
Alexander Couzens 694561ae60 ramips: ethernet: ralink: use the reset controller api for esw & ephy
Instead of writing direct into the reset registers.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-06-25 10:52:50 +02:00
Alexander Couzens 3fa01db479 ramips: ethernet: ralink: add fe_reset_fe() to reset fe via reset controller
The dts defines the reset fe for all architectures. However
the soc code used direct register access of the reset controller.
Replace the custom soc reset with a generic fe_reset_fe().

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-06-25 10:52:50 +02:00
Alexander Couzens d50e129399 ramips: ethernet: ralink: add struct fe_priv as context to fe_reset()
The fe_reset function direct access the reset controller instead
using the reset controller api. In preparation to use the
reset controller.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-06-25 10:52:50 +02:00
Rafał Miłecki 3342d574be ipq40xx: specify FritzBox 7530 LAN port label numbers
This helps managing LAN ports.

Ref: https://forum.openwrt.org/t/openwrt-21-02-0-second-release-candidate/98026/121
Fixes: 95b0c07a61 ("ipq40xx: add support for FritzBox 7530")
Cc: David Bauer <mail@david-bauer.net>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-06-24 09:02:31 +02:00
Liu Yu e6b3e77e6e ramips: fix software reboot failure on HILINK HLK-7628N
In the new kernel version 5.X,reboot will fail.

When SOC is reset, flash has not exited the 4-byte address mode,
which causes the operation mode mismatch of flash during boot.Add
broken-flash-reset to make flash exit 4-byte address mode before
SOC reset

Signed-off-by: Liu Yu <f78fk@live.com>
2021-06-23 14:22:19 +08:00
Shiji Yang b843540057 ramips: add missing "pinctrl-names" for Youku YK1
Without this definition ethernet led can work as usual, but it's better to
re-add it. Relying on default values may cause uncontrollable factors.

Fixes: 882a6116d3 ("ramips: improve pinctrl for Youku YK-L1")

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2021-06-23 14:22:19 +08:00
Michael Pratt 2adeada045 ramips: mt7620: disable SOC VLANs for external switches
These boards have AR8327 or QCA8337 external ethernet switch.
The SOC also has it's own internal switch
where VLAN is now enabled by default.

Changes to preinit caused all switches to have VLANs enabled by default
even if they are not configured with a topology in uci_defaults
(see commit f017f617ae)

When both internal and external switches have VLANs,
and the external switch has both LAN and WAN,
the TX traffic from the SOC cannot flow to the tagged port on the external switch
because the VLAN IDs are not matching.

So disable the internal switch VLANs by default on these boards.

Also, add a topology for the internal switch,
so that on LuCI there is not an "unknown topology" warning.

In theory, it may be possible to have LAN ports on both switches
through internal and external PHYs, but there are no known boards that have this.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:19 +08:00
Michael Pratt 88a0cebadf ramips: mt7620: ethernet: use more macros and bump version
Define and use some missing macros,
and use them instead of BIT() or numbers for more readable code.

Add comment for a bit change that seems unrelated to ethernet
but is actually needed (PCIe Root Complex mode).

Remove unknown and unused macro RST_CTRL_MCM
(probably from MT7621 / MT7622)

This is the last of a series of fixes, so bump version.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:19 +08:00
Michael Pratt 26c84b2e46 ramips: mt7620: fix RGMII TXID PHY mode
the register bits for TX delay and RX delay are opposites:
when TX delay bit is set, delay is enabled
when RX delay bit is set, delay is disabled

So, when both bits are unset, it is RX delay
and when both bits are set, it is TX delay

Note: TXID is the default RGMII mode of the SOC

Fixes: 5410a8e295 ("ramips: mt7620: add rgmii delays support")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:19 +08:00
Michael Pratt cc6fd6fbb5 ramips: mt7620: add ephy-disable option to switch driver
Add back the register write to disable internal PHYs
as a separate option in the code that can be set using a DTS property.

Set the option to true by default
when an external mt7530 switch is identified.

This makes the driver more in sync with original SDK code
while keeping the lines separated into different options
to accommodate any board with any PHY layout.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:18 +08:00
Michael Pratt 6972e498d3 ramips: mt7620: move mt7620_mdio_mode() to ethernet driver
The function mt7620_mdio_mode is only called once
and both the function and mdio_mode block have been named incorrectly,
leading to confusion and useless commits.

These lines in the mdio_mode block of mt7620_hw_init
are only intended for boards with an external mt7530 switch.
(see commit 194ca6127e)

Therefore, move lines from mdio_mode to the place in soc_mt7620.c
where the type of mt7530 switch is identified,
and move lines from mt7620_mdio_mode to a main function.

mt7620_mdio_mode was called from mt7620_gsw_init
where the priv struct is available,
so the lines must stay in mt7620_gsw_init function.

In order to keep things as simple as possible,
keep the DTS property related function calls together,
by moving them from mt7620_gsw_probe to init.

Remove the now useless DTS properties and extra phy nodes.

Fixes: 5a6229a93d ("ramips: remove superfluous & confusing DT binding")
Fixes: b85fe43ec8 ("ramips: mt7620: add force use of mdio-mode")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:18 +08:00
Michael Pratt 0976b6c426 ramips: mt7620: use DTS to set PHY base address for external PHYs
Set the PHY base address to 12 for mt7530 and 8 for others,
which is based on the default setting for some devices
from printing the register with the following command
after it is written to by uboot during the boot cycle.

`md 0x10117014 1`

PHY_BASE option only uses 5 bits of the register,
bits 16 to 20, so use 8-bit integer type.

Set the option using the DTS property mediatek,ephy-base
and create the gsw node if missing.

Also, added a kernel message to display the EPHY base address.

Note:
If anything is written to a PHY address that is greater than 1 hex char (greater than 0xf)
then there is adverse effects with Atheros switches.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:18 +08:00
Michael Pratt de5394a29d ramips: mt7620: allow both internal and external PHYs
When the new variable ephy_base was introduced,
it was not applied to the if block for mdio_mode.

The first line in the mdio_mode if block
sets the EPHY base address to 12 in the SOC by writing a register,
but the corresponding variable in the driver
was still set to the default of 0.

This causes subsequent lines that write registers with the function
_mt7620_mii_write
to write to PHY addresses 0 through 4
while internal PHYs have been moved to addresses 12 through 16.

All of these lines are intended only for PHYs on the SOC internal switch,
however, they are being written to external ethernet switches
if they exist at those PHY addresses 0 through 4.
This causes some ethernet ports to be broken on boards with AR8327 or QCA8337 switch.

Other suggested fixes move those lines to the else block of mdio_mode,
but removing the else block completely also fixes it.

Therefore, move the lines to the mt7620_hw_init function main block,
and have only one instance of the function mtk_switch_w32
for writing the register with the EPHY base address.

In theory, this also allows for boards that have both external switches
and internal PHYs that lead to ethernet ports to be supported.

Fixes: 391df37829 ("ramips: mt7620: add EPHY base mdio address changing possibility")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:18 +08:00
Michael Pratt afd60d650e ramips: mt7620: fix ethernet driver GMAC port init
A workaround was added to the switch driver
to set SOC port 4 as an RGMII GMAC interface
based on the DTS property mediatek,port4-gmac.
(previously mediatek,port4)

However, the ethernet driver already does this,
but is being blocked by a return statement
whenever the phy-handle and fixed-link properties
are both missing from nodes that define the port properties.

Revert the workaround, so that both the switch driver
and ethernet driver are not doing the same thing
and move the phy-handle related lines down
so nothing is ending the function prematurely.

While at it, clean up kernel messages
and delete useless return statements.

Fixes: f6d81e2fa1 ("mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possible")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:18 +08:00
Michael Pratt a2acdf9607 ramips: mt7620: remove useless GMAC nodes
These nodes are used for configuring a GMAC interface
and for defining external PHYs to be accessed with MDIO.

None of this is possible on MT7620N, only MT7620A,
so remove them from all MT7620N DTS.

When the mdio-bus node is missing, the driver returns -NODEV
which causes the internal switch to not initialize.
Replace that return so that everything works without the DTS node.

Also, an extra kernel message to indicate for all error conditions
that mdio-bus is disabled.

Fixes: d482356322 ("ramips: mt7620n: add mdio node and disable port4 by default")
Fixes: aa5014dd1a ("ramips: mt7620n: enable port 4 as EPHY by default")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:18 +08:00
Michael Pratt 953bfe2eb3 ramips: mt7620: simplify DTS properties for GMAC
There are only 2 options in the driver
for the function of mt7620 internal switch port 4:

  EPHY mode (RJ-45, internal PHY)
  GMAC mode (RGMII, external PHY)

Let the DTS property be boolean instead of string
where EPHY mode is the default.

Fix how the properties are written
for all DTS that use them,
and add missing nodes where applicable,
and remove useless nodes,
and minor DTS formatting.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-23 14:22:18 +08:00
Hauke Mehrtens b7ee0786b5 realtek: Fix failsafe mode
The RTL8380-RTL9300 switches only forward packets when VLAN ID 1 is
configured. Do not use the standard failsafe configuration for DSA
accessing the default port directly, but configure a switch on the lan1
interface instead.

This will add the VLAN ID 1 configuration to the switch:
$ bridge vlan show
port              vlan-id
lan1              1 PVID Egress Untagged
switch            1 PVID Egress Untagged

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-06-22 23:23:00 +02:00
Hauke Mehrtens 2e17c71095 kernel: Backport patch to automatically bring up DSA master when opening user port
Without this patch we have to manually bring up the CPU interface in
failsafe mode.

This was backported from kernel 5.12.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
2021-06-22 23:23:00 +02:00
Jason A. Donenfeld 2a3b2f59fe kernel-5.4: backport latest patches for wireguard
These are the latest patches that just landed upstream for 5.13, will be
backported by Greg into 5.10 (because of stable@), and are now in the
5.4 backport branch of wireguard: https://git.zx2c4.com/wireguard-linux/log/?h=backport-5.4.y

Cc: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Tested-by: Stijn Segers <foss@volatilesystems.org>
2021-06-22 23:23:00 +02:00