Commit Graph

96 Commits

Author SHA1 Message Date
Tony Ambardar
3d66f55161 kernel: improve handling of CONFIG_IO_URING
Kernel setting CONFIG_IO_URING supports high-performance I/O for file
access and servers, generally for more performant platforms, and adds
~45 KB to kernel sizes. The need for this on less "beefy" devices is
questionable, as is the size cost considering many platforms have kernel
size limits which require tricky repartitioning if outgrown. The size
cost is also large relative to the ~180 KB bump expected between major
OpenWRT kernel releases.

No OpenWrt packages have hard dependencies on this; samba4 and mariadb
can take advantage if available (+KERNEL_IO_URING:liburing) but
otherwise build and work fine.

Since CONFIG_IO_URING is already managed via the KERNEL_IO_URING setting
in Config-kernel.in (default Y), remove it from those target configs
which unconditionally enable it, and update the defaults to enable it
conditionally only on more powerful 64-bit x86 and arm devices. It may
still be manually enabled as needed for high-performance custom builds.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2023-05-03 10:26:17 -07:00
Hauke Mehrtens
7815c55f7d kernel: Deactivate CONFIG_COMPAT
This deactivates the CONFIG_COMPAT kernel option.
With CONFIG_COMPAT the kernel will provide syscall interfaces for arm32
binaries in addition to the interfaces needed for arm64 binaries.

In OpenWrt the complete userspace is compiled for this specific
architecture and support for 32 bit ARM applications is not needed.
This reduces the size and the attack surface for the systems.

On all other targets CONFIG_COMPAT is already deactivated.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Hauke Mehrtens
0fc3a4aa10 kernel: Deactivate CONFIG_LEGACY_PTYS
The legacy (BSD) PTY support could open security problems in a system,
We do not need them in OpenWrt, deactivate this option in all targets.

Debian also deactivates this option.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Hauke Mehrtens
ca5555d27e kernel: Activate CONFIG_ARM64_SW_TTBR0_PAN
This activates the CONFIG_ARM64_SW_TTBR0_PAN option for all arm64
kernels by default.

The CONFIG_ARM64_SW_TTBR0_PAN option prevents the kernel form accessing
user space memory directly. This makes it harder to exploit the kernel.

This is activated by default and was already activate on all other arm64
targets before.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Hauke Mehrtens
626b37d70a kernel: Activate CONFIG_HARDENED_USERCOPY for all targets
This activates CONFIG_HARDENED_USERCOPY for the remaining targets. This
adds additional checks in the copy_from_user() and copy_to_user()
functions.

This was not activated for ARCHS38 before because of a bug in the Linux
kernel 5.4 till 5.14, which as fixed and is described here:
https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/15

I do not know why this was deactivated for mt7629 and rockchip.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Rafał Miłecki
69ea580882 treewide: update NVMEM symbols
Fixes: 8dfe69cdfc ("kernel: update nvmem subsystem to the latest upstream")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-01-07 01:30:31 +01:00
Jan-Niklas Burfeind
c7d3bbb909 sunxi: ensure NanoPi R1 has unique MAC address
Ensure the MAC address for all NanoPi R1 boards is assigned uniquely for
each board.

The vendor ships the device in two variants; one with and one without
eMMC; but both without static mac-addresses.
In order to assign both board types unique MAC addresses, fall back on
the same method used for the NanoPi R2S and R4S in case the EEPROM
chip is not present by generating the board MAC from the SD card CID.

[0] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R1#Hardware_Spec

Similar too and based on:

commit b5675f500d ("rockchip: ensure NanoPi R4S has unique MAC address")

Co-authored-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2022-12-25 02:27:55 +01:00
John Audia
90120a1552 kernel: bump 5.10 to 5.10.159
Removed upstreamed:
	backport-5.10/888-v6.1-ca8210-Fix-crash-by-zero-initializing-data.patch[1]

All patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.159&id=0a8e66e375736ea12c11f0ef238ba2a8efec460b

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-12-14 23:37:28 +01:00
Kien Truong
d11d93b9ae rockchip: enable watchdog driver
Enable Synopsys DesignWare watchdog driver for rockchip device

Tested on NanoPi R2S

Signed-off-by: Kien Truong <duckientruong@gmail.com>
2022-12-04 15:21:12 +08:00
Chuanhong Guo
c984fc7624
rockchip: use LZMA FIT for kernel image
Use LZMA compressed kernel to save some space in boot partition.

Fixes: #11197
Tested-by: Tianling Shen <cnsztl@immortalwrt.org> [NanoPi R2S]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-11-14 22:50:21 +08:00
John Audia
af1e3439a8 rockchip: armv8: add CONFIG_ARM64_ERRATUM_1742098
5.15.76 introduces a new symbol that applies Cortex-A72 SoCs so enable it[1].

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/arch/arm64/Kconfig?id=v5.15.76&id2=v5.15.75

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-10-30 17:55:00 +01:00
Aleksander Jan Bajkowski
9226f1e419
kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config
Endianness depends on CPU architecture. CONFIG_CPU_(BIG/LITTLE)_ENDIAN should
be enabled on target or subtarget based on SoC architecture.

Fixes warning:
$ make kernel_oldconfig CONFIG_TARGET=subtarget
...
.config:1008:warning: override: CPU_LITTLE_ENDIAN changes choice state
....

Summary:
- ARC - only the CONFIG_CPU_BIG_ENDIAN symbol is defined for this architeture.
  If it is disabled then the processor operates in LITTLE_ENDIAN mode (default),
- ARM32 - CONFIG_CPU_LITTLE_ENDIAN symbol available since kernel 5.19. This
  option should be enabled after OpenWRT moves to kernel 6.x. After refreshing
  the kernel, the symbol disappears,
- ARM64 - enabled CONFIG_CPU_LITTLE_ENDIAN,
- MIPS - enabled relevant symbols,
- POWERPC -  enabled CONFIG_CPU_BIG_ENDIAN,
- UML - Symbols are not defined for this architecture,
- X86 - always little endian. Symbols are not defined for this architecture.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2022-10-21 13:47:01 +02:00
Tomas Lara
2b4f12e55b rockchip: switch to 5.15 kernel
Run tested: NanoPI R4S

Signed-off-by: Tomas Lara <tl849670@gmail.com>
2022-10-02 23:07:50 +02:00
Tomas Lara
c4f0781eae rockchip: refresh kernel 5.15 config
Refreshed using make kernel oldconfig CONFIG TARGET=rockchip .

Signed-off-by: Tomas Lara <tl849670@gmail.com>
2022-10-02 23:07:50 +02:00
Hauke Mehrtens
f08f7e88c9 kernel: Move some IOMMU options to generic
This adds some missing IOMMU related options for x86/64 and moves some
of them to generic for all targets.

On x86 IOMMU_DEFAULT_DMA_LAZY is used by default, on all other platforms
IOMMU_DEFAULT_DMA_STRICT is the default. we just follow the default
kernel configuration here.

Fixes: 8fea4a102c ("x86/64: enable IOMMU support")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-09-24 13:49:47 +02:00
David Bauer
1588069612 rockchip: add system-LED aliases specific to OpenWrt
Add the aliases sections required to detect LEDs specific to OpenWrt
boot / update indication for the NanoPi R4S.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-09-10 01:55:54 +02:00
David Bauer
b5675f500d rockchip: ensure NanoPi R4S has unique MAC address
Ensure the MAC address for all NanoPi R4S boards is assigned unique for
each board.

FriendlyElec ship two versions of the R4S: The standard as well as the
enterprise edition with only the enterprise edition including the EEPROM
chip that stores the unique MAC address.

In order to assign both board types unique MAC addresses, fall back on
the same method used for the NanoPi R2S in case the EEPROM chip is not
present by generating the board MAC from the SD card CID.

[0] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R4S#Differences_Between_R4S_Standard_Version_.26_R4S_Enterprise_Version

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-09-10 01:54:40 +02:00
Hauke Mehrtens
ff06edd1f0 kernel: Activate CONFIG_GPIOLIB in generic configuration
All targets expect the malta target already activate the CONFIG_GPIOLIB
option. Move it to generic kernel configuration and also activate it for
malta.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-08-10 21:36:17 +02:00
Hauke Mehrtens
0e3bafc601 kernel: Activate CONFIG_INPUT_MISC on all targets
CONFIG_INPUT_MISC does not do any changes to the kernel image, it only
shows some extra kernel configuration options.

Activate it on all targets.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-08-10 21:36:17 +02:00
Ronny Kotzschmar
9b00e97956
rockchip: reliably distribute net interrupts
On the NanoPI R4S it takes an average of 3..5 seconds for the network devices
to appear in '/proc/interrupts'.
Wait up to 10 seconds to ensure that the distribution of the interrupts
really happens.

Signed-off-by: Ronny Kotzschmar <ro.ok@me.com>
2022-07-07 13:13:26 +02:00
Tomasz Maciej Nowak
539e60539a generic: enable CRYPTO_LIB_BLAKE2S[_X86|_ARM]
This is now built-in, enable so it won't propagate on target configs.

Link: https://lkml.org/lkml/2022/1/3/168
Fixes: 79e7a2552e ("kernel: bump 5.15 to 5.15.44")
Fixes: 0ca93670693b ("kernel: bump 5.10 to 5.10.119")
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
(Link to Kernel's commit taht made it built-in,
CRYPTO_LIB_BLAKE2S[_ARM|_X86] as it's selectable, 5.10 backport)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-06-24 17:10:24 +02:00
Juergen Wurzer
acbe1d4d36 rockchip: add kernel 5.15 as testing
Add kernel 5.15 as testing kernel for the rockchip-armv8 target.

Signed-off-by: Juergen Wurzer <wurzer.juergen@gmail.com>
[squash commits, update commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-06-18 22:11:26 +02:00
Eneas U de Queiroz
b1346d35e4 rockchip/armv8: enable armv8-CE crypto algorithms
This enables armv8 crypto extensions version of AES, GHASH, and CRC T10
algorithms in the kernel.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-06-04 12:39:01 +02:00
Philip Prindeville
23f94aa330 kernel: include CONFIG_KEXEC_SIG in configs
Seeing failure to build because of missing symbols related to provisioning
CONFIG_KEXEC and signed images.  Without this, if you set
CONFIG_KERNEL_KEXEC=y and try to build, target/linux will hang at:

scripts/kconfig/conf  --syncconfig Kconfig
...
kexec system call (KEXEC) [Y/n/?] y
kexec file based system call (KEXEC_FILE) [Y/n/?] y
Verify kernel signature during kexec_file_load() syscall (KEXEC_SIG) [N/y/?] (NEW)

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2022-03-15 08:33:45 +01:00
Rui Salvaterra
8235723c78 kernel: 5.10: remove CONFIG_DEVTMPFS{,_MOUNT} from kconfigs
They are required for container support, but are handled in Config-kernel.in.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-03-01 22:57:40 +00:00
David Bauer
2b583ab8a7 rockchip: disable UHS modes for NanoPi R4S
The NanoPi R4S leaves the SD card in 1.8V signalling when rebooting
while U-Boot requires the card to be in 3.3V mode.

Remove UHS support from the SD controller so the card remains in 3.3V
mode. This reduces transfer speeds but ensures a reboot whether from
userspace or following a kernel panic is always working.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-01-27 01:44:28 +01:00
David Bauer
e1780de5ce rockchip: remove Kernel 5.4
As v5.10 is the default kernel version now, the files for v5.4 can be
dropped.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-12-27 03:13:36 +01:00
Sergey Ryazanov
fa3690f8f1 kernel: 5.10: consolidate mac80211 crypto options
Each of
- CRYPTO_AEAD2
- CRYPTO_AEAD
- CRYPTO_GF128MUL
- CRYPTO_GHASH
- CRYPTO_HASH2
- CRYPTO_HASH
- CRYPTO_MANAGER2
- CRYPTO_MANAGER
- CRYPTO_NULL2

either directly required for mac80211 crypto support, or directly
selected by such options. Support for the mac80211 crypto was enabled in
the generic config since c7182123b9 ("kernel: make cryptoapi support
needed by mac80211 built-in"). So move the above options from the target
configs to the generic config to make it clear why do we need them.

CC: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2021-12-17 16:16:34 +01:00
Sergey Ryazanov
b61ab8f57e kernel: filter out both Clang and LLD versions
Both CLANG_VERSION and LLD_VERISON are autogenerated runtime
configuration options, so add them to the kernel configuration filter
and remove from generic and per-target configs to keep configs clean.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2021-12-17 16:16:34 +01:00
Chukun Pan
cc2a8c2545 rockchip: move r8152 related patches to generic
These patches can be used on other platforms, so
move it to generic.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2021-10-30 21:17:20 +02:00
Adrian Schmutzler
91eed5d9fb rockchip: rename "Rock Pi 4" to "Rock Pi 4A"
Kernel has added the different variants of the Rock Pi 4 in commit
b5edb0467370 ("arm64: dts: rockchip: Mark rock-pi-4 as rock-pi-4a
dts"). The former Rock Pi 4 is now Rock Pi 4A.

For compatibility with kernel 5.4, this rename has been held back
so far. Having switched to kernel 5.10 now, we can finally apply
it in our tree as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-10 00:57:56 +02:00
Adrian Schmutzler
0c2aa7c003 rockchip: switch to kernel 5.10
This target has testing support for more than half a year now.
Time to switch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-10 00:51:39 +02:00
Hauke Mehrtens
57b323ce38 kernel: Deactivate some ARM64 errata workarounds
This deactivates the following workarounds for erratas in ARM64 CPUS:
CONFIG_ARM64_ERRATUM_1165522: Cortex-A76 cores (r0p0, r1p0, r2p0)
CONFIG_ARM64_ERRATUM_1286807: Cortex-A76 cores (r0p0 to r3p0)
CONFIG_ARM64_ERRATUM_1418040: Cortex-A76/Neoverse-N1 cores (r0p0 to r3p1)
CONFIG_CAVIUM_TX2_ERRATUM_219: Cavium ThunderX2
CONFIG_FUJITSU_ERRATUM_010001: Fujitsu-A64FX

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-10-03 01:13:18 +02:00
David Bauer
b56f7407d9 rockchip: fix broken squashfs sysupgrade
The rockchip platform supports squashfs SD card images. However, the
resulting image is not padded to completely fill the rootfs partition.

Because of that, the f2fs overlay might not be erased, resulting in
uci-defaults not bing executed or the configuration not being erased,
even though drop config was selected.

Modify the image generation process so the image is padded to cover the
entire root filesystem partition.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-24 12:28:48 +02:00
Hauke Mehrtens
b9cc16a5e8 kernel: Set CONFIG_RCU_CPU_STALL_TIMEOUT=21
The default value for CONFIG_RCU_CPU_STALL_TIMEOUT was changed from 60
seconds to 21 seconds in 2012 in the upstream kernel. Some targets
already use 21 seconds.

This patch changes the default value in the generic configuration to 21
seconds and removes the target specific configuration options.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-09-09 20:24:12 +02:00
Rui Salvaterra
505b7a2d08 kernel: move two symbols to the generic kconfigs
CONFIG_RCU_{NEED_SEGCBLIST,STALL_COMMON} are set basically everywhere. Move them
to the generic kconfigs. And resort the generic kconfigs while at it.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-29 17:07:19 +02:00
Rui Salvaterra
7e135add24 kernel: disable CONFIG_RCU_EXPERT and friends
Based on the existing documentation [1][2], I dare anyone to demonstrate that
we need to fine-tune these RCU parameters. The (performance) breakage potential
for doing so is immense, so let's just please put down this loaded footgun.

Disable CONFIG_RCU_EXPERT and its dependent symbols. Additionally, remove the
CONFIG_RCU_EXPERT symbol from the target kconfigs which contain it.

[1] https://www.kernel.org/doc/Documentation/RCU/Design/Data-Structures/Data-Structures.html
[2] https://lwn.net/Articles/777214/

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-29 17:03:38 +02:00
Hauke Mehrtens
c18f91d118 kernel: Do not deactivate staging drivers
Do not deactivate the kernel configuration symbol CONFIG_STAGING in the
target configurations any more. This prevented the build of the exfat.ko
for example.

Fixes: FS#3979
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-08-21 01:10:17 +02:00
John Audia
02e2723ef3 kernel: bump 5.4 to 5.4.139
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-08-14 20:25:19 +02:00
Rui Salvaterra
ce2f31254a kernel: bump 5.10 to 5.10.57
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-14 16:32:34 +01:00
David Bauer
cbb42a44ca rockchip: add missing Kconfig symbols
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-13 00:51:30 +02:00
David Bauer
1c9a9f7c7a treewide: add various missing config symbols
Fixes commit 91a52f22a1 ("treewide: backport support for nvmem on non platform devices")

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-10 20:22:59 +02:00
Rui Salvaterra
f7ab41acc9 linux/rockchip: update the USB 3.0 controller node patch
This has been added in Linux 5.10.51 [1], but it's broken/incomplete. Update our
patch and refresh the remaining patches.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.51&id=421aff50af5e4cdc56b3ac8d6b670e09697bc8ac

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-20 18:38:23 +01:00
Rui Salvaterra
a395cd00d2 kernel: bump 5.10 to 5.10.51
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-07-20 04:11:05 +01:00
Rui Salvaterra
677813c776 kernel: bump 5.10 to 5.10.43
No deleted or manually refreshed patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-06-14 01:36:36 +02:00
Tianling Shen
b721579842 rockchip: add NanoPi R4S support
Hardware
--------
RockChip RK3399 ARM64 (6 cores)
4GB LPDDR4 RAM
2x 1000 Base-T
3 LEDs (LAN / WAN / SYS)
1 Button (Reset)
Micro-SD slot
2x USB 3.0 Port

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card using
dd.

=====================================
NOTICE FOR USERS WHO USE 1GB VERSION:
     BY NOW IT IS NOT SUPPORTED
====================================

[initialed target]
Co-developed-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Marty Jones <mj8263788@gmail.com>
[fixed bootscript]
Co-developed-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-06-10 10:34:44 +02:00
Adrian Schmutzler
6f648ed7e6 treewide: remove "+" sign for increment with macaddr_add
Many people appear to use an unneeded "+" prefix for the increment
when calculating a MAC address with macaddr_add. Since this is not
required and used inconsistently [*], just remove it.

[*] As a funny side-fact, copy-pasting has led to almost all
    hotplug.d files using the "+", while nearly all of the
    02_network files are not using it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-05 23:54:37 +02:00
Rui Salvaterra
3326b5e75c treewide: switch the timer frequency to 100 Hz
Some targets select HZ=100, others HZ=250. There's no reason to select a higher
timer frequency (and 100 Hz are available in every architecture), so change all
targets to 100 Hz.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-21 10:31:10 +01:00
David Bauer
eb85ab9ab6 rockchip: use alternative CID path
Use an alternative path to access the CID of the SD card in MMC0, used
for the generation of MAC addresses. With Kernel 5.10, the device name
of the MMC controller changed, breaking MAC address generation.

The new path is compatible with Kernel 5.4 as well as Kernel 5.10.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-04-18 14:41:51 +02:00
David Bauer
4a5aece2e6 rockchip: add missing config symbols
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-04-18 14:41:38 +02:00