Commit Graph

24005 Commits

Author SHA1 Message Date
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
David Bauer
4b4bff5070 rockchip: enable Realtek PHY support
The NanoPi R2S features a Realtek Gigabit Ethernet PHY. Enable the
Realtek specific PHY driver to correctly configure internal delays.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-10-03 19:00:49 +02:00
David Bauer
9f907c46bb rockchip: fix NanoPi R2S PHY ID
Fix the PHY ID for the NanoPi R2S PHY compatible to match the used PHY.
The ID was wrong as I've accidentally picked the wrong upstream patch.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-10-03 19:00:49 +02:00
John Audia
d6a9a92e32 kernel: bump 5.4 to 5.4.69
Seemingly unneeded based on new upstream code so manually deleted:
 layerscape:
  820-usb-0007-usb-dwc3-gadget-increase-timeout-value-for-send-ep-c.patch

Manually merged:
 generic-hack:
  251-sound_kconfig.patch

All other modifications made by update_kernel.sh

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

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[add lantiq test report, minor commit message clarification]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-02 22:02:26 +02:00
Pawel Dembicki
2d72671b6e layerscape: add layerscape's SATA driver package
This patch intruduce SATA support for layerscape devices.
Target specific package with ahci_qoriq driver was added
to local modules.mk.
Kmod package was added to default packages for devices with
SATA interface.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
2020-10-02 17:08:28 +02:00
Pawel Dembicki
127db180b6 layerscape: add missing kmods for i2c peripherials
This patch adds kmod-hwmon-ina2xx kmod-hwmon-lm90 for boards,
which have it installed.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
2020-10-02 17:05:09 +02:00
Adrian Schmutzler
2230fe3922 ramips: remove set_wifi_led function in 01_leds
While we mostly use the ucidef_set_led_* functions directly in 01_leds
we still have the set_wifi_led function in parallel for several old
devices. This is not only inconsistent with the other definitions,
it also links to the wlan0 interface instead of using a phy trigger
which would be independent of the interface name (and is used for
all newer devices anyway). Apart from that, the standard names
"wifi" and "wifi-led" are not very helpful in a world with different
radio bands either.

Thus, this patch removes the set_wifi_led function and puts the
relevant commands into the cases explicitly. This makes the
mechanism used more evident and will hopefully lead to some future
improvements or at least prevent some copy-pasting of the old
setups.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-02 14:51:57 +02:00
Adrian Schmutzler
ed5933beb6 ramips: remove option to set WiFi LED via aliases
In ramips, it's not common to use an alias for specifying the WiFi
LED; actually only one device uses this mechanism (TL-WR841N v14).

Particularly since the WiFi LEDs are typically distinguished between
2.4G and 5G etc. it is also not very useful for this target.

Thus, this patch removes the setup lines for this mechanism and
converts the TL-WR841N v14 to the normal setup.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-02 14:51:57 +02:00
Adrian Schmutzler
c846dd91f0 ramips: remove model name from LED labels
Like in the previous patch for ath79 target, this will remove the
"devicename" from LED labels in ramips as well.

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.

For the latter, all existing definitions were actually just
devicename migrations anyway. Therefore, those are removed and
a common migration file is created in target base-files. This is
actually another example of how the devicename removal makes things
easier.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-02 14:51:57 +02:00
Adrian Schmutzler
6f96a4d043 ath79: remove model name from LED labels
Currently, we request LED labels in OpenWrt to follow the scheme

  modelname:color:function

However, specifying the modelname at the beginning is actually
entirely useless for the devices we support in OpenWrt. On the
contrary, having this part actually introduces inconvenience in
several aspects:

  - We need to ensure/check consistency with the DTS compatible
  - We have various exceptions where not the model name is used,
    but the vendor name (like tp-link), which is hard to track
    and justify even for core-developers
  - Having model-based components will not allow to share
    identical LED definitions in DTSI files
  - The inconsistency in what's used for the model part complicates
    several scripts, e.g. board.d/01_leds or LED migrations from
    ar71xx where this was even more messy

Apart from our needs, upstream has deprecated the label property
entirely and introduced new properties to specify color and
function properties separately. However, the implementation does
not appear to be ready and probably won't become ready and/or
match our requirements in the foreseeable future.

However, the limitation of generic LEDs to color and function
properties follows the same idea pointed out above. Generic LEDs
will get names like "green:status" or "red:indicator" then, and
if a "devicename" is prepended, it will be the one of an internal
device, like "phy1:amber:status".

With this patch, we move into the same direction, and just drop
the boardname from the LED labels. This allows to consolidate
a few definitions in DTSI files (will be much more on ramips),
and to drop a few migrations compared to ar71xx that just changed
the boardname. But mainly, it will liberate us from a completely
useless subject to take care of for device support review and
maintenance.
To also drop the boardname from existing configurations, a simple
migration routine is added unconditionally.

Although this seems unfamiliar at first look, a quick check in kernel
for the arm/arm64 dts files revealed that while 1033 lines have
labels with three parts *:*:*, still 284 actually use a two-part
labelling *:*, and thus is also acceptable and not even rare there.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-02 13:51:39 +02:00
Adrian Schmutzler
7f8a1fc55e lantiq: 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.

In lantiq, we therefore requested to have in the DTS files so far,
and omit it in the DTSI files. However, essentially the syntax of
the parent SoC-based DTSI files already determines the DTS
version, so putting it into the DTS files is just a useless repetition.

Consequently, this patch puts the dts-v1 statement into the top-level
SoC-based DTSI files, and removes all other occurences.
Since the dts-v1 statement needs to be before any other definitions,
this also moves the includes accordingly where necessary.

Changes are applied to files-5.4 only, files-4.19 remains untouched.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-01 18:08:17 +02:00
Chuanhong Guo
86fdc8abed ath79: ar8216: make switch register access atomic
reg accesses on integrated ar8229 sometimes fails. As a result, phy read
got incorrect port status and wan link goes down and up mysteriously.
After comparing ar8216 with the old driver, these local_irq_save/restore
calls are the only meaningful differences I could find and it does fix
the issue.
The same changes were added in svn r26856 by Gabor Juhos:
ar71xx: ag71xx: make switch register access atomic

As I can't find the underlying problem either, this hack is broght
back to fix the unstable link issue.
This hack is only suitable for ath79 mdio and may easily break the
driver on other platform. Limit it to ath79-only as a target patch.

Fixes: FS#2216
Fixes: FS#3226
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-30 15:56:05 +08:00
David Bauer
18acf62be1 rockchip: rk3328: add compatible to NanoPi R2S ethernet PHY
This adds the compatible property to the NanoPi R2S ethernet PHY node.
Otherwise, the PHY might not be probed, as the PHY ID reads all 0xff
when it is still in reset.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-09-30 00:06:59 +02:00
Paul Spooren
29fd93da14 imagebuilder: add missing libfakeroot files
The `libfakeroot` files are currently missing in the ImageBuilder. As
`fakeroot` is always built, copy those files unconditionally.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-09-29 00:06:32 +01:00
David Bauer
8b4233188d rockchip: refresh NanoPi R2S patches
Update the patches for the NanoPi R2S to the v3 sent (and accepted)
upstream.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-09-28 17:32:14 +02:00
John Audia
283cdb30ab kernel: bump 5.4 to 5.4.68
All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x, ath79/generic, bcm72xx/bcm2711
Run-tested: ipq806x (R7800)

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2020-09-28 16:23:11 +02:00
David Bauer
a735eabc32 ath79: add WiFi migration for AR913x
This adds the automatic WiFi path migration for AR913x platforms.

Tested on: TP-Link TL-WA901ND v2

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-09-28 16:23:03 +02:00
Piotr Dymacz
e9263123f9 ath79: add support for Hak5 WiFi Pineapple NANO
Hak5 WiFi Pineapple NANO is an "USB dongle" device dedicated for Wi-Fi
pentesters. This device is based on Atheros AR9331 and AR9271. Support
for it was first introduced in 950b278c81 (ar71xx). FCC ID: 2AB87-NANO.

Specifications:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR1)
- 16 MB of flash (SPI NOR)
- 1T1R 2.4 GHz Wi-Fi (AR9331)
- 1T1R 2.4 GHz Wi-Fi (AR9271L), with ext. PA and LNA (Qorvo RFFM4203)
- 2x RP-SMA antenna connectors
- 1x USB 2.0 to 10/100 Ethernet bridge (ASIX AX88772A)
- integrated 4-port USB 2.0 HUB: Alcor Micro AU6259:
  - 1x USB 2.0
  - 1x microSD card reader (Genesys Logic GL834L)
  - Atheros AR9271L
- 1x LED, 1x button
- UART (4-pin, 2 mm pitch) header on PCB
- USB 2.0 Type-A plug for power and AX88772A

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz
b33ce8c535 ath79: add support for Hak5 Packet Squirrel
Hak5 Packet Squirrel is a pocket-sized device dedicated for pentesters
(MITM attacks). This device is based on Atheros AR9331 but it lacks
WiFi. Support for it was first introduced in 950b278c81 (ar71xx).

Specifications:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x RJ45 10/100 Mbps Ethernet (AR9331)
- 1x USB 2.0
- 1x RGB LED, 1x button, 1x 4-way mechanical switch
- 1x Micro USB Type-B for main power input

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz
a2f3a58607 ath79: add support for Hak5 LAN Turtle
Hak5 LAN Turtle is an "USB Ethernet Adapter" shaped device dedicated for
sysadmins and pentesters. This device is based on Atheros AR9331 but it
lacks WiFi. Support for it was first introduced in 950b278c81 (ar71xx).

Two different versions of this device exist and it's up to the user to
install required drivers (generic image supports only common features):

- LAN Turtle 3G with Quectel UG96 3G modem
- LAN Turtle SD with microSD card reader (Alcorlink AU6435R)

Specifications:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 1x RJ45 10/100 Mbps Ethernet (AR9331)
- 1x USB 2.0 to 10/100 Ethernet bridge (Realtek RTL8152B)
- 2x LED (power, system), 1x button (inside, on the PCB)
- USB 2.0 Type-A plug for power and RTL8152B

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz
70a57d48db ath79: add support for ALFA Network N5Q
ALFA Network N5Q is a successor of previous model, the N5 (outdoor
CPE/AP, based on Atheros AR7240 + AR9280). New version is based on
Atheros AR9344.

Support for this device was first introduced in 4b0eebe9df (ar71xx
target) but users are advised to migrate from ar71xx target without
preserving settings as ath79 support includes some changes in network
and LED default configuration. They were aligned with vendor firmware
and recently added N2Q model (both Ethernet ports as LAN, labelled as
LAN1 and LAN2).

Specifications:

- Atheros AR9344
- 550/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R 5 GHz Wi-Fi, with ext. PA (RFPA5542) and LNA, up to 27 dBm
- 2x IPEX/U.FL or MMCX antenna connectors (for PCBA version)
- 8x LED (7 are driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- header for optional 802.3at/af PoE module
- DC jack for main power input (optional, not installed by default)
- UART (4-pin, 2.54 mm pitch) header on PCB
- LEDs (2x 5-pin, 2.54 mm pitch) header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE. 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-09-28 01:28:37 +02:00
Piotr Dymacz
6492ea7d9e ath79: add support for ALFA Network N2Q
ALFA Network N2Q is an outdoor N300 AP/CPE based on Qualcomm/Atheros
QCA9531 v2. This model is a successor of the old N2 which was based
on Atheros AR7240. FCC ID: 2AB8795311.

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2T2R 2.4 GHz Wi-Fi with ext. PA (Skyworks SE2623L) and LNA
- 2x 10/100 Mbps Ethernet with passive PoE input in one port (24 V)
- PoE pass through in second port (controlled by GPIO)
- support for optional 802.3af/at PoE module
- 1x mini PCIe slot (PCIe bus, extra 4.2 V for high power cards)
- 2x IPEX/U.FL connectors on PCB
- 1x USB 2.0 mini Type-B (power controlled by GPIO)
- 8x LED (7 of them are driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- UART (4-pin, 2.54 mm pitch) header on PCB
- LEDs (2x 5-pin, 2.54 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-09-28 01:28:37 +02:00
Piotr Dymacz
9bcf98ed85 ath79: add support for ALFA Network R36A
ALFA Network R36A is a successor of the previous model, the R36 (Ralink
RT3050F based). New version is based on Qualcomm/Atheros QCA9531 v2, FCC
ID: 2AB879531.

Support for this device was first introduced in af8f0629df (ar71xx
target). When updating from previous release (and/or ar71xx target),
user should only adjust the WAN LED trigger type (netdev in ar71xx,
switch port in ath79).

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB (R36AH/-U2) or 64 MB (R36A) of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x 10/100 Mbps Ethernet
- Passive PoE input support (12~36 V) in RJ45 near DC jack
- 2T2R 2.4 GHz Wi-Fi with Qorvo RFFM8228P FEM
- 2x IPEX/U.FL connectors on PCB
- 1x USB 2.0 Type-A
- 1x USB 2.0 mini Type-B in R36AH-U2 version
- USB power is controlled by GPIO
- 6/7x LED (5/6 of them are driven by GPIO)
- 2x button (reset, wifi/wps)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- DC jack with lock, for main power input (12 V)
- UART (4-pin, 2.54 mm pitch) header on PCB

Optional/additional features in R36A series (R36A was the first model):
- for R36AH:    USB 2.0 hub*
- for R36AH-U2: USB 2.0 hub*, 1x USB 2.0 mini Type-B, one more LED

*) there are at least three different USB 2.0 hub in R36AH/-U2 variants:
- Terminus-Tech FE 1.1
- Genesys Logic GL852G
- Genesys Logic GL850G (used in latests revision)

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-09-28 01:28:37 +02:00
Piotr Dymacz
cf42660dce ath79: add support for Samsung WAM250
Samsung WAM250 is a dual-band (selectable, not simultaneous) wireless
hub, dedicated for Samsung Shape Wireless Audio System. The device is
based on Atheros AR9344 (FCC ID: A3LWAM250). Support for this device
was first introduced in e58e49bdbe (ar71xx target).

Specifications:

- Atheros AR9344
- 560/450/225 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x 10/100 Mbps Ethernet
- 2T2R 2.4/5 GHz Wi-Fi, with ext. PA (SE2598L, SE5003L) and LNA
- 1x USB 2.0
- 4x LED (all are driven by GPIO)
- 2x button (reset, wps/speaker add)
- DC jack for main power input (14 V)
- UART header on PCB (J4, RX: 3, TX: 5)

Flash instruction:

This device uses dual-image (switched between upgrades) with a common
jffs2 config partition. Fortunately, there is a way to disable this mode
so that more flash space can be used by OpenWrt image.

You can easily access this device over telnet, using root/root
credentials (the same also work for serial console access).

1. Make sure that your device uses second (bootpart=2) image using
   command: "fw_printenv bootpart".
2. If your device uses first image (bootpart=1), perform upgrade to the
   latest vendor firmware (after the update, device should boot from
   second partition) using web gui (default login: admin/1234567890).
3. Rename "sysupgrade" image to "firmware.bin", download it (you can use
   wget, tftp or ftpget) to "/tmp" and issue below commands:

   mtd_debug erase /dev/mtd3 0 $(wc -c /tmp/firmware.bin | awk -F' ' '{print $1}')
   mtd_debug write /dev/mtd3 0 $(wc -c /tmp/firmware.bin)
   fw_setenv bootpart
   fw_setenv bootcmd "bootm 0x9f070000"
   reboot

Revert to vendor firmware instruction:

1. Download vendor firmware to "/tmp" device and issue below commands:

   fw_setenv bootpart 1
   sysupgrade -n -F SS_BHUB_v2.2.05.bin

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz
f777bca95d ath79: image: don't combine kmod-usb2 with kmod-usb-chipidea2
Include of kmod-usb-chipidea2 is enough to support USB host mode in
devices with Atheros AR9331 WiSOC.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz
c65c306d33 ath79: add support for Wallys DR531
Wallys DR531 is based on Qualcomm Atheros QCA9531 v2. Support for this
device was first introduced in e767980eb8 (ar71xx target).

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 550/400/200 MHz (CPU/DDR/AHB)
- 2x 10/100 Mbps Ethernet
- 64 MB of RAM (DDR2)
- 8 MB of flash (SPI NOR)
- 2T2R 2.4 GHz Wi-Fi, with external PA (SE2576L), up to 30 dBm
- 2x MMCX connectors (optional IPEX/U.FL)
- mini PCIe connector (PCIe/USB buses and mini SIM slot)
- 7x LED, 1x button, 1x optional buzzer
- UART, JTAG and LED headers on PCB

Flash instruction (do it under U-Boot, using UART):

  tftpb 0x80060000 openwrt-ath79-...-dr531-squashfs-sysupgrade.bin
  erase 0x9f050000 +$filesize
  cp.b $fileaddr 0x9f050000 $filesize
  setenv bootcmd "bootm 0x9f050000"
  saveenv && reset

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz
66abd58196 ath79: add support for ALFA Network AP121FE
The AP121FE is a slightly modified version of already supported AP121F
model (added to ar71xx in 0c6165d21a and to ath79 in 334bbc5198).

The differences in compare to AP121F:

- no micro SD card reader
- USB data lines are included in Type-A plug
- USB bus switched to device/peripheral mode (permanently, in bootstrap)

Other than that, specifications are the same:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR1)
- 16 MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 1T1R 2.4 GHz Wi-Fi, up to 15 dBm
- 1x IPEX/U.FL connector, internal PCB antenna
- 3x LED, 1x button, 1x switch
- 4-pin UART header on PCB (2 mm pitch)
- USB 2.0 Type-A plug (power and data)

Flash instruction (under U-Boot web recovery mode):

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with RJ45 port, 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-09-28 01:28:37 +02:00
Piotr Dymacz
7f96cbd2a1 ath79: enable usbgadget feature
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz
b329bb9456 ath79: increase SPI clock and enable fast-read on AP121F
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Adrian Schmutzler
315904a459 ramips: merge ethernet setup for RT-AC51U/RT-AC54U
The ethernet setup/label MAC address for RT-AC51U and RT-AC54U are
the same, so move them into the shared DTSI.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-28 00:20:24 +02:00
Adrian Schmutzler
96023cd4ba ath79: fix LED labels for PowerCloud CAP324
The order of function and color in the labels in inverted for the
LAN LEDs. Fix it.

Fixes: 915966d861 ("ath79: Port PowerCloud Systems CAP324 support")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-27 15:58:14 +02:00
Adrian Schmutzler
d232a8ac7d ath79: fix rssi-low LED for My Net Range Extender
The LED color was missing in 01_leds.

Fixes: 745dee11ac ("ath79: add support for WD My Net Wi-Fi Range
Extender")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-27 15:58:14 +02:00
Sungbo Eo
4682d4d770 ipq40xx: tidy up device recipe for Edgecore OAP100
* split up DEVICE_TITLE into DEVICE_{VENDOR,MODEL}
* use SOC instead of DEVICE_DTS

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-09-26 18:26:19 +02:00
Adrian Schmutzler
621297e867 ramips: 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.

In ramips, we therefore requested to have in the DTS files so far,
and omit it in the DTSI files. However, essentially the syntax of
the parent mtxxxx/rtxxxx DTSI files already determines the DTS
version, so putting it into the DTS files is just a useless repetition.

Consequently, this patch puts the dts-v1 statement into the top-level
SoC-based DTSI files, and removes all other occurences.
Since the dts-v1 statement needs to be before any other definitions,
this also moves the includes accordingly where necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-25 23:26:40 +02:00
Adrian Schmutzler
41cc7edc15 ath79: move dts-v1 statement to ath79.dtsi
The "/dts-v1/;" identifier is supposed to be present once at the
top of a device tree file after the includes have been processed.

In ath79, we therefore requested to have in the DTS files so far,
and omit it in the DTSI files. However, essentially the syntax of
the parent ath79.dtsi file already determines the DTS version, so
putting it into the DTS files is just a useless repetition.

Consequently, this patch puts the dts-v1 statement into the parent
ath79.dtsi, which is (indirectly) included by all DTS files. All
other occurences are removed.
Since the dts-v1 statement needs to be before any other definitions,
this also moves the includes to make sure the ath79.dtsi or its
descendants are always included first.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-25 23:26:34 +02:00
Adrian Schmutzler
3ca2d31c54 ath79: move ath79-clk.h include to ath79.dtsi
ath79.dtsi uses ATH79_CLK_MDIO, so the include

  <dt-bindings/clock/ath79-clk.h>

needs to be moved there.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-25 23:24:09 +02:00
Adrian Schmutzler
bdd9dd8ab2 ipq40xx: tidy up dts-v1 statements
The "/dts-v1/;" identifier is supposed to be present once at the
top of a device tree file after the includes have been processed.

Therefore, adding it to a DTS _and_ a DTSI file is actually wrong,
as it will be present twice then (though the compiler does not
complain about it).

In ipq40xx, the dts-v1 statement is already included in
qcom-ipq4019.dtsi, so we don't have to add it anywhere at all.
However, based on the conditions stated above, this requires
qcom-ipq4019.dtsi to be included as the first file in any DTS(I).

Consequently, this patch removes all cases of dts-v1 for the
ipq40xx target, and moves the includes accordingly where necessary.

While at it, remove a few obviously unneeded includes on the way.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-25 21:10:41 +02:00
Adrian Schmutzler
b284333b3a ath79: move engenius_loader_okli recipe before devices
Move engenius_loader_okli image recipe in front of all Engenius
devices, so adding new device entries will not have them sorted
before the shared recipe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-25 20:07:16 +02:00
Linus Walleij
7e9e6fdac7 gemini: Bring up DSA switches
First group the interfaces on the DSA switch into the
right LAN/WAN groups. Tested successfully on the
D-Link DIR-685 with the RTL8366RB DSA switch.

The RTL8366RB is DSA custom tagged and now handled
by the kernel tag parser. (Backported.)

The Vitesse switches are not capable of supporting
DSA per-port tagging. We suspect they must be handled
using some custom VLAN set-up.

Cc: Pawel Dembicki <paweldembicki@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[sorted devices alphabetically]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:34 +02:00
Christian Lamparter
fa1713e791 ipq40xx: fix DTS warning in qcom-ipq4029-gl-s1300.dts
.dts:226.17-230.4: Warning (spi_bus_reg): /soc/spi@78b6000/spi@1:
	SPI bus unit address format error, expected "0"

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:34 +02:00
Christian Lamparter
890bb54d7f ipq40xx: fix DTS warning in qcom-ipq4019-cm520-79f.dts
.dts:121.4-14: Warning (reg_format): /led_spi/led_gpio@0:reg: \
	property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
.dts:119.24-126.5: Warning (avoid_default_addr_size): /led_spi/led_gpio@0: \
	Relying on default #size-cells value

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:34 +02:00
Christian Lamparter
0e4092cbad bcm53xx: add Cisco Meraki MR32
This patch adds support for Cisco Meraki MR32.
The unit was donated by Chris Blake. Thank you!

WARNING:
Only the 1x1:1 abgn Air Marshal WIPS wifi is currently supported by b43:
 b43-phy2: Found PHY: Analog 9, Type 4 (N), Revision 16
 b43-phy2: Found Radio: Manuf 0x17F, ID 0x2057, Revision 9, Version 1
 b43-phy2: Loading firmware version 784.2 (2012-08-15 21:35:19)
 and only as 802.11ABG!

while WIFI1 and WIFI2 (both BCM4352) are not:
 b43-phy0: Broadcom 4352 WLAN found (core revision 42)
 b43-phy0 ERROR: FOUND UNSUPPORTED PHY (Analog 12, Type 11 (AC), Revision 1)

Hardware Highlights:

SoC:	Broadcom BCM53016A1 (1 GHz, 2 cores)
RAM:	128 MiB
NAND:	128 MiB Spansion S34ML01G2 (~114 MiB useable)
ETH:	1GBit Ethernet Port - PoE
WIFI1:	Broadcom BCM43520 an+ac (2x2:2 - id: 0x4352)
WIFI2:	Broadcom BCM43520 bgn (2x2:2 - id: 0x4352)
WIFI3:	Broadcom BCM43428 abgn (1x1:1 - id: 43428)

BLE:	Broadcom BCM20732 (ttyS1)
LEDS:   1 x Programmable RGB Status LED (driven by a PWM)
	1 x White LED (GPIO)
	1 x Orange LED Fault Indicator (GPIO)
	2 x LAN Activity / Speed LEDs (On the RJ45 Port)
BUTTON: one Reset button
MISC:   AT24C64 8KiB EEPROM (i2c - stores Ethernet MAC + Serial#!)
	ina219 hardware monitor (i2c)
	Kensington Lock

SERIAL:
	WARNING: The serial port needs a TTL/RS-232 3V3 level converter!
	The Serial setting is 115200-8-N-1. The board has a populated
	right angle 1x4 0.1" pinheader.
	The pinout is: VCC, RX, TX, GND. (Use a multimeter)

Flashing needs a serial adaptor (due to the lack of a working dropbear on
the original firmware).

This flashing procedure for the MR32 was tested with firmware:
"r23-149867:150252-aacharya".

0. Create a seperate Ethernet LAN which does not have access to the internet.
   Ideally use 192.168.1.2 for your PC. Make sure to reserve 192.168.1.1 it
   will be used later on by the OpenWrt firmware. The original Meraki firmware
   will likely try to setup the network via DHCP Discovery, so make sure your
   PC is running a DHCP-Server (i.e.: dnsmasq)
   '# dnsmasq -i eth# -F 192.168.1.5,192.168.1.50
   Furthermore, the PC needs a supported ssh/http/ftp server in order to
   retrieve the initramfs + dtb file

1. Disassemble the MR32 device by removing all screws (4 screws are located
   under the 4 rubber feets!) and prying open the plastic covers without
   breaking the plastic retention clips. Once inside, remove all the screws
   on the outer metal shielding to get to the PCB. It's not necessary to
   remove the antennas!

2. Connect the serial cable to the serial header.

3. Partially reassemble the outer metal shielding to ensure that the SoC
   has a proper heat sink.

4. Connect the Ethernet patch cable to the device and the power cable.

5. Wait for the device to boot and enter the root shell.
   (rooting is not discussed in detail here please refer to
   Chris Blake - "pwning the meraki mr18" blog post:
   <https://servernetworktech.com/2016/02/pwning-the-meraki-mr18/>
   (The same method works with the MR32's r23-149867:150252-aacharya)

   Wait for the MR32 to enter the "<Meraki>" prompt and enter:
   <Meraki> odm serial_num read
   (Verify that it matches what's on the S/N Sticker on the back!)
   <Meraki> odm serial_num write Q2XX-XXXX-XXXV
   <Meraki> odm serial_num read
   (Verify that the S/N has changed - and the LED start to flash)

   now to flash the firmware:
   <Meraki> odm firmware part.safe "http://192.168.1.2/mr32-initramfs.bin"

Once OpenWrt booted use sysupgrade to permanently install
OpenWrt. To do this: Download the latest sysupgrade.bin file
for the MR32 to the device and use sysupgrade *sysupgrade.bin
to install it.

WARNING: DO NOT DELETE the "storage" ubi volume!

To flash later MR32 Firmwares like r25-201804051805-G885d6d78-dhow-rel
requires in-circut-i2c tools to access the I2C EEPROM AT24C64 next to
the SoC. The idea is pretty much the same as from Step 5 from above:
Change the serial number to Q2XXXXXXXXXV (should be around 0x7c), then
attach a serial cable, ethernet (but make sure the device can't reach
the internet!) hit "s" (the small s!) during boot to enter the root-shell
and add the following commands to the /storage/config there:

serial_allow_odm true
serial_access_enabled true
serial_access_check false
valid_config true

and then hit exit to let it finish booting.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:34 +02:00
Christian Lamparter
1291274335 kernel: package bcm53xx i2c module
The BCM5301x SoCs do have i2c. Since this is only
being used by the Meraki MR32, this will be packaged
as a module.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:34 +02:00
Christian Lamparter
abe46d5002 kernel: add default for new config symbols
Provide disabled defaults for I2C_SLAVE_EEPROM and IPMB_DEVICE_INTERFACE.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:34 +02:00
Christian Lamparter
5f610ec4b8 bcm53xx: backport uart2 and pcie2 device-nodes
These have made their way into -next. This patch
also includes the portion of the bcm53xx kernel
patch refreshes as the hunks in
302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch
moved slightly due to the added nodes.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:34 +02:00
Christian Lamparter
c6d9a2ac59 bcm53xx: enable PWM for bcm53xx
The Meraki MR32 (BCM53016A1) uses the pwm to drive the
tricolor LED. The driver has been available in upstream
for a long time. Only the Device-Tree definition was
missing, but it has been queued recently.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:33 +02:00
Christian Lamparter
f6fbc39706 build: define PWM_SUPPORT arch feature flag
As the PWM has its own sub-system in the Linux kernel,
I think it should be handled in the same way as GPIO, RTC, PCI...

This patch introduces a specific feature flag "pwm" and the
"leds-pwm" kernel module as the first customer.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:32:33 +02:00
Hans Geiblinger
a9071d02b5 ipq40xx: Add support for Linksys MR8300 (Dallas)
The Linksys MR8300 is based on QCA4019 and QCA9888
and provides three, independent radios.
NAND provides two, alternate kernel/firmware images
with fail-over provided by the OEM U-Boot.

Hardware Highlights:

SoC: IPQ4019 at 717 MHz (4 CPUs)
RAM: 512MB RAM

SoC:	Qualcomm IPQ4019 at 717 MHz (4 CPUs)
RAM:	512M DDR3
FLASH:	256 MB NAND (Winbond W29N02GV, 8-bit parallel)
ETH:	Qualcomm QCA8075 (4x GigE LAN, 1x GigE Internet Ethernet Jacks)
BTN:	Reset and WPS
USB:	USB3.0, single port on rear with LED
SERIAL:	Serial pads internal (unpopulated)
LED:	Four status lights on top + USB LED
WIFI1:	2x2:2 QCA4019 2.4 GHz radio on ch. 1-14
WIFI2:  2x2:2 QCA4019 5 GHz radio on ch. 36-64
WIFI3:  2x2:2 QCA9888 5 GHz radio on ch. 100-165

Support is based on the already supported EA8300.
Key differences:
	EA8300 has 256MB RAM where MR8300 has 512MB RAM.
	MR8300 has a revised top panel LED setup.

Installation:
"Factory" images may be installed directly through the OEM GUI using
URL: https://ip-of-router/fwupdate.html (Typically 192.168.1.1)

Signed-off-by: Hans Geiblinger <cybrnook2002@yahoo.com>
[copied Hardware-highlights from EA8300. Fixed alphabetical order.
fixed commit subject, removed bogus unit-address of keys,
fixed author (used Signed-off-By to From:) ]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:31:51 +02:00
Tomasz Maciej Nowak
e24635710c ipq40xx: add support for Luma Home WRTQ-329ACN
Luma Home WRTQ-329ACN, also known as Luma WiFi System, is a dual-band
wireless access point.

Specification
SoC: Qualcomm Atheros IPQ4018
RAM: 256 MB DDR3
Flash: 2 MB SPI NOR
       128 MB SPI NAND
WIFI: 2.4 GHz 2T2R integrated
      5 GHz 2T2R integrated
Ethernet: 2x 10/100/1000 Mbps QCA8075
USB: 1x 2.0
Bluetooth: 1x 4.0 CSR8510 A10, connected to USB bus
LEDS: 16x multicolor LEDs ring, controlled by MSP430G2403 MCU
Buttons: 1x GPIO controlled
EEPROM: 16 Kbit, compatible with AT24C16
UART: row of 4 holes marked on PCB as J19, starting count from the side
      of J19 marking on PCB
      1. GND, 2. RX, 3. TX, 4. 3.3V
      baud: 115200, parity: none, flow control: none

The device supports OTA or USB flash drive updates, unfotunately they
are signed. Until the signing key is known, the UART access is mandatory
for installation. The difficult part is disassembling the casing, there
are a lot of latches holding it together.

Teardown
Prepare three thin, but sturdy, prying tools. Place the device with back
of it facing upwards. Start with the wall having a small notch. Insert
first tool, until You'll feel resistance and keep it there. Repeat the
procedure for neighbouring walls. With applying a pressure, one edge of
the back cover should pop up. Now carefully slide one of the tools to
free the rest of the latches.
There's no need to solder pins to the UART holes, You can use hook clips,
but wiring them outside the casing, will ease debuging and recovery if
problems occur.

Installation
1. Prepare TFTP server with OpenWrt initramfs image.
2. Connect to UART port (don't connect the voltage pin).
3. Connect to LAN port.
4. Power on the device, carefully observe the console output and when
   asked quickly enter the failsafe mode.
5. Invoke 'mount_root'.
6. After the overlayfs is mounted run:
     fw_setenv bootdelay 3
   This will allow to access U-Boot shell.
7. Reboot the device and when prompted to stop autoboot, hit any key.
8. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use
   'setenv' to do that, then run following commands:
     tftpboot 0x84000000 <openwrt_initramfs_image_name>
     bootm 0x84000000
   and wait till OpenWrt boots.
9. In OpenWrt command line run following commands:
     fw_setenv openwrt "setenv mtdids nand1=spi_nand; setenv mtdparts mtdparts=spi_nand:-(ubi); ubi part ubi; ubi read 0x84000000 kernel; bootm 0x84000000"
     fw_setenv bootcmd "run openwrt"
10. Transfer OpenWrt sysupgrade image to /tmp directory and flash it
    with:
     ubirmvol /dev/ubi0 -N ubi_rootfs
     sysupgrade -v -n /tmp/<openwrt_sysupgrade_image_name>
11. After flashing, the access point will reboot to OpenWrt, then it's
    ready for configuration.

Reverting to OEM firmware
1. Execute installation guide steps: 1, 2, 3, 7, 8.
2. In OpenWrt command line run following commands:
     ubirmvol /dev/ubi0 -N rootfs_data
     ubirmvol /dev/ubi0 -N rootfs
     ubirmvol /dev/ubi0 -N kernel
     ubirename /dev/ubi0 kernel1 kernel ubi_rootfs1 ubi_rootfs
     ubimkvol /dev/ubi0 -S 34 -N kernel1
     ubimkvol /dev/ubi0 -S 320 -N ubi_rootfs1
     ubimkvol /dev/ubi0 -S 264 -N rootfs_data
     fw_setenv bootcmd bootipq
3. Reboot.

Known issues
The LEDs ring doesn't have any dedicated driver or application to control
it, the only available option atm is to manipulate it with 'i2cset'
command. The default action after applying power to device is spinning
blue light. This light will stay active at all time. To disable it
install 'i2c-tools' with opkg and run:
 i2cset -y 2 0x48 3 1 0 0 i
The light will stay off until next cold boot.

Additional information
After completing 5. step from installation guide, one can disable asking
for root password on OEM firmware by running:
 sed -e 's/root/root::/' -i /etc/passwd
This is useful for investigating the OEM firmware. One can look
at the communication between the stock firmware and the vendor's
cloud servers or as a way of making a backup of both flash chips.
The root password seems to be constant across all sold devices.
This is output of 'led_ctl' from OEM firmware to illustrate
possibilities of LEDs ring:

Usage: led_ctl [status | upgrade | force_upgrade | version]
       led_ctl solid    COLOR <brightness>
       led_ctl single   COLOR INDEX <brightness 0 - 15>
       led_ctl spinning COLOR <period 1 - 16 (lower = faster)>
       led_ctl fill     COLOR <period 1 - 16 (lower = faster)>
                                             ( default is 5 )
       led_ctl flashing COLOR <on dur 1 - 128>  <off dur 1 - 128>
                              (default is  34)  ( default is 34 )
       led_ctl pulsing  COLOR
COLOR: red, green, blue, yellow, purple, cyan, white

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[squash "ipq-wifi: add BDFs for Luma Home WRTQ-329ACN" into commit,
changed ubi volumes for easier integration, slightly reworded
commit message, changed ubi volume layout to use standard names all
around]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 19:30:19 +02:00
Brian Norris
03bc9b0002 ipq40xx: add open-drain support to pinctrl-msm
Submitted upstream. Shouldn't affect existing devices, but enables new
device support.

https://lore.kernel.org/linux-gpio/20200703080646.23233-1-computersforpeace@gmail.com/

Currently queued for-next:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-next&id=13355ca35cd16f5024655ac06e228b3c199e52a9

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
[refresh patch]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-25 18:43:09 +02:00
John Audia
3ea1b5b745 kernel: bump 5.4 to 5.4.67
All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x, lantiq/xrx200 and ath79/generic
Run-tested: ipq806x (R7800), lantiq (Easybox 904 xDSL)

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[add test on lantiq]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-24 18:53:23 +02:00
J. Scott Heppler
620f9c7734 ramips: add support for Linksys EA7300 v2
This submission relied heavily on the work of
Santiago Rodriguez-Papa <contact at rodsan.dev>

Specifications:

*  SoC:            MediaTek  MT7621A            (880  MHz  2c/4t)
*  RAM:            Winbond W632GG6MB-12         (256M  DDR3-1600)
*  Flash:          Winbond W29N01HVSINA         (128M  NAND)
*  Eth:            MediaTek  MT7621A            (10/100/1000  Mbps  x5)
*  Radio:          MT7603E/MT7615N              (2.4  GHz  &  5  GHz)
                     4  antennae:  1  internal  and  3  non-deatachable
*  USB:            3.0  (x1)
*  LEDs:
          White    (x1  logo)
          Green    (x6  eth  +  wps)
          Orange   (x5,  hardware-bound)
*  Buttons:
          Reset    (x1)
          WPS      (x1)

Installation:

Flash factory image through GUI.

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

Reverting to factory firmware:

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

Signed-off-by: J. Scott Heppler <shep971@centurylink.net>
2020-09-23 12:17:32 +02:00
Adrian Schmutzler
0cfdc7d446 target: update SPDX license names
SPDX moved from GPL-2.0 to GPL-2.0-only and from GPL-2.0+ to
GPL-2.0-or-later. Reflect that in the SPDX license headers.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-22 20:58:26 +02:00
Paul Spooren
e8f61bf50d ath79: remove DTS from ATH79 target name
The legacy ar71xx target is removed and multiple targets use DTS now, so
there is no need to point that out for ATH79 specifically.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-09-22 20:29:24 +02:00
Chuanhong Guo
006cd489f0 mediatek: mt7622: select bluetooth module instead of firmware
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-22 21:13:54 +08:00
Chuanhong Guo
20f2bd044a mediatek: build btmtkuart as a kernel module
bluetooth on mt7622 needs a firmware to start. It can't be built-in or
it tries to load firmware before rootfs is mounted, and then fails.
build it as a kernel module to fix that.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-22 21:07:50 +08:00
David Woodhouse
7190fb2da4 mediatek: mt7623: use bash for generating bootable images
It turns out that 'echo -e' isn't portable; it doesn't work in the dash
builtin echo and Ubuntu users are complaining.

I can't even get octal (specified by POSIX) to work consistently because
those  variants of 'echo' which *do* support -e don't seem to interpret
octalwithout it.

I could switch to /bin/echo but using -e with that isn't actually
portable *either* even though it works today.

For now just stick with bash, and use its builtin. We may end up using
something else entirely; perhaps perl.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2020-09-19 13:39:29 +01:00
David Woodhouse
d10b738c4b mediatek: fix missing pause on switch port for Banana Pi R2
This causes rx drops when running iperf.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2020-09-19 13:39:29 +01:00
Adrian Schmutzler
95c9df7971 ipq806x: fix support of Edgecore ECW5410 support
This fixes several stylistic and functional errors of the recently
added Edgecore ECW5410:

  - fix call in 11-ath10k-caldata
  - use hex notation in 11-ath10k-caldata
  - remove redundant definitions from DTS that are already in DTSI
  - use proper sorting in image/Makefile
  - use DEVICE_VENDOR/DEVICE_MODEL instead of DEVICE_TITLE
  - use SOC instead of DEVICE_DTS

Fixes: 59f0a0fd83 ("ipq806x: add Edgecore ECW5410 support")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-19 13:32:11 +02:00
John Audia
770a9c6787 kernel: bump 5.4 to 5.4.66
All modifications made by update_kernel.sh/no manual intervention needed

Run-tested: ipq806x (R7800), ath79 (Archer C7v5), x86/64

No dmesg regressions, everything appears functional

Signed-off-by: John Audia <graysky@archlinux.us>
[add run test from PR]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-19 12:41:29 +02:00
John Thomson
bf2870c1d9 kernel: fix mtd partition erase < parent_erasesize writes
This bug applied where mtd partition end address,
or erase start address, was not cleanly divisible by parent mtd erasesize.

This error would cause the bits following the end of the partition
to the next erasesize block boundary to be erased,
and this partition-overflow data to be written to the partition erase
address (missing additional partition offset address)
of the mtd (top) parent device.

Fixes: FS#2428

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Tested-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[shorten commit title, add Fixes, fix kernel 4.19 as well]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-19 12:41:29 +02:00
Roger Pueyo Centelles
e6b42386ba ath79/mikrotik: fix soft_config location for SXT 5n
The soft_config partition for these devices lays between 0xe000 and
0xf000 (as correctly detected by the RouterBoard platform driver),
before the bootloader2 partition which starts at 0x10000.

This commit correctly sorts the partitions, fixing the parsing error.

Fixes: FS#3314

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Reviewed-by: Thibaut VARÈNE <hacks@slashdirt.org>
2020-09-17 23:52:03 +02:00
Martin Schiller
a594a5a330 lantiq: use uniform "u-boot-env" mtd label
This is the most popular choice in the linux kernel tree.

Within OpenWrt, this change will establish consistency with ath79
and ramips targets.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
[extend commit message, include netgear_dm200, update base-files]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-17 21:09:51 +02:00
Vladimir Vid
9f0d882680 mvebu: image: add check for fdt_add_r and kernel_addr_r variables
fdt_addr and kernel_addr variables are getting obsolete in the mainline
u-boot in favor of fdt_addr_r and kernel_addr_r.

By checking if the new variables exist, we can make sure that devices with newer
version of u-boot will work while not breaking support for the existing ones.

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2020-09-17 21:09:51 +02:00
Felix Fietkau
4fb58813f9 mediatek: fix hardware flow offload
Add support for dealing with DSA ports

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-17 21:08:32 +02:00
David Bauer
056945faa4 ipq40xx: enable FRITZRepeater 3000 ports on switch
The ethernet ports on the AVM FRITZRepeater 3000 are not separated
between LAN and WAN in the stock firmware. OpenWrt currently abstracts
port 4 as eth0 and port 5 as eth1, bridging them in the kernel.

This patch adjusts the GMAC port bitmasks and default bitmask for ar40xx
to bridge them on the switch, avoiding traffic on both ports to pass
thru the CPU.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-09-17 18:08:46 +02:00
David Bauer
b7da0d2944 ath79: add support for Ubiquiti UniFi AP Pro
This adds support for the Ubiquiti UniFi AP Pro to the ath79 target. The
device was previously supported on the now removed ar71xx target.

SoC   Atheros AR9344
WiFi  Atheros AR9344 & Atheros AR9280
ETH   Atheros AR8327
RAM   128M DDR2
FLASH 16M SPI-NOR

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

Follow the Ubiquiti TFTP recovery procedure for this device.

1. Hold down the reset button while connecting power for 10 seconds.
2. Transfer the factory image via TFTP to the AP (192.168.1.20)
3. Wait 2 minutes for the AP to write the firmware to flash. The device
   will automatically reboot to OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-09-17 18:07:39 +02:00
Adrian Schmutzler
6e170ffb96 ipq806x: sort entries in lib/upgrade/platform.sh
Apply alphabetic sorting like in the other files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-17 13:03:18 +02:00
Adrian Schmutzler
0b1cdb7eea treewide: remove empty default cases
There is no apparent reason to have an empty default case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-17 12:46:19 +02:00
Adrian Schmutzler
a744c14dfa ipq806x: sort entries in 02_network
Apply alphabetic sorting like in the other files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-17 12:33:45 +02:00
John Crispin
0fbdb51f76 ipq40xx: add Edgecore OAP-100 support
flashing the unit
* first update to latest edcore FW as per the PDF instructions
* boot the initramfs
  - tftpboot 0x88000000 openwrt-ipq40xx-generic-edgecore_oap100-initramfs-fit-uImage.itb; bootm
* inside the initramfs call the following commiands
  - ubiattach -p /dev/mtd0
  - ubirmvol /dev/ubi0 -n0
  - ubirmvol /dev/ubi0 -n1
  - ubirmvol /dev/ubi0 -n2
* scp the sysupgrade image to the board and call
  - sysupgrade -n openwrt-ipq40xx-generic-edgecore_oap100-squashfs-nand-sysupgrade.bin

Signed-off-by: John Crispin <john@phrozen.org>
2020-09-17 08:43:07 +02:00
Robert Marko
4488b260a0 ipq40xx: add Edgecore ECW5211 support
This patch adds support for the Edgecore ECW5211 indoor AP.

Specification:
- SoC: Qualcomm Atheros IPQ4018 ARMv7-A 4x Cortex A-7
- RAM: 256MB DDR3
- NOR Flash: 16MB SPI NOR
- NAND Flash: 128MB MX35LFxGE4AB SPI-NAND
- Ethernet: 2 x 1G via Q8075 PHY connected to ethernet adapter via PSGMII (802.3af POE IN on eth0)
- USB: 1 x USB 3.0 SuperSpeed
- WLAN: Built-in IPQ4018 (2x2 802.11bng, 2x2 802.11 acn)
- CC2540 BLE connected to USB 2.0 port
- Atmel AT97SC3205T I2C TPM

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2020-09-17 08:43:03 +02:00
Robert Marko
59f0a0fd83 ipq806x: add Edgecore ECW5410 support
This patch adds support for the Edgecore ECW5410 indoor AP.

Specification:
- SoC: Qualcomm Atheros IPQ8068 ARMv7 2x Cortex A-15
- RAM: 256MB(225 usable) DDR3
- NOR Flash: 16MB SPI NOR
- NAND Flash: 128MB S34MS01G2 Parallel NAND
- Ethernet: 2 x 1G via 2x AR8033 PHY-s connected directly to GMAC2 and GMAC3 via SGMII (802.3af POE IN on eth0)
- USB: 1 x USB 3.0 SuperSpeed
- WLAN: 2x QCA9994 AC Wawe 2 (1x 2GHz bgn, 1x 5GHz acn)
- CC2540 BLE
- UART console on RJ45 next to ethernet ports exposed.
Its Cisco pin compatible, 115200 8n1 baud.

Installation instructions:
Through stock firmware or initramfs.

1.Connect to console
2. Login with root account, if password is unknown then interrupt the boot with f and reset it in failsafe.
3. Transfer factory image
4. Flash the image with ubiformat /dev/mtd1 -y -f <your factory image path>

This will replace the rootfs2 with OpenWrt, if you are currently running from rootfs2 then simply change /dev/mtd1 to /dev/mtd0

Note

Initramfs:
1.  Connect to console
2.  Transfer the image from TFTP server with tftpboot,
or by using DHCP advertised image with dhcp command.
3. bootm
4. Run ubiformat /dev/mtd1

You need to interrupt the bootloader after rebooting and run:
run altbootcmd

This will switch your active rootfs partition to one you wrote to and boot from it.

So if rootfs1 is active, then it will change it to rootfs2.

This will format the rootfs2 partition, if your active partition is 2 then simply change /dev/mtd1 with /dev/mtd0
If you dont format the partition you will be writing too, then sysupgrade will find existing UBI rootfs and kernel volumes and update those.
This will result in wrong ordering and OpenWrt will panic on boot.

5. Transfer sysupgrade image
6. Flash with sysupgrade -n.

Note that sysupgrade will write the image to rootfs partition that is not currently in use.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2020-09-17 08:42:17 +02:00
Robert Marko
43a53891ce ipq806x: import bootargs-append from IPQ40xx
This imports the patch that adds bootargs-append support from IPQ40xx.

This way we can append additional boot arguments from DTS instead of only being able to overwrite them.

This way dual firmware devices can use the rootfs number that bootloader passes to decide from what to boot.
But we still need to append console info and ubi root info.

This is used by Edgecore ECW5410.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2020-09-17 08:42:17 +02:00
Robert Marko
811af0d98a ipq806x: add GSBI1 node to DTSI
IPQ806x series also has a GSBI1 with UART and I2C peripherals, so lets add the node for it.

Its needed for Edgecore ECW5410 which uses the UART from GSBI1 as second UART for Bluetooth.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2020-09-17 08:42:17 +02:00
Robert Marko
6133ac8e99 ipq806x: 5.4: enable AT803X driver
Its needed for Edgecore ECW5410 which does not use QCA8337 switch,
but rather 2x AR8033 PHY-s directly connected to GMAC-s.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2020-09-17 08:42:17 +02:00
Aleksander Jan Bajkowski
4a46f36f99 lantiq: remove trailing whitespaces in dts
Remove trailing whitespaces in dts files.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
2020-09-17 00:21:41 +02:00
Adrian Schmutzler
947bfc62d0 ath79: fix button types for WZR-HP-AG300H and WZR-600DHP
Router and Movie "keys" are actually switches for both devices
according to the manual. This has been properly implemented in ar71xx,
but overlooked when porting to ath79.

Fixes: 480bf28273 ("ath79: add support for Buffalo WZR-HP-AG300H")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 17:34:35 +02:00
Adrian Schmutzler
25f2f66eea ath79: add support for Buffalo WZR-600DHP
The hardware of this device seems to be identical to WZR-HP-AG300H.
It was already implemented as a clone in ar71xx.

Specification:
- 680 MHz CPU (Qualcomm Atheros AR7161)
- 128 MiB RAM
- 32 MiB Flash
- WiFi 5 GHz a/n
- WiFi 2.4 GHz b/g/n
- 5x 1000Base-T Ethernet
- 1x USB 2.0

Installation of OpenWRT from vendor firmware:
- Connect to the Web-interface at http://192.168.11.1
- Go to “Administration” → “Firmware Upgrade”
- Upload the OpenWrt factory image

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 17:32:12 +02:00
Adrian Schmutzler
c68105c3b4 ath79: use common device definition for Buffalo devices
The Buffalo devices in ath79 share their image generation code,
so let's create a shared Device definition for them.

Since most of them use BUFFALO_HWVER := 3, this is moved as
default to the shared definition as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 17:31:03 +02:00
Adrian Schmutzler
a99614a44f ath79: consistently use "info" label for default-mac partition
The tp-link safeloader devices typically contain a partition
"default-mac" which stores the MAC addresses. It is followed by other
partitions containing device info, like

  {"default-mac", 0x610000, 0x00020},
  {"pin", 0x610100, 0x00020},
  {"product-info", 0x611100, 0x01000},

In DTS, we typically assign a 0x10000 sized partition for these,
which is mostly labelled "mac" or "info". In rarer cases, the
partitions have been enclosed in a larger "tplink" or "config"
partition.

However, when comparing different devices, the implementation appears
relatively arbitrary at the moment.
Thus, this PR aims at harmonizing these partitions by always using
the name "info" for the DTS partition containing "default-mac".
"info" is preferred over "mac" as we never just have "default-mac"
alone, but always some other device-info partitions as well.

While at it, this also establishes a similar partitioning for the
few devices where the "info" partitions are part of a bigger
unspecific "config" partition or similar.

Besides the harmonization itself, this also allows to merge a few
cases in 11-ath10k-caldata.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 17:28:48 +02:00
Adrian Schmutzler
300173950d rtl838x: fix incorrect assignment from kstrtoul in serial.c
Assign return value of kstrtoul to error variable instead of
conversion value.

Suggested-by: Birger Koblitz <git@birger-koblitz.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 16:31:28 +02:00
Adrian Schmutzler
5c0cecb6c6 rtl838x: refresh config
Use "make kernel_oldconfig" to update and sort target config.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 16:31:28 +02:00
Adrian Schmutzler
0da0aab6f2 rtl838x: remove some debug output in rtl838x-nor.c
Seems like leftovers from development, remove them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 16:31:28 +02:00
Adrian Schmutzler
d5c4750a71 rtl838x: remove and add some empty lines
Do some minor empty lines cleanup, i.e. remove those at EOF and
add some for cosmetic reasons/consistency.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-15 12:28:43 +02:00
Birger Koblitz
df8e6be59a rtl838x: add new architecture
This adds support for the RTL838x Architecture.
SoCs of this type are used in managed and un-managed Switches and Routers
with 8-28 ports. Drivers are provided for SoC initialization, GPIOs, Flash,
Ethernet including a DSA switch driver and internal and external PHYs used
with these switches.

Supported SoCs:

	RTL8380M
	RTL8381M
	RTL8382M

The kernel will also boot on the following RTL839x SoCs, however driver
support apart from spi-nor is missing:

	RTL8390
	RTL8391
	RTL8393

The following PHYs are supported:

	RTL8214FC (Quad QSGMII multiplexing GMAC and SFP port)
	RTL8218B internal: internal PHY of the RTL838x chips
	RTL8318b external (QSGMII 8-port GMAC phy)
	RTL8382M SerDes for 2 SFP ports
	Initialization sequences for the PHYs are provided in the form of
	firmware files.

Flash driver supports 3 / 4 byte access

DSA switch driver supports VLANs, port isolation, STP and port mirroring.

The ALLNET ALL-SG8208M is supported as Proof of Concept:

	RTL8382M SoC
	1 MIPS 4KEc core @ 500MHz
	8 Internal PHYs (RTL8218B)
	128MB DRAM (Nanya NT5TU128MB)
	16MB NOR Flash (MXIC 25L128)
	8 GBEthernet ports with one green status LED each (SoC controlled)
	1 Power LED (not configurable)
	1 SYS LED (configurable)
	1 On-Off switch (not configurable)
	1 Reset button at the right behind right air-vent (not configurable)
	1 Reset button on front panel (configurable)
	12V 1A barrel connector
	1 serial header with populated standard pin connector and with markings
	  GND TX RX Vcc(3.3V), connection properties: 115200 8N1

To install, upload the sysupgrade image to the OEM webpage.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2020-09-14 07:54:30 +02:00
Birger Koblitz
7bb1bd469e kernel: add support for ALLNET devices in mtdsplit
Add support for uimage headers from ALLNET and provide support for the
SG8208M and SG8310PM devices' magic bytes.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
2020-09-14 07:54:30 +02:00
Adrian Schmutzler
a9790dff53 cns3xxx: drop target
This target has not been updated to 5.4 yet, and the only person
trying it (Koen) decided to retreat based on the following reasons:

- The target is not DT-aware at all

- The huge amount of effort required

- The SoC itself reached EoL at Cavium for some time now

- Upstream removed some important parts as it's also slowly getting EoL
  over there

- The commercial product that used this will fade out shortly

- The amount of download for this binary suggest that the target is not
  that popular

Since nobody has picked up the work since then, and this is the last
remaining 4.19-only target, finally drop it now.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-14 00:19:27 +02:00
Chuanhong Guo
2188ef954e ramips: mt7621: pbr-m1: fix firmware size
This board is equipped with Winbond W25Q256FV 32M SPI-NOR.
Fix partition size for that.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-13 19:15:06 +08:00
Chuanhong Guo
8126521e11 ramips: mt7621: pbr-m1: increase SPI clock to 50MHz
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-13 18:53:25 +08:00
Chuanhong Guo
6f2c95f0cf ramips: mt7621: pbr-m1: add pcie reset for asm1061
this board has a pcie to sata bridge connected to pcie2 with a
separated pcie reset on gpio7.
add reset-gpios and corresponding pinctrl nodes into dts.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-13 18:49:26 +08:00
Felix Fietkau
f0cc5f6c0a ramips/mediatek: improve GRO performance, fix PPE packet parsing
Backport upstream changes to initialize GDM settings and reset PPE
Allow GMAC to recognize the special tag to fix PPE packet parsing
Improve GRO performance by passing PPE L4 hash as skb hash

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-13 11:14:32 +02:00
John Audia
17e64b9447 kernel: bump 5.4 to 5.4.65
All modifications made by update_kernel.sh/no manual intervention needed

Build-tested: x86_64
Run-tested: ipq806x (R7800)

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2020-09-12 23:39:25 +02:00
Sander Vanheule
c9f51a9ad6 ath79: support for TP-Link EAP225-Wall v2
TP-Link EAP225-Wall v2 is an AC1200 (802.11ac Wave-2) wall plate access
point. UART access and debricking require fine soldering.

The device was kindly provided for porting by Stijn Segers.

Device specifications:
* SoC: QCA9561 @ 775MHz
* RAM: 128MiB DDR2
* Flash: 16MiB SPI-NOR (GD25Q127CSIG)
* Wireless 2.4GHz (SoC): b/g/n, 2x2
* Wireless 5Ghz (QCA9886): a/n/ac, 2x2 MU-MIMO
* Ethernet (SoC): 4× 100Mbps
  * Eth0 (back): 802.3af/at PoE in
  * Eth1, Eth2 (bottom)
  * Eth3 (bottom): PoE out (can be toggled by GPIO)
* One status LED
* Two buttons (both work as failsafe)
  * LED button, implemented as KEY_BRIGHTNESS_TOGGLE
  * Reset button

Flashing instructions, requires recent firmware (tested on 1.20.0):
* ssh into target device and run `cliclientd stopcs`
* Upgrade with factory image via web interface

Debricking:
* Serial port can be soldered on PCB J4 (1: TXD, 2: RXD, 3: GND, 4: VCC)
    * Bridge unpopulated resistors R162 (TXD) and R165 (RXD)
      Do NOT bridge R164
    * Use 3.3V, 115200 baud, 8n1
* Interrupt bootloader by holding CTRL+B during boot
* tftp initramfs to flash via sysupgrade or LuCI web interface

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 ifconfig:
    br0       Link encap:Ethernet  HWaddr 50:...:04
    eth0      Link encap:Ethernet  HWaddr 50:...:04
    wifi0     Link encap:UNSPEC  HWaddr 50-...-04-...
    wifi1     Link encap:UNSPEC  HWaddr 50-...-05-...

Signed-off-by: Sander Vanheule <sander@svanheule.net>
[fix IMAGE_SIZE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-12 19:37:24 +02:00
Zhong Jianxin
53df30f02b ath79: add support for Mercury MW4530R v1
Mercury MW4530R is a TP-Link TL-WDR4310 clone.

Specification:

* SOC: Atheros AR9344 (560 MHz)
* RAM: 128 MiB
* Flash: 8192 KiB
* Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8327)
* Wireless:
  - 2.4 GHz b/g/n (internal)
  - 5 GHz a/n (AR9580)
* USB: yes, 1 x USB 2.0

Installation:

Flash factory image via OEM web interface.

Signed-off-by: Zhong Jianxin <azuwis@gmail.com>
2020-09-12 18:47:26 +02:00
John Audia
bee76f1bfa kernel: bump 5.4 to 5.4.64
Remove upstreamed patches:
 generic-backport
  701-v5.5-net-core-use-listified-Rx-for-GRO_NORMAL-in-napi_gro.patch

Manually merged:
 mediatek/patches-5.4
  0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch

All other modifications made by update_kernel.sh

Build-tested: ipq806x, lantiq/xrx200, mvebu, x86/64
Run-tested: ipq806x (R7800), mvebu (mamba, rango),
  lantiq/xrx200 (Easybox 904 xDSL), x86/64

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[add community build/run tests to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-12 01:28:50 +02:00
Adrian Schmutzler
c4110a524e ramips: create common DTSI for Sunvalley Filehub devices
HooToo HT-TM05 and RAVPower RP-WD03 have almost identical hardware
(except for RAM size) and are from the same vendor (SunValley).

Create a common DTSI file for them.

Suggested-by: Russell Morris <rmorris@rkmorris.us>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-12 01:25:10 +02:00
Adrian Schmutzler
b56b499948 ramips: fix baud rate for RAVPower RP-WD03
The baud rate for the RAVPower RP-WD03 is 57600, not 115200.

Since this is the default from mt7620n.dtsi, the chosen node can
simply be removed from the device DTS.

Fixes: 5ef79af4f8 ("ramips: add support for Ravpower WD03")

Suggested-by: Russell Morris <rmorris@rkmorris.us>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-12 01:24:43 +02:00
Adrian Schmutzler
3fc7860961 ramips: assign LEDs for RAVPower RP-WD03
According to the User Manual, there is a "Wi-Fi LED" with blue and
green colors, doing the following by default:

  Flashing Blue: System loading
  Solid Blue: System loaded
  Flashing Green: Connecting to the Internet
  Solid Green: Connected to the Internet

According to this vendor behavior, we keep refer to the LED as "wifi"
but implement the according default behavior as in OEM firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-12 01:24:30 +02:00
Adrian Schmutzler
77825f3cfe ramips: fix MAC address assignment for RAVPower RP-WD03
MAC assignment based on vendor firmware:

  2.4 GHz    *:b4   (factory 0x04)
  LAN/label  *:b4   (factory 0x28)
  WAN        *:b5   (factory 0x2e)

The previously used location 0x4000 for ethernet is actually empty.

Therefore, fix the ethernet MAC address and set it as label-mac-address.

Fixes: 5ef79af4f8 ("ramips: add support for Ravpower WD03")

Suggested-by: Russell Morris <rmorris@rkmorris.us>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-12 01:24:02 +02:00
Adrian Schmutzler
07aa858a73 ramips: fix partitions and boot for RAVPower RP-WD03
The RAVPower RP-WD03 is a battery powered router, with an Ethernet and
USB port. Due due a limitation in the vendor supplied U-Boot bootloader,
we cannot exceed a 1.5 MB kernel size, as is the case with recent builds
(i.e. post v19.07). This breaks both factory and sysupgrade images.

To address this, use the lzma loader (loader-okli) to work around this
limitation.

The improvements here also address the "misplaced" U-Boot environment
partition, which is located between the kernel and rootfs in the stock
image / implementation. This is addressed by making use of mtd-concat,
maximizing space available in the booted image.
This will make sysupgrade from earlier versions impossible.

Changes are based on the recently supported HooToo HT-TM05, as the
hardware is almost identical (except for RAM size) and is from the same
vendor (SunValley). While at it, also change the SPI frequency
accordingly.

Installation:

 - Download the needed OpenWrt install files, place them in the root
   of a clean TFTP server running on your computer. Rename the files as,
   - openwrt-ramips-mt7620-ravpower_rp-wd03-squashfs-kernel.bin => kernel
   - openwrt-ramips-mt7620-ravpower_rp-wd03-squashfs-rootfs.bin => rootfs
 - Plug the router into your computer via Ethernet
 - Set your computer to use 10.10.10.254 as its IP address
 - With your router shut down, hold down the power button until the first
   white LED lights up.
 - Push and hold the reset button and release the power button. Continue
   holding the reset button for 30 seconds or until it begins searching
   for files on your TFTP server, whichever comes first.
 - The router (10.10.10.128) will look for your computer at 10.10.10.254
   and install the two files. Once it has finished installation, it will
   automatically reboot and start up OpenWrt.
 - Set your computer to use DHCP for its IP address

Notes:

 - U-Boot environment can be modified, u-boot-env is preserved on initial
   install or sysupgrade
 - mtd-concat functionality is included, to leave a "hole" for u-boot-env,
   combining the OEM kernel and rootfs partitions

Most of the changes in this commit are the work of Russell Morris (as
credited below), I only wrapped them up and added compat-version.
Thanks to @mpratt14 and @xabolcs for their help getting the lzma loader
to work!

Fixes: 5ef79af4f8 ("ramips: add support for Ravpower WD03")

Suggested-by: Russell Morris <rmorris@rkmorris.us>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-11 19:31:03 +02:00
Adrian Schmutzler
a4e5b8897a ramips: use proper name for RAVPower RP-WD03
The proper model name is RP-WD03 (i.e. with the RP- prefix).

Adjust all names to that.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-11 19:18:54 +02:00
Adrian Schmutzler
14024f6e0f kernel: use proper upstream inclusion version for patch
The patch is only included in kernel 5.5.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-11 18:40:44 +02:00
Adrian Schmutzler
4527f59428 ramips: move ravpower-wd009-factory recipe to mt76x8.mk
The recipe is only used for a single device, so put it in the
subtarget file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-11 18:40:44 +02:00
David Bauer
2e6c236abd ipq40xx: essedma: enable VLAN tag offload for single-port
Enable the VLAN tag offloading mechanism for RGMII single-port devices.
This allows those devices to use 802.1Q VLANs on the ethernet port.

Previously, RX frames were double tagged, as the RX TAG removal flag was
not enabled and an additional 802.1Q header was inserted elsewhere in
the code.

On the TX side, tagging was completely not present for single-port
devices. Enable tagging if an 802.1Q frame should be transmitted and
disable the default tagging mechanism for single-port devices.

Tested on Aruba AP-303

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-09-11 17:37:11 +02:00
Sergey Ryazanov
788aa61e1b ath25: fix preinit Ethernet port configuration
vconfig is no more installed by default to a firmware image. So, replace
vconfig calls for VLAN subinterface configuration by coresponding
ip-link commands.

Also drop few useless comments from the preinit hook script, while we
are at it.

I have no chance to test this fix since I have no board with a subject
switch IC, but this is still better then call an utility that is
unavailable in the firmware for years.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
[use documented syntax for ip link add]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-10 18:52:15 +02:00
Adrian Schmutzler
4d747f5495 kernel: add recently introduced CONFIG_MTD_SPLIT_ELF_FW
The config symbol was introduced in drivers, but not added to
generic kernel config files. This will halt build asking for the
value.

Fix it by adding the value (setting it to disabled).

Fixes: 3f7047db7a ("kernel: mtdsplit: support ELF loader splitting")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-09 22:09:19 +02:00
Sander Vanheule
9dd4ba3d7e ath79: add support for TP-Link EAP245-v3
TP-Link EAP245 v3 is an AC1750 (802.11ac Wave-2) ceiling mount access
point. UART access (for debricking) requires non-trivial soldering.

Specifications:
* SoC: QCA9563 (CPU/DDR/AHB @ 775/650/258 MHz)
* RAM: 128MiB
* Flash: 16MiB SPI-NOR
* Wireless 2.4GHz (SoC): b/g/n 3x3
* Wireless 5GHz (QCA9982): a/n/ac 3x3 with MU-MIMO
* Ethernet (QCA8337N switch): 2× 1GbE, ETH1 (802.3at PoE) and ETH2
* Green and amber status LEDs
* Reset switch (GPIO, available for failsafe)

Flashing instructions:
All recent firmware versions (latest is 2.20.0), can disable firmware
signature verification and use a padded firmware file to flash OpenWrt:
* ssh into target device and run `cliclientd stopcs`
* upload factory image via web interface

The stopcs-method is supported from firmware version 2.3.0. Earlier
versions need to be upgraded to a newer stock version before flashing
OpenWrt.

Factory images for these devices are RSA signed by TP-Link. While the
signature verification can be disabled, the factory image still needs to
have a (fake) 1024 bit signature added to pass file checks.

Debricking instructions:
You can recover using u-boot via the serial port:
* Serial port is available from J3 (1:TX, 2:RX, 3:GND, 4:3.3V)
* Bridge R237 to connect RX, located next to J3
* Bridge R225 to connect TX, located inside can on back-side of board
* Serial port is 115200 baud, 8n1, interrupt u-boot by holding ctrl+B
* Upload initramfs with tftp and upgrade via OpenWrt

Device mac addresses:
Stock firmware has the same mac address for 2.4GHz wireless and
ethernet, 5GHz is incremented by one. The base mac address is stored in
the 'default-mac' partition (offset 0x90000) at an offset of 8 bytes.
ART blobs contain no mac addresses.
From OEM ifconfig:
    ath0      Link encap:Ethernet  HWaddr 74:..:E2
    ath10     Link encap:Ethernet  HWaddr 74:..:E3
    br0       Link encap:Ethernet  HWaddr 74:..:E2
    eth0      Link encap:Ethernet  HWaddr 74:..:E2

Signed-off-by: Sander Vanheule <sander@svanheule.net>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-09-09 20:42:10 +03:00
Sander Vanheule
b71668f96a ath79: enable elf mtd splitter
Enabled the ELF firmware partition splitter 4.19 and 5.4 in preparation
for the TP-Link EAP245v3 device support.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-09-09 20:41:50 +03:00
Sander Vanheule
3f7047db7a kernel: mtdsplit: support ELF loader splitting
To parse the ELF kernel loader, a small ELF parser is used that can
handle both ELF32 or ELF64 class loaders. The splitter assumes that the
kernel is always located before the rootfs, whether it is embedded in
the loader or not. If the kernel is located after the rootfs on the
firmware partition, then the rootfs splitter will include it in the
dynamically created rootfs_data partition and the kernel will be
corrupted.

The kernel image is preferably embedded inside the ELF loader, so the
end of the loader equals the end of the kernel partition. This is due to
the way mtd_find_rootfs_from searches for the the rootfs:
- if the kernel image is embedded in the loader, the appended rootfs may
  follow the loader immediately, within the same erase block.
- if the kernel image is not embedded in the loader, but placed at some
  offset behind the loader (OKLI-style loader), the rootfs must be
  aligned to an erase-block after the loader and kernel image.

In case section header table is empty, determine the elf loader size by
finding the end of the last segment, as defined by the program header
table.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2020-09-09 20:41:50 +03:00
Adrian Schmutzler
2dda301d40 ramips: disable default build for Ravpower RP-WD03
This device has a 1.5M kernel size limit during boot and is
unbootable since February 2019 [1].

[1] https://forum.openwrt.org/t/ravpower-wd03-does-not-start-with-openwrt-master/49792

Reported-by: Szabolcs Hubai <szab.hu@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-09 14:12:14 +02:00
Felix Fietkau
668c988fc5 mediatek/ramips: remove an ethernet optimization patch that was reported to cause a regression
In some tests, crashes were observed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-09 11:51:47 +02:00
Felix Fietkau
c18a872825 mediatek: backport the latest version of the mt7531 support patches
Fixes unknown unicast flooding issue

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-09 11:51:47 +02:00
Adrian Schmutzler
38f6d5d217 treewide: revert sysupgrade adjustments for early DSA-adopters
The uci-default mechanism to update the compat-version was only
meant for early DSA-adopters, which should have updated by now.

Remove this workaround again in order to prevent the intended
experiences for all the other people.

This reverts:
a9703db720 ("mvebu: fix sysupgrade experience for early DSA-adopters")
86c89bf5e8 ("kirkwood: fix sysupgrade experience for early DSA-adopters")

Partially reverted:
1eac573b53 ("ramips: mt7621: implement compatibility version for DSA migration")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-08 19:27:15 +02:00
Adrian Schmutzler
de4e57eaaa Revert "treewide: add sysupgrade comment for early DSA-adopters"
This reverts commit e81e625ca3.

This was meant just for early DSA-adopters. Those should have
updated by now, remove it so future updaters get the intended
experience.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-08 19:26:22 +02:00
John Audia
2c2fcbd2e0 kernel: bump 5.4 to 5.4.63
Manually merged:
 hack-5.4
  230-openwrt_lzma_options.patch
 bcm27xx
  950-0283-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
 x86
  011-tune_lzma_options.patch

Remove upstreamed patches in collaboration with Ansuel Smith:
 ipq806x
  093-1-v5.8-ipq806x-PCI-qcom-Add-missing-ipq806x-clocks-in-PCIe-driver.patch
  093-2-v5.8-ipq806x-PCI-qcom-Change-duplicate-PCI-reset-to-phy-reset.patch
  093-3-v5.8-ipq806x-PCI-qcom-Add-missing-reset-for-ipq806x.patch

All other modifications made by update_kernel.sh

Build-tested: bcm27xx/bcm2708, ipq806x, x86/64
Run-tested: ipq806x (R7800), x86/64

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[update commit message/tested]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:55:19 +02:00
Adrian Schmutzler
ad22f6a8aa ath25: disable devices with 4M flash
Devices with 4M flash are not built be default for 20.xx anymore.

Building them with buildbot settings does not work anymore anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:50:36 +02:00
Adrian Schmutzler
9c12a33b24 ath25: apply vendor_model scheme
This applies the vendor_model scheme for this target as well, so
naming is consistent throughout supported targets.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:49:53 +02:00
Sergey Ryazanov
ce3b135243 ath25: eth: fix crash on skb DMA (un-)map
AR2315 Ethernet driver pass NULL instead of a real device pointer to DMA
(un-)map calls. With kernel version 5.4 such behaviour causes a kernel
panic. Fix this issue by preserving device pointer during the probe
procedure and pass it to each skb data DMA (un-)map call.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2020-09-06 19:49:43 +02:00
Sergey Ryazanov
36e06497f4 ath25: fix ethernet supported link modes for ar2313
Rework ethernet supported link modes to linkmode bitmask.

This is needed to suppress compilation errors:

   drivers/net/ethernet/atheros/ar231x/ar231x.c:1153:20: ...
     error: assignment to expression with array type
     phydev->supported &= (SUPPORTED_10baseT_Half
                       ^~

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
[cut out of bigger patch, adjust commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:49:37 +02:00
Adrian Schmutzler
1a4c1d64bc ath25: fix compilation for AR2315 MTD driver
Kernel commit e7bfb3fdbde3 ("mtd: Stop updating erase_info->state
and calling mtd_erase_callback()") removed erase_info->state
updates and calls of mtd_erase_callback().

Drop these erase callback invocations from AR2315 MTD driver as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:49:28 +02:00
Adrian Schmutzler
481d0281d8 ath25: update config for kernel 5.4
Update config with make kernel_oldconfig.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:49:19 +02:00
Adrian Schmutzler
fc920bfb00 ath25: refresh patches for kernel 5.4
Refresh patches to make them apply to kernel 5.4.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:49:13 +02:00
Adrian Schmutzler
081e944be6 ath25: add back target support
Discussion on the mailing list reveals that this target has active
users. As we are finally able to upgrade this target to kernel 5.4,
add it back to master.

This reverts commit 7d29a55714 ("ath25: drop target") and
immediately moves the relevant files to 5.4, without touching
the content.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:49:05 +02:00
Adrian Schmutzler
8938711223 ath79: drop Build/loader-kernel-cmdline
This is the same as  loader-kernel since the KERNEL_CMDLINE
parameter has been removed in [1] and not used at all anyway.

Remove it.

[1] f77db1a590 ("ath79: cleanup image build code")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Paul Spooren <mail@aparcar.org>
2020-09-06 19:43:08 +02:00
Josh Bendavid
b5dd746cbb ramips: add support for D-Link DIR-2660 A1
This patch adds support for D-Link DIR-2660 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 (white/orange), Internet (white/orange), WiFi 2.4G (white),
        WiFi 5G (white), USB 3.0 (white), USB 2.0 (white)

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: Josh Bendavid <joshbendavid@gmail.com>
[rebase onto already merged DIR-1960 A1, add MAC addresses to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-06 19:09:45 +02:00
Felix Fietkau
ba72ed537c kernel: backport GRO improvements
Improves network performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-06 15:35:57 +02:00
Felix Fietkau
63b6b10670 kernel: backport improved checksum function for ARM64
Improves network performance in some cases when checksum offload is not
available

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-06 15:35:57 +02:00
Felix Fietkau
21ab979c70 mediatek/mt7622: adjust kernel cpu features to match the hardware
Disable unnecessary errata/features
Enable potentially needed ones

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-06 15:35:57 +02:00
Christian Lamparter
252197f014 apm821xx: provide legacy interrupts for PCIe in DT
Devices with PCIe-Switches like the WNDR4700, MR24 and WNDAP660
need to have the interrupts property specified in the device-tree
for the legacy pci interrupt signaling method to work.

If the proper interrupt value is not specified, the default INTA
IRQ 12 is taken for all devices. This is especially bad, if the
device is setup to use INTC, because these interrupts will not
be serviced.

Russell Senior reported his experience on the MR24:
"The symptom is client devices can't see the beacons.
Wifi ifaces appear, can scan and hear other networks,
but clients can't see the MR24's SSIDs."

(The interrupts-property on the WNDAP620 was optional since it
uses INTA by default. Likewise the MX60W is in the same category)

Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-09-05 23:26:05 +02:00
Felix Fietkau
920d975cab mediatek: enable coherent DMA for ethernet and PCI
Improves performance by eliminating the need for extra cache flushes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-04 19:42:35 +02:00
Felix Fietkau
44fe9e6f84 mediatek: fix an irq handling issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-04 19:42:35 +02:00
Felix Fietkau
7081b1704e mediatek/ramips: add patch to avoid unnecessary rearming of interrupts
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-04 19:42:35 +02:00
Felix Fietkau
1fe914d9b4 mediatek: disable packet steering by default
mt76 now spreads the load over multiple CPUs more smoothly, processing
ethernet packets should be faster running on one core

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-04 19:42:35 +02:00
Felix Fietkau
a38b6efbc1 mediatek: enable kernel PCIe ASPM support, refresh kernel config
Improves performance on PCIe devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-04 12:42:46 +02:00
Yangbo Lu
ad0f0df909 layerscape: fix linux headers install issue
The linux upstream commit had treated config leak as error.
5967577 scripts: headers_install: Exit with error on config leak

It is causing below build issue. Provide a kernel patch to fix
it by replacing CONFIG_COMPAT kernel option with FM_COMPAT instead.

  HDRINST usr/include/linux/fmd/integrations/integration_ioctls.h
  HDRINST usr/include/linux/fmd/Peripherals/fm_port_ioctls.h
error: include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h: leak
CONFIG_COMPAT to user-space
scripts/Makefile.headersinst:63: recipe for target
'usr/include/linux/fmd/Peripherals/fm_port_ioctls.h' failed
make[5]: *** [usr/include/linux/fmd/Peripherals/fm_port_ioctls.h] Error 1
Makefile:1198: recipe for target 'headers' failed
make[4]: *** [headers] Error 2

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2020-09-03 14:34:33 +01:00
Russell Morris
45a81f7056 ramips: add support for HooToo HT-TM05
The HooToo HT-TM05 is a battery powered router, with an Ethernet and USB port.
Vendor U-Boot limited to 1.5 MB kernel size, so use lzma loader (loader-okli).

Specifications:

  SOC:     MediaTek MT7620N
  BATTERY: 10400mAh
  WLAN:    802.11bgn
  LAN:     1x 10/100 Mbps Ethernet
  USB:     1x USB 2.0 (Type-A)
  RAM:     64 MB
  FLASH:   GigaDevice GD25Q64, Serial 8 MB Flash, clocked at 50 MHz
           Flash itself specified to 80 MHz, but speed limited by mt7620 SPI
           fast-read enabled (m25p)
  LED:     Status LED (blue after boot, green with WiFi traffic
           4 leds to indicate power level of the battery (unable to control)
  INPUT:   Power, reset button

MAC assignment based on vendor firmware:

  2.4 GHz    *:b4   (factory 0x04)
  LAN/label  *:b4   (factory 0x28)
  WAN        *:b5   (factory 0x2e)

Tested and working:

 - Ethernet
 - 2.4 GHz WiFi (Correct MAC-address)
 - Installation from TFTP (recovery)
 - OpenWRT sysupgrade (Preserving and non-preserving), through the usual
   ways: command line and LuCI
 - LEDs (except as noted above)
 - Button (reset)
 - I2C, which is needed for reading battery charge status and level
 - U-Boot environment / variables (from U-Boot, and OpenWrt)

Installation:

 - Download the needed OpenWrt install files, place them in the root
   of a clean TFTP server running on your computer. Rename the files as,
   - ramips-mt7620-hootoo_tm05-squashfs-kernel.bin => kernel
   - ramips-mt7620-hootoo_tm05-squashfs-rootfs.bin => rootfs
 - Plug the router into your computer via Ethernet
 - Set your computer to use 10.10.10.254 as its IP address
 - With your router shut down, hold down the power button until the first
   white LED lights up.
 - Push and hold the reset button and release the power button. Continue
   holding the reset button for 30 seconds or until it begins searching
   for files on your TFTP server, whichever comes first.
 - The router (10.10.10.128) will look for your computer at 10.10.10.254
   and install the two files. Once it has finished installation, it will
   automatically reboot and start up OpenWrt.
 - Set your computer to use DHCP for its IP address

Notes:

 - U-Boot environment can be modified, u-boot-env is preserved on initial
   install or sysupgrade
 - mtd-concat functionality is included, to leave a "hole" for u-boot-env,
   combining the OEM kernel and rootfs partitions

I would like to thank @mpratt14 and @xabolcs for their help getting the
lzma loader to work!

Signed-off-by: Russell Morris <rmorris@rkmorris.us>
[drop changes in image/Makefile, fix indent and PKG_RELEASE in
uboot-envtools, fix LOADER_FLASH_OFFS, minor commit message facelift,
add COMPILE to Device/Default]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-03 14:15:30 +02:00
Chuanhong Guo
b7013e9c4a ramips: image: add recipe for OKLI loader
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-03 14:15:30 +02:00
Chuanhong Guo
cac9e3e2cb ramips: lzma-loader: make FLASH_START configurable
FLASH_START is supposed to point at the memory area where NOR flash are
mapped. We currently have an incorrect FLASH_START copied from ar71xx
back then and the loader doesn't work under OKLI mode.
On ramips, mt7621 has it's flash mapped to 0x1fc00000 and other SoCs
uses 0x1c000000. This commit makes FLASH_START a configurable value to
handle both cases.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2020-09-03 14:15:30 +02:00
Adrian Schmutzler
95acc4fe0e kernel: remove support for kernel 4.14
No target uses kernel 4.14 anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 16:29:23 +02:00
Adrian Schmutzler
66ab1fb395 ramips: drop support for kernel 4.14
The target seems to be working on 5.4, so drop 4.14 support in
preparation for removing it from master entirely.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 16:29:23 +02:00
Adrian Schmutzler
e68c017e93 pistachio: drop support for kernel 4.14
The target seems to be working on 5.4, so drop 4.14 support in
preparation for removing it from master entirely.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 16:29:22 +02:00
Adrian Schmutzler
64824db6d8 arc770: drop support for kernel 4.14
The target seems to be working on 5.4, so drop 4.14 support in
preparation for removing it from master entirely.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 16:29:22 +02:00
Adrian Schmutzler
bc88ee0aff samsung: drop target
This target is still on kernel 4.14, and no attempt has been made to
update it to a newer kernel. Since we already are two LTS versions ahead
of that the target is dropped, as the chance of somebody bumping it will
only decrease with time.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 16:29:22 +02:00
Adrian Schmutzler
94198e2a1c rb532: drop target
This target is still on kernel 4.14, and recent attempts to move it to
kernel 5.4 have not led to success. The device tester reported that it
wouldn't boot with the following messages:

From sysupgrade:

  Press any key within 4 seconds to enter setup....
  loading kernel from nand... OK
  setting up elf image... OK
  jumping to kernel code

At this point the system hangs.

From CompactFlash:

  Press any key within 4 seconds to enter setup....
  Booting CF
  Loading kernel... done
  setting up elf image... kernel out of range kernel loading failed

The tester reported that the same was observed with current master
(kernel 4.14) as well. This looks like some kernel size restriction.

Since this target is quite old and only supports one device, and since
nobody else seemed interested in working on this for quite some time,
I decided to not put further work into analyzing the problem and drop
this together with the other 4.14-only targets.

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 16:29:22 +02:00
Adrian Schmutzler
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
Paul Spooren
84024e245f build: add whatdepends target to imagebuilder
The package manager `opkg` offers the function `whatdepends` to print
packages that depend on a specific package.

This feature is useful when used in a CI to not only build an upgraded
package but all packages with a dependency.

Usage:
    make whatdepends PACKAGE=libipset

The resulting list can be fed into a SDK building all packages and warn
if anything fails.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-08-31 11:18:24 +01: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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
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
Paul Spooren
8c9a788172
build: SDK/IB reproducible and faster compression
Both IB and SDK now use the same logic for packing.

This commit add reproducible multithread compression to the SDK and
corrects the file mtime for both. Previously all files where just copied
over from the build system, generating random mtimes.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-08-23 18:55:49 +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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
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
Adrian Schmutzler
2549d1dd77 pistachio: use vendor_model scheme for device/image name
This uses the vendor_model scheme for the device/image name in
order to make this consistent to most other targets.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-21 11:46:14 +02:00
Hauke Mehrtens
5fa0e32698 pistachio: Add kmod-ca8210 wpan-tools by default
A ca8210 chip is soldered onto the board, add the driver by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-21 11:46:14 +02:00
Hauke Mehrtens
3f07a06b3b pistachio: Add SC16IS7XX device driver
This device is used to control extra UARTs and LEDs on the board.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-21 11:46:14 +02:00
Hauke Mehrtens
0d81afe3df pistachio: Add extra devices to dts file
This adds some extra devices to the DTS file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-21 11:46:14 +02:00