Commit Graph

104 Commits

Author SHA1 Message Date
Álvaro Fernández Rojas
67c28dde09 bmips: sercomm,h500-s: fix upgrade
Sercomm H500-s devices don't need the JFFS2 cleanmarkers as opposed to the
other bmips NAND devices.

Fixes: 6df12200d9 ("bmips: add support for Sercomm H-500s")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-25 10:25:31 +01:00
Álvaro Fernández Rojas
4dedcbdc80 bmips: sercomm,h500-s: add Quantenna network config
Sercomm H500-s has an external Quantenna QT3740BC SoC connected by RGMII.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-24 11:23:42 +01:00
Álvaro Fernández Rojas
b88ae628cb kernel: add more dsa b53 pending patches
These patches have now received a positive review upstream, so let's add them
to pending patches.

776-net-dsa-b53-mmap-add-phy-ops.patch:
  This is mostly bmips/bcm63xx-specific to get external switches working
  without hanging the device when accessing certain registers.

777-net-dsa-b53-mdio-add-support-for-BCM53134:
  This adds support for BCM53134 switch on DSA B53, so any target using DSA B53
  can benefit from it.

Also fix sercomm-h500-s external switch IMP port phy-mode.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-24 11:23:42 +01:00
Álvaro Fernández Rojas
6df12200d9 bmips: add support for Sercomm H-500s
Sercomm H-500s is a BCM63268 with 128M, internal and external (Quantenna) wifi
and external BCM53134S switch.
This device is already supported in bcm63xx target, so more information can be
found in https://openwrt.org/toh/sercomm/h500-s.

It's a perfect example of a device with internal and external switch
coexistance since most devices only have ports on one of the switches but not
both of them.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-22 20:57:07 +01:00
Álvaro Fernández Rojas
cc07d1d2fd bmips: drop unneded cpu labels from external switches
These labels aren't needed and were accidentally added when adding external
switches support for bmips.

Fixes: 80a3ecc894 ("bmips: add Huawei HG253s v2 support")
Fixes: 61f3c3b1ee ("bmips: dgnd3700v2: enable external BCM53125 switch")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-22 18:31:31 +01:00
Álvaro Fernández Rojas
a97965b7b1 kernel: add pending patches for bcm63268-timer-clocks
bcm63268-timer-clocks have been sent upstream with a positive review, so let's
add them to pending v5.15.
Also add devm_clk_hw_register_gate() patch from v5.17 to backports since it's
needed for upstream bcm63268-timer-clocks patches.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-22 18:31:31 +01:00
Álvaro Fernández Rojas
68883278ab bmips: dts: nand: add missing address/size cells
Fixes the following warnings for Netgear DGND3700v2 and Comtrend VR-3032u:
[    1.059540] 7 fixed-partitions partitions found on MTD device brcmnand.0
[    1.066570] OF: Bad cell count for /ubus/nand@10000200/nandcs@0/partitions
[    1.073766] OF: Bad cell count for /ubus/nand@10000200/nandcs@0/partitions
[    1.081927] OF: Bad cell count for /ubus/nand@10000200/nandcs@0/partitions
[    1.089128] OF: Bad cell count for /ubus/nand@10000200/nandcs@0/partitions

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-21 20:49:21 +01:00
Álvaro Fernández Rojas
80a3ecc894 bmips: add Huawei HG253s v2 support
Huawei HG253s v2 is a BCM6362 with 128M RAM, internal wifi and external
BCM53124S switch.
This device is already supported in bcm63xx target, so more information can be
found in https://openwrt.org/toh/huawei/hg253s_v2.

It's a perfect example of a device with internal and external switch
coexistance since most devices only have ports on one of the switches but not
both of them.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-21 20:49:18 +01:00
Álvaro Fernández Rojas
61f3c3b1ee bmips: dgnd3700v2: enable external BCM53125 switch
The Netgear DGND3700v2 has an external BCM53125 switch which can now be enabled
as a DSA disjoint switch tree setup.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-21 19:45:20 +01:00
Álvaro Fernández Rojas
82dc16fde0 bmips: disable B53 MMAP phy read/write ops
Without this change, internal and external B53 switches couldn't coexist as
reported in https://github.com/openwrt/openwrt/issues/10313.
In order to fix this we need to force the B53 MMAP DSA switch driver to use
bcm6368-mdio-mux for accessing the PHY registers instead of its own phy_read()
and phy_write() functions.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-21 19:36:16 +01:00
Álvaro Fernández Rojas
82ce340384 bmips: dts: fix switch compatible strings
Use the proper string for each SoC.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-20 19:55:24 +01:00
Álvaro Fernández Rojas
fff07085fb kernel: add pending bmips patches
Add patches sent upstream for bmips and b53 and remove downstream ones.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-20 19:51:53 +01:00
Álvaro Fernández Rojas
c2836c4d27 bmips: tweak Kconfig options
Add patch to reduce and improve selected bmips kernel config options.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-16 20:49:47 +01:00
Álvaro Fernández Rojas
9fc98b1956 bmips: irq-bcm6345-l1: register memory region
Add new patch sent upstream for requesting the memory region in the bcm6345-l1
interrupt controller.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-16 20:49:47 +01:00
Álvaro Fernández Rojas
8d0c254651 bmips: update patches sent upstream
Update bmips patches with the latest version sent upstream

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-16 20:49:47 +01:00
Álvaro Fernández Rojas
89390a9e50 bmips: dts: fix warnings
- Add missing interrupt-parent to ext_intc.
- Add missing #address-cells and #size-cells to gpio_cntl.
- Use proper gpio handle for gpios (ar-5315u).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-09 19:05:30 +01:00
Álvaro Fernández Rojas
2f8e90739a Revert "bmips: add missing switch cpu label"
This reverts commit dc0de05e10.
As pointed out by @BKPepe and @arinc9 this was removed by 9df035b since it
isn't needed.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-05 11:53:52 +01:00
Álvaro Fernández Rojas
dc0de05e10 bmips: add missing switch cpu label
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-04 21:27:30 +01:00
Sieng-Piaw Liew
65ebe31130 bmips: check for DMA error when refilling Rx
dma_mapping_error() should be called as dma_map_single() could fail and
return error.

Signed-off-by: Sieng-Piaw Liew <liew.s.piaw@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng-Piaw Liew
a6a54135ef bmips: fix Tx cleanup when NAPI poll budget is zero
NAPI poll() function may be passed a budget value of zero, i.e. during
netpoll, which isn't NAPI context.
Therefore, napi_consume_skb() must be given budget value instead of
!force to truly discern netpoll-like scenarios.

https://lore.kernel.org/netdev/20220707141056.2644-1-liew.s.piaw@gmail.com/t/#m470f5c20225e76fb08c44d6cfa2f1b739ffaaea4
Signed-off-by: Sieng-Piaw Liew <liew.s.piaw@gmail.com>
[improve code format]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
cbc1fcf0e4 bmips: add BQL support
Add Byte Queue Limits support to reduce/remove bufferbloat.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
85d403a579 bmips: batch process eth_type_trans() in rx path
Improve cache efficiency by running eth_type_trans() in its own loop.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
686050b2b2 bmips: batch process rx path
Use netif_receive_skb_list() to batch process rx skb. This improves
cache efficiency.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
6276dad6ca bmips: improve rx loop
Use existing rx processed count to track against budget, thereby making
budget decrement operation redundant.
rx_desc_count can be calculated outside the rx loop, making the loop a
bit smaller.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
330cbcc09c bmips: switch to napi_build_skb() to reuse skbuff_heads
napi_build_skb() reuses NAPI skbuff_head cache in order to save some
cycles on freeing/allocating skbuff_heads on every new rx or completed
tx.
Use napi_consume_skb() to feed the cache with skbuff_heads of completed
tx so it's never empty.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
a332b8cc9c bmips: check NAPI context when refilling rx SKB
Check if we're in NAPI context when refilling rx. Normally we're almost
always running in NAPI context. Dispatch to napi_alloc_frag() directly
instead of relying on netdev_alloc_frag() which does the same but with
the overhead of local_bh_disable/enable.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
[improve code format]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
71ef4ec47c bmips: convert to build_skb()
We can increase the efficiency of rx path by using buffers to receive
packets then build SKBs around them just before passing into the network
stack. In contrast, preallocating SKBs too early reduces CPU cache
efficiency.
Performance is slightly increased but the changes allow more
potential optimizations.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
[improve code format]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-04 19:28:16 +01:00
Sieng Piaw Liew
7178adadcc bmips: use netdev_alloc_skb() for copybreak
bmips is using Broadcom B53 DSA driver which means the ethernet driver
must compensate for 6 bytes tags from the internal switch.
This means using NET_IP_ALIGN actually misaligns the skb, lowering
performance significantly. Therefore napi_alloc_skb() which uses
NET_IP_ALIGN is changed to netdev_alloc_skb().
Performance in iperf3 is increased from ~47Mbps to 52Mbps.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
2023-03-04 19:28:16 +01:00
Álvaro Fernández Rojas
12a3c863d2 bmips: loader-lzma: drop unused RAMSIZE parameter
This parameter has never been used.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-03-02 20:37:56 +01:00
Arınç ÜNAL
9df035b3ea treewide: remove label = "cpu" from DSA dt-binding
This is not used by the DSA dt-binding, so remove it from all devicetrees.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc115d8d6f73dd260de1609182f3645844d6907
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2023-02-26 22:22:48 +01:00
Rosen Penev
2630e5063d treewide: replace wpad-basic-wolfssl default
The newly merged mbedtls backend is smaller and has fewer ABI related
issues than the wolfSSL one.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-04 02:35:03 +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
John Audia
fbe2f7db86 kernel: bump 5.15 to 5.15.67
All patches automatically rebased

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-09-09 21:08:37 +01: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
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: 0ca9367069 ("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
Rui Salvaterra
2454342e06 kernel: bump 5.15 to 5.15.42
Deleted (upstreamed):
generic/backport-5.15/610-v5.18-netfilter-flowtable-move-dst_check-to-packet-path.patch [1]
generic/pending-5.15/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch [2]
generic/pending-5.15/704-01-netfilter-nft_flow_offload-skip-dst-neigh-lookup-for.patch [3]
generic/pending-5.15/704-02-net-fix-dev_fill_forward_path-with-pppoe-bridge.patch [4]
generic/pending-5.15/704-03-netfilter-nft_flow_offload-fix-offload-with-pppoe-vl.patch [5]

Manually rebased:
generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.42&id=88b937673b3552d54da20f648e61a123f4c1fa67
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.42&id=5f4197a020c049a59ea7907c31f9ab037dcefefe
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.42&id=7613dcaceee281973145588f4244f2f78ef85b7f
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.42&id=f96b2e06721249ebf8da3254cfef29dcb6583948
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.42&id=b329889974aed47e1167c85653c07097013e01a7

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-06-06 19:20:28 +02:00
Álvaro Fernández Rojas
90e4c8c6e6 bmips: dgnd3700v2: fix network config
ucidef_set_bridge_device is needed for DGND3700v2 network config since VLAN 1
must be used for the switch to be correctly configured.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-23 21:05:59 +02:00
Álvaro Fernández Rojas
9b4169df2d bmips: rework ARCH_HAS_SYNC_DMA_FOR_CPU_ALL patch
Let's disable ARCH_HAS_SYNC_DMA_FOR_CPU_ALL only for BCM6358.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-20 13:09:26 +02:00
Álvaro Fernández Rojas
66994d68cd bmips: remove linux 5.10 compatibility
A devent amount of patches have been upstreamed, so maintaining linux 5.10 on
this target makes no sense.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-20 12:39:34 +02:00
Álvaro Fernández Rojas
0ad2097099 bmips: switch to linux 5.15
I tested it locally and I couldn't find any regressions, so let's give this a
wider test :).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-20 12:36:43 +02:00
Álvaro Fernández Rojas
6a1e7c767f bmips: add linux v5.15 support
Build system: x86_64
Build-tested: generic, nand
Run-tested: generic/AR-5387un, nand/VR-3032u

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-20 12:21:03 +02:00
Tony Ambardar
76fae1d169 config: limit CONFIG_DEBUG_INFO to top-level generic configs
Remove redundant target-level entries, noting that these settings will be
configured from "Kernel build options" of Kconfig.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[remove from new configs introduced after patch submission]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-05-18 13:32:06 +03: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
Hauke Mehrtens
be3fcd72e9 kernel: Deactivate B53 symbols in generic configuration
Deactivate all the symbols of the B53 DSA driver in the generic kernel
configuration. Multiple targets are now using this drivers and they
only need some of the options.
This fixes the bcm4908 build which didn't deactivate all of the options.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-11-29 22:37:58 +01:00
Rui Salvaterra
72e53eb133 kernel: bump 5.10 to 5.10.74
Patches automatically refreshed.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-10-21 00:17:36 +02:00
Rafał Miłecki
8fa1b576bb linux: update b53 upstream driver
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-09-17 10:15:26 +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
Álvaro Fernández Rojas
4ab0b5fabd bmips: backport accepted watchdog patch
This patch has been accepted for linux v5.14.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-08-25 10:24:33 +02:00
Ansuel Smith
91a52f22a1 treewide: backport support for nvmem on non platform devices
In the current state, nvmem cells are only detected on platform device.
To quickly fix the problem, we register the affected problematic driver
with the of_platform but that is more an hack than a real solution.
Backport from net-next the required patch so that nvmem can work also
with non-platform devices and rework our current patch.
Drop the mediatek and dsa workaround and rework the ath10k patches.
Rework every driver that use the of_get_mac_address api.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2021-08-05 01:46:26 +02:00