From 2b90347dd62606a9b3904999287efb278797eb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 23 Jul 2024 21:24:39 +0200 Subject: [PATCH 01/39] tools: util-linux: update to v2.40.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also switch from .tar.gz to .tar.xz to align with package/utils/util-linux/Makefile. This makes synchronized updates easier. Release Notes: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40-ReleaseNotes https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.1-ReleaseNotes https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.2-ReleaseNotes Signed-off-by: Thomas Weißschuh Link: https://github.com/openwrt/openwrt/pull/15995 Signed-off-by: Hauke Mehrtens --- tools/util-linux/Makefile | 6 +++--- ...1-hexdump-allow-enabling-with-disable-all-programs.patch | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/util-linux/Makefile b/tools/util-linux/Makefile index 0394907a96..f9aadba2c2 100644 --- a/tools/util-linux/Makefile +++ b/tools/util-linux/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.40.1 +PKG_VERSION:=2.40.2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.40 -PKG_HASH:=8e396eececae2b3b68db232c33b8810faa7c31f6df19f98f512739293d5829b7 +PKG_HASH:=d78b37a66f5922d70edf3bdfb01a6b33d34ed3c3cafd6628203b2a2b67c8e8b3 PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_FIXUP:=autoreconf diff --git a/tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch b/tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch index c0c1f04d06..a8f1b5eb24 100644 --- a/tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch +++ b/tools/util-linux/patches/0001-hexdump-allow-enabling-with-disable-all-programs.patch @@ -13,7 +13,7 @@ Signed-off-by: Robert Marko --- a/configure.ac +++ b/configure.ac -@@ -2237,7 +2237,11 @@ UL_BUILD_INIT([column], [check]) +@@ -2240,7 +2240,11 @@ UL_BUILD_INIT([column], [check]) UL_REQUIRES_BUILD([column], [libsmartcols]) AM_CONDITIONAL([BUILD_COLUMN], [test "x$build_column" = xyes]) From edf927690ec1bb6d3b96255be19c0588f1a94a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 23 Jul 2024 21:22:17 +0200 Subject: [PATCH 02/39] util-linux: update to v2.40.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release Notes: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40-ReleaseNotes https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.1-ReleaseNotes https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.2-ReleaseNotes Remove upstreamed: 0001-meson-Fix-build-python-option.patch Signed-off-by: Thomas Weißschuh Link: https://github.com/openwrt/openwrt/pull/15995 Signed-off-by: Hauke Mehrtens --- package/utils/util-linux/Makefile | 4 +-- .../0001-meson-Fix-build-python-option.patch | 31 ------------------- 2 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 package/utils/util-linux/patches/0001-meson-Fix-build-python-option.patch diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 0e04ec8caf..83f3a8c842 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.40.1 +PKG_VERSION:=2.40.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.40 -PKG_HASH:=59e676aa53ccb44b6c39f0ffe01a8fa274891c91bef1474752fad92461def24f +PKG_HASH:=d78b37a66f5922d70edf3bdfb01a6b33d34ed3c3cafd6628203b2a2b67c8e8b3 PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_LICENSE:=GPL-2.0-only diff --git a/package/utils/util-linux/patches/0001-meson-Fix-build-python-option.patch b/package/utils/util-linux/patches/0001-meson-Fix-build-python-option.patch deleted file mode 100644 index e84fe5e705..0000000000 --- a/package/utils/util-linux/patches/0001-meson-Fix-build-python-option.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b66b70d62e50923502aeb3f6420a5f9c20f769d3 Mon Sep 17 00:00:00 2001 -From: Jordan Williams -Date: Thu, 9 May 2024 15:57:12 -0500 -Subject: [PATCH] meson: Fix build-python option -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The build-python option is for controlling whether or not pylibmount is -built. -Unfortunately, commit b6799cc rendered the option unused. -This change uses the build-python option again. - -Signed-off-by: Jordan Williams -Signed-off-by: Thomas Weißschuh ---- - libmount/python/meson.build | 40 ++++++++++++++++++------------------- - 1 file changed, 20 insertions(+), 20 deletions(-) - -diff --git a/libmount/python/meson.build b/libmount/python/meson.build -index 72985eca6b21..5dcdf807da89 100644 ---- a/libmount/python/meson.build -+++ b/libmount/python/meson.build -@@ -1,4 +1,6 @@ --build_python = python.found() -+if get_option('build-python').disabled() -+ subdir_done() -+endif - - pylibmount_sources = ''' - pylibmount.c From 0a8ed4c122efe34963ba14d1ebe98dee13272a30 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 11 Jul 2024 02:36:18 -0400 Subject: [PATCH 03/39] build: add support for host building in a subdirectory Add HOST_MAKE_PATH and use it in order to execute Make in a subdirectory of the build directory and in a similar way that MAKE_PATH is used for target building. Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/15991 Signed-off-by: Robert Marko --- include/host-build.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/host-build.mk b/include/host-build.mk index 8313dbfbb3..4dfa055db9 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -111,9 +111,11 @@ define Host/Configure $(call Host/Configure/Default) endef +HOST_MAKE_PATH ?= . + define Host/Compile/Default +$(HOST_MAKE_VARS) \ - $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ + $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/$(HOST_MAKE_PATH) \ $(HOST_MAKE_FLAGS) \ $(1) endef From ce4b345b7b498f5686b5365c4557353619466e06 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 11 Jul 2024 03:54:29 -0400 Subject: [PATCH 04/39] tools/7z: cleanup Makefile Define the version in one variable, and use Make functions to use variations of it elsewhere. Correct the CPE ID. Override the default tar directory flag by adding a new value to the tar options instead of defining the entire command. Use variables for adjusting build recipes instead of adding custom build recipes. Remove unnecessary lines and add spacing. Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/15991 Signed-off-by: Robert Marko --- tools/7z/Makefile | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tools/7z/Makefile b/tools/7z/Makefile index 2d75d9059e..3b3ceeb096 100644 --- a/tools/7z/Makefile +++ b/tools/7z/Makefile @@ -2,32 +2,26 @@ include $(TOPDIR)/rules.mk PKG_NAME:=7z PKG_VERSION:=23.01 -PKG_SOURCE_VERSION:=2301 -PKG_SOURCE:=$(PKG_NAME)$(PKG_SOURCE_VERSION)-src.tar.xz +PKG_SOURCE:=$(PKG_NAME)$(subst .,,$(PKG_VERSION))-src.tar.xz PKG_SOURCE_URL:=https://7-zip.org/a/ PKG_HASH:=356071007360e5a1824d9904993e8b2480b51b570e8c9faf7c0f58ebe4bf9f74 -PKG_CPE_ID:=cpe:/a:7-zip:7zip + +PKG_CPE_ID:=cpe:/a:7-zip:7-zip # This builds the 7zr variant which supports only 7z, so no non-LGPL code should be included PKG_LICENSE:=LGPL-2.1-or-later PKG_LICENSE_FILES:=DOC/License.txt DOC/copying.txt -HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION) +HOST_MAKE_PATH:=CPP/7zip/Bundles/Alone7z include $(INCLUDE_DIR)/host-build.mk -TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS) - -ALONE_DIR=$(HOST_BUILD_DIR)/CPP/7zip/Bundles/Alone7z - -define Host/Compile - $(MAKE) -C $(ALONE_DIR) -f makefile.gcc -endef +TAR_OPTIONS := -C $(HOST_BUILD_DIR) $(TAR_OPTIONS) +HOST_MAKE_FLAGS += -f makefile.gcc define Host/Install - $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin - $(INSTALL_BIN) $(ALONE_DIR)/_o/7zr $(STAGING_DIR_HOST)/bin/7zr + $(INSTALL_BIN) $(HOST_BUILD_DIR)/$(HOST_MAKE_PATH)/_o/7zr $(STAGING_DIR_HOST)/bin/ endef define Host/Clean From a9f58dddb709d089f19e5036b282abcd5e059090 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 11 Jul 2024 06:33:55 -0400 Subject: [PATCH 05/39] tools/7z: update to 24.05 Update to a more recent stable release. Most notably, this version includes some fixes for building on an OS like Alpine. This allows for the removal of hacks that fixed building on Alpine, but broke building on ARM archs. Manually adjust: - 7-zip-flags.patch - 7-zip-musl.patch Link: https://7-zip.org/history.txt Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/15991 Signed-off-by: Robert Marko --- tools/7z/Makefile | 4 ++-- tools/7z/patches/7-zip-flags.patch | 8 ++++---- tools/7z/patches/7-zip-musl.patch | 27 ++------------------------- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/tools/7z/Makefile b/tools/7z/Makefile index 3b3ceeb096..962fd5729c 100644 --- a/tools/7z/Makefile +++ b/tools/7z/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=7z -PKG_VERSION:=23.01 +PKG_VERSION:=24.05 PKG_SOURCE:=$(PKG_NAME)$(subst .,,$(PKG_VERSION))-src.tar.xz PKG_SOURCE_URL:=https://7-zip.org/a/ -PKG_HASH:=356071007360e5a1824d9904993e8b2480b51b570e8c9faf7c0f58ebe4bf9f74 +PKG_HASH:=63f341cf80b8d287c6e945519b3da0fa75553c85572a471b7fa6e68f9a90b790 PKG_CPE_ID:=cpe:/a:7-zip:7-zip diff --git a/tools/7z/patches/7-zip-flags.patch b/tools/7z/patches/7-zip-flags.patch index b9b2152f22..5c684b0689 100644 --- a/tools/7z/patches/7-zip-flags.patch +++ b/tools/7z/patches/7-zip-flags.patch @@ -9,12 +9,12 @@ endif # for object file -@@ -32,7 +32,7 @@ endif - # -save-temps - CFLAGS_BASE_LIST = -c +@@ -50,7 +50,7 @@ endif + endif + # CFLAGS_BASE_LIST = -S -CFLAGS_BASE = -O2 $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) \ +CFLAGS_BASE = $(CFLAGS_BASE_LIST) $(CFLAGS_WARN_WALL) $(CFLAGS_WARN) -D_GNU_SOURCE \ - -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ + $(CFLAGS_DEBUG) -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ -fPIC diff --git a/tools/7z/patches/7-zip-musl.patch b/tools/7z/patches/7-zip-musl.patch index e066cc8ec9..a08520a25f 100644 --- a/tools/7z/patches/7-zip-musl.patch +++ b/tools/7z/patches/7-zip-musl.patch @@ -1,14 +1,3 @@ ---- a/C/CpuArch.c -+++ b/C/CpuArch.c -@@ -766,8 +766,6 @@ BoolInt CPU_IsSupported_AES (void) { ret - - #ifdef USE_HWCAP - --#include -- - #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \ - BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; } - --- a/C/Threads.c +++ b/C/Threads.c @@ -265,7 +265,7 @@ WRes Thread_Create_With_CpuSet(CThread * @@ -18,7 +7,7 @@ - pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet); + //pthread_attr_setaffinity_np(&attr, sizeof(*cpuSet), cpuSet); // if (ret2) ret = ret2; - #endif + #endif } @@ -275,14 +275,12 @@ WRes Thread_Create_With_CpuSet(CThread * if (!ret) @@ -37,7 +26,7 @@ // ret2 = --- a/C/Threads.h +++ b/C/Threads.h -@@ -20,6 +20,7 @@ +@@ -29,6 +29,7 @@ Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_ #endif #include @@ -45,15 +34,3 @@ #endif ---- a/CPP/Windows/SystemInfo.cpp -+++ b/CPP/Windows/SystemInfo.cpp -@@ -36,9 +36,6 @@ - #endif - */ - --#ifdef MY_CPU_ARM_OR_ARM64 --#include --#endif - #endif - - #ifdef __linux__ From cbfc91a623763e2cc1271e7dcc49f18363cdb8df Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Thu, 25 Jul 2024 18:18:39 +0200 Subject: [PATCH 06/39] kernel/archs38: Create kernel files for v6.6 (from v6.1) This is an automatically generated commit. When doing `git bisect`, consider `git bisect --skip`. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16004 Signed-off-by: Robert Marko --- target/linux/archs38/{config-6.1 => config-6.6} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename target/linux/archs38/{config-6.1 => config-6.6} (100%) diff --git a/target/linux/archs38/config-6.1 b/target/linux/archs38/config-6.6 similarity index 100% rename from target/linux/archs38/config-6.1 rename to target/linux/archs38/config-6.6 From 7bef3ce467792b5693ae8ead4132f0c40ba7ada6 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Thu, 25 Jul 2024 18:18:49 +0200 Subject: [PATCH 07/39] kernel/archs38: Restore kernel files for v6.1 This is an automatically generated commit which aids following Kernel patch history, as git will see the move and copy as a rename thus defeating the purpose. For the original discussion see: https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16004 Signed-off-by: Robert Marko --- target/linux/archs38/config-6.1 | 268 ++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 target/linux/archs38/config-6.1 diff --git a/target/linux/archs38/config-6.1 b/target/linux/archs38/config-6.1 new file mode 100644 index 0000000000..9fe6ba2932 --- /dev/null +++ b/target/linux/archs38/config-6.1 @@ -0,0 +1,268 @@ +# CONFIG_16KSTACKS is not set +CONFIG_ARC=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARC_BUILTIN_DTB_NAME="" +CONFIG_ARC_CACHE=y +CONFIG_ARC_CACHE_LINE_SHIFT=6 +CONFIG_ARC_CACHE_PAGES=y +CONFIG_ARC_CPU_HS=y +CONFIG_ARC_CURR_IN_REG=y +CONFIG_ARC_DBG=y +# CONFIG_ARC_DSP_AGU_USERSPACE is not set +# CONFIG_ARC_DSP_KERNEL is not set +CONFIG_ARC_DSP_NONE=y +# CONFIG_ARC_DSP_USERSPACE is not set +CONFIG_ARC_DW2_UNWIND=y +CONFIG_ARC_FPU_SAVE_RESTORE=y +CONFIG_ARC_HAS_ACCL_REGS=y +CONFIG_ARC_HAS_DCACHE=y +# CONFIG_ARC_HAS_DCCM is not set +CONFIG_ARC_HAS_DIV_REM=y +CONFIG_ARC_HAS_ICACHE=y +# CONFIG_ARC_HAS_ICCM is not set +CONFIG_ARC_HAS_LL64=y +CONFIG_ARC_HAS_LLSC=y +# CONFIG_ARC_HAS_PAE40 is not set +CONFIG_ARC_HAS_SWAPE=y +CONFIG_ARC_IRQ_NO_AUTOSAVE=y +CONFIG_ARC_KVADDR_SIZE=256 +# CONFIG_ARC_LPB_DISABLE is not set +CONFIG_ARC_MCIP=y +# CONFIG_ARC_METAWARE_HLINK is not set +CONFIG_ARC_MMU_V4=y +# CONFIG_ARC_PAGE_SIZE_16K is not set +# CONFIG_ARC_PAGE_SIZE_4K is not set +CONFIG_ARC_PAGE_SIZE_8K=y +CONFIG_ARC_PLAT_AXS10X=y +# CONFIG_ARC_PLAT_TB10X is not set +# CONFIG_ARC_SMP_HALT_ON_RESET is not set +CONFIG_ARC_SOC_HSDK=y +CONFIG_ARC_TIMERS=y +CONFIG_ARC_TIMERS_64BIT=y +CONFIG_ARC_TUNE_MCPU="" +CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS=y +CONFIG_AXS103=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_SD=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 +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y +CONFIG_CPU_RMAP=y +CONFIG_CRC16=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_ECHAINIV=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1 +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA512=y +CONFIG_DEBUG_INFO=y +CONFIG_DMADEVICES=y +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DTC=y +CONFIG_DWMAC_ANARION=y +CONFIG_DWMAC_GENERIC=y +CONFIG_DW_APB_ICTL=y +CONFIG_DW_AXI_DMAC=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_EXT4_FS=y +CONFIG_FAT_FS=y +CONFIG_FB=y +CONFIG_FB_CMDLINE=y +CONFIG_FIXED_PHY=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=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_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_DWAPB=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_SNPS_CREG=y +CONFIG_GRACE_PERIOD=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_IIO=y +CONFIG_IIO_BUFFER=y +CONFIG_IIO_KFIFO_BUF=y +CONFIG_IIO_ST_PRESS=y +CONFIG_IIO_ST_PRESS_I2C=y +CONFIG_IIO_ST_PRESS_SPI=y +CONFIG_IIO_ST_SENSORS_CORE=y +CONFIG_IIO_ST_SENSORS_I2C=y +CONFIG_IIO_ST_SENSORS_SPI=y +CONFIG_IIO_TRIGGER=y +CONFIG_IIO_TRIGGERED_BUFFER=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_WORK=y +# CONFIG_ISA_ARCOMPACT is not set +CONFIG_ISA_ARCV2=y +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KERNEL_GZIP=y +CONFIG_LIBFDT=y +CONFIG_LINUX_LINK_BASE=0x90000000 +CONFIG_LINUX_RAM_BASE=0x80000000 +CONFIG_LOCKD=y +CONFIG_LOCKUP_DETECTOR=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MEMFD_CREATE=y +CONFIG_MFD_SYSCON=y +CONFIG_MICREL_PHY=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_DW=y +# CONFIG_MMC_DW_BLUEFIELD is not set +# CONFIG_MMC_DW_EXYNOS is not set +# CONFIG_MMC_DW_HI3798CV200 is not set +# CONFIG_MMC_DW_K3 is not set +CONFIG_MMC_DW_PLTFM=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NAMESPACES=y +CONFIG_NATIONAL_PHY=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_NS=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_SELFTESTS=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NO_IOPORT_MAP=y +CONFIG_NR_CPUS=4 +CONFIG_OF=y +CONFIG_OF_ADDRESS=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_PADATA=y +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y +CONFIG_PCS_XPCS=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLIB_LEDS=y +CONFIG_PHYLINK=y +CONFIG_PPS=y +CONFIG_PREEMPT=y +CONFIG_PREEMPTION=y +CONFIG_PREEMPT_BUILD=y +CONFIG_PREEMPT_COUNT=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_RCU=y +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RATIONAL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_RESET_AXS10X=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_HSDK=y +CONFIG_RESET_SIMPLE=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_8250_DWLIB=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_ARC=y +CONFIG_SERIAL_ARC_CONSOLE=y +CONFIG_SERIAL_ARC_NR_PORTS=1 +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SOFTLOCKUP_DETECTOR=y +CONFIG_SPI=y +CONFIG_SPI_DESIGNWARE=y +# CONFIG_SPI_DW_DMA is not set +CONFIG_SPI_DW_MMIO=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SRCU=y +CONFIG_STACKTRACE=y +# CONFIG_STANDALONE is not set +CONFIG_STMMAC_ETH=y +CONFIG_STMMAC_PLATFORM=y +CONFIG_SUNRPC=y +CONFIG_SWPHY=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TI_ADC108S102=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_USB_SUPPORT=y +# CONFIG_USER_NS is not set +CONFIG_VFAT_FS=y +CONFIG_WATCHDOG_CORE=y +CONFIG_XPS=y From c7f6b4f82858dc4d855f6ea1f7e66b8e827b0483 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Thu, 25 Jul 2024 20:42:30 +0200 Subject: [PATCH 08/39] archs38: refresh config-6.6 Refresh kernel config for Linux 6.6. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16004 Signed-off-by: Robert Marko --- target/linux/archs38/config-6.6 | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/target/linux/archs38/config-6.6 b/target/linux/archs38/config-6.6 index 9fe6ba2932..5eb67e1043 100644 --- a/target/linux/archs38/config-6.6 +++ b/target/linux/archs38/config-6.6 @@ -46,6 +46,7 @@ CONFIG_BLK_DEV_RAM=y 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 @@ -55,6 +56,7 @@ CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_COMPAT_32BIT_TIME=y CONFIG_CONTEXT_TRACKING=y CONFIG_CONTEXT_TRACKING_IDLE=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_RMAP=y CONFIG_CRC16=y CONFIG_CRYPTO_CRC32C=y @@ -62,9 +64,11 @@ CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_DRBG_HMAC=y CONFIG_CRYPTO_DRBG_MENU=y CONFIG_CRYPTO_ECHAINIV=y +CONFIG_CRYPTO_GENIV=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_JITTERENTROPY=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_GF128MUL=y CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1 CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_SHA256=y @@ -73,6 +77,7 @@ CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_RNG_DEFAULT=y CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA3=y CONFIG_CRYPTO_SHA512=y CONFIG_DEBUG_INFO=y CONFIG_DMADEVICES=y @@ -89,19 +94,21 @@ CONFIG_EXCLUSIVE_SYSTEM_RAM=y CONFIG_EXT4_FS=y CONFIG_FAT_FS=y CONFIG_FB=y -CONFIG_FB_CMDLINE=y +CONFIG_FB_CORE=y +CONFIG_FB_IOMEM_FOPS=y CONFIG_FIXED_PHY=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y +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_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_IOREMAP=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PCI_IOMAP=y @@ -142,6 +149,7 @@ CONFIG_ISA_ARCV2=y CONFIG_JBD2=y CONFIG_KALLSYMS=y CONFIG_KERNEL_GZIP=y +CONFIG_LEGACY_DIRECT_IO=y CONFIG_LIBFDT=y CONFIG_LINUX_LINK_BASE=0x90000000 CONFIG_LINUX_RAM_BASE=0x80000000 @@ -152,7 +160,6 @@ CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MDIO_DEVRES=y -CONFIG_MEMFD_CREATE=y CONFIG_MFD_SYSCON=y CONFIG_MICREL_PHY=y CONFIG_MIGRATION=y @@ -166,16 +173,21 @@ CONFIG_MMC_DW=y CONFIG_MMC_DW_PLTFM=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMU_LAZY_TLB_REFCOUNT=y CONFIG_MODULES_USE_ELF_RELA=y CONFIG_MTD_SPI_NOR=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NAMESPACES=y CONFIG_NATIONAL_PHY=y CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_EGRESS=y CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_HANDSHAKE=y +CONFIG_NET_INGRESS=y CONFIG_NET_NS=y CONFIG_NET_PTP_CLASSIFY=y CONFIG_NET_SELFTESTS=y +CONFIG_NET_XGRESS=y CONFIG_NFS_ACL_SUPPORT=y CONFIG_NFS_FS=y CONFIG_NFS_V3_ACL=y @@ -196,7 +208,6 @@ CONFIG_PADATA=y CONFIG_PAGE_POOL=y CONFIG_PAGE_SIZE_LESS_THAN_256KB=y CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y CONFIG_PCS_XPCS=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y @@ -247,7 +258,7 @@ CONFIG_SPI_DESIGNWARE=y CONFIG_SPI_DW_MMIO=y CONFIG_SPI_MASTER=y CONFIG_SPI_MEM=y -CONFIG_SRCU=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y CONFIG_STACKTRACE=y # CONFIG_STANDALONE is not set CONFIG_STMMAC_ETH=y @@ -264,5 +275,6 @@ CONFIG_UNINLINE_SPIN_UNLOCK=y CONFIG_USB_SUPPORT=y # CONFIG_USER_NS is not set CONFIG_VFAT_FS=y +CONFIG_VIDEO_CMDLINE=y CONFIG_WATCHDOG_CORE=y CONFIG_XPS=y From c268dc3ad3c9c40a97cfe41e4921ed3d5c422f57 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sat, 27 Jul 2024 23:51:16 +0200 Subject: [PATCH 09/39] generic: 6.6: backport fix uninitialized variable warnings Fix uninitialized variable warnings in function regcache_maple_drop Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16004 Signed-off-by: Robert Marko --- ...e-work-around-false-positive-warning.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 target/linux/generic/backport-6.6/200-regmap-maple-work-around-false-positive-warning.patch diff --git a/target/linux/generic/backport-6.6/200-regmap-maple-work-around-false-positive-warning.patch b/target/linux/generic/backport-6.6/200-regmap-maple-work-around-false-positive-warning.patch new file mode 100644 index 0000000000..de5c813804 --- /dev/null +++ b/target/linux/generic/backport-6.6/200-regmap-maple-work-around-false-positive-warning.patch @@ -0,0 +1,47 @@ +From 542440fd7b30983cae23e32bd22f69a076ec7ef4 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 19 Jul 2024 12:40:24 +0200 +Subject: regmap: maple: work around gcc-14.1 false-positive warning + +With gcc-14.1, there is a false-postive -Wuninitialized warning in +regcache_maple_drop: + +drivers/base/regmap/regcache-maple.c: In function 'regcache_maple_drop': +drivers/base/regmap/regcache-maple.c:113:23: error: 'lower_index' is used uninitialized [-Werror=uninitialized] + 113 | unsigned long lower_index, lower_last; + | ^~~~~~~~~~~ +drivers/base/regmap/regcache-maple.c:113:36: error: 'lower_last' is used uninitialized [-Werror=uninitialized] + 113 | unsigned long lower_index, lower_last; + | ^~~~~~~~~~ + +I've created a reduced test case to see if this needs to be reported +as a gcc, but it appears that the gcc-14.x branch already has a change +that turns this into a more sensible -Wmaybe-uninitialized warning, so +I ended up not reporting it so far. + +The reduced test case also produces a warning for gcc-13 and gcc-12 +but I don't see that with the version in the kernel. + +Link: https://godbolt.org/z/oKbohKqd3 +Link: https://lore.kernel.org/all/CAMuHMdWj=FLmkazPbYKPevDrcym2_HDb_U7Mb9YE9ovrP0jJfA@mail.gmail.com/ +Signed-off-by: Arnd Bergmann +Link: https://patch.msgid.link/20240719104030.1382465-1-arnd@kernel.org +Signed-off-by: Mark Brown +--- + drivers/base/regmap/regcache-maple.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'drivers/base/regmap/regcache-maple.c') + +--- a/drivers/base/regmap/regcache-maple.c ++++ b/drivers/base/regmap/regcache-maple.c +@@ -110,7 +110,8 @@ static int regcache_maple_drop(struct re + struct maple_tree *mt = map->cache; + MA_STATE(mas, mt, min, max); + unsigned long *entry, *lower, *upper; +- unsigned long lower_index, lower_last; ++ /* initialized to work around false-positive -Wuninitialized warning */ ++ unsigned long lower_index = 0, lower_last = 0; + unsigned long upper_index, upper_last; + int ret = 0; + From 5e41b285119c1f8f534ab331728fef9679c42acb Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Thu, 25 Jul 2024 20:54:55 +0200 Subject: [PATCH 10/39] archs38: enable 6.6 testing kernel The archs38 now supports 6.6 kernel as testing. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16004 Signed-off-by: Robert Marko --- target/linux/archs38/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/archs38/Makefile b/target/linux/archs38/Makefile index e352c58957..7de2684eb7 100644 --- a/target/linux/archs38/Makefile +++ b/target/linux/archs38/Makefile @@ -12,6 +12,7 @@ FEATURES:=source-only SUBTARGETS:=generic KERNEL_PATCHVER:=6.1 +KERNEL_TESTING_PATCHVER:=6.6 DEVICE_TYPE:=basic From e33ebdd00e5aedacb996fd48987067c77e43f5f4 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 25 Jul 2024 21:51:42 +0200 Subject: [PATCH 11/39] ltq-ptm: Fix netdev ioctls with kernel > 5.15 .ndo_do_ioctl is not called for SIOCDEVPRIVATE any more, the kernel calls .ndo_siocdevprivate now. The function gets the data pointer from the callback directly, make use of it. See upstream Linux kernel commit: https://git.kernel.org/linus/b9067f5dc4a07c8e24e01a1b277c6722d91be39e Link: https://github.com/openwrt/openwrt/pull/16005 Signed-off-by: Hauke Mehrtens --- .../lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 52 +++++++++--------- .../lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 54 +++++++++---------- 2 files changed, 53 insertions(+), 53 deletions(-) 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 8c829f9c6b..3ff01d588a 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -126,7 +126,7 @@ static int ptm_stop(struct net_device *); static unsigned int ptm_poll(int, unsigned int); static int ptm_napi_poll(struct napi_struct *, int); static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *); -static int ptm_ioctl(struct net_device *, struct ifreq *, int); +static int ptm_ioctl(struct net_device *, struct ifreq *, void __user *, int); #if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) static void ptm_tx_timeout(struct net_device *); #else @@ -247,7 +247,7 @@ static struct net_device_ops g_ptm_netdev_ops = { .ndo_start_xmit = ptm_hard_start_xmit, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, - .ndo_do_ioctl = ptm_ioctl, + .ndo_siocdevprivate = ptm_ioctl, .ndo_tx_timeout = ptm_tx_timeout, }; @@ -459,7 +459,7 @@ PTM_HARD_START_XMIT_FAIL: return NETDEV_TX_OK; } -static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *data, int cmd) { int ndev; @@ -469,45 +469,45 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) switch ( cmd ) { case IFX_PTM_MIB_CW_GET: - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw; - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw; - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw; - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxNoIdleCodewords = 0; - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxIdleCodewords = 0; + ((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw; + ((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw; + ((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw; + ((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = 0; + ((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = 0; break; case IFX_PTM_MIB_FRAME_GET: - ((PTM_FRAME_MIB_T *)ifr->ifr_data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu; - ((PTM_FRAME_MIB_T *)ifr->ifr_data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu; - ((PTM_FRAME_MIB_T *)ifr->ifr_data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu; - ((PTM_FRAME_MIB_T *)ifr->ifr_data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu; + ((PTM_FRAME_MIB_T *)data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu; + ((PTM_FRAME_MIB_T *)data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu; + ((PTM_FRAME_MIB_T *)data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu; + ((PTM_FRAME_MIB_T *)data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu; break; case IFX_PTM_CFG_GET: - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len; + ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present; + ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check; + ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check; + ((IFX_PTM_CFG_T *)data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len; + ((IFX_PTM_CFG_T *)data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen; + ((IFX_PTM_CFG_T *)data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen; + ((IFX_PTM_CFG_T *)data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len; break; case IFX_PTM_CFG_SET: - CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent ? 1 : 0; - CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck ? 1 : 0; - if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen == 32) ) + CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent ? 1 : 0; + CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 1 : 0; + if ( ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 32) ) { CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 1; - CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen; + CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->RxTcCrcLen; } else { CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 0; CFG_ETH_EFMTC_CRC->rx_tc_crc_len = 0; } - CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen ? 1 : 0; - if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen == 32) ) + CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 1 : 0; + if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 32) ) { CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 1; - CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen; + CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->TxTcCrcLen; } else { 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 9cd9cd5986..8a0ac331b7 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -76,7 +76,7 @@ static int ptm_stop(struct net_device *); static unsigned int ptm_poll(int, unsigned int); static int ptm_napi_poll(struct napi_struct *, int); static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *); -static int ptm_ioctl(struct net_device *, struct ifreq *, int); +static int ptm_ioctl(struct net_device *, struct ifreq *, void __user *, int); #if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) static void ptm_tx_timeout(struct net_device *); #else @@ -120,7 +120,7 @@ static struct net_device_ops g_ptm_netdev_ops = { .ndo_start_xmit = ptm_hard_start_xmit, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, - .ndo_do_ioctl = ptm_ioctl, + .ndo_siocdevprivate = ptm_ioctl, .ndo_tx_timeout = ptm_tx_timeout, }; @@ -377,62 +377,62 @@ PTM_HARD_START_XMIT_FAIL: return 0; } -static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *data, int cmd) { ASSERT(dev == g_net_dev[0], "incorrect device"); switch ( cmd ) { case IFX_PTM_MIB_CW_GET: - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1); - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1); - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1); - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1); - ((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1); + ((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1); + ((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1); + ((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1); + ((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1); + ((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1); break; case IFX_PTM_MIB_FRAME_GET: { - PTM_FRAME_MIB_T data = {0}; + PTM_FRAME_MIB_T tmp = {0}; int i; - data.RxCorrect = IFX_REG_R32(DREG_AR_HEC_CNT0) + IFX_REG_R32(DREG_AR_HEC_CNT1) + IFX_REG_R32(DREG_AR_AIIDLE_CNT0) + IFX_REG_R32(DREG_AR_AIIDLE_CNT1); + tmp.RxCorrect = IFX_REG_R32(DREG_AR_HEC_CNT0) + IFX_REG_R32(DREG_AR_HEC_CNT1) + IFX_REG_R32(DREG_AR_AIIDLE_CNT0) + IFX_REG_R32(DREG_AR_AIIDLE_CNT1); for ( i = 0; i < 4; i++ ) - data.RxDropped += WAN_RX_MIB_TABLE(i)->wrx_dropdes_pdu; + tmp.RxDropped += WAN_RX_MIB_TABLE(i)->wrx_dropdes_pdu; for ( i = 0; i < 8; i++ ) - data.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu; + tmp.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu; - *((PTM_FRAME_MIB_T *)ifr->ifr_data) = data; + *((PTM_FRAME_MIB_T *)data) = tmp; } break; case IFX_PTM_CFG_GET: // use bear channel 0 preemption gamma interface settings - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent = 1; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16); - ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1; - ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16); + ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = 1; + ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0; + ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;; + ((IFX_PTM_CFG_T *)data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16); + ((IFX_PTM_CFG_T *)data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0; + ((IFX_PTM_CFG_T *)data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1; + ((IFX_PTM_CFG_T *)data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16); break; case IFX_PTM_CFG_SET: { int i; for ( i = 0; i < 4; i++ ) { - RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck ? 0 : 1; + RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 0 : 1; - RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck ? 0 : 1; + RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck ? 0 : 1; - switch ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen ) { + switch ( ((IFX_PTM_CFG_T *)data)->RxTcCrcLen ) { case 16: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 1; break; case 32: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 2; break; default: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 0; } - TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen ? 0 : 1; + TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 0 : 1; - if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen ) { - switch ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen ) { + if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen ) { + switch ( ((IFX_PTM_CFG_T *)data)->TxTcCrcLen ) { case 16: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 1; break; case 32: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 2; break; default: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 0; @@ -447,7 +447,7 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct ppe_prio_q_map cmd; - if ( copy_from_user(&cmd, ifr->ifr_data, sizeof(cmd)) ) + if ( copy_from_user(&cmd, data, sizeof(cmd)) ) return -EFAULT; if ( cmd.pkt_prio < 0 || cmd.pkt_prio >= ARRAY_SIZE(g_ptm_prio_queue_map) ) From f86273e742b9f01565018494733d38438e7f0098 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 25 Jul 2024 22:05:11 +0200 Subject: [PATCH 12/39] ath79: Fix PHY access over ag71xx driver .ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the kernel calls .ndo_eth_ioctl now. The SIOCSIFHWADDR and SIOCGIFHWADDR operation are handled in the generic code in the same way just with more input validation. See upstream Linux kernel commit: https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691 Reported-by: Cthulhu88 in https://forum.openwrt.org/t/ethernet-leds-control-for-tp-link-tl-wr1043nd-v2-v3/202378 Link: https://github.com/openwrt/openwrt/pull/16005 Signed-off-by: Hauke Mehrtens --- .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 31 +++---------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index f63e93f978..c6fcea1abd 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -1162,33 +1162,10 @@ static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct ag71xx *ag = netdev_priv(dev); + if (ag->phy_dev == NULL) + return -ENODEV; - switch (cmd) { - case SIOCSIFHWADDR: - if (copy_from_user - ((void*)dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr))) - return -EFAULT; - return 0; - - case SIOCGIFHWADDR: - if (copy_to_user - (ifr->ifr_data, dev->dev_addr, sizeof(dev->dev_addr))) - return -EFAULT; - return 0; - - case SIOCGMIIPHY: - case SIOCGMIIREG: - case SIOCSMIIREG: - if (ag->phy_dev == NULL) - break; - - return phy_mii_ioctl(ag->phy_dev, ifr, cmd); - - default: - break; - } - - return -EOPNOTSUPP; + return phy_mii_ioctl(ag->phy_dev, ifr, cmd); } static void ag71xx_oom_timer_handler(struct timer_list *t) @@ -1501,7 +1478,7 @@ static const struct net_device_ops ag71xx_netdev_ops = { .ndo_open = ag71xx_open, .ndo_stop = ag71xx_stop, .ndo_start_xmit = ag71xx_hard_start_xmit, - .ndo_do_ioctl = ag71xx_do_ioctl, + .ndo_eth_ioctl = ag71xx_do_ioctl, .ndo_tx_timeout = ag71xx_tx_timeout, .ndo_change_mtu = ag71xx_change_mtu, .ndo_set_mac_address = eth_mac_addr, From dbccc9cf9161103448737785617e6ad537c7da9f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 25 Jul 2024 22:09:04 +0200 Subject: [PATCH 13/39] ramips: eth: Fix PHY access over mtk_eth_soc driver .ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the kernel calls .ndo_eth_ioctl now. See upstream Linux kernel commit: https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691 Link: https://github.com/openwrt/openwrt/pull/16005 Signed-off-by: Hauke Mehrtens --- .../ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c8afa4e3bb..e794f8d5cb 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 @@ -1480,7 +1480,7 @@ static const struct net_device_ops fe_netdev_ops = { .ndo_start_xmit = fe_start_xmit, .ndo_set_mac_address = fe_set_mac_address, .ndo_validate_addr = eth_validate_addr, - .ndo_do_ioctl = fe_do_ioctl, + .ndo_eth_ioctl = fe_do_ioctl, .ndo_change_mtu = fe_change_mtu, .ndo_tx_timeout = fe_tx_timeout, .ndo_get_stats64 = fe_get_stats64, From f0bb25aba2ded7bad98188cebe46efff4baa090f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 25 Jul 2024 22:13:35 +0200 Subject: [PATCH 14/39] ipq40xx: eth: Fix PHY access over ipqess driver .ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the kernel calls .ndo_eth_ioctl now. See upstream Linux kernel commit: https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691 Link: https://github.com/openwrt/openwrt/pull/16005 Signed-off-by: Hauke Mehrtens --- .../700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/patches-6.6/700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch b/target/linux/ipq40xx/patches-6.6/700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch index 4910307c88..d9ecf4b640 100644 --- a/target/linux/ipq40xx/patches-6.6/700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch +++ b/target/linux/ipq40xx/patches-6.6/700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch @@ -996,7 +996,7 @@ Signed-off-by: Maxime Chevallier + .ndo_uninit = ipqess_uninit, + .ndo_open = ipqess_open, + .ndo_stop = ipqess_stop, -+ .ndo_do_ioctl = ipqess_do_ioctl, ++ .ndo_eth_ioctl = ipqess_do_ioctl, + .ndo_start_xmit = ipqess_xmit, + .ndo_get_stats = ipqess_get_stats, + .ndo_set_mac_address = ipqess_set_mac_address, From e08b4bab8f3ba30f1e9e83ff83f419a8a9d7bb7c Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Fri, 26 Apr 2024 23:33:24 +0900 Subject: [PATCH 15/39] uboot-ath79: add new U-Boot package for Atheros/QCA devices Add U-Boot package for the devices that based on Atheros/Qualcomm Atheros SoCs. Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/15432 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-ath79/Makefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 package/boot/uboot-ath79/Makefile diff --git a/package/boot/uboot-ath79/Makefile b/package/boot/uboot-ath79/Makefile new file mode 100644 index 0000000000..cd1fc16f5f --- /dev/null +++ b/package/boot/uboot-ath79/Makefile @@ -0,0 +1,30 @@ +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_VERSION:=2024.07 +PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f + +UBOOT_USE_INTREE_DTC:=1 + +include $(INCLUDE_DIR)/u-boot.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define U-Boot/Default + BUILD_TARGET:=ath79 + BUILD_SUBTARGET:=generic + UBOOT_IMAGE:=u-boot.bin + UBOOT_CONFIG:=ap121 + HIDDEN:=1 +endef + +# don't stage files to bindir, let target/linux/ath79/image/*.mk do that +define Package/u-boot/install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) +endef + +$(eval $(call BuildPackage/U-Boot)) From 08705d44813c0f9208b6e9c52deaded7ba914a94 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Fri, 26 Apr 2024 23:34:31 +0900 Subject: [PATCH 16/39] uboot-ath79: add support for NEC Aterm series based on AR9344 Add support for NEC Aterm series devices based on Atheros AR9344. The following devices have almost the same hardware, so the same U-Boot binary can be used for them. - NEC Aterm WR8750N - NEC Aterm WR9500N - NEC Aterm WG600HP By the way, on NetBSD-based NEC Aterm devices, only 0x20000 (128KiB) is available for a bootloader on the flash chip and that limitation is too small for mainline U-Boot with the default options. So many features/commands not required for booting OpenWrt and recoverying are disabled on that devices, like the followings. - networking support - FIT support - all decompression methods support etc... Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/15432 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-ath79/Makefile | 9 + ...-support-for-NEC-AR9344-Aterm-series.patch | 287 ++++++++++++++++++ 2 files changed, 296 insertions(+) create mode 100644 package/boot/uboot-ath79/patches/400-ath79-add-support-for-NEC-AR9344-Aterm-series.patch diff --git a/package/boot/uboot-ath79/Makefile b/package/boot/uboot-ath79/Makefile index cd1fc16f5f..d19f561576 100644 --- a/package/boot/uboot-ath79/Makefile +++ b/package/boot/uboot-ath79/Makefile @@ -18,6 +18,15 @@ define U-Boot/Default HIDDEN:=1 endef +define U-Boot/ar9344_nec_aterm + NAME:=NEC Aterm series (AR9344) + BUILD_SUBTARGET:= tiny + BUILD_DEVICES:=nec_wg600hp nec_wr8750n nec_wr9500n + UBOOT_CONFIG:=nec_ar9344_aterm +endef + +UBOOT_TARGETS := ar9344_nec_aterm + # don't stage files to bindir, let target/linux/ath79/image/*.mk do that define Package/u-boot/install endef diff --git a/package/boot/uboot-ath79/patches/400-ath79-add-support-for-NEC-AR9344-Aterm-series.patch b/package/boot/uboot-ath79/patches/400-ath79-add-support-for-NEC-AR9344-Aterm-series.patch new file mode 100644 index 0000000000..833a7425b7 --- /dev/null +++ b/package/boot/uboot-ath79/patches/400-ath79-add-support-for-NEC-AR9344-Aterm-series.patch @@ -0,0 +1,287 @@ +From 80a7688c478a6a372083c29ff0b1826db4dae5b2 Mon Sep 17 00:00:00 2001 +From: INAGAKI Hiroshi +Date: Wed, 24 Apr 2024 23:54:46 +0900 +Subject: [PATCH] ath79: add support for NEC AR9344 Aterm series + +--- + arch/mips/dts/Makefile | 1 + + arch/mips/dts/nec,ar9344-aterm.dts | 35 +++++++++++++++ + arch/mips/mach-ath79/Kconfig | 5 +++ + board/nec/ar9344_aterm/Kconfig | 30 +++++++++++++ + board/nec/ar9344_aterm/Makefile | 3 ++ + board/nec/ar9344_aterm/ar9344_aterm.c | 59 ++++++++++++++++++++++++++ + configs/nec_ar9344_aterm_defconfig | 61 +++++++++++++++++++++++++++ + include/configs/nec_ar9344_aterm.h | 28 ++++++++++++ + 8 files changed, 222 insertions(+) + create mode 100644 arch/mips/dts/nec,ar9344-aterm.dts + create mode 100644 board/nec/ar9344_aterm/Kconfig + create mode 100644 board/nec/ar9344_aterm/Makefile + create mode 100644 board/nec/ar9344_aterm/ar9344_aterm.c + create mode 100644 configs/nec_ar9344_aterm_defconfig + create mode 100644 include/configs/nec_ar9344_aterm.h + +--- a/arch/mips/dts/Makefile ++++ b/arch/mips/dts/Makefile +@@ -24,6 +24,7 @@ dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY + dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) += linkit-smart-7688.dtb + dtb-$(CONFIG_TARGET_OCTEON_EBB7304) += mrvl,octeon-ebb7304.dtb + dtb-$(CONFIG_TARGET_OCTEON_NIC23) += mrvl,octeon-nic23.dtb ++dtb-$(CONFIG_BOARD_NEC_AR9344_ATERM) += nec,ar9344-aterm.dtb + dtb-$(CONFIG_BOARD_NETGEAR_CG3100D) += netgear,cg3100d.dtb + dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb + dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f@st1704.dtb +--- /dev/null ++++ b/arch/mips/dts/nec,ar9344-aterm.dts +@@ -0,0 +1,35 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2024 INAGAKI Hiroshi ++ */ ++ ++/dts-v1/; ++#include "ar934x.dtsi" ++ ++/ { ++ model = "NEC Aterm series (AR9344)"; ++ compatible = "nec,ar9344-aterm", "qca,ar934x"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:9600n8"; ++ }; ++}; ++ ++&uart0 { ++ clock-frequency = <40000000>; ++ status = "okay"; ++}; ++ ++&xtal { ++ clock-frequency = <40000000>; ++}; ++ ++/* delete unused nodes to reduce dtb size */ ++/delete-node/ &ehci0; ++/delete-node/ &gmac0; ++/delete-node/ &gmac1; ++/delete-node/ &spi0; +--- a/arch/mips/mach-ath79/Kconfig ++++ b/arch/mips/mach-ath79/Kconfig +@@ -58,6 +58,10 @@ config TARGET_AP152 + bool "AP152 Reference Board" + select SOC_QCA956X + ++config BOARD_NEC_AR9344_ATERM ++ bool "NEC Aterm series Boards (AR9344)" ++ select SOC_AR934X ++ + config BOARD_TPLINK_WDR4300 + bool "TP-Link WDR4300 Board" + select SOC_AR934X +@@ -67,6 +71,7 @@ endchoice + source "board/qca/ap121/Kconfig" + source "board/qca/ap143/Kconfig" + source "board/qca/ap152/Kconfig" ++source "board/nec/ar9344_aterm/Kconfig" + source "board/tplink/wdr4300/Kconfig" + + endmenu +--- /dev/null ++++ b/board/nec/ar9344_aterm/Kconfig +@@ -0,0 +1,30 @@ ++if BOARD_NEC_AR9344_ATERM ++ ++config SYS_VENDOR ++ default "nec" ++ ++config SYS_SOC ++ default "ath79" ++ ++config SYS_BOARD ++ default "ar9344_aterm" ++ ++config SYS_CONFIG_NAME ++ default "nec_ar9344_aterm" ++ ++config TEXT_BASE ++ default 0x9f000000 ++ ++config SYS_DCACHE_SIZE ++ default 32768 ++ ++config SYS_DCACHE_LINE_SIZE ++ default 32 ++ ++config SYS_ICACHE_SIZE ++ default 65536 ++ ++config SYS_ICACHE_LINE_SIZE ++ default 32 ++ ++endif +--- /dev/null ++++ b/board/nec/ar9344_aterm/Makefile +@@ -0,0 +1,3 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++ ++obj-y = ar9344_aterm.o +--- /dev/null ++++ b/board/nec/ar9344_aterm/ar9344_aterm.c +@@ -0,0 +1,59 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2024 INAGAKI Hiroshi ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static void aterm_pinmux_config(void) ++{ ++ void __iomem *regs; ++ ++ regs = map_physmem(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE, ++ MAP_NOCACHE); ++ ++ /* Disable JTAG */ ++ writel(0x2, regs + AR934X_GPIO_REG_FUNC); ++ ++ /* Configure default GPIO OE/SET regs */ ++ writel(0x3db1f, regs + AR71XX_GPIO_REG_OE); ++ writel(0x142000, regs + AR71XX_GPIO_REG_SET); ++ ++ /* Configure pin multiplexing */ ++ writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC0); ++ writel(0x0b0a0900, regs + AR934X_GPIO_REG_OUT_FUNC1); ++ writel(0x00180000, regs + AR934X_GPIO_REG_OUT_FUNC2); ++ writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC3); ++ writel(0x2f2e0000, regs + AR934X_GPIO_REG_OUT_FUNC4); ++ writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC5); ++} ++ ++#ifdef CONFIG_DEBUG_UART_BOARD_INIT ++void board_debug_uart_init(void) ++{ ++ aterm_pinmux_config(); ++} ++#endif ++ ++#ifdef CONFIG_BOARD_EARLY_INIT_F ++int board_early_init_f(void) ++{ ++#ifndef CONFIG_DEBUG_UART_BOARD_INIT ++ aterm_pinmux_config(); ++#endif ++ ++#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) ++ ar934x_pll_init(560, 480, 240); ++ ar934x_ddr_init(560, 480, 240); ++#endif ++ ++ return 0; ++} ++#endif +--- /dev/null ++++ b/configs/nec_ar9344_aterm_defconfig +@@ -0,0 +1,61 @@ ++CONFIG_MIPS=y ++CONFIG_SYS_MALLOC_LEN=0x40000 ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xbd007fff ++CONFIG_ENV_SIZE=0x1000 ++CONFIG_DEFAULT_DEVICE_TREE="nec,ar9344-aterm" ++CONFIG_SYS_LOAD_ADDR=0x83000000 ++CONFIG_ARCH_ATH79=y ++CONFIG_BOARD_NEC_AR9344_ATERM=y ++CONFIG_SYS_MIPS_TIMER_FREQ=280000000 ++CONFIG_MIPS_RELOCATION_TABLE_SIZE=0x4000 ++# CONFIG_LOCALVERSION_AUTO is not set ++CONFIG_TIMESTAMP=y ++CONFIG_BOOTDELAY=3 ++# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set ++CONFIG_USE_BOOTARGS=y ++CONFIG_BOOTARGS="console=ttyS0,115200" ++CONFIG_USE_BOOTCOMMAND=y ++CONFIG_BOOTCOMMAND="bootm 0x9f040000" ++# CONFIG_DISPLAY_BOARDINFO is not set ++CONFIG_BOARD_EARLY_INIT_F=y ++CONFIG_SYS_MALLOC_BOOTPARAMS=y ++# CONFIG_CMDLINE_EDITING is not set ++# CONFIG_AUTO_COMPLETE is not set ++# CONFIG_SYS_LONGHELP is not set ++CONFIG_SYS_MAXARGS=32 ++# CONFIG_SYS_XTRACE is not set ++# CONFIG_CMD_BDI is not set ++# CONFIG_CMD_CONSOLE is not set ++# CONFIG_BOOTM_PLAN9 is not set ++# CONFIG_BOOTM_RTEMS is not set ++# CONFIG_BOOTM_VXWORKS is not set ++# CONFIG_CMD_ELF is not set ++# CONFIG_CMD_FDT is not set ++# CONFIG_CMD_RUN is not set ++# CONFIG_CMD_XIMG is not set ++# CONFIG_CMD_EXPORTENV is not set ++# CONFIG_CMD_IMPORTENV is not set ++# CONFIG_CMD_EDITENV is not set ++# CONFIG_CMD_SAVEENV is not set ++# CONFIG_CMD_ENV_EXISTS is not set ++# CONFIG_CMD_CRC32 is not set ++# CONFIG_CMD_DM is not set ++# CONFIG_CMD_LOADS is not set ++# CONFIG_CMD_ECHO is not set ++# CONFIG_CMD_ITEST is not set ++# CONFIG_CMD_SOURCE is not set ++# CONFIG_CMD_SETEXPR is not set ++# CONFIG_CMD_SLEEP is not set ++# CONFIG_ISO_PARTITION is not set ++# CONFIG_OF_TAG_MIGRATE is not set ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++# CONFIG_NET is not set ++CONFIG_CLK=y ++# CONFIG_GPIO is not set ++# CONFIG_I2C is not set ++# CONFIG_INPUT is not set ++# CONFIG_POWER is not set ++CONFIG_DM_SERIAL=y ++CONFIG_SYS_NS16550=y ++# CONFIG_GZIP is not set +--- /dev/null ++++ b/include/configs/nec_ar9344_aterm.h +@@ -0,0 +1,28 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2024 INAGAKI Hiroshi ++ */ ++ ++#ifndef __NEC_AR9344_ATERM_H ++#define __NEC_AR9344_ATERM_H ++ ++#define CFG_SYS_SDRAM_BASE 0x80000000 ++ ++#define CFG_SYS_INIT_RAM_ADDR 0xbd000000 ++#define CFG_SYS_INIT_RAM_SIZE 0x8000 ++ ++/* ++ * Serial Port ++ */ ++#define CFG_SYS_NS16550_CLK 40000000 ++ ++/* ++ * Command ++ */ ++/* Miscellaneous configurable options */ ++ ++/* ++ * Diagnostics ++ */ ++ ++#endif /* __NEC_AR9344_ATERM_H */ From 98f73552a78e1c6d825dc3ba9845b4c63c3f16c6 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Fri, 26 Apr 2024 23:53:58 +0900 Subject: [PATCH 17/39] ath79: fix PCIe initialization on AR934x Fix PCIe initialization on AR934x by clearing PLL_PWD bit in addition to PPL(PLL?)_RESET bit of AR724x. Refresh patches by `make target/linux/refresh`. Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/15432 Signed-off-by: Hauke Mehrtens --- ...4x-clear-power-down-of-pll-on-AR934x.patch | 34 +++++++++++++++++++ .../patches-6.6/330-missing-registers.patch | 2 +- ...9-add-missing-QCA955x-GMAC-registers.patch | 4 +-- .../patches-6.6/332-ath79-sgmii-config.patch | 2 +- ...S-ath79-export-UART1-reference-clock.patch | 4 +-- 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 target/linux/ath79/patches-6.6/317-MIPS-pci-ar724x-clear-power-down-of-pll-on-AR934x.patch diff --git a/target/linux/ath79/patches-6.6/317-MIPS-pci-ar724x-clear-power-down-of-pll-on-AR934x.patch b/target/linux/ath79/patches-6.6/317-MIPS-pci-ar724x-clear-power-down-of-pll-on-AR934x.patch new file mode 100644 index 0000000000..dfb7e483a7 --- /dev/null +++ b/target/linux/ath79/patches-6.6/317-MIPS-pci-ar724x-clear-power-down-of-pll-on-AR934x.patch @@ -0,0 +1,34 @@ +From f2ca10b22ace3ce53b4e3f189bf1dd53a4482475 Mon Sep 17 00:00:00 2001 +From: INAGAKI Hiroshi +Date: Fri, 26 Apr 2024 23:53:58 +0900 +Subject: [PATCH 1/2] MIPS: pci-ar724x: clear power down of pll on AR934x + +Fix PCIe initialization on AR934x by clearing PLL_PWD bit in addition to +PPL_RESET bit of AR724x. + +Signed-off-by: INAGAKI Hiroshi +--- + +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -347,6 +347,8 @@ + #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) + #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) + ++#define AR934X_PLL_PCIE_CONFIG_PLL_PWD BIT(30) ++ + #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6) + + #define QCA953X_PLL_CPU_CONFIG_REG 0x00 +--- a/arch/mips/pci/pci-ar724x.c ++++ b/arch/mips/pci/pci-ar724x.c +@@ -360,7 +360,8 @@ static void ar724x_pci_hw_init(struct ar + } else { + /* remove the reset of the PCIE PLL */ + ppl = ath79_pll_rr(AR724X_PLL_REG_PCIE_CONFIG); +- ppl &= ~AR724X_PLL_REG_PCIE_CONFIG_PPL_RESET; ++ ppl &= ~(AR934X_PLL_PCIE_CONFIG_PLL_PWD | ++ AR724X_PLL_REG_PCIE_CONFIG_PPL_RESET); + ath79_pll_wr(AR724X_PLL_REG_PCIE_CONFIG, ppl); + + /* deassert bypass for the PCIE PLL */ diff --git a/target/linux/ath79/patches-6.6/330-missing-registers.patch b/target/linux/ath79/patches-6.6/330-missing-registers.patch index 74789437ec..d05e741c7e 100644 --- a/target/linux/ath79/patches-6.6/330-missing-registers.patch +++ b/target/linux/ath79/patches-6.6/330-missing-registers.patch @@ -7,7 +7,7 @@ Subject: [PATCH] ath79: gmac: add parsers for rxd(v)- and tx(d|en)-delay for --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -@@ -1231,6 +1231,10 @@ +@@ -1233,6 +1233,10 @@ #define AR934X_ETH_CFG_RDV_DELAY BIT(16) #define AR934X_ETH_CFG_RDV_DELAY_MASK 0x3 #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16 diff --git a/target/linux/ath79/patches-6.6/331-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch b/target/linux/ath79/patches-6.6/331-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch index c2f228dfe1..5d9c77c69f 100644 --- a/target/linux/ath79/patches-6.6/331-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch +++ b/target/linux/ath79/patches-6.6/331-MIPS-ath79-add-missing-QCA955x-GMAC-registers.patch @@ -16,7 +16,7 @@ Signed-off-by: David Bauer --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -@@ -1251,7 +1251,12 @@ +@@ -1253,7 +1253,12 @@ */ #define QCA955X_GMAC_REG_ETH_CFG 0x00 @@ -29,7 +29,7 @@ Signed-off-by: David Bauer #define QCA955X_ETH_CFG_RGMII_EN BIT(0) #define QCA955X_ETH_CFG_MII_GE0 BIT(1) -@@ -1273,9 +1278,58 @@ +@@ -1275,9 +1280,58 @@ #define QCA955X_ETH_CFG_TXE_DELAY_MASK 0x3 #define QCA955X_ETH_CFG_TXE_DELAY_SHIFT 20 diff --git a/target/linux/ath79/patches-6.6/332-ath79-sgmii-config.patch b/target/linux/ath79/patches-6.6/332-ath79-sgmii-config.patch index a6a50e4a8a..6f6217ce75 100644 --- a/target/linux/ath79/patches-6.6/332-ath79-sgmii-config.patch +++ b/target/linux/ath79/patches-6.6/332-ath79-sgmii-config.patch @@ -21,7 +21,7 @@ Submitted-by: David Bauer --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -@@ -1380,5 +1380,6 @@ +@@ -1382,5 +1382,6 @@ #define QCA956X_SGMII_CONFIG_MODE_CTRL_SHIFT 0 #define QCA956X_SGMII_CONFIG_MODE_CTRL_MASK 0x7 diff --git a/target/linux/ath79/patches-6.6/360-MIPS-ath79-export-UART1-reference-clock.patch b/target/linux/ath79/patches-6.6/360-MIPS-ath79-export-UART1-reference-clock.patch index b24ff21692..ae2f5aa0cd 100644 --- a/target/linux/ath79/patches-6.6/360-MIPS-ath79-export-UART1-reference-clock.patch +++ b/target/linux/ath79/patches-6.6/360-MIPS-ath79-export-UART1-reference-clock.patch @@ -45,8 +45,8 @@ Submitted-by: Daniel Golle goto err_iounmap; --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -@@ -348,6 +348,7 @@ - #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) +@@ -350,6 +350,7 @@ + #define AR934X_PLL_PCIE_CONFIG_PLL_PWD BIT(30) #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6) +#define AR934X_PLL_SWITCH_CLOCK_CONTROL_UART1_CLK_SEL BIT(7) From 09eee2538ee08853b9273df249635409485ac417 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Fri, 26 Apr 2024 23:54:57 +0900 Subject: [PATCH 18/39] ath79: add missing reset de-assertion of PCIe endpoint Fix PCIe initialization by de-assertion of PCIe endpoint reset. Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/15432 Signed-off-by: Hauke Mehrtens --- ...-deassert-the-reset-of-PCIe-endpoint.patch | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 target/linux/ath79/patches-6.6/318-MIPS-pci-ar724x-deassert-the-reset-of-PCIe-endpoint.patch diff --git a/target/linux/ath79/patches-6.6/318-MIPS-pci-ar724x-deassert-the-reset-of-PCIe-endpoint.patch b/target/linux/ath79/patches-6.6/318-MIPS-pci-ar724x-deassert-the-reset-of-PCIe-endpoint.patch new file mode 100644 index 0000000000..c906bdbbb6 --- /dev/null +++ b/target/linux/ath79/patches-6.6/318-MIPS-pci-ar724x-deassert-the-reset-of-PCIe-endpoint.patch @@ -0,0 +1,41 @@ +From 859c93981a8994ffa69967b44b247d2e7d6a01f1 Mon Sep 17 00:00:00 2001 +From: INAGAKI Hiroshi +Date: Fri, 26 Apr 2024 23:54:57 +0900 +Subject: [PATCH 2/2] MIPS: pci-ar724x: deassert the reset of PCIe endpoint + +Fix PCIe initialization by de-assertion of PCIe endpoint reset. + +Signed-off-by: INAGAKI Hiroshi +--- + +--- a/arch/mips/pci/pci-ar724x.c ++++ b/arch/mips/pci/pci-ar724x.c +@@ -25,6 +25,7 @@ + + #define AR724X_PCI_APP_LTSSM_ENABLE BIT(0) + ++#define AR724X_PCI_RESET_EP_RESET_L BIT(2) + #define AR724X_PCI_RESET_LINK_UP BIT(0) + + #define AR724X_PCI_INT_DEV0 BIT(14) +@@ -340,7 +341,7 @@ static void ar724x_pci_irq_init(struct a + + static void ar724x_pci_hw_init(struct ar724x_pci_controller *apc) + { +- u32 ppl, app; ++ u32 ppl, rst, app; + int wait = 0; + + /* deassert PCIe host controller and PCIe PHY reset */ +@@ -370,6 +371,11 @@ static void ar724x_pci_hw_init(struct ar + ath79_pll_wr(AR724X_PLL_REG_PCIE_CONFIG, ppl); + } + ++ /* deassert the reset state of the PCIE endpoint */ ++ rst = __raw_readl(apc->ctrl_base + AR724X_PCI_REG_RESET); ++ rst |= AR724X_PCI_RESET_EP_RESET_L; ++ __raw_writel(rst, apc->ctrl_base + AR724X_PCI_REG_RESET); ++ + /* set PCIE Application Control to ready */ + app = __raw_readl(apc->ctrl_base + AR724X_PCI_REG_APP); + app |= AR724X_PCI_APP_LTSSM_ENABLE; From 7e37a457d4849a5598e474bbaaba4552b1a96b8f Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Thu, 25 Apr 2024 01:08:41 +0900 Subject: [PATCH 19/39] ath79: add support for NEC Aterm WR8750N MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NEC Aterm WR8750N is a 2.4/5 GHz band 11n (Wi-Fi 4) router, based on AR9344. Specification: - SoC : Atheros AR9344 - RAM : DDR2 128 MiB (2x Hynix H5PS5162GFR-S6C) - Flash : SPI-NOR 8 MiB (Macronix MX25L6406EMI-12G) - WLAN : 2.4/5 GHz 2T2R - 2.4 GHz : Atheros AR9344 (SoC) - 5 GHz : Atheros AR9382 - Ethernet : 5x 10/100/1000 Mbps - switch : Atheros AR8327 - LEDs/Keys (GPIO): 10x/4x - note : all LEDs are controlled by ath9k chip (AR9382) - UART : through-hole on PCB - assignment : 3.3V, GND, NC, TX, RX from tri-angle marking - settings : 9600n8 - USB : 1x USB 2.0 Type-A - hub (internal): NEC uPD720114 - Power : 12 VDC, 1.5 A (Max. 16 W) - Stock OS : NetBSD based Flash instruction using initramfs-factory.bin image (StockFW WebUI): 1. Boot WR8750N with router mode normally 2. Access to the WebUI ("http://aterm.me/" or "http://192.168.0.1/") on the device and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt initramfs-factory.bin image and click update ("更新") button 4. After updating, the device will be rebooted and booted with OpenWrt initramfs image 5. On the initramfs image, upload (or download) uboot.bin and sysupgrade.bin image to the device 6. Replace the bootloader with a uboot.bin image mtd write bootloader 7. Perform sysupgrade with a sysupgrade.bin image sysupgrade 8. Wait ~120 seconds to complete flashing Flash instruction using initramfs-factory.bin image (bootloader CLI): 1. Connect and open serial console 2. Power on WR8750N and interrupt bootloader by ESC key 3. Login to the bootloader CLI with a password "chiron" 4. Start TFTP server by "tftpd" command 5. Upload initramfs-factory.bin via tftp from your computer example (Windows): tftp -i 192.168.0.1 PUT initramfs-factory.bin 6. Boot initramfs image by "boot" command 7. On the initramfs image, back up the stock bootloader and firmware if needed 8. Upload (or download) uboot.bin and sysupgrade.bin image to the device 9. Replace the bootloader with a uboot.bin image 10. Perform sysupgrade with a sysupgrade.bin image 11. Wait ~120 seconds to complete flashing Notes: - All LEDs are connected to the GPIO controller on the ath9k chip (AR9382) and controlled by it. Those LEDs are probed after probing of ath9k chip, so they cannot be handled as status LEDs of OpenWrt while booting. - A reset pin of the internal USB hub is connected to the GPIO controller of the ath9k chip, like LEDs above. That hub will be detected after probing of the ath9k chip. - The stock bootloader requires an unknown filesystem on firmware area in the flash. Booting of OpenWrt from that filesystem cannot be handled, so the bootloader needs to be replaced to mainline U-Boot before OpenWrt installation. MAC Addresses: LAN : 1C:B1:7F:xx:xx:00 (config, 0x6 (hex)) WAN : 1C:B1:7F:xx:xx:01 (config, 0xc (hex)) 2.4 GHz: 1C:B1:7F:xx:xx:02 (config, 0x0 (hex) / art, 0x1002 (hex)) 5 GHz : 1C:B1:7F:xx:xx:03 (config, 0x12 (hex) / art, 0x5002 (hex)) Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/15432 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/ar9344_nec_aterm.dtsi | 300 ++++++++++++++++++ target/linux/ath79/dts/ar9344_nec_wr8750n.dts | 16 + target/linux/ath79/image/common-nec.mk | 25 ++ .../linux/ath79/image/lzma-loader/src/board.c | 65 ++++ target/linux/ath79/image/tiny.mk | 11 + .../tiny/base-files/etc/board.d/02_network | 13 +- .../tiny/base-files/lib/upgrade/platform.sh | 16 +- 7 files changed, 441 insertions(+), 5 deletions(-) create mode 100644 target/linux/ath79/dts/ar9344_nec_aterm.dtsi create mode 100644 target/linux/ath79/dts/ar9344_nec_wr8750n.dts create mode 100644 target/linux/ath79/image/common-nec.mk diff --git a/target/linux/ath79/dts/ar9344_nec_aterm.dtsi b/target/linux/ath79/dts/ar9344_nec_aterm.dtsi new file mode 100644 index 0000000000..dfe2b064b7 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_nec_aterm.dtsi @@ -0,0 +1,300 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include +#include + +#include "ar9344.dtsi" + +/ { + aliases { + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + /* + * don't specify bootargs property in DeviceTree to + * enable a console with a default baudrate (9600) + * or passed console= parameter from the bootloader + */ + /delete-property/ bootargs; + stdout-path = &uart; + }; + + keys: keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + button-eco { + label = "eco"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + switch-ap { + label = "ap"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + button-reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + button-wps { + label = "wps"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + ath9k_leds: ath9k-leds { + /* all LEDs are connected to ath9k chip (AR938x) */ + compatible = "gpio-leds"; + + led_power_green: led-0 { + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_POWER; + default-state = "on"; + }; + + led-1 { + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_POWER; + }; + + led-2 { + gpios = <&ath9k 2 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WAN_ONLINE; + }; + + led-3 { + gpios = <&ath9k 3 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WAN_ONLINE; + }; + + led-4 { + gpios = <&ath9k 4 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + linux,default-trigger = "phy0tpt"; + }; + + led-5 { + gpios = <&ath9k 5 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + }; + + led-6 { + gpios = <&ath9k 6 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + linux,default-trigger = "phy1tpt"; + }; + + led-7 { + gpios = <&ath9k 7 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + }; + + led-8 { + gpios = <&ath9k 12 GPIO_ACTIVE_LOW>; + color = ; + function = "tv"; + }; + + led-9 { + gpios = <&ath9k 13 GPIO_ACTIVE_LOW>; + color = ; + function = "tv"; + }; + }; + + regulator { + compatible = "regulator-fixed"; + regulator-name = "usb-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 20 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * since the OEM bootloader requires unknown + * filesystem on firmware area, needs to be + * replaced to u-boot before OpenWrt installation + */ + partition@0 { + label = "bootloader"; + reg = <0x000000 0x020000>; + }; + + /* not compatible with u-boot */ + partition@20000 { + label = "config"; + reg = <0x020000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + }; + + partition@30000 { + label = "art"; + reg = <0x030000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; + }; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07a00000 /* PORT0_PAD_MODE_CTRL */ + 0x08 0x00000000 /* PORT5_PAD_MODE_CTRL */ + 0x0c 0x00000000 /* PORT6_PAD_MODE_CTRL */ + 0x10 0x81000080 /* POWER_ON_STRAP */ + 0x50 0xcf37cf37 /* LED_CTRL0 */ + 0x54 0x00000000 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x06000000 0x00000101 0x00001616>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; + + nvmem-cells = <&macaddr_config_6>; + nvmem-cell-names = "mac-address"; + + gmac-config { + device = <&gmac>; + + rgmii-gmac0 = <1>; + rxdv-delay = <0>; + rxd-delay = <0>; + txd-delay = <0>; + txen-delay = <0>; + }; +}; + +&gpio { + switch-reset { + gpio-hog; + gpios = <13 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0030"; + reg = <0x0000 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + + nvmem-cells = <&cal_art_5000>; + nvmem-cell-names = "calibration"; + + usb-hub-reset { + gpio-hog; + gpios = <10 GPIO_ACTIVE_HIGH>; + output-high; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + dr_mode = "host"; + + /delete-node/ port@1; + + /* NEC uPD720114 */ + hub@1 { + compatible = "usb0409,005a"; + reg = <1>; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; +}; diff --git a/target/linux/ath79/dts/ar9344_nec_wr8750n.dts b/target/linux/ath79/dts/ar9344_nec_wr8750n.dts new file mode 100644 index 0000000000..47e49dddc5 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_nec_wr8750n.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_nec_aterm.dtsi" + +/ { + compatible = "nec,wr8750n", "qca,ar9344"; + model = "NEC Aterm WR8750N"; +}; + +&partitions { + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0x7c0000>; + }; +}; diff --git a/target/linux/ath79/image/common-nec.mk b/target/linux/ath79/image/common-nec.mk new file mode 100644 index 0000000000..7981a72d8e --- /dev/null +++ b/target/linux/ath79/image/common-nec.mk @@ -0,0 +1,25 @@ +DEVICE_VARS += NEC_FW_TYPE + +define Build/nec-usbaterm-fw + $(STAGING_DIR_HOST)/bin/nec-usbatermfw $@.new -t $(NEC_FW_TYPE) $(1) + mv $@.new $@ +endef + +define Device/nec-netbsd-aterm + DEVICE_VENDOR := NEC + LOADER_TYPE := bin + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | uImage none + ARTIFACTS := uboot.bin +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + COMPILE := loader-$(1).bin + COMPILE/loader-$(1).bin := loader-okli-compile + ARTIFACTS += initramfs-factory.bin + ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ + pad-to 4 skip=16 | \ + nec-usbaterm-fw -f 0x0003 -d $$(KDIR)/loader-$(1).bin -d $$$$@ | check-size +endif + UBOOT_PATH := $$(STAGING_DIR_IMAGE)/$$(SOC)_nec_aterm-u-boot.bin + ARTIFACT/uboot.bin := append-uboot | check-size 128k + DEVICE_PACKAGES := kmod-usb2 -uboot-envtools +endef diff --git a/target/linux/ath79/image/lzma-loader/src/board.c b/target/linux/ath79/image/lzma-loader/src/board.c index 04aa348b1f..04e13ea31f 100644 --- a/target/linux/ath79/image/lzma-loader/src/board.c +++ b/target/linux/ath79/image/lzma-loader/src/board.c @@ -213,9 +213,74 @@ static inline void huawei_ap_init(void) static inline void huawei_ap_init(void) {} #endif +#if defined(CONFIG_BOARD_NEC_WR8750N) + +#define AR934X_PLL_SWITCH_CLK_CTRL_REG 0x24 +#define AR934X_PLL_SWITCH_CLK_CTRL_SWITCHCLK_SEL BIT(0) + +static inline void nec_aterm_init(void) +{ + unsigned int reg, val; + + printf("NEC Aterm series (AR9344)\n"); + + /* set REFCLK=40MHz to switch PLL */ + reg = KSEG1ADDR(AR71XX_PLL_BASE); + val = READREG(reg + AR934X_PLL_SWITCH_CLK_CTRL_REG); + val &= ~AR934X_PLL_SWITCH_CLK_CTRL_SWITCHCLK_SEL; + WRITEREG(reg + AR934X_PLL_SWITCH_CLK_CTRL_REG, val); + + reg = KSEG1ADDR(AR71XX_RESET_BASE); +#ifndef LOADADDR + /* + * This is for initramfs-factory image. + * When the system was reset by power source or FULL_CHIP_RESET + * and started from the OEM bootloader with a dummy tp data + * (this loader), reset again by timeout of the watchdog timer + * to load an actual OpenWrt initramfs image in firmware block + * in a factory image. + * Note: On the stock firmware, TP block contains a POST function + * and sub commands of "tp" command. + * + * Behaviors of OEM bootloader: + * + * - reset by watchdog (ex.: rebooting on the stock firmware): + * called as "SOFT-RESET", boot a firmware without POST + * + * - reset by FULL_CHIP_RESET (or powering on): + * called as "HARD-RESET", run POST and boot a firmware + */ + printf("\n## booted with dummy tp (lzma-loader)," + " waiting reset... (count: 0x%08x) ##\n", + READREG(reg + AR71XX_RESET_REG_WDOG)); + while (1); +#endif + /* + * set maximum watchdog count to avoid reset while + * booting from stock bootloader + */ + WRITEREG(reg + AR71XX_RESET_REG_WDOG, 0xffffffff); + + /* + * deassert some RESET bits not handled by drivers + * and mainline U-Boot + * + * - ETH_SWITCH(_ANALOG): eth0 + * - RTC : wmac + */ + val = READREG(reg + AR934X_RESET_REG_RESET_MODULE); + val &= ~(AR934X_RESET_ETH_SWITCH | AR934X_RESET_ETH_SWITCH_ANALOG | + AR934X_RESET_RTC); + WRITEREG(reg + AR934X_RESET_REG_RESET_MODULE, val); +} +#else +static inline void nec_aterm_init(void) {} +#endif + void board_init(void) { tlwr1043nd_init(); mr18_init(); huawei_ap_init(); + nec_aterm_init(); } diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index 955d0fbff2..454bb63dab 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -1,4 +1,5 @@ include ./common-buffalo.mk +include ./common-nec.mk include ./common-senao.mk define Device/buffalo_whr-g301n @@ -120,6 +121,16 @@ define Device/engenius_enh202-v1 endef TARGET_DEVICES += engenius_enh202-v1 +define Device/nec_wr8750n + SOC := ar9344 + DEVICE_MODEL := Aterm WR8750N + BLOCKSIZE := 4k + IMAGE_SIZE := 7936k + NEC_FW_TYPE := H033a + $(Device/nec-netbsd-aterm) +endef +TARGET_DEVICES += nec_wr8750n + define Device/pqi_air-pen SOC := ar9330 DEVICE_VENDOR := PQI diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/02_network b/target/linux/ath79/tiny/base-files/etc/board.d/02_network index fa2ea3aa6f..6f0f988309 100644 --- a/target/linux/ath79/tiny/base-files/etc/board.d/02_network +++ b/target/linux/ath79/tiny/base-files/etc/board.d/02_network @@ -69,6 +69,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "4:lan:1" ;; + nec,wr8750n|\ + tplink,tl-wr941n-v7-cn) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" + ;; tplink,tl-mr3220-v1|\ tplink,tl-mr3420-v1|\ tplink,tl-mr3420-v3|\ @@ -105,10 +110,6 @@ ath79_setup_interfaces() tplink,tl-wr941-v2) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; - tplink,tl-wr941n-v7-cn) - ucidef_add_switch "switch0" \ - "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" - ;; ubnt,airrouter) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ @@ -152,6 +153,10 @@ ath79_setup_macs() ubnt,picostation-m) label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) ;; + nec,wr8750n) + wan_mac=$(mtd_get_mac_binary config 0xc) + label_mac=$wan_mac + ;; tplink,tl-wr941-v2|\ tplink,tl-wr941n-v7-cn) base_mac=$(mtd_get_mac_binary u-boot 0x1fc00) diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh index eb8441c6d2..6b0ffd4046 100644 --- a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh @@ -9,7 +9,21 @@ RAMFS_COPY_BIN='fw_setenv' RAMFS_COPY_DATA='/etc/fw_env.config' platform_check_image() { - return 0 + local board=$(board_name) + + case "$board" in + nec,wr8750n) + local uboot_mtd=$(find_mtd_part "bootloader") + + # check "U-Boot ." string in the "bootloader" partition + if ! grep -q "U-Boot [0-9]\{4\}\.[0-9]\{2\}" $uboot_mtd; then + v "The bootloader doesn't seem to be replaced to U-Boot!" + return 1 + fi + ;; + *) + return 0 + esac } platform_do_upgrade() { From bafd1aa18349e0c67dae1ca0c66fccb5c23e32db Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Thu, 25 Apr 2024 01:08:41 +0900 Subject: [PATCH 20/39] ath79: add support for NEC Aterm WR9500N MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NEC Aterm WR9500N is a 2.4/5 GHz band 11n (Wi-Fi 4) router, based on AR9344. Specification: - SoC : Atheros AR9344 - RAM : DDR2 128 MiB (2x Nanya NT5TU32M16DG-AC) - Flash : SPI-NOR 16 MiB (Macronix MX25L12845EMI-10G) - WLAN : 2.4/5 GHz - 2.4 GHz : 2T2R, Atheros AR9344 (SoC) - 5 GHz : 3T3R, Atheros AR9380 - Ethernet : 5x 10/100/1000 Mbps - switch : Atheros AR8327 - LEDs/Keys (GPIO): 12x/4x - note : all LEDs are controlled by ath9k chip (AR9380) - UART : pad on PCB (near shielded ath9k chip, white circle) - assignment : 3.3V, GND, TX, RX from AR8327 side - settings : 9600n8 - USB : 1x USB 2.0 Type-A - hub (internal): NEC uPD720114 - Power : 12 VDC, 1.5 A (Max. 17 W) - Stock OS : NetBSD based Flash instruction using initramfs-factory.bin image (StockFW WebUI): 1. Boot WR9500N with router mode normally 2. Access to the WebUI ("http://aterm.me/" or "http://192.168.0.1/") on the device and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt initramfs-factory.bin image and click update ("更新") button 4. After updating, the device will be rebooted and booted with OpenWrt initramfs image 5. On the initramfs image, upload (or download) uboot.bin and sysupgrade.bin image to the device 6. Replace the bootloader with a uboot.bin image mtd write bootloader 7. Perform sysupgrade with a sysupgrade.bin image sysupgrade 8. Wait ~120 seconds to complete flashing Flash instruction using initramfs-factory.bin image (bootloader CLI): 1. Connect and open serial console 2. Power on WR9500N and interrupt bootloader by ESC key 3. Login to the bootloader CLI with a password "chiron" 4. Start TFTP server by "tftpd" command 5. Upload initramfs-factory.bin via tftp from your computer example (Windows): tftp -i 192.168.0.1 PUT initramfs-factory.bin 6. Boot initramfs image by "boot" command 7. On the initramfs image, back up the stock bootloader and firmware if needed 8. Upload (or download) uboot.bin and sysupgrade.bin image to the device 9. Replace the bootloader with a uboot.bin image 10. Perform sysupgrade with a sysupgrade.bin image 11. Wait ~120 seconds to complete flashing Notes: - All LEDs are connected to the GPIO controller on the ath9k chip (AR9380) and controlled by it. Those LEDs are probed after probing of ath9k chip, so they cannot be handled as status LEDs of OpenWrt while booting. - A reset pin of the internal USB hub is connected to the GPIO controller of the ath9k chip, like LEDs above. That hub will be detected after probing of the ath9k chip. - The stock bootloader requires an unknown filesystem on firmware area in the flash. Booting of OpenWrt from that filesystem cannot be handled, so the bootloader needs to be replaced to mainline U-Boot before OpenWrt installation. MAC Addresses: LAN : 1C:B1:7F:xx:xx:60 (config, 0x6 (hex)) WAN : 1C:B1:7F:xx:xx:61 (config, 0xc (hex)) 2.4 GHz: 1C:B1:7F:xx:xx:62 (config, 0x0 (hex) / art, 0x1002 (hex)) 5 GHz : 1C:B1:7F:xx:xx:63 (config, 0x12 (hex) / art, 0x5002 (hex)) Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/15432 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/ar9344_nec_wr9500n.dts | 39 +++++++++++++++++++ .../linux/ath79/image/lzma-loader/src/board.c | 3 +- target/linux/ath79/image/tiny.mk | 10 +++++ .../tiny/base-files/etc/board.d/02_network | 4 +- .../tiny/base-files/lib/upgrade/platform.sh | 3 +- 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/ar9344_nec_wr9500n.dts diff --git a/target/linux/ath79/dts/ar9344_nec_wr9500n.dts b/target/linux/ath79/dts/ar9344_nec_wr9500n.dts new file mode 100644 index 0000000000..1919e09829 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_nec_wr9500n.dts @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_nec_aterm.dtsi" + +/ { + compatible = "nec,wr9500n", "qca,ar9344"; + model = "NEC Aterm WR9500N"; +}; + +&keys { + switch-converter { + label = "cnv"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; +}; + +&ath9k_leds { + led-10 { + gpios = <&ath9k 14 GPIO_ACTIVE_LOW>; + color = ; + function = "converter"; + }; + + led-11 { + gpios = <&ath9k 15 GPIO_ACTIVE_LOW>; + color = ; + function = "converter"; + }; +}; + +&partitions { + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0xfc0000>; + }; +}; diff --git a/target/linux/ath79/image/lzma-loader/src/board.c b/target/linux/ath79/image/lzma-loader/src/board.c index 04e13ea31f..c38dc14558 100644 --- a/target/linux/ath79/image/lzma-loader/src/board.c +++ b/target/linux/ath79/image/lzma-loader/src/board.c @@ -213,7 +213,8 @@ static inline void huawei_ap_init(void) static inline void huawei_ap_init(void) {} #endif -#if defined(CONFIG_BOARD_NEC_WR8750N) +#if defined(CONFIG_BOARD_NEC_WR8750N) || \ + defined(CONFIG_BOARD_NEC_WR9500N) #define AR934X_PLL_SWITCH_CLK_CTRL_REG 0x24 #define AR934X_PLL_SWITCH_CLK_CTRL_SWITCHCLK_SEL BIT(0) diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index 454bb63dab..d80ffa9400 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -131,6 +131,16 @@ define Device/nec_wr8750n endef TARGET_DEVICES += nec_wr8750n +define Device/nec_wr9500n + SOC := ar9344 + DEVICE_MODEL := Aterm WR9500N + BLOCKSIZE := 4k + IMAGE_SIZE := 16128k + NEC_FW_TYPE := H033 + $(Device/nec-netbsd-aterm) +endef +TARGET_DEVICES += nec_wr9500n + define Device/pqi_air-pen SOC := ar9330 DEVICE_VENDOR := PQI diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/02_network b/target/linux/ath79/tiny/base-files/etc/board.d/02_network index 6f0f988309..e11c37453e 100644 --- a/target/linux/ath79/tiny/base-files/etc/board.d/02_network +++ b/target/linux/ath79/tiny/base-files/etc/board.d/02_network @@ -70,6 +70,7 @@ ath79_setup_interfaces() "0@eth1" "4:lan:1" ;; nec,wr8750n|\ + nec,wr9500n|\ tplink,tl-wr941n-v7-cn) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" @@ -153,7 +154,8 @@ ath79_setup_macs() ubnt,picostation-m) label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) ;; - nec,wr8750n) + nec,wr8750n|\ + nec,wr9500n) wan_mac=$(mtd_get_mac_binary config 0xc) label_mac=$wan_mac ;; diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh index 6b0ffd4046..19ddd29a1d 100644 --- a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh @@ -12,7 +12,8 @@ platform_check_image() { local board=$(board_name) case "$board" in - nec,wr8750n) + nec,wr8750n|\ + nec,wr9500n) local uboot_mtd=$(find_mtd_part "bootloader") # check "U-Boot ." string in the "bootloader" partition From ba723a3f6c1a8d3c39d85cd57eae2daa8c896b15 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Thu, 25 Apr 2024 01:08:41 +0900 Subject: [PATCH 21/39] ath79: add support for NEC Aterm WG600HP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NEC Aterm WG600HP is a 2.4/5 GHz band 11n (Wi-Fi 4) router, based on AR9344. Specification: - SoC : Atheros AR9344 - RAM : DDR2 128 MiB (2x Hynix H5PS5162GFR-S6C) - Flash : SPI-NOR 8 MiB (Macronix MX25L6406EMI-12G) - WLAN : 2.4/5 GHz 2T2R - 2.4 GHz : Atheros AR9344 (SoC) - 5 GHz : Atheros AR9382 - Ethernet : 5x 10/100/1000 Mbps - switch : Atheros AR8327 - LEDs/Keys (GPIO): 10x/4x - note : all LEDs are controlled by ath9k chip (AR9382) - UART : through-hole on PCB - assignment : 3.3V, GND, NC, TX, RX from tri-angle marking - settings : 9600n8 - USB : 1x USB 2.0 Type-A - hub (internal): NEC uPD720114 - Power : 12 VDC, 1.5 A (Max. 16 W) - Stock OS : NetBSD based Flash instruction using initramfs-factory.bin image (StockFW WebUI): 1. Boot WG600HP with router mode normally 2. Access to the WebUI ("http://aterm.me/" or "http://192.168.0.1/") on the device and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt initramfs-factory.bin image and click update ("更新") button 4. After updating, the device will be rebooted and booted with OpenWrt initramfs image 5. On the initramfs image, upload (or download) uboot.bin and sysupgrade.bin image to the device 6. Replace the bootloader with a uboot.bin image mtd write bootloader 7. Perform sysupgrade with a sysupgrade.bin image sysupgrade 8. Wait ~120 seconds to complete flashing Flash instruction using initramfs-factory.bin image (bootloader CLI): 1. Connect and open serial console 2. Power on WG600HP and interrupt bootloader by ESC key 3. Login to the bootloader CLI with a password "chiron" 4. Start TFTP server by "tftpd" command 5. Upload initramfs-factory.bin via tftp from your computer example (Windows): tftp -i 192.168.0.1 PUT initramfs-factory.bin 6. Boot initramfs image by "boot" command 7. On the initramfs image, back up the stock bootloader and firmware if needed 8. Upload (or download) uboot.bin and sysupgrade.bin image to the device 9. Replace the bootloader with a uboot.bin image 10. Perform sysupgrade with a sysupgrade.bin image 11. Wait ~120 seconds to complete flashing Notes: - All LEDs are connected to the GPIO controller on the ath9k chip (AR9382) and controlled by it. Those LEDs are probed after probing of ath9k chip, so they cannot be handled as status LEDs of OpenWrt while booting. - A reset pin of the internal USB hub is connected to the GPIO controller of the ath9k chip, like LEDs above. That hub will be detected after probing of the ath9k chip. - The stock bootloader requires an unknown filesystem on firmware area in the flash. Booting of OpenWrt from that filesystem cannot be handled, so the bootloader needs to be replaced to mainline U-Boot before OpenWrt installation. MAC Addresses: LAN : A4:12:42:xx:xx:A0 (config, 0x6 (hex)) WAN : A4:12:42:xx:xx:A1 (config, 0xc (hex)) 2.4 GHz: A4:12:42:xx:xx:A2 (config, 0x0 (hex) / art, 0x1002 (hex)) 5 GHz : A4:12:42:xx:xx:A3 (config, 0x12 (hex) / art, 0x5002 (hex)) Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/15432 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/ar9344_nec_wg600hp.dts | 16 ++++++++++++++++ target/linux/ath79/image/lzma-loader/src/board.c | 3 ++- target/linux/ath79/image/tiny.mk | 10 ++++++++++ .../ath79/tiny/base-files/etc/board.d/02_network | 2 ++ .../tiny/base-files/lib/upgrade/platform.sh | 1 + 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar9344_nec_wg600hp.dts diff --git a/target/linux/ath79/dts/ar9344_nec_wg600hp.dts b/target/linux/ath79/dts/ar9344_nec_wg600hp.dts new file mode 100644 index 0000000000..e586dce7ca --- /dev/null +++ b/target/linux/ath79/dts/ar9344_nec_wg600hp.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_nec_aterm.dtsi" + +/ { + compatible = "nec,wg600hp", "qca,ar9344"; + model = "NEC Aterm WG600HP"; +}; + +&partitions { + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0x7c0000>; + }; +}; diff --git a/target/linux/ath79/image/lzma-loader/src/board.c b/target/linux/ath79/image/lzma-loader/src/board.c index c38dc14558..0d92f3174b 100644 --- a/target/linux/ath79/image/lzma-loader/src/board.c +++ b/target/linux/ath79/image/lzma-loader/src/board.c @@ -213,7 +213,8 @@ static inline void huawei_ap_init(void) static inline void huawei_ap_init(void) {} #endif -#if defined(CONFIG_BOARD_NEC_WR8750N) || \ +#if defined(CONFIG_BOARD_NEC_WG600HP) || \ + defined(CONFIG_BOARD_NEC_WR8750N) || \ defined(CONFIG_BOARD_NEC_WR9500N) #define AR934X_PLL_SWITCH_CLK_CTRL_REG 0x24 diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index d80ffa9400..53111119d8 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -121,6 +121,16 @@ define Device/engenius_enh202-v1 endef TARGET_DEVICES += engenius_enh202-v1 +define Device/nec_wg600hp + DEVICE_MODEL := Aterm WG600HP + SOC := ar9344 + BLOCKSIZE := 4k + IMAGE_SIZE := 7936k + NEC_FW_TYPE := H044 + $(Device/nec-netbsd-aterm) +endef +TARGET_DEVICES += nec_wg600hp + define Device/nec_wr8750n SOC := ar9344 DEVICE_MODEL := Aterm WR8750N diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/02_network b/target/linux/ath79/tiny/base-files/etc/board.d/02_network index e11c37453e..a204e820ca 100644 --- a/target/linux/ath79/tiny/base-files/etc/board.d/02_network +++ b/target/linux/ath79/tiny/base-files/etc/board.d/02_network @@ -69,6 +69,7 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "4:lan:1" ;; + nec,wg600hp|\ nec,wr8750n|\ nec,wr9500n|\ tplink,tl-wr941n-v7-cn) @@ -154,6 +155,7 @@ ath79_setup_macs() ubnt,picostation-m) label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) ;; + nec,wg600hp|\ nec,wr8750n|\ nec,wr9500n) wan_mac=$(mtd_get_mac_binary config 0xc) diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh index 19ddd29a1d..8fc0efcfbd 100644 --- a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh @@ -12,6 +12,7 @@ platform_check_image() { local board=$(board_name) case "$board" in + nec,wg600hp|\ nec,wr8750n|\ nec,wr9500n) local uboot_mtd=$(find_mtd_part "bootloader") From c5a5c44d0c1bcbca4c42cd83793e9f2a825a4b2a Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 28 Jul 2024 14:49:44 +0200 Subject: [PATCH 22/39] archs38: use kernel 6.6 by default Switch to Linux kernel version 6.6. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16021 Signed-off-by: Robert Marko --- target/linux/archs38/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/archs38/Makefile b/target/linux/archs38/Makefile index 7de2684eb7..0b3feb9889 100644 --- a/target/linux/archs38/Makefile +++ b/target/linux/archs38/Makefile @@ -11,8 +11,7 @@ BOARDNAME:=Synopsys DesignWare ARC HS38 FEATURES:=source-only SUBTARGETS:=generic -KERNEL_PATCHVER:=6.1 -KERNEL_TESTING_PATCHVER:=6.6 +KERNEL_PATCHVER:=6.6 DEVICE_TYPE:=basic From 865f62ff61d0f62691b6228973a4713c95c33757 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 28 Jul 2024 14:50:41 +0200 Subject: [PATCH 23/39] archs38: drop 6.1 support Drop config for Linux 6.1. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/16021 Signed-off-by: Robert Marko --- target/linux/archs38/config-6.1 | 268 -------------------------------- 1 file changed, 268 deletions(-) delete mode 100644 target/linux/archs38/config-6.1 diff --git a/target/linux/archs38/config-6.1 b/target/linux/archs38/config-6.1 deleted file mode 100644 index 9fe6ba2932..0000000000 --- a/target/linux/archs38/config-6.1 +++ /dev/null @@ -1,268 +0,0 @@ -# CONFIG_16KSTACKS is not set -CONFIG_ARC=y -CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARC_BUILTIN_DTB_NAME="" -CONFIG_ARC_CACHE=y -CONFIG_ARC_CACHE_LINE_SHIFT=6 -CONFIG_ARC_CACHE_PAGES=y -CONFIG_ARC_CPU_HS=y -CONFIG_ARC_CURR_IN_REG=y -CONFIG_ARC_DBG=y -# CONFIG_ARC_DSP_AGU_USERSPACE is not set -# CONFIG_ARC_DSP_KERNEL is not set -CONFIG_ARC_DSP_NONE=y -# CONFIG_ARC_DSP_USERSPACE is not set -CONFIG_ARC_DW2_UNWIND=y -CONFIG_ARC_FPU_SAVE_RESTORE=y -CONFIG_ARC_HAS_ACCL_REGS=y -CONFIG_ARC_HAS_DCACHE=y -# CONFIG_ARC_HAS_DCCM is not set -CONFIG_ARC_HAS_DIV_REM=y -CONFIG_ARC_HAS_ICACHE=y -# CONFIG_ARC_HAS_ICCM is not set -CONFIG_ARC_HAS_LL64=y -CONFIG_ARC_HAS_LLSC=y -# CONFIG_ARC_HAS_PAE40 is not set -CONFIG_ARC_HAS_SWAPE=y -CONFIG_ARC_IRQ_NO_AUTOSAVE=y -CONFIG_ARC_KVADDR_SIZE=256 -# CONFIG_ARC_LPB_DISABLE is not set -CONFIG_ARC_MCIP=y -# CONFIG_ARC_METAWARE_HLINK is not set -CONFIG_ARC_MMU_V4=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set -CONFIG_ARC_PAGE_SIZE_8K=y -CONFIG_ARC_PLAT_AXS10X=y -# CONFIG_ARC_PLAT_TB10X is not set -# CONFIG_ARC_SMP_HALT_ON_RESET is not set -CONFIG_ARC_SOC_HSDK=y -CONFIG_ARC_TIMERS=y -CONFIG_ARC_TIMERS_64BIT=y -CONFIG_ARC_TUNE_MCPU="" -CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS=y -CONFIG_AXS103=y -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 -CONFIG_BLK_DEV_SD=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 -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_CONTEXT_TRACKING=y -CONFIG_CONTEXT_TRACKING_IDLE=y -CONFIG_CPU_RMAP=y -CONFIG_CRC16=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1 -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_SHA256=y -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_DEBUG_INFO=y -CONFIG_DMADEVICES=y -CONFIG_DMA_DIRECT_REMAP=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DTC=y -CONFIG_DWMAC_ANARION=y -CONFIG_DWMAC_GENERIC=y -CONFIG_DW_APB_ICTL=y -CONFIG_DW_AXI_DMAC=y -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_EXT4_FS=y -CONFIG_FAT_FS=y -CONFIG_FB=y -CONFIG_FB_CMDLINE=y -CONFIG_FIXED_PHY=y -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=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_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PENDING_IRQ=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_DWAPB=y -CONFIG_GPIO_GENERIC=y -CONFIG_GPIO_SNPS_CREG=y -CONFIG_GRACE_PERIOD=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HZ_PERIODIC=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_IIO=y -CONFIG_IIO_BUFFER=y -CONFIG_IIO_KFIFO_BUF=y -CONFIG_IIO_ST_PRESS=y -CONFIG_IIO_ST_PRESS_I2C=y -CONFIG_IIO_ST_PRESS_SPI=y -CONFIG_IIO_ST_SENSORS_CORE=y -CONFIG_IIO_ST_SENSORS_I2C=y -CONFIG_IIO_ST_SENSORS_SPI=y -CONFIG_IIO_TRIGGER=y -CONFIG_IIO_TRIGGERED_BUFFER=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_WORK=y -# CONFIG_ISA_ARCOMPACT is not set -CONFIG_ISA_ARCV2=y -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -CONFIG_KERNEL_GZIP=y -CONFIG_LIBFDT=y -CONFIG_LINUX_LINK_BASE=0x90000000 -CONFIG_LINUX_RAM_BASE=0x80000000 -CONFIG_LOCKD=y -CONFIG_LOCKUP_DETECTOR=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MEMFD_CREATE=y -CONFIG_MFD_SYSCON=y -CONFIG_MICREL_PHY=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_DW=y -# CONFIG_MMC_DW_BLUEFIELD is not set -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_HI3798CV200 is not set -# CONFIG_MMC_DW_K3 is not set -CONFIG_MMC_DW_PLTFM=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MTD_SPI_NOR=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NAMESPACES=y -CONFIG_NATIONAL_PHY=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_NS=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_SELFTESTS=y -CONFIG_NFS_ACL_SUPPORT=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3_ACL=y -CONFIG_NLS=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NO_IOPORT_MAP=y -CONFIG_NR_CPUS=4 -CONFIG_OF=y -CONFIG_OF_ADDRESS=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_PADATA=y -CONFIG_PAGE_POOL=y -CONFIG_PAGE_SIZE_LESS_THAN_256KB=y -CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y -CONFIG_PCS_XPCS=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PHYLIB_LEDS=y -CONFIG_PHYLINK=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPTION=y -CONFIG_PREEMPT_BUILD=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -# CONFIG_PREVENT_FIRMWARE_BUILD is not set -CONFIG_PTP_1588_CLOCK=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_RANDSTRUCT_NONE=y -CONFIG_RATIONAL=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGMAP_SPI=y -CONFIG_RESET_AXS10X=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_HSDK=y -CONFIG_RESET_SIMPLE=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_SCSI=y -CONFIG_SCSI_COMMON=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_DWLIB=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_ARC=y -CONFIG_SERIAL_ARC_CONSOLE=y -CONFIG_SERIAL_ARC_NR_PORTS=1 -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SG_POOL=y -CONFIG_SMP=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -CONFIG_SOFTLOCKUP_DETECTOR=y -CONFIG_SPI=y -CONFIG_SPI_DESIGNWARE=y -# CONFIG_SPI_DW_DMA is not set -CONFIG_SPI_DW_MMIO=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_MEM=y -CONFIG_SRCU=y -CONFIG_STACKTRACE=y -# CONFIG_STANDALONE is not set -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_SUNRPC=y -CONFIG_SWPHY=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TI_ADC108S102=y -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB_SUPPORT=y -# CONFIG_USER_NS is not set -CONFIG_VFAT_FS=y -CONFIG_WATCHDOG_CORE=y -CONFIG_XPS=y From d261be1d9e850a25fa6747a84595a8e170a029ac Mon Sep 17 00:00:00 2001 From: Aleksey Vasilenko Date: Sat, 27 Jul 2024 20:01:00 +0300 Subject: [PATCH 24/39] mwlwifi: fix mac80211 broken after update to 6.9.9 Port of kernel commit: https://github.com/torvalds/linux/commit/0a44dfc Fixes: https://github.com/openwrt/openwrt/issues/15975 Fixes: 1bfcc1e ("mac80211: update to version 6.9.9") Signed-off-by: Aleksey Vasilenko Link: https://github.com/openwrt/openwrt/pull/16016 Signed-off-by: Robert Marko --- package/kernel/mwlwifi/patches/005-mac80211_update.patch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/kernel/mwlwifi/patches/005-mac80211_update.patch b/package/kernel/mwlwifi/patches/005-mac80211_update.patch index da37875705..877053fdf1 100644 --- a/package/kernel/mwlwifi/patches/005-mac80211_update.patch +++ b/package/kernel/mwlwifi/patches/005-mac80211_update.patch @@ -428,11 +428,15 @@ const struct ieee80211_tx_queue_params *params) { struct mwl_priv *priv = hw->priv; -@@ -934,4 +934,5 @@ const struct ieee80211_ops mwl_mac80211_ +@@ -934,4 +934,9 @@ const struct ieee80211_ops mwl_mac80211_ .pre_channel_switch = mwl_mac80211_chnl_switch, .sw_scan_start = mwl_mac80211_sw_scan_start, .sw_scan_complete = mwl_mac80211_sw_scan_complete, + .wake_tx_queue = ieee80211_handle_wake_tx_queue, ++ .add_chanctx = ieee80211_emulate_add_chanctx, ++ .remove_chanctx = ieee80211_emulate_remove_chanctx, ++ .change_chanctx = ieee80211_emulate_change_chanctx, ++ .switch_vif_chanctx = ieee80211_emulate_switch_vif_chanctx, }; --- a/utils.c +++ b/utils.c From 91573ac145aa70a12b0984ec75507ac648569240 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 27 Jul 2024 19:29:04 +0200 Subject: [PATCH 25/39] ncurses: Fix path in ncursesw.pc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The file contains the the /usr/lib path from the toolchain directory and not from the target directory. The /usr/lib directory for the toolchain is empty and the shared library is not in the specified paths. On RISCV the linker of util-linux was finding the libncursesw.so in my host system, tried to link against it and failed. Fix the .pc file. Fixes: #15942 Co-authored-by: Thomas Weißschuh Signed-off-by: Hauke Mehrtens Link: https://github.com/openwrt/openwrt/pull/16018 Signed-off-by: Robert Marko --- package/libs/ncurses/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 0958051533..0fcc388840 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -181,6 +181,8 @@ define Build/InstallDev $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' -e 's/$$$$INCS //g' \ $(2)/bin/ncursesw6-config ln -sf $(STAGING_DIR)/host/bin/ncursesw6-config $(1)/usr/bin/ncursesw6-config + $(SED) 's,$(TOOLCHAIN_DIR),$(STAGING_DIR),g' \ + $(1)/usr/lib/pkgconfig/ncursesw.pc endef define Host/Compile From 308630aea6da1b5618d169d6ebf208aaa249ef72 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Mon, 22 Jul 2024 20:53:47 +0200 Subject: [PATCH 26/39] octeon: ubnt-edgerouter: Disable PCIe Some devices lock up on PCIe initialization: [ 64.309697] PCIe: Port 0 in endpoint mode, skipping. [ 64.320496] PCIe: Initializing port 1 [ 64.325257] PCIe: BIST FAILED for port 1 (0xffffffffffffffff) (system hangs here) Given the ER contains no PCIe peripherals, has no way to attach any and the stock kernel doesn't have PCIe support either, just disable it. Signed-off-by: Jakob Haufe Link: https://github.com/openwrt/openwrt/pull/15992 Signed-off-by: Robert Marko --- target/linux/octeon/image/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/octeon/image/Makefile b/target/linux/octeon/image/Makefile index dcab815791..536ec5ff7c 100644 --- a/target/linux/octeon/image/Makefile +++ b/target/linux/octeon/image/Makefile @@ -42,7 +42,8 @@ define Device/itus_shield-router endef TARGET_DEVICES += itus_shield-router -ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait +# Disable PCIe on ER as it doesn't have PCIe peripherals and some devices lock up on initialization +ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait pcie_octeon.pcie_disable=1 define Device/ubnt_edgerouter DEVICE_VENDOR := Ubiquiti DEVICE_MODEL := EdgeRouter From 0bd129a5d3b298340e1f6351942a8ccc2ba6eaea Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Mon, 15 Jul 2024 08:54:22 -0600 Subject: [PATCH 27/39] build: autoconf: set ac_cv_func_setresuid=true MUSL and eglibc provide these symbols. Bind needs setresuid() to build properly in recent versions. Signed-off-by: Philip Prindeville Link: https://github.com/openwrt/openwrt/pull/15952 Signed-off-by: Hauke Mehrtens --- include/site/linux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/site/linux b/include/site/linux index b193d25c45..63fc3aa6b1 100644 --- a/include/site/linux +++ b/include/site/linux @@ -37,7 +37,7 @@ ac_cv_func_rindex=yes ac_cv_func_setlocale=yes ac_cv_func_setgrent_void=yes ac_cv_func_setpgrp_void=yes -ac_cv_func_setresuid=no +ac_cv_func_setresuid=yes ac_cv_func_setvbuf_reversed=no ac_cv_func_stat_empty_string_bug=no ac_cv_func_stat_ignores_trailing_slash=no From b8b9c79d277634e77c850fc76ed805c282e46c4b Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Sat, 27 Jul 2024 19:19:46 -0600 Subject: [PATCH 28/39] build: autoconf: Activate options for standard types These are POSIX standard types And therefore should be present in any POSIX compliant runtime. Signed-off-by: Philip Prindeville Link: https://github.com/openwrt/openwrt/pull/15952 Signed-off-by: Hauke Mehrtens --- include/site/linux | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/site/linux b/include/site/linux index 63fc3aa6b1..1dadd60bf3 100644 --- a/include/site/linux +++ b/include/site/linux @@ -66,9 +66,12 @@ ac_cv_sctp=no ac_cv_sys_restartable_syscalls=yes ac_cv_time_r_type=POSIX ac_cv_type_suseconds_t=yes +ac_cv_size_t=yes +ac_cv_ssize_t=yes ac_cv_uchar=no ac_cv_uint=yes ac_cv_uint64_t=yes +ac_cv_uintptr_t=yes ac_cv_ulong=yes ac_cv_ushort=yes ac_cv_va_copy=C99 From d2626bd2a7cb38c638504d22acc717701b02e717 Mon Sep 17 00:00:00 2001 From: John Audia Date: Fri, 26 Jul 2024 12:52:42 -0400 Subject: [PATCH 29/39] kernel: bump 6.6 to 6.6.42 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.42 Removed upstreamed: bcm27xx/patches-6.6/950-0490-input-ads7846-Add-missing-spi_device_id-strings.patch[1] All patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.42&id=528466f921aa7637bca684ce2d7d62cdb2c34013 Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/16010 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 +- ...he-abused-interrupt-map-on-pcie-node.patch | 2 +- ...o_user-and-__copy_from_user-performa.patch | 2 +- ...ware-emulation-of-deprecated-instruc.patch | 2 +- ...ce-quirks-for-Freeway-Airmouse-T3-an.patch | 2 +- ...53x-Add-ti-tca9554-compatible-string.patch | 2 +- ...ci_sync-Add-fallback-bd-address-prop.patch | 4 +- ...46-Add-missing-spi_device_id-strings.patch | 49 ------------------- .../generic/hack-6.6/253-ksmbd-config.patch | 2 +- .../generic/hack-6.6/902-debloat_proc.patch | 2 +- ...-Add-support-for-dynamic-calibration.patch | 2 +- 11 files changed, 12 insertions(+), 61 deletions(-) delete mode 100644 target/linux/bcm27xx/patches-6.6/950-0490-input-ads7846-Add-missing-spi_device_id-strings.patch diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 24fff19d3b..212c6263d5 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .41 -LINUX_KERNEL_HASH-6.6.41 = 9ec99c578158ab85d99b37791a76643d2ea4c3f72ecbef7b5eb6d60f3de032ef +LINUX_VERSION-6.6 = .42 +LINUX_KERNEL_HASH-6.6.42 = 8801c8c297d774e76044977ec3d0684399dc4e7cce347d730874ec78b774e683 diff --git a/target/linux/ath79/patches-6.6/810-ath79-ignore-the-abused-interrupt-map-on-pcie-node.patch b/target/linux/ath79/patches-6.6/810-ath79-ignore-the-abused-interrupt-map-on-pcie-node.patch index 980c265fe6..330c0d139b 100644 --- a/target/linux/ath79/patches-6.6/810-ath79-ignore-the-abused-interrupt-map-on-pcie-node.patch +++ b/target/linux/ath79/patches-6.6/810-ath79-ignore-the-abused-interrupt-map-on-pcie-node.patch @@ -22,7 +22,7 @@ Signed-off-by: Shiji Yang --- a/drivers/of/irq.c +++ b/drivers/of/irq.c -@@ -86,6 +86,8 @@ EXPORT_SYMBOL_GPL(of_irq_find_parent); +@@ -89,6 +89,8 @@ EXPORT_SYMBOL_GPL(of_irq_find_parent); * drawing board. */ static const char * const of_irq_imap_abusers[] = { diff --git a/target/linux/bcm27xx/patches-6.6/950-0103-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/bcm27xx/patches-6.6/950-0103-Improve-__copy_to_user-and-__copy_from_user-performa.patch index 2d546c7502..92fd35d936 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0103-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0103-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -99,7 +99,7 @@ Signed-off-by: Phil Elwell #endif --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h -@@ -509,6 +509,9 @@ do { \ +@@ -499,6 +499,9 @@ do { \ extern unsigned long __must_check arm_copy_from_user(void *to, const void __user *from, unsigned long n); diff --git a/target/linux/bcm27xx/patches-6.6/950-0113-ARM64-Force-hardware-emulation-of-deprecated-instruc.patch b/target/linux/bcm27xx/patches-6.6/950-0113-ARM64-Force-hardware-emulation-of-deprecated-instruc.patch index 14f92dfadd..1a84fb14b1 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0113-ARM64-Force-hardware-emulation-of-deprecated-instruc.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0113-ARM64-Force-hardware-emulation-of-deprecated-instruc.patch @@ -10,7 +10,7 @@ Subject: [PATCH 0113/1085] ARM64: Force hardware emulation of deprecated --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c -@@ -539,9 +539,14 @@ static void __init register_insn_emulati +@@ -542,9 +542,14 @@ static void __init register_insn_emulati switch (insn->status) { case INSN_DEPRECATED: diff --git a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index a64754310d..c3c3353f91 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1405,6 +1408,9 @@ +@@ -1407,6 +1410,9 @@ #define USB_VENDOR_ID_XIAOMI 0x2717 #define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014 diff --git a/target/linux/bcm27xx/patches-6.6/950-0416-gpio-pca953x-Add-ti-tca9554-compatible-string.patch b/target/linux/bcm27xx/patches-6.6/950-0416-gpio-pca953x-Add-ti-tca9554-compatible-string.patch index b9ec31caa5..aa11729b71 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0416-gpio-pca953x-Add-ti-tca9554-compatible-string.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0416-gpio-pca953x-Add-ti-tca9554-compatible-string.patch @@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c -@@ -1345,6 +1345,7 @@ static const struct of_device_id pca953x +@@ -1347,6 +1347,7 @@ static const struct of_device_id pca953x { .compatible = "ti,tca6424", .data = OF_953X(24, PCA_INT), }, { .compatible = "ti,tca9538", .data = OF_953X( 8, PCA_INT), }, { .compatible = "ti,tca9539", .data = OF_953X(16, PCA_INT), }, diff --git a/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch b/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch index 9aa16d6b25..218ad5dbe5 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch @@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c -@@ -4659,6 +4659,7 @@ static const struct { +@@ -4672,6 +4672,7 @@ static const struct { */ static int hci_dev_setup_sync(struct hci_dev *hdev) { @@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell int ret = 0; bool invalid_bdaddr; size_t i; -@@ -4687,7 +4688,8 @@ static int hci_dev_setup_sync(struct hci +@@ -4700,7 +4701,8 @@ static int hci_dev_setup_sync(struct hci test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); if (!ret) { if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) && diff --git a/target/linux/bcm27xx/patches-6.6/950-0490-input-ads7846-Add-missing-spi_device_id-strings.patch b/target/linux/bcm27xx/patches-6.6/950-0490-input-ads7846-Add-missing-spi_device_id-strings.patch deleted file mode 100644 index 1b0a29a777..0000000000 --- a/target/linux/bcm27xx/patches-6.6/950-0490-input-ads7846-Add-missing-spi_device_id-strings.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 3b391ceadf0d4ab5ce45f98d2f1d41f40e5aedd7 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Fri, 1 Sep 2023 12:23:30 +0100 -Subject: [PATCH 0490/1085] input: ads7846: Add missing spi_device_id strings - -The SPI core logs error messages if a compatible string device -name is not also present as an spi_device_id. - -No spi_device_id values are specified by the driver, therefore -we get 4 log lines every time it is loaded: -SPI driver ads7846 has no spi_device_id for ti,tsc2046 -SPI driver ads7846 has no spi_device_id for ti,ads7843 -SPI driver ads7846 has no spi_device_id for ti,ads7845 -SPI driver ads7846 has no spi_device_id for ti,ads7873 - -Add the spi_device_id values for these devices. - -Signed-off-by: Dave Stevenson ---- - drivers/input/touchscreen/ads7846.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - ---- a/drivers/input/touchscreen/ads7846.c -+++ b/drivers/input/touchscreen/ads7846.c -@@ -1114,6 +1114,16 @@ static const struct of_device_id ads7846 - }; - MODULE_DEVICE_TABLE(of, ads7846_dt_ids); - -+static const struct spi_device_id ads7846_spi_ids[] = { -+ { "tsc2046", 0 }, -+ { "ads7843", 0 }, -+ { "ads7845", 0 }, -+ { "ads7846", 0 }, -+ { "ads7873", 0 }, -+ { } -+}; -+MODULE_DEVICE_TABLE(spi, ads7846_spi_ids); -+ - static const struct ads7846_platform_data *ads7846_get_props(struct device *dev) - { - struct ads7846_platform_data *pdata; -@@ -1390,6 +1400,7 @@ static struct spi_driver ads7846_driver - .pm = pm_sleep_ptr(&ads7846_pm), - .of_match_table = ads7846_dt_ids, - }, -+ .id_table = ads7846_spi_ids, - .probe = ads7846_probe, - .remove = ads7846_remove, - }; diff --git a/target/linux/generic/hack-6.6/253-ksmbd-config.patch b/target/linux/generic/hack-6.6/253-ksmbd-config.patch index 298a0787b7..b200d2ce60 100644 --- a/target/linux/generic/hack-6.6/253-ksmbd-config.patch +++ b/target/linux/generic/hack-6.6/253-ksmbd-config.patch @@ -21,7 +21,7 @@ Subject: [PATCH] Kconfig: add tristate for OID and ASNI string that can be interpreted by the ASN.1 stream decoder and used to --- a/lib/Kconfig +++ b/lib/Kconfig -@@ -647,7 +647,7 @@ config LIBFDT +@@ -641,7 +641,7 @@ config LIBFDT bool config OID_REGISTRY diff --git a/target/linux/generic/hack-6.6/902-debloat_proc.patch b/target/linux/generic/hack-6.6/902-debloat_proc.patch index 559d403242..7b05e55f5e 100644 --- a/target/linux/generic/hack-6.6/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.6/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2897,6 +2897,8 @@ static const struct seq_operations locks +@@ -2896,6 +2896,8 @@ static const struct seq_operations locks static int __init proc_locks_init(void) { diff --git a/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch b/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch index 7ad07c3583..19fe984aa6 100644 --- a/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch +++ b/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch @@ -224,7 +224,7 @@ Signed-off-by: SkyLake.Huang int (*fw_translate_cs)(struct spi_controller *ctlr, unsigned cs); /* -@@ -1600,6 +1639,9 @@ spi_register_board_info(struct spi_board +@@ -1601,6 +1640,9 @@ spi_register_board_info(struct spi_board { return 0; } #endif From 96392789ae50a76dc2c8ee875aeabd06c0a48189 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 27 Jul 2024 08:18:53 -0400 Subject: [PATCH 30/39] kernel: bump 6.6 to 6.6.43 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.43 All patches automatically rebased. Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/16010 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- ...fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch | 2 +- target/linux/generic/hack-6.6/902-debloat_proc.patch | 2 +- ...052-v6.7-arm64-dts-qcom-ipq6018-include-the-GPLL0-as.patch | 2 +- .../0059-v6.9-arm64-dts-qcom-ipq6018-add-thermal-zones.patch | 2 +- .../0906-arm64-dts-qcom-ipq6018-add-wifi-node.patch | 2 +- .../patches-6.6/0907-soc-qcom-fix-smp2p-ack-on-ipq6018.patch | 2 +- ...arm64-dts-qcom-ipq6018-assign-QDSS_AT-clock-to-wifi-.patch | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 212c6263d5..4c6596969d 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .42 -LINUX_KERNEL_HASH-6.6.42 = 8801c8c297d774e76044977ec3d0684399dc4e7cce347d730874ec78b774e683 +LINUX_VERSION-6.6 = .43 +LINUX_KERNEL_HASH-6.6.43 = 0ad83b1a1a780a1aad948d55aa55ee63c50c626f2d46910b9d2180028d100a5e diff --git a/target/linux/bcm27xx/patches-6.6/950-1141-fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch b/target/linux/bcm27xx/patches-6.6/950-1141-fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch index 113b3fdf53..b05a8276df 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1141-fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1141-fs-ntfs3-Fix-memory-corruption-when-page_size-change.patch @@ -25,7 +25,7 @@ Signed-off-by: Dom Cobley --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c -@@ -3907,6 +3907,8 @@ check_restart_area: +@@ -3914,6 +3914,8 @@ check_restart_area: log->l_size = log->orig_file_size; log->page_size = norm_file_page(t32, &log->l_size, t32 == DefaultLogPageSize); diff --git a/target/linux/generic/hack-6.6/902-debloat_proc.patch b/target/linux/generic/hack-6.6/902-debloat_proc.patch index 7b05e55f5e..bf14d95999 100644 --- a/target/linux/generic/hack-6.6/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.6/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2896,6 +2896,8 @@ static const struct seq_operations locks +@@ -2895,6 +2895,8 @@ static const struct seq_operations locks static int __init proc_locks_init(void) { diff --git a/target/linux/qualcommax/patches-6.6/0052-v6.7-arm64-dts-qcom-ipq6018-include-the-GPLL0-as.patch b/target/linux/qualcommax/patches-6.6/0052-v6.7-arm64-dts-qcom-ipq6018-include-the-GPLL0-as.patch index 3239404977..d407b9c5c4 100644 --- a/target/linux/qualcommax/patches-6.6/0052-v6.7-arm64-dts-qcom-ipq6018-include-the-GPLL0-as.patch +++ b/target/linux/qualcommax/patches-6.6/0052-v6.7-arm64-dts-qcom-ipq6018-include-the-GPLL0-as.patch @@ -22,7 +22,7 @@ Signed-off-by: Bjorn Andersson --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi -@@ -619,8 +619,8 @@ +@@ -620,8 +620,8 @@ compatible = "qcom,ipq6018-apcs-apps-global"; reg = <0x0 0x0b111000 0x0 0x1000>; #clock-cells = <1>; diff --git a/target/linux/qualcommax/patches-6.6/0059-v6.9-arm64-dts-qcom-ipq6018-add-thermal-zones.patch b/target/linux/qualcommax/patches-6.6/0059-v6.9-arm64-dts-qcom-ipq6018-add-thermal-zones.patch index b8b623c8bc..7e8c84558e 100644 --- a/target/linux/qualcommax/patches-6.6/0059-v6.9-arm64-dts-qcom-ipq6018-add-thermal-zones.patch +++ b/target/linux/qualcommax/patches-6.6/0059-v6.9-arm64-dts-qcom-ipq6018-add-thermal-zones.patch @@ -55,7 +55,7 @@ Signed-off-by: Bjorn Andersson }; L2_0: l2-cache { -@@ -889,6 +894,122 @@ +@@ -890,6 +895,122 @@ }; }; 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 3e040cd2fd..f4968f1a4d 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 -@@ -808,6 +808,102 @@ +@@ -809,6 +809,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 d1bca14063..094442a59b 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 -@@ -1156,6 +1156,7 @@ +@@ -1157,6 +1157,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 3e0ac68f2b..a0528e7f50 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 -@@ -929,8 +929,8 @@ +@@ -930,8 +930,8 @@ "wcss_reset", "wcss_q6_reset"; From dad6ac5e3478a65a1aeb2f1e80e65d56f67b825b Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 30 Aug 2022 09:06:04 +0200 Subject: [PATCH 31/39] mpc85xx: enable inside secure driver for PowerPC platforms Freescale procesor has Securite Engine driver called Talitos. [1] This driver is already packaged for OpenWrt since commit bf57f33f0229564828f576b2dfb897aa0b57e85c ("kernel: Allow talitos crypto hw module selection"), but many users don't know about it. Let's include this kernel module package to default packages as it was recently done for MediaTek in commit 06c4fc6d5e1eea00e6a3ea208102407408590af8 ("kernel: enable inside secure driver for MediaTek platforms") [1] https://cateee.net/lkddb/web-lkddb/CRYPTO_DEV_TALITOS.html Signed-off-by: Josef Schlehofer Link: https://github.com/openwrt/openwrt/pull/10557 Signed-off-by: Hauke Mehrtens --- target/linux/mpc85xx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile index b9bf0eaff0..7c8453776b 100644 --- a/target/linux/mpc85xx/Makefile +++ b/target/linux/mpc85xx/Makefile @@ -21,6 +21,6 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += \ kmod-input-core kmod-input-gpio-keys kmod-button-hotplug \ kmod-leds-gpio swconfig kmod-ath9k wpad-basic-mbedtls kmod-usb2 \ - uboot-envtools + uboot-envtools kmod-crypto-hw-talitos $(eval $(call BuildTarget)) From be71e1663057e19e9cd660314dc2896066fde68b Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Mon, 27 May 2024 23:18:01 +0800 Subject: [PATCH 32/39] sunxi: backport Allwinner H616 DVFS support Backport H616 DVFS support from linux-next. Tested on the Orange Pi Zero 3 (H618 SoC). Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/15600 Signed-off-by: Hauke Mehrtens --- ...mccc-Export-revision-soc_id-function.patch | 32 +++ ...ev-Blocklist-Allwinner-H616-618-SoCs.patch | 29 +++ ...q-sun50i-Refactor-speed-bin-decoding.patch | 149 ++++++++++++++ ...50i-Add-support-for-opp_supported_hw.patch | 132 ++++++++++++ ...6.10-cpufreq-sun50i-Add-H616-support.patch | 122 ++++++++++++ ...ts-allwinner-h616-Add-CPU-OPPs-table.patch | 188 ++++++++++++++++++ ...nner-h616-enable-DVFS-for-all-boards.patch | 86 ++++++++ ...50i-Fix-build-warning-around-snprint.patch | 51 +++++ ...error-returns-in-dt_has_supported_hw.patch | 34 ++++ 9 files changed, 823 insertions(+) create mode 100644 target/linux/sunxi/patches-6.6/017-v6.10-firmware-smccc-Export-revision-soc_id-function.patch create mode 100644 target/linux/sunxi/patches-6.6/018-v6.10-cpufreq-dt-platdev-Blocklist-Allwinner-H616-618-SoCs.patch create mode 100644 target/linux/sunxi/patches-6.6/019-v6.10-cpufreq-sun50i-Refactor-speed-bin-decoding.patch create mode 100644 target/linux/sunxi/patches-6.6/020-v6.10-cpufreq-sun50i-Add-support-for-opp_supported_hw.patch create mode 100644 target/linux/sunxi/patches-6.6/021-v6.10-cpufreq-sun50i-Add-H616-support.patch create mode 100644 target/linux/sunxi/patches-6.6/022-v6.10-arm64-dts-allwinner-h616-Add-CPU-OPPs-table.patch create mode 100644 target/linux/sunxi/patches-6.6/023-v6.10-arm64-dts-allwinner-h616-enable-DVFS-for-all-boards.patch create mode 100644 target/linux/sunxi/patches-6.6/024-v6.10-cpufreq-sun50i-Fix-build-warning-around-snprint.patch create mode 100644 target/linux/sunxi/patches-6.6/025-v6.10-cpufreq-sun50i-fix-error-returns-in-dt_has_supported_hw.patch diff --git a/target/linux/sunxi/patches-6.6/017-v6.10-firmware-smccc-Export-revision-soc_id-function.patch b/target/linux/sunxi/patches-6.6/017-v6.10-firmware-smccc-Export-revision-soc_id-function.patch new file mode 100644 index 0000000000..538484dd82 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/017-v6.10-firmware-smccc-Export-revision-soc_id-function.patch @@ -0,0 +1,32 @@ +From 9cf3415ade2d7598d78d2ce6d35d6d6d06132201 Mon Sep 17 00:00:00 2001 +From: Martin Botka +Date: Thu, 18 Apr 2024 16:44:01 +0100 +Subject: [PATCH] firmware: smccc: Export revision soc_id function + +The "SoC ID revision" as provided via the SMCCC SOCID interface can be +valuable information for drivers, when certain functionality depends +on a die revision, for instance. +One example is the sun50i-cpufreq-nvmem driver, which needs this +information to determine the speed bin of the SoC. + +Export the arm_smccc_get_soc_id_revision() function so that it can be +called by any driver. + +Signed-off-by: Martin Botka +Signed-off-by: Andre Przywara +Acked-by: Sudeep Holla +Signed-off-by: Viresh Kumar +--- + drivers/firmware/smccc/smccc.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/firmware/smccc/smccc.c ++++ b/drivers/firmware/smccc/smccc.c +@@ -69,6 +69,7 @@ s32 arm_smccc_get_soc_id_revision(void) + { + return smccc_soc_id_revision; + } ++EXPORT_SYMBOL_GPL(arm_smccc_get_soc_id_revision); + + static int __init smccc_devices_init(void) + { diff --git a/target/linux/sunxi/patches-6.6/018-v6.10-cpufreq-dt-platdev-Blocklist-Allwinner-H616-618-SoCs.patch b/target/linux/sunxi/patches-6.6/018-v6.10-cpufreq-dt-platdev-Blocklist-Allwinner-H616-618-SoCs.patch new file mode 100644 index 0000000000..d67b35ee71 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/018-v6.10-cpufreq-dt-platdev-Blocklist-Allwinner-H616-618-SoCs.patch @@ -0,0 +1,29 @@ +From 6ae07744cf334b750762ba881492c0cfba524b38 Mon Sep 17 00:00:00 2001 +From: Martin Botka +Date: Thu, 18 Apr 2024 16:44:02 +0100 +Subject: [PATCH] cpufreq: dt-platdev: Blocklist Allwinner H616/618 SoCs + +The AllWinner H616 SoC will use the (extended) H6 OPP driver, so add +them to the cpufreq-dt blocklist, to not create the device twice. +This also affects the closely related sibling SoCs H618 and H700. + +Signed-off-by: Martin Botka +Signed-off-by: Andre Przywara +Reviewed-by: Jernej Skrabec +Signed-off-by: Viresh Kumar +--- + drivers/cpufreq/cpufreq-dt-platdev.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/cpufreq/cpufreq-dt-platdev.c ++++ b/drivers/cpufreq/cpufreq-dt-platdev.c +@@ -104,6 +104,9 @@ static const struct of_device_id allowli + */ + static const struct of_device_id blocklist[] __initconst = { + { .compatible = "allwinner,sun50i-h6", }, ++ { .compatible = "allwinner,sun50i-h616", }, ++ { .compatible = "allwinner,sun50i-h618", }, ++ { .compatible = "allwinner,sun50i-h700", }, + + { .compatible = "apple,arm-platform", }, + diff --git a/target/linux/sunxi/patches-6.6/019-v6.10-cpufreq-sun50i-Refactor-speed-bin-decoding.patch b/target/linux/sunxi/patches-6.6/019-v6.10-cpufreq-sun50i-Refactor-speed-bin-decoding.patch new file mode 100644 index 0000000000..9a81906996 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/019-v6.10-cpufreq-sun50i-Refactor-speed-bin-decoding.patch @@ -0,0 +1,149 @@ +From 6cc4bcceff9af0e6be9738096d95e4ba75e75123 Mon Sep 17 00:00:00 2001 +From: Brandon Cheo Fusi +Date: Thu, 18 Apr 2024 16:44:04 +0100 +Subject: [PATCH] cpufreq: sun50i: Refactor speed bin decoding + +Make converting the speed bin value into a speed grade generic and +determined by a platform specific callback. Also change the prototypes +involved to encode the speed bin directly in the return value. + +This allows to extend the driver more easily to support more SoCs. + +Signed-off-by: Brandon Cheo Fusi +[Andre: merge output into return value] +Signed-off-by: Andre Przywara +Reviewed-by: Jernej Skrabec +Signed-off-by: Viresh Kumar +--- + drivers/cpufreq/sun50i-cpufreq-nvmem.c | 74 +++++++++++++++++--------- + 1 file changed, 49 insertions(+), 25 deletions(-) + +--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c ++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c +@@ -25,19 +25,52 @@ + + static struct platform_device *cpufreq_dt_pdev, *sun50i_cpufreq_pdev; + ++struct sunxi_cpufreq_data { ++ u32 (*efuse_xlate)(u32 speedbin); ++}; ++ ++static u32 sun50i_h6_efuse_xlate(u32 speedbin) ++{ ++ u32 efuse_value; ++ ++ efuse_value = (speedbin >> NVMEM_SHIFT) & NVMEM_MASK; ++ ++ /* ++ * We treat unexpected efuse values as if the SoC was from ++ * the slowest bin. Expected efuse values are 1-3, slowest ++ * to fastest. ++ */ ++ if (efuse_value >= 1 && efuse_value <= 3) ++ return efuse_value - 1; ++ else ++ return 0; ++} ++ ++static struct sunxi_cpufreq_data sun50i_h6_cpufreq_data = { ++ .efuse_xlate = sun50i_h6_efuse_xlate, ++}; ++ ++static const struct of_device_id cpu_opp_match_list[] = { ++ { .compatible = "allwinner,sun50i-h6-operating-points", ++ .data = &sun50i_h6_cpufreq_data, ++ }, ++ {} ++}; ++ + /** + * sun50i_cpufreq_get_efuse() - Determine speed grade from efuse value +- * @versions: Set to the value parsed from efuse + * +- * Returns 0 if success. ++ * Returns non-negative speed bin index on success, a negative error ++ * value otherwise. + */ +-static int sun50i_cpufreq_get_efuse(u32 *versions) ++static int sun50i_cpufreq_get_efuse(void) + { ++ const struct sunxi_cpufreq_data *opp_data; + struct nvmem_cell *speedbin_nvmem; ++ const struct of_device_id *match; + struct device_node *np; + struct device *cpu_dev; +- u32 *speedbin, efuse_value; +- size_t len; ++ u32 *speedbin; + int ret; + + cpu_dev = get_cpu_device(0); +@@ -48,12 +81,12 @@ static int sun50i_cpufreq_get_efuse(u32 + if (!np) + return -ENOENT; + +- ret = of_device_is_compatible(np, +- "allwinner,sun50i-h6-operating-points"); +- if (!ret) { ++ match = of_match_node(cpu_opp_match_list, np); ++ if (!match) { + of_node_put(np); + return -ENOENT; + } ++ opp_data = match->data; + + speedbin_nvmem = of_nvmem_cell_get(np, NULL); + of_node_put(np); +@@ -61,25 +94,16 @@ static int sun50i_cpufreq_get_efuse(u32 + return dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem), + "Could not get nvmem cell\n"); + +- speedbin = nvmem_cell_read(speedbin_nvmem, &len); ++ speedbin = nvmem_cell_read(speedbin_nvmem, NULL); + nvmem_cell_put(speedbin_nvmem); + if (IS_ERR(speedbin)) + return PTR_ERR(speedbin); + +- efuse_value = (*speedbin >> NVMEM_SHIFT) & NVMEM_MASK; +- +- /* +- * We treat unexpected efuse values as if the SoC was from +- * the slowest bin. Expected efuse values are 1-3, slowest +- * to fastest. +- */ +- if (efuse_value >= 1 && efuse_value <= 3) +- *versions = efuse_value - 1; +- else +- *versions = 0; ++ ret = opp_data->efuse_xlate(*speedbin); + + kfree(speedbin); +- return 0; ++ ++ return ret; + }; + + static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) +@@ -87,7 +111,7 @@ static int sun50i_cpufreq_nvmem_probe(st + int *opp_tokens; + char name[MAX_NAME_LEN]; + unsigned int cpu; +- u32 speed = 0; ++ int speed; + int ret; + + opp_tokens = kcalloc(num_possible_cpus(), sizeof(*opp_tokens), +@@ -95,10 +119,10 @@ static int sun50i_cpufreq_nvmem_probe(st + if (!opp_tokens) + return -ENOMEM; + +- ret = sun50i_cpufreq_get_efuse(&speed); +- if (ret) { ++ speed = sun50i_cpufreq_get_efuse(); ++ if (speed < 0) { + kfree(opp_tokens); +- return ret; ++ return speed; + } + + snprintf(name, MAX_NAME_LEN, "speed%d", speed); diff --git a/target/linux/sunxi/patches-6.6/020-v6.10-cpufreq-sun50i-Add-support-for-opp_supported_hw.patch b/target/linux/sunxi/patches-6.6/020-v6.10-cpufreq-sun50i-Add-support-for-opp_supported_hw.patch new file mode 100644 index 0000000000..e0c68f9aad --- /dev/null +++ b/target/linux/sunxi/patches-6.6/020-v6.10-cpufreq-sun50i-Add-support-for-opp_supported_hw.patch @@ -0,0 +1,132 @@ +From fa5aec9561cfc4f4370983ca5818c90227c9d90e Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Thu, 18 Apr 2024 16:44:05 +0100 +Subject: [PATCH] cpufreq: sun50i: Add support for opp_supported_hw + +The opp_supported_hw DT property allows the DT to specify a mask of chip +revisions that a certain OPP is eligible for. This allows for easy +limiting of maximum frequencies, for instance. + +Add support for that in the sun50i-cpufreq-nvmem driver. We support both +the existing opp-microvolt suffix properties as well as the +opp-supported-hw property, the generic code figures out which is needed +automatically. +However if none of the DT OPP nodes contain an opp-supported-hw +property, the core code will ignore all OPPs and the driver will fail +probing. So check the DT's eligibility first before using that feature. + +Signed-off-by: Andre Przywara +Reviewed-by: Jernej Skrabec +Signed-off-by: Viresh Kumar +--- + drivers/cpufreq/sun50i-cpufreq-nvmem.c | 62 ++++++++++++++++++++++---- + 1 file changed, 54 insertions(+), 8 deletions(-) + +--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c ++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c +@@ -58,6 +58,41 @@ static const struct of_device_id cpu_opp + }; + + /** ++ * dt_has_supported_hw() - Check if any OPPs use opp-supported-hw ++ * ++ * If we ask the cpufreq framework to use the opp-supported-hw feature, it ++ * will ignore every OPP node without that DT property. If none of the OPPs ++ * have it, the driver will fail probing, due to the lack of OPPs. ++ * ++ * Returns true if we have at least one OPP with the opp-supported-hw property. ++ */ ++static bool dt_has_supported_hw(void) ++{ ++ bool has_opp_supported_hw = false; ++ struct device_node *np, *opp; ++ struct device *cpu_dev; ++ ++ cpu_dev = get_cpu_device(0); ++ if (!cpu_dev) ++ return -ENODEV; ++ ++ np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); ++ if (!np) ++ return -ENOENT; ++ ++ for_each_child_of_node(np, opp) { ++ if (of_find_property(opp, "opp-supported-hw", NULL)) { ++ has_opp_supported_hw = true; ++ break; ++ } ++ } ++ ++ of_node_put(np); ++ ++ return has_opp_supported_hw; ++} ++ ++/** + * sun50i_cpufreq_get_efuse() - Determine speed grade from efuse value + * + * Returns non-negative speed bin index on success, a negative error +@@ -110,7 +145,8 @@ static int sun50i_cpufreq_nvmem_probe(st + { + int *opp_tokens; + char name[MAX_NAME_LEN]; +- unsigned int cpu; ++ unsigned int cpu, supported_hw; ++ struct dev_pm_opp_config config = {}; + int speed; + int ret; + +@@ -125,7 +161,18 @@ static int sun50i_cpufreq_nvmem_probe(st + return speed; + } + ++ /* ++ * We need at least one OPP with the "opp-supported-hw" property, ++ * or else the upper layers will ignore every OPP and will bail out. ++ */ ++ if (dt_has_supported_hw()) { ++ supported_hw = 1U << speed; ++ config.supported_hw = &supported_hw; ++ config.supported_hw_count = 1; ++ } ++ + snprintf(name, MAX_NAME_LEN, "speed%d", speed); ++ config.prop_name = name; + + for_each_possible_cpu(cpu) { + struct device *cpu_dev = get_cpu_device(cpu); +@@ -135,12 +182,11 @@ static int sun50i_cpufreq_nvmem_probe(st + goto free_opp; + } + +- opp_tokens[cpu] = dev_pm_opp_set_prop_name(cpu_dev, name); +- if (opp_tokens[cpu] < 0) { +- ret = opp_tokens[cpu]; +- pr_err("Failed to set prop name\n"); ++ ret = dev_pm_opp_set_config(cpu_dev, &config); ++ if (ret < 0) + goto free_opp; +- } ++ ++ opp_tokens[cpu] = ret; + } + + cpufreq_dt_pdev = platform_device_register_simple("cpufreq-dt", -1, +@@ -155,7 +201,7 @@ static int sun50i_cpufreq_nvmem_probe(st + + free_opp: + for_each_possible_cpu(cpu) +- dev_pm_opp_put_prop_name(opp_tokens[cpu]); ++ dev_pm_opp_clear_config(opp_tokens[cpu]); + kfree(opp_tokens); + + return ret; +@@ -169,7 +215,7 @@ static void sun50i_cpufreq_nvmem_remove( + platform_device_unregister(cpufreq_dt_pdev); + + for_each_possible_cpu(cpu) +- dev_pm_opp_put_prop_name(opp_tokens[cpu]); ++ dev_pm_opp_clear_config(opp_tokens[cpu]); + + kfree(opp_tokens); + } diff --git a/target/linux/sunxi/patches-6.6/021-v6.10-cpufreq-sun50i-Add-H616-support.patch b/target/linux/sunxi/patches-6.6/021-v6.10-cpufreq-sun50i-Add-H616-support.patch new file mode 100644 index 0000000000..c891f5722a --- /dev/null +++ b/target/linux/sunxi/patches-6.6/021-v6.10-cpufreq-sun50i-Add-H616-support.patch @@ -0,0 +1,122 @@ +From e2e2dcd2e944fe6167cb731864f8a1343f1bbee7 Mon Sep 17 00:00:00 2001 +From: Martin Botka +Date: Thu, 18 Apr 2024 16:44:06 +0100 +Subject: [PATCH] cpufreq: sun50i: Add H616 support + +The Allwinner H616/H618 SoCs have different OPP tables per SoC version +and die revision. The SoC version is stored in NVMEM, as before, though +encoded differently. The die revision is in a different register, in the +SRAM controller. Firmware already exports that value in a standardised +way, through the SMCCC SoCID mechanism. We need both values, as some chips +have the same SoC version, but they don't support the same frequencies and +they get differentiated by the die revision. + +Add the new compatible string and tie the new translation function to +it. This mechanism not only covers the original H616 SoC, but also its +very close sibling SoCs H618 and H700, so add them to the list as well. + +Signed-off-by: Martin Botka +Signed-off-by: Andre Przywara +Signed-off-by: Viresh Kumar +--- + drivers/cpufreq/sun50i-cpufreq-nvmem.c | 67 ++++++++++++++++++++++++++ + 1 file changed, 67 insertions(+) + +--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c ++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c +@@ -10,6 +10,7 @@ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +@@ -46,14 +47,77 @@ static u32 sun50i_h6_efuse_xlate(u32 spe + return 0; + } + ++static int get_soc_id_revision(void) ++{ ++#ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY ++ return arm_smccc_get_soc_id_revision(); ++#else ++ return SMCCC_RET_NOT_SUPPORTED; ++#endif ++} ++ ++/* ++ * Judging by the OPP tables in the vendor BSP, the quality order of the ++ * returned speedbin index is 4 -> 0/2 -> 3 -> 1, from worst to best. ++ * 0 and 2 seem identical from the OPP tables' point of view. ++ */ ++static u32 sun50i_h616_efuse_xlate(u32 speedbin) ++{ ++ int ver_bits = get_soc_id_revision(); ++ u32 value = 0; ++ ++ switch (speedbin & 0xffff) { ++ case 0x2000: ++ value = 0; ++ break; ++ case 0x2400: ++ case 0x7400: ++ case 0x2c00: ++ case 0x7c00: ++ if (ver_bits != SMCCC_RET_NOT_SUPPORTED && ver_bits <= 1) { ++ /* ic version A/B */ ++ value = 1; ++ } else { ++ /* ic version C and later version */ ++ value = 2; ++ } ++ break; ++ case 0x5000: ++ case 0x5400: ++ case 0x6000: ++ value = 3; ++ break; ++ case 0x5c00: ++ value = 4; ++ break; ++ case 0x5d00: ++ value = 0; ++ break; ++ default: ++ pr_warn("sun50i-cpufreq-nvmem: unknown speed bin 0x%x, using default bin 0\n", ++ speedbin & 0xffff); ++ value = 0; ++ break; ++ } ++ ++ return value; ++} ++ + static struct sunxi_cpufreq_data sun50i_h6_cpufreq_data = { + .efuse_xlate = sun50i_h6_efuse_xlate, + }; + ++static struct sunxi_cpufreq_data sun50i_h616_cpufreq_data = { ++ .efuse_xlate = sun50i_h616_efuse_xlate, ++}; ++ + static const struct of_device_id cpu_opp_match_list[] = { + { .compatible = "allwinner,sun50i-h6-operating-points", + .data = &sun50i_h6_cpufreq_data, + }, ++ { .compatible = "allwinner,sun50i-h616-operating-points", ++ .data = &sun50i_h616_cpufreq_data, ++ }, + {} + }; + +@@ -230,6 +294,9 @@ static struct platform_driver sun50i_cpu + + static const struct of_device_id sun50i_cpufreq_match_list[] = { + { .compatible = "allwinner,sun50i-h6" }, ++ { .compatible = "allwinner,sun50i-h616" }, ++ { .compatible = "allwinner,sun50i-h618" }, ++ { .compatible = "allwinner,sun50i-h700" }, + {} + }; + MODULE_DEVICE_TABLE(of, sun50i_cpufreq_match_list); diff --git a/target/linux/sunxi/patches-6.6/022-v6.10-arm64-dts-allwinner-h616-Add-CPU-OPPs-table.patch b/target/linux/sunxi/patches-6.6/022-v6.10-arm64-dts-allwinner-h616-Add-CPU-OPPs-table.patch new file mode 100644 index 0000000000..4665286d0f --- /dev/null +++ b/target/linux/sunxi/patches-6.6/022-v6.10-arm64-dts-allwinner-h616-Add-CPU-OPPs-table.patch @@ -0,0 +1,188 @@ +From 3e057e05b3b281bcc29db573eb51f87ee6b5afc0 Mon Sep 17 00:00:00 2001 +From: Martin Botka +Date: Thu, 18 Apr 2024 16:44:07 +0100 +Subject: [PATCH] arm64: dts: allwinner: h616: Add CPU OPPs table + +Add an Operating Performance Points table for the CPU cores to enable +Dynamic Voltage & Frequency Scaling (DVFS) on the H616. +The values were taken from the BSP sources. There is a separate OPP set +seen on some H700 devices, but they didn't really work out in testing, so +they are not included for now. + +Also add the needed cpu_speed_grade nvmem cell and the cooling cells +properties, to enable passive cooling. + +Signed-off-by: Martin Botka +[Andre: rework to minimise opp-microvolt properties] +Signed-off-by: Andre Przywara +Acked-by: Jernej Skrabec +Signed-off-by: Viresh Kumar +--- + .../dts/allwinner/sun50i-h616-cpu-opp.dtsi | 115 ++++++++++++++++++ + .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 8 ++ + 2 files changed, 123 insertions(+) + create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi + +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi +@@ -0,0 +1,115 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++// Copyright (C) 2023 Martin Botka ++ ++/ { ++ cpu_opp_table: opp-table-cpu { ++ compatible = "allwinner,sun50i-h616-operating-points"; ++ nvmem-cells = <&cpu_speed_grade>; ++ opp-shared; ++ ++ opp-480000000 { ++ opp-hz = /bits/ 64 <480000000>; ++ opp-microvolt = <900000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x1f>; ++ }; ++ ++ opp-600000000 { ++ opp-hz = /bits/ 64 <600000000>; ++ opp-microvolt = <900000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x12>; ++ }; ++ ++ opp-720000000 { ++ opp-hz = /bits/ 64 <720000000>; ++ opp-microvolt = <900000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x0d>; ++ }; ++ ++ opp-792000000 { ++ opp-hz = /bits/ 64 <792000000>; ++ opp-microvolt-speed1 = <900000>; ++ opp-microvolt-speed4 = <940000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x12>; ++ }; ++ ++ opp-936000000 { ++ opp-hz = /bits/ 64 <936000000>; ++ opp-microvolt = <900000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x0d>; ++ }; ++ ++ opp-1008000000 { ++ opp-hz = /bits/ 64 <1008000000>; ++ opp-microvolt-speed0 = <950000>; ++ opp-microvolt-speed1 = <940000>; ++ opp-microvolt-speed2 = <950000>; ++ opp-microvolt-speed3 = <950000>; ++ opp-microvolt-speed4 = <1020000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x1f>; ++ }; ++ ++ opp-1104000000 { ++ opp-hz = /bits/ 64 <1104000000>; ++ opp-microvolt-speed0 = <1000000>; ++ opp-microvolt-speed2 = <1000000>; ++ opp-microvolt-speed3 = <1000000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x0d>; ++ }; ++ ++ opp-1200000000 { ++ opp-hz = /bits/ 64 <1200000000>; ++ opp-microvolt-speed0 = <1050000>; ++ opp-microvolt-speed1 = <1020000>; ++ opp-microvolt-speed2 = <1050000>; ++ opp-microvolt-speed3 = <1050000>; ++ opp-microvolt-speed4 = <1100000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x1f>; ++ }; ++ ++ opp-1320000000 { ++ opp-hz = /bits/ 64 <1320000000>; ++ opp-microvolt = <1100000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x1d>; ++ }; ++ ++ opp-1416000000 { ++ opp-hz = /bits/ 64 <1416000000>; ++ opp-microvolt = <1100000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x0d>; ++ }; ++ ++ opp-1512000000 { ++ opp-hz = /bits/ 64 <1512000000>; ++ opp-microvolt-speed1 = <1100000>; ++ opp-microvolt-speed3 = <1100000>; ++ clock-latency-ns = <244144>; /* 8 32k periods */ ++ opp-supported-hw = <0x0a>; ++ }; ++ }; ++}; ++ ++&cpu0 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; ++ ++&cpu1 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; ++ ++&cpu2 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; ++ ++&cpu3 { ++ operating-points-v2 = <&cpu_opp_table>; ++}; +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +@@ -26,6 +26,7 @@ + reg = <0>; + enable-method = "psci"; + clocks = <&ccu CLK_CPUX>; ++ #cooling-cells = <2>; + }; + + cpu1: cpu@1 { +@@ -34,6 +35,7 @@ + reg = <1>; + enable-method = "psci"; + clocks = <&ccu CLK_CPUX>; ++ #cooling-cells = <2>; + }; + + cpu2: cpu@2 { +@@ -42,6 +44,7 @@ + reg = <2>; + enable-method = "psci"; + clocks = <&ccu CLK_CPUX>; ++ #cooling-cells = <2>; + }; + + cpu3: cpu@3 { +@@ -50,6 +53,7 @@ + reg = <3>; + enable-method = "psci"; + clocks = <&ccu CLK_CPUX>; ++ #cooling-cells = <2>; + }; + }; + +@@ -143,6 +147,10 @@ + ths_calibration: thermal-sensor-calibration@14 { + reg = <0x14 0x8>; + }; ++ ++ cpu_speed_grade: cpu-speed-grade@0 { ++ reg = <0x0 2>; ++ }; + }; + + watchdog: watchdog@30090a0 { diff --git a/target/linux/sunxi/patches-6.6/023-v6.10-arm64-dts-allwinner-h616-enable-DVFS-for-all-boards.patch b/target/linux/sunxi/patches-6.6/023-v6.10-arm64-dts-allwinner-h616-enable-DVFS-for-all-boards.patch new file mode 100644 index 0000000000..8c91184117 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/023-v6.10-arm64-dts-allwinner-h616-enable-DVFS-for-all-boards.patch @@ -0,0 +1,86 @@ +From 09d0aaa0ae9c80ff9569393b206226c1008801b1 Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Thu, 18 Apr 2024 16:44:08 +0100 +Subject: [PATCH] arm64: dts: allwinner: h616: enable DVFS for all boards + +With the DT bindings now describing the format of the CPU OPP tables, we +can include the OPP table in each board's .dts file, and specify the CPU +power supply. +This allows to enable DVFS, and get up to 50% of performance benefit in +the highest OPP, or up to 60% power savings in the lowest OPP, compared +to the fixed 1GHz @ 1.0V OPP we are running in by default at the moment. + +Signed-off-by: Andre Przywara +Acked-by: Jernej Skrabec +Signed-off-by: Viresh Kumar +--- + .../boot/dts/allwinner/sun50i-h616-bigtreetech-cb1.dtsi | 5 +++++ + arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 5 +++++ + arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts | 5 +++++ + .../boot/dts/allwinner/sun50i-h618-longan-module-3h.dtsi | 5 +++++ + .../arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts | 5 +++++ + arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts | 5 +++++ + .../boot/dts/allwinner/sun50i-h618-transpeed-8k618-t.dts | 5 +++++ + 7 files changed, 35 insertions(+) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts +@@ -6,12 +6,17 @@ + /dts-v1/; + + #include "sun50i-h616-orangepi-zero.dtsi" ++#include "sun50i-h616-cpu-opp.dtsi" + + / { + model = "OrangePi Zero2"; + compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616"; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdca>; ++}; ++ + &emac0 { + allwinner,rx-delay-ps = <3100>; + allwinner,tx-delay-ps = <700>; +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts +@@ -6,6 +6,7 @@ + /dts-v1/; + + #include "sun50i-h616.dtsi" ++#include "sun50i-h616-cpu-opp.dtsi" + + #include + #include +@@ -32,6 +33,10 @@ + }; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdca>; ++}; ++ + &ehci0 { + status = "okay"; + }; +--- a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts +@@ -6,12 +6,17 @@ + /dts-v1/; + + #include "sun50i-h616-orangepi-zero.dtsi" ++#include "sun50i-h616-cpu-opp.dtsi" + + / { + model = "OrangePi Zero3"; + compatible = "xunlong,orangepi-zero3", "allwinner,sun50i-h618"; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ + &emac0 { + allwinner,tx-delay-ps = <700>; + phy-mode = "rgmii-rxid"; diff --git a/target/linux/sunxi/patches-6.6/024-v6.10-cpufreq-sun50i-Fix-build-warning-around-snprint.patch b/target/linux/sunxi/patches-6.6/024-v6.10-cpufreq-sun50i-Fix-build-warning-around-snprint.patch new file mode 100644 index 0000000000..8bfd6c2d09 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/024-v6.10-cpufreq-sun50i-Fix-build-warning-around-snprint.patch @@ -0,0 +1,51 @@ +From d2059d3b548409905b20b4f52495bffbd7c8da8b Mon Sep 17 00:00:00 2001 +From: Viresh Kumar +Date: Mon, 22 Apr 2024 08:58:51 +0530 +Subject: [PATCH] cpufreq: sun50i: Fix build warning around snprint() + +The Sun50i driver generates a warning with W=1: + +warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] + +Fix it by allocating a big enough array to print an integer. + +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202404191715.LDwMm2gP-lkp@intel.com/ +Signed-off-by: Viresh Kumar +Acked-by: Chen-Yu Tsai +Reviewed-by: Andre Przywara +Tested-by: Andre Przywara +Reviewed-by: Julian Calaby +--- + drivers/cpufreq/sun50i-cpufreq-nvmem.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c ++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c +@@ -19,8 +19,6 @@ + #include + #include + +-#define MAX_NAME_LEN 7 +- + #define NVMEM_MASK 0x7 + #define NVMEM_SHIFT 5 + +@@ -208,7 +206,7 @@ static int sun50i_cpufreq_get_efuse(void + static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) + { + int *opp_tokens; +- char name[MAX_NAME_LEN]; ++ char name[] = "speedXXXXXXXXXXX"; /* Integers can take 11 chars max */ + unsigned int cpu, supported_hw; + struct dev_pm_opp_config config = {}; + int speed; +@@ -235,7 +233,7 @@ static int sun50i_cpufreq_nvmem_probe(st + config.supported_hw_count = 1; + } + +- snprintf(name, MAX_NAME_LEN, "speed%d", speed); ++ snprintf(name, sizeof(name), "speed%d", speed); + config.prop_name = name; + + for_each_possible_cpu(cpu) { diff --git a/target/linux/sunxi/patches-6.6/025-v6.10-cpufreq-sun50i-fix-error-returns-in-dt_has_supported_hw.patch b/target/linux/sunxi/patches-6.6/025-v6.10-cpufreq-sun50i-fix-error-returns-in-dt_has_supported_hw.patch new file mode 100644 index 0000000000..2304a6af79 --- /dev/null +++ b/target/linux/sunxi/patches-6.6/025-v6.10-cpufreq-sun50i-fix-error-returns-in-dt_has_supported_hw.patch @@ -0,0 +1,34 @@ +From 76a6fc5644b2a1c70868bec24a078f784600ef2a Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 24 Apr 2024 14:40:11 +0300 +Subject: [PATCH] cpufreq: sun50i: fix error returns in dt_has_supported_hw() + +The dt_has_supported_hw() function returns type bool. That means these +negative error codes are cast to true but the function should return +false instead. + +Fixes: fa5aec9561cf ("cpufreq: sun50i: Add support for opp_supported_hw") +Signed-off-by: Dan Carpenter +Reviewed-by: Andre Przywara +Reviewed-by: Jernej Skrabec +Signed-off-by: Viresh Kumar +--- + drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c ++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c +@@ -136,11 +136,11 @@ static bool dt_has_supported_hw(void) + + cpu_dev = get_cpu_device(0); + if (!cpu_dev) +- return -ENODEV; ++ return false; + + np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); + if (!np) +- return -ENOENT; ++ return false; + + for_each_child_of_node(np, opp) { + if (of_find_property(opp, "opp-supported-hw", NULL)) { From 5d0ccaf67cd3bb732dc15a53f9f080910ce73e66 Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Sat, 15 Jun 2024 17:27:42 +0300 Subject: [PATCH 33/39] ramips: mt7621: add support for Wodesys WD-R1802U This commit adds support for a dual-band AX1800 wall plug manufactured by Shenzhen Century Xinyang Tech Co., Ltd. CPU: Mediatek MT7621A (2 cores, 4 threads) RAM: 256i MiB DDR3 (Samsung K4B2G1646F-BCNB) ROM: 16 MiB SPI NOR (Winbond W25Q128JVPQ) Wired: one gigabit RJ45 port (with green/yellow non-GPIO LEDs) WiFi: Mediatek MT7905DAN + MT7975DN (DBDC 2x 2T2R) Ant.: four 2 dBi external antennas (two 2.4GHz, two 5 GHz) GPIO: tri-color status LED (GPIO 13, 14, 16); reset button (GPIO 18) Power: 12V 2-pin JST-XH on main PCB 110/220V AC to 12V1A DC on auxiliary PCB UART: 115200 8n1, SMD pads available on the PCB as J4 pinout is [3v3] (Rx) (Tx) (Gnd) MAC: 1C:BF:CE:xx:xx:xx (2.4 GHz, label) 1C:BF:CE:xx:xx:xx + 1 (ethernet [1]) 1C:BF:CE:xx:xx:xx + 2 (5 GHz) Original firmware is LEDE Reboot 17.01-SNAPSHOT (kernel 4.4.198) with a few custom packages and a non-LuCI web interface. Telnet and SSH are enabled, requiring an unknown root password [2]. Root password is also needed to access the router via UART console, but passwordless telnet can be enabled via a trivial web exploit [3] and then the root password can be removed by editing `/etc/shadow`. Installation: First upload `sysupgrade` binary via web interface at `http://192.168.188.1/settings.shtml` and wait until getting back to the home screen (select network to extend). The installation fails since the original firmware uses `swconfig` and recent versions of OpenWrt use DSA. However, the sysupgrade file is uploaded correctly and stored at `/tmp/upgrade.bin`, so it can be written to flash via the web exploit [4] (both `mtd -r write` and `sysupgrade -Fn` work fine). Passwordless telnet/ssh is not needed for installation. Alternatively, use u-boot menu to load image via TFTP. Notes: - Device model in LEDE is "MediaTek MT7621 RFB (802.11ax,SNOR)". - It is sold under several names, among them are Wodesys WD-R1802U, Fenvi F-AX1802U, and EDUP EP-2971; the Wodesys brand was selected since it is referenced in `/etc/banner` and `/etc/hosts`, and the PCB is marked "WD518A V1.0". - Instead of a standard ethernet transformer, the PCB has a few tiny SMD coils. [1] Original firmware sets ethernet MAC to 1C:BF:CE:E7:62:1D based on offset `0x3fff4` in the Factory partition; since this is the same MAC for all units, whereas WiFi MACs stored at offsets 0x6 and 0xc are unique, it was decided to use