From 141ccfd5483d115beb8e81ff94b871f8516c3a18 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 24 Nov 2024 21:15:08 +0100 Subject: [PATCH 001/119] ramips: mt7621: support openwrt,netdev-name for renaming interfaces Edgerouter X currently has its eth1 port on the switch missing since there is a naming conflict currently. So, as the root cause is mixing kernel support for DSA interfaces having predictable names set via "label" property vs others having it assigned dynamically lets avoid the conflict by using our own custom property as suggested upstream [1]. So, add support via "openwrt,netdev-name" property and use it on ERX. Fixes: 2a25c6ace8d8 ("ramips: get rid of downstream network device label patch") Fixes: #15643 Link: https://github.com/openwrt/openwrt/pull/17062 Signed-off-by: Robert Marko (cherry picked from commit 5695267847c2fe51290fdbde6ecd7114654f7988) --- .../ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts | 3 ++- .../ramips/dts/mt7621_ubnt_edgerouter-x.dts | 2 +- .../ramips/dts/mt7621_ubnt_edgerouter-x.dtsi | 17 +++++++++++------ .../base-files/lib/preinit/04_set_netdev_label | 8 ++++++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts index 50a77c3877..9f1e0a8d20 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts @@ -69,11 +69,12 @@ ports { port@5 { reg = <5>; - label = "eth5"; + openwrt,netdev-name = "eth5"; phy-handle = <&ephy7>; phy-mode = "rgmii-rxid"; nvmem-cells = <&macaddr_factory_22 5>; nvmem-cell-names = "mac-address"; + /delete-property/ label; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts index 80467c88e9..c0230e13b4 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts @@ -7,7 +7,7 @@ &gmac1 { status = "okay"; - label = "eth0"; + openwrt,netdev-name = "eth0"; phy-handle = <ðphy0>; nvmem-cells = <&macaddr_factory_22 0>; diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi index 0902ad56b9..7648e42982 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi @@ -22,42 +22,47 @@ &gmac0 { nvmem-cells = <&macaddr_factory_22 0>; nvmem-cell-names = "mac-address"; - label = "dsa"; + openwrt,netdev-name = "dsa"; }; &switch0 { ports { port@0 { status = "okay"; - label = "eth0"; + openwrt,netdev-name = "eth0"; + /delete-property/ label; }; port@1 { status = "okay"; - label = "eth1"; + openwrt,netdev-name = "eth1"; nvmem-cells = <&macaddr_factory_22 1>; nvmem-cell-names = "mac-address"; + /delete-property/ label; }; port@2 { status = "okay"; - label = "eth2"; + openwrt,netdev-name = "eth2"; nvmem-cells = <&macaddr_factory_22 2>; nvmem-cell-names = "mac-address"; + /delete-property/ label; }; port@3 { status = "okay"; - label = "eth3"; + openwrt,netdev-name = "eth3"; nvmem-cells = <&macaddr_factory_22 3>; nvmem-cell-names = "mac-address"; + /delete-property/ label; }; port@4 { status = "okay"; - label = "eth4"; + openwrt,netdev-name = "eth4"; nvmem-cells = <&macaddr_factory_22 4>; nvmem-cell-names = "mac-address"; + /delete-property/ label; }; }; }; diff --git a/target/linux/ramips/mt7621/base-files/lib/preinit/04_set_netdev_label b/target/linux/ramips/mt7621/base-files/lib/preinit/04_set_netdev_label index 110e023b96..2c5e420f93 100644 --- a/target/linux/ramips/mt7621/base-files/lib/preinit/04_set_netdev_label +++ b/target/linux/ramips/mt7621/base-files/lib/preinit/04_set_netdev_label @@ -10,6 +10,14 @@ set_netdev_labels() { [ "$netdev" = "$label" ] && continue ip link set "$netdev" name "$label" done + + for dir in /sys/class/net/*; do + [ -r "$dir/of_node/openwrt,netdev-name" ] || continue + read -r label < "$dir/of_node/openwrt,netdev-name" + netdev="${dir##*/}" + [ "$netdev" = "$label" ] && continue + ip link set "$netdev" name "$label" + done } boot_hook_add preinit_main set_netdev_labels From 79dafe4ad1be6619fa8a13d7db02f7ba43f51853 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 2 Nov 2024 20:22:35 +0000 Subject: [PATCH 002/119] kernel: modules: package driver for generic MIPI DBI TFT panels Package kmod-drm-panel-mipi-dbi as well as modules it depends on in order to support a wide range of MIPI DBI complaint SPI-connected TFT panels. See https://github.com/notro/panel-mipi-dbi/ for more information on how to use specific panels. Signed-off-by: Daniel Golle (cherry picked from commit 0a7b7ef27cfc00521a0f99de073a7168f1b79e8f) --- package/kernel/linux/modules/video.mk | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 52fc55bbad..8b4585a624 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -311,6 +311,38 @@ endef $(eval $(call KernelPackage,drm-exec)) +define KernelPackage/drm-dma-helper + SUBMENU:=$(VIDEO_MENU) + HIDDEN:=1 + TITLE:=GEM DMA helper functions + DEPENDS:=@DISPLAY_SUPPORT +kmod-drm-kms-helper + KCONFIG:=CONFIG_DRM_GEM_DMA_HELPER + FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_dma_helper.ko + AUTOLOAD:=$(call AutoProbe,drm_dma_helper) +endef + +define KernelPackage/drm-dma-helper/description + GEM DMA helper functions. +endef + +$(eval $(call KernelPackage,drm-dma-helper)) + +define KernelPackage/drm-mipi-dbi + SUBMENU:=$(VIDEO_MENU) + HIDDEN:=1 + TITLE:=MIPI DBI helpers + DEPENDS:=@DISPLAY_SUPPORT +kmod-backlight +kmod-drm-kms-helper + KCONFIG:=CONFIG_DRM_MIPI_DBI + FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm_mipi_dbi.ko + AUTOLOAD:=$(call AutoProbe,drm_mipi_dbi) +endef + +define KernelPackage/drm-mipi-dbi/description + MIPI Display Bus Interface (DBI) LCD controller support. +endef + +$(eval $(call KernelPackage,drm-mipi-dbi)) + define KernelPackage/drm-ttm SUBMENU:=$(VIDEO_MENU) TITLE:=GPU memory management subsystem @@ -484,6 +516,24 @@ endef $(eval $(call KernelPackage,drm-imx-ldb)) +define KernelPackage/drm-panel-mipi-dbi + SUBMENU:=$(VIDEO_MENU) + TITLE:=Generic MIPI DBI LCD panel + DEPENDS:=+kmod-drm-mipi-dbi +kmod-drm-dma-helper + KCONFIG:=CONFIG_DRM_PANEL_MIPI_DBI \ + CONFIG_DRM_FBDEV_EMULATION=y \ + CONFIG_DRM_FBDEV_OVERALLOC=100 + FILES:= \ + $(LINUX_DIR)/drivers/gpu/drm/tiny/panel-mipi-dbi.ko + AUTOLOAD:=$(call AutoProbe,panel-mipi-dbi) +endef + +define KernelPackage/drm-panel-mipi-dbi/description + Generic driver for MIPI Alliance Display Bus Interface +endef + +$(eval $(call KernelPackage,drm-panel-mipi-dbi)) + define KernelPackage/drm-radeon SUBMENU:=$(VIDEO_MENU) TITLE:=Radeon DRM support From 1d612c33de2a57157b3d92e6df0d03fabcbf30b9 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 10 Nov 2024 00:31:18 +0100 Subject: [PATCH 003/119] include: cmake.mk: honor CONFIG_DEBUG Set CMAKE_BUILD_TYPE according to CONFIG_DEBUG. Signed-off-by: Daniel Golle (cherry picked from commit fc9ec5bd3d22d50654af154fc779517fa7aecb33) --- include/cmake.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cmake.mk b/include/cmake.mk index 87309dd045..f59410c2f3 100644 --- a/include/cmake.mk +++ b/include/cmake.mk @@ -97,7 +97,7 @@ define Build/Configure/Default -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_VERSION=1 \ -DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=$(if $(CONFIG_DEBUG),Debug,Release) \ -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \ -DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \ From 634ac989e999cf0fe47f28ae7ef52b1b41b79670 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 10 Nov 2024 00:32:05 +0100 Subject: [PATCH 004/119] include: meson.mk: honor CONFIG_DEBUG Set buildtype according to CONFIG_DEBUG. Signed-off-by: Daniel Golle (cherry picked from commit be3e7a84bd37f29e14e4c6a89b8c79bc9808c36c) --- include/meson.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/meson.mk b/include/meson.mk index 2a20c2bd6b..ff452d8b01 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -124,7 +124,7 @@ define Build/Configure/Meson $(call Meson/CreateCrossFile,$(PKG_BUILD_DIR)/openwrt-cross.txt) $(call Meson, \ setup \ - --buildtype plain \ + --buildtype $(if $(CONFIG_DEBUG),debug,plain) \ --native-file $(PKG_BUILD_DIR)/openwrt-native.txt \ --cross-file $(PKG_BUILD_DIR)/openwrt-cross.txt \ -Ddefault_library=both \ From 0de3c201b139979dd22b4f723846b85c4ad6f170 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 13 Nov 2024 21:58:38 +0000 Subject: [PATCH 005/119] procd: update to git HEAD 7330fa5 initd: mount /sys and /proc with MS_RELATIME Fixes mounting /proc in unpriviledged user namespace. Signed-off-by: Daniel Golle (cherry picked from commit 1e8505ac4e88212106fe78486cfcbe9cae7660f9) --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 86de4babfd..81e133f55b 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=0f494faf2811af6cd7332acda8049ad9713dcabc4b2885dc14acbd9f61920be1 -PKG_SOURCE_DATE:=2024-11-06 -PKG_SOURCE_VERSION:=109fa41b2321506280397e03757976c468832668 +PKG_MIRROR_HASH:=56c5f71da3f68036c63ae59d01992785e74027726da5973297895985cd27c215 +PKG_SOURCE_DATE:=2024-11-13 +PKG_SOURCE_VERSION:=7330fa55c5211eb7b3c675d1c7b8281b69b53553 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 39d6d318a6c3427ef7fc91b14bdbd316837f1446 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 16 Nov 2024 15:29:24 +0000 Subject: [PATCH 006/119] mtd-utils: add ubihealthd to nand-utils Add ubihealthd to the nand-utils package, auto-create UCI config for each UBI device and launch the daemon on boot. The default time interval between scrubbing a random PED is 120 seconds which means that a fully used 128 MiB flash chip gets scrubbed in about a day and a half. The interval can be adjusted in UCI using the 'interval' option. Suggested-by: Rodrigo Balerdi Signed-off-by: Daniel Golle Link: https://github.com/openwrt/openwrt/pull/16973 Signed-off-by: Christian Marangi (cherry picked from commit 7e287b563aa1043a1af54d5e2b0bd96326371732) --- package/utils/mtd-utils/Makefile | 12 +++++++-- .../utils/mtd-utils/files/ubihealthd.defaults | 18 +++++++++++++ package/utils/mtd-utils/files/ubihealthd.init | 27 +++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 package/utils/mtd-utils/files/ubihealthd.defaults create mode 100644 package/utils/mtd-utils/files/ubihealthd.init diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index 046572e83b..0dc8831251 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -65,12 +65,20 @@ CONFIGURE_ARGS += \ --without-lzo \ --without-zlib +define Package/ubi-utils/conffiles +/etc/config/ubihealthd +endef + define Package/ubi-utils/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/sbin/{ubiattach,ubicrc32,ubiblock,ubidetach,ubiformat,ubimkvol} $(1)/usr/sbin/ + $(PKG_INSTALL_DIR)/usr/sbin/{ubiattach,ubicrc32,ubiblock,ubidetach,ubiformat,ubihealthd} $(1)/usr/sbin/ $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/sbin/{ubinfo,ubinize,ubirename,ubirmvol,ubirsvol,ubiupdatevol} $(1)/usr/sbin/ + $(PKG_INSTALL_DIR)/usr/sbin/{ubimkvol,ubinfo,ubinize,ubirename,ubirmvol,ubirsvol,ubiupdatevol} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ubihealthd.init $(1)/etc/init.d/ubihealthd + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_DATA) ./files/ubihealthd.defaults $(1)/etc/uci-defaults/ubihealthd endef define Package/nand-utils/install diff --git a/package/utils/mtd-utils/files/ubihealthd.defaults b/package/utils/mtd-utils/files/ubihealthd.defaults new file mode 100644 index 0000000000..5222961bd4 --- /dev/null +++ b/package/utils/mtd-utils/files/ubihealthd.defaults @@ -0,0 +1,18 @@ +#!/bin/sh + +[ -e "/etc/config/ubihealthd" ] && exit 0 +[ ! -e "/sys/class/ubi" ] && exit 0 + +touch "/etc/config/ubihealthd" + +for ubidev in /sys/class/ubi/*/total_eraseblocks; do + ubidev="${ubidev%/*}" + ubidev="${ubidev##*/}" + uci batch < Date: Fri, 22 Nov 2024 09:00:25 -0800 Subject: [PATCH 007/119] build: profiles.json: add kernel version information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently downstream tools like ASU lack information about kernel version to find out the relevant kmod build folder on downloads server. So lets fix it by providing a new `linux_kernel` JSON array which would for the start provide Linux kernel version, revision and vermagic information. "linux_kernel": { "release": "1", "vermagic": "b57450c07d3a786158c3601fc5cee57d", "version": "6.6.61" }, Fixes: openwrt/openwrt#17036 Fixes: efahl/owut#9 Co-developed-by: Petr Štetiar Signed-off-by: Eric Fahlgren Link: https://github.com/openwrt/openwrt/pull/17042 Signed-off-by: Petr Štetiar (cherry picked from commit c857145e034f623e31ab2028049a547ecd94ce85) --- scripts/json_overview_image_info.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index 0d2cf7f1ef..96921c2743 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -47,7 +47,13 @@ for device_id, profile in output.get("profiles", {}).items(): if output: - default_packages, output["arch_packages"] = run( + ( + default_packages, + output["arch_packages"], + linux_version, + linux_release, + linux_vermagic, + ) = run( [ "make", "--no-print-directory", @@ -55,6 +61,9 @@ if output: "target/linux/", "val.DEFAULT_PACKAGES", "val.ARCH_PACKAGES", + "val.LINUX_VERSION", + "val.LINUX_RELEASE", + "val.LINUX_VERMAGIC", "V=s", ], stdout=PIPE, @@ -64,7 +73,11 @@ if output: ).stdout.splitlines() output["default_packages"] = sorted(default_packages.split()) - + output["linux_kernel"] = { + "version": linux_version, + "release": linux_release, + "vermagic": linux_vermagic, + } output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":"))) else: print("JSON info file script could not find any JSON files for target") From fbe50c67c615a2df77072586fc4a5c2144bb9597 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Oct 2024 18:56:30 -0700 Subject: [PATCH 008/119] ipq40xx: use devm for mutex_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoids having to call mutex_destroy in remove. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16755 Signed-off-by: Robert Marko (cherry picked from commit 57f2c72505f24b41fd9beaef3a8aa713b436cdb9) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- ...-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch b/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch index 20dd345c69..9bd5ca515e 100644 --- a/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch +++ b/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch @@ -87,7 +87,7 @@ Signed-off-by: Robert Marko if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge)) --- /dev/null +++ b/drivers/net/dsa/qca/qca8k-ipq4019.c -@@ -0,0 +1,946 @@ +@@ -0,0 +1,948 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2009 Felix Fietkau @@ -989,7 +989,9 @@ Signed-off-by: Robert Marko + priv->ds->num_ports = QCA8K_IPQ4019_NUM_PORTS; + priv->ds->priv = priv; + priv->ds->ops = &qca8k_ipq4019_switch_ops; -+ mutex_init(&priv->reg_mutex); ++ ret = devm_mutex_init(dev, &priv->reg_mutex); ++ if (ret) ++ return ret; + platform_set_drvdata(pdev, priv); + + return dsa_register_switch(priv->ds); From 3451a7035600d06631dc05333ddeb63ebdfda16e Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sat, 2 Nov 2024 22:24:21 +0800 Subject: [PATCH 009/119] kernel: can: package driver for Geschwister Schneider interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Package gs_usb CAN driver, which is for Geschwister Schneider and bytewerk.org candleLight compatible USB/CAN interfaces. Signed-off-by: Chuanhong Guo (cherry picked from commit ef4df2b5e9d66a6461982a0a81f928abb0f6a074) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/can.mk | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/package/kernel/linux/modules/can.mk b/package/kernel/linux/modules/can.mk index c86d02d8de..1a4c81cc31 100644 --- a/package/kernel/linux/modules/can.mk +++ b/package/kernel/linux/modules/can.mk @@ -245,6 +245,25 @@ endef $(eval $(call KernelPackage,can-usb-esd)) +define KernelPackage/can-usb-gs + TITLE:=Geschwister Schneider UG interfaces + KCONFIG:=CONFIG_CAN_GS_USB + FILES:= \ + $(LINUX_DIR)/drivers/net/can/usb/gs_usb.ko + AUTOLOAD:=$(call AutoProbe,gs_usb) + $(call AddDepends/can,+kmod-usb-core) +endef + +define KernelPackage/can-usb-gsr/description + This driver supports the Geschwister Schneider and + bytewerk.org candleLight compatible + (https://github.com/candle-usb/candleLight_fw) USB/CAN + interfaces. +endef + +$(eval $(call KernelPackage,can-usb-gs)) + + define KernelPackage/can-usb-kvaser TITLE:=Kvaser CAN/USB interface KCONFIG:=CONFIG_CAN_KVASER_USB From 0cf557876ae77985f120e3fbf2b8007d08b5495d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 Oct 2024 14:51:29 -0700 Subject: [PATCH 010/119] ramips: mt7621: convert usb power to regulators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These things are regulators. Should silence dmesg messages about using dummy regulators. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16804 Signed-off-by: Robert Marko (cherry picked from commit e612900ae0fd6c4624fa661e004536216409107f) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../ramips/dts/mt7621_d-team_newifi-d2.dts | 20 ++++++++-------- target/linux/ramips/dts/mt7621_humax_e10.dts | 23 +++++++++++-------- .../dts/mt7621_mikrotik_routerboard-7xx.dtsi | 19 ++++++++++----- .../dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi | 19 ++++++++++----- .../ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi | 19 ++++++++++----- .../ramips/dts/mt7621_zyxel_lte3301-plus.dts | 19 +++++++-------- .../ramips/dts/mt7621_zyxel_lte5398-m904.dts | 19 ++++++++++----- 7 files changed, 86 insertions(+), 52 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts index 9d426fb17d..00ff80e3ca 100644 --- a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -80,15 +80,13 @@ }; }; - gpio_export { - compatible = "gpio-export"; - #size-cells = <0>; - - power_usb3 { - gpio-export,name = "power_usb3"; - gpio-export,output = <1>; - gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; - }; + reg_power_usb3: regulator { + compatible = "regulator-fixed"; + regulator-name = "power_usb3"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + enable-active-high; }; }; @@ -155,6 +153,10 @@ }; }; +&xhci { + vbus-supply = <®_power_usb3>; +}; + &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7621_humax_e10.dts b/target/linux/ramips/dts/mt7621_humax_e10.dts index 39eac32d53..7ba772d5e5 100644 --- a/target/linux/ramips/dts/mt7621_humax_e10.dts +++ b/target/linux/ramips/dts/mt7621_humax_e10.dts @@ -19,16 +19,6 @@ label-mac-device = &gmac1; }; - gpio-export { - compatible = "gpio-export"; - - gpio-usb-power { - gpio-export,name = "power:usb"; - gpio-export,output = <1>; - gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; - }; - }; - leds { compatible = "gpio-leds"; @@ -65,6 +55,15 @@ linux,code = ; }; }; + + reg_power_usb: regulator { + compatible = "regulator-fixed"; + regulator-name = "power:usb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &spi0 { @@ -131,6 +130,10 @@ }; }; +&xhci { + vbus-supply = <®_power_usb>; +}; + &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi index cdca47f8b8..4a3de8cfba 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi @@ -13,13 +13,20 @@ gpio-export,output = <0>; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; }; - - usb_power { - gpio-export,name = "usb_power"; - gpio-export,output = <1>; - gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; - }; }; + + reg_usb_power: regulator { + compatible = "regulator-fixed"; + regulator-name = "usb_power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&xhci { + vbus-supply = <®_usb_power>; }; &keys { diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi index c3712fea7b..c70b3330e9 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi @@ -48,6 +48,15 @@ }; }; + reg_power_usb: regulator { + compatible = "regulator-fixed"; + regulator-name = "power_usb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + watchdog { compatible = "linux,wdt-gpio"; gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; @@ -72,15 +81,13 @@ gpio-export,output = <1>; gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; }; - - ext-usb { - gpio-export,name = "ext-usb"; - gpio-export,output = <1>; - gpios = <&gpio 6 GPIO_ACTIVE_LOW>; - }; }; }; +&xhci { + vbus-supply = <®_power_usb>; +}; + &sdhci { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi index dcad7b26d2..3e2a593ae7 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi @@ -47,6 +47,15 @@ }; }; + reg_power_usb: regulator { + compatible = "regulator-fixed"; + regulator-name = "power_usb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + watchdog { compatible = "linux,wdt-gpio"; gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; @@ -71,15 +80,13 @@ gpio-export,output = <1>; gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; }; - - ext-usb { - gpio-export,name = "ext-usb"; - gpio-export,output = <1>; - gpios = <&gpio 6 GPIO_ACTIVE_LOW>; - }; }; }; +&xhci { + vbus-supply = <®_power_usb>; +}; + &sdhci { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts index 9eed123157..88894325b5 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts @@ -96,17 +96,18 @@ }; + reg_power_usb: regulator { + compatible = "regulator-fixed"; + regulator-name = "power_usb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; -&gpio { - status = "okay"; - - enable_usb_power { - gpio-hog; - line-name = "enable USB power"; - gpios = <7 GPIO_ACTIVE_HIGH>; - output-high; - }; +&xhci { + vbus-supply = <®_power_usb>; }; &nand { diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts index e121077b0a..e6ff5ecf6a 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts @@ -92,13 +92,20 @@ gpio-export,output = <0>; gpios = <&gpio 27 GPIO_ACTIVE_LOW>; }; - - usb_power { - gpio-export,name = "usb_power"; - gpio-export,output = <1>; - gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; - }; }; + + reg_usb_power: regulator { + compatible = "regulator-fixed"; + reglator-name = "usb_power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&xhci { + vbus-supply = <®_usb_power>; }; &nand { From e5a20b0f49070f17ac54c7d651dadc3a0a803d03 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 19 Oct 2024 15:49:42 -0700 Subject: [PATCH 011/119] ath79: gpio-latch-miktorik: use gpiochip_get_data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oversight from devm conversion. No need for a custom static inline function. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16747 Signed-off-by: Robert Marko (cherry picked from commit 6d2ed484fa2f62e355893f5e1fe3734c88201bfc) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../ath79/files/drivers/gpio/gpio-latch-mikrotik.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c index 6e3f0f9690..4baed52e57 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c @@ -28,11 +28,6 @@ struct gpio_latch_chip { struct gpio_desc *gpios[GPIO_LATCH_LINES]; }; -static inline struct gpio_latch_chip *to_gpio_latch_chip(struct gpio_chip *gc) -{ - return container_of(gc, struct gpio_latch_chip, gc); -} - static void gpio_latch_lock(struct gpio_latch_chip *glc, bool enable) { mutex_lock(&glc->mutex); @@ -58,7 +53,7 @@ static void gpio_latch_unlock(struct gpio_latch_chip *glc, bool disable) static int gpio_latch_get(struct gpio_chip *gc, unsigned offset) { - struct gpio_latch_chip *glc = to_gpio_latch_chip(gc); + struct gpio_latch_chip *glc = gpiochip_get_data(gc); int ret; gpio_latch_lock(glc, false); @@ -71,7 +66,7 @@ gpio_latch_get(struct gpio_chip *gc, unsigned offset) static void gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value) { - struct gpio_latch_chip *glc = to_gpio_latch_chip(gc); + struct gpio_latch_chip *glc = gpiochip_get_data(gc); bool enable_latch = false; bool disable_latch = false; @@ -88,7 +83,7 @@ gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value) static int gpio_latch_direction_output(struct gpio_chip *gc, unsigned offset, int value) { - struct gpio_latch_chip *glc = to_gpio_latch_chip(gc); + struct gpio_latch_chip *glc = gpiochip_get_data(gc); bool enable_latch = false; bool disable_latch = false; int ret; From ec774fafe60763376f0dd82d34c621eea48dfa5f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 19 Oct 2024 15:51:51 -0700 Subject: [PATCH 012/119] ath79: gpio-rb91x-key: use gpiochip_get_data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need for a custom function that does the same thing. Oversight from devm conversion. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16748 Signed-off-by: Robert Marko (cherry picked from commit e99b5832e801fdf2ec366419797360e09c2348c6) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c index b2c8e63305..02639cf011 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c @@ -41,14 +41,9 @@ struct gpio_rb91x_key { struct gpio_desc *gpio; }; -static inline struct gpio_rb91x_key *to_gpio_rb91x_key(struct gpio_chip *gc) -{ - return container_of(gc, struct gpio_rb91x_key, gc); -} - static int gpio_rb91x_key_get(struct gpio_chip *gc, unsigned offset) { - struct gpio_rb91x_key *drvdata = to_gpio_rb91x_key(gc); + struct gpio_rb91x_key *drvdata = gpiochip_get_data(gc); struct gpio_desc *gpio = drvdata->gpio; int val, bak_val; @@ -97,7 +92,7 @@ static int gpio_rb91x_key_direction_input(struct gpio_chip *gc, unsigned offset) static void gpio_rb91x_key_set(struct gpio_chip *gc, unsigned offset, int value) { - struct gpio_rb91x_key *drvdata = to_gpio_rb91x_key(gc); + struct gpio_rb91x_key *drvdata = gpiochip_get_data(gc); struct gpio_desc *gpio = drvdata->gpio; mutex_lock(&drvdata->mutex); From 70ee25f70f58dcad301b04ab493ff40723064c51 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 4 Nov 2024 22:34:52 +0100 Subject: [PATCH 013/119] packages: drop DEVICE specific dependency for omnia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both packages `ombnia-mcu-firmware` and `omnia-mcutool` would depend on a specific device. The buildbots however build all devices and therefore the package isn't build at all, due to unmet dependencies. While this didn't cause issues with OPKG, APK fails actively due to the missing packages. Drop the specific dependency, however wants to install unrelated firmware on any device can do that anyway. Signed-off-by: Paul Spooren (cherry picked from commit f35a29d63f445d784f1e266eaa6d3825a249cd6c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/firmware/omnia-mcu-firmware/Makefile | 1 - package/utils/omnia-mcutool/Makefile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package/firmware/omnia-mcu-firmware/Makefile b/package/firmware/omnia-mcu-firmware/Makefile index 6f7bd6ca70..9c1c8fbe6c 100644 --- a/package/firmware/omnia-mcu-firmware/Makefile +++ b/package/firmware/omnia-mcu-firmware/Makefile @@ -29,7 +29,6 @@ define Package/omnia-mcu-firmware CATEGORY:=Firmware URL:=https://gitlab.nic.cz/turris/hw/$(PKG_DISTNAME)/-/releases TITLE:=CZ.NIC Turris Omnia MCU firmware - DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia endef define Package/omnia-mcu-firmware/description diff --git a/package/utils/omnia-mcutool/Makefile b/package/utils/omnia-mcutool/Makefile index 2eca0cf190..66f8ffc6d4 100644 --- a/package/utils/omnia-mcutool/Makefile +++ b/package/utils/omnia-mcutool/Makefile @@ -27,7 +27,7 @@ define Package/omnia-mcutool CATEGORY:=Utilities URL:=https://gitlab.nic.cz/turris/$(PKG_NAME) TITLE:=CZ.NIC Turris Omnia MCU utility - DEPENDS:=+libopenssl +omnia-mcu-firmware @TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia + DEPENDS:=+libopenssl +omnia-mcu-firmware endef define Package/omnia-mcutool/description From c4c1bb523f1ae14de049df65c302b817445b00e3 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 5 Nov 2024 20:03:39 +0100 Subject: [PATCH 014/119] fritz-tools: fix mixed indentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: David Bauer (cherry picked from commit 685e979d470a09361defe1612b001dfc3b7d9832) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../utils/fritz-tools/src/fritz_cal_extract.c | 140 +++++++++--------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/package/utils/fritz-tools/src/fritz_cal_extract.c b/package/utils/fritz-tools/src/fritz_cal_extract.c index 2978d86e0c..9899cd53c3 100644 --- a/package/utils/fritz-tools/src/fritz_cal_extract.c +++ b/package/utils/fritz-tools/src/fritz_cal_extract.c @@ -48,86 +48,86 @@ static inline size_t special_min(size_t a, size_t b) is an error reading or writing the files. */ static int inf(FILE *source, FILE *dest, size_t limit, size_t skip) { - int ret; - size_t have; - z_stream strm; - unsigned char in[CHUNK]; - unsigned char out[CHUNK]; + int ret; + size_t have; + z_stream strm; + unsigned char in[CHUNK]; + unsigned char out[CHUNK]; - /* allocate inflate state */ - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.avail_in = 0; - strm.next_in = Z_NULL; - ret = inflateInit(&strm); - if (ret != Z_OK) - return ret; + /* allocate inflate state */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit(&strm); + if (ret != Z_OK) + return ret; - /* decompress until deflate stream ends or end of file */ - do { - strm.avail_in = fread(in, 1, CHUNK, source); - if (ferror(source)) { - (void)inflateEnd(&strm); - return Z_ERRNO; - } - if (strm.avail_in == 0) - break; - strm.next_in = in; + /* decompress until deflate stream ends or end of file */ + do { + strm.avail_in = fread(in, 1, CHUNK, source); + if (ferror(source)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + if (strm.avail_in == 0) + break; + strm.next_in = in; - /* run inflate() on input until output buffer not full */ - do { - strm.avail_out = CHUNK; - strm.next_out = out; - ret = inflate(&strm, Z_NO_FLUSH); - assert(ret != Z_STREAM_ERROR); /* state not clobbered */ - switch (ret) { - case Z_NEED_DICT: - ret = Z_DATA_ERROR; /* and fall through */ - case Z_DATA_ERROR: - case Z_MEM_ERROR: - (void)inflateEnd(&strm); - return ret; - } - have = special_min(limit, CHUNK - strm.avail_out) - skip; - if (fwrite(&out[skip], have, 1, dest) != 1 || ferror(dest)) { - (void)inflateEnd(&strm); - return Z_ERRNO; - } - skip = 0; - limit -= have; - } while (strm.avail_out == 0 && limit > 0); + /* run inflate() on input until output buffer not full */ + do { + strm.avail_out = CHUNK; + strm.next_out = out; + ret = inflate(&strm, Z_NO_FLUSH); + assert(ret != Z_STREAM_ERROR); /* state not clobbered */ + switch (ret) { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; /* and fall through */ + case Z_DATA_ERROR: + case Z_MEM_ERROR: + (void)inflateEnd(&strm); + return ret; + } + have = special_min(limit, CHUNK - strm.avail_out) - skip; + if (fwrite(&out[skip], have, 1, dest) != 1 || ferror(dest)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + skip = 0; + limit -= have; + } while (strm.avail_out == 0 && limit > 0); - /* done when inflate() says it's done */ - } while (ret != Z_STREAM_END && limit > 0); + /* done when inflate() says it's done */ + } while (ret != Z_STREAM_END && limit > 0); - /* clean up and return */ - (void)inflateEnd(&strm); - return (limit == 0 ? Z_OK : (ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR)); + /* clean up and return */ + (void)inflateEnd(&strm); + return (limit == 0 ? Z_OK : (ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR)); } /* report a zlib or i/o error */ static void zerr(int ret) { - switch (ret) { - case Z_ERRNO: - if (ferror(stdin)) - fputs("error reading stdin\n", stderr); - if (ferror(stdout)) - fputs("error writing stdout\n", stderr); - break; - case Z_STREAM_ERROR: - fputs("invalid compression level\n", stderr); - break; - case Z_DATA_ERROR: - fputs("invalid or incomplete deflate data\n", stderr); - break; - case Z_MEM_ERROR: - fputs("out of memory\n", stderr); - break; - case Z_VERSION_ERROR: - fputs("zlib version mismatch!\n", stderr); - } + switch (ret) { + case Z_ERRNO: + if (ferror(stdin)) + fputs("error reading stdin\n", stderr); + if (ferror(stdout)) + fputs("error writing stdout\n", stderr); + break; + case Z_STREAM_ERROR: + fputs("invalid compression level\n", stderr); + break; + case Z_DATA_ERROR: + fputs("invalid or incomplete deflate data\n", stderr); + break; + case Z_MEM_ERROR: + fputs("out of memory\n", stderr); + break; + case Z_VERSION_ERROR: + fputs("zlib version mismatch!\n", stderr); + } } static unsigned int get_num(char *str) From 4b9e9a03108258bffef7d779cb965f5b91608dd7 Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Wed, 17 Apr 2024 10:49:49 +1000 Subject: [PATCH 015/119] rampis: mt7621: Convert Edgerouter-X dts to single kernel config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OEM layout for Edgerouter X provides for two 3MB kernel slots. As of linux 6.1 the kernel images no longer fit and as such Edgerouter X builds have been disabled in Main. Revise the layout to make kernel1 slot 6MB and drop kernel2 slot. This patch applies the required changes to the dts file. Signed-off-by: Tim Lunn Tested-by: Mauri Sandberg Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit dc51c4355d48e91ed8fd06d70f0bf71b0b4bc4d2) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi index 7648e42982..40433c1c43 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi @@ -105,13 +105,8 @@ }; partition@140000 { - label = "kernel1"; - reg = <0x140000 0x300000>; - }; - - partition@440000 { - label = "kernel2"; - reg = <0x440000 0x300000>; + label = "kernel"; + reg = <0x140000 0x600000>; }; partition@740000 { From c2cde63ae654185d2c117ec72c1837b683212734 Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Wed, 17 Apr 2024 12:51:22 +1000 Subject: [PATCH 016/119] rampis: mt7621: Edgerouter-X disable toggling of kernel slots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uboot selects which kernel slot to boot based on a flag in the factory mtd partition. Patch ubnt.sh to ensure always flash to kernel1 slot and update flag if required. Signed-off-by: Tim Lunn Tested-by: Mauri Sandberg Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit 5e355f1f9084c1b6de3151fbcde948d736292d6c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../mt7621/base-files/lib/upgrade/ubnt.sh | 39 ++++--------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/ubnt.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/ubnt.sh index 748ec8e628..7e9d937d79 100644 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/ubnt.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/ubnt.sh @@ -8,32 +8,16 @@ UBNT_ERX_KERNEL_INDEX_OFFSET=160 -ubnt_get_target_kernel() { +ubnt_update_kernel_flag() { local factory_mtd=$1 - local current_kernel_index=$(hexdump -s $UBNT_ERX_KERNEL_INDEX_OFFSET -n 1 -e '/1 "%X "' ${factory_mtd}) + local kernel_index=$(hexdump -s $UBNT_ERX_KERNEL_INDEX_OFFSET -n 1 -e '/1 "%X "' ${factory_mtd}) - if [ $current_kernel_index == "0" ]; then - echo 'kernel2' - elif [ $current_kernel_index == "1" ]; then - echo 'kernel1' - fi -} - -ubnt_update_target_kernel() { - local factory_mtd=$1 - local kernel_part=$2 - - local new_kernel_index - if [ $kernel_part == "kernel1" ]; then - new_kernel_index="\x00" - elif [ $kernel_part == "kernel2" ]; then - new_kernel_index="\x01" - else - echo 'Unknown kernel image index' >&2 - return 1 + if [ $kernel_index = "0" ]; then + echo "Kernel flag already set to kernel slot 1" + return 0 fi - if ! (echo -e $new_kernel_index | dd of=${factory_mtd} bs=1 count=1 seek=$UBNT_ERX_KERNEL_INDEX_OFFSET); then + if ! (echo -e "\x00" | dd of=${factory_mtd} bs=1 count=1 seek=$UBNT_ERX_KERNEL_INDEX_OFFSET); then echo 'Failed to update kernel bootup index' >&2 return 1 fi @@ -46,15 +30,6 @@ platform_upgrade_ubnt_erx() { exit 1 fi - local kernel_part="$(ubnt_get_target_kernel ${factory_mtd})" - if [ -z "$kernel_part" ]; then - echo "cannot find factory partition" >&2 - exit 1 - fi - - # This is a global defined in nand.sh, sets partition kernel will be flashed into - CI_KERNPART=${kernel_part} - #Remove volume possibly left over from stock firmware local ubidev="$( nand_find_ubi "$CI_UBIPART" )" if [ -z "$ubidev" ]; then @@ -72,7 +47,7 @@ platform_upgrade_ubnt_erx() { [ -n "$troot_ubivol" ] && ubirmvol /dev/$ubidev -N troot || true fi - ubnt_update_target_kernel ${factory_mtd} ${kernel_part} || exit 1 + ubnt_update_kernel_flag ${factory_mtd} || exit 1 nand_do_upgrade "$1" } From 1fd7e5124ebe06b4fab8b619d38f695828640905 Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Wed, 17 Apr 2024 10:51:35 +1000 Subject: [PATCH 017/119] rampis: mt7621: resize Edgerouter-X kernel size to 6MB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the updated partition layout set in dts, set the KERNEL_SIZE parameter to 6MB allowing builds of Linux 6.1 and later to fit. Signed-off-by: Tim Lunn Tested-by: Mauri Sandberg Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit 09a6bffb6e0a714f20d71043ae8382af4c5925b6) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/image/mt7621.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 9654e237a8..27adb06bf7 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2860,7 +2860,7 @@ define Device/ubnt_edgerouter_common DEVICE_VENDOR := Ubiquiti IMAGE_SIZE := 256768k FILESYSTEMS := squashfs - KERNEL_SIZE := 3145728 + KERNEL_SIZE := 6144k KERNEL_INITRAMFS := $$(KERNEL) | \ ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata From a5efcbd327f837b4ca425ac46d9e63e203580d4f Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Thu, 18 Apr 2024 10:56:07 +1000 Subject: [PATCH 018/119] rampis: mt7621: Edgerouter-X set compat version message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refer user to the wiki page for instructions on how to migrate to the new kernel layout. Signed-off-by: Tim Lunn Tested-by: Mauri Sandberg Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit 70c371d91cda300d7c655f019cb2076d2dd537fb) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/image/mt7621.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 27adb06bf7..f4dacba894 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2865,6 +2865,10 @@ define Device/ubnt_edgerouter_common ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata DEVICE_PACKAGES += -wpad-basic-mbedtls -uboot-envtools + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := Partition table has been changed due to kernel size restrictions. \ + Refer to the wiki page for instructions to migrate to the new layout: \ + https://openwrt.org/toh/ubiquiti/edgerouter_x_er-x_ka DEFAULT := n endef From 1c934c7dc7355cb5ff9dda5a52256d74dfd2aa83 Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Thu, 18 Apr 2024 10:57:17 +1000 Subject: [PATCH 019/119] rampis: mt7621: Edgerouter-X update compat version to 2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use compat version to indicate that the new layout for larger kernels is in place. This handled by the patch to ubnt.sh to always select the kernel1 slot for flashing and as active kernel slot. Signed-off-by: Tim Lunn Tested-by: Mauri Sandberg Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit 1bdbd511b27017157e92ffe128e66853d169dcbf) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../ramips/mt7621/base-files/etc/board.d/05_compat-version | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version index acc69021d0..156fb1735e 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version @@ -8,6 +8,8 @@ board_config_update case "$(board_name)" in + ubnt,edgerouter-x|\ + ubnt,edgerouter-x-sfp|\ iptime,ax2004m) ucidef_set_compat_version "2.0" ;; From 14880209d5c38a9146359ea439783f8c02ea2f7b Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Thu, 18 Apr 2024 10:53:54 +1000 Subject: [PATCH 020/119] rampis: mt7621: Re-enable Edgerouter-X image builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the new layout providing 6MB for kernel there will be no issues with kernel size affecting build of images. Re-enable image builds for Edgerouter-X and X-SFP. Signed-off-by: Tim Lunn Tested-by: Mauri Sandberg Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit 71b4842e3bdaed91cd2daa4b28a208559c3de7c6) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/image/mt7621.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index f4dacba894..b9692c5f3a 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2869,7 +2869,6 @@ define Device/ubnt_edgerouter_common DEVICE_COMPAT_MESSAGE := Partition table has been changed due to kernel size restrictions. \ Refer to the wiki page for instructions to migrate to the new layout: \ https://openwrt.org/toh/ubiquiti/edgerouter_x_er-x_ka - DEFAULT := n endef define Device/ubnt_edgerouter-x From d582b369c3e6d7d4c103066bc82b00055a4a27a9 Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Fri, 19 Apr 2024 22:16:11 +1000 Subject: [PATCH 021/119] ramips: mt7621: Edgerouter-X drop factory image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edgerouter-X factory images have not built automatically since 19.x due to images being over 3MB. While it was possible to build custom images with very stripped down config, this is no longer possible with the size increases of linux 6.1 and 6.6. Drop code for generation of factory images, if some dev later wishes to try custom images they can revert this commit. Signed-off-by: Tim Lunn Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit 4d90b79704efba57ab158c47ae6936ce4c1ef185) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/image/mt7621.mk | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index b9692c5f3a..bebe40c216 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -229,30 +229,6 @@ define Build/belkin-header mv $@.new $@ endef -define Build/ubnt-erx-factory-image - if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \ - echo '21001:7' > $(1).compat; \ - $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \ - \ - $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \ - $(MKHASH) md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \ - $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \ - \ - echo "dummy" > $(1).rootfs; \ - $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \ - \ - $(MKHASH) md5 $(1).rootfs > $(1).md5; \ - $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \ - \ - echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \ - $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \ - \ - $(CP) $(1) $(BIN_DIR)/; \ - else \ - echo "WARNING: initramfs kernel image too big, cannot generate factory image (actual $$(stat -c%s $@); max $(KERNEL_SIZE))" >&2; \ - fi -endef - define Build/zytrx-header $(eval board=$(word 1,$(1))) $(eval version=$(word 2,$(1))) @@ -2861,8 +2837,6 @@ define Device/ubnt_edgerouter_common IMAGE_SIZE := 256768k FILESYSTEMS := squashfs KERNEL_SIZE := 6144k - KERNEL_INITRAMFS := $$(KERNEL) | \ - ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata DEVICE_PACKAGES += -wpad-basic-mbedtls -uboot-envtools DEVICE_COMPAT_VERSION := 2.0 From 79c711a035e5a98dcb16b1e68d323c865a08db1e Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Fri, 26 Apr 2024 11:27:45 +1000 Subject: [PATCH 022/119] rampis: mt7621: Edgerouter-X adjust IMAGE_SIZE to reflect new kernel size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IMAGE_SIZE was previously set to kernel1 + ubi size = 256768k, now kernel1 is 6MB adjust this value to add 3072k to total image size. Signed-off-by: Tim Lunn Link: https://github.com/openwrt/openwrt/pull/15194 (cherry picked from commit 5b406bccaccadb494cad139b3f69e17ab62d3968) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/image/mt7621.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index bebe40c216..1dc1219d24 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2834,7 +2834,7 @@ define Device/ubnt_edgerouter_common $(Device/dsa-migration) $(Device/uimage-lzma-loader) DEVICE_VENDOR := Ubiquiti - IMAGE_SIZE := 256768k + IMAGE_SIZE := 259840k FILESYSTEMS := squashfs KERNEL_SIZE := 6144k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata From 68465e524bb8134ac514b4257c5cd5c1cb97dd83 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 6 Nov 2024 13:23:35 -0800 Subject: [PATCH 023/119] ramips: mt7621: add missing regulator-boot-on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What seems to be happening is that the kernel requests an ACTIVE_LOW gpio initially and sets it to high later based on gpios in dts. This seems to break some devices where the bootloader sets it to high. Fixes: e612900ae0 ("ramips: mt7621: convert usb power to regulators") Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16877 Signed-off-by: Robert Marko (cherry picked from commit a7bc6bf7dba98c77724cb8284d21a9c77c263d56) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts | 1 + target/linux/ramips/dts/mt7621_humax_e10.dts | 1 + target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi | 1 + target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts | 1 + target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts | 1 + 5 files changed, 5 insertions(+) diff --git a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts index 00ff80e3ca..cba4ceae72 100644 --- a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -87,6 +87,7 @@ regulator-max-microvolt = <5000000>; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-boot-on; }; }; diff --git a/target/linux/ramips/dts/mt7621_humax_e10.dts b/target/linux/ramips/dts/mt7621_humax_e10.dts index 7ba772d5e5..fd66578eaf 100644 --- a/target/linux/ramips/dts/mt7621_humax_e10.dts +++ b/target/linux/ramips/dts/mt7621_humax_e10.dts @@ -63,6 +63,7 @@ regulator-max-microvolt = <5000000>; gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-boot-on; }; }; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi index 4a3de8cfba..7429ce673d 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-7xx.dtsi @@ -22,6 +22,7 @@ regulator-max-microvolt = <5000000>; gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-boot-on; }; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts index 88894325b5..2a556190d0 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts @@ -103,6 +103,7 @@ regulator-max-microvolt = <5000000>; gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-boot-on; }; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts index e6ff5ecf6a..2d06b949f2 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts @@ -101,6 +101,7 @@ regulator-max-microvolt = <5000000>; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-boot-on; }; }; From f05d49cfbda927a618123ccc787b52640baed5e3 Mon Sep 17 00:00:00 2001 From: Marius Dinu Date: Sat, 9 Nov 2024 19:20:47 +0200 Subject: [PATCH 024/119] menuconfig: add help description for Stack Smashing Protection options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Descriptions taken from: https://wiki.osdev.org/Stack_Smashing_Protector Signed-off-by: Marius Dinu Link: https://github.com/openwrt/openwrt/pull/16897 Signed-off-by: Christian Marangi (cherry picked from commit cbf7be9fb37baaaf7ee5c2b6315028bd47c764bc) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- config/Config-build.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config/Config-build.in b/config/Config-build.in index 41c1daccd9..481be0bb6c 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -295,12 +295,22 @@ menu "Global build settings" Enable GCC Stack Smashing Protection (SSP) for userspace applications config PKG_CC_STACKPROTECTOR_NONE bool "None" + help + No stack smashing protection. config PKG_CC_STACKPROTECTOR_REGULAR bool "Regular" + help + Protects functions with vulnerable objects. + This includes functions with buffers larger than 8 bytes or calls to alloca. config PKG_CC_STACKPROTECTOR_STRONG bool "Strong" + help + Like Regular, but also protects functions with + local arrays or references to local frame addresses. config PKG_CC_STACKPROTECTOR_ALL bool "All" + help + Protects all functions. endchoice choice @@ -310,10 +320,18 @@ menu "Global build settings" Enable GCC Stack-Smashing Protection (SSP) for the kernel config KERNEL_CC_STACKPROTECTOR_NONE bool "None" + help + No stack smashing protection. config KERNEL_CC_STACKPROTECTOR_REGULAR bool "Regular" + help + Protects functions with vulnerable objects. + This includes functions with buffers larger than 8 bytes or calls to alloca. config KERNEL_CC_STACKPROTECTOR_STRONG bool "Strong" + help + Like Regular, but also protects functions with + local arrays or references to local frame addresses. endchoice config KERNEL_STACKPROTECTOR From 69fd722edd3437d29047fce72395c7999572b281 Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Mon, 19 Feb 2024 12:49:28 +0100 Subject: [PATCH 025/119] hostapd: split long lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These two were getting rather long. Signed-off-by: Leon M. Busch-George Link: https://github.com/openwrt/openwrt/pull/16849 Signed-off-by: Christian Marangi (cherry picked from commit 8b6d5874b88bbe2e7a53bcab0e102b8781480880) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/network/services/hostapd/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 0e3396262d..16dfbff2b0 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -84,7 +84,11 @@ ifneq ($(CONFIG_DRIVER_11BE_SUPPORT),) HOSTAPD_IEEE80211BE:=y endif -CORE_DEPENDS = +ucode +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json +libudebug + +CORE_DEPENDS = +ucode +libucode \ + +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uloop \ + +libubus +libblobmsg-json \ + +libudebug OPENSSL_DEPENDS = +PACKAGE_$(1):libopenssl +PACKAGE_$(1):libopenssl-legacy DRIVER_MAKEOPTS= \ @@ -716,7 +720,13 @@ define Install/supplicant endef define Package/hostapd-common/install - $(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d $(1)/usr/share/hostap + $(INSTALL_DIR) \ + $(1)/etc/capabilities \ + $(1)/etc/rc.button \ + $(1)/etc/hotplug.d/ieee80211 \ + $(1)/etc/init.d $(1)/lib/netifd \ + $(1)/usr/share/acl.d \ + $(1)/usr/share/hostap $(INSTALL_BIN) ./files/dhcp-get-server.sh $(1)/lib/netifd/dhcp-get-server.sh $(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps From 2af51fbdabbec7ec3d6adcc5090222a9292d0a79 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 31 Oct 2024 12:22:04 -0700 Subject: [PATCH 026/119] treewide: remove THIS_MODULE assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matches upstream coccinelle check: api/platform_no_drv_owner.cocci. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16846 Signed-off-by: Christian Marangi (cherry picked from commit cc98cfafd799d502fbe09ddb62bab68633d570f5) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 2 -- package/kernel/gpio-nct5104d/src/gpio-nct5104d.c | 1 - package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c | 1 - package/kernel/lantiq/ltq-adsl/patches/120-platform.patch | 3 +-- package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 1 - package/kernel/lantiq/ltq-deu/src/ifxmips_deu.c | 1 - package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 1 - package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 1 - package/kernel/ubootenv-nvram/src/ubootenv-nvram.c | 1 - target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c | 1 - target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c | 1 - target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c | 1 - target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c | 1 - target/linux/bcm47xx/patches-6.6/831-old_gpio_wdt.patch | 3 +-- target/linux/generic/files/drivers/net/phy/rtl8366rb.c | 1 - target/linux/generic/files/drivers/net/phy/rtl8366s.c | 1 - target/linux/generic/files/drivers/net/phy/rtl8367.c | 1 - target/linux/generic/files/drivers/net/phy/rtl8367b.c | 1 - .../generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch | 3 +-- .../510-block-add-uImage.FIT-subimage-block-driver.patch | 3 +-- .../ipq40xx/patches-6.6/850-soc-add-qualcomm-syscon.patch | 3 +-- .../ipq806x/patches-6.6/850-soc-add-qualcomm-syscon.patch | 3 +-- .../0008-MIPS-lantiq-backport-old-timer-code.patch | 3 +-- .../0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch | 3 +-- ...0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch | 3 +-- .../patches-6.6/0151-lantiq-ifxmips_pcie-use-of.patch | 3 +-- .../mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c | 1 - .../patches-6.6/0900-power-Add-Qualcomm-APM.patch | 3 +-- .../0901-regulator-add-Qualcomm-CPR-regulators.patch | 6 ++---- .../ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c | 1 - .../ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c | 1 - .../ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 1 - .../linux/siflower/files-6.6/drivers/gpio/gpio-siflower.c | 1 - 33 files changed, 13 insertions(+), 48 deletions(-) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index 52346c25d9..9876dee90f 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -693,7 +693,6 @@ static struct platform_driver gpio_keys_driver = { .remove = gpio_keys_remove, .driver = { .name = "gpio-keys", - .owner = THIS_MODULE, .of_match_table = of_match_ptr(gpio_keys_of_match), }, }; @@ -703,7 +702,6 @@ static struct platform_driver gpio_keys_polled_driver = { .remove = gpio_keys_remove, .driver = { .name = "gpio-keys-polled", - .owner = THIS_MODULE, .of_match_table = of_match_ptr(gpio_keys_polled_of_match), }, }; diff --git a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c index e31a94b5cf..ffeab29eda 100644 --- a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c +++ b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c @@ -366,7 +366,6 @@ err: static struct platform_driver nct5104d_gpio_driver = { .driver = { - .owner = THIS_MODULE, .name = DRVNAME, }, .probe = nct5104d_gpio_probe, diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c index ba23232ee9..20a63716a3 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c +++ b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c @@ -2807,7 +2807,6 @@ static struct platform_driver ltq_mei_driver = { .remove = ltq_mei_remove, .driver = { .name = "lantiq,mei-xway", - .owner = THIS_MODULE, .of_match_table = ltq_mei_match, }, }; diff --git a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch index 7bbcf35cd2..69f2b45e32 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch @@ -36,7 +36,7 @@ } #ifndef _lint -@@ -1159,8 +1159,30 @@ module_param(debug_level, byte, 0); +@@ -1159,8 +1159,29 @@ module_param(debug_level, byte, 0); MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs"); #endif /* #ifndef DSL_DEBUG_DISABLE*/ @@ -59,7 +59,6 @@ + .remove = __devexit_p(ltq_adsl_remove), + .driver = { + .name = "adsl", -+ .owner = THIS_MODULE, + .of_match_table = ltq_adsl_match, + }, +}; diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c index 0cb49a59bd..6b1e0321b3 100644 --- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c +++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c @@ -1894,7 +1894,6 @@ static struct platform_driver ltq_atm_driver = { .remove = ltq_atm_remove, .driver = { .name = "atm", - .owner = THIS_MODULE, .of_match_table = ltq_atm_match, }, }; diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu.c index 096b8b5bba..e44e84c03c 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_deu.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_deu.c @@ -196,7 +196,6 @@ static struct platform_driver ltq_deu_driver = { .remove = ltq_deu_remove, .driver = { .name = "deu", - .owner = THIS_MODULE, .of_match_table = ltq_deu_match, }, }; diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index 3ff01d588a..5e5535348d 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -1600,7 +1600,6 @@ static struct platform_driver ltq_ptm_driver = { .remove = ltq_ptm_remove, .driver = { .name = "ptm", - .owner = THIS_MODULE, .of_match_table = ltq_ptm_match, }, }; diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 6731904bba..c5bbd9fd87 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -1138,7 +1138,6 @@ static struct platform_driver ltq_ptm_driver = { .remove = ltq_ptm_remove, .driver = { .name = "ptm", - .owner = THIS_MODULE, .of_match_table = ltq_ptm_match, }, }; diff --git a/package/kernel/ubootenv-nvram/src/ubootenv-nvram.c b/package/kernel/ubootenv-nvram/src/ubootenv-nvram.c index f624414216..106e41231c 100644 --- a/package/kernel/ubootenv-nvram/src/ubootenv-nvram.c +++ b/package/kernel/ubootenv-nvram/src/ubootenv-nvram.c @@ -146,7 +146,6 @@ static struct platform_driver ubootenv_driver = { .remove = ubootenv_remove, .driver = { .name = NAME, - .owner = THIS_MODULE, .of_match_table = of_ubootenv_match, }, }; diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c index 4baed52e57..a0759fe9e3 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c @@ -168,7 +168,6 @@ static struct platform_driver gpio_latch_driver = { .probe = gpio_latch_probe, .driver = { .name = GPIO_LATCH_DRIVER_NAME, - .owner = THIS_MODULE, .of_match_table = gpio_latch_match, }, }; diff --git a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c index 02639cf011..d83b690afe 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c @@ -182,7 +182,6 @@ static struct platform_driver gpio_rb91x_key_driver = { .probe = gpio_rb91x_key_probe, .driver = { .name = GPIO_RB91X_KEY_DRIVER_NAME, - .owner = THIS_MODULE, .of_match_table = gpio_rb91x_key_match, }, }; diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c index d0d9e2090b..029142ca61 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c @@ -1478,7 +1478,6 @@ static struct platform_driver ar934x_nfc_driver = { .remove = ar934x_nfc_remove, .driver = { .name = AR934X_NFC_DRIVER_NAME, - .owner = THIS_MODULE, .of_match_table = ar934x_nfc_match, }, }; diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c index 092cd85d82..cf2809bfa3 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c @@ -356,7 +356,6 @@ static struct platform_driver rb91x_nand_driver = { .remove = rb91x_nand_remove, .driver = { .name = "rb91x-nand", - .owner = THIS_MODULE, .of_match_table = rb91x_nand_match, }, }; diff --git a/target/linux/bcm47xx/patches-6.6/831-old_gpio_wdt.patch b/target/linux/bcm47xx/patches-6.6/831-old_gpio_wdt.patch index 6c76cbeee7..f7ab33802c 100644 --- a/target/linux/bcm47xx/patches-6.6/831-old_gpio_wdt.patch +++ b/target/linux/bcm47xx/patches-6.6/831-old_gpio_wdt.patch @@ -32,7 +32,7 @@ Signed-off-by: Mathias Adam obj-$(CONFIG_TXX9_WDT) += txx9wdt.o --- /dev/null +++ b/drivers/watchdog/old_gpio_wdt.c -@@ -0,0 +1,301 @@ +@@ -0,0 +1,300 @@ +/* + * Driver for GPIO-controlled Hardware Watchdogs. + * @@ -294,7 +294,6 @@ Signed-off-by: Mathias Adam + .probe = gpio_wdt_probe, + .remove = gpio_wdt_remove, + .driver.name = "gpio-wdt", -+ .driver.owner = THIS_MODULE, +}; + +static int __init gpio_wdt_init(void) diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c index 0e0116051a..0878ca9f14 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c @@ -1503,7 +1503,6 @@ MODULE_DEVICE_TABLE(of, rtl8366rb_match); static struct platform_driver rtl8366rb_driver = { .driver = { .name = RTL8366RB_DRIVER_NAME, - .owner = THIS_MODULE, .of_match_table = of_match_ptr(rtl8366rb_match), }, .probe = rtl8366rb_probe, diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c index 8c746778b8..d4045fcc06 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c @@ -1291,7 +1291,6 @@ MODULE_DEVICE_TABLE(of, rtl8366s_match); static struct platform_driver rtl8366s_driver = { .driver = { .name = RTL8366S_DRIVER_NAME, - .owner = THIS_MODULE, #ifdef CONFIG_OF .of_match_table = of_match_ptr(rtl8366s_match), #endif diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367.c b/target/linux/generic/files/drivers/net/phy/rtl8367.c index 0acfeb54bb..950e9d2767 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8367.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8367.c @@ -1834,7 +1834,6 @@ MODULE_DEVICE_TABLE(of, rtl8367_match); static struct platform_driver rtl8367_driver = { .driver = { .name = RTL8367_DRIVER_NAME, - .owner = THIS_MODULE, #ifdef CONFIG_OF .of_match_table = of_match_ptr(rtl8367_match), #endif diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367b.c b/target/linux/generic/files/drivers/net/phy/rtl8367b.c index 4236912dd5..5f885aa5be 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8367b.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8367b.c @@ -1633,7 +1633,6 @@ MODULE_DEVICE_TABLE(of, rtl8367b_match); static struct platform_driver rtl8367b_driver = { .driver = { .name = RTL8367B_DRIVER_NAME, - .owner = THIS_MODULE, #ifdef CONFIG_OF .of_match_table = of_match_ptr(rtl8367b_match), #endif diff --git a/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch b/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch index a1d787191c..e6dcdfd92b 100644 --- a/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch +++ b/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin #include "gpiolib.h" #include "gpiolib-of.h" -@@ -1129,3 +1131,74 @@ void of_gpiochip_remove(struct gpio_chip +@@ -1129,3 +1131,73 @@ void of_gpiochip_remove(struct gpio_chip { of_node_put(dev_of_node(&chip->gpiodev->dev)); } @@ -81,7 +81,6 @@ Signed-off-by: John Crispin +static struct platform_driver gpio_export_driver = { + .driver = { + .name = "gpio-export", -+ .owner = THIS_MODULE, + .of_match_table = of_match_ptr(gpio_export_ids), + }, + .probe = of_gpio_export_probe, diff --git a/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch b/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch index ff38964ece..b06c29ffaf 100644 --- a/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch +++ b/target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch @@ -81,7 +81,7 @@ Signed-off-by: Daniel Golle swim_mod-y := swim.o swim_asm.o --- /dev/null +++ b/drivers/block/fitblk.c -@@ -0,0 +1,659 @@ +@@ -0,0 +1,658 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * uImage.FIT virtual block device driver. @@ -714,7 +714,6 @@ Signed-off-by: Daniel Golle + .probe = fitblk_probe, + .driver = { + .name = "fitblk", -+ .owner = THIS_MODULE, + }, +}; + diff --git a/target/linux/ipq40xx/patches-6.6/850-soc-add-qualcomm-syscon.patch b/target/linux/ipq40xx/patches-6.6/850-soc-add-qualcomm-syscon.patch index 0e93ebb646..7cd473b24e 100644 --- a/target/linux/ipq40xx/patches-6.6/850-soc-add-qualcomm-syscon.patch +++ b/target/linux/ipq40xx/patches-6.6/850-soc-add-qualcomm-syscon.patch @@ -23,7 +23,7 @@ Subject: SoC: add qualcomm syscon +obj-$(CONFIG_QCOM_TCSR) += qcom_tcsr.o --- /dev/null +++ b/drivers/soc/qcom/qcom_tcsr.c -@@ -0,0 +1,96 @@ +@@ -0,0 +1,95 @@ +/* + * Copyright (c) 2014, The Linux foundation. All rights reserved. + * @@ -109,7 +109,6 @@ Subject: SoC: add qualcomm syscon +static struct platform_driver tcsr_driver = { + .driver = { + .name = "tcsr", -+ .owner = THIS_MODULE, + .of_match_table = tcsr_dt_match, + }, + .probe = tcsr_probe, diff --git a/target/linux/ipq806x/patches-6.6/850-soc-add-qualcomm-syscon.patch b/target/linux/ipq806x/patches-6.6/850-soc-add-qualcomm-syscon.patch index 8b49af8e84..2d639bbfd3 100644 --- a/target/linux/ipq806x/patches-6.6/850-soc-add-qualcomm-syscon.patch +++ b/target/linux/ipq806x/patches-6.6/850-soc-add-qualcomm-syscon.patch @@ -28,7 +28,7 @@ Subject: SoC: add qualcomm syscon depends on ARCH_QCOM || COMPILE_TEST --- /dev/null +++ b/drivers/soc/qcom/qcom_tcsr.c -@@ -0,0 +1,62 @@ +@@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014, The Linux foundation. All rights reserved. + * @@ -80,7 +80,6 @@ Subject: SoC: add qualcomm syscon +static struct platform_driver tcsr_driver = { + .driver = { + .name = "tcsr", -+ .owner = THIS_MODULE, + .of_match_table = tcsr_dt_match, + }, + .probe = tcsr_probe, diff --git a/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch b/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch index 3e6c267685..81bf72913b 100644 --- a/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch +++ b/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch @@ -186,7 +186,7 @@ Signed-off-by: John Crispin obj-y += vmmc.o --- /dev/null +++ b/arch/mips/lantiq/xway/timer.c -@@ -0,0 +1,887 @@ +@@ -0,0 +1,886 @@ +#ifndef CONFIG_SOC_AMAZON_SE + +#include @@ -1043,7 +1043,6 @@ Signed-off-by: John Crispin + .probe = gptu_probe, + .driver = { + .name = "gptu-xway", -+ .owner = THIS_MODULE, + .of_match_table = gptu_match, + }, +}; diff --git a/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch b/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch index 1992b536f4..235e48f6de 100644 --- a/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch +++ b/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch @@ -47,7 +47,7 @@ Signed-off-by: John Crispin obj-$(CONFIG_I2C_MESON) += i2c-meson.o --- /dev/null +++ b/drivers/i2c/busses/i2c-lantiq.c -@@ -0,0 +1,746 @@ +@@ -0,0 +1,745 @@ + +/* + * Lantiq I2C bus adapter @@ -782,7 +782,6 @@ Signed-off-by: John Crispin + .remove = ltq_i2c_remove, + .driver = { + .name = DRV_NAME, -+ .owner = THIS_MODULE, + .of_match_table = ltq_i2c_match, + }, +}; diff --git a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index 8bb6e5a0da..3ece97052b 100644 --- a/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-6.6/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -36,7 +36,7 @@ Signed-off-by: John Crispin +obj-$(CONFIG_PCI) += ath5k_eep.o --- /dev/null +++ b/arch/mips/lantiq/xway/ath5k_eep.c -@@ -0,0 +1,136 @@ +@@ -0,0 +1,135 @@ +/* + * Copyright (C) 2011 Luca Olivetti + * Copyright (C) 2011 John Crispin @@ -149,7 +149,6 @@ Signed-off-by: John Crispin +static struct platform_driver ath5k_eeprom_driver = { + .driver = { + .name = "ath5k,eeprom", -+ .owner = THIS_MODULE, + .of_match_table = of_match_ptr(ath5k_eeprom_ids), + }, +}; diff --git a/target/linux/lantiq/patches-6.6/0151-lantiq-ifxmips_pcie-use-of.patch b/target/linux/lantiq/patches-6.6/0151-lantiq-ifxmips_pcie-use-of.patch index b83bf992a6..65253bc7e4 100644 --- a/target/linux/lantiq/patches-6.6/0151-lantiq-ifxmips_pcie-use-of.patch +++ b/target/linux/lantiq/patches-6.6/0151-lantiq-ifxmips_pcie-use-of.patch @@ -293,7 +293,7 @@ Signed-off-by: Eddi De Pieri register_pci_controller(&ifx_pcie_controller[pcie_port].pcic); /* XXX, clear error status */ -@@ -1083,6 +1185,30 @@ static int __init ifx_pcie_bios_init(voi +@@ -1083,6 +1185,29 @@ static int __init ifx_pcie_bios_init(voi return 0; } @@ -308,7 +308,6 @@ Signed-off-by: Eddi De Pieri + .probe = ifx_pcie_bios_probe, + .driver = { + .name = "pcie-xrx200", -+ .owner = THIS_MODULE, + .of_match_table = ifxmips_pcie_match, + }, +}; diff --git a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c index b4d4554d4f..d958d622e0 100644 --- a/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c +++ b/target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c @@ -296,7 +296,6 @@ static struct platform_driver gsw_driver = { .remove = rtk_gsw_remove, .driver = { .name = "rtk-gsw", - .owner = THIS_MODULE, .of_match_table = rtk_gsw_match, }, }; diff --git a/target/linux/qualcommax/patches-6.6/0900-power-Add-Qualcomm-APM.patch b/target/linux/qualcommax/patches-6.6/0900-power-Add-Qualcomm-APM.patch index 2e5c72b7d1..f105351584 100644 --- a/target/linux/qualcommax/patches-6.6/0900-power-Add-Qualcomm-APM.patch +++ b/target/linux/qualcommax/patches-6.6/0900-power-Add-Qualcomm-APM.patch @@ -49,7 +49,7 @@ Signed-off-by: Robert Marko +obj-$(CONFIG_QCOM_APM) += apm.o --- /dev/null +++ b/drivers/power/qcom/apm.c -@@ -0,0 +1,944 @@ +@@ -0,0 +1,943 @@ +/* + * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. + * @@ -971,7 +971,6 @@ Signed-off-by: Robert Marko + .driver = { + .name = MSM_APM_DRIVER_NAME, + .of_match_table = msm_apm_match_table, -+ .owner = THIS_MODULE, + }, + .probe = msm_apm_probe, + .remove = msm_apm_remove, diff --git a/target/linux/qualcommax/patches-6.6/0901-regulator-add-Qualcomm-CPR-regulators.patch b/target/linux/qualcommax/patches-6.6/0901-regulator-add-Qualcomm-CPR-regulators.patch index c85be0357c..46d4fc246f 100644 --- a/target/linux/qualcommax/patches-6.6/0901-regulator-add-Qualcomm-CPR-regulators.patch +++ b/target/linux/qualcommax/patches-6.6/0901-regulator-add-Qualcomm-CPR-regulators.patch @@ -77,7 +77,7 @@ Signed-off-by: Robert Marko obj-$(CONFIG_REGULATOR_PF8X00) += pf8x00-regulator.o --- /dev/null +++ b/drivers/regulator/cpr3-npu-regulator.c -@@ -0,0 +1,695 @@ +@@ -0,0 +1,694 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * @@ -752,7 +752,6 @@ Signed-off-by: Robert Marko + .driver = { + .name = "qcom,cpr3-npu-regulator", + .of_match_table = cpr3_regulator_match_table, -+ .owner = THIS_MODULE, + }, + .probe = cpr3_npu_regulator_probe, + .remove = cpr3_npu_regulator_remove, @@ -9866,7 +9865,7 @@ Signed-off-by: Robert Marko +} --- /dev/null +++ b/drivers/regulator/cpr4-apss-regulator.c -@@ -0,0 +1,1819 @@ +@@ -0,0 +1,1818 @@ +/* + * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. + * @@ -11663,7 +11662,6 @@ Signed-off-by: Robert Marko + .driver = { + .name = "qcom,cpr4-apss-regulator", + .of_match_table = cpr4_regulator_match_table, -+ .owner = THIS_MODULE, + }, + .probe = cpr4_apss_regulator_probe, + .remove = cpr4_apss_regulator_remove, diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c index cafa28e7a4..bbb52d74b2 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c @@ -1525,7 +1525,6 @@ static struct platform_driver esw_driver = { .remove = esw_remove, .driver = { .name = "rt3050-esw", - .owner = THIS_MODULE, .of_match_table = ralink_esw_match, }, }; diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c index 9fc54a74b4..154983494e 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c @@ -296,7 +296,6 @@ static struct platform_driver gsw_driver = { .remove = mt7620_gsw_remove, .driver = { .name = "mt7620-gsw", - .owner = THIS_MODULE, .of_match_table = mediatek_gsw_match, }, }; diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index d8d27fda3b..4dff1340d7 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -1657,7 +1657,6 @@ static struct platform_driver fe_driver = { .remove = fe_remove, .driver = { .name = "mtk_soc_eth", - .owner = THIS_MODULE, .of_match_table = of_fe_match, }, }; diff --git a/target/linux/siflower/files-6.6/drivers/gpio/gpio-siflower.c b/target/linux/siflower/files-6.6/drivers/gpio/gpio-siflower.c index f061021e30..bd3d8906b4 100644 --- a/target/linux/siflower/files-6.6/drivers/gpio/gpio-siflower.c +++ b/target/linux/siflower/files-6.6/drivers/gpio/gpio-siflower.c @@ -333,7 +333,6 @@ static struct platform_driver sf_gpio_driver = { .remove = sf_gpio_remove, .driver = { .name = "siflower_gpio", - .owner = THIS_MODULE, .of_match_table = sf_gpio_ids, }, }; From 62690e3b51e0ac227cf23e3da2f83e2fca3de6c4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Oct 2024 19:08:02 -0700 Subject: [PATCH 027/119] lantiq: use more devm for i2c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i2c_add_numbered_adapter is the wrong function to use here. It requires setting nr to some value, otherwise it behaves the same as i2c_add_adapter. nr is not set. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16825 Signed-off-by: Hauke Mehrtens (cherry picked from commit 44824f0b787b13e2f2fccc58256b2c42fa3f9f5d) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- ...I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch b/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch index 235e48f6de..1f2f5139d6 100644 --- a/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch +++ b/target/linux/lantiq/patches-6.6/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch @@ -47,7 +47,7 @@ Signed-off-by: John Crispin obj-$(CONFIG_I2C_MESON) += i2c-meson.o --- /dev/null +++ b/drivers/i2c/busses/i2c-lantiq.c -@@ -0,0 +1,745 @@ +@@ -0,0 +1,742 @@ + +/* + * Lantiq I2C bus adapter @@ -658,7 +658,9 @@ Signed-off-by: John Crispin + } + + init_completion(&priv->cmd_complete); -+ mutex_init(&priv->mutex); ++ ret = devm_mutex_init(&pdev->dev, &priv->mutex); ++ if (ret) ++ return ret; + + priv->membase = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(priv->membase)) @@ -719,7 +721,7 @@ Signed-off-by: John Crispin + clk_activate(priv->clk_gate); + + /* add our adapter to the i2c stack */ -+ ret = i2c_add_numbered_adapter(adap); ++ ret = devm_i2c_add_adapter(&pdev->dev, adap); + if (ret) { + dev_err(&pdev->dev, "can't register I2C adapter\n"); + goto out; @@ -737,7 +739,6 @@ Signed-off-by: John Crispin + ret = ltq_i2c_hw_init(adap); + if (ret) { + dev_err(&pdev->dev, "can't configure adapter\n"); -+ i2c_del_adapter(adap); + platform_set_drvdata(pdev, NULL); + goto out; + } else { @@ -762,10 +763,6 @@ Signed-off-by: John Crispin + /* power down the core */ + clk_deactivate(priv->clk_gate); + -+ /* remove driver */ -+ i2c_del_adapter(&priv->adap); -+ kfree(priv); -+ + dev_dbg(&pdev->dev, "removed\n"); + platform_set_drvdata(pdev, NULL); + From 67da3d33f3df328f89780bc0c79e1620dc47267a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 31 Oct 2024 12:22:04 -0700 Subject: [PATCH 028/119] lantiq: use devm for mutex_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's common to avoid calling mutex_destroy when done. It's not correct strictly speaking. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16832 Signed-off-by: Hauke Mehrtens (cherry picked from commit fccff963c0a6ba035455daea61566f4d121643e3) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../0008-MIPS-lantiq-backport-old-timer-code.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch b/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch index 81bf72913b..a396efd990 100644 --- a/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch +++ b/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch @@ -186,7 +186,7 @@ Signed-off-by: John Crispin obj-y += vmmc.o --- /dev/null +++ b/arch/mips/lantiq/xway/timer.c -@@ -0,0 +1,886 @@ +@@ -0,0 +1,888 @@ +#ifndef CONFIG_SOC_AMAZON_SE + +#include @@ -989,7 +989,9 @@ Signed-off-by: John Crispin + ltq_w32(0xfff, LQ_GPTU_IRNCR); + + memset(&timer_dev, 0, sizeof(timer_dev)); -+ mutex_init(&timer_dev.gptu_mutex); ++ ret = devm_mutex_init(&pdev->dev, &timer_dev.gptu_mutex); ++ if (ret) ++ return ret; + + lq_enable_gptu(); + timer_dev.number_of_timers = GPTU_ID_CFG * 2; From 25427d794288de530a0663b4ab9a8f82da8307d4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 9 Nov 2024 15:46:26 -0800 Subject: [PATCH 029/119] mdadm: backport musl patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needed to fix compilation with GCC14. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16912 Signed-off-by: Robert Marko (cherry picked from commit 1f3d5858b441cf4e1195b96242dd08d68538e83d) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/utils/mdadm/Makefile | 2 +- package/utils/mdadm/patches/060-gcc14.patch | 24 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 package/utils/mdadm/patches/060-gcc14.patch diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile index c2778fe351..b521daaefc 100644 --- a/package/utils/mdadm/Makefile +++ b/package/utils/mdadm/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mdadm PKG_VERSION:=4.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm diff --git a/package/utils/mdadm/patches/060-gcc14.patch b/package/utils/mdadm/patches/060-gcc14.patch new file mode 100644 index 0000000000..545a40ac0a --- /dev/null +++ b/package/utils/mdadm/patches/060-gcc14.patch @@ -0,0 +1,24 @@ +From 8bda86099089b44129ef6206764f9de47a45f0db Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 12 Mar 2024 11:01:50 +0100 +Subject: [PATCH] util.c: add limits.h include for NAME_MAX definition + +Add limits.h include for NAME_MAX definition. + +Signed-off-by: Alexander Kanavin +Signed-off-by: Mariusz Tkaczyk +--- + util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/util.c ++++ b/util.c +@@ -36,7 +36,7 @@ + #include + #include + #include +- ++#include + + /* + * following taken from linux/blkpg.h because they aren't From 96ab90a9aa75c06fd85cb94babe12b8cb49e32ce Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 11 Nov 2024 12:23:01 -0800 Subject: [PATCH 030/119] ramips: mt7621: fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missing u caused the regulator to fail probe. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16925 Signed-off-by: Robert Marko (cherry picked from commit 3e42526404f021094ae3fa41524c396d753f4c6c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts index 2d06b949f2..41173dd129 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts @@ -96,7 +96,7 @@ reg_usb_power: regulator { compatible = "regulator-fixed"; - reglator-name = "usb_power"; + regulator-name = "usb_power"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; From 655874713ee32f5f16f038c4291b02da3a018b76 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 10 Nov 2024 15:54:14 -0800 Subject: [PATCH 031/119] realtek: rtl83xx: use devm for mutex_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mutex_destroy is missing in remove. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16926 Signed-off-by: Robert Marko (cherry picked from commit 1125ed408c7f0d130b5606ab39e4dd98a41d5f0a) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c index 5468fc0653..fe0980a1be 100644 --- a/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c +++ b/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c @@ -1492,7 +1492,9 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev) priv->ds->needs_standalone_vlan_filtering = true; priv->dev = dev; - mutex_init(&priv->reg_mutex); + err = devm_mutex_init(dev, &priv->reg_mutex); + if (err) + return err; priv->family_id = soc_info.family; priv->id = soc_info.id; From 9d44e00fc564c92bd4f21fdcb30d67d5256e7f59 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Sun, 10 Nov 2024 19:53:07 +0100 Subject: [PATCH 032/119] cryptodev-linux: give a coherent description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For the last ten years, nobody has noticed that this driver doesn't actually say what it is for. ;) Signed-off-by: Paul Donald Link: https://github.com/openwrt/openwrt/pull/16910 Signed-off-by: Christian Marangi (cherry picked from commit 3df5966f9453ecefcabc893f6449c8c4f1054aef) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/cryptodev-linux/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/kernel/cryptodev-linux/Makefile b/package/kernel/cryptodev-linux/Makefile index ea1bd24161..611d4ae27a 100644 --- a/package/kernel/cryptodev-linux/Makefile +++ b/package/kernel/cryptodev-linux/Makefile @@ -36,8 +36,9 @@ define KernelPackage/cryptodev endef define KernelPackage/cryptodev/description - This is a driver for that allows to use the Linux kernel supported - hardware ciphers by user-space applications. + This driver allows use of the Linux kernel supported hardware-based + cryptographic and hash accelerators by user-space applications, + via a "/dev/crypto" device. endef define Build/Configure From 7424f58eb6cee31e8a34180c945c1037dc748980 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Sun, 10 Nov 2024 19:47:34 +0100 Subject: [PATCH 033/119] cryptodev-linux: change home-page URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most links and info on the org page are broken or defunct, and all new versions are available on the github based repo anyway. Signed-off-by: Paul Donald Link: https://github.com/openwrt/openwrt/pull/16910 Signed-off-by: Christian Marangi (cherry picked from commit ce0b843ac7d27e124cb9ca13e9a1aeb115fcaf23) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/cryptodev-linux/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/cryptodev-linux/Makefile b/package/kernel/cryptodev-linux/Makefile index 611d4ae27a..165cc60487 100644 --- a/package/kernel/cryptodev-linux/Makefile +++ b/package/kernel/cryptodev-linux/Makefile @@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/cryptodev SUBMENU:=Cryptographic API modules TITLE:=Driver for cryptographic acceleration - URL:=http://cryptodev-linux.org/ + URL:=https://github.com/cryptodev-linux/cryptodev-linux DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash FILES:=$(PKG_BUILD_DIR)/cryptodev.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,50,cryptodev) From 03984356bdb2d476dcd9c9115dca0c64599c94d0 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 6 Nov 2024 20:13:06 +0100 Subject: [PATCH 034/119] qualcommax: ipq60xx: add NSS reserved memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that despite NSS not being supported in OpenWrt the memory it usually uses needs to be reserved anyway for stability reasons. Link: https://github.com/openwrt/openwrt/pull/16928 Signed-off-by: Robert Marko (cherry picked from commit 8729d2a64d282d37b69c0853269af401a0102517) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- ...qcom-ipq6018-add-NSS-reserved-memory.patch | 27 +++++++++++++++++++ ...arm64-dts-qcom-ipq6018-add-wifi-node.patch | 2 +- ...07-soc-qcom-fix-smp2p-ack-on-ipq6018.patch | 2 +- ...pq6018-assign-QDSS_AT-clock-to-wifi-.patch | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 target/linux/qualcommax/patches-6.6/0140-arm64-dts-qcom-ipq6018-add-NSS-reserved-memory.patch diff --git a/target/linux/qualcommax/patches-6.6/0140-arm64-dts-qcom-ipq6018-add-NSS-reserved-memory.patch b/target/linux/qualcommax/patches-6.6/0140-arm64-dts-qcom-ipq6018-add-NSS-reserved-memory.patch new file mode 100644 index 0000000000..84591c845d --- /dev/null +++ b/target/linux/qualcommax/patches-6.6/0140-arm64-dts-qcom-ipq6018-add-NSS-reserved-memory.patch @@ -0,0 +1,27 @@ +From 7e102b1eb2ca3eff7a6f33ebeab17825e6f70956 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Mon, 4 Nov 2024 22:01:24 +0100 +Subject: [PATCH] arm64: dts: qcom: ipq6018: add NSS reserved memory + +It seems that despite NSS not being supported in OpenWrt the memory it +usually uses needs to be reserved anyway for stability reasons. + +Signed-off-by: Robert Marko +--- + arch/arm64/boot/dts/qcom/ipq6018.dtsi | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi ++++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi +@@ -199,6 +199,11 @@ + no-map; + }; + ++ nss_region: memory@40000000 { ++ reg = <0x0 0x40000000 0x0 0x01000000>; ++ no-map; ++ }; ++ + bootloader@4a100000 { + reg = <0x0 0x4a100000 0x0 0x400000>; + no-map; diff --git a/target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq6018-add-wifi-node.patch b/target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq6018-add-wifi-node.patch index f4968f1a4d..d41244d65a 100644 --- a/target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq6018-add-wifi-node.patch +++ b/target/linux/qualcommax/patches-6.6/0906-arm64-dts-qcom-ipq6018-add-wifi-node.patch @@ -15,7 +15,7 @@ Signed-off-by: Mantas Pucka --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi -@@ -809,6 +809,102 @@ +@@ -814,6 +814,102 @@ }; }; diff --git a/target/linux/qualcommax/patches-6.6/0907-soc-qcom-fix-smp2p-ack-on-ipq6018.patch b/target/linux/qualcommax/patches-6.6/0907-soc-qcom-fix-smp2p-ack-on-ipq6018.patch index 094442a59b..5154aad531 100644 --- a/target/linux/qualcommax/patches-6.6/0907-soc-qcom-fix-smp2p-ack-on-ipq6018.patch +++ b/target/linux/qualcommax/patches-6.6/0907-soc-qcom-fix-smp2p-ack-on-ipq6018.patch @@ -15,7 +15,7 @@ Signed-off-by: Mantas Pucka --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi -@@ -1157,6 +1157,7 @@ +@@ -1162,6 +1162,7 @@ wcss_smp2p_out: master-kernel { qcom,entry-name = "master-kernel"; diff --git a/target/linux/qualcommax/patches-6.6/0909-arm64-dts-qcom-ipq6018-assign-QDSS_AT-clock-to-wifi-.patch b/target/linux/qualcommax/patches-6.6/0909-arm64-dts-qcom-ipq6018-assign-QDSS_AT-clock-to-wifi-.patch index a0528e7f50..993d60870b 100644 --- a/target/linux/qualcommax/patches-6.6/0909-arm64-dts-qcom-ipq6018-assign-QDSS_AT-clock-to-wifi-.patch +++ b/target/linux/qualcommax/patches-6.6/0909-arm64-dts-qcom-ipq6018-assign-QDSS_AT-clock-to-wifi-.patch @@ -13,7 +13,7 @@ Signed-off-by: Mantas Pucka --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi -@@ -930,8 +930,8 @@ +@@ -935,8 +935,8 @@ "wcss_reset", "wcss_q6_reset"; From 11d36818b99463cb8709586011958b8fc9d36ca3 Mon Sep 17 00:00:00 2001 From: Sergey Matsievskiy Date: Fri, 8 Nov 2024 14:43:52 +0300 Subject: [PATCH 035/119] build: add comments to makefiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comments to build system makefile functions and variables to help developers in understanding build system internals and ease the development process. This patch adds some documentation examples with proposed doxygen-like syntax. Hopefully, this would start the discussion and result in generation of the makefile documentation guidelines. Signed-off-by: Sergey Matsievskiy Link: https://github.com/openwrt/openwrt/pull/16888 Signed-off-by: Christian Marangi (cherry picked from commit a72c8c770584075782959f2aa5c1487d68517edd) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- include/image.mk | 56 +++++++++++++++++++++++++++ include/target.mk | 34 ++++++++++++++--- rules.mk | 97 ++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 169 insertions(+), 18 deletions(-) diff --git a/include/image.mk b/include/image.mk index a4ac1b49cf..9a4dff2167 100644 --- a/include/image.mk +++ b/include/image.mk @@ -21,6 +21,11 @@ include $(INCLUDE_DIR)/rootfs.mk override MAKE:=$(_SINGLE)$(SUBMAKE) override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE) +##@ +# @brief Convert size with unit postfix to unitless expression in bytes. +# +# @param 1: Size with unit. Possible unit postfix are `g`, `m`, `k`. +## exp_units = $(subst k, * 1024,$(subst m, * 1024k,$(subst g, * 1024m,$(1)))) target_params = $(subst +,$(space),$*) @@ -111,6 +116,12 @@ endef PROFILE_SANITIZED := $(call tolower,$(subst DEVICE_,,$(subst $(space),-,$(PROFILE)))) +##@ +# @brief Call function for each group of arguments. +# +# @param 1: List of lists of arguments. Lists are separated by `|`. +# @param 2: Function to call for list of arguments. +## define split_args $(foreach data, \ $(subst |,$(space),\ @@ -118,12 +129,24 @@ $(foreach data, \ $(call $(2),$(strip $(subst ^,$(space),$(data))))) endef +##@ +# @brief Call build function with arguments. +# +# @param 1: Function to call. Function name is prepended with `Build/`. +# @param 2...: Function arguments. +## define build_cmd $(if $(Build/$(word 1,$(1))),,$(error Missing Build/$(word 1,$(1)))) $(call Build/$(word 1,$(1)),$(wordlist 2,$(words $(1)),$(1))) endef +##@ +# @brief Call build functions from the list. +# +# @param 1: List of build functions with arguments, separated by `|`. +# First word in each group is a build command without `Build/` prefix. +## define concat_cmd $(call split_args,$(1),build_cmd) endef @@ -163,6 +186,12 @@ DTC_WARN_FLAGS := \ DTC_FLAGS += $(DTC_WARN_FLAGS) DTCO_FLAGS += $(DTC_WARN_FLAGS) +##@ +# @brief Pad file to specified size. +# +# @param 1: File. +# @param 2: Padding. +## define Image/pad-to dd if=$(1) of=$(1).new bs=$(2) conv=sync mv $(1).new $(1) @@ -403,26 +432,53 @@ define Device/InitProfile DEVICE_DESCRIPTION = Build firmware images for $$(DEVICE_TITLE) endef +##@ +# @brief Image configuration variables. +# +# @param 1: Device name. +## define Device/Init + ##@ Device name. DEVICE_NAME := $(1) + ##@ Commands to build kernel. + # Commands with arguments are separated by `|`. + ## KERNEL:= + ##@ Commands to build initramfs. + # Commands with arguments are separated by `|`. + ## KERNEL_INITRAMFS = $$(KERNEL) + ##@ Kernel command line. CMDLINE:= + ##@ Images to build. IMAGES := + ##@ Artifacts to build. ARTIFACTS := + ##@ Device image prefix. DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1) + ##@ Device image name. DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2) + ##@ Factory image name. FACTORY_IMG_NAME := + ##@ Maximum image size. Optional. IMAGE_SIZE := + ##@ Maximum image size. Optional. NAND_SIZE := + ##@ Kernel image prefix. KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX) + ##@ Kernel image suffix. KERNEL_SUFFIX := -kernel.bin + ##@ Initramfs image suffix. KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX) + ##@ Kernel image name. KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX) + ##@ Initramfs image prefix. KERNEL_INITRAMFS_PREFIX = $$(DEVICE_IMG_PREFIX)-initramfs KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_INITRAMFS_SUFFIX) + ##@ Initramfs image name. KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs + ##@ Kernel install flag. KERNEL_INSTALL := KERNEL_NAME := vmlinux KERNEL_DEPENDS := diff --git a/include/target.mk b/include/target.mk index d13902ad6e..0108bced99 100644 --- a/include/target.mk +++ b/include/target.mk @@ -7,10 +7,17 @@ ifneq ($(__target_inc),1) __target_inc=1 -# default device type +##@ +# @brief Default device type ( basic | nas | router ). +## DEVICE_TYPE?=router -# Default packages - the really basic set +##@ +# @brief Default packages. +# +# The really basic set. Additional packages are added based on @DEVICE_TYPE and +# @CONFIG_* values. +## DEFAULT_PACKAGES:=\ base-files \ ca-bundle \ @@ -27,15 +34,21 @@ DEFAULT_PACKAGES:=\ urandom-seed \ urngd -# For the basic set +##@ +# @brief Default packages for @DEVICE_TYPE basic. +## DEFAULT_PACKAGES.basic:= -# For nas targets +##@ +# @brief Default packages for @DEVICE_TYPE nas. +## DEFAULT_PACKAGES.nas:=\ block-mount \ fdisk \ lsblk \ mdadm -# For router targets +##@ +# @brief Default packages for @DEVICE_TYPE router. +## DEFAULT_PACKAGES.router:=\ dnsmasq \ firewall4 \ @@ -121,7 +134,18 @@ endif # Add device specific packages (here below to allow device type set from subtarget) DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE)) +##@ +# @brief Filter out packages, prepended with `-`. +# +# @param 1: Package list. +## filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1)) + +##@ +# @brief Append extra package dependencies. +# +# @param 1: Package list. +## extra_packages = $(if $(filter wpad wpad-% nas,$(1)),iwinfo) define ProfileDefault diff --git a/rules.mk b/rules.mk index 973fd1cbb9..54df407fca 100644 --- a/rules.mk +++ b/rules.mk @@ -20,6 +20,11 @@ endif export TMP_DIR:=$(TOPDIR)/tmp export TMPDIR:=$(TMP_DIR) +##@ +# @brief Strip quotes `"` and pounds `#` from string. +# +# @param 1: String. +## qstrip=$(strip $(subst ",,$(1))) #")) @@ -27,8 +32,23 @@ empty:= space:= $(empty) $(empty) comma:=, pound:=\# +##@ +# @brief Merge strings by removing spaces. +# +# @param 1: String. +## merge=$(subst $(space),,$(1)) +##@ +# @brief Get hash sum of variable list. +# +# @param 1: List of variable names. +## confvar=$(shell echo '$(foreach v,$(1),$(v)=$(subst ','\'',$($(v))))' | $(MKHASH) md5) +##@ +# @brief Strip last extension from file name. +# +# @param 1: File name. +## strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1)) paren_left = ( @@ -51,9 +71,18 @@ __tr_head = $(subst $(paren_left)subst,$(paren_left)subst$(space),$(__tr_head_st __tr_tail = $(subst $(space),,$(foreach cv,$(1),$(paren_right))) __tr_template = $(__tr_head)$$(1)$(__tr_tail) +##@ +# @brief Convert string characters to upper. +## $(eval toupper = $(call __tr_template,$(chars_lower),$(chars_upper))) +##@ +# @brief Convert string characters to lower. +## $(eval tolower = $(call __tr_template,$(chars_upper),$(chars_lower))) +##@ +# @brief Abbreviate version. Truncate to 8 characters. +## version_abbrev = $(if $(if $(CHECK),,$(DUMP)),$(1),$(shell printf '%.8s' $(1))) _SINGLE=export MAKEFLAGS=$(space); @@ -102,6 +131,13 @@ endif DEFAULT_SUBDIR_TARGETS:=clean download prepare compile update refresh prereq dist distcheck configure check check-depends +##@ +# @brief Create default targets. +# +# Targets are created from @DEFAULT_SUBDIR_TARGETS and input argument lists. +# +# @param 1: Additional targets list. +## define DefaultTargets $(foreach t,$(DEFAULT_SUBDIR_TARGETS) $(1), .$(t): @@ -371,16 +407,28 @@ export BISON_PKGDATADIR:=$(STAGING_DIR_HOST)/share/bison export HOST_GNULIB_SRCDIR:=$(STAGING_DIR_HOST)/share/gnulib export M4:=$(STAGING_DIR_HOST)/bin/m4 +##@ +# @brief Slugify variable name and prepend suffix. +## define shvar V_$(subst .,_,$(subst -,_,$(subst /,_,$(1)))) endef +##@ +# @brief Create and export variable, set to function result. +# +# @param 1: Function name. Used as variable name, prepended with `V_`. +## define shexport export $(call shvar,$(1))=$$(call $(1)) endef +##@ +# @brief Support 64 bit tine in C code. +# # Test support for 64-bit time with C code from largefile.m4 provided by GNU Gnulib -# the value is 'y' when successful and '' otherwise +# the value is `y` when successful and `` otherwise +## define YEAR_2038 $(shell \ mkdir -p $(TMP_DIR); \ @@ -392,9 +440,12 @@ $(shell \ ) endef -# Execute commands under flock -# $(1) => The shell expression. -# $(2) => The lock name. If not given, the global lock will be used. +##@ +# @brief Execute commands under flock +# +# @param 1: The shell expression. +# @param 2: The lock name. If not given, the global lock will be used. +## ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),) define locked SHELL= \ @@ -406,10 +457,14 @@ else locked=$(1) endif -# Recursively copy paths into another directory, purge dangling + +##@ +# @brief Recursively copy paths into another directory, purge dangling # symlinks before. -# $(1) => File glob expression -# $(2) => Destination directory +# +# @param 1: File glob expression. +# @param 1: Destination directory. +## define file_copy for src_dir in $(sort $(foreach d,$(wildcard $(1)),$(dir $(d)))); do \ ( cd $$src_dir; find -type f -or -type d ) | \ @@ -424,19 +479,30 @@ define file_copy $(CP) $(1) $(2) endef -# Calculate sha256sum of any plain file within a given directory -# $(1) => Input directory -# $(2) => If set, recurse into subdirectories +##@ +# @brief Calculate sha256sum of any plain file within a given directory. +# +# @param 1: Input directory. +# @param 2: If set, recurse into subdirectories. +## define sha256sums (cd $(1); find . $(if $(2),,-maxdepth 1) -type f -not -name 'sha256sums' -printf "%P\n" | sort | \ xargs -r $(MKHASH) -n sha256 | sed -ne 's!^\(.*\) \(.*\)$$!\1 *\2!p' > sha256sums) endef -# file extension +##@ +# @brief Retrieve file extension. +# +# @param 1: File name. +## ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1))) -# Count Git commits of a package -# $(1) => if non-empty: count commits since last ": [uU]pdate to " or ": [bB]ump to " in commit message +##@ +# @brief Count Git commits of a package. +# +# @param 1: if non-empty: count commits since last ": [uU]pdate to " +# or ": [bB]ump to " in commit message. +## define commitcount $(shell \ if git log -1 >/dev/null 2>/dev/null; then \ @@ -458,6 +524,11 @@ $(shell \ ) endef +##@ +# @brief Get ABI version string, stripping `-`, `_` and `.`. +# +# @param 1: Version string. +## abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1)))) COMMITCOUNT = $(if $(DUMP),0,$(call commitcount)) From 2942ee0a8d205428afcca9cd9c0479b161246229 Mon Sep 17 00:00:00 2001 From: "David S. H. Rosenthal" Date: Wed, 6 Nov 2024 10:19:17 +0000 Subject: [PATCH 036/119] scripts: add download-check-artifact.sh script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While checking wiki documentation about GPG signatures checking I found this nice script and I've thought, that it would be nice to provide it officially instead of some random internet site. Usage example: $ ./scripts/download-check-artifact.sh https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb 1) Downloading image file ========================= ########################################### 100.0% 2) Downloading checksum file ============================ ########################################### 100.0% 3) Downloading the GPG signature ================================ ########################################### 100.0% 4) Verifying GPG signature ========================== gpg: Signature made Tue 05 Nov 2024 05:21:50 PM UTC gpg: using EDDSA key 92C561DE55AE6552F3C736B82B0151090606D1D9 gpg: Good signature from "OpenWrt Build System (Nitrokey3) " [ultimate] Primary key fingerprint: 8A8B C12F 46B8 36C0 F9CD B36F 1D53 D187 7742 E911 Subkey fingerprint: 92C5 61DE 55AE 6552 F3C7 36B8 2B01 5109 0606 D1D9 5) Verifying SHA256 checksum ============================ openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb: OK Verification done! ================== Downloaded artifact placed in '/var/home/ynezz/dev/openwrt/openwrt.git/openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb' Cleaning up. Adding file in a state as downloaded from https://www.abitare.org/bin/download.sh References: https://openwrt.org/docs/guide-quick-start/verify_firmware_checksum?s[]=gpg#linux Signed-off-by: David S. H. Rosenthal Link: https://github.com/openwrt/openwrt/pull/16871 (cherry picked from commit 4c9031fda271ed7d4503642f63ff824faa6cc3a0) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- scripts/download-check-artifact.sh | 154 +++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100755 scripts/download-check-artifact.sh diff --git a/scripts/download-check-artifact.sh b/scripts/download-check-artifact.sh new file mode 100755 index 0000000000..31868da5cd --- /dev/null +++ b/scripts/download-check-artifact.sh @@ -0,0 +1,154 @@ +#!/usr/bin/env bash +# Script to perform verified file downloads. +# Exit codes: +# 0 - File downloaded successfully and verified +# 1 - Failed to download requested file +# 2 - Failed to download sha256sums file +# 3 - Failed to download sha256sums.gpg file +# 4 - GnuPG is available but fails to verify the signature (missing pubkey, file integrity error, ...) +# 5 - The checksums do not match +# 6 - Unable to copy the requested file to its final destination +# 254 - The script got interrupted by a signal +# 255 - A suitable download or checksum utility is missing + +[ -n "$1" ] || { + echo "Usage: $0 " >&2 + exit 1 +} + +finish() { + [ -e "/tmp/verify.$$" ] && { + echo "Cleaning up." + rm -r "/tmp/verify.$$" + } + exit $1 +} + +trap "finish 254" INT TERM + +destdir="$(pwd)" +image_url="$1" +image_file="${image_url##*/}" +sha256_url="${image_url%/*}/sha256sums" +gpgsig_url="${image_url%/*}/sha256sums.asc" +keyserver_url="hkp://keyserver.ubuntu.com" + +# Find a suitable download utility +if which curl >/dev/null; then + download() { curl --progress-bar -o "$1" "$2"; } +elif which wget >/dev/null; then + download() { wget -O "$1" "$2"; } +elif which fetch >/dev/null; then + download() { fetch -o "$1" "$2"; } +else + echo "No suitable download utility found, cannot download files!" >&2 + finish 255 +fi + +# Find a suitable checksum utility +if which sha256sum >/dev/null; then + checksum() { sha256sum -c --ignore-missing "sha256sums"; } +elif which shasum >/dev/null; then + checksum() { + local sum="$(shasum -a 256 "$image_file")"; + grep -xF "${sum%% *} *$image_file" "sha256sums"; + } +else + echo "No SHA256 checksum executable installed, cannot verify checksums!" >&2 + finish 255 +fi + +# Check for gpg availability +if which gpg >/dev/null; then + runpgp() { gpg "$@"; } +else + runpgp() { + echo "WARNING: No GnuPG installed, cannot verify digital signature!" >&2 + return 0 + } +fi + +mkdir -p "/tmp/verify.$$" +cd "/tmp/verify.$$" + +echo "" +echo "1) Downloading image file" +echo "=========================" +download "$image_file" "$image_url" || { + echo "Failed to download image file!" >&2 + finish 1 +} + +echo "" +echo "2) Downloading checksum file" +echo "============================" +download "sha256sums" "$sha256_url" || { + echo "Failed to download checksum file!" >&2 + finish 2 +} + +echo "" +echo "3) Downloading the GPG signature" +echo "================================" +download "sha256sums.gpg" "$gpgsig_url" || { + echo "Failed to download GPG signature!" >&2 + finish 3 +} + +echo "" +echo "4) Verifying GPG signature" +echo "==========================" +missing_key=$(runpgp --status-fd 1 --with-fingerprint --verify \ + "sha256sums.gpg" "sha256sums" 2>/dev/null | sed -ne 's!^.* NO_PUBKEY !!p') + +if [ -n "$missing_key" ]; then + echo "The signature was signed by a public key with the id $missing_key" >&2 + echo "which is not present on this system." >&2 + echo "" >&2 + + echo "Provide a public keyserver url below or press enter to accept the" >&2 + echo "default suggestion. Hit Ctrl-C to abort the operation." >&2 + echo "" >&2 + + while true; do + printf "Keyserver to use? [$keyserver_url] > " + read url; case "${url:-$keyserver_url}" in + hkp://*) + gpg --keyserver "${url:-$keyserver_url}" --recv-keys "$missing_key" || { + echo "Failed to download public key." >&2 + finish 7 + } + break + ;; + *) + echo "Expecting a key server url in the form 'hkp://hostname'." >&2 + ;; + esac + done +fi + +runpgp --with-fingerprint --verify "sha256sums.gpg" "sha256sums" || { + echo "Failed to verify checksum file with GPG signature!" >&2 + finish 4 +} + +echo "" +echo "5) Verifying SHA256 checksum" +echo "============================" +checksum || { + echo "Checksums do not match!" >&2 + finish 5 +} + +cp "$image_file" "$destdir/$image_file" || { + echo "Failed to write '$destdir/$image_file'" >&2 + finish 6 +} + +echo "" +echo "Verification done!" +echo "==================" +echo "Firmware image placed in '$destdir/$image_file'." +echo "" + +finish 0 From 8f0d52d8c42234ffd6292e6e2d6490987c92e624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 6 Nov 2024 10:40:37 +0000 Subject: [PATCH 037/119] scripts: download-check-artifact.sh: fix shellcheck and improve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following shellcheck's recommendations: In scripts/download-check-artifact.sh line 24: exit $1 ^-- SC2086 (info): Double quote to prevent globbing and word splitting. In scripts/download-check-artifact.sh line 53: local sum="$(shasum -a 256 "$image_file")"; ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In scripts/download-check-artifact.sh line 72: cd "/tmp/verify.$$" ^-----------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. In scripts/download-check-artifact.sh line 114: printf "Keyserver to use? [$keyserver_url] > " ^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In scripts/download-check-artifact.sh line 115: read url; case "${url:-$keyserver_url}" in ^--^ SC2162 (info): read without -r will mangle backslashes. While at it make it clear, that it is possible to download/check any build artifacts like even SDK or ImageBuilder. Link: https://github.com/openwrt/openwrt/pull/16871 (cherry picked from commit 27c2c140b16cb490f20c1c2259b3decf50ae5762) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- scripts/download-check-artifact.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/download-check-artifact.sh b/scripts/download-check-artifact.sh index 31868da5cd..bc0918b214 100755 --- a/scripts/download-check-artifact.sh +++ b/scripts/download-check-artifact.sh @@ -12,6 +12,7 @@ # 255 - A suitable download or checksum utility is missing [ -n "$1" ] || { + echo "$0 - Download and verify build artifacts" echo "Usage: $0 " >&2 exit 1 } @@ -21,7 +22,7 @@ finish() { echo "Cleaning up." rm -r "/tmp/verify.$$" } - exit $1 + exit "$1" } trap "finish 254" INT TERM @@ -50,7 +51,8 @@ if which sha256sum >/dev/null; then checksum() { sha256sum -c --ignore-missing "sha256sums"; } elif which shasum >/dev/null; then checksum() { - local sum="$(shasum -a 256 "$image_file")"; + local sum + sum="$(shasum -a 256 "$image_file")"; grep -xF "${sum%% *} *$image_file" "sha256sums"; } else @@ -68,11 +70,14 @@ else } fi -mkdir -p "/tmp/verify.$$" -cd "/tmp/verify.$$" +tmpdir="$(mktemp -d)" +cd "$tmpdir" || { + echo "Failed to create temporary directory!" >&2 + finish 255 +} echo "" -echo "1) Downloading image file" +echo "1) Downloading artifact file" echo "=========================" download "$image_file" "$image_url" || { echo "Failed to download image file!" >&2 @@ -111,8 +116,8 @@ if [ -n "$missing_key" ]; then echo "" >&2 while true; do - printf "Keyserver to use? [$keyserver_url] > " - read url; case "${url:-$keyserver_url}" in + printf 'Keyserver to use? [%s] > ' "$keyserver_url" + read -r url; case "${url:-$keyserver_url}" in hkp://*) gpg --keyserver "${url:-$keyserver_url}" --recv-keys "$missing_key" || { echo "Failed to download public key." >&2 @@ -148,7 +153,7 @@ cp "$image_file" "$destdir/$image_file" || { echo "" echo "Verification done!" echo "==================" -echo "Firmware image placed in '$destdir/$image_file'." +echo "Downloaded artifact placed in '$destdir/$image_file'." echo "" finish 0 From 2226546e1c07ca442ccd89bb0dad54776c216d89 Mon Sep 17 00:00:00 2001 From: Enrico Mioso Date: Sat, 9 Nov 2024 22:14:31 +0100 Subject: [PATCH 038/119] uboot-mediatek: add support for GatoNetworks GDSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GatoNetworks GDSP is a re-branded version of the R5000 5G Industrial router from Yinghua Technologies. Advantages over stock bootloader: 1. supports serving the external GPIO WDT, allowing for easier work in U-Boot shell 2. supports cool features like netconsole, easy recovery, scripting and so on 3. allows using FIT image and image integrity validation and ultimately gives you much more flexibility to implement your tweaks. Known issues ------------ To make it easier to operate the device, console I/O multiplexing support has been enabled in U-Boot configuration. Setting I/O related U-Boot environment variables to something like "serial,nc" will have the desired effect. Still, setting these variables to such a value in the persistent environment will lead to a crash and make it impossible to boot the system or recover it. I decided to leave it on anyway since I think it can be very practical in development. Signed-off-by: Enrico Mioso (cherry picked from commit 7f2c7b3238ee26180d44528ae98fd2f54e874511) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/boot/uboot-mediatek/Makefile | 14 + ...ialized-the-watchdog-subsystem-later.patch | 54 +++ .../patches/458-add-GatoNetworks-GDSP.patch | 406 ++++++++++++++++++ 3 files changed, 474 insertions(+) create mode 100644 package/boot/uboot-mediatek/patches/457-initialized-the-watchdog-subsystem-later.patch create mode 100644 package/boot/uboot-mediatek/patches/458-add-GatoNetworks-GDSP.patch diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 3485765368..d2a03277d4 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -364,6 +364,19 @@ define U-Boot/mt7981_rfb-emmc DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr3 endef +define U-Boot/mt7981_gatonetworks_gdsp + NAME:=GatoNetworks GDSP + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=gatonetworks_gdsp + UBOOT_CONFIG:=mt7981_gatonetworks_gdsp + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=nor + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr3 + FIP_COMPRESS:=1 +endef + define U-Boot/mt7981_rfb-nor NAME:=MT7981 Reference Board BUILD_SUBTARGET:=filogic @@ -797,6 +810,7 @@ UBOOT_TARGETS := \ mt7981_abt_asr3000 \ mt7981_cmcc_rax3000m-emmc \ mt7981_cmcc_rax3000m-nand \ + mt7981_gatonetworks_gdsp \ mt7981_glinet_gl-x3000 \ mt7981_glinet_gl-xe3000 \ mt7981_h3c_magic-nx30-pro \ diff --git a/package/boot/uboot-mediatek/patches/457-initialized-the-watchdog-subsystem-later.patch b/package/boot/uboot-mediatek/patches/457-initialized-the-watchdog-subsystem-later.patch new file mode 100644 index 0000000000..7919b36560 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/457-initialized-the-watchdog-subsystem-later.patch @@ -0,0 +1,54 @@ +From 9c1ad8a18ac1a20aee7a617964bcae3e90dac700 Mon Sep 17 00:00:00 2001 +From: Enrico Mioso +Date: Wed, 23 Oct 2024 17:46:35 +0200 +Subject: [PATCH] uboot-mediatek: initialized the watchdog subsystem later + +Initialize the watchdog subsystem later during initialization, to allow for +the gpio-wdt driver to work. + +Signed-off-by: Enrico Mioso +--- + common/board_r.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +--- a/common/board_r.c ++++ b/common/board_r.c +@@ -663,19 +663,13 @@ static init_fnc_t init_sequence_r[] = { + serial_initialize, + initr_announce, + dm_announce, +-#if CONFIG_IS_ENABLED(WDT) +- initr_watchdog, +-#endif +- INIT_FUNC_WATCHDOG_RESET + arch_initr_trap, + #if defined(CONFIG_BOARD_EARLY_INIT_R) + board_early_init_r, + #endif +- INIT_FUNC_WATCHDOG_RESET + #ifdef CONFIG_POST + post_output_backlog, + #endif +- INIT_FUNC_WATCHDOG_RESET + #if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT) + /* + * Do early PCI configuration _before_ the flash gets initialised, +@@ -690,7 +684,6 @@ static init_fnc_t init_sequence_r[] = { + #ifdef CONFIG_MTD_NOR_FLASH + initr_flash, + #endif +- INIT_FUNC_WATCHDOG_RESET + #if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) + /* initialize higher level parts of CPU like time base and timers */ + cpu_init_r, +@@ -719,6 +712,10 @@ static init_fnc_t init_sequence_r[] = { + #ifdef CONFIG_PVBLOCK + initr_pvblock, + #endif ++#if CONFIG_IS_ENABLED(WDT) ++ initr_watchdog, ++#endif ++ INIT_FUNC_WATCHDOG_RESET + initr_env, + #ifdef CONFIG_SYS_MALLOC_BOOTPARAMS + initr_malloc_bootparams, diff --git a/package/boot/uboot-mediatek/patches/458-add-GatoNetworks-GDSP.patch b/package/boot/uboot-mediatek/patches/458-add-GatoNetworks-GDSP.patch new file mode 100644 index 0000000000..28bdd95e15 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/458-add-GatoNetworks-GDSP.patch @@ -0,0 +1,406 @@ +From 57d0f608d925cb688b5c9b71512fca7d228f07f6 Mon Sep 17 00:00:00 2001 +From: Enrico Mioso +Date: Wed, 23 Oct 2024 20:39:28 +0200 +Subject: [PATCH] add GatoNetworks GDSP + +Signed-off-by: Enrico Mioso +--- + arch/arm/dts/mt7981-gatonetworks_gdsp.dts | 200 +++++++++++++++++++++ + configs/mt7981_gatonetworks_gdsp_defconfig | 144 +++++++++++++++ + gatonetworks_gdsp_env | 38 ++++ + 3 files changed, 382 insertions(+) + create mode 100644 arch/arm/dts/mt7981-gatonetworks_gdsp.dts + create mode 100644 configs/mt7981_gatonetworks_gdsp_defconfig + create mode 100644 gatonetworks_gdsp_env + +--- /dev/null ++++ b/arch/arm/dts/mt7981-gatonetworks_gdsp.dts +@@ -0,0 +1,200 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "GatoNetworks GDSP"; ++ compatible = "gatonetworks,gdsp", "mediatek,mt7981"; ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x40000000 0x10000000>; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sim1 { ++ label = "sim1"; ++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sim2 { ++ label = "sim2"; ++ gpios = <&gpio 0 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sg1 { ++ label = "sg1"; ++ gpios = <&gpio 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sg2 { ++ label = "sg2"; ++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sg3 { ++ label = "sg3"; ++ gpios = <&gpio 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sg4 { ++ label = "sg4"; ++ gpios = <&gpio 7 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sg5 { ++ label = "sg5"; ++ gpios = <&gpio 8 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sg6 { ++ label = "sg6"; ++ gpios = <&gpio 9 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ gpio-watchdog { ++ compatible = "linux,wdt-gpio"; ++ gpios = <&gpio 6 GPIO_ACTIVE_LOW>; ++ hw_algo = "toggle"; ++ hw_margin_ms = <25000>; ++ always-running; ++ u-boot,autostart; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "2500base-x"; ++ mediatek,switch = "mt7531"; ++ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&spi2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi2_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@00000 { ++ label = "BL2"; ++ reg = <0x00000 0x0040000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "u-boot-env"; ++ reg = <0x40000 0x0010000>; ++ }; ++ ++ partition@50000 { ++ label = "Factory"; ++ reg = <0x50000 0x00B0000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "FIP"; ++ reg = <0x100000 0x0080000>; ++ }; ++ ++ partition@180000 { ++ label = "firmware"; ++ reg = <0x180000 0x1E80000>; ++ }; ++ }; ++ }; ++}; ++ ++&pinctrl { ++ uart1_pins: uart1-pins { ++ mux { ++ function = "uart"; ++ groups = "uart1_0"; ++ }; ++ }; ++ ++ uart2_pins: uart2-pins { ++ mux { ++ function = "uart"; ++ groups = "uart2_0_tx_rx"; ++ }; ++ }; ++ ++ spi2_flash_pins: spi2-pins { ++ mux { ++ function = "spi"; ++ groups = "spi2", "spi2_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pins>; ++ status = "okay"; ++}; +--- /dev/null ++++ b/configs/mt7981_gatonetworks_gdsp_defconfig +@@ -0,0 +1,144 @@ ++CONFIG_ARM=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x10000 ++CONFIG_ENV_OFFSET=0x0 ++CONFIG_DEFAULT_DEVICE_TREE="mt7981-gatonetworks_gdsp" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7981=y ++CONFIG_WATCHDOG_TIMEOUT_MSECS=25000 ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_SPI_BOOT=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_USE_PREBOOT=y ++CONFIG_DEFAULT_FDT_FILE="mt7981-gatonetworks_gdsp" ++CONFIG_SYS_CBSIZE=512 ++CONFIG_SYS_PBSIZE=1049 ++CONFIG_LOGLEVEL=7 ++CONFIG_CONSOLE_MUX=y ++CONFIG_LOG=y ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="GDSP> " ++CONFIG_SYS_MAXARGS=16 ++CONFIG_CMD_BDINFO_EXTRA=y ++CONFIG_CMD_CPU=y ++CONFIG_CMD_HISTORY=y ++CONFIG_CMD_LICENSE=y ++# CONFIG_BOOTM_NETBSD is not set ++# CONFIG_BOOTM_PLAN9 is not set ++# CONFIG_BOOTM_RTEMS is not set ++# CONFIG_BOOTM_VXWORKS is not set ++# CONFIG_CMD_BOOTEFI_BOOTMGR is not set ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_CALLBACK=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CRC32_VERIFY=y ++CONFIG_LOOPW=y ++CONFIG_CMD_MEMINFO=y ++CONFIG_CMD_MEMTEST=y ++CONFIG_CMD_STRINGS=y ++# CONFIG_CMD_UNLZ4 is not set ++# CONFIG_CMD_UNZIP is not set ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPIO_READ=y ++CONFIG_CMD_PWM=y ++CONFIG_CMD_MTD=y ++# CONFIG_CMD_NAND_EXT is not set ++CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_CAT=y ++CONFIG_CMD_SETEXPR_FMT=y ++CONFIG_CMD_XXD=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_TFTPPUT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++# CONFIG_CMD_EFICONFIG is not set ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_MTD=y ++CONFIG_ENV_MTD_NAME="u-boot-env" ++CONFIG_ENV_SIZE_REDUND=0x0 ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_DEFAULT_ENV_FILE="gatonetworks_gdsp_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_NETCONSOLE=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_DM_SPI_FLASH=y ++CONFIG_SPI_FLASH_SFDP_SUPPORT=y ++CONFIG_SPI_FLASH_EON=y ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_ISSI=y ++CONFIG_SPI_FLASH_MACRONIX=y ++CONFIG_SPI_FLASH_SPANSION=y ++CONFIG_SPI_FLASH_STMICRO=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_SPI_FLASH_XMC=y ++CONFIG_SPI_FLASH_XTX=y ++CONFIG_SPI_FLASH_MTD=y ++CONFIG_UBI_SILENCE_MSG=y ++CONFIG_PHY_FIXED=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PHY=y ++CONFIG_PHY_MTK_TPHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7981=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_PWM=y ++CONFIG_PWM_MTK=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_MTK=y ++CONFIG_USB_STORAGE=y ++CONFIG_WDT=y ++CONFIG_WDT_GPIO=y ++CONFIG_UBIFS_SILENCE_MSG=y ++CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 +--- /dev/null ++++ b/gatonetworks_gdsp_env +@@ -0,0 +1,38 @@ ++load_factory_data=if env exists factory_data_present ; then else mtd read Factory $loadaddr 0x0 0x1000 ; setenv factory_data_present 1 ; fi ++lan_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x2a ; env readmem -b lan_mac $macoffs 0x6 ; setenv lan_mac_factory ; setenv macoffs ++wan_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x24 ; env readmem -b wan_mac $macoffs 0x6 ; setenv wan_mac_factory ; setenv macoffs ++label_mac_factory=run load_factory_data ; setexpr macoffs $loadaddr + 0x4 ; env readmem -b label_mac $macoffs 0x6 ; setenv label_mac_factory ; setenv macoffs ++ethaddr_factory=setenv ethaddr $lan_mac ; setenv ethaddr_factory ++wifi_mac_factory=setenv wifi_mac $label_mac ; setenv wifi_mac_factory ++env_cleanup=setenv load_factory_data ; setenv factory_data_present ; setenv env_cleanup ++ipaddr=192.168.1.1 ++serverip=192.168.1.10 ++loadaddr=0x46000000 ++bootcmd=run boot_nor ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-gatonetworks_gdsp-initramfs-kernel.bin ++bootfile_upg=openwrt-mediatek-filogic-gatonetworks_gdsp-squashfs-sysupgrade.bin ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot system from flash.=run boot_nor ; run bootmenu_confirm_return ++bootmenu_3=Load system via TFTP then write to flash.=run boot_tftp_sysupgrade ; run bootmenu_confirm_return ++bootmenu_4=Reset all settings to factory defaults.=run reset_factory ; reset ++bootmenu_5=Reboot.=reset ++boot_first=if button reset ; then run boot_tftp ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_tftp_forever ++boot_nor=mtd read firmware ${loadaddr} ; bootm $loadaddr ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr ++boot_tftp_forever=while true ; do run boot_tftp ; sleep 1 ; done ++boot_tftp_sysupgrade=tftpboot $loadaddr $bootfile_upg && iminfo $loadaddr && run nor_write_production ++reset_factory=env default -a && saveenv && reset ++nor_pad_size=setexpr image_eb $filesize / 0x1000 ; setexpr tmp1 image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb $image_eb + 1 ; setexpr image_eb $image_eb * 0x1000 ++nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x1e80000 && mtd erase firmware 0x0 0x$image_eb && mtd write firmware $loadaddr 0x0 $filesize ++_init_env=setenv _init_env ; saveenv ++_firstboot=setenv _firstboot ; run _switch_to_menu ; run lan_mac_factory ; run wan_mac_factory ; run label_mac_factory ; run env_cleanup ; run ethaddr_factory ; run wifi_mac_factory ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" From 7d9fc260a1e56299a17eb23f1ba0ccda13fb445d Mon Sep 17 00:00:00 2001 From: Enrico Mioso Date: Sat, 9 Nov 2024 22:14:32 +0100 Subject: [PATCH 039/119] uboot-envtools: add support for GatoNetworks GDSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This configuration should work with both stock and OpenWrt-based U-Boot. Signed-off-by: Enrico Mioso (cherry picked from commit 785ebf2baff4adadf818d71a99fdb2d2300590ba) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/boot/uboot-envtools/files/mediatek_filogic | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index a38024de65..9de1a4d75d 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -86,6 +86,9 @@ zbtlink,zbt-z8103ax) dlink,aquila-pro-ai-m30-a1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" ;; +gatonetworks,gdsp) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" + ;; glinet,gl-x3000|\ glinet,gl-xe3000|\ glinet,gl-mt2500|\ From f2a40e11176f74adba1228880725af7a95ebfaf0 Mon Sep 17 00:00:00 2001 From: Enrico Mioso Date: Sat, 9 Nov 2024 22:14:33 +0100 Subject: [PATCH 040/119] mediatek: filogic: add support for GatoNetworks GDSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GatoNetworks GDSP is a re-branded version of the R5000 5G Industrial router from Yinghua Technologies. The re-branded device comes with OpenWrt preinstalled, and an OpenWrt-based U-Boot bootloader version. While the flash layout has been kept compatible with the OpenWrt version found on the stock device (see [5]), the image format changed, making a bootloader upgrade necessary. Specifications: SoC: Mediatek MT7981BA RAM: 256MB Flash: SPI-NOR 32 MiB (Winbond W25Q256) WLAN: MT7976CN DBDC AX Wi-Fi Switch: MT7531AE (4x LAN Gigabit ports, 1x WAN Gigabit port) 5G: Quectel RM520N modem Watchdog: an external WDT connected to GPIO 6 is present and always running; the built-in Mediatek watchdog is also present and effective, but not used at the moment. This porting has been tested only with 1x 5G modems installed (the device supports up to two). Installation: Installation is possible via sysupgrade both in the stock device and re-branded version. However, in the former case, updating the bootloader is required. OpenWrt-based U-Boot Bootloader installation -------------------------------------------- The firmware flashed in the re-branded device at manifacturing time will flash an OpenWrt-based U-Boot bootloader with some extra recovery features (see [1]) at first boot. To update the bootloader, you need to install the mtd-rw module and insmod it: insmod mtd-rw i_want_a_brick=1 Then update relevant flash partitions: mtd erase u-boot-env mtd erase BL2 mtd erase FIP mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-preloader.bin BL2 mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-bl31-uboot.fip FIP And reboot, making sure all previous commands ran succesfully. If something goes wrong, you can recover your device via the mtk_uartboot tool. In my testing, it was possible to start the process even without (un)-plugging the device, may be handy for remote recovery. Installation from stock device and firmware ------------------------------------------- To install vanilla OpenWrt in the stock device (R5000 5G Industrial router from Yinghua Technologies) running the stock vendor firmware, you will need to update your bootloader as described in previous section. Remember to use -F (force upgrade) and -n (not keeping settings). U-Boot Recovery --------------- This procedure has been tested only with the OpenWrt-based U-boot bootloader. Assign your system static IP address 192.168.1.1 and start a TFTP server. The device will look for an initramfs image named openwrt-mediatek-filogic-gatonetworks_gdsp-initramfs-kernel.bin (so you may use openwrt/bin/targets/mediatek/filogic as root dir for your TFTP server). Power on the device while keeping the reset button pressed, until you see a TFTP request from 192.168.1.10. Your environment will be restored to it's default state. MAC addresses assignment ------------------------ MAC addresses are assigned slightly differently than in stock firmware. In particular, the 5 GHz Wi-Fi uses 2.4 GHZ MAC + 1, rather than reusing it with LA bit set as done in stock firmware. This MAC address is allocated to the device, so it can be used. The 2.4 GHz Wi-Fi MAC address is the label MAC. LAN MAC is used to set the special U-Boot environment ethaddr variable. device MAC address U-Boot env variable factory partition offset 2.4 GHz Wi-Fi :84 wifi_mac 0x4 5.8 GHz Wi-Fi :85 not present not present WAN :86 wan_mac 0x24 LAN :87 lan_mac 0x2A Notes ----- [1]: the OpenWrt-based U-Boot bootloader you will find installed in the re-branded device is configured to request for the initramfs image via TFTP for $gdsp_tftp_tries times before trying normal boot from NOR flash. Setting this U-Boot environment variable to 0x0 will disable the feature, which is not implemented in this patch. [2]: the exposed UART port is connected to ttyS1; the ttyS0 console port is not exposed. [3]: the provided bootloader environment has no provision for operating on BL2 and the FIP partitions. This is an intentional choice to make it (slightly) more difficult to brick the device. [4]: it seems GPIO 6 is used both for the "SYS" LED and external WDT. [5] BL2 expects to find FIP payload at a fixed offset, so some constraints apply. Signed-off-by: Enrico Mioso (cherry picked from commit b43194e041b17fbb574fb3721dafedcc30a20ab5) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../dts/mt7981b-gatonetworks-gdsp.dts | 389 ++++++++++++++++++ .../base-files/lib/upgrade/platform.sh | 1 + target/linux/mediatek/image/filogic.mk | 20 + 3 files changed, 410 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7981b-gatonetworks-gdsp.dts diff --git a/target/linux/mediatek/dts/mt7981b-gatonetworks-gdsp.dts b/target/linux/mediatek/dts/mt7981b-gatonetworks-gdsp.dts new file mode 100644 index 0000000000..fd9fdca124 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-gatonetworks-gdsp.dts @@ -0,0 +1,389 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7981.dtsi" + +/ { + model = "GatoNetworks GDSP"; + compatible = "gatonetworks,gdsp", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + label-mac-device = &wifi_band_0; + led-boot = &sg1; + led-failsafe = &sg1; + led-running = &sg1; + led-upgrade = &sg1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "console=ttyS0,115200n1 earlycon=uart8250,mmio32,0x11002000"; + rootdisk = <&firmware>; + }; + + memory { + reg = <0 0x40000000 0 0x10000000>; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + modem1 { + gpio-export,name = "modem1"; + gpio-export,output = <0>; + gpios = <&pio 2 GPIO_ACTIVE_LOW>; + }; + + modem2 { + gpio-export,name = "modem2"; + gpio-export,output = <0>; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + sim1 { + label = "green:sim1"; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + + sim2 { + label = "green:sim2"; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + + sg1: sg1 { + label = "green:sg1"; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + sg2 { + label = "green:sg2"; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + sg3 { + label = "green:sg3"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + sg4 { + label = "green:sg4"; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + }; + + sg5 { + label = "green:sg5"; + gpios = <&pio 8 GPIO_ACTIVE_LOW>; + }; + + sg6 { + label = "green:sg6"; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&pio 6 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + hw_margin_ms = <25000>; + always-running; + }; +}; + +&watchdog { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cells = <&macaddr_lan>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 0>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + swphy0: phy@0 { + reg = <0>; + }; + + swphy1: phy@1 { + reg = <1>; + }; + + swphy2: phy@2 { + reg = <2>; + }; + + swphy3: phy@3 { + reg = <3>; + }; + + swphy4: phy@4 { + reg = <4>; + }; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + phy-handle = <&swphy0>; + }; + + port@1 { + reg = <1>; + label = "lan2"; + phy-handle = <&swphy1>; + }; + + port@2 { + reg = <2>; + label = "lan3"; + phy-handle = <&swphy2>; + }; + + port@3 { + reg = <3>; + label = "lan4"; + phy-handle = <&swphy3>; + }; + + port@4 { + reg = <4>; + label = "wan"; + nvmem-cells = <&macaddr_wan>; + nvmem-cell-names = "mac-address"; + phy-handle = <&swphy4>; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + }; + }; +}; + +&crypto { + status = "okay"; +}; + +&wifi { + mediatek,mtd-eeprom = <&factory 0x0>; + status = "okay"; + + wifi_band_0: band@0 { + reg = <0>; + nvmem-cells = <&macaddr_wifi 0>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_wifi 1>; + nvmem-cell-names = "mac-address"; + }; +}; + +&spi2 { + pinctrl-names = "default"; + pinctrl-0 = <&spi2_flash_pins>; + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <52000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@00000 { + label = "BL2"; + reg = <0x00000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x0010000>; + }; + + factory: partition@50000 { + label = "Factory"; + reg = <0x50000 0x00B0000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_wifi: macaddr@4 { + reg = <0x4 0x6>; + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + + macaddr_wan: macaddr@24 { + reg = <0x24 0x6>; + }; + + macaddr_lan: macaddr@2a { + reg = <0x2a 0x6>; + }; + }; + }; + + partition@100000 { + label = "FIP"; + reg = <0x100000 0x0080000>; + read-only; + }; + + firmware: partition@180000 { + label = "firmware"; + reg = <0x180000 0x1E80000>; + }; + }; + }; +}; + +&pio { + uart1_pins: uart1-pins { + mux { + function = "uart"; + groups = "uart1_0"; + }; + }; + + uart2_pins: uart2-pins { + mux { + function = "uart"; + groups = "uart2_0_tx_rx"; + }; + }; + + spi2_flash_pins: spi2-pins { + mux { + function = "spi"; + groups = "spi2", "spi2_wp_hold"; + }; + + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + mediatek,u3p-dis-msk = <0x0>; + phys = <&u2port0 PHY_TYPE_USB2>, + <&u3port0 PHY_TYPE_USB3>; + status = "okay"; + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; +}; diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 7fe2d29d31..cfd77b62d7 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -70,6 +70,7 @@ platform_do_upgrade() { bananapi,bpi-r4|\ bananapi,bpi-r4-poe|\ cmcc,rax3000m|\ + gatonetworks,gdsp|\ h3c,magic-nx30-pro|\ jcg,q30-pro|\ jdcloud,re-cp-03|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 5dfde755a0..739fd54308 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -670,6 +670,26 @@ define Device/edgecore_eap111 endef TARGET_DEVICES += edgecore_eap111 +define Device/gatonetworks_gdsp + DEVICE_VENDOR := GatoNetworks + DEVICE_MODEL := gdsp + DEVICE_DTS := mt7981b-gatonetworks-gdsp + DEVICE_DTS_DIR := ../dts + IMAGES := sysupgrade.itb + IMAGE_SIZE := 32768k + DEVICE_PACKAGES := fitblk kmod-mt7915e kmod-mt7981-firmware \ + kmod-usb-net-qmi-wwan kmod-usb-serial-option kmod-usb3 \ + mt7981-wo-firmware -kmod-phy-aquantia + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 nor-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot gatonetworks_gdsp + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += gatonetworks_gdsp + define Device/glinet_gl-mt2500 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-MT2500 From 77af73050cd53d022a5a4a503f38ffa226a48384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Fri, 15 Nov 2024 10:01:35 +0100 Subject: [PATCH 041/119] utils: Add the omnia-eeprom utility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new utility, `omnia-eeprom`, which can be used to print / set EEPROM fields on Turris Omnia. One example when this utility might be useful is if the board experiences random crashes due to newer versions of the DDR training algorithm in newer U-Boot. The user can change the DDR speed from 1600K to 1333H to solve these issues, with ``` omnia-eeprom set ddr_speed 1333H ``` Signed-off-by: Marek Behún Link: https://github.com/openwrt/openwrt/pull/16264 Signed-off-by: Robert Marko (cherry picked from commit 749a43325b98afe4430fa7e2f23ac3ee44791ad6) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/utils/omnia-eeprom/Makefile | 56 ++++++++++++++++++++++++++++ target/linux/mvebu/image/cortexa9.mk | 3 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 package/utils/omnia-eeprom/Makefile diff --git a/package/utils/omnia-eeprom/Makefile b/package/utils/omnia-eeprom/Makefile new file mode 100644 index 0000000000..03eb13bbc1 --- /dev/null +++ b/package/utils/omnia-eeprom/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2024 Marek Behún +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=omnia-eeprom +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-v$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/omnia-eeprom/-/archive/v$(PKG_VERSION)/ +PKG_HASH:=6f949d0b8080adca8bae088774ce615b563ba6ec2807cce97ee6769b4eee7bbf + +PKG_MAINTAINER:=Marek Behun +PKG_LICENSE:=GPL-2.0-or-later + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +include $(INCLUDE_DIR)/package.mk + +define Package/omnia-eeprom + SECTION:=utils + CATEGORY:=Utilities + URL:=https://gitlab.nic.cz/turris/omnia-eeprom + TITLE:=CZ.NIC Turris Omnia EEPROM accessing utility + DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia +kmod-eeprom-at24 +endef + +define Package/omnia-eeprom/description +This package contains the omnia-eeprom utility, which allows you to display +and update EEPROM fields on the Turris Omnia router. +The EEPROM is normally not meant to be updated by users, but there are some +exceptions where it might be useful. +One such example is to change the DDR3 speed from the default 1600K mode to +1333H mode, in order to solve random crashes that occur on some boards with +newer versions of the U-Boot bootloader (because of bugs in newer versions of +the DDR training algorithm). +endef + +MAKE_VARS += OMNIA_EEPROM_VERSION="v$(PKG_VERSION)" + +TARGET_CFLAGS += -Wall + +Build/Compile = $(Build/Compile/Default) + +define Package/omnia-eeprom/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/omnia-eeprom $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,omnia-eeprom)) diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 6e49045f68..4a41f2c102 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -107,7 +107,8 @@ define Device/cznic_turris-omnia mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ wpad-basic-mbedtls kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ kmod-mt7915-firmware partx-utils kmod-i2c-mux-pca954x kmod-leds-turris-omnia \ - kmod-turris-omnia-mcu kmod-gpio-button-hotplug omnia-mcu-firmware omnia-mcutool + kmod-turris-omnia-mcu kmod-gpio-button-hotplug omnia-eeprom omnia-mcu-firmware \ + omnia-mcutool IMAGES := sysupgrade.img.gz IMAGE/sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata SUPPORTED_DEVICES += armada-385-turris-omnia From f59c665660e54dbf57c82711074a9c483d24b88f Mon Sep 17 00:00:00 2001 From: Joe Zheng Date: Fri, 20 Sep 2024 05:57:34 +0000 Subject: [PATCH 042/119] linux-firmware: rename packages for i915 firmware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the package name from intel-igpu-firmware-* to i915-firmware-*, the prefix "intel-igpu" is misleading, i915 firmware is not only for iGPU but also for dGPU now. Remove the redundant "intel" as i915 is already well known. More accurate file classification to handle following files correctly: adlp_dmc.bin mtl_huc.bin mtl_huc_gsc.bin mtl_gsc_1.bin The pattern in regex is "([[:alnum:]]+)_([[:alnum:]]+)(_[\w-.]+)?\.bin", where $1 is the platform, $2 is the firmware type (dmc, guc, huc, etc.), and the optional $3 which is revision or other suffix. Glob first to narrow down the target file set, and then split with "_" to extract the firmware type (remove the ".bin" in case there is no $3) Add package "i915-firmware" as a meta package to install all the i915 firmwares, it is a balance between simplicity and optimization. * Installing all the available firmwares as a whole, can support all the platforms, not only the current one but also the future ones. The price to pay is the increased size. * If we want to minimize the storage, we can customize to install the necessary ones only, even for the target platform only (e.g. ADL) and skip the others. The price to pay is the time to tune. What I am going to do is: * Let drm-i915 driver depend on i915-firmware-dmc, which is small and can cover most of the old platforms * Let the user select i915-firmware to install all the i915 firmwares as a whole to cover the latest or future platforms Signed-off-by: Joe Zheng Link: https://github.com/openwrt/openwrt/pull/16276 Signed-off-by: Robert Marko (cherry picked from commit ca00bafd7e05b3f77e38acac6add223ce46df585) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/firmware/linux-firmware/intel.mk | 58 ++++++++++++++++-------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk index 225b2aa862..4c9e04cd3d 100644 --- a/package/firmware/linux-firmware/intel.mk +++ b/package/firmware/linux-firmware/intel.mk @@ -216,29 +216,49 @@ define Package/e100-firmware/install endef $(eval $(call BuildPackage,e100-firmware)) -Package/intel-igpu-firmware-dmc = $(call Package/firmware-default,Intel iGPU DMC Display MC firmware) -define Package/intel-igpu-firmware-dmc/install - $(INSTALL_DIR) $(1)/lib/firmware/i915 - $(CP) \ - $(PKG_BUILD_DIR)/i915/*_dmc_*.bin* \ - $(1)/lib/firmware/i915/ +i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc +i915-firmware-gsc +Package/i915-firmware = $(call Package/firmware-default,Intel I915 firmware \(meta package\),$(i915_deps),LICENSE.i915) +define Package/i915-firmware/install + true endef -$(eval $(call BuildPackage,intel-igpu-firmware-dmc)) +$(eval $(call BuildPackage,i915-firmware)) -Package/intel-igpu-firmware-guc = $(call Package/firmware-default,Intel iGPU GUC Graphics MC firmware) -define Package/intel-igpu-firmware-guc/install +Package/i915-firmware-dmc = $(call Package/firmware-default,Intel I915 DMC firmware,,LICENSE.i915) +define Package/i915-firmware-dmc/install $(INSTALL_DIR) $(1)/lib/firmware/i915 - $(CP) \ - $(PKG_BUILD_DIR)/i915/*_guc_*.bin* \ - $(1)/lib/firmware/i915/ + for f in $(PKG_BUILD_DIR)/i915/*_dmc*.bin; do \ + t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \ + if [ "$$$$t" = dmc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \ + done endef -$(eval $(call BuildPackage,intel-igpu-firmware-guc)) +$(eval $(call BuildPackage,i915-firmware-dmc)) -Package/intel-igpu-firmware-huc = $(call Package/firmware-default,Intel iGPU HUC H.265 MC firmware) -define Package/intel-igpu-firmware-huc/install +Package/i915-firmware-guc = $(call Package/firmware-default,Intel I915 GUC firmware,,LICENSE.i915) +define Package/i915-firmware-guc/install $(INSTALL_DIR) $(1)/lib/firmware/i915 - $(CP) \ - $(PKG_BUILD_DIR)/i915/*_huc_*.bin* \ - $(1)/lib/firmware/i915/ + for f in $(PKG_BUILD_DIR)/i915/*_guc*.bin; do \ + t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \ + if [ "$$$$t" = guc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \ + done endef -$(eval $(call BuildPackage,intel-igpu-firmware-huc)) +$(eval $(call BuildPackage,i915-firmware-guc)) + +Package/i915-firmware-huc = $(call Package/firmware-default,Intel I915 HUC firmware,,LICENSE.i915) +define Package/i915-firmware-huc/install + $(INSTALL_DIR) $(1)/lib/firmware/i915 + for f in $(PKG_BUILD_DIR)/i915/*_huc*.bin; do \ + t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \ + if [ "$$$$t" = huc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \ + done +endef +$(eval $(call BuildPackage,i915-firmware-huc)) + +Package/i915-firmware-gsc = $(call Package/firmware-default,Intel I915 GSC firmware,,LICENSE.i915) +define Package/i915-firmware-gsc/install + $(INSTALL_DIR) $(1)/lib/firmware/i915 + for f in $(PKG_BUILD_DIR)/i915/*_gsc*.bin; do \ + t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \ + if [ "$$$$t" = gsc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \ + done +endef +$(eval $(call BuildPackage,i915-firmware-gsc)) From 756c955a9ca129b55e2b06ac6dab487373d867c7 Mon Sep 17 00:00:00 2001 From: Joe Zheng Date: Sun, 25 Aug 2024 00:53:01 +0000 Subject: [PATCH 043/119] x86: make i915 as a kmod with required firmware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i915 driver requires to load correct firmware to work on latest x86 GPU, it is more reasonable to make it as a kernel module, so that initramfs is not required, and it can also save some space from the kernel image comparing being a built-in driver Signed-off-by: Joe Zheng Link: https://github.com/openwrt/openwrt/pull/16276 Signed-off-by: Robert Marko (cherry picked from commit 77cfe8fd15d3d0f77ee16660d06a174f41b53444) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/video.mk | 42 +++++++++++++++++++++++++++ target/linux/x86/64/config-6.6 | 24 --------------- target/linux/x86/generic/config-6.6 | 24 --------------- target/linux/x86/legacy/config-6.6 | 24 --------------- 4 files changed, 42 insertions(+), 72 deletions(-) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 8b4585a624..fc0f038863 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -438,6 +438,48 @@ endef $(eval $(call KernelPackage,drm-amdgpu)) +define KernelPackage/drm-i915 + SUBMENU:=$(VIDEO_MENU) + TITLE:=Intel i915 DRM support + DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \ + +kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +i915-firmware-dmc \ + +kmod-drm-display-helper +kmod-drm-buddy +kmod-acpi-video \ + +kmod-drm-exec +kmod-drm-suballoc-helper + KCONFIG:=CONFIG_DRM_I915 \ + CONFIG_DRM_I915_CAPTURE_ERROR=y \ + CONFIG_DRM_I915_COMPRESS_ERROR=y \ + CONFIG_DRM_I915_DEBUG=n \ + CONFIG_DRM_I915_DEBUG_GUC=n \ + CONFIG_DRM_I915_DEBUG_MMIO=n \ + CONFIG_DRM_I915_DEBUG_RUNTIME_PM=n \ + CONFIG_DRM_I915_DEBUG_VBLANK_EVADE=n \ + CONFIG_DRM_I915_FENCE_TIMEOUT=10000 \ + CONFIG_DRM_I915_FORCE_PROBE="" \ + CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 \ + CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=n \ + CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 \ + CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 \ + CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 \ + CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 \ + CONFIG_DRM_I915_SELFTEST=n \ + CONFIG_DRM_I915_STOP_TIMEOUT=100 \ + CONFIG_DRM_I915_SW_FENCE_CHECK_DAG=n \ + CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS=n \ + CONFIG_DRM_I915_TIMESLICE_DURATION=1 \ + CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 \ + CONFIG_DRM_I915_USERPTR=y \ + CONFIG_DRM_I915_WERROR=n \ + CONFIG_FB_INTEL=n + FILES:=$(LINUX_DIR)/drivers/gpu/drm/i915/i915.ko + AUTOLOAD:=$(call AutoProbe,i915) +endef + +define KernelPackage/drm-i915/description + Direct Rendering Manager (DRM) support for Intel GPU +endef + +$(eval $(call KernelPackage,drm-i915)) + define KernelPackage/drm-imx SUBMENU:=$(VIDEO_MENU) diff --git a/target/linux/x86/64/config-6.6 b/target/linux/x86/64/config-6.6 index def4527f77..3475e65287 100644 --- a/target/linux/x86/64/config-6.6 +++ b/target/linux/x86/64/config-6.6 @@ -151,30 +151,6 @@ CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 CONFIG_DRM_GEM_SHMEM_HELPER=y # CONFIG_DRM_HYPERV is not set -CONFIG_DRM_I915=y -CONFIG_DRM_I915_CAPTURE_ERROR=y -CONFIG_DRM_I915_COMPRESS_ERROR=y -# CONFIG_DRM_I915_DEBUG is not set -# CONFIG_DRM_I915_DEBUG_GUC is not set -# CONFIG_DRM_I915_DEBUG_MMIO is not set -# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set -# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set -CONFIG_DRM_I915_FENCE_TIMEOUT=10000 -CONFIG_DRM_I915_FORCE_PROBE="" -CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 -# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set -CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 -CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 -CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 -CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 -# CONFIG_DRM_I915_SELFTEST is not set -CONFIG_DRM_I915_STOP_TIMEOUT=100 -# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set -# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set -CONFIG_DRM_I915_TIMESLICE_DURATION=1 -CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 -CONFIG_DRM_I915_USERPTR=y -# CONFIG_DRM_I915_WERROR is not set CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_MIPI_DSI=y CONFIG_DRM_PANEL=y diff --git a/target/linux/x86/generic/config-6.6 b/target/linux/x86/generic/config-6.6 index 091584e077..ecbd0aa93e 100644 --- a/target/linux/x86/generic/config-6.6 +++ b/target/linux/x86/generic/config-6.6 @@ -86,30 +86,6 @@ CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 CONFIG_DRM_GEM_SHMEM_HELPER=y # CONFIG_DRM_HYPERV is not set -CONFIG_DRM_I915=y -CONFIG_DRM_I915_CAPTURE_ERROR=y -CONFIG_DRM_I915_COMPRESS_ERROR=y -# CONFIG_DRM_I915_DEBUG is not set -# CONFIG_DRM_I915_DEBUG_GUC is not set -# CONFIG_DRM_I915_DEBUG_MMIO is not set -# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set -# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set -CONFIG_DRM_I915_FENCE_TIMEOUT=10000 -CONFIG_DRM_I915_FORCE_PROBE="" -CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 -# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set -CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 -CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 -CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 -CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 -# CONFIG_DRM_I915_SELFTEST is not set -CONFIG_DRM_I915_STOP_TIMEOUT=100 -# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set -# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set -CONFIG_DRM_I915_TIMESLICE_DURATION=1 -CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 -CONFIG_DRM_I915_USERPTR=y -# CONFIG_DRM_I915_WERROR is not set CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_MIPI_DSI=y CONFIG_DRM_PANEL=y diff --git a/target/linux/x86/legacy/config-6.6 b/target/linux/x86/legacy/config-6.6 index 8ce9237a21..10511ff08b 100644 --- a/target/linux/x86/legacy/config-6.6 +++ b/target/linux/x86/legacy/config-6.6 @@ -67,30 +67,6 @@ CONFIG_DRM_DISPLAY_HELPER=y CONFIG_DRM_EXEC=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 -CONFIG_DRM_I915=y -CONFIG_DRM_I915_CAPTURE_ERROR=y -CONFIG_DRM_I915_COMPRESS_ERROR=y -# CONFIG_DRM_I915_DEBUG is not set -# CONFIG_DRM_I915_DEBUG_GUC is not set -# CONFIG_DRM_I915_DEBUG_MMIO is not set -# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set -# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set -CONFIG_DRM_I915_FENCE_TIMEOUT=10000 -CONFIG_DRM_I915_FORCE_PROBE="" -CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 -# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set -CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 -CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 -CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 -CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 -# CONFIG_DRM_I915_SELFTEST is not set -CONFIG_DRM_I915_STOP_TIMEOUT=100 -# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set -# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set -CONFIG_DRM_I915_TIMESLICE_DURATION=1 -CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 -CONFIG_DRM_I915_USERPTR=y -# CONFIG_DRM_I915_WERROR is not set CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_MIPI_DSI=y CONFIG_DRM_PANEL=y From 71d60c69836de7543e86fddb60e8c3eba05ef50e Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 14 Nov 2024 21:47:47 +0100 Subject: [PATCH 044/119] base-files: Create /run and /run/lock folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create the folder /run and /run/lock using symlinks. Other Linux distributions also have these folders and some applications might already depend on them. Just create symlinks pointing to the older folder. Signed-off-by: Hauke Mehrtens Link: https://github.com/openwrt/openwrt/pull/16961 Signed-off-by: Christian Marangi (cherry picked from commit 3b710375dd97af1e0416904c4174d11c51e3f09c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/base-files/files/etc/init.d/boot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index c7d1d4af3a..332a5c96f3 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -24,6 +24,8 @@ boot() { chmod 1777 /var/lock mkdir -p /var/log mkdir -p /var/run + ln -s /var/run /run + ln -s /var/lock /run/lock mkdir -p /var/state mkdir -p /var/tmp mkdir -p /tmp/.uci From 7d4be068da502cd68f252cad73d18faf8e59e2a5 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 14 Nov 2024 21:46:36 +0100 Subject: [PATCH 045/119] base-files: Mount debugfs and pstore with nosuid,nodev,noexec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These permissions are not needed. Systemd also mounts these file systems without these permissions on other Linux distributions. Dropping these permissions should make the system more secure. Signed-off-by: Hauke Mehrtens Link: https://github.com/openwrt/openwrt/pull/16960 Signed-off-by: Christian Marangi (cherry picked from commit b88d51898d126d2f918cb476d4158e9fcd62492c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/base-files/files/etc/init.d/boot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index 332a5c96f3..a26d4886b2 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -35,9 +35,9 @@ boot() { mkdir -p /tmp/resolv.conf.d touch /tmp/resolv.conf.d/resolv.conf.auto ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf - grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug + grep -q debugfs /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t debugfs debugfs /sys/kernel/debug grep -q bpf /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime,mode=0700 -t bpf bpffs /sys/fs/bpf - grep -q pstore /proc/filesystems && /bin/mount -o noatime -t pstore pstore /sys/fs/pstore + grep -q pstore /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime -t pstore pstore /sys/fs/pstore [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe touch /tmp/.config_pending From be082a7c7e9b1edf60346752e8dc9935905b7dda Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 13 Oct 2024 21:15:59 +0800 Subject: [PATCH 046/119] ppp: remove more unnecessary kernel checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ppp package can support all features since Linux 4.7.0 kernel. Therefore, most kernel version checks can pass unconditionally on OpenWrt v18.06 and later version. This patch can reduce the size of ppp package by approximately 2.5 KB. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/16695 Signed-off-by: Christian Marangi (cherry picked from commit 3dbe730080e70e96990a5e89cbe2035adcca8d4b) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../patches/400-simplify_kernel_checks.patch | 100 ++++++++++-------- 1 file changed, 53 insertions(+), 47 deletions(-) diff --git a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch index 137937c244..311bb8752f 100644 --- a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch +++ b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch @@ -10,7 +10,14 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -231,7 +231,7 @@ static int driver_is_old = 0; +@@ -224,14 +224,10 @@ static fd_set in_fds; /* set of fds tha + static int max_in_fd; /* highest fd set in in_fds */ + + static int has_proxy_arp = 0; +-static int driver_version = 0; +-static int driver_modification = 0; +-static int driver_patch = 0; +-static int driver_is_old = 0; static int restore_term = 0; /* 1 => we've munged the terminal */ static struct termios inittermios; /* Initial TTY termios */ @@ -19,17 +26,18 @@ Signed-off-by: Jo-Philipp Wich static char loop_name[20]; static unsigned char inbuf[512]; /* buffer for chars read from loopback */ -@@ -250,8 +250,8 @@ static int looped; /* 1 if using loop +@@ -249,9 +245,8 @@ static int dynaddr_set; /* 1 if ip_dyna + static int looped; /* 1 if using loop */ static int link_mtu; /* mtu for the link (not bundle) */ - static struct utsname utsname; /* for the kernel version */ +-static struct utsname utsname; /* for the kernel version */ -static int kernel_version; #define KVERSION(j,n,p) ((j)*1000000 + (n)*1000 + (p)) -+static const int kernel_version = KVERSION(2,6,37); ++static const int kernel_version = KVERSION(4,9,0); #define MAX_IFS 100 -@@ -1970,11 +1970,12 @@ int ccp_fatal_error (int unit) +@@ -1970,11 +1965,12 @@ int ccp_fatal_error (int unit) * * path_to_procfs - find the path to the proc file system mount point */ @@ -44,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich struct mntent *mntent; FILE *fp; -@@ -1996,6 +1997,7 @@ static char *path_to_procfs(const char * +@@ -1996,6 +1992,7 @@ static char *path_to_procfs(const char * fclose (fp); } } @@ -52,35 +60,24 @@ Signed-off-by: Jo-Philipp Wich strlcpy(proc_path + proc_path_len, tail, sizeof(proc_path) - proc_path_len); -@@ -2895,15 +2897,19 @@ int ppp_check_kernel_support(void) - int my_version, my_modification, my_patch; - int osmaj, osmin, ospatch; +@@ -2889,6 +2886,8 @@ ppp_registered(void) + int ppp_check_kernel_support(void) + { ++ return 1; /* OpenWrt support ppp device "/dev/ppp" by default */ +#if 0 - /* get the kernel version now, since we are called before sys_init */ - uname(&utsname); - osmaj = osmin = ospatch = 0; - sscanf(utsname.release, "%d.%d.%d", &osmaj, &osmin, &ospatch); - kernel_version = KVERSION(osmaj, osmin, ospatch); + int s, ok, fd; + struct ifreq ifr; + int size; +@@ -3016,6 +3015,7 @@ int ppp_check_kernel_support(void) + } + close(s); + return ok; +#endif + } - fd = open("/dev/ppp", O_RDWR); - if (fd >= 0) { -+#if 0 - new_style_driver = 1; -+#endif - - /* XXX should get from driver */ - driver_version = 2; -@@ -2963,6 +2969,7 @@ int ppp_check_kernel_support(void) - - if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP)) - ok = 0; -+ return ok; - - /* - * This is the PPP device. Validate the version of the driver at this -@@ -3577,6 +3584,7 @@ get_pty(int *master_fdp, int *slave_fdp, + #ifndef HAVE_LOGWTMP +@@ -3577,6 +3577,7 @@ get_pty(int *master_fdp, int *slave_fdp, } #endif /* TIOCGPTN */ @@ -88,7 +85,7 @@ Signed-off-by: Jo-Philipp Wich if (sfd < 0) { /* the old way - scan through the pty name space */ for (i = 0; i < 64; ++i) { -@@ -3601,6 +3609,7 @@ get_pty(int *master_fdp, int *slave_fdp, +@@ -3601,6 +3602,7 @@ get_pty(int *master_fdp, int *slave_fdp, } } } @@ -96,23 +93,35 @@ Signed-off-by: Jo-Philipp Wich if (sfd < 0) return 0; +@@ -3716,6 +3718,7 @@ get_host_seed(void) + int + sys_check_options(void) + { ++#if 0 + if (demand && driver_is_old) { + ppp_option_error("demand dialling is not supported by kernel driver " + "version %d.%d.%d", driver_version, driver_modification, +@@ -3726,6 +3729,7 @@ sys_check_options(void) + warn("Warning: multilink is not supported by the kernel driver"); + multilink = 0; + } ++#endif + return 1; + } + --- a/pppd/plugins/pppoatm/pppoatm.c +++ b/pppd/plugins/pppoatm/pppoatm.c -@@ -179,14 +179,6 @@ static void disconnect_pppoatm(void) - +@@ -180,10 +180,6 @@ static void disconnect_pppoatm(void) void plugin_init(void) { --#ifdef linux + #ifdef linux - extern int new_style_driver; /* From sys-linux.c */ - if (!ppp_check_kernel_support() && !new_style_driver) - fatal("Kernel doesn't support ppp_generic - " - "needed for PPPoATM"); --#else -- fatal("No PPPoATM support on this OS"); --#endif - ppp_add_options(pppoa_options); - } - + #else + fatal("No PPPoATM support on this OS"); + #endif --- a/pppd/plugins/pppoe/plugin.c +++ b/pppd/plugins/pppoe/plugin.c @@ -57,9 +57,6 @@ static char const RCSID[] = @@ -138,17 +147,14 @@ Signed-off-by: Jo-Philipp Wich info("PPPoE plugin from pppd %s", PPPD_VERSION); --- a/pppd/plugins/pppol2tp/pppol2tp.c +++ b/pppd/plugins/pppol2tp/pppol2tp.c -@@ -500,12 +500,7 @@ static void pppol2tp_cleanup(void) - +@@ -501,10 +501,6 @@ static void pppol2tp_cleanup(void) void plugin_init(void) { --#if defined(__linux__) + #if defined(__linux__) - extern int new_style_driver; /* From sys-linux.c */ - if (!ppp_check_kernel_support() && !new_style_driver) - fatal("Kernel doesn't support ppp_generic - " - "needed for PPPoL2TP"); --#else -+#if !defined(__linux__) + #else fatal("No PPPoL2TP support on this OS"); #endif - ppp_add_options(pppol2tp_options); From 4c22224bcc08c9bd18e6e9921280c73e2abcd7c3 Mon Sep 17 00:00:00 2001 From: John Audia Date: Mon, 2 Sep 2024 19:53:47 -0400 Subject: [PATCH 047/119] x86: switch config to a tickless kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes and closes #16313. Switch the x86 kernel's timer to tickless operation which is more power efficient since it is not woken up by periodic timer interrupts when idle. Also add several other options for CPU idle governors particularly the upstream default for tickless kernels, CONFIG_CPU_IDLE_GOV_MENU. Without this commit, my AMD Ryzen 7 5800U can only achieve a minimum core frequency of 1,384 MHz which is over 3x higher than the processor's minimum frequency of 400 MHz which is accessible with this modification. In addition to the lower clock rate, I have seen a concomitant reduction in both idle temps and at-the-wall power consumption. Summary: * Idle CPU freqs dropped from 1,384 MHz to 400 Mhz. * Idle power consumption dropped from 7 W avg to 5 W. * Idle temps have dropped from 50C on avg to 43C. There are other well known reasons to switch to a tickless timer including: reduced interrupt overhead, better use of CPU resources, and reduced latency to name a few. Build system: x86/64 Build-tested: x86/64/AMD Cezanne Run-tested: x86/64/AMD Cezanne Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/16317 Signed-off-by: Christian Marangi (cherry picked from commit 31111680f6fc5f17201b02b8ce656b955be56d7a) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/x86/config-6.6 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/linux/x86/config-6.6 b/target/linux/x86/config-6.6 index b8d38e60fa..3d1c005138 100644 --- a/target/linux/x86/config-6.6 +++ b/target/linux/x86/config-6.6 @@ -48,6 +48,7 @@ CONFIG_COMPAT_32=y CONFIG_COMPAT_32BIT_TIME=y # CONFIG_COMPAT_VDSO is not set CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTEXT_TRACKING_USER_FORCE=y # CONFIG_CPU5_WDT is not set CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y @@ -61,7 +62,10 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_GOV_USERSPACE is not set CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_HALTPOLL=y CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_IDLE_GOV_TEO=y CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_SUP_AMD=y CONFIG_CPU_SUP_CENTAUR=y @@ -180,7 +184,6 @@ CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_GEODE=y CONFIG_HW_RANDOM_VIA=y # CONFIG_HYPERVISOR_GUEST is not set -CONFIG_HZ_PERIODIC=y CONFIG_I8253_LOCK=y CONFIG_IA32_FEAT_CTL=y # CONFIG_IB700_WDT is not set @@ -275,6 +278,9 @@ CONFIG_NET_XGRESS=y CONFIG_NLS=y # CONFIG_NMI_CHECK_CPU is not set # CONFIG_NOHIGHMEM is not set +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_FULL=y CONFIG_NR_CPUS=1 CONFIG_NR_CPUS_DEFAULT=1 CONFIG_NR_CPUS_RANGE_BEGIN=1 @@ -330,6 +336,8 @@ CONFIG_PTP_1588_CLOCK_OPTIONAL=y # CONFIG_PUNIT_ATOM_DEBUG is not set CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y +CONFIG_RCU_LAZY=y +CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y CONFIG_RETHUNK=y From 994a95584aeb7b5168306eaac6d62dcae4784106 Mon Sep 17 00:00:00 2001 From: Jeronimo Pellegrini Date: Sat, 21 Sep 2024 15:46:36 -0300 Subject: [PATCH 048/119] libreadlne: create symlinks for .so MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, libreadline only installs ``` /usr/lib/libhistory.so.8 -> libhistory.so.8.2 /usr/lib/libhistory.so.8.2 /usr/lib/libreadline.so.8 -> libreadline.so.8.2 /usr/lib/libreadline.so.8.2 ``` But there is no `libreadline.so` or `libhistory.so` available. So this happens: ``` root@OpenWRT:~# cat a.c int main() { } root@OpenWRT:~# gcc a.c -lreadline /usr/bin/ld: cannot find -lreadline: No such file or directory collect2: error: ld returned 1 exit status ``` Unless, of course, one uses `-l:libreadline.so.8`... But that doesn't help with binaries that try to dynamically open `libreadline.so`. I have one of those here (the STklos Scheme compiler -- I didn't make a PR for it because it's far from being ready, but one issue is that it does use dlopen to use readline...) With the symlink, it works: ``` root@OpenWRT:~# ln -s /usr/lib/libreadline.so.8 /usr/lib/libreadline.so root@OpenWRT:~# root@OpenWRT:~# gcc a.c -lreadline root@OpenWRT:~# ``` Another example: when trying to package rlwrap, the build failed complaining it could not find readline (using `-lreadline`). It would then be necessary to change rlwrap's `configure.ac` (and also in all packages that use readline), but it seems simpler to add the symlinks... This PR changes the Makefile so it will include the links. Signed-off-by: Jeronimo Pellegrini Link: https://github.com/openwrt/openwrt/pull/16445 Signed-off-by: Christian Marangi (cherry picked from commit 0000ba6ab8062f965d8fed240b76d36f9a493b55) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/libs/readline/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/libs/readline/Makefile b/package/libs/readline/Makefile index 11b9e0172f..03e56f36ed 100644 --- a/package/libs/readline/Makefile +++ b/package/libs/readline/Makefile @@ -69,7 +69,7 @@ endef define Package/libreadline/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.so* $(1)/usr/lib/ endef $(eval $(call HostBuild)) From d4a26ffd1a739e15b797c1b12e4f31a7fa29682f Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Fri, 15 Nov 2024 01:32:47 -0500 Subject: [PATCH 049/119] realtek: align kernel config with upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the start of the Realtek target OpenWrt works with RTL83XX as the target architecture. Upstream is using MACH_REALTEK_RTL instead. To simplify further development align that. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/16963 Signed-off-by: Hauke Mehrtens (cherry picked from commit 65964c42f8744ed8ca09448a155b99e3a99be283) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../files-6.6/arch/mips/rtl838x/Platform | 4 +- .../files-6.6/drivers/clk/realtek/Kconfig | 4 +- .../files-6.6/drivers/net/dsa/rtl83xx/Kconfig | 2 +- .../300-mips-add-rtl838x-platform.patch | 51 ++++++++++--------- .../301-gpio-add-rtl8231-driver.patch | 2 +- ...e-dependencies-for-gpio-realtek-otto.patch | 26 ---------- ...pdate-dependency-for-spi-realtek-rtl.patch | 25 --------- ...pdate-dependency-for-irq-realtek-rtl.patch | 25 --------- ...date-dependency-for-realtek-otto-wdt.patch | 32 ------------ ...net-add-support-for-rtl838x-ethernet.patch | 2 +- .../realtek/patches-6.6/720-add-rtl-phy.patch | 2 +- target/linux/realtek/rtl838x/config-6.6 | 2 +- target/linux/realtek/rtl839x/config-6.6 | 2 +- target/linux/realtek/rtl930x/config-6.6 | 2 +- target/linux/realtek/rtl931x/config-6.6 | 2 +- 15 files changed, 39 insertions(+), 144 deletions(-) delete mode 100644 target/linux/realtek/patches-6.6/303-gpio-update-dependencies-for-gpio-realtek-otto.patch delete mode 100644 target/linux/realtek/patches-6.6/304-spi-update-dependency-for-spi-realtek-rtl.patch delete mode 100644 target/linux/realtek/patches-6.6/305-irqchip-update-dependency-for-irq-realtek-rtl.patch delete mode 100644 target/linux/realtek/patches-6.6/307-wdt-update-dependency-for-realtek-otto-wdt.patch diff --git a/target/linux/realtek/files-6.6/arch/mips/rtl838x/Platform b/target/linux/realtek/files-6.6/arch/mips/rtl838x/Platform index 98f18cac1b..e824dee7b7 100644 --- a/target/linux/realtek/files-6.6/arch/mips/rtl838x/Platform +++ b/target/linux/realtek/files-6.6/arch/mips/rtl838x/Platform @@ -1,5 +1,5 @@ # # Realtek RTL838x SoCs # -cflags-$(CONFIG_RTL83XX) += -I$(srctree)/arch/mips/include/asm/mach-rtl838x/ -load-$(CONFIG_RTL83XX) += 0xffffffff80100000 +cflags-$(CONFIG_MACH_REALTEK_RTL) += -I$(srctree)/arch/mips/include/asm/mach-rtl838x/ +load-$(CONFIG_MACH_REALTEK_RTL) += 0xffffffff80100000 diff --git a/target/linux/realtek/files-6.6/drivers/clk/realtek/Kconfig b/target/linux/realtek/files-6.6/drivers/clk/realtek/Kconfig index 4cf3cd9633..62b704077a 100644 --- a/target/linux/realtek/files-6.6/drivers/clk/realtek/Kconfig +++ b/target/linux/realtek/files-6.6/drivers/clk/realtek/Kconfig @@ -2,13 +2,13 @@ menuconfig COMMON_CLK_REALTEK bool "Support for Realtek's clock controllers" - depends on RTL83XX + depends on MACH_REALTEK_RTL if COMMON_CLK_REALTEK config COMMON_CLK_RTL83XX bool "Clock driver for Realtek RTL83XX" - depends on RTL83XX + depends on MACH_REALTEK_RTL select SRAM help This driver adds support for the Realtek RTL83xx series basic clocks. diff --git a/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/Kconfig b/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/Kconfig index 3124ee8d20..0af4abcfb9 100644 --- a/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/Kconfig +++ b/target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config NET_DSA_RTL83XX tristate "Realtek RTL838x/RTL839x switch support" - depends on RTL83XX + depends on MACH_REALTEK_RTL select NET_DSA_TAG_TRAILER help This driver adds support for Realtek RTL83xx series switching. diff --git a/target/linux/realtek/patches-6.6/300-mips-add-rtl838x-platform.patch b/target/linux/realtek/patches-6.6/300-mips-add-rtl838x-platform.patch index 7adbbbc517..bb89a7864f 100644 --- a/target/linux/realtek/patches-6.6/300-mips-add-rtl838x-platform.patch +++ b/target/linux/realtek/patches-6.6/300-mips-add-rtl838x-platform.patch @@ -9,64 +9,67 @@ configurations for the SoCs, which are introduced in addition. Submitted-by: Birger Koblitz --- - arch/mips/Kbuild.platforms | 1 + - arch/mips/Kconfig | 57 ++++++++++++++ - 2 files changed, 58 insertions(+) - --- a/arch/mips/Kbuild.platforms +++ b/arch/mips/Kbuild.platforms @@ -22,6 +22,7 @@ platform-$(CONFIG_MACH_NINTENDO64) += n6 platform-$(CONFIG_PIC32MZDA) += pic32/ platform-$(CONFIG_RALINK) += ralink/ platform-$(CONFIG_MIKROTIK_RB532) += rb532/ -+platform-$(CONFIG_RTL83XX) += rtl838x/ ++platform-$(CONFIG_MACH_REALTEK_RTL) += rtl838x/ platform-$(CONFIG_SGI_IP22) += sgi-ip22/ platform-$(CONFIG_SGI_IP27) += sgi-ip27/ platform-$(CONFIG_SGI_IP28) += sgi-ip22/ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -968,8 +968,58 @@ config CAVIUM_OCTEON_SOC - Hikari - Say Y here for most Octeon reference boards. +@@ -620,21 +620,23 @@ config RALINK -+config RTL83XX -+ bool "Realtek based platforms" -+ select DMA_NONCOHERENT -+ select IRQ_MIPS_CPU + config MACH_REALTEK_RTL + bool "Realtek RTL838x/RTL839x based machines" +- select MIPS_GENERIC + select DMA_NONCOHERENT + select IRQ_MIPS_CPU +- select CSRC_R4K +- select CEVT_R4K + select SYS_HAS_CPU_MIPS32_R1 + select SYS_HAS_CPU_MIPS32_R2 + select SYS_SUPPORTS_BIG_ENDIAN + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_MIPS16 +- select SYS_SUPPORTS_MULTITHREADING +- select SYS_SUPPORTS_VPE_LOADER + select BOOT_RAW + select PINCTRL + select USE_OF + select NO_EXCEPT_FILL -+ select SYS_HAS_CPU_MIPS32_R1 -+ select SYS_HAS_CPU_MIPS32_R2 -+ select SYS_SUPPORTS_BIG_ENDIAN + select SYS_SUPPORTS_HIGHMEM -+ select SYS_SUPPORTS_32BIT_KERNEL -+ select SYS_SUPPORTS_MIPS16 + select SYS_HAS_EARLY_PRINTK + select SYS_HAS_EARLY_PRINTK_8250 + select USE_GENERIC_EARLY_PRINTK_8250 -+ select BOOT_RAW -+ select PINCTRL + select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER -+ select USE_OF -+ + + config SGI_IP22 + bool "SGI IP22 (Indy/Indigo2)" +@@ -970,6 +972,36 @@ config CAVIUM_OCTEON_SOC + endchoice +config RTL838X + bool "Realtek RTL838X based platforms" -+ depends on RTL83XX ++ depends on MACH_REALTEK_RTL + select CPU_SUPPORTS_CPUFREQ + select MIPS_EXTERNAL_TIMER + +config RTL839X + bool "Realtek RTL839X based platforms" -+ depends on RTL83XX ++ depends on MACH_REALTEK_RTL + select CPU_SUPPORTS_CPUFREQ + select MIPS_EXTERNAL_TIMER + select SYS_SUPPORTS_MULTITHREADING + +config RTL930X + bool "Realtek RTL930X based platforms" -+ depends on RTL83XX ++ depends on MACH_REALTEK_RTL + select MIPS_CPU_SCACHE + select MIPS_EXTERNAL_TIMER + select SYS_SUPPORTS_MULTITHREADING diff --git a/target/linux/realtek/patches-6.6/301-gpio-add-rtl8231-driver.patch b/target/linux/realtek/patches-6.6/301-gpio-add-rtl8231-driver.patch index a177876420..f64e2cf94e 100644 --- a/target/linux/realtek/patches-6.6/301-gpio-add-rtl8231-driver.patch +++ b/target/linux/realtek/patches-6.6/301-gpio-add-rtl8231-driver.patch @@ -31,7 +31,7 @@ Submitted-by: John Crispin +config GPIO_RTL8231 + tristate "RTL8231 GPIO" -+ depends on RTL83XX ++ depends on MACH_REALTEK_RTL + help + Say yes here to support Realtek RTL8231 GPIO expansion chips. + diff --git a/target/linux/realtek/patches-6.6/303-gpio-update-dependencies-for-gpio-realtek-otto.patch b/target/linux/realtek/patches-6.6/303-gpio-update-dependencies-for-gpio-realtek-otto.patch deleted file mode 100644 index 2b466340e6..0000000000 --- a/target/linux/realtek/patches-6.6/303-gpio-update-dependencies-for-gpio-realtek-otto.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 9bac1c20b8f39f2e0e342b087add5093b94feaed Mon Sep 17 00:00:00 2001 -From: INAGAKI Hiroshi -Date: Wed, 5 May 2021 22:05:39 +0900 -Subject: realtek: backport gpio-realtek-otto driver from 5.13 to 5.10 - -This patch backports "gpio-realtek-otto" driver to Kernel 5.10. -"MACH_REALTEK_RTL" is used as a platform name in upstream, but "RTL838X" -is used in OpenWrt, so update the dependency by the additional patch. - -Submitted-by: INAGAKI Hiroshi ---- - drivers/gpio/Kconfig | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -527,8 +527,8 @@ config GPIO_RDA - - config GPIO_REALTEK_OTTO - tristate "Realtek Otto GPIO support" -- depends on MACH_REALTEK_RTL -- default MACH_REALTEK_RTL -+ depends on RTL83XX -+ default RTL838X - select GPIO_GENERIC - select GPIOLIB_IRQCHIP - help diff --git a/target/linux/realtek/patches-6.6/304-spi-update-dependency-for-spi-realtek-rtl.patch b/target/linux/realtek/patches-6.6/304-spi-update-dependency-for-spi-realtek-rtl.patch deleted file mode 100644 index 01530257b8..0000000000 --- a/target/linux/realtek/patches-6.6/304-spi-update-dependency-for-spi-realtek-rtl.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0b000cbfe0aa0323bffa855ef8449c0687a4c071 Mon Sep 17 00:00:00 2001 -From: INAGAKI Hiroshi -Date: Thu, 6 May 2021 19:30:58 +0900 -Subject: realtek: backport spi-realtek-rtl driver from 5.12 to 5.10 - -This patch backports "spi-realtek-rtl" driver to Kernel 5.10 from 5.12. -"MACH_REALTEK_RTL" is used as a platform name in upstream, but "RTL838X" -is used in OpenWrt, so update the dependency by the additional patch. - -Submitted-by: INAGAKI Hiroshi ---- - drivers/spi/Makefile | 2 +- - 1 files changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -114,7 +114,7 @@ obj-$(CONFIG_SPI_QUP) += spi-qup.o - obj-$(CONFIG_SPI_ROCKCHIP) += spi-rockchip.o - obj-$(CONFIG_SPI_ROCKCHIP_SFC) += spi-rockchip-sfc.o - obj-$(CONFIG_SPI_RB4XX) += spi-rb4xx.o --obj-$(CONFIG_MACH_REALTEK_RTL) += spi-realtek-rtl.o -+obj-$(CONFIG_RTL83XX) += spi-realtek-rtl.o - obj-$(CONFIG_SPI_RPCIF) += spi-rpc-if.o - obj-$(CONFIG_SPI_RSPI) += spi-rspi.o - obj-$(CONFIG_SPI_RZV2M_CSI) += spi-rzv2m-csi.o diff --git a/target/linux/realtek/patches-6.6/305-irqchip-update-dependency-for-irq-realtek-rtl.patch b/target/linux/realtek/patches-6.6/305-irqchip-update-dependency-for-irq-realtek-rtl.patch deleted file mode 100644 index 0ecc33376e..0000000000 --- a/target/linux/realtek/patches-6.6/305-irqchip-update-dependency-for-irq-realtek-rtl.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2cd00b51470a30198b048a5fca48a04db77e29cc Mon Sep 17 00:00:00 2001 -From: INAGAKI Hiroshi -Date: Fri, 21 May 2021 23:16:37 +0900 -Subject: [PATCH] realtek: backport irq-realtek-rtl driver from 5.12 to 5.10 - -This patch backports "irq-realtek-rtl" driver to Kernel 5.10 from 5.12. -"MACH_REALTEK_RTL" is used as a platform name in upstream, but "RTL838X" -is used in OpenWrt, so update the dependency by the additional patch. - -Submitted-by: INAGAKI Hiroshi ---- - drivers/irqchip/Makefile | 2 +- - 1 files changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/irqchip/Makefile -+++ b/drivers/irqchip/Makefile -@@ -114,7 +114,7 @@ obj-$(CONFIG_LOONGSON_PCH_MSI) += irq-l - obj-$(CONFIG_LOONGSON_PCH_LPC) += irq-loongson-pch-lpc.o - obj-$(CONFIG_MST_IRQ) += irq-mst-intc.o - obj-$(CONFIG_SL28CPLD_INTC) += irq-sl28cpld.o --obj-$(CONFIG_MACH_REALTEK_RTL) += irq-realtek-rtl.o -+obj-$(CONFIG_RTL83XX) += irq-realtek-rtl.o - obj-$(CONFIG_WPCM450_AIC) += irq-wpcm450-aic.o - obj-$(CONFIG_IRQ_IDT3243X) += irq-idt3243x.o - obj-$(CONFIG_APPLE_AIC) += irq-apple-aic.o diff --git a/target/linux/realtek/patches-6.6/307-wdt-update-dependency-for-realtek-otto-wdt.patch b/target/linux/realtek/patches-6.6/307-wdt-update-dependency-for-realtek-otto-wdt.patch deleted file mode 100644 index c9dab65b72..0000000000 --- a/target/linux/realtek/patches-6.6/307-wdt-update-dependency-for-realtek-otto-wdt.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b8fc5eecdc5d33cf261986436597b5482ab856da Mon Sep 17 00:00:00 2001 -From: Sander Vanheule -Date: Sun, 14 Nov 2021 19:45:32 +0100 -Subject: [PATCH] realtek: Backport Realtek Otto WDT driver - -Add patch submitted upstream to linux-watchdog and replace the MIPS -architecture symbols. Requires one extra patch for the DIV_ROUND_* -macros, which have moved to a different header since 5.10. - -Submitted-by: Sander Vanheule -Tested-by: Stijn Segers -Tested-by: Paul Fertser -Tested-by: Stijn Tintel ---- - drivers/watchdog/Kconfig | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/watchdog/Kconfig -+++ b/drivers/watchdog/Kconfig -@@ -977,10 +977,10 @@ config RTD119X_WATCHDOG - - config REALTEK_OTTO_WDT - tristate "Realtek Otto MIPS watchdog support" -- depends on MACH_REALTEK_RTL || COMPILE_TEST -+ depends on RTL83XX - depends on COMMON_CLK - select WATCHDOG_CORE -- default MACH_REALTEK_RTL -+ default RTL83XX - help - Say Y here to include support for the watchdog timer on Realtek - RTL838x, RTL839x, RTL930x SoCs. This watchdog has pretimeout diff --git a/target/linux/realtek/patches-6.6/716-net-ethernet-add-support-for-rtl838x-ethernet.patch b/target/linux/realtek/patches-6.6/716-net-ethernet-add-support-for-rtl838x-ethernet.patch index 9d79ea565d..e0c10bca63 100644 --- a/target/linux/realtek/patches-6.6/716-net-ethernet-add-support-for-rtl838x-ethernet.patch +++ b/target/linux/realtek/patches-6.6/716-net-ethernet-add-support-for-rtl838x-ethernet.patch @@ -29,7 +29,7 @@ Submitted-by: John Crispin + +config NET_RTL838X + tristate "Realtek rtl838x Ethernet MAC support" -+ depends on RTL83XX ++ depends on MACH_REALTEK_RTL + help + Say Y here if you want to use the Realtek rtl838x Gbps Ethernet MAC. + diff --git a/target/linux/realtek/patches-6.6/720-add-rtl-phy.patch b/target/linux/realtek/patches-6.6/720-add-rtl-phy.patch index 78a57f0a3e..43d4a7d4fc 100644 --- a/target/linux/realtek/patches-6.6/720-add-rtl-phy.patch +++ b/target/linux/realtek/patches-6.6/720-add-rtl-phy.patch @@ -20,7 +20,7 @@ Submitted-by: Birger Koblitz +config REALTEK_SOC_PHY + tristate "Realtek SoC PHYs" -+ depends on RTL83XX ++ depends on MACH_REALTEK_RTL + help + Supports the PHYs found in combination with Realtek Switch SoCs + diff --git a/target/linux/realtek/rtl838x/config-6.6 b/target/linux/realtek/rtl838x/config-6.6 index ad2c1b43cc..44c1d7e064 100644 --- a/target/linux/realtek/rtl838x/config-6.6 +++ b/target/linux/realtek/rtl838x/config-6.6 @@ -116,6 +116,7 @@ CONFIG_JFFS2_ZLIB=y CONFIG_LEDS_GPIO=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MACH_REALTEK_RTL=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y @@ -192,7 +193,6 @@ CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RTL838X=y # CONFIG_RTL839X is not set -CONFIG_RTL83XX=y # CONFIG_RTL930X is not set CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_OF_PLATFORM=y diff --git a/target/linux/realtek/rtl839x/config-6.6 b/target/linux/realtek/rtl839x/config-6.6 index a357eb3966..630027bf81 100644 --- a/target/linux/realtek/rtl839x/config-6.6 +++ b/target/linux/realtek/rtl839x/config-6.6 @@ -115,6 +115,7 @@ CONFIG_JFFS2_ZLIB=y CONFIG_LEDS_GPIO=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MACH_REALTEK_RTL=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y @@ -204,7 +205,6 @@ CONFIG_RFS_ACCEL=y CONFIG_RPS=y # CONFIG_RTL838X is not set CONFIG_RTL839X=y -CONFIG_RTL83XX=y # CONFIG_RTL930X is not set CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_OF_PLATFORM=y diff --git a/target/linux/realtek/rtl930x/config-6.6 b/target/linux/realtek/rtl930x/config-6.6 index af5f2ca7a3..5a29bdc3c1 100644 --- a/target/linux/realtek/rtl930x/config-6.6 +++ b/target/linux/realtek/rtl930x/config-6.6 @@ -97,6 +97,7 @@ CONFIG_JFFS2_ZLIB=y CONFIG_LEDS_GPIO=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MACH_REALTEK_RTL=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y @@ -172,7 +173,6 @@ CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y # CONFIG_RTL838X is not set # CONFIG_RTL839X is not set -CONFIG_RTL83XX=y CONFIG_RTL930X=y # CONFIG_RTL931X is not set CONFIG_SERIAL_MCTRL_GPIO=y diff --git a/target/linux/realtek/rtl931x/config-6.6 b/target/linux/realtek/rtl931x/config-6.6 index 736f472029..df235defe8 100644 --- a/target/linux/realtek/rtl931x/config-6.6 +++ b/target/linux/realtek/rtl931x/config-6.6 @@ -106,6 +106,7 @@ CONFIG_KMAP_LOCAL=y CONFIG_LEDS_GPIO=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MACH_REALTEK_RTL=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y @@ -195,7 +196,6 @@ CONFIG_RFS_ACCEL=y CONFIG_RPS=y # CONFIG_RTL838X is not set # CONFIG_RTL839X is not set -CONFIG_RTL83XX=y CONFIG_RTL930X=y CONFIG_RTL931X=y CONFIG_SENSORS_GPIO_FAN=y From 4166aaf98abc848496fbe3b8be3f4ec59bbb5cac Mon Sep 17 00:00:00 2001 From: Ryan Keane Date: Thu, 7 Nov 2024 21:50:58 -0800 Subject: [PATCH 050/119] elfutils: Update to 0.192 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a patch still under review to fix some errors. Refresh patch: - 003-libintl-compatibility.patch - 005-build_only_libs.patch - 006-Fix-build-on-aarch64-musl.patch Add patch: - 102-fix-potential-deref-of-null-error.patch Release notes are in the link below. Link: https://inbox.sourceware.org/elfutils-devel/CAJDtP-T3+gXqHWp3T0mejWWbPr0_1tHetEXwfB67-o+zz7ShiA@mail.gmail.com/T/#u Signed-off-by: Ryan Keane Link: https://github.com/openwrt/openwrt/pull/16886 Signed-off-by: Robert Marko (cherry picked from commit f5132df69db50a99e556e6fbd165002aac0e3e38) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/libs/elfutils/Makefile | 4 +- .../patches/003-libintl-compatibility.patch | 2 +- .../patches/005-build_only_libs.patch | 2 +- .../006-Fix-build-on-aarch64-musl.patch | 4 +- ...02-fix-potential-deref-of-null-error.patch | 55 +++++++++++++++++++ 5 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 package/libs/elfutils/patches/102-fix-potential-deref-of-null-error.patch diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index ac5841c604..b8bb50b564 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=elfutils -PKG_VERSION:=0.191 +PKG_VERSION:=0.192 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) -PKG_HASH:=df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871 +PKG_HASH:=616099beae24aba11f9b63d86ca6cc8d566d968b802391334c91df54eab416b4 PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0-or-later diff --git a/package/libs/elfutils/patches/003-libintl-compatibility.patch b/package/libs/elfutils/patches/003-libintl-compatibility.patch index 1271796af5..eda9f2204a 100644 --- a/package/libs/elfutils/patches/003-libintl-compatibility.patch +++ b/package/libs/elfutils/patches/003-libintl-compatibility.patch @@ -11,7 +11,7 @@ Requires.private: zlib @LIBZSTD@ --- a/configure.ac +++ b/configure.ac -@@ -717,6 +717,9 @@ dnl AM_GNU_GETTEXT_REQUIRE_VERSION suppo +@@ -728,6 +728,9 @@ dnl AM_GNU_GETTEXT_REQUIRE_VERSION suppo AM_GNU_GETTEXT_VERSION([0.19.6]) AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6]) diff --git a/package/libs/elfutils/patches/005-build_only_libs.patch b/package/libs/elfutils/patches/005-build_only_libs.patch index 598b734874..177ac659e6 100644 --- a/package/libs/elfutils/patches/005-build_only_libs.patch +++ b/package/libs/elfutils/patches/005-build_only_libs.patch @@ -8,4 +8,4 @@ + libasm EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING SECURITY \ - COPYING COPYING-GPLV2 COPYING-LGPLV3 + COPYING COPYING-GPLV2 COPYING-LGPLV3 CONDUCT diff --git a/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch b/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch index d8066c5ca7..a7786ed2c0 100644 --- a/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch +++ b/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch @@ -32,8 +32,8 @@ Signed-off-by: Hongxu Jia +# include # include # include - /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */ -@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t + # include +@@ -94,7 +94,7 @@ aarch64_set_initial_registers_tid (pid_t Dwarf_Word dwarf_fregs[32]; for (int r = 0; r < 32; r++) diff --git a/package/libs/elfutils/patches/102-fix-potential-deref-of-null-error.patch b/package/libs/elfutils/patches/102-fix-potential-deref-of-null-error.patch new file mode 100644 index 0000000000..6710e4ef9c --- /dev/null +++ b/package/libs/elfutils/patches/102-fix-potential-deref-of-null-error.patch @@ -0,0 +1,55 @@ +strip.c: Pointer `arhdr` created at strip.c:2741 and then dereferenced without NULL-check. +The same situation for the `arhdr` pointer at the objdump.c:313 and +the `h` pointer at the readelf.c:13545. + +Triggers found by static analyzer Svace. + +Signed-off-by: Maks Mishin +--- + src/objdump.c | 5 +++++ + src/readelf.c | 5 +++++ + src/strip.c | 5 +++++ + 3 files changed, 15 insertions(+) + +--- a/src/objdump.c ++++ b/src/objdump.c +@@ -311,6 +311,11 @@ handle_ar (int fd, Elf *elf, const char + { + /* The the header for this element. */ + Elf_Arhdr *arhdr = elf_getarhdr (subelf); ++ if (arhdr == NULL) ++ { ++ printf ("cannot get arhdr: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } + + /* Skip over the index entries. */ + if (strcmp (arhdr->ar_name, "/") != 0 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -13543,6 +13543,11 @@ dump_archive_index (Elf *elf, const char + as_off, fname, elf_errmsg (-1)); + + const Elf_Arhdr *h = elf_getarhdr (subelf); ++ if (h == NULL) ++ { ++ printf ("cannot get arhdr: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } + + printf (_("Archive member '%s' contains:\n"), h->ar_name); + +--- a/src/strip.c ++++ b/src/strip.c +@@ -2739,6 +2739,11 @@ handle_ar (int fd, Elf *elf, const char + { + /* The the header for this element. */ + Elf_Arhdr *arhdr = elf_getarhdr (subelf); ++ if (arhdr == NULL) ++ { ++ printf ("cannot get arhdr: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } + + if (elf_kind (subelf) == ELF_K_ELF) + result |= handle_elf (fd, subelf, new_prefix, arhdr->ar_name, 0, NULL); From d5e45df9c24aecf1eefc1e3abfabf53f8d5636bc Mon Sep 17 00:00:00 2001 From: Ryan Keane Date: Wed, 13 Nov 2024 11:46:38 -0800 Subject: [PATCH 051/119] elfutils: Add mirrors.kernel.org as mirrror MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add mirrors.kernel.org as mirror, listed on sourceware mirror sites page. Link: https://sourceware.org/mirrors.html Signed-off-by: Ryan Keane Link: https://github.com/openwrt/openwrt/pull/16886 Signed-off-by: Robert Marko (cherry picked from commit 63caa2b1685ef5d2b4259784085f64cb9e5574a8) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/libs/elfutils/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index b8bb50b564..7b31331e0b 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -11,7 +11,8 @@ PKG_VERSION:=0.192 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) +PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) \ + https://mirrors.kernel.org/sourceware/$(PKG_NAME)/$(PKG_VERSION) PKG_HASH:=616099beae24aba11f9b63d86ca6cc8d566d968b802391334c91df54eab416b4 PKG_MAINTAINER:=Luiz Angelo Daros de Luca From 9591c1631d158dabf529603a490914bbdc3fd6c9 Mon Sep 17 00:00:00 2001 From: Ryan Keane Date: Thu, 7 Nov 2024 22:36:23 -0800 Subject: [PATCH 052/119] elfutils: Backport some patches to fix errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On aarch64 musl gcc 14.x compiler, trying compiling elfutils 0.192 with lto option enabled will cause null-dereference error. Example error message: ... elf_compress.c: In function 'elf_compress': elf_compress.c:675:26: error: potential null pointer dereference [-Werror=null-dereference] 675 | shdr->sh_flags |= SHF_COMPRESSED; | ^ elf_compress_gnu.c: In function 'elf_compress_gnu': elf_compress_gnu.c:127:25: error: potential null pointer dereference [-Werror=null-dereference] 127 | shdr->sh_size = new_size; | ^ ^ ... This is a false postive warning but will abort compilation if gcc has `-Werror` flag. This commit add a patch for this, see the bugzilla report below. This commit backports a series of patches to fix some errors. Add patch: - 007-add-libeu-symbols-to-libelf.patch - 008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch - 009-fix-null-dereference-with-lto.patch Link: https://sourceware.org/bugzilla/show_bug.cgi?id=32311 Signed-off-by: Ryan Keane Link: https://github.com/openwrt/openwrt/pull/16886 Signed-off-by: Robert Marko (cherry picked from commit afffcd09e5f15be53f327a80ee87d391312eb805) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../007-add-libeu-symbols-to-libelf.patch | 31 +++ ...fix-autoconf-ENABLE_IMA_VERIFICATION.patch | 24 +++ .../009-fix-null-dereference-with-lto.patch | 193 ++++++++++++++++++ 3 files changed, 248 insertions(+) create mode 100644 package/libs/elfutils/patches/007-add-libeu-symbols-to-libelf.patch create mode 100644 package/libs/elfutils/patches/008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch create mode 100644 package/libs/elfutils/patches/009-fix-null-dereference-with-lto.patch diff --git a/package/libs/elfutils/patches/007-add-libeu-symbols-to-libelf.patch b/package/libs/elfutils/patches/007-add-libeu-symbols-to-libelf.patch new file mode 100644 index 0000000000..23489b5625 --- /dev/null +++ b/package/libs/elfutils/patches/007-add-libeu-symbols-to-libelf.patch @@ -0,0 +1,31 @@ +From f5d6e088f84dd05278c4698a21cbf1ff4569978d Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Tue, 22 Oct 2024 15:03:42 +0200 +Subject: [PATCH] libelf: Add libeu objects to libelf.a static archive + +libelf might use some symbols from libeu.a, specifically the eu-search +wrappers. But we don't ship libeu.a separately. So include the libeu +objects in the libelf.a archive to facilitate static linking. + + * libelf/Makefile.am (libeu_objects): New variable. + (libelf_a_LIBADD): New, add libeu_objects. + +https://sourceware.org/bugzilla/show_bug.cgi?id=32293 + +Signed-off-by: Mark Wielaard +--- + libelf/Makefile.am | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/libelf/Makefile.am ++++ b/libelf/Makefile.am +@@ -122,6 +122,9 @@ libelf.so: $(srcdir)/libelf.map $(libelf + @$(textrel_check) + $(AM_V_at)ln -fs $@ $@.$(VERSION) + ++libeu_objects = $(shell $(AR) t ../lib/libeu.a) ++libelf_a_LIBADD = $(addprefix ../lib/,$(libeu_objects)) ++ + install: install-am libelf.so + $(mkinstalldirs) $(DESTDIR)$(libdir) + $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so diff --git a/package/libs/elfutils/patches/008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch b/package/libs/elfutils/patches/008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch new file mode 100644 index 0000000000..e5732d2b08 --- /dev/null +++ b/package/libs/elfutils/patches/008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch @@ -0,0 +1,24 @@ +From f3c664d069d81a4872a1ec8241ee709f37c53e9c Mon Sep 17 00:00:00 2001 +From: Aaron Merey +Date: Tue, 29 Oct 2024 14:16:57 -0400 +Subject: [PATCH] configure.ac: Fix ENABLE_IMA_VERIFICATION conditional + +Fix test statement for ENABLE_IMA_VERIFICATION always evalutating to +false due to a missing 'x'. + +Signed-off-by: Aaron Merey +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -895,7 +895,7 @@ AS_IF([test "x$enable_debuginfod" != "xn + AM_CONDITIONAL([DEBUGINFOD],[test "x$enable_debuginfod" = "xyes"]) + AS_IF([test "x$enable_debuginfod_ima_verification" = "xyes"],AC_DEFINE([ENABLE_IMA_VERIFICATION],[1],[Build IMA verification])) + AS_IF([test "x$have_libarchive" = "xyes"],AC_DEFINE([HAVE_LIBARCHIVE],[1],[Define to 1 if libarchive is available])) +-AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "$enable_debuginfod_ima_verification" = "xyes"]) ++AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "x$enable_debuginfod_ima_verification" = "xyes"]) + AM_CONDITIONAL([OLD_LIBMICROHTTPD],[test "x$old_libmicrohttpd" = "xyes"]) + + dnl for /etc/profile.d/elfutils.{csh,sh} diff --git a/package/libs/elfutils/patches/009-fix-null-dereference-with-lto.patch b/package/libs/elfutils/patches/009-fix-null-dereference-with-lto.patch new file mode 100644 index 0000000000..1179a1e1a0 --- /dev/null +++ b/package/libs/elfutils/patches/009-fix-null-dereference-with-lto.patch @@ -0,0 +1,193 @@ +From 8707194a9f2f0b13e53041b03ebfdbdbd2942e43 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Tue, 5 Nov 2024 23:31:14 +0100 +Subject: [PATCH 1/1] libelf: Only fetch shdr once in elf_compress[_gnu] + +Some compilers assume the second call to elf[32|64]_getshdr can fail +and produce error: potential null pointer dereference. Just store the +result of the first call and reuse (when not NULL). + + * libelf/elf_compress.c (elf_compress): Store getshdr result in + a shdr union var. + * libelf/elf_compress_gnu.c (): Likewise + +https://sourceware.org/bugzilla/show_bug.cgi?id=32311 + +Signed-off-by: Mark Wielaard +--- + libelf/elf_compress.c | 55 +++++++++++++++++++++------------------ + libelf/elf_compress_gnu.c | 45 ++++++++++++++------------------ + 2 files changed, 48 insertions(+), 52 deletions(-) + +--- a/libelf/elf_compress.c ++++ b/libelf/elf_compress.c +@@ -584,25 +584,30 @@ elf_compress (Elf_Scn *scn, int type, un + Elf64_Xword sh_flags; + Elf64_Word sh_type; + Elf64_Xword sh_addralign; ++ union shdr ++ { ++ Elf32_Shdr *s32; ++ Elf64_Shdr *s64; ++ } shdr; + if (elfclass == ELFCLASS32) + { +- Elf32_Shdr *shdr = elf32_getshdr (scn); +- if (shdr == NULL) ++ shdr.s32 = elf32_getshdr (scn); ++ if (shdr.s32 == NULL) + return -1; + +- sh_flags = shdr->sh_flags; +- sh_type = shdr->sh_type; +- sh_addralign = shdr->sh_addralign; ++ sh_flags = shdr.s32->sh_flags; ++ sh_type = shdr.s32->sh_type; ++ sh_addralign = shdr.s32->sh_addralign; + } + else + { +- Elf64_Shdr *shdr = elf64_getshdr (scn); +- if (shdr == NULL) ++ shdr.s64 = elf64_getshdr (scn); ++ if (shdr.s64 == NULL) + return -1; + +- sh_flags = shdr->sh_flags; +- sh_type = shdr->sh_type; +- sh_addralign = shdr->sh_addralign; ++ sh_flags = shdr.s64->sh_flags; ++ sh_type = shdr.s64->sh_type; ++ sh_addralign = shdr.s64->sh_addralign; + } + + if ((sh_flags & SHF_ALLOC) != 0) +@@ -679,17 +684,17 @@ elf_compress (Elf_Scn *scn, int type, un + correctly and ignored when SHF_COMPRESSED is set. */ + if (elfclass == ELFCLASS32) + { +- Elf32_Shdr *shdr = elf32_getshdr (scn); +- shdr->sh_size = new_size; +- shdr->sh_addralign = __libelf_type_align (ELFCLASS32, ELF_T_CHDR); +- shdr->sh_flags |= SHF_COMPRESSED; ++ shdr.s32->sh_size = new_size; ++ shdr.s32->sh_addralign = __libelf_type_align (ELFCLASS32, ++ ELF_T_CHDR); ++ shdr.s32->sh_flags |= SHF_COMPRESSED; + } + else + { +- Elf64_Shdr *shdr = elf64_getshdr (scn); +- shdr->sh_size = new_size; +- shdr->sh_addralign = __libelf_type_align (ELFCLASS64, ELF_T_CHDR); +- shdr->sh_flags |= SHF_COMPRESSED; ++ shdr.s64->sh_size = new_size; ++ shdr.s64->sh_addralign = __libelf_type_align (ELFCLASS64, ++ ELF_T_CHDR); ++ shdr.s64->sh_flags |= SHF_COMPRESSED; + } + + __libelf_reset_rawdata (scn, out_buf, new_size, 1, ELF_T_CHDR); +@@ -731,17 +736,15 @@ elf_compress (Elf_Scn *scn, int type, un + correctly and ignored when SHF_COMPRESSED is set. */ + if (elfclass == ELFCLASS32) + { +- Elf32_Shdr *shdr = elf32_getshdr (scn); +- shdr->sh_size = scn->zdata_size; +- shdr->sh_addralign = scn->zdata_align; +- shdr->sh_flags &= ~SHF_COMPRESSED; ++ shdr.s32->sh_size = scn->zdata_size; ++ shdr.s32->sh_addralign = scn->zdata_align; ++ shdr.s32->sh_flags &= ~SHF_COMPRESSED; + } + else + { +- Elf64_Shdr *shdr = elf64_getshdr (scn); +- shdr->sh_size = scn->zdata_size; +- shdr->sh_addralign = scn->zdata_align; +- shdr->sh_flags &= ~SHF_COMPRESSED; ++ shdr.s64->sh_size = scn->zdata_size; ++ shdr.s64->sh_addralign = scn->zdata_align; ++ shdr.s64->sh_flags &= ~SHF_COMPRESSED; + } + + __libelf_reset_rawdata (scn, scn->zdata_base, +--- a/libelf/elf_compress_gnu.c ++++ b/libelf/elf_compress_gnu.c +@@ -59,25 +59,30 @@ elf_compress_gnu (Elf_Scn *scn, int infl + Elf64_Xword sh_flags; + Elf64_Word sh_type; + Elf64_Xword sh_addralign; ++ union shdr ++ { ++ Elf32_Shdr *s32; ++ Elf64_Shdr *s64; ++ } shdr; + if (elfclass == ELFCLASS32) + { +- Elf32_Shdr *shdr = elf32_getshdr (scn); +- if (shdr == NULL) ++ shdr.s32 = elf32_getshdr (scn); ++ if (shdr.s32 == NULL) + return -1; + +- sh_flags = shdr->sh_flags; +- sh_type = shdr->sh_type; +- sh_addralign = shdr->sh_addralign; ++ sh_flags = shdr.s32->sh_flags; ++ sh_type = shdr.s32->sh_type; ++ sh_addralign = shdr.s32->sh_addralign; + } + else + { +- Elf64_Shdr *shdr = elf64_getshdr (scn); +- if (shdr == NULL) ++ shdr.s64 = elf64_getshdr (scn); ++ if (shdr.s64 == NULL) + return -1; + +- sh_flags = shdr->sh_flags; +- sh_type = shdr->sh_type; +- sh_addralign = shdr->sh_addralign; ++ sh_flags = shdr.s64->sh_flags; ++ sh_type = shdr.s64->sh_type; ++ sh_addralign = shdr.s64->sh_addralign; + } + + /* Allocated sections, or sections that are already are compressed +@@ -122,15 +127,9 @@ elf_compress_gnu (Elf_Scn *scn, int infl + sh_flags won't have a SHF_COMPRESSED hint in the GNU format. + Just adjust the sh_size. */ + if (elfclass == ELFCLASS32) +- { +- Elf32_Shdr *shdr = elf32_getshdr (scn); +- shdr->sh_size = new_size; +- } ++ shdr.s32->sh_size = new_size; + else +- { +- Elf64_Shdr *shdr = elf64_getshdr (scn); +- shdr->sh_size = new_size; +- } ++ shdr.s64->sh_size = new_size; + + __libelf_reset_rawdata (scn, out_buf, new_size, 1, ELF_T_BYTE); + +@@ -187,15 +186,9 @@ elf_compress_gnu (Elf_Scn *scn, int infl + sh_flags won't have a SHF_COMPRESSED hint in the GNU format. + Just adjust the sh_size. */ + if (elfclass == ELFCLASS32) +- { +- Elf32_Shdr *shdr = elf32_getshdr (scn); +- shdr->sh_size = size; +- } ++ shdr.s32->sh_size = size; + else +- { +- Elf64_Shdr *shdr = elf64_getshdr (scn); +- shdr->sh_size = size; +- } ++ shdr.s64->sh_size = size; + + __libelf_reset_rawdata (scn, buf_out, size, sh_addralign, + __libelf_data_type (&ehdr, sh_type, From 1eade612f91587eece6deb350948644975cf8a00 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Tue, 24 Sep 2024 17:43:49 -0300 Subject: [PATCH 053/119] ipq807x: nbg7815: use the standard eMMC sysupgrade code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that the old ad-hoc method did not explicitly align backup data to 64 KiB boundaries. Signed-off-by: Rodrigo Balerdi Link: https://github.com/openwrt/openwrt/pull/16505 Signed-off-by: Robert Marko (cherry picked from commit 5583d2318966d5d5dcdbdec2e34b8815d3f6419a) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/qualcommax/image/ipq807x.mk | 2 +- .../ipq807x/base-files/lib/upgrade/platform.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index faefb479c2..401f455585 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -446,7 +446,7 @@ define Device/zyxel_nbg7815 DEVICE_MODEL := NBG7815 DEVICE_DTS_CONFIG := config@nbg7815 SOC := ipq8074 - DEVICE_PACKAGES := ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci \ + DEVICE_PACKAGES := kmod-fs-f2fs f2fs-tools ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci \ kmod-bluetooth kmod-hwmon-tmp103 endef TARGET_DEVICES += zyxel_nbg7815 diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 808acac684..f822f6291d 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -251,14 +251,13 @@ platform_do_upgrade() { [ -z "$config_mtdnum" ] && reboot part_num="$(hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd$config_mtdnum | cut -f 1 -d "|" | head -n1)" if [ "$part_num" -eq "0" ]; then - kernelname="0:HLOS" - rootfsname="rootfs" - mmc_do_upgrade "$1" + CI_KERNPART="0:HLOS" + CI_ROOTPART="rootfs" else - kernelname="0:HLOS_1" - rootfsname="rootfs_1" - mmc_do_upgrade "$1" + CI_KERNPART="0:HLOS_1" + CI_ROOTPART="rootfs_1" fi + emmc_do_upgrade "$1" ;; *) default_do_upgrade "$1" @@ -268,7 +267,8 @@ platform_do_upgrade() { platform_copy_config() { case "$(board_name)" in - spectrum,sax1v1k) + spectrum,sax1v1k|\ + zyxel,nbg7815) emmc_copy_config ;; esac From 16eb043062f16986879d7ff8f6f9b1f773a4a2fd Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 8 Nov 2024 17:40:03 -0300 Subject: [PATCH 054/119] ipq807x: prpl haze & qnap 301w: use the standard eMMC sysupgrade code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that the old ad-hoc method did not explicitly align backup data to 64 KiB boundaries. Also note that the qnap 301w has a 'rootfs_data' partition in the eMMC that is being ignored by fstools during boot, presumably due to a bug. This is why the partition is also ignored in the sysupgrade code and there is no definition of CI_DATAPART="rootfs_data". Signed-off-by: Rodrigo Balerdi Link: https://github.com/openwrt/openwrt/pull/16505 Signed-off-by: Robert Marko (cherry picked from commit fe481c9c47d97ebde1bc3c959924f4f9227c6c16) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/qualcommax/image/ipq807x.mk | 4 ++-- .../qualcommax/ipq807x/base-files/lib/upgrade/platform.sh | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 401f455585..60af865459 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -308,7 +308,7 @@ define Device/prpl_haze DEVICE_DTS_CONFIG := config@hk09 SOC := ipq8072 DEVICE_PACKAGES := ath11k-firmware-qcn9074 ipq-wifi-prpl_haze kmod-ath11k-pci \ - mkf2fs f2fsck kmod-fs-f2fs kmod-leds-lp5562 + kmod-fs-f2fs f2fs-tools kmod-leds-lp5562 endef TARGET_DEVICES += prpl_haze @@ -320,7 +320,7 @@ define Device/qnap_301w DEVICE_DTS_CONFIG := config@hk01 KERNEL_SIZE := 16384k SOC := ipq8072 - DEVICE_PACKAGES := ipq-wifi-qnap_301w + DEVICE_PACKAGES := kmod-fs-f2fs f2fs-tools ipq-wifi-qnap_301w endef TARGET_DEVICES += qnap_301w diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index f822f6291d..00289dcfe6 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -185,9 +185,9 @@ platform_do_upgrade() { ;; prpl,haze|\ qnap,301w) - kernelname="0:HLOS" - rootfsname="rootfs" - mmc_do_upgrade "$1" + CI_KERNPART="0:HLOS" + CI_ROOTPART="rootfs" + emmc_do_upgrade "$1" ;; tplink,eap660hd-v1) tplink_do_upgrade "$1" @@ -267,6 +267,8 @@ platform_do_upgrade() { platform_copy_config() { case "$(board_name)" in + prpl,haze|\ + qnap,301w|\ spectrum,sax1v1k|\ zyxel,nbg7815) emmc_copy_config From b1c01cd4b5d0ab8ad8f254836aa3e3c50688a64d Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 8 Nov 2024 17:45:12 -0300 Subject: [PATCH 055/119] ipq807x: order devices alphabetically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alphabetically sort devices in platform.sh Signed-off-by: Rodrigo Balerdi Link: https://github.com/openwrt/openwrt/pull/16505 Signed-off-by: Robert Marko (cherry picked from commit 17f84bba44dbee248b3a79935657a74b21caa280) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../qualcommax/ipq807x/base-files/lib/upgrade/platform.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 00289dcfe6..70657629fc 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -189,9 +189,6 @@ platform_do_upgrade() { CI_ROOTPART="rootfs" emmc_do_upgrade "$1" ;; - tplink,eap660hd-v1) - tplink_do_upgrade "$1" - ;; redmi,ax6|\ xiaomi,ax3600|\ xiaomi,ax9000) @@ -217,6 +214,9 @@ platform_do_upgrade() { CI_DATAPART="rootfs_data" emmc_do_upgrade "$1" ;; + tplink,eap660hd-v1) + tplink_do_upgrade "$1" + ;; yuncore,ax880) active="$(fw_printenv -n active)" if [ "$active" -eq "1" ]; then From 05989f69d8e68051bc2058f0ae3b2e14264a4504 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 8 Nov 2024 17:40:29 -0300 Subject: [PATCH 056/119] ipq807x: delete unused legacy eMMC sysupgrade code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All ipq807x devices that were using the legacy 'mmc_do_upgrade' eMMC sysupgrade code were ported to the replacement 'emmc_do_upgrade' code. Signed-off-by: Rodrigo Balerdi Link: https://github.com/openwrt/openwrt/pull/16505 Signed-off-by: Robert Marko (cherry picked from commit 491121288eaa9d20f3db8215a4790e8f0ee1f8ca) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../ipq807x/base-files/lib/upgrade/mmc.sh | 83 ------------------- 1 file changed, 83 deletions(-) delete mode 100644 target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh deleted file mode 100644 index 21cd7928e3..0000000000 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh +++ /dev/null @@ -1,83 +0,0 @@ -# -# Copyright (C) 2016 lede-project.org -# - -# this can be used as a generic mmc upgrade script -# just add a device entry in platform.sh, -# define "kernelname" and "rootfsname" and call mmc_do_upgrade -# after the kernel and rootfs flash a loopdev (as overlay) is -# setup on top of the rootfs partition -# for the proper function a padded rootfs image is needed, basically -# append "pad-to 64k" to the image definition -# this is based on the ipq806x zyxel.sh mmc upgrade - -. /lib/functions.sh - -mmc_do_upgrade() { - local tar_file="$1" - local rootfs= - local kernel= - - [ -z "$kernel" ] && kernel=$(find_mmc_part ${kernelname}) - [ -z "$rootfs" ] && rootfs=$(find_mmc_part ${rootfsname}) - - [ -z "$kernel" ] && echo "Upgrade failed: kernel partition not found! Rebooting..." && reboot -f - [ -z "$rootfs" ] && echo "Upgrade failed: rootfs partition not found! Rebooting..." && reboot -f - - mmc_do_flash $tar_file $kernel $rootfs - - return 0 -} - -mmc_do_flash() { - local tar_file=$1 - local kernel=$2 - local rootfs=$3 - - # keep sure its unbound - losetup --detach-all || { - echo Failed to detach all loop devices. Skip this try. - reboot -f - } - - # use the first found directory in the tar archive - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} - - echo "flashing kernel to $kernel" - tar xf $tar_file ${board_dir}/kernel -O >$kernel - - echo "flashing rootfs to ${rootfs}" - tar xf $tar_file ${board_dir}/root -O >"${rootfs}" - - # a padded rootfs is needed for overlay fs creation - local offset=$(tar xf $tar_file ${board_dir}/root -O | wc -c) - [ $offset -lt 65536 ] && { - echo Wrong size for rootfs: $offset - sleep 10 - reboot -f - } - - # Mount loop for rootfs_data - local loopdev="$(losetup -f)" - losetup -o $offset $loopdev $rootfs || { - echo "Failed to mount looped rootfs_data." - sleep 10 - reboot -f - } - - echo "Format new rootfs_data at position ${offset}." - mkfs.ext4 -F -L rootfs_data $loopdev - mkdir /tmp/new_root - mount -t ext4 $loopdev /tmp/new_root && { - echo "Saving config to rootfs_data at position ${offset}." - cp -v "$UPGRADE_BACKUP" "/tmp/new_root/$BACKUP_FILE" - umount /tmp/new_root - } - - # Cleanup - losetup -d $loopdev >/dev/null 2>&1 - sync - umount -a - reboot -f -} From abf78dd5d8cdf874b074fc96a8802f3178d9a32a Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 17 Nov 2024 08:40:44 +0100 Subject: [PATCH 057/119] kernel: disable drm-i915 module for x86/geode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable drm-i915 module for target x86/geode. Fixes: 77cfe8f ("x86: make i915 as a kmod with required firmware") Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16977 Signed-off-by: Robert Marko (cherry picked from commit 226f74badd61fb1586dd3531835aeaa3bf6fe467) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/video.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index fc0f038863..f2fa82fd03 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -441,7 +441,8 @@ $(eval $(call KernelPackage,drm-amdgpu)) define KernelPackage/drm-i915 SUBMENU:=$(VIDEO_MENU) TITLE:=Intel i915 DRM support - DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \ + DEPENDS:=@(TARGET_x86_64||TARGET_x86_generic||TARGET_x86_legacy) \ + @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \ +kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +i915-firmware-dmc \ +kmod-drm-display-helper +kmod-drm-buddy +kmod-acpi-video \ +kmod-drm-exec +kmod-drm-suballoc-helper From dae203bd942d5220bee83eb63a75202e339181ad Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 16 Nov 2024 18:38:42 +0100 Subject: [PATCH 058/119] omnia-eeprom: Mark it nonshared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This tool was build in the phase 2 build, there the TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia dependecy was probably not meat. Mark it as non shared to build it together with the target where this option is set. Signed-off-by: Hauke Mehrtens Link: https://github.com/openwrt/openwrt/pull/16975 Signed-off-by: Robert Marko (cherry picked from commit 371e7bef4046fb3992ecfb92b5b741c22fa3ade6) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/utils/omnia-eeprom/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/utils/omnia-eeprom/Makefile b/package/utils/omnia-eeprom/Makefile index 03eb13bbc1..f9e48b28b9 100644 --- a/package/utils/omnia-eeprom/Makefile +++ b/package/utils/omnia-eeprom/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-v$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/omnia-eeprom/-/archive/v$(PKG_VERSION)/ PKG_HASH:=6f949d0b8080adca8bae088774ce615b563ba6ec2807cce97ee6769b4eee7bbf +PKG_FLAGS:=nonshared PKG_MAINTAINER:=Marek Behun PKG_LICENSE:=GPL-2.0-or-later From 2884aded40c946aa1fc721dd2e4e5633afe5c256 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sat, 16 Nov 2024 17:26:52 +0100 Subject: [PATCH 059/119] kernel: move CONFIG_INTEL_MEI settings to target generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move settings CONFIG_INTEL_MEI_GSC_PROXY, CONFIG_INTEL_MEI_HDCP and CONFIG_INTEL_MEI_PXP to target generic. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16971 Signed-off-by: Robert Marko (cherry picked from commit 84665993d6beed8ac2b557f8d3e005a29e3fd09c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/generic/config-6.6 | 3 +++ target/linux/x86/64/config-6.6 | 3 --- target/linux/x86/generic/config-6.6 | 3 --- target/linux/x86/legacy/config-6.6 | 3 --- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6 index 8b22cc4035..d887381414 100644 --- a/target/linux/generic/config-6.6 +++ b/target/linux/generic/config-6.6 @@ -2715,7 +2715,10 @@ CONFIG_INPUT_MISC=y # CONFIG_INTEL_IOATDMA is not set # CONFIG_INTEL_ISH_HID is not set # CONFIG_INTEL_MEI is not set +# CONFIG_INTEL_MEI_GSC_PROXY is not set +# CONFIG_INTEL_MEI_HDCP is not set # CONFIG_INTEL_MEI_ME is not set +# CONFIG_INTEL_MEI_PXP is not set # CONFIG_INTEL_MEI_TXE is not set # CONFIG_INTEL_OAKTRAIL is not set # CONFIG_INTEL_PMC_CORE is not set diff --git a/target/linux/x86/64/config-6.6 b/target/linux/x86/64/config-6.6 index 3475e65287..1d08d31daa 100644 --- a/target/linux/x86/64/config-6.6 +++ b/target/linux/x86/64/config-6.6 @@ -292,9 +292,6 @@ CONFIG_INTEL_IOMMU_PERF_EVENTS=y # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set # CONFIG_INTEL_IOMMU_SVM is not set # CONFIG_INTEL_IPS is not set -# CONFIG_INTEL_MEI_GSC_PROXY is not set -# CONFIG_INTEL_MEI_HDCP is not set -# CONFIG_INTEL_MEI_PXP is not set CONFIG_INTEL_PCH_THERMAL=y # CONFIG_INTEL_SAR_INT1092 is not set # CONFIG_INTEL_SCU_PLATFORM is not set diff --git a/target/linux/x86/generic/config-6.6 b/target/linux/x86/generic/config-6.6 index ecbd0aa93e..404e3ac330 100644 --- a/target/linux/x86/generic/config-6.6 +++ b/target/linux/x86/generic/config-6.6 @@ -211,9 +211,6 @@ CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_GTT=y CONFIG_INTEL_IDLE=y # CONFIG_INTEL_IPS is not set -# CONFIG_INTEL_MEI_GSC_PROXY is not set -# CONFIG_INTEL_MEI_HDCP is not set -# CONFIG_INTEL_MEI_PXP is not set CONFIG_INTEL_PCH_THERMAL=y # CONFIG_INTEL_SAR_INT1092 is not set # CONFIG_INTEL_SCU_PLATFORM is not set diff --git a/target/linux/x86/legacy/config-6.6 b/target/linux/x86/legacy/config-6.6 index 10511ff08b..bc7e74ac3f 100644 --- a/target/linux/x86/legacy/config-6.6 +++ b/target/linux/x86/legacy/config-6.6 @@ -129,9 +129,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INTEL_GTT=y CONFIG_INTEL_IDLE=y # CONFIG_INTEL_IPS is not set -# CONFIG_INTEL_MEI_GSC_PROXY is not set -# CONFIG_INTEL_MEI_HDCP is not set -# CONFIG_INTEL_MEI_PXP is not set # CONFIG_INTEL_SAR_INT1092 is not set # CONFIG_INTEL_SCU_PLATFORM is not set # CONFIG_INTEL_SOC_DTS_THERMAL is not set From 4b9739a0f1f0a1c1706102b15a93b3289fa3de9e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 16 Nov 2024 11:01:15 -0800 Subject: [PATCH 060/119] kernel: remove GCC11_NO_ARRAY_BOUNDS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This symbol is no longer present. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16770 Signed-off-by: Hauke Mehrtens (cherry picked from commit da8abd4a1e86a37ddcd4fa0e6acc5bf8b1b4c70e) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/bcm47xx/config-6.6 | 1 - target/linux/bcm4908/config-6.6 | 1 - target/linux/bcm53xx/config-6.6 | 1 - target/linux/imx/config-6.6 | 1 - target/linux/ipq40xx/config-6.6 | 1 - target/linux/ipq806x/config-6.6 | 1 - target/linux/kirkwood/config-6.6 | 1 - target/linux/layerscape/armv7/config-6.6 | 1 - target/linux/loongarch64/config-6.6 | 1 - target/linux/malta/config-6.6 | 1 - target/linux/mediatek/filogic/config-6.6 | 1 - target/linux/mediatek/mt7622/config-6.6 | 1 - target/linux/mediatek/mt7623/config-6.6 | 1 - target/linux/mediatek/mt7629/config-6.6 | 1 - target/linux/mpc85xx/config-6.6 | 1 - target/linux/mvebu/config-6.6 | 1 - target/linux/mxs/config-6.6 | 1 - target/linux/qualcommax/config-6.6 | 1 - target/linux/sifiveu/config-6.6 | 1 - target/linux/starfive/config-6.6 | 1 - target/linux/x86/config-6.6 | 1 - 21 files changed, 21 deletions(-) diff --git a/target/linux/bcm47xx/config-6.6 b/target/linux/bcm47xx/config-6.6 index 3b795941f3..dcf98603d7 100644 --- a/target/linux/bcm47xx/config-6.6 +++ b/target/linux/bcm47xx/config-6.6 @@ -66,7 +66,6 @@ CONFIG_FS_IOMAP=y CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/bcm4908/config-6.6 b/target/linux/bcm4908/config-6.6 index 0c604a1860..10e89cea81 100644 --- a/target/linux/bcm4908/config-6.6 +++ b/target/linux/bcm4908/config-6.6 @@ -94,7 +94,6 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y diff --git a/target/linux/bcm53xx/config-6.6 b/target/linux/bcm53xx/config-6.6 index 34dcf86e7b..cd62b0df58 100644 --- a/target/linux/bcm53xx/config-6.6 +++ b/target/linux/bcm53xx/config-6.6 @@ -140,7 +140,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/target/linux/imx/config-6.6 b/target/linux/imx/config-6.6 index f70e7e1501..75ad42c6df 100644 --- a/target/linux/imx/config-6.6 +++ b/target/linux/imx/config-6.6 @@ -194,7 +194,6 @@ CONFIG_FS_MBCACHE=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/ipq40xx/config-6.6 b/target/linux/ipq40xx/config-6.6 index 0ee2f433b1..69c2752894 100644 --- a/target/linux/ipq40xx/config-6.6 +++ b/target/linux/ipq40xx/config-6.6 @@ -165,7 +165,6 @@ CONFIG_FIX_EARLYCON_MEM=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/ipq806x/config-6.6 b/target/linux/ipq806x/config-6.6 index 88ec58e2c9..af5ccb11ac 100644 --- a/target/linux/ipq806x/config-6.6 +++ b/target/linux/ipq806x/config-6.6 @@ -155,7 +155,6 @@ CONFIG_FIX_EARLYCON_MEM=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/kirkwood/config-6.6 b/target/linux/kirkwood/config-6.6 index b3320dac1f..c5cfecd4e3 100644 --- a/target/linux/kirkwood/config-6.6 +++ b/target/linux/kirkwood/config-6.6 @@ -103,7 +103,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y diff --git a/target/linux/layerscape/armv7/config-6.6 b/target/linux/layerscape/armv7/config-6.6 index ee397fc7c6..0a244a85cd 100644 --- a/target/linux/layerscape/armv7/config-6.6 +++ b/target/linux/layerscape/armv7/config-6.6 @@ -232,7 +232,6 @@ CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/target/linux/loongarch64/config-6.6 b/target/linux/loongarch64/config-6.6 index 46a90c1284..5cbf1177cd 100644 --- a/target/linux/loongarch64/config-6.6 +++ b/target/linux/loongarch64/config-6.6 @@ -285,7 +285,6 @@ CONFIG_FW_CACHE=y # CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y diff --git a/target/linux/malta/config-6.6 b/target/linux/malta/config-6.6 index 73db6cea21..f6d9049f4d 100644 --- a/target/linux/malta/config-6.6 +++ b/target/linux/malta/config-6.6 @@ -84,7 +84,6 @@ CONFIG_FS_MBCACHE=y CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/mediatek/filogic/config-6.6 b/target/linux/mediatek/filogic/config-6.6 index ba472b6ced..936f1009d9 100644 --- a/target/linux/mediatek/filogic/config-6.6 +++ b/target/linux/mediatek/filogic/config-6.6 @@ -168,7 +168,6 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y diff --git a/target/linux/mediatek/mt7622/config-6.6 b/target/linux/mediatek/mt7622/config-6.6 index e4a9e4b9cb..9440a7bb28 100644 --- a/target/linux/mediatek/mt7622/config-6.6 +++ b/target/linux/mediatek/mt7622/config-6.6 @@ -174,7 +174,6 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y diff --git a/target/linux/mediatek/mt7623/config-6.6 b/target/linux/mediatek/mt7623/config-6.6 index d04188f20c..dc31c230a2 100644 --- a/target/linux/mediatek/mt7623/config-6.6 +++ b/target/linux/mediatek/mt7623/config-6.6 @@ -240,7 +240,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/mediatek/mt7629/config-6.6 b/target/linux/mediatek/mt7629/config-6.6 index 384311dc71..d74e143c10 100644 --- a/target/linux/mediatek/mt7629/config-6.6 +++ b/target/linux/mediatek/mt7629/config-6.6 @@ -113,7 +113,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/target/linux/mpc85xx/config-6.6 b/target/linux/mpc85xx/config-6.6 index 14d5650fb5..c5563958a8 100644 --- a/target/linux/mpc85xx/config-6.6 +++ b/target/linux/mpc85xx/config-6.6 @@ -86,7 +86,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y diff --git a/target/linux/mvebu/config-6.6 b/target/linux/mvebu/config-6.6 index a4572d8a89..f132884d49 100644 --- a/target/linux/mvebu/config-6.6 +++ b/target/linux/mvebu/config-6.6 @@ -161,7 +161,6 @@ CONFIG_FS_MBCACHE=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/mxs/config-6.6 b/target/linux/mxs/config-6.6 index 76aecd17ff..b4bc5b3051 100644 --- a/target/linux/mxs/config-6.6 +++ b/target/linux/mxs/config-6.6 @@ -92,7 +92,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/qualcommax/config-6.6 b/target/linux/qualcommax/config-6.6 index 1d05868caf..ac2494d749 100644 --- a/target/linux/qualcommax/config-6.6 +++ b/target/linux/qualcommax/config-6.6 @@ -151,7 +151,6 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y diff --git a/target/linux/sifiveu/config-6.6 b/target/linux/sifiveu/config-6.6 index 2e5474ce2f..8ed8f766c8 100644 --- a/target/linux/sifiveu/config-6.6 +++ b/target/linux/sifiveu/config-6.6 @@ -118,7 +118,6 @@ CONFIG_FS_MBCACHE=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/starfive/config-6.6 b/target/linux/starfive/config-6.6 index 8ebced1165..ef71001663 100644 --- a/target/linux/starfive/config-6.6 +++ b/target/linux/starfive/config-6.6 @@ -190,7 +190,6 @@ CONFIG_FS_MBCACHE=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/x86/config-6.6 b/target/linux/x86/config-6.6 index 3d1c005138..1a68c589a5 100644 --- a/target/linux/x86/config-6.6 +++ b/target/linux/x86/config-6.6 @@ -137,7 +137,6 @@ CONFIG_FUSION_MAX_SGE=128 CONFIG_FUSION_SPI=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y # CONFIG_GDS_FORCE_MITIGATION is not set CONFIG_GENERIC_ALLOCATOR=y From 7142e35777248710635f0152ccee2fba78325395 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 2 Oct 2024 15:25:35 -0700 Subject: [PATCH 061/119] kernel: filter out compiler opts from config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These get dynamically set based on compiler version. Not relevant for targets. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16770 Signed-off-by: Hauke Mehrtens (cherry picked from commit cd92cbddf8c473507a9af290c99f2aef8c368784) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/airoha/an7581/config-6.6 | 3 --- target/linux/airoha/en7523/config-6.6 | 3 --- target/linux/apm821xx/config-6.6 | 3 --- target/linux/archs38/config-6.6 | 3 --- target/linux/at91/sam9x/config-6.6 | 3 --- target/linux/at91/sama5/config-6.6 | 3 --- target/linux/at91/sama7/config-6.6 | 3 --- target/linux/ath79/config-6.6 | 3 --- target/linux/bcm27xx/bcm2708/config-6.6 | 3 --- target/linux/bcm27xx/bcm2709/config-6.6 | 3 --- target/linux/bcm27xx/bcm2710/config-6.6 | 3 --- target/linux/bcm27xx/bcm2711/config-6.6 | 3 --- target/linux/bcm27xx/bcm2712/config-6.6 | 3 --- target/linux/bcm47xx/config-6.6 | 2 -- target/linux/bcm4908/config-6.6 | 2 -- target/linux/bcm53xx/config-6.6 | 2 -- target/linux/bmips/bcm6318/config-6.6 | 3 --- target/linux/bmips/bcm63268/config-6.6 | 3 --- target/linux/bmips/bcm6328/config-6.6 | 3 --- target/linux/bmips/bcm6358/config-6.6 | 3 --- target/linux/bmips/bcm6362/config-6.6 | 3 --- target/linux/bmips/bcm6368/config-6.6 | 3 --- target/linux/d1/config-6.6 | 2 -- target/linux/gemini/config-6.6 | 3 --- target/linux/generic/config-filter | 3 +++ target/linux/imx/config-6.6 | 2 -- target/linux/ipq40xx/config-6.6 | 2 -- target/linux/ipq806x/config-6.6 | 2 -- target/linux/ixp4xx/config-6.6 | 3 --- target/linux/kirkwood/config-6.6 | 2 -- target/linux/lantiq/config-6.6 | 3 --- target/linux/layerscape/armv7/config-6.6 | 2 -- target/linux/layerscape/armv8_64b/config-6.6 | 3 --- target/linux/loongarch64/config-6.6 | 2 -- target/linux/malta/config-6.6 | 2 -- target/linux/mediatek/filogic/config-6.6 | 2 -- target/linux/mediatek/mt7622/config-6.6 | 2 -- target/linux/mediatek/mt7623/config-6.6 | 2 -- target/linux/mediatek/mt7629/config-6.6 | 2 -- target/linux/mpc85xx/config-6.6 | 2 -- target/linux/mvebu/config-6.6 | 2 -- target/linux/mxs/config-6.6 | 2 -- target/linux/octeon/config-6.6 | 3 --- target/linux/omap/config-6.6 | 3 --- target/linux/pistachio/config-6.6 | 3 --- target/linux/qoriq/config-6.6 | 3 --- target/linux/qualcommax/config-6.6 | 2 -- target/linux/ramips/mt7620/config-6.6 | 3 --- target/linux/ramips/mt7621/config-6.6 | 3 --- target/linux/ramips/mt76x8/config-6.6 | 3 --- target/linux/ramips/rt288x/config-6.6 | 3 --- target/linux/ramips/rt305x/config-6.6 | 3 --- target/linux/ramips/rt3883/config-6.6 | 3 --- target/linux/rockchip/armv8/config-6.6 | 3 --- target/linux/sifiveu/config-6.6 | 2 -- target/linux/siflower/sf19a2890/config-6.6 | 3 --- target/linux/starfive/config-6.6 | 2 -- target/linux/tegra/config-6.6 | 3 --- target/linux/x86/config-6.6 | 2 -- target/linux/zynq/config-6.6 | 3 --- 60 files changed, 3 insertions(+), 155 deletions(-) diff --git a/target/linux/airoha/an7581/config-6.6 b/target/linux/airoha/an7581/config-6.6 index 5001de9b19..b26cbeeb33 100644 --- a/target/linux/airoha/an7581/config-6.6 +++ b/target/linux/airoha/an7581/config-6.6 @@ -111,8 +111,6 @@ CONFIG_CAVIUM_ERRATUM_30115=y CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y # CONFIG_CFS_BANDWIDTH is not set CONFIG_CGROUPS=y CONFIG_CGROUP_CPUACCT=y @@ -232,7 +230,6 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y # CONFIG_FW_LOADER_USER_HELPER is not set -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/target/linux/airoha/en7523/config-6.6 b/target/linux/airoha/en7523/config-6.6 index ce93f7d9ff..a40b61696a 100644 --- a/target/linux/airoha/en7523/config-6.6 +++ b/target/linux/airoha/en7523/config-6.6 @@ -45,8 +45,6 @@ CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs,jffs2" CONFIG_CMDLINE_FROM_BOOTLOADER=y @@ -102,7 +100,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/target/linux/apm821xx/config-6.6 b/target/linux/apm821xx/config-6.6 index 33e586632c..a9c9a952c8 100644 --- a/target/linux/apm821xx/config-6.6 +++ b/target/linux/apm821xx/config-6.6 @@ -34,8 +34,6 @@ CONFIG_BOOKE=y CONFIG_BOOKE_OR_40x=y CONFIG_BOOKE_WDT=y # CONFIG_CANYONLANDS is not set -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs noinitrd" CONFIG_CMDLINE_FROM_BOOTLOADER=y @@ -83,7 +81,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/archs38/config-6.6 b/target/linux/archs38/config-6.6 index 6298ce9e46..dab1b855b9 100644 --- a/target/linux/archs38/config-6.6 +++ b/target/linux/archs38/config-6.6 @@ -47,8 +47,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y CONFIG_BUFFER_HEAD=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLK_HSDK=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y @@ -103,7 +101,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CSUM=y diff --git a/target/linux/at91/sam9x/config-6.6 b/target/linux/at91/sam9x/config-6.6 index d5cfa5f753..2631f0feea 100644 --- a/target/linux/at91/sam9x/config-6.6 +++ b/target/linux/at91/sam9x/config-6.6 @@ -44,8 +44,6 @@ CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y CONFIG_BLK_PM=y CONFIG_BUFFER_HEAD=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_AT91=y @@ -109,7 +107,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/at91/sama5/config-6.6 b/target/linux/at91/sama5/config-6.6 index 04eee7a210..d04e10f9e1 100644 --- a/target/linux/at91/sama5/config-6.6 +++ b/target/linux/at91/sama5/config-6.6 @@ -54,8 +54,6 @@ CONFIG_BLK_PM=y CONFIG_BUFFER_HEAD=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMA=y CONFIG_CMA_ALIGNMENT=8 @@ -181,7 +179,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/at91/sama7/config-6.6 b/target/linux/at91/sama7/config-6.6 index e3455c5e37..c69cbdf767 100644 --- a/target/linux/at91/sama7/config-6.6 +++ b/target/linux/at91/sama7/config-6.6 @@ -45,8 +45,6 @@ CONFIG_BUFFER_HEAD=y # CONFIG_CACHE_L2X0 is not set CONFIG_CAN=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMA=y CONFIG_CMA_ALIGNMENT=9 @@ -162,7 +160,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/ath79/config-6.6 b/target/linux/ath79/config-6.6 index 92057c343c..c43dbfd719 100644 --- a/target/linux/ath79/config-6.6 +++ b/target/linux/ath79/config-6.6 @@ -14,8 +14,6 @@ CONFIG_AT803X_PHY=y CONFIG_ATH79=y CONFIG_ATH79_WDT=y CONFIG_BLK_MQ_PCI=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs,jffs2" @@ -58,7 +56,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/bcm27xx/bcm2708/config-6.6 b/target/linux/bcm27xx/bcm2708/config-6.6 index 4872e44642..b587b5d719 100644 --- a/target/linux/bcm27xx/bcm2708/config-6.6 +++ b/target/linux/bcm27xx/bcm2708/config-6.6 @@ -55,8 +55,6 @@ CONFIG_BRCM_CHAR_DRIVERS=y CONFIG_BUFFER_HEAD=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -172,7 +170,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/bcm27xx/bcm2709/config-6.6 b/target/linux/bcm27xx/bcm2709/config-6.6 index 23e93241df..4a295d52c8 100644 --- a/target/linux/bcm27xx/bcm2709/config-6.6 +++ b/target/linux/bcm27xx/bcm2709/config-6.6 @@ -69,8 +69,6 @@ CONFIG_BROADCOM_PHY=y CONFIG_BUFFER_HEAD=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -211,7 +209,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/bcm27xx/bcm2710/config-6.6 b/target/linux/bcm27xx/bcm2710/config-6.6 index 5b7d6ae4f1..97f2f110b0 100644 --- a/target/linux/bcm27xx/bcm2710/config-6.6 +++ b/target/linux/bcm27xx/bcm2710/config-6.6 @@ -85,8 +85,6 @@ CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -218,7 +216,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/target/linux/bcm27xx/bcm2711/config-6.6 b/target/linux/bcm27xx/bcm2711/config-6.6 index 270763549a..f9b7469607 100644 --- a/target/linux/bcm27xx/bcm2711/config-6.6 +++ b/target/linux/bcm27xx/bcm2711/config-6.6 @@ -84,8 +84,6 @@ CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -219,7 +217,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_NUMA=y diff --git a/target/linux/bcm27xx/bcm2712/config-6.6 b/target/linux/bcm27xx/bcm2712/config-6.6 index a5eb6c4d0e..5abc41ff68 100644 --- a/target/linux/bcm27xx/bcm2712/config-6.6 +++ b/target/linux/bcm27xx/bcm2712/config-6.6 @@ -110,8 +110,6 @@ CONFIG_BUFFER_HEAD=y CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -262,7 +260,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_NUMA=y diff --git a/target/linux/bcm47xx/config-6.6 b/target/linux/bcm47xx/config-6.6 index dcf98603d7..ec549f6e33 100644 --- a/target/linux/bcm47xx/config-6.6 +++ b/target/linux/bcm47xx/config-6.6 @@ -27,8 +27,6 @@ CONFIG_BCMA_PFLASH=y CONFIG_BCMA_SFLASH=y # CONFIG_BGMAC_BCMA is not set CONFIG_BLK_MQ_PCI=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="noinitrd console=ttyS0,115200" diff --git a/target/linux/bcm4908/config-6.6 b/target/linux/bcm4908/config-6.6 index 10e89cea81..02eb2f2ce6 100644 --- a/target/linux/bcm4908/config-6.6 +++ b/target/linux/bcm4908/config-6.6 @@ -49,8 +49,6 @@ CONFIG_BLK_PM=y CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLK_BCM_63XX=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="earlycon=bcm63xx_uart,0xff800640 console=ttyS0,115200" diff --git a/target/linux/bcm53xx/config-6.6 b/target/linux/bcm53xx/config-6.6 index cd62b0df58..9e3211801c 100644 --- a/target/linux/bcm53xx/config-6.6 +++ b/target/linux/bcm53xx/config-6.6 @@ -73,8 +73,6 @@ CONFIG_BOUNCE=y CONFIG_BROADCOM_PHY=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y CONFIG_CLKSRC_MMIO=y # CONFIG_CLK_BCM_NS2 is not set diff --git a/target/linux/bmips/bcm6318/config-6.6 b/target/linux/bmips/bcm6318/config-6.6 index 665e7f2847..ae4516cdcc 100644 --- a/target/linux/bmips/bcm6318/config-6.6 +++ b/target/linux/bmips/bcm6318/config-6.6 @@ -17,8 +17,6 @@ CONFIG_BCM7038_WDT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BMIPS_GENERIC=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y # CONFIG_CLK_BCM63268_TIMER is not set CONFIG_CLK_BCM_63XX_GATE=y @@ -86,7 +84,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CFE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/bmips/bcm63268/config-6.6 b/target/linux/bmips/bcm63268/config-6.6 index 8e060fd77c..e71c70dce9 100644 --- a/target/linux/bmips/bcm63268/config-6.6 +++ b/target/linux/bmips/bcm63268/config-6.6 @@ -17,8 +17,6 @@ CONFIG_BCM7038_WDT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BMIPS_GENERIC=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLK_BCM63268_TIMER=y CONFIG_CLK_BCM_63XX_GATE=y @@ -87,7 +85,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CFE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/bmips/bcm6328/config-6.6 b/target/linux/bmips/bcm6328/config-6.6 index 95d0ce6c9e..c069c11d9b 100644 --- a/target/linux/bmips/bcm6328/config-6.6 +++ b/target/linux/bmips/bcm6328/config-6.6 @@ -17,8 +17,6 @@ CONFIG_BCM7038_WDT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BMIPS_GENERIC=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y # CONFIG_CLK_BCM63268_TIMER is not set CONFIG_CLK_BCM_63XX_GATE=y @@ -87,7 +85,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CFE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/bmips/bcm6358/config-6.6 b/target/linux/bmips/bcm6358/config-6.6 index 8247e65e34..0b3c0dd701 100644 --- a/target/linux/bmips/bcm6358/config-6.6 +++ b/target/linux/bmips/bcm6358/config-6.6 @@ -15,8 +15,6 @@ CONFIG_BCM7038_WDT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BMIPS_GENERIC=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y # CONFIG_CLK_BCM63268_TIMER is not set CONFIG_CLK_BCM_63XX_GATE=y @@ -84,7 +82,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CFE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/bmips/bcm6362/config-6.6 b/target/linux/bmips/bcm6362/config-6.6 index c47f72c1b6..5e6a936ab1 100644 --- a/target/linux/bmips/bcm6362/config-6.6 +++ b/target/linux/bmips/bcm6362/config-6.6 @@ -17,8 +17,6 @@ CONFIG_BCM7038_WDT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BMIPS_GENERIC=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y # CONFIG_CLK_BCM63268_TIMER is not set CONFIG_CLK_BCM_63XX_GATE=y @@ -87,7 +85,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CFE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/bmips/bcm6368/config-6.6 b/target/linux/bmips/bcm6368/config-6.6 index 204b1628a4..e214d9a0f1 100644 --- a/target/linux/bmips/bcm6368/config-6.6 +++ b/target/linux/bmips/bcm6368/config-6.6 @@ -16,8 +16,6 @@ CONFIG_BCM7038_WDT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BMIPS_GENERIC=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y # CONFIG_CLK_BCM63268_TIMER is not set CONFIG_CLK_BCM_63XX_GATE=y @@ -86,7 +84,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CFE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/d1/config-6.6 b/target/linux/d1/config-6.6 index 5a5b4c3d36..7330cc0e24 100644 --- a/target/linux/d1/config-6.6 +++ b/target/linux/d1/config-6.6 @@ -22,8 +22,6 @@ CONFIG_ASSOCIATIVE_ARRAY=y CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CLZ_TAB=y diff --git a/target/linux/gemini/config-6.6 b/target/linux/gemini/config-6.6 index a93297a423..2e590540af 100644 --- a/target/linux/gemini/config-6.6 +++ b/target/linux/gemini/config-6.6 @@ -35,8 +35,6 @@ CONFIG_BOUNCE=y CONFIG_BUFFER_HEAD=y CONFIG_CACHESTAT_SYSCALL=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMA=y @@ -187,7 +185,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GEMINI_ETHERNET=y CONFIG_GENERIC_ALLOCATOR=y diff --git a/target/linux/generic/config-filter b/target/linux/generic/config-filter index e72c334ee7..274c31ecb0 100644 --- a/target/linux/generic/config-filter +++ b/target/linux/generic/config-filter @@ -3,8 +3,11 @@ # CONFIG_ARM64_CONT_.*_SHIFT is not set # CONFIG_AS_.* is not set # CONFIG_CC_(CAN|HAS|IS|VERSION)_.* is not set +# CONFIG_CC_IMPLICIT_FALLTHROUGH is not set +# CONFIG_CC_NO_ARRAY_BOUNDS is not set CONFIG_CLANG_VERSION=.* CONFIG_FRAME_WARN=.* +# CONFIG_GCC10_NO_ARRAY_BOUNDS is not set # CONFIG_GCC_VERSION is not set # CONFIG_HAVE_(?!(ARCH_TIMER|TCM|SMP)).* is not set # CONFIG_INLINE_.* is not set diff --git a/target/linux/imx/config-6.6 b/target/linux/imx/config-6.6 index 75ad42c6df..fb841686ff 100644 --- a/target/linux/imx/config-6.6 +++ b/target/linux/imx/config-6.6 @@ -44,8 +44,6 @@ CONFIG_BLK_DEV_SD=y CONFIG_BLK_PM=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_IMX_GPT=y CONFIG_CLKSRC_MMIO=y # CONFIG_CLK_IMX8MM is not set diff --git a/target/linux/ipq40xx/config-6.6 b/target/linux/ipq40xx/config-6.6 index 69c2752894..d1c181cd0d 100644 --- a/target/linux/ipq40xx/config-6.6 +++ b/target/linux/ipq40xx/config-6.6 @@ -52,8 +52,6 @@ CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE_PARTITION=y diff --git a/target/linux/ipq806x/config-6.6 b/target/linux/ipq806x/config-6.6 index af5ccb11ac..bc3761b2e5 100644 --- a/target/linux/ipq806x/config-6.6 +++ b/target/linux/ipq806x/config-6.6 @@ -57,8 +57,6 @@ CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE_OVERRIDE=y diff --git a/target/linux/ixp4xx/config-6.6 b/target/linux/ixp4xx/config-6.6 index 960012ada4..84a72c8d5c 100644 --- a/target/linux/ixp4xx/config-6.6 +++ b/target/linux/ixp4xx/config-6.6 @@ -32,8 +32,6 @@ CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BUFFER_HEAD=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y @@ -88,7 +86,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y diff --git a/target/linux/kirkwood/config-6.6 b/target/linux/kirkwood/config-6.6 index c5cfecd4e3..751d3e6a1b 100644 --- a/target/linux/kirkwood/config-6.6 +++ b/target/linux/kirkwood/config-6.6 @@ -38,8 +38,6 @@ CONFIG_BLK_MQ_PCI=y CONFIG_CACHE_FEROCEON_L2=y # CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y diff --git a/target/linux/lantiq/config-6.6 b/target/linux/lantiq/config-6.6 index 1890d82ff8..2bc5b92ce8 100644 --- a/target/linux/lantiq/config-6.6 +++ b/target/linux/lantiq/config-6.6 @@ -4,8 +4,6 @@ CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 @@ -44,7 +42,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/layerscape/armv7/config-6.6 b/target/linux/layerscape/armv7/config-6.6 index 0a244a85cd..be8eca1bf7 100644 --- a/target/linux/layerscape/armv7/config-6.6 +++ b/target/linux/layerscape/armv7/config-6.6 @@ -77,8 +77,6 @@ CONFIG_BROADCOM_PHY=y CONFIG_BUFFER_HEAD=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CDROM=y CONFIG_CHECKPOINT_RESTORE=y CONFIG_CHR_DEV_SG=y diff --git a/target/linux/layerscape/armv8_64b/config-6.6 b/target/linux/layerscape/armv8_64b/config-6.6 index 3c052edb7d..55b9d9b934 100644 --- a/target/linux/layerscape/armv8_64b/config-6.6 +++ b/target/linux/layerscape/armv8_64b/config-6.6 @@ -110,8 +110,6 @@ CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CHECKPOINT_RESTORE=y CONFIG_CHROME_PLATFORMS=y CONFIG_CLK_LS1028A_PLLDIG=y @@ -330,7 +328,6 @@ CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set CONFIG_GARP=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y diff --git a/target/linux/loongarch64/config-6.6 b/target/linux/loongarch64/config-6.6 index 5cbf1177cd..57bc7d5691 100644 --- a/target/linux/loongarch64/config-6.6 +++ b/target/linux/loongarch64/config-6.6 @@ -93,8 +93,6 @@ CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_BUFFER_HEAD=y CONFIG_BUG_ON_DATA_CORRUPTION=y CONFIG_CACHESTAT_SYSCALL=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CDROM=y CONFIG_CFS_BANDWIDTH=y CONFIG_CGROUPS=y diff --git a/target/linux/malta/config-6.6 b/target/linux/malta/config-6.6 index f6d9049f4d..a635e2c39e 100644 --- a/target/linux/malta/config-6.6 +++ b/target/linux/malta/config-6.6 @@ -21,8 +21,6 @@ CONFIG_BOARD_SCACHE=y CONFIG_BOOT_ELF32=y CONFIG_BUFFER_HEAD=y CONFIG_BUILTIN_DTB=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLKBLD_I8253=y CONFIG_CLKEVT_I8253=y diff --git a/target/linux/mediatek/filogic/config-6.6 b/target/linux/mediatek/filogic/config-6.6 index 936f1009d9..408ac5483e 100644 --- a/target/linux/mediatek/filogic/config-6.6 +++ b/target/linux/mediatek/filogic/config-6.6 @@ -56,8 +56,6 @@ CONFIG_BUFFER_HEAD=y CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE_OVERRIDE=y diff --git a/target/linux/mediatek/mt7622/config-6.6 b/target/linux/mediatek/mt7622/config-6.6 index 9440a7bb28..ec3be8df9a 100644 --- a/target/linux/mediatek/mt7622/config-6.6 +++ b/target/linux/mediatek/mt7622/config-6.6 @@ -56,8 +56,6 @@ CONFIG_BUFFER_HEAD=y CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y # CONFIG_CMDLINE_OVERRIDE is not set diff --git a/target/linux/mediatek/mt7623/config-6.6 b/target/linux/mediatek/mt7623/config-6.6 index dc31c230a2..6bc92a09dc 100644 --- a/target/linux/mediatek/mt7623/config-6.6 +++ b/target/linux/mediatek/mt7623/config-6.6 @@ -52,8 +52,6 @@ CONFIG_BOUNCE=y CONFIG_BUFFER_HEAD=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="earlyprintk console=ttyS0,115200 rootfstype=squashfs,jffs2" diff --git a/target/linux/mediatek/mt7629/config-6.6 b/target/linux/mediatek/mt7629/config-6.6 index d74e143c10..9f57bda3e9 100644 --- a/target/linux/mediatek/mt7629/config-6.6 +++ b/target/linux/mediatek/mt7629/config-6.6 @@ -37,8 +37,6 @@ CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CHR_DEV_SCH=y diff --git a/target/linux/mpc85xx/config-6.6 b/target/linux/mpc85xx/config-6.6 index c5563958a8..132917bf2b 100644 --- a/target/linux/mpc85xx/config-6.6 +++ b/target/linux/mpc85xx/config-6.6 @@ -29,8 +29,6 @@ CONFIG_BOOKE_WDT=y # CONFIG_BSC9131_RDB is not set # CONFIG_BSC9132_QDS is not set # CONFIG_C293_PCIE is not set -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLONE_BACKWARDS=y CONFIG_CLZ_TAB=y CONFIG_CMDLINE="console=ttyS0,115200" diff --git a/target/linux/mvebu/config-6.6 b/target/linux/mvebu/config-6.6 index f132884d49..bb29d80c5c 100644 --- a/target/linux/mvebu/config-6.6 +++ b/target/linux/mvebu/config-6.6 @@ -57,8 +57,6 @@ CONFIG_BOUNCE=y # CONFIG_CACHE_FEROCEON_L2 is not set CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y diff --git a/target/linux/mxs/config-6.6 b/target/linux/mxs/config-6.6 index b4bc5b3051..b954ea2548 100644 --- a/target/linux/mxs/config-6.6 +++ b/target/linux/mxs/config-6.6 @@ -32,8 +32,6 @@ CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y CONFIG_BLK_PM=y CONFIG_BUFFER_HEAD=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="console=ttyAMA0,115200 root=/dev/mmcblk0p2 rw rootwait" diff --git a/target/linux/octeon/config-6.6 b/target/linux/octeon/config-6.6 index 724361d5ea..cc2dadbe9c 100644 --- a/target/linux/octeon/config-6.6 +++ b/target/linux/octeon/config-6.6 @@ -25,8 +25,6 @@ CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY=y CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB=y CONFIG_CAVIUM_OCTEON_SOC=y CONFIG_CAVIUM_RESERVE32=0 -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLONE_BACKWARDS=y # CONFIG_COMMON_CLK is not set @@ -90,7 +88,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/omap/config-6.6 b/target/linux/omap/config-6.6 index f85a68f0aa..5f19df0d8b 100644 --- a/target/linux/omap/config-6.6 +++ b/target/linux/omap/config-6.6 @@ -66,8 +66,6 @@ CONFIG_BSD_PROCESS_ACCT=y CONFIG_BUFFER_HEAD=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEC_CORE=y # CONFIG_CHARGER_TPS65217 is not set CONFIG_CLKSRC_MMIO=y @@ -244,7 +242,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y diff --git a/target/linux/pistachio/config-6.6 b/target/linux/pistachio/config-6.6 index 80ff36ebbb..69c566a1e8 100644 --- a/target/linux/pistachio/config-6.6 +++ b/target/linux/pistachio/config-6.6 @@ -10,8 +10,6 @@ CONFIG_BLK_DEV_SD=y CONFIG_BOARD_SCACHE=y CONFIG_BUFFER_HEAD=y CONFIG_BUILTIN_DTB=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLKSRC_MIPS_GIC=y CONFIG_CLKSRC_PISTACHIO=y @@ -102,7 +100,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/qoriq/config-6.6 b/target/linux/qoriq/config-6.6 index 750e6c6551..28ece0679f 100644 --- a/target/linux/qoriq/config-6.6 +++ b/target/linux/qoriq/config-6.6 @@ -29,8 +29,6 @@ CONFIG_BOOKE=y CONFIG_BOOKE_OR_40x=y CONFIG_BOOKE_WDT=y CONFIG_BUFFER_HEAD=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLK_QORIQ=y CONFIG_CLONE_BACKWARDS=y CONFIG_CLZ_TAB=y @@ -148,7 +146,6 @@ CONFIG_FUNCTION_ERROR_INJECTION=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y diff --git a/target/linux/qualcommax/config-6.6 b/target/linux/qualcommax/config-6.6 index ac2494d749..ac5059682a 100644 --- a/target/linux/qualcommax/config-6.6 +++ b/target/linux/qualcommax/config-6.6 @@ -65,8 +65,6 @@ CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y diff --git a/target/linux/ramips/mt7620/config-6.6 b/target/linux/ramips/mt7620/config-6.6 index 2c95b9c960..edd64a642c 100644 --- a/target/linux/ramips/mt7620/config-6.6 +++ b/target/linux/ramips/mt7620/config-6.6 @@ -6,8 +6,6 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BLK_MQ_PCI=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CEVT_SYSTICK_QUIRK=y CONFIG_CLKEVT_RT3352=y @@ -60,7 +58,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/ramips/mt7621/config-6.6 b/target/linux/ramips/mt7621/config-6.6 index d1ca85aebd..7a3e68ef45 100644 --- a/target/linux/ramips/mt7621/config-6.6 +++ b/target/linux/ramips/mt7621/config-6.6 @@ -7,8 +7,6 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_AT803X_PHY=y CONFIG_BLK_MQ_PCI=y CONFIG_BOARD_SCACHE=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLKSRC_MIPS_GIC=y CONFIG_CLK_MT7621=y @@ -65,7 +63,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/ramips/mt76x8/config-6.6 b/target/linux/ramips/mt76x8/config-6.6 index bf57a7a330..31dc4a980f 100644 --- a/target/linux/ramips/mt76x8/config-6.6 +++ b/target/linux/ramips/mt76x8/config-6.6 @@ -5,8 +5,6 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BLK_MQ_PCI=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CEVT_SYSTICK_QUIRK=y CONFIG_CLKEVT_RT3352=y @@ -58,7 +56,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/ramips/rt288x/config-6.6 b/target/linux/ramips/rt288x/config-6.6 index 986bd1ef3e..0c9798b9f3 100644 --- a/target/linux/ramips/rt288x/config-6.6 +++ b/target/linux/ramips/rt288x/config-6.6 @@ -5,8 +5,6 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BLK_MQ_PCI=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLK_MTMIPS=y CONFIG_CLONE_BACKWARDS=y @@ -51,7 +49,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/ramips/rt305x/config-6.6 b/target/linux/ramips/rt305x/config-6.6 index 9b34b94cff..6f7b7ea2a1 100644 --- a/target/linux/ramips/rt305x/config-6.6 +++ b/target/linux/ramips/rt305x/config-6.6 @@ -4,8 +4,6 @@ CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CEVT_SYSTICK_QUIRK=y CONFIG_CLKEVT_RT3352=y @@ -54,7 +52,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/ramips/rt3883/config-6.6 b/target/linux/ramips/rt3883/config-6.6 index 7b3f6916ac..4b768bfb77 100644 --- a/target/linux/ramips/rt3883/config-6.6 +++ b/target/linux/ramips/rt3883/config-6.6 @@ -6,8 +6,6 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BLK_MQ_PCI=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLK_MTMIPS=y CONFIG_CLONE_BACKWARDS=y @@ -54,7 +52,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y diff --git a/target/linux/rockchip/armv8/config-6.6 b/target/linux/rockchip/armv8/config-6.6 index fddc85f9d7..56fb2f96a1 100644 --- a/target/linux/rockchip/armv8/config-6.6 +++ b/target/linux/rockchip/armv8/config-6.6 @@ -118,8 +118,6 @@ CONFIG_BUFFER_HEAD=y CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CHARGER_GPIO=y # CONFIG_CHARGER_RK817 is not set CONFIG_CLKSRC_MMIO=y @@ -259,7 +257,6 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y diff --git a/target/linux/sifiveu/config-6.6 b/target/linux/sifiveu/config-6.6 index 8ed8f766c8..595090be19 100644 --- a/target/linux/sifiveu/config-6.6 +++ b/target/linux/sifiveu/config-6.6 @@ -23,8 +23,6 @@ CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_CAVIUM_PTP=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLK_ANALOGBITS_WRPLL_CLN28HPC=y CONFIG_CLK_SIFIVE=y CONFIG_CLK_SIFIVE_PRCI=y diff --git a/target/linux/siflower/sf19a2890/config-6.6 b/target/linux/siflower/sf19a2890/config-6.6 index bec75436e0..2e15ca67d4 100644 --- a/target/linux/siflower/sf19a2890/config-6.6 +++ b/target/linux/siflower/sf19a2890/config-6.6 @@ -7,8 +7,6 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARM_AMBA=y CONFIG_BLK_DEV_LOOP=y CONFIG_BOARD_SCACHE=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CEVT_R4K=y CONFIG_CLKSRC_MIPS_GIC=y CONFIG_CLK_SF19A2890=y @@ -69,7 +67,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/target/linux/starfive/config-6.6 b/target/linux/starfive/config-6.6 index ef71001663..457fa86b9a 100644 --- a/target/linux/starfive/config-6.6 +++ b/target/linux/starfive/config-6.6 @@ -27,8 +27,6 @@ CONFIG_AUXILIARY_BUS=y # CONFIG_AX45MP_L2_CACHE is not set # CONFIG_BT_AICUSB is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CHECKPOINT_RESTORE=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_ANALOGBITS_WRPLL_CLN28HPC=y diff --git a/target/linux/tegra/config-6.6 b/target/linux/tegra/config-6.6 index 9cecf9f693..a98d81c92d 100644 --- a/target/linux/tegra/config-6.6 +++ b/target/linux/tegra/config-6.6 @@ -56,8 +56,6 @@ CONFIG_BOUNCE=y CONFIG_BUFFER_HEAD=y CONFIG_CACHE_L2X0=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CLZ_TAB=y @@ -210,7 +208,6 @@ CONFIG_FS_MBCACHE=y CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/target/linux/x86/config-6.6 b/target/linux/x86/config-6.6 index 1a68c589a5..b3d15bc104 100644 --- a/target/linux/x86/config-6.6 +++ b/target/linux/x86/config-6.6 @@ -33,8 +33,6 @@ CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y CONFIG_BUFFER_HEAD=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKBLD_I8253=y CONFIG_CLKEVT_I8253=y CONFIG_CLKSRC_I8253=y diff --git a/target/linux/zynq/config-6.6 b/target/linux/zynq/config-6.6 index 15716a12cd..69a31d254b 100644 --- a/target/linux/zynq/config-6.6 +++ b/target/linux/zynq/config-6.6 @@ -59,8 +59,6 @@ CONFIG_CACHE_L2X0=y CONFIG_CADENCE_TTC_TIMER=y CONFIG_CADENCE_WATCHDOG=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y CONFIG_CLKSRC_MMIO=y CONFIG_CLKSRC_VERSATILE=y @@ -191,7 +189,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y From 908975850dbc0aa3db25c1045f42ec12e23c06df Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Tue, 28 May 2024 02:50:09 +0300 Subject: [PATCH 062/119] dropbear: use config_get_bool enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The config_get_bool also works with on/off, yes/no, true/false. Add 'main' section name. This will make it easier to change settings from uci. Add a link to documentation. Signed-off-by: Sergey Ponomarev Link: https://github.com/openwrt/openwrt/pull/15579 Signed-off-by: Hauke Mehrtens (cherry picked from commit 4511fa4b30f73185597990ce563bbf3f96385292) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/network/services/dropbear/Makefile | 2 +- package/network/services/dropbear/files/dropbear.config | 4 +++- package/network/services/dropbear/files/dropbear.init | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index e9f3bd693c..1918e7dec6 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2024.85 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/network/services/dropbear/files/dropbear.config b/package/network/services/dropbear/files/dropbear.config index 2139ba0bbe..7eb5975449 100644 --- a/package/network/services/dropbear/files/dropbear.config +++ b/package/network/services/dropbear/files/dropbear.config @@ -1,4 +1,6 @@ -config dropbear +# See https://openwrt.org/docs/guide-user/base-system/dropbear +config dropbear main + option enable '1' option PasswordAuth 'on' option RootPasswordAuth 'on' option Port '22' diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init index 708fabd326..395237f9bc 100755 --- a/package/network/services/dropbear/files/dropbear.init +++ b/package/network/services/dropbear/files/dropbear.init @@ -361,7 +361,7 @@ dropbear_instance() load_interfaces() { local enable - config_get enable "$1" enable 1 + config_get_bool enable "$1" enable 1 [ "${enable}" = "1" ] || return 0 local direct_iface iface From 69eecbef91b831da1c2282ad71495ce3e5be8477 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 17 Nov 2024 19:22:25 +0100 Subject: [PATCH 063/119] generic: add CONFIG_FB_INTEL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONFIG_FB_INTEL is now visible on x86 since i915 driver is packaged as kmod now and it stops compilation, so add it to the generic config. Signed-off-by: Robert Marko (cherry picked from commit 57daea682e1c6e6da91f92efed717159f9ffffb0) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/generic/config-6.6 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6 index d887381414..9eec780b53 100644 --- a/target/linux/generic/config-6.6 +++ b/target/linux/generic/config-6.6 @@ -1927,6 +1927,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_FB_IBM_GXT4500 is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_IMX is not set +# CONFIG_FB_INTEL is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_LE80578 is not set # CONFIG_FB_LITTLE_ENDIAN is not set From 57ac0965cf8455c69907eb6be80cdc2695596822 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 18 Nov 2024 17:15:54 +0100 Subject: [PATCH 064/119] omnia-eeprom: depend only on subtarget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that omnia-eeprom is marked nonshared building the cortex-a9 mvebu subtarget will fail with: ERROR: unable to select packages: omnia-eeprom (no such package): required by: world[omnia-eeprom] This is because omnia-eeprom depends on TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia which will not be satisfied in buildbots since CONFIG_TARGET_ALL_PROFILES and CONFIG_TARGET_PER_DEVICE_ROOTFS are set in which case CONFIG_TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia is not set. So, lets simply depend on the mvebu/cortex-a9 subtarget. Fixes: 371e7bef4046 ("omnia-eeprom: Mark it nonshared") Link: https://github.com/openwrt/openwrt/pull/17007 Signed-off-by: Robert Marko (cherry picked from commit 90de3b277b8e1d121b2f7023578979c6b616167f) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/utils/omnia-eeprom/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/omnia-eeprom/Makefile b/package/utils/omnia-eeprom/Makefile index f9e48b28b9..9418e93f44 100644 --- a/package/utils/omnia-eeprom/Makefile +++ b/package/utils/omnia-eeprom/Makefile @@ -29,7 +29,7 @@ define Package/omnia-eeprom CATEGORY:=Utilities URL:=https://gitlab.nic.cz/turris/omnia-eeprom TITLE:=CZ.NIC Turris Omnia EEPROM accessing utility - DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia +kmod-eeprom-at24 + DEPENDS:=@TARGET_mvebu_cortexa9 +kmod-eeprom-at24 endef define Package/omnia-eeprom/description From 9a09c5444915d5a7ccfb46c46ec8399484de0fb8 Mon Sep 17 00:00:00 2001 From: He Ping Date: Tue, 19 Nov 2024 10:41:42 +0800 Subject: [PATCH 065/119] odhcp6c: update to Git HEAD (2024-09-25) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit b6ae9ffaeb0e odhcp6c: allow to request specific ipv6 prefix Signed-off-by: He Ping Link: https://github.com/openwrt/openwrt/pull/17013 Signed-off-by: Petr Štetiar [hash, commit] (cherry picked from commit b0312c10818f36bc6e61a518bb528d2809562796) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/network/ipv6/odhcp6c/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index 894f388945..c16ecfa083 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_RELEASE:=20 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2023-05-12 -PKG_SOURCE_VERSION:=bcd283632ac13391aac3ebdd074d1fd832d76fa3 -PKG_MIRROR_HASH:=0c18c578045f9251bd86a5b8fb0518b69c519e83f69907bf76583a2985482508 +PKG_SOURCE_DATE:=2024-09-25 +PKG_SOURCE_VERSION:=b6ae9ffaeb0e18e9fa3d5be62faa8d3c9f340a58 +PKG_MIRROR_HASH:=25499b6a0d403815e6b04869a02d2d5a32582348bff2bc2626559d297425a908 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 7afbe2259985d189a1e77f1d76f664a813c2ddae Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 16 Oct 2024 15:17:14 -0700 Subject: [PATCH 066/119] mpc85xx: run make kernel_oldconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjusts the default config to modern kernels. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16847 Signed-off-by: Robert Marko (cherry picked from commit 890d47b60a221328bbf05518eedc35ac5bd922f1) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/mpc85xx/config-6.6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/mpc85xx/config-6.6 b/target/linux/mpc85xx/config-6.6 index 132917bf2b..30a551e55e 100644 --- a/target/linux/mpc85xx/config-6.6 +++ b/target/linux/mpc85xx/config-6.6 @@ -40,6 +40,7 @@ CONFIG_COMPAT_32BIT_TIME=y # CONFIG_CORENET_GENERIC is not set # CONFIG_CPM2 is not set CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_MITIGATIONS=y # CONFIG_CRYPTO_AES_PPC_SPE is not set CONFIG_CRYPTO_AUTHENC=y CONFIG_CRYPTO_HW=y @@ -71,6 +72,7 @@ CONFIG_EDAC_SUPPORT=y CONFIG_EXCLUSIVE_SYSTEM_RAM=y # CONFIG_FIREBOX_T10 is not set CONFIG_FIXED_PHY=y +CONFIG_FORCE_NR_CPUS=y CONFIG_FSL_EMB_PERFMON=y # CONFIG_FSL_FMAN is not set CONFIG_FSL_LBC=y @@ -84,7 +86,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y From ac2d91329ea0c3273e9bd2d6d7bf5092f0d0c23f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 16 Oct 2024 15:42:56 -0700 Subject: [PATCH 067/119] mpc85xx: p1010: add missing symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since kernel_oldconfig doesn't work properly with it, I ran that first and then moved all the config symbols to config-6.6 and found the differences. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16847 Signed-off-by: Robert Marko (cherry picked from commit e9dd6da91661612d2330c2b633f3dd55b93218f8) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/mpc85xx/p1010/config-default | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default index 5a17e38f5c..22801b9c2b 100644 --- a/target/linux/mpc85xx/p1010/config-default +++ b/target/linux/mpc85xx/p1010/config-default @@ -1,11 +1,19 @@ CONFIG_BR200_WP=y CONFIG_CMDLINE_OVERRIDE=y +CONFIG_CRC16=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_DEFAULT_UIMAGE=y CONFIG_FIREBOX_T10=y # CONFIG_FSL_CORENET_CF is not set CONFIG_FSL_IFC=y CONFIG_GPIO_74X164=y +CONFIG_GRO_CELLS=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y CONFIG_MEMORY=y -CONFIG_MTD_CFI=y CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPLIT_TPLINK_FW=y @@ -14,6 +22,7 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_QCA8K=y @@ -27,7 +36,16 @@ CONFIG_REALTEK_PHY=y CONFIG_RED_15W_REV1=y CONFIG_REGMAP=y CONFIG_REGULATOR=y +CONFIG_SGL_ALLOC=y +CONFIG_SPI_BITBANG=y CONFIG_SPI_GPIO=y +CONFIG_SWIOTLB=y CONFIG_TL_WDR4900_V1=y CONFIG_UBIFS_FS=y CONFIG_WS_AP3715I=y +CONFIG_XXHASH=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMMON=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y From b17413117d54b9989422aafff7dbcaa398f00172 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 17 Oct 2024 16:09:17 -0700 Subject: [PATCH 068/119] mpc85xx: p1020: add missing symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since kernel_oldconfig doesn't work properly with it, I ran that first and then moved all the config symbols to config-6.6 and found the differences. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16847 Signed-off-by: Robert Marko (cherry picked from commit bec8edb6d61eb74e8d7578749560cbb5040f307a) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/mpc85xx/p1020/config-default | 29 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default index 66710a9ace..6169791007 100644 --- a/target/linux/mpc85xx/p1020/config-default +++ b/target/linux/mpc85xx/p1020/config-default @@ -1,24 +1,31 @@ -CONFIG_ARCH_HAS_TICK_BROADCAST=y CONFIG_AT803X_PHY=y CONFIG_B53=y CONFIG_B53_MDIO_DRIVER=y CONFIG_BCM_NET_PHYLIB=y CONFIG_BROADCOM_PHY=y CONFIG_CMDLINE_OVERRIDE=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_CPU_RMAP=y +CONFIG_CRC16=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_DEFAULT_UIMAGE=y CONFIG_EEPROM_LEGACY=y -# CONFIG_FSL_CORENET_CF is not set CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_TBSYNC=y CONFIG_GPIO_74X164=y # CONFIG_GPIO_MAX77620 is not set CONFIG_GRO_CELLS=y -CONFIG_HAVE_RCU_TABLE_FREE=y CONFIG_HIVEAP_330=y CONFIG_I2C_CHARDEV=y CONFIG_LEDS_LP5521=y CONFIG_LEDS_LP55XX_COMMON=y CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y # CONFIG_MAX77620_THERMAL is not set # CONFIG_MAX77620_WATCHDOG is not set CONFIG_MFD_CORE=y @@ -46,16 +53,30 @@ CONFIG_NET_SWITCHDEV=y CONFIG_NR_CPUS=2 CONFIG_PADATA=y CONFIG_PANDA=y +CONFIG_PHYLINK=y +CONFIG_PPC_ZIMAGE_LA3000000=y +CONFIG_QCOM_NET_PHYLIB=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y CONFIG_REGMAP_IRQ=y CONFIG_REGULATOR=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y -# CONFIG_RTC_DRV_MAX77686 is not set CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SGL_ALLOC=y CONFIG_SMP=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SPI_BITBANG=y CONFIG_SPI_GPIO=y CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y CONFIG_UBIFS_FS=y CONFIG_WS_AP3710I=y CONFIG_WS_AP3825I=y CONFIG_XPS=y +CONFIG_XXHASH=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMMON=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y From 77de80d9dbe3e6bf68ed5df328ca23ccf3a7f723 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 17 Oct 2024 16:14:07 -0700 Subject: [PATCH 069/119] mpc85xx: p2020: add missing symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since kernel_oldconfig doesn't work properly with it, I ran that first and then moved all the config symbols to config-6.6 and found the differences. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16847 Signed-off-by: Robert Marko (cherry picked from commit 22664498ebdd47aad9b15f62edbcaadd851fd62c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/mpc85xx/p2020/config-default | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/linux/mpc85xx/p2020/config-default b/target/linux/mpc85xx/p2020/config-default index ff8c8cb939..bfdb48959a 100644 --- a/target/linux/mpc85xx/p2020/config-default +++ b/target/linux/mpc85xx/p2020/config-default @@ -1,16 +1,16 @@ CONFIG_BLK_DEV_NVME=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_CPU_RMAP=y CONFIG_DEFAULT_UIMAGE=y CONFIG_FSL_ULI1575=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_TBSYNC=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_MAX63XX_WATCHDOG=y -CONFIG_MDIO_DEVRES=y CONFIG_MPC85xx_RDB=y CONFIG_MTD_CFI=y CONFIG_MTD_NAND_FSL_ELBC=y @@ -36,6 +36,7 @@ CONFIG_RPS=y CONFIG_RTC_DRV_DS1307=y CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SMP=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SWIOTLB=y CONFIG_TARGET_CPU="8540" CONFIG_TARGET_CPU_BOOL=y From f93bba30d7ea704e5948d4c0c79d7e2432b9e82e Mon Sep 17 00:00:00 2001 From: Mikhail Kshevetskiy Date: Fri, 15 Nov 2024 03:17:07 +0300 Subject: [PATCH 070/119] mediatek: fix pwn fan settings for sinovoip bpi-r3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Popular bpi-r3 pwm fans like this one https://www.amazon.com/youyeetoo-Barebone-Fan-BPI-R3-Integrated/dp/B0CCCTY8PS will not work properly with current openwrt-23.05/24.10 firmware. Trying different pwm setting echo $value > /sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1 I found: pwm1 value fan rotation speed cpu temperature notes ----------------------------------------------------------------- 0 maximal 31.5 Celsius too noisy 40 optimal 35.2 Celsius no noise hearable 95 minimal above 95 does not rotate 55.5 Celsius ----------------------------------------------------------------- At the moment we have following cooling levels: cooling-levels = <255 96 0>; for cpu-active-high, cpu-active-medium and cpu-active-low modes correspondingly. Thus only cpu-active-high and cpu-active-low are usable. I think this is wrong. This patch fixes cpu-active-medium settings for bpi-r3 board. PS: I know, the patch is not ideal as it can break pwm fan for some users. There are some peoples that use handmade cooling solutions, but: * discussed cooler is the only 'official' pwm cooler for bpi-r3 available on the market. * most peoples will use passive cooling available on the market or the discussed cooler. * the pwm-fan dts section was added before the official cooler appears on the market. Thus it should not be a lot of harm from this fix. Signed-off-by: Mikhail Kshevetskiy Link: https://github.com/openwrt/openwrt/pull/16974 Signed-off-by: Robert Marko (cherry picked from commit 3467ea905b40f0df87700a15b716b1f5a4efc955) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- ...96-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch diff --git a/target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch b/target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch new file mode 100644 index 0000000000..267c654f35 --- /dev/null +++ b/target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch @@ -0,0 +1,11 @@ +--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +@@ -46,7 +46,7 @@ + compatible = "pwm-fan"; + #cooling-cells = <2>; + /* cooling level (0, 1, 2) - pwm inverted */ +- cooling-levels = <255 96 0>; ++ cooling-levels = <255 40 0>; + pwms = <&pwm 0 10000>; + status = "okay"; + }; From 7a945bf88b99f304a7214e3036aeb52d8bc3cfee Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 21 Nov 2024 22:04:41 +0100 Subject: [PATCH 071/119] Revert "mediatek: fix pwn fan settings for sinovoip bpi-r3" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3467ea905b40f0df87700a15b716b1f5a4efc955. I merged it by accident. Signed-off-by: Robert Marko (cherry picked from commit 52b6c9247997e51a97f13bb9e94749bc34e2d52e) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- ...96-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch diff --git a/target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch b/target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch deleted file mode 100644 index 267c654f35..0000000000 --- a/target/linux/mediatek/patches-5.15/196-dts-mt7986a-bpi-r3-pwm-fan-cooling-levels.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts -+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts -@@ -46,7 +46,7 @@ - compatible = "pwm-fan"; - #cooling-cells = <2>; - /* cooling level (0, 1, 2) - pwm inverted */ -- cooling-levels = <255 96 0>; -+ cooling-levels = <255 40 0>; - pwms = <&pwm 0 10000>; - status = "okay"; - }; From 2d3ad3553740f63d4fdee211a1ab4c3e22a9291b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Fri, 22 Nov 2024 18:12:12 +0800 Subject: [PATCH 072/119] ramips: sync upstream Ralink clock patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add sdhc clock for MT7620 and MT76x8 SoCs. 2. Fix clock driver warning for RT2880, RT305x and RT3883. Link: https://lore.kernel.org/all/20240910044024.120009-1-sergio.paracuellos@gmail.com/ Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17037 Signed-off-by: Hauke Mehrtens (cherry picked from commit 7bb99bca3dfd878e6ad950b218c0cb96d36d14f4) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/dts/mt7620a.dtsi | 27 ++-- target/linux/ramips/dts/mt7620n.dtsi | 14 +- target/linux/ramips/dts/mt7628an.dtsi | 23 ++-- target/linux/ramips/dts/rt3883.dtsi | 20 +-- ...-fix-clock-plan-for-Ralink-SoC-RT38.patch} | 15 ++- ...s-fix-clocks-probe-order-in-oldest-r.patch | 124 ++++++++++++++++++ ...s-add-mmc-related-clocks-for-SoCs-MT.patch | 101 ++++++++++++++ 7 files changed, 269 insertions(+), 55 deletions(-) rename target/linux/ramips/patches-6.6/{100-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT3883.patch => 002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch} (75%) create mode 100644 target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch create mode 100644 target/linux/ramips/patches-6.6/002-03-v6.13-clk-ralink-mtmips-add-mmc-related-clocks-for-SoCs-MT.patch diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi index bcc7f4be3f..93b4286193 100644 --- a/target/linux/ramips/dts/mt7620a.dtsi +++ b/target/linux/ramips/dts/mt7620a.dtsi @@ -32,13 +32,6 @@ compatible = "mti,cpu-interrupt-controller"; }; - mmc_clk: mmc-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <48000000>; - clock-accuracy = <100>; - }; - mmc_reg_1v8: regulator-1v8 { compatible = "regulator-fixed"; @@ -80,7 +73,7 @@ compatible = "ralink,rt2880-timer"; reg = <0x100 0x20>; - clocks = <&sysc 5>; + clocks = <&sysc 7>; interrupt-parent = <&intc>; interrupts = <1>; @@ -90,7 +83,7 @@ compatible = "ralink,rt2880-wdt"; reg = <0x120 0x10>; - clocks = <&sysc 6>; + clocks = <&sysc 8>; resets = <&sysc 8>; reset-names = "wdt"; @@ -122,7 +115,7 @@ compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; reg = <0x500 0x100>; - clocks = <&sysc 7>; + clocks = <&sysc 9>; resets = <&sysc 12>; @@ -216,7 +209,7 @@ compatible = "ralink,rt2880-i2c"; reg = <0x900 0x100>; - clocks = <&sysc 8>; + clocks = <&sysc 10>; resets = <&sysc 16>; reset-names = "i2c"; @@ -234,7 +227,7 @@ compatible = "mediatek,mt7620-i2s"; reg = <0xa00 0x100>; - clocks = <&sysc 9>; + clocks = <&sysc 11>; resets = <&sysc 17>; reset-names = "i2s"; @@ -256,7 +249,7 @@ compatible = "ralink,rt2880-spi"; reg = <0xb00 0x40>; - clocks = <&sysc 10>; + clocks = <&sysc 12>; resets = <&sysc 18>; reset-names = "spi"; @@ -274,7 +267,7 @@ compatible = "ralink,rt2880-spi"; reg = <0xb40 0x60>; - clocks = <&sysc 11>; + clocks = <&sysc 13>; resets = <&sysc 18>; reset-names = "spi"; @@ -292,7 +285,7 @@ compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; reg = <0xc00 0x100>; - clocks = <&sysc 12>; + clocks = <&sysc 14>; resets = <&sysc 19>; @@ -539,7 +532,7 @@ cap-mmc-highspeed; cap-sd-highspeed; - clocks = <&mmc_clk>, <&mmc_clk>; + clocks = <&sysc 15>, <&sysc 15>; clock-names = "source", "hclk"; disable-wp; @@ -645,7 +638,7 @@ compatible = "ralink,rt7620-wmac", "ralink,rt2880-wmac"; reg = <0x10180000 0x40000>; - clocks = <&sysc 13>; + clocks = <&sysc 16>; interrupt-parent = <&cpuintc>; interrupts = <6>; diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi index b284119961..64dbd0a50e 100644 --- a/target/linux/ramips/dts/mt7620n.dtsi +++ b/target/linux/ramips/dts/mt7620n.dtsi @@ -51,7 +51,7 @@ compatible = "ralink,rt2880-timer"; reg = <0x100 0x20>; - clocks = <&sysc 5>; + clocks = <&sysc 7>; interrupt-parent = <&intc>; interrupts = <1>; @@ -61,7 +61,7 @@ compatible = "ralink,rt2880-wdt"; reg = <0x120 0x10>; - clocks = <&sysc 6>; + clocks = <&sysc 8>; resets = <&sysc 8>; reset-names = "wdt"; @@ -171,7 +171,7 @@ compatible = "ralink,rt2880-i2c"; reg = <0x900 0x100>; - clocks = <&sysc 8>; + clocks = <&sysc 10>; resets = <&sysc 16>; reset-names = "i2c"; @@ -189,7 +189,7 @@ compatible = "ralink,rt2880-spi"; reg = <0xb00 0x40>; - clocks = <&sysc 10>; + clocks = <&sysc 12>; resets = <&sysc 18>; reset-names = "spi"; @@ -207,7 +207,7 @@ compatible = "ralink,rt2880-spi"; reg = <0xb40 0x60>; - clocks = <&sysc 11>; + clocks = <&sysc 13>; resets = <&sysc 18>; reset-names = "spi"; @@ -225,7 +225,7 @@ compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; reg = <0xc00 0x100>; - clocks = <&sysc 12>; + clocks = <&sysc 14>; resets = <&sysc 19>; @@ -372,7 +372,7 @@ compatible = "ralink,rt7620-wmac", "ralink,rt2880-wmac"; reg = <0x10180000 0x40000>; - clocks = <&sysc 13>; + clocks = <&sysc 16>; interrupt-parent = <&cpuintc>; interrupts = <6>; diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi index 445c530815..239211b1e1 100644 --- a/target/linux/ramips/dts/mt7628an.dtsi +++ b/target/linux/ramips/dts/mt7628an.dtsi @@ -30,13 +30,6 @@ compatible = "mti,cpu-interrupt-controller"; }; - mmc_clk: mmc-clock { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <48000000>; - clock-accuracy = <100>; - }; - mmc_reg_1v8: regulator-1v8 { compatible = "regulator-fixed"; @@ -121,7 +114,7 @@ compatible = "mediatek,mt7621-i2c"; reg = <0x900 0x100>; - clocks = <&sysc 7>; + clocks = <&sysc 9>; clock-names = "i2c"; resets = <&sysc 16>; @@ -140,7 +133,7 @@ compatible = "mediatek,mt7628-i2s"; reg = <0xa00 0x100>; - clocks = <&sysc 8>; + clocks = <&sysc 10>; resets = <&sysc 17>; reset-names = "i2s"; @@ -162,7 +155,7 @@ compatible = "ralink,mt7621-spi"; reg = <0xb00 0x100>; - clocks = <&sysc 9>; + clocks = <&sysc 11>; clock-names = "spi"; resets = <&sysc 18>; @@ -185,7 +178,7 @@ reg-io-width = <4>; no-loopback-test; - clocks = <&sysc 11>; + clocks = <&sysc 13>; resets = <&sysc 12>; @@ -204,7 +197,7 @@ reg-io-width = <4>; no-loopback-test; - clocks = <&sysc 12>; + clocks = <&sysc 14>; resets = <&sysc 19>; @@ -225,7 +218,7 @@ reg-io-width = <4>; no-loopback-test; - clocks = <&sysc 13>; + clocks = <&sysc 15>; resets = <&sysc 20>; @@ -393,7 +386,7 @@ cap-mmc-highspeed; cap-sd-highspeed; - clocks = <&mmc_clk>, <&mmc_clk>; + clocks = <&sysc 16>, <&sysc 16>; clock-names = "source", "hclk"; disable-wp; @@ -516,7 +509,7 @@ compatible = "mediatek,mt7628-wmac"; reg = <0x10300000 0x100000>; - clocks = <&sysc 14>; + clocks = <&sysc 17>; interrupt-parent = <&cpuintc>; interrupts = <6>; diff --git a/target/linux/ramips/dts/rt3883.dtsi b/target/linux/ramips/dts/rt3883.dtsi index 509d1c21e8..363b1959b6 100644 --- a/target/linux/ramips/dts/rt3883.dtsi +++ b/target/linux/ramips/dts/rt3883.dtsi @@ -51,7 +51,7 @@ compatible = "ralink,rt2880-timer"; reg = <0x100 0x20>; - clocks = <&sysc 4>; + clocks = <&sysc 5>; interrupt-parent = <&intc>; interrupts = <1>; @@ -61,7 +61,7 @@ compatible = "ralink,rt2880-wdt"; reg = <0x120 0x10>; - clocks = <&sysc 5>; + clocks = <&sysc 6>; resets = <&sysc 8>; reset-names = "wdt"; @@ -93,7 +93,7 @@ compatible = "ralink,rt3883-uart", "ralink,rt2880-uart", "ns16550a"; reg = <0x500 0x100>; - clocks = <&sysc 6>; + clocks = <&sysc 7>; resets = <&sysc 12>; @@ -187,7 +187,7 @@ compatible = "ralink,rt2880-i2c"; reg = <0x900 0x100>; - clocks = <&sysc 7>; + clocks = <&sysc 8>; resets = <&sysc 16>; reset-names = "i2c"; @@ -205,7 +205,7 @@ compatible = "ralink,rt3883-i2s"; reg = <0xa00 0x100>; - clocks = <&sysc 8>; + clocks = <&sysc 9>; resets = <&sysc 17>; reset-names = "i2s"; @@ -229,7 +229,7 @@ #address-cells = <1>; #size-cells = <0>; - clocks = <&sysc 9>; + clocks = <&sysc 10>; resets = <&sysc 18>; reset-names = "spi"; @@ -246,7 +246,7 @@ #address-cells = <1>; #size-cells = <0>; - clocks = <&sysc 10>; + clocks = <&sysc 11>; resets = <&sysc 18>; reset-names = "spi"; @@ -261,7 +261,7 @@ compatible = "ralink,rt3883-uart", "ralink,rt2880-uart", "ns16550a"; reg = <0xc00 0x100>; - clocks = <&sysc 11>; + clocks = <&sysc 12>; resets = <&sysc 19>; @@ -343,7 +343,7 @@ #size-cells = <0>; reg = <0x10100000 0x10000>; - clocks = <&sysc 12>; + clocks = <&sysc 13>; resets = <&sysc 21>; reset-names = "fe"; @@ -463,7 +463,7 @@ compatible = "ralink,rt3883-wmac", "ralink,rt2880-wmac"; reg = <0x10180000 0x40000>; - clocks = <&sysc 13>; + clocks = <&sysc 14>; interrupt-parent = <&cpuintc>; interrupts = <6>; diff --git a/target/linux/ramips/patches-6.6/100-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT3883.patch b/target/linux/ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch similarity index 75% rename from target/linux/ramips/patches-6.6/100-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT3883.patch rename to target/linux/ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch index a3d58b78f6..422b6dcfb0 100644 --- a/target/linux/ramips/patches-6.6/100-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT3883.patch +++ b/target/linux/ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch @@ -1,6 +1,7 @@ -Subject: [PATCH] clk: ralink: mtmips: fix clock plan for Ralink SoC RT3883 -Date: Tue, 6 Aug 2024 16:29:02 +0200 -Message-Id: <20240806142902.224164-1-sergio.paracuellos@gmail.com> +From 33239152305567b3e9bf052f71fd4baecd626341 Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Tue, 10 Sep 2024 06:40:22 +0200 +Subject: [PATCH 1/3] clk: ralink: mtmips: fix clock plan for Ralink SoC RT3883 Clock plan for Ralink SoC RT3883 needs an extra 'periph' clock to properly set some peripherals that has this clock as their parent. When this driver @@ -14,6 +15,8 @@ properly working clock plan for this SoC. Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for MTMIPS SoCs") Signed-off-by: Sergio Paracuellos +Link: https://lore.kernel.org/r/20240910044024.120009-2-sergio.paracuellos@gmail.com +Signed-off-by: Stephen Boyd --- drivers/clk/ralink/clk-mtmips.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) @@ -24,7 +27,7 @@ Signed-off-by: Sergio Paracuellos CLK_FIXED("xtal", NULL, 40000000) }; -+static struct mtmips_clk_fixed rt3383_fixed_clocks[] = { ++static struct mtmips_clk_fixed rt3883_fixed_clocks[] = { + CLK_FIXED("xtal", NULL, 40000000), + CLK_FIXED("periph", "xtal", 40000000) +}; @@ -38,8 +41,8 @@ Signed-off-by: Sergio Paracuellos .num_clk_base = ARRAY_SIZE(rt3883_clks_base), - .clk_fixed = rt305x_fixed_clocks, - .num_clk_fixed = ARRAY_SIZE(rt305x_fixed_clocks), -+ .clk_fixed = rt3383_fixed_clocks, -+ .num_clk_fixed = ARRAY_SIZE(rt3383_fixed_clocks), ++ .clk_fixed = rt3883_fixed_clocks, ++ .num_clk_fixed = ARRAY_SIZE(rt3883_fixed_clocks), .clk_factor = NULL, .num_clk_factor = 0, .clk_periph = rt5350_pherip_clks, diff --git a/target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch b/target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch new file mode 100644 index 0000000000..3268a18dac --- /dev/null +++ b/target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch @@ -0,0 +1,124 @@ +From d34db686a3d74bd564bfce2ada15011c556269fc Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Tue, 10 Sep 2024 06:40:23 +0200 +Subject: [PATCH 2/3] clk: ralink: mtmips: fix clocks probe order in oldest + ralink SoCs + +Base clocks are the first in being probed and are real dependencies of the +rest of fixed, factor and peripheral clocks. For old ralink SoCs RT2880, +RT305x and RT3883 'xtal' must be defined first since in any other case, +when fixed clocks are probed they are delayed until 'xtal' is probed so the +following warning appears: + + WARNING: CPU: 0 PID: 0 at drivers/clk/ralink/clk-mtmips.c:499 rt3883_bus_recalc_rate+0x98/0x138 + Modules linked in: + CPU: 0 PID: 0 Comm: swapper Not tainted 6.6.43 #0 + Stack : 805e58d0 00000000 00000004 8004f950 00000000 00000004 00000000 00000000 + 80669c54 80830000 80700000 805ae570 80670068 00000001 80669bf8 00000000 + 00000000 00000000 805ae570 80669b38 00000020 804db7dc 00000000 00000000 + 203a6d6d 80669b78 80669e48 70617773 00000000 805ae570 00000000 00000009 + 00000000 00000001 00000004 00000001 00000000 00000000 83fe43b0 00000000 + ... + Call Trace: + [<800065d0>] show_stack+0x64/0xf4 + [<804bca14>] dump_stack_lvl+0x38/0x60 + [<800218ac>] __warn+0x94/0xe4 + [<8002195c>] warn_slowpath_fmt+0x60/0x94 + [<80259ff8>] rt3883_bus_recalc_rate+0x98/0x138 + [<80254530>] __clk_register+0x568/0x688 + [<80254838>] of_clk_hw_register+0x18/0x2c + [<8070b910>] rt2880_clk_of_clk_init_driver+0x18c/0x594 + [<8070b628>] of_clk_init+0x1c0/0x23c + [<806fc448>] plat_time_init+0x58/0x18c + [<806fdaf0>] time_init+0x10/0x6c + [<806f9bc4>] start_kernel+0x458/0x67c + + ---[ end trace 0000000000000000 ]--- + +When this driver was mainlined we could not find any active users of old +ralink SoCs so we cannot perform any real tests for them. Now, one user +of a Belkin f9k1109 version 1 device which uses RT3883 SoC appeared and +reported some issues in openWRT: +- https://github.com/openwrt/openwrt/issues/16054 + +Thus, define a 'rt2880_xtal_recalc_rate()' just returning the expected +frequency 40Mhz and use it along the old ralink SoCs to have a correct +boot trace with no warnings and a working clock plan from the beggining. + +Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for MTMIPS SoCs") +Signed-off-by: Sergio Paracuellos +Link: https://lore.kernel.org/r/20240910044024.120009-3-sergio.paracuellos@gmail.com +Signed-off-by: Stephen Boyd +--- + drivers/clk/ralink/clk-mtmips.c | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +--- a/drivers/clk/ralink/clk-mtmips.c ++++ b/drivers/clk/ralink/clk-mtmips.c +@@ -263,10 +263,6 @@ err_clk_unreg: + .rate = _rate \ + } + +-static struct mtmips_clk_fixed rt305x_fixed_clocks[] = { +- CLK_FIXED("xtal", NULL, 40000000) +-}; +- + static struct mtmips_clk_fixed rt3883_fixed_clocks[] = { + CLK_FIXED("xtal", NULL, 40000000), + CLK_FIXED("periph", "xtal", 40000000) +@@ -371,6 +367,12 @@ static inline struct mtmips_clk *to_mtmi + return container_of(hw, struct mtmips_clk, hw); + } + ++static unsigned long rt2880_xtal_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ return 40000000; ++} ++ + static unsigned long rt5350_xtal_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) + { +@@ -682,10 +684,12 @@ static unsigned long mt76x8_cpu_recalc_r + } + + static struct mtmips_clk rt2880_clks_base[] = { ++ { CLK_BASE("xtal", NULL, rt2880_xtal_recalc_rate) }, + { CLK_BASE("cpu", "xtal", rt2880_cpu_recalc_rate) } + }; + + static struct mtmips_clk rt305x_clks_base[] = { ++ { CLK_BASE("xtal", NULL, rt2880_xtal_recalc_rate) }, + { CLK_BASE("cpu", "xtal", rt305x_cpu_recalc_rate) } + }; + +@@ -695,6 +699,7 @@ static struct mtmips_clk rt3352_clks_bas + }; + + static struct mtmips_clk rt3883_clks_base[] = { ++ { CLK_BASE("xtal", NULL, rt2880_xtal_recalc_rate) }, + { CLK_BASE("cpu", "xtal", rt3883_cpu_recalc_rate) }, + { CLK_BASE("bus", "cpu", rt3883_bus_recalc_rate) } + }; +@@ -751,8 +756,8 @@ err_clk_unreg: + static const struct mtmips_clk_data rt2880_clk_data = { + .clk_base = rt2880_clks_base, + .num_clk_base = ARRAY_SIZE(rt2880_clks_base), +- .clk_fixed = rt305x_fixed_clocks, +- .num_clk_fixed = ARRAY_SIZE(rt305x_fixed_clocks), ++ .clk_fixed = NULL, ++ .num_clk_fixed = 0, + .clk_factor = rt2880_factor_clocks, + .num_clk_factor = ARRAY_SIZE(rt2880_factor_clocks), + .clk_periph = rt2880_pherip_clks, +@@ -762,8 +767,8 @@ static const struct mtmips_clk_data rt28 + static const struct mtmips_clk_data rt305x_clk_data = { + .clk_base = rt305x_clks_base, + .num_clk_base = ARRAY_SIZE(rt305x_clks_base), +- .clk_fixed = rt305x_fixed_clocks, +- .num_clk_fixed = ARRAY_SIZE(rt305x_fixed_clocks), ++ .clk_fixed = NULL, ++ .num_clk_fixed = 0, + .clk_factor = rt305x_factor_clocks, + .num_clk_factor = ARRAY_SIZE(rt305x_factor_clocks), + .clk_periph = rt305x_pherip_clks, diff --git a/target/linux/ramips/patches-6.6/002-03-v6.13-clk-ralink-mtmips-add-mmc-related-clocks-for-SoCs-MT.patch b/target/linux/ramips/patches-6.6/002-03-v6.13-clk-ralink-mtmips-add-mmc-related-clocks-for-SoCs-MT.patch new file mode 100644 index 0000000000..b90a19b7ca --- /dev/null +++ b/target/linux/ramips/patches-6.6/002-03-v6.13-clk-ralink-mtmips-add-mmc-related-clocks-for-SoCs-MT.patch @@ -0,0 +1,101 @@ +From 198675bbc03d437fb80a35d781ad13d622d0ff68 Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Tue, 10 Sep 2024 06:40:24 +0200 +Subject: [PATCH 3/3] clk: ralink: mtmips: add mmc related clocks for SoCs + MT7620, MT7628 and MT7688 + +Original architecture clock code from where this driver was derived did not +include nothing related to mmc clocks. OpenWRT people started to use mtk-sd +upstream driver recently and they were forced to use a dts 'fixed-clock' +node with 48 MHz clock: +- https://github.com/openwrt/openwrt/pull/15896 +The proper thing to do to avoid that is to add the mmc related clocks to the +driver to avoid a dts with fixed clocks nodes. The minimal documentation in +the mt7620 programming guide says that there is a BBP_PLL clock of 480 MHz +derived from the 40 MHz XTAL and from there a clock divider by ten produces +the desired SDHC clock of 48 MHz for the mmc. Hence add a fixed clock 'bbppll' +and factor clock 'sdhc' ten divider child to properly set the 'mmc' peripheral +clock with the desired 48 Mhz rate. + +Signed-off-by: Sergio Paracuellos +Link: https://lore.kernel.org/r/20240910044024.120009-4-sergio.paracuellos@gmail.com +Signed-off-by: Stephen Boyd +--- + drivers/clk/ralink/clk-mtmips.c | 30 +++++++++++++++++++++++------- + 1 file changed, 23 insertions(+), 7 deletions(-) + +--- a/drivers/clk/ralink/clk-mtmips.c ++++ b/drivers/clk/ralink/clk-mtmips.c +@@ -207,6 +207,7 @@ static struct mtmips_clk mt7620_pherip_c + { CLK_PERIPH("10000b00.spi", "bus") }, + { CLK_PERIPH("10000b40.spi", "bus") }, + { CLK_PERIPH("10000c00.uartlite", "periph") }, ++ { CLK_PERIPH("10130000.mmc", "sdhc") }, + { CLK_PERIPH("10180000.wmac", "xtal") } + }; + +@@ -220,6 +221,7 @@ static struct mtmips_clk mt76x8_pherip_c + { CLK_PERIPH("10000c00.uart0", "periph") }, + { CLK_PERIPH("10000d00.uart1", "periph") }, + { CLK_PERIPH("10000e00.uart2", "periph") }, ++ { CLK_PERIPH("10130000.mmc", "sdhc") }, + { CLK_PERIPH("10300000.wmac", "xtal") } + }; + +@@ -272,8 +274,13 @@ static struct mtmips_clk_fixed rt3352_fi + CLK_FIXED("periph", "xtal", 40000000) + }; + ++static struct mtmips_clk_fixed mt7620_fixed_clocks[] = { ++ CLK_FIXED("bbppll", "xtal", 480000000) ++}; ++ + static struct mtmips_clk_fixed mt76x8_fixed_clocks[] = { +- CLK_FIXED("pcmi2s", "xtal", 480000000), ++ CLK_FIXED("bbppll", "xtal", 480000000), ++ CLK_FIXED("pcmi2s", "bbppll", 480000000), + CLK_FIXED("periph", "xtal", 40000000) + }; + +@@ -328,6 +335,15 @@ static struct mtmips_clk_factor rt305x_f + CLK_FACTOR("bus", "cpu", 1, 3) + }; + ++static struct mtmips_clk_factor mt7620_factor_clocks[] = { ++ CLK_FACTOR("sdhc", "bbppll", 1, 10) ++}; ++ ++static struct mtmips_clk_factor mt76x8_factor_clocks[] = { ++ CLK_FACTOR("bus", "cpu", 1, 3), ++ CLK_FACTOR("sdhc", "bbppll", 1, 10) ++}; ++ + static int mtmips_register_factor_clocks(struct clk_hw_onecell_data *clk_data, + struct mtmips_clk_priv *priv) + { +@@ -811,10 +827,10 @@ static const struct mtmips_clk_data rt53 + static const struct mtmips_clk_data mt7620_clk_data = { + .clk_base = mt7620_clks_base, + .num_clk_base = ARRAY_SIZE(mt7620_clks_base), +- .clk_fixed = NULL, +- .num_clk_fixed = 0, +- .clk_factor = NULL, +- .num_clk_factor = 0, ++ .clk_fixed = mt7620_fixed_clocks, ++ .num_clk_fixed = ARRAY_SIZE(mt7620_fixed_clocks), ++ .clk_factor = mt7620_factor_clocks, ++ .num_clk_factor = ARRAY_SIZE(mt7620_factor_clocks), + .clk_periph = mt7620_pherip_clks, + .num_clk_periph = ARRAY_SIZE(mt7620_pherip_clks), + }; +@@ -824,8 +840,8 @@ static const struct mtmips_clk_data mt76 + .num_clk_base = ARRAY_SIZE(mt76x8_clks_base), + .clk_fixed = mt76x8_fixed_clocks, + .num_clk_fixed = ARRAY_SIZE(mt76x8_fixed_clocks), +- .clk_factor = rt305x_factor_clocks, +- .num_clk_factor = ARRAY_SIZE(rt305x_factor_clocks), ++ .clk_factor = mt76x8_factor_clocks, ++ .num_clk_factor = ARRAY_SIZE(mt76x8_factor_clocks), + .clk_periph = mt76x8_pherip_clks, + .num_clk_periph = ARRAY_SIZE(mt76x8_pherip_clks), + }; From 8eb07120a24b372f3a3be90fca58893eceeecfbe Mon Sep 17 00:00:00 2001 From: Til Kaiser Date: Fri, 15 Nov 2024 16:49:14 +0100 Subject: [PATCH 073/119] x86: add all ports to the Gowin 1U default network config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit e52c57bb1b30375e0bcc5523db76a672a4a8b4a4 renamed all network ports to match the faceplate of the Gowin 1U Rack Mount Server and added the br-lan bridge for the eth* ports. This commit adds the PoE port to the br-lan bridge and a br-wan bridge for the two SFP ports so that all ports are part of the default network configuration. Signed-off-by: Til Kaiser Link: https://github.com/openwrt/openwrt/pull/16965 Signed-off-by: Hauke Mehrtens (cherry picked from commit 75af6a0d736a696ca726cb44d813791858c29f0c) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/x86/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network index dc744db05d..b3d1855764 100644 --- a/target/linux/x86/base-files/etc/board.d/02_network +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -58,7 +58,7 @@ gowin-solution-co-ltd-gw-mb-u01) ucidef_set_network_device_path_port "sfp2" "$sfp_device/$sfp_port" "0" fi - ucidef_set_interface_lan "eth1 eth2 eth3 eth4" + ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 poe" "sfp1 sfp2" ;; pc-engines-apu1|pc-engines-apu2|pc-engines-apu3) ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" From fb4088cdecb6a9e6413ba50ea81e594e2403c430 Mon Sep 17 00:00:00 2001 From: Romanov Danila Date: Mon, 21 Oct 2024 21:34:34 +0300 Subject: [PATCH 074/119] mediatek: change Routerich AX3000 ubi size All new routers are shipped with ubi size 112MB since early September. Bootloader update required (ask vendor , see wiki) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These partitions weren't used: firmware_backup zrsave config2 Signed-off-by: Romanov Danila Link: https://github.com/openwrt/openwrt/pull/16686 Signed-off-by: Hauke Mehrtens (cherry picked from commit d8a9669093359d60f4d6f183b58a22f24cf01731) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../mediatek/dts/mt7981b-routerich-ax3000.dts | 20 +------------------ .../base-files/etc/board.d/05_compat-version | 3 +++ target/linux/mediatek/image/filogic.mk | 5 +++++ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts b/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts index dfe44843b9..aa6a15ee1d 100644 --- a/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts +++ b/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts @@ -226,25 +226,7 @@ partition@580000 { label = "ubi"; - reg = <0x580000 0x4000000>; - }; - - partition@4580000 { - label = "firmware_backup"; - reg = <0x4580000 0x2000000>; - read-only; - }; - - partition@6580000 { - label = "zrsave"; - reg = <0x6580000 0x100000>; - read-only; - }; - - partition@6680000 { - label = "config2"; - reg = <0x6680000 0x100000>; - read-only; + reg = <0x580000 0x7000000>; }; }; }; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version index d0cfd8f0a1..9b704b983c 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version @@ -8,6 +8,9 @@ case "$(board_name)" in bananapi,bpi-r3) ucidef_set_compat_version "1.2" ;; + routerich,ax3000) + ucidef_set_compat_version "1.1" + ;; esac board_config_flush diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 739fd54308..cb5c102b1e 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1173,6 +1173,11 @@ define Device/routerich_ax3000 DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Partition layout has been changed. Bootloader MUST be \ + upgraded to avoid data corruption and getting bricked. \ + Please, contact your vendor and follow the guide: \ + https://openwrt.org/toh/routerich/ax3000#web_ui_method endef TARGET_DEVICES += routerich_ax3000 From 480aed0c729f063e089e186b728fcbd0c69138d7 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 26 Sep 2024 16:10:26 +0200 Subject: [PATCH 075/119] build: add generic build template for optee-os packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a generic template include/optee-os.mk to build OP-TEE. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit dedb90e8f82a179ad67b6eac3b6f8862b9183077) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- include/optee-os.mk | 113 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 include/optee-os.mk diff --git a/include/optee-os.mk b/include/optee-os.mk new file mode 100644 index 0000000000..396d2406bf --- /dev/null +++ b/include/optee-os.mk @@ -0,0 +1,113 @@ +include $(INCLUDE_DIR)/prereq.mk + +PKG_NAME ?= optee-os + +ifndef PKG_SOURCE_PROTO +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL_FILE:=$(PKG_VERSION).tar.gz +PKG_SOURCE_URL = https://github.com/OP-TEE/optee_os/archive/refs/tags/ +TAR_OPTIONS+= --transform 's/optee_os/$(PKG_NAME)/' +endif + +PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_TARGETS := bin +PKG_FLAGS:=nonshared + +PKG_LICENSE:=BSD 2-Clause +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_PARALLEL ?= 1 + +$(eval $(call TestHostCommand,python3-cryptography, \ + Please install the Python3 cryptography module, \ + $(STAGING_DIR_HOST)/bin/python3 -c 'import cryptography')) + +$(eval $(call TestHostCommand,python3-pyelftools, \ + Please install the Python3 pyelftools module, \ + $(STAGING_DIR_HOST)/bin/python3 -c 'import elftools')) + +export GCC_HONOUR_COPTS=s + +define Package/optee-os/install/default + $(CP) $(patsubst %,$(PKG_BUILD_DIR)/out/arm-plat-$(PLAT)/core/%,$(OPTEE_IMAGE)) $(1)/ +endef + +Package/optee-os/install = $(Package/optee-os/install/default) + +define Optee-os/Init + BUILD_TARGET:= + BUILD_SUBTARGET:= + BUILD_DEVICES:= + NAME:= + DEPENDS:= + HIDDEN:= + DEFAULT:= + VARIANT:=$(1) + PLAT:=$(1) + PLAT_FLAVOR:= + OPTEE_IMAGE:=tee-header_v2.bin tee-pager_v2.bin tee-pageable_v2.bin +endef + +TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET)) + +define Build/Optee-os/Target + $(eval $(call Optee-os/Init,$(1))) + $(eval $(call Optee-os/Default,$(1))) + $(eval $(call Optee-os/$(1),$(1))) + + define Package/optee-os-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=OPTEE-OS for $(NAME) + VARIANT:=$(VARIANT) + DEPENDS:=@!IN_SDK $(DEPENDS) + HIDDEN:=$(HIDDEN) + ifneq ($(BUILD_TARGET),) + DEPENDS += @$(TARGET_DEP) + ifneq ($(BUILD_DEVICES),) + DEFAULT := y if ($(TARGET_DEP)_Default \ + $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \ + $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%,$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES))) + endif + endif + $(if $(DEFAULT),DEFAULT:=$(DEFAULT)) + URL:=https://optee.readthedocs.io + endef + + define Package/optee-os-$(1)/install + $$(Package/optee-os/install) + endef +endef + +define Build/Configure/Optee-os +endef + +define Build/Compile/Optee-os + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + PATH=$(LINUX_DIR)/scripts/dtc/:$(PATH) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + CROSS_COMPILE_core="$(TARGET_CROSS)" \ + CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)" \ + CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)" \ + $(if $(CONFIG_ARCH_64BIT), CFG_ARM64_core=y CFG_USER_TA_TARGETS=ta_arm64, CFG_ARM32_core=y) \ + PLATFORM="$(PLAT)" \ + PLATFORM_FLAVOR="$(call qstrip,$(PLAT_FLAVOR))" \ + $(OPTEE_MAKE_FLAGS) +endef + +define BuildPackage/Optee-os/Defaults + Build/Configure/Default = $$$$(Build/Configure/Optee-os) + Build/Compile/Default = $$$$(Build/Compile/Optee-os) +endef + +define BuildPackage/Optee-os + $(eval $(call BuildPackage/Optee-os/Defaults)) + $(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \ + $(eval $(call Build/Optee-os/Target,$(type))) + ) + $(eval $(call Build/DefaultTargets)) + $(foreach type,$(if $(DUMP),$(OPTEE_TARGETS),$(BUILD_VARIANT)), \ + $(call BuildPackage,optee-os-$(type)) + ) +endef From c93e7700d40750261341937433becdc3686ae321 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 26 Sep 2024 16:19:35 +0200 Subject: [PATCH 076/119] optee-os-stm32: add OP-TEE for stm32 boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add OP-TEE for stm32 boards, with the first being STM32MP135F-DK. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit fae25d4001bcbae0bb1ce60b676bd421e97d78fc) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/boot/optee-os-stm32/Makefile | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 package/boot/optee-os-stm32/Makefile diff --git a/package/boot/optee-os-stm32/Makefile b/package/boot/optee-os-stm32/Makefile new file mode 100644 index 0000000000..9e681127e6 --- /dev/null +++ b/package/boot/optee-os-stm32/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2024 Bootlin +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=4.3.0 +PKG_RELEASE:=1 + +PKG_HASH:=390b271905c828d6def9fa6a77bbaa425f3b434d733c8eb18f582ccbc6896096 +PKG_MAINTAINER:=Thomas Richard + +OPTEE_USE_INTREE_DTC:=1 + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/optee-os.mk +include $(INCLUDE_DIR)/package.mk + +define Optee-os/Default + BUILD_TARGET:=stm32 +endef + +define Optee-os/stm32mp1 + BUILD_SUBTARGET:=stm32mp1 + PLAT:=stm32mp1 +endef + +define Optee-os/stm32mp135f-dk + $(call Optee-os/stm32mp1) + NAME:=STM32MP135F-DK + PLAT_FLAVOR:=135F_DK +endef + +OPTEE_TARGETS := stm32mp135f-dk + +define Package/optee-os/install/default +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(foreach img,$(OPTEE_IMAGE), \ + $(CP) $(PKG_BUILD_DIR)/out/arm-plat-$(PLAT)/core/$(img) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(img); \ + ) +endef + +$(eval $(call BuildPackage/Optee-os)) From fd9de585d7ab82d400ed4091a20a36e20b83160e Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 26 Sep 2024 16:24:26 +0200 Subject: [PATCH 077/119] uboot-stm32: add U-Boot for stm32 boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add U-Boot for stm32 boards, with the first being STM32MP135F-DK. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit ac79ad0757764028a138d0138c8d9aa74420f9ed) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/boot/uboot-stm32/Makefile | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 package/boot/uboot-stm32/Makefile diff --git a/package/boot/uboot-stm32/Makefile b/package/boot/uboot-stm32/Makefile new file mode 100644 index 0000000000..58754aedd5 --- /dev/null +++ b/package/boot/uboot-stm32/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2024 Bootlin +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=2024.07 +PKG_RELEASE:=1 + +PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f +PKG_MAINTAINER:=Thomas Richard + +UBOOT_USE_INTREE_DTC:=1 + +include $(INCLUDE_DIR)/u-boot.mk +include $(INCLUDE_DIR)/package.mk + +define U-Boot/Default + BUILD_TARGET:=stm32 + UBOOT_IMAGE:=u-boot.bin u-boot.dtb +endef + +define U-Boot/stm32mp13 + BUILD_SUBTARGET:=stm32mp1 + UBOOT_CONFIG:=stm32mp13 +endef + +define U-Boot/stm32mp135f-dk + $(call U-Boot/stm32mp13) + NAME:=STM32MP135F-DK + DEVICE_TREE:=stm32mp135f-dk +endef + +UBOOT_TARGETS := stm32mp135f-dk + +UBOOT_MAKE_FLAGS += DEVICE_TREE=$(DEVICE_TREE) + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(foreach img,$(UBOOT_IMAGE), \ + $(CP) $(PKG_BUILD_DIR)/$(img) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(img); \ + ) +endef + +define Package/u-boot/install/default +endef + +$(eval $(call BuildPackage/U-Boot)) From d921c2db0b511b89cd9adeb644f4d92a79e419bb Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 26 Sep 2024 16:29:41 +0200 Subject: [PATCH 078/119] arm-trusted-firmware-stm32: add ATF for stm32 boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ATF for stm32 boards, with the first being STM32MP135F-DK. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit 08dcb73c8d05aa774957422731bfed1b322648d7) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../boot/arm-trusted-firmware-stm32/Makefile | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 package/boot/arm-trusted-firmware-stm32/Makefile diff --git a/package/boot/arm-trusted-firmware-stm32/Makefile b/package/boot/arm-trusted-firmware-stm32/Makefile new file mode 100644 index 0000000000..75a92f15af --- /dev/null +++ b/package/boot/arm-trusted-firmware-stm32/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2024 Bootlin +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=2.10 +PKG_RELEASE:=1 + +PKG_HASH:=88215a62291b9ba87da8e50b077741103cdc08fb6c9e1ebd34dfaace746d3201 +PKG_MAINTAINER:=Thomas Richard + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/trusted-firmware-a.mk +include $(INCLUDE_DIR)/package.mk + +define Trusted-Firmware-A/Default + BUILD_TARGET:=stm32 + BUILD_DEVICES:=$(1) + DEPENDS:=+u-boot-$(1) +optee-os-$(1) +endef + +define Trusted-Firmware-A/stm32mp1 + BUILD_SUBTARGET:=stm32mp1 + PLAT:=stm32mp1 + MAKE_ARGS += BL32_EXTRA2=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pageable_v2.bin \ + STM32MP_USB_PROGRAMMER=1 \ + STM32MP1_OPTEE_IN_SYSRAM=1 \ + ARM_ARCH_MAJOR=7 +endef + +define Trusted-Firmware-A/stm32mp135f-dk + $(call Trusted-Firmware-A/stm32mp1) + NAME:=STM32MP135F-DK + DTB_FILE_NAME=stm32mp135f-dk.dtb +endef + +TFA_TARGETS := stm32mp135f-dk + +TFA_MAKE_FLAGS += \ + ARCH=aarch32 AARCH32_SP=optee \ + BL32=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-header_v2.bin \ + BL32_EXTRA1=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pager_v2.bin \ + BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.bin \ + BL33_CFG=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.dtb \ + DTB_FILE_NAME=$(DTB_FILE_NAME) \ + STM32MP_SDMMC=1 \ + TARGET_BOARD="" \ + $(MAKE_ARGS) \ + all fip + +define Package/trusted-firmware-a/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/tf-a-$(BUILD_VARIANT).stm32 \ + $(STAGING_DIR_IMAGE)/tf-a-$(BUILD_VARIANT).stm32 + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \ + $(STAGING_DIR_IMAGE)/fip-$(BUILD_VARIANT).bin +endef + +$(eval $(call BuildPackage/Trusted-Firmware-A)) From 911b25d618dab50d84c9881aaedfe98761b006a2 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Tue, 24 Sep 2024 18:06:28 +0200 Subject: [PATCH 079/119] mac80211: enable CONFIG_BRCMFMAC_SDIO for stm32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All stm32 devices use BCM43430 Wi-Fi interface in SDIO mode. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit 456e0aad97413816aee41e68b3d3cfdfadc2fd43) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/mac80211/broadcom.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/mac80211/broadcom.mk b/package/kernel/mac80211/broadcom.mk index a6f42cd19a..444d705ab3 100644 --- a/package/kernel/mac80211/broadcom.mk +++ b/package/kernel/mac80211/broadcom.mk @@ -437,6 +437,7 @@ define KernelPackage/brcmfmac/config default y if TARGET_starfive default y if TARGET_rockchip default y if TARGET_sunxi + default y if TARGET_stm32 default n help Enable support for cards attached to an SDIO bus. From c3db0cca0f66d2edb721cf72adb92125abc4a001 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 10 Oct 2024 17:19:38 +0200 Subject: [PATCH 080/119] murata-firmware: add new package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This package contains firmwares provided by Murata. See https://community.murata.com/. Murata firmwares are used by wifi chip on stm32 boards. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit 960f5f94d7cefe89abd41347124fd3f0fbb945ae) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/firmware/murata-firmware/Makefile | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 package/firmware/murata-firmware/Makefile diff --git a/package/firmware/murata-firmware/Makefile b/package/firmware/murata-firmware/Makefile new file mode 100644 index 0000000000..1d9efda576 --- /dev/null +++ b/package/firmware/murata-firmware/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2024 Bootlin +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=murata-firmware +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2024-09-12 +PKG_SOURCE_URL:=https://github.com/murata-wireless/cyw-fmac-fw.git +PKG_MIRROR_HASH:=26f8a2df800666daab183b2842e5b3d591b1e5b31769d5429f9d70527f43d152 +PKG_SOURCE_VERSION:=50ac17bb65b2342cd954d49d9bc492709d431c3c + +PKG_MAINTAINER:=Thomas Richard +PKG_LICENSE_FILES:=LICENCE + +include $(INCLUDE_DIR)/package.mk + +define Package/murata-firmware-default + SECTION:=firmware + CATEGORY:=Firmware + URL:=https://community.murata.com/ +endef + +define Build/Compile +endef + +define Package/murata-firmware-43430-sdio + $(Package/murata-firmware-default) + TITLE:=BCM43430 FullMac SDIO firmware + CONFLICTS:=cypress-firmware-43430-sdio +endef + +define Package/murata-firmware-43430-sdio/install + $(INSTALL_DIR) $(1)/lib/firmware/murata + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/cyfmac43430-sdio.bin \ + $(1)/lib/firmware/murata/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/cyfmac43430-sdio.1DX.clm_blob \ + $(1)/lib/firmware/murata/ + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(LN) \ + ../murata/cyfmac43430-sdio.bin \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin + $(LN) \ + ../murata/cyfmac43430-sdio.1DX.clm_blob \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob +endef + +$(eval $(call BuildPackage,murata-firmware-43430-sdio)) + From 72bf1db35ce614322526c476ee09d76d652813fa Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 10 Oct 2024 17:21:16 +0200 Subject: [PATCH 081/119] murata-nvram: add new package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This package contains nvram files for Murata's Wi-Fi/Bluetooth modules. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit be937952fdf8f78fb45ea001258074ddb45e0891) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/firmware/murata-nvram/Makefile | 48 +++++++++++++++++++ .../files/cyfmac43430-sdio.1DX.stm32.txt | 47 ++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 package/firmware/murata-nvram/Makefile create mode 100755 package/firmware/murata-nvram/files/cyfmac43430-sdio.1DX.stm32.txt diff --git a/package/firmware/murata-nvram/Makefile b/package/firmware/murata-nvram/Makefile new file mode 100644 index 0000000000..daf382e3bc --- /dev/null +++ b/package/firmware/murata-nvram/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2024 Bootlin +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=murata-nvram +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2024-09-28 +PKG_SOURCE_URL:=https://github.com/murata-wireless/cyw-fmac-nvram.git +PKG_MIRROR_HASH:=e2fc6f1f9898edfd67f5495e615882700f03b42a75efa2e3f4e2d524aed0efb8 +PKG_SOURCE_VERSION:=255819aab07572d87576a13329ef9d4c654167aa + +PKG_MAINTAINER:=Thomas Richard +PKG_LICENSE_FILES:=LICENCE.cypress + +include $(INCLUDE_DIR)/package.mk + +define Package/murata-nvram-default + SECTION:=firmware + CATEGORY:=Firmware + URL:=https://community.murata.com/ +endef + +define Build/Compile +endef + +define Package/murata-nvram-43430-sdio + $(Package/murata-nvram-default) + TITLE:=BCM43430 SDIO NVRAM + CONFLICTS:=brcmfmac-nvram-43430-sdio +endef + +define Package/murata-nvram-43430-sdio/install + $(INSTALL_DIR) $(1)/lib/firmware/brcm + $(INSTALL_DATA) ./files/cyfmac43430-sdio.1DX.stm32.txt \ + $(1)/lib/firmware/brcm/ + $(LN) \ + cyfmac43430-sdio.1DX.stm32.txt \ + $(1)/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp135f-dk.txt +endef + +$(eval $(call BuildPackage,murata-nvram-43430-sdio)) diff --git a/package/firmware/murata-nvram/files/cyfmac43430-sdio.1DX.stm32.txt b/package/firmware/murata-nvram/files/cyfmac43430-sdio.1DX.stm32.txt new file mode 100755 index 0000000000..f06abf0380 --- /dev/null +++ b/package/firmware/murata-nvram/files/cyfmac43430-sdio.1DX.stm32.txt @@ -0,0 +1,47 @@ +# This NVRAM file is based on cyfmac43430-sdio.1DX.txt, except that the muxenab +# parameter was unset to enable IB IRQ (OOB IRQ is not stable on STM32 +# platforms). +# 2.4 GHz, 20 MHz BW mode +manfid=0x2d0 +prodid=0x0726 +vendid=0x14e4 +devid=0x43e2 +boardtype=0x0726 +boardrev=0x1202 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +sromrev=11 +boardflags=0x00404201 +boardflags3=0x08000000 +xtalfreq=37400 +nocrc=1 +ag0=0 +aa2g=1 +ccode=ALL +#pa0itssit=0x20 +extpagain2g=0 +pa2ga0=-145,6667,-751 +AvVmid_c0=0x0,0xc8 +cckpwroffset0=2 +maxp2ga0=74 +#txpwrbckof=6 +cckbw202gpo=0 +legofdmbw202gpo=0x88888888 +mcsbw202gpo=0xaaaaaaaa +propbw202gpo=0xdd +ofdmdigfilttype=18 +ofdmdigfilttypebe=18 +papdmode=1 +papdvalidtest=1 +pacalidx2g=48 +papdepsoffset=-22 +papdendidx=58 +il0macaddr=00:90:4c:c5:12:38 +wl0id=0x431b +# muxenab defined to enable OOB IRQ. Level sensitive interrupt via WL_HOST_WAKE line. +# muxenab=0x10 +#BT COEX deferral limit setting +#btc_params 8 45000 +#btc_params 10 20000 +#spurconfig=0x3 +# End of NVRAM - do not remove this line # From 956bb0c2a49e3178542ca5e917b0db55c9aff695 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 25 Oct 2024 15:20:38 +0200 Subject: [PATCH 082/119] kernel: package industrialio-hw-consumer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is needed for the stm32/stm32mp1 subtarget. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit ff96bd84ce0bae633007cf0de82d69796cf3508a) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/iio.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/kernel/linux/modules/iio.mk b/package/kernel/linux/modules/iio.mk index e46544b79c..b9bcaad5b2 100644 --- a/package/kernel/linux/modules/iio.mk +++ b/package/kernel/linux/modules/iio.mk @@ -46,6 +46,23 @@ endef $(eval $(call KernelPackage,iio-kfifo-buf)) +define KernelPackage/industrialio-hw-consumer + TITLE:=Provides a bonding way to an other device in hardware + KCONFIG:=CONFIG_IIO_BUFFER_HW_CONSUMER + FILES:=$(LINUX_DIR)/drivers/iio/buffer/industrialio-hw-consumer.ko + AUTOLOAD:=$(call AutoLoad,55,industrialio-hw-consumer) + $(call AddDepends/iio,+kmod-iio-kfifo-buf) +endef + +define KernelPackage/industrialio-hw-consumer/description + Provides a way to bonding when an IIO device has a direct connection + to another device in hardware. In this case buffers for data transfers + are handled by hardware. +endef + +$(eval $(call KernelPackage,industrialio-hw-consumer)) + + define KernelPackage/industrialio-triggered-buffer TITLE:=Provides helper functions for setting up triggered buffers. DEPENDS:=+kmod-iio-kfifo-buf From 2950e189cebda9c0521c84f86c06aaeb447affe2 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 25 Oct 2024 15:21:57 +0200 Subject: [PATCH 083/119] kernel: package snd-soc-dmic driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is needed for the stm32/stm32mp1 subtarget. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit e606366a2e018e0a3b25e3dd4b3a937bb53c70e1) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/sound.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/kernel/linux/modules/sound.mk b/package/kernel/linux/modules/sound.mk index 623f65ac59..f3e44e01ee 100644 --- a/package/kernel/linux/modules/sound.mk +++ b/package/kernel/linux/modules/sound.mk @@ -314,6 +314,17 @@ endef $(eval $(call KernelPackage,sound-soc-spdif)) +define KernelPackage/sound-soc-dmic + TITLE:=Generic Digital Microphone CODEC + KCONFIG:=CONFIG_SND_SOC_DMIC + FILES:=$(LINUX_DIR)/sound/soc/codecs/snd-soc-dmic.ko + AUTOLOAD:=$(call AutoProbe,snd-soc-dmic) + $(call AddDepends/sound,+kmod-sound-soc-core) +endef + +$(eval $(call KernelPackage,sound-soc-dmic)) + + define KernelPackage/pcspkr DEPENDS:=@TARGET_x86 +kmod-input-core TITLE:=PC speaker support From 0f301db3fff105887d0a373a792dbaccb9cc8593 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 25 Oct 2024 15:23:26 +0200 Subject: [PATCH 084/119] kernel: unset CONFIG_DEVFREQ_THERMAL in kmod-thermal package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is needed for the stm32/stm32mp1 subtarget. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit 6b9df468f05fefa21a8cbce2fdb2e59692b4d246) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/other.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index bbebcf37ec..7b64985fd6 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -961,6 +961,7 @@ define KernelPackage/thermal CONFIG_THERMAL=y \ CONFIG_THERMAL_OF=y \ CONFIG_CPU_THERMAL=y \ + CONFIG_DEVFREQ_THERMAL=n \ CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y \ CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE=n \ CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE=n \ From 2f99171de308c53d99a01ac35078f506633a2979 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Tue, 5 Nov 2024 10:38:49 +0100 Subject: [PATCH 085/119] kernel: package crypto_engine driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is needed for the stm32/stm32mp1 subtarget. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit 7bcc68ede36dcc66ec6cdb45c3201e0af0f90708) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/crypto.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index ce22163547..2257a36c80 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -249,6 +249,15 @@ endef $(eval $(call KernelPackage,crypto-echainiv)) +define KernelPackage/crypto-engine + TITLE:=Crypto engine + KCONFIG:=CONFIG_CRYPTO_ENGINE + FILES:=$(LINUX_DIR)/crypto/crypto_engine.ko + AUTOLOAD:=$(call AutoLoad,09,crypto_engine) + $(call AddDepends/crypto, +kmod-crypto-rsa +kmod-crypto-kpp) +endef + +$(eval $(call KernelPackage,crypto-engine)) define KernelPackage/crypto-essiv TITLE:=ESSIV support for block encryption From 27afd9e1ca662724839577cf0815805d6a3971d3 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Tue, 5 Nov 2024 10:39:47 +0100 Subject: [PATCH 086/119] kernel: package industrialio-buffer-cb driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is needed for the stm32/stm32mp1 subtarget. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit b0adf5e0fdc0d4b449bced9191a95bf08124c1ac) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/iio.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/iio.mk b/package/kernel/linux/modules/iio.mk index b9bcaad5b2..e98a6830da 100644 --- a/package/kernel/linux/modules/iio.mk +++ b/package/kernel/linux/modules/iio.mk @@ -63,6 +63,21 @@ endef $(eval $(call KernelPackage,industrialio-hw-consumer)) +define KernelPackage/industrialio-buffer-cb + TITLE:=Provides callback buffer used for push in-kernel interfaces + KCONFIG:=CONFIG_IIO_BUFFER_CB + FILES:=$(LINUX_DIR)/drivers/iio/buffer/industrialio-buffer-cb.ko + AUTOLOAD:=$(call AutoLoad,55,industrialio-triggered-buffer-cb) + $(call AddDepends/iio) +endef + +define KernelPackage/industrialio-buffer-cb/description + Should be selected by any drivers that do in-kernel push usage. +endef + +$(eval $(call KernelPackage,industrialio-buffer-cb)) + + define KernelPackage/industrialio-triggered-buffer TITLE:=Provides helper functions for setting up triggered buffers. DEPENDS:=+kmod-iio-kfifo-buf From c584683a7f3c30754e2a2462642b9d81ee570d44 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Tue, 5 Nov 2024 11:10:44 +0100 Subject: [PATCH 087/119] kernel: package media controller driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is needed for the stm32/stm32mp1 subtarget. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit bb3418f21f7b8fe0dcd335375d183dd2a81772bf) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/video.mk | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index f2fa82fd03..486b9b9ab1 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -12,6 +12,28 @@ V4L2_DIR=v4l2-core V4L2_USB_DIR=usb V4L2_MEM2MEM_DIR=platform +# +# Media +# +define KernelPackage/media-controller + SUBMENU:=$(VIDEO_MENU) + TITLE:=Media Controller API + KCONFIG:= \ + CONFIG_MEDIA_SUPPORT \ + CONFIG_MEDIA_CONTROLLER=y + FILES:= \ + $(LINUX_DIR)/drivers/media/mc/mc.ko + AUTOLOAD:=$(call AutoProbe,mc) +endef + +define KernelPackage/media-controller/description + Kernel modules for media controller API used to query media devices + internal topology and configure it dynamically. +endef + +$(eval $(call KernelPackage,media-controller)) + + # # Video Display # @@ -601,9 +623,8 @@ $(eval $(call KernelPackage,drm-radeon)) define KernelPackage/video-core SUBMENU:=$(VIDEO_MENU) TITLE=Video4Linux support - DEPENDS:=+PACKAGE_kmod-i2c-core:kmod-i2c-core + DEPENDS:=+PACKAGE_kmod-i2c-core:kmod-i2c-core +kmod-media-controller KCONFIG:= \ - CONFIG_MEDIA_SUPPORT \ CONFIG_MEDIA_CAMERA_SUPPORT=y \ CONFIG_VIDEO_DEV \ CONFIG_V4L_PLATFORM_DRIVERS=y \ From e654d55446a505dd59c1deb1b0a3f87a983dfdf4 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Tue, 5 Nov 2024 11:23:36 +0100 Subject: [PATCH 088/119] kernel: add kmod-media-controller dependency for kmod-usb-audio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The snd-usb-audio drivers uses media controller if media controller is set. So add kmod-media-controller as dependency. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit 109592524663ae8bbda47e4ad51a124153a1c903) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/usb.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 458c8c4ba6..466c547e8a 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -576,6 +576,7 @@ define KernelPackage/usb-audio CONFIG_SND_USB_AUDIO $(call AddDepends/usb) $(call AddDepends/sound) + DEPENDS+=kmod-media-controller FILES:= \ $(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko \ $(LINUX_DIR)/sound/usb/snd-usb-audio.ko From 4eb85c47bddda48aea3e6ee8dd87e5214938f0fa Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Tue, 5 Nov 2024 11:13:34 +0100 Subject: [PATCH 089/119] kernel: package v4l2-async and v4l2-fwnode drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These packages are needed for the stm32/stm32mp1 subtarget. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit e109831e07e398cc50839a30a1cf18c4436983f4) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/video.mk | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 486b9b9ab1..9bb030bf57 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -680,6 +680,25 @@ endef $(eval $(call KernelPackage,video-videobuf2)) +define KernelPackage/video-async + TITLE:=V4L2 ASYNC support + KCONFIG:=CONFIG_V4L2_ASYNC + FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-async.ko + $(call AddDepends/video) + AUTOLOAD:=$(call AutoProbe,v4l2-async) +endef + +$(eval $(call KernelPackage,video-async)) + +define KernelPackage/video-fwnode + TITLE:=V4L2 FWNODE support + KCONFIG:=CONFIG_V4L2_FWNODE + FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-fwnode.ko + $(call AddDepends/video,+kmod-video-async) + AUTOLOAD:=$(call AutoProbe,v4l2-fwnode) +endef + +$(eval $(call KernelPackage,video-fwnode)) define KernelPackage/video-cpia2 TITLE:=CPIA2 video driver From 58f4667a37fe0056e844e3baca4accf2b19ab4a2 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 26 Sep 2024 16:55:22 +0200 Subject: [PATCH 090/119] stm32: add new stm32 target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New stm32 target introduces support for stm32mp1 based devices. For now it includes an initial support of the STM32MP135F-DK device. The specifications bellow only list supported features. Specifications -------------- SOC: STM32MP135FAF7 RAM: 512 MiB Storage: SD Card Ethernet: 2x 100 Mbps Wireless: 2.4GHz Cypress CYW43455 (802.11b/g/n) LEDs: Heartbeat (Blue) Buttons: 1x Reset, 1x User (USER2) USB: 4x 2.0 Type-A Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens (cherry picked from commit 851e7f77e424f24cda8531330f2d82ebc942c0a4) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/stm32/Makefile | 24 + .../stm32/base-files/etc/board.d/02_network | 18 + .../base-files/lib/preinit/79_move_config | 15 + .../stm32/base-files/lib/upgrade/platform.sh | 181 +++ target/linux/stm32/image/Makefile | 63 + target/linux/stm32/image/extlinux.conf | 4 + .../linux/stm32/image/gen_stm32_sdcard_img.sh | 35 + target/linux/stm32/modules.mk | 256 ++++ ...-stm32-use-devm_stmmac_probe_config_.patch | 69 + ...ac-dwmac-stm32-refactor-clock-config.patch | 241 ++++ ...-stm32-Separate-out-external-clock-r.patch | 125 ++ ...-stm32-Separate-out-external-clock-s.patch | 132 ++ ...mac-stm32-Extract-PMCR-configuration.patch | 71 + ...wmac-stm32-Clean-up-the-debug-prints.patch | 83 ++ ...-stm32-Mask-support-for-PMCR-configu.patch | 101 ++ ...-stm32-add-management-of-stm32mp13-f.patch | 94 ++ ...d-ETZPC-as-a-system-bus-for-STM32MP1.patch | 1192 +++++++++++++++++ ...t-ETZPC-as-an-access-controller-for-.patch | 265 ++++ ...d-ethernet1-2-RMII-pins-for-STM32MP1.patch | 126 ++ ...d-ethernet1-and-ethernet2-support-on.patch | 108 ++ ...d-ethernet1-for-STM32MP135F-DK-board.patch | 58 + ...tm32-add-SDIO-in-band-interrupt-mode.patch | 166 +++ ...32-add-pinctrl-and-pinmux-interfaces.patch | 189 +++ ...-Low-Speed-Clock-Output-LSCO-support.patch | 253 ++++ ...c-add-pin-to-provide-LSCO-on-stm32mp.patch | 31 + ...c-add-LSCO-to-WLAN-BT-module-on-stm3.patch | 34 + ...d-support-of-WLAN-BT-on-stm32mp135f-.patch | 84 ++ ...-stm32-add-support-of-phy-supply-pro.patch | 106 ++ ...d-ethernet2-for-STM32MP135F-DK-board.patch | 53 + target/linux/stm32/stm32mp1/config-6.6 | 485 +++++++ target/linux/stm32/stm32mp1/target.mk | 12 + 31 files changed, 4674 insertions(+) create mode 100644 target/linux/stm32/Makefile create mode 100644 target/linux/stm32/base-files/etc/board.d/02_network create mode 100644 target/linux/stm32/base-files/lib/preinit/79_move_config create mode 100644 target/linux/stm32/base-files/lib/upgrade/platform.sh create mode 100644 target/linux/stm32/image/Makefile create mode 100644 target/linux/stm32/image/extlinux.conf create mode 100755 target/linux/stm32/image/gen_stm32_sdcard_img.sh create mode 100644 target/linux/stm32/modules.mk create mode 100644 target/linux/stm32/patches-6.6/001-net-stmmac-dwmac-stm32-use-devm_stmmac_probe_config_.patch create mode 100644 target/linux/stm32/patches-6.6/002-net-stmmac-dwmac-stm32-refactor-clock-config.patch create mode 100644 target/linux/stm32/patches-6.6/003-net-stmmac-dwmac-stm32-Separate-out-external-clock-r.patch create mode 100644 target/linux/stm32/patches-6.6/004-net-stmmac-dwmac-stm32-Separate-out-external-clock-s.patch create mode 100644 target/linux/stm32/patches-6.6/005-net-stmmac-dwmac-stm32-Extract-PMCR-configuration.patch create mode 100644 target/linux/stm32/patches-6.6/006-net-stmmac-dwmac-stm32-Clean-up-the-debug-prints.patch create mode 100644 target/linux/stm32/patches-6.6/007-net-stmmac-dwmac-stm32-Mask-support-for-PMCR-configu.patch create mode 100644 target/linux/stm32/patches-6.6/008-net-stmmac-dwmac-stm32-add-management-of-stm32mp13-f.patch create mode 100644 target/linux/stm32/patches-6.6/009-ARM-dts-stm32-add-ETZPC-as-a-system-bus-for-STM32MP1.patch create mode 100644 target/linux/stm32/patches-6.6/010-ARM-dts-stm32-put-ETZPC-as-an-access-controller-for-.patch create mode 100644 target/linux/stm32/patches-6.6/011-ARM-dts-stm32-add-ethernet1-2-RMII-pins-for-STM32MP1.patch create mode 100644 target/linux/stm32/patches-6.6/012-ARM-dts-stm32-add-ethernet1-and-ethernet2-support-on.patch create mode 100644 target/linux/stm32/patches-6.6/013-ARM-dts-stm32-add-ethernet1-for-STM32MP135F-DK-board.patch create mode 100644 target/linux/stm32/patches-6.6/020-mmc-mmci-stm32-add-SDIO-in-band-interrupt-mode.patch create mode 100644 target/linux/stm32/patches-6.6/030-rtc-stm32-add-pinctrl-and-pinmux-interfaces.patch create mode 100644 target/linux/stm32/patches-6.6/031-rtc-stm32-add-Low-Speed-Clock-Output-LSCO-support.patch create mode 100644 target/linux/stm32/patches-6.6/032-ARM-dts-stm32-rtc-add-pin-to-provide-LSCO-on-stm32mp.patch create mode 100644 target/linux/stm32/patches-6.6/033-ARM-dts-stm32-rtc-add-LSCO-to-WLAN-BT-module-on-stm3.patch create mode 100644 target/linux/stm32/patches-6.6/034-ARM-dts-stm32-add-support-of-WLAN-BT-on-stm32mp135f-.patch create mode 100644 target/linux/stm32/patches-6.6/700-net-stmmac-dwmac-stm32-add-support-of-phy-supply-pro.patch create mode 100644 target/linux/stm32/patches-6.6/900-ARM-dts-stm32-add-ethernet2-for-STM32MP135F-DK-board.patch create mode 100644 target/linux/stm32/stm32mp1/config-6.6 create mode 100644 target/linux/stm32/stm32mp1/target.mk diff --git a/target/linux/stm32/Makefile b/target/linux/stm32/Makefile new file mode 100644 index 0000000000..3020d0b2b8 --- /dev/null +++ b/target/linux/stm32/Makefile @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2024 Bootlin +# + +include $(TOPDIR)/rules.mk + +BOARD:=stm32 +BOARDNAME:=STMicroelectronics STM32 +FEATURES:=boot-part emmc ext4 gpio rtc usb +SUBTARGETS:=stm32mp1 +CPU_TYPE:= + +KERNEL_PATCHVER:=6.6 + +include $(INCLUDE_DIR)/target.mk + +DEFAULT_PACKAGES += blockdev kmod-gpio-button-hotplug + +define Target/Description + Build firmware image for STM32 devices +endef + +$(eval $(call BuildTarget)) diff --git a/target/linux/stm32/base-files/etc/board.d/02_network b/target/linux/stm32/base-files/etc/board.d/02_network new file mode 100644 index 0000000000..a96fada9a4 --- /dev/null +++ b/target/linux/stm32/base-files/etc/board.d/02_network @@ -0,0 +1,18 @@ + +. /lib/functions/uci-defaults.sh +. /lib/functions.sh +. /lib/functions/system.sh + +board_config_update + +board=$(board_name) + +case "$board" in +st,stm32mp135f-dk) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/stm32/base-files/lib/preinit/79_move_config b/target/linux/stm32/base-files/lib/preinit/79_move_config new file mode 100644 index 0000000000..bc7db4c782 --- /dev/null +++ b/target/linux/stm32/base-files/lib/preinit/79_move_config @@ -0,0 +1,15 @@ + +move_config() { + . /lib/upgrade/common.sh + . /lib/upgrade/platform.sh + + if export_bootdevice && export_partdevice partdev 4; then + mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt + if [ -f "/mnt/$BACKUP_FILE" ]; then + mv -f "/mnt/$BACKUP_FILE" / + fi + umount /mnt + fi +} + +boot_hook_add preinit_mount_root move_config diff --git a/target/linux/stm32/base-files/lib/upgrade/platform.sh b/target/linux/stm32/base-files/lib/upgrade/platform.sh new file mode 100644 index 0000000000..4cd88ab6bd --- /dev/null +++ b/target/linux/stm32/base-files/lib/upgrade/platform.sh @@ -0,0 +1,181 @@ +REQUIRE_IMAGE_METADATA=1 + +UBOOT_ENV_PART=3 +BOOT_PART=4 +ROOTFS_PART=5 + +RAMFS_COPY_BIN='blockdev' + +export_bootdevice() { + local cmdline uuid blockdev uevent line class + local MAJOR MINOR DEVNAME DEVTYPE + local rootpart="$(cmdline_get_var root)" + + case "$rootpart" in + PARTUUID=????????-????-????-????-??????????0?/PARTNROFF=1 | \ + PARTUUID=????????-????-????-????-??????????05) + uuid="${rootpart#PARTUUID=}" + uuid="${uuid%/PARTNROFF=1}" + uuid="${uuid%0?}00" + for disk in $(find /dev -type b); do + set -- $(dd if=$disk bs=1 skip=568 count=16 2>/dev/null | hexdump -v -e '8/1 "%02x "" "2/1 "%02x""-"6/1 "%02x"') + if [ "$4$3$2$1-$6$5-$8$7-$9" = "$uuid" ]; then + uevent="/sys/class/block/${disk##*/}/uevent" + break + fi + done + ;; + esac + + if [ -e "$uevent" ]; then + while read line; do + export -n "$line" + done < "$uevent" + export BOOTDEV_MAJOR=$MAJOR + export BOOTDEV_MINOR=$MINOR + return 0 + fi + + return 1 +} + +platform_check_image() { + local diskdev partdev diff + + [ "$#" -gt 1 ] && return 1 + + export_bootdevice && export_partdevice diskdev 0 || { + v "platform_check_image: Unable to determine upgrade device" + return 1 + } + + get_partitions "/dev/$diskdev" bootdisk + + v "Extract the boot sector from the image" + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi +} + +platform_do_upgrade() { + local diskdev partdev diff partlabel + + export_bootdevice && export_partdevice diskdev 0 || { + v "platform_do_upgrade: Unable to determine upgrade device" + return 1 + } + + sync + + if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + v "Extract boot sector from the image" + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + rm -rf /tmp/ubootenv + + if export_partdevice partdev $UBOOT_ENV_PART; then + v "Saving u-boot env (/dev/$partdev) before to write image" + get_image_dd "/dev/$partdev" of=/tmp/ubootenv + fi + + v "Writing image to /dev/$diskdev..." + get_image_dd "$1" of="/dev/$diskdev" conv=fsync + + blockdev --rereadpt "/dev/$diskdev" + + [ -f /tmp/ubootenv ] && { + # iterate over each partition from the image to find the + # u-boot-env partition and restore u-boot env. + while read part start size; do + if export_partdevice partdev $part; then + while read line; do + eval "local l$line" + done < "/sys/class/block/$partdev/uevent" + + [ "$lPARTNAME" = "u-boot-env" ] || continue + + v "Writting u-boot env to /dev/$partdev" + get_image_dd /tmp/ubootenv of="/dev/$partdev" conv=fsync + + return 0 + fi + done < /tmp/partmap.image + } + return 0 + fi + + #iterate over each partition from the image and write it to the boot disk + while read part start size; do + if export_partdevice partdev $part; then + # do not erase u-boot env + [ "$part" = "$UBOOT_ENV_PART" ] && continue + + v "Writing image to /dev/$partdev..." + v "Normal partition, doing DD" + get_image_dd "$1" of="/dev/$partdev" ibs=512 obs=1M skip="$start" \ + count="$size" conv=fsync + else + v "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + if export_partdevice partdev "$BOOT_PART"; then + mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt + local partuuid="$(cmdline_get_var root)" + v "Setting rootfs ${partuuid}" + sed -i "s/PARTUUID=[a-f0-9-]\+/${partuuid}/ig" \ + /mnt/extlinux/extlinux.conf + umount /mnt + fi +} + +platform_copy_config() { + local partdev + + # Iterate over each partition from the image to find the boot partition + # and copy the config tarball. + # The partlabel is used to find the partition. + # An hardcoded partition number cannot be used, as it could be wrong if + # the partition table changed, and the full image was written. + while read part start size; do + # config is copied in the boot partition, as for squashfs image, the + # rootfs partition is not writable. + if export_partdevice partdev "$part"; then + while read line; do + eval "local l$line" + done < "/sys/class/block/$partdev/uevent" + + [ "$lPARTNAME" = "boot" ] || continue + + mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt + cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE" + umount /mnt + return 0 + else + v "ERROR: Unable to find partition to copy config data to" + fi + done < /tmp/partmap.image +} + diff --git a/target/linux/stm32/image/Makefile b/target/linux/stm32/image/Makefile new file mode 100644 index 0000000000..77c25edaf8 --- /dev/null +++ b/target/linux/stm32/image/Makefile @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2024 Bootlin +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +define Build/boot-img-ext4 + rm -fR $@.boot + mkdir -p $@.boot + $(foreach dts,$(DEVICE_DTS), $(CP) $(KDIR)/image-$(dts).dtb $@.boot/$(dts).dtb;) + $(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_IMG) + $(INSTALL_DIR) $@.boot/extlinux + $(CP) ./extlinux.conf $@.boot/extlinux/ + $(SED) 's/@KERNEL@/$(KERNEL_IMG)/' $@.boot/extlinux/extlinux.conf + $(SED) 's/@DEVICE@/$(DEVICE_NAME)/' $@.boot/extlinux/extlinux.conf + $(SED) 's/@DTS@/$(DEVICE_DTS)/' $@.boot/extlinux/extlinux.conf + $(SED) 's/@ROOT@/PARTUUID=$(shell echo $(IMG_PART_DISKGUID) | sed 's/00$$/05/')/' $@.boot/extlinux/extlinux.conf + + make_ext4fs -J -L kernel -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M \ + $(if $(SOURCE_DATE_EPOCH),-T $(SOURCE_DATE_EPOCH)) \ + $@.bootimg $@.boot +endef + +define Build/sdcard-img + GUID=$(IMG_PART_DISKGUID) ./gen_stm32_sdcard_img.sh \ + $@ $(STAGING_DIR_IMAGE)/tf-a-$(DEVICE_NAME).stm32 \ + $(STAGING_DIR_IMAGE)/fip-$(DEVICE_NAME).bin $@.bootimg $(IMAGE_ROOTFS) \ + $(ENV_SIZE) $(CONFIG_TARGET_KERNEL_PARTSIZE) $(CONFIG_TARGET_ROOTFS_PARTSIZE) +endef + +define Device/Default + PROFILES := Default + DEVICE_VENDOR := STMicroelectronics + IMAGES := factory.img.gz sysupgrade.img.gz + IMAGE/factory.img.gz := boot-img-ext4 | sdcard-img | gzip + IMAGE/sysupgrade.img.gz := boot-img-ext4 | sdcard-img | gzip | append-metadata + KERNEL := kernel-bin + KERNEL_NAME := zImage + KERNEL_IMG := zImage + DEVICE_DTS_DIR := $(DTS_DIR)/st + ENV_SIZE := 0x200000 + DEVICE_PACKAGES := kmod-brcmfmac \ + murata-firmware-43430-sdio \ + murata-nvram-43430-sdio \ + wpad-basic-mbedtls \ + kmod-phy-stm32-usbphyc \ + kmod-usb2 \ + kmod-usb-storage \ + kmod-usb-ledtrig-usbport \ + -mtd +endef + +define Device/stm32mp135f-dk + DEVICE_MODEL := STM32MP135F-DK + DEVICE_DTS := stm32mp135f-dk + SUPPORTED_DEVICES := st,stm32mp135f-dk +endef + +TARGET_DEVICES += stm32mp135f-dk + +$(eval $(call BuildImage)) diff --git a/target/linux/stm32/image/extlinux.conf b/target/linux/stm32/image/extlinux.conf new file mode 100644 index 0000000000..5c7773c2a8 --- /dev/null +++ b/target/linux/stm32/image/extlinux.conf @@ -0,0 +1,4 @@ +label @DEVICE@-openwrt + kernel /@KERNEL@ + devicetree /@DTS@.dtb + append root=@ROOT@ rootwait diff --git a/target/linux/stm32/image/gen_stm32_sdcard_img.sh b/target/linux/stm32/image/gen_stm32_sdcard_img.sh new file mode 100755 index 0000000000..9af891694a --- /dev/null +++ b/target/linux/stm32/image/gen_stm32_sdcard_img.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (C) 2024 Bootlin + +set -ex +[ $# -eq 8 ] || { + echo "SYNTAX: $0 " + exit 1 +} + +OUTPUT="${1}" +FSBL="${2}" +FIP="${3}" +BOOTFS="${4}" +ROOTFS="${5}" +ENVSIZE="$((${6} / 1024))" +BOOTFSSIZE="${7}" +ROOTFSSIZE="${8}" + +set $(ptgen -o "${OUTPUT}" -g -a 4 -l 2048 -G ${GUID} -N fsbla -p 2M -N fip -p 3M -N u-boot-env -p "${ENVSIZE}" -N boot -p${BOOTFSSIZE}M -N rootfs -p ${ROOTFSSIZE}M) +FSBLAOFFSET="$((${1} / 512))" +FSBLASIZE="$((${2} / 512))" +FIPOFFSET="$((${3} / 512))" +FIPSIZE="$((${4} / 512))" +ENVOFFSET="$((${5} / 512))" +ENVSIZE="$((${6} / 512))" +BOOTFSOFFSET="$((${7} / 512))" +BOOTFSSIZE="$((${8} / 512))" +ROOTFSOFFSET="$((${9} / 512))" +ROOTFSSIZE="$((${10} / 512))" + +dd bs=512 if="${FSBL}" of="${OUTPUT}" seek="${FSBLAOFFSET}" conv=notrunc +dd bs=512 if="${FIP}" of="${OUTPUT}" seek="${FIPOFFSET}" conv=notrunc +dd bs=512 if=/dev/zero of="${OUTPUT}" seek="${ENVOFFSET}" count="${ENVSIZE}" conv=notrunc +dd bs=512 if="${BOOTFS}" of="${OUTPUT}" seek="${BOOTFSOFFSET}" conv=notrunc +dd bs=512 if="${ROOTFS}" of="${OUTPUT}" seek="${ROOTFSOFFSET}" conv=notrunc diff --git a/target/linux/stm32/modules.mk b/target/linux/stm32/modules.mk new file mode 100644 index 0000000000..baba80baba --- /dev/null +++ b/target/linux/stm32/modules.mk @@ -0,0 +1,256 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2024 Bootlin + +define KernelPackage/phy-stm32-usbphyc + TITLE:=STM32 USB HS PHY Controller driver + DEPENDS:=@TARGET_stm32 + KCONFIG:=CONFIG_PHY_STM32_USBPHYC + FILES:=$(LINUX_DIR)/drivers/phy/st/phy-stm32-usbphyc.ko + AUTOLOAD:=$(call AutoProbe,phy-stm32-usbphyc,) +endef + +define KernelPackage/phy-stm32-usbphyc/description + Kernel module for STM32 USB HS PHY Controller +endef + +$(eval $(call KernelPackage,phy-stm32-usbphyc)) + + +define KernelPackage/bxcan + TITLE:=STM32 Basic Extended CAN (bxCAN) devices + KCONFIG:=CONFIG_CAN_BXCAN + FILES=$(LINUX_DIR)/drivers/net/can/bxcan.ko + AUTOLOAD:=$(call AutoProbe,bxcan) + $(call AddDepends/can,@TARGET_stm32) +endef + +$(eval $(call KernelPackage,bxcan)) + + +define KernelPackage/spi-stm32 + SUBMENU=$(SPI_MENU) + TITLE:=STM32 SPI controller + DEPENDS:=@TARGET_stm32 + KCONFIG:=CONFIG_SPI_STM32 \ + CONFIG_SPI=y \ + CONFIG_SPI_MASTER=y \ + CONFIG_SPI_SLAVE_TIME=n \ + CONFIG_SPI_SLAVE_SYSTEM_CONTROL=n + FILES=$(LINUX_DIR)/drivers/spi/spi-stm32.ko + AUTOLOAD:=$(call AutoProbe,spi-stm32) +endef + +define KernelPackage/spi-stm32/description + SPI driver for STMicroelectronics STM32 SoCs. +endef + +$(eval $(call KernelPackage,spi-stm32)) + + +define KernelPackage/scmi-hwmon + TITLE:=ARM SCMI Sensors + KCONFIG:=CONFIG_SENSORS_ARM_SCMI + FILES:=$(LINUX_DIR)/drivers/hwmon/scmi-hwmon.ko + AUTOLOAD:=$(call AutoProbe,scmi-hwmon) + $(call AddDepends/hwmon,@TARGET_stm32 +kmod-thermal) +endef + +$(eval $(call KernelPackage,scmi-hwmon)) + + +define KernelPackage/stm32-dcmi + TITLE:=STM32 Digital Camera Memory Interface support + KCONFIG:=CONFIG_VIDEO_STM32_DCMI + FILES:=$(LINUX_DIR)/drivers/media/platform/st/stm32/stm32-dcmi.ko + AUTOLOAD:=$(call AutoProbe,stm32-dcmi) + $(call AddDepends/video,@TARGET_stm32 +kmod-video-videobuf2 +kmod-video-dma-contig +kmod-video-async +kmod-video-fwnode) +endef + +$(eval $(call KernelPackage,stm32-dcmi)) + + +define KernelPackage/sound-soc-stm32-sai + TITLE:=STM32 SAI interface (Serial Audio Interface) support + KCONFIG:=CONFIG_SND_SOC_STM32_SAI + FILES:=$(LINUX_DIR)/sound/soc/stm/snd-soc-stm32-sai-sub.ko \ + $(LINUX_DIR)/sound/soc/stm/snd-soc-stm32-sai.ko + AUTOLOAD:=$(call AutoProbe,snd-soc-stm32-sai-sub snd-soc-stm32-sai) + $(call AddDepends/sound,@TARGET_stm32 +kmod-sound-soc-core) +endef + +$(eval $(call KernelPackage,sound-soc-stm32-sai)) + + +define KernelPackage/sound-soc-stm32-i2s + TITLE:=STM32 I2S interface (SPI/I2S block) support + KCONFIG:=CONFIG_SND_SOC_STM32_I2S + FILES:=$(LINUX_DIR)/sound/soc/stm/snd-soc-stm32-i2s.ko + AUTOLOAD:=$(call AutoProbe,snd-soc-stm32-i2s) + $(call AddDepends/sound,@TARGET_stm32 +kmod-sound-soc-core) +endef + +$(eval $(call KernelPackage,sound-soc-stm32-i2s)) + + +define KernelPackage/sound-soc-stm32-spdifrx + TITLE:=STM32 S/PDIF receiver (SPDIFRX) support + KCONFIG:=CONFIG_SND_SOC_STM32_SPDIFRX + FILES:=$(LINUX_DIR)/sound/soc/stm/snd-soc-stm32-spdifrx.ko + AUTOLOAD:=$(call AutoProbe,snd-soc-stm32-spdifrx) + $(call AddDepends/sound,@TARGET_stm32 +kmod-sound-soc-core) +endef + +$(eval $(call KernelPackage,sound-soc-stm32-spdifrx)) + + +define KernelPackage/sound-soc-stm32-dfsdm + TITLE:=SoC Audio support for STM32 DFSDM + KCONFIG:=CONFIG_SND_SOC_STM32_DFSDM + FILES:=$(LINUX_DIR)/sound/soc/stm/stm32_adfsdm.ko + AUTOLOAD:=$(call AutoProbe,stm32_adfsdm) + $(call AddDepends/sound,@TARGET_stm32 +kmod-sound-soc-core +kmod-stm32-dfsdm-adc +kmod-industrialio-buffer-cb) +endef + +$(eval $(call KernelPackage,sound-soc-stm32-dfsdm)) + + +define KernelPackage/stm32-timers + TITLE:=STM32 Timers + DEPENDS:=@TARGET_stm32 +kmod-mfd + KCONFIG:=CONFIG_MFD_STM32_TIMERS + FILES:=$(LINUX_DIR)/drivers/mfd/stm32-timers.ko + AUTOLOAD:=$(call AutoProbe,stm32-timers) +endef + +$(eval $(call KernelPackage,stm32-timers)) + + +define KernelPackage/stm32-timer-trigger + TITLE:=STM32 Timer Trigger + KCONFIG:=CONFIG_IIO_STM32_TIMER_TRIGGER + FILES:=$(LINUX_DIR)/drivers/iio/trigger/stm32-timer-trigger.ko + AUTOLOAD:=$(call AutoProbe,stm32-timer-trigger) + $(call AddDepends/iio,@TARGET_stm32 +kmod-stm32-timers) +endef + +$(eval $(call KernelPackage,stm32-timer-trigger)) + + +define KernelPackage/stm32-adc + TITLE:=STM32 ADC + KCONFIG:=CONFIG_STM32_ADC_CORE \ + CONFIG_STM32_ADC + FILES:=$(LINUX_DIR)/drivers/iio/adc/stm32-adc-core.ko \ + $(LINUX_DIR)/drivers/iio/adc/stm32-adc.ko + AUTOLOAD:=$(call AutoProbe,stm32-adc-core stm32-adc) + $(call AddDepends/iio,@TARGET_stm32 +kmod-stm32-timer-trigger +kmod-industrialio-triggered-buffer) +endef + +$(eval $(call KernelPackage,stm32-adc)) + + +define KernelPackage/stm32-dfsdm-adc + TITLE:=STM32 DFSDM ADC + KCONFIG:=CONFIG_STM32_DFSDM_CORE \ + CONFIG_STM32_DFSDM_ADC + FILES:=$(LINUX_DIR)/drivers/iio/adc/stm32-dfsdm-core.ko \ + $(LINUX_DIR)/drivers/iio/adc/stm32-dfsdm-adc.ko + AUTOLOAD:=$(call AutoProbe,stm32-dfsdm-core stm32-dfsdm-adc) + $(call AddDepends/iio,@TARGET_stm32 +kmod-stm32-timer-trigger +kmod-industrialio-triggered-buffer +kmod-industrialio-hw-consumer) +endef + +$(eval $(call KernelPackage,stm32-dfsdm-adc)) + + +define KernelPackage/scmi-iio + TITLE:=IIO SCMI + KCONFIG=CONFIG_IIO_SCMI + FILES:=$(LINUX_DIR)/drivers/iio/common/scmi_sensors/scmi_iio.ko + AUTOLOAD:=$(call AutoProbe,scmi_iio) + $(call AddDepends/iio,@TARGET_stm32 +kmod-iio-kfifo-buf) +endef + +$(eval $(call KernelPackage,scmi-iio)) + + +define KernelPackage/stm32-dac + TITLE:=STM32 DAC + DEPENDS:=@TARGET_stm32 + KCONFIG:=CONFIG_STM32_DAC_CORE \ + CONFIG_STM32_DAC + FILES:=$(LINUX_DIR)/drivers/iio/dac/stm32-dac-core.ko \ + $(LINUX_DIR)/drivers/iio/dac/stm32-dac.ko + AUTOLOAD:=$(call AutoProbe,stm32-dac-core stm32-dac) + $(call AddDepends/iio,@TARGET_stm32) +endef + +$(eval $(call KernelPackage,stm32-dac)) + + +define KernelPackage/nvmem-stm32-romem + SUBMENU:=$(OTHER_MENU) + TITLE:=STM32 factory-programmed memory support + DEPENDS:=@TARGET_stm32 + KCONFIG:=CONFIG_NVMEM_STM32_ROMEM + FILES:=$(LINUX_DIR)/drivers/nvmem/nvmem_stm32_romem.ko + AUTOLOAD:=$(call AutoProbe,nvmem-stm32-romem) +endef + +$(eval $(call KernelPackage,nvmem-stm32-romem)) + + +define KernelPackage/stm32-crc32 + TITLE:=Support for STM32 crc accelerators + KCONFIG:=CONFIG_CRYPTO_DEV_STM32_CRC \ + CONFIG_CRYPTO_HW=y + FILES:=$(LINUX_DIR)/drivers/crypto/stm32/stm32-crc32.ko + AUTOLOAD:=$(call AutoProbe,stm32-crc32) + $(call AddDepends/crypto,@TARGET_stm32 +kmod-crypto-crc32) +endef + +$(eval $(call KernelPackage,stm32-crc32)) + + +define KernelPackage/stm32-hash + SUBMENU:=$(CRYPTO_MENU) + TITLE:=Support for STM32 hash accelerators + DEPENDS:=@TARGET_stm32 \ + +kmod-crypto-md5 \ + +kmod-crypto-sha1 \ + +kmod-crypto-sha256 \ + +kmod-crypto-sha3 \ + +kmod-crypto-rsa + KCONFIG:=CONFIG_CRYPTO_DEV_STM32_HASH \ + CONFIG_CRYPTO_ENGINE=y \ + FILES:=$(LINUX_DIR)/drivers/crypto/stm32/stm32-hash.ko + AUTOLOAD:=$(call AutoProbe,stm32-hash) +endef + +$(eval $(call KernelPackage,stm32-hash)) + + +define KernelPackage/stm32-cryp + TITLE:=Support for STM32 cryp accelerators + KCONFIG:=CONFIG_CRYPTO_DEV_STM32_CRYP \ + CONFIG_CRYPTO_LIB_DES=y + FILES:=$(LINUX_DIR)/drivers/crypto/stm32/stm32-cryp.ko + AUTOLOAD:=$(call AutoProbe,stm32-cryp) + $(call AddDepends/crypto,@TARGET_stm32 +kmod-crypto-hash +kmod-crypto-des +kmod-crypto-engine) +endef + +$(eval $(call KernelPackage,stm32-cryp)) + + +define KernelPackage/st-thermal + SUBMENU:=$(OTHER_MENU) + TITLE:=Thermal sensors on STMicroelectronics STi series of SoCs + KCONFIG:=CONFIG_ST_THERMAL \ + CONFIG_ST_THERMAL_MEMMAP + DEPENDS:=@TARGET_stm32 +kmod-thermal + FILES:=$(LINUX_DIR)/drivers/thermal/st/st_thermal.ko \ + $(LINUX_DIR)/drivers/thermal/st/st_thermal_memmap.ko + AUTOLOAD:=$(call AutoProbe,st_thermal st_thermal_memmap) +endef + +$(eval $(call KernelPackage,st-thermal)) diff --git a/target/linux/stm32/patches-6.6/001-net-stmmac-dwmac-stm32-use-devm_stmmac_probe_config_.patch b/target/linux/stm32/patches-6.6/001-net-stmmac-dwmac-stm32-use-devm_stmmac_probe_config_.patch new file mode 100644 index 0000000000..cf192fdef4 --- /dev/null +++ b/target/linux/stm32/patches-6.6/001-net-stmmac-dwmac-stm32-use-devm_stmmac_probe_config_.patch @@ -0,0 +1,69 @@ +From 1ddced59ac1f7c739f21e930d87b126a30c561bb Mon Sep 17 00:00:00 2001 +From: Jisheng Zhang +Date: Sat, 16 Sep 2023 15:58:23 +0800 +Subject: [PATCH 1/8] net: stmmac: dwmac-stm32: use + devm_stmmac_probe_config_dt() + +Simplify the driver's probe() function by using the devres +variant of stmmac_probe_config_dt(). + +Signed-off-by: Jisheng Zhang +Signed-off-by: David S. Miller +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 17 ++++++----------- + 1 file changed, 6 insertions(+), 11 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -372,21 +372,18 @@ static int stm32_dwmac_probe(struct plat + if (ret) + return ret; + +- plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac); ++ plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); + if (IS_ERR(plat_dat)) + return PTR_ERR(plat_dat); + + dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); +- if (!dwmac) { +- ret = -ENOMEM; +- goto err_remove_config_dt; +- } ++ if (!dwmac) ++ return -ENOMEM; + + data = of_device_get_match_data(&pdev->dev); + if (!data) { + dev_err(&pdev->dev, "no of match data provided\n"); +- ret = -EINVAL; +- goto err_remove_config_dt; ++ return -EINVAL; + } + + dwmac->ops = data; +@@ -395,14 +392,14 @@ static int stm32_dwmac_probe(struct plat + ret = stm32_dwmac_parse_data(dwmac, &pdev->dev); + if (ret) { + dev_err(&pdev->dev, "Unable to parse OF data\n"); +- goto err_remove_config_dt; ++ return ret; + } + + plat_dat->bsp_priv = dwmac; + + ret = stm32_dwmac_init(plat_dat); + if (ret) +- goto err_remove_config_dt; ++ return ret; + + ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); + if (ret) +@@ -412,8 +409,6 @@ static int stm32_dwmac_probe(struct plat + + err_clk_disable: + stm32_dwmac_clk_disable(dwmac); +-err_remove_config_dt: +- stmmac_remove_config_dt(pdev, plat_dat); + + return ret; + } diff --git a/target/linux/stm32/patches-6.6/002-net-stmmac-dwmac-stm32-refactor-clock-config.patch b/target/linux/stm32/patches-6.6/002-net-stmmac-dwmac-stm32-refactor-clock-config.patch new file mode 100644 index 0000000000..dd791dab6a --- /dev/null +++ b/target/linux/stm32/patches-6.6/002-net-stmmac-dwmac-stm32-refactor-clock-config.patch @@ -0,0 +1,241 @@ +From 73c350e3fb32e9598b66f61081c7e06a7fba49f8 Mon Sep 17 00:00:00 2001 +From: Ben Wolsieffer +Date: Mon, 9 Oct 2023 10:59:04 -0400 +Subject: [PATCH 2/8] net: stmmac: dwmac-stm32: refactor clock config + +Currently, clock configuration is spread throughout the driver and +partially duplicated for the STM32MP1 and STM32 MCU variants. This makes +it difficult to keep track of which clocks need to be enabled or disabled +in various scenarios. + +This patch adds symmetric stm32_dwmac_clk_enable/disable() functions +that handle all clock configuration, including quirks required while +suspending or resuming. syscfg_clk and clk_eth_ck are not present on +STM32 MCUs, but it is fine to try to configure them anyway since NULL +clocks are ignored. + +Signed-off-by: Ben Wolsieffer +Signed-off-by: David S. Miller +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 113 +++++++----------- + 1 file changed, 45 insertions(+), 68 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -98,7 +98,6 @@ struct stm32_dwmac { + + struct stm32_ops { + int (*set_mode)(struct plat_stmmacenet_data *plat_dat); +- int (*clk_prepare)(struct stm32_dwmac *dwmac, bool prepare); + int (*suspend)(struct stm32_dwmac *dwmac); + void (*resume)(struct stm32_dwmac *dwmac); + int (*parse_data)(struct stm32_dwmac *dwmac, +@@ -107,62 +106,55 @@ struct stm32_ops { + bool clk_rx_enable_in_suspend; + }; + +-static int stm32_dwmac_init(struct plat_stmmacenet_data *plat_dat) ++static int stm32_dwmac_clk_enable(struct stm32_dwmac *dwmac, bool resume) + { +- struct stm32_dwmac *dwmac = plat_dat->bsp_priv; + int ret; + +- if (dwmac->ops->set_mode) { +- ret = dwmac->ops->set_mode(plat_dat); +- if (ret) +- return ret; +- } +- + ret = clk_prepare_enable(dwmac->clk_tx); + if (ret) +- return ret; ++ goto err_clk_tx; + +- if (!dwmac->ops->clk_rx_enable_in_suspend || +- !dwmac->dev->power.is_suspended) { ++ if (!dwmac->ops->clk_rx_enable_in_suspend || !resume) { + ret = clk_prepare_enable(dwmac->clk_rx); +- if (ret) { +- clk_disable_unprepare(dwmac->clk_tx); +- return ret; +- } ++ if (ret) ++ goto err_clk_rx; + } + +- if (dwmac->ops->clk_prepare) { +- ret = dwmac->ops->clk_prepare(dwmac, true); +- if (ret) { +- clk_disable_unprepare(dwmac->clk_rx); +- clk_disable_unprepare(dwmac->clk_tx); +- } ++ ret = clk_prepare_enable(dwmac->syscfg_clk); ++ if (ret) ++ goto err_syscfg_clk; ++ ++ if (dwmac->enable_eth_ck) { ++ ret = clk_prepare_enable(dwmac->clk_eth_ck); ++ if (ret) ++ goto err_clk_eth_ck; + } + + return ret; ++ ++err_clk_eth_ck: ++ clk_disable_unprepare(dwmac->syscfg_clk); ++err_syscfg_clk: ++ if (!dwmac->ops->clk_rx_enable_in_suspend || !resume) ++ clk_disable_unprepare(dwmac->clk_rx); ++err_clk_rx: ++ clk_disable_unprepare(dwmac->clk_tx); ++err_clk_tx: ++ return ret; + } + +-static int stm32mp1_clk_prepare(struct stm32_dwmac *dwmac, bool prepare) ++static int stm32_dwmac_init(struct plat_stmmacenet_data *plat_dat, bool resume) + { +- int ret = 0; ++ struct stm32_dwmac *dwmac = plat_dat->bsp_priv; ++ int ret; + +- if (prepare) { +- ret = clk_prepare_enable(dwmac->syscfg_clk); ++ if (dwmac->ops->set_mode) { ++ ret = dwmac->ops->set_mode(plat_dat); + if (ret) + return ret; +- if (dwmac->enable_eth_ck) { +- ret = clk_prepare_enable(dwmac->clk_eth_ck); +- if (ret) { +- clk_disable_unprepare(dwmac->syscfg_clk); +- return ret; +- } +- } +- } else { +- clk_disable_unprepare(dwmac->syscfg_clk); +- if (dwmac->enable_eth_ck) +- clk_disable_unprepare(dwmac->clk_eth_ck); + } +- return ret; ++ ++ return stm32_dwmac_clk_enable(dwmac, resume); + } + + static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) +@@ -252,13 +244,15 @@ static int stm32mcu_set_mode(struct plat + dwmac->ops->syscfg_eth_mask, val << 23); + } + +-static void stm32_dwmac_clk_disable(struct stm32_dwmac *dwmac) ++static void stm32_dwmac_clk_disable(struct stm32_dwmac *dwmac, bool suspend) + { + clk_disable_unprepare(dwmac->clk_tx); +- clk_disable_unprepare(dwmac->clk_rx); ++ if (!dwmac->ops->clk_rx_enable_in_suspend || !suspend) ++ clk_disable_unprepare(dwmac->clk_rx); + +- if (dwmac->ops->clk_prepare) +- dwmac->ops->clk_prepare(dwmac, false); ++ clk_disable_unprepare(dwmac->syscfg_clk); ++ if (dwmac->enable_eth_ck) ++ clk_disable_unprepare(dwmac->clk_eth_ck); + } + + static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac, +@@ -397,7 +391,7 @@ static int stm32_dwmac_probe(struct plat + + plat_dat->bsp_priv = dwmac; + +- ret = stm32_dwmac_init(plat_dat); ++ ret = stm32_dwmac_init(plat_dat, false); + if (ret) + return ret; + +@@ -408,7 +402,7 @@ static int stm32_dwmac_probe(struct plat + return 0; + + err_clk_disable: +- stm32_dwmac_clk_disable(dwmac); ++ stm32_dwmac_clk_disable(dwmac, false); + + return ret; + } +@@ -421,7 +415,7 @@ static void stm32_dwmac_remove(struct pl + + stmmac_dvr_remove(&pdev->dev); + +- stm32_dwmac_clk_disable(priv->plat->bsp_priv); ++ stm32_dwmac_clk_disable(dwmac, false); + + if (dwmac->irq_pwr_wakeup >= 0) { + dev_pm_clear_wake_irq(&pdev->dev); +@@ -431,18 +425,7 @@ static void stm32_dwmac_remove(struct pl + + static int stm32mp1_suspend(struct stm32_dwmac *dwmac) + { +- int ret = 0; +- +- ret = clk_prepare_enable(dwmac->clk_ethstp); +- if (ret) +- return ret; +- +- clk_disable_unprepare(dwmac->clk_tx); +- clk_disable_unprepare(dwmac->syscfg_clk); +- if (dwmac->enable_eth_ck) +- clk_disable_unprepare(dwmac->clk_eth_ck); +- +- return ret; ++ return clk_prepare_enable(dwmac->clk_ethstp); + } + + static void stm32mp1_resume(struct stm32_dwmac *dwmac) +@@ -450,14 +433,6 @@ static void stm32mp1_resume(struct stm32 + clk_disable_unprepare(dwmac->clk_ethstp); + } + +-static int stm32mcu_suspend(struct stm32_dwmac *dwmac) +-{ +- clk_disable_unprepare(dwmac->clk_tx); +- clk_disable_unprepare(dwmac->clk_rx); +- +- return 0; +-} +- + #ifdef CONFIG_PM_SLEEP + static int stm32_dwmac_suspend(struct device *dev) + { +@@ -468,6 +443,10 @@ static int stm32_dwmac_suspend(struct de + int ret; + + ret = stmmac_suspend(dev); ++ if (ret) ++ return ret; ++ ++ stm32_dwmac_clk_disable(dwmac, true); + + if (dwmac->ops->suspend) + ret = dwmac->ops->suspend(dwmac); +@@ -485,7 +464,7 @@ static int stm32_dwmac_resume(struct dev + if (dwmac->ops->resume) + dwmac->ops->resume(dwmac); + +- ret = stm32_dwmac_init(priv->plat); ++ ret = stm32_dwmac_init(priv->plat, true); + if (ret) + return ret; + +@@ -500,13 +479,11 @@ static SIMPLE_DEV_PM_OPS(stm32_dwmac_pm_ + + static struct stm32_ops stm32mcu_dwmac_data = { + .set_mode = stm32mcu_set_mode, +- .suspend = stm32mcu_suspend, + .syscfg_eth_mask = SYSCFG_MCU_ETH_MASK + }; + + static struct stm32_ops stm32mp1_dwmac_data = { + .set_mode = stm32mp1_set_mode, +- .clk_prepare = stm32mp1_clk_prepare, + .suspend = stm32mp1_suspend, + .resume = stm32mp1_resume, + .parse_data = stm32mp1_parse_data, diff --git a/target/linux/stm32/patches-6.6/003-net-stmmac-dwmac-stm32-Separate-out-external-clock-r.patch b/target/linux/stm32/patches-6.6/003-net-stmmac-dwmac-stm32-Separate-out-external-clock-r.patch new file mode 100644 index 0000000000..bcdd23b4eb --- /dev/null +++ b/target/linux/stm32/patches-6.6/003-net-stmmac-dwmac-stm32-Separate-out-external-clock-r.patch @@ -0,0 +1,125 @@ +From 23c08dc4ff28b5ca1aa5ee745a5e9688561e8f6a Mon Sep 17 00:00:00 2001 +From: Marek Vasut +Date: Tue, 11 Jun 2024 10:36:00 +0200 +Subject: [PATCH 3/8] net: stmmac: dwmac-stm32: Separate out external clock + rate validation + +Pull the external clock frequency validation into a separate function, +to avoid conflating it with external clock DT property decoding and +clock mux register configuration. This should make the code easier to +read and understand. + +This does change the code behavior slightly. The clock mux PMCR register +setting now depends solely on the DT properties which configure the clock +mux between external clock and internal RCC generated clock. The mux PMCR +register settings no longer depend on the supplied clock frequency, that +supplied clock frequency is now only validated, and if the clock frequency +is invalid for a mode, it is rejected. + +Previously, the code would switch the PMCR register clock mux to internal +RCC generated clock if external clock couldn't provide suitable frequency, +without checking whether the RCC generated clock frequency is correct. Such +behavior is risky at best, user should have configured their clock correctly +in the first place, so this behavior is removed here. + +Signed-off-by: Marek Vasut +Signed-off-by: Christophe Roullier +Signed-off-by: Paolo Abeni +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 51 +++++++++++++++---- + 1 file changed, 41 insertions(+), 10 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -157,25 +157,54 @@ static int stm32_dwmac_init(struct plat_ + return stm32_dwmac_clk_enable(dwmac, resume); + } + ++static int stm32mp1_validate_ethck_rate(struct plat_stmmacenet_data *plat_dat) ++{ ++ struct stm32_dwmac *dwmac = plat_dat->bsp_priv; ++ const u32 clk_rate = clk_get_rate(dwmac->clk_eth_ck); ++ ++ switch (plat_dat->mac_interface) { ++ case PHY_INTERFACE_MODE_MII: ++ case PHY_INTERFACE_MODE_GMII: ++ if (clk_rate == ETH_CK_F_25M) ++ return 0; ++ break; ++ case PHY_INTERFACE_MODE_RMII: ++ if (clk_rate == ETH_CK_F_25M || clk_rate == ETH_CK_F_50M) ++ return 0; ++ break; ++ case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII_ID: ++ case PHY_INTERFACE_MODE_RGMII_RXID: ++ case PHY_INTERFACE_MODE_RGMII_TXID: ++ if (clk_rate == ETH_CK_F_25M || clk_rate == ETH_CK_F_125M) ++ return 0; ++ break; ++ default: ++ break; ++ } ++ ++ dev_err(dwmac->dev, "Mode %s does not match eth-ck frequency %d Hz", ++ phy_modes(plat_dat->mac_interface), clk_rate); ++ return -EINVAL; ++} ++ + static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) + { + struct stm32_dwmac *dwmac = plat_dat->bsp_priv; +- u32 reg = dwmac->mode_reg, clk_rate; +- int val; ++ u32 reg = dwmac->mode_reg; ++ int val, ret; + +- clk_rate = clk_get_rate(dwmac->clk_eth_ck); + dwmac->enable_eth_ck = false; + switch (plat_dat->mac_interface) { + case PHY_INTERFACE_MODE_MII: +- if (clk_rate == ETH_CK_F_25M && dwmac->ext_phyclk) ++ if (dwmac->ext_phyclk) + dwmac->enable_eth_ck = true; + val = SYSCFG_PMCR_ETH_SEL_MII; + pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n"); + break; + case PHY_INTERFACE_MODE_GMII: + val = SYSCFG_PMCR_ETH_SEL_GMII; +- if (clk_rate == ETH_CK_F_25M && +- (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk)) { ++ if (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk) { + dwmac->enable_eth_ck = true; + val |= SYSCFG_PMCR_ETH_CLK_SEL; + } +@@ -183,8 +212,7 @@ static int stm32mp1_set_mode(struct plat + break; + case PHY_INTERFACE_MODE_RMII: + val = SYSCFG_PMCR_ETH_SEL_RMII; +- if ((clk_rate == ETH_CK_F_25M || clk_rate == ETH_CK_F_50M) && +- (dwmac->eth_ref_clk_sel_reg || dwmac->ext_phyclk)) { ++ if (dwmac->eth_ref_clk_sel_reg || dwmac->ext_phyclk) { + dwmac->enable_eth_ck = true; + val |= SYSCFG_PMCR_ETH_REF_CLK_SEL; + } +@@ -195,8 +223,7 @@ static int stm32mp1_set_mode(struct plat + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: + val = SYSCFG_PMCR_ETH_SEL_RGMII; +- if ((clk_rate == ETH_CK_F_25M || clk_rate == ETH_CK_F_125M) && +- (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk)) { ++ if (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk) { + dwmac->enable_eth_ck = true; + val |= SYSCFG_PMCR_ETH_CLK_SEL; + } +@@ -209,6 +236,10 @@ static int stm32mp1_set_mode(struct plat + return -EINVAL; + } + ++ ret = stm32mp1_validate_ethck_rate(plat_dat); ++ if (ret) ++ return ret; ++ + /* Need to update PMCCLRR (clear register) */ + regmap_write(dwmac->regmap, reg + SYSCFG_PMCCLRR_OFFSET, + dwmac->ops->syscfg_eth_mask); diff --git a/target/linux/stm32/patches-6.6/004-net-stmmac-dwmac-stm32-Separate-out-external-clock-s.patch b/target/linux/stm32/patches-6.6/004-net-stmmac-dwmac-stm32-Separate-out-external-clock-s.patch new file mode 100644 index 0000000000..2e8f76158d --- /dev/null +++ b/target/linux/stm32/patches-6.6/004-net-stmmac-dwmac-stm32-Separate-out-external-clock-s.patch @@ -0,0 +1,132 @@ +From d23ba64e733580db2809e6f6dbf6f093fbd1b91b Mon Sep 17 00:00:00 2001 +From: Marek Vasut +Date: Tue, 11 Jun 2024 10:36:01 +0200 +Subject: [PATCH 4/8] net: stmmac: dwmac-stm32: Separate out external clock + selector + +Pull the external clock selector into a separate function, to avoid +conflating it with external clock rate validation and clock mux +register configuration. This should make the code easier to read and +understand. + +The dwmac->enable_eth_ck variable in the end indicates whether the MAC +clock are supplied by external oscillator (true) or internal RCC clock +IP (false). The dwmac->enable_eth_ck value is set based on multiple DT +properties, some of them deprecated, some of them specific to bus mode. + +The following DT properties and variables are taken into account. In +each case, if the property is present or true, MAC clock is supplied +by external oscillator. +- "st,ext-phyclk", assigned to variable dwmac->ext_phyclk + - Used in any mode (MII/RMII/GMII/RGMII) + - The only non-deprecated DT property of the three +- "st,eth-clk-sel", assigned to variable dwmac->eth_clk_sel_reg + - Valid only in GMII/RGMII mode + - Deprecated property, backward compatibility only +- "st,eth-ref-clk-sel", assigned to variable dwmac->eth_ref_clk_sel_reg + - Valid only in RMII mode + - Deprecated property, backward compatibility only + +The stm32mp1_select_ethck_external() function handles the aforementioned +DT properties and sets dwmac->enable_eth_ck accordingly. + +The stm32mp1_set_mode() is adjusted to call stm32mp1_select_ethck_external() +first and then only use dwmac->enable_eth_ck to determine hardware clock mux +settings. + +No functional change intended. + +Signed-off-by: Marek Vasut +Signed-off-by: Christophe Roullier +Signed-off-by: Paolo Abeni +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 50 ++++++++++++++----- + 1 file changed, 38 insertions(+), 12 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -157,6 +157,37 @@ static int stm32_dwmac_init(struct plat_ + return stm32_dwmac_clk_enable(dwmac, resume); + } + ++static int stm32mp1_select_ethck_external(struct plat_stmmacenet_data *plat_dat) ++{ ++ struct stm32_dwmac *dwmac = plat_dat->bsp_priv; ++ ++ switch (plat_dat->mac_interface) { ++ case PHY_INTERFACE_MODE_MII: ++ dwmac->enable_eth_ck = dwmac->ext_phyclk; ++ return 0; ++ case PHY_INTERFACE_MODE_GMII: ++ dwmac->enable_eth_ck = dwmac->eth_clk_sel_reg || ++ dwmac->ext_phyclk; ++ return 0; ++ case PHY_INTERFACE_MODE_RMII: ++ dwmac->enable_eth_ck = dwmac->eth_ref_clk_sel_reg || ++ dwmac->ext_phyclk; ++ return 0; ++ case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII_ID: ++ case PHY_INTERFACE_MODE_RGMII_RXID: ++ case PHY_INTERFACE_MODE_RGMII_TXID: ++ dwmac->enable_eth_ck = dwmac->eth_clk_sel_reg || ++ dwmac->ext_phyclk; ++ return 0; ++ default: ++ dwmac->enable_eth_ck = false; ++ dev_err(dwmac->dev, "Mode %s not supported", ++ phy_modes(plat_dat->mac_interface)); ++ return -EINVAL; ++ } ++} ++ + static int stm32mp1_validate_ethck_rate(struct plat_stmmacenet_data *plat_dat) + { + struct stm32_dwmac *dwmac = plat_dat->bsp_priv; +@@ -194,28 +225,25 @@ static int stm32mp1_set_mode(struct plat + u32 reg = dwmac->mode_reg; + int val, ret; + +- dwmac->enable_eth_ck = false; ++ ret = stm32mp1_select_ethck_external(plat_dat); ++ if (ret) ++ return ret; ++ + switch (plat_dat->mac_interface) { + case PHY_INTERFACE_MODE_MII: +- if (dwmac->ext_phyclk) +- dwmac->enable_eth_ck = true; + val = SYSCFG_PMCR_ETH_SEL_MII; + pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n"); + break; + case PHY_INTERFACE_MODE_GMII: + val = SYSCFG_PMCR_ETH_SEL_GMII; +- if (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk) { +- dwmac->enable_eth_ck = true; ++ if (dwmac->enable_eth_ck) + val |= SYSCFG_PMCR_ETH_CLK_SEL; +- } + pr_debug("SYSCFG init : PHY_INTERFACE_MODE_GMII\n"); + break; + case PHY_INTERFACE_MODE_RMII: + val = SYSCFG_PMCR_ETH_SEL_RMII; +- if (dwmac->eth_ref_clk_sel_reg || dwmac->ext_phyclk) { +- dwmac->enable_eth_ck = true; ++ if (dwmac->enable_eth_ck) + val |= SYSCFG_PMCR_ETH_REF_CLK_SEL; +- } + pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RMII\n"); + break; + case PHY_INTERFACE_MODE_RGMII: +@@ -223,10 +251,8 @@ static int stm32mp1_set_mode(struct plat + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: + val = SYSCFG_PMCR_ETH_SEL_RGMII; +- if (dwmac->eth_clk_sel_reg || dwmac->ext_phyclk) { +- dwmac->enable_eth_ck = true; ++ if (dwmac->enable_eth_ck) + val |= SYSCFG_PMCR_ETH_CLK_SEL; +- } + pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RGMII\n"); + break; + default: diff --git a/target/linux/stm32/patches-6.6/005-net-stmmac-dwmac-stm32-Extract-PMCR-configuration.patch b/target/linux/stm32/patches-6.6/005-net-stmmac-dwmac-stm32-Extract-PMCR-configuration.patch new file mode 100644 index 0000000000..b28884df58 --- /dev/null +++ b/target/linux/stm32/patches-6.6/005-net-stmmac-dwmac-stm32-Extract-PMCR-configuration.patch @@ -0,0 +1,71 @@ +From bb7ab910631ee0ade0758a3c4aa8dadc3b6934b6 Mon Sep 17 00:00:00 2001 +From: Marek Vasut +Date: Tue, 11 Jun 2024 10:36:02 +0200 +Subject: [PATCH 5/8] net: stmmac: dwmac-stm32: Extract PMCR configuration + +Pull the PMCR clock mux configuration into a separate function. This is +the final change of three, which moves external clock rate validation, +external clock selector decoding, and clock mux configuration into +separate functions. This should make the code easier to understand. +No functional change intended. + +Signed-off-by: Marek Vasut +Signed-off-by: Christophe Roullier +Signed-off-by: Paolo Abeni +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 27 ++++++++++++------- + 1 file changed, 17 insertions(+), 10 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -219,15 +219,11 @@ static int stm32mp1_validate_ethck_rate( + return -EINVAL; + } + +-static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) ++static int stm32mp1_configure_pmcr(struct plat_stmmacenet_data *plat_dat) + { + struct stm32_dwmac *dwmac = plat_dat->bsp_priv; + u32 reg = dwmac->mode_reg; +- int val, ret; +- +- ret = stm32mp1_select_ethck_external(plat_dat); +- if (ret) +- return ret; ++ int val; + + switch (plat_dat->mac_interface) { + case PHY_INTERFACE_MODE_MII: +@@ -262,10 +258,6 @@ static int stm32mp1_set_mode(struct plat + return -EINVAL; + } + +- ret = stm32mp1_validate_ethck_rate(plat_dat); +- if (ret) +- return ret; +- + /* Need to update PMCCLRR (clear register) */ + regmap_write(dwmac->regmap, reg + SYSCFG_PMCCLRR_OFFSET, + dwmac->ops->syscfg_eth_mask); +@@ -275,6 +267,21 @@ static int stm32mp1_set_mode(struct plat + dwmac->ops->syscfg_eth_mask, val); + } + ++static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) ++{ ++ int ret; ++ ++ ret = stm32mp1_select_ethck_external(plat_dat); ++ if (ret) ++ return ret; ++ ++ ret = stm32mp1_validate_ethck_rate(plat_dat); ++ if (ret) ++ return ret; ++ ++ return stm32mp1_configure_pmcr(plat_dat); ++} ++ + static int stm32mcu_set_mode(struct plat_stmmacenet_data *plat_dat) + { + struct stm32_dwmac *dwmac = plat_dat->bsp_priv; diff --git a/target/linux/stm32/patches-6.6/006-net-stmmac-dwmac-stm32-Clean-up-the-debug-prints.patch b/target/linux/stm32/patches-6.6/006-net-stmmac-dwmac-stm32-Clean-up-the-debug-prints.patch new file mode 100644 index 0000000000..45050ae077 --- /dev/null +++ b/target/linux/stm32/patches-6.6/006-net-stmmac-dwmac-stm32-Clean-up-the-debug-prints.patch @@ -0,0 +1,83 @@ +From 0476213f50452446fedd1a918b7bc72eb39a4c46 Mon Sep 17 00:00:00 2001 +From: Marek Vasut +Date: Tue, 11 Jun 2024 10:36:03 +0200 +Subject: [PATCH 6/8] net: stmmac: dwmac-stm32: Clean up the debug prints + +Use dev_err()/dev_dbg() and phy_modes() to print PHY mode instead of +pr_debug() and hand-written PHY mode decoding. This way, each debug +print has associated device with it and duplicated mode decoding is +removed. + +Signed-off-by: Marek Vasut +Signed-off-by: Christophe Roullier +Signed-off-by: Paolo Abeni +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -228,19 +228,16 @@ static int stm32mp1_configure_pmcr(struc + switch (plat_dat->mac_interface) { + case PHY_INTERFACE_MODE_MII: + val = SYSCFG_PMCR_ETH_SEL_MII; +- pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n"); + break; + case PHY_INTERFACE_MODE_GMII: + val = SYSCFG_PMCR_ETH_SEL_GMII; + if (dwmac->enable_eth_ck) + val |= SYSCFG_PMCR_ETH_CLK_SEL; +- pr_debug("SYSCFG init : PHY_INTERFACE_MODE_GMII\n"); + break; + case PHY_INTERFACE_MODE_RMII: + val = SYSCFG_PMCR_ETH_SEL_RMII; + if (dwmac->enable_eth_ck) + val |= SYSCFG_PMCR_ETH_REF_CLK_SEL; +- pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RMII\n"); + break; + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: +@@ -249,15 +246,16 @@ static int stm32mp1_configure_pmcr(struc + val = SYSCFG_PMCR_ETH_SEL_RGMII; + if (dwmac->enable_eth_ck) + val |= SYSCFG_PMCR_ETH_CLK_SEL; +- pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RGMII\n"); + break; + default: +- pr_debug("SYSCFG init : Do not manage %d interface\n", +- plat_dat->mac_interface); ++ dev_err(dwmac->dev, "Mode %s not supported", ++ phy_modes(plat_dat->mac_interface)); + /* Do not manage others interfaces */ + return -EINVAL; + } + ++ dev_dbg(dwmac->dev, "Mode %s", phy_modes(plat_dat->mac_interface)); ++ + /* Need to update PMCCLRR (clear register) */ + regmap_write(dwmac->regmap, reg + SYSCFG_PMCCLRR_OFFSET, + dwmac->ops->syscfg_eth_mask); +@@ -291,19 +289,19 @@ static int stm32mcu_set_mode(struct plat + switch (plat_dat->mac_interface) { + case PHY_INTERFACE_MODE_MII: + val = SYSCFG_MCU_ETH_SEL_MII; +- pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n"); + break; + case PHY_INTERFACE_MODE_RMII: + val = SYSCFG_MCU_ETH_SEL_RMII; +- pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RMII\n"); + break; + default: +- pr_debug("SYSCFG init : Do not manage %d interface\n", +- plat_dat->mac_interface); ++ dev_err(dwmac->dev, "Mode %s not supported", ++ phy_modes(plat_dat->mac_interface)); + /* Do not manage others interfaces */ + return -EINVAL; + } + ++ dev_dbg(dwmac->dev, "Mode %s", phy_modes(plat_dat->mac_interface)); ++ + return regmap_update_bits(dwmac->regmap, reg, + dwmac->ops->syscfg_eth_mask, val << 23); + } diff --git a/target/linux/stm32/patches-6.6/007-net-stmmac-dwmac-stm32-Mask-support-for-PMCR-configu.patch b/target/linux/stm32/patches-6.6/007-net-stmmac-dwmac-stm32-Mask-support-for-PMCR-configu.patch new file mode 100644 index 0000000000..336378abb3 --- /dev/null +++ b/target/linux/stm32/patches-6.6/007-net-stmmac-dwmac-stm32-Mask-support-for-PMCR-configu.patch @@ -0,0 +1,101 @@ +From 796669a85c5c4fa80cb8790e9adcccbbd99750e8 Mon Sep 17 00:00:00 2001 +From: Christophe Roullier +Date: Tue, 11 Jun 2024 10:36:05 +0200 +Subject: [PATCH 7/8] net: stmmac: dwmac-stm32: Mask support for PMCR + configuration + +Add possibility to have second argument in syscon property to manage +mask. This mask will be used to address right BITFIELDS of PMCR register. + +Signed-off-by: Christophe Roullier +Reviewed-by: Marek Vasut +Signed-off-by: Paolo Abeni +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 28 +++++++++++++------ + 1 file changed, 19 insertions(+), 9 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -90,6 +90,7 @@ struct stm32_dwmac { + int eth_ref_clk_sel_reg; + int irq_pwr_wakeup; + u32 mode_reg; /* MAC glue-logic mode register */ ++ u32 mode_mask; + struct regmap *regmap; + u32 speed; + const struct stm32_ops *ops; +@@ -102,8 +103,8 @@ struct stm32_ops { + void (*resume)(struct stm32_dwmac *dwmac); + int (*parse_data)(struct stm32_dwmac *dwmac, + struct device *dev); +- u32 syscfg_eth_mask; + bool clk_rx_enable_in_suspend; ++ u32 syscfg_clr_off; + }; + + static int stm32_dwmac_clk_enable(struct stm32_dwmac *dwmac, bool resume) +@@ -256,13 +257,16 @@ static int stm32mp1_configure_pmcr(struc + + dev_dbg(dwmac->dev, "Mode %s", phy_modes(plat_dat->mac_interface)); + ++ /* Shift value at correct ethernet MAC offset in SYSCFG_PMCSETR */ ++ val <<= ffs(dwmac->mode_mask) - ffs(SYSCFG_MP1_ETH_MASK); ++ + /* Need to update PMCCLRR (clear register) */ +- regmap_write(dwmac->regmap, reg + SYSCFG_PMCCLRR_OFFSET, +- dwmac->ops->syscfg_eth_mask); ++ regmap_write(dwmac->regmap, dwmac->ops->syscfg_clr_off, ++ dwmac->mode_mask); + + /* Update PMCSETR (set register) */ + return regmap_update_bits(dwmac->regmap, reg, +- dwmac->ops->syscfg_eth_mask, val); ++ dwmac->mode_mask, val); + } + + static int stm32mp1_set_mode(struct plat_stmmacenet_data *plat_dat) +@@ -303,7 +307,7 @@ static int stm32mcu_set_mode(struct plat + dev_dbg(dwmac->dev, "Mode %s", phy_modes(plat_dat->mac_interface)); + + return regmap_update_bits(dwmac->regmap, reg, +- dwmac->ops->syscfg_eth_mask, val << 23); ++ SYSCFG_MCU_ETH_MASK, val << 23); + } + + static void stm32_dwmac_clk_disable(struct stm32_dwmac *dwmac, bool suspend) +@@ -348,8 +352,15 @@ static int stm32_dwmac_parse_data(struct + return PTR_ERR(dwmac->regmap); + + err = of_property_read_u32_index(np, "st,syscon", 1, &dwmac->mode_reg); +- if (err) ++ if (err) { + dev_err(dev, "Can't get sysconfig mode offset (%d)\n", err); ++ return err; ++ } ++ ++ dwmac->mode_mask = SYSCFG_MP1_ETH_MASK; ++ err = of_property_read_u32_index(np, "st,syscon", 2, &dwmac->mode_mask); ++ if (err) ++ dev_dbg(dev, "Warning sysconfig register mask not set\n"); + + return err; + } +@@ -540,8 +551,7 @@ static SIMPLE_DEV_PM_OPS(stm32_dwmac_pm_ + stm32_dwmac_suspend, stm32_dwmac_resume); + + static struct stm32_ops stm32mcu_dwmac_data = { +- .set_mode = stm32mcu_set_mode, +- .syscfg_eth_mask = SYSCFG_MCU_ETH_MASK ++ .set_mode = stm32mcu_set_mode + }; + + static struct stm32_ops stm32mp1_dwmac_data = { +@@ -549,7 +559,7 @@ static struct stm32_ops stm32mp1_dwmac_d + .suspend = stm32mp1_suspend, + .resume = stm32mp1_resume, + .parse_data = stm32mp1_parse_data, +- .syscfg_eth_mask = SYSCFG_MP1_ETH_MASK, ++ .syscfg_clr_off = 0x44, + .clk_rx_enable_in_suspend = true + }; + diff --git a/target/linux/stm32/patches-6.6/008-net-stmmac-dwmac-stm32-add-management-of-stm32mp13-f.patch b/target/linux/stm32/patches-6.6/008-net-stmmac-dwmac-stm32-add-management-of-stm32mp13-f.patch new file mode 100644 index 0000000000..c2526019e2 --- /dev/null +++ b/target/linux/stm32/patches-6.6/008-net-stmmac-dwmac-stm32-add-management-of-stm32mp13-f.patch @@ -0,0 +1,94 @@ +From 8d28aaf5d5dbfd1f452286fa6ac571df0bcf00ad Mon Sep 17 00:00:00 2001 +From: Christophe Roullier +Date: Tue, 11 Jun 2024 10:36:06 +0200 +Subject: [PATCH 8/8] net: stmmac: dwmac-stm32: add management of stm32mp13 for + stm32 + +Add Ethernet support for STM32MP13. +STM32MP13 is STM32 SOC with 2 GMACs instances. +GMAC IP version is SNPS 4.20. +GMAC IP configure with 1 RX and 1 TX queue. +DMA HW capability register supported +RX Checksum Offload Engine supported +TX Checksum insertion supported +Wake-Up On Lan supported +TSO supported + +Signed-off-by: Christophe Roullier +Reviewed-by: Marek Vasut +Signed-off-by: Paolo Abeni +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 32 ++++++++++++++++--- + 1 file changed, 28 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -104,6 +104,7 @@ struct stm32_ops { + int (*parse_data)(struct stm32_dwmac *dwmac, + struct device *dev); + bool clk_rx_enable_in_suspend; ++ bool is_mp13; + u32 syscfg_clr_off; + }; + +@@ -224,11 +225,18 @@ static int stm32mp1_configure_pmcr(struc + { + struct stm32_dwmac *dwmac = plat_dat->bsp_priv; + u32 reg = dwmac->mode_reg; +- int val; ++ int val = 0; + + switch (plat_dat->mac_interface) { + case PHY_INTERFACE_MODE_MII: +- val = SYSCFG_PMCR_ETH_SEL_MII; ++ /* ++ * STM32MP15xx supports both MII and GMII, STM32MP13xx MII only. ++ * SYSCFG_PMCSETR ETH_SELMII is present only on STM32MP15xx and ++ * acts as a selector between 0:GMII and 1:MII. As STM32MP13xx ++ * supports only MII, ETH_SELMII is not present. ++ */ ++ if (!dwmac->ops->is_mp13) /* Select MII mode on STM32MP15xx */ ++ val |= SYSCFG_PMCR_ETH_SEL_MII; + break; + case PHY_INTERFACE_MODE_GMII: + val = SYSCFG_PMCR_ETH_SEL_GMII; +@@ -359,8 +367,12 @@ static int stm32_dwmac_parse_data(struct + + dwmac->mode_mask = SYSCFG_MP1_ETH_MASK; + err = of_property_read_u32_index(np, "st,syscon", 2, &dwmac->mode_mask); +- if (err) +- dev_dbg(dev, "Warning sysconfig register mask not set\n"); ++ if (err) { ++ if (dwmac->ops->is_mp13) ++ dev_err(dev, "Sysconfig register mask must be set (%d)\n", err); ++ else ++ dev_dbg(dev, "Warning sysconfig register mask not set\n"); ++ } + + return err; + } +@@ -560,12 +572,24 @@ static struct stm32_ops stm32mp1_dwmac_d + .resume = stm32mp1_resume, + .parse_data = stm32mp1_parse_data, + .syscfg_clr_off = 0x44, ++ .is_mp13 = false, ++ .clk_rx_enable_in_suspend = true ++}; ++ ++static struct stm32_ops stm32mp13_dwmac_data = { ++ .set_mode = stm32mp1_set_mode, ++ .suspend = stm32mp1_suspend, ++ .resume = stm32mp1_resume, ++ .parse_data = stm32mp1_parse_data, ++ .syscfg_clr_off = 0x08, ++ .is_mp13 = true, + .clk_rx_enable_in_suspend = true + }; + + static const struct of_device_id stm32_dwmac_match[] = { + { .compatible = "st,stm32-dwmac", .data = &stm32mcu_dwmac_data}, + { .compatible = "st,stm32mp1-dwmac", .data = &stm32mp1_dwmac_data}, ++ { .compatible = "st,stm32mp13-dwmac", .data = &stm32mp13_dwmac_data}, + { } + }; + MODULE_DEVICE_TABLE(of, stm32_dwmac_match); diff --git a/target/linux/stm32/patches-6.6/009-ARM-dts-stm32-add-ETZPC-as-a-system-bus-for-STM32MP1.patch b/target/linux/stm32/patches-6.6/009-ARM-dts-stm32-add-ETZPC-as-a-system-bus-for-STM32MP1.patch new file mode 100644 index 0000000000..f00001bc47 --- /dev/null +++ b/target/linux/stm32/patches-6.6/009-ARM-dts-stm32-add-ETZPC-as-a-system-bus-for-STM32MP1.patch @@ -0,0 +1,1192 @@ +From d788961c5b25d9d822c4230bfbc536a6736b91ff Mon Sep 17 00:00:00 2001 +From: Gatien Chevallier +Date: Fri, 5 Jan 2024 14:04:03 +0100 +Subject: [PATCH 1/5] ARM: dts: stm32: add ETZPC as a system bus for STM32MP13x + boards + +ETZPC is a firewall controller. Put all peripherals filtered by the +ETZPC as ETZPC subnodes and keep the "simple-bus" compatible for +backward compatibility. + +Signed-off-by: Gatien Chevallier +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp131.dtsi | 1020 +++++++++++++------------ + arch/arm/boot/dts/st/stm32mp133.dtsi | 50 +- + arch/arm/boot/dts/st/stm32mp13xc.dtsi | 18 +- + arch/arm/boot/dts/st/stm32mp13xf.dtsi | 18 +- + 4 files changed, 569 insertions(+), 537 deletions(-) + +--- a/arch/arm/boot/dts/st/stm32mp131.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp131.dtsi +@@ -745,340 +745,6 @@ + dma-channels = <16>; + }; + +- adc_2: adc@48004000 { +- compatible = "st,stm32mp13-adc-core"; +- reg = <0x48004000 0x400>; +- interrupts = ; +- clocks = <&rcc ADC2>, <&rcc ADC2_K>; +- clock-names = "bus", "adc"; +- interrupt-controller; +- #interrupt-cells = <1>; +- #address-cells = <1>; +- #size-cells = <0>; +- status = "disabled"; +- +- adc2: adc@0 { +- compatible = "st,stm32mp13-adc"; +- #io-channel-cells = <1>; +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0x0>; +- interrupt-parent = <&adc_2>; +- interrupts = <0>; +- dmas = <&dmamux1 10 0x400 0x80000001>; +- dma-names = "rx"; +- status = "disabled"; +- +- channel@13 { +- reg = <13>; +- label = "vrefint"; +- }; +- channel@14 { +- reg = <14>; +- label = "vddcore"; +- }; +- channel@16 { +- reg = <16>; +- label = "vddcpu"; +- }; +- channel@17 { +- reg = <17>; +- label = "vddq_ddr"; +- }; +- }; +- }; +- +- usbotg_hs: usb@49000000 { +- compatible = "st,stm32mp15-hsotg", "snps,dwc2"; +- reg = <0x49000000 0x40000>; +- clocks = <&rcc USBO_K>; +- clock-names = "otg"; +- resets = <&rcc USBO_R>; +- reset-names = "dwc2"; +- interrupts = ; +- g-rx-fifo-size = <512>; +- g-np-tx-fifo-size = <32>; +- g-tx-fifo-size = <256 16 16 16 16 16 16 16>; +- dr_mode = "otg"; +- otg-rev = <0x200>; +- usb33d-supply = <&scmi_usb33>; +- status = "disabled"; +- }; +- +- usart1: serial@4c000000 { +- compatible = "st,stm32h7-uart"; +- reg = <0x4c000000 0x400>; +- interrupts-extended = <&exti 26 IRQ_TYPE_LEVEL_HIGH>; +- clocks = <&rcc USART1_K>; +- resets = <&rcc USART1_R>; +- wakeup-source; +- dmas = <&dmamux1 41 0x400 0x5>, +- <&dmamux1 42 0x400 0x1>; +- dma-names = "rx", "tx"; +- status = "disabled"; +- }; +- +- usart2: serial@4c001000 { +- compatible = "st,stm32h7-uart"; +- reg = <0x4c001000 0x400>; +- interrupts-extended = <&exti 27 IRQ_TYPE_LEVEL_HIGH>; +- clocks = <&rcc USART2_K>; +- resets = <&rcc USART2_R>; +- wakeup-source; +- dmas = <&dmamux1 43 0x400 0x5>, +- <&dmamux1 44 0x400 0x1>; +- dma-names = "rx", "tx"; +- status = "disabled"; +- }; +- +- i2s4: audio-controller@4c002000 { +- compatible = "st,stm32h7-i2s"; +- reg = <0x4c002000 0x400>; +- #sound-dai-cells = <0>; +- interrupts = ; +- dmas = <&dmamux1 83 0x400 0x01>, +- <&dmamux1 84 0x400 0x01>; +- dma-names = "rx", "tx"; +- status = "disabled"; +- }; +- +- spi4: spi@4c002000 { +- compatible = "st,stm32h7-spi"; +- reg = <0x4c002000 0x400>; +- interrupts = ; +- clocks = <&rcc SPI4_K>; +- resets = <&rcc SPI4_R>; +- #address-cells = <1>; +- #size-cells = <0>; +- dmas = <&dmamux1 83 0x400 0x01>, +- <&dmamux1 84 0x400 0x01>; +- dma-names = "rx", "tx"; +- status = "disabled"; +- }; +- +- spi5: spi@4c003000 { +- compatible = "st,stm32h7-spi"; +- reg = <0x4c003000 0x400>; +- interrupts = ; +- clocks = <&rcc SPI5_K>; +- resets = <&rcc SPI5_R>; +- #address-cells = <1>; +- #size-cells = <0>; +- dmas = <&dmamux1 85 0x400 0x01>, +- <&dmamux1 86 0x400 0x01>; +- dma-names = "rx", "tx"; +- status = "disabled"; +- }; +- +- i2c3: i2c@4c004000 { +- compatible = "st,stm32mp13-i2c"; +- reg = <0x4c004000 0x400>; +- interrupt-names = "event", "error"; +- interrupts = , +- ; +- clocks = <&rcc I2C3_K>; +- resets = <&rcc I2C3_R>; +- #address-cells = <1>; +- #size-cells = <0>; +- dmas = <&dmamux1 73 0x400 0x1>, +- <&dmamux1 74 0x400 0x1>; +- dma-names = "rx", "tx"; +- st,syscfg-fmp = <&syscfg 0x4 0x4>; +- i2c-analog-filter; +- status = "disabled"; +- }; +- +- i2c4: i2c@4c005000 { +- compatible = "st,stm32mp13-i2c"; +- reg = <0x4c005000 0x400>; +- interrupt-names = "event", "error"; +- interrupts = , +- ; +- clocks = <&rcc I2C4_K>; +- resets = <&rcc I2C4_R>; +- #address-cells = <1>; +- #size-cells = <0>; +- dmas = <&dmamux1 75 0x400 0x1>, +- <&dmamux1 76 0x400 0x1>; +- dma-names = "rx", "tx"; +- st,syscfg-fmp = <&syscfg 0x4 0x8>; +- i2c-analog-filter; +- status = "disabled"; +- }; +- +- i2c5: i2c@4c006000 { +- compatible = "st,stm32mp13-i2c"; +- reg = <0x4c006000 0x400>; +- interrupt-names = "event", "error"; +- interrupts = , +- ; +- clocks = <&rcc I2C5_K>; +- resets = <&rcc I2C5_R>; +- #address-cells = <1>; +- #size-cells = <0>; +- dmas = <&dmamux1 115 0x400 0x1>, +- <&dmamux1 116 0x400 0x1>; +- dma-names = "rx", "tx"; +- st,syscfg-fmp = <&syscfg 0x4 0x10>; +- i2c-analog-filter; +- status = "disabled"; +- }; +- +- timers12: timer@4c007000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-timers"; +- reg = <0x4c007000 0x400>; +- interrupts = ; +- interrupt-names = "global"; +- clocks = <&rcc TIM12_K>; +- clock-names = "int"; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- timer@11 { +- compatible = "st,stm32h7-timer-trigger"; +- reg = <11>; +- status = "disabled"; +- }; +- }; +- +- timers13: timer@4c008000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-timers"; +- reg = <0x4c008000 0x400>; +- interrupts = ; +- interrupt-names = "global"; +- clocks = <&rcc TIM13_K>; +- clock-names = "int"; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- timer@12 { +- compatible = "st,stm32h7-timer-trigger"; +- reg = <12>; +- status = "disabled"; +- }; +- }; +- +- timers14: timer@4c009000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-timers"; +- reg = <0x4c009000 0x400>; +- interrupts = ; +- interrupt-names = "global"; +- clocks = <&rcc TIM14_K>; +- clock-names = "int"; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- timer@13 { +- compatible = "st,stm32h7-timer-trigger"; +- reg = <13>; +- status = "disabled"; +- }; +- }; +- +- timers15: timer@4c00a000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-timers"; +- reg = <0x4c00a000 0x400>; +- interrupts = ; +- interrupt-names = "global"; +- clocks = <&rcc TIM15_K>; +- clock-names = "int"; +- dmas = <&dmamux1 105 0x400 0x1>, +- <&dmamux1 106 0x400 0x1>, +- <&dmamux1 107 0x400 0x1>, +- <&dmamux1 108 0x400 0x1>; +- dma-names = "ch1", "up", "trig", "com"; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- timer@14 { +- compatible = "st,stm32h7-timer-trigger"; +- reg = <14>; +- status = "disabled"; +- }; +- }; +- +- timers16: timer@4c00b000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-timers"; +- reg = <0x4c00b000 0x400>; +- interrupts = ; +- interrupt-names = "global"; +- clocks = <&rcc TIM16_K>; +- clock-names = "int"; +- dmas = <&dmamux1 109 0x400 0x1>, +- <&dmamux1 110 0x400 0x1>; +- dma-names = "ch1", "up"; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- timer@15 { +- compatible = "st,stm32h7-timer-trigger"; +- reg = <15>; +- status = "disabled"; +- }; +- }; +- +- timers17: timer@4c00c000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-timers"; +- reg = <0x4c00c000 0x400>; +- interrupts = ; +- interrupt-names = "global"; +- clocks = <&rcc TIM17_K>; +- clock-names = "int"; +- dmas = <&dmamux1 111 0x400 0x1>, +- <&dmamux1 112 0x400 0x1>; +- dma-names = "ch1", "up"; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- timer@16 { +- compatible = "st,stm32h7-timer-trigger"; +- reg = <16>; +- status = "disabled"; +- }; +- }; +- + rcc: rcc@50000000 { + compatible = "st,stm32mp13-rcc", "syscon"; + reg = <0x50000000 0x1000>; +@@ -1105,69 +771,6 @@ + clocks = <&rcc SYSCFG>; + }; + +- lptimer2: timer@50021000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-lptimer"; +- reg = <0x50021000 0x400>; +- interrupts-extended = <&exti 48 IRQ_TYPE_LEVEL_HIGH>; +- clocks = <&rcc LPTIM2_K>; +- clock-names = "mux"; +- wakeup-source; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm-lp"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- trigger@1 { +- compatible = "st,stm32-lptimer-trigger"; +- reg = <1>; +- status = "disabled"; +- }; +- +- counter { +- compatible = "st,stm32-lptimer-counter"; +- status = "disabled"; +- }; +- +- timer { +- compatible = "st,stm32-lptimer-timer"; +- status = "disabled"; +- }; +- }; +- +- lptimer3: timer@50022000 { +- #address-cells = <1>; +- #size-cells = <0>; +- compatible = "st,stm32-lptimer"; +- reg = <0x50022000 0x400>; +- interrupts-extended = <&exti 50 IRQ_TYPE_LEVEL_HIGH>; +- clocks = <&rcc LPTIM3_K>; +- clock-names = "mux"; +- wakeup-source; +- status = "disabled"; +- +- pwm { +- compatible = "st,stm32-pwm-lp"; +- #pwm-cells = <3>; +- status = "disabled"; +- }; +- +- trigger@2 { +- compatible = "st,stm32-lptimer-trigger"; +- reg = <2>; +- status = "disabled"; +- }; +- +- timer { +- compatible = "st,stm32-lptimer-timer"; +- status = "disabled"; +- }; +- }; +- + lptimer4: timer@50023000 { + compatible = "st,stm32-lptimer"; + reg = <0x50023000 0x400>; +@@ -1220,79 +823,10 @@ + dma-requests = <48>; + }; + +- fmc: memory-controller@58002000 { +- compatible = "st,stm32mp1-fmc2-ebi"; +- reg = <0x58002000 0x1000>; +- ranges = <0 0 0x60000000 0x04000000>, /* EBI CS 1 */ +- <1 0 0x64000000 0x04000000>, /* EBI CS 2 */ +- <2 0 0x68000000 0x04000000>, /* EBI CS 3 */ +- <3 0 0x6c000000 0x04000000>, /* EBI CS 4 */ +- <4 0 0x80000000 0x10000000>; /* NAND */ +- #address-cells = <2>; +- #size-cells = <1>; +- clocks = <&rcc FMC_K>; +- resets = <&rcc FMC_R>; +- status = "disabled"; +- +- nand-controller@4,0 { +- compatible = "st,stm32mp1-fmc2-nfc"; +- reg = <4 0x00000000 0x1000>, +- <4 0x08010000 0x1000>, +- <4 0x08020000 0x1000>, +- <4 0x01000000 0x1000>, +- <4 0x09010000 0x1000>, +- <4 0x09020000 0x1000>; +- #address-cells = <1>; +- #size-cells = <0>; +- interrupts = ; +- dmas = <&mdma 24 0x2 0x12000a02 0x0 0x0>, +- <&mdma 24 0x2 0x12000a08 0x0 0x0>, +- <&mdma 25 0x2 0x12000a0a 0x0 0x0>; +- dma-names = "tx", "rx", "ecc"; +- status = "disabled"; +- }; +- }; +- +- qspi: spi@58003000 { +- compatible = "st,stm32f469-qspi"; +- reg = <0x58003000 0x1000>, <0x70000000 0x10000000>; +- reg-names = "qspi", "qspi_mm"; +- #address-cells = <1>; +- #size-cells = <0>; +- interrupts = ; +- dmas = <&mdma 26 0x2 0x10100002 0x0 0x0>, +- <&mdma 26 0x2 0x10100008 0x0 0x0>; +- dma-names = "tx", "rx"; +- clocks = <&rcc QSPI_K>; +- resets = <&rcc QSPI_R>; +- status = "disabled"; +- }; +- +- sdmmc1: mmc@58005000 { +- compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell"; +- arm,primecell-periphid = <0x20253180>; +- reg = <0x58005000 0x1000>, <0x58006000 0x1000>; +- interrupts = ; +- clocks = <&rcc SDMMC1_K>; +- clock-names = "apb_pclk"; +- resets = <&rcc SDMMC1_R>; +- cap-sd-highspeed; +- cap-mmc-highspeed; +- max-frequency = <130000000>; +- status = "disabled"; +- }; +- +- sdmmc2: mmc@58007000 { +- compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell"; +- arm,primecell-periphid = <0x20253180>; +- reg = <0x58007000 0x1000>, <0x58008000 0x1000>; +- interrupts = ; +- clocks = <&rcc SDMMC2_K>; +- clock-names = "apb_pclk"; +- resets = <&rcc SDMMC2_R>; +- cap-sd-highspeed; +- cap-mmc-highspeed; +- max-frequency = <130000000>; ++ crc1: crc@58009000 { ++ compatible = "st,stm32f7-crc"; ++ reg = <0x58009000 0x400>; ++ clocks = <&rcc CRC1>; + status = "disabled"; + }; + +@@ -1323,29 +857,6 @@ + status = "disabled"; + }; + +- usbphyc: usbphyc@5a006000 { +- #address-cells = <1>; +- #size-cells = <0>; +- #clock-cells = <0>; +- compatible = "st,stm32mp1-usbphyc"; +- reg = <0x5a006000 0x1000>; +- clocks = <&rcc USBPHY_K>; +- resets = <&rcc USBPHY_R>; +- vdda1v1-supply = <&scmi_reg11>; +- vdda1v8-supply = <&scmi_reg18>; +- status = "disabled"; +- +- usbphyc_port0: usb-phy@0 { +- #phy-cells = <0>; +- reg = <0>; +- }; +- +- usbphyc_port1: usb-phy@1 { +- #phy-cells = <1>; +- reg = <1>; +- }; +- }; +- + rtc: rtc@5c004000 { + compatible = "st,stm32mp1-rtc"; + reg = <0x5c004000 0x400>; +@@ -1374,6 +885,529 @@ + }; + }; + ++ etzpc: bus@5c007000 { ++ compatible = "simple-bus"; ++ reg = <0x5c007000 0x400>; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ ++ adc_2: adc@48004000 { ++ compatible = "st,stm32mp13-adc-core"; ++ reg = <0x48004000 0x400>; ++ interrupts = ; ++ clocks = <&rcc ADC2>, <&rcc ADC2_K>; ++ clock-names = "bus", "adc"; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ ++ adc2: adc@0 { ++ compatible = "st,stm32mp13-adc"; ++ #io-channel-cells = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; ++ interrupt-parent = <&adc_2>; ++ interrupts = <0>; ++ dmas = <&dmamux1 10 0x400 0x80000001>; ++ dma-names = "rx"; ++ status = "disabled"; ++ ++ channel@13 { ++ reg = <13>; ++ label = "vrefint"; ++ }; ++ channel@14 { ++ reg = <14>; ++ label = "vddcore"; ++ }; ++ channel@16 { ++ reg = <16>; ++ label = "vddcpu"; ++ }; ++ channel@17 { ++ reg = <17>; ++ label = "vddq_ddr"; ++ }; ++ }; ++ }; ++ ++ usbotg_hs: usb@49000000 { ++ compatible = "st,stm32mp15-hsotg", "snps,dwc2"; ++ reg = <0x49000000 0x40000>; ++ clocks = <&rcc USBO_K>; ++ clock-names = "otg"; ++ resets = <&rcc USBO_R>; ++ reset-names = "dwc2"; ++ interrupts = ; ++ g-rx-fifo-size = <512>; ++ g-np-tx-fifo-size = <32>; ++ g-tx-fifo-size = <256 16 16 16 16 16 16 16>; ++ dr_mode = "otg"; ++ otg-rev = <0x200>; ++ usb33d-supply = <&scmi_usb33>; ++ status = "disabled"; ++ }; ++ ++ usart1: serial@4c000000 { ++ compatible = "st,stm32h7-uart"; ++ reg = <0x4c000000 0x400>; ++ interrupts-extended = <&exti 26 IRQ_TYPE_LEVEL_HIGH>; ++ clocks = <&rcc USART1_K>; ++ resets = <&rcc USART1_R>; ++ wakeup-source; ++ dmas = <&dmamux1 41 0x400 0x5>, ++ <&dmamux1 42 0x400 0x1>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ ++ usart2: serial@4c001000 { ++ compatible = "st,stm32h7-uart"; ++ reg = <0x4c001000 0x400>; ++ interrupts-extended = <&exti 27 IRQ_TYPE_LEVEL_HIGH>; ++ clocks = <&rcc USART2_K>; ++ resets = <&rcc USART2_R>; ++ wakeup-source; ++ dmas = <&dmamux1 43 0x400 0x5>, ++ <&dmamux1 44 0x400 0x1>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ ++ i2s4: audio-controller@4c002000 { ++ compatible = "st,stm32h7-i2s"; ++ reg = <0x4c002000 0x400>; ++ #sound-dai-cells = <0>; ++ interrupts = ; ++ dmas = <&dmamux1 83 0x400 0x01>, ++ <&dmamux1 84 0x400 0x01>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ ++ spi4: spi@4c002000 { ++ compatible = "st,stm32h7-spi"; ++ reg = <0x4c002000 0x400>; ++ interrupts = ; ++ clocks = <&rcc SPI4_K>; ++ resets = <&rcc SPI4_R>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ dmas = <&dmamux1 83 0x400 0x01>, ++ <&dmamux1 84 0x400 0x01>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ ++ spi5: spi@4c003000 { ++ compatible = "st,stm32h7-spi"; ++ reg = <0x4c003000 0x400>; ++ interrupts = ; ++ clocks = <&rcc SPI5_K>; ++ resets = <&rcc SPI5_R>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ dmas = <&dmamux1 85 0x400 0x01>, ++ <&dmamux1 86 0x400 0x01>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ ++ i2c3: i2c@4c004000 { ++ compatible = "st,stm32mp13-i2c"; ++ reg = <0x4c004000 0x400>; ++ interrupt-names = "event", "error"; ++ interrupts = , ++ ; ++ clocks = <&rcc I2C3_K>; ++ resets = <&rcc I2C3_R>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ dmas = <&dmamux1 73 0x400 0x1>, ++ <&dmamux1 74 0x400 0x1>; ++ dma-names = "rx", "tx"; ++ st,syscfg-fmp = <&syscfg 0x4 0x4>; ++ i2c-analog-filter; ++ status = "disabled"; ++ }; ++ ++ i2c4: i2c@4c005000 { ++ compatible = "st,stm32mp13-i2c"; ++ reg = <0x4c005000 0x400>; ++ interrupt-names = "event", "error"; ++ interrupts = , ++ ; ++ clocks = <&rcc I2C4_K>; ++ resets = <&rcc I2C4_R>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ dmas = <&dmamux1 75 0x400 0x1>, ++ <&dmamux1 76 0x400 0x1>; ++ dma-names = "rx", "tx"; ++ st,syscfg-fmp = <&syscfg 0x4 0x8>; ++ i2c-analog-filter; ++ status = "disabled"; ++ }; ++ ++ i2c5: i2c@4c006000 { ++ compatible = "st,stm32mp13-i2c"; ++ reg = <0x4c006000 0x400>; ++ interrupt-names = "event", "error"; ++ interrupts = , ++ ; ++ clocks = <&rcc I2C5_K>; ++ resets = <&rcc I2C5_R>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ dmas = <&dmamux1 115 0x400 0x1>, ++ <&dmamux1 116 0x400 0x1>; ++ dma-names = "rx", "tx"; ++ st,syscfg-fmp = <&syscfg 0x4 0x10>; ++ i2c-analog-filter; ++ status = "disabled"; ++ }; ++ ++ timers12: timer@4c007000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-timers"; ++ reg = <0x4c007000 0x400>; ++ interrupts = ; ++ interrupt-names = "global"; ++ clocks = <&rcc TIM12_K>; ++ clock-names = "int"; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ timer@11 { ++ compatible = "st,stm32h7-timer-trigger"; ++ reg = <11>; ++ status = "disabled"; ++ }; ++ }; ++ ++ timers13: timer@4c008000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-timers"; ++ reg = <0x4c008000 0x400>; ++ interrupts = ; ++ interrupt-names = "global"; ++ clocks = <&rcc TIM13_K>; ++ clock-names = "int"; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ timer@12 { ++ compatible = "st,stm32h7-timer-trigger"; ++ reg = <12>; ++ status = "disabled"; ++ }; ++ }; ++ ++ timers14: timer@4c009000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-timers"; ++ reg = <0x4c009000 0x400>; ++ interrupts = ; ++ interrupt-names = "global"; ++ clocks = <&rcc TIM14_K>; ++ clock-names = "int"; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ timer@13 { ++ compatible = "st,stm32h7-timer-trigger"; ++ reg = <13>; ++ status = "disabled"; ++ }; ++ }; ++ ++ timers15: timer@4c00a000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-timers"; ++ reg = <0x4c00a000 0x400>; ++ interrupts = ; ++ interrupt-names = "global"; ++ clocks = <&rcc TIM15_K>; ++ clock-names = "int"; ++ dmas = <&dmamux1 105 0x400 0x1>, ++ <&dmamux1 106 0x400 0x1>, ++ <&dmamux1 107 0x400 0x1>, ++ <&dmamux1 108 0x400 0x1>; ++ dma-names = "ch1", "up", "trig", "com"; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ timer@14 { ++ compatible = "st,stm32h7-timer-trigger"; ++ reg = <14>; ++ status = "disabled"; ++ }; ++ }; ++ ++ timers16: timer@4c00b000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-timers"; ++ reg = <0x4c00b000 0x400>; ++ interrupts = ; ++ interrupt-names = "global"; ++ clocks = <&rcc TIM16_K>; ++ clock-names = "int"; ++ dmas = <&dmamux1 109 0x400 0x1>, ++ <&dmamux1 110 0x400 0x1>; ++ dma-names = "ch1", "up"; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ timer@15 { ++ compatible = "st,stm32h7-timer-trigger"; ++ reg = <15>; ++ status = "disabled"; ++ }; ++ }; ++ ++ timers17: timer@4c00c000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-timers"; ++ reg = <0x4c00c000 0x400>; ++ interrupts = ; ++ interrupt-names = "global"; ++ clocks = <&rcc TIM17_K>; ++ clock-names = "int"; ++ dmas = <&dmamux1 111 0x400 0x1>, ++ <&dmamux1 112 0x400 0x1>; ++ dma-names = "ch1", "up"; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ timer@16 { ++ compatible = "st,stm32h7-timer-trigger"; ++ reg = <16>; ++ status = "disabled"; ++ }; ++ }; ++ ++ lptimer2: timer@50021000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-lptimer"; ++ reg = <0x50021000 0x400>; ++ interrupts-extended = <&exti 48 IRQ_TYPE_LEVEL_HIGH>; ++ clocks = <&rcc LPTIM2_K>; ++ clock-names = "mux"; ++ wakeup-source; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm-lp"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ trigger@1 { ++ compatible = "st,stm32-lptimer-trigger"; ++ reg = <1>; ++ status = "disabled"; ++ }; ++ ++ counter { ++ compatible = "st,stm32-lptimer-counter"; ++ status = "disabled"; ++ }; ++ ++ timer { ++ compatible = "st,stm32-lptimer-timer"; ++ status = "disabled"; ++ }; ++ }; ++ ++ lptimer3: timer@50022000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "st,stm32-lptimer"; ++ reg = <0x50022000 0x400>; ++ interrupts-extended = <&exti 50 IRQ_TYPE_LEVEL_HIGH>; ++ clocks = <&rcc LPTIM3_K>; ++ clock-names = "mux"; ++ wakeup-source; ++ status = "disabled"; ++ ++ pwm { ++ compatible = "st,stm32-pwm-lp"; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ ++ trigger@2 { ++ compatible = "st,stm32-lptimer-trigger"; ++ reg = <2>; ++ status = "disabled"; ++ }; ++ ++ timer { ++ compatible = "st,stm32-lptimer-timer"; ++ status = "disabled"; ++ }; ++ }; ++ ++ hash: hash@54003000 { ++ compatible = "st,stm32mp13-hash"; ++ reg = <0x54003000 0x400>; ++ interrupts = ; ++ clocks = <&rcc HASH1>; ++ resets = <&rcc HASH1_R>; ++ dmas = <&mdma 30 0x2 0x1000a02 0x0 0x0>; ++ dma-names = "in"; ++ status = "disabled"; ++ }; ++ ++ rng: rng@54004000 { ++ compatible = "st,stm32mp13-rng"; ++ reg = <0x54004000 0x400>; ++ clocks = <&rcc RNG1_K>; ++ resets = <&rcc RNG1_R>; ++ status = "disabled"; ++ }; ++ ++ fmc: memory-controller@58002000 { ++ compatible = "st,stm32mp1-fmc2-ebi"; ++ reg = <0x58002000 0x1000>; ++ ranges = <0 0 0x60000000 0x04000000>, /* EBI CS 1 */ ++ <1 0 0x64000000 0x04000000>, /* EBI CS 2 */ ++ <2 0 0x68000000 0x04000000>, /* EBI CS 3 */ ++ <3 0 0x6c000000 0x04000000>, /* EBI CS 4 */ ++ <4 0 0x80000000 0x10000000>; /* NAND */ ++ #address-cells = <2>; ++ #size-cells = <1>; ++ clocks = <&rcc FMC_K>; ++ resets = <&rcc FMC_R>; ++ status = "disabled"; ++ ++ nand-controller@4,0 { ++ compatible = "st,stm32mp1-fmc2-nfc"; ++ reg = <4 0x00000000 0x1000>, ++ <4 0x08010000 0x1000>, ++ <4 0x08020000 0x1000>, ++ <4 0x01000000 0x1000>, ++ <4 0x09010000 0x1000>, ++ <4 0x09020000 0x1000>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ interrupts = ; ++ dmas = <&mdma 24 0x2 0x12000a02 0x0 0x0>, ++ <&mdma 24 0x2 0x12000a08 0x0 0x0>, ++ <&mdma 25 0x2 0x12000a0a 0x0 0x0>; ++ dma-names = "tx", "rx", "ecc"; ++ status = "disabled"; ++ }; ++ }; ++ ++ qspi: spi@58003000 { ++ compatible = "st,stm32f469-qspi"; ++ reg = <0x58003000 0x1000>, <0x70000000 0x10000000>; ++ reg-names = "qspi", "qspi_mm"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ interrupts = ; ++ dmas = <&mdma 26 0x2 0x10100002 0x0 0x0>, ++ <&mdma 26 0x2 0x10100008 0x0 0x0>; ++ dma-names = "tx", "rx"; ++ clocks = <&rcc QSPI_K>; ++ resets = <&rcc QSPI_R>; ++ status = "disabled"; ++ }; ++ ++ sdmmc1: mmc@58005000 { ++ compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell"; ++ arm,primecell-periphid = <0x20253180>; ++ reg = <0x58005000 0x1000>, <0x58006000 0x1000>; ++ interrupts = ; ++ clocks = <&rcc SDMMC1_K>; ++ clock-names = "apb_pclk"; ++ resets = <&rcc SDMMC1_R>; ++ cap-sd-highspeed; ++ cap-mmc-highspeed; ++ max-frequency = <130000000>; ++ status = "disabled"; ++ }; ++ ++ sdmmc2: mmc@58007000 { ++ compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell"; ++ arm,primecell-periphid = <0x20253180>; ++ reg = <0x58007000 0x1000>, <0x58008000 0x1000>; ++ interrupts = ; ++ clocks = <&rcc SDMMC2_K>; ++ clock-names = "apb_pclk"; ++ resets = <&rcc SDMMC2_R>; ++ cap-sd-highspeed; ++ cap-mmc-highspeed; ++ max-frequency = <130000000>; ++ status = "disabled"; ++ }; ++ ++ usbphyc: usbphyc@5a006000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ #clock-cells = <0>; ++ compatible = "st,stm32mp1-usbphyc"; ++ reg = <0x5a006000 0x1000>; ++ clocks = <&rcc USBPHY_K>; ++ resets = <&rcc USBPHY_R>; ++ vdda1v1-supply = <&scmi_reg11>; ++ vdda1v8-supply = <&scmi_reg18>; ++ status = "disabled"; ++ ++ usbphyc_port0: usb-phy@0 { ++ #phy-cells = <0>; ++ reg = <0>; ++ }; ++ ++ usbphyc_port1: usb-phy@1 { ++ #phy-cells = <1>; ++ reg = <1>; ++ }; ++ }; ++ }; ++ + /* + * Break node order to solve dependency probe issue between + * pinctrl and exti. +--- a/arch/arm/boot/dts/st/stm32mp133.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp133.dtsi +@@ -33,35 +33,37 @@ + bosch,mram-cfg = <0x1400 0 0 32 0 0 2 2>; + status = "disabled"; + }; ++ }; ++}; ++ ++&etzpc { ++ adc_1: adc@48003000 { ++ compatible = "st,stm32mp13-adc-core"; ++ reg = <0x48003000 0x400>; ++ interrupts = ; ++ clocks = <&rcc ADC1>, <&rcc ADC1_K>; ++ clock-names = "bus", "adc"; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; + +- adc_1: adc@48003000 { +- compatible = "st,stm32mp13-adc-core"; +- reg = <0x48003000 0x400>; +- interrupts = ; +- clocks = <&rcc ADC1>, <&rcc ADC1_K>; +- clock-names = "bus", "adc"; +- interrupt-controller; +- #interrupt-cells = <1>; ++ adc1: adc@0 { ++ compatible = "st,stm32mp13-adc"; ++ #io-channel-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; ++ reg = <0x0>; ++ interrupt-parent = <&adc_1>; ++ interrupts = <0>; ++ dmas = <&dmamux1 9 0x400 0x80000001>; ++ dma-names = "rx"; + status = "disabled"; + +- adc1: adc@0 { +- compatible = "st,stm32mp13-adc"; +- #io-channel-cells = <1>; +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0x0>; +- interrupt-parent = <&adc_1>; +- interrupts = <0>; +- dmas = <&dmamux1 9 0x400 0x80000001>; +- dma-names = "rx"; +- status = "disabled"; +- +- channel@18 { +- reg = <18>; +- label = "vrefint"; +- }; ++ channel@18 { ++ reg = <18>; ++ label = "vrefint"; + }; + }; + }; +--- a/arch/arm/boot/dts/st/stm32mp13xc.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp13xc.dtsi +@@ -4,15 +4,13 @@ + * Author: Alexandre Torgue for STMicroelectronics. + */ + +-/ { +- soc { +- cryp: crypto@54002000 { +- compatible = "st,stm32mp1-cryp"; +- reg = <0x54002000 0x400>; +- interrupts = ; +- clocks = <&rcc CRYP1>; +- resets = <&rcc CRYP1_R>; +- status = "disabled"; +- }; ++&etzpc { ++ cryp: crypto@54002000 { ++ compatible = "st,stm32mp1-cryp"; ++ reg = <0x54002000 0x400>; ++ interrupts = ; ++ clocks = <&rcc CRYP1>; ++ resets = <&rcc CRYP1_R>; ++ status = "disabled"; + }; + }; +--- a/arch/arm/boot/dts/st/stm32mp13xf.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp13xf.dtsi +@@ -4,15 +4,13 @@ + * Author: Alexandre Torgue for STMicroelectronics. + */ + +-/ { +- soc { +- cryp: crypto@54002000 { +- compatible = "st,stm32mp1-cryp"; +- reg = <0x54002000 0x400>; +- interrupts = ; +- clocks = <&rcc CRYP1>; +- resets = <&rcc CRYP1_R>; +- status = "disabled"; +- }; ++&etzpc { ++ cryp: crypto@54002000 { ++ compatible = "st,stm32mp1-cryp"; ++ reg = <0x54002000 0x400>; ++ interrupts = ; ++ clocks = <&rcc CRYP1>; ++ resets = <&rcc CRYP1_R>; ++ status = "disabled"; + }; + }; diff --git a/target/linux/stm32/patches-6.6/010-ARM-dts-stm32-put-ETZPC-as-an-access-controller-for-.patch b/target/linux/stm32/patches-6.6/010-ARM-dts-stm32-put-ETZPC-as-an-access-controller-for-.patch new file mode 100644 index 0000000000..e6a4eee057 --- /dev/null +++ b/target/linux/stm32/patches-6.6/010-ARM-dts-stm32-put-ETZPC-as-an-access-controller-for-.patch @@ -0,0 +1,265 @@ +From 21ca3d7c59595d76237faebeff4f6a979cf7ae82 Mon Sep 17 00:00:00 2001 +From: Alexandre Torgue +Date: Fri, 5 Apr 2024 13:45:24 +0200 +Subject: [PATCH 2/5] ARM: dts: stm32: put ETZPC as an access controller for + STM32MP13x boards + +Reference ETZPC as an access-control-provider. + +For more information on which peripheral is securable or supports MCU +isolation, please read the STM32MP13 reference manual + +Signed-off-by: Gatien Chevallier +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp131.dtsi | 28 ++++++++++++++++++++++++++- + arch/arm/boot/dts/st/stm32mp133.dtsi | 1 + + arch/arm/boot/dts/st/stm32mp13xc.dtsi | 1 + + arch/arm/boot/dts/st/stm32mp13xf.dtsi | 1 + + 4 files changed, 30 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/st/stm32mp131.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp131.dtsi +@@ -886,10 +886,11 @@ + }; + + etzpc: bus@5c007000 { +- compatible = "simple-bus"; ++ compatible = "st,stm32-etzpc", "simple-bus"; + reg = <0x5c007000 0x400>; + #address-cells = <1>; + #size-cells = <1>; ++ #access-controller-cells = <1>; + ranges; + + adc_2: adc@48004000 { +@@ -902,6 +903,7 @@ + #interrupt-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; ++ access-controllers = <&etzpc 33>; + status = "disabled"; + + adc2: adc@0 { +@@ -949,6 +951,7 @@ + dr_mode = "otg"; + otg-rev = <0x200>; + usb33d-supply = <&scmi_usb33>; ++ access-controllers = <&etzpc 34>; + status = "disabled"; + }; + +@@ -962,6 +965,7 @@ + dmas = <&dmamux1 41 0x400 0x5>, + <&dmamux1 42 0x400 0x1>; + dma-names = "rx", "tx"; ++ access-controllers = <&etzpc 16>; + status = "disabled"; + }; + +@@ -975,6 +979,7 @@ + dmas = <&dmamux1 43 0x400 0x5>, + <&dmamux1 44 0x400 0x1>; + dma-names = "rx", "tx"; ++ access-controllers = <&etzpc 17>; + status = "disabled"; + }; + +@@ -986,6 +991,7 @@ + dmas = <&dmamux1 83 0x400 0x01>, + <&dmamux1 84 0x400 0x01>; + dma-names = "rx", "tx"; ++ access-controllers = <&etzpc 13>; + status = "disabled"; + }; + +@@ -1000,6 +1006,7 @@ + dmas = <&dmamux1 83 0x400 0x01>, + <&dmamux1 84 0x400 0x01>; + dma-names = "rx", "tx"; ++ access-controllers = <&etzpc 18>; + status = "disabled"; + }; + +@@ -1014,6 +1021,7 @@ + dmas = <&dmamux1 85 0x400 0x01>, + <&dmamux1 86 0x400 0x01>; + dma-names = "rx", "tx"; ++ access-controllers = <&etzpc 19>; + status = "disabled"; + }; + +@@ -1032,6 +1040,7 @@ + dma-names = "rx", "tx"; + st,syscfg-fmp = <&syscfg 0x4 0x4>; + i2c-analog-filter; ++ access-controllers = <&etzpc 20>; + status = "disabled"; + }; + +@@ -1050,6 +1059,7 @@ + dma-names = "rx", "tx"; + st,syscfg-fmp = <&syscfg 0x4 0x8>; + i2c-analog-filter; ++ access-controllers = <&etzpc 21>; + status = "disabled"; + }; + +@@ -1068,6 +1078,7 @@ + dma-names = "rx", "tx"; + st,syscfg-fmp = <&syscfg 0x4 0x10>; + i2c-analog-filter; ++ access-controllers = <&etzpc 22>; + status = "disabled"; + }; + +@@ -1080,6 +1091,7 @@ + interrupt-names = "global"; + clocks = <&rcc TIM12_K>; + clock-names = "int"; ++ access-controllers = <&etzpc 23>; + status = "disabled"; + + pwm { +@@ -1104,6 +1116,7 @@ + interrupt-names = "global"; + clocks = <&rcc TIM13_K>; + clock-names = "int"; ++ access-controllers = <&etzpc 24>; + status = "disabled"; + + pwm { +@@ -1128,6 +1141,7 @@ + interrupt-names = "global"; + clocks = <&rcc TIM14_K>; + clock-names = "int"; ++ access-controllers = <&etzpc 25>; + status = "disabled"; + + pwm { +@@ -1157,6 +1171,7 @@ + <&dmamux1 107 0x400 0x1>, + <&dmamux1 108 0x400 0x1>; + dma-names = "ch1", "up", "trig", "com"; ++ access-controllers = <&etzpc 26>; + status = "disabled"; + + pwm { +@@ -1184,6 +1199,7 @@ + dmas = <&dmamux1 109 0x400 0x1>, + <&dmamux1 110 0x400 0x1>; + dma-names = "ch1", "up"; ++ access-controllers = <&etzpc 27>; + status = "disabled"; + + pwm { +@@ -1211,6 +1227,7 @@ + dmas = <&dmamux1 111 0x400 0x1>, + <&dmamux1 112 0x400 0x1>; + dma-names = "ch1", "up"; ++ access-controllers = <&etzpc 28>; + status = "disabled"; + + pwm { +@@ -1235,6 +1252,7 @@ + clocks = <&rcc LPTIM2_K>; + clock-names = "mux"; + wakeup-source; ++ access-controllers = <&etzpc 1>; + status = "disabled"; + + pwm { +@@ -1269,6 +1287,7 @@ + clocks = <&rcc LPTIM3_K>; + clock-names = "mux"; + wakeup-source; ++ access-controllers = <&etzpc 2>; + status = "disabled"; + + pwm { +@@ -1297,6 +1316,7 @@ + resets = <&rcc HASH1_R>; + dmas = <&mdma 30 0x2 0x1000a02 0x0 0x0>; + dma-names = "in"; ++ access-controllers = <&etzpc 41>; + status = "disabled"; + }; + +@@ -1305,6 +1325,7 @@ + reg = <0x54004000 0x400>; + clocks = <&rcc RNG1_K>; + resets = <&rcc RNG1_R>; ++ access-controllers = <&etzpc 40>; + status = "disabled"; + }; + +@@ -1320,6 +1341,7 @@ + #size-cells = <1>; + clocks = <&rcc FMC_K>; + resets = <&rcc FMC_R>; ++ access-controllers = <&etzpc 54>; + status = "disabled"; + + nand-controller@4,0 { +@@ -1353,6 +1375,7 @@ + dma-names = "tx", "rx"; + clocks = <&rcc QSPI_K>; + resets = <&rcc QSPI_R>; ++ access-controllers = <&etzpc 55>; + status = "disabled"; + }; + +@@ -1367,6 +1390,7 @@ + cap-sd-highspeed; + cap-mmc-highspeed; + max-frequency = <130000000>; ++ access-controllers = <&etzpc 50>; + status = "disabled"; + }; + +@@ -1381,6 +1405,7 @@ + cap-sd-highspeed; + cap-mmc-highspeed; + max-frequency = <130000000>; ++ access-controllers = <&etzpc 51>; + status = "disabled"; + }; + +@@ -1394,6 +1419,7 @@ + resets = <&rcc USBPHY_R>; + vdda1v1-supply = <&scmi_reg11>; + vdda1v8-supply = <&scmi_reg18>; ++ access-controllers = <&etzpc 5>; + status = "disabled"; + + usbphyc_port0: usb-phy@0 { +--- a/arch/arm/boot/dts/st/stm32mp133.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp133.dtsi +@@ -47,6 +47,7 @@ + #interrupt-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; ++ access-controllers = <&etzpc 32>; + status = "disabled"; + + adc1: adc@0 { +--- a/arch/arm/boot/dts/st/stm32mp13xc.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp13xc.dtsi +@@ -11,6 +11,7 @@ + interrupts = ; + clocks = <&rcc CRYP1>; + resets = <&rcc CRYP1_R>; ++ access-controllers = <&etzpc 42>; + status = "disabled"; + }; + }; +--- a/arch/arm/boot/dts/st/stm32mp13xf.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp13xf.dtsi +@@ -11,6 +11,7 @@ + interrupts = ; + clocks = <&rcc CRYP1>; + resets = <&rcc CRYP1_R>; ++ access-controllers = <&etzpc 42>; + status = "disabled"; + }; + }; diff --git a/target/linux/stm32/patches-6.6/011-ARM-dts-stm32-add-ethernet1-2-RMII-pins-for-STM32MP1.patch b/target/linux/stm32/patches-6.6/011-ARM-dts-stm32-add-ethernet1-2-RMII-pins-for-STM32MP1.patch new file mode 100644 index 0000000000..123bde8841 --- /dev/null +++ b/target/linux/stm32/patches-6.6/011-ARM-dts-stm32-add-ethernet1-2-RMII-pins-for-STM32MP1.patch @@ -0,0 +1,126 @@ +From b1468a44e0c0f43a06e027efeff4183b3aee0cf7 Mon Sep 17 00:00:00 2001 +From: Christophe Roullier +Date: Mon, 10 Jun 2024 10:03:08 +0200 +Subject: [PATCH 3/5] ARM: dts: stm32: add ethernet1/2 RMII pins for + STM32MP13F-DK board + +Those pins are used for Ethernet 1 and 2 on STM32MP13F-DK board. +ethernet1: RMII with crystal. +ethernet2: RMII without crystal. +Add analog gpio pin configuration ("sleep") to manage power mode on +stm32mp13. + +Signed-off-by: Christophe Roullier +Reviewed-by: Marek Vasut +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp13-pinctrl.dtsi | 98 +++++++++++++++++++++ + 1 file changed, 98 insertions(+) + +--- a/arch/arm/boot/dts/st/stm32mp13-pinctrl.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp13-pinctrl.dtsi +@@ -13,6 +13,104 @@ + }; + }; + ++ eth1_rgmii_pins_a: eth1-rgmii-0 { ++ pins1 { ++ pinmux = , /* ETH_RGMII_TXD0 */ ++ , /* ETH_RGMII_TXD1 */ ++ , /* ETH_RGMII_TXD2 */ ++ , /* ETH_RGMII_TXD3 */ ++ , /* ETH_RGMII_TX_CTL */ ++ , /* ETH_RGMII_GTX_CLK */ ++ , /* ETH_MDIO */ ++ ; /* ETH_MDC */ ++ bias-disable; ++ drive-push-pull; ++ slew-rate = <2>; ++ }; ++ ++ pins2 { ++ pinmux = , /* ETH_RGMII_RXD0 */ ++ , /* ETH_RGMII_RXD1 */ ++ , /* ETH_RGMII_RXD2 */ ++ , /* ETH_RGMII_RXD3 */ ++ , /* ETH_RGMII_RX_CTL */ ++ ; /* ETH_RGMII_RX_CLK */ ++ bias-disable; ++ }; ++ ++ }; ++ ++ eth1_rmii_pins_a: eth1-rmii-0 { ++ pins1 { ++ pinmux = , /* ETH_RMII_TXD0 */ ++ , /* ETH_RMII_TXD1 */ ++ , /* ETH_RMII_TX_EN */ ++ , /* ETH_RMII_REF_CLK */ ++ , /* ETH_MDIO */ ++ ; /* ETH_MDC */ ++ bias-disable; ++ drive-push-pull; ++ slew-rate = <1>; ++ }; ++ ++ pins2 { ++ pinmux = , /* ETH_RMII_RXD0 */ ++ , /* ETH_RMII_RXD1 */ ++ ; /* ETH_RMII_CRS_DV */ ++ bias-disable; ++ }; ++ ++ }; ++ ++ eth1_rmii_sleep_pins_a: eth1-rmii-sleep-0 { ++ pins1 { ++ pinmux = , /* ETH_RMII_TXD0 */ ++ , /* ETH_RMII_TXD1 */ ++ , /* ETH_RMII_TX_EN */ ++ , /* ETH_RMII_REF_CLK */ ++ , /* ETH_MDIO */ ++ , /* ETH_MDC */ ++ , /* ETH_RMII_RXD0 */ ++ , /* ETH_RMII_RXD1 */ ++ ; /* ETH_RMII_CRS_DV */ ++ }; ++ }; ++ ++ eth2_rmii_pins_a: eth2-rmii-0 { ++ pins1 { ++ pinmux = , /* ETH_RMII_TXD0 */ ++ , /* ETH_RMII_TXD1 */ ++ , /* ETH_RMII_ETHCK */ ++ , /* ETH_RMII_TX_EN */ ++ , /* ETH_MDIO */ ++ ; /* ETH_MDC */ ++ bias-disable; ++ drive-push-pull; ++ slew-rate = <1>; ++ }; ++ ++ pins2 { ++ pinmux = , /* ETH_RMII_RXD0 */ ++ , /* ETH_RMII_RXD1 */ ++ ; /* ETH_RMII_CRS_DV */ ++ bias-disable; ++ }; ++ }; ++ ++ eth2_rmii_sleep_pins_a: eth2-rmii-sleep-0 { ++ pins1 { ++ pinmux = , /* ETH_RMII_TXD0 */ ++ , /* ETH_RMII_TXD1 */ ++ , /* ETH_RMII_ETHCK */ ++ , /* ETH_RMII_TX_EN */ ++ , /* ETH_MDIO */ ++ , /* ETH_MDC */ ++ , /* ETH_RMII_RXD0 */ ++ , /* ETH_RMII_RXD1 */ ++ ; /* ETH_RMII_CRS_DV */ ++ }; ++ }; ++ + i2c1_pins_a: i2c1-0 { + pins { + pinmux = , /* I2C1_SCL */ diff --git a/target/linux/stm32/patches-6.6/012-ARM-dts-stm32-add-ethernet1-and-ethernet2-support-on.patch b/target/linux/stm32/patches-6.6/012-ARM-dts-stm32-add-ethernet1-and-ethernet2-support-on.patch new file mode 100644 index 0000000000..947b141324 --- /dev/null +++ b/target/linux/stm32/patches-6.6/012-ARM-dts-stm32-add-ethernet1-and-ethernet2-support-on.patch @@ -0,0 +1,108 @@ +From fcf6ca2da4650d0a7a9cd62c8c72341860931159 Mon Sep 17 00:00:00 2001 +From: Christophe Roullier +Date: Mon, 10 Jun 2024 10:03:07 +0200 +Subject: [PATCH 4/5] ARM: dts: stm32: add ethernet1 and ethernet2 support on + stm32mp13 + +Both instances ethernet based on GMAC SNPS IP on stm32mp13. +GMAC IP version is SNPS 4.20. + +Signed-off-by: Christophe Roullier +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp131.dtsi | 38 ++++++++++++++++++++++++++++ + arch/arm/boot/dts/st/stm32mp133.dtsi | 31 +++++++++++++++++++++++ + 2 files changed, 69 insertions(+) + +--- a/arch/arm/boot/dts/st/stm32mp131.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp131.dtsi +@@ -883,6 +883,12 @@ + ts_cal2: calib@5e { + reg = <0x5e 0x2>; + }; ++ ethernet_mac1_address: mac1@e4 { ++ reg = <0xe4 0x6>; ++ }; ++ ethernet_mac2_address: mac2@ea { ++ reg = <0xea 0x6>; ++ }; + }; + + etzpc: bus@5c007000 { +@@ -1409,6 +1415,38 @@ + status = "disabled"; + }; + ++ ethernet1: ethernet@5800a000 { ++ compatible = "st,stm32mp13-dwmac", "snps,dwmac-4.20a"; ++ reg = <0x5800a000 0x2000>; ++ reg-names = "stmmaceth"; ++ interrupts-extended = <&intc GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>, ++ <&exti 68 1>; ++ interrupt-names = "macirq", "eth_wake_irq"; ++ clock-names = "stmmaceth", ++ "mac-clk-tx", ++ "mac-clk-rx", ++ "ethstp", ++ "eth-ck"; ++ clocks = <&rcc ETH1MAC>, ++ <&rcc ETH1TX>, ++ <&rcc ETH1RX>, ++ <&rcc ETH1STP>, ++ <&rcc ETH1CK_K>; ++ st,syscon = <&syscfg 0x4 0xff0000>; ++ snps,mixed-burst; ++ snps,pbl = <2>; ++ snps,axi-config = <&stmmac_axi_config_1>; ++ snps,tso; ++ access-controllers = <&etzpc 48>; ++ status = "disabled"; ++ ++ stmmac_axi_config_1: stmmac-axi-config { ++ snps,blen = <0 0 0 0 16 8 4>; ++ snps,rd_osr_lmt = <0x7>; ++ snps,wr_osr_lmt = <0x7>; ++ }; ++ }; ++ + usbphyc: usbphyc@5a006000 { + #address-cells = <1>; + #size-cells = <0>; +--- a/arch/arm/boot/dts/st/stm32mp133.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp133.dtsi +@@ -68,4 +68,35 @@ + }; + }; + }; ++ ++ ethernet2: ethernet@5800e000 { ++ compatible = "st,stm32mp13-dwmac", "snps,dwmac-4.20a"; ++ reg = <0x5800e000 0x2000>; ++ reg-names = "stmmaceth"; ++ interrupts-extended = <&intc GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>; ++ interrupt-names = "macirq"; ++ clock-names = "stmmaceth", ++ "mac-clk-tx", ++ "mac-clk-rx", ++ "ethstp", ++ "eth-ck"; ++ clocks = <&rcc ETH2MAC>, ++ <&rcc ETH2TX>, ++ <&rcc ETH2RX>, ++ <&rcc ETH2STP>, ++ <&rcc ETH2CK_K>; ++ st,syscon = <&syscfg 0x4 0xff000000>; ++ snps,mixed-burst; ++ snps,pbl = <2>; ++ snps,axi-config = <&stmmac_axi_config_2>; ++ snps,tso; ++ access-controllers = <&etzpc 49>; ++ status = "disabled"; ++ ++ stmmac_axi_config_2: stmmac-axi-config { ++ snps,blen = <0 0 0 0 16 8 4>; ++ snps,rd_osr_lmt = <0x7>; ++ snps,wr_osr_lmt = <0x7>; ++ }; ++ }; + }; diff --git a/target/linux/stm32/patches-6.6/013-ARM-dts-stm32-add-ethernet1-for-STM32MP135F-DK-board.patch b/target/linux/stm32/patches-6.6/013-ARM-dts-stm32-add-ethernet1-for-STM32MP135F-DK-board.patch new file mode 100644 index 0000000000..79408c5bad --- /dev/null +++ b/target/linux/stm32/patches-6.6/013-ARM-dts-stm32-add-ethernet1-for-STM32MP135F-DK-board.patch @@ -0,0 +1,58 @@ +From b255afeeb33efaa974b1b2454b1f58252d783b67 Mon Sep 17 00:00:00 2001 +From: Christophe Roullier +Date: Mon, 10 Jun 2024 10:03:09 +0200 +Subject: [PATCH 5/5] ARM: dts: stm32: add ethernet1 for STM32MP135F-DK board + +Ethernet1: RMII with crystal +Ethernet2: RMII with no cristal, need "phy-supply" property to work, +today this property was managed by Ethernet glue, but should be present +and managed in PHY node. So I will push second Ethernet in next step. + +PHYs used are SMSC (LAN8742A) + +Signed-off-by: Christophe Roullier +Reviewed-by: Marek Vasut +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp135f-dk.dts | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/arch/arm/boot/dts/st/stm32mp135f-dk.dts ++++ b/arch/arm/boot/dts/st/stm32mp135f-dk.dts +@@ -19,6 +19,7 @@ + compatible = "st,stm32mp135f-dk", "st,stm32mp135"; + + aliases { ++ ethernet0 = ðernet1; + serial0 = &uart4; + serial1 = &usart1; + serial2 = &uart8; +@@ -92,6 +93,28 @@ + }; + }; + }; ++ ++ðernet1 { ++ status = "okay"; ++ pinctrl-0 = <ð1_rmii_pins_a>; ++ pinctrl-1 = <ð1_rmii_sleep_pins_a>; ++ pinctrl-names = "default", "sleep"; ++ phy-mode = "rmii"; ++ phy-handle = <&phy0_eth1>; ++ ++ mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "snps,dwmac-mdio"; ++ ++ phy0_eth1: ethernet-phy@0 { ++ compatible = "ethernet-phy-id0007.c131"; ++ reg = <0>; ++ reset-gpios = <&mcp23017 9 GPIO_ACTIVE_LOW>; ++ wakeup-source; ++ }; ++ }; ++}; + + &i2c1 { + pinctrl-names = "default", "sleep"; diff --git a/target/linux/stm32/patches-6.6/020-mmc-mmci-stm32-add-SDIO-in-band-interrupt-mode.patch b/target/linux/stm32/patches-6.6/020-mmc-mmci-stm32-add-SDIO-in-band-interrupt-mode.patch new file mode 100644 index 0000000000..235efb5716 --- /dev/null +++ b/target/linux/stm32/patches-6.6/020-mmc-mmci-stm32-add-SDIO-in-band-interrupt-mode.patch @@ -0,0 +1,166 @@ +From 1bcfbfd7c9aa716f61a01682345a1b329f6a6e66 Mon Sep 17 00:00:00 2001 +From: Christophe Kerello +Date: Wed, 8 Nov 2023 15:16:37 +0100 +Subject: [PATCH] mmc: mmci: stm32: add SDIO in-band interrupt mode + +Add the support of SDIO in-band interrupt mode for STM32 and Ux500 +variants. +It allows the SD I/O card to interrupt the host on SDMMC_D1 data line. +It is not enabled by default on Ux500 variant as this is unstable and +Ux500 users should use out-of-band IRQs. + +Signed-off-by: Christophe Kerello +Signed-off-by: Yann Gautier +Reviewed-by: Linus Walleij +Link: https://lore.kernel.org/r/20231108141637.119497-1-yann.gautier@foss.st.com +Signed-off-by: Ulf Hansson +--- + drivers/mmc/host/mmci.c | 69 +++++++++++++++++++++++++++++++++++++++-- + drivers/mmc/host/mmci.h | 2 ++ + 2 files changed, 69 insertions(+), 2 deletions(-) + +--- a/drivers/mmc/host/mmci.c ++++ b/drivers/mmc/host/mmci.c +@@ -272,6 +272,7 @@ static struct variant_data variant_stm32 + .datactrl_mask_sdio = MCI_DPSM_ST_SDIOEN, + .stm32_idmabsize_mask = GENMASK(12, 5), + .stm32_idmabsize_align = BIT(5), ++ .supports_sdio_irq = true, + .busy_timeout = true, + .busy_detect = true, + .busy_detect_flag = MCI_STM32_BUSYD0, +@@ -299,6 +300,7 @@ static struct variant_data variant_stm32 + .datactrl_mask_sdio = MCI_DPSM_ST_SDIOEN, + .stm32_idmabsize_mask = GENMASK(16, 5), + .stm32_idmabsize_align = BIT(5), ++ .supports_sdio_irq = true, + .dma_lli = true, + .busy_timeout = true, + .busy_detect = true, +@@ -327,6 +329,7 @@ static struct variant_data variant_stm32 + .datactrl_mask_sdio = MCI_DPSM_ST_SDIOEN, + .stm32_idmabsize_mask = GENMASK(16, 6), + .stm32_idmabsize_align = BIT(6), ++ .supports_sdio_irq = true, + .dma_lli = true, + .busy_timeout = true, + .busy_detect = true, +@@ -420,8 +423,9 @@ void mmci_write_pwrreg(struct mmci_host + */ + static void mmci_write_datactrlreg(struct mmci_host *host, u32 datactrl) + { +- /* Keep busy mode in DPSM if enabled */ +- datactrl |= host->datactrl_reg & host->variant->busy_dpsm_flag; ++ /* Keep busy mode in DPSM and SDIO mask if enabled */ ++ datactrl |= host->datactrl_reg & (host->variant->busy_dpsm_flag | ++ host->variant->datactrl_mask_sdio); + + if (host->datactrl_reg != datactrl) { + host->datactrl_reg = datactrl; +@@ -1761,6 +1765,25 @@ static irqreturn_t mmci_pio_irq(int irq, + return IRQ_HANDLED; + } + ++static void mmci_write_sdio_irq_bit(struct mmci_host *host, int enable) ++{ ++ void __iomem *base = host->base; ++ u32 mask = readl_relaxed(base + MMCIMASK0); ++ ++ if (enable) ++ writel_relaxed(mask | MCI_ST_SDIOITMASK, base + MMCIMASK0); ++ else ++ writel_relaxed(mask & ~MCI_ST_SDIOITMASK, base + MMCIMASK0); ++} ++ ++static void mmci_signal_sdio_irq(struct mmci_host *host, u32 status) ++{ ++ if (status & MCI_ST_SDIOIT) { ++ mmci_write_sdio_irq_bit(host, 0); ++ sdio_signal_irq(host->mmc); ++ } ++} ++ + /* + * Handle completion of command and data transfers. + */ +@@ -1805,6 +1828,9 @@ static irqreturn_t mmci_irq(int irq, voi + mmci_data_irq(host, host->data, status); + } + ++ if (host->variant->supports_sdio_irq) ++ mmci_signal_sdio_irq(host, status); ++ + /* + * Busy detection has been handled by mmci_cmd_irq() above. + * Clear the status bit to prevent polling in IRQ context. +@@ -2041,6 +2067,35 @@ static int mmci_sig_volt_switch(struct m + return ret; + } + ++static void mmci_enable_sdio_irq(struct mmc_host *mmc, int enable) ++{ ++ struct mmci_host *host = mmc_priv(mmc); ++ unsigned long flags; ++ ++ if (enable) ++ /* Keep the SDIO mode bit if SDIO irqs are enabled */ ++ pm_runtime_get_sync(mmc_dev(mmc)); ++ ++ spin_lock_irqsave(&host->lock, flags); ++ mmci_write_sdio_irq_bit(host, enable); ++ spin_unlock_irqrestore(&host->lock, flags); ++ ++ if (!enable) { ++ pm_runtime_mark_last_busy(mmc_dev(mmc)); ++ pm_runtime_put_autosuspend(mmc_dev(mmc)); ++ } ++} ++ ++static void mmci_ack_sdio_irq(struct mmc_host *mmc) ++{ ++ struct mmci_host *host = mmc_priv(mmc); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&host->lock, flags); ++ mmci_write_sdio_irq_bit(host, 1); ++ spin_unlock_irqrestore(&host->lock, flags); ++} ++ + static struct mmc_host_ops mmci_ops = { + .request = mmci_request, + .pre_req = mmci_pre_request, +@@ -2316,6 +2371,16 @@ static int mmci_probe(struct amba_device + mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; + } + ++ if (variant->supports_sdio_irq && host->mmc->caps & MMC_CAP_SDIO_IRQ) { ++ mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; ++ ++ mmci_ops.enable_sdio_irq = mmci_enable_sdio_irq; ++ mmci_ops.ack_sdio_irq = mmci_ack_sdio_irq; ++ ++ mmci_write_datactrlreg(host, ++ host->variant->datactrl_mask_sdio); ++ } ++ + /* Variants with mandatory busy timeout in HW needs R1B responses. */ + if (variant->busy_timeout) + mmc->caps |= MMC_CAP_NEED_RSP_BUSY; +--- a/drivers/mmc/host/mmci.h ++++ b/drivers/mmc/host/mmci.h +@@ -331,6 +331,7 @@ enum mmci_busy_state { + * register. + * @opendrain: bitmask identifying the OPENDRAIN bit inside MMCIPOWER register + * @dma_lli: true if variant has dma link list feature. ++ * @supports_sdio_irq: allow SD I/O card to interrupt the host + * @stm32_idmabsize_mask: stm32 sdmmc idma buffer size. + */ + struct variant_data { +@@ -376,6 +377,7 @@ struct variant_data { + u32 start_err; + u32 opendrain; + u8 dma_lli:1; ++ bool supports_sdio_irq; + u32 stm32_idmabsize_mask; + u32 stm32_idmabsize_align; + void (*init)(struct mmci_host *host); diff --git a/target/linux/stm32/patches-6.6/030-rtc-stm32-add-pinctrl-and-pinmux-interfaces.patch b/target/linux/stm32/patches-6.6/030-rtc-stm32-add-pinctrl-and-pinmux-interfaces.patch new file mode 100644 index 0000000000..e06ea134c5 --- /dev/null +++ b/target/linux/stm32/patches-6.6/030-rtc-stm32-add-pinctrl-and-pinmux-interfaces.patch @@ -0,0 +1,189 @@ +From c15671ce05a038b8c92a6f1e24b0b850a154ba59 Mon Sep 17 00:00:00 2001 +From: Valentin Caron +Date: Mon, 22 Jul 2024 18:00:20 +0200 +Subject: [PATCH] rtc: stm32: add pinctrl and pinmux interfaces + +STM32 RTC is capable to handle 3 specific pins of the soc. +"out1, out2 and out2_rmp". To handle this, we use pinctrl framework. +There is a single pin per group. + +Signed-off-by: Valentin Caron +Reviewed-by: Linus Walleij +Link: https://lore.kernel.org/r/20240722160022.454226-3-valentin.caron@foss.st.com +Signed-off-by: Alexandre Belloni +--- + drivers/rtc/Kconfig | 5 ++ + drivers/rtc/rtc-stm32.c | 120 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 125 insertions(+) + +--- a/drivers/rtc/Kconfig ++++ b/drivers/rtc/Kconfig +@@ -1887,6 +1887,11 @@ config RTC_DRV_STM32 + tristate "STM32 RTC" + select REGMAP_MMIO + depends on ARCH_STM32 || COMPILE_TEST ++ depends on OF ++ depends on PINCTRL ++ select PINMUX ++ select PINCONF ++ select GENERIC_PINCONF + help + If you say yes here you get support for the STM32 On-Chip + Real Time Clock. +--- a/drivers/rtc/rtc-stm32.c ++++ b/drivers/rtc/rtc-stm32.c +@@ -12,6 +12,9 @@ + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include +@@ -94,6 +97,14 @@ + /* STM32 RTC driver time helpers */ + #define SEC_PER_DAY (24 * 60 * 60) + ++/* STM32 RTC pinctrl helpers */ ++#define STM32_RTC_PINMUX(_name, _action, ...) { \ ++ .name = (_name), \ ++ .action = (_action), \ ++ .groups = ((const char *[]){ __VA_ARGS__ }), \ ++ .num_groups = ARRAY_SIZE(((const char *[]){ __VA_ARGS__ })), \ ++} ++ + struct stm32_rtc; + + struct stm32_rtc_registers { +@@ -149,6 +160,106 @@ static void stm32_rtc_wpr_lock(struct st + writel_relaxed(RTC_WPR_WRONG_KEY, rtc->base + regs->wpr); + } + ++enum stm32_rtc_pin_name { ++ NONE, ++ OUT1, ++ OUT2, ++ OUT2_RMP ++}; ++ ++static const struct pinctrl_pin_desc stm32_rtc_pinctrl_pins[] = { ++ PINCTRL_PIN(OUT1, "out1"), ++ PINCTRL_PIN(OUT2, "out2"), ++ PINCTRL_PIN(OUT2_RMP, "out2_rmp"), ++}; ++ ++static int stm32_rtc_pinctrl_get_groups_count(struct pinctrl_dev *pctldev) ++{ ++ return ARRAY_SIZE(stm32_rtc_pinctrl_pins); ++} ++ ++static const char *stm32_rtc_pinctrl_get_group_name(struct pinctrl_dev *pctldev, ++ unsigned int selector) ++{ ++ return stm32_rtc_pinctrl_pins[selector].name; ++} ++ ++static int stm32_rtc_pinctrl_get_group_pins(struct pinctrl_dev *pctldev, ++ unsigned int selector, ++ const unsigned int **pins, ++ unsigned int *num_pins) ++{ ++ *pins = &stm32_rtc_pinctrl_pins[selector].number; ++ *num_pins = 1; ++ return 0; ++} ++ ++static const struct pinctrl_ops stm32_rtc_pinctrl_ops = { ++ .dt_node_to_map = pinconf_generic_dt_node_to_map_all, ++ .dt_free_map = pinconf_generic_dt_free_map, ++ .get_groups_count = stm32_rtc_pinctrl_get_groups_count, ++ .get_group_name = stm32_rtc_pinctrl_get_group_name, ++ .get_group_pins = stm32_rtc_pinctrl_get_group_pins, ++}; ++ ++struct stm32_rtc_pinmux_func { ++ const char *name; ++ const char * const *groups; ++ const unsigned int num_groups; ++ int (*action)(struct pinctrl_dev *pctl_dev, unsigned int pin); ++}; ++ ++static const struct stm32_rtc_pinmux_func stm32_rtc_pinmux_functions[] = { ++}; ++ ++static int stm32_rtc_pinmux_get_functions_count(struct pinctrl_dev *pctldev) ++{ ++ return ARRAY_SIZE(stm32_rtc_pinmux_functions); ++} ++ ++static const char *stm32_rtc_pinmux_get_fname(struct pinctrl_dev *pctldev, unsigned int selector) ++{ ++ return stm32_rtc_pinmux_functions[selector].name; ++} ++ ++static int stm32_rtc_pinmux_get_groups(struct pinctrl_dev *pctldev, unsigned int selector, ++ const char * const **groups, unsigned int * const num_groups) ++{ ++ *groups = stm32_rtc_pinmux_functions[selector].groups; ++ *num_groups = stm32_rtc_pinmux_functions[selector].num_groups; ++ return 0; ++} ++ ++static int stm32_rtc_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int selector, ++ unsigned int group) ++{ ++ struct stm32_rtc_pinmux_func selected_func = stm32_rtc_pinmux_functions[selector]; ++ struct pinctrl_pin_desc pin = stm32_rtc_pinctrl_pins[group]; ++ ++ /* Call action */ ++ if (selected_func.action) ++ return selected_func.action(pctldev, pin.number); ++ ++ return -EINVAL; ++} ++ ++static const struct pinmux_ops stm32_rtc_pinmux_ops = { ++ .get_functions_count = stm32_rtc_pinmux_get_functions_count, ++ .get_function_name = stm32_rtc_pinmux_get_fname, ++ .get_function_groups = stm32_rtc_pinmux_get_groups, ++ .set_mux = stm32_rtc_pinmux_set_mux, ++ .strict = true, ++}; ++ ++static struct pinctrl_desc stm32_rtc_pdesc = { ++ .name = DRIVER_NAME, ++ .pins = stm32_rtc_pinctrl_pins, ++ .npins = ARRAY_SIZE(stm32_rtc_pinctrl_pins), ++ .owner = THIS_MODULE, ++ .pctlops = &stm32_rtc_pinctrl_ops, ++ .pmxops = &stm32_rtc_pinmux_ops, ++}; ++ + static int stm32_rtc_enter_init_mode(struct stm32_rtc *rtc) + { + const struct stm32_rtc_registers *regs = &rtc->data->regs; +@@ -723,6 +834,7 @@ static int stm32_rtc_probe(struct platfo + { + struct stm32_rtc *rtc; + const struct stm32_rtc_registers *regs; ++ struct pinctrl_dev *pctl; + int ret; + + rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); +@@ -834,6 +946,14 @@ static int stm32_rtc_probe(struct platfo + goto err; + } + ++ ret = devm_pinctrl_register_and_init(&pdev->dev, &stm32_rtc_pdesc, rtc, &pctl); ++ if (ret) ++ return dev_err_probe(&pdev->dev, ret, "pinctrl register failed"); ++ ++ ret = pinctrl_enable(pctl); ++ if (ret) ++ return dev_err_probe(&pdev->dev, ret, "pinctrl enable failed"); ++ + /* + * If INITS flag is reset (calendar year field set to 0x00), calendar + * must be initialized diff --git a/target/linux/stm32/patches-6.6/031-rtc-stm32-add-Low-Speed-Clock-Output-LSCO-support.patch b/target/linux/stm32/patches-6.6/031-rtc-stm32-add-Low-Speed-Clock-Output-LSCO-support.patch new file mode 100644 index 0000000000..1ac0974572 --- /dev/null +++ b/target/linux/stm32/patches-6.6/031-rtc-stm32-add-Low-Speed-Clock-Output-LSCO-support.patch @@ -0,0 +1,253 @@ +From 229476a4de2e237ebadddca8a82d20afa9298f71 Mon Sep 17 00:00:00 2001 +From: Valentin Caron +Date: Mon, 22 Jul 2024 18:00:21 +0200 +Subject: [PATCH] rtc: stm32: add Low Speed Clock Output (LSCO) support + +RTC is able to output on a pin the "LSE" internal clock. + +STM32 RTC is now registered as a clock provider. +It provides rtc_lsco clock, that means RTC_LSCO is output on either +RTC_OUT1 or RTC_OUT2_RMP, depending on pinmux DT property. +The clock is marked as CLK_IGNORE_UNUSED and CLK_IS_CRITICAL because +RTC_LSCO can be early required by devices needed it to init. + +Add LSCO in pinmux functions. + +Add "stm32_rtc_clean_outs" to disable LSCO. As RTC is part of "backup" +power domain, it is not reset during shutdown or reboot. So force LSCO +disable at probe. + +Co-developed-by: Amelie Delaunay +Signed-off-by: Amelie Delaunay +Signed-off-by: Valentin Caron +Link: https://lore.kernel.org/r/20240722160022.454226-4-valentin.caron@foss.st.com +Signed-off-by: Alexandre Belloni +--- + drivers/rtc/Kconfig | 1 + + drivers/rtc/rtc-stm32.c | 99 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 100 insertions(+) + +--- a/drivers/rtc/Kconfig ++++ b/drivers/rtc/Kconfig +@@ -1892,6 +1892,7 @@ config RTC_DRV_STM32 + select PINMUX + select PINCONF + select GENERIC_PINCONF ++ depends on COMMON_CLK + help + If you say yes here you get support for the STM32 On-Chip + Real Time Clock. +--- a/drivers/rtc/rtc-stm32.c ++++ b/drivers/rtc/rtc-stm32.c +@@ -6,6 +6,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -44,6 +45,10 @@ + #define STM32_RTC_CR_FMT BIT(6) + #define STM32_RTC_CR_ALRAE BIT(8) + #define STM32_RTC_CR_ALRAIE BIT(12) ++#define STM32_RTC_CR_OSEL GENMASK(22, 21) ++#define STM32_RTC_CR_COE BIT(23) ++#define STM32_RTC_CR_TAMPOE BIT(26) ++#define STM32_RTC_CR_OUT2EN BIT(31) + + /* STM32_RTC_ISR/STM32_RTC_ICSR bit fields */ + #define STM32_RTC_ISR_ALRAWF BIT(0) +@@ -80,6 +85,12 @@ + /* STM32_RTC_SR/_SCR bit fields */ + #define STM32_RTC_SR_ALRA BIT(0) + ++/* STM32_RTC_CFGR bit fields */ ++#define STM32_RTC_CFGR_OUT2_RMP BIT(0) ++#define STM32_RTC_CFGR_LSCOEN GENMASK(2, 1) ++#define STM32_RTC_CFGR_LSCOEN_OUT1 1 ++#define STM32_RTC_CFGR_LSCOEN_OUT2_RMP 2 ++ + /* STM32_RTC_VERR bit fields */ + #define STM32_RTC_VERR_MINREV_SHIFT 0 + #define STM32_RTC_VERR_MINREV GENMASK(3, 0) +@@ -117,6 +128,7 @@ struct stm32_rtc_registers { + u16 wpr; + u16 sr; + u16 scr; ++ u16 cfgr; + u16 verr; + }; + +@@ -131,6 +143,7 @@ struct stm32_rtc_data { + bool has_pclk; + bool need_dbp; + bool need_accuracy; ++ bool has_lsco; + }; + + struct stm32_rtc { +@@ -143,6 +156,7 @@ struct stm32_rtc { + struct clk *rtc_ck; + const struct stm32_rtc_data *data; + int irq_alarm; ++ struct clk *clk_lsco; + }; + + static void stm32_rtc_wpr_unlock(struct stm32_rtc *rtc) +@@ -209,7 +223,68 @@ struct stm32_rtc_pinmux_func { + int (*action)(struct pinctrl_dev *pctl_dev, unsigned int pin); + }; + ++static int stm32_rtc_pinmux_lsco_available(struct pinctrl_dev *pctldev, unsigned int pin) ++{ ++ struct stm32_rtc *rtc = pinctrl_dev_get_drvdata(pctldev); ++ struct stm32_rtc_registers regs = rtc->data->regs; ++ unsigned int cr = readl_relaxed(rtc->base + regs.cr); ++ unsigned int cfgr = readl_relaxed(rtc->base + regs.cfgr); ++ unsigned int calib = STM32_RTC_CR_COE; ++ unsigned int tampalrm = STM32_RTC_CR_TAMPOE | STM32_RTC_CR_OSEL; ++ ++ switch (pin) { ++ case OUT1: ++ if ((!(cr & STM32_RTC_CR_OUT2EN) && ++ ((cr & calib) || cr & tampalrm)) || ++ ((cr & calib) && (cr & tampalrm))) ++ return -EBUSY; ++ break; ++ case OUT2_RMP: ++ if ((cr & STM32_RTC_CR_OUT2EN) && ++ (cfgr & STM32_RTC_CFGR_OUT2_RMP) && ++ ((cr & calib) || (cr & tampalrm))) ++ return -EBUSY; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ if (clk_get_rate(rtc->rtc_ck) != 32768) ++ return -ERANGE; ++ ++ return 0; ++} ++ ++static int stm32_rtc_pinmux_action_lsco(struct pinctrl_dev *pctldev, unsigned int pin) ++{ ++ struct stm32_rtc *rtc = pinctrl_dev_get_drvdata(pctldev); ++ struct stm32_rtc_registers regs = rtc->data->regs; ++ struct device *dev = rtc->rtc_dev->dev.parent; ++ u8 lscoen; ++ int ret; ++ ++ if (!rtc->data->has_lsco) ++ return -EPERM; ++ ++ ret = stm32_rtc_pinmux_lsco_available(pctldev, pin); ++ if (ret) ++ return ret; ++ ++ lscoen = (pin == OUT1) ? STM32_RTC_CFGR_LSCOEN_OUT1 : STM32_RTC_CFGR_LSCOEN_OUT2_RMP; ++ ++ rtc->clk_lsco = clk_register_gate(dev, "rtc_lsco", __clk_get_name(rtc->rtc_ck), ++ CLK_IGNORE_UNUSED | CLK_IS_CRITICAL, ++ rtc->base + regs.cfgr, lscoen, 0, NULL); ++ if (IS_ERR(rtc->clk_lsco)) ++ return PTR_ERR(rtc->clk_lsco); ++ ++ of_clk_add_provider(dev->of_node, of_clk_src_simple_get, rtc->clk_lsco); ++ ++ return 0; ++} ++ + static const struct stm32_rtc_pinmux_func stm32_rtc_pinmux_functions[] = { ++ STM32_RTC_PINMUX("lsco", &stm32_rtc_pinmux_action_lsco, "out1", "out2_rmp"), + }; + + static int stm32_rtc_pinmux_get_functions_count(struct pinctrl_dev *pctldev) +@@ -664,6 +739,7 @@ static const struct stm32_rtc_data stm32 + .has_pclk = false, + .need_dbp = true, + .need_accuracy = false, ++ .has_lsco = false, + .regs = { + .tr = 0x00, + .dr = 0x04, +@@ -674,6 +750,7 @@ static const struct stm32_rtc_data stm32 + .wpr = 0x24, + .sr = 0x0C, /* set to ISR offset to ease alarm management */ + .scr = UNDEF_REG, ++ .cfgr = UNDEF_REG, + .verr = UNDEF_REG, + }, + .events = { +@@ -686,6 +763,7 @@ static const struct stm32_rtc_data stm32 + .has_pclk = true, + .need_dbp = true, + .need_accuracy = false, ++ .has_lsco = false, + .regs = { + .tr = 0x00, + .dr = 0x04, +@@ -696,6 +774,7 @@ static const struct stm32_rtc_data stm32 + .wpr = 0x24, + .sr = 0x0C, /* set to ISR offset to ease alarm management */ + .scr = UNDEF_REG, ++ .cfgr = UNDEF_REG, + .verr = UNDEF_REG, + }, + .events = { +@@ -717,6 +796,7 @@ static const struct stm32_rtc_data stm32 + .has_pclk = true, + .need_dbp = false, + .need_accuracy = true, ++ .has_lsco = true, + .regs = { + .tr = 0x00, + .dr = 0x04, +@@ -727,6 +807,7 @@ static const struct stm32_rtc_data stm32 + .wpr = 0x24, + .sr = 0x50, + .scr = 0x5C, ++ .cfgr = 0x60, + .verr = 0x3F4, + }, + .events = { +@@ -743,6 +824,19 @@ static const struct of_device_id stm32_r + }; + MODULE_DEVICE_TABLE(of, stm32_rtc_of_match); + ++static void stm32_rtc_clean_outs(struct stm32_rtc *rtc) ++{ ++ struct stm32_rtc_registers regs = rtc->data->regs; ++ ++ if (regs.cfgr != UNDEF_REG) { ++ unsigned int cfgr = readl_relaxed(rtc->base + regs.cfgr); ++ ++ cfgr &= ~STM32_RTC_CFGR_LSCOEN; ++ cfgr &= ~STM32_RTC_CFGR_OUT2_RMP; ++ writel_relaxed(cfgr, rtc->base + regs.cfgr); ++ } ++} ++ + static int stm32_rtc_init(struct platform_device *pdev, + struct stm32_rtc *rtc) + { +@@ -946,6 +1040,8 @@ static int stm32_rtc_probe(struct platfo + goto err; + } + ++ stm32_rtc_clean_outs(rtc); ++ + ret = devm_pinctrl_register_and_init(&pdev->dev, &stm32_rtc_pdesc, rtc, &pctl); + if (ret) + return dev_err_probe(&pdev->dev, ret, "pinctrl register failed"); +@@ -992,6 +1088,9 @@ static void stm32_rtc_remove(struct plat + const struct stm32_rtc_registers *regs = &rtc->data->regs; + unsigned int cr; + ++ if (!IS_ERR_OR_NULL(rtc->clk_lsco)) ++ clk_unregister_gate(rtc->clk_lsco); ++ + /* Disable interrupts */ + stm32_rtc_wpr_unlock(rtc); + cr = readl_relaxed(rtc->base + regs->cr); diff --git a/target/linux/stm32/patches-6.6/032-ARM-dts-stm32-rtc-add-pin-to-provide-LSCO-on-stm32mp.patch b/target/linux/stm32/patches-6.6/032-ARM-dts-stm32-rtc-add-pin-to-provide-LSCO-on-stm32mp.patch new file mode 100644 index 0000000000..1d5bedbad3 --- /dev/null +++ b/target/linux/stm32/patches-6.6/032-ARM-dts-stm32-rtc-add-pin-to-provide-LSCO-on-stm32mp.patch @@ -0,0 +1,31 @@ +From 92483a156238078562d187f527de6b358cb53a08 Mon Sep 17 00:00:00 2001 +From: Valentin Caron +Date: Tue, 27 Aug 2024 16:04:48 +0200 +Subject: [PATCH] ARM: dts: stm32: rtc, add pin to provide LSCO on + stm32mp13 + +Declare pin for LSCO in stm32-pinctrl provider node to reserve this pin +for RTC OUT2_RMP, in stm32mp13-pinctrl.dtsi. + +Signed-off-by: Valentin Caron +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp13-pinctrl.dtsi | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm/boot/dts/st/stm32mp13-pinctrl.dtsi ++++ b/arch/arm/boot/dts/st/stm32mp13-pinctrl.dtsi +@@ -212,6 +212,13 @@ + }; + }; + ++ /omit-if-no-ref/ ++ rtc_rsvd_pins_a: rtc-rsvd-0 { ++ pins { ++ pinmux = ; /* RTC_OUT2_RMP */ ++ }; ++ }; ++ + sdmmc1_b4_pins_a: sdmmc1-b4-0 { + pins { + pinmux = , /* SDMMC1_D0 */ diff --git a/target/linux/stm32/patches-6.6/033-ARM-dts-stm32-rtc-add-LSCO-to-WLAN-BT-module-on-stm3.patch b/target/linux/stm32/patches-6.6/033-ARM-dts-stm32-rtc-add-LSCO-to-WLAN-BT-module-on-stm3.patch new file mode 100644 index 0000000000..ec6a086a7d --- /dev/null +++ b/target/linux/stm32/patches-6.6/033-ARM-dts-stm32-rtc-add-LSCO-to-WLAN-BT-module-on-stm3.patch @@ -0,0 +1,34 @@ +From d6e424f926397e682fc44a952d5b3a1e34b2cd73 Mon Sep 17 00:00:00 2001 +From: Valentin Caron +Date: Tue, 27 Aug 2024 16:04:50 +0200 +Subject: [PATCH] ARM: dts: stm32: rtc, add LSCO to WLAN/BT module on + stm32mp135f-dk + +On stm32mp135f-dk board, WLAN/BT module LPO_IN pin is wired to +RTC OUT2_RMP pin. + +Provide a pinctrl configuration to enable LSCO on OUT2_RMP. + +Signed-off-by: Valentin Caron +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp135f-dk.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm/boot/dts/st/stm32mp135f-dk.dts ++++ b/arch/arm/boot/dts/st/stm32mp135f-dk.dts +@@ -184,7 +184,14 @@ + }; + + &rtc { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&rtc_rsvd_pins_a>; + status = "okay"; ++ ++ rtc_lsco_pins_a: rtc-lsco-0 { ++ pins = "out2_rmp"; ++ function = "lsco"; ++ }; + }; + + &scmi_regu { diff --git a/target/linux/stm32/patches-6.6/034-ARM-dts-stm32-add-support-of-WLAN-BT-on-stm32mp135f-.patch b/target/linux/stm32/patches-6.6/034-ARM-dts-stm32-add-support-of-WLAN-BT-on-stm32mp135f-.patch new file mode 100644 index 0000000000..e2b69ac8c7 --- /dev/null +++ b/target/linux/stm32/patches-6.6/034-ARM-dts-stm32-add-support-of-WLAN-BT-on-stm32mp135f-.patch @@ -0,0 +1,84 @@ +From 6b44fdef4c7ad112e17d7cbd64d7d522a426d6e4 Mon Sep 17 00:00:00 2001 +From: Christophe Roullier +Date: Tue, 27 Aug 2024 16:04:52 +0200 +Subject: [PATCH] ARM: dts: stm32: add support of WLAN/BT on stm32mp135f-dk + +Add support of WLAN/BT Murata Type 1DX module: +- usart2 is used for Bluetooth interface +- sdmmc2 is used for WLAN (sdio) interface + +Signed-off-by: Christophe Roullier +Signed-off-by: Valentin Caron +Signed-off-by: Alexandre Torgue +--- + arch/arm/boot/dts/st/stm32mp135f-dk.dts | 45 +++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + +--- a/arch/arm/boot/dts/st/stm32mp135f-dk.dts ++++ b/arch/arm/boot/dts/st/stm32mp135f-dk.dts +@@ -67,6 +67,19 @@ + default-state = "off"; + }; + }; ++ ++ v3v3_ao: v3v3-ao { ++ compatible = "regulator-fixed"; ++ regulator-name = "v3v3_ao"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&mcp23017 11 GPIO_ACTIVE_LOW>; ++ }; + }; + + &adc_1 { +@@ -230,6 +243,30 @@ + status = "okay"; + }; + ++/* Wifi */ ++&sdmmc2 { ++ pinctrl-names = "default", "opendrain", "sleep"; ++ pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_clk_pins_a>; ++ pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_clk_pins_a>; ++ pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>; ++ non-removable; ++ cap-sdio-irq; ++ st,neg-edge; ++ bus-width = <4>; ++ vmmc-supply = <&v3v3_ao>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ brcmf: bcrmf@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&rtc_lsco_pins_a>; ++ }; ++}; ++ + &spi5 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&spi5_pins_a>; +@@ -332,6 +369,14 @@ + pinctrl-2 = <&usart2_idle_pins_a>; + uart-has-rtscts; + status = "okay"; ++ ++ bluetooth { ++ shutdown-gpios = <&mcp23017 13 GPIO_ACTIVE_HIGH>; ++ compatible = "brcm,bcm43438-bt"; ++ max-speed = <3000000>; ++ vbat-supply = <&v3v3_ao>; ++ vddio-supply = <&v3v3_ao>; ++ }; + }; + + &usbh_ehci { diff --git a/target/linux/stm32/patches-6.6/700-net-stmmac-dwmac-stm32-add-support-of-phy-supply-pro.patch b/target/linux/stm32/patches-6.6/700-net-stmmac-dwmac-stm32-add-support-of-phy-supply-pro.patch new file mode 100644 index 0000000000..57d2a26c1a --- /dev/null +++ b/target/linux/stm32/patches-6.6/700-net-stmmac-dwmac-stm32-add-support-of-phy-supply-pro.patch @@ -0,0 +1,106 @@ +From 7bfe3404a02923ca3858abf56b18a098b4be33b2 Mon Sep 17 00:00:00 2001 +From: Christophe Roullier +Date: Wed, 10 Nov 2021 17:39:40 +0100 +Subject: [PATCH] net: ethernet: stmmac: stm32: support the phy-supply + regulator binding + +Configure the phy regulator if defined by the "phy-supply" DT phandle. + +Signed-off-by: Christophe Roullier +--- + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 51 ++++++++++++++++++- + 1 file changed, 50 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -92,6 +93,7 @@ struct stm32_dwmac { + u32 mode_reg; /* MAC glue-logic mode register */ + u32 mode_mask; + struct regmap *regmap; ++ struct regulator *regulator; + u32 speed; + const struct stm32_ops *ops; + struct device *dev; +@@ -374,6 +376,16 @@ static int stm32_dwmac_parse_data(struct + dev_dbg(dev, "Warning sysconfig register mask not set\n"); + } + ++ dwmac->regulator = devm_regulator_get_optional(dev, "phy"); ++ if (IS_ERR(dwmac->regulator)) { ++ if (PTR_ERR(dwmac->regulator) == -EPROBE_DEFER) { ++ dev_dbg(dev, "phy regulator is not available yet, deferred probing\n"); ++ return -EPROBE_DEFER; ++ } ++ dev_dbg(dev, "no regulator found\n"); ++ dwmac->regulator = NULL; ++ } ++ + return err; + } + +@@ -439,6 +451,28 @@ static int stm32mp1_parse_data(struct st + return err; + } + ++static int phy_power_on(struct stm32_dwmac *bsp_priv, bool enable) ++{ ++ int ret; ++ struct device *dev = bsp_priv->dev; ++ ++ if (!bsp_priv->regulator) ++ return 0; ++ ++ if (enable) { ++ ret = regulator_enable(bsp_priv->regulator); ++ if (ret) ++ dev_err(dev, "fail to enable phy-supply\n"); ++ } else { ++ ret = regulator_disable(bsp_priv->regulator); ++ if (ret) ++ dev_err(dev, "fail to disable phy-supply\n"); ++ } ++ ++ return 0; ++} ++ ++ + static int stm32_dwmac_probe(struct platform_device *pdev) + { + struct plat_stmmacenet_data *plat_dat; +@@ -480,12 +514,18 @@ static int stm32_dwmac_probe(struct plat + if (ret) + return ret; + +- ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); ++ ret = phy_power_on(plat_dat->bsp_priv, true); + if (ret) + goto err_clk_disable; + ++ ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); ++ if (ret) ++ goto err_gmac_powerdown; ++ + return 0; + ++err_gmac_powerdown: ++ phy_power_on(plat_dat->bsp_priv, false); + err_clk_disable: + stm32_dwmac_clk_disable(dwmac, false); + +@@ -506,6 +546,8 @@ static void stm32_dwmac_remove(struct pl + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); + } ++ ++ phy_power_on(priv->plat->bsp_priv, false); + } + + static int stm32mp1_suspend(struct stm32_dwmac *dwmac) diff --git a/target/linux/stm32/patches-6.6/900-ARM-dts-stm32-add-ethernet2-for-STM32MP135F-DK-board.patch b/target/linux/stm32/patches-6.6/900-ARM-dts-stm32-add-ethernet2-for-STM32MP135F-DK-board.patch new file mode 100644 index 0000000000..48fa446bd8 --- /dev/null +++ b/target/linux/stm32/patches-6.6/900-ARM-dts-stm32-add-ethernet2-for-STM32MP135F-DK-board.patch @@ -0,0 +1,53 @@ +From 63c84f846ec5b794a6c90a1c5813cdb0ae75daf6 Mon Sep 17 00:00:00 2001 +From: Thomas Richard +Date: Thu, 26 Sep 2024 16:48:52 +0200 +Subject: [PATCH] ARM: dts: stm32: add ethernet2 for STM32MP135F-DK board + +This patch is based on the stm32mp135f-dk devicetree from 6.6 ST kernel. + +Signed-off-by: Thomas Richard +--- + arch/arm/boot/dts/st/stm32mp135f-dk.dts | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/arch/arm/boot/dts/st/stm32mp135f-dk.dts ++++ b/arch/arm/boot/dts/st/stm32mp135f-dk.dts +@@ -20,6 +20,7 @@ + + aliases { + ethernet0 = ðernet1; ++ ethernet1 = ðernet2; + serial0 = &uart4; + serial1 = &usart1; + serial2 = &uart8; +@@ -129,6 +130,30 @@ + }; + }; + ++ðernet2 { ++ status = "okay"; ++ pinctrl-0 = <ð2_rmii_pins_a>; ++ pinctrl-1 = <ð2_rmii_sleep_pins_a>; ++ pinctrl-names = "default", "sleep"; ++ phy-mode = "rmii"; ++ phy-handle = <&phy0_eth2>; ++ st,ext-phyclk; ++ phy-supply = <&scmi_v3v3_sw>; ++ ++ mdio1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "snps,dwmac-mdio"; ++ phy0_eth2: ethernet-phy@0 { ++ compatible = "ethernet-phy-id0007.c131"; ++ reset-gpios = <&mcp23017 10 GPIO_ACTIVE_LOW>; ++ reg = <0>; ++ }; ++ }; ++}; ++ ++ ++ + &i2c1 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c1_pins_a>; diff --git a/target/linux/stm32/stm32mp1/config-6.6 b/target/linux/stm32/stm32mp1/config-6.6 new file mode 100644 index 0000000000..946649ef9b --- /dev/null +++ b/target/linux/stm32/stm32mp1/config-6.6 @@ -0,0 +1,485 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_FORCE_MAX_ORDER=12 +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_STACKWALK=y +CONFIG_ARCH_STM32=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_ERRATA_430973=y +CONFIG_ARM_ERRATA_643719=y +CONFIG_ARM_ERRATA_720789=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_754327=y +CONFIG_ARM_ERRATA_764369=y +CONFIG_ARM_ERRATA_775420=y +CONFIG_ARM_ERRATA_798181=y +CONFIG_ARM_ERRATA_814220=y +CONFIG_ARM_GIC=y +CONFIG_ARM_HAS_GROUP_RELOCS=y +# CONFIG_ARM_HIGHBANK_CPUIDLE is not set +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_PL172_MPMC is not set +CONFIG_ARM_PSCI=y +CONFIG_ARM_PSCI_CPUIDLE=y +CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y +CONFIG_ARM_PSCI_FW=y +CONFIG_ARM_SCMI_CPUFREQ=y +CONFIG_ARM_SCMI_HAVE_MSG=y +CONFIG_ARM_SCMI_HAVE_SHMEM=y +CONFIG_ARM_SCMI_HAVE_TRANSPORT=y +# CONFIG_ARM_SCMI_POWER_CONTROL is not set +CONFIG_ARM_SCMI_POWER_DOMAIN=y +CONFIG_ARM_SCMI_PROTOCOL=y +# CONFIG_ARM_SCMI_RAW_MODE_SUPPORT is not set +CONFIG_ARM_SCMI_TRANSPORT_OPTEE=y +CONFIG_ARM_SCMI_TRANSPORT_SMC=y +# CONFIG_ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE is not set +CONFIG_ARM_SMCCC_SOC_ID=y +CONFIG_ARM_SMC_WATCHDOG=y +# CONFIG_ARM_SMMU is not set +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_PM=y +CONFIG_BOUNCE=y +CONFIG_BUFFER_HEAD=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y +CONFIG_CHR_DEV_SG=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_STM32=y +CONFIG_CLK_ICST=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=64 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set +CONFIG_CMDLINE_PARTITION=y +CONFIG_COMMON_CLK=y +CONFIG_COMMON_CLK_SCMI=y +CONFIG_COMMON_CLK_STM32MP135=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y +CONFIG_CONTIG_ALLOC=y +CONFIG_COREDUMP=y +CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y +CONFIG_CPU_ISOLATION=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_MITIGATIONS=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SPECTRE=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRC16=y +CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_GF128MUL=y +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_CRYPTO_SHA1=y +CONFIG_CURRENT_POINTER_IN_TPIDRURO=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DEVFREQ_GOV_PASSIVE=y +# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set +# CONFIG_DEVFREQ_GOV_POWERSAVE is not set +CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y +# CONFIG_DEVFREQ_GOV_USERSPACE is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_CMA=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_OPS=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +CONFIG_DT_IDLE_GENPD=y +CONFIG_DT_IDLE_STATES=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_DWMAC_DWC_QOS_ETH=y +CONFIG_DWMAC_GENERIC=y +CONFIG_DWMAC_STM32=y +CONFIG_DW_DMAC=y +CONFIG_DW_DMAC_CORE=y +CONFIG_EDAC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_LEGACY_SYSFS=y +CONFIG_EDAC_SUPPORT=y +CONFIG_ELF_CORE=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_EXT4_FS=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FREEZER=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FUNCTION_ALIGNMENT=0 +CONFIG_FWNODE_MDIO=y +CONFIG_FW_CACHE=y +# CONFIG_FW_LOADER_USER_HELPER is not set +CONFIG_GCC10_NO_ARRAY_BOUNDS=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ARCH_TOPOLOGY=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_VDSO_32=y +CONFIG_GLOB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GENERIC_PLATFORM=y +CONFIG_GPIO_SYSCON=y +# CONFIG_GPIO_SYSFS is not set +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_SMP=y +CONFIG_HIGHMEM=y +CONFIG_HIGHPTE=y +CONFIG_HOTPLUG_CORE_SYNC=y +CONFIG_HOTPLUG_CORE_SYNC_DEAD=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_OPTEE=y +# CONFIG_HW_RANDOM_STM32 is not set +CONFIG_HZ_FIXED=0 +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_DEMUX_PINCTRL=y +CONFIG_I2C_HELPER_AUTO=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_GPIO=y +CONFIG_I2C_MUX_PCA954x=y +CONFIG_I2C_MUX_PINCTRL=y +CONFIG_I2C_SLAVE=y +# CONFIG_I2C_SLAVE_TESTUNIT is not set +CONFIG_I2C_SMBUS=y +# CONFIG_I2C_STM32F4 is not set +CONFIG_I2C_STM32F7=y +CONFIG_INPUT=y +# CONFIG_IOMMUFD is not set +# CONFIG_IOMMU_DEBUGFS is not set +CONFIG_IOMMU_IO_PGTABLE=y +# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set +CONFIG_IOMMU_IO_PGTABLE_LPAE=y +# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set +CONFIG_IOMMU_SUPPORT=y +CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_XZ is not set +CONFIG_KMAP_LOCAL=y +CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y +# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set +# CONFIG_LEDS_CLASS_MULTICOLOR is not set +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LEDS_TRIGGER_TRANSIENT=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LOG_BUF_SHIFT=16 +# CONFIG_LRU_GEN is not set +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACH_STM32MP13=y +# CONFIG_MACH_STM32MP157 is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_MAGIC_SYSRQ_SERIAL=y +CONFIG_MDIO_BITBANG=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +# CONFIG_MDIO_GPIO is not set +CONFIG_MEMORY=y +CONFIG_MEMORY_ISOLATION=y +# CONFIG_MFD_STM32_LPTIMER is not set +# CONFIG_MFD_STM32_TIMERS is not set +CONFIG_MFD_SYSCON=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_ARMMMCI=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_MINORS=16 +CONFIG_MMC_STM32_SDMMC=y +CONFIG_MMU_LAZY_TLB_REFCOUNT=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_SRCU_NMI_SAFE=y +CONFIG_NEON=y +CONFIG_NET_EGRESS=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_INGRESS=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_XGRESS=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=2 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_DYNAMIC=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_OVERLAY=y +CONFIG_OF_RESOLVE=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OPTEE=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_POOL_STATS=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 +CONFIG_PANIC_TIMEOUT=0 +CONFIG_PCPU_DEV_REFCNT=y +CONFIG_PCS_XPCS=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLIB_LEDS=y +CONFIG_PHYLINK=y +# CONFIG_PHY_STM32_USBPHYC is not set +CONFIG_PINCTRL=y +CONFIG_PINCTRL_MCP23S08=y +CONFIG_PINCTRL_MCP23S08_I2C=y +CONFIG_PINCTRL_STM32=y +CONFIG_PINCTRL_STM32MP135=y +# CONFIG_PL353_SMC is not set +CONFIG_PM=y +CONFIG_PM_CLK=y +CONFIG_PM_DEVFREQ=y +CONFIG_PM_DEVFREQ_EVENT=y +CONFIG_PM_GENERIC_DOMAINS=y +CONFIG_PM_GENERIC_DOMAINS_OF=y +CONFIG_PM_GENERIC_DOMAINS_SLEEP=y +CONFIG_PM_OPP=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_RESET_GPIO_RESTART=y +CONFIG_POWER_RESET_SYSCON=y +CONFIG_POWER_RESET_SYSCON_POWEROFF=y +CONFIG_POWER_SUPPLY=y +CONFIG_PPS=y +CONFIG_PREEMPT_NONE_BUILD=y +CONFIG_PRINTK_TIME=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RAS=y +CONFIG_RATIONAL=y +# CONFIG_RAVE_SP_CORE is not set +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_ARM_SCMI=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_GPIO=y +# CONFIG_REGULATOR_STM32_BOOSTER is not set +# CONFIG_REGULATOR_STM32_PWR is not set +# CONFIG_REGULATOR_STM32_VREFBUF is not set +CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_SCMI=y +CONFIG_RESET_SIMPLE=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_DRV_CMOS is not set +# CONFIG_RTC_DRV_OPTEE is not set +CONFIG_RTC_DRV_STM32=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y +# CONFIG_SERIAL_8250 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_DEV_BUS=y +CONFIG_SERIAL_DEV_CTRL_TTYPORT=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_STM32=y +CONFIG_SERIAL_STM32_CONSOLE=y +CONFIG_SERIO=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_SERPORT=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SOC_BUS=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y +CONFIG_SPARSE_IRQ=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FILE_CACHE=y +# CONFIG_SQUASHFS_FILE_DIRECT is not set +CONFIG_SQUASHFS_LZO=y +CONFIG_SQUASHFS_ZLIB=y +CONFIG_STM32_DMA=y +CONFIG_STM32_DMAMUX=y +CONFIG_STM32_EXTI=y +# CONFIG_STM32_FMC2_EBI is not set +CONFIG_STM32_MDMA=y +CONFIG_STM32_WATCHDOG=y +CONFIG_STMMAC_ETH=y +CONFIG_STMMAC_PLATFORM=y +# CONFIG_STRIP_ASM_SYMS is not set +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +CONFIG_SWPHY=y +CONFIG_SWP_EMULATE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TEE=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_TRUSTED_FOUNDATIONS=y +# CONFIG_UCLAMP_TASK is not set +# CONFIG_UEVENT_HELPER is not set +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB_SUPPORT=y +CONFIG_USELIB=y +CONFIG_USE_OF=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_VMAP_STACK=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +CONFIG_XPS=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_ARMTHUMB=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/stm32/stm32mp1/target.mk b/target/linux/stm32/stm32mp1/target.mk new file mode 100644 index 0000000000..c41055d5b5 --- /dev/null +++ b/target/linux/stm32/stm32mp1/target.mk @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2024 Bootlin +# + +BOARDNAME:=STM32MP1 boards +ARCH:=arm +CPU_TYPE:=cortex-a7 +CPU_SUBTYPE=neon-vfpv4 +FEATURES+=fpu +KERNEL_IMAGES:=zImage + From b2f3713801c22d496791949877e6466864eaaa41 Mon Sep 17 00:00:00 2001 From: Antonio Pastor Date: Sat, 16 Nov 2024 15:09:49 -0500 Subject: [PATCH 091/119] kernel: modules: appletalk: add for Netatalk v4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Netatalk v4 reintroduces AppleTalk and this module is required for layer 3 protocol support. Module was removed in kernel 4.14 for OpenWrt 18.06 (commmit 14a0131, 22/02/2018). At the time nothing used it as Netatalk v3 did not support AppleTalk. Not building ipddp feature/module like it was in the past, as recommended by upstream Netatalk maintainers. Signed-off-by: Antonio Pastor Link: https://github.com/openwrt/openwrt/pull/16979 Signed-off-by: Hauke Mehrtens (cherry picked from commit 5eb25dddb17fa3cf4958e91dfc9fc868c9eb03ac) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/netsupport.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 9f349d34ee..3551a89a9b 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -42,6 +42,24 @@ endef $(eval $(call KernelPackage,atmtcp)) +define KernelPackage/appletalk + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Appletalk protocol support + KCONFIG:= \ + CONFIG_ATALK \ + CONFIG_DEV_APPLETALK \ + CONFIG_IPDDP=n + FILES:=$(LINUX_DIR)/net/appletalk/appletalk.ko + AUTOLOAD:=$(call AutoLoad,40,appletalk) +endef + +define KernelPackage/appletalk/description + Kernel module for AppleTalk protocol. +endef + +$(eval $(call KernelPackage,appletalk)) + + define KernelPackage/bonding SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Ethernet bonding driver From 35b7bbf35535aa60997a1d09b3ab15c492f39d59 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 22 Oct 2024 17:07:44 -0700 Subject: [PATCH 092/119] mxs: run kernel_oldconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit small change. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16913 Signed-off-by: Hauke Mehrtens (cherry picked from commit 55644397cd3cb3d8c77d74c9d22872502d091257) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/mxs/config-6.6 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/linux/mxs/config-6.6 b/target/linux/mxs/config-6.6 index b954ea2548..e01e266c0d 100644 --- a/target/linux/mxs/config-6.6 +++ b/target/linux/mxs/config-6.6 @@ -53,6 +53,7 @@ CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_PABRT_LEGACY=y CONFIG_CPU_PM=y CONFIG_CPU_THUMB_CAPABLE=y @@ -70,6 +71,7 @@ CONFIG_CRYPTO_LIB_GF128MUL=y CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_UTILS=y CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y @@ -84,6 +86,7 @@ CONFIG_EXTCON=y CONFIG_FEC=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FORCE_NR_CPUS=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y CONFIG_FUNCTION_ALIGNMENT=0 @@ -206,6 +209,7 @@ CONFIG_PPS=y CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PTP_1588_CLOCK=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y @@ -231,6 +235,7 @@ CONFIG_SPI=y CONFIG_SPI_MASTER=y CONFIG_SPI_MXS=y CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y CONFIG_STMP3XXX_RTC_WATCHDOG=y CONFIG_STMP_DEVICE=y CONFIG_SWPHY=y From 1b513604c3bdc4663ab6cb8ea8f850d967c94f7b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Oct 2024 19:19:50 -0700 Subject: [PATCH 093/119] mvebu: devm for mutex_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's common to avoid calling mutex_destroy when done. It's not correct strictly speaking. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16753 Signed-off-by: Hauke Mehrtens (cherry picked from commit 6280b4abfbc087157bc233083a67a42bffa31010) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- ...-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch | 10 +++++++--- ...-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch | 6 ++++-- ...910-drivers-leds-wt61p803-puzzle-improvements.patch | 6 ++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/target/linux/mvebu/patches-6.6/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch b/target/linux/mvebu/patches-6.6/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch index 1046b15e4b..2aac515eb1 100644 --- a/target/linux/mvebu/patches-6.6/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch +++ b/target/linux/mvebu/patches-6.6/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch @@ -54,7 +54,7 @@ Cc: Robert Marko obj-$(CONFIG_INTEL_SOC_PMIC_BXTWC) += intel_soc_pmic_bxtwc.o --- /dev/null +++ b/drivers/mfd/iei-wt61p803-puzzle.c -@@ -0,0 +1,908 @@ +@@ -0,0 +1,912 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* IEI WT61P803 PUZZLE MCU Driver + * System management microcontroller for fan control, temperature sensor reading, @@ -894,8 +894,12 @@ Cc: Robert Marko + mcu->serdev = serdev; + mcu->dev = dev; + init_completion(&mcu->reply->received); -+ mutex_init(&mcu->reply_lock); -+ mutex_init(&mcu->lock); ++ ret = devm_mutex_init(dev, &mcu->reply_lock); ++ if (ret) ++ return ret; ++ ret = devm_mutex_init(dev, &mcu->lock); ++ if (ret) ++ return ret; + + /* Setup UART interface */ + serdev_device_set_drvdata(serdev, mcu); diff --git a/target/linux/mvebu/patches-6.6/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch b/target/linux/mvebu/patches-6.6/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch index 983434e666..eca2bb81e4 100644 --- a/target/linux/mvebu/patches-6.6/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch +++ b/target/linux/mvebu/patches-6.6/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch @@ -53,7 +53,7 @@ Cc: Robert Marko obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o --- /dev/null +++ b/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c -@@ -0,0 +1,445 @@ +@@ -0,0 +1,447 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* IEI WT61P803 PUZZLE MCU HWMON Driver + * @@ -457,7 +457,9 @@ Cc: Robert Marko + + mcu_hwmon->mcu = mcu; + platform_set_drvdata(pdev, mcu_hwmon); -+ mutex_init(&mcu_hwmon->lock); ++ ret = devm_mutex_init(dev, &mcu_hwmon->lock); ++ if (ret) ++ return ret; + + hwmon_dev = devm_hwmon_device_register_with_info(dev, "iei_wt61p803_puzzle", + mcu_hwmon, diff --git a/target/linux/mvebu/patches-6.6/910-drivers-leds-wt61p803-puzzle-improvements.patch b/target/linux/mvebu/patches-6.6/910-drivers-leds-wt61p803-puzzle-improvements.patch index 150a65498c..8de403773a 100644 --- a/target/linux/mvebu/patches-6.6/910-drivers-leds-wt61p803-puzzle-improvements.patch +++ b/target/linux/mvebu/patches-6.6/910-drivers-leds-wt61p803-puzzle-improvements.patch @@ -47,7 +47,7 @@ ret = iei_wt61p803_puzzle_write_command(priv->mcu, led_power_cmd, sizeof(led_power_cmd), -@@ -90,39 +106,166 @@ static enum led_brightness iei_wt61p803_ +@@ -90,39 +106,168 @@ static enum led_brightness iei_wt61p803_ return led_state; } @@ -194,7 +194,9 @@ + goto put_child_node; + } + -+ mutex_init(&priv->lock); ++ ret = devm_mutex_init(dev, &priv->lock); ++ if (ret) ++ goto put_child_node; + + dev_set_drvdata(dev, priv); + From 50ee6adc5a51fb9764cd0036bfd4af440189860f Mon Sep 17 00:00:00 2001 From: Vaclav Svoboda Date: Mon, 11 Nov 2024 22:34:00 +0100 Subject: [PATCH 094/119] ramips: mt76x8: Add support for Zbtlink ZBT-WE2426-B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Zbtlink ZBT-WE2426-B is an indoor dual band WiFi router with 4 external non detachable antennas and 5 Fast Ethernet ports. Hardware of ZBT-WE2426-B: - SoC: MT7628AN - RAM: 64 MB (Winbond W9751G6K8-25) - Storage: 8 MB SPI flash (S25FL064K) - Ethernet: 5x 10/100 Mbps LAN1,LAN2,LAN3,LAN4 & WAN - Wireless: 2.4GHz: on SoC (802.11b/g/n) - Wireless: 5GHz: Mediatek MT7612EN (802.11n/ac) - LEDs: 8x - Buttons: 1x reset - USB: 1x 2.0 - MicroSD slot: 1x - Power: 9 VDC, 1 A - Uart: GND TX RX PWR - J1 on the PCB - Board silkscreen: "ZBT-WE2426-C V04" "2018-02-28" "CTT" "13 18" Backup the stock firmware, settings and calibration data: This router comes with PandoraBox OpenWrt firmware, so it is possible to get all MTD partitions using scp. Installation: - Using the bootloader web server. Hold the reset button while turning the power on. Upload the sysupgrade image on http://192.168.1.1. - Using the sysupgrade command in PandoraBox OpenWrt. LEDs: - LAN1,LAN2,LAN3,LAN4,WAN,WLAN2G use GPIO pins of the MT7628AN SoC (GPIOs 43,42,41,40,39,44) - WLAN5G uses pin of MT7612EN. - The POWER LED is directly connected to the VCC. It can be reconnected to the GPIO 37 of the MT7628AN SoC by resoldering SMD resistor on the PCB. Buttons: - The RESET button is connected to the GPIO 38 of the MT7628AN SoC. MAC addresses as verified by OEM firmware: use address source 2g *:b0 factory 0x4 (label) 5g *:b1 factory 0x8004 LAN *:b2 factory 0x28 WAN *:b3 factory 0x2e Signed-off-by: Vaclav Svoboda Link: https://github.com/openwrt/openwrt/pull/16927 Signed-off-by: Hauke Mehrtens (cherry picked from commit 3a9752ea027b8969750c0dd7f89b6afc357dcffa) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../dts/mt7628an_zbtlink_zbt-we2426-b.dts | 183 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 8 + .../mt76x8/base-files/etc/board.d/01_leds | 7 + .../mt76x8/base-files/etc/board.d/02_network | 6 +- 4 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 target/linux/ramips/dts/mt7628an_zbtlink_zbt-we2426-b.dts diff --git a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we2426-b.dts b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we2426-b.dts new file mode 100644 index 0000000000..6dfdb2617c --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we2426-b.dts @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include +#include + +/ { + compatible = "zbtlink,zbt-we2426-b", "mediatek,mt7628an-soc"; + model = "Zbtlink ZBT-WE2426-B"; + + aliases { + led-boot = &led_wlan; + led-failsafe = &led_wlan; + led-upgrade = &led_wlan; + label-mac-device = &wmac; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + }; + + leds { + compatible = "gpio-leds"; + + lan1 { + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + }; + + lan2 { + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + }; + + lan3 { + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + }; + + lan4 { + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + }; + + wan { + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WAN; + }; + + led_wlan: wlan2g { + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WLAN; + linux,default-trigger = "phy0tpt"; + }; + + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2s", "refclk", "wdt", "p4led_an", + "p3led_an", "p2led_an", + "p1led_an", "p0led_an", + "wled_an"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + led-active-low; + }; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&sdhci { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 8ad840ddfe..7e343bf016 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -1158,6 +1158,14 @@ define Device/zbtlink_zbt-we1226 endef TARGET_DEVICES += zbtlink_zbt-we1226 +define Device/zbtlink_zbt-we2426-b + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE2426-B + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += zbtlink_zbt-we2426-b + define Device/zyxel_keenetic-extra-ii IMAGE_SIZE := 29824k DEVICE_VENDOR := Zyxel diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index 5ea668de01..00e5086bb3 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -186,6 +186,13 @@ zbtlink,zbt-we1226) ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x02" ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x10" ;; +zbtlink,zbt-we2426-b) + ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" + ucidef_set_led_switch "lan1" "lan1" "green:lan-1" "switch0" "0x01" + ucidef_set_led_switch "lan2" "lan2" "green:lan-2" "switch0" "0x02" + ucidef_set_led_switch "lan3" "lan3" "green:lan-3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "lan4" "green:lan-4" "switch0" "0x08" + ;; zyxel,keenetic-extra-ii) ucidef_set_led_netdev "wifi_led" "wifi" "green:wifi" "wlan0" ucidef_set_led_switch "internet" "internet" "green:internet" "switch0" "0x01" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index cb0983b9dc..616baa80c0 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -148,7 +148,8 @@ ramips_setup_interfaces() netgear,r6020|\ netgear,r6080|\ netgear,r6120|\ - wavlink,wl-wn531a3) + wavlink,wl-wn531a3|\ + zbtlink,zbt-we2426-b) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" ;; @@ -244,7 +245,8 @@ ramips_setup_macs() hilink,hlk-7688a|\ wavlink,wl-wn531a3|\ wavlink,wl-wn577a2|\ - wavlink,wl-wn578a2) + wavlink,wl-wn578a2|\ + zbtlink,zbt-we2426-b) wan_mac=$(mtd_get_mac_binary factory 0x2e) label_mac=$(mtd_get_mac_binary factory 0x4) ;; From 1e0f790d2381c3c9bf19471b191fdf42cd454441 Mon Sep 17 00:00:00 2001 From: Tim Noack Date: Mon, 21 Oct 2024 12:21:41 +0000 Subject: [PATCH 095/119] ath79: refactor dts of TP-Link CPE710-v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is done in preparation of adding support for the CPE710-v2, which uses a similiar device tree. Signed-off-by: Tim Noack Link: https://github.com/openwrt/openwrt/pull/16637 Signed-off-by: Hauke Mehrtens (cherry picked from commit 832cc8ce04122ea726178687b5168187b2465f7f) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../ath79/dts/qca9563_tplink_cpe710-v1.dts | 151 +---------------- .../ath79/dts/qca9563_tplink_cpe710.dtsi | 160 ++++++++++++++++++ 2 files changed, 161 insertions(+), 150 deletions(-) create mode 100644 target/linux/ath79/dts/qca9563_tplink_cpe710.dtsi diff --git a/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts index 6d1b58f95f..31e04232ab 100644 --- a/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts @@ -1,151 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca956x.dtsi" - -#include -#include -#include +#include "qca9563_tplink_cpe710.dtsi" / { model = "TP-Link CPE710 v1"; compatible = "tplink,cpe710-v1", "qca,qca9563"; - - aliases { - label-mac-device = ð0; - led-boot = &led_lan; - led-failsafe = &led_lan; - led-upgrade = &led_lan; - }; - - leds { - compatible = "gpio-leds"; - - led_lan: lan { - function = LED_FUNCTION_LAN; - color = ; - gpios = <&gpio 5 GPIO_ACTIVE_LOW>; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "Reset button"; - linux,code = ; - gpios = <&gpio 2 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; -}; - -&pcie { - status = "okay"; - - wifi@0,0 { - compatible = "qcom,ath10k"; - reg = <0x0000 0 0 0 0>; - nvmem-cells = <&precal_art_5000>, <&macaddr_info_8>; - nvmem-cell-names = "pre-calibration", "mac-address"; - }; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - label = "partition-table"; - reg = <0x050000 0x010000>; - read-only; - }; - - info: partition@60000 { - label = "info"; - reg = <0x060000 0x010000>; - read-only; - - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; - }; - }; - - partition@70000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x070000 0xf50000>; - }; - - partition@fc0000 { - label = "config"; - reg = <0xfc0000 0x030000>; - read-only; - }; - - partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - precal_art_5000: pre-calibration@5000 { - reg = <0x5000 0x2f20>; - }; - }; - }; - }; - }; -}; - -&pinmux { - mdio_pins: mdio_pins { - /* GPIO 10 as MDIO(0x20), GPIO 8 as MDC(0x21) */ - pinctrl-single,bits = <0x8 0x00200021 0x00ff00ff>; - }; }; &mdio0 { - status = "okay"; - - pinctrl-names = "default"; - pinctrl-0 = <&mdio_pins>; - phy4: ethernet-phy@4 { reg = <4>; reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; @@ -153,17 +15,6 @@ }; ð0 { - status = "okay"; - phy-handle = <&phy4>; phy-mode = "sgmii"; - - nvmem-cells = <&macaddr_info_8>; - nvmem-cell-names = "mac-address"; - - qca956x-serdes-fixup; - - gmac-config { - device = <&gmac>; - }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_cpe710.dtsi b/target/linux/ath79/dts/qca9563_tplink_cpe710.dtsi new file mode 100644 index 0000000000..9de36f3b66 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_cpe710.dtsi @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + aliases { + led-boot = &led_lan; + led-failsafe = &led_lan; + led-upgrade = &led_lan; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_lan: lan { + function = LED_FUNCTION_LAN; + color = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&precal_art_5000>, <&macaddr_info_8>; + nvmem-cell-names = "pre-calibration", "mac-address"; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "partition-table"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "info"; + reg = <0x060000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; + }; + + partition@70000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x070000 0xf50000>; + }; + + partition@fc0000 { + label = "config"; + reg = <0xfc0000 0x030000>; + read-only; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_5000: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; + }; +}; + +&pinmux { + mdio_pins: mdio_pins { + /* GPIO 10 as MDIO(0x20), GPIO 8 as MDC(0x21) */ + pinctrl-single,bits = <0x8 0x00200021 0x00ff00ff>; + }; +}; + +&mdio0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + + qca956x-serdes-fixup; + + gmac-config { + device = <&gmac>; + }; +}; From 0b4d831886689b55e149e276dbca5b780fb6a00e Mon Sep 17 00:00:00 2001 From: Tim Noack Date: Mon, 21 Oct 2024 12:21:59 +0000 Subject: [PATCH 096/119] ath79: add support for TP-Link CPE710-v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TP-Link CPE710-v2 is an outdoor wireless CPE for 5 GHz with one Ethernet port based on the AP152 reference board. Compared to the CPE710-v1, the only change observed in hardware is that the mdio address of the ethernet physical changed from 0x4 to 0x0. Specifications: - SoC: QCA9563-AL3A MIPS 74kc @ 775MHz, AHB @ 258MHz - RAM: 128MiB DDR2 @ 650MHz - Flash: 16MiB SPI NOR Based on the GD25Q128 - Wi-Fi 5Ghz: ath10k chip (802.11ac for up to 867Mbps on 5GHz wireless data rate), based on the QCA9896 - Ethernet: one 1GbE port - 23dBi high-gain directional 2×2 MIMO parabolic antenna - Power, LAN, WLAN5G Blue LEDs Flashing instructions: Flash factory image through stock firmware WEB UI or through TFTP To get to TFTP recovery just hold reset button while powering on for around 30-40 seconds and release. Rename factory image to recovery.bin Stock TFTP server IP:192.168.0.100 Stock device TFTP address:192.168.0.254 Signed-off-by: Tim Noack Link: https://github.com/openwrt/openwrt/pull/16637 Signed-off-by: Hauke Mehrtens (cherry picked from commit 5572e0196a93604716ec36ebb8db6737fc6677aa) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../ath79/dts/qca9563_tplink_cpe710-v2.dts | 20 +++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 3 ++- .../generic/base-files/etc/board.d/02_network | 1 + target/linux/ath79/image/generic-tp-link.mk | 11 ++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9563_tplink_cpe710-v2.dts diff --git a/target/linux/ath79/dts/qca9563_tplink_cpe710-v2.dts b/target/linux/ath79/dts/qca9563_tplink_cpe710-v2.dts new file mode 100644 index 0000000000..fe277fc549 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_cpe710-v2.dts @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9563_tplink_cpe710.dtsi" + +/ { + model = "TP-Link CPE710 v2"; + compatible = "tplink,cpe710-v2", "qca,qca9563"; +}; + +&mdio0 { + phy0: ethernet-phy@0 { + reg = <0>; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; +}; + +ð0 { + phy-handle = <&phy0>; + phy-mode = "sgmii"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 0e5731dd74..6409adb78a 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -222,7 +222,8 @@ openmesh,mr900-v1|\ openmesh,mr900-v2|\ openmesh,mr1750-v1|\ openmesh,mr1750-v2|\ -tplink,cpe710-v1) +tplink,cpe710-v1|\ +tplink,cpe710-v2) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ;; compex,wpj344-16m|\ diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 8f79a3fad8..2bd97442d9 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -89,6 +89,7 @@ ath79_setup_interfaces() tplink,cpe610-v1|\ tplink,cpe610-v2|\ tplink,cpe710-v1|\ + tplink,cpe710-v2|\ tplink,eap225-outdoor-v1|\ tplink,eap225-outdoor-v3|\ tplink,eap225-v1|\ diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 643de76f7c..c42338db78 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -391,6 +391,17 @@ define Device/tplink_cpe710-v1 endef TARGET_DEVICES += tplink_cpe710-v1 +define Device/tplink_cpe710-v2 + $(Device/tplink-safeloader-uimage) + SOC := qca9563 + IMAGE_SIZE := 15680k + DEVICE_MODEL := CPE710 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + TPLINK_BOARD_ID := CPE710V2 +endef +TARGET_DEVICES += tplink_cpe710-v2 + define Device/tplink-eap2x5 $(Device/tplink-safeloader) LOADER_TYPE := elf From 25973eab22e0f30bcdfd9ff93951136d5eff88ee Mon Sep 17 00:00:00 2001 From: Joerg Bayer Date: Sat, 13 Apr 2024 16:05:24 +0200 Subject: [PATCH 097/119] linux-firmware: Add support for Intel AX411 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for Intel AX411 CNVio2 device. Signed-off-by: Joerg Bayer Link: https://github.com/openwrt/openwrt/pull/15153 [squashed and updated commit description, update to version 89] Signed-off-by: Hauke Mehrtens (cherry picked from commit c89ed7acc897794b06b61f10d8f641ee06fbaacf) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/firmware/linux-firmware/intel.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk index 4c9e04cd3d..eb5ac29159 100644 --- a/package/firmware/linux-firmware/intel.mk +++ b/package/firmware/linux-firmware/intel.mk @@ -199,6 +199,14 @@ define Package/iwlwifi-firmware-ax210/install endef $(eval $(call BuildPackage,iwlwifi-firmware-ax210)) +Package/iwlwifi-firmware-ax411 = $(call Package/firmware-default,Intel AX411 firmware) +define Package/iwlwifi-firmware-ax411/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0-89.ucode $(1)/lib/firmware + $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0.pnvm $(1)/lib/firmware +endef +$(eval $(call BuildPackage,iwlwifi-firmware-ax411)) + Package/iwlwifi-firmware-be200 = $(call Package/firmware-default,Intel BE200 firmware) define Package/iwlwifi-firmware-be200/install $(INSTALL_DIR) $(1)/lib/firmware From a07c241b81542ada0ebd7aaacafcd346a23593b8 Mon Sep 17 00:00:00 2001 From: George Oldfort Date: Mon, 11 Nov 2024 09:25:56 +0100 Subject: [PATCH 098/119] mediatek: split Acer/W6 dts into W6 common dtsi and device specific dts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to prepare OpenWrt support for other Acer W6 devices, this commit moves all device tree components that are used by all Acer W6/W6e/W6d/W6m routers from mt7986a-acer-predator-w6.dts to mt7986a-acer-w6-common.dtsi (new file) and includes this dtsi file in mt7986a-acer-predator-w6.dts. Minor changes had to be made to the device tree in order to improve clarity and – notably – to reduce the number of dtc warnings: - replace (obviously wrong) led@ gpio led entities by led- - remove unnecessary (default-state = "off") gpio led statements - rename entity “memory” to “memory@0” - add missing #address-cells and #address-size in /soc/mmc@11230000 - add missing #address-cells and #address-size in /soc/pcie@11280000 - introduce symbols “nvmem” and “swport0” in dtsi (referenced in dts) The changes were checked with `diff -BEZbdtwy --suppress-common-lines ...` (comparing two dts files created using old and new fdt-1 blobs again), see https://github.com/openwrt/openwrt/pull/16861/#issuecomment-2455680020 . This is the first of four commits into which the original commit was split to make reviews easier and more targeted. Signed-off-by: George Oldfort Link: https://github.com/openwrt/openwrt/pull/16861 Signed-off-by: Hauke Mehrtens (cherry picked from commit ce3b36b3d5374709b9b091390cb9053657be17fa) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../mediatek/dts/mt7986a-acer-predator-w6.dts | 491 ++---------------- .../mediatek/dts/mt7986a-acer-w6-common.dtsi | 387 ++++++++++++++ 2 files changed, 438 insertions(+), 440 deletions(-) create mode 100644 target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts index c27264a8d2..8c86fd31d8 100644 --- a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts +++ b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts @@ -1,11 +1,7 @@ -// SPDX-License-Identifier: (GPL-2.0 OR MIT) +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include -#include - -#include "mt7986a.dtsi" +#include "mt7986a-acer-w6-common.dtsi" / { model = "Acer Predator W6"; @@ -19,455 +15,99 @@ led-upgrade = &led_status; }; - chosen { - stdout-path = "serial0:115200n8"; - bootargs = "dm-mod.create=\"dm-verity,,,ro,0 31544 verity 1 PARTLABEL=rootfs PARTLABEL=rootfs 4096 4096 3943 3944 sha256 2f969fa9e9e4e20b37746f22633e85b178f5db7c143e11f92733a704299cc933 2dd56e34b15c6c84573cf26c4392028421061d2c808975217b45e9a5b49d2087\" rootfstype=squashfs,ext4 rootwait root=/dev/mmcblk0p6 fstools_ignore_partname=1"; - }; - - memory { - reg = <0 0x40000000 0 0x20000000>; - }; - - reg_1p8v: regulator-1p8v { - compatible = "regulator-fixed"; - regulator-name = "fixed-1.8V"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - regulator-always-on; - }; - - reg_3p3v: regulator-3p3v { - compatible = "regulator-fixed"; - regulator-name = "fixed-3.3V"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - regulator-always-on; - }; - - reg_5v: regulator-5v { - compatible = "regulator-fixed"; - regulator-name = "fixed-5V"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-boot-on; - regulator-always-on; - }; - - gpio-keys { - compatible = "gpio-keys"; - - factory { - label = "factory"; - linux,code = ; - gpios = <&pio 9 GPIO_ACTIVE_LOW>; - }; - - wps { - label = "wps"; - linux,code = ; - gpios = <&pio 10 GPIO_ACTIVE_LOW>; - }; - }; - - leds { compatible = "gpio-leds"; - led_status: led@0 { + led_status: led-0 { label = "ant0:red"; gpios = <&pio 1 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@1 { + led-1 { label = "ant0:green"; gpios = <&pio 2 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@2 { + led-2 { label = "ant0:blue"; gpios = <&pio 36 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@3 { + led-3 { label = "ant1:red"; gpios = <&pio 35 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@4 { + led-4 { label = "ant1:green"; gpios = <&pio 34 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@5 { + led-5 { label = "ant1:blue"; gpios = <&pio 33 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@6 { + led-6 { label = "ant2:red"; gpios = <&pio 38 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@7 { + led-7 { label = "ant2:green"; gpios = <&pio 37 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@8 { + led-8 { label = "ant2:blue"; gpios = <&pio 26 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@9 { + led-9 { label = "ant3:red"; gpios = <&pio 25 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@10 { + led-10 { label = "ant3:green"; gpios = <&pio 24 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@11 { + led-11 { label = "ant3:blue"; gpios = <&pio 23 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@12 { + led-12 { label = "ant4:red"; gpios = <&pio 28 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@13 { + led-13 { label = "ant4:green"; gpios = <&pio 27 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@14 { + led-14 { label = "ant4:blue"; gpios = <&pio 32 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@15 { + led-15 { label = "ant5:red"; gpios = <&pio 45 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@16 { + led-16 { label = "ant5:green"; gpios = <&pio 44 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; - led@17 { + led-17 { label = "ant5:blue"; gpios = <&pio 43 GPIO_ACTIVE_HIGH>; - default-state = "off"; }; }; - -}; - -ð { - status = "okay"; - - gmac0: mac@0 { - /* LAN */ - compatible = "mediatek,eth-mac"; - reg = <0>; - phy-mode = "2500base-x"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - - gmac1: mac@1 { - /* WAN */ - compatible = "mediatek,eth-mac"; - reg = <1>; - phy-mode = "2500base-x"; - phy-handle = <&phy6>; - }; - - mdio: mdio-bus { - #address-cells = <1>; - #size-cells = <0>; - }; -}; - -&mdio { - phy6: phy@6 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <6>; - - reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; - reset-assert-us = <10000>; - reset-deassert-us = <10000>; - - /* LED0: nc ; LED1: nc ; LED2: Amber ; LED3: Green */ - mxl,led-config = <0x0 0x0 0x370 0x80>; - }; - - switch: switch@1f { - compatible = "mediatek,mt7531"; - reg = <31>; - - reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; - reset-assert-us = <10000>; - reset-deassert-us = <10000>; - }; -}; - -&pio { - mmc0_pins_default: mmc0-pins { - mux { - function = "emmc"; - groups = "emmc_51"; - }; - conf-cmd-dat { - pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", - "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", - "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; - input-enable; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - conf-clk { - pins = "EMMC_CK"; - drive-strength = <6>; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-ds { - pins = "EMMC_DSL"; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-rst { - pins = "EMMC_RSTB"; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - }; - - mmc0_pins_uhs: mmc0-uhs-pins { - mux { - function = "emmc"; - groups = "emmc_51"; - }; - conf-cmd-dat { - pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", - "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", - "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; - input-enable; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - conf-clk { - pins = "EMMC_CK"; - drive-strength = <6>; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-ds { - pins = "EMMC_DSL"; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-rst { - pins = "EMMC_RSTB"; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - }; - - pcie_pins: pcie-pins { - mux { - function = "pcie"; - groups = "pcie_pereset"; - }; - }; - - wf_2g_5g_pins: wf_2g_5g-pins { - mux { - function = "wifi"; - groups = "wf_2g", "wf_5g"; - }; - conf { - pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", - "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", - "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", - "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", - "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", - "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", - "WF1_TOP_CLK", "WF1_TOP_DATA"; - drive-strength = <4>; - }; - }; - - wf_dbdc_pins: wf-dbdc-pins { - mux { - function = "wifi"; - groups = "wf_dbdc"; - }; - conf { - pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", - "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", - "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", - "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", - "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", - "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", - "WF1_TOP_CLK", "WF1_TOP_DATA"; - drive-strength = <4>; - }; - }; -}; - -&switch { - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - label = "game"; - phy-handle = <&swphy0>; - }; - - port@1 { - reg = <1>; - label = "lan1"; - phy-handle = <&swphy1>; - }; - - port@2 { - reg = <2>; - label = "lan2"; - phy-handle = <&swphy2>; - }; - - port@3 { - reg = <3>; - label = "lan3"; - phy-handle = <&swphy3>; - }; - - port@6 { - reg = <6>; - label = "cpu"; - ethernet = <&gmac0>; - phy-mode = "2500base-x"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - }; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - - swphy0: phy@0 { - reg = <0>; - - mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ - 0x22 0x0c00 /* ON_DURATION */ - 0x23 0x1400 /* BLINK_DURATION */ - 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ - >; - }; - - swphy1: phy@1 { - reg = <1>; - - mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ - 0x22 0x0c00 /* ON_DURATION */ - 0x23 0x1400 /* BLINK_DURATION */ - 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ - >; - }; - - swphy2: phy@2 { - reg = <2>; - - mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ - 0x22 0x0c00 /* ON_DURATION */ - 0x23 0x1400 /* BLINK_DURATION */ - 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ - >; - }; - - swphy3: phy@3 { - reg = <3>; - - mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ - 0x22 0x0c00 /* ON_DURATION */ - 0x23 0x1400 /* BLINK_DURATION */ - 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ - >; - }; - }; -}; - -&wifi { - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; - pinctrl-names = "default", "dbdc"; - pinctrl-0 = <&wf_2g_5g_pins>; - pinctrl-1 = <&wf_dbdc_pins>; - status = "okay"; -}; - -&trng { - status = "okay"; -}; - -&watchdog { - status = "okay"; -}; - -&crypto { - status = "okay"; -}; - -&uart0 { - status = "okay"; }; &ssusb { @@ -476,74 +116,45 @@ status = "okay"; }; +&nvmem { + eeprom_factory_a0000: eeprom@a0000 { + reg = <0xa0000 0x1000>; + }; +}; + +&slot0 { + radio0: mt7915@0,0 { + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_a0000>; + nvmem-cell-names = "eeprom"; + }; +}; + &usb_phy { status = "okay"; }; -&mmc0 { - status = "okay"; - pinctrl-names = "default", "state_uhs"; - pinctrl-0 = <&mmc0_pins_default>; - pinctrl-1 = <&mmc0_pins_uhs>; - bus-width = <0x08>; - max-frequency = <200000000>; - cap-mmc-highspeed; - mmc-hs200-1_8v; - mmc-hs400-1_8v; - hs400-ds-delay = <0x14014>; - vmmc-supply = <®_3p3v>; - vqmmc-supply = <®_1p8v>; - non-removable; - no-sd; - no-sdio; - - card@0 { - compatible = "mmc-card"; - reg = <0>; - - block { - compatible = "block-device"; - - partitions { - block-partition-factory { - partname = "factory"; - - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x1000>; - }; - - eeprom_factory_a0000: eeprom@a0000 { - reg = <0xa0000 0x1000>; - }; - }; - }; - }; - }; +ð { + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; }; }; -&pcie { - pinctrl-names = "default"; - pinctrl-0 = <&pcie_pins>; - status = "okay"; - - slot0: pcie@0,0 { - reg = <0x0000 0 0 0 0>; - - radio0: mt7915@0,0 { - reg = <0x0000 0 0 0 0>; - - nvmem-cells = <&eeprom_factory_a0000>; - nvmem-cell-names = "eeprom"; - }; +&mdio { + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-assert-us = <10000>; + reset-deassert-us = <10000>; + /* LED0: nc ; LED1: nc ; LED2: amber ; LED3: green */ + mxl,led-config = <0x0 0x0 0x370 0x80>; }; }; -&pcie_phy { - status = "okay"; +&swport0 { + label = "game"; }; diff --git a/target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi b/target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi new file mode 100644 index 0000000000..cca03684fb --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi @@ -0,0 +1,387 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include +#include + +#include "mt7986a.dtsi" + +/ { + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "dm-mod.create=\"dm-verity,,,ro,0 31544 verity 1 PARTLABEL=rootfs PARTLABEL=rootfs 4096 4096 3943 3944 sha256 2f969fa9e9e4e20b37746f22633e85b178f5db7c143e11f92733a704299cc933 2dd56e34b15c6c84573cf26c4392028421061d2c808975217b45e9a5b49d2087\" rootfstype=squashfs,ext4 rootwait root=/dev/mmcblk0p6 fstools_ignore_partname=1"; + }; + + memory@0 { + reg = <0 0x40000000 0 0x20000000>; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible = "gpio-keys"; + + factory { + label = "factory"; + linux,code = ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&watchdog { + status = "okay"; +}; + +&pio { + mmc0_pins_default: mmc0-pins { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; /* pull-up 10K */ + }; + + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + mediatek,pull-down-adv = <2>; /* pull-down 50K */ + }; + + conf-ds { + pins = "EMMC_DSL"; + mediatek,pull-down-adv = <2>; /* pull-down 50K */ + }; + + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; /* pull-up 10K */ + }; + }; + + mmc0_pins_uhs: mmc0-uhs-pins { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; /* pull-up 10K */ + }; + + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + mediatek,pull-down-adv = <2>; /* pull-down 50K */ + }; + + conf-ds { + pins = "EMMC_DSL"; + mediatek,pull-down-adv = <2>; /* pull-down 50K */ + }; + + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; /* pull-up 10K */ + }; + }; + + pcie_pins: pcie-pins { + mux { + function = "pcie"; + groups = "pcie_pereset"; + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + wf_dbdc_pins: wf-dbdc-pins { + mux { + function = "wifi"; + groups = "wf_dbdc"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&trng { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&mmc0 { + status = "okay"; + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <0x08>; + max-frequency = <200000000>; + cap-mmc-highspeed; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + hs400-ds-delay = <0x14014>; + vmmc-supply = <®_3p3v>; + vqmmc-supply = <®_1p8v>; + non-removable; + no-sd; + no-sdio; + #address-cells = <1>; + #size-cells = <0>; + + card@0 { + compatible = "mmc-card"; + reg = <0>; + + block { + compatible = "block-device"; + + partitions { + block-partition-factory { + partname = "factory"; + + nvmem: nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + }; + }; + }; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; + status = "okay"; + + slot0: pcie@0,0 { + reg = <0x0000 0 0 0 0>; + #address-cells = <0x03>; + #size-cells = <0x02>; + }; +}; + +&pcie_phy { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + reset-assert-us = <10000>; + reset-deassert-us = <10000>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + swport0: port@0 { + reg = <0>; + phy-handle = <&swphy0>; + }; + + port@1 { + reg = <1>; + label = "lan1"; + phy-handle = <&swphy1>; + }; + + port@2 { + reg = <2>; + label = "lan2"; + phy-handle = <&swphy2>; + }; + + port@3 { + reg = <3>; + label = "lan3"; + phy-handle = <&swphy3>; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + swphy0: phy@0 { + reg = <0>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0xc001 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + swphy1: phy@1 { + reg = <1>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0xc001 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + swphy2: phy@2 { + reg = <2>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0xc001 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + swphy3: phy@3 { + reg = <3>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0xc001 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + }; + }; + }; +}; + +&wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + pinctrl-names = "default", "dbdc"; + pinctrl-0 = <&wf_2g_5g_pins>; + pinctrl-1 = <&wf_dbdc_pins>; + status = "okay"; +}; From fd0f608d66b30be1eef5a1dc4bb61e3540736be3 Mon Sep 17 00:00:00 2001 From: George Oldfort Date: Mon, 11 Nov 2024 10:14:55 +0100 Subject: [PATCH 099/119] mediatek: make use of Acer Predator Connect W6's u-boot environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to prepare OpenWrt support for other Acer W6 devices and to adapt the procedure to read and set mac addresses which other devices of the same target are using (instead of needing an additional script and creating an additional structure in the file system), this commit - reads device mac addresses from u-boot environment - avoids the detour via the file system to set the mac addresses - drops redundant file /lib/preinit/05_extract_factory_data.sh The idea and the implementation were thankfully taken from PR #16410. This is the second of four commits into which the original commit was split to make reviews easier and more targeted. Signed-off-by: George Oldfort Link: https://github.com/openwrt/openwrt/pull/16861 Signed-off-by: Hauke Mehrtens (cherry picked from commit e7aaba2587e57dbd157899f7a2215ec6b7af5f89) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../uboot-envtools/files/mediatek_filogic | 15 +++++------ .../filogic/base-files/etc/board.d/02_network | 4 +++ .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 7 +++--- .../lib/preinit/05_extract_factory_data.sh | 25 ------------------- .../base-files/lib/preinit/10_fix_eth_mac.sh | 13 +++++----- 5 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 target/linux/mediatek/filogic/base-files/lib/preinit/05_extract_factory_data.sh diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 9de1a4d75d..7571af0020 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -49,6 +49,14 @@ xiaomi,redmi-router-ax6000-ubootmod|\ zyxel,ex5601-t0-ubootmod) ubootenv_add_ubi_default ;; +acer,predator-w6|\ +glinet,gl-mt2500|\ +glinet,gl-mt6000|\ +glinet,gl-x3000|\ +glinet,gl-xe3000) + local envdev=$(find_mmc_part "u-boot-env") + ubootenv_add_uci_config "$envdev" "0x0" "0x80000" + ;; asus,rt-ax59u) ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000" ;; @@ -89,13 +97,6 @@ dlink,aquila-pro-ai-m30-a1) gatonetworks,gdsp) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; -glinet,gl-x3000|\ -glinet,gl-xe3000|\ -glinet,gl-mt2500|\ -glinet,gl-mt6000) - local envdev=$(find_mmc_part "u-boot-env") - ubootenv_add_uci_config "$envdev" "0x0" "0x80000" - ;; glinet,gl-mt3000) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000" ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index fff39006da..2bcead8304 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -132,6 +132,10 @@ mediatek_setup_macs() local label_mac="" case $board in + acer,predator-w6) + wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC) + lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC) + ;; bananapi,bpi-r3|\ bananapi,bpi-r3-mini|\ bananapi,bpi-r4) diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 3042858353..f7f00c9a83 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -18,10 +18,9 @@ case "$board" in [ "$PHYNBR" = "1" ] && macaddr_setbit_la $addr > /sys${DEVPATH}/macaddress ;; acer,predator-w6) - key_path="/var/qcidata/data" - [ "$PHYNBR" = "0" ] && cat $key_path/2gMAC > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && cat $key_path/6gMAC > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "2" ] && cat $key_path/5gMAC > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "0" ] && mmc_get_mac_ascii u-boot-env 2gMAC > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && mmc_get_mac_ascii u-boot-env 6gMAC > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "2" ] && mmc_get_mac_ascii u-boot-env 5gMAC > /sys${DEVPATH}/macaddress ;; asus,rt-ax59u) CI_UBIPART="UBI_DEV" diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/05_extract_factory_data.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/05_extract_factory_data.sh deleted file mode 100644 index 87287a7d1c..0000000000 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/05_extract_factory_data.sh +++ /dev/null @@ -1,25 +0,0 @@ -. /lib/functions/system.sh - -predator_w6_factory_extract() { - local mmc_part - - mmc_part="$(find_mmc_part qcidata)" - - mkdir -p /var/qcidata/data - mkdir -p /var/qcidata/mount - - mount -r "$mmc_part" /var/qcidata/mount - - cp /var/qcidata/mount/factory/*MAC "/var/qcidata/data/" - umount "/var/qcidata/mount" -} - -preinit_extract_factory() { - case $(board_name) in - acer,predator-w6) - predator_w6_factory_extract - ;; - esac -} - -boot_hook_add preinit_main preinit_extract_factory diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh index 0497d7dfa2..0d7da89cea 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -3,12 +3,13 @@ preinit_set_mac_address() { case $(board_name) in acer,predator-w6) - key_path="/var/qcidata/data" - ip link set dev lan1 address "$(cat $key_path/LANMAC)" - ip link set dev lan2 address "$(cat $key_path/LANMAC)" - ip link set dev lan3 address "$(cat $key_path/LANMAC)" - ip link set dev game address "$(cat $key_path/LANMAC)" - ip link set dev eth1 address "$(cat $key_path/WANMAC)" + $(mmc_get_mac_ascii u-boot-env WANMAC) + $(mmc_get_mac_ascii u-boot-env LANMAC) + ip link set dev lan1 address "$lan_mac" + ip link set dev lan2 address "$lan_mac" + ip link set dev lan3 address "$lan_mac" + ip link set dev game address "$lan_mac" + ip link set dev eth1 address "$wan_mac" ;; asus,tuf-ax4200|\ asus,tuf-ax6000) From d491100f01aea270557b151a8ead3a82b785eea7 Mon Sep 17 00:00:00 2001 From: George Oldfort Date: Mon, 11 Nov 2024 10:40:45 +0100 Subject: [PATCH 100/119] mediatek: improve device tree for Acer Predator Connect W6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to prepare for OpenWrt support other Acer W6 devices and to get a step further to full hardware support for Acer Predator Connect W6, this commit - adjusts the product name ("Acer Predator Connect W6") - updates gpio LED labels to function/color scheme - show router status by using first rgb led instead of it's red color only (blue: booting/failsafe mode; red: sysupgrade; green: running – was: red) - changes switch/eth1 led configuration to reflect RX/TX activity and speed (green: full 1Gbps/2.5Gbps speed; amber: lower speed; blink: RX/TX) - shortens dummy dm-mod.create string in bootargs - enables W6's i2c interface This is the third of four commits into which the original commit was split to make reviews easier and more targeted. Signed-off-by: George Oldfort Link: https://github.com/openwrt/openwrt/pull/16861 Signed-off-by: Hauke Mehrtens (cherry picked from commit d42075dcefa407a03a30663879688475bb912729) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../mediatek/dts/mt7986a-acer-predator-w6.dts | 90 +++++++++++++------ .../mediatek/dts/mt7986a-acer-w6-common.dtsi | 47 ++++++---- target/linux/mediatek/image/filogic.mk | 2 +- 3 files changed, 94 insertions(+), 45 deletions(-) diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts index 8c86fd31d8..5002326d70 100644 --- a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts +++ b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts @@ -4,107 +4,143 @@ #include "mt7986a-acer-w6-common.dtsi" / { - model = "Acer Predator W6"; + model = "Acer Predator Connect W6"; compatible = "acer,predator-w6", "mediatek,mt7986a"; aliases { serial0 = &uart0; - led-boot = &led_status; - led-failsafe = &led_status; - led-running = &led_status; - led-upgrade = &led_status; + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_green; + led-upgrade = &led_status_red; }; leds { compatible = "gpio-leds"; - led_status: led-0 { - label = "ant0:red"; + led_status_red: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; gpios = <&pio 1 GPIO_ACTIVE_HIGH>; }; - led-1 { - label = "ant0:green"; + led_status_green: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; gpios = <&pio 2 GPIO_ACTIVE_HIGH>; }; - led-2 { - label = "ant0:blue"; + led_status_blue: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; gpios = <&pio 36 GPIO_ACTIVE_HIGH>; }; led-3 { - label = "ant1:red"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; gpios = <&pio 35 GPIO_ACTIVE_HIGH>; }; led-4 { - label = "ant1:green"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; gpios = <&pio 34 GPIO_ACTIVE_HIGH>; }; led-5 { - label = "ant1:blue"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; gpios = <&pio 33 GPIO_ACTIVE_HIGH>; }; led-6 { - label = "ant2:red"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; gpios = <&pio 38 GPIO_ACTIVE_HIGH>; }; led-7 { - label = "ant2:green"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; gpios = <&pio 37 GPIO_ACTIVE_HIGH>; }; led-8 { - label = "ant2:blue"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; gpios = <&pio 26 GPIO_ACTIVE_HIGH>; }; led-9 { - label = "ant3:red"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <3>; gpios = <&pio 25 GPIO_ACTIVE_HIGH>; }; led-10 { - label = "ant3:green"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <3>; gpios = <&pio 24 GPIO_ACTIVE_HIGH>; }; led-11 { - label = "ant3:blue"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <3>; gpios = <&pio 23 GPIO_ACTIVE_HIGH>; }; led-12 { - label = "ant4:red"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <4>; gpios = <&pio 28 GPIO_ACTIVE_HIGH>; }; led-13 { - label = "ant4:green"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <4>; gpios = <&pio 27 GPIO_ACTIVE_HIGH>; }; led-14 { - label = "ant4:blue"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <4>; gpios = <&pio 32 GPIO_ACTIVE_HIGH>; }; led-15 { - label = "ant5:red"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; gpios = <&pio 45 GPIO_ACTIVE_HIGH>; }; led-16 { - label = "ant5:green"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; gpios = <&pio 44 GPIO_ACTIVE_HIGH>; }; led-17 { - label = "ant5:blue"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; gpios = <&pio 43 GPIO_ACTIVE_HIGH>; }; }; @@ -151,7 +187,7 @@ reset-assert-us = <10000>; reset-deassert-us = <10000>; /* LED0: nc ; LED1: nc ; LED2: amber ; LED3: green */ - mxl,led-config = <0x0 0x0 0x370 0x80>; + mxl,led-config = <0x0 0x0 0x370 0x380>; }; }; diff --git a/target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi b/target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi index cca03684fb..03913f04e1 100644 --- a/target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi +++ b/target/linux/mediatek/dts/mt7986a-acer-w6-common.dtsi @@ -9,7 +9,7 @@ / { chosen { stdout-path = "serial0:115200n8"; - bootargs = "dm-mod.create=\"dm-verity,,,ro,0 31544 verity 1 PARTLABEL=rootfs PARTLABEL=rootfs 4096 4096 3943 3944 sha256 2f969fa9e9e4e20b37746f22633e85b178f5db7c143e11f92733a704299cc933 2dd56e34b15c6c84573cf26c4392028421061d2c808975217b45e9a5b49d2087\" rootfstype=squashfs,ext4 rootwait root=/dev/mmcblk0p6 fstools_ignore_partname=1"; + bootargs = "dm-mod.create=\"acer,,,ro,0 1 zero 1 0 0 0\" rootfstype=squashfs,ext4 rootwait root=/dev/mmcblk0p6 fstools_ignore_partname=1"; }; memory@0 { @@ -171,6 +171,13 @@ drive-strength = <4>; }; }; + + i2c_pins: i2c-pins { + mux { + function = "i2c"; + groups = "i2c"; + }; + }; }; &trng { @@ -185,6 +192,12 @@ status = "okay"; }; +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c_pins>; + status = "okay"; +}; + &mmc0 { status = "okay"; pinctrl-names = "default", "state_uhs"; @@ -321,13 +334,13 @@ reg = <0>; mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ + 0x21 0x8008 /* BASIC_CTRL */ 0x22 0x0c00 /* ON_DURATION */ 0x23 0x1400 /* BLINK_DURATION */ 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ + 0x25 0x0003 /* LED0_BLINK_CTRL */ + 0x26 0xc006 /* LED1_ON_CTRL */ + 0x27 0x003c /* LED1_BLINK_CTRL */ >; }; @@ -335,13 +348,13 @@ reg = <1>; mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ + 0x21 0x8008 /* BASIC_CTRL */ 0x22 0x0c00 /* ON_DURATION */ 0x23 0x1400 /* BLINK_DURATION */ 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ + 0x25 0x0003 /* LED0_BLINK_CTRL */ + 0x26 0xc006 /* LED1_ON_CTRL */ + 0x27 0x003c /* LED1_BLINK_CTRL */ >; }; @@ -349,13 +362,13 @@ reg = <2>; mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ + 0x21 0x8008 /* BASIC_CTRL */ 0x22 0x0c00 /* ON_DURATION */ 0x23 0x1400 /* BLINK_DURATION */ 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ + 0x25 0x0003 /* LED0_BLINK_CTRL */ + 0x26 0xc006 /* LED1_ON_CTRL */ + 0x27 0x003c /* LED1_BLINK_CTRL */ >; }; @@ -363,13 +376,13 @@ reg = <3>; mediatek,led-config = < - 0x21 0x8009 /* BASIC_CTRL */ + 0x21 0x8008 /* BASIC_CTRL */ 0x22 0x0c00 /* ON_DURATION */ 0x23 0x1400 /* BLINK_DURATION */ 0x24 0xc001 /* LED0_ON_CTRL */ - 0x25 0x0000 /* LED0_BLINK_CTRL */ - 0x26 0xc007 /* LED1_ON_CTRL */ - 0x27 0x003f /* LED1_BLINK_CTRL */ + 0x25 0x0003 /* LED0_BLINK_CTRL */ + 0x26 0xc006 /* LED1_ON_CTRL */ + 0x27 0x003c /* LED1_BLINK_CTRL */ >; }; }; diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index cb5c102b1e..838a433bf4 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -152,7 +152,7 @@ TARGET_DEVICES += acelink_ew-7886cax define Device/acer_predator-w6 DEVICE_VENDOR := Acer - DEVICE_MODEL := Predator W6 + DEVICE_MODEL := Predator Connect W6 DEVICE_DTS := mt7986a-acer-predator-w6 DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 From 60e21548e500cf7c70879073f8ef8d5dbb381f2c Mon Sep 17 00:00:00 2001 From: George Oldfort Date: Mon, 11 Nov 2024 11:18:19 +0100 Subject: [PATCH 101/119] mediatek: add support for Acer Predator W6d and Acer Vero W6m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for two variants of the already supported router Acer Predator Connect W6: The Acer Predator Connect W6d (W6 without 6 GHz wifi) and the Acer Connect Vero W6m (W6 without 2.5G eth1 port, usb3 port, and the 6 on-board gpio RGB LEDs, and with a KTD2026 RGB LED controller instead of the KTD2061 LED controller of the W6/W6d). The device tree for the W6m refers to the KTD202x driver suggested in PR #16860. Patching target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh removes the code repetition in (old) lines 121 to 124 on the occasion. This is the last of four commits into which the original commit was split to make reviews easier and more targeted. Signed-off-by: George Oldfort Link: https://github.com/openwrt/openwrt/pull/16861 Signed-off-by: Hauke Mehrtens (cherry picked from commit 2898d1d1269a841e5bb8673801bd2a04ad120031) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../uboot-envtools/files/mediatek_filogic | 2 + .../dts/mt7986a-acer-predator-w6d.dts | 182 ++++++++++++++++++ .../mediatek/dts/mt7986a-acer-vero-w6m.dts | 66 +++++++ .../filogic/base-files/etc/board.d/02_network | 10 +- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 7 +- .../base-files/lib/preinit/10_fix_eth_mac.sh | 11 +- .../base-files/lib/upgrade/platform.sh | 16 +- target/linux/mediatek/image/filogic.mk | 30 +++ 8 files changed, 312 insertions(+), 12 deletions(-) create mode 100644 target/linux/mediatek/dts/mt7986a-acer-predator-w6d.dts create mode 100644 target/linux/mediatek/dts/mt7986a-acer-vero-w6m.dts diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 7571af0020..b637f43287 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -50,6 +50,8 @@ zyxel,ex5601-t0-ubootmod) ubootenv_add_ubi_default ;; acer,predator-w6|\ +acer,predator-w6d|\ +acer,vero-w6m|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ glinet,gl-x3000|\ diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6d.dts b/target/linux/mediatek/dts/mt7986a-acer-predator-w6d.dts new file mode 100644 index 0000000000..b2c35a6197 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-acer-predator-w6d.dts @@ -0,0 +1,182 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7986a-acer-w6-common.dtsi" + +/ { + model = "Acer Predator Connect W6d"; + compatible = "acer,predator-w6d", "mediatek,mt7986a"; + + aliases { + serial0 = &uart0; + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; + gpios = <&pio 1 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; + gpios = <&pio 2 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; + gpios = <&pio 36 GPIO_ACTIVE_HIGH>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + gpios = <&pio 35 GPIO_ACTIVE_HIGH>; + }; + + led-4 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + gpios = <&pio 34 GPIO_ACTIVE_HIGH>; + }; + + led-5 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + gpios = <&pio 33 GPIO_ACTIVE_HIGH>; + }; + + led-6 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + gpios = <&pio 38 GPIO_ACTIVE_HIGH>; + }; + + led-7 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + gpios = <&pio 37 GPIO_ACTIVE_HIGH>; + }; + + led-8 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + gpios = <&pio 26 GPIO_ACTIVE_HIGH>; + }; + + led-9 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <3>; + gpios = <&pio 25 GPIO_ACTIVE_HIGH>; + }; + + led-10 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <3>; + gpios = <&pio 24 GPIO_ACTIVE_HIGH>; + }; + + led-11 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <3>; + gpios = <&pio 23 GPIO_ACTIVE_HIGH>; + }; + + led-12 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <4>; + gpios = <&pio 28 GPIO_ACTIVE_HIGH>; + }; + + led-13 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <4>; + gpios = <&pio 27 GPIO_ACTIVE_HIGH>; + }; + + led-14 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <4>; + gpios = <&pio 32 GPIO_ACTIVE_HIGH>; + }; + + led-15 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; + gpios = <&pio 45 GPIO_ACTIVE_HIGH>; + }; + + led-16 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; + gpios = <&pio 44 GPIO_ACTIVE_HIGH>; + }; + + led-17 { + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <5>; + gpios = <&pio 43 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&ssusb { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +ð { + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; + }; +}; + +&mdio { + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-assert-us = <10000>; + reset-deassert-us = <10000>; + /* LED0: nc ; LED1: nc ; LED2: amber ; LED3: green */ + mxl,led-config = <0x0 0x0 0x370 0x380>; + }; +}; + +&swport0 { + label = "game"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-acer-vero-w6m.dts b/target/linux/mediatek/dts/mt7986a-acer-vero-w6m.dts new file mode 100644 index 0000000000..7927efcb00 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-acer-vero-w6m.dts @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7986a-acer-w6-common.dtsi" + +/ { + model = "Acer Connect Vero W6m"; + compatible = "acer,vero-w6m", "mediatek,mt7986a"; + + aliases { + serial0 = &uart0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; +}; + +&i2c0 { + led-controller@30 { + compatible = "kinetic,ktd2026"; + reg = <0x30>; + vin-supply = <®_5v>; + vio-supply = <®_3p3v>; + + led_status: multi-led { + color = ; + function = LED_FUNCTION_STATUS; + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = ; + }; + + led@1 { + reg = <1>; + color = ; + }; + + led@2 { + reg = <2>; + color = ; + }; + }; + }; +}; + +&nvmem { + eeprom_factory_a0000: eeprom@a0000 { + reg = <0xa0000 0x1000>; + }; +}; + +&slot0 { + radio0: mt7915@0,0 { + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_a0000>; + nvmem-cell-names = "eeprom"; + }; +}; + +&swport0 { + label = "internet"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 2bcead8304..7bfc61a269 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -18,9 +18,13 @@ mediatek_setup_interfaces() acelink,ew-7886cax) ucidef_set_interface_lan "eth0" "dhcp" ;; - acer,predator-w6) + acer,predator-w6|\ + acer,predator-w6d) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1 ;; + acer,vero-w6m) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" internet + ;; arcadyan,mozart) ucidef_set_interfaces_lan_wan "lan0 eth1" eth2 ;; @@ -132,7 +136,9 @@ mediatek_setup_macs() local label_mac="" case $board in - acer,predator-w6) + acer,predator-w6|\ + acer,predator-w6d|\ + acer,vero-w6m) wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC) lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC) ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index f7f00c9a83..f87cc0646e 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -17,11 +17,16 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_setbit_la $addr > /sys${DEVPATH}/macaddress ;; - acer,predator-w6) + acer,predator-w6|\ + acer,vero-w6m) [ "$PHYNBR" = "0" ] && mmc_get_mac_ascii u-boot-env 2gMAC > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && mmc_get_mac_ascii u-boot-env 6gMAC > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "2" ] && mmc_get_mac_ascii u-boot-env 5gMAC > /sys${DEVPATH}/macaddress ;; + acer,predator-w6d) + [ "$PHYNBR" = "0" ] && mmc_get_mac_ascii u-boot-env 2gMAC > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && mmc_get_mac_ascii u-boot-env 5gMAC > /sys${DEVPATH}/macaddress + ;; asus,rt-ax59u) CI_UBIPART="UBI_DEV" addr=$(mtd_get_mac_binary_ubi "Factory" 0x4) diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh index 0d7da89cea..9d279898ac 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -2,7 +2,8 @@ preinit_set_mac_address() { case $(board_name) in - acer,predator-w6) + acer,predator-w6|\ + acer,predator-w6d) $(mmc_get_mac_ascii u-boot-env WANMAC) $(mmc_get_mac_ascii u-boot-env LANMAC) ip link set dev lan1 address "$lan_mac" @@ -11,6 +12,14 @@ preinit_set_mac_address() { ip link set dev game address "$lan_mac" ip link set dev eth1 address "$wan_mac" ;; + acer,vero-w6m) + wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC) + lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC) + ip link set dev lan1 address "$lan_mac" + ip link set dev lan2 address "$lan_mac" + ip link set dev lan3 address "$lan_mac" + ip link set dev internet address "$wan_mac" + ;; asus,tuf-ax4200|\ asus,tuf-ax6000) CI_UBIPART="UBI_DEV" diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index cfd77b62d7..ce334b2c8e 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -91,7 +91,13 @@ platform_do_upgrade() { fit_do_upgrade "$1" ;; acer,predator-w6|\ + acer,predator-w6d|\ + acer,vero-w6m|\ arcadyan,mozart|\ + glinet,gl-mt2500|\ + glinet,gl-mt6000|\ + glinet,gl-x3000|\ + glinet,gl-xe3000|\ smartrg,sdg-8612|\ smartrg,sdg-8614|\ smartrg,sdg-8622|\ @@ -115,14 +121,6 @@ platform_do_upgrade() { yuncore,ax835) default_do_upgrade "$1" ;; - glinet,gl-mt2500|\ - glinet,gl-mt6000|\ - glinet,gl-x3000|\ - glinet,gl-xe3000) - CI_KERNPART="kernel" - CI_ROOTPART="rootfs" - emmc_do_upgrade "$1" - ;; mercusys,mr90x-v1|\ tplink,re6000xd) CI_UBIPART="ubi0" @@ -204,6 +202,8 @@ platform_copy_config() { fi ;; acer,predator-w6|\ + acer,predator-w6d|\ + acer,vero-w6m|\ arcadyan,mozart|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 838a433bf4..072cae0d1f 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -165,6 +165,36 @@ define Device/acer_predator-w6 endef TARGET_DEVICES += acer_predator-w6 +define Device/acer_predator-w6d + DEVICE_VENDOR := Acer + DEVICE_MODEL := Predator Connect W6d + DEVICE_DTS := mt7986a-acer-predator-w6d + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + IMAGES := sysupgrade.bin + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += acer_predator-w6d + +define Device/acer_vero-w6m + DEVICE_VENDOR := Acer + DEVICE_MODEL := Connect Vero W6m + DEVICE_DTS := mt7986a-acer-vero-w6m + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + DEVICE_PACKAGES := kmod-leds-ktd202x kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + IMAGES := sysupgrade.bin + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += acer_vero-w6m + define Device/adtran_smartrg DEVICE_VENDOR := Adtran DEVICE_DTS_DIR := ../dts From 4779e954fa847c4b376623bc3bdf9651007e8a89 Mon Sep 17 00:00:00 2001 From: David Ignjic Date: Wed, 13 Nov 2024 11:20:27 +0100 Subject: [PATCH 102/119] mediatek: filogic: add support for Cudy WR3000S v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardware -------- MediaTek MT7981 WiSoC 256MB DDR3 RAM 128MB SPI-NAND (XMC XM25QH128C) MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5) UART: 115200 8N1 3.3V MAC: LAN MAC: label mac WAN MAC: label mac + 1 2.4G MAC: label mac 5G MAC: label mac + 1 with LA bit set Installation ------------ 1. Connect to the serial port as described in the "Hardware" section. 2. Power on the device + press reset pin. Keep pressing reset pin to enter the U-Boot shell. 3. Download the OpenWrt initramfs image. Place it on an TFTP server connected to the Cudy LAN ports. Make sure the server is reachable at 192.168.1.88. Rename the image to "cudy3000s.bin" 4. Download and boot the OpenWrt initramfs image. $ tftpboot 0x46000000 cudy3000s.bin; bootm 0x46000000 5. Transfer the OpenWrt sysupgrade image to the device using scp. Install with sysupgrade. Signed-off-by: David Ignjic Link: https://github.com/openwrt/openwrt/pull/16939 Signed-off-by: Hauke Mehrtens (cherry picked from commit faf4b3e0f7a583a8fa1a65b302ac74457e48575f) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../mediatek/dts/mt7981b-cudy-wr3000s-v1.dts | 283 ++++++++++++++++++ .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 1 + target/linux/mediatek/image/filogic.mk | 17 ++ 3 files changed, 301 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts new file mode 100644 index 0000000000..a643969494 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts @@ -0,0 +1,283 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include + +#include "mt7981.dtsi" + +/ { + model = "Cudy WR3000S v1"; + compatible = "cudy,wr3000s-v1", "mediatek,mt7981-spim-snand-rfb"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status: led@0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + + led_internet { + function = LED_FUNCTION_WAN_ONLINE; + color = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led_wps { + function = LED_FUNCTION_WPS; + color = ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led_wlan2g { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; + gpios = <&pio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_wlan5g { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x00000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + + partition@380000 { + label = "bdinfo"; + reg = <0x380000 0x0040000>; + read-only; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@3C0000 { + label = "FIP"; + reg = <0x3C0000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x5C0000 0x4000000>; + compatible = "linux,ubi"; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 1>; + }; + + port@1 { + reg = <1>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@4 { + reg = <4>; + label = "lan4"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index f87cc0646e..7402bfc71b 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -81,6 +81,7 @@ case "$board" in ;; cudy,ap3000outdoor-v1|\ cudy,m3000-v1|\ + cudy,wr3000s-v1|\ cudy,wr3000-v1) addr=$(mtd_get_mac_binary bdinfo 0xde00) # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 072cae0d1f..f366a9b920 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -667,6 +667,23 @@ define Device/cudy_wr3000-v1 endef TARGET_DEVICES += cudy_wr3000-v1 +define Device/cudy_wr3000s-v1 + DEVICE_VENDOR := Cudy + DEVICE_MODEL := WR3000S + DEVICE_VARIANT := v1 + DEVICE_DTS := mt7981b-cudy-wr3000s-v1 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += R59 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware +endef +TARGET_DEVICES += cudy_wr3000s-v1 + define Device/dlink_aquila-pro-ai-m30-a1 DEVICE_VENDOR := D-Link DEVICE_MODEL := AQUILA PRO AI M30 From 005f0867524ff26e62167b1c71208dd05f33cfb5 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 24 Nov 2024 14:39:57 +0100 Subject: [PATCH 103/119] x86: Deactivate kernel options with extra overhead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deactivate CONFIG_CONTEXT_TRACKING_USER_FORCE: Force user context tracking: This is a testing feature which should not be activate in production environments according to the Kconfig help. It adds an extra overhead. Deactivate CONFIG_RCU_NOCB_CPU_DEFAULT_ALL: Offload RCU callback processing from all CPUs by default: This option should only be used in aggressive HPC or real-time workloads which we do not have in OpenWrt. For normal workloads it increases the number of context switches. In the default Arch Linux kernel both options are not activated. Fixes: 31111680f6fc ("x86: switch config to a tickless kernel") Link: https://github.com/openwrt/openwrt/pull/17057 Signed-off-by: Hauke Mehrtens (cherry picked from commit ed523454454965da07c9c7a009ae0a3995aa7c33) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/x86/config-6.6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/config-6.6 b/target/linux/x86/config-6.6 index b3d15bc104..c416bb6a08 100644 --- a/target/linux/x86/config-6.6 +++ b/target/linux/x86/config-6.6 @@ -46,7 +46,7 @@ CONFIG_COMPAT_32=y CONFIG_COMPAT_32BIT_TIME=y # CONFIG_COMPAT_VDSO is not set CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_CONTEXT_TRACKING_USER_FORCE=y +# CONFIG_CONTEXT_TRACKING_USER_FORCE is not set # CONFIG_CPU5_WDT is not set CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y @@ -334,7 +334,7 @@ CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y CONFIG_RCU_LAZY=y -CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y +# CONFIG_RCU_NOCB_CPU_DEFAULT_ALL is not set CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y CONFIG_RETHUNK=y From 2544e03d10fc5e06e9423878bf9d1ab02def5bc2 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 23 Nov 2024 22:32:03 +0100 Subject: [PATCH 104/119] dropbear: bump to 2024.86 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update dropbear to latest stable 2024.86; for the changes see https://matt.ucc.asn.au/dropbear/CHANGES Link: https://github.com/openwrt/openwrt/pull/17053 Signed-off-by: Hauke Mehrtens (cherry picked from commit a9d3c5b4c9bf910d4b3b42109161b1f6526b76eb) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/network/services/dropbear/Makefile | 6 +++--- .../network/services/dropbear/patches/110-change_user.patch | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 1918e7dec6..e13b6c2145 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear -PKG_VERSION:=2024.85 -PKG_RELEASE:=2 +PKG_VERSION:=2024.86 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ https://matt.ucc.asn.au/dropbear/releases/ \ https://dropbear.nl/mirror/releases/ -PKG_HASH:=86b036c433a69d89ce51ebae335d65c47738ccf90d13e5eb0fea832e556da502 +PKG_HASH:=e78936dffc395f2e0db099321d6be659190966b99712b55c530dd0a1822e0a5e PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE diff --git a/package/network/services/dropbear/patches/110-change_user.patch b/package/network/services/dropbear/patches/110-change_user.patch index 9cb073cf94..9ef8f0cfbc 100644 --- a/package/network/services/dropbear/patches/110-change_user.patch +++ b/package/network/services/dropbear/patches/110-change_user.patch @@ -1,6 +1,6 @@ --- a/src/svr-chansession.c +++ b/src/svr-chansession.c -@@ -987,12 +987,12 @@ static void execchild(const void *user_d +@@ -984,12 +984,12 @@ static void execchild(const void *user_d /* We can only change uid/gid as root ... */ if (getuid() == 0) { From 888e879d7ffdad46998a1f7570f8c3b642a94eac Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 24 Nov 2024 14:52:22 +0100 Subject: [PATCH 105/119] CI: labeler: Add stm32 target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a label for changes in the stm32 target. Fixes: 851e7f77e424 ("stm32: add new stm32 target") Link: https://github.com/openwrt/openwrt/pull/17058 Signed-off-by: Hauke Mehrtens (cherry picked from commit eb7aa07a0e23e931579de07e0dbdec735b8e35b2) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .github/labeler.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index ede4bb5a02..129357df2b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -180,6 +180,13 @@ - changed-files: - any-glob-to-any-file: - "target/linux/starfive/**" +"target/stm32": +- changed-files: + - any-glob-to-any-file: + - "target/linux/stm32/**" + - "package/boot/arm-trusted-firmware-stm32/**" + - "package/boot/optee-os-stm32/**" + - "package/boot/uboot-stm32/**" "target/sunxi": - changed-files: - any-glob-to-any-file: From 1b2adb8000244d3488cc83e3f4950ce3dc631544 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 24 Nov 2024 14:53:47 +0100 Subject: [PATCH 106/119] stm32: Remove unnecessary kernel options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These options are filtered out since some weeks, remove them also from the new stm32 target. Fixes: 851e7f77e424 ("stm32: add new stm32 target") Link: https://github.com/openwrt/openwrt/pull/17058 Signed-off-by: Hauke Mehrtens (cherry picked from commit ea2c860225b8bbda98ed0526dc670825866835b6) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/stm32/stm32mp1/config-6.6 | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/linux/stm32/stm32mp1/config-6.6 b/target/linux/stm32/stm32mp1/config-6.6 index 946649ef9b..e19abcc7dc 100644 --- a/target/linux/stm32/stm32mp1/config-6.6 +++ b/target/linux/stm32/stm32mp1/config-6.6 @@ -70,8 +70,6 @@ CONFIG_BOUNCE=y CONFIG_BUFFER_HEAD=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CHR_DEV_SG=y CONFIG_CLKSRC_MMIO=y CONFIG_CLKSRC_STM32=y @@ -189,7 +187,6 @@ CONFIG_FUNCTION_ALIGNMENT=0 CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y # CONFIG_FW_LOADER_USER_HELPER is not set -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y From 67269ae51ecd7abfdc761ec9a802092965babe1e Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 24 Nov 2024 14:57:19 +0100 Subject: [PATCH 107/119] kernel: usb: kmod-usb-audio: Fix dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the dependency on the kmod-media-controller from depends to select. Fixes: 109592524663 ("kernel: add kmod-media-controller dependency for kmod-usb-audio") Link: https://github.com/openwrt/openwrt/pull/17058 Signed-off-by: Hauke Mehrtens (cherry picked from commit b7dd70a0d708b7f8fe9f5c95d09013245e3dcb6b) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/usb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 466c547e8a..734df050cd 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -576,7 +576,7 @@ define KernelPackage/usb-audio CONFIG_SND_USB_AUDIO $(call AddDepends/usb) $(call AddDepends/sound) - DEPENDS+=kmod-media-controller + DEPENDS+=+kmod-media-controller FILES:= \ $(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko \ $(LINUX_DIR)/sound/usb/snd-usb-audio.ko From 0a0950614b7377c23d24999f7d44068e6ee09860 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 3 Nov 2024 12:30:21 +0800 Subject: [PATCH 108/119] ramips: mt76x8: disable unused Ralink systick driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mt76x8 series SoCs use the MIPS generic systick timer. Sync the upstream Ralink systick driver changes and disable it for mt76x8 target to reduce the kernel size. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/16844 Signed-off-by: Hauke Mehrtens (cherry picked from commit 0c57510cedeff9caf795930ff86a436aa54bcc6d) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/mt7620/config-6.6 | 2 +- target/linux/ramips/mt76x8/config-6.6 | 6 +- ...ers-ralink-Add-Ralink-System-Tick-Co.patch | 384 ++++++++++++++++++ ...e-to-enable-disable-the-cevt-r4k-irq.patch | 36 +- ...IPS-ralink-add-cpu-frequency-scaling.patch | 35 +- ...-select-illegal-access-driver-by-def.patch | 4 +- target/linux/ramips/rt305x/config-6.6 | 2 +- 7 files changed, 426 insertions(+), 43 deletions(-) create mode 100644 target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch diff --git a/target/linux/ramips/mt7620/config-6.6 b/target/linux/ramips/mt7620/config-6.6 index edd64a642c..3e1ef761e0 100644 --- a/target/linux/ramips/mt7620/config-6.6 +++ b/target/linux/ramips/mt7620/config-6.6 @@ -8,7 +8,6 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y CONFIG_CEVT_SYSTICK_QUIRK=y -CONFIG_CLKEVT_RT3352=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_MTMIPS=y CONFIG_CLONE_BACKWARDS=y @@ -180,6 +179,7 @@ CONFIG_PINCTRL_MTK_MTMIPS=y CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_RALINK=y +CONFIG_RALINK_TIMER=y CONFIG_RALINK_WDT=y CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y diff --git a/target/linux/ramips/mt76x8/config-6.6 b/target/linux/ramips/mt76x8/config-6.6 index 31dc4a980f..f40d18efcc 100644 --- a/target/linux/ramips/mt76x8/config-6.6 +++ b/target/linux/ramips/mt76x8/config-6.6 @@ -6,9 +6,6 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y -CONFIG_CEVT_SYSTICK_QUIRK=y -CONFIG_CLKEVT_RT3352=y -CONFIG_CLKSRC_MMIO=y CONFIG_CLK_MTMIPS=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs,jffs2" @@ -173,6 +170,7 @@ CONFIG_PINCTRL_MTK_MTMIPS=y CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_RALINK=y +# CONFIG_RALINK_TIMER is not set # CONFIG_RALINK_WDT is not set CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y @@ -215,8 +213,6 @@ CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_SYS_SUPPORTS_ZBOOT=y CONFIG_TARGET_ISA_REV=2 CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y diff --git a/target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch b/target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch new file mode 100644 index 0000000000..cd2a90826c --- /dev/null +++ b/target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch @@ -0,0 +1,384 @@ +From 57cbfd333c9d65bfab1a06b49c75536ee28dc2ce Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Mon, 28 Oct 2024 21:36:43 +0100 +Subject: clocksource/drivers/ralink: Add Ralink System Tick Counter driver + +System Tick Counter is present on Ralink SoCs RT3352 and MT7620. This +driver has been in 'arch/mips/ralink' directory since the beggining of +Ralink architecture support. However, it can be moved into a more proper +place in 'drivers/clocksource'. Hence add it here adding also support for +compile test targets and reducing LOC in architecture code folder. + +Signed-off-by: Sergio Paracuellos +Link: https://lore.kernel.org/r/20241028203643.191268-2-sergio.paracuellos@gmail.com +Signed-off-by: Daniel Lezcano +--- + arch/mips/ralink/Kconfig | 7 -- + arch/mips/ralink/Makefile | 2 - + arch/mips/ralink/cevt-rt3352.c | 153 ------------------------------------- + drivers/clocksource/Kconfig | 9 +++ + drivers/clocksource/Makefile | 1 + + drivers/clocksource/timer-ralink.c | 150 ++++++++++++++++++++++++++++++++++++ + 6 files changed, 160 insertions(+), 162 deletions(-) + delete mode 100644 arch/mips/ralink/cevt-rt3352.c + create mode 100644 drivers/clocksource/timer-ralink.c + +--- a/arch/mips/ralink/Kconfig ++++ b/arch/mips/ralink/Kconfig +@@ -1,13 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0 + if RALINK + +-config CLKEVT_RT3352 +- bool +- depends on SOC_RT305X || SOC_MT7620 +- default y +- select TIMER_OF +- select CLKSRC_MMIO +- + config RALINK_ILL_ACC + bool + depends on SOC_RT305X +--- a/arch/mips/ralink/Makefile ++++ b/arch/mips/ralink/Makefile +@@ -10,8 +10,6 @@ ifndef CONFIG_MIPS_GIC + obj-y += clk.o timer.o + endif + +-obj-$(CONFIG_CLKEVT_RT3352) += cevt-rt3352.o +- + obj-$(CONFIG_RALINK_ILL_ACC) += ill_acc.o + + obj-$(CONFIG_IRQ_INTC) += irq.o +--- a/arch/mips/ralink/cevt-rt3352.c ++++ /dev/null +@@ -1,153 +0,0 @@ +-/* +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file "COPYING" in the main directory of this archive +- * for more details. +- * +- * Copyright (C) 2013 by John Crispin +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-#define SYSTICK_FREQ (50 * 1000) +- +-#define SYSTICK_CONFIG 0x00 +-#define SYSTICK_COMPARE 0x04 +-#define SYSTICK_COUNT 0x08 +- +-/* route systick irq to mips irq 7 instead of the r4k-timer */ +-#define CFG_EXT_STK_EN 0x2 +-/* enable the counter */ +-#define CFG_CNT_EN 0x1 +- +-struct systick_device { +- void __iomem *membase; +- struct clock_event_device dev; +- int irq_requested; +- int freq_scale; +-}; +- +-static int systick_set_oneshot(struct clock_event_device *evt); +-static int systick_shutdown(struct clock_event_device *evt); +- +-static int systick_next_event(unsigned long delta, +- struct clock_event_device *evt) +-{ +- struct systick_device *sdev; +- u32 count; +- +- sdev = container_of(evt, struct systick_device, dev); +- count = ioread32(sdev->membase + SYSTICK_COUNT); +- count = (count + delta) % SYSTICK_FREQ; +- iowrite32(count, sdev->membase + SYSTICK_COMPARE); +- +- return 0; +-} +- +-static void systick_event_handler(struct clock_event_device *dev) +-{ +- /* noting to do here */ +-} +- +-static irqreturn_t systick_interrupt(int irq, void *dev_id) +-{ +- struct clock_event_device *dev = (struct clock_event_device *) dev_id; +- +- dev->event_handler(dev); +- +- return IRQ_HANDLED; +-} +- +-static struct systick_device systick = { +- .dev = { +- /* +- * cevt-r4k uses 300, make sure systick +- * gets used if available +- */ +- .rating = 310, +- .features = CLOCK_EVT_FEAT_ONESHOT, +- .set_next_event = systick_next_event, +- .set_state_shutdown = systick_shutdown, +- .set_state_oneshot = systick_set_oneshot, +- .event_handler = systick_event_handler, +- }, +-}; +- +-static int systick_shutdown(struct clock_event_device *evt) +-{ +- struct systick_device *sdev; +- +- sdev = container_of(evt, struct systick_device, dev); +- +- if (sdev->irq_requested) +- free_irq(systick.dev.irq, &systick.dev); +- sdev->irq_requested = 0; +- iowrite32(0, systick.membase + SYSTICK_CONFIG); +- +- return 0; +-} +- +-static int systick_set_oneshot(struct clock_event_device *evt) +-{ +- const char *name = systick.dev.name; +- struct systick_device *sdev; +- int irq = systick.dev.irq; +- +- sdev = container_of(evt, struct systick_device, dev); +- +- if (!sdev->irq_requested) { +- if (request_irq(irq, systick_interrupt, +- IRQF_PERCPU | IRQF_TIMER, name, &systick.dev)) +- pr_err("Failed to request irq %d (%s)\n", irq, name); +- } +- sdev->irq_requested = 1; +- iowrite32(CFG_EXT_STK_EN | CFG_CNT_EN, +- systick.membase + SYSTICK_CONFIG); +- +- return 0; +-} +- +-static int __init ralink_systick_init(struct device_node *np) +-{ +- int ret; +- +- systick.membase = of_iomap(np, 0); +- if (!systick.membase) +- return -ENXIO; +- +- systick.dev.name = np->name; +- clockevents_calc_mult_shift(&systick.dev, SYSTICK_FREQ, 60); +- systick.dev.max_delta_ns = clockevent_delta2ns(0x7fff, &systick.dev); +- systick.dev.max_delta_ticks = 0x7fff; +- systick.dev.min_delta_ns = clockevent_delta2ns(0x3, &systick.dev); +- systick.dev.min_delta_ticks = 0x3; +- systick.dev.irq = irq_of_parse_and_map(np, 0); +- if (!systick.dev.irq) { +- pr_err("%pOFn: request_irq failed", np); +- return -EINVAL; +- } +- +- ret = clocksource_mmio_init(systick.membase + SYSTICK_COUNT, np->name, +- SYSTICK_FREQ, 301, 16, +- clocksource_mmio_readl_up); +- if (ret) +- return ret; +- +- clockevents_register_device(&systick.dev); +- +- pr_info("%pOFn: running - mult: %d, shift: %d\n", +- np, systick.dev.mult, systick.dev.shift); +- +- return 0; +-} +- +-TIMER_OF_DECLARE(systick, "ralink,cevt-systick", ralink_systick_init); +--- a/drivers/clocksource/Kconfig ++++ b/drivers/clocksource/Kconfig +@@ -732,4 +732,13 @@ config GOLDFISH_TIMER + help + Support for the timer/counter of goldfish-rtc + ++config RALINK_TIMER ++ bool "Ralink System Tick Counter" ++ depends on SOC_RT305X || SOC_MT7620 || COMPILE_TEST ++ select CLKSRC_MMIO ++ select TIMER_OF ++ help ++ Enables support for system tick counter present on ++ Ralink SoCs RT3352 and MT7620. ++ + endmenu +--- a/drivers/clocksource/Makefile ++++ b/drivers/clocksource/Makefile +@@ -89,3 +89,4 @@ obj-$(CONFIG_MSC313E_TIMER) += timer-ms + obj-$(CONFIG_GOLDFISH_TIMER) += timer-goldfish.o + obj-$(CONFIG_GXP_TIMER) += timer-gxp.o + obj-$(CONFIG_CLKSRC_LOONGSON1_PWM) += timer-loongson1-pwm.o ++obj-$(CONFIG_RALINK_TIMER) += timer-ralink.o +--- /dev/null ++++ b/drivers/clocksource/timer-ralink.c +@@ -0,0 +1,150 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Ralink System Tick Counter driver present on RT3352 and MT7620 SoCs. ++ * ++ * Copyright (C) 2013 by John Crispin ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define SYSTICK_FREQ (50 * 1000) ++ ++#define SYSTICK_CONFIG 0x00 ++#define SYSTICK_COMPARE 0x04 ++#define SYSTICK_COUNT 0x08 ++ ++/* route systick irq to mips irq 7 instead of the r4k-timer */ ++#define CFG_EXT_STK_EN 0x2 ++/* enable the counter */ ++#define CFG_CNT_EN 0x1 ++ ++struct systick_device { ++ void __iomem *membase; ++ struct clock_event_device dev; ++ int irq_requested; ++ int freq_scale; ++}; ++ ++static int systick_set_oneshot(struct clock_event_device *evt); ++static int systick_shutdown(struct clock_event_device *evt); ++ ++static int systick_next_event(unsigned long delta, ++ struct clock_event_device *evt) ++{ ++ struct systick_device *sdev; ++ u32 count; ++ ++ sdev = container_of(evt, struct systick_device, dev); ++ count = ioread32(sdev->membase + SYSTICK_COUNT); ++ count = (count + delta) % SYSTICK_FREQ; ++ iowrite32(count, sdev->membase + SYSTICK_COMPARE); ++ ++ return 0; ++} ++ ++static void systick_event_handler(struct clock_event_device *dev) ++{ ++ /* noting to do here */ ++} ++ ++static irqreturn_t systick_interrupt(int irq, void *dev_id) ++{ ++ struct clock_event_device *dev = (struct clock_event_device *)dev_id; ++ ++ dev->event_handler(dev); ++ ++ return IRQ_HANDLED; ++} ++ ++static struct systick_device systick = { ++ .dev = { ++ /* ++ * cevt-r4k uses 300, make sure systick ++ * gets used if available ++ */ ++ .rating = 310, ++ .features = CLOCK_EVT_FEAT_ONESHOT, ++ .set_next_event = systick_next_event, ++ .set_state_shutdown = systick_shutdown, ++ .set_state_oneshot = systick_set_oneshot, ++ .event_handler = systick_event_handler, ++ }, ++}; ++ ++static int systick_shutdown(struct clock_event_device *evt) ++{ ++ struct systick_device *sdev; ++ ++ sdev = container_of(evt, struct systick_device, dev); ++ ++ if (sdev->irq_requested) ++ free_irq(systick.dev.irq, &systick.dev); ++ sdev->irq_requested = 0; ++ iowrite32(0, systick.membase + SYSTICK_CONFIG); ++ ++ return 0; ++} ++ ++static int systick_set_oneshot(struct clock_event_device *evt) ++{ ++ const char *name = systick.dev.name; ++ struct systick_device *sdev; ++ int irq = systick.dev.irq; ++ ++ sdev = container_of(evt, struct systick_device, dev); ++ ++ if (!sdev->irq_requested) { ++ if (request_irq(irq, systick_interrupt, ++ IRQF_PERCPU | IRQF_TIMER, name, &systick.dev)) ++ pr_err("Failed to request irq %d (%s)\n", irq, name); ++ } ++ sdev->irq_requested = 1; ++ iowrite32(CFG_EXT_STK_EN | CFG_CNT_EN, ++ systick.membase + SYSTICK_CONFIG); ++ ++ return 0; ++} ++ ++static int __init ralink_systick_init(struct device_node *np) ++{ ++ int ret; ++ ++ systick.membase = of_iomap(np, 0); ++ if (!systick.membase) ++ return -ENXIO; ++ ++ systick.dev.name = np->name; ++ clockevents_calc_mult_shift(&systick.dev, SYSTICK_FREQ, 60); ++ systick.dev.max_delta_ns = clockevent_delta2ns(0x7fff, &systick.dev); ++ systick.dev.max_delta_ticks = 0x7fff; ++ systick.dev.min_delta_ns = clockevent_delta2ns(0x3, &systick.dev); ++ systick.dev.min_delta_ticks = 0x3; ++ systick.dev.irq = irq_of_parse_and_map(np, 0); ++ if (!systick.dev.irq) { ++ pr_err("%pOFn: request_irq failed", np); ++ return -EINVAL; ++ } ++ ++ ret = clocksource_mmio_init(systick.membase + SYSTICK_COUNT, np->name, ++ SYSTICK_FREQ, 301, 16, ++ clocksource_mmio_readl_up); ++ if (ret) ++ return ret; ++ ++ clockevents_register_device(&systick.dev); ++ ++ pr_info("%pOFn: running - mult: %d, shift: %d\n", ++ np, systick.dev.mult, systick.dev.shift); ++ ++ return 0; ++} ++ ++TIMER_OF_DECLARE(systick, "ralink,cevt-systick", ralink_systick_init); diff --git a/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch b/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch index 36925b8326..d59a71af88 100644 --- a/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch +++ b/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch @@ -1,13 +1,11 @@ -From ce3d4a4111a5f7e6b4e74bceae5faa6ce388e8ec Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 14 Jul 2013 23:08:11 +0200 -Subject: [PATCH 05/53] MIPS: use set_mode() to enable/disable the cevt-r4k - irq +Subject: [PATCH 1/2] MIPS: use set_mode() to enable/disable the cevt-r4k irq Signed-off-by: John Crispin --- arch/mips/kernel/cevt-r4k.c | 43 +++++++++++++++++++++++++++++++++++++ - arch/mips/ralink/Kconfig | 5 +++++ + drivers/clocksource/Kconfig | 5 +++++ 2 files changed, 48 insertions(+) --- a/arch/mips/kernel/cevt-r4k.c @@ -96,23 +94,21 @@ Signed-off-by: John Crispin return 0; } ---- a/arch/mips/ralink/Kconfig -+++ b/arch/mips/ralink/Kconfig -@@ -1,12 +1,17 @@ - # SPDX-License-Identifier: GPL-2.0 - if RALINK - +--- a/drivers/clocksource/Kconfig ++++ b/drivers/clocksource/Kconfig +@@ -731,10 +731,15 @@ config GOLDFISH_TIMER + depends on RTC_DRV_GOLDFISH + help + Support for the timer/counter of goldfish-rtc ++ +config CEVT_SYSTICK_QUIRK + bool + default n -+ - config CLKEVT_RT3352 - bool - depends on SOC_RT305X || SOC_MT7620 - default y - select TIMER_OF - select CLKSRC_MMIO -+ select CEVT_SYSTICK_QUIRK - config RALINK_ILL_ACC - bool + config RALINK_TIMER + bool "Ralink System Tick Counter" + depends on SOC_RT305X || SOC_MT7620 || COMPILE_TEST ++ select CEVT_SYSTICK_QUIRK + select CLKSRC_MMIO + select TIMER_OF + help diff --git a/target/linux/ramips/patches-6.6/312-MIPS-ralink-add-cpu-frequency-scaling.patch b/target/linux/ramips/patches-6.6/312-MIPS-ralink-add-cpu-frequency-scaling.patch index 0d70770941..6acdfff837 100644 --- a/target/linux/ramips/patches-6.6/312-MIPS-ralink-add-cpu-frequency-scaling.patch +++ b/target/linux/ramips/patches-6.6/312-MIPS-ralink-add-cpu-frequency-scaling.patch @@ -1,19 +1,26 @@ -From bd30f19a006fb52bac80c6463c49dd2f4159f4ac Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 28 Jul 2013 16:26:41 +0200 -Subject: [PATCH 06/53] MIPS: ralink: add cpu frequency scaling +Subject: [PATCH 2/2] MIPS: ralink: add cpu frequency scaling This feature will break udelay() and cause the delay loop to have longer delays when the frequency is scaled causing a performance hit. Signed-off-by: John Crispin --- - arch/mips/ralink/cevt-rt3352.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) + drivers/clocksource/timer-ralink.c | 117 ++++++++++++++++++++++------- + 1 file changed, 89 insertions(+), 28 deletions(-) ---- a/arch/mips/ralink/cevt-rt3352.c -+++ b/arch/mips/ralink/cevt-rt3352.c -@@ -29,6 +29,10 @@ +--- a/drivers/clocksource/timer-ralink.c ++++ b/drivers/clocksource/timer-ralink.c +@@ -5,6 +5,7 @@ + * Copyright (C) 2013 by John Crispin + */ + ++#include + #include + #include + #include +@@ -26,6 +27,10 @@ /* enable the counter */ #define CFG_CNT_EN 0x1 @@ -24,7 +31,7 @@ Signed-off-by: John Crispin struct systick_device { void __iomem *membase; struct clock_event_device dev; -@@ -36,21 +40,53 @@ struct systick_device { +@@ -33,21 +38,53 @@ struct systick_device { int freq_scale; }; @@ -64,7 +71,7 @@ Signed-off-by: John Crispin +} + static int systick_next_event(unsigned long delta, - struct clock_event_device *evt) + struct clock_event_device *evt) { struct systick_device *sdev; - u32 count; @@ -83,18 +90,18 @@ Signed-off-by: John Crispin } static void systick_event_handler(struct clock_event_device *dev) -@@ -60,20 +96,25 @@ static void systick_event_handler(struct +@@ -57,20 +94,25 @@ static void systick_event_handler(struct static irqreturn_t systick_interrupt(int irq, void *dev_id) { -- struct clock_event_device *dev = (struct clock_event_device *) dev_id; +- struct clock_event_device *dev = (struct clock_event_device *)dev_id; + int ret = 0; + struct clock_event_device *cdev; + struct systick_device *sdev; - dev->event_handler(dev); + if (read_c0_cause() & STATUSF_IP7) { -+ cdev = (struct clock_event_device *) dev_id; ++ cdev = (struct clock_event_device *)dev_id; + sdev = container_of(cdev, struct systick_device, dev); + + /* Clear Count/Compare Interrupt */ @@ -117,7 +124,7 @@ Signed-off-by: John Crispin .features = CLOCK_EVT_FEAT_ONESHOT, .set_next_event = systick_next_event, .set_state_shutdown = systick_shutdown, -@@ -91,7 +132,13 @@ static int systick_shutdown(struct clock +@@ -88,7 +130,13 @@ static int systick_shutdown(struct clock if (sdev->irq_requested) free_irq(systick.dev.irq, &systick.dev); sdev->irq_requested = 0; @@ -132,7 +139,7 @@ Signed-off-by: John Crispin return 0; } -@@ -116,33 +163,46 @@ static int systick_set_oneshot(struct cl +@@ -113,33 +161,46 @@ static int systick_set_oneshot(struct cl return 0; } diff --git a/target/linux/ramips/patches-6.6/316-arch-mips-do-not-select-illegal-access-driver-by-def.patch b/target/linux/ramips/patches-6.6/316-arch-mips-do-not-select-illegal-access-driver-by-def.patch index 1dc54ccf23..8568041670 100644 --- a/target/linux/ramips/patches-6.6/316-arch-mips-do-not-select-illegal-access-driver-by-def.patch +++ b/target/linux/ramips/patches-6.6/316-arch-mips-do-not-select-illegal-access-driver-by-def.patch @@ -11,8 +11,8 @@ Signed-off-by: John Crispin --- a/arch/mips/ralink/Kconfig +++ b/arch/mips/ralink/Kconfig -@@ -14,9 +14,9 @@ config CLKEVT_RT3352 - select CEVT_SYSTICK_QUIRK +@@ -2,9 +2,9 @@ + if RALINK config RALINK_ILL_ACC - bool diff --git a/target/linux/ramips/rt305x/config-6.6 b/target/linux/ramips/rt305x/config-6.6 index 6f7b7ea2a1..33efcba633 100644 --- a/target/linux/ramips/rt305x/config-6.6 +++ b/target/linux/ramips/rt305x/config-6.6 @@ -6,7 +6,6 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_CEVT_R4K=y CONFIG_CEVT_SYSTICK_QUIRK=y -CONFIG_CLKEVT_RT3352=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_MTMIPS=y CONFIG_CLONE_BACKWARDS=y @@ -160,6 +159,7 @@ CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_RALINK=y # CONFIG_RALINK_ILL_ACC is not set +CONFIG_RALINK_TIMER=y CONFIG_RALINK_WDT=y CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y From fd7b1f60ea8d6a5c9da1dce70fd86231f5599aa6 Mon Sep 17 00:00:00 2001 From: Mauri Sandberg Date: Mon, 28 Oct 2024 22:13:04 +0200 Subject: [PATCH 109/119] ramips: dna_valokuitu-plus-ex400: clean-up image creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code cleanup. Simplify and unify how kernel image is passed to Build/dna-bootfs Signed-off-by: Mauri Sandberg Link: https://github.com/openwrt/openwrt/pull/16811 Signed-off-by: Hauke Mehrtens (cherry picked from commit ec839c786ca56c6143257b89f146aeafbb6cfd3a) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/ramips/image/mt7621.mk | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 1dc1219d24..eb7dacefef 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -94,18 +94,9 @@ endef define Build/dna-bootfs mkdir -p $@.ubifs-dir/boot - # populate the boot fs with the dtb and with either initramfs kernel or - # the normal kernel + # populate the boot fs with the dtb and the kernel image $(CP) $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@.ubifs-dir/boot/dtb - - $(if $(findstring with-initrd,$(word 1,$(1))),\ - ( \ - $(CP) $@ $@.ubifs-dir/boot/uImage \ - ) , \ - ( \ - $(CP) $(IMAGE_KERNEL) $@.ubifs-dir/boot/uImage \ - ) \ - ) + $(CP) $@ $@.ubifs-dir/boot/uImage # create ubifs $(STAGING_DIR_HOST)/bin/mkfs.ubifs ${MKUBIFS_OPTS} -r $@.ubifs-dir/ -o $@.new @@ -1060,17 +1051,16 @@ define Device/dna_valokuitu-plus-ex400 IMAGE_SIZE := 117m PAGESIZE := 2048 MKUBIFS_OPTS := --min-io-size=$$(PAGESIZE) --leb-size=124KiB --max-leb-cnt=96 \ - --log-lebs=2 --space-fixup --squash-uids + --log-lebs=2 --space-fixup --squash-uids DEVICE_VENDOR := DNA DEVICE_MODEL := Valokuitu Plus EX400 KERNEL := kernel-bin | lzma | uImage lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma IMAGES += factory.bin IMAGE/factory.bin := append-image-stage initramfs-kernel.bin | \ - dna-bootfs with-initrd | dna-header | \ - append-md5sum-ascii-salted - IMAGE/sysupgrade.bin := dna-bootfs | sysupgrade-tar kernel=$$$$@ | check-size | \ - append-metadata + dna-bootfs | dna-header | append-md5sum-ascii-salted + IMAGE/sysupgrade.bin := append-kernel | dna-bootfs | \ + sysupgrade-tar kernel=$$$$@ | check-size | append-metadata DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2) DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3 endef From ba95a01cbfd67a7c89c2d95fb2ef21b2e9bdf265 Mon Sep 17 00:00:00 2001 From: Mikhail Zhilkin Date: Sat, 26 Oct 2024 09:34:43 +0000 Subject: [PATCH 110/119] uboot-mediatek: add Routerich AX3000 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add U-Boot replacement loader for Routerich AX3000. Signed-off-by: Mikhail Zhilkin Link: https://github.com/openwrt/openwrt/pull/16791 Signed-off-by: Hauke Mehrtens (cherry picked from commit c0581520b1c53fe2fc4a310f916590dcc428474a) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/boot/uboot-mediatek/Makefile | 13 + .../patches/460-add-routerich-ax3000.patch | 362 ++++++++++++++++++ 2 files changed, 375 insertions(+) create mode 100644 package/boot/uboot-mediatek/patches/460-add-routerich-ax3000.patch diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index d2a03277d4..fa314da399 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -413,6 +413,18 @@ define U-Boot/mt7981_rfb-snfi DEPENDS:=+trusted-firmware-a-mt7981-snand-ddr3 endef +define U-Boot/mt7981_routerich_ax3000 + NAME:=Routerich AX3000 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=routerich_ax3000-ubootmod + UBOOT_CONFIG:=mt7981_routerich_ax3000 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 +endef + define U-Boot/mt7981_qihoo_360t7 NAME:=Qihoo 360T7 BUILD_SUBTARGET:=filogic @@ -823,6 +835,7 @@ UBOOT_TARGETS := \ mt7981_rfb-nor \ mt7981_rfb-sd \ mt7981_rfb-snfi \ + mt7981_routerich_ax3000 \ mt7981_qihoo_360t7 \ mt7981_xiaomi_mi-router-ax3000t \ mt7981_xiaomi_mi-router-wr30u \ diff --git a/package/boot/uboot-mediatek/patches/460-add-routerich-ax3000.patch b/package/boot/uboot-mediatek/patches/460-add-routerich-ax3000.patch new file mode 100644 index 0000000000..9aa31843de --- /dev/null +++ b/package/boot/uboot-mediatek/patches/460-add-routerich-ax3000.patch @@ -0,0 +1,362 @@ +--- /dev/null ++++ b/configs/mt7981_routerich_ax3000_defconfig +@@ -0,0 +1,107 @@ ++CONFIG_ARM=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7981-routerich_ax3000" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7981=y ++CONFIG_PRE_CON_BUF_ADDR=0x4007ef00 ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-routerich_ax3000.dtb" ++CONFIG_LOGLEVEL=7 ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_LOG=y ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="MT7981> " ++CONFIG_CMD_CPU=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_ENV_UBI_PART="ubi" ++CONFIG_ENV_UBI_VOLUME="ubootenv" ++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_DEFAULT_ENV_FILE="routerich_ax3000_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_NETCONSOLE=y ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_MTD_UBI_FASTMAP=y ++CONFIG_PHY_FIXED=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PHY=y ++CONFIG_PHY_MTK_TPHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7981=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_RAM=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 +--- /dev/null ++++ b/arch/arm/dts/mt7981-routerich_ax3000.dts +@@ -0,0 +1,187 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Copyright (c) 2022 MediaTek Inc. ++ * Author: Sam Shih ++ */ ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "Routerich AX3000"; ++ compatible = "routerich,ax3000", "mediatek,mt7981"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x10000000>; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ button-0 { ++ label = "mesh"; ++ linux,code = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-1 { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ label = "red:wlan5g"; ++ gpios = <&gpio 5 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-1 { ++ label = "red:wan"; ++ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-2 { ++ label = "blue:power"; ++ gpios = <&gpio 7 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-3 { ++ label = "blue:lan1"; ++ gpios = <&gpio 9 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-4 { ++ label = "blue:lan2"; ++ gpios = <&gpio 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-5 { ++ label = "blue:lan3"; ++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-6 { ++ label = "blue:wan"; ++ gpios = <&gpio 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-7 { ++ label = "blue:wlan2g"; ++ gpios = <&gpio 34 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-8 { ++ label = "blue:mesh"; ++ gpios = <&gpio 35 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "2500base-x"; ++ mediatek,switch = "mt7531"; ++ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&pinctrl { ++ spi_flash_pins: spi0-pins-func-1 { ++ mux { ++ function = "flash"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&spi0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "uboot-env-orig"; ++ reg = <0x100000 0x80000>; ++ }; ++ ++ partition@160000 { ++ label = "Factory"; ++ reg = <0x180000 0x200000>; ++ }; ++ ++ partition@380000 { ++ label = "fip"; ++ reg = <0x380000 0x200000>; ++ }; ++ ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x7a80000>; ++ }; ++ }; ++ }; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/routerich_ax3000_env +@@ -0,0 +1,58 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootcmd=run check_buttons ; if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-routerich_ax3000-ubootmod-squashfs-sysupgrade.itb ++bootled_pwr=blue:power ++bootled_rec=blue:power ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 ++check_buttons=if button reset ; then run boot_tftp ; fi ++ethaddr_factory=mtd read Factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x40080004 0x6 ; setenv ethaddr_factory ++part_default=production ++part_recovery=recovery ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr ++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format ++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" From c312295b5682295915109300c953c277d3fd420c Mon Sep 17 00:00:00 2001 From: Mikhail Zhilkin Date: Sat, 26 Oct 2024 09:37:14 +0000 Subject: [PATCH 111/119] mediatek: Routerich AX3000: add OpenWrt U-Boot layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds OpenWrt U-Boot layout support for Routerich AX3000. The aims: 1. Get open-source U-Boot; 2. Get maximum available free space in OpenWrt. Install ------- 1. Copy OpenWrt ubootmod-bl31-uboot.fip, ubootmod-preloader.bin, to the /tmp folder of the router using scp. 2. Make mtd partitions backups: http://192.168.1.1/cgi-bin/luci/admin/system/flash -> Save mtdblock contents 3. Install kmod-mtd-rw: ``` opkg update && opkg install kmod-mtd-rw ``` 4. Write FIP and preloader: ``` insmod mtd-rw i_want_a_brick=1 mtd unlock BL2 mtd erase BL2 mtd write /tmp/ubootmod-preloader.bin BL2 mtd unlock FIP mtd erase FIP mtd write /tmp/ubootmod-bl31-uboot.fip FIP ``` 5. Copy OpenWrt ubootmod-initramfs-recovery.itb to the tftp server root with IP 192.168.1.254. 6. Reboot router: ``` reboot ``` U-Boot will automatically download from the tftp server and boot OpenWrt initramfs system. 7. Copy OpenWrt ubootmod-squashfs-sysupgrade.itb to the /tmp dir of the router using scp. 8. Run sysupgrade: ``` sysupgrade -n /tmp/squashfs-sysupgrade.itb ``` Recovery -------- 1. Place OpenWrt initramfs-recovery.itb image (with original name) on the tftp server (IP: 192.168.1.254). 2. Press "reset" button and power on the router. After ~10 sec release the button. 3. Use OpenWrt initramfs system for recovery. BL2 and FIP recovery -------------------- Use mtk_uartboot and UART connection if BL2 or FIP in UBI is destroyed: Link: https://github.com/981213/mtk_uartboot Return to stock: ---------------- 1. Copy partition backups (BL2.bin and FIP.bin) to the /tmp dir of the router using scp. 2. Install kmod-mtd-rw: ``` opkg update && opkg install kmod-mtd-rw ``` 3. Restore stock U-Boot and reboot: ``` insmod mtd-rw i_want_a_brick=1 mtd unlock BL2 mtd erase BL2 mtd write /tmp/BL2.bin BL2 mtd unlock FIP mtd erase FIP mtd write /tmp/FIP.bin FIP reboot ``` 4. Open U-Boot web recovery, upload stock firmware image and start upgrade. Link: http://192.168.1.1 Signed-off-by: Mikhail Zhilkin Link: https://github.com/openwrt/openwrt/pull/16791 Signed-off-by: Hauke Mehrtens (cherry picked from commit d413163832df93c321eef3fce8c4f72c350d5308) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- .../uboot-envtools/files/mediatek_filogic | 1 + .../dts/mt7981b-routerich-ax3000-common.dtsi | 302 ++++++++++++++++++ .../dts/mt7981b-routerich-ax3000-ubootmod.dts | 52 +++ .../mediatek/dts/mt7981b-routerich-ax3000.dts | 119 +------ .../filogic/base-files/etc/board.d/01_leds | 3 +- .../filogic/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 1 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/mediatek/image/filogic.mk | 25 ++ 9 files changed, 400 insertions(+), 107 deletions(-) create mode 100644 target/linux/mediatek/dts/mt7981b-routerich-ax3000-common.dtsi create mode 100644 target/linux/mediatek/dts/mt7981b-routerich-ax3000-ubootmod.dts diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index b637f43287..58db7dad28 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -39,6 +39,7 @@ jcg,q30-pro|\ netcore,n60|\ nokia,ea0326gmp|\ qihoo,360t7|\ +routerich,ax3000-ubootmod|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ tplink,tl-xdr6088|\ diff --git a/target/linux/mediatek/dts/mt7981b-routerich-ax3000-common.dtsi b/target/linux/mediatek/dts/mt7981b-routerich-ax3000-common.dtsi new file mode 100644 index 0000000000..f0b0b9365b --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-routerich-ax3000-common.dtsi @@ -0,0 +1,302 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; +#include +#include +#include + +#include "mt7981.dtsi" + +/ { + aliases { + label-mac-device = &wan; + + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + + serial0 = &uart0; + }; + + chosen: chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-0 { + label = "mesh"; + linux,input-type = ; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + button-1 { + label = "reset"; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <50>; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-1 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 6 GPIO_ACTIVE_HIGH>; + }; + + led_power_blue: led-2 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led-4 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led-5 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led-6 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-7 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <24>; + gpios = <&pio 34 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-8 { + color = ; + /* LED_FUNCTION_MESH isn't implemented yet */ + function = "mesh"; + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + }; + }; + + memory { + reg = <0 0x40000000 0 0x10000000>; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 (-1)>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <0x1f>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + /* ESMT F50L1G41LB (128M) */ + spi: spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0_all { + label = "spi0.0"; + reg = <0x0 0x8000000>; + read-only; + }; + + partition@0 { + label = "BL2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + read-only; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + wan: port@4 { + reg = <4>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 (-2)>; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + nvmem-cell-names = "eeprom"; + nvmem-cells = <&eeprom_factory_0>; +}; + +&xhci { + status = "okay"; + mediatek,u3p-dis-msk = <0x1>; +}; diff --git a/target/linux/mediatek/dts/mt7981b-routerich-ax3000-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-routerich-ax3000-ubootmod.dts new file mode 100644 index 0000000000..dfdb78936d --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-routerich-ax3000-ubootmod.dts @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +#include "mt7981b-routerich-ax3000-common.dtsi" + +/ { + model = "Routerich AX3000 (OpenWrt U-Boot layout)"; + compatible = "routerich,ax3000-ubootmod", "mediatek,mt7981"; +}; + +&chosen { + rootdisk = <&ubi_fit_volume>; +}; + +&partitions { + partition@100000 { + label = "u-boot-env-orig"; + reg = <0x100000 0x80000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x7a80000>; + compatible = "linux,ubi"; + + volumes { + ubi_fit_volume: ubi-volume-fit { + volname = "fit"; + }; + + ubi_ubootenv: ubi-volume-ubootenv { + volname = "ubootenv"; + }; + + ubi_ubootenv2: ubi-volume-ubootenv2 { + volname = "ubootenv2"; + }; + }; + }; +}; + +&ubi_ubootenv { + nvmem-layout { + compatible = "u-boot,env-redundant-bool"; + }; +}; + +&ubi_ubootenv2 { + nvmem-layout { + compatible = "u-boot,env-redundant-bool"; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts b/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts index aa6a15ee1d..c0a10b3fc8 100644 --- a/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts +++ b/target/linux/mediatek/dts/mt7981b-routerich-ax3000.dts @@ -1,118 +1,27 @@ // SPDX-License-Identifier: GPL-2.0-only OR MIT -/dts-v1/; -#include -#include -#include - -#include "mt7981.dtsi" +#include "mt7981b-routerich-ax3000-common.dtsi" / { model = "Routerich AX3000"; compatible = "routerich,ax3000", "mediatek,mt7981"; +}; - aliases { - label-mac-device = &wan; +&spi { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; +}; - led-boot = &led_power_blue; - led-failsafe = &led_power_blue; - led-running = &led_power_blue; - led-upgrade = &led_power_blue; - - serial0 = &uart0; +&partitions { + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; }; - chosen { - stdout-path = "serial0:115200n8"; - }; - - gpio-keys { - compatible = "gpio-keys"; - - button-0 { - label = "mesh"; - linux,input-type = ; - linux,code = ; - gpios = <&pio 0 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - button-1 { - label = "reset"; - gpios = <&pio 1 GPIO_ACTIVE_LOW>; - linux,code = ; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - led-0 { - color = ; - function = LED_FUNCTION_WLAN; - function-enumerator = <50>; - gpios = <&pio 5 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - led-1 { - color = ; - function = LED_FUNCTION_WAN; - gpios = <&pio 6 GPIO_ACTIVE_HIGH>; - }; - - led_power_blue: led-2 { - color = ; - function = LED_FUNCTION_POWER; - gpios = <&pio 7 GPIO_ACTIVE_LOW>; - }; - - led-3 { - color = ; - function = LED_FUNCTION_LAN; - function-enumerator = <1>; - gpios = <&pio 9 GPIO_ACTIVE_LOW>; - }; - - led-4 { - color = ; - function = LED_FUNCTION_LAN; - function-enumerator = <2>; - gpios = <&pio 10 GPIO_ACTIVE_LOW>; - }; - - led-5 { - color = ; - function = LED_FUNCTION_LAN; - function-enumerator = <3>; - gpios = <&pio 11 GPIO_ACTIVE_LOW>; - }; - - led-6 { - color = ; - function = LED_FUNCTION_WAN; - gpios = <&pio 12 GPIO_ACTIVE_LOW>; - }; - - led-7 { - color = ; - function = LED_FUNCTION_WLAN; - function-enumerator = <24>; - gpios = <&pio 34 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - led-8 { - color = ; - /* LED_FUNCTION_MESH isn't implemented yet */ - function = "mesh"; - gpios = <&pio 35 GPIO_ACTIVE_LOW>; - }; - }; - - memory { - reg = <0 0x40000000 0 0x10000000>; + partition@580000 { + label = "ubi"; + reg = <0x580000 0x7000000>; }; }; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index dad5c293de..38c4b7525b 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -75,7 +75,8 @@ openwrt,one) ucidef_set_led_netdev "lanact" "LANACT" "green:lan" "eth1" "rx tx" ucidef_set_led_netdev "lanlink" "LANLINK" "amber:lan" "eth1" "link" ;; -routerich,ax3000) +routerich,ax3000|\ +routerich,ax3000-ubootmod) ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-1" "lan1" "link tx rx" ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-2" "lan2" "link tx rx" ucidef_set_led_netdev "lan-3" "lan-3" "blue:lan-3" "lan3" "link tx rx" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 7bfc61a269..1480dbcbc7 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -34,7 +34,8 @@ mediatek_setup_interfaces() cudy,wr3000-v1|\ jcg,q30-pro|\ qihoo,360t7|\ - routerich,ax3000) + routerich,ax3000|\ + routerich,ax3000-ubootmod) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan ;; asus,tuf-ax4200|\ diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 7402bfc71b..5e83a167de 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -158,6 +158,7 @@ case "$board" in [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress ;; routerich,ax3000|\ + routerich,ax3000-ubootmod|\ zbtlink,zbt-z8102ax|\ zbtlink,zbt-z8103ax|\ zyxel,ex5601-t0|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index ce334b2c8e..0040ffbb26 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -80,6 +80,7 @@ platform_do_upgrade() { openwrt,one|\ netcore,n60|\ qihoo,360t7|\ + routerich,ax3000-ubootmod|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ tplink,tl-xdr6088|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index f366a9b920..672790f1a7 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1228,6 +1228,31 @@ define Device/routerich_ax3000 endef TARGET_DEVICES += routerich_ax3000 +define Device/routerich_ax3000-ubootmod + DEVICE_VENDOR := Routerich + DEVICE_MODEL := AX3000 (OpenWrt U-Boot layout) + DEVICE_DTS := mt7981b-routerich-ax3000-ubootmod + DEVICE_DTS_DIR := ../dts + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \ + append-metadata + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware kmod-usb3 mt7981-wo-firmware + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot routerich_ax3000 +endef +TARGET_DEVICES += routerich_ax3000-ubootmod + define Device/ruijie_rg-x60-pro DEVICE_VENDOR := Ruijie DEVICE_MODEL := RG-X60 Pro From 9e73f794adc8fae59c8ff45aed2d99e4b43cc2d5 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sun, 29 Oct 2023 04:32:21 -0400 Subject: [PATCH 112/119] kernel: enable pressure interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PSI provides a canonical way to see resource pressure increases as they develop, with pressure metrics for three major resources: memory, CPU, and IO. PSI stats are like barometers that provide fair warning of impending resource shortages, enabling users to take more proactive, granular, and nuanced steps when resources start becoming scarce. References: * https://www.kernel.org/doc/html/latest/accounting/psi.html * https://lwn.net/Articles/759781/ Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000 Run-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/13819 Signed-off-by: Hauke Mehrtens (cherry picked from commit eed39d45c2ff901b5327c7ab63c9131166e3140e) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- config/Config-kernel.in | 19 +++++++++++++++++++ target/linux/generic/config-6.6 | 1 + 2 files changed, 20 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 0fa039db40..91678cf2a6 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -333,6 +333,25 @@ if KERNEL_TASKSTATS endif +config KERNEL_PSI + bool "Compile the kernel with pressure stall information tracking" + help + Collect metrics that indicate how overcommitted the CPU, memory, + and IO capacity are in the system. + + If you say Y here, the kernel will create /proc/pressure/ with the + pressure statistics files cpu, memory, and io. These will indicate + the share of walltime in which some or all tasks in the system are + delayed due to contention of the respective resource. + + In kernels with cgroup support, cgroups (cgroup2 only) will + have cpu.pressure, memory.pressure, and io.pressure files, + which aggregate pressure stalls for the grouped tasks only. + + For more details see Documentation/accounting/psi.rst. + + Say N if unsure. + config KERNEL_KALLSYMS bool "Compile the kernel with symbol table information" default y if !SMALL_FLASH diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6 index 9eec780b53..105dc0d344 100644 --- a/target/linux/generic/config-6.6 +++ b/target/linux/generic/config-6.6 @@ -4758,6 +4758,7 @@ CONFIG_PROC_SYSCTL=y # CONFIG_PSB6970_PHY is not set # CONFIG_PSE_CONTROLLER is not set # CONFIG_PSI is not set +# CONFIG_PSI_DEFAULT_DISABLED is not set # CONFIG_PSTORE is not set # CONFIG_PSTORE_BLK is not set # CONFIG_PSTORE_COMPRESS is not set From 8c616ccf241e934174a83aa9f4efb9c46186a0c4 Mon Sep 17 00:00:00 2001 From: George Oldfort Date: Tue, 26 Nov 2024 06:42:25 +0100 Subject: [PATCH 113/119] mediatek: remove ktd-202x driver filogic image (Aer Vero W6m) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Image build fails with PR #16861 merged while PR #16860 not merged. Removing kmod-leds-ktd202x from filogic.mk will fix the build process. Fixes: 2898d1d1269a ("mediatek: add support for Acer Predator W6d and Acer Vero W6m") Signed-off-by: George Oldfort Link: https://github.com/openwrt/openwrt/pull/17087 Signed-off-by: Hauke Mehrtens (cherry picked from commit 1bdb6d84046ec1c47f28c57651358470ed212ec3) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- target/linux/mediatek/image/filogic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 672790f1a7..3a36fbc46b 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -186,7 +186,7 @@ define Device/acer_vero-w6m DEVICE_DTS := mt7986a-acer-vero-w6m DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 - DEVICE_PACKAGES := kmod-leds-ktd202x kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs IMAGES := sysupgrade.bin KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL_INITRAMFS := kernel-bin | lzma | \ From 7eec852c060cdef0d7d287596ac95799a954430e Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 10 Nov 2024 17:16:51 +0200 Subject: [PATCH 114/119] gdb: Fix description for apk, remove backtick MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove backtick from gdb description text, as that seems to be recognized as a shell action by compilation with apk, causing error. Example from test buildbot: rstrip.sh: /builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/gdb-15.2/ipkg-aarch64_generic/gdb/usr/bin/gdb: executable bash: -c: line 1: unexpected EOF while looking for matching ``' bash: -c: line 2: syntax error: unexpected end of file make[3]: *** [Makefile:123: /builder/shared-workdir/build/sdk/bin/packages/aarch64_generic/base/gdb-15.2-r1.apk] Error 2 Local compilation: rstrip.sh: /OpenWrt/aarch64/build_dir/target-aarch64_cortex-a53_musl/gdb-15.2/ipkg-aarch64_cortex-a53/gdb/usr/bin/gdb: executable bash: -c: line 1: unexpected EOF while looking for matching ``' make[2]: *** [Makefile:123: /OpenWrt/aarch64/bin/packages/aarch64_cortex-a53/base/gdb-15.2-r1.apk] Error 2 Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/16908 Signed-off-by: Hauke Mehrtens (cherry picked from commit adb921c34ff220951a699665bb35dc0e3538b3b2) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/devel/gdb/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 366746be87..7bdc6c83cb 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb PKG_VERSION:=15.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb @@ -37,7 +37,7 @@ $(call Package/gdb/Default) endef define Package/gdb/description -GDB, the GNU Project debugger, allows you to see what is going on `inside' +GDB, the GNU Project debugger, allows you to see what is going on 'inside' another program while it executes -- or what another program was doing at the moment it crashed. endef From 2c3d036fe7d573eee9874ae9bdeb7c9b3291eebe Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 27 Nov 2024 00:25:12 +0100 Subject: [PATCH 115/119] config: Mark USE_APK broken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will hide the USE_APK setting in OpenWrt 24.10 by default. APK is not stable yet and we do not want to support it in OpenWrt 24.10 branch. References: https://openwrt.org/meetings/20241126#release_2410 Signed-off-by: Hauke Mehrtens Signed-off-by: Petr Štetiar [meeting notes ref, config] Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- config/Config-build.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/Config-build.in b/config/Config-build.in index 481be0bb6c..ae44985546 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -70,7 +70,8 @@ menu "Global build settings" config USE_APK imply PACKAGE_apk-mbedtls - bool "Use APK instead of OPKG to build distribution (EXPERIMENTAL)" + bool "Use APK instead of OPKG to build distribution (BROKEN)" + depends on BROKEN comment "General build options" From 17bdccb4a52049ee06142c0b5fbc2001bc519a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 27 Nov 2024 08:32:01 +0000 Subject: [PATCH 116/119] apk: mark package as broken to hide it by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the last OpenWrt developer meeting 2024-11-26 it was decided, that 24.10 will be the last release using opkg package manager and thus apk won't be supported, so make it explicit and mark apk package manager as broken. References: https://openwrt.org/meetings/20241126#release_2410 Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Štetiar --- package/system/apk/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile index 3e2066e269..8242e12ee9 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -27,7 +27,7 @@ define Package/apk/default SECTION:=base CATEGORY:=Base system TITLE:=apk package manager - DEPENDS:=+zlib + DEPENDS:=@BROKEN +zlib URL:=$(PKG_SOURCE_URL) PROVIDES:=apk endef From de8a1a1e3adfb2085189f2a7de576ca4e6484afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 27 Nov 2024 08:39:46 +0000 Subject: [PATCH 117/119] mediatek: filogic: Cudy WR3000S v1: fix CRLF line endings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DTS file for this device seems to be using CRLF line endings, so lets convert them into Unix-style LF. Fixes: faf4b3e0f7a5 ("mediatek: filogic: add support for Cudy WR3000S v1") Link: https://github.com/openwrt/openwrt/pull/17096 Signed-off-by: Petr Štetiar (cherry picked from commit 30ae0b3f1e331646054d8110e931dfaa32f7b414) --- .../mediatek/dts/mt7981b-cudy-wr3000s-v1.dts | 566 +++++++++--------- 1 file changed, 283 insertions(+), 283 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts index a643969494..cf2f79b407 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1.dts @@ -1,283 +1,283 @@ -// SPDX-License-Identifier: (GPL-2.0 OR MIT) - -/dts-v1/; - -#include - -#include "mt7981.dtsi" - -/ { - model = "Cudy WR3000S v1"; - compatible = "cudy,wr3000s-v1", "mediatek,mt7981-spim-snand-rfb"; - - aliases { - label-mac-device = &gmac0; - led-boot = &led_status; - led-failsafe = &led_status; - led-running = &led_status; - led-upgrade = &led_status; - serial0 = &uart0; - }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - gpio-keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&pio 1 GPIO_ACTIVE_LOW>; - }; - - wps { - label = "wps"; - linux,code = ; - gpios = <&pio 0 GPIO_ACTIVE_LOW>; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_status: led@0 { - function = LED_FUNCTION_STATUS; - color = ; - gpios = <&pio 10 GPIO_ACTIVE_LOW>; - }; - - - led_internet { - function = LED_FUNCTION_WAN_ONLINE; - color = ; - gpios = <&pio 11 GPIO_ACTIVE_LOW>; - }; - - led_wps { - function = LED_FUNCTION_WPS; - color = ; - gpios = <&pio 9 GPIO_ACTIVE_LOW>; - }; - - led_wlan2g { - function = LED_FUNCTION_WLAN_2GHZ; - color = ; - gpios = <&pio 6 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - led_wlan5g { - function = LED_FUNCTION_WLAN_5GHZ; - color = ; - gpios = <&pio 7 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - }; -}; - -&uart0 { - status = "okay"; -}; - -&watchdog { - status = "okay"; -}; - -ð { - pinctrl-names = "default"; - pinctrl-0 = <&mdio_pins>; - - status = "okay"; - - gmac0: mac@0 { - compatible = "mediatek,eth-mac"; - reg = <0>; - phy-mode = "2500base-x"; - - nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00 0>; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; -}; - -&mdio_bus { - switch: switch@1f { - compatible = "mediatek,mt7531"; - reg = <31>; - reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; - interrupt-controller; - #interrupt-cells = <1>; - interrupt-parent = <&pio>; - interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; - }; -}; - -&spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_flash_pins>; - status = "okay"; - - spi_nand: flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spi-nand"; - reg = <0>; - spi-max-frequency = <52000000>; - - spi-cal-enable; - spi-cal-mode = "read-data"; - spi-cal-datalen = <7>; - spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; - spi-cal-addrlen = <5>; - spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; - - spi-tx-bus-width = <4>; - spi-rx-bus-width = <4>; - mediatek,nmbm; - mediatek,bmt-max-ratio = <1>; - mediatek,bmt-max-reserved-blocks = <64>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "BL2"; - reg = <0x00000 0x0100000>; - read-only; - }; - - partition@100000 { - label = "u-boot-env"; - reg = <0x0100000 0x0080000>; - read-only; - }; - - factory: partition@180000 { - label = "Factory"; - reg = <0x180000 0x0200000>; - read-only; - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x1000>; - }; - }; - }; - - partition@380000 { - label = "bdinfo"; - reg = <0x380000 0x0040000>; - read-only; - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - compatible = "mac-base"; - reg = <0xde00 0x6>; - #nvmem-cell-cells = <1>; - }; - }; - }; - - partition@3C0000 { - label = "FIP"; - reg = <0x3C0000 0x0200000>; - read-only; - }; - - partition@580000 { - label = "ubi"; - reg = <0x5C0000 0x4000000>; - compatible = "linux,ubi"; - }; - }; - }; -}; - -&pio { - spi0_flash_pins: spi0-pins { - mux { - function = "spi"; - groups = "spi0", "spi0_wp_hold"; - }; - conf-pu { - pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; - drive-strength = ; - bias-pull-up = ; - }; - - conf-pd { - pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; - drive-strength = ; - bias-pull-down = ; - }; - }; -}; - -&switch { - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - label = "wan"; - - nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00 1>; - }; - - port@1 { - reg = <1>; - label = "lan1"; - }; - - port@2 { - reg = <2>; - label = "lan2"; - }; - - port@3 { - reg = <3>; - label = "lan3"; - }; - - port@4 { - reg = <4>; - label = "lan4"; - }; - - port@6 { - reg = <6>; - label = "cpu"; - ethernet = <&gmac0>; - phy-mode = "2500base-x"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - }; -}; - -&wifi { - status = "okay"; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; -}; +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include + +#include "mt7981.dtsi" + +/ { + model = "Cudy WR3000S v1"; + compatible = "cudy,wr3000s-v1", "mediatek,mt7981-spim-snand-rfb"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status: led@0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + + led_internet { + function = LED_FUNCTION_WAN_ONLINE; + color = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led_wps { + function = LED_FUNCTION_WPS; + color = ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led_wlan2g { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; + gpios = <&pio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_wlan5g { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x00000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + + partition@380000 { + label = "bdinfo"; + reg = <0x380000 0x0040000>; + read-only; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@3C0000 { + label = "FIP"; + reg = <0x3C0000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x5C0000 0x4000000>; + compatible = "linux,ubi"; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 1>; + }; + + port@1 { + reg = <1>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@4 { + reg = <4>; + label = "lan4"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; From c981096416737a3029ee92aca61cdeda31f311e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 28 Nov 2024 16:30:07 +0000 Subject: [PATCH 118/119] tools: ccache update to 4.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes since 4.10: * Fixed detection of Fmt version 11 and newer. * Fixed prefix command lookup from PATH. Suggested-by: Jen Wolf Link: https://github.com/openwrt/openwrt/pull/17105 Signed-off-by: Petr Štetiar (cherry picked from commit 08f12283c7436814cdd10d93b5cb913f49acad3e) --- tools/ccache/Makefile | 4 ++-- tools/ccache/patches/100-honour-copts.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 47c24a5c98..447bc3ea43 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ccache -PKG_VERSION:=4.10 +PKG_VERSION:=4.10.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=16972ba62c8499045edc3ae7d7b8a0b419a961567f5ff0f01bf5a44194204775 +PKG_HASH:=108100960bb7e64573ea925af2ee7611701241abb36ce0aae3354528403a7d87 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index a40665ea25..c07c8ce8eb 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,6 +1,6 @@ --- a/src/ccache/ccache.cpp +++ b/src/ccache/ccache.cpp -@@ -1906,6 +1906,7 @@ get_manifest_key(Context& ctx, Hash& has +@@ -1914,6 +1914,7 @@ get_manifest_key(Context& ctx, Hash& has "OBJCPLUS_INCLUDE_PATH", // Clang "CLANG_CONFIG_FILE_SYSTEM_DIR", // Clang "CLANG_CONFIG_FILE_USER_DIR", // Clang From d276b4c91a50aeac14f84284c22bb4938881f64a Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Wed, 27 Nov 2024 10:31:35 +0900 Subject: [PATCH 119/119] Revert "ath79: elecom,wab: use nvmem" This reverts commit 70e41d0205d95386881fa1cdf6ee00f6cca1b3f6. "ethaddr" is stored into the "u-boot-env" (stock: "Config") partition and it's quoted with double-quotations, but that format is not supported by the current NVMEM u-boot-env driver (and mac_pton() function) and the MAC address won't be parsed to byte array. This causes random MAC addresses on the adapters, so revert the above commit. Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/17116 (cherry picked from commit af611bce44d3dcffd47c47f46b95400445498be9) Link: https://github.com/openwrt/openwrt/pull/17117 Signed-off-by: Robert Marko --- target/linux/ath79/dts/qca955x_elecom_wab.dtsi | 17 ++++------------- .../generic/base-files/etc/board.d/02_network | 3 +++ .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 10 ++++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/target/linux/ath79/dts/qca955x_elecom_wab.dtsi b/target/linux/ath79/dts/qca955x_elecom_wab.dtsi index 53bb5b0141..43e34c6029 100644 --- a/target/linux/ath79/dts/qca955x_elecom_wab.dtsi +++ b/target/linux/ath79/dts/qca955x_elecom_wab.dtsi @@ -8,7 +8,6 @@ / { aliases { - label-mac-device = ð0; led-boot = &led_status; led-failsafe = &led_status; led-upgrade = &led_status; @@ -108,9 +107,6 @@ phy-mode = "rgmii-rxid"; pll-data = <0xae000000 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_uboot_ethaddr 0>; - nvmem-cell-names = "mac-address"; - gmac-config { device = <&gmac>; @@ -148,8 +144,8 @@ wifi@0,0 { compatible = "qcom,ath10k"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>; - nvmem-cell-names = "calibration", "mac-address"; + nvmem-cells = <&cal_art_5000>; + nvmem-cell-names = "calibration"; }; }; @@ -173,14 +169,9 @@ }; partition@40000 { - compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x40000 0x10000>; read-only; - - macaddr_uboot_ethaddr: ethaddr { - #nvmem-cell-cells = <1>; - }; }; partition@50000 { @@ -261,6 +252,6 @@ &wmac { status = "okay"; - nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>; - nvmem-cell-names = "calibration", "mac-address"; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 2bd97442d9..016bd6bb51 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -717,6 +717,9 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_ascii devdata "lanmac") wan_mac=$(mtd_get_mac_ascii devdata "wanmac") ;; + elecom,wab-i1750-ps|\ + elecom,wab-s1167-ps|\ + elecom,wab-s600-ps|\ engenius,ecb1200|\ engenius,ecb1750) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 6676e4d509..5155d240a8 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -42,6 +42,16 @@ case "$board" in [ "$PHYNBR" -eq 1 ] && \ mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress ;; + elecom,wab-i1750-ps|\ + elecom,wab-s1167-ps|\ + elecom,wab-s600-ps) + # set the 5G MAC address (= ethaddr + 1) + [ "$PHYNBR" -eq 0 ] && \ + macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress + # set the 2.4G MAC address (= ethaddr) + [ "$PHYNBR" -eq 1 ] && \ + mtd_get_mac_ascii u-boot-env "ethaddr" > /sys${DEVPATH}/macaddress + ;; engenius,ecb1200|\ engenius,ecb1750) [ "$PHYNBR" -eq 0 ] && \