openwrt/staging/robimarko.git
4 years agox86: geode/legacy: fix missing watchdog core dependencies
Christian Lamparter [Sun, 22 Mar 2020 19:39:16 +0000 (20:39 +0100)]
x86: geode/legacy: fix missing watchdog core dependencies

This patch follows the other patches that added the watchdog
core to various (armvirt, malta, ath79, ...) targets that
have been hit by the following build error:

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

In theory, we could have just added the CONFIG_WATCHDOG_CORE=y
to the Kconfig variable of kmod-hwmon-sch5627's package definition.
This would have forced the watchdog core to be builtin and less
architectures would need to be updated. But we might as well follow
through here.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years agodnsmasq: add 'scriptarp' option
Jordan Sokolic [Thu, 19 Mar 2020 12:23:22 +0000 (14:23 +0200)]
dnsmasq: add 'scriptarp' option

Add option 'scriptarp' to uci dnsmasq config to enable --script-arp functions.
The default setting is false, meaning any scripts in `/etc/hotplug.d/neigh` intended
to be triggered by `/usr/lib/dnsmasq/dhcp-script.sh` will fail to execute.

Also enable --script-arp if has_handlers returns true.

Signed-off-by: Jordan Sokolic <oofnik@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
4 years agoath79: fix missing return statement in ar934x_nand
David Bauer [Sun, 22 Mar 2020 19:06:23 +0000 (20:06 +0100)]
ath79: fix missing return statement in ar934x_nand

The reset assert and deassert methods currently miss
a return value, leading to a compilation warning.

Return the return-value of reset_control_assert and
reset_control_deassert to fix these warnings.

Suggested-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoath79: fix NAND driver compilation for kernel 5.4
David Bauer [Tue, 17 Mar 2020 20:59:27 +0000 (21:59 +0100)]
ath79: fix NAND driver compilation for kernel 5.4

This fixes the compilation of the AR934x NAND controller
driver for kernel 5.4 while leaving it untouched for
kernel 4.19.

This change is currently not run-tested, as i do not have such
a device at hand.

CC: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
CC: André Valentin <avalentin@marcant.net>
CC: WeiDong Jia <jwdsccd@gmail.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years agooxnas: yet another irqchip related patch
Daniel Golle [Sun, 22 Mar 2020 13:30:22 +0000 (13:30 +0000)]
oxnas: yet another irqchip related patch

This time DTS fix, again from Sungbo Eo <mans0n@gorani.run>
  ARM: dts: oxnas: Fix clear-mask property

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoiwinfo: update to latest Git HEAD
David Bauer [Sun, 22 Mar 2020 00:34:56 +0000 (01:34 +0100)]
iwinfo: update to latest Git HEAD

9f5a7c4 iwinfo: add missing HT modename for HT-None
06a03c9 Revert "iwinfo: add BSS load element to scan result"
9a4bae8 iwinfo: add device id for Qualcomm Atheros QCA9990
eba5a20 iwinfo: add device id for BCM43602
a6914dc iwinfo: add BSS load element to scan result
bb21698 iwinfo: add device id for Atheros AR9287
7483398 iwinfo: add device id for MediaTek MT7615E

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoath79: align Ubiquiti AC Pro ethernet map to factory
David Bauer [Thu, 19 Mar 2020 09:33:20 +0000 (10:33 +0100)]
ath79: align Ubiquiti AC Pro ethernet map to factory

The Uniquiti AC Pro and Ubiquiti AC Mesh Pro currently have the
"Primary" and "Secondary" ethernet ports configured to offer LAN as well
as WAN. However, Uiquiti describes the following behavior for the
devices Ethernet ports:

 > Secondary UniFi Access Point (UAP) Ethernet ports don't
 > provide PoE passthrough (to run current to a second powered
 > device), but they do support data passthrough.
 > It serves as a bridged interface between main / secondary
 > Ethernet port.

To reduce confusion for users (as LAN and WAN functionality is not
visible on the device itself), configure both ports to offer LAN
functionality. Users can still configure a WAN interface on a port they
are able to choose.

CC: Lucian Cristian <lucian.cristian@gmail.com>
Reported-by: Florian Klink <flokli@flokli.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agotools: squashfskit4: fix build with GCC10
Robert Marko [Thu, 19 Mar 2020 11:22:07 +0000 (12:22 +0100)]
tools: squashfskit4: fix build with GCC10

In order to build squashfskit with GCC10, this backport from upstream is needed.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
[increase PKG_RELEASE]
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
4 years agosquashfskit4/Makefile: introduce PKG_RELEASE=1
Alexander Couzens [Sun, 22 Mar 2020 01:03:19 +0000 (02:03 +0100)]
squashfskit4/Makefile: introduce PKG_RELEASE=1

When adding patches, the PKG_RELEASE should be increased.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
4 years agoath79: add support for Ubiquiti NanoBridge M (XM)
Roger Pueyo Centelles [Sun, 15 Mar 2020 17:20:03 +0000 (18:20 +0100)]
ath79: add support for Ubiquiti NanoBridge M (XM)

This patch adds support for the Ubiquiti NanoBridge M (XM), a
802.11n wireless with a feed+dish form factor, with the same board
definition as the Bullet M (XM).

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

Flashing via stock GUI:
 - WARNING: flashing OpenWrt from AirOS v5.6 or newer will brick your
   device! Read the wiki for more info.
 - Downgrade to AirOS v5.5.x (latest available is 5.5.11) first.
 - Upload the factory image via AirOS web GUI.

Flashing via TFTP:
 - WARNING: flashing OpenWrt from AirOS v5.6 or newer will brick your
   device! Read the wiki for more info.
 - Downgrade to AirOS v5.5.x (latest available is 5.5.11) first.
 - Use a pointy tool (e.g., pen cap, slotted screwdriver) to keep the
   reset button pressed.
 - Power on the device (keep reset button pressed).
 - Keep pressing until LEDs flash alternatively LED1+LED3 =>
   LED2+LED4 => LED1+LED3, etc.
 - Release reset button.
 - The device starts a TFTP server at 192.168.1.20.
 - Set a static IP on the computer (e.g., 192.168.1.21/24).
 - Upload via tftp the factory image:
    $ tftp 192.168.1.20
    tftp> bin
    tftp> trace
    tftp> put openwrt-ath79-generic-xxxxx-ubnt_nanobridge-m-squashfs-factory.bin

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
[rebase, fix includes in DTS, add label MAC address, add SOC and
fix sorting in generic-ubnt.mk]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agosamba36: log error if getting device info failed
Rafał Miłecki [Mon, 30 Dec 2019 06:54:53 +0000 (07:54 +0100)]
samba36: log error if getting device info failed

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agobcm53xx: sysupgrade: optimize building UBI image
Rafał Miłecki [Thu, 20 Feb 2020 12:40:55 +0000 (13:40 +0100)]
bcm53xx: sysupgrade: optimize building UBI image

Use "truncate" to adjust size of existing file instead of "dd" which
required creating a copy. This saves space on tmpfs. It may be as low
as 2.1 MiB when using OpenWrt default user space and way more (20+ MiB)
when flashing vendor firmware.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agobusybox: enable truncate on bcm53xx target
Rafał Miłecki [Thu, 20 Feb 2020 12:40:54 +0000 (13:40 +0100)]
busybox: enable truncate on bcm53xx target

It's needed for optimized sysupgrade. On host machine this change
increased busybox size by 4096 B.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agotreewide: omit IMAGE_SIZE argument from check-size
Sungbo Eo [Tue, 10 Mar 2020 13:58:27 +0000 (22:58 +0900)]
treewide: omit IMAGE_SIZE argument from check-size

Now that check-size uses IMAGE_SIZE by default, we can skip the argument from
image recipes to reduce redundancy.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[do not touch ar71xx]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobuild: image: set default parameter for check-size
Sungbo Eo [Tue, 10 Mar 2020 13:58:00 +0000 (22:58 +0900)]
build: image: set default parameter for check-size

In most cases check-size is used with IMAGE_SIZE and vice versa. Let check-size
use IMAGE_SIZE by default.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agotreewide: gather DEVICE_VARS into one place
Sungbo Eo [Tue, 10 Mar 2020 06:41:09 +0000 (15:41 +0900)]
treewide: gather DEVICE_VARS into one place

Place DEVICE_VARS assignments at the top of the file or above Device/Default
to make them easier to find.

For ramips, remove redundant values already present in parent file.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[do not touch ar71xx, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for ubnt_bullet-m-ar7240 variant
Russell Senior [Thu, 19 Mar 2020 11:27:28 +0000 (04:27 -0700)]
ath79: add support for ubnt_bullet-m-ar7240 variant

This adds support for the Ubiquiti Bullet M (AR7240).

Specifications:
- AR7240 SoC @ 400 MHz
- 32 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- External antenna
- POWER/LAN green LEDs
- 4x RSSI LEDs (red, orange, green, green)
- UART (115200 8N1) on PCB

Flashing via WebUI:
  Upload the factory image via the stock firmware web UI.

  Attention: airOS firmware versions >= 5.6 have a new bootloader with
  an incompatible partition table!

  Please downgrade to <= 5.5 _before_ flashing OpenWrt!
  Refer to the device's Wiki page for further information.

Flashing via TFTP:
  Same procedure as other Ubiquiti M boards.

- Use a pointy tool (e.g., pen cap, paper clip) and keep the reset
  button on the device or on the PoE supply pressed
- Power on the device via PoE (keep reset button pressed)
- Keep pressing until LEDs flash alternatively LED1+LED3 =>
  LED2+LED4 => LED1+LED3, etc.
- Release reset button
- The device starts a TFTP server at 192.168.1.20
- Set a static IP on the computer (e.g., 192.168.1.21/24)
- Upload via tftp the factory image:
  $ tftp 192.168.1.20
  tftp> bin
  tftp> trace
  tftp> put openwrt-ath79-generic-xxxxx-ubnt_bullet-m-ar7240-squashfs-factory.bin

The "fixed-link" section of the device tree is needed to avoid errors like this:

  Generic PHY mdio.0:1f:04: Master/Slave resolution failed, maybe conflicting manual settings?

With "fixed-link", the errors go away and eth0 comes up reliably.

Signed-off-by: Russell Senior <russell@personaltelco.net>
[fix SUPPORTED_DEVICES]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agogemini: Bump kernel to v5.4
Linus Walleij [Sat, 21 Mar 2020 13:05:55 +0000 (14:05 +0100)]
gemini: Bump kernel to v5.4

The v5.4 kernel already works much better than v4.19
as so many things got upstreamed so let's just bump
it to kernel v5.4.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 years agogemini: Add kernel config for kernel v5.4
Linus Walleij [Sat, 21 Mar 2020 13:05:54 +0000 (14:05 +0100)]
gemini: Add kernel config for kernel v5.4

This adds a kernel config file for the v5.4 gemini
kernel.

No major changes compared to v4.19, mainly
CONFIG_MTD_PHYSMAP_OF_GEMINI was renamed to
CONFIG_MTD_PHYSMAP_GEMINI.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[select UNWINDER_ARM, set CONFIG_DRM_FBDEV_OVERALLOC, drop
dropped 4.19 symbols, kernel config refreshed]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years agogemini: Add v5.4 kernel patches
Linus Walleij [Sat, 21 Mar 2020 13:05:53 +0000 (14:05 +0100)]
gemini: Add v5.4 kernel patches

This adds the kernel patches needed for the Gemini.
Just 7 patches, 5 of them are already upstream.

Notably we incorperate the temperature sensor on the
hard drive to drive temperature control of the NAS
chassis. This is required for the DIR-685 which has
no external temperature sensor.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[use the drivetemp package over the backport]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years agokernel: 5.4: disable more symbols
Christian Lamparter [Sat, 21 Mar 2020 15:39:40 +0000 (16:39 +0100)]
kernel: 5.4: disable more symbols

These have been discovered by the gemini 5.4 patches.
This is because one of the devices uses the FBDEV emulation.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years agokernel: backport and package drivetemp hwmon from v5.5
Christian Lamparter [Fri, 28 Feb 2020 22:42:50 +0000 (23:42 +0100)]
kernel: backport and package drivetemp hwmon from v5.5

This patch backports the hwmon drivetemp sensor module from vanilla
linux 5.5 to be available on OpenWrt's 5.4 kernel.

Extract from The upstream commit by Guenter Roeck <linux@roeck-us.net>:
hwmon: Driver for disk and solid state drives with temperature sensors

"Reading the temperature of ATA drives has been supported for years
by userspace tools such as smarttools or hddtemp. The downside of
such tools is that they need to run with super-user privilege, that
the temperatures are not reported by standard tools such as 'sensors'
or 'libsensors', and that drive temperatures are not available for use
in the kernel's thermal subsystem.

This driver solves this problem by adding support for reading the
temperature of ATA drives from the kernel using the hwmon API and
by adding a temperature zone for each drive.

With this driver, the hard disk temperature can be read [...]
using sysfs:

$ grep . /sys/class/hwmon/hwmon9/{name,temp1_input}
/sys/class/hwmon/hwmon9/name:drivetemp
/sys/class/hwmon/hwmon9/temp1_input:23000

If the drive supports SCT transport and reports temperature limits,
those are reported as well.

drivetemp-scsi-0-0
Adapter: SCSI adapter
temp1:        +27.0<C2><B0>C (low  =  +0.0<C2><B0>C, high = +60.0<C2><B0>C)
                             (crit low = -41.0<C2><B0>C, crit = +85.0<C2><B0>C)
                             (lowest = +23.0<C2><B0>C, highest = +34.0<C2><B0>C)

The driver attempts to use SCT Command Transport to read the drive
temperature. If the SCT Command Transport feature set is not available,
or if it does not report the drive temperature, drive temperatures may
be readable through SMART attributes. Since SMART attributes are not well
defined, this method is only used as fallback mechanism."

This patch incorperates a patch made by Linus Walleij:
820-libata-Assign-OF-node-to-the-SCSI-device.patch
This patch is necessary in order to wire-up the drivetemp
sensor into the device tree's thermal-zones.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years agoopenssl: update to 1.1.1e
Eneas U de Queiroz [Thu, 19 Mar 2020 19:12:15 +0000 (16:12 -0300)]
openssl: update to 1.1.1e

This version includes bug and security fixes, including medium-severity
CVE-2019-1551, affecting RSA1024, RSA1536, DSA1024 & DH512 on x86_64.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
4 years agoopenssl: add configuration example for afalg-sync
Eneas U de Queiroz [Thu, 19 Mar 2020 19:12:14 +0000 (16:12 -0300)]
openssl: add configuration example for afalg-sync

This adds commented configuration help for the alternate, afalg-sync
engine to /etc/ssl/openssl.cnf.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
4 years agooxnas: backport another fix for irqchip
Daniel Golle [Sat, 21 Mar 2020 14:25:09 +0000 (14:25 +0000)]
oxnas: backport another fix for irqchip

Sungbo Eo <mans0n@gorani.run> submitted another patch fixing an error
on reboot:
  irqchip/versatile-fpga: Apply clear-mask earlier

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoscripts: fixup qemustart for new x86 image names
Paul Spooren [Fri, 20 Mar 2020 10:10:59 +0000 (00:10 -1000)]
scripts: fixup qemustart for new x86 image names

qemustart allows easy testing of created images via `qemu`. The script
automatically selects created images and can setup e.g. networks.

As the x86 target now uses the generic image.mk the profile appears also
in the image name, this is *generic*.

Add the profile name to the qemustart script so it still finds the file.

Signed-off-by: Paul Spooren <mail@aparcar.org>
4 years agox86: allow non gzipped images
Paul Spooren [Fri, 20 Mar 2020 10:10:58 +0000 (00:10 -1000)]
x86: allow non gzipped images

The previous image generation code would always gzipped images.

This patch changes the behaviour and only compresses images when
selected in menuconfig.

Signed-off-by: Paul Spooren <mail@aparcar.org>
4 years agox86: use qemu-image command from image-commands.mk
Paul Spooren [Fri, 20 Mar 2020 10:10:57 +0000 (00:10 -1000)]
x86: use qemu-image command from image-commands.mk

The `qemu-image` command converts images to the specified type and
reduces redundant code.

Adaption from Alexander Couzens <lynxis@fe80.eu> work[0].

[0]: https://git.openwrt.org/?p=openwrt/staging/lynxis.git;a=blob;f=target/linux/x86/image/Makefile;h=83b8140b7aefbe708fd09c9c61827e7e39bda8b4;hb=416cccf398e9589e3de386e05b61b1c46cace20d#l51

Signed-off-by: Paul Spooren <mail@aparcar.org>
4 years agox86: remove obsolete legacy profiles
Paul Spooren [Fri, 20 Mar 2020 10:10:56 +0000 (00:10 -1000)]
x86: remove obsolete legacy profiles

Rely on device profiles instead for packages selection.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[rebase, adjusted commit title]
Signed-off-by: Paul Spooren <mail@aparcar.org>
4 years agox86: switch image generation to new code
Paul Spooren [Fri, 20 Mar 2020 10:10:55 +0000 (00:10 -1000)]
x86: switch image generation to new code

This commit introduces few related changes which need to be done in
single commit to keep images buildable between git revisions. In result
it retains all previous image creation possibilities with slight name
change of generated images. Brief summary of the commit:

* Split up image generation recipe to smaller chunks to make it more
  generic and reusable.

* Make iso images x86 specific and drop their definition as root
  filesystem.

* Convert image creation process to generic code specified in image.mk.

* Make geode subtarget inherit features from the main target instead of
  redefining them.

* For subtargets create device definitions with basic packages set.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[rebased]
Signed-off-by: Paul Spooren <mail@aparcar.org>
4 years agox86/grub2: move grub2 image creation to package
Paul Spooren [Fri, 20 Mar 2020 10:10:54 +0000 (00:10 -1000)]
x86/grub2: move grub2 image creation to package

Let the grub2 package take care of creating installable grub2 images,
this will allow creating grub2 images without first calling x86 image
generation recipe. Also as side effect, since those images are now
shared, it'll reduce the number of calling grub-mkimage.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[rebase, adjusted commit title]
Signed-off-by: Paul Spooren <mail@aparcar.org>
4 years agokernel: connmark set-dscpmark fix build on 5.4
Kevin Darbyshire-Bryant [Sat, 21 Mar 2020 09:25:49 +0000 (09:25 +0000)]
kernel: connmark set-dscpmark fix build on 5.4

Fix header change that was done for kernel but 4.19 got missed for 5.4.

Solves nasty errors like:

8.4.0_musl/include/linux/netfilter/xt_CONNMARK.h:5,
                from connmark_listener.c:30:
/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/include/linux/netfilter/xt_connmark.h:23:2: error: enumerator value for 'XT_CONNMARK_VALUE' is not an integer constant
 XT_CONNMARK_VALUE = BIT(0),
 ^~~~~~~~~~~~~~~~~
/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/include/linux/netfilter/xt_connmark.h:25:1: error: enumerator value for 'XT_CONNMARK_DSCP' is not an integer constant
};

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agowireguard: bump to 0.0.20200318
Jason A. Donenfeld [Sat, 21 Mar 2020 02:12:53 +0000 (20:12 -0600)]
wireguard: bump to 0.0.20200318

WireGuard had a brief professional security audit. The auditors didn't find
any vulnerabilities, but they did suggest one defense-in-depth suggestion to
protect against potential API misuse down the road, mentioned below. This
compat snapshot corresponds with the patches I just pushed to Dave for
5.6-rc7.

* curve25519-x86_64: avoid use of r12

This buys us 100 extra cycles, which isn't much, but it winds up being even
faster on PaX kernels, which use r12 as a RAP register.

* wireguard: queueing: account for skb->protocol==0

This is the defense-in-depth change. We deal with skb->protocol==0 just fine,
but the advice to deal explicitly with it seems like a good idea.

* receive: remove dead code from default packet type case

A default case of a particular switch statement should never be hit, so
instead of printing a pretty debug message there, we full-on WARN(), so that
we get bug reports.

* noise: error out precomputed DH during handshake rather than config

All peer keys will now be addable, even if they're low order. However, no
handshake messages will be produced successfully. This is a more consistent
behavior with other low order keys, where the handshake just won't complete if
they're being used anywhere.

* send: use normaler alignment formula from upstream

We're trying to keep a minimal delta with upstream for the compat backport.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agowireguard-tools: bump to 1.0.20200319
Jason A. Donenfeld [Sat, 21 Mar 2020 02:12:17 +0000 (20:12 -0600)]
wireguard-tools: bump to 1.0.20200319

* netlink: initialize mostly unused field
* curve25519: squelch warnings on clang

Code quality improvements.

* man: fix grammar in wg(8) and wg-quick(8)
* man: backlink wg-quick(8) in wg(8)
* man: add a warning to the SaveConfig description

Man page improvements. We hope to rewrite our man pages in mdocml at some
point soon.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agomediatek: move mt76 and wpad-bacic to mt7622 subtarget
Chuanhong Guo [Fri, 20 Mar 2020 12:58:49 +0000 (20:58 +0800)]
mediatek: move mt76 and wpad-bacic to mt7622 subtarget

mt76 is a target default package for mt7622-wmac only.
mt7623 doesn't have integrated wireless support and wifi drivers for
pcie cards should be added as device specific package.
mt7629-wmac isn't supported by mt76 yet.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agomediatek: mt7629: fix firmware partition
Chuanhong Guo [Fri, 20 Mar 2020 11:36:30 +0000 (19:36 +0800)]
mediatek: mt7629: fix firmware partition

rename "kernel" partition in upstream dts to "firmware" and add
denx,fit as compatible string for mtdsplit.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agomediatek: backport spi-mem based mtk spinor driver
Chuanhong Guo [Fri, 20 Mar 2020 11:26:45 +0000 (19:26 +0800)]
mediatek: backport spi-mem based mtk spinor driver

This new driver has full quadspi and DMA support, providing way better
reading performance.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agomediatek: mt7629: refresh config for linux 5.4
Chuanhong Guo [Fri, 20 Mar 2020 11:23:01 +0000 (19:23 +0800)]
mediatek: mt7629: refresh config for linux 5.4

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agomediatek: mt7629: fix ethernet default config
Chuanhong Guo [Fri, 20 Mar 2020 10:08:00 +0000 (18:08 +0800)]
mediatek: mt7629: fix ethernet default config

1. fix typo: ucidef_set_interfaces_wan -> ucidef_set_interface_wan
2. change board name to mt7629-rfb to match upstream dts

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agokernel: load rtl8366_smi and rtl8367b on boot
Luiz Angelo Daros de Luca [Sat, 1 Feb 2020 03:51:59 +0000 (00:51 -0300)]
kernel: load rtl8366_smi and rtl8367b on boot

This external switch driver should be loaded on boot for network support
in failsafe mode.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
[alter commit message]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agokernel: rtl8367b: add configuration for extif2
Serge Vasilugin [Mon, 16 Mar 2020 08:28:38 +0000 (16:28 +0800)]
kernel: rtl8367b: add configuration for extif2

Both rtl8367b and rtl8367s have two extended interface
rtl8367rb: 5 port + 2*RGMII/MII
rtl8367s:  5 port + SGMII/HSGMI + RGMII/MII
(?)rtl8367sb:  5 port + 2*RGMII/MII
These interfaces correspond to EXT1 and EXT2 (ports 6 and 7 respectivly).

This patch allow to configure EXT2 in dts-file:

rtl8367rb {
compatible = "realtek,rtl8367b";
cpu_port = <7>;
realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
mii-bus = <&mdio0>;
phy_id = <29>;
};

Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru>
[fix indent, replace magic value, alter commit message]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agogeneric: rtl8367b: add definition of debug reg
Chuanhong Guo [Mon, 16 Mar 2020 08:04:09 +0000 (16:04 +0800)]
generic: rtl8367b: add definition of debug reg

This commit adds definition of DEBUG0 and DEBUG1 registers and replace
magic values with proper register modifying.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agomac80211: do not try to setup hostapd-managed interfaces.
Oldřich Jedlička [Mon, 16 Mar 2020 20:00:51 +0000 (21:00 +0100)]
mac80211: do not try to setup hostapd-managed interfaces.

For virtual access points (when multiple SSIDs are used for one
physical AP), there exist one physical network interface and
multiple virtual interfaces, which are fully under control of
hostapd. When networking is setup, the script
`/lib/netifd/wireless/mac80211.sh` is called, which tries to bring
the interface up by a call to `ip link set dev <iface> up`. This
call might fail for virtual APs, because the virtual interface
might not have been created by hostapd yet. There are some artifical
delays in the script most probably to handle this, but when DFS
channel availability check on 5GHz band is issued, hostapd can
delay creating virtual interfaces by a minute.

In order to fix this (or work around it), do not try to bring the
interface up (this is responsibility of hostapd anyway) and
do not try to set txpower on the virtual interface.

Fixes FS#2698.

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
4 years agox86: make crashdump works
Chen Minqiang [Thu, 11 Jul 2019 14:34:03 +0000 (22:34 +0800)]
x86: make crashdump works

1. KERNEL_CRASH_DUMP should depends on KERNEL_PROC_KCORE (kexec use it)
2. select crashkernel mem size by totalmem
   mem <= 256M disable crashkernel by default
   mem >= 4G use 256M for crashkernel
   mem >= 8G use 512M for crashkernel
   default use 128M
3. set BOOT_IMAGE in kdump.init
4. resolve a "Unhandled rela relocation: R_X86_64_PLT32" error

Tested on x86_64

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
4 years agoreadline: needs host depend on ncurses to build
Jan Kardell [Fri, 20 Mar 2020 13:32:23 +0000 (14:32 +0100)]
readline: needs host depend on ncurses to build

We must ensure that host ncurses is build before host readline.

Signed-off-by: Jan Kardell <jan.kardell@telliq.com>
4 years agooxnas: backport patch fixing hang after reboot
Daniel Golle [Thu, 19 Mar 2020 22:37:17 +0000 (22:37 +0000)]
oxnas: backport patch fixing hang after reboot

Sungbo Eo <mans0n@gorani.run> posted a patch fixing the long-standing
reboot problem on the OXNAS OX820 platform:
  irqchip/versatile-fpga: Handle chained IRQs properly

It got queued for 5.7. Import it to oxnas target patches for now.

Fixes: b4917fa907 ("oxnas: fix oxnas-rps-timer dt-match")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agotoolchain: Update GCC 9 to version 9.3.0
Hauke Mehrtens [Sun, 15 Mar 2020 17:32:56 +0000 (18:32 +0100)]
toolchain: Update GCC 9 to version 9.3.0

The removed patch is included in GCC 9.3.0.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agotoolchain: Update GCC 8 to version 8.4.0
Hauke Mehrtens [Sun, 15 Mar 2020 17:12:26 +0000 (18:12 +0100)]
toolchain: Update GCC 8 to version 8.4.0

The removed patch is included in GCC 8.4.0.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agocryptodev-linux: Fix error when compiling with 5.4 kernel
Jeffery To [Tue, 17 Mar 2020 14:27:13 +0000 (22:27 +0800)]
cryptodev-linux: Fix error when compiling with 5.4 kernel

Currently, cryptodev-linux fails to compile with a
'"crypto_givcipher_type" undefined' error for targets on the 5.4 kernel,
e.g. armvirt[1].

This backports an upstream patch[2] that fixes this error.

[1]: https://downloads.openwrt.org/snapshots/faillogs/aarch64_generic/base/cryptodev-linux/compile.txt
[2]: https://github.com/cryptodev-linux/cryptodev-linux/commit/f971e0cd4a0ebe59fb2e8e17240399bf6901b09b

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
4 years agohostapd: fix segfault in wpa_supplicant ubus
Daniel Golle [Wed, 18 Mar 2020 17:58:43 +0000 (18:58 +0100)]
hostapd: fix segfault in wpa_supplicant ubus

When introducing ubus reload support, ubus initialization was moved
to the service level instead of being carried out when adding a BSS
configuration. While this works when using wpa_supplicant in that way,
it breaks the ability to run wpa_supplicant on the command line, eg.
for debugging purposes.
Fix that by re-introducing ubus context intialization when adding
configuration.

Reported-by: @PolynomialDivision https://github.com/openwrt/openwrt/pull/2417
Fixes: 60fb4c92b6 ("hostapd: add ubus reload")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: add support for TP-Link Archer D7/D7b v1
Davide Fioravanti [Sun, 19 Jan 2020 20:05:31 +0000 (21:05 +0100)]
ath79: add support for TP-Link Archer D7/D7b v1

TP-Link Archer D7 v1 is a dual-band AC1750 router + modem.
The router section is based on Qualcomm/Atheros QCA9558 + QCA9880.
The "DSL" section is based on BCM6318 but it's currently not supported.

The Archer D7b seems to differ from the Archer D7 only in the
partition table.

Router section - Specification:

775/650/258 MHz (CPU/DDR/AHB)
128 MB of RAM (DDR2)
16 MB of FLASH (SPI NOR)
3T3R 2.4 GHz
3T3R 5 GHz
4x 10/100/1000 Mbps Ethernet
7x LED, 2x button
UART header on PCB

Known issues:

- Broadband LED (missing GPIO - probably driven by the BCM6318)
- Internet LED (missing GPIO - probably driven by the BCM6318)
- WIFI LED (working only for one interface at a time, while in the
  OEM firmware works for both wifi interfaces; thus, this patch does
  not set a trigger by default)
- DSL not working (eth0)

UART connection
---------------
J1 HEADER (Qualcomm CPU)
. VCC
. GND
. RX
O TX

J41 HEADER (Broadcom CPU)
. VCC
. GND
. RX
O TX

The following instructions require a connection to the J1 UART header
and are tested for the Archer D7 v1.
For the Archer D7b v1, names should be changed accordingly.

Flash instructions under U-Boot, using UART
------------------------------------------
 1. Press "tpl" to stop autobooting and obtain U-Boot CLI access.
 2. Setup ip addresses for U-Boot and your tftp server.
 3. Issue below commands:
tftpboot 0x81000000 openwrt-ath79-generic-tplink_archer-d7-v1-squashfs-sysupgrade.bin
erase 0x9f020000 +f90000
cp.b 0x81000000 0x9f020000 0xf90000
reset

Initramfs instructions under U-Boot for testing, using UART
----------------------------------------------------------
 1. Press "tpl" to stop autobooting and obtain U-Boot CLI access.
 2. Setup ip addresses for U-Boot and your tftp server.
 3. Issue below commands:
tftpboot 0x81000000 openwrt-ath79-generic-tplink_archer-d7-v1-initramfs-kernel.bin
bootm 0x81000000
 4. Here you can backup the original firmware and/or flash the sysupgrade openwrt if you want

Restore the original firmware
-----------------------------
 0. Backup every partition using the OpenWrt web interface
 1. Download the OEM firmware from the TP-Link website
 2. Extract the bin file in a folder (eg. Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin)
 3. Remove the U-Boot and the Broadcom image part from the file.
    Issue the following command:
dd if="Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin" of="Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin.mod" skip=257 bs=512 count=31872
 4. Double check the .mod file size. It must be 16318464 bytes.
 5. Flash it using the OpenWrt web interface. Force the update if needed.
    WARNING: Remember to NOT keep settings.

 5b. (Alternative to 5.) Flash it using the U-Boot and UART connection.
     Issue below commands in the U-Boot:
tftpboot 0x81000000 Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin.mod
erase 0x9f020000 +f90000
cp.b 0x81000000 0x9f020000 0xf90000
reset

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
[cosmetic DTS changes, remove TPLINK_HWREVADD := 0, do not use two
phyXtpt at once, add missing buttons, minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for TP-Link Archer C60 v3
Adrian Schmutzler [Wed, 12 Feb 2020 13:43:15 +0000 (14:43 +0100)]
ath79: add support for TP-Link Archer C60 v3

TP-Link Archer C60 v3 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561 + QCA9886.

It seems to be identical to the v2 revision, except that
it lacks a WPS LED and has different GPIO for amber WAN LED.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 6x LED, 2x button
- UART header on PCB

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed IP address 192.168.0.66
2. Download *-factory.bin image and rename it to tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root
   directory
4. Turn off the router
5. Press and hold reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time the firmware should
   be transferred from the tftp server
8. Wait ~30 second to complete recovery

While TFTP works for OpenWrt images, my device didn't accept the
only available official firmware "Archer C60(EU)_V3.0_190115.bin".

In contrast to earlier revisions (v2), the v3 contains the (same)
MAC address twice, once in 0x1fa08 and again in 0x1fb08.
While the partition-table on the device refers to the latter, the
firmware image contains a different partition-table for that region:

name           device            firmware
factory-boot   0x00000-0x1fb00   0x00000-0x1fa00
default-mac    0x1fb00-0x1fd00   0x1fa00-0x1fc00
pin            0x1fd00-0x1fe00   0x1fc00-0x1fd00
product-info   0x1fe00-0x1ff00   0x1fd00-0x1ff00
device-id      0x1ff00-0x20000   0x1ff00-0x20000

While the MAC address is present twice, other data like the PIN isn't,
so with the partitioning from the firmware image the PIN on the device
would actually be outside of its partition.
Consequently, the patch uses the MAC location from the device (which
is the same as for the v2).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: rename ubnt_bullet-m to ubnt_bullet-m-ar7241
Russell Senior [Wed, 11 Mar 2020 01:06:03 +0000 (18:06 -0700)]
ath79: rename ubnt_bullet-m to ubnt_bullet-m-ar7241

Since there exists another variant of the Bullet M with AR7240 SoC
under the same name, this patch introduces the SoC into the device
name to be able to distinguish these variants.

Signed-off-by: Russell Senior <russell@personaltelco.net>
[add commit message, adjust model in DTS, fix 02_network and
SUPPORTED_DEVICES]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: generalize ubnt_xm dtsi for ar7240 and ar7241
Russell Senior [Wed, 11 Mar 2020 01:06:02 +0000 (18:06 -0700)]
ath79: generalize ubnt_xm dtsi for ar7240 and ar7241

* Prepare to support the AR7240 variant of ubiquiti bullet m, by
  reorganizing the related dtsi files.

* Distribute SOC variable across ubnt-xm devices.

Signed-off-by: Russell Senior <russell@personaltelco.net>
4 years agobcm27xx: enable THERMAL_WRITABLE_TRIPS on bcm2710 and bcm2711
Bjørn Mork [Mon, 16 Mar 2020 19:39:29 +0000 (20:39 +0100)]
bcm27xx: enable THERMAL_WRITABLE_TRIPS on bcm2710 and bcm2711

The PoE hat supported on the RPi 3B+ and 4B comes with a rather
loud fan, tripped in two steps by the brcmstb_thermal
thermal_zone driver.  Enabling writable trip points allow
users to adjust the fan trip points according to their
preferred temp/noise ratio.

This setting is enabled on most other targets with similar
thermal_zone controlled cooling devices.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
4 years agoramips: do not add metadata to factory images
Mathias Kresin [Sun, 5 Jan 2020 08:19:37 +0000 (09:19 +0100)]
ramips: do not add metadata to factory images

The image metadata are openwrt specific and not required for factory
images.

Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agolantiq: kernel 5.4: enable JFFS2
Mathias Kresin [Tue, 17 Mar 2020 19:36:39 +0000 (20:36 +0100)]
lantiq: kernel 5.4: enable JFFS2

We do not build images with a jffs2 rootfs, but jffs2 is still used as
filesystem for the rootfs_data.

Fixes: e3eaf578082e ("lantiq: kernel 5.4: debloat kernel config")
Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agoath79: fix execute bit for 02_network on mikrotik subtarget
Adrian Schmutzler [Tue, 17 Mar 2020 18:24:29 +0000 (19:24 +0100)]
ath79: fix execute bit for 02_network on mikrotik subtarget

When creating the mikrotik subtarget, the execute bit on 02_network
was not set. Fix it.

Fixes: a66eee63368e ("ath79: add mikrotik subtarget")
Reported-by: Christopher Hill <ch6574@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: get rid of BOARD_NAME for Mikrotik RouterBOARD
Adrian Schmutzler [Wed, 26 Feb 2020 14:53:30 +0000 (15:53 +0100)]
ath79: get rid of BOARD_NAME for Mikrotik RouterBOARD

So far, specifying "BOARD_NAME := routerboard" is required by the
upgrade code of Mikrotik NAND devices, as "sysupgrade-routerboard"
is hardcoded in platform_do_upgrade_mikrotik_nand().

This patch replaces the latter with a grep for the name like it
is already done in nand_upgrade_tar() in /lib/upgrade/nand.sh.

By that, BOARD_NAME is obsolete now for this device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoar71xx: remove hard-coded folder name from Mikrotik RB upgrade
Adrian Schmutzler [Wed, 26 Feb 2020 17:24:55 +0000 (18:24 +0100)]
ar71xx: remove hard-coded folder name from Mikrotik RB upgrade

So far, specifying "BOARD_NAME := routerboard" is required by the
upgrade code of Mikrotik NAND devices, as "sysupgrade-routerboard"
is hardcoded in platform_do_upgrade_mikrotik_rb().

This patch replaces the latter with a grep for the name like it
is already done in nand_upgrade_tar() in /lib/upgrade/nand.sh.

This should enable upgrades from ar71xx to ath79 without setting
BOARD_NAME for the latter.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add mikrotik subtarget
Roger Pueyo Centelles [Fri, 28 Feb 2020 15:01:02 +0000 (16:01 +0100)]
ath79: add mikrotik subtarget

This commit creates the ath79/mikrotik subtarget in order to support
MikroTik devices based on Qualcomm Atheros MIPS SoCs.

MikroTik devices need a couple of specific features: the split MiNOR
firmware MTD format, which is not used by other devices, and the 4k
sector erase size on SPI NOR storage, which can not be added to the
ath79/generic and ath79/nand subtargets now.

Additionally, the commit moves the two MikroTik devices already in
the generic and nand subtargets to this new one.

Tested on the RB922 board and the wAP AC router.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years agohostapd: fix pointer cast warnings
Leon M. George [Thu, 12 Mar 2020 23:02:37 +0000 (00:02 +0100)]
hostapd: fix pointer cast warnings

Signed-off-by: Leon M. George <leon@georgemail.eu>
4 years agohostapd: remove trailing whitespace
Leon M. George [Thu, 12 Mar 2020 21:56:58 +0000 (22:56 +0100)]
hostapd: remove trailing whitespace

Signed-off-by: Leon M. George <leon@georgemail.eu>
4 years agooxnas: enable sata on Pogoplug V3/Pro
Sungbo Eo [Tue, 17 Mar 2020 08:34:27 +0000 (17:34 +0900)]
oxnas: enable sata on Pogoplug V3/Pro

Pogoplug V3/Pro has an interanl SATA port. To use it, DTS sata node should be
enabled, and kmod-ata-oxnas-sata package needs to be installed.

Fixes: FS#2542
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agotegra: switch to kernel 5.4
Tomasz Maciej Nowak [Mon, 16 Mar 2020 18:32:10 +0000 (19:32 +0100)]
tegra: switch to kernel 5.4

Build the latest kernel by default, since testing did not show any
regressions.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[fix merge conflict in tegra/Makefile]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agotegra: refresh patches and kernel config for 5.4
Tomasz Maciej Nowak [Mon, 16 Mar 2020 18:32:09 +0000 (19:32 +0100)]
tegra: refresh patches and kernel config for 5.4

This commit also disables Trusted Foundations firmware support as this
feature won't be used by any device.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[fix merge conflict in tegra/Makefile]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agotegra: copy kernel config and patches for 5.4
Tomasz Maciej Nowak [Mon, 16 Mar 2020 18:32:08 +0000 (19:32 +0100)]
tegra: copy kernel config and patches for 5.4

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years agokernel: move TEO governor to generic config
Tomasz Maciej Nowak [Mon, 16 Mar 2020 18:32:07 +0000 (19:32 +0100)]
kernel: move TEO governor to generic config

This new symbol popped up in few places. Disable it in generic config.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[fixed merge conflict in generic/config-5.4]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agomxs: fix user led for OLinuXino boards
Michael Heimpold [Mon, 16 Mar 2020 21:47:44 +0000 (22:47 +0100)]
mxs: fix user led for OLinuXino boards

More testing after kernel upgrade to 5.4 uncovered a regression: the user
led is not present anymore due to a pin mux "collision" in device tree.

A patch sent to upstream kernel was accepted now. Integrate this
pending fix as platform specific patch so that user led is available again.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
4 years agozynq: switch to kernel 5.4
Luis Araneda [Fri, 13 Mar 2020 03:23:13 +0000 (00:23 -0300)]
zynq: switch to kernel 5.4

Use kernel 5.4 by default

compile-tested: all devices from target
run-tested: Digilent Zybo Z7-20

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
4 years agozynq: refresh kernel 5.4 config
Luis Araneda [Fri, 13 Mar 2020 03:23:12 +0000 (00:23 -0300)]
zynq: refresh kernel 5.4 config

By running make kernel_oldconfig and selecting relevant options

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
4 years agozynq: copy config from kernel 4.19 to 5.4
Luis Araneda [Fri, 13 Mar 2020 03:23:11 +0000 (00:23 -0300)]
zynq: copy config from kernel 4.19 to 5.4

Refreshed kernel 4.19 config before copying the file

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
4 years agolantiq: kernel 5.4: debloat kernel config
Mathias Kresin [Thu, 12 Mar 2020 09:41:20 +0000 (10:41 +0100)]
lantiq: kernel 5.4: debloat kernel config

The etop driver is used by all targets except xrx200.

Remove the UBIFS compression support for zlib and zstd from the xway
subtarget. The hardware is EOL for a long time and it's unlikely to ever
see a board shipped with an UBIFS using these compression methods.

Remove the JFFS2 support. Support for jjfs2 images was dropped years
ago.

It shrinks the compressed kernel up to 130 KByte.

Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agolantiq: add Linux 5.4 support as testing kernel version
Mathias Kresin [Wed, 10 Jul 2019 10:29:03 +0000 (12:29 +0200)]
lantiq: add Linux 5.4 support as testing kernel version

Switch to the mainline Lantiq PCIe PHY driver and update the vr9.dtsi
accordingly.

The Lantiq IRQ SMP support added upstream required changes to the SoC
dtsi as well.

Following changes are made to the Lantiq kernel patches:

  0005-lantiq_etop-pass-struct-device-to-DMA-API-functions.patch
  0006-MIPS-lantiq-pass-struct-device-to-DMA-API-functions.patch
    applied upstream

  0008-MIPS-lantiq-backport-old-timer-code.patch
    access_ok API update because it lost it's type (which was the first)
    parameter in upstream commit 96d4f267e40f95 ("Remove 'type' argument
    from access_ok() function")

  0024-MIPS-lantiq-autoselect-soc-rev-matching-fw.patch
    merged into 0026-MIPS-lantiq-Add-GPHY-Firmware-loader.patch

  0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch
    revert upstream changes required for upstream xrx200 ethernet and
    xrx200 (DSA) switch driver but breaking our driver

  0026-MIPS-lantiq-Add-GPHY-Firmware-loader.patch
    required for our driver but dropped upstream, add former upstream
    version

  0028-NET-lantiq-various-etop-fixes.patch
    now has to use the phy_set_max_speed API instead of modifying
    phydev->supported. Also call ltq_dma_enable_irq() in
    ltq_etop_open() based on upstream commit cc973aecf0b054 ("MIPS:
    lantiq: Do not enable IRQs in dma open")

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years agolantiq: linux 5.4: remove support for the linux,mtd-name OF property
Martin Blumenstingl [Sat, 29 Feb 2020 21:44:55 +0000 (22:44 +0100)]
lantiq: linux 5.4: remove support for the linux,mtd-name OF property

This is referenced in two .dts but never actually used from userspace.
Drop support for this property because it's not used and because it
makes updating to Linux 5.4 harder (as the patch doesn't apply anymore).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years agolantiq: copy target to kernel 5.4
Mathias Kresin [Sun, 1 Mar 2020 07:09:19 +0000 (08:09 +0100)]
lantiq: copy target to kernel 5.4

Duplicate kernel 4.19 config and patches for kernel 5.4.

Duplicate the devicetree source files as well, they need kernel 5.4
specific adjustments.

Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agolantiq: ltq-tapi: fix compilation with newer Linux kernels
Martin Blumenstingl [Sat, 29 Feb 2020 21:38:26 +0000 (22:38 +0100)]
lantiq: ltq-tapi: fix compilation with newer Linux kernels

Compiling the ltq-tapi driver against Linux 5.4 results in a compile
error complaining that the size of struct sched_param is not known.
Switch the existing "sched/types.h" include to reference
include/uapi/linux/sched/types.h to fix compilation against Linux 5.4.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years agolantiq: ltq-deu: fix compatibility with Linux 5.3+
Martin Blumenstingl [Sat, 29 Feb 2020 20:17:21 +0000 (21:17 +0100)]
lantiq: ltq-deu: fix compatibility with Linux 5.3+

Upstream commit 84ede58dfcd1d ("crypto: hash - remove
CRYPTO_ALG_TYPE_DIGEST") drops the CRYPTO_ALG_TYPE_DIGEST define because
it has the same value as CRYPTO_ALG_TYPE_HASH. This was the case for
earlier kernels as well. Switch to CRYPTO_ALG_TYPE_HASH to fix building
against Linux 5.4.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years agolantiq: ltq-vdsl: fix compilation with Linux 5.0+
Martin Blumenstingl [Sat, 29 Feb 2020 21:36:29 +0000 (22:36 +0100)]
lantiq: ltq-vdsl: fix compilation with Linux 5.0+

Upstream commit e4b92b108c6cd6 ("timekeeping: remove obsolete time
accessors") removed do_gettimeofday(). In Linux 4.19 this was only a
wrapper around ktime_get_real_ts64(). Use ktime_get_real_ts64() now that
the wrapper is gone to fix compilation against Linux 5.4.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 years agoltq-adsl: fix compilation with Linux 5.0+
Mathias Kresin [Tue, 3 Mar 2020 23:39:59 +0000 (00:39 +0100)]
ltq-adsl: fix compilation with Linux 5.0+

Upstream commit e4b92b108c6cd6 ("timekeeping: remove obsolete time
accessors") removed do_gettimeofday(). In Linux 4.19 this was only a
wrapper around ktime_get_real_ts64(). Use ktime_get_real_ts64() now that
the wrapper is gone to fix compilation against Linux 5.4.

Move the ifxmips_mei_interface header to the include directory, it can't
be found otherwise during compilation. The reason for the changed
behaviour is not yet clear, however having header files in an include
directory is more straight forward.

To use the of_device_id struct, the mod_devicetable header need to be
included. Instead of including this header, include the of_platform
header, which includes the mod_devicetable on its own.

Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agoltq-atm: add Linux 5.0+ compatibility
Mathias Kresin [Sun, 7 Jul 2019 15:13:18 +0000 (17:13 +0200)]
ltq-atm: add Linux 5.0+ compatibility

Upstream commit 96d4f267e40f95 ("Remove 'type' argument from access_ok()
function") removes the first argument to access_ok.
Adjust the code so it builds with Linux 5.4.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agokernel: kmod-serial-8250: fix linux 5.3 dependencies
Mathias Kresin [Mon, 16 Mar 2020 20:16:07 +0000 (21:16 +0100)]
kernel: kmod-serial-8250: fix linux 5.3 dependencies

Beginning with linux 5.3, kmod-serial-8250 uses functions provided by
serial_mctrl_gpio.ko if GPIO support is enabled.

Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agogeneric: make all phy drivers kernel 5.0 compatible
Mathias Kresin [Sun, 7 Jul 2019 09:15:05 +0000 (11:15 +0200)]
generic: make all phy drivers kernel 5.0 compatible

It adjusts the code to upstream changes from the commit 3c1bcc8614db
("net: ethernet: Convert phydev advertize and supported from u32 to link
 mode")

Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agolantiq: vgv7510kw22: fix missing wireless
Mathias Kresin [Sun, 15 Mar 2020 22:54:47 +0000 (23:54 +0100)]
lantiq: vgv7510kw22: fix missing wireless

For some reason pin 7 (gphy0_led1_pins) need to be set to output prior
to loading the PCI driver. Otherwise the wireless doesn't appear on the
PCI bus. Of course, it doesn't make much sense, since pin 7 is used to
drive the LAN1 led.

It can either be done by setting the pins function to GPHY or GPIO +
direction output. However, the pinctrl driver doesn't provide a way to
switch a pin to GPIO. It is done indirectly by the pinctrl driver at the
time a GPIO is requested (requesting a GPIO always resets the function
to GPIO).

Do it via pinmux driver, as it is always loaded first. Use the GPHY
function as it's the pins intended purpose for this board.

Fixes: FS#2895
Signed-off-by: Mathias Kresin <dev@kresin.me>
4 years agotreewide: remove maintainer variable from targets
Petr Štetiar [Wed, 11 Mar 2020 14:04:37 +0000 (15:04 +0100)]
treewide: remove maintainer variable from targets

There is no such role as target maintainer anymore, one should always
send corresponding changes for the review and anyone from the commiters
is allowed to merge them or eventually use the hand break and NACK them.

Lets make it clear, that it is solely a community doing the maintenance
tasks.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Piotr Dymacz <pepe2k@gmail.com>
4 years agoipq40xx: 5.4: fix ethernet driver
Robert Marko [Tue, 3 Mar 2020 19:19:31 +0000 (20:19 +0100)]
ipq40xx: 5.4: fix ethernet driver

In 5.4 kernel old u32 array way of setting network features was dropped and linkmode is now the only way.
So lets migrate the EDMA driver to support linkmode.
Also, old get/set settings API for ethtool is also dropped so lets convert to new ksettings API while at it as it demands linkmode.

Now, gigabit works properly as well as ethtool.
Previously you would get this in ethtool:
root@OpenWrt:/# ethtool eth1
Settings for eth1:
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes

Now, features are properly advertised:
root@OpenWrt:/# ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 4
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
4 years agoipq40xx: 5.4: fix networking PHY driver
Robert Marko [Tue, 3 Mar 2020 19:19:30 +0000 (20:19 +0100)]
ipq40xx: 5.4: fix networking PHY driver

In 5.4 kernel old u32 array way of setting network features was dropped and linkmode is now the only way.
So lets migrate the PHY driver to support linkmode.
Also, now in order for gigabit to work, PHY driver needs to advertise PHY_GBIT_FEATURES instead of PHY_BASIC_FEATURES

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
4 years agoipq40xx: 5.4: fix of_get_mac_address obsolete usage OOPs
Petr Štetiar [Mon, 16 Mar 2020 08:43:00 +0000 (09:43 +0100)]
ipq40xx: 5.4: fix of_get_mac_address obsolete usage OOPs

of_get_mac_address returns valid pointer or ERR_PTR since 5.2 via commit
d01f449c008a ("of_net: add NVMEM support to of_get_mac_address") so the
patch fixes following OOPs on nbg6617:

 Unable to handle kernel paging request at virtual address ffffffed
 CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.4.24 #0
 PC is at edma_axi_probe+0x444/0x1114
 LR is at bus_find_device+0x88/0x9c

Where the PC can be resolved to:

 >>> l *edma_axi_probe+0x444
 0xc067be5c is in edma_axi_probe (./include/linux/string.h:378).

 >>> l *edma_axi_probe+0x43f
 0xc067be57 is in edma_axi_probe (drivers/net/ethernet/qualcomm/essedma/edma_axi.c:936)

Which leads to the following code fragment:

 935  mac_addr = of_get_mac_address(pnp);
 936  if (mac_addr)
 937      memcpy(edma_netdev[idx_mac]->dev_addr, mac_addr, ETH_ALEN);

Where using mac_addr=0xffffffed (-ENODEV) as source address in memcpy()
is causing the OOPs.

Acked-by: John Crispin <john@phrozen.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agosunxi: add testing 5.4 kernel
Aleksander Jan Bajkowski [Mon, 9 Mar 2020 21:58:32 +0000 (22:58 +0100)]
sunxi: add testing 5.4 kernel

Add 5.4 as testing kernel.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agosunxi: move common options from subtargets into target kconfig
Aleksander Jan Bajkowski [Tue, 10 Mar 2020 21:59:20 +0000 (22:59 +0100)]
sunxi: move common options from subtargets into target kconfig

These new options are common for all subtargets and can be moved into target kconfig.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agosunxi: refresh config for all subtargets
Aleksander Jan Bajkowski [Tue, 10 Mar 2020 21:50:17 +0000 (22:50 +0100)]
sunxi: refresh config for all subtargets

This was done by executing these command for all subtargets:

$ time make -j9 kernel_oldconfig CONFIG_TARGET=subtarget

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agosunxi: remove old symbols from 5.4 kconfig
Aleksander Jan Bajkowski [Tue, 10 Mar 2020 21:39:59 +0000 (22:39 +0100)]
sunxi: remove old symbols from 5.4 kconfig

These options only exist earlier kernel versions.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agosunxi: remove options that are already in generic kconfig
Aleksander Jan Bajkowski [Tue, 10 Mar 2020 21:25:22 +0000 (22:25 +0100)]
sunxi: remove options that are already in generic kconfig

These options are already definied in generic 5.4 kconfig.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agokernel: move disabled symbols into generic kconfig
Aleksander Jan Bajkowski [Mon, 9 Mar 2020 21:57:31 +0000 (22:57 +0100)]
kernel: move disabled symbols into generic kconfig

Move some disabled kconfig options found in sunxi kconfig into generic.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agosunxi: make patches apply cleanly on 5.4
Aleksander Jan Bajkowski [Mon, 9 Mar 2020 21:56:07 +0000 (22:56 +0100)]
sunxi: make patches apply cleanly on 5.4

These patches are already in mainline 5.4 kernel:
* 010-v5.3-drivers-ata-ahci_sunxi-Increased-SATA-AHCI-DMA-TX-RX.patch
* 101-arm64-dts-allwinner-a64-Enable-A64-timer-workaround.patch

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agosunxi: copy config and patches from 4.19 to 5.4
Aleksander Jan Bajkowski [Mon, 2 Mar 2020 18:32:34 +0000 (19:32 +0100)]
sunxi: copy config and patches from 4.19 to 5.4

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agokernel: sort generic configuration
Aleksander Jan Bajkowski [Thu, 12 Mar 2020 22:40:51 +0000 (23:40 +0100)]
kernel: sort generic configuration

This was done by executing these commands:

$ ./scripts/kconfig.pl '+' target/linux/generic/config-4.19 /dev/null > target/linux/generic/config-4.19-new
$ mv target/linux/generic/config-4.19-new target/linux/generic/config-4.19

$ ./scripts/kconfig.pl '+' target/linux/generic/config-5.4 /dev/null > target/linux/generic/config-5.4-new
$ mv target/linux/generic/config-5.4-new target/linux/generic/config-5.4

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agox86: switch to 5.4 kernel
Petr Štetiar [Wed, 11 Mar 2020 11:21:49 +0000 (12:21 +0100)]
x86: switch to 5.4 kernel

Seems to be working fine on apu2 and QEMU, it's 99.9% upstream stuff
anyway. Lets start wider userbase testing.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoimx6: switch to 5.4 kernel
Petr Štetiar [Wed, 11 Mar 2020 11:21:49 +0000 (12:21 +0100)]
imx6: switch to 5.4 kernel

Seems to be working fine, it's 99.9% upstream stuff anyway. Lets start
wider userbase testing.

Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agorpcd: fix respawn settings
Petr Štetiar [Thu, 5 Mar 2020 08:33:52 +0000 (09:33 +0100)]
rpcd: fix respawn settings

Commit 432ec292ccc8 ("rpcd: add respawn param") has introduced infinite
restarting of the service which could be reached over network. This is
not recommended security practice as it might give potential adversary
infinite number of tries in case there might be some issue in the rpcd
or its surrounding stack.

So lets remove the currently bogus `respawn_retry` variable (it wasn't
possible to override it anyway), reverting to the previous default max.
of 5 service restarts which could be now overriden via system's UCI
settings if desired.

Cc: Jo-Philip Wich <jow@mein.io>
Cc: Florian Eckert <fe@dev.tdt.de>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Fixes: 432ec292ccc8 ("rpcd: add respawn param")
Signed-off-by: Petr Štetiar <ynezz@true.cz>