openwrt/openwrt.git
3 years agozram-swap: correctly express the required dependencies
Rui Salvaterra [Wed, 8 Jul 2020 16:20:28 +0000 (17:20 +0100)]
zram-swap: correctly express the required dependencies

The block-mount swapon implementation doesn't support discard, so make zram-swap
depend only on the default BusyBox implementation or, when unavailable, on the
one present in the swap-utils package.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agozram-swap: enable swap discard
Rui Salvaterra [Tue, 23 Jun 2020 11:29:54 +0000 (12:29 +0100)]
zram-swap: enable swap discard

Zram block devices have supported trim/discard for over six years, let's
enable it. This allows the zram device to actually free up allocated memory
when it's marked as unused in the filesystem metadata, as explained in more
detail in the original commit message [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/block/zram/zram_drv.c?h=linux-4.14.y&id=f4659d8e620d08bd1a84a8aec5d2f5294a242764

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agobusybox: use CLOCK_MONOTONIC instead of gettimeofday
Rui Salvaterra [Wed, 8 Jul 2020 08:18:14 +0000 (09:18 +0100)]
busybox: use CLOCK_MONOTONIC instead of gettimeofday

The clock_gettime(CLOCK_MONOTONIC) syscall exists for so long that the first
kernel version to support it is not even specified in the man page [1]. Let's
enable it on BusyBox by default. Otherwise, gettimeofday will be used instead,
which will give wrong results if the date/time is reset (time moving backwards).

[1] https://linux.die.net/man/2/clock_gettime

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agolzo: switch to building with CMake
Rosen Penev [Fri, 10 Jul 2020 23:13:10 +0000 (16:13 -0700)]
lzo: switch to building with CMake

CMake is less error prone that autotools and also compiles faster.

Fixed license information.

Added pkgconfig file to InstallDev so that packages that use it can
find lzo.

Before:

time make package/lzo/compile -j 12
________________________________________________________
Executed in   20.87 secs   fish           external
   usr time   26.95 secs    0.00 micros   26.95 secs
   sys time    5.49 secs  305.00 micros    5.49 secs

After:

time make package/lzo/compile -j 12
________________________________________________________
Executed in   13.22 secs   fish           external
   usr time   19.59 secs  328.00 micros   19.59 secs
   sys time    4.03 secs   10.00 micros    4.03 secs

Time output is with fish shell. make clean was ran before both attempts.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agolibubox: update to version 2020-07-11
Petr Štetiar [Mon, 20 Jan 2020 15:22:07 +0000 (16:22 +0100)]
libubox: update to version 2020-07-11

 f4e9bf73ac5c examples/lua: attempt to highlight some traps
 53b9a2123fc6 lua/uloop: fd_add: use absolute indices for arguments
 c0941d3289fc lua/uloop: make get_sock_fd capable of absolute addresses
 161c25960ba2 lua/uloop: fd_add() better args checking

Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoramips: kernel: fix awake-rt305x-dwc2 patch
Alexey Dobrovolsky [Wed, 6 May 2020 20:48:15 +0000 (23:48 +0300)]
ramips: kernel: fix awake-rt305x-dwc2 patch

At this point in v5.4 kernel we cannot use dwc2_readl() and
dwc2_writel() since they rely on the value hsotg->needs_byte_swap
which cannot be obtained before the controller wakes up.
We should use readl() and writel() to wake up the controller before
calling dwc2_check_core_endianness().

Fixes: 6be0da90a165 ("ramips: refresh patches")
Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
[fixed Fixes: tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agolinux-firmware: package EIP197 mini firmware
Tomasz Maciej Nowak [Thu, 9 Jul 2020 19:16:15 +0000 (21:16 +0200)]
linux-firmware: package EIP197 mini firmware

Quoting part of original message from eefb5f741015 commit in
linux-firmware repository:

This adds the "minifw" version of the EIP197 firmware, which the inside-
secure driver will use as a fallback if the original full-featured
firmware cannot be found. This allows for using the inside-secure driver
and hardware without access to "official" firmware only available under
NDA.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
3 years agofirmware-utils: mkfwimage: fix memcpy and strncpy usage
Petr Štetiar [Fri, 26 Jul 2019 12:45:32 +0000 (14:45 +0200)]
firmware-utils: mkfwimage: fix memcpy and strncpy usage

Firmware is binary blob, so there are barely any NULL terminated strings
expected, so we should probably convert all chars into u8 types, and
after that it's clear, that using strcpy doesn't make sense anymore.

This is rather theoretical stuff, but `uint8_t name[PART_NAME_LENGTH]`
means, that you can supply PART_NAME_LENGTH sized name, not
PART_NAME_LENGTH-1 name when NULL terminated.

Ref: https://github.com/openwrt/openwrt/pull/2274
Fixes: 04cb651376f9 ("firmware-utils: mkfwimage: fix more errors reported by gcc-6/7/9")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agotoolchain/gcc: Add GCC 10.1.0 patches
Syrone Wong [Tue, 7 Jul 2020 22:46:22 +0000 (06:46 +0800)]
toolchain/gcc: Add GCC 10.1.0 patches

Compared to GCC 9:

870-ppc_no_crtsavres.patch changes moved to another file following upstream
881-no_tm_section.patch keep the tm section disabled

patches refreshed to apply cleanly

See https://gcc.gnu.org/gcc-10/porting_to.html for more info

Compiled and run tested on x86_64

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
3 years agotoolchain/gcc: Add GCC 10.1.0 config
Syrone Wong [Tue, 7 Jul 2020 22:41:21 +0000 (06:41 +0800)]
toolchain/gcc: Add GCC 10.1.0 config

Add needed config changes and tarball hash for new GCC version.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
[added missing commit description]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agotoolchain/gcc: Copy patches from 9.3.0 to 10.1.0
Syrone Wong [Tue, 7 Jul 2020 22:40:24 +0000 (06:40 +0800)]
toolchain/gcc: Copy patches from 9.3.0 to 10.1.0

No content changes in this commit

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
3 years agokirkwood: add support for Check Point L-50
Pawel Dembicki [Sun, 26 Jan 2020 16:22:28 +0000 (17:22 +0100)]
kirkwood: add support for Check Point L-50

This patch adds support for the Check Point L-50 from 600/1100 series
routers.

Specification:
-CPU: Marvell Kirkwood 88F6281 1200MHz
-RAM: 512MB
-Flash: NAND 512MB
-WiFi: mPCIe card based on Atheros AR9287 b/g/n
-WAN: 1 Gigabit Port (Marvell 88E1116R PHY)
-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4))
-USB: 2x USB2.0
-Express card slot
-SD card slot
-Serial console: RJ-45 115200 8n1
-Unsupported DSL

Known issues:
-DSL not supported
-Expresscard not tested

Installation:

Step one -> backup:
make backup u-boot and env for revert stock posibility
make backup dsl_mac_addr, dmz_mac_addr, eth1addr, ethaddr and all lanX_mac_addr

Step two -> Use kwboot tool to upload openwrt u-boot to RAM:

run kwboot: "kwboot -B 115200 /dev/ttyUSB0 -b u-boot.kwb -p -t"
end start u-boot

Step three -> Restore macs (e.g. below):
setenv eth1addr 00:1C:XX:XX:XX:6C
setenv ethaddr 00:1C:XX:XX:XX:6B
setenv lan1_mac_addr 00:1C:XX:XX:XX:6C
setenv lan2_mac_addr 00:1C:XX:XX:XX:6D
setenv lan3_mac_addr 00:1C:XX:XX:XX:6E
setenv lan4_mac_addr 00:1C:XX:XX:XX:6F
setenv lan5_mac_addr 00:1C:XX:XX:XX:70
setenv lan6_mac_addr 00:1C:XX:XX:XX:71
setenv lan7_mac_addr 00:1C:XX:XX:XX:72
setenv lan8_mac_addr 00:1C:XX:XX:XX:73
setenv dmz_mac_addr 00:1C:XX:XX:XX:74
setenv dsl_mac_addr 00:1C:XX:XX:XX:75

Step four -> flash u-boot:
mw 0x0800000 0xffff 0x100000
nand erase 0x0 100000
tftp 0x0800000 openwrt-kirkwood-l50-u-boot.kwb
nand write 0x0800000 0x0 0x100000
saveenv

Step five -> run initramfs image:

tftpboot 0x02000000 openwrt.bin; bootm 0x02000000;

Step six -> install sysupgrade OpenWrt image:

copy to /tmp/ sysupgrade image
run sysupgrade

Back to stock:
Restore original u-boot end env.
Install factory image via stock u-boot.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
3 years agouboot-kirkwood: add uboot for CheckPoint L-50
Pawel Dembicki [Fri, 24 Jan 2020 06:13:24 +0000 (07:13 +0100)]
uboot-kirkwood: add uboot for CheckPoint L-50

This patch add u-boot for CheckPoint L-50 routers.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
3 years agokernel: add package for Seiko S-35390A I2C RTC
Pawel Dembicki [Fri, 24 Jan 2020 06:25:54 +0000 (07:25 +0100)]
kernel: add package for Seiko S-35390A I2C RTC

This patch adds kernel package for Seiko Instruments S-35390A.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
3 years agouboot-envtools: ath79: update ubootenv partion index for gl-ar300m
Huangbin Zhan [Wed, 8 Jul 2020 21:01:54 +0000 (05:01 +0800)]
uboot-envtools: ath79: update ubootenv partion index for gl-ar300m

The block index of u-boot-env changed from mtd1 to mtd3 after upgrading kernel to 5.4.
This patch search the mtd block by label name, work as expect when perform a clean flash.

Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
3 years agokernel: bump 5.4 to 5.4.51
John Audia [Thu, 9 Jul 2020 21:22:35 +0000 (17:22 -0400)]
kernel: bump 5.4 to 5.4.51
update via update_kernel.sh -v -u 5.4

Removed upstreamed patches:
 350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch

Script refreshed patches:
 902-debloat_proc.patch
 904-debloat_dma_buf.patch

Attempted merge conflict in following patches:
 0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch

Build system: x86_64
Build tested: ipq806x (Netgear R7800)

Signed-off-by: John Audia <graysky@archlinux.us>
[fixed sha256sum of the tarball]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoipq806x: enable Linksys EA8500 eth1 interface
Pawel Dembicki [Tue, 30 Jun 2020 09:29:46 +0000 (11:29 +0200)]
ipq806x: enable Linksys EA8500 eth1 interface

At this moment Linksys EA8500 uses only eth0.

This patch change switch registers, which allow to use eth1 as lan
and eth0 as wan. The method work with similar Linksys EA7500V1
and it work with EA8500.

Suggested-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Brian Onn <brian.a.onn@gmail.com>
Tested-by: Adrian Panella <ianchi74@outlook.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
3 years agobase-files: remove useless cat
Adrian Schmutzler [Sun, 10 May 2020 14:47:54 +0000 (16:47 +0200)]
base-files: remove useless cat

Check file contents directly instead of using cat.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agowireguard-tools: replace backticks by $(...)
Adrian Schmutzler [Sun, 10 May 2020 14:47:51 +0000 (16:47 +0200)]
wireguard-tools: replace backticks by $(...)

This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agobase-files: replace backticks by $(...)
Adrian Schmutzler [Sun, 10 May 2020 14:47:46 +0000 (16:47 +0200)]
base-files: replace backticks by $(...)

This replaces deprecated backticks by more versatile $(...) syntax.

This does not touch lib/upgrade/nand.sh, as there replacement is
not trivial.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoprocd: fix yet another build issue, this time with capabilities
Daniel Golle [Sat, 11 Jul 2020 10:27:33 +0000 (11:27 +0100)]
procd: fix yet another build issue, this time with capabilities

 3034eaf jail: use linux/capability.h instead of sys/capability.h

Fixes: b6e440a0f5 ("procd: update to git HEAD")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoprocd: fix another seccomp-related build issue
Daniel Golle [Sat, 11 Jul 2020 09:52:28 +0000 (10:52 +0100)]
procd: fix another seccomp-related build issue

 3473671 ujail: add dependency on syscall-names-h

Fixes: b6e440a0f5 ("procd: update to git HEAD")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoath79: disable TP-Link TL-WR941ND v2
Adrian Schmutzler [Sat, 11 Jul 2020 09:43:22 +0000 (11:43 +0200)]
ath79: disable TP-Link TL-WR941ND v2

The support for this device's Marvell MV88E6060 switch has been
reported to be broken with kernels 4.19/5.4 (see bug report).

Since this a 4/32 device and it has been confirmed to be working
with stable 19.07 release (kernel 4.14), and since fixing it does
not seem trivial, let's just disable it in master.

Fixes: FS#2524
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoprocd: jail: fix build on platforms without seccomp support
Daniel Golle [Fri, 10 Jul 2020 23:08:04 +0000 (00:08 +0100)]
procd: jail: fix build on platforms without seccomp support

Fixes: b6e440a0f5 ("procd: update to git HEAD")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoprocd: update to git HEAD
Daniel Golle [Fri, 10 Jul 2020 17:52:28 +0000 (18:52 +0100)]
procd: update to git HEAD

 ea7a790 jail: add support for running OCI bundle
 bb4a446 uxc: add container management CLI tool

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agomac80211: rt2x00: define RF5592 in init_eeprom routine
Daniel Golle [Tue, 7 Jul 2020 20:51:58 +0000 (21:51 +0100)]
mac80211: rt2x00: define RF5592 in init_eeprom routine

Make sure RF5592 is set for RT5592 chip which apparently sometimes
doesn't have RF defined (but always comes with RF5592).
This patch was originally submitted on linux-wireless by
Tom Psyborg <pozega.tomislav@gmail.com> but got rejected.
Turns out the patch is actually needed.

Reported-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoramips: add support for Netgear R6020
Tim Thorpe [Thu, 9 Jul 2020 03:07:35 +0000 (22:07 -0500)]
ramips: add support for Netgear R6020

This adds support for the Netgear R6020, aka Netgear AC750.

The R6020 appears to be the same hardware as the Netgear R6080,
aka Netgear AC1000, but it has a slightly different flash layout,
and no USB ports.

Specification:

SoC: MediaTek MT7628 (580 MHz)
Flash: 8 MiB
RAM: 64 MiB
Wireless: 2.4Ghz (builtin) and 5Ghz (MT7612E)
LAN speed: 10/100
LAN ports: 4
WAN speed: 10/100
WAN ports: 1
UART (57600 8N1) on PCB

MAC addresses based on vendor firmware:
LAN      *:88   0x4
WAN      *:89
WLAN2    *:88   0x4
WLAN5    *:8a   0x8004

The factory partition might have been corrupted beforehand. However,
the comparison of vendor firmware and OpenWrt still allowed to retrieve
a meaningful assignment that also matches the other similar devices.

Installation:

Flashing OpenWRT from stock firmware requires nmrpflash. Use an ethernet
cable to connect to LAN port 1 of the R6020, and power the R6020 off.
From the connected workstation, run
`nmrpflash -i eth0 -f openwrt-ramips-mt76x8-netgear_r6020-squashfs-factory.img`,
replacing eth0 with the appropriate interface (can be identified by
running `nmrpflash -L`). Then power on the R6020. After flashing has finished,
power cycle the R6020, and it will boot into OpenWRT. Once OpenWRT has been
installed, subsequent flashes can use the web interface and sysupgrade files.

Signed-off-by: Tim Thorpe <timfthorpe@gmail.com>
[slightly extend commit message, fix whitespaces in DTS, align From:
with Signed-off-by]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agolantiq: set correct gphy pins for Zyxel P-2812
Willem van den Akker [Thu, 9 Jul 2020 12:51:19 +0000 (14:51 +0200)]
lantiq: set correct gphy pins for Zyxel P-2812

This fixes the gphy LED pins for Zyxel P-2812 devices. The have
been accidentally altered during a tidy-up operation (see Fixes:
below).

No ports were available, dmesg reported:

[ 0.658577] pinctrl-xway 1e100b10.pinmux: pin io5 already requested by
            1e100bb0.stp; cannot claim for 1e108000.eth
[ 0.667566] pinctrl-xway 1e100b10.pinmux: pin-5 (1e108000.eth) status -22
[ 0.685238] lantiq,xrx200-net 1e108000.eth: Error applying setting,
            reverse things back
[ 0.693270] lantiq,xrx200-net: probe of 1e108000.eth failed with error -22

Fixes: FS#3188
Fixes: 660200e53d62 ("lantiq: dts: assign the GPHY LED pins to the
Ethernet controller node")

Suggested-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Willem van den Akker <wvdakker@wilsoft.nl>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agomediatek: fix bashism in gen_banana_pi_img.sh
David Woodhouse [Thu, 9 Jul 2020 08:56:18 +0000 (09:56 +0100)]
mediatek: fix bashism in gen_banana_pi_img.sh

There was a bashism in the script. This fixes the script so that it
doesn't actually require bash, and can be run with any POSIX shell as
its shebang suggests.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agokernel: iscsi-initator: fix kernel config symbols
Lucian Cristian [Wed, 8 Jul 2020 19:49:57 +0000 (22:49 +0300)]
kernel: iscsi-initator: fix kernel config symbols

Enable SCSI low-level drivers on targets that don't have it already in
order to fix following build failures on few platforms:

  .config:4739:warning: symbol value 'm' invalid for SCSI_LOWLEVEL
 * Restart config...
 * SCSI low-level drivers
 SCSI low-level drivers (SCSI_LOWLEVEL) [Y/n] (NEW) aborted!

Fixes: b88f8202c4ce ("kernel: add iscsi-initator support")
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
[commit subject and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agomediatek: re-add u3phy2 phy-switch patch
Sungbo Eo [Fri, 29 May 2020 13:06:35 +0000 (22:06 +0900)]
mediatek: re-add u3phy2 phy-switch patch

This patch is required for pcie@2,0 in mt7623 to work. The patch was originally
added in kernel 4.14, but it has not been ported to 4.19 and later.

Fixes: FS#3217
Tested-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
3 years agomediatek: do not create device nodes in uci-defaults script
Sungbo Eo [Fri, 29 May 2020 11:51:01 +0000 (20:51 +0900)]
mediatek: do not create device nodes in uci-defaults script

Since commit 298814e6be76 ("base-files: config_generate: split macaddr with
multiple ifaces") uci MAC address setup will create a device node for each
member iface. But this script might override the device nodes and interfere
with the MAC address setup.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
3 years agotreewide: kernel: drop redundant USB_EHCI_HCD=n config symbol
Petr Štetiar [Thu, 9 Jul 2020 07:04:54 +0000 (09:04 +0200)]
treewide: kernel: drop redundant USB_EHCI_HCD=n config symbol

Commit e53ec043bae1 ("kirkwood: move usb support to modules") has moved
this config symbol into generic configs, so it could be removed from
other configs.

Suggested-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoath79: add support for D-Link DAP-1330/DAP-1365 A1
Sebastian Schaper [Wed, 3 Jun 2020 19:15:09 +0000 (21:15 +0200)]
ath79: add support for D-Link DAP-1330/DAP-1365 A1

Port device support for DAP-1330 from the ar71xx target to ath79.

Additionally, images are generated for the European through-socket
case variant DAP-1365. Both devices run the same vendor firmware, the
only difference being the DAP_SIGNATURE field in the factory header.
The vendor's Web UI will display a model string stored in the flash.

Specifications:

 * QCA9533, 8 MiB Flash, 64 MiB RAM
 * One Ethernet Port (10/100)
 * Wall-plug style case (DAP-1365 with additional socket)
 * LED bargraph RSSI indicator

Installation:

 * Web UI: http://192.168.0.50 (or different address obtained via DHCP)
   There is no password set by default
 * Recovery Web UI: Keep reset button pressed during power-on
   until LED starts flashing red, upgrade via http://192.168.0.50
 * Some modern browsers may have problems flashing via the Web UI,
   if this occurs consider booting to recovery mode and flashing via:
   curl -F \
     files=@openwrt-ath79-generic-dlink_dap-1330-a1-squashfs-factory.bin \
     http://192.168.0.50/cgi/index

The device will use the same MAC address for both wired and wireless
interfaces, however it is stored at two different locations in the flash.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
3 years agoath79: add support for Arduino Yun
Sungbo Eo [Sun, 12 Jan 2020 12:36:23 +0000 (21:36 +0900)]
ath79: add support for Arduino Yun

Arduino Yun is a microcontroller development board, based on Atmel
ATmega32u4 and Atheros AR9331.

Specifications:
- MCU: ATmega32U4
- SoC: AR9331
- RAM: DDR2 64MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: SoC internal
- Ethernet: 1x 10/100Mbps
- USB: 1x 2.0
- MicroSD: 1x SDHC

Notes:
- Stock firmware is based on OpenWrt AA.
- The SoC UART can be accessed only through the MCU.
  YunSerialTerminal is recommended for access to serial console.
- Stock firmware uses non-standard 250000 baudrate by default.
- The MCU can be reprogrammed from the SoC with avrdude linuxgpio.

Installation:
1.  Update U-Boot environment variables to adapt to new partition scheme.
    > setenv bootcmd "run addboard; run addtty; run addparts; run addrootfs; bootm 0x9f050000 || bootm 0x9fea0000"
    > setenv mtdparts "spi0.0:256k(u-boot)ro,64k(u-boot-env),15936k(firmware),64k(nvram),64k(art)ro"
    > saveenv
2.  Boot into stock firmware normally and perform sysupgrade with
    sysupgrade image.
    # sysupgrade -n -F /tmp/sysupgrade.bin

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
3 years agobase-files: add functions to set or clear bit in MAC address
Sungbo Eo [Sat, 25 Jan 2020 14:06:07 +0000 (23:06 +0900)]
base-files: add functions to set or clear bit in MAC address

Some devices (e.g. Arduino Yun) need bitwise operations during MAC address
setup. This commit adds generalized versions of macaddr_setbit_la(), which
are helpful when manipulating a single bit in a MAC address.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
3 years agomediatek: Implement sysupgrade support for Banana Pi R2
David Woodhouse [Mon, 15 Jun 2020 16:48:19 +0000 (17:48 +0100)]
mediatek: Implement sysupgrade support for Banana Pi R2

Based on work by Alexey Loukianov <lx2@lexa2.ru> and others.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: store MAC address in boot partition on Banana Pi R2
David Woodhouse [Sun, 14 Jun 2020 13:20:36 +0000 (14:20 +0100)]
mediatek: store MAC address in boot partition on Banana Pi R2

Like many boards, the Banana Pi R2 doesn't have permanant storage of
its MAC address, and we store the first random one that the kernel
generates in order to use it later and at least be consistent.

Store it in the FAT boot partition, just as the U7623 board (and others)
do.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: add SD card image creation for Banana Pi R2
David Woodhouse [Fri, 12 Jun 2020 10:06:38 +0000 (11:06 +0100)]
mediatek: add SD card image creation for Banana Pi R2

Based on work by Alexey Loukianov <lx2@lexa2.ru> and others.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: use U-Boot FAT environment support for Banana Pi R2
David Woodhouse [Fri, 19 Jun 2020 22:11:48 +0000 (23:11 +0100)]
mediatek: use U-Boot FAT environment support for Banana Pi R2

Instead of building in a default environment which loads our environment
from the FAT partition....  just ask U-Boot to do it.

Submitted upstream at
https://patchwork.ozlabs.org/project/uboot/list/?series=184688

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: fix U-Boot pinctrl setup for mt7623 eMMC
David Woodhouse [Fri, 19 Jun 2020 11:43:10 +0000 (12:43 +0100)]
mediatek: fix U-Boot pinctrl setup for mt7623 eMMC

The U-Boot pinctrl driver for mt7623 was incomplete and didn't handle the
settings required for eMMC to work.

Submitted upstream at
https://patchwork.ozlabs.org/project/uboot/list/?series=184529

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: add mt7623 u-boot build for Banana Pi R2
David Woodhouse [Thu, 11 Jun 2020 18:32:12 +0000 (19:32 +0100)]
mediatek: add mt7623 u-boot build for Banana Pi R2

For building full SD/eMMC images for Banana Pi R2 we'll want a u-boot
image built for that platform.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: new mt7623n preloader package for Banana Pi
David Woodhouse [Thu, 11 Jun 2020 18:33:42 +0000 (19:33 +0100)]
mediatek: new mt7623n preloader package for Banana Pi

Download the boot preloader code from the Banana Pi github repo and make
it available for bootable SD card image creation.

Supports only Banana Pi R2 for now.

Based on work by Alexey Loukianov <lx2@lexa2.ru> and others.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: enable SATA for mt7623
David Woodhouse [Wed, 10 Jun 2020 15:23:04 +0000 (16:23 +0100)]
mediatek: enable SATA for mt7623

The MT7623 SoC has the same SATA block as the MT7622, so enable it in
MT7623 builds too and add it to the DEVICE_PACKAGES for those boards.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek/mt7623: unify features and packages, add ext4 and usb
David Woodhouse [Mon, 15 Jun 2020 08:47:09 +0000 (09:47 +0100)]
mediatek/mt7623: unify features and packages, add ext4 and usb

The supported MT7623 boards are mostly identical (what with being a
System-on-Chip and all), so unify the DEVICE_PACKAGES for them, and add
ext4 and usb support for them.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agofirmware-utils/ptgen: allow explicit placement of partitions
David Woodhouse [Sat, 13 Jun 2020 22:39:15 +0000 (23:39 +0100)]
firmware-utils/ptgen: allow explicit placement of partitions

For Banana Pi R2 we need to place the U-Boot partition at precisely 0x50000.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agomediatek: mt7623: refresh 5.4 kernel config
David Woodhouse [Wed, 17 Jun 2020 21:04:46 +0000 (22:04 +0100)]
mediatek: mt7623: refresh 5.4 kernel config

Some options were not explicitly specified, causing the kernel build to
drop to interactive mode. Set the missing options.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agofstools: update to the latest version
David Woodhouse [Wed, 17 Jun 2020 21:31:59 +0000 (22:31 +0100)]
fstools: update to the latest version

d34ea8e Use autoclear for overlay loopback device

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
3 years agoath79: add support for D-Link DCH-G020 Rev. A1
Sebastian Schaper [Wed, 13 May 2020 15:37:31 +0000 (17:37 +0200)]
ath79: add support for D-Link DCH-G020 Rev. A1

The DCH-G020 is a Smart Home Gateway for Z-Wave devices.

Specifications:

 * QCA9531, 16 MiB Flash, 64 MiB RAM
 * On-Board USB SD3503A Z-Wave dongle
 * GL850 USB 2.0 Hub (one rear port, internal Z-Wave)
 * Two Ethernet Ports (10/100)

Installation:

 * Web UI: http://192.168.0.60 (or different address obtained via DHCP)
   Login with 'admin' and the 6-digit PIN Code from the bottom label
 * Recovery Web UI: Keep reset button pressed during power-on
   until LED starts flashing red, upgrade via http://192.168.0.60
 * Some modern browsers may have problems flashing via the Web UI,
   if this occurs consider booting to recovery mode and flashing via:
   curl -F \
     files=@openwrt-ath79-generic-dlink_dch-g020-a1-squashfs-factory.bin \
     http://192.168.0.60/cgi/index

Known issues:

 * Real-Time-Clock is not working as there is currently no matching driver
   It is still included in the dts as compatible = "pericom,pt7c43390";
 * openzwave was tested on v19.07 (running MinOZW as a proof-of-concept),
   but the package grew too big as lots of device pictures were included,
   thus any use of Z-Wave is up to the user (e.g. extroot and domoticz)

The device will use the same MAC address for both wired and wireless
interfaces, however it is stored at two different locations in the flash.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
3 years agotarget.mk: change i386 CPU type to pentium-mmx
Rosen Penev [Sun, 12 Jan 2020 04:44:34 +0000 (20:44 -0800)]
target.mk: change i386 CPU type to pentium-mmx

f4f8f4a180366ee90fd8e153213db2cb746ca361 broke ffmpeg compilation with x86

The reason is that ffmpeg's x86 assembly requires at least MMX, which the
pentium CPU_TYPE was preventing.

Fixes ffmpeg compilation on x86_legacy and x86_geode.

Ref: https://github.com/openwrt/openwrt/pull/3061
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agoipq806x: compile in schedutil governor
John Audia [Wed, 8 Jul 2020 18:43:04 +0000 (14:43 -0400)]
ipq806x: compile in schedutil governor

Gives users a third option to augment ondemand and performance. Kernel
docs[1] explain differences and this PR empowers users w/ the choice to
select between the older ondemand and newer and more simplistic schedutil
should they wish to use one that is not the performance governor.

1. Documentation/admin-guide/pm/cpufreq.rst

Signed-off-by: John Audia <graysky@archlinux.us>
[fixed From: to match SoB:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoramips: mt7621: use lzma-loader for ra21s & rg21s
Furkan Alaca [Fri, 3 Jul 2020 05:51:03 +0000 (01:51 -0400)]
ramips: mt7621: use lzma-loader for ra21s & rg21s

The rg21s fails to boot if the kernel is larger than about
2,376 KiB. The ra21s is virtually identical hardware.
Enabling lzma-loader resolves the issue on both the rg21s
and ra21s (see FS#3057 on the issue tracker).

Fixes: FS#3057
Signed-off-by: Furkan Alaca <furkan.alaca@queensu.ca>
3 years agoramips: add support for ZyXEL Keenetic Lite Rev.B
Sergei Burakov [Thu, 28 May 2020 18:24:55 +0000 (21:24 +0300)]
ramips: add support for ZyXEL Keenetic Lite Rev.B

Device specification:

SoC: RT5350
CPU Frequency: 360 MHz
Flash Chip: Macronix MX25L6406E (8192 KiB)
RAM: Winbond W9825G6JH-6 (32768 KiB)
5x 10/100 Mbps Ethernet (4x LAN, 1x WAN)
1x external antenna
UART (J1) header on PCB (57800 8n1)
Wireless: SoC-intergated: 2.4GHz 802.11bgn
USB: None
8x LED, 2x button

Flash instruction:

Configure PC with static IP 192.168.99.8/24 and start TFTP server.
Rename "openwrt-ramips-rt305x-zyxel_keenetic-lite-b-squashfs-sysupgrade.bin"
to "rt305x_firmware.bin" and place it in TFTP server directory.
Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed until power LED start blinking.
Router will download file from TFTP server, write it to flash and reboot.

Signed-off-by: Sergei Burakov <senior.anonymous@ya.ru>
3 years agoramips: move adslr_g7 in image/mt7621.mk to keep sorting
Adrian Schmutzler [Wed, 8 Jul 2020 19:18:12 +0000 (21:18 +0200)]
ramips: move adslr_g7 in image/mt7621.mk to keep sorting

Move this device to the top to maintain alphabetic sorting in the
file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: add missing kmod-mt7615-firmware for TP-Link RE500 v1
Adrian Schmutzler [Wed, 8 Jul 2020 19:12:27 +0000 (21:12 +0200)]
ramips: add missing kmod-mt7615-firmware for TP-Link RE500 v1

Adding this has been overlooked when rebasing the commit prior to
merge.

Fixes: ba0f4f0cfddc ("ramips: add support for TP-Link RE500 v1")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agokernel: iscsi-initator: fix missing dependency
Petr Štetiar [Wed, 8 Jul 2020 19:11:40 +0000 (21:11 +0200)]
kernel: iscsi-initator: fix missing dependency

Fixes following issue:

 Package kmod-iscsi-initiator is missing dependencies for the following libraries:
 crypto_hash.ko

Fixes: b88f8202c4ce ("kernel: add iscsi-initator support")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoipq40xx: fix patches on dts Makefile
Adrian Schmutzler [Wed, 8 Jul 2020 15:48:15 +0000 (17:48 +0200)]
ipq40xx: fix patches on dts Makefile

The patches for arch/arm/boot/dts/Makefile have not been updated
in a syntactically correct way (just body was changed). Fix it.

Fixes: 4a77a060ab62 ("ipq40xx: add support for Buffalo WTR-M2133HP")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: add support for ZyXEL WAP6805 (Altibox WiFi+)
Bjørn Mork [Wed, 18 Apr 2018 19:57:52 +0000 (21:57 +0200)]
ramips: add support for ZyXEL WAP6805 (Altibox WiFi+)

Hardware
--------
SoC:   MediaTek MT7621ST
WiFi:  MediaTek MT7603
       Quantenna QT3840BC
Flash: 128M NAND
RAM:   64M
LED:   Dual colour red and green
BTN:   Reset
       WPS
Eth:   4 x 10/100/1000 connected to MT7621 internal switch
       MT7621 RGMII port connected to Quantenna module
GPIO:  Power/reset of Quantenna module

Quantenna module
----------------

The Quantenna QT3840BC (or QV840) is a separate SoC running
another Linux installation.  It is mounted on a wide mini-PCIe
form factor module, but is connected to the RGMII port of
the MT7621.  It loads both a second uboot stage and an os
image from the MT7621 using tftp.  The module is configured
using Quantenna specific RPC calls over IP, using 802.1q
over the RGMII link to support multiple SSIDs.

There is no support for using this module as a WiFi device
in OpenWrt. A package with basic firmware and management
tools is being prepared.

Serial ports
------------

Two serial ports with headers:

RRJ1 - 115200 8N1 - Connected to the Quantenna console
J1   -  57600 8N1 - Connected to the MT7621 console

Both share pinout with many other Zyxel/Mitrastar devices:

1 - NC (VDD)
2 - TX
3 - RX
4 - NC (no pin)
5 - GND

Dual system partitions
----------------------

The vendor firmware and boot loader use a dual partition
scheme storing a counter in the header of each partition. The
partition with the highest number will be selected for boot.

OpenWrt does not support this scheme and will always use the
first OS partition.  It will reset both counters to zero the
first time sysupgrade is run, making sure the first partition
is selected by the boot loader.

Installation from vendor firmware
---------------------------------

1. Run a DHCP server. The WAP6805 is configured as a client device
   and does not have a default static IP address. Make a note of
   which address it is assigned

2. tftp the OpenWrt initramfs-kernel.bin image to this address.
   Wait for the WAP6805 to reboot.

3. ssh to the OpenWrt initramfs system on 192.168.1.1. Make a
   backup of all mtd partitions now.  The last used OEM image is
   still present in either "Kernel" or "Kernel2" at this point,
   and can be restored later if you save a copy.

4. sysupgrade to the OpenWrt sysupgrade.bin image.

Installation from U-Boot
------------------------

This requires serial console access

1. Copy the OpenWrt initramfs-kernel.bin image as "ras.bin" to
   your tftp server directory.  Configure the server address as
   192.168.0.33/24

2. Hit ESC when the message "Hit ESC key to stop autoboot"
   appears

3. Type "ATGU" + Enter, and then "2" immediately after pressing enter.

4. Answer Y to the question "Erase Linux in Flash then burn new
   one. Are you sure?", and answer the address/filename questions.
   Defaults:
        Input device IP (192.168.0.2)
        Input server IP (192.168.0.33)
        Input Linux Kernel filename ("ras.bin")

5. Wait until after you see the message "Done!" and power cycle
   the device.  It will hang after flashing.

6. Continue with step 3 and 4 from the vendor firmware procedure.

Notes on the WAP6805 U-Boot
---------------------------
The bootloader has been modified with both ZyXELs zyloader and the
device specific dual partition scheme.  These changes appear to have
broken a few things.  The zyloader shell claims to support a number
of ZyXEL AT commands, but not all of them work.  The image selection
scheme is unreliable and inconsistent.  A limited U-Boot menu is
available - and used by the above U-Boot install procedure.  But
direct booting into an uploaded image does not work, neither with
ram nor with flash.  Flashing works, but requires a hard reset after
it is finished.

Reverting to OEM firmware
-------------------------

The OEM firmware can be restored by using mtd write from OpenWrt,
flashing it to the "Kernel" partition. E.g.

  ssh root@192.168.1.1 "mtd -r -e Kernel write - Kernel" < oem.bin

OEM firmwares for the WAP6805 are not avaible for public download,
so a backup of the original installation is required.  See above.

Alternatively, firmware for the WAP6806 (Armor X1) may be used. This
is exactly the same hardware.  But the branding features do obviously
differ.

LED controller
--------------

Hardware implementation is unknown.  The dual-color LED is controlled
by 3 GPIOs:

  4: red
  7: blinking green
 13: green

Enabling both red and green makes the LED appear yellow.

The boot loader enables hardware blinking, causing the green LED to blink
slowly on power-on, until the OpenWrt boot mode starts a faster software
blink.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
[fix alphabetic sorting for image build statement]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agomt7621-qtn-rgmii: enable RGMII connected Quantenna QV840
Bjørn Mork [Sun, 5 Apr 2020 14:17:11 +0000 (16:17 +0200)]
mt7621-qtn-rgmii: enable RGMII connected Quantenna QV840

Write a magic value to a magic destination.  This might
be specific to the Mitrastar designed ZyXEL WAP6805.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
3 years agoipq806x: add support for Linksys EA7500 V1
Pawel Dembicki [Tue, 26 May 2020 19:14:11 +0000 (21:14 +0200)]
ipq806x: add support for Linksys EA7500 V1

This patch adds support for the Linksys EA7500 V1 router.

Specification:
 - CPU: Qualcomm IPQ8064
 - RAM: 256MB
 - Flash: NAND 128MB
 - WiFi: QCA9982 an+ac + QCA9983 bgn
 - Ethernet: 5 GBE Ports (WAN+ 4xLAN) (QCA8337)
 - USB: 1x USB 3.0 1x USB2.0
 - Serial console: RJ-45 115200 8n1 (1V8 Voltage level)
 - 2 Buttons
 - 1 LED

Known issues:
 - Some devices won't flash via web gui

Installation:
- Newer stock images doesn't allow to install custom firmware.
- Please downgrade software to 1.1.2 version. Official firmware:
https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.gpg.img
- Do it two times to downgrade all stored images.
- Apply factory image via web-gui.

Serial + TFTP method:
 - downgrade to 1.1.2 two times
 - connect ehternet and serial cable
 - set ip address of tftp server to 192.168.1.254
 - put openwrt factory image to tftp folder and rename it to macan.bin
 - stop device while booting in u-boot
 - run command: "run flashimg"
 - run command: "setenv boot_part 1"
 - run command "saveenv"
 - reset

Back to stock:
- Please use old non-gpg image like this 1.1.2:
https://downloads.linksys.com/downloads/firmware/FW_EA7500_1.1.2.172843_prod.img
- ssh to router and copy image to tmp
- use sysupgrade -n -F

Tested by github users: @jack338c and @grzesiczek1

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[removed i2c4_pins, mdio0_pins, nand_pins, rgmii2_pins from DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agofirmware-utils/hcsmakeimage: fix possible memory leak and resource leaks
Andrea Dalla Costa [Sat, 11 Jan 2020 21:57:58 +0000 (22:57 +0100)]
firmware-utils/hcsmakeimage: fix possible memory leak and resource leaks

Add missing calls to `free` for variable `filebuffer`.
Add missing calls to `fclose` for variables `fd` and `fd_out`.

Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
3 years agoipq40xx: add support for Buffalo WTR-M2133HP
Yanase Yuki [Wed, 29 Jan 2020 10:27:25 +0000 (19:27 +0900)]
ipq40xx: add support for Buffalo WTR-M2133HP

Buffalo WTR-M2133HP is a Tri-Band router based on IPQ4019.

Specification
-------------
- SoC: Qualcomm IPQ4019
- RAM: 512MiB
- Flash Memory: NAND 128MiB (MXIC MX30LF1G18AC)
- Wi-Fi: Qualcomm IPQ4019 (2.4GHz, 1ch - 13ch)
- Wi-Fi: Qualcomm IPQ4019 (5GHz, 36ch - 64ch)
- Wi-Fi: Qualcomm QCA9984 (2T2R, 5GHz, 100ch - 140ch)
- Ethernet: 4x 10/100/1000 Mbps (1x WAN, 3x LAN)
- LED: 4x white LED, 4x orange LED, 1x blue LED
- USB: 1x USB 3.0 port
- Input: 2x tactile switch, 2x slide switch (2x SP3T)
- Serial console: 115200bps, pinheader JP5 on PCB
- Power: DC 12V 2A

Flash instruction
-----------------
1. Set up a TFTP server (IP address: 192.168.11.10)
2. Rename "initramfs-fit-uImage.itb" to "WTR-M2133HP-initramfs.uImage"
   and put it into the TFTP server directory.
3. Connect the TFTP server and WTR-M2133HP.
4. Hold down the AOSS button, then power on the router.
5. After booting OpenWrt initramfs image, connect to the router by SSH.
6. Transfer "squashfs-nand-factory.ubi" to the router.
7. Execute the following commands.
    # ubidetach -p /dev/mtd15
    # ubiformat /dev/mtd15 -f /tmp/openwrt-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-nand-factory.ubi
    # fw_setenv bootcmd bootipq
8. Perform reboot.

Recover to stock firmware
-------------------------
1. Execute the following command.
    # fw_setenv bootcmd bootbf
2. Reboot and wait several minutes.

Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
3 years agokirkwood: add support for Zyxel NSA310S
Pawel Dembicki [Sat, 2 May 2020 13:33:14 +0000 (15:33 +0200)]
kirkwood: add support for Zyxel NSA310S

Zyxel NSA310S is a NAS based on Marvell kirkwood SoC.

Specification:
 - Processor Marvell 88F6702 1 GHz
 - 256MB RAM
 - 128MB NAND
 - 1x GBE LAN port (PHY: Marvell 88E1318)
 - 2x USB 2.0
 - 1x SATA
 - 3x button
 - 7x leds
 - serial on J1 connector (115200 8N1) (GND-NOPIN-RX-TX-VCC)

Known issues:
 - no kernel module for RTC. [*]
 - buzzer (connected to MPP43) need to be drived by 1kHz signal
 - no kernel module for internal MCU connected via I2C[**]

[*]
Karoly Pocsi made simple, unofficial driver for HT1382.
It can be found here:
https://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/

[**]
Karoly Pocsi found how CPU talk with MCU:
It is possible to query the MCU-controlled fan speed and temperature:
i2cget -y 0x0 0x0a 0x07
i2cget -y 0x0 0x0a 0x08
The first value (0x07) is the temperature in ° C, the second (0x08) is
the time in milliseconds to complete one fan revolution (rpm = 60,000 / value).
Info translated from:
https://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/

Installation:

TFTP:
1. Run serial console and go to u-boot.
2. Copy u-boot via tftp and write to NAND:
=> mw 0x0800000 0xffff 0x100000
=> nand erase 0x0 100000
=> setenv ipaddr 192.168.1.2
=> setenv serverip 192.168.1.4
=> tftp 0x0800000 nsa310s-u-boot.kwb
=> nand write 0x0800000 0x0 0x100000
=> reset
3. Run new u-Boot, repair bootcmd and restore MAC address from sticker
=> setenv ethaddr AA:BB:CC:DD:EE:FF
=> saveenv
4. Copy and run initramfs image
=> setenv ipaddr 192.168.1.2
=> setenv serverip 192.168.1.4
=> tftpboot zyxel_nsa310s-initramfs-uImage
=> bootm 0x800000
5. Download sysupgrade image and perform sysupgrade

USB:

1. Prepare usb fat32 drive with u-boot.kwb and initramfs image.
   Stick it to USB 2.0 port.
2. Run serial console and go to u-boot.
3. Copy u-boot from usb and write to NAND:
=> mw 0x0800000 0xffff 0x100000
=> nand erase 0x0 100000
=> usb start
=> fatload usb 0 0x0800000 u-boot.kwb
=> nand write 0x0800000 0x0 0x100000
=> reset
4. Run new u-Boot, repair bootcmd and restore MAC address from sticker
=> setenv ethaddr AA:BB:CC:DD:EE:FF
=> saveenv
5. Copy and run initramfs image:
=> usb start
=> fatload usb 0 0x0800000 initramfs-uImage
=> bootm 0x800000
6. Download sysupgrade image and perform sysupgrade.

Based on work ThBexx <thomas.beckler@hotmail.com>
DTS based on dropped support in 0ebdf0c.

Tested-by: Lech Perczak <lech.perczak@gmail.com>
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[NSA310s -> NSA310S in DEVICE_MODEL]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agouboot-kirkwood: add support for Zyxel NSA310S
Pawel Dembicki [Sat, 9 May 2020 20:08:02 +0000 (22:08 +0200)]
uboot-kirkwood: add support for Zyxel NSA310S

This patch modifies the u-boot config for the Zyxel NSA310S to work with
OpenWrt.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
3 years agoath79: add support for 8devices Lima board
Andrey Bondar [Wed, 8 Jul 2020 10:51:34 +0000 (13:51 +0300)]
ath79: add support for 8devices Lima board

Specification:

  • 650/600/216 MHz (CPU/DDR/AHB)
  • 64 MB of RAM (DDR2)
  • 32 MB of FLASH
  • 2T2R 2.4 GHz
  • 2x 10/100 Mbps Ethernet
  • 1x USB 2.0 Host socket
  • 1x miniPCIe slot
  • UART for serial console
  • 14x GPIO

Flash instructions:

Upgrading from ar71xx target:

  • Upload image into the board:
    scp openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin
    root@192.168.1.1/tmp/
  • Run sysupgrade
    sysupgrade -F /tmp/openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin

Upgrading from u-boot:

  • Set up tftp server with
    openwrt-ath79-generic-8dev_lima-initramfs-kernel.bin
  • Go to u-boot (reboot and press ESC when prompted)
  • Set TFTP server IP
    setenv serverip 192.168.1.254
  • Set device ip from the same subnet
    setenv ipaddr 192.168.1.1
  • Copy new firmware to board
    tftpboot 0x82000000 initramfs.bin
  • Boot OpenWRT
    bootm 0x82000000
  • Upload image openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin into
    the board
  • Run sysupgrade.

Signed-off-by: Andrey Bondar <a.bondar@8devices.com>
3 years agocomgt: add new script to send ussd request and get the answer
Kirill Lukonin [Fri, 20 Mar 2020 09:08:52 +0000 (14:08 +0500)]
comgt: add new script to send ussd request and get the answer

New script for comgt. Should help to fetch balance or any additional information with USSD.
This script uses the standard AT command which should be supported by all modems.

Run-tested on: Mikrotik wAP LTE KIT

Signed-off-by: Kirill Lukonin <klukonin@gmail.com>
[fixed from/sob]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agobuild: add 'make kernel_xconfig' command
Sergio E. Nemirowski [Wed, 1 Apr 2020 23:21:37 +0000 (02:21 +0300)]
build: add 'make kernel_xconfig' command

This adds the kernel_xconfig make target.

Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
3 years agoipq40xx: add support for GL.iNet GL-S1300
Dongming Han [Wed, 8 Apr 2020 08:43:51 +0000 (16:43 +0800)]
ipq40xx: add support for GL.iNet GL-S1300

Specifications:
SOC:        Qualcomm IPQ4029 (DAKOTA) ARM Quad-Core
RAM:        512 MiB
FLASH1:     16 MiB NOR - SPI0
FLASH2:     8 GiB eMMC
ETH:        Qualcomm QCA8075
WLAN1:      Qualcomm Atheros QCA4029 2.4GHz 802.11b/g/n 2x2
WLAN2:      Qualcomm Atheros QCA4029 5GHz 802.11n/ac W2 2x2
INPUT:      Reset, WPS
LED:        Power, Mesh, WLAN
UART1:      On board pin header near to LED (3.3V, TX, RX, GND), 3.3V without pin - 115200 8N1
UART2:      On board with BLE module
SPI1:       On board socket for Zigbee module

Install via tftp
- NB: need to flash transition image firstly

Firstly install transition image:
(IPQ40xx) # tftpboot 0x84000000 s1300-factory-to-openwrt.img
(IPQ40xx) # sf probe && imgaddr=0x84000000 && source :script

Secondly install openwrt sysupgrade bin:
(IPQ40xx) # run lf

Revert to factory image:
(IPQ40xx) # tftpboot 0x84000000 s1300-openwrt-to-factory.img
(IPQ40xx) # sf probe && imgaddr=0x84000000 && source :script

The kernel and rootfs of factory firmware are on eMMC, and openwrt
firmware is on NOR flash. The transition image includes U-boot
and partition table, which decides where to load kernel and rootfs.
After you firstly install openwrt image, you can switch between
factory and openwrt firmware by flashing transition image.

Signed-off-by: Dongming Han <handongming@gl-inet.com>
3 years agokernel: add iscsi-initator support
Lucian Cristian [Sun, 12 Apr 2020 14:45:41 +0000 (17:45 +0300)]
kernel: add iscsi-initator support

Module is needed for using iscsi-initiator userspace applications

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
[added missing newline between kernel modules]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agouclibc++: make verbosity affect uClibc++ build
Wren Turkal [Mon, 25 May 2020 21:05:51 +0000 (14:05 -0700)]
uclibc++: make verbosity affect uClibc++ build

Before this change, setting the verbosity to anything with V=blah would
cause uclibc++ build to print errors to the screen. Now, it the
clibc++ build verbosity will be altered in the following manners:
* V=s will set V=1 in the uclibc++ build
* V=sc will set V=2 in the uclibc++ build

Signed-off-by: Wren Turkal <wt@penguintechs.org>
3 years agoramips: Add support for Xiaomi Mi Router(Black,R2100)
Emir Efe Kucuk [Sat, 30 May 2020 09:18:50 +0000 (12:18 +0300)]
ramips: Add support for Xiaomi Mi Router(Black,R2100)

The Xiaomi Mi Router AC2100 is a *black* cylindrical router that shares many
characteristics (apart from its looks and the GPIO ports) with the 6-antenna
*white* "Xiaomi Redmi Router AC2100"

See the visual comparison of the two routers here:
https://github.com/emirefek/openwrt-R2100/raw/imgcdn/rm2100-r2100.jpg

Specification of R2100:
- CPU: MediaTek MT7621A
- RAM: 128 MB DDR3
- FLASH: 128 MB ESMT NAND
- WIFI: 2x2 802.11bgn (MT7603)
- WIFI: 4x4 802.11ac (MT7615)
- ETH: 3xLAN+1xWAN 1000base-T
- LED: Power, WAN in Yellow and Blue
- UART: On board (Don't know where is should be confirmed by anybody else)
- Modified u-boot

Hacking of official firmware process is same at both RM2100 and R2100.
Thanks to @namidairo

Here is the detailed guide Hack: https://github.com/impulse/ac2100-openwrt-guide
Guide is written for MacOS but it will work at linux.
needed packages: python3(with scapy), netcat, http server, telnet client

1. Run PPPoE&exploit to get nc and wget busybox, get telnet and wget firmware
2. mtd write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-kernel1.bin kernel1
3. nvram set uart_en=1
4. nvram set bootdelay=5
5. nvram set flag_try_sys1_failed=1
6. nvram commit
7. mtd -r write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-rootfs0.bin rootfs0

other than these I specified in here. Everything is same with:
https://github.com/openwrt/openwrt/commit/f3792690c4f0567a8965d82898295b9d50c3bb7e
Thanks for all community and especially for this device:
@Ilyas @scp07 @namidairo @Percy @thorsten97 @impulse (names@forum.openwrt.com)

MAC Locations:
WAN *:b5 = factory 0xe006
LAN *:b6 = factory 0xe000
WIFI 5ghz *:b8 = factory 0x8004
WIFI 2.4ghz *:b7 = factory 0x0004

Signed-off-by: Emir Efe Kucuk <emirefek@gmail.com>
[refactored common image bits into Device/xiaomi-ac2100, fixed From:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agogeneric: platform/mikrotik: add partial AR71xx cpufreq support
Thibaut VARÈNE [Sun, 21 Jun 2020 10:59:56 +0000 (12:59 +0200)]
generic: platform/mikrotik: add partial AR71xx cpufreq support

This patch adds cpu frequency setting for AR724x and AR7161.
It is unknown if all the AR71xx devices support the same value range,
so support is only enabled for AR7161 at this stage.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
3 years agogeneric: platform/mikrotik: add board_revision tag
Thibaut VARÈNE [Sat, 6 Jun 2020 13:46:08 +0000 (15:46 +0200)]
generic: platform/mikrotik: add board_revision tag

Tag was discovered exploring the hard_config of a "r2" board.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
3 years agogeneric: platform/mikrotik: graceful fallback for cpufreq_index
Thibaut VARÈNE [Fri, 5 Jun 2020 13:56:15 +0000 (15:56 +0200)]
generic: platform/mikrotik: graceful fallback for cpufreq_index

The current code would return an error on ath79 when the SoC isn't known
to the driver. Return the raw hex value instead, as happens with non
supported targets.
Also return the correctly incremented value from
sc_tag_cpufreq_ath79_arraysize()

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
3 years agogeneric: platform/mikrotik: match RouterBOOT nomenclature
Thibaut VARÈNE [Fri, 5 Jun 2020 12:06:02 +0000 (14:06 +0200)]
generic: platform/mikrotik: match RouterBOOT nomenclature

RouterBOOT cpu frequency settings are letter-indexed. Follow the
same logic for the sysfs interface.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
3 years agogeneric: platform/mikrotik: fix routerboot_tag_show_u32s()
Thibaut VARÈNE [Fri, 5 Jun 2020 11:59:41 +0000 (13:59 +0200)]
generic: platform/mikrotik: fix routerboot_tag_show_u32s()

The routine would only accurately print out the first word.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Fixes: 5ecf7d96 ("generic: routerboot sysfs platform driver")
3 years agoramips: add support for Edimax Gemini RE23S
Davide Fioravanti [Tue, 19 May 2020 23:27:56 +0000 (01:27 +0200)]
ramips: add support for Edimax Gemini RE23S

Hardware
--------
SoC:   Mediatek MT7621AT (880 MHz, 2 cores 4 threads)
RAM:   128MB
FLASH: 16MB NOR (Macronix MX25L12805D)
ETH:   1x 10/100/1000 Mbps Ethernet (MT7530)
WIFI:
  - 2.4GHz: 1x MT7615 (4x4:4)
  - 5GHz:   1x MT7615 (4x4:4)
  - 4 antennas: 2 external detachable and 2 internal
BTN:
  - 1x Reset button
  - 1x WPS button
LEDS:
  - 1x Green led (Power)
  - 1x Green-Amber-Red led (Wifi)
UART:
  - 57600-8-N-1

Everything works correctly.

Installation
------------
Flash the factory image directly from OEM web interface.
(You can login using these credentials: admin/1234)

Restore OEM Firmware
--------------------
Flash the OEM "bin" firmware directly from LUCI.
The firmware is downloadable from the OEM web page.
Warning: Remember to not keep settings!
Warning2: Remember to force the flash.

Restoring procedure tested with RE23_1.08.bin

MAC addresses
-------------
factory 0x4     *:24
factory 0x8004  *:25
Cimage  0x07    *:24
Cimage  0x0D    *:24
Cimage  0x13    *:24
Cimage  0x19    *:25

No other addresses were found in factory partition.

Since the label contains both the 2.4GHz and 5GHz mac address I decided
to set the 5GHz one as label-mac-device. Moreover it also corresponds
to the lan mac address.

Notes
-----
The wifi led in the OEM firmware changes colour depending on the signal
strength. This can be done in OpenWrt but just for one interface.
So for now will not be any default action for this led.

If you want to open the case, pay attention to the antenna placed on
the bottom part of the front cover.
The wire is a bit short and it breaks easily. (I broke it)

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
[fix two typos and add extended MAC address section to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoar71xx: Fix mikrotik NAND compile problem
Hauke Mehrtens [Tue, 7 Jul 2020 21:38:10 +0000 (23:38 +0200)]
ar71xx: Fix mikrotik NAND compile problem

This Fixes the folowing compile error:
drivers/mtd/nand/rb91x_nand.c: In function 'rb91x_nand_remove':
drivers/mtd/nand/rb91x_nand.c:445:16: error: 'rbni' undeclared (first use in this function)
  nand_release(&rbni->chip);

Fixes: ce958dd88a7e ("kernel: Update kernel 4.14 to version 4.14.187")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agocurl: bump to 7.71.1
Hans Dedecker [Tue, 7 Jul 2020 19:51:36 +0000 (21:51 +0200)]
curl: bump to 7.71.1

For changes in 7.71.1; see https://curl.haxx.se/changes.html#7_71_1

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agonat46: fix translation of ICMP protocol unreachable
Hans Dedecker [Tue, 7 Jul 2020 19:39:36 +0000 (21:39 +0200)]
nat46: fix translation of ICMP protocol unreachable

Refresh patch

1182f30 nat46-core: Fix translation of ICMP protocol unreachable

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agobuild: fix compatibility with python 3.6
Huangbin Zhan [Mon, 6 Jul 2020 23:14:42 +0000 (07:14 +0800)]
build: fix compatibility with python 3.6

On a system python3 is linked to python3.6, fail to perform json_overview_image_info
 and got `TypeError: __init__() got an unexpected keyword argument 'capture_output'`.
This patch emulate the behaviour on python 3.7+.

Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
3 years agobuild: mconf readme update
Sergio E. Nemirowski [Mon, 15 Jun 2020 17:58:15 +0000 (20:58 +0300)]
build: mconf readme update

This updates mconf.c readme message to maintain less changes with
upstream and consistency with nconf.c

Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
3 years agobuild: add nconfig
Sergio E. Nemirowski [Wed, 10 Jun 2020 01:33:21 +0000 (04:33 +0300)]
build: add nconfig

Add support for make target nconfig (ncurses)

Reviewed-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Signed-off-by: Sergio E. Nemirowski <sergio@outerface.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoath79: nand: disable images for glinet_gl-ar750s
Petr Štetiar [Wed, 20 May 2020 10:11:12 +0000 (12:11 +0200)]
ath79: nand: disable images for glinet_gl-ar750s

Fixes following build failures:

 WARNING: Image file glinet_gl-ar750s-nor-kernel.bin is too big
 WARNING: Image file glinet_gl-ar750s-nor-nand-kernel.bin is too big

Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoath79: add support for 8devices Rambutan board
Andrey Bondar [Fri, 26 Jun 2020 08:16:00 +0000 (11:16 +0300)]
ath79: add support for 8devices Rambutan board

Rambutan is a Wifi module based on QCA9550/9557
http://www.8devices.com/products/rambutan

Specification:

- 720/600/200 MHz (CPU/DDR/AHB)
- 128 MB of DDR2 RAM
- 128 MB of NAND Flash
- 1x 100Mbps Ethernet
- 1x 1000Mbps Ethernet (PHY on dev-kit)
- 1x Wifi radio 2x2 MIMO, dualband 2.4 and 5 GHz
- 2x U.FL connectors on module, chip antennas on dev-kit
- 1x miniPCIe slot
- 2x USB2.0 host
- 2x UART
- SPI, I2C, GPIO

Flash instructions:

Upgrade from ar71xx target:
 sysupgrade -F /tmp/openwrt-ath79-nand-8dev_rambutan-squashfs-sysupgrade.tar
or upgrade from GUI (don't save config)

Use factory image to flash from U-Boot:
 tftpboot 80060000 openwrt-ath79-nand-8dev_rambutan-squashfs-factory.ubi
 nand erase.part ubi
 nand write 80060000 ubi ${filesize}

Signed-off-by: Petr Štetiar <ynezz@true.cz> [copy&pasted missing commit description]
Signed-off-by: Andrey Bondar <a.bondar@8devices.com>
3 years agodropbear: make rsa-sha2-256 pubkeys usable again
Petr Štetiar [Wed, 1 Jul 2020 10:29:44 +0000 (12:29 +0200)]
dropbear: make rsa-sha2-256 pubkeys usable again

Upstream in commit 972d723484d8 ("split signkey_type and signature_type
for RSA sha1 vs sha256") has added strict checking of pubkey algorithms
which made keys with SHA-256 hashing algorithm unusable as they still
reuse the `ssh-rsa` public key format. So fix this by disabling the
check for `rsa-sha2-256` pubkeys.

Ref: https://tools.ietf.org/html/rfc8332#section-3
Fixes: d4c80f5b172e ("dropbear: bump to 2020.80")
Tested-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agoramips: use WiFi LED DT triggers for TP-Link RE650 v1
Adrian Schmutzler [Tue, 7 Jul 2020 09:49:36 +0000 (11:49 +0200)]
ramips: use WiFi LED DT triggers for TP-Link RE650 v1

This moves WiFi LED triggers from 01_leds to device tree.

While at it, convert the labels there to lower case; this is
more commonly used and the change will actually remove competition
between DT trigger and leftover uci config on already installed
systems.

Suggested-by: Georgi Vlaev <georgi.vlaev@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoath79: switch to kernel 5.4
David Bauer [Thu, 2 Apr 2020 19:53:59 +0000 (21:53 +0200)]
ath79: switch to kernel 5.4

As the reported major bugs are ironed out, switch to the new kernel to
begin testing with a broader audience.

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agobuild: conditionally enable testing-kernel feature
David Bauer [Tue, 7 Jul 2020 08:32:09 +0000 (10:32 +0200)]
build: conditionally enable testing-kernel feature

Only enable the testing-kernel feature for the target when the testing
kernel version does not match the stable kernel version.

This way, the option for building the testing kernel in the build config
menu is only exposed when there's a testing kernel available.

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agolantiq: set port numbers corresponding to reg value
Aleksander Jan Bajkowski [Sun, 17 May 2020 10:33:56 +0000 (12:33 +0200)]
lantiq: set port numbers corresponding to reg value

Fix inconsistencies found in DTS files and sort ethernet ports based on
updated names.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[squash two separate patches, rephrase commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agolantiq: remove redundant includes from fritz736x DTS files
Aleksander Jan Bajkowski [Sun, 17 May 2020 10:32:07 +0000 (12:32 +0200)]
lantiq: remove redundant includes from fritz736x DTS files

The removed lines are already included in vr9_avm_fritz736x.dtsi

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[rephrase commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: add support for TP-Link RE500 v1
Christoph Krapp [Mon, 6 Jul 2020 21:05:25 +0000 (23:05 +0200)]
ramips: add support for TP-Link RE500 v1

This device uses the same hardware as RE650 v1 which got supported in
8c51dde.

Hardware specification:

- SoC 880 MHz - MediaTek MT7621AT
- 128 MB of DDR3 RAM
- 16 MB - Winbond 25Q128FVSG
- 4T4R 2.4 GHz - MediaTek MT7615E
- 4T4R 5 GHz - MediaTek MT7615E
- 1x 1 Gbps Ethernet - MT7621AT integrated
- 7x LEDs (Power, 2G, 5G, WPS(x2), Lan(x2))
- 4x buttons (Reset, Power, WPS, LED)
- UART header (J1) - 2:GND, 3:RX, 4:TX
  Serial console @ 57600,8n1

Flash instructions:

Upload
openwrt-ramips-mt7621-tplink_re500-v1-squashfs-factory.bin
from the RE500 web interface.

TFTP recovery to stock firmware:

Unfortunately, I can't find an easy way to recover the RE
without opening the device and using modified binaries. The
TFTP upload will only work if selected from u-boot, which
means you have to open the device and attach to the serial
console. The TFTP update procedure does *not* accept the
published vendor firmware binaries. However, it allows to
flash kernel + rootfs binaries, and this works if you have
a backup of the original contents of the flash. It's probably
possible to create special image out of the vendor binaries
and use that as recovery image.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[remove dts-v1 in DTSI, do not touch WiFi LEDs for RE650, keep
state_default in DTS files, fix label-mac-device, use lower case
for WiFi LEDs]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agolantiq: dts: Move the &usb_vbus nodes out of &gpio
Martin Blumenstingl [Mon, 6 Jul 2020 17:46:34 +0000 (19:46 +0200)]
lantiq: dts: Move the &usb_vbus nodes out of &gpio

Move the USB VBUS regulator nodes out of the GPIO controller node. This
fixes a problem where the "regulator-fixed" driver wasn't probed for
these regulators because the GPIO driver doesn't scan the child-nodes
and based on the dt-bindings documentation it's not supposed to.

This fixed the following error reported by Luca Olivetti:
  ...
  dwc2 1e101000.usb: DWC OTG Controller
  dwc2 1e101000.usb: new USB bus registered, assigned bus number 1
  dwc2 1e101000.usb: irq 62, io mem 0x1e101000
  dwc2 1e101000.usb: startup error -517
  dwc2 1e101000.usb: USB bus 1 deregistered
  dwc2 1e101000.usb: dwc2_hcd_init() FAILED, returning -517

Fixes: FS#1634
Cc: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
3 years agoravpower-mcu: add missing PKG_RELEASE
David Bauer [Mon, 6 Jul 2020 14:02:15 +0000 (16:02 +0200)]
ravpower-mcu: add missing PKG_RELEASE

This fixes the imagebuilder for this device.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agokernel/pcengines-apu2: detect apuv4 board
Matthew Gyurgyik [Fri, 3 Jul 2020 21:08:25 +0000 (14:08 -0700)]
kernel/pcengines-apu2: detect apuv4 board

Upstream commit 3d00da1de3 ("platform/x86: pcengines-apuv2: detect apuv4
board")

On 5.4, this module fails on APUv4 due to non-matching DMI data. With this
patch, the module will match DMI data for the APUv4.

Signed-off-by: Matthew Gyurgyik <matthew@gyurgyik.io>
[include upstream patch description]
Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agolantiq: added switch-config for ARV752DPW
Lars Wessels [Sat, 4 Jul 2020 12:05:18 +0000 (14:05 +0200)]
lantiq: added switch-config for ARV752DPW

Add missing switch config (4 LAN-Ports + CPU).

Grey WAN port (used for ADSL) is not part of the switch.

Signed-off-by: Lars Wessels <software@bytebox.org>
[rework commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agolantiq: wifi mac fix for ARV752DPW
Lars Wessels [Sat, 4 Jul 2020 11:59:17 +0000 (13:59 +0200)]
lantiq: wifi mac fix for ARV752DPW

Set wifi mac from flash partition 'board_config' to
match the label on the device (Easybox 802).

Currently the wifi mac is always set to 00:0c:43:28:60:00.
eth0 and WiFi will now share the same mac (as in original firmware).

Signed-off-by: Lars Wessels <software@bytebox.org>
[improve commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agomac80211: allow ACS restriction with fixed channel
Jan Hoffmann [Fri, 3 Jul 2020 11:53:47 +0000 (13:53 +0200)]
mac80211: allow ACS restriction with fixed channel

This can be useful when a DFS channel is configured, as the ACS channel
list is taken into account when switching channels after a radar event.
For example, this allows to prevent the SRD channels from being used in
that case.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
[reorder structure]
Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoramips: reduce spi-max-frequency for ipTIME A8004T
Sunguk Lee [Thu, 2 Jul 2020 09:32:43 +0000 (18:32 +0900)]
ramips: reduce spi-max-frequency for ipTIME A8004T

Reduce spi-max-frequency for ipTIME A8004T and disable
m25p,fast-read option.

A8004T uses `en25qh128` for the MTD.
This flash memory would allow 80MHz, sometimes kernel received
wrong id value in initramfs installed router.
(kernel expected `1c 70 18 1c 70 18`, but one of cases, it
was `9c 70 18 1c 70 18`)

In this case, openwrt can't detect the partition information,
it would write the inccorect data to the firmware partition and
also it would occur the bootlooping after sysupgrade.

Signed-off-by: Sunguk Lee <d3m3vilurr@gmail.com>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoipq806x: move serial0 to DTSI files
Adrian Schmutzler [Fri, 3 Jul 2020 13:46:31 +0000 (15:46 +0200)]
ipq806x: move serial0 to DTSI files

All device DTS files in the target set the serial0 property to the
same value (*). So, let's move the definitions to the DTSI files.

That's also where the kernel defines it (qcom-ipq8064-v1.0.dtsi).

* The only exception is ipq8064-db149, which defines
  "serial0 = &uart2;", but inside a block called "alias" instead of
  "aliases". It must be assumed that this is broken anyway, so we
  don't touch it here.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>