1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-15 11:43:54 +02:00
Commit Graph

23217 Commits

Author SHA1 Message Date
7d29a55714 ath25: drop target
This target still only works with kernel 4.14, and not so recent
attempts of getting newer kernel versions supported did not lead
to success. Therefore, drop the target, as we are already two
LTS kernel versions ahead and it does not seem like anybody will
pick up the work.

Patchwork series:
https://patchwork.ozlabs.org/project/openwrt/list/?series=169991&state=*

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 16:29:22 +02:00
Felix Fietkau
b5d425af23 mediatek/ramips: unify ethernet driver fixes and add performance optimizations
Increase DMA burst size and tx ring size and optimize tx processing

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-01 17:01:56 +02:00
John Crispin
4841ac042e mediatek: pull in some fixes fromt he latest SDK
Signed-off-by: John Crispin <john@phrozen.org>
2020-09-01 09:09:13 +02:00
Michael Pratt
22caf30a65 ath79: add support for Senao Engenius ENH202 v1
FCC ID: U2M-ENH200

Engenius ENH202 is an outdoor wireless access point with 2 10/100 ports,
built-in ethernet switch, internal antenna plates and proprietery PoE.

Specification:

  - Qualcomm/Atheros AR7240 rev 2
  - 40 MHz reference clock
  - 8 MB FLASH                  ST25P64V6P (aka ST M25P64)
  - 32 MB RAM
  - UART at J3                  (populated)
  - 2x 10/100 Mbps Ethernet     (built-in switch at gmac1)
  - 2.4 GHz, 2x2, 29dBm         (Atheros AR9280 rev 2)
  - internal antenna plates     (10 dbi, semi-directional)
  - 5 LEDs, 1 button            (LAN, WAN, RSSI) (Reset)

Known Issues:

  - Sysupgrade from ar71xx no longer possible
  - Power LED not controllable, or unknown gpio

MAC addresses:

  eth0/eth1  *:11   art 0x0/0x6
  wlan       *:10   art 0x120c

  The device label lists both addresses, WLAN MAC and ETH MAC,
  in that order.

  Since 0x0 and 0x6 have the same content, it cannot be
  determined which is eth0 and eth1, so we chose 0x0 for both.

Installation:

  2 ways to flash factory.bin from OEM:

  - Connect ethernet directly to board (the non POE port)
      this is LAN for all images
  - 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"
    In upper right select Reset
    "Restore to factory default settings"
    Wait for reboot and login again
    Navigate to "Firmware Upgrade" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt boot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9f670000`
    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

Format of OEM firmware image:

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

    openwrt-senao-enh202-uImage-lzma.bin
    openwrt-senao-enh202-root.squashfs

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

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

Note on built-in switch:

  ENH202 is originally configured to be an access point,
  but with two ethernet ports, both WAN and LAN is possible.

  the POE port is gmac0 which is preferred to be
  the port for WAN because it gives link status
  where swconfig does not.

Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[assign label_mac in 02_network, use ucidef_set_interface_wan,
use common device definition, some reordering]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-31 17:41:21 +02:00
Michael Pratt
6decbf3186 ath79: add support for Senao Engenius ENS202EXT v1
Engenius ENS202EXT v1 is an outdoor wireless access point with 2 10/100 ports,
with built-in ethernet switch, detachable antennas and proprietery PoE.

FCC ID:	A8J-ENS202

Specification:

  - Qualcomm/Atheros AR9341 v1
  - 535/400/200/40 MHz          (CPU/DDR/AHB/REF)
  - 64 MB of RAM
  - 16 MB of FLASH              MX25L12835F(MI-10G)
  - UART (J1) header on PCB     (unpopulated)
  - 2x 10/100 Mbps Ethernet     (built-in switch Atheros AR8229)
  - 2.4 GHz, up to 27dBm        (Atheros AR9340)
  - 2x external, detachable antennas
  - 7x LED (5 programmable in ath79), 1x GPIO button (Reset)

Known Issues:

  - Sysupgrade from ar71xx no longer possible
  - Ethernet LEDs stay on solid when connected, not programmable

MAC addresses:

  eth0/eth1  *:7b   art 0x0/0x6
  wlan       *:7a   art 0x1002

  The device label lists both addresses, WLAN MAC and ETH MAC,
  in that order.

  Since 0x0 and 0x6 have the same content, it cannot be
  determined which is eth0 and eth1, so we chose 0x0 for both.

Installation:

  2 ways to flash factory.bin from OEM:

  - Connect ethernet directly to board (the non POE port)
      this is LAN for all images
  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    In upper right select Reset
    "Restore to factory default settings"
    Wait for reboot and login again
    Navigate to "Firmware Upgrade" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt boot 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

  *If you are unable to get network/LuCI after flashing*
  You must perform another factory reset:

    After waiting 3 minutes or when Power LED stop blinking:

    Hold Reset button for 15 seconds while powered on
    or until Power LED blinks very fast

    release and wait 2 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions

  *DISCLAIMER*
  The Failsafe image is unique to this model.
  The following directions are unique to this model.
  DO NOT downgrade to ar71xx this way, can cause kernel loop

  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:

  For some reason, TFTP is not reliable on this board.
  Takes many attempts, many timeouts before it fully transfers.

  Starting with an initramfs.bin:

  Connect to ethernet
  set IP address and TFTP server to 192.168.1.101
  set up infinite ping to 192.168.1.1
  rename the initramfs.bin to "vmlinux-art-ramdisk" and host on TFTP server
  disconnect power to the board
  hold reset button while powering on board for 8 seconds

  Wait a minute, power LED should blink eventually if successful
  and a minute after that the pings should get replies
  You have now loaded a temporary Openwrt with default settings temporarily.
  You can use that image to sysupgrade another image to overwrite flash.

Format of OEM firmware image:

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

    openwrt-senao-ens202ext-uImage-lzma.bin
    openwrt-senao-ens202ext-root.squashfs

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

Note on the factory.bin:

  The newest kernel is too large to be in the kernel partition

  the new ath79 kernel is beyond   1592k
  Even ath79-tiny is               1580k

  Checksum fails at boot because the bootloader (modified uboot)
  expects kernel to be 1536k. If the kernel is larger, it gets
  overwritten when rootfs is flashed, causing a broken image.
  The mtdparts variable is part of the build and saving a new
  uboot environment will not persist after flashing.
  OEM version might interact with uboot or with the custom
  OEM partition at 0x9f050000.

  Failed checksums at boot cause failsafe image to launch,
  allowing any image to be flashed again.

  HOWEVER: one should not install older Openwrt from failsafe
  because it can cause rootfs to be unmountable,
  causing kernel loop after successful checksum.
  The only way to rescue after that is with a serial cable.

  For these reasons, a fake kernel (OKLI kernel loader)
  and fake squashfs rootfs is implemented to take care of
  the OEM firmware image verification and checksums at boot.
  The OEM only verifies the checksum of the first image
  of each partition respectively, which is the loader
  and the fake squashfs. This completely frees
  the "firmware" partition from all checks.

  virtual_flash is implemented to make use of the wasted space.
  this leaves only 2 erase blocks actually wasted.

  The loader and fakeroot partitions must remain intact, otherwise
  the next boot will fail, redirecting to the Failsafe image.

  Because the partition table required is so different
  than the OEM partition table and ar71xx partition table,
  sysupgrades are not possible until one switches to ath79 kernel.

Note on sysupgrade.tgz:

  To make things even more complicated, another change is needed to
  fix an issue where network does not work after flashing from either
  OEM software or Failsafe image, which implants the OEM (Openwrt Kamikaze)
  configuration into the jffs2 /overlay when writing rootfs from factory.bin.

  The upgrade script has this:

    mtd -j "/tmp/_sys/sysupgrade.tgz" write "${rootfs}" "rootfs"

  However, it also accepts scripts before and after:

    before_local="/etc/before-upgradelocal.sh"
    after_local="/etc/after-upgradelocal.sh"
    before="before-upgrade.sh"
    after="after-upgrade.sh"

  Thus, we can solve the issue by making the .tgz an empty file
  by making a before-upgrade.sh in the factory.bin

Note on built-in switch:

  There is two ports on the board, POE through the power supply brick,
  the other is on the board. For whatever reason, in the ar71xx target,
  both ports were on the built-in switch on eth1. In order to make use
  of a port for WAN or a different LAN, one has to set up VLANs.

  In ath79, eth0 and eth1 is defined in the DTS so that the
  built-in switch is seen as eth0, but only for 1 port
  the other port is on eth1 without a built-in switch.

  eth0: switch0
    CPU is port 0
    board port is port 1

  eth1: POE port on the power brick

  Since there is two physical ports,
  it can be configured as a full router,
  with LAN for both wired and wireless.

  According to the Datasheet, the port that is not on the switch
  is connected to gmac0. It is preferred that gmac0 is chosen as WAN
  over a port on an internal switch, so that link status can pass
  to the kernel immediately which is more important for WAN connections.

Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[apply sorting in 01_leds, make factory recipe more generic, create common
device node, move label-mac to 02_network, add MAC addresses to commit
message, remove kmod-leds-gpio, use gzip directly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-31 17:41:21 +02:00
Roger Pueyo Centelles
781d4bfb39 ath79: mikrotik: fix network setup for lhg-hb platform
This network setup for MikroTik devices based on the LHG-HB platform
avoids using the integrated switch and connects the single Ethernet
port directly. This way, link speed (10/100 Mbps) is properly repor-
ted by eth0.

Fixes: FS#3309

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
2020-08-31 17:41:21 +02:00
Sven Wegener
0348a02c7c ath79: use correct MAC address for TP-Link TL-WPA8630 v2
The base address is used for the LAN and 2G WLAN interfaces.
5G WLAN interface is +1 and the PLC interface uses +2.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
[improve commit title, fix assignment in 11-ath10k-caldata]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-31 17:41:21 +02:00
Martin Kennedy
af9dee336d ath79: add support for Meraki MR16
Port device support for Meraki MR16 from the ar71xx target to ath79.

Specifications:

  * AR7161 CPU, 16 MiB Flash, 64 MiB RAM
  * One PoE-capable Gigabit Ethernet Port
  * AR9220 / AR9223 (2x2 11an / 11n) WLAN

Installation:

  * Requires TFTP server at 192.168.1.101, w/ initramfs & sysupgrade .bins
  * Open shell case and connect a USB to TTL cable to upper serial headers
  * Power on the router; connect to U-boot over 115200-baud connection
  * Interrupt U-boot process to boot Openwrt by running:
       setenv bootcmd bootm 0xbf0a0000; saveenv;
       tftpboot 0c00000 <filename-of-initramfs-kernel>.bin;
       bootm 0c00000;
  * Copy sysupgrade image to /tmp on MR16
  * sysupgrade /tmp/<filename-of-sysupgrade>.bin

Notes:

  - There are two separate ARTs in the partition (offset 0x1000/0x5000 and
    0x11000/0x15000) in the OEM device. I suspect this is an OEM artifact;
    possibly used to configure the radios for different regions,
    circumstances or RF frontends. Since the ar71xx target uses the
    second offsets, use that second set (0x11000 and 0x15000) for the ART.

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

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

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

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

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

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

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

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

       ... into ...

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

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

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

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

Addenda:

  - The MR12 should be able to be migrated in a nearly identical manner as
    it shares much of its hardware with the MR16.

  - Thank-you Chris B for copious help with this port.

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
[fix typo in compat message, drop art DT label,
move 05_fix-compat-version to subtarget]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-31 17:41:21 +02:00
Thomas Petazzoni
168faef443 kernel: add options needed for SELinux
This adds a number of options to config/Config-kernel.in so that
packages related to SELinux support can enable the appropriate Linux
kernel support.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[rebase; add ext4, F2FS, UBIFS, and JFFS2 support; add commit message]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
2020-08-31 01:15:41 +01:00
Hannu Nyman
55b73d6754 kernel: add missing symbol NET_DSA_TAG_RTL4_A
Fix build breakage caused by the missing kernel config symbol.

Fixes: 8735997686 ("kernel: backport RTL8366RB patches")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-08-30 22:21:34 +02:00
d7fb7ac278 ath79: increase kernel partition for ar9344 TP-Link CPE/WBS
The kernel has become too big again for the ar9344-based TP-Link
CPE/WBS devices which still have no firmware-partition splitter.

Current buildbots produce a kernel size of about 2469 kiB, while
the partition is only 2048 kiB (0x200000). Therefore, increase it
to 0x300000 to provide enough room for this and, hopefully, the
next kernel.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-30 22:20:37 +02:00
4e4ee46495 ar71xx: drop target
This target has been mostly replaced by ath79 and won't be included
in the upcoming release anymore. Finally put it to rest.

This also removes all references in packages, tools, etc. as well as
the uboot-ar71xx and vsc73x5-ucode packages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-30 22:18:35 +02:00
John Audia
05b8e84362 kernel: bump 5.4 to 5.4.61
Manually merged:
  backport-5.4
     011-kbuild-export-SUBARCH.patch
  layerscape
    701-net-0262-net-dsa-ocelot-add-tagger-for-Ocelot-Felix-switches.patch

All other modifications made by update_kernel.sh

Build-tested: x86/64, lantiq/xrx200, ramips/mt7621
Run-tested: ipq806x (R7800), lantiq/xrx200, x86/64, ramips (RT-AC57U)

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-30 19:44:47 +02:00
Christian Lamparter
f589bd9283 apm821xx: fix typos in .dts files
This patch fixes various typos or tab-vs-space issues in
the APM821XX device targets Device-Tree source files.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:15:09 +02:00
Christian Lamparter
e4c33462f9 apm821xx: use SPDX-License-identifiers
Please note that the DTS are based on really old .DTS from vendors
themselves.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:15:03 +02:00
Christian Lamparter
eb6bb94b12 apm821xx: apm821xx.dtsi fix comment styles
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:58 +02:00
Christian Lamparter
4ea5d443db apm821xx: MX60W: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration for
the Meraki MX60W.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:55 +02:00
Christian Lamparter
1640e71e8e apm821xx: WNDR4700: delete wndr4700 board file
Thanks to the PCIE OF enumeration patch, this is technically
no longer needed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:49 +02:00
Christian Lamparter
9153955095 apm821xx: MR24: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration for
the Meraki MR24.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:44 +02:00
Christian Lamparter
b15420fc6c apm821xx: add missing cells-values for IIC1
These are copied over from the IIC0.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:42 +02:00
Christian Lamparter
90909ef4ba apm821xx: DTB: fix warnings related to sata-port warnings
This patch silences the following warnings:
>netgear-wndr4700.dts:168.3-13:Warning (reg_format): /plb/sata@bffd1800/sata-port@0:reg:property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
>netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #address-cells value
>netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #size-cells value

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:37 +02:00
Christian Lamparter
0facedb515 apm821xx: WNDAP6x0: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration of the
WNDAP620 and WNDAP660.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:31 +02:00
Christian Lamparter
2c3f16d70e apm821xx: WNDR4700: enumerate PCIe in device-tree
This patch adds the pcie-switch and bridge configuration of the
WNDR4700.

This allows to get rid of the legacy firmware monikers and drop
the usbport LED declaration.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-08-29 17:14:27 +02:00
Daniel Golle
d75e753063 oxnas: kd20: revert accedintally commited change
Changing the factory image of KD20 was used during testing and wasn't
intended to be included in the commit fixing a SATA bug on oxnas.
Revert that part of the commit.

Fixes: 5793112f75 ("oxnas: reduce size of ATA DMA descriptor space")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-08-29 01:16:24 +01:00
Daniel González Cabanelas
42d14ace3e mvebu: LS421DE: add linkstation poweroff driver
Compile the Linkstation poweroff module for the Buffalo LS421DE.
Without this driver the device remains forever halted if a power off
command is executed.

The driver will also allow to use the WoL feature, which wasn't availabe
in the stock firmware.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2020-08-28 10:44:29 +01:00
Daniel González Cabanelas
59c200ca0a mvebu: backport linkstation-poweroff upstream driver
Backport the Linkstation poweroff driver from the kernel upstream (commit
a7f79f99541ef)

This driver is required by the Buffalo LinkStation LS421DE for a correct
power off operation. It also allows to use the WoL feature.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2020-08-28 10:44:29 +01:00
Perry Melange
09faa73c53 ramips: rt3883: use lzma-loader for DIR-645
The DIR-645 fails to boot if the kernel is large.
Enabling lzma-loader resolves the issue.

Run-tested on D-Link DIR-645.

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
2020-08-28 00:25:34 +02:00
Georgi Vlaev
51b653de94 ramips: add support for Wavlink WL-WN531A6
This patch adds support for Wavlink WL-WN531A6 (Quantum D6).

Specifications:
--------------

* SoC: Mediatek MT7621AT 2C2T, 880MHz
* RAM: 128MB DDR3, Nanya NT5CB64M16GP-EK
* Flash: 16MB SPI NOR flash, GigaDevice GD25Q127CSIG
* WiFi 5GHz: Mediatek MT7615N (4x4:4) on mini PCIE slot.
* WiFi 2.4GHz: Mediatek MT7603EN (2x2:2) on mini PCIE slot.
* Ethernet: MT7630, 5x 1000Base-T
* LED: Power, WAN, LAN(x4), WiFi, WPS, dual color
       "WAVLINK" LED logo on the top cover.
* Buttons: Reset, WPS, "Turbo", touch button on the top
           cover via RH6015C touch sensor.
* UART: UART1: serial console (57600 8n1) on the J4 header
               located below the top heatsink.
        UART2: J12 header, located on the right side of
               the board.
* USB: One USB3 port.
* I2C: J9 header, located below the top heatsink.

Backup the OEM Firmware:
-----------------------

There isn't any firmware released for the WL-WN531A6 on
the Wavlink web site. Reverting back to the OEM firmware is
not possible unless we have a backup of the original OEM
firmware.

The OEM firmware is stored on /dev/mtd4 ("Kernel").

  1) Plug a FAT32 formatted USB flash drive into the USB port.
  2) Navigate to "Setup->USB Storage". Under the "Available
     Network folder" you can see part of the mount point of
     the newly mounted flash drive filesystem - e.g "sda1".
     The full mount point is prefixed with "/media", so in
     this case the mount point becomes "/media/sda1".
  3) Go to http://192.168.10.1/webcmd.shtml .
  4) Type the following line in the "Command" input box:

     dd if=/dev/mtd4ro of=/media/sda1/firmware.bin

  5) Click "Apply"
  6) After few seconds, in the text area should appear this
     output:

        30080+0 records in
      30080+0 records out

  7) Type "sync" in the "Command" input box and click "Apply".
  8) At this point the OEM firmware is stored on the flash
     drive as "firmware.bin". The size of the file is 15040 KB.

Installation:
------------

* Flashing instructions (OEM web interface):
The OEM web interface accepts only files with names containing
"WN531A6". It's also impossible to flash the *-sysupgrade.bin
image, so we have to flash the *-initramfs-kernel.bin first and
use the OpenWrt's upgrade interface to write the sysupgrade
image.

  1) Rename openwrt-ramips-mt7621-wavlink_wl-wn531a6-initramfs-kernel.bin
     to WN531A6.bin.
  2) Connect your computer to the one of the LAN ports of the
     router with an Ethernet cable and open http://192.168.10.1
  3) Browse to Setup -> Firmware Upgrade interface.
  4) Upload the (renamed) OpenWrt image - WN531A6.bin.
  5) Proceed with the firmware installation and give the device
     a few minutes to finish and reboot.
  6) After reboot wait for the "WAVLINK" logo on the top cover
     to turn solid blue, and open http://192.168.1.1
  7) Use the OpenWrt's "Flash Firmware" interface to write the
     OpenWrt sysupgrade image:
     openwrt-ramips-mt7621-wavlink_wl-wn531a6-squashfs-sysupgrade.bin

* Flashing instructions (u-boot TFTP):
  1) Configure a TFTP server on your computer and set its IP
     to 192.168.10.100
  2) Rename the OpenWrt sysupgrade image to firmware.bin and
     place it in the root folder of the TFTP server.
  3) Power off the device and connect an Ethernet cable from
     one of its LAN ports your computer.
  4) Press the "Reset" button (and keep it pressed)
  5) Power on the device.
  6) After a few seconds, when the connected port LAN LED stops
     blinking fast, release the "Reset" button.
  7) Flashing OpenWrt takes less than a minute, system will
     reboot automatically.
  8) After reboot the WAVLINK logo on the top cover will indicate
     the current OpenWrt running status (wait until the logo tunrs
     solid blue).

Revert to the OEM Firmware:
--------------------------
* U-boot TFTP:
  Follow "Flashing instructions (u-boot TFTP)" and use the
  "firmware.bin" backup image.

* OpenWrt "Flash Firmware" interface:
  Upload the "firmware.bin" backup image and select "Force update"
  before continuing.

Notes:
-----
* The MAC address shown on the label at the back of the device
is assigned to the 2.4G WiFi adapter.

  MAC addresses assigned by the OEM firmware:
  2.4G: *:XX (label): factory@0x0004
    5G: *:XX + 1    : factory@0x8004
   WAN: *:XX - 1    : factory@0xe006
   LAN: *:XX - 2    : factory@0xe000

* The I2C bus and UART2 are fully functional. The headers are
not populated.

Signed-off-by: Georgi Vlaev <georgi.vlaev@konsulko.com>
2020-08-28 00:25:33 +02:00
Andrew Freeman
ff5dd32164 ramips: add support for TP-Link TL-WR850N v2
This patch adds support for the TP-Link TL-WR850N v2. This device
is very similar to TP-Link TL-WR840 v4 and TP-Link TL-WR841 v13.

Specifications:
SOC: MediaTek MT7628NN
Flash: 8 MiB SPI
RAM: 64 MiB
WLAN: MediaTek MT7628NN
Ethernet: 5 ports (100M)

Installation Using the integrated tftp capability of the router:
1. Turn off the router.
2. Connect pc to one of the router LAN ports.
3. Set your PC IPv4 address to 192.168.0.66/24.
4. Run any TFTP server on the PC.
5. Put the recovery firmware on the root directory of TFTP server
   and name the file tp_recovery.bin
6. Start the router by pressing power button while holding the
   WPS/Reset button (or both WPS/Reset and WIFI buttons)
7. Router connects to your PC with IPv4 address 192.168.0.2,
   downloads the firmware, installs it and reboots. LEDs are
   flashing. Now you have OpenWrt installed.
8. Change your IPv4 PC address to something in 192.168.1.0/24
   network or use DHCP to get an address from your OpenWrt router.
9. Done! You can login to your router via ssh.

Forum link:
https://forum.openwrt.org/t/add-support-for-tp-link-tl-wr850n-v2/66899

Signed-off-by: Andrew Freeman <labz56@gmail.com>
[squash an tidy up commits, sort nodes]
Signed-off-by: Darsh Patel <darshkpatel@gmail.com>
[minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-27 16:36:18 +02:00
6e936591f0 at91: explicitly set CONFIG_USB_SUPPORT for sam9x subtarget
The at91 target sets

  FEATURES:=usb usbgadget ...

in the target Makefile, which sets CONFIG_USB_SUPPORT=y in the
.config file for both subtargets.

However, when building with all kmods, the build fails with the
following error message:

  ERROR: module [...]/drivers/bluetooth/btusb.ko is missing.

It appears that only a part of the bluetooth files are compiled.
The package depends @USB_SUPPORT.

This can be easily healed by adding CONFIG_USB_SUPPORT=y to the
sam9x subtarget configuration. Before the 4.14->5.4 bump, the
same was also set in the target's config-4.14 file along with
several other USB config options that are not reimplemented.

Still, it remains a mystery to me why setting the same symbol
via target kernel config creates a different result than the
feature setting the same symbol in target-metadata.pl.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-27 16:36:18 +02:00
Hauke Mehrtens
e9b6dd3151 pistachio: Use kernel 5.4 by default
Kernel 5.4 should be stable enough.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-27 00:34:46 +02:00
adf830a3a5 ramips: remove further mt7621 code from local ethernet driver
While commit 734a8c46e7 focussed on removing stuff directly
selected by the NET_RALINK_* symbols, this patch removes additional
unused mt7621-specific code from the ethernet driver.

As with the previous patch, the main reason is to reduce the amount
of code we have to maintain and care about.

Note that this patch still keeps a few lines with
IS_ENABLED(CONFIG_SOC_MT7621) in mtk_eth_soc.h/.c, as this file is
still selected for the mt7621 subtarget.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-26 23:58:01 +02:00
18fbb9aa21 ath79: fix ethernet setup for some qca953x devices
On Comfast CF-E130N v2 and Mikrotik LHG HB board, the config
found in DTS appears to be strange:

- eth0 has "syscon","simple-mfd" set although it's not enabled
- eth1 is enabled redundantly (already "okay" in qca953x.dtsi)
- phy-handle is set for eth1 in DTS although it has a fixed-link
  in qca953x.dtsi

This seems like a copy-paste gone wrong. Remove the named options.

Run-tested on MikroTik LHG 2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-25 20:54:24 +02:00
7f1540cc46 at91: introduce vendor_model scheme and drop board names
This introduces the vendor_model scheme to this target in order to
harmonize device names within the target and with the rest of
OpenWrt. In addition, custom board names are dropped in favor
of the generic script which takes the compatible.

Use the SUPPORTED_DEVICES variable to store the compatible where it
deviates from the device name, so we can use it in build recipes.

While at it, harmonize a few indents as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-25 19:28:42 +02:00
Hauke Mehrtens
186569e2e8 at91: Refresh kernel config
This was done by running:
make kernel_oldconfig CONFIG_TARGET=subtarget

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-25 19:28:42 +02:00
Sandeep Sheriker M
0d0a0d6649 at91: change dtb file path
Changing dtb file path since the dtb files are build in KDIR folder
with image- prefix.

Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
[remove commented lines]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-25 19:28:42 +02:00
Sandeep Sheriker M
a070e2ee42 at91: bump linux version to 5.4
Move patches to 5.4, put config only in subtarget directories.

Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
[refresh patches, add commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-25 19:28:42 +02:00
Pawel Dembicki
81ac2a73bc layerscape: add flashing manual for LS1012FRDM
LS1012FRDM is supported but there's no flashing instruction in README.

This patch adds it.

While at it, add a missing saveenv for MAC address setup.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[add comment about saveenv]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-25 16:42:21 +02:00
Linus Walleij
8735997686 kernel: backport RTL8366RB patches
These upstream patches makes the RTL8366RB DSA switch work
properly with OpenWrt, the D-Link DIR-685 gets network and
can be used as a router, and the same should be applicable
for any other device that want to enable the RTL8366RB
through Device Tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2020-08-24 18:53:59 +02:00
36aa27189a kernel: bump 5.4 to 5.4.60
Deleted upstream patches:
  generic:
    041-genirq-affinity-Make-affinity-setting-if-activated-o.patch
  ipq806x:
    093-5-v5.8-ipq806x-PCI-qcom-Define-some-PARF-params-needed-for-ipq8064-SoC.patch
    093-6-v5.8-ipq806x-PCI-qcom-Add-support-for-tx-term-offset-for-rev-2_1_0.patch

Merged manually:
  ipq806x:
    093-4-v5.8-ipq806x-PCI-qcom-Use-bulk-clk-api-and-assert-on-error.patch
  layerscape:
    804-crypto-0016-MLKU-114-1-crypto-caam-reduce-page-0-regs-access-to-.patch

Build-tested: ath79/generic, ipq806x, layerscape/armv7, layerscape/armv8_64b
Run-tested: ipq806x (R7800)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-24 17:33:58 +02:00
cc501ab021 kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627
For many target we have added CONFIG_WATCHDOG_CORE=y to the target
config due to the following error:

 Package kmod-hwmon-sch5627 is missing dependencies for the following
 libraries:
 watchdog.ko

However, actually the proper way appears to be setting the
dependency for the kmod-hwmon-sch5627 package, as the error message
demands.

Do this in this patch and remove the target config entries added
due to this issue.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-24 14:09:11 +02:00
Ansuel Smith
58d2bd88ae ipq806x: replace pci patchset with upstream version
Changes:
- Update patches
- Update dts with new binding
    Tx term offset dropped and replaced with a new compatible

Removed:
- 0071-5-PCI-qcom-Programming-the-PCIE-iATU-for-IPQ806x
    Pci init does the same exact thing (was needed in older kernel version)
- 0071-7-pcie-Set-PCIE-MRRS-and-MPS-to-256B
    Rejected upstream, can't find any reason to have this. No regression with
    testing it on R7800.

Tested on R7800 (ipq8065), R7500 v2 ("ipq8064-v2")

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Tested-by: Paul Blazejowski <paulb@blazebox.homeip.net> [R7800]
[rebase and refresh]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-24 14:09:11 +02:00
Rustam Gaptulin
b2f19d3ef7 ramips: mt7621: use lzma-loader for ZBT-WG3526
The wg3526 fails to boot if the kernel is large.
Enabling lzma-loader resolves the issue on both the wg3526-16m
and wg3526-32m.

Fixes: FS#3143

Signed-off-by: Rustam Gaptulin <rascal6@gmail.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-24 00:18:43 +02:00
Joe Mullally
685d2513b5 ath79: fix/improve LED control for TL-WPA8630 v1/v2
The TL-WPA8630 v1 and v2 have the same LED Control GPIO configuration
according to the TP-Link GPL sources. Set the GPIO to output to make
it work and set to Active Low. It defaults to LEDs on at bootup.

To turn all LEDs off:
  echo 0 > /sys/class/gpio/tp-link\:led\:control/value
To turn all LEDs on:
  echo 1 > /sys/class/gpio/tp-link\:led\:control/value

Change the "LED" button from BTN_0 to KEY_LIGHTS_TOGGLE to match other
devices and the button guide, and to reduce the number of unintuitive
"BTN_X" inputs.

Fixes: ab74def0db ("ath79: add support for TP-Link TL-WPA8630P v2")

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
[shorten commit title, minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-22 15:13:15 +02:00
441b36236f ipq806x: create shared DTSI for EA7500 v1 and EA8500
Most of the definitions for the two devices are shared, so put
them in a shared DTSI.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-22 14:20:25 +02:00
Felix Fietkau
f51f18e099 kernel: add patch that adds support for running threaded NAPI poll functions
This is helps on workloads with CPU intensive poll functions (e.g. 802.11)
on multicore systems

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-22 07:02:01 +02:00
Felix Fietkau
3f69f7dd84 uml: update to linux 5.4
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-22 07:02:01 +02:00
Felix Fietkau
9c5128854e kernel: backport a fix for a regression that broke IRQ affinity on ARM
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-21 20:44:53 +02:00
734a8c46e7 ramips: remove legacy ethernet driver components for mt7621
The mt7621 subtarget has been switched to DSA quite a while ago and
seems to run sufficiently fine. Build with older kernels than 5.4 has
been disabled directly during the kernel bump, so our local ethernet
driver is unused in master since then.

Therefore, let's remove the mt7621-specific parts of "our" ethernet
driver, so we don't have to maintain them and it's obvious to
everybody that they are not used anymore.

This also drops the offloading components as this was specifically
implemented to depend on mt7621.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-21 15:46:54 +02:00
373d4cc360 pistachio: use generic diag.sh
Remove local diag.sh in favor of generic one and add the required
led-* aliases to DTS.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-21 11:46:14 +02:00