Commit Graph

230 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
Felix Fietkau b0f7ea2853 kernel: unify CONFIG_GPIO_SYSFS in kernel configs
Enable it for all platforms

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Adrian Schmutzler 356866c481 target: replace remaining occurrences of ifconfig with ip
ifconfig is effectively deprecated for quite some time now. Let's
replace the remaining occurrences for our target setup by the
corresponding ip commands now.

Note that this does not touch ar71xx, as it will be dropped anyway,
and changing it would only make backports harder.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Christian Lamparter caa6ada969 apm821xx: disable WNDR4700 5.4 image
The compressed image that the buildbots are building is too large for
the netgear uboot and it crashes and soft-bricks the device.

| Uncompressing Kernel Image ...
| LZMA: uncompress or overwrite error 1 - must RESET board to recover

The whole target likely needs to be switched zImage which is a major
hassle due to powerpc's legacy bootwrapper setup as compared to ARM.
So for now, disable the device.

Reported-by: Wiktor Stasiak (FS#3258)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Adrian Schmutzler eff0a0e39e apm821xx: derive DEVICE_DTS from device name
The DEVICE_DTS variable always matches the device definition name,
just with "_" replaced by "-". Thus, create a DEVICE_DTS definition
in Device/Default and drop all the individual statements.

If necessary in the future, local DEVICE_DTS will still overwrite
that default.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Hauke Mehrtens 68d9cb8214 kernel: Update kernel 5.4 to version 5.4.50
Run tested: ath79, ipq40xx
Build tested: ath79, ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 6062d85892 kernel: Update kernel 4.19 to version 4.19.131
Fixes:
- CVE-2020-10757

The "mtd: rawnand: Pass a nand_chip object to nand_release()" commit was
backported which needed some adaptations to other code.

Run tested: ath79
Build tested: ath79

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Adrian Schmutzler 48c1fdd046 treewide: drop shebang from non-executable target files
This drops the shebang from all target files for /lib and
/etc/uci-defaults folders, as these are sourced and the shebang
is useless.

While at it, fix the executable flag on a few of these files.

This does not touch ar71xx, as this target is just used for
backporting now and applying cosmetic changes would just complicate
things.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 11db48f89a apm821xx: move device definitions to subfiles
With several subtargets, the image/Makefile becomes crowded after a
while. Many targets have moved their device definitions to $subtarget.mk
files to have them more organized, let's do this here as well.

While at it, also move subtarget-specific build recipes.

Cc: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Adrian Schmutzler 04373e20cb apm821xx: set DEVICE_TYPE to "nas" for sata subtarget
Since DEVICE_TYPE cannot be set per device, just set DEVICE_TYPE
to "nas" for the entire subtarget, which only contains this single
device.

Note that while this looks like a cosmetic change in combination
with the previous patches, this particular patch actually changes
the packages for the device.

Suggested-by: Christian Lamparter <chunkeey@gmail.com>
Cc: Christian Lamparter <chunkeey@gmail.com>
Cc: Sungbo Eo <mans0n@gorani.run>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 64ebf74c05 treewide: drop DEVICE_TYPE when used as device variable
DEVICE_TYPE is a target/subtarget variable, and it does not have
any effect when set in a device definition. It can only be set
in a target's or subtarget's Makefile.

Consequently, having it set anyway is misleading, so this drops
all cases.

This effectively reverts the following commits:
7a1497fd60 ("apm821xx: MBL: set DEVICE_TYPE to NAS")
5b4765c93a ("gemini: Classify Raidsonic NAS IB-4220-B as a NAS")
cdc6de460b ("gemini: D-Link DNS-313 is a NAS")

For the following commit, the variable was set when adding device
support:
27b2f0fc0f ("kirkwood: add support for Iomega Storcenter ix2-200")

Cc: Christian Lamparter <chunkeey@gmail.com>
Cc: Sungbo Eo <mans0n@gorani.run>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Petr Štetiar 5ea3ea154f kernel: bump 5.4 to 5.4.36
Refreshed patches, removed upstreamed patch:

 generic/hack: 551-loop-Better-discard-support-for-block-devices.patch

Added generic config symbol `ARM64_ERRATUM_1542419` due to Fixes:
f2791551cedb ("arm64: errata: Hide CTR_EL0.DIC on systems affected by
Neoverse-N1 #1542419").

Run tested: qemu-x86-64, apalis, nbg6617
Build tested: x86/64, imx6, ipq40xx, sunxi/a53

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Koen Vandeputte 3c3825436e kernel: bump 4.19 to 4.19.115
Refreshed all patches.

Remove upstreamed:
- 600-ipv6-addrconf-call-ipv6_mc_up-for-non-Ethernet-inter.patch
- 184-USB-serial-option-add-Wistron-Neweb-D19Q1.patch

Fixes:
- CVE-2020-8647
- CVE-2020-8648 (potentially)
- CVE-2020-8649

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Christian Lamparter 8ce138607e apm821xx: use the real default HZ value from upstream
With the "real HZ" debate out of the way, let's actually
use the apm821xx's default upstream config file at
arch/powerpc/configs/44x/bluestone_defconfig. From what
I can tell, it sets NO_HZ (well, this platform was for
NAS, so this is a bit unexpected) and remove any specific
HZ_$VALUE symbol.

Sadly, Daniel Engberg didn't run any before/after netperf
tests, because it would have been such a slam dunk across
the boards. In case of the apm821xx the tcp tx/rx
performance improved ~14% (from 600Mbps to 700Mps).
This now causes the emac to drop frames too, so let's see
if this is causes more problems or not.

This patch includes a refresh of the configuration too.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Daniel Engberg 3a761c90af treewide: Don't diverge from upstream default HZ settings on 4.19
Most targets upstream use 250Hz or even 1000Hz by default while
100Hz is hardcoded in OpenWrt's default config. Use upstream default
except for apm821xx which hardsets 1000Hz instead of platform default of
250Hz.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
[Apply same changes to 5.4]
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Petr Štetiar 5ecc0cfd6f kernel: bump 5.4 to 5.4.28
Changelog since 5.4.24 mentions CVE-2019-19769, CVE-2020-8648,
CVE-2020-8649 and CVE-2020-8647.

Removed upstreamed:

 generic: 507-v5.6-iio-chemical-sps30-fix-missing-triggered-buffer-depe.patch
 generic: 600-ipv6-addrconf-call-ipv6_mc_up-for-non-Ethernet-inter.patch
 bcm27xx: 950-0435-ASoC-pcm512x-Fix-unbalanced-regulator-enable-call-in.patch
 ipq806x: 701-stmmac-fix-notifier-registration.patch
 lantiq: 002-pinctrl-falcon-fix-syntax-error.patch
 octeontx: 0002-net-thunderx-workaround-BGX-TX-Underflow-issue.patch

Run tested: apu2, qemu-x86-64, apalis, a64-olinuxino, nbg6617
Build tested: sunxi/a53, imx6, x86/64, ipq40xx

Tested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> [apu2]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Christian Lamparter 8a92ae8e4b apm821xx: switch to 5.4 kernel
This patch switches the APM821XX target to the linux kernel 5.4 variant.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Christian Lamparter 3509d4ec56 apm821xx: wndr4700: add preliminary drivetemp sensor
This patch prepares the WNDR4700 to use the HDD sensor for
the thermal zone. While the kernel's thermal.txt device-tree
binding documentation files talks about supporting multiple
sensors for a zone. This sadly is NOT the case. Even the most
current upstream kernels (5.6-rc) supports just >one< sensor
per zone: (driver/base/of-thermal.c:886)
| * REVIST: for now, the thermal framework supports only
| * one sensor per thermal zone. Thus, we are considering
| * only the first two values as slope and offset.

I do hope that this warning will prevent others wasteing time
on trying to figure out why their multi-sensor thermal-zones
definitions are not working as specified.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Christian Lamparter 01fe7a2b64 apm821xx: add drivetemp sensor for the WD MyBook Series
This patch adds the hwmon-drivetemp to the device.
It also adds device-tree bindings. This can be useful to
automate external fans which can be controlled for example
by either an unused sata-port or by the usb-power regulator.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Sungbo Eo 3f14f034fb 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 ago
Petr Štetiar 9ba09653ad 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 ago
Christian Lamparter b052b62efc apm821xx: 4.14: remove kernel config and patches
This patch removes the 4.14 kernel support from the apm821xx target.
The 4.19 kernel has been available and stable for a while and the 5.4
kernel support has been tested successfully on real hardware as well.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Sungbo Eo 90daff4cf8 build: image: move IMAGE_SIZE to image.mk
IMAGE_SIZE is widely used in many targets. Declare it in the default template to
clean up redundant code. This also prevents deriving IMAGE_SIZE unintentionally
from the previously defined device.

While at it, remove duplicate KERNEL_SIZE declaration.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Yousong Zhou 860652f4b9 kernel: 5.4: move some kconfig options to generic
CONFIG_64BIT_TIME=y
	CONFIG_KASAN_STACK=1
	CONFIG_UBSAN_ALIGNMENT=y
	CONFIG_UNIX_SCM=y
	CONFIG_DMA_DECLARE_COHERENT=y
	CONFIG_OF_RESERVED_MEM=y

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years ago
Koen Vandeputte f9f62d43e4 kernel: bump 5.4 to 5.4.24
Refreshed all patches.

Compile-tested on: imx6
Runtime-tested on: imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte e64564920a kernel: bump 4.19 to 4.19.108
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte d5a3536631 kernel: bump 4.14 to 4.14.172
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
David Bauer 0d727f231f treewide: move commonly disabled symbols to generic config
Move new commonly disabled kernel 5.4 symbols to the generic kernel
configuration.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Christian Lamparter 1c880f2324 apm821xx: remove gpio-interrupt cruft
This hunk became obsolete the moment when our
gpio-button-hotplug learned how to deal with
interrupt-supported gpio buttons. The gpio driver
never supported interrupt handling, so these
properties never served any use (outside of a
enhanced ppc4xx-gpio driver that was dropped).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Christian Lamparter a2ae9a07d2 apm821xx: 5.4: add important NAND symbols
This patch adds important NAND config symbols.
These are necessary as otherwise the devices
won't find the rootfs on the NAND chips.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
David Bauer 53ab9865c2 ath79: add support for kernel 5.4
Signed-off-by: David Bauer <mail@david-bauer.net>
[refreshed]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>

* Sync the patches with the changes done for kernel 4.19
* Use KERNEL_TESTING_PATCHVER
* Refresh the configuration
* Fix multiple compile bugs in the patches
* Only add own ag71xx files for kernel 4.19 and use upstream version for
  5.4.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Christian Lamparter e1e6ff6648 apm821xx: add linux kernel 5.4 testing support
This patch adds support for the linux kernel version 5.4
as an optional testing kernel.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Koen Vandeputte 20b5a4ca01 kernel: bump 4.19 to 4.19.101
Refreshed all patches.

Fixes:
- CVE-2019-14896
- CVE-2019-14897

Remove upstreamed:
- 023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch
- 950-0202-staging-bcm2835-camera-fix-module-autoloading.patch
- 001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 1b310cff0f kernel: bump 4.14 to 4.14.169
Refreshed all patches.

Fixes:
- CVE-2019-14896
- CVE-2019-14897

Remove upstreamed:
- 023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch
- 001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Rosen Penev 3c42293937 apm821xx: mbl_gen_hdd_img.sh: switch to /bin/sh
Nothing here needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Koen Vandeputte e115fa478f kernel: bump 4.19 to 4.19.90
Refreshed all patches.

Remove upstreamed:
- 010-dmaengine-dw-dmac-implement-dma-prot.patch
- 950-0148-Increase-firmware-call-buffer-size-to-48-bytes.patch
- 950-0206-Mailbox-firmware-calls-now-use-kmalloc-2749.patch
- 402-leds-trigger-netdev-fix-handling-on-interface-rename.patch

Fixes:
- CVE-2019-19332

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[Add 010-dt-bindings-dmaengine-dw-dmac-add-protection-control.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Koen Vandeputte 7604e53d5f kernel: bump 4.14 to 4.14.159
Refreshed all patches.

Remove upstreamed:
- 302-0002-dmaengine-dw-implement-per-channel-protection-contro.patch

Fixes:
- CVE-2019-19332

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Petr Štetiar 3bbcffa0b6 treewide: kernel config: remove runtime options
Remove CC_HAS_ASM_GOTO, CC_IS_GCC and GCC_VERSION kernel config options
which are set at runtime and which should be ignored now.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler 2c60de0e3f treewide: move MAC address patch functions to common library
This unifies MAC address patch functions and moves them to a
common script. While those were implemented differently for
different targets, they all seem to do the same. The number of
different variants is significantly reduced by this patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 5b6a809092 treewide: move calibration data extraction function to library
This moves the almost identical calibration data extraction
functions present multiple times in several targets to a single
library file /lib/functions/caldata.sh.

Functions are renamed with more generic names to merge different
variants that only differ in their names.

Most of the targets used find_mtd_chardev, while some used
find_mtd_part inside the extraction code. To merge them, the more
abundant version with find_mtd_chardev is used in the common code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[rebase on latest master; add mpc85xx]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler c5b4fa20fa treewide: replace backticks by $(...) in gen_*_img.sh scripts
This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[decapitalized patch subject at submitter's request]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter 95f2bb24be apm821xx: fix fan control on highest step
This patch removes a typo (extra "0") so that the 'cpu-alert6'
step is triggered once the system reaches 85°C.

Note: Unless the WNDR4700 is placed in an hot oven, the
hardware-monitor will never reach this value.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Russell Senior a03219ba09 apm821xx: remove unnecessary kernel padding
The allocation of LEBs to ubi volumes is handled by the sysupgrade script:

  package/base-files/files/lib/upgrade/nand.sh

and the ubimkvol and or ubirsvol command. Therefore, padding of the
kernel blob is not needed at all, so use cat instead of dd. The
BLOCKSIZE variable was only used in the dd command.  In any case, 63k
made no sense for the way BLOCKSIZE was being used.

63k (64512) does make sense for DTB_SIZE because of the offsets expected
by u-boot given extant u-boot-env variables.

Tested on Meraki MR24.

Signed-off-by: Russell Senior <russell@personaltelco.net>
5 years ago
Yousong Zhou a089d55170 apm821xx: image: remove unused kernel.dtb from IMAGES
It's a leftover from 2271967f ("apm821xx: utilize build ARTIFACTs")

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Rafał Miłecki 641f6b6c26 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable
It's a variable set by procd that should replace hardcoded
/tmp/sysupgrade.tgz.

This change requires the most recent procd with the commit 0f3c136
("sysupgrade: set UPGRADE_BACKUP env variable").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 62dbe361a1 treewide: when copying a backup file always specify dest name
$CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz.
This change makes code more generic and allows refactoring $CONF_TAR.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki bf39047872 treewide: don't hardcode "sysupgrade.tgz" file name
1) Add BACKUP_FILE and use it when copying an archive to be restored
   after sysupgrade (on the next preinit).
2) Use CONF_TAR for copying backup prepared by the /sbin/sysupgrade

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki b6f4cd57e1 treewide: sysupgrade: pass "save_partitions" option to the "sysupgrade" method
This explicitly lets stage2 know if partitions should be preserved. No
more "touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap" hack.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Adrian Schmutzler b133e466b0
treewide: convert WiFi caldata size and offset to hexadecimal
This changes size and offset set for WiFi caldata extraction and
MAC address adjustment to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-cal-data in DTS files.

Since dd cannot deal with hexadecimal notation, one has to convert
back to decimal by simple $(($hexnum)).

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 75bfc393ba treewide: convert MAC address location offsets to hexadecimal
This changes the offsets for the MAC address location in
mtd_get_mac_binary* and mtd_get_mac_text to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-mac-address in DTS files.

(e.g. 0x1006 and 0x5006 are much more useful than 4102 and 20486)

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Koen Vandeputte 42d9bccadb kernel: bump 4.19 to 4.19.64
Refreshed all patches.

Remove upstreamed:
- 100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch
- 950-0309-usb-dwc2-Disable-all-EP-s-on-disconnect.patch
- 950-0310-usb-dwc2-Fix-disable-all-EP-s-on-disconnect.patch

Fixes:
- CVE-2019-13648
- CVE-2019-3900
- CVE-2019-10207

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago