From 0688cf5aebe1dc9a2e7f3820861783c2a7a75d44 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Fri, 5 Apr 2024 15:31:03 +0000 Subject: [PATCH 01/13] realtek: add support for switch Zyxel GS1900-24EP This device is very similar to the GS1900-24E switch (added in b515ad1), except that the first 12 of 24 ethernet ports are capable of PoE and the physical jacks are in the right order - unlike for the GS1900-24E, where even and uneven ports are flipped (up <-> down on panel). Zyxel version code for this device (-24EP) is: ABTO Signed-off-by: Mirko Vogt --- .../realtek/base-files/etc/board.d/02_network | 3 + .../dts-5.15/rtl8382_zyxel_gs1900-24ep.dts | 63 +++++++++++++++++++ target/linux/realtek/image/rtl838x.mk | 9 +++ 3 files changed, 75 insertions(+) create mode 100644 target/linux/realtek/dts-5.15/rtl8382_zyxel_gs1900-24ep.dts diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index db1d99f4ec..fe3027879c 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -105,6 +105,9 @@ zyxel,gs1900-8hp-v1|\ zyxel,gs1900-8hp-v2) ucidef_set_poe 70 "$lan_list" ;; +zyxel,gs1900-24ep) + ucidef_set_poe 130 "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 lan9 lan10 lan11 lan12" + ;; zyxel,gs1900-24hp-v1|\ zyxel,gs1900-24hp-v2) ucidef_set_poe 170 "$(filter_port_list "$lan_list" "lan25 lan26")" diff --git a/target/linux/realtek/dts-5.15/rtl8382_zyxel_gs1900-24ep.dts b/target/linux/realtek/dts-5.15/rtl8382_zyxel_gs1900-24ep.dts new file mode 100644 index 0000000000..8a77121f4c --- /dev/null +++ b/target/linux/realtek/dts-5.15/rtl8382_zyxel_gs1900-24ep.dts @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rtl8380_zyxel_gs1900.dtsi" + +/ { + compatible = "zyxel,gs1900-24ep", "realtek,rtl838x-soc"; + model = "ZyXEL GS1900-24EP Switch"; +}; + +&uart1 { + status = "okay"; +}; + +&mdio { + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) + + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) +}; + +&switch0 { + ports { + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + }; +}; diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index dc4ddc6d1d..7c64d8d667 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -358,6 +358,15 @@ define Device/zyxel_gs1900-24e endef TARGET_DEVICES += zyxel_gs1900-24e +define Device/zyxel_gs1900-24ep + $(Device/zyxel_gs1900) + SOC := rtl8382 + DEVICE_MODEL := GS1900-24EP + ZYXEL_VERS := ABTO + DEVICE_PACKAGES += realtek-poe +endef +TARGET_DEVICES += zyxel_gs1900-24ep + define Device/zyxel_gs1900-24hp-v1 $(Device/zyxel_gs1900) SOC := rtl8382 From 3ce1e4c3d3da3885c2f42e1aa5bc97e0d421445b Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 8 Apr 2024 07:54:45 +0200 Subject: [PATCH 02/13] d1: define subtarget specifically Historically it's possible to leave the `SUBTARGETS` undefined and automatically fallback to a "generic" subtarget. This however breaks various downstream scripts which may have expectations around filenames: While some targets with an explicit generic subtarget contain `generic` in the filenames of artifacts, implicit "subtargets" don't. Right now this breaks the CI[1], possibly also scripts using the ImageBuilders. Do to the D1 target what's done to other target, explicitly define the "generic" subtarget. [1]: https://github.com/openwrt/openwrt/actions/runs/8592821105/job/23548273630 Signed-off-by: Paul Spooren --- target/linux/d1/Makefile | 1 + target/linux/d1/generic/target.mk | 1 + 2 files changed, 2 insertions(+) create mode 100644 target/linux/d1/generic/target.mk diff --git a/target/linux/d1/Makefile b/target/linux/d1/Makefile index 436ab94862..69e28d4811 100644 --- a/target/linux/d1/Makefile +++ b/target/linux/d1/Makefile @@ -9,6 +9,7 @@ BOARD:=d1 BOARDNAME:=AllWinner D1 RISC-V SoC FEATURES:=ext4 squashfs KERNELNAME:=Image dtbs +SUBTARGETS:=generic KERNEL_PATCHVER:=6.1 diff --git a/target/linux/d1/generic/target.mk b/target/linux/d1/generic/target.mk new file mode 100644 index 0000000000..f5cb1fb19b --- /dev/null +++ b/target/linux/d1/generic/target.mk @@ -0,0 +1 @@ +BOARDNAME:=Generic From d997477775bf5447000f1d300a027878b566f5d1 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 8 Apr 2024 08:05:29 +0200 Subject: [PATCH 03/13] treewide: remove implicit SUBTARGET Historically it's possible to leave the `SUBTARGETS` undefined and automatically fallback to a "generic" subtarget. This however breaks various downstream scripts which may have expectations around filenames: While some targets with an explicit generic subtarget contain `generic` in the filenames of artifacts, implicit "subtargets" don't. Right now this breaks the CI[1], possibly also scripts using the ImageBuilders. This commit removes all code that support implicit handling of subtargets and instead requires every target to define "SUBTARGETS". [1]: https://github.com/openwrt/openwrt/actions/runs/8592821105/job/23548273630 Signed-off-by: Paul Spooren --- include/image-commands.mk | 4 ++-- include/image.mk | 12 ++++++------ include/kernel.mk | 6 +++--- include/version.mk | 2 +- package/kernel/linux/modules/crypto.mk | 2 +- target/imagebuilder/Makefile | 2 +- target/imagebuilder/files/Makefile | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 832c85ee70..83ecf7c520 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -46,7 +46,7 @@ endef ifdef IB define Build/append-image-stage - dd if=$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1) >> $@ + dd if=$(STAGING_DIR_IMAGE)/$(BOARD)-$(SUBTARGET)-$(DEVICE_NAME)-$(1) >> $@ endef else define Build/append-image-stage @@ -54,7 +54,7 @@ define Build/append-image-stage fwtool -s /dev/null -t "$@.stripmeta" || : fwtool -i /dev/null -t "$@.stripmeta" || : mkdir -p "$(STAGING_DIR_IMAGE)" - dd if="$@.stripmeta" of="$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)" + dd if="$@.stripmeta" of="$(STAGING_DIR_IMAGE)/$(BOARD)-$(SUBTARGET)-$(DEVICE_NAME)-$(1)" dd if="$@.stripmeta" >> "$@" rm "$@.stripmeta" endef diff --git a/include/image.mk b/include/image.mk index 4b6acbe1aa..b6b796dd97 100644 --- a/include/image.mk +++ b/include/image.mk @@ -39,7 +39,7 @@ IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))- IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-) IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERSION_CODE))-) -IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) +IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)-$(SUBTARGET) IMG_ROOTFS:=$(IMG_PREFIX)-rootfs IMG_COMBINED:=$(IMG_PREFIX)-combined ifeq ($(DUMP),) @@ -477,10 +477,10 @@ endef ifdef IB DEVICE_CHECK_PROFILE = $(filter $(1),DEVICE_$(PROFILE) $(PROFILE)) else - DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1)) + DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)_$(SUBTARGET))_$(1)) endif -DEVICE_EXTRA_PACKAGES = $(call qstrip,$(CONFIG_TARGET_DEVICE_PACKAGES_$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_DEVICE_$(1))) +DEVICE_EXTRA_PACKAGES = $(call qstrip,$(CONFIG_TARGET_DEVICE_PACKAGES_$(call target_conf,$(BOARD)_$(SUBTARGET))_DEVICE_$(1))) define merge_packages $(1) := @@ -558,7 +558,7 @@ define Device/Build/initramfs DEVICE_TITLE="$$(DEVICE_TITLE)" \ DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \ TARGET="$(BOARD)" \ - SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \ + SUBTARGET="$(SUBTARGET)" \ VERSION_NUMBER="$(VERSION_NUMBER)" \ VERSION_CODE="$(VERSION_CODE)" \ SUPPORTED_DEVICES="$$(SUPPORTED_DEVICES)" \ @@ -692,7 +692,7 @@ define Device/Build/image DEVICE_TITLE="$(DEVICE_TITLE)" \ DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \ TARGET="$(BOARD)" \ - SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \ + SUBTARGET="$(SUBTARGET)" \ VERSION_NUMBER="$(VERSION_NUMBER)" \ VERSION_CODE="$(VERSION_CODE)" \ SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \ @@ -746,7 +746,7 @@ define Device/Build/artifact DEVICE_TITLE="$(DEVICE_TITLE)" \ DEVICE_PACKAGES="$(DEVICE_PACKAGES)" \ TARGET="$(BOARD)" \ - SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \ + SUBTARGET="$(SUBTARGET)" \ VERSION_NUMBER="$(VERSION_NUMBER)" \ VERSION_CODE="$(VERSION_CODE)" \ SUPPORTED_DEVICES="$(SUPPORTED_DEVICES)" \ diff --git a/include/kernel.mk b/include/kernel.mk index 9969c519dd..479c586ea2 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -43,7 +43,7 @@ else PATCH_DIR ?= $(CURDIR)/patches$(if $(wildcard ./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER)) FILES_DIR ?= $(foreach dir,$(wildcard $(CURDIR)/files $(CURDIR)/files-$(KERNEL_PATCHVER)),"$(dir)") endif - KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)) + KERNEL_BUILD_DIR ?= $(BUILD_DIR)/linux-$(BOARD)_$(SUBTARGET) LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) LINUX_UAPI_DIR=uapi/ LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null)) @@ -204,7 +204,7 @@ define KernelPackage $(eval $(call KernelPackage/Defaults)) $(eval $(call KernelPackage/$(1))) $(eval $(call KernelPackage/$(1)/$(BOARD))) - $(eval $(call KernelPackage/$(1)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic))) + $(eval $(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET))) define Package/kmod-$(1) TITLE:=$(TITLE) @@ -216,7 +216,7 @@ define KernelPackage PKGFLAGS:=$(PKGFLAGS) $(call KernelPackage/$(1)) $(call KernelPackage/$(1)/$(BOARD)) - $(call KernelPackage/$(1)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)) + $(call KernelPackage/$(1)/$(BOARD)/$(SUBTARGET)) endef ifdef KernelPackage/$(1)/conffiles diff --git a/include/version.mk b/include/version.mk index f39e35cd09..cdee0976da 100644 --- a/include/version.mk +++ b/include/version.mk @@ -95,7 +95,7 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \ -e 's,%d,\L$(call sed_escape,$(subst $(space),_,$(VERSION_DIST))),g' \ -e 's,%R,$(call sed_escape,$(REVISION)),g' \ -e 's,%T,$(call sed_escape,$(BOARD)),g' \ - -e 's,%S,$(call sed_escape,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)),g' \ + -e 's,%S,$(call sed_escape,$(BOARD)/$(SUBTARGET)),g' \ -e 's,%A,$(call sed_escape,$(ARCH_PACKAGES)),g' \ -e 's,%t,$(call sed_escape,$(VERSION_TAINTS)),g' \ -e 's,%M,$(call sed_escape,$(VERSION_MANUFACTURER)),g' \ diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index be9893d453..4a8a283d37 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -11,7 +11,7 @@ CRYPTO_MODULES = \ ALGAPI2=crypto_algapi \ BLKCIPHER2=crypto_blkcipher -CRYPTO_TARGET = $(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic) +CRYPTO_TARGET = $(BOARD)/$(SUBTARGET) crypto_confvar=CONFIG_CRYPTO_$(word 1,$(subst =,$(space),$(1))) crypto_file=$(LINUX_DIR)/crypto/$(word 2,$(subst =,$(space),$(1))).ko diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index 799ac3be55..c768c992ea 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/feeds.mk override MAKEFLAGS= -IB_NAME:=$(VERSION_DIST_SANITIZED)-imagebuilder-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)).$(HOST_OS)-$(HOST_ARCH) +IB_NAME:=$(VERSION_DIST_SANITIZED)-imagebuilder-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)-$(SUBTARGET).$(HOST_OS)-$(HOST_ARCH) PKG_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME) IB_KDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(KERNEL_BUILD_DIR)) IB_LDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR)) diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 0466fc7dcc..78a75e96a8 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -103,7 +103,7 @@ PROFILE_LIST = $(foreach p,$(PROFILE_NAMES), \ .profiles.mk: .targetinfo - @$(SCRIPT_DIR)/target-metadata.pl profile_mk $< '$(BOARD)$(if $(SUBTARGET),/$(SUBTARGET))' > $@ + @$(SCRIPT_DIR)/target-metadata.pl profile_mk $< '$(BOARD)/$(SUBTARGET)' > $@ staging_dir/host/.prereq-build: include/prereq-build.mk mkdir -p tmp From d606b84c4ebf6561168b23df51a294dc9e25c451 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Mon, 8 Apr 2024 16:24:12 -0400 Subject: [PATCH 04/13] qualcommax: Skip compiling unnecessary dtbs Currently the compile phase of the kernel builds `Image dtbs modules`. However, none of the dtbs that get built are used for the final image. This ends up unnecessarily taking CPU cycles and produces a lot of `WARNINGS` that can lead users to believe there's cause for concern. I believe the same principle can be applied to other targets. ``` DTC arch/arm64/boot/dts/qcom/msm8996-mtp.dtb arch/arm64/boot/dts/qcom/msm8996.dtsi:2954.36-2962.5: Warning (clocks_property): /soc/clock-controller@6400000: Missing property '#clock-cells' in node /soc/mailbox@9820000 or bad phandle (referred from clocks[2]) DTC arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dtb arch/arm64/boot/dts/qcom/msm8996.dtsi:2954.36-2962.5: Warning (clocks_property): /soc/clock-controller@6400000: Missing property '#clock-cells' in node /soc/mailbox@9820000 or bad phandle (referred from clocks[2]) DTC arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dtb arch/arm64/boot/dts/qcom/msm8996.dtsi:2954.36-2962.5: Warning (clocks_property): /soc/clock-controller@6400000: Missing property '#clock-cells' in node /soc/mailbox@9820000 or bad phandle (referred from clocks[2]) DTC arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dtb arch/arm64/boot/dts/qcom/msm8996.dtsi:2954.36-2962.5: Warning (clocks_property): /soc/clock-controller@6400000: Missing property '#clock-cells' in node /soc/mailbox@9820000 or bad phandle (referred from clocks[2]) DTC arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dtb arch/arm64/boot/dts/qcom/msm8996.dtsi:2954.36-2962.5: Warning (clocks_property): /soc/clock-controller@6400000: Missing property '#clock-cells' in node /soc/mailbox@9820000 or bad phandle (referred from clocks[2]) DTC arch/arm64/boot/dts/qcom/msm8996-xiaomi-natrium.dtb arch/arm64/boot/dts/qcom/msm8996.dtsi:2954.36-2962.5: Warning (clocks_property): /soc/clock-controller@6400000: Missing property '#clock-cells' in node /soc/mailbox@9820000 or bad phandle (referred from clocks[2]) DTC arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dtb arch/arm64/boot/dts/qcom/msm8996.dtsi:2954.36-2962.5: Warning (clocks_property): /soc/clock-controller@6400000: Missing property '#clock-cells' in node /soc/mailbox@9820000 or bad phandle (referred from clocks[2]) ``` Signed-off-by: Sean Khan --- target/linux/qualcommax/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/qualcommax/Makefile b/target/linux/qualcommax/Makefile index ab7f52ae04..3c9bb840e3 100644 --- a/target/linux/qualcommax/Makefile +++ b/target/linux/qualcommax/Makefile @@ -4,7 +4,7 @@ ARCH:=aarch64 BOARD:=qualcommax BOARDNAME:=Qualcomm Atheros 802.11ax WiSoC-s FEATURES:=squashfs ramdisk fpu nand rtc emmc -KERNELNAME:=Image dtbs +KERNELNAME:=Image CPU_TYPE:=cortex-a53 SUBTARGETS:=ipq807x ipq60xx From 7c39a95a2f6ae638f173833dc8d4c120e25475c8 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 8 Apr 2024 17:52:22 +0200 Subject: [PATCH 05/13] sdk: include lib/crtsavres.o for powerpc Trying to link certain kernel modules like dahdi-linux when building with the OpenWrt SDK will fail with: openwrt-sdk-apm821xx-sata_gcc-13.2.0_musl.Linux-x86_64/staging_dir/toolchain-powerpc_464fp_gcc-13.2.0_musl/bin/powerpc-openwrt-linux-musl-ld: cannot find arch/powerpc/lib/crtsavres.o: No such file or directory Previously this worked with the PowerPC SDK since we carried a hack that was passing --save-restore-funcs to module LDFLAGS so the linker provided the required functions automatically as without --save-restore-funcs it doesnt do so automatically on relocatable links and as a sideffect did not require the kernel provided crtsaves.o to link against. Now that hack has been removed as upstream kernel now compiles crtsaves.o by default so it can be linked against but its not included in the SDK. So, lets include lib/crtsavres.o when SDK is generated for PowerPC. Fixes: 99c9d8abd677 ("kernel: bump 5.15 to 5.15.148") Signed-off-by: Robert Marko --- target/sdk/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/sdk/Makefile b/target/sdk/Makefile index c57a451617..d0c0ab7a2b 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -68,6 +68,10 @@ KERNEL_FILES_ARCH = \ kernel/asm-offsets.s \ kernel/module.lds +ifeq ($(LINUX_KARCH),powerpc) + KERNEL_FILES_ARCH += lib/crtsavres.o +endif + KERNEL_FILES_BASE := \ .config \ Makefile \ From d4e8653e1e9ec90404d12ea24fb0f8e507b337d5 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 9 Jan 2024 19:54:51 +0000 Subject: [PATCH 06/13] mvebu: puzzle-m90x: wipe rootfs_data on sysupgrade The sysupgrade formware of the Puzzle series is a slightly strange dual-boot approach while remaining compatible with Marvell's SDK firmware upgrade binary format -- which happens to be a full-disk image with GPT partition table. Hence that /lib/upgrade/emmc-puzzle.sh script is like an exotic disease which results from those decisions, and as we also want to somehow stay compatible with the IEI-World stock firmware we got to use it in that same way (we are not compatible with the QNAP-branded identical hardware device anyway). Currently, on sysupgrade the result is that one ends up with the old content of rootfs_data (a GPT partition on those devices) as nothing ever wipes or in any way re-creates the filesystem there. As a simple work-around, let's kill the filesystem on rootfs_data so fstools re-formats it on the next boot. Signed-off-by: Daniel Golle --- .../linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh index 5e5c356ed6..9a33b7714c 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh @@ -32,5 +32,7 @@ platform_do_upgrade_emmc() { v "Writing new UUID to /dev/$diskdev..." get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + dd if=/dev/zero of=$(find_mmc_part rootfs_data) bs=512 count=8 + sleep 1 } From 1ae3c53466942e05d2ab91c9432c65156f7228a1 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 23 Feb 2024 16:03:00 +0000 Subject: [PATCH 07/13] mediatek: filogic: switch TP-LINK XDR series to fitblk Instead of using the deprecated FIT partition parser, use the new fitblk driver instead. Signed-off-by: Daniel Golle --- .../mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi | 11 ++++++++++- .../filogic/base-files/lib/upgrade/platform.sh | 6 +++--- target/linux/mediatek/image/filogic.mk | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi b/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi index c851853286..1649b0775d 100644 --- a/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi +++ b/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi @@ -17,6 +17,8 @@ }; chosen { + bootargs = "root=/dev/fit0 rootwait"; + rootdisk = <&ubi_rootdisk>; stdout-path = "serial0:115200n8"; }; @@ -217,8 +219,15 @@ }; partition@580000 { - label = "ubi"; + compatible = "linux,ubi"; reg = <0x580000 0x7800000>; + label = "ubi"; + + volumes { + ubi_rootdisk: ubi-volume-fit { + volname = "fit"; + }; + }; }; }; }; 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 380606412d..6f69706d79 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -83,6 +83,9 @@ platform_do_upgrade() { bananapi,bpi-r3|\ bananapi,bpi-r3-mini|\ bananapi,bpi-r4|\ + tplink,tl-xdr4288|\ + tplink,tl-xdr6086|\ + tplink,tl-xdr6088|\ xiaomi,redmi-router-ax6000-ubootmod) [ -e /dev/fit0 ] && fitblk /dev/fit0 [ -e /dev/fitrw ] && fitblk /dev/fitrw @@ -132,9 +135,6 @@ platform_do_upgrade() { mediatek,mt7981-rfb|\ netcore,n60|\ qihoo,360t7|\ - tplink,tl-xdr4288|\ - tplink,tl-xdr6086|\ - tplink,tl-xdr6088|\ xiaomi,mi-router-ax3000t-ubootmod|\ xiaomi,mi-router-wr30u-ubootmod) CI_KERNPART="fit" diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index c3de23f5e8..818a7cef95 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -930,7 +930,7 @@ define Device/tplink_tl-xdr-common 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-with-rootfs | append-metadata - DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := fitblk kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware ARTIFACTS := preloader.bin bl31-uboot.fip ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3 endef From 204823ac287998c8725329ab75333ed1098d3cd8 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 8 Apr 2024 18:38:51 +0200 Subject: [PATCH 08/13] scripts/dl_github_archive: use tar -I for ZSTD Instead of relying on env variables for setting the ZSTD compression configuration we can simply do what we do for IB, SDK and the rest and use tar -I to pass "zstd -T0 --ultra -20" directly. This makes it rather clear what is being done and allows to drop the zstd CLI max level override as its usually capped at level 19. Signed-off-by: Robert Marko --- scripts/dl_github_archive.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/dl_github_archive.py b/scripts/dl_github_archive.py index 744c441ca7..570ed3c629 100755 --- a/scripts/dl_github_archive.py +++ b/scripts/dl_github_archive.py @@ -139,9 +139,7 @@ class Path(object): if ts is not None: args.append('--mtime=@%d' % ts) if into.endswith('.zst'): - envs['ZSTD_CLEVEL'] = '20' - envs['ZSTD_NBTHREADS'] = '0' - args.append('--zstd') + args.append('-I zstd -T0 --ultra -20') elif into.endswith('.xz'): envs['XZ_OPT'] = '-7e' args.append('-J') From e65800d9484e49e81c5d226cc64f2bb47782c089 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 8 Apr 2024 18:35:45 +0200 Subject: [PATCH 09/13] tools: zstd: dont override CLI max level Now that instead of relying on env variables for the GH download script invoking ZSTD tarball compression it passes the full arguments via tar -I we can drop the CLI max compression level override. Signed-off-by: Robert Marko --- tools/zstd/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile index 728cef26b8..0264ac2422 100644 --- a/tools/zstd/Makefile +++ b/tools/zstd/Makefile @@ -17,9 +17,6 @@ include $(INCLUDE_DIR)/host-build.mk HOSTCC:= $(HOSTCC_NOCACHE) -HOST_CFLAGS += \ - -DZSTDCLI_CLEVEL_MAX=20 - HOST_MAKE_FLAGS += \ BACKTRACE=0 \ HAVE_THREAD=1 \ From a68eb991911794b1c3814acb17ca829cb311fdcd Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 9 Apr 2024 17:39:46 +0100 Subject: [PATCH 10/13] generic: add missing patch headers Make sure all patches can be applied to a git tree using 'git am' by adding missing patch headers where needed. Signed-off-by: Daniel Golle --- .../hack-5.15/781-usb-net-rndis-support-asr.patch | 13 +++++++++++++ .../hack-6.1/781-usb-net-rndis-support-asr.patch | 13 +++++++++++++ .../hack-6.6/781-usb-net-rndis-support-asr.patch | 13 +++++++++++++ ...-phy-realtek-support-interrupt-of-RTL8221B.patch | 12 ++++++++++++ ...-phy-realtek-support-interrupt-of-RTL8221B.patch | 12 ++++++++++++ ...-phy-realtek-support-interrupt-of-RTL8221B.patch | 12 ++++++++++++ 6 files changed, 75 insertions(+) diff --git a/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch b/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch index 9934bb8078..47339b6c22 100644 --- a/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch +++ b/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch @@ -1,3 +1,16 @@ +From 9fabf60187f1fa19e6f6bb5441587d485bd534b0 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Tue, 9 Apr 2024 17:06:38 +0100 +Subject: [PATCH] rndis_host: add a bunch of USB IDs + +Add a bunch of USB IDs found in various places online to the +RNDIS USB network driver. + +Signed-off-by: Daniel Golle +--- + drivers/net/usb/rndis_host.c | 40 ++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -630,6 +630,16 @@ static const struct driver_info zte_rndi diff --git a/target/linux/generic/hack-6.1/781-usb-net-rndis-support-asr.patch b/target/linux/generic/hack-6.1/781-usb-net-rndis-support-asr.patch index 9934bb8078..47339b6c22 100644 --- a/target/linux/generic/hack-6.1/781-usb-net-rndis-support-asr.patch +++ b/target/linux/generic/hack-6.1/781-usb-net-rndis-support-asr.patch @@ -1,3 +1,16 @@ +From 9fabf60187f1fa19e6f6bb5441587d485bd534b0 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Tue, 9 Apr 2024 17:06:38 +0100 +Subject: [PATCH] rndis_host: add a bunch of USB IDs + +Add a bunch of USB IDs found in various places online to the +RNDIS USB network driver. + +Signed-off-by: Daniel Golle +--- + drivers/net/usb/rndis_host.c | 40 ++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -630,6 +630,16 @@ static const struct driver_info zte_rndi diff --git a/target/linux/generic/hack-6.6/781-usb-net-rndis-support-asr.patch b/target/linux/generic/hack-6.6/781-usb-net-rndis-support-asr.patch index 9934bb8078..47339b6c22 100644 --- a/target/linux/generic/hack-6.6/781-usb-net-rndis-support-asr.patch +++ b/target/linux/generic/hack-6.6/781-usb-net-rndis-support-asr.patch @@ -1,3 +1,16 @@ +From 9fabf60187f1fa19e6f6bb5441587d485bd534b0 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Tue, 9 Apr 2024 17:06:38 +0100 +Subject: [PATCH] rndis_host: add a bunch of USB IDs + +Add a bunch of USB IDs found in various places online to the +RNDIS USB network driver. + +Signed-off-by: Daniel Golle +--- + drivers/net/usb/rndis_host.c | 40 ++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c @@ -630,6 +630,16 @@ static const struct driver_info zte_rndi diff --git a/target/linux/generic/pending-5.15/731-net-phy-realtek-support-interrupt-of-RTL8221B.patch b/target/linux/generic/pending-5.15/731-net-phy-realtek-support-interrupt-of-RTL8221B.patch index b2b41d9c61..bf0e0aa66d 100644 --- a/target/linux/generic/pending-5.15/731-net-phy-realtek-support-interrupt-of-RTL8221B.patch +++ b/target/linux/generic/pending-5.15/731-net-phy-realtek-support-interrupt-of-RTL8221B.patch @@ -1,3 +1,15 @@ +From d7943c31d57c11e1a517aa3ce2006fca44866870 Mon Sep 17 00:00:00 2001 +From: Jianhui Zhao +Date: Sun, 24 Sep 2023 22:15:00 +0800 +Subject: [PATCH] net: phy: realtek: add interrupt support for RTL8221B + +This commit introduces interrupt support for RTL8221B. + +Signed-off-by: Jianhui Zhao +--- + drivers/net/phy/realtek.c | 47 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -971,6 +971,51 @@ static int rtl8221b_config_init(struct p diff --git a/target/linux/generic/pending-6.1/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch b/target/linux/generic/pending-6.1/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch index 51cd98c883..82cd419a7e 100644 --- a/target/linux/generic/pending-6.1/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch +++ b/target/linux/generic/pending-6.1/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch @@ -1,3 +1,15 @@ +From d7943c31d57c11e1a517aa3ce2006fca44866870 Mon Sep 17 00:00:00 2001 +From: Jianhui Zhao +Date: Sun, 24 Sep 2023 22:15:00 +0800 +Subject: [PATCH] net: phy: realtek: add interrupt support for RTL8221B + +This commit introduces interrupt support for RTL8221B. + +Signed-off-by: Jianhui Zhao +--- + drivers/net/phy/realtek.c | 47 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -981,6 +981,51 @@ static int rtl8221b_config_init(struct p diff --git a/target/linux/generic/pending-6.6/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch b/target/linux/generic/pending-6.6/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch index aab0d3f7d5..e4fbf1f870 100644 --- a/target/linux/generic/pending-6.6/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch +++ b/target/linux/generic/pending-6.6/741-net-phy-realtek-support-interrupt-of-RTL8221B.patch @@ -1,3 +1,15 @@ +From d7943c31d57c11e1a517aa3ce2006fca44866870 Mon Sep 17 00:00:00 2001 +From: Jianhui Zhao +Date: Sun, 24 Sep 2023 22:15:00 +0800 +Subject: [PATCH] net: phy: realtek: add interrupt support for RTL8221B + +This commit introduces interrupt support for RTL8221B. + +Signed-off-by: Jianhui Zhao +--- + drivers/net/phy/realtek.c | 47 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -1026,6 +1026,51 @@ static int rtl8221b_config_init(struct p From 12b2cb2ec3f1366b65caa0dbbdd83846c1c88d4e Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 8 Apr 2024 22:05:19 +0200 Subject: [PATCH 11/13] config: fix CONFIG_GDB appearing in main menuconfig menu I noticed that CONFIG_GDB was suddenly appearing in the main menuconfig menu despite the fact that it should be visible only when TOOLCHAINOPTS is selected and under a dedicated menu. After some trial and error, it seems that this was caused by the recent addition of GCC_USE_DEFAULT_VERSION, and after even more trial and error it gets fixed as soon GCC_USE_DEFAULT_VERSION is placed after GCC_VERSION. So, lets simply put GCC_USE_DEFAULT_VERSION after GCC_VERSION. Fixes: 501ef81040ba ("config: select KERNEL_WERROR if building with default GCC version") Signed-off-by: Robert Marko --- toolchain/gcc/Config.in | 5 ----- toolchain/gcc/Config.version | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index fd98914075..85abbdabb7 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -16,11 +16,6 @@ choice bool "gcc 13.x" endchoice -config GCC_USE_DEFAULT_VERSION - bool - default y if !TOOLCHAINOPTS || GCC_USE_VERSION_13 - imply KERNEL_WERROR - config GCC_USE_GRAPHITE bool prompt "Compile in support for the new Graphite framework in GCC 4.4+" if TOOLCHAINOPTS diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index 54bb4445b3..fe956d65b7 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -12,3 +12,8 @@ config GCC_VERSION default "11.3.0" if GCC_VERSION_11 default "12.3.0" if GCC_VERSION_12 default "13.2.0" + +config GCC_USE_DEFAULT_VERSION + bool + default y if !TOOLCHAINOPTS || GCC_USE_VERSION_13 + imply KERNEL_WERROR From 08639a5e47d8ec2d78693493924081d841601028 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 9 Apr 2024 11:21:39 +0200 Subject: [PATCH 12/13] ucode: update to Git HEAD (2024-04-07) 1220992631d5 ubus: automatically clear error information d6fd94014eea uci: automatically clear error information 99837f280b61 uloop: automatically clear error information be767ae197ba vm: rework `in` operator semantics 4ade84e8fb81 ubus: add explicit support for deferring incoming requests Signed-off-by: Felix Fietkau --- package/utils/ucode/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile index fdaafdddcc..f9db6b060e 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/jow-/ucode.git -PKG_SOURCE_DATE:=2024-02-21 -PKG_SOURCE_VERSION:=ba3855ae3775197f3594fc2615cac539075bd2fb -PKG_MIRROR_HASH:=f585447ebbb5ef56ada3a9f8dbe71d5310cc8185d0e90676b512849eaf60f77c +PKG_SOURCE_DATE:=2024-04-07 +PKG_SOURCE_VERSION:=5507654a498a339c44b642f62e203e1d5fb1f725 +PKG_MIRROR_HASH:=40d3df5308faaf3cddfca4ebbcd9ee7fff98cf7e7d406dc177972a7abf0ca16b PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From d668c74fe6efb546f0fd65f0334a3f0bd7bf5df4 Mon Sep 17 00:00:00 2001 From: Oleg S Date: Sun, 24 Mar 2024 21:26:08 +0300 Subject: [PATCH 13/13] kernel: add kmod-hwmon-emc2305 support This module supports the Microchip Technology Inc (SMSC) EMC2301/EMC2302/EMC2303/EMC2305 fan speed PWM controller chips. Signed-off-by: Oleg S --- package/kernel/linux/modules/hwmon.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index be38a6071a..ba393ab8fa 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -125,6 +125,21 @@ endef $(eval $(call KernelPackage,hwmon-drivetemp)) +define KernelPackage/hwmon-emc2305 + TITLE:=Microchip EMC2301/2/3/5 fan controller + KCONFIG:=CONFIG_SENSORS_EMC2305 + FILES:=$(LINUX_DIR)/drivers/hwmon/emc2305.ko + AUTOLOAD:=$(call AutoProbe,emc2305) + $(call AddDepends/hwmon,+kmod-i2c-core +PACKAGE_kmod-thermal:kmod-thermal +kmod-regmap-i2c @LINUX_6_1||LINUX_6_6) +endef + +define KernelPackage/hwmon-emc2305/description + Kernel module for Microchip EMC2301/EMC2302/EMC2303/EMC2305 fan controllers +endef + +$(eval $(call KernelPackage,hwmon-emc2305)) + + define KernelPackage/hwmon-gsc TITLE:=Gateworks System Controller support KCONFIG:=CONFIG_MFD_GATEWORKS_GSC \