Commit Graph

24005 Commits

Author SHA1 Message Date
John Crispin
2b88563ee5 realtek: update the tree to the latest refactored version
* rename the target to realtek
* add refactored DSA driver
* add latest gpio driver
* lots of arch cleanups
* new irq driver
* additional boards

Signed-off-by: Bert Vermeulen <bert@biot.com>
Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: John Crispin <john@phrozen.org>
2020-11-26 13:29:27 +01:00
John Audia
4e39949dd1 kernel: bump 5.4 to 5.4.80
Removed since could be reverse-applied by quilt and found to be
included upstream:
  backport-5.4/789-net-usb-qmi_wwan-Set-DTR-quirk-for-MR400.patch

All modifications made by update_kernel.sh

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

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Curtis Deptuck <curtdept@me.com> [x86_64 build/run]
2020-11-26 11:17:55 +01:00
Sander Vanheule
f29231ece7 ramips: mt7621: replace missing custom-initramfs-uimage
custom-initramfs-uimage was replaced by calls to uImage, but apparently
mtc_wr1201 was missed in the transistion. Use uImage for this device
too.

Fixes: 9f574b1b87 "ramips: mt7621: drop custom uImage function"

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-26 09:12:57 +01:00
Adrian Schmutzler
b69c21738e treewide: add space before SPDX identifier
Strictly, an SPDX identifier requires a space between the comment
marker and the identifier itself. The choice of the comment marker
itself is irrelevant.

Correct:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

Wrong:

//SPDX-License-Identifier: GPL-2.0-or-later OR MIT

Fix that in the whole tree (actually, only ramips contained wrong
uses).

Found by checkpatch.pl

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 19:34:13 +01:00
Ataberk Özen
4287f73989 ramips: add support for Xiaomi Mi Router 4C
This commit adds support for Xiaomi's Mi Router 4C device.

Specifications:

- CPU: MediaTek MT7628AN (580MHz)
- Flash: 16MB
- RAM: 64MB DDR2
- 2.4 GHz: IEEE 802.11b/g/n with Integrated LNA and PA
- Antennas: 4x external single band antennas
- WAN: 1x 10/100M
- LAN: 2x 10/100M
- LEDs: 2x yellow/blue. Programmable (labelled as power on case)
                      - Non-programmable (shows WAN activity)
- Button: Reset

How to install:

1- Use OpenWRTInvasion to gain telnet and ftp access.
2- Push openwrt firmware to /tmp/ using ftp.
3- Connect to router using telnet. (IP: 192.168.31.1 -
   Username: root - No password)
4- Use command "mtd -r write /tmp/firmware.bin OS1" to flash into
   the router..
5- It takes around 2 minutes. After that router will restart itself
   to OpenWrt.

Signed-off-by: Ataberk Özen <ataberkozen123@gmail.com>
[wrap commit message, bump PKG_RELEASE for uboot-envtools, remove
dts-v1 from DTS, fix LED labels]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 19:34:13 +01:00
Tomasz Maciej Nowak
30c95c4d26 tegra: sysupgrade: use get_image_dd wrapper
This function eliminates false-positive errors emitted by dd.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
[drop argument check changes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 18:42:59 +01:00
Tomasz Maciej Nowak
fa9e8a008a tegra: sysupgrade: remove redundant MBR check
This is already done by get_partitions.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
[add "redundant" to title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 18:39:12 +01:00
Tomasz Maciej Nowak
456f5680db mvebu: sysupgrade: use get_image_dd wrapper
This function eliminates false-positive errors emitted by dd.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-11-25 18:18:54 +01:00
Tomasz Maciej Nowak
f06adb64bf mvebu: sysupgrade: remove redundant MBR check
This is already done by get_partitions.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
[add "redundant" to title, remove declaration of magic variable]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 18:13:54 +01:00
Sander Vanheule
8582e15616 rtl838x: drop custom mkimage build function
UIMAGE_MAGIC is now supported by Build/uImage, in addition to
UIMAGE_NAME. This removes the need for a custom mkimage call, so let's
remove it.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-25 16:34:56 +01:00
Sander Vanheule
ab1584a797 ath79: netgear: trim down uImage customisations
Replace NETGEAR_KERNEL_MAGIC by UIMAGE_MAGIC to better match the
variable's purpose. This allows to drop the custom
Build/netgear-uImage.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
[keep UIMAGE_MAGIC definitions even for default value]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 16:33:49 +01:00
Sander Vanheule
9f574b1b87 ramips: mt7621: drop custom uImage function
Use the mkimage argument overrides provided by uImage to implement the
customisations required for the initramfs, instead of the near-identical
custom function.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-25 15:51:22 +01:00
Tomasz Maciej Nowak
4a243ae332 mvebu: base-files: move additional files to subtargets
Both of these scripts are only relevant to cortexa9, therefore move them
there.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-11-25 13:58:29 +01:00
Tomasz Maciej Nowak
92b3efec54 mvebu: sort patches
Sort patches according to target/linux/generic/PATCHES. Additionally:
- replace hashes in backported patches with the ones from main Linux tree
- add descriptions to some patches

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
[remove 004-add_sata_disk_activity_trigger.patch separately]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 13:57:50 +01:00
Adrian Schmutzler
bffb30603c mvebu: remove redundant patch for Linksys LED trigger
Remove 004-add_sata_disk_activity_trigger.patch, as the trigger is
already added in shared dtsi.

Suggested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 13:48:01 +01:00
Filip Moc
b641eb6ecf ramips: add support for TP-Link MR6400 v5
TL-MR6400v5 is very similar to TL-MR6400v4. Main differences are:
  - smaller form factor
  - different LED GPIOs
  - different switch connections

You can flash via tftp recovery:
 - serve tftp-recovery image as /tp_recovery.bin on 192.168.0.225/24
 - connect to any ethernet port
 - power on the device while holding the reset button
 - wait at least 8 seconds before releasing reset button

Flashing via OEM web interface does not work.

LTE module does not support DHCP so it must be configured via QMI.

Hardware Specification (v5.0 EU):
 - SoC: MT7628NN
 - Flash: Winbond W25Q64JVS (8MiB)
 - RAM: ESMT M14D5121632A (64MiB)
 - Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna)
 - Ethernet: 1NIC (4x100M)
 - WWAN: TP-LINK LTE MODULE (2x external detachable antenna)
 - Power: DC 9V 0.85A

Signed-off-by: Filip Moc <lede@moc6.cz>
2020-11-25 13:23:06 +01:00
Michael Pratt
b31aaa0580 ath79: add support for Senao Engenius EAP300 v2
FCC ID: A8J-EAP300A

Engenius EAP300 v2 is an indoor wireless access point with a
100/10-BaseT ethernet port, 2.4 GHz wireless, internal antennas,
and 802.3af PoE.

**Specification:**

  - AR9341
  - 40 MHz reference clock
  - 16 MB FLASH			MX25L12845EMI-10G
  - 64 MB RAM
  - UART at J1			(populated)
  - Ethernet port with POE
  - internal antennas
  - 3 LEDs, 1 button		(power, eth, wlan) (reset)

**MAC addresses:**

  phy0  *:d3   art 0x1002 (label)
  eth0  *:d4   art 0x0/0x6

**Installation:**

  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

  OEM webpage at 192.168.1.1
  username and password "admin"
  Navigate to "Firmware" page from left pane
  Click Browse and select the factory.bin image
  Upload and verify checksum
  Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

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

**Return to OEM:**

  If you have a serial cable, see Serial Failsafe instructions

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

  The easiest way to return to the OEM software is the Failsafe image
  If you dont have a serial cable, you can ssh into openwrt and run

  `mtd -r erase fakeroot`

  Wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

**TFTP recovery** (unstable / not reliable):

  rename initramfs to 'vmlinux-art-ramdisk'
  make available on TFTP server at 192.168.1.101
  power board while holding or pressing reset button repeatedly

  NOTE: for some Engenius boards TFTP is not reliable
  try setting MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software of EAP300 v2 is a heavily modified version
  of Openwrt Kamikaze. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names
  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring.

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

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

Signed-off-by: Michael Pratt <mcpratt@pm.me>
[clarify MAC address section, bump PKG_RELEASE for uboot-envtools]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 13:23:06 +01:00
Rui Salvaterra
f1c6523376 lantiq: clean up target/subtarget features
The feature "squashfs" is defined for target and all subtargets
individually. Remove the redundant entries in the subtargets.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[split patch, adjust commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 13:23:06 +01:00
Rui Salvaterra
8e8fcce609 apm821xx: clean up target/subtarget features
Move features common to all subtargets to the parent target.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[split patch to make it target-specific, adjust commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 13:23:06 +01:00
Filip Moc
4f4f6def0e ramips: add license to TP-Link MR6400 v4's DTS
Signed-off-by: Filip Moc <lede@moc6.cz>
2020-11-25 13:23:06 +01:00
Matthew Gyurgyik
aab36200e7 imagebuilder: fix partition signature
When building images with the imagebuilder, the partition signature
never changes. The signature is generated by hashing SOURCE_DATE_EPOCH
and LINUX_VERMAGIC which are undefined. Prepopulate these variables, as
done by the SDK.

Signed-off-by: Matthew Gyurgyik <matthew@gyurgyik.io>
2020-11-24 14:46:05 -10:00
Tomasz Maciej Nowak
bc64b9c32e treewide: update email address of Tomasz Maciej Nowak
Replace my o2.pl email address.

I'm still available at the old address.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[rephrase commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-24 15:39:07 +01:00
John Audia
9100566267 kernel: bump 5.4 to 5.4.79
Manually rebased patches:
  ath79/patches-5.4/910-unaligned_access_hacks.patch
  bcm27xx/patches-5.4/950-0135-spi-spi-bcm2835-Disable-forced-software-CS.patch
  bcm27xx/patches-5.4/950-0414-SQUASH-Fix-spi-driver-compiler-warnings.patch
  ipq806x/patches-5.4/093-4-v5.8-ipq806x-PCI-qcom-Use-bulk-clk-api-and-assert-on-error.patch

Removed since could be reverse-applied by quilt and found to be included upstream:
  ipq806x/patches-5.4/096-PCI-qcom-Make-sure-PCIe-is-reset-before-init-for-rev.patch

All modifications made by update_kernel.sh

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

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[refresh altered targets after rebase]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-24 15:36:59 +01:00
Yanase Yuki
cba79b1de2 ath79: move device specific nodes to DTS files for Devolo 1xxx
qca9558_devolo_dvl1xxx.dtsi contains device specific nodes which
are inherited for some DTS files and overwritten for others.

This is considered confusing, so move the relevant nodes/properties
to the devices and only keep the shared stuff in the DTSI.

Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
[clarify commit title/message, move &gmac_config in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-24 14:40:55 +01:00
Sander Vanheule
b0ecae504b ath79: support for TP-Link EAP225 v3
TP-Link EAP225 v3 is an AC1350 (802.11ac Wave-2) ceiling mount access
point. Serial port access for debricking requires fine soldering.

Device specifications:
* SoC: QCA9563 @ 775MHz
* RAM: 128MiB DDR2
* Flash: 16MiB SPI-NOR
* Wireless 2.4GHz (SoC): b/g/n, 3x3
* Wireless 5Ghz (QCA9886): a/n/ac, 2x2 MU-MINO
* Ethernet (AR8033): 1× 1GbE, 802.3at PoE

Flashing instructions:
* ssh into target device and run `cliclientd stopcs`
* Upgrade with factory image via web interface

Debricking:
* Serial port can be soldered on PCB J3 (1: TXD, 2: RXD, 3: GND, 4: VCC)
    * Bridge unpopulated resistors R225 (TXD) and R237 (RXD).
      Do NOT bridge R230.
    * Use 3.3V, 115200 baud, 8n1
* Interrupt bootloader by holding CTRL+B during boot
* tftp initramfs to flash via LuCI web interface
    setenv ipaddr 192.168.1.1 # default, change as required
    setenv serverip 192.168.1.10 # default, change as required
    tftp 0x80800000 initramfs.bin
    bootelf $fileaddr

MAC addresses:
MAC address (as on device label) is stored in device info partition at
an offset of 8 bytes. ath9k device has same address as ethernet, ath10k
uses address incremented by 1.
From OEM boot log:

    Using interface ath0 with hwaddr b0:...:3e and ssid "..."
    Using interface ath10 with hwaddr b0:...:3f and ssid "..."

Tested by forum user blinkstar88

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-23 22:53:15 +01:00
Sander Vanheule
4f86edf477 ath79: support for TP-Link EAP225-Outdoor v1
TP-Link EAP225-Outdoor v1 is an AC1200 (802.11ac Wave-2) pole or wall
mount access point. Debricking requires access to the serial port, which
is non-trivial.

Device specifications:
* SoC: QCA9563 @ 775MHz
* Memory: 128MiB DDR2
* Flash: 16MiB SPI-NOR
* Wireless 2.4GHz (SoC): b/g/n 2x2
* Wireless 5GHz (QCA9886): a/n/ac 2x2 MU-MIMO
* Ethernet (AR8033): 1× 1GbE, PoE

Flashing instructions:
* ssh into target device with recent (>= v1.6.0) firmware
* run `cliclientd stopcs` on target device
* upload factory image via web interface

Debricking:
To recover the device, you need access to the serial port. This requires
fine soldering to test points, or the use of probe pins.
* Open the case and solder wires to the test points: RXD, TXD and TPGND4
  * Use a 3.3V UART, 115200 baud, 8n1
* Interrupt bootloader by holding ctrl+B during boot
* upload initramfs via built-in tftp client and perform sysupgrade
    setenv ipaddr 192.168.1.1 # default, change as required
    setenv serverip 192.168.1.10 # default, change as required
    tftp 0x80800000 initramfs.bin
    bootelf $fileaddr

MAC addresses:
MAC address (as on device label) is stored in device info partition at
an offset of 8 bytes. ath9k device has same address as ethernet, ath10k
uses address incremented by 1.
From stock ifconfig:

    ath0      Link encap:Ethernet  HWaddr D8:...:2E
    ath10     Link encap:Ethernet  HWaddr D8:...:2F
    br0       Link encap:Ethernet  HWaddr D8:...:2E
    eth0      Link encap:Ethernet  HWaddr D8:...:2E

Tested by forum user PolynomialDivision on firmware v1.7.0.
UART access tested by forum user arinc9.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-23 22:53:15 +01:00
Sander Vanheule
b11ad48764 ath79: support for TP-Link EAP245 v1
TP-Link EAP245 v1 is an AC1750 (802.11ac Wave-1) ceiling mount access point.

Device specifications:
* SoC: QCA9563 @ 775MHz
* RAM: 128MiB DDR2
* Flash: 16MiB SPI-NOR
* Wireless 2.4GHz (SoC): b/g/n, 3x3
* Wireless 5Ghz (QCA9880): a/n/ac, 3x3
* Ethernet (AR8033): 1× 1GbE, 802.3at PoE

Flashing instructions:
* Upgrade the device to firmware v1.4.0 if necessary
* Exploit the user management page in the web interface to start telnetd
  by changing the username to `;/usr/sbin/telnetd -l/bin/sh&`.
* Immediately change the malformed username back to something valid
  (e.g. 'admin') to make ssh work again.
* Use the root shell via telnet to make /tmp world writeable (chmod 777)
* Extract /usr/bin/uclited from the device via ssh and apply the binary
  patch listed below. The patch is required to prevent `uclited -u` in
  the last step from crashing.
* Copy the patched uclited programme back to the device at /tmp/uclited
  (via ssh)
* Upload the factory image to /tmp/upgrade.bin (via ssh)
* Run `chmod +x /tmp/uclited && /tmp/uclited -u` to install OpenWrt.

    --- xxd uclited
    +++ xxd uclited-patched
    @@ -53796,7 +53796,7 @@
     000d2240: 8c44 0000 0320 f809 0000 0000 8fbc 0010  .D... ..........
     000d2250: 8fa6 0a4c 02c0 2821 8f82 87b8 0000 0000  ...L..(!........
    -000d2260: 8c44 0000 0c13 45e0 27a7 0018 8fbc 0010  .D....E.'.......
    +000d2260: 8c44 0000 2402 0000 0000 0000 8fbc 0010  .D..$...........
     000d2270: 1040 001d 0000 1821 8f99 8374 3c04 0058  .@.....!...t<..X
     000d2280: 3c05 0056 2484 a898 24a5 9a30 0320 f809  <..V$...$..0. ..

Debricking:
* Serial port can be soldered on PCB J3 (1: TXD, 2: RXD, 3: GND, 4: VCC)
    * Bridge unpopulated resistors R225 (TXD) and R237 (RXD).
      Do NOT bridge R230.
    * Use 3.3V, 115200 baud, 8n1
* Interrupt bootloader by holding CTRL+B during boot
* tftp initramfs to flash via the LuCI web interface
    setenv ipaddr 192.168.1.1 # default, change as required
    setenv serverip 192.168.1.10 # default, change as required
    tftp 0x80800000 initramfs.bin
    bootelf $fileaddr

Tested on the EAP245 v1 running the latest firmware (v1.4.0). The binary
patch might not apply to uclited from other firmware versions.

EAP245 v1 device support was originally developed and maintained by
Julien Dusser out-of-tree. This patch and "ath79: prepare for 1-port
TP-Link EAP2x5 devices" are based on that work.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-23 22:53:15 +01:00
Sander Vanheule
7a875d155e ath79: prepare for 1-port TP-Link EAP2x5 devices
TP-Link has developed a number of access points based on the AP152
reference board. In the EAP-series of 802.11ac access points, this
includes the following devices with one ethernet port:
* EAP225 v1/v2
* EAP225 v3
* EAP225-Outdoor v1
* EAP245 v1

Since the only differences between these devices are the ath10k wireless
radios and LEDs, a common base is provided for the overlapping support
requirements.

Hardware commonalities:
* SoC: QCA9563-AL3A MIPS 74kc v5.0 @ 775MHz, AHB @ 258MHz
* RAM: 128MiB DDR2 @ 650MHz
* Flash: 16MiB SPI NOR
* Wi-Fi 2.4GHz: provided by SoC
* Wi-Fi 5Ghz: ath10k chip on PCIe
* Ethernet: AR8033-AL1A, one 1GbE port (802.3at PoE)

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-23 22:53:15 +01:00
Julien Dusser
87627b2d76 ath79: add QCA956x SERDES init workaround
This commit add a workaround for non working SGMII link observed on some
QCA956x SoCs. The workaround originates part from the U-Boot source code
from QCA, part from the implementation from TP-Link found in the GPL
tarball for the EAP245v1.

Extends commit 0d416a8d3b for QCA956x.
Note that reset is the same on QCA955x and QCA956x, same register offset
and values.

Auto calibration is done on u-boot, but always fall back to default value
0x7. Add a DTS entry serdes-cal in case a device require another value.

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
[Sander Vanheule:
    Minor code style fixes,
    Remove hunk adding qca956x-serdes-fixup to a missing DTS,
    Remove variable err that was only assigned,
    Rename function to sgmii_serdes_init,
    Lower priority of serdes call message to pr_debug]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-23 22:53:15 +01:00
Sander Vanheule
8dd2a1715b ath79: ensure QCA956x gmac0 mux selects sgmii
Some bootloaders do not set up gmac0 properly, leaving it disconnected
from the sgmii interface. If the user specificies phy-mode sgmii, then
use the gmac-config/device node to ensure the mux is configured
correctly.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-11-23 22:53:15 +01:00
Vladimir Vid
c0af4a0ca2 mvebu: add initial support for Globalscale ESPRESSObin-Ultra
This patch adds support for Globalscale ESPRESSObin-Ultra. Device uses
the same Armada-3720 SoC with extended hardware support.

- SoC: Armada-3720
- RAM: 1 GB DDR4
- Flash: 4MB SPI NOR (mx25u3235f) + 8 GB eMMC
- Ethernet: Topaz 6341 88e6341 (4x GB LAN + 1x WAN with 30W PoE)
- WiFI: 2x2 802.11ac Wi-Fi marvell (88w8997 PCIe+USB)
- 1x USB 2.0 port
- 1x USB 3.0 port
- 1x microSD slot
- 1x mini-PCIe slot (USB [with nano-sim slot])
- 1x mini-USB debug UART
- 1x RTC Clock and battery
- 1x reset button
- 1x power button
- 4x LED (RGBY)
- Optional 1x M.2 2280 slot

** Installation **

Copy dtb from build_dir to bin/ and run tftpserver there:
$ cp ./build_dir/target-aarch64_cortex-a53_musl/linux-mvebu_cortexa53/
linux-5.4.65/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dtb
bin/targets/mvebu/cortexa53/
$ in.tftpd -L -s bin/targets/mvebu/cortexa53/

Connect to the device UART via microUSB port on the back side and power on the device.

Power on the device and hit any key to stop the autoboot.

Set serverip (host IP) and ipaddr (any free IP address on the same subnet), e.g:
$ setenv serverip 192.168.1.10 # Host
$ setenv ipaddr 192.168.1.15 # Device

Ping server to confirm network is working:
$ ping $serverip
Using neta@30000 device
host 192.168.1.15 is alive

Tftpboot the firmware:
$ tftpboot $kernel_addr_r openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-initramfs-kernel.bin
$ tftpboot $fdt_addr_r armada-3720-espressobin-ultra.dtb

Set the console and boot the image:
$ setenv bootargs $console
$ booti $kernel_addr_r - $fdt_addr_r

Once the initramfs is booted, transfer openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-squashfs-sdcard.img.gz
to /tmp dir on the device.

Gunzip and dd the image:
$ gunzip /tmp/openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-squashfs-sdcard.img.gz
$ dd if=/tmp/openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-squashfs-sdcard.img of=/dev/mmcblk0 && sync

Reboot the device.

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
2020-11-23 22:53:15 +01:00
Pawel Dembicki
cdff729b27 layerscape: enable spi-uart in LS1012A-FRDM
This patch add missing support of SC16IS740 serial controller, installed
on LS1012A-FRDM board.

It was required to change RCW bits, because SPI was disabled by default.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2020-11-23 22:53:15 +01:00
Pawel Dembicki
4dc27a026b layerscape: add i2c peripherials on LS1012A-RDB
LS1012A-RDB equipped in some i2c devices:
  - 3x GPIO Expander: PCAL9555A (NXP)
  - Gyro: FXAS21002 (NXP)
  - Accelerometer: FXOS8700 (NXP)
  - Current & Power Monitor: INA220 (TI)

This patch enables i2c peripherials installed on LS1012A-RDB.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2020-11-23 22:53:15 +01:00
Pawel Dembicki
65f8d7360c layerscape: make initramfs kernel fit packed
This will make developing process easier, because dtb will be included
into image.
Not need to enable initramfs image by default.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2020-11-23 22:53:15 +01:00
René van Dorst
6e1a4496f5 ramips: phy: at803x: Select SFP interface mode that both sides supports.
Currently sfp_select_interface() return the fastest interface that
the sfp modules supports even if the phy don't support that mode.

For example an GPON module that support both 2500basex and 1000basex.
Currently sfp_select_interface() picks 2500basex instead of 1000basex.

So limit the interfaces which both sides supports before calling
sfp_select_interface() or return an error if we don't have match.

Reviewed-by: John Thomson <git@johnthomson.fastmail.com.au>
Tested-by: Braihan Cantera <bcanterac@gmail.com> [MikroTik RB760iGS + Nokia G-010S-A 3FE46541AA SFP]
Tested-by: John Thomson <git@johnthomson.fastmail.com.au> [Mikrotik rb760igs + SFP SM/LC, SFP base1000T, SFP+ passive DAC]
Signed-off-by: René van Dorst <opensource@vdorst.com>
2020-11-23 22:53:15 +01:00
Sven Eckelmann
223eec7e81 kernel: mtd: parser: cmdline: Fix parsing of part-names with colons
Some devices (especially QCA ones) are already using hardcoded partition
names with colons in it. The OpenMesh A62 for example provides following
mtd relevant information via cmdline:

  root=31:11 mtdparts=spi0.0:256k(0:SBL1),128k(0:MIBIB),384k(0:QSEE),64k(0:CDT),64k(0:DDRPARAMS),64k(0:APPSBLENV),512k(0:APPSBL),64k(0:ART),64k(custom),64k(0:KEYS),0x002b0000(kernel),0x00c80000(rootfs),15552k(inactive) rootfsname=rootfs rootwait

The change to split only on the last colon between mtd-id and partitions
will cause newpart to see following string for the first partition:

  KEYS),0x002b0000(kernel),0x00c80000(rootfs),15552k(inactive)

Such a partition list cannot be parsed and thus the device fails to boot.

Avoid this behavior by making sure that the start of the first part-name
("(") will also be the last byte the mtd-id split algorithm is using for
its colon search.

Fixes: d6a9a92e32 ("kernel: bump 5.4 to 5.4.69")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-11-23 22:53:15 +01:00
Sven Eckelmann
8231994d3f ipq40xx: DTS style updates for OpenMesh devices
The OpenMesh related files were not updated since a while and the new
coding style requirements weren't integrated. This can cause problems
for new devices when an author uses these files as starting point.

* use SPDX-License-Identifiers instead of full license texts
* drop linux,default-trigger with value default-off for LEDs
* led nodes with label "abc:xyz" should have name "xyz_abc"
* led DT labels for "xyz_abc" should be "led_xyz_abc"
* "m25p80@0" flash node should be renamed to "flash@0"
* drop unnecessary empty lines

Signed-off-by: Sven Eckelmann <sven@narfation.org>
[minor commit title and message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-23 13:44:47 +01:00
Rui Salvaterra
eb087ae4f4 ath79: move the squashfs feature to the parent target
All subtargets define it. Move it to the parent target and remove
it from all subtargets.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2020-11-23 13:20:53 +01:00
Paulo Machado
b19a684f46 imagebuilder: fix main entry makefile
Remove a syntax error from ImageBuider Makefile

Acked-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Paulo Machado <pffmachado@yahoo.com>
2020-11-23 03:13:46 +00:00
Filip Moc
0d65177658 ramips: add support for TP-Link MR6400 v4
You can flash via tftp recovery:
 - serve tftp-recovery image as /tp_recovery.bin on 192.168.0.225/24
 - connect to any ethernet port
 - power on the device while holding the reset button
 - wait at least 8 seconds before releasing reset button

Flashing via OEM web interface does not work.

LTE module does not support DHCP so it must be configured via QMI.

Hardware Specification (v4.0 EU):
 - SoC: MT7628NN
 - Flash: Winbond W25Q64JVS (8MiB)
 - RAM: ESMT M14D5121632A (64MiB)
 - Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna)
 - Ethernet: 1NIC (4x100M)
 - WWAN: TP-LINK LTE MODULE (2x external detachable antenna)
 - Power: DC 9V 0.85A

Signed-off-by: Filip Moc <lede@moc6.cz>
2020-11-23 00:46:40 +00:00
Filip Moc
1e69106e34 generic: add DTR quirk patch for MR400 LTE
This is required for LTE module MR400 in TL-MR6400 v4.

Signed-off-by: Filip Moc <lede@moc6.cz>
2020-11-23 00:45:44 +00:00
Paul Spooren
418362b1cc imagebuilder: add package signature verification
The ImageBuilder downloads pre-built packages and adds them to images.
This process uses `opkg` which has the capability to verify package list
signatures via `usign`, as enabled per default on running OpenWrt
devices.

Until now this was disabled for ImageBuilders because neither the `opkg`
keys nor the `opkg-add` script was present during first packagelist
update.

To harden the ImageBuilder against *drive-by-download-attacks* both keys
and verification script are added to the ImageBuilder allowing `opkg` to
verify downloaded package indices.

This commit adds `opkg-add` to the ImageBuilder scripts folder. The keys
folder is added to ImageBuilder $TOPDIR to have an obvious place for users to
store their own keys. The `option check_signature` is appended to the
repositories.conf file. All of the above only happens if the Buildbot
runs with the SIGNATURE_CHECK option.

The keys stored in the ImageBuilder keys/ are the same as included in
the openwrt-keyring package. To avoid the chicken-egg problem of
downloading and verifying a package, containing signing keys, the keys
are added during the ImageBuilder generation. They are same as in
shipped images (stored at `/etc/opkg/keys/`).

To allow a local package feed in which the user can add additional
packages, a local set of `usign` and `ucert` keys is generated, same as
building OpenWrt from source. The private key signs the local repository
inside the packages/ folder. The local public key is added to the keys/
folder to be considered by `opkg` when updating repositories. This way a
local package feed can be modified while requiring `opkg` to check
signatures for remote feed, making HTTPS optional.

The new option `ADD_LOCAL_KEY` allows to add the local key inside the
created images, adding the advantage that sysupgrades can validate the
ImageBuilders local key.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-19 22:15:00 +00:00
Marc Egerton
f276395cda ramips: add support for the Hak5 WiFi Pineapple Mark 7
This patch adds support for the WiFi Pineapple Mark 7, a wireless
penetration testing tool.

Specifications:
    * SoC: MediaTek MT7628 (580MHz)
    * RAM: 256MiB (DDR2)
    * Storage 1: 32MiB NOR (SPI)
    * Storage 2: 2GB eMMC
    * Wireless 1: 802.11b/g/n 2.4GHz (Built In)
    * Wireless 2: 802.11b/g/n 2.4GHz (MT7601)
    * Wireless 3: 802.11b/g/n 2.4GHz (MT7601)
    * USB: 1x USB Type-A 2.0 Host Port
    * Ethernet: 1x USB Type-C AX88772C Ethernet
    * UART: 57600 8N1 on PCB
    * Inputs: 1x Reset Button
    * Outputs: 1x RGB LED
    * FCCID: 2AA52MK7

Flash Instructions:
    Original firmware is based on OpenWRT.
    Use sysupgrade via SSH to flash.

Signed-off-by: Marc Egerton <foxtrot@realloc.me>
[pepe2k@gmail.com: set only required/used gpio groups to gpio function]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
a92d55efcf ath79: fix reset button support on 8devices Lima
This fixes 'linux,code' property name and value for the 'reset' key node
in 8devices Lima DTS file.

Problem and solution were reported on the forum, see:
https://forum.openwrt.org/t/resetbutton-not-working-ath79-8devices-lima/78810

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
6d65e3af9b ath79: calculate Eth MACs from WLAN on ALFA Network R36A
New batches of the R36A board series might no longer keep separated
Ethernet MAC addresses stored in flash. Use same approach as on the
N2Q and calculate Ethernet MACs from WLAN one which is kept in ART.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
64a6f4a9c1 ath79: add support for ALFA Network Pi-WiFi4
ALFA Network Pi-WiFi4 is a Qualcomm QCA9531 v2 based, high-power 802.11n
WiFi board in Raspberry Pi 3B shape, equipped with 1x FE and 4x USB 2.0.

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16+ MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 2T2R 2.4 GHz Wi-Fi with Qorvo RFFM8228P FEM
- 2x IPEX/U.FL connectors on PCB
- 4x USB 2.0 Type-A
- Genesys Logic GL850G 4-port USB HUB
- USB power is controlled by GPIO
- 5x LED (3x on PCB, 2x in RJ45, 4x driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- 1x micro USB Type-B for power and system console (Holtek HT42B534)
- UART and GPIO (8-pin, 1.27 mm pitch) header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Piotr Dymacz
d44463b087 ath79: add label MAC address for ALFA Network N5Q
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
Adrian Schmutzler
e0cc68daad ramips: use m25p,fast-read on Xiaomi Mi Router 4A Gb/3G v2
The Xiaomi Mi Router 4A Gigabit model has a race condition on bootup
causing the SQUASHFS data errors to appear and create a bootloop
scenario.

Adding the m25p,fast-read property resolves this issue.

Suggested-by: David Bentham <db260179@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-18 21:13:46 +01:00
John Audia
667f6c7f49 kernel: bump 5.4 to 5.4.77
Manually rebased patches:
 bcm27xx/patches-5.4/950-0135-spi-spi-bcm2835-Disable-forced-software-CS.patch
 generic-backport/744-v5.5-net-sfp-soft-status-and-control-support.patch
 layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch
 mvebu/patches-5.4/521-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch

Removed:
 layerscape/patches-5.4/819-uart-0012-tty-serial-lpuart-add-LS1028A-support.patch

All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711,
              lantiq/Easybox 904 xDSL, x86_64
Run-tested: ipq806x/R7800, lantiq/Easybox 904 xDSL, x86_64

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-18 21:13:46 +01:00
Nick Hainke
79f3f1358b ath79: Add support for Ubiquiti NanoBeam AC Gen2
CPU:         Atheros AR9342 rev 3 SoC
RAM:         64 MB DDR2
Flash:       16 MB NOR SPI
WLAN 2.4GHz: Atheros AR9342 v3 (ath9k)
WLAN 5.0GHz: QCA988X
Ports:       2x GbE

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

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

To keep it consistent, we will add the gen1 variant to
the nanobeam ac gen1.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-11-18 21:13:46 +01:00
Adrian Schmutzler
aafbfc6ac3 ath79: fix missing ";;" in 11-ath10k-caldata
This adds a missing ";;" in the switch-case in 11-ath10k-caldata.

Fixes: 4d36569b9c ("ath79: fix ath10k caldata extraction on some
D-Link DIR-842 C3 devices")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-16 19:26:25 +01:00
Paul Fertser
4d36569b9c ath79: fix ath10k caldata extraction on some D-Link DIR-842 C3 devices
According to forum threads [0][1] and a report on IRC by Doc-Saintly
some of those boards have calibration data in a different place. Only
one alternative location is known.

Without proper board calibration data (board.bin having all 0xff bytes)
ath10k firmware still tries to load but crashes on startup with a
confusing error message.

If you're applying this patch manually on your device do not forget to
remove /lib/firmware/ath10k/pre-cal-pci-0000:00:00.0.bin and reboot to
force caldata re-extraction.

[0] https://forum.openwrt.org/t/support-for-d-link-dir842-rev-c3/41654
[1] https://forum.openwrt.org/t/d-link-dir-842-cant-access-firmware-upload-form/65454

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2020-11-16 14:05:24 +01:00
DENG Qingfang
03d178727a kernel: remove mvsw61xx swconfig driver
All targets that used mvsw61xx have switched to upstream mv88e6xxx DSA
driver, so it can be removed.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
2020-11-16 13:55:05 +01:00
Adrian Schmutzler
7661b83768 mediatek: fix mixed indent in DTS files
mediatek frequently had mixed indent (tabs vs. spaces) in DTS files
and DTS file kernel patches (probably due to careless copy/paste).

The harmonizes these cases to tabs-only, as usual for DTS(I).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-16 13:43:39 +01:00
Adrian Schmutzler
2658008a2a treewide: remove default-state off for LEDs
default-state = "off" is default for LEDs, no need to specify it
explicitly.

https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/common.yaml

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-16 13:43:39 +01:00
Daniel González Cabanelas
4e885dd90a mvebu: LS421DE: improve the HDD leds
Improve the HDD LEDs used for disk activity:
 - Use the trigger activity per ata channel

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2020-11-16 13:43:39 +01:00
DENG Qingfang
fe1f11ce32 ramips: mt7621: fix Telco X1 GPIO switches
The GPIO base of MT7621 GPIO 0~31 is 480 on kernel 5.4
Fix the GPIO numbering.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
2020-11-16 13:43:39 +01:00
Paul Spooren
47e089e30e bcm27xx: add bit variant to redundant RaspberryPi
Both bcm2709 and bcm2710 firmware can run on the same RaspberryPi
models, varying however in 32 and 64 Bit architectures. The model name
alone does not include the architecture information, which becomes
problematic if looking at a overview that only contains the names. By
adding a variant it is possible to tell the architecture.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-15 00:24:12 +00:00
Adrian Schmutzler
95b0751d0f ipq40xx: do not remove pci@40000000 for ap.dk04.1
This pci@40000000 node from upstream was dropped when the device
was converted from local DTS(I) files to kernel patches in [1] to
ensure that change was purely cosmetic.

However, the DK04.1 has a PCI-E slot by default, so let's keep
(i.e. not remove) the kernel definition now.

[1] c4beac9ea2 ("ipq40xx: use upstream DTS files for IPQ4019/AP-DK04.1")

Suggested-by: Robert Marko <robert.marko@sartura.hr>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-13 18:34:41 +01:00
Robert Marko
4f277b4da5 ipq40xx: 5.4: update and reorder patches
A lot of patches are outdated versions of upstreamed patches and
drivers.

So lets pull in the upstreamed patches and reorder remaining ones.

This drops the unnecessary 721-dts-ipq4019-add-ethernet-essedma-node.patch
which adds nodes for not yet in OpenWrt IPQESS driver.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
[do not touch 902-dts-ipq4019-ap-dk04.1.patch here]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-13 16:08:58 +01:00
Felix Fietkau
a8fb12a7d6 build: filter out more autogenerated kernel config options
Define wildcard patterns for filtering in target/linux/generic/config-filter
Preparation for supporting newer kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-13 13:18:20 +01:00
Felix Fietkau
f307684ab2 kernel: rename mtdpart_get_master to mtd_get_master
Preparation for supporting newer kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-13 13:16:51 +01:00
Felix Fietkau
92b707f61b kernel: ip17xx: use pr_warn instead of pr_warning
Fixes build with newer kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-13 13:16:31 +01:00
Thibaut VARÈNE
41b867165d generic: platform/mikrotik: implement multi caldata
MikroTik recently changed again the way they store wlan calibration data
on devices. Prior to this change, ERD calibration data for all available
radios was stored within a single identifier node ("tag" in RouterBoot
parlance).

Recent devices have been seen with calibration (and BDF) data stored in
separate identifiers within LZOR packing for each radio: this patch
addresses this by:
1) ensuring that both variants are properly supported,
2) preserving backward compatibility with existing data consumers,
3) allowing for more than 2 calibration blobs to be exposed via sysfs.

Specifically, before this patch, the driver would provide a single sysfs
file named /sys/firmware/mikrotik/hard_config/wlan_data that contained
whatever calibration data found on the device's flash. After this patch,
when executed on a device that uses the old style storage, this behavior
is unchanged, but when executed on a device that uses new style storage
(for either traditional "ERD" packing or "LZOR" packing), the driver
replaces that single file with a folder containing one or more files
each containing the data encoded within individual identifiers.

As far as OpenWRT is concerned, this means that for devices which are
known to exist with both styles of data storage, a suitable hotplug stub
could look like this for e.g. the second radio:

wdata="/sys/firmware/mikrotik/hard_config/wlan_data"
( [ -f "$wdata" ] && caldata_sysfsload_from_file "$wdata" 0x8000 0x2f20 ) || \
( [ -d "$wdata" ] && caldata_sysfsload_from_file "$wdata/data_2" 0x0 0x2f20 )

This patch has been tested with LZOR old and new style packing on ipq4019,
and with old style on ath79.

Tested-by: John Thomson <git@johnthomson.fastmail.com.au>
Tested-by: Шебанов Алексей <admin@ublaze.ru>
Tested-by: Alen Opačić <subixonfire@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Tested-by: Robert Marko <robimarko@gmail.com>
2020-11-12 18:21:55 +01:00
Alberto Bursi
ccddc3470c x86: generic: disable CONFIG_EFI_VARS
CONFIG_EFI_VARS has been disabled in 
64bit x86 target in 2018 by the following commit
b0a51dab8c
the same reasons apply to Generic target, so
now it's disabled here too.
Leaving it enabled is also blocking compile as 
a new symbol was added
EFI_CUSTOM_SSDT_OVERLAYS 
that depends from CONFIG_EFI_VARS
and the build system stops and waits for
user input on what to do about it.

The Legacy and Geode targets never
had any EFI_xxx configs enabled so they 
don't have this issue

Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
2020-11-12 18:21:55 +01:00
Birger Koblitz
fba69a5a30 rtl838x: Add switch and ethernet driver support for RTL839x SoCs
This adds support for RTL839x SoCs in the ethernet and switch
drivers of the rtl838x architecture.

Reviewed-by: Andreas Oberritter <obi@saftware.de>
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2020-11-12 18:21:55 +01:00
Roman Kuzmitskii
02e8182d87 sunxi: add support for Libre Computer ALL-H3-CC H5
Specification:

- CPU: Allwinner H5, Quad-core Cortex-A53 Up to 1GHz
- DDR3 RAM: 2GB
- Network:
    10/100M Ethernet x 1
- IR: x1 (Receive)
- USB (Host) Type-A x3
- USB (OTG) Type-A x1
- MicroSD Slot x 1
- eMMC Slot x1
- MicroUSB power input
- GPIO 40pin header
- UART 3pin header
- Leds:
    - librecomputer:blue:status
    - librecomputer:green:pwr
- Buttons:
    - uboot button (used to enter fel mode)
    - power button (can trigger power on)
- Power Supply via MicroUSB or GPIO 5V/2A

Installation:

- Write the image to SD Card with dd
- Boot from the SD Card

Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
[Fixed Signed-off-by]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-12 18:21:17 +01:00
Adrian Schmutzler
a51e46e543 ramips: add Xiaomi Mi Router 4A Gigabit explicitly
This device has previously been supported by the image
for Xiaomi Mi Router 3G v2. Since this is not obvious, the
4A is marketed as a new major revision and it also seems to
have a different bootloader, this will be both more tidy and
more helpful for the users.

Apart from that, note that there also is a 100M version of
the device that uses mt7628 platform, so a specifically named
image will also prevent confusion in this area.

Specifications:

- SoC:      MediaTek MT7621
- Flash:    16 MiB NOR SPI
- RAM:      128 MiB DDR3
- Ethernet: 3x 10/100/1000 Mbps (switched, 2xLAN + WAN)
- WIFI0:    MT7603E 2.4GHz 802.11b/g/n
- WIFI1:    MT7612E 5GHz 802.11ac
- Antennas: 4x external (2 per radio), non-detachable
- LEDs:     Programmable "power" LED (two-coloured, yellow/blue)
            Non-programmable "internet" LED (shows WAN activity)
- Buttons:  Reset

Installation:

Bootloader won't accept any serial input unless "boot_wait" u-boot
environment variable is changed to "on".

Vendor firmware won't accept any serial input until "uart_en" is
set to "1".

Using the https://github.com/acecilia/OpenWRTInvasion exploit you
can gain access to shell to enable these options:

To enable uart keyboard actions - 'nvram set uart_en=1'
To make uboot delay boot work - 'nvram set boot_wait=on'
Set boot delay to 5 - 'nvram set bootdelay=5'

Then run 'nvram commit' to make the changes permanent.

Once in the shell (following the OpenWRTInvasion instructions) you
can then run the following to flash OpenWrt and then reboot:

'cd /tmp; curl https://downloads.openwrt.org/...-sysupgrade.bin
  --output firmware.bin; mtd -e OS1 -r write firmware.bin OS1'

Suggested-by: David Bentham <db260179@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-12 17:18:26 +01:00
张鹏
448de2e2e5 ath79: add support for Qxwlan E600G v2 / E600GAC v2
E600G v2 based on Qualcomm/Atheros QCA9531

Specification:

 - 650/600/200 MHz (CPU/DDR/AHB)
 - 128/64 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz
 - 2 x 10/100 Mbps Ethernet(RJ45)
 - 1 x MiniPCI-e
 - 1 x SIM (3G/4G)
 - 5 x LED , 1 x Button(SW2-Reset Buttun), 1 x power input
 - UART(J100) header on PCB(115200 8N1)

E600GAC v2 based on Qualcomm/Atheros QCA9531 + QCA9887

Specification:

 - 650/600/200 MHz (CPU/DDR/AHB)
 - 128/64 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz
 - 1T1R 5 GHz
 - 2 x 10/100 Mbps Ethernet(RJ45)
 - 6 x LED (one three-color led), 2 x Button(SW2-Reset Buttun),1 x power input
 - UART (J100)header on PCB(115200 8N1)

Flash instruction:

1.Using tftp mode with UART connection and original OpenWrt image
 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "openwrt-ath79-generic-xxx-squashfs-sysupgrade.bin"
   to "firmware.bin" and place it in tftp server directory.
 - Connect PC with one of LAN ports, power up the router and press
   key "Enter" to access U-Boot CLI.
 - Use the following commands to update the device to OpenWrt:
   run lfw
 - After that the device will reboot and boot to OpenWrt.
 - Wait until all LEDs stops flashing and use the router.

2.Using httpd mode with Web UI connection and original OpenWrt image
 - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
 - Connect PC with one of LAN ports,press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   leds flashing.
 - Open your browser and enter 192.168.1.1,You will see the upgrade
   interface, select "openwrt-ath79-generic-xxx-squashfs-
   sysupgrade.bin" and click the upgrade button.
 - After that the device will reboot and boot to OpenWrt.
 - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[rearrange in generic.mk, fix one case in 04_led_migration, update
commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-12 17:18:26 +01:00
Piotr Jurkiewicz
75401550c3 sunxi: fix board.d/01_leds permissions and drop include
The file lacks executable permissions, which makes it not being applied
during the first boot.

While at it, drop unneeded include.

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
[do not touch board name handling, update commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-12 17:18:26 +01:00
James McGuire
de768829a5 ramips: add support for D-Link DIR-2640 A1
This patch adds support for D-Link DIR-2640 A1.

Specifications:
* Board: AP-MTKH7-0002
* SoC: MediaTek MT7621AT
* RAM: 256 MB (DDR3)
* Flash: 128 MB (NAND)
* WiFi: MediaTek MT7615N (x2)
* Switch: 1 WAN, 4 LAN (Gigabit)
* Ports: 1 USB 2.0, 1 USB 3.0
* Buttons: Reset, WPS
* LEDs: Power (blue/orange), Internet (blue/orange), WiFi 2.4G (blue),
        WiFi 5G (blue), USB 3.0 (blue), USB 2.0 (blue)

Notes:
* WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips

Installation:
* D-Link Recovery GUI: power down the router, press and hold the reset
  button, then re-plug it. Keep the reset button pressed until the power
  LED starts flashing orange, manually assign a static IP address under
  the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1

* Some modern browsers may have problems flashing via the Recovery GUI,
  if that occurs consider uploading the firmware through cURL:

    curl -v -i -F "firmware=@file.bin" 192.168.0.1

MAC addresses:

lan   factory 0xe000     *:a7 (label)
wan   factory 0xe006     *:aa
2.4   factory 0xe000 +1  *:a8
5.0   factory 0xe000 +2  *:a9

Seems like vendor didn't replace the dummy entries in the calibration data.

Signed-off-by: James McGuire <jamesm51@gmail.com>
[fix device definition title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-11 17:35:10 +01:00
Yousong Zhou
c02096361c x86: upgrade: make code comment appear as log lines
The comment content can be useful for readers of both the log and code

Previously when dd command "records in/out" messages are not filtered
like now with get_image_dd, it's not clear that these messages are for
extracting boot sectors.  E.g.

Before

  == upgrade: Reading partition table from bootdisk...
  37+26 records in
  37+26 records out
  == upgrade: Reading partition table from image...

After

  == upgrade: Reading partition table from bootdisk...
  == upgrade: Extract boot sector from the image
  37+26 records in
  37+26 records out
  == upgrade: Reading partition table from image...

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-11-11 21:29:55 +08:00
Yousong Zhou
2e34cfbca7 x86: upgrade: use get_image_dd
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3140
Reported-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Reviewed-By: Philip Prindeville <philipp@redfish-solutions.com>
2020-11-11 21:29:55 +08:00
Yousong Zhou
31a34076ed x86: upgrade: use v function for writting logs
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-11-11 21:29:55 +08:00
John Audia
a47279154e kernel: bump 5.4 to 5.4.75
Manually rebased patches:
  bcm27xx:
    patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch
  bcm53xx:
    patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
  layerscape:
    patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch
    patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch
    patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch

Removed since could be reverse-applied by quilt:
  mediatek:
    patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch

All modifications made by update_kernel.sh

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

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Curtis Deptuck <curtdept@me.com> [x86_64]

Rebase of 802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
2020-11-10 13:11:32 +01:00
Petr Štetiar
fe302d472a rtl838x: fine tune default package set
Althought most of the switches aren't routers, they can be used as such,
so let's add some of the packages from the router's DEVICE_TYPE. While
at it, remove swconfig package which is not needed on DSA targets.

Acked-by: John Crispin <john@phrozen.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 21:50:06 +01:00
Paul Spooren
2e282537d0 imagebuilder: fix sstrip
Without an absolute path to staging_dir/host/bin/sstrip the Makefile
tries to run a host installed version of sstrip, which is likely not
available.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-09 10:54:30 +00:00
Petr Štetiar
e267445510 rtl838x: dts: use macros for phy and switch definitions
It's quite more readable, saves some tedious copy&pasting, not so
error prone etc.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
0516aa398c rtl838x: rtl838x.dtsi: fix missing interrupt-parent for uart0
Fixes following dtc warning:

 Warning (interrupts_property): /uart@b8002000: Missing interrupt-parent

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
2ab6add9b9 rtl838x: rtl838x.dtsi: remove reg property from root node
Fixes following dtc warning:

 ../dts/rtl838x.dtsi:38.3-145.3: Warning (reg_format): /: Root node has a "reg" property

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
b5bd945733 rtl838x: add support for D-Link DGS-1210-28
Hardware specification
 ----------------------

 * RTL8382M SoC, 1 MIPS 4KEc core @ 500MHz
 * 128MB DRAM
 * 32MB NOR Flash (MX25L25635E)
 * 24 x 10/100/1000BASE-T ports
    - Internal PHY with 8 ports (RTL8218B)
    - Two external PHYs with 8 ports each (RTL8218B)
 * 4 x Gigabit RJ45/SFP Combo ports
    - External PHY with 4 SFP ports (RTL8214FC)
 * Power LED
 * Reset button on front panel
 * UART (115200 8N1) via unpopulated standard 0.1" pin header marked J6

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

  [oooo]J3 [o]ooo|J6
    |       ^ ||`------ GND
    |       | |`------- RX
    |       | `-------- TX
    |       `---------- Vcc (3V3)
    |
    `------------------ J3 is power input connector nearby J6 UART

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

  1. Press Escape key during `Hit Esc key to stop autoboot` prompt
  2. Press CTRL+C keys to get into real U-Boot prompt
  3. Init network with `rtk network on` command
  4. Load image with `tftpboot 0x8f000000 openwrt-rtl838x-generic-d-link_dgs-1210-28-initramfs-kernel.bin` command
  5. Boot the image with `bootm` command

To install, upload the sysupgrade image to the OEM webpage or sysupgrade
from the system running from initramfs image.

It has been developed and tested on device with F1 revision.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
aeb26f8434 rtl838x: d-link_dgs-1210: refactor common family bits
So the common bits can be easily shared with other boards in the family
and while at it add missing SPDX license identifiers into the DTS files
and fixed alphabetic sorting of the devices in the images.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Petr Štetiar
b1b8abaf58 rtl838x: clean whitespace issues in rtl8382_d-link_dgs-1210-16.dts
So it's tidy.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-09 09:14:02 +01:00
Roman Kuzmitskii
dd651e54cc octeon: add support for Ubiquiti EdgeRouter 4
Ubiquiti EdgeRouter 4 is 4 port Octeon Cavium 7130 powered router.
It has internal power supply and needs c13 power cord.
There are three 10/100/1000 Mbps RJ45/Copper ports and
one 1000 Mbps SFP port connected directly to a SoC.

SoC:
  Octeon Cavium 7130 (Cavium 3)
  Clocked at 1000Mhz

Memory:
  1 GiB (SK hynix H5TQ4G63CFR-RDC × 2)
  DDR3, clocked at 533 Mhz (1066Mhz effective)
Flash:
  - mtd:
    8 MiB (Macronix MX25L6408EMI-12G)
    used for uboot/eeprom
  - emmc:
    4 GiB (SanDisk SDIN7DP2-4G)
    used for kernel+rootfs
Leds: 1x for power status (white/blue, controllable)
  and 4x for ethernet and sfp ports (no control over them)
Buttons: 1x Reset (from SOC)
Serial: 1x RJ45 port on front panel. 115200 baud, 8N1 (from SoC)
USB: 1x USB3.0 on front panel (from SoC)
MII: 1x QSGMII from SoC is used
PHY: 1x Vitesse VSC8504 of which 4x ports is used

All physical port numbers are properly mapped inside OS and
named by lanX instead of ethX.

There is also special purpose four(4) loopX ports available.
That loopX ports are currently hardcoded by linux kernel
and exact use case of them is currently unknown. We leave them
to the linux kernel and octeon board defaults.

All four (4) physical ports are connected to the same QSGMII.
vsc8504 is used for phys and only 4, 5, 6 and 7 phys are used.

Phy mapping:
 - Phy5 is connected to physical eth0 port
 - Phy6 is connected to physical eth1 port
 - Phy7 is connected to physical eth2 port
 - Phy4 is connected to physical eth3 port

Why this device needs external dts:
 - faster boot time since need to initialize less device tree nodes.
 - to add actual indication with LED about boot/failure/upgrade.
   i.e. user could know when to enter failsafe mode or if upgrade is done
 - reset button support so user can reset their device in case off failure
 - sfp port indication in dmesg with information about sfp module
   it also indicates when module inserted or removed

Octeon quirks:
 - There is no port status available before it interface brought up
 - SFP port can not be tied to actual phy due to octeon-ethernet state
   and currently we can only get reports a about SFP state in dmesg

How to flash the firmware:
  - copy openwrt-octeon-ubnt_edgerouter-4-initramfs-kernel.bin and
    openwrt-octeon-ubnt_edgerouter-4-squashfs-sysupgrade.tar to
    USB flash drive that is formatted to vfat/fat32
  - connect USB flash drive to edgerouter 4 front USB port
  - connect serial cable using front RJ45 port (115200 baud, 8N1)
  - connect power to cable to edgerouter 4
  - connect terminal to the console to see uboot boot process
  - interrupt boot by pressing button(s) on your keyboard to log in to the uboot
  - detect usb connected flash drives by typing to the console:
    usb start
  - after drive is detected load initramfs+kernel to the memory by typing:
    fatload usb 0:1 0x20000000 openwrt-octeon-ubnt_edgerouter-4-initramfs-kernel.bin
  - after initramfs+kernel is loaded to the memory load it by typing:
    bootoctlinux 0 numcores=4 endbootargs mem=0
  - boot process should finish and you will be greeted with console after pressing enter
  - create directory to mount usb flash drive to by typing:
    mkdir /tmp/sda
  - mount flash drive to that directory by typing:
    mount /dev/sda1 /tmp/sda
  - flash firmware to router internal storage by typing:
    sysupgrade /tmp/sda/openwrt-octeon-ubnt_edgerouter-4-squashfs-sysupgrade.tar
  - device will reboot and after it gets up you will have edgerouter 4 running openwrt

Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
Tested-by: Johannes Kimmel <fff@bareminimum.eu>
Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
2020-11-05 19:29:48 +00:00
Roman Kuzmitskii
577ac8ce84 octeon: honor disabled sgmii device tree nodes
adds patch to octeon ethernet driver that lets sgmii interface
device tree node to be disabled and that disabled interface
won't be unnecessarily initialized.

It solves the problem with octeon boards that have 8 sgmii or more ports
initialized but have nothing connected to them.

Tested-by: Johannes Kimmel <fff@bareminimum.eu>
Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
2020-11-05 19:29:48 +00:00
Roman Kuzmitskii
a8ceda752c octeon: implement interface rename by label from device tree
adds patch to octeon ethernet driver that to rename interface
name by label from device tree

Tested-by: Johannes Kimmel <fff@bareminimum.eu>
Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
2020-11-05 19:29:48 +00:00
Roman Kuzmitskii
b9898cd78a generic: add support for vsc8504 phy
adds support for vsc8504 phy.
patch have use on 5.4 kernel and has
to be dropped after since phy is supported by
CONFIG_MICROSEMI_PHY on newer LTS kernels.

Tested-by: Johannes Kimmel <fff@bareminimum.eu>
Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
2020-11-05 19:29:48 +00:00
David Bauer
22be18effb ath79: streamline image-generation for OCEDO boards
Use the default sysupgrade generation procedure provided
by the target. The previously generated images had the rootfs not
aligned to an eraseblock.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-05 00:00:37 +01:00
David Bauer
6f1b8c652f rockchip: remove unused config symbols
Remove MDIO and I2C bitbangig support from the kernel.

These functionalities are currently not used by any board in the target.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-04 23:58:27 +01:00
David Bauer
3f05b5fda3 rockchip: fix NanoPi R2S GMAC clock name
This commit fixes the name for the GMAC clock to gmac_clkin, as this is
the name of the clock provided by the rk3328-clk driver.

Without this commit, the GMAC will not work in TX direction.

Suggested-by: Tobias Waldvogel <tobias.waldvogel@gmail.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-04 23:58:13 +01:00
Anton Ryzhov
df469befdc ramips: fix kernel oops in mt7621_nfc_write_page_hwecc
`mt7621_nfc_write_page_hwecc` may be called with `buf=NULL`, but
`mt7621_nfc_check_empty_page` always tries to read it.
That caused Oops:
`Unable to handle kernel paging request at virtual address 00000000`

Fixes: FS#3416
Signed-off-by: Anton Ryzhov <anton@ryzhov.me>
2020-11-04 22:08:11 +08:00
Adrian Schmutzler
df9ee254aa ath79: remove redundant setup of wmac for ubnt WA devices
Several Ubiquiti WA devices set up &wmac again in their DTS files,
although this is already done in ar9342_ubnt_wa.dtsi.

Fixes: fa3c2676ab ("ath79: Add support for Ubiquiti Nanostation AC")
Fixes: cf5a1abe46 ("ath79: define 2.4GHz radio for nanostation ac loco")
Fixes: 09804da80a ("ath79: define 2.4GHz radio for litebeam ac gen2")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-03 18:34:10 +01:00
Nick Hainke
28a211808a ath79: create DTSI files for ubnt WA 1-/2-port devices
The ar9342 Ubiquiti WA devices appear to only have two different
network setups, based on the number of ethernet ports.
Create DTSI files for them to consolidate duplicate definitions.

Signed-off-by: Nick Hainke <vincent@systemli.org>
[rephrase commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-03 18:34:10 +01:00
Nick Hainke
50a76208bc ath79: fix nanobeam ac ethernet interface
In 4.14 the delays were not cleared, so setting "rgmii" as phy-mode
did not affect delays set by the bootloader. With 5.4 kernel the
situation changed and the ethernet interface stopped working.

"rgmii" requires rx and tx delays depending on the hardware circuit
and wiring. The mac or the phy can add these delays.
- "rgmii":  delays are controlled by the mac
- "rgmii-id": delays are controlled by the phy
More Information in Linux Kernel Tree:
Documentation/devicetree/bindings/net/ethernet-controller.yaml

"rgmii" should be the preferred mode, which allows the mac layer to
turn off the dealys completely if they are not needed. However, the
delays are not set correctly, which causes the ethernet interface
to be broken. Just taking the ethernetpart from the litebeam ac gen2
will fix the issue.

Explained-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-11-03 18:34:04 +01:00
John Crispin
f5772d71a4 rtl838x: remove the swconfig setup from the board.d code
the code currently sets up uci for swconfig which we do not use.

Signed-off-by: John Crispin <john@phrozen.org>
2020-11-03 17:46:40 +01:00
Adrian Schmutzler
54fad3f32b kernel: add disabled CONFIG_IP6_NF_TARGET_MASQUERADE
In kernel commit adf82accc5f5 ("netfilter: x_tables: merge ip and
ipv6 masquerade modules") the config symbols IP_NF_TARGET_MASQUERADE
and IP6_NF_TARGET_MASQUERADE have been demoted to simple backwards-
compat options for NETFILTER_XT_TARGET_MASQUERADE.

In netfilter.mk, this has already been updated in OpenWrt commit
d1592306cc ("netfilter.mk: use CONFIG_NETFILTER_XT_TARGET_MASQUERADE"),
having us use the new config symbol.

However, enabling IP_NF_NAT or IP6_NF_NAT still makes the relevant
legacy options selectable, so we need to disable them in generic
config (and forget about them afterwards).
Since CONFIG_IP_NF_TARGET_MASQUERADE is already present there, this
just adds the missing CONFIG_IP6_NF_TARGET_MASQUERADE.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-02 18:14:20 +01:00
Adrian Schmutzler
89a2a6c870 kernel: drop obsolete symbol CONFIG_NF_NAT_IPV6
Kernel has removed the symbols CONFIG_NF_NAT_IPV4 and
CONFIG_NF_NAT_IPV6 in favor of CONFIG_NF_NAT in commit
3bf195ae6037 ("netfilter: nat: merge nf_nat_ipv4,6 into nat core").

This drops the obsolete symbol CONFIG_NF_NAT_IPV6 from generic
config-5.4.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-02 17:27:05 +01:00
Lech Perczak
52d3b027ec ath79: ubnt-unifi: make u-boot-env partition read-only
This partition isn't normally modified during boot process. Make it
read-only to prevent accidental overwrite.
If needed this can be overriden with installing kmod-mtd-rw; the same
way as for installing modified U-boot.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2020-11-02 16:33:25 +01:00
Lech Perczak
7d93473eff ath79: ubnt-xm: make u-boot-env partition read-only
This partition isn't normally modified during boot process. Make it
read-only to prevent accidental overwrite.
If needed this can be overriden with installing kmod-mtd-rw; the same
way as for installing modified U-boot.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2020-11-02 16:33:25 +01:00
John Audia
71b2b32f98 kernel: bump 5.4 to 5.4.74
Removed upstreamed patches:
 mvebu/patches-5.4
   409-phy-marvell-comphy-Convert-internal-SMCC-firmware-re.patch

All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711, x86_64
Run-tested: ipq806x/R7800, x86_64, lantiq/Easybox 904 xDSL

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
Tested-by: Curtis Deptuck <curtdept@me.com> [x86_64 build/run]
[added lantiq test report]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-02 16:33:25 +01:00
Yousong Zhou
bd0b820068 x86: fix touching bootloader "upgraded" mark
The mount point is "/tmp/boot", the path in the boot partition is
"/boot/grub/upgraded".

Origin of this mark b9c1cf16 ("x86: add preinit hook for bootloader
upgrade")

Fixes 32f675ca ("x86: fix grub-bios-setup fail during sysupgrade")

Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3140
Reported-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-11-02 21:09:22 +08:00
Petr Štetiar
ec0ec0428e sdk: fix missing include directories
It's not possible to compile some applications which are using
`-Werror=missing-include-dirs` compiler flags with the SDK as some
target directories are missing in the SDK tarball:

 cc1: error: staging_dir/target/usr/include: No such file or directory [-Werror=missing-include-dirs]
 cc1: error: staging_dir/target/include: No such file or directory [-Werror=missing-include-dirs]

Fix this by adding the missing directories in the SDK.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-02 08:39:49 +01:00
David Bauer
e73d866c6f ipq40xx: enable RX hash / CTAG TX offloading for single-phy
This re-enables offloading features disabled by
commit 9da2b56760 ("ipq40xx: fix ethernet vlan double tagging").

Single-PHY devices use port-based VLANs on the switch, therefore no
S-TAG magic is involved here. Re-enabling these features restores
throughput back to 950 Mbit/s.

Reported-by: Jannis Pinter <jannis@pinterjann.is>
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-01 15:30:22 +01:00
David Bauer
4c5eb1040f ath79: use correct firmware name for UniFi AP
The Ubiquiti UniFi AP does not have a AHB connected radio but a PCI one.
Also the EEPROM ist only 0x440 bytes of length.

Reported-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Tested-by: Martin Weinelt <martin@darmstadt.freifunk.net>
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-01 15:30:05 +01:00
David Bauer
d011952d19 ath79: remove AT803X config symbol from subtargets
The AT803X_PHY kernel config symbol is already enabled target-wide. SO
it does not have to be enabled for individual subtargets.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-01 15:29:58 +01:00
David Bauer
c741ca5291 ath79: drop upstreamed patch
Patch was upstreamed a long time ago (over 2 years) as commit
a08227a206b8d ("MIPS: ath79: select the PINCTRL subsystem").

When porting this patch to a newer kernel, nobody noticed we now patch a
Broadcom platform. This is clearly not intended. So drop this patch and
pretend nothing ever happened.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-01 15:29:06 +01:00
John Audia
b4c02c9998 kernel: bump 5.4 to 5.4.73
Removed upstreamed patches:
 generic/pending-5.4
   445-mtd-spinand-gigadevice-Only-one-dummy-byte-in-QUA.patch
   446-mtd-spinand-gigadevice-Add-QE-Bit.patch
 pistachio/patches-5.4
   150-pwm-img-Fix-null-pointer-access-in-probe.patch

Manually rebased:
 layerscape/patches-5.4
   801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch
   801-audio-0039-MLK-16224-6-ASoC-fsl_sai-fix-DSD-suspend-resume.patch
   801-audio-0073-MLK-21957-3-ASoC-fsl_sai-add-bitcount-and-timestamp-.patch
   820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch

All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711,
              mvebu (mamba, rango), x86_64, ramips/mt7621
Run-tested: ipq806x/R7800, mvebu (mamba, rango), x86_64, ramips (RT-AC57U)

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[alter 820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-01 14:44:06 +01:00
Adrian Schmutzler
2aa558c49a target: remove obsolete kernel version switches for 4.19
This removes unneeded kernel version switches from the targets after
kernel 4.19 has been dropped.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-30 19:45:24 +01:00
Adrian Schmutzler
2785126650 kernel: remove support for kernel 4.19
We use 5.4 on all targets by default, and 4.19 has never been released
in a stable version. There is no reason to keep it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-30 19:29:59 +01:00
Johannes Kimmel
3824fa26d2 octeon: disable edgerouter image
This patch disables the image for edgerouter devices by default, since
it isn't able to boot at the moment.

Currently the edgerouter image won't boot. Current kernels have an
option CONFIG_CAVIUM_CN63XXP1 that needs to be enabled for this chip.

If the kernel was compiled without this option, following message is
displayed and the machine reboots:

[   36.778028] Kernel panic - not syncing: OCTEON II DCache prefetch workaround not in place (cfa0000c).
[   36.778028] Please build kernel with proper options (CONFIG_CAVIUM_CN63XXP1).
[   36.794398] Rebooting in 1 seconds..

This was last confirmed on 2020-10-29.

The description of this option states, that enabling it will possibly
cause performance issues on other chips.

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
2020-10-30 19:26:09 +01:00
Daniel Golle
37ef2197e6 kernel: move kmod-i2c-bcm-iproc to I2C menu
A typo resulted in that module having it's own menu.
Move it into the I2C menu as it was most likely intended.

Fixes: 1291274335 ("kernel: package bcm53xx i2c module")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-10-30 15:47:52 +00:00
Paul Spooren
04757f964b build,IB: reload packages/ only if existing
With the fix of external kmod feeds it is possible to ship the
ImageBuilder without any packages except the pseudo packages kernel and
libc. Therefore the local package feeds becomes optional.

This commit adds a check to the package_reload function to only run if
the local feed is existing.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-10-30 00:39:09 +00:00
Paul Spooren
2999f810ff build,IB: include kmods only in local builds
The buildbots generate a kmod archive which should be used instead of a
local copy. This is possible due to the introduction of a kernelversion
specific feed.

This commit adds the ability of using only signed package feeds.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-10-30 00:39:09 +00:00
John Thomson
e91344776b ath79: mikrotik: use vmlinuz (zBoot ELF)
- minimal built initramfs: 10MB vmlinux ELF -> 6MB vmlinuz
- ~5 seconds for kernel decompression, which was equivalent to the
  additional time to load the uncompressed ELF from SPI NOR.
- Removes requirement for lzma-loader, which may have been causing some
  image builds to fail to boot on Mikrotik mt7621.

Suggested-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
2020-10-29 21:35:03 +08:00
John Thomson
254f51443d mt7621: mikrotik: use vmlinuz (zBoot ELF)
- minimal built initramfs: 11MB vmlinux ELF -> 4.5MB vmlinuz
- ~5 seconds for kernel decompression, which was equivalent to the
  additional time to load the uncompressed ELF from SPI NOR.
- Removes requirement for lzma-loader, which may have been causing some
  image builds to fail to boot on Mikrotik mt7621.

Fixes: FS#3354
Suggested-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
2020-10-29 21:35:03 +08:00
Chuanhong Guo
c063e27e02 kernel: mips: zboot: put appended dtb into a section
This will make a separated section for dtb appear in ELF, and we can
then use objcopy to patch a dtb into vmlinuz when RAW_APPENDED_DTB
is set in kernel config.

command to patch a dtb:
objcopy --set-section-flags=.appended_dtb=alloc,contents \
        --update-section=.appended_dtb=<target>.dtb vmlinuz vmlinuz-dtb

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-10-29 21:34:56 +08:00
Chuanhong Guo
42af05ca1f ramips: add linux zboot support
linux-mips has zboot code which can create a self-extracting kernel
image.
This allows enabling kernel zboot support for ramips targets.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-10-29 21:20:10 +08:00
Nuno Goncalves
2a860bf4f4 ramips: add support for Wavlink WL-WN530HG4
Same hardware as Phicomm K2G but different flash layout.

Specification:
- SoC: MediaTek MT7620A
- Flash: 8 MB
- RAM: 64 MB
- Ethernet: 4 FE ports and 1 GE port (RTL8211F on port 5)
- Wireless radio: MT7620 for 2.4G and MT7612E for 5G, both equipped
  with external PA.
- UART: 1 x UART on PCB - 57600 8N1

Flash instruction:
To avoid requiring UART for TFTP a dual flash procedure is suggested
to install the squashfs image:
1. Rename openwrt-ramips-mt7620-wavlink_wl-wn530hg4-initramfs-kernel.bin
   to WN530HG4-WAVLINK.
2. Flash this file with the factory web interface.
3. With OpenWRT now running use standard sysupgrade to install the
   squashfs image.

Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
[remove dts-v1, remove model from LED labels, wrap commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-27 21:20:16 +01:00
Tony Ambardar
29804086ee malta: relocate CPU_TYPE setting to subtarget makefiles
Move CPU_TYPE:=24kc (32-bit) from the top-level target makefile to the
be/le subtarget makefiles, which is consistent with the 64-bit subtargets.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2020-10-27 21:01:13 +01:00
Leon Maurice Adam
6c85a449a9 lantiq: add support for AVM FRITZ!Box 7430
Hardware:
- SoC: Lantiq VRX 220
- CPU: 2x MIPS 34Kc 500 MHz
- RAM: 128 MiB 250 MHz
- Flash: 128 MiB NAND
- Ethernet: Built-in Fast Ethernet switch, 4 ports used
- Wifi: Atheros AR9381-AL1A b/g/n with 2 pcb/internal and 1 external antennas
- USB: 1x USB 2.0
- DSL: Built-in A/VDSL2 modem
- DECT: Dialog SC14441
- LEDs: 1 two-color, 4 one-color
- Buttons: 1x DECT, 1x WIFI
- Telephone connectors: 1 FXS port via TAE or RJ11 connector

With the exception of FXS/DECT everything works
(there are no drivers for AVM's FXS or DECT implementation),
DSL is yet untested.

Installation:
Boot up the device and wait a few seconds. Run the eva_ramboot.py script
in scripts/flashing/ to load the initramfs image on the device:
$ ./scripts/flashing/eva_ramboot.py 192.168.178.1 <path to your initramfs image>
If the script fails to reach the device, maybe try 169.254.120.1.

Wait until booting is complete. You should now be able to reach your device
under the default ip address 192.168.1.1.

Before flashing, check if linux_fs_start is not set to 1 in the tffs partition:
$ fritz_tffs_nand -d /dev/mtd1 -n linux_fs_start
If linux_fs_start is 1, you will need to reset it to 0, either by FTP,
upgrading FritzOS or doing a recovery.

Now you should be able to flash the device using sysupgrade.

Signed-off-by: Leon Maurice Adam <leon.adam@aol.de>
Acked-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[drop BOARD_NAME, use wpad-basic-wolfssl, drop 4.19, drop dts-v1,
remove model prefix from LED names]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-27 13:40:09 +01:00
Adrian Schmutzler
c19c15f330 lantiq: fix indent in vr9_avm_fritz7412.dts
Indent should be tabs.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-27 13:33:21 +01:00
Adrian Schmutzler
c4ab1b7dd9 bcm63xx: reorganize board patches into fewer files
At the moment, bcm63xx creates one patch for each board to add to
board_bcm963xx.c. While this is not really helpful to get an overview
in the first place, it is particularly painful if you want to change
something for an early file and have to refresh all the later patches
accordingly.

Since it does not look like these board patches are upstreamed either,
this commit consolidates all board additions into one patch per "board".
By this, both adding and editing boards should become much simpler,
and we drop about 1300 lines of "code" from patches as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 23:48:08 +01:00
Adrian Schmutzler
8087499ac5 ath79: enable upgrade from ar71xx for Qxwlan devices
This supports upgrade from ar71xx for the recently added Qxwlan
devices E1700AC v2, E558 v2, E750A v4 and E750G v8.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 21:07:22 +01:00
Roman Kuzmitskii
733700c652 octeon: use dedicated function to move config backup
All octeon devices use the same or a very similar way to backup
and restore configuration.

We expect to have more devices added and in order to stop
repeating ourselves move the logic to a separate function.

While at it, add a few checks.

Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 21:07:22 +01:00
Felix Fietkau
a4c1c169c3 sdk: keep the linux package in the same subdir as in the main build system
Fixes: 953435795d ("build: always build package/kernel/linux")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-10-26 02:36:02 +01:00
Nick Hainke
c9e9b8c342 ath79: fix block protection clearing
The block protection bits of macronix do not match the implementation.
The chip has 3 BP bits. Bit 5 is actually the third BP but here the
5th bit is SR_TB. Therefore the patch adds SR_TB to the mask. In the
4.19er kernel the whole register was simply set to 0.

The wrong implementation did not remove the block protection. This led
to jffs2 errors in the form of:
"jffs2: Newly-erased block contained word 0x19852003 at offset 0x..."
This caused inconsistent memory and other errors.

Suggested-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-10-26 02:35:55 +01:00
Yangbo Lu
c1130c7a6b layerscape: several kernel fix-ups from NXP linux factory
NXP linux factory unifies one linux kernel for i.MX, Layerscape and
S32 platforms. It provides a common code base for their SDKs.

Add several kernel patches for bug fix from linux factory last release.

Git: https://source.codeaurora.org/external/qoriq/qoriq-components/linux
Tag: LTS-5.4.47-20200828

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2020-10-26 00:40:12 +01:00
Biwen Li
3b94a39c14 layerscape: update kernel to LSDK-20.04-V5.4-update-290520
Update kernel from LSDK-20.04-V5.4 to LSDK-20.04-V5.4-update-290520.
Only two patches added for Layerscape.

LSDK kernel link
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2020-10-26 00:40:12 +01:00
Adrian Schmutzler
46fd198338 layerscape: harmonize wrapping for IMAGE/* definitions
Always keep the first line empty for multi-line IMAGE/* definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 00:40:12 +01:00
Adrian Schmutzler
48a634a41f layerscape: create shared definitions for sdboot devices
This moves a few shared variables for SD-Boot devices into common
definitions in order to reduce duplicate code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 00:40:12 +01:00
Pawel Dembicki
a254279a6c layerscape: Change to combined rootfs on sd images
At this moment layerscape images are ext4 only. It causes problem with
save changes durring sysupgrade and make "firstboot" and failsafe mode
useless.

This patch changes sd-card images to squashfs + f2fs combined images.
To make place, for saving config, kernel space ar now ext4 partition
with fit kernel.

This method of image generation is similar to rest of OpenWrt sd-card
targets.

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[reword README, reword DEVICE_COMPAT_MESSAGE, keep original indent]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 00:40:12 +01:00
Pawel Dembicki
c51f8030b6 layerscape: fix platform_copy_config function
At this moment platform_copy_config function is used for every device
and function "export_partdevice" without "export_bootdevice" causes
multiple errors like that:
"sh: 1: unknown operand"

This patch fix usage of export_partdevice and split platform_copy_config
for sd-card images.

Fixes: 0841b68c91 ("layerscape: support sysupgrade for SD card ext4
rootfs")

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2020-10-26 00:40:12 +01:00
Pawel Dembicki
3605eff881 layerscape: add dtb to sysupgrade
At this moment sysupgrade replaces only kernel and rootfs.

This patch add dtb part to sysupgrade images to avoid situation
when old dtb make system broken.

Is possible to sysupgrade older images for NOR devices:
1. Firmware partition in bootargs need to be updated to:
   "49m@0xf00000(firmware)". Env should be saved after changes.
2. After step one, "sysupgrade -F" will work.

Run tested: LS1046A-RDB

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[bump PKG_RELEASE for uboot-layerscape]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 00:40:12 +01:00
Pawel Dembicki
6180005deb layerscape: fix sd-card sysupgrade
So far, kernel has not been written correctly to SD card during
sysupgrade, as both target path and offset were wrong.

This patch fixes it, and adds some descriptive output on the way.

Fixes: 0841b68c91 ("layerscape: support sysupgrade for SD card ext4
rootfs")

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[alter/extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 00:40:12 +01:00
Nick Hainke
09804da80a ath79: define 2.4GHz radio for litebeam ac gen2
The litebeam ac gen2 has a 2.4GHz management radio.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-10-25 16:04:56 +01:00
Nick Hainke
cf5a1abe46 ath79: define 2.4GHz radio for nanostation ac loco
The nanostation ac loco has a 2.4GHz management radio.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-10-25 16:04:52 +01:00
Nick Hainke
a181dbc2e3 ath79: fix nanostation ac loco ethernet interface
In 4.14 the delays were not cleared, so setting "rgmii" as phy-mode
did not affect delays set by the bootloader. With 5.4 kernel the
situation changed and the ethernet interface stopped working.

Just taking the ethernetpart from the litebeam ac gen2 will fix
the issue.

Explained-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-10-25 16:04:31 +01:00
Jianhui Zhao
63ab77d0eb ramips: mt7621: use lzma-loader for U7621-06
The U7621-06 fails to boot if the kernel is large.
Enabling lzma-loader resolves the issue.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2020-10-25 22:30:02 +08:00
Chuanhong Guo
23be410b3d ramips: add support for TOTOLINK X5000R
Specifications:
- SoC: MT7621AT
- RAM: 256MB
- Flash: 16MB (EN25QH128A)
- Ethernet: 5xGbE
- WiFi: MT7915 2x2 2.4G 573.5Mbps + 2x2 5G 1201Mbps

Known issue:
MT7915 DBDC variant isn't supported yet.

Flash instruction:
Upload the sysupgrade firmware to the firmware upgrade page in
vendor fw.

Other info:
MT7915 seems to have two PCIEs connected to MT7621. Card detected on
PCIE0 has an ID of 14c3:7916 and the other one on PCIE1 has 14c3:7915.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-10-25 22:27:44 +08:00
Yousong Zhou
4c21415350 generic: 5.4: make nf nat masquerade in unset state by default
Upstream linux 5.1 commit d1aca8ab ("netfilter: nat: merge ipv4 and ipv6
masquerade functionality") replaces the following 2 options

 - CONFIG_NF_NAT_MASQUERADE_IPV4
 - CONFIG_NF_NAT_MASQUERADE_IPV6

with CONFIG_NF_NAT_MASQUERADE.  The new option is one without prompt and
will be selected by CONFIG_NETFILTER_XT_TARGET_MASQUERADE introduced
still later in 5.2.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-10-24 22:28:37 +08:00
John Audia
dd20ba98e7 kernel: bump 5.4 to 5.4.72
All modifications made by update_kernel.sh

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

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2020-10-20 03:01:27 +02:00
Richard Fröhning
33b76d66d1 ramips: add support for TP-Link RE200 v4
TP-Link RE200 v4 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas.
It's based on MediaTek MT7628AN+MT7610EN like the v2/v3.

Specifications
--------------

- MediaTek MT7628AN (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 1x 10/100 Mbps Ethernet
- 8x LED (GPIO-controlled), 2x button
- UART connection holes on PCB (57600 8n1)

There are 2.4G and 5G LEDs in red and green which are controlled
separately.

MAC addresses
-------------

The MAC address assignment matches stock firmware, i.e.:

LAN : *:8E
2.4G: *:8D
5G  : *:8C

MAC address assignment has been done according to the RE200 v2.

The label MAC address matches the OpenWrt ethernet address.

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

Web Interface
-------------

It is possible to upgrade to OpenWrt via the web interface. Simply flash
the -factory.bin from OEM. In contrast to a stock firmware, this will not
overwrite U-Boot.

Recovery
--------

Unfortunately, this devices does not offer a recovery mode or a tftp
installation method. If the web interface upgrade fails, you have to open
your device and attach serial console.

Instructions for serial console and recovery may be checked out in
commit 6d6f36ae78 ("ramips: add support for TP-Link RE200 v2") or on
the device's Wiki page.

Signed-off-by: Richard Fröhning <misanthropos@gmx.de>
[removed empty line, fix commit message formatting]
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-10-20 03:01:13 +02:00
Adrian Schmutzler
21cf17bb4c lantiq: remove support for kernel 4.19
The target uses 5.4 as default kernel since 06/2020.

Kernel 4.19 support is not really maintained anymore, it does not
seem to be needed and upcoming changes (mainly DSA) will break
backward-compatibility anyway.

Thus, make maintaining of old stuff and reviewing of new stuff
easier by removing support for kernel 4.19.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-19 15:57:40 +02:00
Ansuel Smith
f47cb405ca ipq806x: fix pci broken on bootm command
Pci is broken when bootm is used instead of the custom bootipq. This
is caused by the lack of reset by the bootloader. Make the driver do
the reset to fix this specific problem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2020-10-19 15:46:17 +02:00
Adrian Schmutzler
29ca10e537 ipq806x: remove support for kernel 4.19
The target uses 5.4 as default kernel since 04/2020.

Kernel 4.19 support is not really maintained anymore, and there has
been a lot of changes between 4.19 and 5.4 on this target. Despite,
new devices are typically added for 5.4 only anyway.

Thus, make maintaining of old stuff and reviewing of new stuff
easier by removing support for kernel 4.19.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-19 15:37:54 +02:00
Adrian Schmutzler
a7afeb3142 ipq40xx: remove support for kernel 4.19
The target uses 5.4 as default kernel since 03/2020.

Kernel 4.19 support is not really maintained anymore, it does not
seem to be needed, and removing it will make upcoming driver
updates easier. Thus, remove it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-19 15:30:44 +02:00
John Crispin
c78e123d5a rtl838x: various fixes
* add d-link_dgs-1210-10p support
* make sure mips16 is disabled
* add a generic sub target
* add proper cflags

Signed-off-by: John Crispin <john@phrozen.org>
2020-10-19 14:53:27 +02:00
Jayantajit Gogoi
e6d9f6fdff sunxi: add support for FriendlyARM NanoPi R1
Specification:

- CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz
- DDR3 RAM: 512MB/1GB
- Network:
    10/100/1000M Ethernet x 1,
    10/100M Ethernet x 1
- WiFi: 802.11b/g/n, with SMA antenna interface
- USB Host: Type-A x2
- MicroSD Slot x 1
- MicroUSB: for OTG and power input
- Debug Serial Port: 3Pin 2.54mm pitch pin-header
- LED:
    nanopi:red:status
    nanopi:green:wan
    nanopi:green:lan
- KEY:
    reset
- Power Supply: DC 5V/2A

Installation:

- Write the image to SD Card with dd
- Boot NanoPi from the SD Card

Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
2020-10-18 15:46:42 +02:00
张鹏
4ff7bdfeeb ath79: add support for Qxwlan E1700AC v2
E1700AC v2 based on Qualcomm/Atheros QCA9563 + QCA9880.

Specification:

 - 750/400/250 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 3T3R 2.4 GHz
 - 3T3R 5 GHz
 - 2 x 10/1000M Mbps Ethernet (RJ45)
 - 1 x MiniPCI-e
 - 1 x SIM (3G/4G)
 - 1 x USB 2.0 Port
 - 5 x LED , 2 x Button(S8-Reset Buttun), 1 x power input
 - UART (J5) header on PCB (115200 8N1)

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig, whitespace fixes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-17 20:18:00 +02:00
张鹏
987d9028e1 ath79: add support for Qxwlan E558 v2
Qxwlan E558 v2 is based on Qualcomm QCA9558 + AR8327.

Specification:

 - 720/600/200 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz (QCA9558)
 - 3x 10/100/1000 Mbps Ethernet (one port with PoE support)
 - 4x miniPCIe slot (USB 2.0 bus only)
 - 1x microSIM slot
 - 5x LED (4 driven by GPIO)
 - 1x button (reset)
 - 1x 3-pos switch
 - 1x DC jack for main power input (9-48 V)
 - UART (JP5) and LEDs (J8) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig, whitespace adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-17 20:17:59 +02:00
张鹏
27a7d071c0 ath79: add support for Qxwlan E750G v8
Qxwlan E750G v8 is based on Qualcomm QCA9344 + QCA9334.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4G GHz (AR9344)
 - 2x 10/100/1000 Mbps Ethernet (one port with PoE support)
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-17 20:17:59 +02:00
Felix Fietkau
4a0688ed71 base-files: remove block2mtd checks from sysupgrade
This hasn't been used in a long time

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-10-17 16:43:17 +02:00
Felix Fietkau
93f98b2835 kernel: remove obsolete non-upstream block2mtd patches
Since block2mtd is not used for firmware images anymore, these patches
are no longer needed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-10-17 16:43:17 +02:00
Felix Fietkau
b59d5c8f0e mediatek: rewrite flow offload code
The code is now much cleaner and works better than the old code.
Preparation for submitting it upstream (though with a different API)
Also add back MT7621 support and fix flow table coherence issues on
MT7622

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-10-16 21:37:39 +02:00
Peng Zhang
5666ca913a ath79: add support for Qxwlan E750A v4
Qxwlan E750A v4 is based on Qualcomm QCA9344.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 5G GHz (AR9344)
 - 2x 10/100 Mbps Ethernet (one port with PoE support)
 - 1x miniPCIe slot (USB 2.0 bus only)
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: Peng Zhang <sd20@qxwlan.com>
[cut out of bigger patch, alter use of DEVICE_VARIANT, merge case
in 01_leds, use lower case for v4]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-15 18:52:39 +02:00
Adrian Schmutzler
dec4a028ab rtl838x: remove model name from LED labels
Like in the previous patches for various targets, this removes
the "devicename" from LED labels in rtl838x, as it's useless and
only creates complexity.

Since the target is fresh and so far only system LEDs were added,
this does not add a migration script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-15 17:54:31 +02:00
Adrian Schmutzler
a49c1aa883 rtl838x: move dts-v1 to DTSI
The syntax of the shared SoC DTSI file determines the DTS version,
so no need to repeat the "/dts-v1/;" identifier in every file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-15 17:51:42 +02:00
Adrian Schmutzler
3679f8f933 sunxi: use wpad-basic-wolfssl for Sinovoip Banana Pi M2 Ultra
The idea of commit a14f5bb4bd was to use wpad-basic-wolfssl
consistently throughout the whole trunk, so use it here as well.

Fixes: 50fdddae05 ("BPi-M2U kernel modules for onboard WiFi")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-15 17:46:54 +02:00
John Audia
0efec6a008 kernel: bump 5.4 to 5.4.71
All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711,
              lantiq/Easybox 904 xDSL
Run-tested:   ipq806x/R7800, lantiq/Easybox 904 xDSL

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[add lantiq test reports]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-15 17:46:54 +02:00
John Crispin
479d1154c4 rtl838x: add DLink DGS-1210-16 support
Signed-off-by: John Crispin <john@phrozen.org>
2020-10-15 13:36:10 +02:00
Birger Koblitz
076fdd9fec rtl838x: Fix firmware handling
Fix wrong magic number verification for FW files.
Correct handling of external RTL8218B firmware PHY name in firmware.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2020-10-15 13:26:57 +02:00
Andreas Oberritter
f422488337 rtl838x: do not default to the router DEVICE_TYPE
The router profile installs many packages unnecessary for
the operation of a typical ethernet switch. Instead of creating
an empty switch profile upfront, use the basic profile until
a set of common packages crystallizes.

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2020-10-15 08:32:31 +02:00
Andreas Oberritter
0c26c9395b rtl838x: bundle phy firmware with Linux kernel
Fixes long delay on boot when booting from flash. The driver waits
for one minute for userspace to load firmware, before it becomes
available.

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2020-10-15 08:32:31 +02:00
Birger Koblitz
121ef9ddc9 rtl838x: Add support for RTL839x internal PHY
This adds basic support for reading the internal PHYs of the RTL839x SoCs
and full support for the 2 PHYs connected to the 1000Base-X SerDes of
the RTL8393 SoC.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2020-10-15 08:32:23 +02:00
Birger Koblitz
3c4063f715 rtl838x: Add irq settings for RTL839x SoCs
This adds correct interrupt routing settings for IRQs on the RTL839x SoCs.
It also speeds up irq handling based on work by biot for all SoCs.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2020-10-15 08:23:46 +02:00
Rui Salvaterra
e788e9bd87 treewide: enable the vDSO
The vDSO is used to accelerate some syscalls. It should work fine wherever it's
available, so enable it globally for all targets.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2020-10-13 20:08:41 +02:00
Hal Martin
0830ae3a2f sunxi: Correct manufacturer name to Sinovoip
Sinovoip is the manufacturer of the BPi-M2U:
http://www.banana-pi.org/m2u.html

Signed-off-by: Hal Martin <hal.martin@gmail.com>
2020-10-11 20:27:20 +02:00
Hal Martin
50fdddae05 sunxi: BPi-M2U kernel modules for onboard WiFi
Signed-off-by: Hal Martin <hal.martin@gmail.com>
2020-10-11 20:27:14 +02:00
Arturas Moskvinas
679db02b10 sunxi: add support for FriendlyArm Zeropi
Specification

    CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz
    DDR3 RAM: 256MB/512MB
    Connectivity: 10/100/1000Mbps Ethernet
    USB Host: Type-A x 1
    MicroSD Slot x 1
    MicroUSB: for power input only
    Debug Serial Port: 4Pin, 2.54 mm pitch pin header
    Power Supply: DC 5V/2A
    PCB Dimension: 40 x 40 x 1.2mm

Installation:

    Burn the image file to an SD Card with dd or any image burning tool
    Boot ZeroPi from the SD Card

The following features are working and tested:

    Ethernet port 10/100/1000M Ethernet

Remarks: SBC is mostly compatible and boots with FriendlyARM NanoPI M1 plus DTS also (zeropi has no working hdmi)

Signed-off-by: Arturas Moskvinas <arturas.moskvinas@gmail.com>
2020-10-11 18:29:26 +02:00
Andre Heider
37e62ec4ec sunxi: add a kmod package for sun4i_spdif
Tested on a A20 board:
$ cat /proc/asound/cards
 0 [SPDIF          ]: On-board_SPDIF - On-board SPDIF
                      On-board SPDIF

Size of the module for a 32bit kernel:
60708 linux-5.4.66/sound/soc/sunxi/sun4i-spdif.ko

Signed-off-by: Andre Heider <a.heider@gmail.com>
2020-10-11 17:45:02 +02:00
Andre Heider
4943d3f14b sunxi: add SND_SIMPLE_CARD to kernel config
This is required to expose an ALSA card for quite some boards:

$ git grep -l simple-audio-card \
	arch/arm/boot/dts/sun?i* \
	arch/arm64/boot/dts/allwinner/*

arch/arm/boot/dts/sun4i-a10-a1000.dts
arch/arm/boot/dts/sun5i-gr8-evb.dts
arch/arm/boot/dts/sun6i-a31-i7.dts
arch/arm/boot/dts/sun6i-a31s-sina31s.dts
arch/arm/boot/dts/sun7i-a20-cubietruck.dts
arch/arm/boot/dts/sun7i-a20-itead-ibox.dts
arch/arm/boot/dts/sun8i-a33-olinuxino.dts
arch/arm/boot/dts/sun8i-a33.dtsi
arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts

The compressed 32bit kernel increases less than 1K:
Before: 3230768 zImage
After:  3231664 zImage

Signed-off-by: Andre Heider <a.heider@gmail.com>
2020-10-11 17:45:02 +02:00
Andre Heider
c43b45863e mvebu: Add bootscript for espressobin to support mainline firmware
The generic bootscript is tailored around a downstream firmware and
doesn't work on a firmware built from mainline components.

Add a bootscript which:
* sets $console since mainline u-boot doesn't do that
* uses distro boot variables, so OpenWRT can be booted off any supported
  device when using a mainline firmware
* sets missing distro boot variables for the downstream firmware

Booting with a downstream firmware is unchanged.
Booting with a mainline firmware now works.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2020-10-11 16:53:20 +02:00
Hauke Mehrtens
722906d144 kernel: move CONFIG_F2FS_CHECK_FS to generic kernel config
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-10-11 16:38:16 +02:00
Hauke Mehrtens
6542615e41 kernel: Move CONFIG_F2FS_FS_SECURITY to generic kernel config
Move the CONFIG_F2FS_FS_SECURITY kernel configuration option to the
generic kernel configuration.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-10-11 16:38:16 +02:00
Hauke Mehrtens
18deed29be kernel: Remove 2FS_FS_XATTR and F2FS_STAT_FS symbols from target configs
This config option was moved to the generic kernel configuration.

Fixes: ab1bd57656 ("kernel: move F2FS_FS_XATTR and F2FS_STAT_FS symbols to generic")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-10-11 16:38:16 +02:00
Kabuli Chana
4d6ade2a22 mvebu: Correct regulatory country of WRT3200ACM
correct oversight on setting regulatory country and mac address of wireless configuration
change method of retrieving mac address

The MAC address for eth0 is rad out of the devinfo partition in some
other initial configuration script already.

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
2020-10-11 16:38:03 +02:00
Kabuli Chana
c5bd4dde32 mvebu: add wrt3200acm to 03_wireless CC
correct device CC oversight

Set the initial wifi configuration like for the other similar Linksys
devices.

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
2020-10-11 16:23:39 +02:00
Pali Rohár
9948c19134 mvebu: armada-37xx: espressobin: Backport patch for ethernet switch aliases
Signed-off-by: Pali Rohár <pali@kernel.org>
2020-10-11 16:16:24 +02:00
Pali Rohár
eb777539fd mvebu: armada-37xx: Backport PCI aardvark patches
This commit contains patches for PCI aardvark driver and relevant DTS
changes for Turris MOX and EspressoBin backported from mainline kernel.
It fixes support for old ATF, various wifi cards, mainly Compex WLE900VX.

Signed-off-by: Pali Rohár <pali@kernel.org>
2020-10-11 16:16:24 +02:00
Tony Ambardar
1b27591ddb malta: update MIPS64 ISA to R2
Usage of current R1 ISA is inconsistent with the MIPS32 subtarget, little
used and has limited utility for testing.

Many distros target a minimum R2 ISA. Debian MIPS 32-bit/64-bit ports all
use MIPS R2 ISA since Stretch, for example. Fedora's MIPS arch also targets
the R2 ISA for 32-bit/64-bit.

Widely used MIPS64 platforms like Octeon are based on the MIPS R2 ISA or
later, and benefit from having a compatible test platform in OpenWRT.

While Linux does support MIPS64 R1 targets, its usefulness for development
and testing is limited. As an example, the modern Linux eBPF JIT requires
a MIPS R2 ISA or later.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
[Refresh config and fix README]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-10-11 16:16:24 +02:00
Adrian Schmutzler
c98819a9e6 bcm63xx: move dts-v1 statement to top-level DTSI files
The "/dts-v1/;" identifier is supposed to be present once at the
top of a device tree file after the includes have been processed.

Like done for other targets recently, put the dts-v1 statement
into the top-level SoC-based DTSI files, and remove all other
occurences.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-10 20:00:34 +02:00
Adrian Schmutzler
c0aea38436 bcm63xx: add a few DTSI files to share definitions
After the LED labels have been made more general by removing
the model names, we can move several definitions to DTSI files
to reduce the amount of duplicate code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-10 19:55:18 +02:00
Adrian Schmutzler
55aac8463f bcm63xx: remove model name from LED labels
Like in the previous patches for various targets, this will remove
the "devicename" from LED labels in bcm63xx, as it's useless and
only creates complexity.

The devicename is removed in DTS files and 01_leds, merging
several cases on the way. A migration script is added for
existing configurations.

Note that a few labels were using "model::function" scheme without
color specified, those were converting to just "function" and the
necessary migrations were added to the migration script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-10 19:44:02 +02:00
Daniel Golle
5423d9d27e kernel: move F2FS_FS_XATTR and F2FS_STAT_FS symbols to generic
Similar to how it was already done for other filesystems' *_FS_XATTR
kernel config symbols, also move CONFIG_F2FS_FS_XATTR=y and
CONFIG_F2FS_STAT_FS=y to target/linux/generic.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-10-09 23:20:19 +01:00
Adrian Schmutzler
f2b952a657 ath79: drop redundant gpios on i2c
Since "sda-gpios" and "scl-gpios" are only available since kernel 4.19,
a few devices have redundantly defined "gpios" to also support older
kernels. Since we have nothing older than 4.19 now, we can remove
the redundant definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-09 22:45:36 +02:00
Adrian Schmutzler
f5cf408b76 ramips: drop kernel version switches
The ramips target only supports 5.4, so drop all kernel version
switches for older kernels there.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-09 22:24:04 +02:00
Adrian Schmutzler
f6ca57e4f4 oxnas: fix qc_prep return in sata driver after kernel 5.4.69
This fixes a regression after a kernel change in 5.4.69 [1] that
led to build failure on oxnas/ox820:

  drivers/ata/sata_oxnas.c:2238:13: error: initialization of
  'enum ata_completion_errors (*)(struct ata_queued_cmd *)'
  from incompatible pointer type
  'void (*)(struct ata_queued_cmd *)' [-Werror=incompatible-pointer-types]
    .qc_prep = sata_oxnas_qc_prep,
               ^~~~~~~~~~~~~~~~~~
  drivers/ata/sata_oxnas.c:2238:13: note:
  (near initialization for 'sata_oxnas_ops.qc_prep')

Our local driver is changed the same way as prototyped in the
kernel patch, i.e. return type is changed and AC_ERR_OK return
value is added.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e11c83520cd04b813cd1748ee2a8f2c620e5f7e3

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-09 16:16:32 +01:00
Robert Marko
9604e216bf ipq40xx: 5.4: move AR40xx driver into files
There is no point in keeping the AR40xx driver as a patch as its
not pending merge or backport.

To allow for easier maintenance until DSA is ready move it into
files like EDMA is.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
[combine with removal from patches-5.4]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-09 14:21:10 +02:00
Paul Spooren
0f5b5cf730 kernel: clean up XATTR config symbols
Extended attributes are required for overlayfs and have hence been long
ago enabled for jffs2, but should be enabled unconditionally for all
other filesystems which may potentially serve as overlayfs' upper
directory. Previously it was inconsistently added in multiple targets.
Add symbols to generic kernel config and remove all *_XATTR symbols
from target configs.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[keep things as they are for squashfs, improve commit message]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-10-09 01:49:22 +01:00
Paul Spooren
32d7acc9c5 kernel: sort config-5.4 via kconfig.pl
The options were out of order which makes reviewing of changes harder.
Sort it before applying an actual change.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-10-09 01:48:47 +01:00
Adrian Schmutzler
c3319322b2 lantiq: remove model name from LED labels
Like in the previous patches for other targets, this will remove
the "devicename" from LED labels in lantiq.

The devicename is removed in DTS files and 01_leds, consolidation
of definitions into DTSI files is done where (easily) possible,
and migration scripts are updated. The DTS/DTSI consolidation is
only performed for files-5.4.

For lantiq,easy98020 some LED definitions have the form
"devicename:function" without the color, so we need to implement
explicit migration for that one.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-08 20:21:18 +02:00
Adrian Schmutzler
c4beac9ea2 ipq40xx: use upstream DTS files for IPQ4019/AP-DK04.1
Upstream provides DTS(I) files for IPQ4019/AP-DK04.1, but we overwrite
them with local versions so far.

Remove the local files and use patches to be closer to upstream.
We already do the same for IPQ40xx/AP-DK01.1-C1.

Technically, this changes the compatible from "qcom,ipq4019" to
"qcom,ipq4019-dk04.1-c1", but it has never been implemented correctly
beforehand anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-07 22:26:52 +02:00
Sungbo Eo
8f29e36963 ipq40xx: improve support for Edgecore ECW5211
This adds several stylistic and functional improvements of the recently
added Edgecore ECW5211, especially:

* Drop the local BDFs as those are already in the upstream under different names
* Add SPDX tag to DTS
* Add label MAC address
* Move LED trigger to DTS
* Remove unnecessary status="okay"
* Disable unused SS USB phy as the USB port only supports USB 2.0
* Make uboot-env partition writable
* Remove qcom,poll_required_dynamic property as the driver does not use it
* Tidy up the device recipe

Fixes: 4488b260a0 ("ipq40xx: add Edgecore ECW5211 support")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Acked-by: Robert Marko <robert.marko@sartura.hr>
2020-10-07 18:07:54 +02:00
Adrian Schmutzler
d181b2cefa ipq806x: remove model name from LED labels
Like in the previous patches for ath79 and ramips, this will remove
the "devicename" from LED labels in ipq806x.

The devicename is removed in DTS files and 01_leds, and a migration
script is added.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-07 01:31:45 +02:00
Adrian Schmutzler
ad90a42e48 ipq40xx: remove model name from LED labels
Like in the previous patches for ath79 and ramips, this will remove
the "devicename" from LED labels in ipq40xx.

The devicename is removed in DTS files and 01_leds, and a migration
script is added. While at it, also harmonize capitalization of
wlan2G/wlan5G vs. wlan2g/wlan5g.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-07 01:31:37 +02:00
Roman Kuzmitskii
582ba9ddc7 ath79: rename ubnt,acb-isp to ubnt,aircube-isp
Use the full model name for this device to make it easier to
recognize for the users and in order to make it consistent with
the other devices.

While at it, fix sorting in 03_gpio_switches.

Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-06 15:13:27 +02:00
Adrian Schmutzler
e3af1666f4 ath79: rename TP-Link TL-WPA8630P v2 (EU) to v2.0 (EU)
Since we have a v2.1 (EU) with different partitioning now, rename
the v2.0 to make the difference visible to the user more directly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-04 15:44:05 +02:00
Joe Mullally
7422c7a6fa ath79: add support for TP-Link TL-WPA8630P (EU) v2.1
This adds support for the TP-Link TL-WPA8630P (EU) in its v2.1
version. The only unique aspect for the firmware compared to v2
layout is the partition layout.

Note that while the EU version has different partitioning for
v2.0 and v2.1, the v2.1 (AU) is supported by the v2-int image.

If you plan to use this device, make sure you have a look at
the Wiki page to check whether the device is supported and
which image needs to be taken.

Specifications
--------------

  - QCA9563 750MHz, 2.4GHz WiFi
  - QCA9888 5GHz WiFi
  - 8MiB SPI Flash
  - 128MiB RAM
  - 3 GBit Ports (QCA8337)
  - PLC (QCA7550)

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

Installation is possible from the OEM web interface. Make sure to
install the latest OEM firmware first, so that the PLC firmware is
at the latest version. However, please also check the Wiki page
for hints according to altered partitioning between OEM firmware
revisions.

Notes
-----

The OEM firmware has 0x620000 to 0x680000 unassigned, so we leave
this empty as well. It is complicated enough already ...

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
[improve partitions, use v2 DTSI, add entry in 02_network, rewrite
and extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-04 15:44:05 +02:00
David Bauer
929e8f0f55 ramips: fix logic level for DIR-645 buttons
The D-Link DIR-645 currently uses an incorrect logic level for its
buttons.

Correct them in order to prevent unintentional activation of failsafe
mode.

Reported-by: Perry Melange <isprotejesvalkata@gmail.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-10-03 22:52:58 +02:00
Marty Jones
5b5469f87a rockchip: add support for Radxa Rock Pi 4
This adds basic support for Radxa Rock Pi 4

Specification:
  - RAM:      1 GB/ 2 GB/4 GB LPDDR4

  - SoC:      Rockchip RK3399
  - CPU:      64bit hexa core processor
              Dual Cortex-A72, freqency 1.8Ghz
              with quad Cortex-A53, frequency 1.4Ghz
  - USB:      USB 3.0 OTG x1
              hardware switch for host/device switch, upper one
              USB 3.0 HOST x1
              dedicated USB3.0 channel, lower one
              USB 2.0 HOST x2
  - Ethernet: 1x GbE
  - Storage:  eMMC module
              uSD card
              M.2 SSD
  - Wireless: 802.11 ac wifi
              Bluetooth 5.0
              currently not supported

 firmware Installation
 ======================
 gzip -d xxx.img.gz, then dd the .img to SD/eMMC
 ======================

 Device Tested: ROCK PI 4 Model B v1.3

Signed-off-by: Marty Jones <mj8263788@gmail.com>
2020-10-03 22:51:36 +02:00