From 6aa5f22bb1df46f37659cd87ad51f3e7a6a97d85 Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Mon, 10 Aug 2026 13:50:50 +0200 Subject: [PATCH 02/77] layerscape: build the ASK vendor kernel with offload patches The ASK hardware-offload stack requires the NXP vendor kernel (sdk_dpaa/sdk_fman/fsl_qbman). Build it via CONFIG_KERNEL_GIT_CLONE_URI = nxp-qoriq/linux at lf-6.12.49-2.2.0 (KERNEL_GIT_LINUX_VERSION=6.12.49). Git-clone mode skips all kernel patching, so Kernel/Prepare is overridden to: fetch we-are-mono/ASK at a pinned commit through the standard download machinery, apply its patches/kernel/0*.patch series (999-* legacy monolith excluded), then patches-ask/ - the 11 generic cherry-picks OpenWrt userspace depends on (kconfig visibility hacks, rfkill split, CFG80211_HEADERS, fail-on-unset-symbol), then overlay files-ask/ (mono-gateway-dk.dts, vendored from the meta-mono layer) with an idempotent dtb-y append. Co-Authored-By: Claude Fable 5 --- target/linux/layerscape/Makefile | 51 + .../boot/dts/freescale/mono-gateway-dk.dts | 1037 +++++++++++++++++ .../patches-ask/204-module_strip.patch | 201 ++++ ...-abort-configuration-on-unset-symbol.patch | 41 + .../249-udp-tunnel-selection.patch | 36 + .../patches-ask/250-netfilter_depends.patch | 27 + .../layerscape/patches-ask/251-kconfig.patch | 157 +++ .../patches-ask/253-ksmbd-config.patch | 32 + .../patches-ask/259-regmap_dynamic.patch | 156 +++ .../260-crypto_test_dependencies.patch | 54 + .../patches-ask/261-lib-arc4-unhide.patch | 24 + .../patches-ask/280-rfkill-stubs.patch | 84 ++ ...0211_ptr-even-with-no-CFG82111-suppo.patch | 59 + 13 files changed, 1959 insertions(+) create mode 100644 target/linux/layerscape/files-ask/arch/arm64/boot/dts/freescale/mono-gateway-dk.dts create mode 100644 target/linux/layerscape/patches-ask/204-module_strip.patch create mode 100644 target/linux/layerscape/patches-ask/205-kconfig-abort-configuration-on-unset-symbol.patch create mode 100644 target/linux/layerscape/patches-ask/249-udp-tunnel-selection.patch create mode 100644 target/linux/layerscape/patches-ask/250-netfilter_depends.patch create mode 100644 target/linux/layerscape/patches-ask/251-kconfig.patch create mode 100644 target/linux/layerscape/patches-ask/253-ksmbd-config.patch create mode 100644 target/linux/layerscape/patches-ask/259-regmap_dynamic.patch create mode 100644 target/linux/layerscape/patches-ask/260-crypto_test_dependencies.patch create mode 100644 target/linux/layerscape/patches-ask/261-lib-arc4-unhide.patch create mode 100644 target/linux/layerscape/patches-ask/280-rfkill-stubs.patch create mode 100644 target/linux/layerscape/patches-ask/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index 61690b8b58..79a16f082d 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -8,6 +8,9 @@ BOARD:=layerscape BOARDNAME:=NXP Layerscape KERNEL_PATCHVER:=6.12 +# Real version of the NXP vendor kernel fetched via KERNEL_GIT_CLONE_URI; +# names the build dir and gives kmod packages an apk-valid version. +KERNEL_GIT_LINUX_VERSION:=6.12.49 FEATURES:=squashfs nand usb pcie gpio fpu ubifs ext4 rootfs-part boot-part SUBTARGETS:=armv8_64b armv7 @@ -21,4 +24,52 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage \ mkf2fs e2fsprogs partx-utils +# ASK hardware-offload integration. +# +# The offload stack requires the NXP vendor kernel (sdk_dpaa/sdk_fman/qbman), +# selected via CONFIG_KERNEL_GIT_CLONE_URI. In that mode OpenWrt skips all +# kernel patching (generic + platform), so it is restored here: the ASK +# repository is fetched at a pinned revision and its kernel patch series is +# applied, followed by the OpenWrt-integration patches in patches-ask/ +# (cherry-picks from the generic stack that OpenWrt userspace depends on). +ASK_VERSION:=b4c31a46dfb7b03984ebfa3a8eabd06ccbc0cc91 +ASK_SOURCE:=ask-$(ASK_VERSION).tar.xz +ASK_SUBDIR:=ask-$(ASK_VERSION) + +ifeq ($(TARGET_BUILD),1) +ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) + + define Download/ask + URL:=https://github.com/we-are-mono/ASK + PROTO:=git + SOURCE_VERSION:=$(ASK_VERSION) + FILE:=$(ASK_SOURCE) + SUBDIR:=$(ASK_SUBDIR) + endef + $(eval $(call Download,ask)) + + KERNEL_FILE_DEPENDS+=$(PLATFORM_DIR)/patches-ask $(PLATFORM_DIR)/files-ask + + # 0*.patch only: 999-* is the legacy 5.4 reference monolith, never applied. + # files-ask/ overlays board files (mono-gateway-dk.dts, vendored from the + # meta-mono layer) onto the vendor tree; the dtb-y append is idempotent. + define Kernel/Prepare + $(call Kernel/Prepare/Default) + rm -rf $(KERNEL_BUILD_DIR)/$(ASK_SUBDIR) $(KERNEL_BUILD_DIR)/ask-kernel-patches + xzcat $(DL_DIR)/$(ASK_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) -xf - + mkdir -p $(KERNEL_BUILD_DIR)/ask-kernel-patches + $(CP) $(KERNEL_BUILD_DIR)/$(ASK_SUBDIR)/patches/kernel/0*.patch $(KERNEL_BUILD_DIR)/ask-kernel-patches/ + $(call PatchDir,$(LINUX_DIR),$(KERNEL_BUILD_DIR)/ask-kernel-patches,ask/) + $(call PatchDir,$(LINUX_DIR),$(PLATFORM_DIR)/patches-ask,ask-openwrt/) + $(CP) $(PLATFORM_DIR)/files-ask/. $(LINUX_DIR)/ + grep -q "mono-gateway-dk" $(LINUX_DIR)/arch/arm64/boot/dts/freescale/Makefile || \ + echo 'dtb-y += mono-gateway-dk.dtb' \ + >> $(LINUX_DIR)/arch/arm64/boot/dts/freescale/Makefile + endef + +$(STAMP_PREPARED): $(DL_DIR)/$(ASK_SOURCE) + +endif +endif + $(eval $(call BuildTarget)) diff --git a/target/linux/layerscape/files-ask/arch/arm64/boot/dts/freescale/mono-gateway-dk.dts b/target/linux/layerscape/files-ask/arch/arm64/boot/dts/freescale/mono-gateway-dk.dts new file mode 100644 index 0000000000..e002cc9716 --- /dev/null +++ b/target/linux/layerscape/files-ask/arch/arm64/boot/dts/freescale/mono-gateway-dk.dts @@ -0,0 +1,1037 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Device Tree file for Freescale Layerscape-1046A family SoC. + * + * Copyright 2025 Mono Technologies Inc. + * + * Author: Tomaz Zaman + */ + +/dts-v1/; + +#include +#include +#include +#include "fsl-ls1046a.dtsi" +#include "qoriq-qman-portals-sdk.dtsi" +#include "qoriq-bman-portals-sdk.dtsi" + +/ { + model = "Mono Gateway Development Kit"; + compatible = "mono,gateway-dk", "fsl,ls1046a"; + + aliases { + serial0 = &duart0; + serial1 = &duart1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-poweroff { + compatible = "gpio-poweroff"; + gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>; + timeout-ms = <1000>; + }; + + leds { + compatible = "gpio-leds"; + + /* SFP+ Port 0 LEDs - Activity/Link */ + led_sfp0_link: sfp0_link { + label = "sfp0:link"; + gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_sfp0_activity: sfp0_activity { + label = "sfp0:activity"; + gpios = <&gpio2 18 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + /* SFP+ Port 1 LEDs - Activity/Link */ + led_sfp1_link: sfp1_link { + label = "sfp1:link"; + gpios = <&gpio2 15 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_sfp1_activity: sfp1_activity { + label = "sfp1:activity"; + gpios = <&gpio2 16 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + /* SFP 1 */ + sfp_xfi0: sfp-xfi0 { + compatible = "sff,sfp"; + i2c-bus = <&sfp0_i2c>; + tx-disable-gpios = <&gpio2 14 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>; + los-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <3000>; + }; + + /* SFP 2 */ + sfp_xfi1: sfp-xfi1 { + compatible = "sff,sfp"; + i2c-bus = <&sfp1_i2c>; + tx-disable-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; + los-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <3000>; + }; + + /* SFP LED Controller */ + sfp_led_controller: sfp-led-controller { + compatible = "mono,sfp-led"; + + port@0 { + sfp = <&sfp_xfi0>; + leds = <&led_sfp0_link>, <&led_sfp0_activity>; + }; + port@1 { + sfp = <&sfp_xfi1>; + leds = <&led_sfp1_link>, <&led_sfp1_activity>; + }; + }; + + cpus { + fman0-extended-args { + cell-index = <0x00>; + compatible = "fsl,fman-extended-args"; + total-fifo-size = <0x3e500>; + + /* Offline ports for CDX - cell-index overridden for SDK compatibility: + * fman0_oh_0x3 (port@83000) = cell-index 1 (SDK style) + * fman0_oh_0x4 (port@84000) = cell-index 2 (SDK style) + */ + fman0_oh_0x3-extended-args { + cell-index = <0x01>; /* matches port@83000 SDK cell-index */ + compatible = "fsl,fman-port-op-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + }; + + fman0_oh_0x4-extended-args { + cell-index = <0x02>; /* matches port@84000 SDK cell-index */ + compatible = "fsl,fman-port-op-extended-args"; + fifo-size = <0x900 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* All 1G ports need extended-args (SDK driver requirement) */ + + /* MAC1 (ethernet@e0000) - cell-index 0 - disabled but needed */ + fman0_rx0-extended-args { + cell-index = <0x00>; + compatible = "fsl,fman-port-1g-rx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx0-extended-args { + cell-index = <0x00>; + compatible = "fsl,fman-port-1g-tx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* MAC2 (ethernet@e2000) - cell-index 1 */ + fman0_rx1-extended-args { + cell-index = <0x01>; + compatible = "fsl,fman-port-1g-rx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx1-extended-args { + cell-index = <0x01>; + compatible = "fsl,fman-port-1g-tx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* MAC3 (ethernet@e4000) - cell-index 2 - disabled but needed */ + fman0_rx2-extended-args { + cell-index = <0x02>; + compatible = "fsl,fman-port-1g-rx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx2-extended-args { + cell-index = <0x02>; + compatible = "fsl,fman-port-1g-tx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* MAC4 (ethernet@e6000) - cell-index 3 - disabled but needed */ + fman0_rx3-extended-args { + cell-index = <0x03>; + compatible = "fsl,fman-port-1g-rx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx3-extended-args { + cell-index = <0x03>; + compatible = "fsl,fman-port-1g-tx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* MAC5 (ethernet@e8000) - cell-index 4 */ + fman0_rx4-extended-args { + cell-index = <0x04>; + compatible = "fsl,fman-port-1g-rx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx4-extended-args { + cell-index = <0x04>; + compatible = "fsl,fman-port-1g-tx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* MAC6 (ethernet@ea000) - cell-index 5 */ + fman0_rx5-extended-args { + cell-index = <0x05>; + compatible = "fsl,fman-port-1g-rx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx5-extended-args { + cell-index = <0x05>; + compatible = "fsl,fman-port-1g-tx-extended-args"; + fifo-size = <0x3200 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* MAC9 (ethernet@f0000) - 10G cell-index 0 */ + fman0_rx6-extended-args { + cell-index = <0x00>; + compatible = "fsl,fman-port-10g-rx-extended-args"; + fifo-size = <0x6000 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx6-extended-args { + cell-index = <0x00>; + compatible = "fsl,fman-port-10g-tx-extended-args"; + fifo-size = <0x4000 0x00>; + buffer-layout = <0x60 0x40>; + }; + + /* MAC10 (ethernet@f2000) - 10G cell-index 1 */ + fman0_rx7-extended-args { + cell-index = <0x01>; + compatible = "fsl,fman-port-10g-rx-extended-args"; + fifo-size = <0x6000 0x00>; + buffer-layout = <0x60 0x40>; + vsp-window = <0x02 0x00>; + }; + + fman0_tx7-extended-args { + cell-index = <0x01>; + compatible = "fsl,fman-port-10g-tx-extended-args"; + fifo-size = <0x4000 0x00>; + buffer-layout = <0x60 0x40>; + }; + }; + }; +}; + +&pcie3 { + status = "okay"; +}; + +&gpio2 { + 2R-enable { + gpio-hog; + gpios = <6 GPIO_ACTIVE_LOW>; + output-high; + line-name = "2r-enable"; + }; + + 3R-enable { + gpio-hog; + gpios = <2 GPIO_ACTIVE_LOW>; + output-low; + line-name = "3r-enable"; + }; + + uart-mux { + gpio-hog; + gpios = <26 GPIO_ACTIVE_HIGH>; + output-high; /* "output-high" for 2R, "output-low" for 3R */ + line-name = "uart-mux"; + }; +}; + +&duart0 { + status = "okay"; +}; + +&duart1 { + status = "okay"; + uart-has-rtscts; + + bluetooth { + compatible = "nxp,88w8987-bt"; + fw-init-baudrate = <3000000>; + }; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&usb1 { + status = "disabled"; + disable-over-current; +}; + +&usb2 { + status = "disabled"; + disable-over-current; +}; + +&dspi { + status = "okay"; +}; + +&esdhc { + status = "okay"; + mmc-hs200-1_8v; + bus-width = <4>; +}; + +&i2c0 { + status = "okay"; + + /* Thermal sensors, retimer, clock genenerator, PWM fan */ + i2c-mux@70 { + compatible = "nxp,pca9545"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + retimer: retimer@18 { + compatible = "ti,ds100df410"; + reg = <0x18>; + status = "okay"; + }; + }; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + temp-sensor@4c { + compatible = "ti,tmp431"; + reg = <0x4c>; + }; + }; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + temp-sensor@4c { + compatible = "ti,tmp431"; + reg = <0x4c>; + }; + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + fan_controller: fan-controller@2e { + compatible = "microchip,emc2305"; + reg = <0x2e>; + #address-cells = <1>; + #size-cells = <0>; + #pwm-cells = <3>; + + fan0: fan@0 { + reg = <0>; + label = "System Fan 1"; + pwms = <&fan_controller 26000 1 1>; + #cooling-cells = <2>; + }; + + fan1: fan@1 { + reg = <1>; + label = "System Fan 2"; + pwms = <&fan_controller 26000 1 1>; + #cooling-cells = <2>; + }; + }; + }; + }; +}; + +&i2c1 { + status = "okay"; + + /* SFP+ modules */ + sfpmux: i2c-mux@70 { + compatible = "nxp,pca9545"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + /* The SFP channels carry the only field-swappable devices on + * any i2c bus. Park the mux with all channels disconnected so + * a misbehaving or half-inserted module can only disturb the + * bus during an in-flight transfer, not while idle; the reset + * line guarantees a clean mux state at probe regardless of + * what the previous boot stage left selected. + */ + i2c-mux-idle-disconnect; + reset-gpios = <&gpio2 24 GPIO_ACTIVE_LOW>; + + sfp0_i2c: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + sfp1_i2c: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + }; +}; + +&i2c2 { + status = "okay"; + + i2c-mux@70 { + compatible = "nxp,pca9545"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + power_sensor@40 { + compatible = "ti,ina234"; + reg = <0x40>; + label = "USB Power Delivery"; + #io-channel-cells = <1>; + shunt-resistor = <1000>; + }; + power_sensor@41 { + compatible = "ti,ina234"; + reg = <0x41>; + label = "5V PSU"; + #io-channel-cells = <1>; + shunt-resistor = <1000>; + }; + power_sensor@42 { + compatible = "ti,ina234"; + reg = <0x42>; + label = "1V Core PSU"; + #io-channel-cells = <1>; + shunt-resistor = <1000>; + }; + power_sensor@43 { + compatible = "ti,ina234"; + reg = <0x43>; + label = "1.2V DDR PSU"; + #io-channel-cells = <1>; + shunt-resistor = <5000>; + }; + }; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + power_sensor@40 { + compatible = "ti,ina234"; + reg = <0x40>; + label = "1.35V SerDes PSU"; + #io-channel-cells = <1>; + shunt-resistor = <5000>; + }; + power_sensor@41 { + compatible = "ti,ina234"; + reg = <0x41>; + label = "1.8V PSU"; + #io-channel-cells = <1>; + shunt-resistor = <5000>; + }; + power_sensor@42 { + compatible = "ti,ina234"; + reg = <0x42>; + label = "2.5V DDR PSU"; + #io-channel-cells = <1>; + shunt-resistor = <5000>; + }; + power_sensor@43 { + compatible = "ti,ina234"; + reg = <0x43>; + label = "3.3V PSU"; + #io-channel-cells = <1>; + shunt-resistor = <1000>; + }; + }; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + rtc@53 { + compatible = "nxp,pcf2131"; + reg = <0x53>; + status = "okay"; + }; + + typec: hd3ss3220@47 { + compatible = "ti,hd3ss3220"; + reg = <0x47>; + }; + }; + + i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + lp5810@6c { + compatible = "ti,lp5812"; + reg = <0x6c>; + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = ; + label = "status:white"; + led-max-microamp = <25500>; + }; + + led@1 { + reg = <1>; + color = ; + label = "status:blue"; + led-max-microamp = <25500>; + }; + + led@2 { + reg = <2>; + color = ; + label = "status:green"; + led-max-microamp = <25500>; + }; + + led@3 { + reg = <3>; + color = ; + label = "status:red"; + led-max-microamp = <25500>; + }; + }; + }; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&qspi { + status = "okay"; + + mt25qu512a0: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <50000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@flash { + label = "flash"; + reg = <0x0 0x4000000>; + }; + + partition@0 { + label = "rcw-bl2"; + reg = <0x0 0x100000>; + }; + + partition@100000 { + label = "uboot"; + reg = <0x100000 0x200000>; + }; + + partition@300000 { + label = "uboot-env"; + reg = <0x300000 0x100000>; + }; + + partition@400000 { + label = "fman-ucode"; + reg = <0x400000 0x100000>; + }; + + partition@500000 { + label = "backup"; + reg = <0x500000 0x300000>; + }; + + partition@800000 { + label = "recovery-fit"; + reg = <0x800000 0x1800000>; + }; + + partition@2000000 { + label = "unallocated"; + reg = <0x2000000 0x2000000>; + }; + }; + }; +}; + +#include "fsl-ls1046-post.dtsi" + +&bman_fbpr { + compatible = "fsl,bman-fbpr"; + alloc-ranges = <0 0 0x10000 0>; +}; +&qman_fqd { + compatible = "fsl,qman-fqd"; + alloc-ranges = <0 0 0x10000 0>; +}; +&qman_pfdr { + compatible = "fsl,qman-pfdr"; + alloc-ranges = <0 0 0x10000 0>; +}; + +&soc { + /delete-property/ dma-coherent; + + #include "qoriq-dpaa-eth.dtsi" + /* Note: We override cell-index values in &fman0 section to match + * SDK driver expectations (0-5 instead of mainline 2-7). + * Port@82000 with cell-index=0 becomes the HC port for PCD. + */ + + pcie@3400000 { + /delete-property/ iommu-map; + }; + + pcie@3500000 { + /delete-property/ iommu-map; + }; + + pcie@3600000 { + /delete-property/ iommu-map; + }; + + /delete-node/ iommu@9000000; +}; + +&fsldpaa { + ethernet@0 { + status = "disabled"; /* MAC1 - not on Mono Gateway DK */ + }; + ethernet@2 { + status = "disabled"; /* MAC3 - not on Mono Gateway DK */ + }; + ethernet@3 { + status = "disabled"; /* MAC4 - not on Mono Gateway DK */ + }; + + /* Enabled from qoriq-dpaa-eth.dtsi: + * ethernet@1 = enet1 = MAC2 + * ethernet@4 = enet4 = MAC5 + * ethernet@5 = enet5 = MAC6 + * ethernet@8 = enet6 = MAC9 (10G) + */ + + /* Add MAC10 - not in qoriq-dpaa-eth.dtsi */ + ethernet@9 { + compatible = "fsl,dpa-ethernet"; + fsl,fman-mac = <&enet7>; + dma-coherent; + }; +}; + +&fman0 { + compatible = "fsl,fman", "simple-bus"; + + /* Core FMan sub-modules */ + muram@0 { + compatible = "fsl,fman-muram"; + reg = <0x0 0x60000>; + }; + + bmi@80000 { + compatible = "fsl,fman-bmi"; + reg = <0x80000 0x400>; + }; + + qmi@80400 { + compatible = "fsl,fman-qmi"; + reg = <0x80400 0x400>; + }; + + /* PCD sub-modules required for FMC/CDX */ + cc { + compatible = "fsl,fman-cc"; + }; + + policer@c0000 { + compatible = "fsl,fman-policer"; + reg = <0xc0000 0x1000>; + }; + + keygen@c1000 { + compatible = "fsl,fman-keygen"; + reg = <0xc1000 0x1000>; + }; + + dma@c2000 { + compatible = "fsl,fman-dma"; + reg = <0xc2000 0x1000>; + }; + + fpm@c3000 { + compatible = "fsl,fman-fpm"; + reg = <0xc3000 0x1000>; + }; + + parser@c7000 { + compatible = "fsl,fman-parser"; + reg = <0xc7000 0x1000>; + }; + + vsps@dc000 { + compatible = "fsl,fman-vsps"; + reg = <0xdc000 0x1000>; + }; + + ethernet@e0000 { + status = "disabled"; + }; + + ethernet@e4000 { + status = "disabled"; + }; + + ethernet@e6000 { + status = "disabled"; + }; + + ethernet@e8000 { + phy-handle = <&sgmii_phy0>; + phy-connection-type = "sgmii"; + status = "okay"; + }; + + ethernet@ea000 { + phy-handle = <&sgmii_phy1>; + phy-connection-type = "sgmii"; + status = "okay"; + }; + + ethernet@e2000 { + phy-handle = <&sgmii_phy2>; + phy-connection-type = "sgmii"; + status = "okay"; + }; + + fm1_mac9: ethernet@f0000 { /* 10GEC1 */ + /delete-property/ managed; + sfp = <&sfp_xfi0>; + fixed-link = <0 1 10000 0 0>; + phy-connection-type = "xgmii"; + pcs-handle-names = "xfi"; /* Match enet7 for consistency */ + }; + + fm1_mac10: ethernet@f2000 { /* 10GEC2 */ + /delete-property/ managed; + sfp = <&sfp_xfi1>; + fixed-link = <0 1 10000 0 0>; + phy-connection-type = "xgmii"; + }; + + mdio@fc000 { + status = "disabled"; + }; + + mdio@fd000 { + sgmii_phy0: ethernet-phy@0 { + reg = <0x0>; + }; + + sgmii_phy1: ethernet-phy@1 { + reg = <0x1>; + }; + + sgmii_phy2: ethernet-phy@2 { + reg = <0x2>; + }; + }; + + /* DPA Offline port bindings - required for CDX. + * Use phandles fman0_oh_0x3 (port@83000) and fman0_oh_0x4 (port@84000). + * Cell-index overridden to SDK-style (1 and 2) in port nodes above. + */ + dpa-fman0-oh@2 { + compatible = "fsl,dpa-oh"; + fsl,qman-frame-queues-oh = <0x60 0x01 0x61 0x01>; + fsl,fman-oh-port = <&fman0_oh_0x3>; + }; + + dpa-fman0-oh@3 { + compatible = "fsl,dpa-oh"; + fsl,qman-frame-queues-oh = <0x62 0x01 0x63 0x01>; + fsl,fman-oh-port = <&fman0_oh_0x4>; + }; + + /* Override OH port cell-index values for SDK driver compatibility. + * SDK driver expects cell-index 0 for HC (Host Command/PCD) port. + * Mainline qoriq-fman3-0.dtsi uses cell-index 2-7, but SDK needs 0-5. + */ + port@82000 { + cell-index = <0>; /* HC port - required for PCD initialization */ + compatible = "fsl,fman-port-oh"; + }; + + port@83000 { + cell-index = <1>; + compatible = "fsl,fman-port-oh"; + }; + + port@84000 { + cell-index = <2>; + compatible = "fsl,fman-port-oh"; + }; + + port@85000 { + cell-index = <3>; + compatible = "fsl,fman-port-oh"; + }; + + port@86000 { + cell-index = <4>; + compatible = "fsl,fman-port-oh"; + }; + + port@87000 { + cell-index = <5>; + compatible = "fsl,fman-port-oh"; + }; +}; + +&clockgen { + dma-coherent; +}; + +&scfg { + dma-coherent; +}; + +&crypto { + dma-coherent; +}; + +&dcfg { + dma-coherent; +}; + +&ifc { + dma-coherent; +}; + +&qspi { + dma-coherent; +}; + +&esdhc { + dma-coherent; +}; + +&ddr { + dma-coherent; +}; + +&tmu { + dma-coherent; +}; + +&qman { + dma-coherent; +}; + +&bman { + dma-coherent; +}; + +&bportals { + dma-coherent; +}; + +&qportals { + dma-coherent; +}; + +&dspi { + dma-coherent; +}; + +&i2c0 { + dma-coherent; +}; + +&i2c1 { + dma-coherent; +}; + +&i2c2 { + dma-coherent; +}; + +&i2c3 { + dma-coherent; +}; + +&duart0 { + dma-coherent; +}; + +&duart1 { + dma-coherent; +}; + +&duart2 { + dma-coherent; +}; + +&duart3 { + dma-coherent; +}; + +&gpio0 { + dma-coherent; +}; + +&gpio1 { + dma-coherent; +}; + +&gpio2 { + dma-coherent; +}; + +&gpio3 { + dma-coherent; +}; + +&lpuart0 { + dma-coherent; +}; + +&lpuart1 { + dma-coherent; +}; + +&lpuart2 { + dma-coherent; +}; + +&lpuart3 { + dma-coherent; +}; + +&lpuart4 { + dma-coherent; +}; + +&lpuart5 { + dma-coherent; +}; + +&ftm_alarm0 { + dma-coherent; +}; + +&wdog0 { + dma-coherent; +}; + +&edma0 { + dma-coherent; +}; + +&sata { + dma-coherent; +}; + +&qdma { + dma-coherent; +}; + +&msi1 { + dma-coherent; +}; + +&msi2 { + dma-coherent; +}; + +&msi3 { + dma-coherent; +}; + +&fman0 { + dma-coherent; +}; + +&ptp_timer0 { + dma-coherent; +}; + +&fsldpaa { + dma-coherent; +}; diff --git a/target/linux/layerscape/patches-ask/204-module_strip.patch b/target/linux/layerscape/patches-ask/204-module_strip.patch new file mode 100644 index 0000000000..22da0d3cfa --- /dev/null +++ b/target/linux/layerscape/patches-ask/204-module_strip.patch @@ -0,0 +1,201 @@ +From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 16:56:48 +0200 +Subject: build: add a hack for removing non-essential module info + +Signed-off-by: Felix Fietkau +--- + include/linux/module.h | 13 ++++++++----- + include/linux/moduleparam.h | 15 ++++++++++++--- + init/Kconfig | 7 +++++++ + kernel/module.c | 5 ++++- + scripts/mod/modpost.c | 12 ++++++++++++ + 5 files changed, 43 insertions(+), 9 deletions(-) + +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -166,6 +166,7 @@ struct module_kobject *lookup_or_create_ + + /* Generic info of form tag = "info" */ + #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) ++#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) + + /* For userspace: you can also call me... */ + #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) +@@ -241,12 +242,12 @@ struct module_kobject *lookup_or_create_ + * Author(s), use "Name " or just "Name", for multiple + * authors use multiple MODULE_AUTHOR() statements/lines. + */ +-#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) ++#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) + + /* What your module does. */ +-#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) ++#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, _description) + +-#ifdef MODULE ++#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) + /* Creates an alias so file2alias.c can find device table. */ + #define MODULE_DEVICE_TABLE(type, name) \ + extern typeof(name) __mod_##type##__##name##_device_table \ +@@ -273,7 +274,9 @@ extern typeof(name) __mod_##type##__##na + */ + + #if defined(MODULE) || !defined(CONFIG_SYSFS) +-#define MODULE_VERSION(_version) MODULE_INFO(version, _version) ++#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) ++#elif defined(CONFIG_MODULE_STRIPPED) ++#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) + #else + #define MODULE_VERSION(_version) \ + MODULE_INFO(version, _version); \ +@@ -296,7 +299,7 @@ extern typeof(name) __mod_##type##__##na + /* Optional firmware file (or files) needed by the module + * format is simply firmware file name. Multiple firmware + * files require multiple MODULE_FIRMWARE() specifiers */ +-#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) ++#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) + + #define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, __stringify(ns)) + +--- a/include/linux/moduleparam.h ++++ b/include/linux/moduleparam.h +@@ -20,6 +20,16 @@ + /* Chosen so that structs with an unsigned long line up. */ + #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) + ++/* This struct is here for syntactic coherency, it is not used */ ++#define __MODULE_INFO_DISABLED(name) \ ++ struct __UNIQUE_ID(name) {} ++ ++#ifdef CONFIG_MODULE_STRIPPED ++#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) ++#else ++#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) ++#endif ++ + #define __MODULE_INFO(tag, name, info) \ + static const char __UNIQUE_ID(name)[] \ + __used __section(".modinfo") __aligned(1) \ +@@ -31,7 +41,7 @@ + /* One for each parameter, describing how to use it. Some files do + multiple of these per line, so can't just use MODULE_INFO. */ + #define MODULE_PARM_DESC(_parm, desc) \ +- __MODULE_INFO(parm, _parm, #_parm ":" desc) ++ __MODULE_INFO_STRIP(parm, _parm, #_parm ":" desc) + + struct kernel_param; + +--- a/kernel/module/Kconfig ++++ b/kernel/module/Kconfig +@@ -402,4 +402,11 @@ config MODULES_TREE_LOOKUP + def_bool y + depends on PERF_EVENTS || TRACING || CFI_CLANG + ++config MODULE_STRIPPED ++ bool "Reduce module size" ++ depends on MODULES ++ help ++ Remove module parameter descriptions, author info, version, aliases, ++ device tables, etc. ++ + endif # MODULES +--- a/kernel/module/main.c ++++ b/kernel/module/main.c +@@ -1001,6 +1001,7 @@ size_t modinfo_attrs_count = ARRAY_SIZE( + + static const char vermagic[] = VERMAGIC_STRING; + ++#if defined(CONFIG_MODVERSIONS) || !defined(CONFIG_MODULE_STRIPPED) + int try_to_force_load(struct module *mod, const char *reason) + { + #ifdef CONFIG_MODULE_FORCE_LOAD +@@ -1012,6 +1013,7 @@ int try_to_force_load(struct module *mod + return -ENOEXEC; + #endif + } ++#endif + + /* Parse tag=value strings from .modinfo section */ + char *module_next_tag_pair(char *string, unsigned long *secsize) +@@ -2102,9 +2104,11 @@ static void module_augment_kernel_taints + + static int check_modinfo(struct module *mod, struct load_info *info, int flags) + { +- const char *modmagic = get_modinfo(info, "vermagic"); + int err; + ++#ifndef CONFIG_MODULE_STRIPPED ++ const char *modmagic = get_modinfo(info, "vermagic"); ++ + if (flags & MODULE_INIT_IGNORE_VERMAGIC) + modmagic = NULL; + +@@ -2118,6 +2122,7 @@ static int check_modinfo(struct module * + info->name, modmagic, vermagic); + return -ENOEXEC; + } ++#endif + + err = check_modinfo_livepatch(mod, info); + if (err) +--- a/scripts/mod/modpost.c ++++ b/scripts/mod/modpost.c +@@ -1605,7 +1605,9 @@ static void read_symbols(const char *mod + symname = remove_dot(info.strtab + sym->st_name); + + handle_symbol(mod, &info, sym, symname); ++#ifndef CONFIG_MODULE_STRIPPED + handle_moddevtable(mod, &info, sym, symname); ++#endif + } + + check_sec_ref(mod, &info); +@@ -1762,7 +1764,9 @@ static void add_header(struct buffer *b, + buf_printf(b, "#include \n"); + buf_printf(b, "#include \n"); + buf_printf(b, "\n"); ++#ifndef CONFIG_MODULE_STRIPPED + buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); ++#endif + buf_printf(b, "\n"); + buf_printf(b, "__visible struct module __this_module\n"); + buf_printf(b, "__section(\".gnu.linkonce.this_module\") = {\n"); +@@ -1776,11 +1780,13 @@ static void add_header(struct buffer *b, + buf_printf(b, "\t.arch = MODULE_ARCH_INIT,\n"); + buf_printf(b, "};\n"); + ++#ifndef CONFIG_MODULE_STRIPPED + if (!external_module) + buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n"); + + if (strstarts(mod->name, "drivers/staging")) + buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n"); ++#endif + + if (strstarts(mod->name, "tools/testing")) + buf_printf(b, "\nMODULE_INFO(test, \"Y\");\n"); +@@ -1890,11 +1896,13 @@ static void add_depends(struct buffer *b + + static void add_srcversion(struct buffer *b, struct module *mod) + { ++#ifndef CONFIG_MODULE_STRIPPED + if (mod->srcversion[0]) { + buf_printf(b, "\n"); + buf_printf(b, "MODULE_INFO(srcversion, \"%s\");\n", + mod->srcversion); + } ++#endif + } + + static void write_buf(struct buffer *b, const char *fname) +@@ -1977,7 +1985,9 @@ static void write_mod_c_file(struct modu + add_exported_symbols(&buf, mod); + add_versions(&buf, mod); + add_depends(&buf, mod); ++#ifndef CONFIG_MODULE_STRIPPED + add_moddevtable(&buf, mod); ++#endif + add_srcversion(&buf, mod); + + ret = snprintf(fname, sizeof(fname), "%s.mod.c", mod->name); diff --git a/target/linux/layerscape/patches-ask/205-kconfig-abort-configuration-on-unset-symbol.patch b/target/linux/layerscape/patches-ask/205-kconfig-abort-configuration-on-unset-symbol.patch new file mode 100644 index 0000000000..d7416d81a9 --- /dev/null +++ b/target/linux/layerscape/patches-ask/205-kconfig-abort-configuration-on-unset-symbol.patch @@ -0,0 +1,41 @@ +From 310e8e04a05d9eb43fa9dd7f00143300afcaa37a Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Fri, 11 Nov 2022 13:33:44 +0100 +Subject: [PATCH] kconfig: abort configuration on unset symbol + +When a target configuration has unset Kconfig symbols, the build will +fail when OpenWrt is compiled with V=s and stdin is connected to a tty. + +In case OpenWrt is compiled without either of these preconditions, the +build will succeed with the symbols in question being unset. + +Modify the kernel configuration in a way it fails on unset symbols +regardless of the aforementioned preconditions. + +Signed-off-by: David Bauer +--- + scripts/kconfig/conf.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/scripts/kconfig/conf.c ++++ b/scripts/kconfig/conf.c +@@ -312,6 +312,9 @@ static int conf_askvalue(struct symbol * + } + /* fall through */ + default: ++ if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) { ++ exit(1); ++ } + fflush(stdout); + xfgets(line, sizeof(line), stdin); + break; +@@ -470,6 +473,9 @@ static void conf_choice(struct menu *men + } + /* fall through */ + case oldaskconfig: ++ if (!tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) { ++ exit(1); ++ } + fflush(stdout); + xfgets(line, sizeof(line), stdin); + strip(line); diff --git a/target/linux/layerscape/patches-ask/249-udp-tunnel-selection.patch b/target/linux/layerscape/patches-ask/249-udp-tunnel-selection.patch new file mode 100644 index 0000000000..7f7e5f11f4 --- /dev/null +++ b/target/linux/layerscape/patches-ask/249-udp-tunnel-selection.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Andy Chiang +Date: Thu, 20 Nov 2025 20:37:53 +0700 +Subject: [PATCH] kernel: fix build of kmod-udptunnel4 and kmod-udptunnel6 + +This fixes the following errors: +``` +make[4]: Entering directory '/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.12.57' + MODPOST /home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/Module.symvers +ERROR: modpost: "udp_tunnel6_xmit_skb" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined! +ERROR: modpost: "setup_udp_tunnel_sock" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined! +ERROR: modpost: "udp_tunnel_xmit_skb" [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/ovpn-dco-v2.ko] undefined! +make[6]: *** [scripts/Makefile.modpost:145: /home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/ovpn-dco-0.2.20250801/drivers/net/ovpn-dco/Module.symvers] Error 1 +make[5]: *** [/home/runner/work/OP/OP/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.12.57/Makefile:1897: modpost] Error 2 +make[4]: *** [Makefile:224: __sub-make] Error 2 +``` + +ref https://github.com/openwrt/openwrt/commit/1d15a96b29dcd0947690951a7c36aead79a27129 +fixes: https://github.com/openwrt/packages/issues/22998 + +Signed-off-by: Andy Chiang +--- + net/ipv4/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ipv4/Kconfig ++++ b/net/ipv4/Kconfig +@@ -315,7 +315,7 @@ config NET_IPVTI + on top. + + config NET_UDP_TUNNEL +- tristate ++ tristate "IP: UDP tunneling support" + select NET_IP_TUNNEL + default n + diff --git a/target/linux/layerscape/patches-ask/250-netfilter_depends.patch b/target/linux/layerscape/patches-ask/250-netfilter_depends.patch new file mode 100644 index 0000000000..43faa9959e --- /dev/null +++ b/target/linux/layerscape/patches-ask/250-netfilter_depends.patch @@ -0,0 +1,27 @@ +From: Felix Fietkau +Subject: hack: net: remove bogus netfilter dependencies + +lede-commit: 589d2a377dee27d206fc3725325309cf649e4df6 +Signed-off-by: Felix Fietkau +--- + net/netfilter/Kconfig | 2 -- + 1 file changed, 2 deletions(-) + +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -259,7 +259,6 @@ config NF_CONNTRACK_FTP + + config NF_CONNTRACK_H323 + tristate "H.323 protocol support" +- depends on IPV6 || IPV6=n + depends on NETFILTER_ADVANCED + help + H.323 is a VoIP signalling protocol from ITU-T. As one of the most +@@ -1120,7 +1119,6 @@ config NETFILTER_XT_TARGET_SECMARK + + config NETFILTER_XT_TARGET_TCPMSS + tristate '"TCPMSS" target support' +- depends on IPV6 || IPV6=n + default m if NETFILTER_ADVANCED=n + help + This option adds a `TCPMSS' target, which allows you to alter the diff --git a/target/linux/layerscape/patches-ask/251-kconfig.patch b/target/linux/layerscape/patches-ask/251-kconfig.patch new file mode 100644 index 0000000000..dd73e79453 --- /dev/null +++ b/target/linux/layerscape/patches-ask/251-kconfig.patch @@ -0,0 +1,157 @@ +From da3c50704f14132f4adf80d48e9a4cd5d46e54c9 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Fri, 7 Jul 2017 17:09:21 +0200 +Subject: kconfig: owrt specifc dependencies + +Signed-off-by: John Crispin +--- + crypto/Kconfig | 10 +++++----- + drivers/bcma/Kconfig | 1 + + drivers/ssb/Kconfig | 3 ++- + lib/Kconfig | 8 ++++---- + net/netfilter/Kconfig | 2 +- + net/wireless/Kconfig | 17 ++++++++++------- + sound/core/Kconfig | 4 ++-- + 7 files changed, 25 insertions(+), 20 deletions(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -55,7 +55,7 @@ config CRYPTO_FIPS_VERSION + By default the KERNELRELEASE value is used. + + config CRYPTO_ALGAPI +- tristate ++ tristate "ALGAPI" + select CRYPTO_ALGAPI2 + help + This option provides the API for cryptographic algorithms. +@@ -64,7 +64,7 @@ config CRYPTO_ALGAPI2 + tristate + + config CRYPTO_AEAD +- tristate ++ tristate "AEAD" + select CRYPTO_AEAD2 + select CRYPTO_ALGAPI + +@@ -82,7 +82,7 @@ config CRYPTO_SIG2 + select CRYPTO_ALGAPI2 + + config CRYPTO_SKCIPHER +- tristate ++ tristate "SKCIPHER" + select CRYPTO_SKCIPHER2 + select CRYPTO_ALGAPI + select CRYPTO_ECB +@@ -92,7 +92,7 @@ config CRYPTO_SKCIPHER2 + select CRYPTO_ALGAPI2 + + config CRYPTO_HASH +- tristate ++ tristate "HASH" + select CRYPTO_HASH2 + select CRYPTO_ALGAPI + +@@ -101,7 +101,7 @@ config CRYPTO_HASH2 + select CRYPTO_ALGAPI2 + + config CRYPTO_RNG +- tristate ++ tristate "RNG" + select CRYPTO_RNG2 + select CRYPTO_ALGAPI + +--- a/drivers/bcma/Kconfig ++++ b/drivers/bcma/Kconfig +@@ -16,6 +16,7 @@ if BCMA + # Support for Block-I/O. SELECT this from the driver that needs it. + config BCMA_BLOCKIO + bool ++ default y + + config BCMA_HOST_PCI_POSSIBLE + bool +--- a/drivers/ssb/Kconfig ++++ b/drivers/ssb/Kconfig +@@ -29,6 +29,7 @@ config SSB_SPROM + config SSB_BLOCKIO + bool + depends on SSB ++ default y + + config SSB_PCIHOST_POSSIBLE + bool +@@ -49,7 +50,7 @@ config SSB_PCIHOST + config SSB_B43_PCI_BRIDGE + bool + depends on SSB_PCIHOST +- default n ++ default y + + config SSB_PCMCIAHOST_POSSIBLE + bool +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -457,16 +457,16 @@ config BCH_CONST_T + # Textsearch support is select'ed if needed + # + config TEXTSEARCH +- bool ++ bool "Textsearch support" + + config TEXTSEARCH_KMP +- tristate ++ tristate "Textsearch KMP" + + config TEXTSEARCH_BM +- tristate ++ tristate "Textsearch BM" + + config TEXTSEARCH_FSM +- tristate ++ tristate "Textsearch FSM" + + config BTREE + bool +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -22,7 +22,7 @@ config NETFILTER_SKIP_EGRESS + def_bool NETFILTER_EGRESS && (NET_CLS_ACT || IFB) + + config NETFILTER_NETLINK +- tristate ++ tristate "Netfilter NFNETLINK interface" + + config NETFILTER_FAMILY_BRIDGE + bool +--- a/sound/core/Kconfig ++++ b/sound/core/Kconfig +@@ -17,7 +17,7 @@ config SND_DMAENGINE_PCM + tristate + + config SND_HWDEP +- tristate ++ tristate "Sound hardware support" + + config SND_SEQ_DEVICE + tristate +@@ -57,7 +57,7 @@ config SND_CORE_TEST + + + config SND_COMPRESS_OFFLOAD +- tristate ++ tristate "Compression offloading support" + + config SND_JACK + bool +--- a/net/Kconfig ++++ b/net/Kconfig +@@ -484,7 +484,7 @@ config NET_DEVLINK + default n + + config PAGE_POOL +- bool ++ bool "Page pool support" + + config PAGE_POOL_STATS + default n diff --git a/target/linux/layerscape/patches-ask/253-ksmbd-config.patch b/target/linux/layerscape/patches-ask/253-ksmbd-config.patch new file mode 100644 index 0000000000..0b74e88cb8 --- /dev/null +++ b/target/linux/layerscape/patches-ask/253-ksmbd-config.patch @@ -0,0 +1,32 @@ +From dcd966fa7ca63f38cf7147e1184d13d66e2ca340 Mon Sep 17 00:00:00 2001 +From: OpenWrt community +Date: Wed, 13 Jul 2022 13:33:30 +0200 +Subject: [PATCH] Kconfig: add tristate for OID and ASNI string + +--- + init/Kconfig | 2 +- + lib/Kconfig | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -2066,7 +2066,7 @@ config PADATA + bool + + config ASN1 +- tristate ++ tristate "ASN1" + help + Build a simple ASN.1 grammar compiler that produces a bytecode output + that can be interpreted by the ASN.1 stream decoder and used to +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -642,7 +642,7 @@ config LIBFDT + bool + + config OID_REGISTRY +- tristate ++ tristate "OID" + help + Enable fast lookup object identifier registry. + diff --git a/target/linux/layerscape/patches-ask/259-regmap_dynamic.patch b/target/linux/layerscape/patches-ask/259-regmap_dynamic.patch new file mode 100644 index 0000000000..72b282005e --- /dev/null +++ b/target/linux/layerscape/patches-ask/259-regmap_dynamic.patch @@ -0,0 +1,156 @@ +From 811d9e2268a62b830cfe93cd8bc929afcb8b198b Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 15 Jul 2017 21:12:38 +0200 +Subject: kernel: move regmap bloat out of the kernel image if it is only being used in modules + +lede-commit: 96f39119815028073583e4fca3a9c5fe9141e998 +Signed-off-by: Felix Fietkau +--- + drivers/base/regmap/Kconfig | 15 ++++++++++----- + drivers/base/regmap/Makefile | 12 ++++++++---- + drivers/base/regmap/regmap.c | 3 +++ + include/linux/regmap.h | 2 +- + 4 files changed, 22 insertions(+), 10 deletions(-) + +--- a/drivers/base/regmap/Kconfig ++++ b/drivers/base/regmap/Kconfig +@@ -4,8 +4,7 @@ + # subsystems should select the appropriate symbols. + + config REGMAP +- bool +- default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SOUNDWIRE_MBQ || REGMAP_SCCB || REGMAP_I3C || REGMAP_SPI_AVMM || REGMAP_MDIO || REGMAP_FSI) ++ tristate + select IRQ_DOMAIN if REGMAP_IRQ + select MDIO_BUS if REGMAP_MDIO + help +@@ -19,7 +18,7 @@ config REGMAP + + config REGMAP_KUNIT + tristate "KUnit tests for regmap" +- depends on KUNIT && REGMAP ++ depends on KUNIT + default KUNIT_ALL_TESTS + select REGMAP_RAM + +@@ -34,60 +33,76 @@ config REGMAP_BUILD + normally enabled. + + config REGMAP_AC97 ++ select REGMAP + tristate + + config REGMAP_I2C ++ select REGMAP + tristate + depends on I2C + + config REGMAP_SLIMBUS ++ select REGMAP + tristate + depends on SLIMBUS + + config REGMAP_SPI ++ select REGMAP + tristate + depends on SPI + + config REGMAP_SPMI ++ select REGMAP + tristate + depends on SPMI + + config REGMAP_W1 ++ select REGMAP + tristate + depends on W1 + + config REGMAP_MDIO ++ select REGMAP + tristate + + config REGMAP_MMIO ++ select REGMAP + tristate + + config REGMAP_IRQ ++ select REGMAP + bool + + config REGMAP_RAM ++ select REGMAP + tristate + + config REGMAP_SOUNDWIRE ++ select REGMAP + tristate + depends on SOUNDWIRE + + config REGMAP_SOUNDWIRE_MBQ ++ select REGMAP + tristate + depends on SOUNDWIRE + + config REGMAP_SCCB ++ select REGMAP + tristate + depends on I2C + + config REGMAP_I3C ++ select REGMAP + tristate + depends on I3C + + config REGMAP_SPI_AVMM ++ select REGMAP + tristate + depends on SPI + + config REGMAP_FSI ++ select REGMAP + tristate + depends on FSI +--- a/drivers/base/regmap/Makefile ++++ b/drivers/base/regmap/Makefile +@@ -2,9 +2,11 @@ + # For include/trace/define_trace.h to include trace.h + CFLAGS_regmap.o := -I$(src) + +-obj-$(CONFIG_REGMAP) += regmap.o regcache.o +-obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o regcache-maple.o +-obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o ++regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-flat.o regcache-maple.o ++ifdef CONFIG_DEBUG_FS ++regmap-core-objs += regmap-debugfs.o ++endif ++obj-$(CONFIG_REGMAP) += regmap-core.o + obj-$(CONFIG_REGMAP_KUNIT) += regmap-kunit.o + obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o + obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o +--- a/drivers/base/regmap/regmap.c ++++ b/drivers/base/regmap/regmap.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -3545,3 +3546,5 @@ static int __init regmap_initcall(void) + return 0; + } + postcore_initcall(regmap_initcall); ++ ++MODULE_LICENSE("GPL"); +--- a/include/linux/regmap.h ++++ b/include/linux/regmap.h +@@ -197,7 +197,7 @@ struct reg_sequence { + __ret ?: __tmp; \ + }) + +-#ifdef CONFIG_REGMAP ++#if IS_REACHABLE(CONFIG_REGMAP) + + enum regmap_endian { + /* Unspecified -> 0 -> Backwards compatible default */ diff --git a/target/linux/layerscape/patches-ask/260-crypto_test_dependencies.patch b/target/linux/layerscape/patches-ask/260-crypto_test_dependencies.patch new file mode 100644 index 0000000000..ce900a87ea --- /dev/null +++ b/target/linux/layerscape/patches-ask/260-crypto_test_dependencies.patch @@ -0,0 +1,54 @@ +From fd1799b0bf5efa46dd3e6dfbbf3955564807e508 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:12:51 +0200 +Subject: kernel: prevent cryptomgr from pulling in useless extra dependencies for tests that are not run + +Reduces kernel size after LZMA by about 5k on MIPS + +lede-commit: 044c316167e076479a344c59905e5b435b84a77f +Signed-off-by: Felix Fietkau +--- + crypto/Kconfig | 13 ++++++------- + crypto/algboss.c | 4 ++++ + 2 files changed, 10 insertions(+), 7 deletions(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -149,15 +149,15 @@ config CRYPTO_MANAGER + cbc(aes). + + config CRYPTO_MANAGER2 +- def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y) +- select CRYPTO_ACOMP2 +- select CRYPTO_AEAD2 +- select CRYPTO_AKCIPHER2 +- select CRYPTO_SIG2 +- select CRYPTO_HASH2 +- select CRYPTO_KPP2 +- select CRYPTO_RNG2 +- select CRYPTO_SKCIPHER2 ++ def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y && !CRYPTO_MANAGER_DISABLE_TESTS) ++ select CRYPTO_ACOMP2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_AEAD2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_AKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_SIG2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_HASH2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_KPP2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_RNG2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_SKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS + + config CRYPTO_USER + tristate "Userspace cryptographic algorithm configuration" +--- a/crypto/algboss.c ++++ b/crypto/algboss.c +@@ -203,6 +203,10 @@ static int cryptomgr_schedule_test(struc + memcpy(param->alg, alg->cra_name, sizeof(param->alg)); + param->type = alg->cra_flags; + ++#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS ++ param->type |= CRYPTO_ALG_TESTED; ++#endif ++ + thread = kthread_run(cryptomgr_test, param, "cryptomgr_test"); + if (IS_ERR(thread)) + goto err_free_param; diff --git a/target/linux/layerscape/patches-ask/261-lib-arc4-unhide.patch b/target/linux/layerscape/patches-ask/261-lib-arc4-unhide.patch new file mode 100644 index 0000000000..f1e1ad4c40 --- /dev/null +++ b/target/linux/layerscape/patches-ask/261-lib-arc4-unhide.patch @@ -0,0 +1,24 @@ +From 241e5d3f7b0dd3c01f8c7fa83cbc9a3882286d53 Mon Sep 17 00:00:00 2001 +From: OpenWrt community +Date: Wed, 13 Jul 2022 13:35:18 +0200 +Subject: [PATCH] lib/crypto: add tristate string for ARC4 + +This makes it possible to select CONFIG_CRYPTO_LIB_ARC4 directly. We +need this to be able to compile this into the kernel and make use of it +from backports. + +--- + lib/crypto/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/crypto/Kconfig ++++ b/lib/crypto/Kconfig +@@ -20,7 +20,7 @@ config CRYPTO_LIB_AESGCM + select CRYPTO_LIB_UTILS + + config CRYPTO_LIB_ARC4 +- tristate ++ tristate "ARC4 cipher library" + + config CRYPTO_LIB_GF128MUL + tristate diff --git a/target/linux/layerscape/patches-ask/280-rfkill-stubs.patch b/target/linux/layerscape/patches-ask/280-rfkill-stubs.patch new file mode 100644 index 0000000000..ff6638f7a0 --- /dev/null +++ b/target/linux/layerscape/patches-ask/280-rfkill-stubs.patch @@ -0,0 +1,84 @@ +From 236c1acdfef5958010ac9814a9872e0a46fd78ee Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Fri, 7 Jul 2017 17:13:44 +0200 +Subject: rfkill: add fake rfkill support + +allow building of modules depending on RFKILL even if RFKILL is not enabled. + +Signed-off-by: John Crispin +--- + include/linux/rfkill.h | 2 +- + net/Makefile | 2 +- + net/rfkill/Kconfig | 14 +++++++++----- + net/rfkill/Makefile | 2 +- + 4 files changed, 12 insertions(+), 8 deletions(-) + +--- a/include/linux/rfkill.h ++++ b/include/linux/rfkill.h +@@ -64,7 +64,7 @@ struct rfkill_ops { + int (*set_block)(void *data, bool blocked); + }; + +-#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) ++#if defined(CONFIG_RFKILL_FULL) || defined(CONFIG_RFKILL_FULL_MODULE) + /** + * rfkill_alloc - Allocate rfkill structure + * @name: name of the struct -- the string is not copied internally +--- a/net/Makefile ++++ b/net/Makefile +@@ -51,7 +51,7 @@ obj-$(CONFIG_TIPC) += tipc/ + obj-$(CONFIG_NETLABEL) += netlabel/ + obj-$(CONFIG_IUCV) += iucv/ + obj-$(CONFIG_SMC) += smc/ +-obj-$(CONFIG_RFKILL) += rfkill/ ++obj-$(CONFIG_RFKILL_FULL) += rfkill/ + obj-$(CONFIG_NET_9P) += 9p/ + obj-$(CONFIG_CAIF) += caif/ + obj-$(CONFIG_DCB) += dcb/ +--- a/net/rfkill/Kconfig ++++ b/net/rfkill/Kconfig +@@ -2,7 +2,11 @@ + # + # RF switch subsystem configuration + # +-menuconfig RFKILL ++config RFKILL ++ bool ++ default y ++ ++menuconfig RFKILL_FULL + tristate "RF switch subsystem support" + help + Say Y here if you want to have control over RF switches +@@ -14,19 +18,19 @@ menuconfig RFKILL + # LED trigger support + config RFKILL_LEDS + bool +- depends on RFKILL ++ depends on RFKILL_FULL + depends on LEDS_TRIGGERS = y || RFKILL = LEDS_TRIGGERS + default y + + config RFKILL_INPUT + bool "RF switch input support" if EXPERT +- depends on RFKILL ++ depends on RFKILL_FULL + depends on INPUT = y || RFKILL = INPUT + default y if !EXPERT + + config RFKILL_GPIO + tristate "GPIO RFKILL driver" +- depends on RFKILL ++ depends on RFKILL_FULL + depends on GPIOLIB || COMPILE_TEST + default n + help +--- a/net/rfkill/Makefile ++++ b/net/rfkill/Makefile +@@ -5,5 +5,5 @@ + + rfkill-y += core.o + rfkill-$(CONFIG_RFKILL_INPUT) += input.o +-obj-$(CONFIG_RFKILL) += rfkill.o ++obj-$(CONFIG_RFKILL_FULL) += rfkill.o + obj-$(CONFIG_RFKILL_GPIO) += rfkill-gpio.o diff --git a/target/linux/layerscape/patches-ask/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch b/target/linux/layerscape/patches-ask/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch new file mode 100644 index 0000000000..a9b753cf03 --- /dev/null +++ b/target/linux/layerscape/patches-ask/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch @@ -0,0 +1,59 @@ +From 686c603f67ae87bf21a61b5e4b1564443f41c3ee Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Thu, 20 Oct 2022 03:34:43 +0200 +Subject: [PATCH] net: permit ieee80211_ptr even with no CFG82111 support + +Introduce a new flag CONFIG_CFG80211_HEADERS to compile in ieee80211_ptr +even if CFG80211 support is not compiled in. This is needed for the +backports project and for any downstream wireless driver that loads in +the kernel dynamically. + +Signed-off-by: Christian Marangi +--- + include/linux/netdevice.h | 2 +- + net/batman-adv/hard-interface.c | 2 +- + net/wireless/Kconfig | 4 ++++ + 3 files changed, 6 insertions(+), 2 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -2229,7 +2229,7 @@ struct net_device { + #if IS_ENABLED(CONFIG_AX25) + struct ax25_dev __rcu *ax25_ptr; + #endif +-#if IS_ENABLED(CONFIG_CFG80211) ++#if IS_ENABLED(CONFIG_CFG80211_HEADERS) + struct wireless_dev *ieee80211_ptr; + #endif + #if IS_ENABLED(CONFIG_IEEE802154) || IS_ENABLED(CONFIG_6LOWPAN) +--- a/net/batman-adv/hard-interface.c ++++ b/net/batman-adv/hard-interface.c +@@ -309,7 +309,7 @@ static bool batadv_is_cfg80211_netdev(st + if (!net_device) + return false; + +-#if IS_ENABLED(CONFIG_CFG80211) ++#if IS_ENABLED(CONFIG_CFG80211_HEADERS) + /* cfg80211 drivers have to set ieee80211_ptr */ + if (net_device->ieee80211_ptr) + return true; +--- a/net/wireless/Kconfig ++++ b/net/wireless/Kconfig +@@ -26,6 +26,7 @@ config CFG80211 + # using a different algorithm, though right now they shouldn't + # (this is here rather than below to allow it to be a module) + select CRYPTO_SHA256 if CFG80211_USE_KERNEL_REGDB_KEYS ++ select CFG80211_HEADERS + help + cfg80211 is the Linux wireless LAN (802.11) configuration API. + Enable this if you have a wireless device. +@@ -36,6 +37,9 @@ config CFG80211 + + When built as a module it will be called cfg80211. + ++config CFG80211_HEADERS ++ bool "cfg80211 - headers support" ++ + if CFG80211 + + config NL80211_TESTMODE -- 2.47.3