From 29a56e0412668f197353001254125ae40824db1e Mon Sep 17 00:00:00 2001 From: Tjalling Hattink Date: Tue, 26 Sep 2023 15:10:52 +0200 Subject: [PATCH 01/78] build: suppress cmake warnings about unused vars When cmake is invoked to build a package it usually reports a warning about unused variables passed to it. This is caused by openwrt passing all supported variables to cmake, even if they are not all required by the package being compiled. To reduce clutter when compiling such packages these warnings are now suppressed. Approved-by: Rosen Penev Reviewed-by: Robert Marko Signed-off-by: Tjalling Hattink --- include/cmake.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/cmake.mk b/include/cmake.mk index 9b169b06934..95870ffdb0f 100644 --- a/include/cmake.mk +++ b/include/cmake.mk @@ -89,6 +89,7 @@ define Build/Configure/Default CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \ cmake \ + --no-warn-unused-cli \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_VERSION=1 \ -DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \ @@ -141,6 +142,7 @@ define Host/Configure/Default CXXFLAGS="$(HOST_CFLAGS)" \ LDFLAGS="$(HOST_LDFLAGS)" \ cmake \ + --no-warn-unused-cli \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \ -DCMAKE_C_COMPILER="$(CMAKE_HOST_C_COMPILER)" \ From 4c2eab1c27defd154adcd0c4454248112815ffcc Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 4 Oct 2023 13:27:55 +0200 Subject: [PATCH 02/78] CI: push-containers: fix concurrency group Fix concurrency group for push-containers workflow to handle running on different branches. Signed-off-by: Christian Marangi --- .github/workflows/push-containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index 5b5140961cd..0d41b0a67f8 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -14,7 +14,7 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: From b40c0b54bde81243974cada51cb9a44736c773b3 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 4 Oct 2023 13:28:58 +0200 Subject: [PATCH 03/78] CI: push-containers: refresh containers also on modify cmake options Refresh containers also on modify of cmake options in the include file. Signed-off-by: Christian Marangi --- .github/workflows/push-containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index 0d41b0a67f8..74f534d57a4 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -4,6 +4,7 @@ on: push: paths: - 'include/version.mk' + - 'include/cmake.mk' - 'tools/**' - '.github/workflows/push-containers.yml' - 'toolchain/**' From 41fcc617f94601072d304f2f68e12cf1dd058707 Mon Sep 17 00:00:00 2001 From: Rudolf Vesely Date: Mon, 2 Oct 2023 06:51:19 +0000 Subject: [PATCH 04/78] rtl83xx: fix STP by trapping BPDUs Fix Spanning Tree Protocol (STP) by changing COPY2CPU which currently makes switch to ignore Bridge Protocol Data Units (BPDUs). Tested on Zyxel GS1900-8, 24 and 48. Signed-off-by: Rudolf Vesely [ improve commit description and add new line in different sections ] Signed-off-by: Christian Marangi --- target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c index 6b661f90ade..063ce9b8c5d 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c @@ -152,7 +152,7 @@ static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv) static void rtl83xx_setup_bpdu_traps(struct rtl838x_switch_priv *priv) { for (int i = 0; i < priv->cpu_port; i++) - priv->r->set_receive_management_action(i, BPDU, COPY2CPU); + priv->r->set_receive_management_action(i, BPDU, TRAP2CPU); } static void rtl83xx_port_set_salrn(struct rtl838x_switch_priv *priv, From 0d510eb08289e3237a601442aeb291f014782c24 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 28 Sep 2023 20:12:47 +0200 Subject: [PATCH 05/78] gemini: Drop kernel v5.15 and default to v6.1 There is no point in keeping the v5.15 kernel around for Gemini, we are maintaining the platform with a strong upstream focus and newer is always better. Now that OpenWrt can support pure v6.1 kernels, switch up to v6.1 and drop v5.15 so we don't need to migrate configs and patches for no reason. The USB FOTG2 module handling can be simplified as a result. Signed-off-by: Linus Walleij --- target/linux/gemini/Makefile | 3 +- target/linux/gemini/config-5.15 | 420 ------------------ target/linux/gemini/modules.mk | 7 +- ...t-fotg2-add-Gemini-specific-handling.patch | 131 ------ ...-DIR-685-partition-table-for-OpenWrt.patch | 37 -- 5 files changed, 3 insertions(+), 595 deletions(-) delete mode 100644 target/linux/gemini/config-5.15 delete mode 100644 target/linux/gemini/patches-5.15/0001-usb-host-fotg2-add-Gemini-specific-handling.patch delete mode 100644 target/linux/gemini/patches-5.15/0002-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch diff --git a/target/linux/gemini/Makefile b/target/linux/gemini/Makefile index 284d1247cb2..b7f1962c9a5 100644 --- a/target/linux/gemini/Makefile +++ b/target/linux/gemini/Makefile @@ -11,8 +11,7 @@ FEATURES:=squashfs pci rtc usb dt gpio display ext4 rootfs-part boot-part CPU_TYPE:=fa526 SUBTARGETS:=generic -KERNEL_PATCHVER:=5.15 -KERNEL_TESTING_PATCHVER:=6.1 +KERNEL_PATCHVER:=6.1 define Target/Description Build firmware images for the StorLink/Cortina Gemini CS351x ARM FA526 CPU diff --git a/target/linux/gemini/config-5.15 b/target/linux/gemini/config-5.15 deleted file mode 100644 index b0c3afbf9db..00000000000 --- a/target/linux/gemini/config-5.15 +++ /dev/null @@ -1,420 +0,0 @@ -CONFIG_ALIGNMENT_TRAP=y -CONFIG_AMBA_PL08X=y -CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_GEMINI=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_ARCH_MOXART is not set -CONFIG_ARCH_MULTIPLATFORM=y -CONFIG_ARCH_MULTI_V4=y -# CONFIG_ARCH_MULTI_V4T is not set -CONFIG_ARCH_MULTI_V4_V5=y -# CONFIG_ARCH_MULTI_V5 is not set -CONFIG_ARCH_NR_GPIO=0 -CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARM=y -CONFIG_ARM_AMBA=y -CONFIG_ARM_APPENDED_DTB=y -# CONFIG_ARM_ATAG_DTB_COMPAT is not set -CONFIG_ARM_CRYPTO=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_ARM_L1_CACHE_SHIFT=5 -CONFIG_ARM_PATCH_PHYS_VIRT=y -# CONFIG_ARM_SMMU is not set -CONFIG_ARM_UNWIND=y -CONFIG_ATA=y -CONFIG_ATAGS=y -CONFIG_ATA_FORCE=y -CONFIG_ATA_VERBOSE_ERROR=y -CONFIG_AUTO_ZRELADDR=y -CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_MQ_PCI=y -CONFIG_BLK_PM=y -CONFIG_BOUNCE=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CMA=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 -# CONFIG_CMA_DEBUG is not set -# CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_PERCENTAGE=10 -# CONFIG_CMA_SIZE_SEL_MAX is not set -# CONFIG_CMA_SIZE_SEL_MBYTES is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -CONFIG_CMA_SIZE_SEL_PERCENTAGE=y -# CONFIG_CMA_SYSFS is not set -CONFIG_COMMON_CLK=y -CONFIG_COMMON_CLK_GEMINI=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_CONTIG_ALLOC=y -CONFIG_COREDUMP=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_CPU_32v4=y -CONFIG_CPU_ABRT_EV4=y -CONFIG_CPU_CACHE_FA=y -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_COPY_FA=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -# CONFIG_CPU_DCACHE_WRITETHROUGH is not set -CONFIG_CPU_FA526=y -CONFIG_CPU_NO_EFFICIENT_FFS=y -CONFIG_CPU_PABRT_LEGACY=y -CONFIG_CPU_THERMAL=y -CONFIG_CPU_TLB_FA=y -CONFIG_CPU_USE_DOMAINS=y -CONFIG_CRASH_CORE=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CRC_CCITT=y -CONFIG_CRC_ITU_T=y -CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_DEV_SL3516=y -# CONFIG_CRYPTO_DEV_SL3516_DEBUG is not set -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_ENGINE=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_LIB_DES=y -CONFIG_CRYPTO_LIB_SHA256=y -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -CONFIG_DEBUG_MEMORY_INIT=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_LZ4=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DECOMPRESS_LZO=y -CONFIG_DECOMPRESS_XZ=y -CONFIG_DMADEVICES=y -CONFIG_DMATEST=y -CONFIG_DMA_CMA=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_ENGINE_RAID=y -CONFIG_DMA_OF=y -CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y -CONFIG_DMA_SHARED_BUFFER=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DRM=y -CONFIG_DRM_BRIDGE=y -CONFIG_DRM_FBDEV_EMULATION=y -CONFIG_DRM_FBDEV_OVERALLOC=100 -CONFIG_DRM_GEM_CMA_HELPER=y -CONFIG_DRM_KMS_CMA_HELPER=y -CONFIG_DRM_KMS_HELPER=y -CONFIG_DRM_PANEL=y -CONFIG_DRM_PANEL_BRIDGE=y -CONFIG_DRM_PANEL_ILITEK_IL9322=y -CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y -CONFIG_DRM_TVE200=y -CONFIG_DTC=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EEPROM_93CX6=y -CONFIG_ELF_CORE=y -# CONFIG_EMBEDDED is not set -# CONFIG_EXPERT is not set -CONFIG_EXT4_FS=y -CONFIG_FARADAY_FTINTC010=y -CONFIG_FB=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_FOPS=y -CONFIG_FB_SYS_IMAGEBLIT=y -CONFIG_FHANDLE=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_FONT_8x16=y -CONFIG_FONT_8x8=y -CONFIG_FONT_SUPPORT=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -CONFIG_FTTMR010_TIMER=y -CONFIG_FTWDT010_WATCHDOG=y -CONFIG_FWNODE_MDIO=y -CONFIG_FW_LOADER_PAGED_BUF=y -# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set -CONFIG_GEMINI_ETHERNET=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GLOB=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_FTGPIO010=y -CONFIG_GPIO_GENERIC=y -CONFIG_GRO_CELLS=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HDMI=y -CONFIG_HIGHMEM=y -CONFIG_HIGHPTE=y -CONFIG_HWMON=y -CONFIG_HW_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_GPIO=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INPUT=y -CONFIG_INPUT_KEYBOARD=y -# CONFIG_IOMMU_DEBUGFS is not set -# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set -# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set -CONFIG_IOMMU_SUPPORT=y -CONFIG_IPC_NS=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -# CONFIG_ISDN is not set -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -CONFIG_KCMP=y -CONFIG_KERNEL_LZMA=y -# CONFIG_KERNEL_XZ is not set -CONFIG_KEXEC=y -CONFIG_KEXEC_CORE=y -CONFIG_KEYBOARD_DLINK_DIR685=y -CONFIG_KMAP_LOCAL=y -CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y -# CONFIG_LDM_DEBUG is not set -CONFIG_LDM_PARTITION=y -CONFIG_LEDS_TRIGGER_DISK=y -CONFIG_LIBFDT=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOGO=y -CONFIG_LOGO_LINUX_CLUT224=y -# CONFIG_LOGO_LINUX_MONO is not set -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LZ4_DECOMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MARVELL_PHY=y -CONFIG_MDIO_BITBANG=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MDIO_GPIO=y -CONFIG_MEMFD_CREATE=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGRATION=y -CONFIG_MODULES_USE_ELF_REL=y -# CONFIG_MODULE_UNLOAD is not set -CONFIG_MQ_IOSCHED_DEADLINE=y -CONFIG_MQ_IOSCHED_KYBER=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_PHYSMAP_GEMINI=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_SPLIT_FIRMWARE=y -CONFIG_MTD_SPLIT_WRGG_FW=y -CONFIG_NAMESPACES=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_KUSER_HELPERS=y -CONFIG_NEED_PER_CPU_KM=y -CONFIG_NET_DEVLINK=y -CONFIG_NET_DSA=y -CONFIG_NET_DSA_REALTEK_SMI=y -CONFIG_NET_DSA_TAG_RTL4_A=y -CONFIG_NET_NS=y -CONFIG_NET_SELFTESTS=y -CONFIG_NET_SWITCHDEV=y -CONFIG_NLS=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NVMEM=y -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_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -CONFIG_PATA_FTIDE010=y -CONFIG_PCI=y -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_PERFORMANCE is not set -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_FTPCI100=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PHYLINK=y -CONFIG_PID_NS=y -CONFIG_PINCTRL=y -CONFIG_PINCTRL_GEMINI=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PM=y -CONFIG_PM_CLK=y -CONFIG_POWER_RESET=y -CONFIG_POWER_RESET_GEMINI_POWEROFF=y -CONFIG_POWER_RESET_SYSCON=y -CONFIG_PREEMPT=y -CONFIG_PREEMPTION=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_RATIONAL=y -CONFIG_RD_BZIP2=y -CONFIG_RD_GZIP=y -CONFIG_RD_LZ4=y -CONFIG_RD_LZMA=y -CONFIG_RD_LZO=y -CONFIG_RD_XZ=y -CONFIG_REALTEK_PHY=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_RELAY=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RSEQ=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_FTRTC010=y -CONFIG_RTC_I2C_AND_SPI=y -CONFIG_RTC_MC146818_LIB=y -CONFIG_RTC_NVMEM=y -CONFIG_SATA_GEMINI=y -CONFIG_SATA_HOST=y -CONFIG_SATA_PMP=y -CONFIG_SCSI=y -CONFIG_SCSI_COMMON=y -# CONFIG_SCSI_LOWLEVEL is not set -# CONFIG_SCSI_PROC_FS is not set -CONFIG_SENSORS_DRIVETEMP=y -CONFIG_SENSORS_GPIO_FAN=y -CONFIG_SENSORS_LM75=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_EXAR=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_8250_NR_UARTS=1 -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIO=y -CONFIG_SERIO_LIBPS2=y -CONFIG_SERIO_SERPORT=y -CONFIG_SG_POOL=y -CONFIG_SLUB_DEBUG=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_GPIO=y -CONFIG_SPI_MASTER=y -CONFIG_SPLIT_PTLOCK_CPUS=999999 -CONFIG_SRCU=y -# CONFIG_STRIP_ASM_SYMS is not set -CONFIG_SWPHY=y -CONFIG_SYNC_FILE=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_UNWINDER_ARM=y -CONFIG_USB_SUPPORT=y -CONFIG_USER_NS=y -CONFIG_USE_OF=y -CONFIG_UTS_NS=y -CONFIG_VGA_ARB=y -CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_VITESSE_PHY=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_XZ_DEC_IA64=y -CONFIG_XZ_DEC_POWERPC=y -CONFIG_XZ_DEC_SPARC=y -CONFIG_XZ_DEC_X86=y -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/gemini/modules.mk b/target/linux/gemini/modules.mk index 104ad902799..21c215ec9f5 100644 --- a/target/linux/gemini/modules.mk +++ b/target/linux/gemini/modules.mk @@ -3,11 +3,8 @@ define KernelPackage/usb-fotg210 DEPENDS:=@USB_SUPPORT @TARGET_gemini KCONFIG:=CONFIG_USB_FOTG210 \ CONFIG_USB_FOTG210_HCD - FILES:=$(if $(CONFIG_USB_FOTG210_HCD),$(LINUX_DIR)/drivers/usb/host/fotg210-hcd.ko@lt6.1) \ - $(if $(CONFIG_USB_FOTG210),$(LINUX_DIR)/drivers/usb/fotg210/fotg210.ko@ge6.1) - AUTOLOAD:=$(call AutoLoad,50, \ - $(if $(CONFIG_USB_FOTG210_HCD),fotg210-hcd@lt6.1) \ - $(if $(CONFIG_USB_FOTG210),fotg210@ge6.1),1) + FILES:=$(LINUX_DIR)/drivers/usb/fotg210/fotg210.ko + AUTOLOAD:=$(call AutoLoad,50,1) $(call AddDepends/usb) endef diff --git a/target/linux/gemini/patches-5.15/0001-usb-host-fotg2-add-Gemini-specific-handling.patch b/target/linux/gemini/patches-5.15/0001-usb-host-fotg2-add-Gemini-specific-handling.patch deleted file mode 100644 index 6fb59efd1a3..00000000000 --- a/target/linux/gemini/patches-5.15/0001-usb-host-fotg2-add-Gemini-specific-handling.patch +++ /dev/null @@ -1,131 +0,0 @@ -From ff887de2f7af17d6264eb946f6b336e6e1521222 Mon Sep 17 00:00:00 2001 -From: Linus Walleij -Date: Fri, 21 Apr 2017 22:19:00 +0200 -Subject: [PATCH 1/2] usb: host: fotg2: add Gemini-specific handling - -The Cortina Systems Gemini has bolted on a PHY inside the -silicon that can be handled by six bits in a MISC register in -the system controller. - -If we are running on Gemini, look up a syscon regmap through -a phandle and enable VBUS and optionally the Mini-B connector. - -If the device is flagged as "wakeup-source" using the standard -DT bindings, we also enable this in the global controller for -respective port. - -Signed-off-by: Linus Walleij ---- - drivers/usb/host/Kconfig | 1 + - drivers/usb/host/fotg210-hcd.c | 76 ++++++++++++++++++++++++++++++++++ - 2 files changed, 77 insertions(+) - ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -381,6 +381,7 @@ config USB_ISP1362_HCD - config USB_FOTG210_HCD - tristate "FOTG210 HCD support" - depends on USB && HAS_DMA && HAS_IOMEM -+ select MFD_SYSCON - help - Faraday FOTG210 is an OTG controller which can be configured as - an USB2.0 host. It is designed to meet USB2.0 EHCI specification ---- a/drivers/usb/host/fotg210-hcd.c -+++ b/drivers/usb/host/fotg210-hcd.c -@@ -34,6 +34,10 @@ - #include - #include - #include -+#include -+/* For Cortina Gemini */ -+#include -+#include - - #include - #include -@@ -5557,6 +5561,72 @@ static void fotg210_init(struct fotg210_ - } - - /* -+ * Gemini-specific initialization function, only executed on the -+ * Gemini SoC using the global misc control register. -+ */ -+#define GEMINI_GLOBAL_MISC_CTRL 0x30 -+#define GEMINI_MISC_USB0_WAKEUP BIT(14) -+#define GEMINI_MISC_USB1_WAKEUP BIT(15) -+#define GEMINI_MISC_USB0_VBUS_ON BIT(22) -+#define GEMINI_MISC_USB1_VBUS_ON BIT(23) -+#define GEMINI_MISC_USB0_MINI_B BIT(29) -+#define GEMINI_MISC_USB1_MINI_B BIT(30) -+ -+static int fotg210_gemini_init(struct device *dev, struct usb_hcd *hcd) -+{ -+ struct device_node *np = dev->of_node; -+ struct regmap *map; -+ bool mini_b; -+ bool wakeup; -+ u32 mask, val; -+ int ret; -+ -+ map = syscon_regmap_lookup_by_phandle(np, "syscon"); -+ if (IS_ERR(map)) { -+ dev_err(dev, "no syscon\n"); -+ return PTR_ERR(map); -+ } -+ mini_b = of_property_read_bool(np, "cortina,gemini-mini-b"); -+ wakeup = of_property_read_bool(np, "wakeup-source"); -+ -+ /* -+ * Figure out if this is USB0 or USB1 by simply checking the -+ * physical base address. -+ */ -+ mask = 0; -+ if (hcd->rsrc_start == 0x69000000) { -+ val = GEMINI_MISC_USB1_VBUS_ON; -+ if (mini_b) -+ val |= GEMINI_MISC_USB1_MINI_B; -+ else -+ mask |= GEMINI_MISC_USB1_MINI_B; -+ if (wakeup) -+ val |= GEMINI_MISC_USB1_WAKEUP; -+ else -+ mask |= GEMINI_MISC_USB1_WAKEUP; -+ } else { -+ val = GEMINI_MISC_USB0_VBUS_ON; -+ if (mini_b) -+ val |= GEMINI_MISC_USB0_MINI_B; -+ else -+ mask |= GEMINI_MISC_USB0_MINI_B; -+ if (wakeup) -+ val |= GEMINI_MISC_USB0_WAKEUP; -+ else -+ mask |= GEMINI_MISC_USB0_WAKEUP; -+ } -+ -+ ret = regmap_update_bits(map, GEMINI_GLOBAL_MISC_CTRL, mask, val); -+ if (ret) { -+ dev_err(dev, "failed to initialize Gemini PHY\n"); -+ return ret; -+ } -+ -+ dev_info(dev, "initialized Gemini PHY\n"); -+ return 0; -+} -+ -+/** - * fotg210_hcd_probe - initialize faraday FOTG210 HCDs - * - * Allocates basic resources for this USB host controller, and -@@ -5633,6 +5703,12 @@ static int fotg210_hcd_probe(struct plat - - fotg210_init(fotg210); - -+ if (of_device_is_compatible(dev->of_node, "cortina,gemini-usb")) { -+ retval = fotg210_gemini_init(dev, hcd); -+ if (retval) -+ goto failed_dis_clk; -+ } -+ - retval = usb_add_hcd(hcd, irq, IRQF_SHARED); - if (retval) { - dev_err(dev, "failed to add hcd with err %d\n", retval); diff --git a/target/linux/gemini/patches-5.15/0002-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch b/target/linux/gemini/patches-5.15/0002-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch deleted file mode 100644 index 78a163afd87..00000000000 --- a/target/linux/gemini/patches-5.15/0002-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 36ee838bf83c01cff7cb47c7b07be278d2950ac0 Mon Sep 17 00:00:00 2001 -From: Linus Walleij -Date: Mon, 11 Mar 2019 15:44:29 +0100 -Subject: [PATCH 2/2] ARM: dts: Augment DIR-685 partition table for OpenWrt - -Rename the firmware partition so that the firmware MTD -splitter will do its job, drop the rootfs arguments as -the MTD splitter will set this up automatically. - -Signed-off-by: Linus Walleij ---- - arch/arm/boot/dts/gemini-dlink-dir-685.dts | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts -+++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts -@@ -20,7 +20,7 @@ - }; - - chosen { -- bootargs = "console=ttyS0,19200n8 root=/dev/sda1 rw rootwait consoleblank=300"; -+ bootargs = "console=ttyS0,19200n8 consoleblank=300"; - stdout-path = "uart0:19200n8"; - }; - -@@ -317,9 +317,9 @@ - * this is called "upgrade" on the vendor system. - */ - partition@40000 { -- label = "upgrade"; -+ compatible = "wrg"; -+ label = "firmware"; - reg = <0x00040000 0x01f40000>; -- read-only; - }; - /* RGDB, Residental Gateway Database? */ - partition@1f80000 { From 8f033569b4675741796bdd6b5f6ab7548a38b72d Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 28 Sep 2023 15:28:31 +0200 Subject: [PATCH 06/78] Delete arm-magic script This script was used to modify the wrong machine type passed from the boot loader to the kernel. The device tree kernels does not use the machine type so this script is no longer needed. Signed-off-by: Linus Walleij --- scripts/arm-magic.sh | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100755 scripts/arm-magic.sh diff --git a/scripts/arm-magic.sh b/scripts/arm-magic.sh deleted file mode 100755 index b4b0fa94f57..00000000000 --- a/scripts/arm-magic.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# Empty/wrong machtype-workaround generator -# -# Copyright (C) 2006-2012 Imre Kaloz -# based on linux/arch/arm/boot/compressed/head-xscale.S -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# NOTE: for now it's for only IXP4xx in big endian mode - -# list of supported boards, in "boardname machtypeid" format -for board in "avila 526" "gateway7001 731" "nslu2 597" "nas100d 865" "wg302v1 889" "wg302v2 890" "pronghorn 928" "pronghornmetro 1040" "compex 1273" "wrt300nv2 1077" "loft 849" "dsmg600 964" "fsg3 1091" "ap1000 1543" "tw2662 1658" "tw5334 1664" "ixdpg425 604" "cambria 1468" "sidewinder 1041" "ap42x 4418" -do - set -- $board - hexid=$(printf %x\\n $2) - if [ "$2" -lt "256" ]; then - # we have a low machtypeid, we just need a "mov" (e3a) - printf "\xe3\xa0\x10\x$hexid" > $BIN_DIR/$IMG_PREFIX-$1-zImage - else - # we have a high machtypeid, we need a "mov" (e3a) and an "orr" (e38) - if [ "$2" -lt "4096" ]; then - printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "2 3")\xe3\x81\x1c\x$(echo $hexid|cut -b 1)" > $BIN_DIR/$IMG_PREFIX-$1-zImage - else - printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "3 4")\xe3\x81\x1c\x$(echo $hexid|cut -b "1 2")" > $BIN_DIR/$IMG_PREFIX-$1-zImage - fi - fi - # generate the image - cat $BIN_DIR/$IMG_PREFIX-zImage >> $BIN_DIR/$IMG_PREFIX-$1-zImage -done From 89895937dd4a24446b7bfd067398b4f7e73dc7b5 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 23 Sep 2023 10:15:37 -0400 Subject: [PATCH 07/78] kernel: bump 5.15 to 5.15.133 Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.133 Removed upstreamed: bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch[1] Cherry picked build fix.[2] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.133&id=56cf9f446b331414a15ef0e8dedf23583ec2c427 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/queue-5.15/fix-up-backport-of-136191703038-interconnect-teach-l.patch Build system: x86_64 Build-tested: ramips/tplink_archer-a6-v3 Run-tested: ramips/tplink_archer-a6-v3 Signed-off-by: John Audia --- include/kernel-5.15 | 4 +- ...nand-Assign-soc-as-early-as-possible.patch | 8 +- ...-Allow-SoC-to-provide-I-O-operations.patch | 150 ------------------ ...mnand-Avoid-pdev-in-brcmnand_init_cs.patch | 6 +- ...F-operations-out-of-brcmnand_init_cs.patch | 6 +- ...and-Allow-working-without-interrupts.patch | 4 +- ...and-Allow-platform-data-instantation.patch | 14 +- ...A-controller-uses-command-shift-of-0.patch | 2 +- ...8-mtd-rawnand-brcmnand-Add-BCMA-shim.patch | 2 +- ...wnand-brcmnand-disable-WP-on-BCM4908.patch | 2 +- ...lti-gen-LRU-support-page-table-walks.patch | 6 +- .../894-Fix-up-backport-for-13619703038.patch | 31 ++++ .../pending-5.15/834-ledtrig-libata.patch | 2 +- ...move-drivers-from-strlcpy-to-strscpy.patch | 2 +- .../oxnas/patches-5.15/999-libata-hacks.patch | 4 +- 15 files changed, 62 insertions(+), 181 deletions(-) delete mode 100644 target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch create mode 100644 target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 96feed23e07..06bcb632e33 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .132 -LINUX_KERNEL_HASH-5.15.132 = 4177b5c4d6e749bb8339ac4aa68eb0932ead9490b956a80d9a597089959618ac +LINUX_VERSION-5.15 = .133 +LINUX_KERNEL_HASH-5.15.133 = ef845e7934897b88e4448378ea9daacac19e07f156fe904844fab0a7d8ff5ddd diff --git a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch index ce14834fa71..30b6d97a858 100644 --- a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch +++ b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch @@ -14,15 +14,15 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -3033,6 +3033,7 @@ int brcmnand_probe(struct platform_devic +@@ -3059,6 +3059,7 @@ int brcmnand_probe(struct platform_devic dev_set_drvdata(dev, ctrl); ctrl->dev = dev; + ctrl->soc = soc; - init_completion(&ctrl->done); - init_completion(&ctrl->dma_done); -@@ -3173,8 +3174,6 @@ int brcmnand_probe(struct platform_devic + /* Enable the static key if the soc provides I/O operations indicating + * that a non-memory mapped IO access path must be used +@@ -3205,8 +3206,6 @@ int brcmnand_probe(struct platform_devic * interesting ways */ if (soc) { diff --git a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch deleted file mode 100644 index 60671658fed..00000000000 --- a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch +++ /dev/null @@ -1,150 +0,0 @@ -From: Florian Fainelli -Subject: [PATCH v3 2/9] mtd: rawnand: brcmnand: Allow SoC to provide I/O operations -Date: Fri, 07 Jan 2022 10:46:07 -0800 -Content-Type: text/plain; charset="utf-8" - -Allow a brcmnand_soc instance to provide a custom set of I/O operations -which we will require when using this driver on a BCMA bus which is not -directly memory mapped I/O. Update the nand_{read,write}_reg accordingly -to use the SoC operations if provided. - -To minimize the penalty on other SoCs which do support standard MMIO -accesses, we use a static key which is disabled by default and gets -enabled if a soc implementation does provide I/O operations. - -Signed-off-by: Florian Fainelli ---- - drivers/mtd/nand/raw/brcmnand/brcmnand.c | 28 +++++++++++++++++++++-- - drivers/mtd/nand/raw/brcmnand/brcmnand.h | 29 ++++++++++++++++++++++++ - 2 files changed, 55 insertions(+), 2 deletions(-) - ---- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c -+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -207,6 +208,8 @@ enum { - - struct brcmnand_host; - -+static DEFINE_STATIC_KEY_FALSE(brcmnand_soc_has_ops_key); -+ - struct brcmnand_controller { - struct device *dev; - struct nand_controller controller; -@@ -592,15 +595,25 @@ enum { - INTFC_CTLR_READY = BIT(31), - }; - -+static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl) -+{ -+ return static_branch_unlikely(&brcmnand_soc_has_ops_key); -+} -+ - static inline u32 nand_readreg(struct brcmnand_controller *ctrl, u32 offs) - { -+ if (brcmnand_non_mmio_ops(ctrl)) -+ return brcmnand_soc_read(ctrl->soc, offs); - return brcmnand_readl(ctrl->nand_base + offs); - } - - static inline void nand_writereg(struct brcmnand_controller *ctrl, u32 offs, - u32 val) - { -- brcmnand_writel(val, ctrl->nand_base + offs); -+ if (brcmnand_non_mmio_ops(ctrl)) -+ brcmnand_soc_write(ctrl->soc, val, offs); -+ else -+ brcmnand_writel(val, ctrl->nand_base + offs); - } - - static int brcmnand_revision_init(struct brcmnand_controller *ctrl) -@@ -766,13 +779,18 @@ static inline void brcmnand_rmw_reg(stru - - static inline u32 brcmnand_read_fc(struct brcmnand_controller *ctrl, int word) - { -+ if (brcmnand_non_mmio_ops(ctrl)) -+ return brcmnand_soc_read(ctrl->soc, BRCMNAND_NON_MMIO_FC_ADDR); - return __raw_readl(ctrl->nand_fc + word * 4); - } - - static inline void brcmnand_write_fc(struct brcmnand_controller *ctrl, - int word, u32 val) - { -- __raw_writel(val, ctrl->nand_fc + word * 4); -+ if (brcmnand_non_mmio_ops(ctrl)) -+ brcmnand_soc_write(ctrl->soc, val, BRCMNAND_NON_MMIO_FC_ADDR); -+ else -+ __raw_writel(val, ctrl->nand_fc + word * 4); - } - - static inline void edu_writel(struct brcmnand_controller *ctrl, -@@ -3035,6 +3053,12 @@ int brcmnand_probe(struct platform_devic - ctrl->dev = dev; - ctrl->soc = soc; - -+ /* Enable the static key if the soc provides I/O operations indicating -+ * that a non-memory mapped IO access path must be used -+ */ -+ if (brcmnand_soc_has_ops(ctrl->soc)) -+ static_branch_enable(&brcmnand_soc_has_ops_key); -+ - init_completion(&ctrl->done); - init_completion(&ctrl->dma_done); - init_completion(&ctrl->edu_done); ---- a/drivers/mtd/nand/raw/brcmnand/brcmnand.h -+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.h -@@ -11,12 +11,25 @@ - - struct platform_device; - struct dev_pm_ops; -+struct brcmnand_io_ops; -+ -+/* Special register offset constant to intercept a non-MMIO access -+ * to the flash cache register space. This is intentionally large -+ * not to overlap with an existing offset. -+ */ -+#define BRCMNAND_NON_MMIO_FC_ADDR 0xffffffff - - struct brcmnand_soc { - bool (*ctlrdy_ack)(struct brcmnand_soc *soc); - void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en); - void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare, - bool is_param); -+ const struct brcmnand_io_ops *ops; -+}; -+ -+struct brcmnand_io_ops { -+ u32 (*read_reg)(struct brcmnand_soc *soc, u32 offset); -+ void (*write_reg)(struct brcmnand_soc *soc, u32 val, u32 offset); - }; - - static inline void brcmnand_soc_data_bus_prepare(struct brcmnand_soc *soc, -@@ -58,6 +71,22 @@ static inline void brcmnand_writel(u32 v - writel_relaxed(val, addr); - } - -+static inline bool brcmnand_soc_has_ops(struct brcmnand_soc *soc) -+{ -+ return soc && soc->ops && soc->ops->read_reg && soc->ops->write_reg; -+} -+ -+static inline u32 brcmnand_soc_read(struct brcmnand_soc *soc, u32 offset) -+{ -+ return soc->ops->read_reg(soc, offset); -+} -+ -+static inline void brcmnand_soc_write(struct brcmnand_soc *soc, u32 val, -+ u32 offset) -+{ -+ soc->ops->write_reg(soc, val, offset); -+} -+ - int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc); - int brcmnand_remove(struct platform_device *pdev); - diff --git a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch index d514998fd72..46cd377406e 100644 --- a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch +++ b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch @@ -16,7 +16,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -2806,7 +2806,7 @@ static const struct nand_controller_ops +@@ -2814,7 +2814,7 @@ static const struct nand_controller_ops static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn) { struct brcmnand_controller *ctrl = host->ctrl; @@ -25,7 +25,7 @@ Signed-off-by: Florian Fainelli struct mtd_info *mtd; struct nand_chip *chip; int ret; -@@ -2814,7 +2814,7 @@ static int brcmnand_init_cs(struct brcmn +@@ -2822,7 +2822,7 @@ static int brcmnand_init_cs(struct brcmn ret = of_property_read_u32(dn, "reg", &host->cs); if (ret) { @@ -34,7 +34,7 @@ Signed-off-by: Florian Fainelli return -ENXIO; } -@@ -2823,13 +2823,13 @@ static int brcmnand_init_cs(struct brcmn +@@ -2831,13 +2831,13 @@ static int brcmnand_init_cs(struct brcmn nand_set_flash_node(chip, dn); nand_set_controller_data(chip, host); diff --git a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch index 2e2c05a4324..6a17ea7182a 100644 --- a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch +++ b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -2803,7 +2803,7 @@ static const struct nand_controller_ops +@@ -2811,7 +2811,7 @@ static const struct nand_controller_ops .attach_chip = brcmnand_attach_chip, }; @@ -26,7 +26,7 @@ Signed-off-by: Florian Fainelli { struct brcmnand_controller *ctrl = host->ctrl; struct device *dev = ctrl->dev; -@@ -2812,16 +2812,9 @@ static int brcmnand_init_cs(struct brcmn +@@ -2820,16 +2820,9 @@ static int brcmnand_init_cs(struct brcmn int ret; u16 cfg_offs; @@ -43,7 +43,7 @@ Signed-off-by: Florian Fainelli nand_set_controller_data(chip, host); mtd->name = devm_kasprintf(dev, GFP_KERNEL, "brcmnand.%d", host->cs); -@@ -3228,7 +3221,16 @@ int brcmnand_probe(struct platform_devic +@@ -3236,7 +3229,16 @@ int brcmnand_probe(struct platform_devic host->pdev = pdev; host->ctrl = ctrl; diff --git a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch index 0845a7bfa32..ecc3e954ce6 100644 --- a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch +++ b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch @@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli unsigned int dma_irq; int nand_version; -@@ -1642,7 +1642,7 @@ static bool brcmstb_nand_wait_for_comple +@@ -1650,7 +1650,7 @@ static bool brcmstb_nand_wait_for_comple bool err = false; int sts; @@ -32,7 +32,7 @@ Signed-off-by: Florian Fainelli /* switch to interrupt polling and PIO mode */ disable_ctrl_irqs(ctrl); sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY, -@@ -3179,33 +3179,29 @@ int brcmnand_probe(struct platform_devic +@@ -3187,33 +3187,29 @@ int brcmnand_probe(struct platform_devic } /* IRQ */ diff --git a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch index bf9b410102a..b9ad82ecf96 100644 --- a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch +++ b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch @@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli #include #include #include -@@ -2803,7 +2804,8 @@ static const struct nand_controller_ops +@@ -2811,7 +2812,8 @@ static const struct nand_controller_ops .attach_chip = brcmnand_attach_chip, }; @@ -33,7 +33,7 @@ Signed-off-by: Florian Fainelli { struct brcmnand_controller *ctrl = host->ctrl; struct device *dev = ctrl->dev; -@@ -2856,7 +2858,7 @@ static int brcmnand_init_cs(struct brcmn +@@ -2864,7 +2866,7 @@ static int brcmnand_init_cs(struct brcmn if (ret) return ret; @@ -42,7 +42,7 @@ Signed-off-by: Florian Fainelli if (ret) nand_cleanup(chip); -@@ -3025,17 +3027,15 @@ static int brcmnand_edu_setup(struct pla +@@ -3033,17 +3035,15 @@ static int brcmnand_edu_setup(struct pla int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) { @@ -63,7 +63,7 @@ Signed-off-by: Florian Fainelli return -ENODEV; ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL); -@@ -3062,7 +3062,7 @@ int brcmnand_probe(struct platform_devic +@@ -3070,7 +3070,7 @@ int brcmnand_probe(struct platform_devic /* NAND register range */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctrl->nand_base = devm_ioremap_resource(dev, res); @@ -72,7 +72,7 @@ Signed-off-by: Florian Fainelli return PTR_ERR(ctrl->nand_base); /* Enable clock before using NAND registers */ -@@ -3206,7 +3206,6 @@ int brcmnand_probe(struct platform_devic +@@ -3214,7 +3214,6 @@ int brcmnand_probe(struct platform_devic for_each_available_child_of_node(dn, child) { if (of_device_is_compatible(child, "brcm,nandcs")) { @@ -80,7 +80,7 @@ Signed-off-by: Florian Fainelli host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL); if (!host) { -@@ -3226,7 +3225,7 @@ int brcmnand_probe(struct platform_devic +@@ -3234,7 +3233,7 @@ int brcmnand_probe(struct platform_devic nand_set_flash_node(&host->chip, child); @@ -89,7 +89,7 @@ Signed-off-by: Florian Fainelli if (ret) { devm_kfree(dev, host); continue; /* Try all chip-selects */ -@@ -3236,6 +3235,32 @@ int brcmnand_probe(struct platform_devic +@@ -3244,6 +3243,32 @@ int brcmnand_probe(struct platform_devic } } diff --git a/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch index 188d59b7d16..50cc4a6b22a 100644 --- a/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch +++ b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch @@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -916,6 +916,12 @@ static void brcmnand_wr_corr_thresh(stru +@@ -951,6 +951,12 @@ static void brcmnand_wr_corr_thresh(stru static inline int brcmnand_cmd_shift(struct brcmnand_controller *ctrl) { diff --git a/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch index baa48ef5a0d..38fd3a30a65 100644 --- a/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch +++ b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch @@ -187,7 +187,7 @@ Signed-off-by: Florian Fainelli +MODULE_DESCRIPTION("NAND controller driver glue for BCMA chips"); --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -598,7 +598,11 @@ enum { +@@ -627,7 +627,11 @@ enum { static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl) { diff --git a/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch b/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch index 74dddb7f489..65066236db9 100644 --- a/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch +++ b/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch @@ -20,7 +20,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -37,7 +37,11 @@ +@@ -38,7 +38,11 @@ * 1: NAND_WP is set by default, cleared for erase/write operations * 2: NAND_WP is always cleared */ diff --git a/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch b/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch index c89d3c25428..754d97d84b4 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch @@ -382,7 +382,7 @@ Signed-off-by: Andrew Morton } --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1083,6 +1083,7 @@ static struct mm_struct *mm_init(struct +@@ -1091,6 +1091,7 @@ static struct mm_struct *mm_init(struct goto fail_nocontext; mm->user_ns = get_user_ns(user_ns); @@ -390,7 +390,7 @@ Signed-off-by: Andrew Morton return mm; fail_nocontext: -@@ -1125,6 +1126,7 @@ static inline void __mmput(struct mm_str +@@ -1133,6 +1134,7 @@ static inline void __mmput(struct mm_str } if (mm->binfmt) module_put(mm->binfmt->module); @@ -398,7 +398,7 @@ Signed-off-by: Andrew Morton mmdrop(mm); } -@@ -2617,6 +2619,13 @@ pid_t kernel_clone(struct kernel_clone_a +@@ -2625,6 +2627,13 @@ pid_t kernel_clone(struct kernel_clone_a get_task_struct(p); } diff --git a/target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch b/target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch new file mode 100644 index 00000000000..674740eaac3 --- /dev/null +++ b/target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch @@ -0,0 +1,31 @@ +From 16c572ef0646f8b0fa19fbf81b302de8a03127f2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 24 Sep 2023 14:30:44 -0400 +Subject: Fix up backport of 136191703038 ("interconnect: Teach lockdep about + icc_bw_lock order") + +Add a missing include to fix the following build error: + +drivers/interconnect/core.c: In function 'icc_init': +drivers/interconnect/core.c:1148:9: error: implicit declaration of function 'fs_reclaim_acquire' [-Werror=implicit-function-declaration] + 1148 | fs_reclaim_acquire(GFP_KERNEL); + | ^~~~~~~~~~~~~~~~~~ +drivers/interconnect/core.c:1150:9: error: implicit declaration of function 'fs_reclaim_release' [-Werror=implicit-function-declaration] + 1150 | fs_reclaim_release(GFP_KERNEL); + | ^~~~~~~~~~~~~~~~~~ + +Signed-off-by: Sasha Levin +--- + drivers/interconnect/core.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/interconnect/core.c ++++ b/drivers/interconnect/core.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/target/linux/generic/pending-5.15/834-ledtrig-libata.patch b/target/linux/generic/pending-5.15/834-ledtrig-libata.patch index 9c85862a4bd..d61e28b4c38 100644 --- a/target/linux/generic/pending-5.15/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-5.15/834-ledtrig-libata.patch @@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -894,6 +897,12 @@ struct ata_port { +@@ -898,6 +901,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif diff --git a/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch b/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch index 79444e071e8..e3ccef44036 100644 --- a/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch +++ b/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch @@ -72,7 +72,7 @@ Signed-off-by: Wolfram Sang idev->adapter.dev.parent = &pdev->dev; --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c -@@ -1024,7 +1024,7 @@ static int aspeed_i2c_probe_bus(struct p +@@ -1027,7 +1027,7 @@ static int aspeed_i2c_probe_bus(struct p bus->adap.algo = &aspeed_i2c_algo; bus->adap.dev.parent = &pdev->dev; bus->adap.dev.of_node = pdev->dev.of_node; diff --git a/target/linux/oxnas/patches-5.15/999-libata-hacks.patch b/target/linux/oxnas/patches-5.15/999-libata-hacks.patch index f44f6b55ffe..27074071c2b 100644 --- a/target/linux/oxnas/patches-5.15/999-libata-hacks.patch +++ b/target/linux/oxnas/patches-5.15/999-libata-hacks.patch @@ -36,7 +36,7 @@ --- a/include/linux/libata.h +++ b/include/linux/libata.h -@@ -923,6 +923,8 @@ struct ata_port_operations { +@@ -927,6 +927,8 @@ struct ata_port_operations { enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc); unsigned int (*qc_issue)(struct ata_queued_cmd *qc); bool (*qc_fill_rtf)(struct ata_queued_cmd *qc); @@ -45,7 +45,7 @@ /* * Configuration and exception handling -@@ -1013,6 +1015,9 @@ struct ata_port_operations { +@@ -1017,6 +1019,9 @@ struct ata_port_operations { void (*phy_reset)(struct ata_port *ap); void (*eng_timeout)(struct ata_port *ap); From 3aef61060e3f51aa43fe494d5ff173e81dd43003 Mon Sep 17 00:00:00 2001 From: Glen Lee Date: Thu, 29 Jun 2023 15:58:05 -0400 Subject: [PATCH 08/78] ipq806x: add support for Extreme Networks AP3935 Extreme Networks AP3935i/e - https://www.extremenetworks.com/support/documentation/access-points-ap3935i-e/ SoC: IPQ8068 QYY AT46279K45060I RAM: NANYA 1527 NT5CC256M16DP-DI 515073W0EF 7 TW FLASH: NOR - S25FL256S1 - 32MB NAND - Macronix MX30UF4G28AB - 512MB LAN: Atheros AR8035-A J5150WL 1515 CN - RGMII LAN2: Atheros AR8033-AL1A SKCSR.AJ1 1444 China - SGMII WLAN2: QCA9990 OVV FNPV209 K451406 WLAN5: QCA9990 OVV FNPV209 K451406 SERIAL: RS232 Port (115200 8n1) Cisco console cable and 4pin Serial Header | 3.3 | GND | RX | TX MAC address for LAN1/LAN2/WLAN 2G/WLAN 5G in uboot env * Installation via either RJ45 console or on-board 4 PIN header Install Method -------------- 1) Setup TFTP server, and place openwrt-ipq806x-generic-extreme_ap3935-initramfs-uImage image in /srv/tftp or similar 2) Connect to console on router and connect ethernet port "LAN1" to your LAN 3) Interupt the boot with any character 4) Login with admin/new2day for default password (use reset/FactoryDefault if password needs to be reset) 5) Set serverip to TFTP IP: set serverip 192.168.1.2 6) Set ipaddr to another IP: set ipaddr 192.168.1.101 7) Make uboot ping something to activate eth0 on boot: set bootcmd 'ping 192.168.1.1; run boot_flash' saveenv 8) TFTP image to RAM: tftpboot 0x42000000 openwrt-ipq806x-generic-extreme_ap3935i-initramfs-uImage 9) Boot image: bootm 0x42000000 In OpenWRT, "LAN1" is LAN, "LAN2" is WAN 10) SFTP openwrt-ipq806x-generic-extreme_ap3935-squashfs-nand-sysupgrade.bin image to /tmp 11) sysupgrade /tmp/openwrt-*-nand-sysupgrade.bin Signed-off-by: Glen Lee --- package/boot/uboot-envtools/files/ipq806x | 4 + .../ipq806x/base-files/etc/board.d/01_leds | 4 + .../ipq806x/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 5 + .../ipq806x/base-files/etc/init.d/bootcount | 3 + .../base-files/lib/upgrade/platform.sh | 5 + target/linux/ipq806x/config-6.1 | 1 + .../arch/arm/boot/dts/qcom-ipq8068-ap3935.dts | 351 ++++++++++++++++++ target/linux/ipq806x/image/generic.mk | 17 + 9 files changed, 392 insertions(+), 1 deletion(-) create mode 100644 target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ap3935.dts diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x index 01a86c7b19f..443a0e13d40 100644 --- a/package/boot/uboot-envtools/files/ipq806x +++ b/package/boot/uboot-envtools/files/ipq806x @@ -38,6 +38,10 @@ askey,rt4230w-rev6) edgecore,ecw5410) ubootenv_add_uci_config "/dev/mtd11" "0x0" "0x10000" "0x10000" ;; +extreme,ap3935) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" + ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" + ;; linksys,ea7500-v1|\ linksys,ea8500) ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000" diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index 0b64bbb4206..511adc5a50f 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -33,6 +33,10 @@ edgecore,ecw5410) ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0tpt" ;; +extreme,ap3935) + ucidef_set_led_netdev "wan" "wan" "orange:lan1" "eth1" + ucidef_set_led_netdev "lan" "lan" "orange:lan2" "eth0" + ;; meraki,mr52) ucidef_set_led_netdev "eth0" "eth0" "green:lan1" "eth0" ucidef_set_led_netdev "eth1" "eth1" "green:lan2" "eth1" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 3ba3ff79e9e..a4316272e9e 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -39,7 +39,8 @@ ipq806x_setup_interfaces() tplink,onhub) ucidef_set_interfaces_lan_wan "lan1" "wan" ;; - edgecore,ecw5410) + edgecore,ecw5410 |\ + extreme,ap3935) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; qcom,ipq8064-ap161) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 5af3a5b8057..ef5fc344a6f 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -15,6 +15,11 @@ case "$board" in ubnt,unifi-ac-hd) macaddr_add $(mtd_get_mac_binary EEPROM 0x6) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress ;; + extreme,ap3935) + echo "##### PHYNBR=$PHYNBR DEVPATH=$DEVPATH" + [ "$PHYNBR" = "0" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR0) > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR1) > /sys${DEVPATH}/macaddress + ;; esac OPATH=${DEVPATH##/devices/platform/} diff --git a/target/linux/ipq806x/base-files/etc/init.d/bootcount b/target/linux/ipq806x/base-files/etc/init.d/bootcount index cb32a4ed356..ef3c6894e44 100755 --- a/target/linux/ipq806x/base-files/etc/init.d/bootcount +++ b/target/linux/ipq806x/base-files/etc/init.d/bootcount @@ -12,6 +12,9 @@ boot() { edgecore,ecw5410) fw_setenv bootcount 0 ;; + extreme,ap3935) + fw_setenv WATCHDOG_COUNT 0x00000000 + ;; linksys,ea7500-v1 |\ linksys,ea8500) mtd resetbc s_env || true diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 8eda75b7188..7877ecae6ba 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -44,6 +44,11 @@ platform_do_upgrade() { fi nand_do_upgrade "$1" ;; + extreme,ap3935) + CI_ROOTPART="nand_flash" + CI_KERNPART="PriImg" + nand_do_upgrade "$1" + ;; linksys,ea7500-v1 |\ linksys,ea8500) platform_do_upgrade_linksys "$1" diff --git a/target/linux/ipq806x/config-6.1 b/target/linux/ipq806x/config-6.1 index c0086137136..e31e8223800 100644 --- a/target/linux/ipq806x/config-6.1 +++ b/target/linux/ipq806x/config-6.1 @@ -318,6 +318,7 @@ CONFIG_NVMEM_QCOM_QFPROM=y # CONFIG_NVMEM_QCOM_SEC_QFPROM is not set # CONFIG_NVMEM_SPMI_SDAM is not set CONFIG_NVMEM_SYSFS=y +CONFIG_NVMEM_U_BOOT_ENV=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ap3935.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ap3935.dts new file mode 100644 index 00000000000..5c75de8f8df --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ap3935.dts @@ -0,0 +1,351 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8064-v2.0.dtsi" + +#include +#include + +/ { + model = "Extreme Networks AP3935"; + compatible = "extreme,ap3935", "qcom,ipq8064"; + + memory@0 { + reg = <0x41400000 0x3ec00000>; + device_type = "memory"; + }; + + aliases { + serial0 = &gsbi7_serial; + serial1 = &gsbi2_serial; + mdio-gpio0 = &mdio0; + ethernet0 = &gmac0; + ethernet1 = &gmac2; + + led-boot = &led_power_green; + led-failsafe = &led_power_orange; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-override = "ubi.block=0,0 root=/dev/ubiblock0_0"; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 56 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + wakeup-source; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&qcom_pinmux 22 GPIO_ACTIVE_LOW>; + }; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&qcom_pinmux 23 GPIO_ACTIVE_LOW>; + }; + + led_wlan2g_green { + label = "green:wlan2g"; + gpios = <&qcom_pinmux 24 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_wlan5g_green { + label = "green:wlan5g"; + gpios = <&qcom_pinmux 25 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led_lan1_green { + label = "green:lan1"; + gpios = <&qcom_pinmux 26 GPIO_ACTIVE_LOW>; + }; + + led_lan1_orange { + label = "orange:lan1"; + gpios = <&qcom_pinmux 27 GPIO_ACTIVE_LOW>; + }; + + led_lan2_green { + label = "green:lan2"; + gpios = <&qcom_pinmux 28 GPIO_ACTIVE_LOW>; + }; + + led_lan2_orange { + label = "orange:lan2"; + gpios = <&qcom_pinmux 29 GPIO_ACTIVE_LOW>; + }; + }; +}; + + +&qcom_pinmux { + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19"; + function = "gsbi5"; + drive-strength = <10>; + bias-pull-down; + }; + + clk { + pins = "gpio21"; + function = "gsbi5"; + drive-strength = <12>; + bias-pull-down; + }; + + cs { + pins = "gpio20"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + }; + }; + + led_pins: led_pins { + mux { + pins = "gpio22", "gpio23", "gpio24", "gpio25", + "gpio26", "gpio27", "gpio28", "gpio29"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + }; + }; + + button_pins: button_pins { + mux { + pins = "gpio56"; + function = "gpio"; + bias-pull-up; + }; + }; +}; + +&gsbi2 { + qcom,mode = ; + status = "okay"; + + gsbi2_serial: serial@12490000 { + status = "okay"; + }; +}; + +&gsbi4 { + qcom,mode = ; + status = "okay"; + + serial@16340000 { + status = "disabled"; + }; +}; + +&gsbi7 { + qcom,mode = ; + status = "okay"; + + gsbi7_serial: serial@16640000 { + status = "okay"; + }; +}; + +&gsbi5 { + qcom,mode = ; + status = "okay"; + + spi4: spi@1a280000 { + status = "okay"; + spi-max-frequency = <50000000>; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + + cfg1@02a0000 { + compatible = "u-boot,env-redundant-bool"; + label = "CFG1"; + reg = <0x02a0000 0x0010000>; + + ethaddr: ethaddr { + }; + }; + + bootpri@02b0000 { + label = "BootPRI"; + reg = <0x02b0000 0x0080000>; + }; + + cfg2@0330000 { + label = "CFG2"; + reg = <0x0330000 0x0010000>; + }; + + fs@0340000 { + label = "FS"; + reg = <0x0340000 0x0080000>; + }; + + priimg@03c0000 { + label = "PriImg"; + reg = <0x03c0000 0x0e10000>; + }; + + secimg@11d0000 { + label = "SecImg"; + reg = <0x11d0000 0x0e10000>; + }; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; + + /delete-property/ pinctrl-0; + /delete-property/ pinctrl-names; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&pcie1 { + status = "okay"; + + /delete-property/ pinctrl-0; + /delete-property/ pinctrl-names; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&nand { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + compatible = "qcom,nandcs"; + + reg = <0>; + + nand-ecc-strength = <8>; + nand-bus-width = <8>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + ubi@0 { + label = "ubi"; + reg = <0x0000000 0x20000000>; + }; + }; + }; +}; + +&soc { + mdio1: mdio { + compatible = "virtual,mdio-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + + phy2: ethernet-phy@2 { + reg = <2>; + }; + }; +}; + +&gmac0 { + status = "okay"; + + qcom,id = <0>; + mdiobus = <&mdio1>; + + phy-mode = "rgmii"; + phy-handle = <&phy1>; + + nvmem-cells = <ðaddr>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + + qcom,id = <2>; + mdiobus = <&mdio1>; + + phy-mode = "sgmii"; + phy-handle = <&phy2>; +}; + +&adm_dma { + status = "okay"; +}; diff --git a/target/linux/ipq806x/image/generic.mk b/target/linux/ipq806x/image/generic.mk index 0339a612d8e..b3743c35e31 100644 --- a/target/linux/ipq806x/image/generic.mk +++ b/target/linux/ipq806x/image/generic.mk @@ -160,6 +160,23 @@ define Device/edgecore_ecw5410 endef TARGET_DEVICES += edgecore_ecw5410 +define Device/extreme_ap3935 + $(call Device/LegacyImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Extreme Networks + DEVICE_MODEL := AP3935 + SOC := qcom-ipq8068 + PAGESIZE := 2048 + BLOCKSIZE := 128k + KERNEL = kernel-bin | append-dtb | uImage none | append-uImage-fakehdr filesystem + KERNEL_LOADADDR = 0x41408000 + KERNEL_SIZE := 14400k + KERNEL_SUFFIX := -uImage + UBINIZE_OPTS := -E 5 + DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct +endef +TARGET_DEVICES += extreme_ap3935 + define Device/linksys_ea7500-v1 $(call Device/LegacyImage) $(Device/kernel-size-migration) From e53ed6af8744b588ca9da5f395b427a0b0d659ba Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Mon, 31 Jul 2023 08:10:23 +0200 Subject: [PATCH 09/78] linux-atm: use target specific kernel headers There are a few targets that mess with the atm kernel headers. To avoid incompatibility between kernel and user space during compilation, the correct headers should be used. Consequently, the package must also be marked as nonshared. Signed-off-by: Martin Schiller --- package/network/utils/linux-atm/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile index c74febcbbc3..43f4b6556b5 100644 --- a/package/network/utils/linux-atm/Makefile +++ b/package/network/utils/linux-atm/Makefile @@ -21,6 +21,7 @@ PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ PKG_CPE_ID:=cpe:/a:linux-atm:linux-atm PKG_FIXUP:=autoreconf +PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk @@ -98,6 +99,8 @@ endef $(foreach t,$(ATM_DEBUG_TOOLS),$(eval $(call GenAtmPlugin,atm-$(t),$(t)))) +TARGET_CFLAGS += -I$(LINUX_DIR)/user_headers/include + define Build/Configure $(call Build/Configure/Default) # prevent autoheader invocation From 7fc91be56431ae7ecd19f1f26302769264ffd4eb Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 5 Oct 2023 12:40:34 +0200 Subject: [PATCH 10/78] ipq806x: fix wrong QCA8K LED definition for NEC Aterm WG2600HP3 Fix copy-paste error in migrating NEC Aterm WG2600HP3 to new LED implementation for the QCA8K switch. Correct define the missing additional LED pin used for each port and fix wrong color for LED 2 for each port. Also add the required function-enumerator as all 3 LED have the same color and function. Fixes: c707cff6c94b ("ipq806x: add LEDs definition for non-standard qca8k LEDs") Signed-off-by: Christian Marangi --- .../arm/boot/dts/qcom-ipq8062-wg2600hp3.dts | 60 +++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts index 2c181bd8830..04f4b7cd023 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts @@ -451,13 +451,23 @@ reg = <0>; color = ; function = LED_FUNCTION_WAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; function = LED_FUNCTION_WAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_WAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -477,13 +487,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -503,13 +523,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -529,13 +559,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -555,13 +595,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; From ed3ccf44e600b7f8553f84c77b29fef9498f7cd7 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 5 Oct 2023 20:40:12 +0200 Subject: [PATCH 11/78] mediatek: fix wrong variable name in patch for Linux 6.1 The name of the variable holding the pointer to the private struct has changed between Linux 5.15 and Linux 6.1 and adding the identical patch fixing PCIe #PERST de-assert broke the build on Linux 6.1. Also change the name in the patch to fix the build. Fixes: 6a2e17d5c1 ("mediatek: fix PCIe #PERST being de-asserted too early") Signed-off-by: Daniel Golle --- .../611-pcie-mediatek-gen3-PERST-for-100ms.patch | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/target/linux/mediatek/patches-6.1/611-pcie-mediatek-gen3-PERST-for-100ms.patch b/target/linux/mediatek/patches-6.1/611-pcie-mediatek-gen3-PERST-for-100ms.patch index f88efc07320..5e343d01cce 100644 --- a/target/linux/mediatek/patches-6.1/611-pcie-mediatek-gen3-PERST-for-100ms.patch +++ b/target/linux/mediatek/patches-6.1/611-pcie-mediatek-gen3-PERST-for-100ms.patch @@ -1,19 +1,17 @@ --- a/drivers/pci/controller/pcie-mediatek-gen3.c +++ b/drivers/pci/controller/pcie-mediatek-gen3.c -@@ -350,9 +350,15 @@ static int mtk_pcie_startup_port(struct +@@ -350,7 +350,13 @@ static int mtk_pcie_startup_port(struct msleep(100); /* De-assert reset signals */ - val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB); + val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB); - writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); - ++ writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); ++ + msleep(100); + + /* De-assert PERST# signals */ + val &= ~(PCIE_PE_RSTB); -+ writel_relaxed(val, port->base + PCIE_RST_CTRL_REG); -+ + writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); + /* Check if the link is up or not */ - err = readl_poll_timeout(pcie->base + PCIE_LINK_STATUS_REG, val, - !!(val & PCIE_PORT_LINKUP), 20, From 2e3ea6d2066fdbb7955df61711c7a0c372c6626b Mon Sep 17 00:00:00 2001 From: Javier Tia Date: Tue, 3 Oct 2023 16:54:38 -0600 Subject: [PATCH 12/78] armsr: armv8: Enable KASLR in kernel 6.1 In userspace, ASLR is enabled, but it's missing to enable KASLR on the kernel side to improve security as part of SystemReady recommendations. Signed-off-by: Javier Tia --- target/linux/armsr/armv8/config-6.1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/armsr/armv8/config-6.1 b/target/linux/armsr/armv8/config-6.1 index 4eab79bba96..0ead9730641 100644 --- a/target/linux/armsr/armv8/config-6.1 +++ b/target/linux/armsr/armv8/config-6.1 @@ -599,6 +599,10 @@ CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_RASPBERRYPI_POWER=y +CONFIG_RANDOMIZE_BASE=y +CONFIG_RANDOMIZE_MODULE_REGION_FULL=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RELOCATABLE=y # CONFIG_RAVB is not set CONFIG_RCAR_DMAC=y # CONFIG_RCAR_GEN3_THERMAL is not set From 79ba851a8aabab9a21a9dec373f5559cce87f88c Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 5 Oct 2023 00:25:18 +0200 Subject: [PATCH 13/78] generic: rtl8366_smi: rename and drop conflicting vlan GPL symbols Symbol rtl8366_enable_vlan and rtl8366_reset_vlan are also present in the DSA driver upstream and conflicts as they are EXPORTED. Rename them to rtl8366_smi_enable_vlan and rtl8366_smi_reset_vlan to fix the conflict. While at it also make them static and drop the EXPORT_SYMBOL_GPL as they are not actually used by any other driver and exporting them is useless. Signed-off-by: Christian Marangi --- .../files/drivers/net/phy/rtl8366_smi.c | 31 +++++++++---------- .../files/drivers/net/phy/rtl8366_smi.h | 4 --- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c index e8375e51478..028b9916e78 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -590,7 +590,7 @@ static int rtl8366_set_pvid(struct rtl8366_smi *smi, unsigned port, return -ENOSPC; } -int rtl8366_enable_vlan(struct rtl8366_smi *smi, int enable) +static int rtl8366_smi_enable_vlan(struct rtl8366_smi *smi, int enable) { int err; @@ -607,9 +607,8 @@ int rtl8366_enable_vlan(struct rtl8366_smi *smi, int enable) return err; } -EXPORT_SYMBOL_GPL(rtl8366_enable_vlan); -static int rtl8366_enable_vlan4k(struct rtl8366_smi *smi, int enable) +static int rtl8366_smi_enable_vlan4k(struct rtl8366_smi *smi, int enable) { int err; @@ -629,7 +628,7 @@ static int rtl8366_enable_vlan4k(struct rtl8366_smi *smi, int enable) return 0; } -int rtl8366_enable_all_ports(struct rtl8366_smi *smi, int enable) +static int rtl8366_smi_enable_all_ports(struct rtl8366_smi *smi, int enable) { int port; int err; @@ -642,16 +641,15 @@ int rtl8366_enable_all_ports(struct rtl8366_smi *smi, int enable) return 0; } -EXPORT_SYMBOL_GPL(rtl8366_enable_all_ports); -int rtl8366_reset_vlan(struct rtl8366_smi *smi) +static int rtl8366_smi_reset_vlan(struct rtl8366_smi *smi) { struct rtl8366_vlan_mc vlanmc; int err; int i; - rtl8366_enable_vlan(smi, 0); - rtl8366_enable_vlan4k(smi, 0); + rtl8366_smi_enable_vlan(smi, 0); + rtl8366_smi_enable_vlan4k(smi, 0); /* clear VLAN member configurations */ vlanmc.vid = 0; @@ -667,14 +665,13 @@ int rtl8366_reset_vlan(struct rtl8366_smi *smi) return 0; } -EXPORT_SYMBOL_GPL(rtl8366_reset_vlan); static int rtl8366_init_vlan(struct rtl8366_smi *smi) { int port; int err; - err = rtl8366_reset_vlan(smi); + err = rtl8366_smi_reset_vlan(smi); if (err) return err; @@ -695,7 +692,7 @@ static int rtl8366_init_vlan(struct rtl8366_smi *smi) return err; } - return rtl8366_enable_vlan(smi, 1); + return rtl8366_smi_enable_vlan(smi, 1); } #ifdef CONFIG_RTL8366_SMI_DEBUG_FS @@ -1073,15 +1070,15 @@ int rtl8366_sw_reset_switch(struct switch_dev *dev) if (err) return err; - err = rtl8366_reset_vlan(smi); + err = rtl8366_smi_reset_vlan(smi); if (err) return err; - err = rtl8366_enable_vlan(smi, 1); + err = rtl8366_smi_enable_vlan(smi, 1); if (err) return err; - return rtl8366_enable_all_ports(smi, 1); + return rtl8366_smi_enable_all_ports(smi, 1); } EXPORT_SYMBOL_GPL(rtl8366_sw_reset_switch); @@ -1343,9 +1340,9 @@ int rtl8366_sw_set_vlan_enable(struct switch_dev *dev, return -EINVAL; if (attr->ofs == 1) - err = rtl8366_enable_vlan(smi, val->value.i); + err = rtl8366_smi_enable_vlan(smi, val->value.i); else - err = rtl8366_enable_vlan4k(smi, val->value.i); + err = rtl8366_smi_enable_vlan4k(smi, val->value.i); return err; } @@ -1494,7 +1491,7 @@ int rtl8366_smi_init(struct rtl8366_smi *smi) goto err_free_sck; } - err = rtl8366_enable_all_ports(smi, 1); + err = rtl8366_smi_enable_all_ports(smi, 1); if (err) goto err_free_sck; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h index d1d988a3727..fabc9402780 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h @@ -115,10 +115,6 @@ int rtl8366_smi_write_reg_noack(struct rtl8366_smi *smi, u32 addr, u32 data); int rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data); int rtl8366_smi_rmwr(struct rtl8366_smi *smi, u32 addr, u32 mask, u32 data); -int rtl8366_reset_vlan(struct rtl8366_smi *smi); -int rtl8366_enable_vlan(struct rtl8366_smi *smi, int enable); -int rtl8366_enable_all_ports(struct rtl8366_smi *smi, int enable); - #ifdef CONFIG_RTL8366_SMI_DEBUG_FS int rtl8366_debugfs_open(struct inode *inode, struct file *file); #endif From d382756b851571e13d1d97cf29de697385e6bfff Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 20 Sep 2023 15:02:40 +0200 Subject: [PATCH 14/78] ath79: mikrotik: fix build error with kernel 6.1 drivers/mfd/rb4xx-cpld.c:167:19: error: initialization of 'void (*)(struct spi_device *)' from incompatible pointer type 'int (*)(struct spi_device *)' [-Werror=incompatible-pointer-types] 167 | .remove = rb4xx_cpld_remove, | ^~~~~~~~~~~~~~~~~ drivers/mfd/rb4xx-cpld.c:167:19: note: (near initialization for 'rb4xx_cpld_driver.remove') cc1: some warnings being treated as errors make[8]: *** [scripts/Makefile.build:250: drivers/mfd/rb4xx-cpld.o] Error 1 make[7]: *** [scripts/Makefile.build:500: drivers/mfd] Error 2 make[6]: *** [scripts/Makefile.build:500: drivers] Error 2 make[5]: *** [Makefile:2012: .] Error 2 As the allocated function does nothing, simply delete it. Signed-off-by: Koen Vandeputte --- target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c b/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c index da18424c633..148157aa7b7 100644 --- a/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c +++ b/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c @@ -151,11 +151,6 @@ static int rb4xx_cpld_probe(struct spi_device *spi) NULL, 0, NULL); } -static int rb4xx_cpld_remove(struct spi_device *spi) -{ - return 0; -} - static const struct of_device_id rb4xx_cpld_dt_match[] = { { .compatible = "mikrotik,rb4xx-cpld", }, { }, @@ -164,7 +159,6 @@ MODULE_DEVICE_TABLE(of, rb4xx_cpld_dt_match); static struct spi_driver rb4xx_cpld_driver = { .probe = rb4xx_cpld_probe, - .remove = rb4xx_cpld_remove, .driver = { .name = "rb4xx-cpld", .bus = &spi_bus_type, From cee7bfde3caa18a4ff6d942f0c83398243e86b30 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 6 Oct 2023 11:58:59 +0200 Subject: [PATCH 15/78] generic: 6.1: add missing config SPI_BCM63XX_HSSPI Add missing config SPI_BCM63XX_HSSPI for kernel 6.1 triggered on compilation of bcm4908. Signed-off-by: Christian Marangi --- target/linux/generic/config-6.1 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-6.1 b/target/linux/generic/config-6.1 index 5796cbb67c8..8c078b20118 100644 --- a/target/linux/generic/config-6.1 +++ b/target/linux/generic/config-6.1 @@ -6480,6 +6480,7 @@ CONFIG_SND_X86=y # CONFIG_SPI_AX88796C is not set # CONFIG_SPI_AXI_SPI_ENGINE is not set # CONFIG_SPI_BCM2835 is not set +# CONFIG_SPI_BCM63XX_HSSPI is not set # CONFIG_SPI_BCM_QSPI is not set # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_BUTTERFLY is not set From c951291df9941c70683cb1bbdb1c950724cc8b91 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 6 Oct 2023 12:15:53 +0200 Subject: [PATCH 16/78] generic: 6.1: fix compilation warning for CONFIG_PROC_STRIPPED Fix compilation warning for CONFIG_PROC_STRIPPED for kernel 6.1. Fix compilation warning: make[4]: Leaving directory '/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-ath79_tiny/linux-6.1.55' net/ipv4/inet_timewait_sock.c: In function '__inet_twsk_schedule': net/ipv4/inet_timewait_sock.c:272:22: error: unused variable 'kill' [-Werror=unused-variable] 272 | bool kill = timeo <= 4*HZ; | ^~~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi --- target/linux/generic/hack-6.1/902-debloat_proc.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/linux/generic/hack-6.1/902-debloat_proc.patch b/target/linux/generic/hack-6.1/902-debloat_proc.patch index 23de30f4923..33b408a476f 100644 --- a/target/linux/generic/hack-6.1/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.1/902-debloat_proc.patch @@ -406,3 +406,14 @@ Signed-off-by: Felix Fietkau return register_pernet_subsys(&ip_rt_proc_ops); } +--- a/net/ipv4/inet_timewait_sock.c ++++ b/net/ipv4/inet_timewait_sock.c +@@ -269,7 +269,7 @@ void __inet_twsk_schedule(struct inet_ti + */ + + if (!rearm) { +- bool kill = timeo <= 4*HZ; ++ bool __maybe_unused kill = timeo <= 4*HZ; + + __NET_INC_STATS(twsk_net(tw), kill ? LINUX_MIB_TIMEWAITKILLED : + LINUX_MIB_TIMEWAITED); From b0048b314620cc99f155c8c5cd4541af5e99e578 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 6 Oct 2023 12:49:09 +0200 Subject: [PATCH 17/78] generic: 6.1: add patch enabling assisted learning for qca8k Add patch enabling assisted learning for qca8k to fix roaming issue between BSS and BSS on the same L2 broadcast domain. Signed-off-by: Christian Marangi --- ...enable-assisted-learning-on-CPU-port.patch | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch diff --git a/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch new file mode 100644 index 00000000000..5b1f07749a6 --- /dev/null +++ b/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch @@ -0,0 +1,57 @@ +From 0f6599167c126ce32c85d4f8a1f3d1775a268572 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Fri, 6 Oct 2023 12:44:00 +0200 +Subject: [PATCH] net: dsa: qca8k: enable assisted learning on CPU port + +Enable assisted learning on CPU port. + +It has been verified that there is a problem in packet roaming +from one BSS to another in the same security settings from one +physical R7800 to another physical R7800 where they are in the +same L2 broadcast domain backhauled/linked together via one +of the ethernet ports. +DHCP will fail to complete and traffic cannot flow for around 300 +seconds. + +Signed-off-by: Christian Marangi +--- + drivers/net/dsa/qca/qca8k-8xxx.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/drivers/net/dsa/qca/qca8k-8xxx.c ++++ b/drivers/net/dsa/qca/qca8k-8xxx.c +@@ -1991,6 +1991,12 @@ qca8k_setup(struct dsa_switch *ds) + dev_err(priv->dev, "failed enabling QCA header mode on port %d", dp->index); + return ret; + } ++ ++ /* Disable learning by default on all ports */ ++ ret = regmap_clear_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(dp->index), ++ QCA8K_PORT_LOOKUP_LEARN); ++ if (ret) ++ return ret; + } + + /* Forward all unknown frames to CPU port for Linux processing */ +@@ -2020,11 +2026,6 @@ qca8k_setup(struct dsa_switch *ds) + if (ret) + return ret; + +- ret = regmap_clear_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(port), +- QCA8K_PORT_LOOKUP_LEARN); +- if (ret) +- return ret; +- + /* For port based vlans to work we need to set the + * default egress vid + */ +@@ -2076,6 +2077,9 @@ qca8k_setup(struct dsa_switch *ds) + /* Set max number of LAGs supported */ + ds->num_lag_ids = QCA8K_NUM_LAGS; + ++ /* HW learn on CPU port is limited and require manual setting */ ++ ds->assisted_learning_on_cpu_port = true; ++ + return 0; + } + From 20d74c68112a2e7a6b4ce6eaf1aeeb136f0d2ed0 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 6 Oct 2023 18:41:05 +0200 Subject: [PATCH 18/78] generic: 6.1: backport qca8k fixes for big endian and MDIO Backport qca8k fixes for big endian system (to make them working again) and a patch fixing MDIO conflicts if other PHY are connected and mgmt eth is used to control the switch. Signed-off-by: Christian Marangi --- ...x-regmap-bulk-read-write-methods-on-.patch | 61 ++++++++++ ...x-potential-MDIO-bus-conflict-when-a.patch | 106 ++++++++++++++++++ ...a8k-move-qca8k_port_to_phy-to-header.patch | 2 +- ...net-dsa-qca8k-add-LEDs-basic-support.patch | 2 +- ...-qca8k-implement-lag_fdb_add-del-ops.patch | 2 +- ...a8k-enable-flooding-to-both-CPU-port.patch | 2 +- ...k-add-support-for-port_change_master.patch | 4 +- ...enable-assisted-learning-on-CPU-port.patch | 6 +- 8 files changed, 176 insertions(+), 9 deletions(-) create mode 100644 target/linux/generic/backport-6.1/781-v6.6-01-net-dsa-qca8k-fix-regmap-bulk-read-write-methods-on-.patch create mode 100644 target/linux/generic/backport-6.1/781-v6.6-02-net-dsa-qca8k-fix-potential-MDIO-bus-conflict-when-a.patch diff --git a/target/linux/generic/backport-6.1/781-v6.6-01-net-dsa-qca8k-fix-regmap-bulk-read-write-methods-on-.patch b/target/linux/generic/backport-6.1/781-v6.6-01-net-dsa-qca8k-fix-regmap-bulk-read-write-methods-on-.patch new file mode 100644 index 00000000000..632f422d1ff --- /dev/null +++ b/target/linux/generic/backport-6.1/781-v6.6-01-net-dsa-qca8k-fix-regmap-bulk-read-write-methods-on-.patch @@ -0,0 +1,61 @@ +From 5652d1741574eb89cc02576e50ee3e348bd6dd77 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Wed, 4 Oct 2023 11:19:03 +0200 +Subject: [PATCH 1/2] net: dsa: qca8k: fix regmap bulk read/write methods on + big endian systems +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit c766e077d927 ("net: dsa: qca8k: convert to regmap read/write +API") introduced bulk read/write methods to qca8k's regmap. + +The regmap bulk read/write methods get the register address in a buffer +passed as a void pointer parameter (the same buffer contains also the +read/written values). The register address occupies only as many bytes +as it requires at the beginning of this buffer. For example if the +.reg_bits member in regmap_config is 16 (as is the case for this +driver), the register address occupies only the first 2 bytes in this +buffer, so it can be cast to u16. + +But the original commit implementing these bulk read/write methods cast +the buffer to u32: + u32 reg = *(u32 *)reg_buf & U16_MAX; +taking the first 4 bytes. This works on little endian systems where the +first 2 bytes of the buffer correspond to the low 16-bits, but it +obviously cannot work on big endian systems. + +Fix this by casting the beginning of the buffer to u16 as + u32 reg = *(u16 *)reg_buf; + +Fixes: c766e077d927 ("net: dsa: qca8k: convert to regmap read/write API") +Signed-off-by: Marek Behún +Tested-by: Christian Marangi +Reviewed-by: Christian Marangi +Signed-off-by: David S. Miller +--- + drivers/net/dsa/qca/qca8k-8xxx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/dsa/qca/qca8k-8xxx.c ++++ b/drivers/net/dsa/qca/qca8k-8xxx.c +@@ -504,8 +504,8 @@ qca8k_bulk_read(void *ctx, const void *r + void *val_buf, size_t val_len) + { + int i, count = val_len / sizeof(u32), ret; +- u32 reg = *(u32 *)reg_buf & U16_MAX; + struct qca8k_priv *priv = ctx; ++ u32 reg = *(u16 *)reg_buf; + + if (priv->mgmt_master && + !qca8k_read_eth(priv, reg, val_buf, val_len)) +@@ -526,8 +526,8 @@ qca8k_bulk_gather_write(void *ctx, const + const void *val_buf, size_t val_len) + { + int i, count = val_len / sizeof(u32), ret; +- u32 reg = *(u32 *)reg_buf & U16_MAX; + struct qca8k_priv *priv = ctx; ++ u32 reg = *(u16 *)reg_buf; + u32 *val = (u32 *)val_buf; + + if (priv->mgmt_master && diff --git a/target/linux/generic/backport-6.1/781-v6.6-02-net-dsa-qca8k-fix-potential-MDIO-bus-conflict-when-a.patch b/target/linux/generic/backport-6.1/781-v6.6-02-net-dsa-qca8k-fix-potential-MDIO-bus-conflict-when-a.patch new file mode 100644 index 00000000000..fc573ccb3aa --- /dev/null +++ b/target/linux/generic/backport-6.1/781-v6.6-02-net-dsa-qca8k-fix-potential-MDIO-bus-conflict-when-a.patch @@ -0,0 +1,106 @@ +From 526c8ee04bdbd4d8d19a583b1f3b06700229a815 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Wed, 4 Oct 2023 11:19:04 +0200 +Subject: [PATCH 2/2] net: dsa: qca8k: fix potential MDIO bus conflict when + accessing internal PHYs via management frames +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Besides the QCA8337 switch the Turris 1.x device has on it's MDIO bus +also Micron ethernet PHY (dedicated to the WAN port). + +We've been experiencing a strange behavior of the WAN ethernet +interface, wherein the WAN PHY started timing out the MDIO accesses, for +example when the interface was brought down and then back up. + +Bisecting led to commit 2cd548566384 ("net: dsa: qca8k: add support for +phy read/write with mgmt Ethernet"), which added support to access the +QCA8337 switch's internal PHYs via management ethernet frames. + +Connecting the MDIO bus pins onto an oscilloscope, I was able to see +that the MDIO bus was active whenever a request to read/write an +internal PHY register was done via an management ethernet frame. + +My theory is that when the switch core always communicates with the +internal PHYs via the MDIO bus, even when externally we request the +access via ethernet. This MDIO bus is the same one via which the switch +and internal PHYs are accessible to the board, and the board may have +other devices connected on this bus. An ASCII illustration may give more +insight: + + +---------+ + +----| | + | | WAN PHY | + | +--| | + | | +---------+ + | | + | | +----------------------------------+ + | | | QCA8337 | +MDC | | | +-------+ | +------o-+--|--------o------------o--| | | +MDIO | | | | | PHY 1 |-|--to RJ45 +--------o--|---o----+---------o--+--| | | + | | | | | +-------+ | + | +-------------+ | o--| | | + | | MDIO MDC | | | | PHY 2 |-|--to RJ45 +eth1 | | | o--+--| | | +-----------|-|port0 | | | +-------+ | + | | | | o--| | | + | | switch core | | | | PHY 3 |-|--to RJ45 + | +-------------+ o--+--| | | + | | | +-------+ | + | | o--| ... | | + +----------------------------------+ + +When we send a request to read an internal PHY register via an ethernet +management frame via eth1, the switch core receives the ethernet frame +on port 0 and then communicates with the internal PHY via MDIO. At this +time, other potential devices, such as the WAN PHY on Turris 1.x, cannot +use the MDIO bus, since it may cause a bus conflict. + +Fix this issue by locking the MDIO bus even when we are accessing the +PHY registers via ethernet management frames. + +Fixes: 2cd548566384 ("net: dsa: qca8k: add support for phy read/write with mgmt Ethernet") +Signed-off-by: Marek Behún +Reviewed-by: Christian Marangi +Signed-off-by: David S. Miller +--- + drivers/net/dsa/qca/qca8k-8xxx.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/dsa/qca/qca8k-8xxx.c ++++ b/drivers/net/dsa/qca/qca8k-8xxx.c +@@ -665,6 +665,15 @@ qca8k_phy_eth_command(struct qca8k_priv + goto err_read_skb; + } + ++ /* It seems that accessing the switch's internal PHYs via management ++ * packets still uses the MDIO bus within the switch internally, and ++ * these accesses can conflict with external MDIO accesses to other ++ * devices on the MDIO bus. ++ * We therefore need to lock the MDIO bus onto which the switch is ++ * connected. ++ */ ++ mutex_lock(&priv->bus->mdio_lock); ++ + /* Actually start the request: + * 1. Send mdio master packet + * 2. Busy Wait for mdio master command +@@ -677,6 +686,7 @@ qca8k_phy_eth_command(struct qca8k_priv + mgmt_master = priv->mgmt_master; + if (!mgmt_master) { + mutex_unlock(&mgmt_eth_data->mutex); ++ mutex_unlock(&priv->bus->mdio_lock); + ret = -EINVAL; + goto err_mgmt_master; + } +@@ -764,6 +774,7 @@ exit: + QCA8K_ETHERNET_TIMEOUT); + + mutex_unlock(&mgmt_eth_data->mutex); ++ mutex_unlock(&priv->bus->mdio_lock); + + return ret; + diff --git a/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch b/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch index 3c89819ac08..f6a025fa12a 100644 --- a/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch +++ b/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch @@ -20,7 +20,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -778,21 +778,6 @@ err_clear_skb: +@@ -789,21 +789,6 @@ err_clear_skb: return ret; } diff --git a/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch b/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch index 58478f56ccc..4bd84223ef3 100644 --- a/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch +++ b/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch @@ -71,7 +71,7 @@ Signed-off-by: David S. Miller static void qca8k_split_addr(u32 regaddr, u16 *r1, u16 *r2, u16 *page) -@@ -1829,6 +1830,10 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1840,6 +1841,10 @@ qca8k_setup(struct dsa_switch *ds) if (ret) return ret; diff --git a/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch b/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch index 04935d0d7a9..b03bb622d32 100644 --- a/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch +++ b/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch @@ -16,7 +16,7 @@ Signed-off-by: Christian Marangi --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1993,6 +1993,8 @@ static const struct dsa_switch_ops qca8k +@@ -2004,6 +2004,8 @@ static const struct dsa_switch_ops qca8k .port_fdb_add = qca8k_port_fdb_add, .port_fdb_del = qca8k_port_fdb_del, .port_fdb_dump = qca8k_port_fdb_dump, diff --git a/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch b/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch index 27539b9074a..8ba89ccfa59 100644 --- a/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch +++ b/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch @@ -14,7 +14,7 @@ Signed-off-by: Christian Marangi --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1882,15 +1882,12 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1893,15 +1893,12 @@ qca8k_setup(struct dsa_switch *ds) } } diff --git a/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch b/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch index 53a29f547a1..bf1415b939f 100644 --- a/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch +++ b/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch @@ -26,7 +26,7 @@ Signed-off-by: Christian Marangi --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1719,6 +1719,117 @@ qca8k_get_tag_protocol(struct dsa_switch +@@ -1730,6 +1730,117 @@ qca8k_get_tag_protocol(struct dsa_switch return DSA_TAG_PROTO_QCA; } @@ -144,7 +144,7 @@ Signed-off-by: Christian Marangi static void qca8k_master_change(struct dsa_switch *ds, const struct net_device *master, bool operational) -@@ -2005,8 +2116,9 @@ static const struct dsa_switch_ops qca8k +@@ -2016,8 +2127,9 @@ static const struct dsa_switch_ops qca8k .phylink_mac_link_down = qca8k_phylink_mac_link_down, .phylink_mac_link_up = qca8k_phylink_mac_link_up, .get_phy_flags = qca8k_get_phy_flags, diff --git a/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch index 5b1f07749a6..4d0b363c379 100644 --- a/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch @@ -20,7 +20,7 @@ Signed-off-by: Christian Marangi --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1991,6 +1991,12 @@ qca8k_setup(struct dsa_switch *ds) +@@ -2002,6 +2002,12 @@ qca8k_setup(struct dsa_switch *ds) dev_err(priv->dev, "failed enabling QCA header mode on port %d", dp->index); return ret; } @@ -33,7 +33,7 @@ Signed-off-by: Christian Marangi } /* Forward all unknown frames to CPU port for Linux processing */ -@@ -2020,11 +2026,6 @@ qca8k_setup(struct dsa_switch *ds) +@@ -2031,11 +2037,6 @@ qca8k_setup(struct dsa_switch *ds) if (ret) return ret; @@ -45,7 +45,7 @@ Signed-off-by: Christian Marangi /* For port based vlans to work we need to set the * default egress vid */ -@@ -2076,6 +2077,9 @@ qca8k_setup(struct dsa_switch *ds) +@@ -2087,6 +2088,9 @@ qca8k_setup(struct dsa_switch *ds) /* Set max number of LAGs supported */ ds->num_lag_ids = QCA8K_NUM_LAGS; From bb1bfb46020b38179ef97d30333c90ab00b71c97 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 25 Sep 2023 02:26:43 +0200 Subject: [PATCH 19/78] quilt.mk: use CURDIR instead of ./ for PATCH_DIR and FILES_DIR To better reference them for diagnostic use, reference the PATCH_DIR and FILES_DIR with the absolute path instead of using ./ and reference by the relative location. No behaviour change intended. Signed-off-by: Christian Marangi --- include/quilt.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/quilt.mk b/include/quilt.mk index 18cafe60a28..140d3905283 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -34,8 +34,8 @@ endif ifneq ($(if $(DUMP),1,$(__quilt_inc)),1) __quilt_inc:=1 -PATCH_DIR?=./patches -FILES_DIR?=./files +PATCH_DIR?=$(CURDIR)/patches +FILES_DIR?=$(CURDIR)/files HOST_PATCH_DIR?=$(PATCH_DIR) HOST_FILES_DIR?=$(FILES_DIR) From 9536446965e853231e34c4e5dc4cf13f838b9e90 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 25 Sep 2023 02:29:31 +0200 Subject: [PATCH 20/78] quilt.mk: don't error on refresh/update if patches doesn't exist The current code fails if we have package or host tools with no patches to apply. The error printend is the following: (taking ubus as an example) make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config' make[2]: 'conf' is up to date. make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config' make[1]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt' make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus' The source directory contains no quilt patches. make[2]: *** [Makefile:81: quilt-check] Error 1 make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus' time: package/system/ubus/refresh#0.06#0.00#0.07 ERROR: package/system/ubus failed to build. make[1]: *** [package/Makefile:120: package/system/ubus/refresh] Error 1 make[1]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt' make: *** [/home/ansuel/openwrt-ansuel/openwrt/include/toplevel.mk:232: package/ubus/refresh] Error 2 We exit 1 after saying that there are no patches because later in the function quilt pop fails to execute. Having no patches for a package and calling refresh should not be a critical error and the function should just do nothing. To handle this improve quilt.mk with the following addition. - If we don't have any patch for the package, we print a warning and we create an empty series. This is useful to trick quilt and make it do nothing. We also create a status file .quilt_no_patch to detect in the other function that we don't have patches to handle. - In refresh makefile target, we check if .quilt_no_patch exist and we skip quilt cleanup if this exist. - In RefreshDir function we change the logic and now we delete the patches directory and not only the content. This is done as a cleanup to clean case with empty patches directory. - In RefreshDir we check if .quilt_no_patch exist and we skip creating the patches directory and copying the refreshed patches. - In RefreshDir we delete at the end any trace of .quilt_no_patch if present. This is needed to support run like package/refresh that will run the refresh process on any package present in the buildroot. Signed-off-by: Christian Marangi --- include/quilt.mk | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/include/quilt.mk b/include/quilt.mk index 140d3905283..a58390f6c54 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -106,13 +106,14 @@ define Kernel/Patch/Default endef define Quilt/RefreshDir - mkdir -p $(2) - -rm -f $(2)/* 2>/dev/null >/dev/null - @( \ + -rm -rf $(2) 2>/dev/null >/dev/null + [ -f $(1)/.quilt_no_patch ] || mkdir -p $(2) + @[ -f $(1)/.quilt_no_patch ] || { \ for patch in $$$$($(if $(3),grep "^$(3)",cat) $(1)/patches/series | awk '{print $$$$1}'); do \ $(CP) -v "$(1)/patches/$$$$patch" $(2); \ done; \ - ) + } + @-rm -f $(1)/.quilt_no_patch 2>/dev/null >/dev/null; endef define Quilt/Refresh/Host @@ -156,7 +157,7 @@ define Quilt/Template } @[ -f "$(1)/patches/series" ] || { \ echo "The source directory contains no quilt patches."; \ - false; \ + touch $(1)/patches/series $(1)/.quilt_no_patch; \ } @[ -n "$$$$(ls $(1)/patches/series)" -o \ "$$$$(cat $(1)/patches/series | $(MKHASH) md5)" = "$$(sort $(1)/patches/series | $(MKHASH) md5)" ] || { \ @@ -165,10 +166,12 @@ define Quilt/Template } $(3)refresh: $(3)quilt-check - @cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null - @cd "$(1)"; while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \ - QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \ - done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null + @[ -f $(1)/.quilt_no_patch ] || { \ + cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null; \ + while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \ + QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \ + done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null; \ + } $(Quilt/Refresh/$(4)) $(3)update: $(3)quilt-check From ac3a5911daeaecc04c6ffd03027b6b75fa4472d2 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 7 Oct 2023 10:00:03 -0400 Subject: [PATCH 21/78] kernel: bump 5.15 to 5.15.134 Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.134 Removed upstreamed: generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.134&id=d7acb7031758141225844bea073860b48fd92092 Build system: x86_64 Build-tested: ramips/tplink_archer-a6-v3 Run-tested: ramips/tplink_archer-a6-v3 Signed-off-by: John Audia --- include/kernel-5.15 | 4 +-- ...v6.1-10-mm-multi-gen-LRU-kill-switch.patch | 2 +- .../894-Fix-up-backport-for-13619703038.patch | 31 ------------------- ...les-ignore-EOPNOTSUPP-on-flowtable-d.patch | 2 +- ...-missing-linux-if_ether.h-for-ETH_AL.patch | 2 +- .../patches-5.15/410-bt-mtk-serial-fix.patch | 2 +- 6 files changed, 6 insertions(+), 37 deletions(-) delete mode 100644 target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 06bcb632e33..35a21308aab 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .133 -LINUX_KERNEL_HASH-5.15.133 = ef845e7934897b88e4448378ea9daacac19e07f156fe904844fab0a7d8ff5ddd +LINUX_VERSION-5.15 = .134 +LINUX_KERNEL_HASH-5.15.134 = f37182aecb57ed6853d01e1074d3a60a653331e35f3115728381e08be050b9d3 diff --git a/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch b/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch index cf5b8f0e9f7..8ee032fb0f0 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch @@ -116,7 +116,7 @@ Signed-off-by: Andrew Morton extern spinlock_t css_set_lock; #define task_css_set_check(task, __c) \ rcu_dereference_check((task)->cgroups, \ -@@ -708,6 +719,8 @@ struct cgroup; +@@ -709,6 +720,8 @@ struct cgroup; static inline u64 cgroup_id(const struct cgroup *cgrp) { return 1; } static inline void css_get(struct cgroup_subsys_state *css) {} static inline void css_put(struct cgroup_subsys_state *css) {} diff --git a/target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch b/target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch deleted file mode 100644 index 674740eaac3..00000000000 --- a/target/linux/generic/backport-5.15/894-Fix-up-backport-for-13619703038.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 16c572ef0646f8b0fa19fbf81b302de8a03127f2 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sun, 24 Sep 2023 14:30:44 -0400 -Subject: Fix up backport of 136191703038 ("interconnect: Teach lockdep about - icc_bw_lock order") - -Add a missing include to fix the following build error: - -drivers/interconnect/core.c: In function 'icc_init': -drivers/interconnect/core.c:1148:9: error: implicit declaration of function 'fs_reclaim_acquire' [-Werror=implicit-function-declaration] - 1148 | fs_reclaim_acquire(GFP_KERNEL); - | ^~~~~~~~~~~~~~~~~~ -drivers/interconnect/core.c:1150:9: error: implicit declaration of function 'fs_reclaim_release' [-Werror=implicit-function-declaration] - 1150 | fs_reclaim_release(GFP_KERNEL); - | ^~~~~~~~~~~~~~~~~~ - -Signed-off-by: Sasha Levin ---- - drivers/interconnect/core.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/interconnect/core.c -+++ b/drivers/interconnect/core.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index ba847d5f8a9..b618c896136 100644 --- a/target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -7729,7 +7729,7 @@ static int nft_register_flowtable_net_ho +@@ -7707,7 +7707,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch b/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch index fcf7892c04e..39ba71606ec 100644 --- a/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch +++ b/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch @@ -51,7 +51,7 @@ Signed-off-by: Daniel Golle --- a/arch/arm/mach-mvebu/kirkwood.c +++ b/arch/arm/mach-mvebu/kirkwood.c -@@ -14,6 +14,7 @@ +@@ -11,6 +11,7 @@ #include #include #include diff --git a/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch index bfa90f3849c..3f4597c65d6 100644 --- a/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2763,6 +2763,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2766,6 +2766,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; From 1a15a8cdb98361a36c2138c9b4e51444cc15dfe9 Mon Sep 17 00:00:00 2001 From: John Audia Date: Fri, 6 Oct 2023 13:59:35 -0400 Subject: [PATCH 22/78] kernel: bump 6.1 to 6.1.56 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.56 Removed upstreamed: bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.56&id=226590fbd96717fce218878044df3568c825ba8e Build system: x86/64 Build-tested: x86/64/AMD Cezanne, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: x86/64/AMD Cezanne, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia --- include/kernel-6.1 | 4 +-- ...-Extend-RAM-to-full-256MB-for-Linksy.patch | 35 ------------------- ...i-gen-LRU-per-node-lru_gen_folio-lis.patch | 6 ++-- ...les-ignore-EOPNOTSUPP-on-flowtable-d.patch | 2 +- .../patches-6.1/410-bt-mtk-serial-fix.patch | 2 +- 5 files changed, 7 insertions(+), 42 deletions(-) delete mode 100644 target/linux/bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch diff --git a/include/kernel-6.1 b/include/kernel-6.1 index c916b86dcc3..0354d642c85 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .55 -LINUX_KERNEL_HASH-6.1.55 = a87e241ec15d53452c4efe219713a3769d88cc436b5b98cf6efb262c4aff15c0 +LINUX_VERSION-6.1 = .56 +LINUX_KERNEL_HASH-6.1.56 = 9edefdde32c2298389dcd19566402332b3c2016f5ada17e5820f500b908d478c diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch deleted file mode 100644 index 854fbfafa4f..00000000000 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 91994e59079dcb455783d3f9ea338eea6f671af3 Mon Sep 17 00:00:00 2001 -From: Aleksey Nasibulin -Date: Wed, 12 Jul 2023 03:40:17 +0200 -Subject: [PATCH] ARM: dts: BCM5301X: Extend RAM to full 256MB for Linksys - EA6500 V2 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Linksys ea6500-v2 have 256MB of ram. Currently we only use 128MB. -Expand the definition to use all the available RAM. - -Fixes: 03e96644d7a8 ("ARM: dts: BCM5301X: Add basic DT for Linksys EA6500 V2") -Signed-off-by: Aleksey Nasibulin -Signed-off-by: Christian Marangi -Cc: stable@vger.kernel.org -Acked-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230712014017.28123-1-ansuelsmth@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6500-v2.dts | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -+++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -19,7 +19,8 @@ - - memory@0 { - device_type = "memory"; -- reg = <0x00000000 0x08000000>; -+ reg = <0x00000000 0x08000000>, -+ <0x88000000 0x08000000>; - }; - - gpio-keys { diff --git a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch index ef98d52b78d..71bee2d2a71 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch @@ -335,7 +335,7 @@ Signed-off-by: T.J. Mercier if (order > 0) return 0; -@@ -5383,6 +5396,7 @@ static int mem_cgroup_css_online(struct +@@ -5386,6 +5399,7 @@ static int mem_cgroup_css_online(struct if (unlikely(mem_cgroup_is_root(memcg))) queue_delayed_work(system_unbound_wq, &stats_flush_dwork, 2UL*HZ); @@ -343,7 +343,7 @@ Signed-off-by: T.J. Mercier return 0; offline_kmem: memcg_offline_kmem(memcg); -@@ -5414,6 +5428,7 @@ static void mem_cgroup_css_offline(struc +@@ -5417,6 +5431,7 @@ static void mem_cgroup_css_offline(struc memcg_offline_kmem(memcg); reparent_shrinker_deferred(memcg); wb_memcg_offline(memcg); @@ -351,7 +351,7 @@ Signed-off-by: T.J. Mercier drain_all_stock(memcg); -@@ -5425,6 +5440,7 @@ static void mem_cgroup_css_released(stru +@@ -5428,6 +5443,7 @@ static void mem_cgroup_css_released(stru struct mem_cgroup *memcg = mem_cgroup_from_css(css); invalidate_reclaim_iterators(memcg); diff --git a/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index 2daa2ee1e49..0901213491d 100644 --- a/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -7886,7 +7886,7 @@ static int nft_register_flowtable_net_ho +@@ -7864,7 +7864,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch index 072883e7fec..5b94c9216d9 100644 --- a/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2770,6 +2770,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2773,6 +2773,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; From e66eed033f9f9d27fc839d81d3a03d4fad1b9b5b Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 7 Oct 2023 12:29:57 +0200 Subject: [PATCH 23/78] toolchain: glibc: Update glibc 2.37 to recent HEAD This adds the following changes: b4f76ecc9e Ignore MAP_VARIABLE in tst-mman-consts.py f5d377c896 __check_pf: Add a cancellation cleanup handler [BZ #20975] 0e3e9dbb0e Document BZ #20975 fix e2974d26ce io: Fix record locking contants on 32 bit arch with 64 bit default time_t (BZ#30477) 3593050c27 io: Fix F_GETLK, F_SETLK, and F_SETLKW for powerpc64 8dcb1a5181 hppa: xfail debug/tst-ssp-1 when have-ssp is yes (gcc-12 and later) 0930ff8eb3 realloc: Limit chunk reuse to only growing requests [BZ #30579] 3f4b4e2cdd elf: _dl_find_object may return 1 during early startup (bug 30515) 260d4b742b nptl: Fix tst-cancel30 on sparc64 58f7431fd7 sparc: Fix la_symbind for bind-now (BZ 23734) 1caf955269 x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` 80a8c858a5 x86: Fix slight bug in `shared_per_thread` cache size calculation. cc8243fb0b x86: Use `3/4*sizeof(per-thread-L3)` as low bound for NT threshold. f94ff95e93 x86: Fix incorrect scope of setting `shared_per_thread` [BZ# 30745] 0d500bfdc0 hurd: Make exception subcode a long be26b29262 io: Fix record locking contants for powerpc64 with __USE_FILE_OFFSET64 3d24d1903d elf: Do not run constructors for proxy objects a7e34a6675 elf: Always call destructors in reverse constructor order (bug 30785) bdb594afa5 elf: Remove unused l_text_end field from struct link_map 1a7cbe52c8 elf: Move l_init_called_next to old place of l_text_end in link map b752934602 CVE-2023-4527: Stack read overflow with large TCP responses in no-aaaa mode 6529a7466c (HEAD) getaddrinfo: Fix use after free in getcanonname (CVE-2023-4806) 79310b45af x86/dl-cacheinfo: remove unsused parameter from handle_amd 9d5c6e27ed x86: Fix for cache computation on AMD legacy cpus. 4473d1b87d Fix leak in getaddrinfo introduced by the fix for CVE-2023-4806 [BZ #30843] 94ef701365 Document CVE-2023-4806 and CVE-2023-5156 in NEWS 2dfd8c77b5 i686: Regenerate ulps b4e23c75ae tunables: Terminate if end of input is reached (CVE-2023-4911) Signed-off-by: Hauke Mehrtens --- toolchain/glibc/common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index b80cb2678b8..18413cd271a 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -12,8 +12,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=7c32cb7dd88cf100b0b412163896e30aa2ee671a -PKG_MIRROR_HASH:=92afa3672e4af0c3ba9d360e9aaac60c094a0aad9334ef78a1fd2ee49f5e1b64 +PKG_SOURCE_VERSION:=b4e23c75aea756b4bddc4abcf27a1c6dca8b6bd3 +PKG_MIRROR_HASH:=4d5b3de6ec7b47427700f74fdb529e32083b54a512f6ca86ec824a61092ecdd4 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz PKG_CPE_ID:=cpe:/a:gnu:glibc From 22b0c36ae7e39dc7ae7211ab038c22fb3d8158b0 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 8 Oct 2023 10:16:16 +0800 Subject: [PATCH 24/78] ramips: fix EEPROM size for I-O DATA WN-DEAX1800GR I-O DATA WN-DEAX1800GR uses MT7915 PCIe NIC. The correct EEPROM size is 0xe00. Fixes: ac68fbf526d ("ramips: add support for I-O DATA WN-DEAX1800GR") Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts index 10959a1fcdc..b9357632e1a 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts @@ -130,7 +130,7 @@ #size-cells = <1>; eeprom: eeprom@0 { - reg = <0x0 0x1aa20>; + reg = <0x0 0xe00>; }; macaddr_factory_4: macaddr@4 { From 230d5de707e4a31603ccb0a7e2b32df45127b38d Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 8 Oct 2023 09:43:28 +0800 Subject: [PATCH 25/78] ramips: correct NVMEM MAC address node name and label for Bolt Arion The node name&label should match the address in the 'reg' property, so it's better to change the incorrect offset to the 0x28. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7621_bolt_arion.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_bolt_arion.dts b/target/linux/ramips/dts/mt7621_bolt_arion.dts index 7ba413932ea..feff4a66e48 100644 --- a/target/linux/ramips/dts/mt7621_bolt_arion.dts +++ b/target/linux/ramips/dts/mt7621_bolt_arion.dts @@ -137,7 +137,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_28>; nvmem-cell-names = "mac-address"; mac-address-increment = <3>; }; @@ -152,7 +152,7 @@ wan: port@1 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_28>; nvmem-cell-names = "mac-address"; }; @@ -179,7 +179,7 @@ #address-cells = <1>; #size-cells = <1>; - macaddr_factory_4000: macaddr@4000 { + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; }; From fb4cea45ec55b7625e870c0375d4d7971d2fbb53 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 10:12:02 +0800 Subject: [PATCH 26/78] ramips: convert MT7603 EEPROM to NVMEM format This patch converts MT7603 WiFi calibration data to NVMEM format. The EEPROM size is 0x400. Signed-off-by: Shiji Yang --- .../ramips/dts/mt7621_afoundry_ew1200.dts | 24 ++++++----- .../linux/ramips/dts/mt7621_asus_rp-ac56.dts | 12 ++++-- .../ramips/dts/mt7621_asus_rt-ac57u-v1.dts | 32 ++++++++------- .../ramips/dts/mt7621_asus_rt-n56u-b1.dts | 32 ++++++++------- .../dts/mt7621_beeline_smartbox-giga.dts | 14 ++++--- .../mt7621_beeline_smartbox-turbo-plus.dts | 14 ++++--- target/linux/ramips/dts/mt7621_bolt_arion.dts | 24 ++++++----- .../ramips/dts/mt7621_buffalo_wsr-1166dhp.dts | 10 ++++- .../ramips/dts/mt7621_buffalo_wsr-600dhp.dts | 24 ++++++----- .../ramips/dts/mt7621_comfast_cf-ew72-v2.dts | 9 +++- .../ramips/dts/mt7621_cudy_wr1300-v1.dts | 29 +++++++------ .../ramips/dts/mt7621_cudy_wr1300-v2.dts | 29 +++++++------ .../linux/ramips/dts/mt7621_cudy_wr2100.dts | 27 +++++++----- .../ramips/dts/mt7621_d-team_newifi-d2.dts | 32 ++++++++------- .../linux/ramips/dts/mt7621_d-team_pbr-m1.dts | 32 ++++++++------- .../linux/ramips/dts/mt7621_etisalat_s3.dts | 14 ++++--- .../ramips/dts/mt7621_gehua_ghl-r-001.dts | 24 ++++++----- .../linux/ramips/dts/mt7621_hiwifi_hc5962.dts | 10 ++++- .../ramips/dts/mt7621_huasifei_ws1208v2.dts | 12 ++++-- .../ramips/dts/mt7621_iodata_wn-ax1167gr.dts | 41 +++++++++---------- .../ramips/dts/mt7621_iodata_wn-dx1200gr.dts | 34 +++++++-------- .../ramips/dts/mt7621_iodata_wn-gx300gr.dts | 24 ++++++----- .../ramips/dts/mt7621_keenetic_kn-3010.dts | 32 ++++++++------- .../ramips/dts/mt7621_lenovo_newifi-d1.dts | 32 ++++++++------- .../linux/ramips/dts/mt7621_linksys_e5600.dts | 10 ++++- .../ramips/dts/mt7621_linksys_re7000.dts | 24 ++++++----- .../ramips/dts/mt7621_netgear_wac104.dts | 24 ++++++----- .../dts/mt7621_renkforce_ws-wn530hp3-a.dts | 26 ++++++------ .../dts/mt7621_samknows_whitebox-v8.dts | 32 ++++++++------- .../dts/mt7621_sercomm_dxx_nand_256m.dtsi | 12 ++++-- .../linux/ramips/dts/mt7621_sercomm_na502.dts | 26 ++++++------ .../ramips/dts/mt7621_sercomm_na502s.dts | 26 ++++++------ .../ramips/dts/mt7621_snr_snr-cpe-me1.dts | 12 ++++-- .../dts/mt7621_snr_snr-cpe-me2-lite.dts | 32 ++++++++------- .../dts/mt7621_telco-electronics_x1.dts | 24 ++++++----- .../ramips/dts/mt7621_tozed_zlt-s12-pro.dts | 12 ++++-- .../dts/mt7621_tplink_archer-c6u-v1.dts | 29 +++++++------ .../dts/mt7621_tplink_archer-x6-v3.dtsi | 29 +++++++------ .../ramips/dts/mt7621_tplink_deco-m4r-v4.dts | 10 ++++- .../dts/mt7621_tplink_eap235-wall-v1.dts | 29 +++++++------ .../ramips/dts/mt7621_tplink_mr600-v2-eu.dts | 30 +++++++------- .../ramips/dts/mt7621_tplink_re350-v1.dts | 29 +++++++------ .../dts/mt7621_tplink_tl-wpa8631p-v3.dts | 29 +++++++------ .../ramips/dts/mt7621_ubnt_unifi-6-lite.dts | 38 +++++++++-------- .../dts/mt7621_unielec_u7621-01-16m.dts | 29 ++++++------- .../ramips/dts/mt7621_unielec_u7621-01.dtsi | 3 +- .../dts/mt7621_wavlink_ws-wn572hp3-4g.dts | 39 +++++++++--------- .../ramips/dts/mt7621_wevo_w2914ns-v2.dtsi | 32 ++++++++------- .../ramips/dts/mt7621_winstars_ws-wn583a6.dts | 32 ++++++++------- .../dts/mt7621_xzwifi_creativebox-v1.dts | 24 ++++++----- .../ramips/dts/mt7621_youhua_wr1200js.dts | 32 ++++++++------- .../linux/ramips/dts/mt7621_youku_yk-l2.dts | 32 ++++++++------- .../ramips/dts/mt7621_zbtlink_zbt-we1326.dts | 32 ++++++++------- .../ramips/dts/mt7621_zbtlink_zbt-we3526.dts | 32 ++++++++------- .../dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi | 32 ++++++++------- .../ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi | 32 ++++++++------- .../ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi | 12 ++++-- .../ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi | 24 ++++++----- .../linux/ramips/dts/mt7621_zyxel_nr7101.dts | 24 ++++++----- .../linux/ramips/dts/mt7621_zyxel_wap6805.dts | 24 ++++++----- 60 files changed, 821 insertions(+), 664 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts index 8d33f542dc1..0161fcfb410 100644 --- a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts +++ b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts @@ -71,9 +71,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -107,7 +118,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -168,13 +180,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts index 50047999be7..c8e6bc9f28a 100644 --- a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts @@ -136,13 +136,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -188,7 +191,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts index bb1c86c2d5d..347f6edb95f 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts @@ -86,9 +86,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -121,7 +136,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; led { led-active-low; @@ -179,17 +195,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts index c8d286e7ed1..bce6bd435aa 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts @@ -105,9 +105,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; partition@50000 { @@ -135,7 +150,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -189,17 +205,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts index 22fc065eb29..1b61d77c036 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts @@ -94,14 +94,17 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; sercomm,scpart-id = <2>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; @@ -188,11 +191,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(4)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts index 507920bac22..9dbc7be0e92 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts @@ -100,14 +100,17 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; sercomm,scpart-id = <2>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; @@ -181,11 +184,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(4)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_bolt_arion.dts b/target/linux/ramips/dts/mt7621_bolt_arion.dts index feff4a66e48..bf29d079bcd 100644 --- a/target/linux/ramips/dts/mt7621_bolt_arion.dts +++ b/target/linux/ramips/dts/mt7621_bolt_arion.dts @@ -100,9 +100,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -122,7 +133,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -173,13 +185,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index a8d76b544e2..85aca456cb6 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -133,9 +133,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@50000 { @@ -210,7 +217,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index f46bc256d0c..932c36c6291 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -133,9 +133,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -168,7 +179,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -219,13 +231,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts b/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts index 8b7b4a035ea..b3a823b1f08 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts @@ -110,10 +110,16 @@ compatible = "nvmem-cells"; reg = <0x40000 0x10000>; read-only; + nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + macaddr_factory_e000: macaddr@e000 { compatible = "mac-base"; reg = <0xe000 0x6>; @@ -152,7 +158,8 @@ wifi_2_4_ghz: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; // Wi-Fi device reads it's MAC address from EEPROM (&factory + 4) // adding anything related to mac-address here will cause use random MAC }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts index cc1afdc95bd..108dbc17a5f 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts @@ -85,9 +85,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@50000 { @@ -109,9 +116,16 @@ }; bdinfo: partition@ff0000 { + compatible = "nvmem-cells"; label = "bdinfo"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_bdinfo_de00: macaddr@de00 { + reg = <0xde00 0x6>; + }; }; }; }; @@ -125,9 +139,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -204,13 +217,3 @@ function = "gpio"; }; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts index a5d2fc46079..0aafde6c085 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts @@ -78,9 +78,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@50000 { @@ -102,9 +109,16 @@ }; bdinfo: partition@ff0000 { + compatible = "nvmem-cells"; label = "bdinfo"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_bdinfo_de00: macaddr@de00 { + reg = <0xde00 0x6>; + }; }; }; }; @@ -118,9 +132,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -186,13 +199,3 @@ function = "gpio"; }; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts index b2e75762a5d..28151cdaeeb 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts @@ -90,7 +90,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -130,9 +131,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@50000 { @@ -154,9 +162,16 @@ }; bdinfo: partition@ff0000 { + compatible = "nvmem-cells"; label = "bdinfo"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_bdinfo_de00: macaddr@de00 { + reg = <0xde00 0x6>; + }; }; }; }; @@ -208,13 +223,3 @@ }; }; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts index 33deb21dcaa..f539c137671 100644 --- a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -115,9 +115,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -144,7 +159,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -190,17 +206,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts index 03b593e093d..bd57bc153bf 100644 --- a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts +++ b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts @@ -129,9 +129,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -170,7 +185,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -220,17 +236,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_etisalat_s3.dts b/target/linux/ramips/dts/mt7621_etisalat_s3.dts index 65d168fd803..411dbdb3662 100644 --- a/target/linux/ramips/dts/mt7621_etisalat_s3.dts +++ b/target/linux/ramips/dts/mt7621_etisalat_s3.dts @@ -100,14 +100,17 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; sercomm,scpart-id = <2>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; @@ -181,11 +184,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(2)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts index cb9f9bdad1e..824e578f954 100644 --- a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -68,9 +68,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -89,7 +100,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -152,13 +164,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index d9ca1012cea..eab4c0faef6 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -81,9 +81,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@140000 { @@ -116,7 +123,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts index fe77f652074..f8d25102c51 100644 --- a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts +++ b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts @@ -93,13 +93,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; @@ -123,7 +126,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts index 69c79d7dc76..b6bafe8c89a 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts @@ -89,15 +89,33 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; iNIC_rf: partition@50000 { + compatible = "nvmem-cells"; label = "iNIC_rf"; reg = <0x50000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_iNIC_rf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@60000 { @@ -186,7 +204,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -201,23 +220,3 @@ &xhci { status = "disabled"; }; - -&iNIC_rf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_iNIC_rf_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts index 653132bc619..e723bf5a618 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts @@ -81,8 +81,23 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x200000 0x200000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_1e000: macaddr@1e000 { + reg = <0x1e000 0x6>; + }; + + macaddr_factory_1e006: macaddr@1e006 { + reg = <0x1e006 0x6>; + }; }; partition@400000 { @@ -183,9 +198,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -209,17 +225,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_1e000: macaddr@1e000 { - reg = <0x1e000 0x6>; - }; - - macaddr_factory_1e006: macaddr@1e006 { - reg = <0x1e006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts index 8a09675bffb..f2cd28ad1c7 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts @@ -89,9 +89,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -186,20 +197,11 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts index 69080df6822..8382aaba654 100644 --- a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts +++ b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts @@ -123,9 +123,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "rf-eeprom"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware1: partition@50000 { @@ -229,7 +244,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -242,17 +258,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts index 810ca3361af..b5d606f17ee 100644 --- a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts +++ b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts @@ -104,9 +104,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -133,7 +148,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -177,17 +193,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_linksys_e5600.dts b/target/linux/ramips/dts/mt7621_linksys_e5600.dts index 3b23a25f8b5..32015b6a2af 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e5600.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts @@ -83,9 +83,16 @@ }; factory: partition@c0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0xc0000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@100000 { @@ -136,7 +143,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_re7000.dts b/target/linux/ramips/dts/mt7621_linksys_re7000.dts index 5e33f489159..d3505e774dc 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re7000.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re7000.dts @@ -84,9 +84,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -112,7 +123,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -142,13 +154,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_wac104.dts b/target/linux/ramips/dts/mt7621_netgear_wac104.dts index 97aa4a90d1b..57365252824 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wac104.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wac104.dts @@ -96,9 +96,20 @@ }; factory: partition@2e00000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x2e00000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@4200000 { @@ -126,7 +137,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -175,13 +187,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts b/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts index c56c2f1554c..7722d3d2782 100644 --- a/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts +++ b/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts @@ -68,9 +68,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -90,10 +101,9 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; }; }; @@ -155,13 +165,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts index d1f51fedddd..76c0f19781f 100644 --- a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts +++ b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts @@ -72,9 +72,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -101,7 +116,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -155,17 +171,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi index a0534bdabd9..d51ff8212af 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi @@ -98,14 +98,17 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; sercomm,scpart-id = <2>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; @@ -181,7 +184,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502.dts b/target/linux/ramips/dts/mt7621_sercomm_na502.dts index 9ec4cf77888..f3e9e2bfd46 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502.dts @@ -125,8 +125,19 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@140000 { @@ -186,9 +197,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; ieee80211-freq-limit = <2400000 2500000>; }; @@ -217,13 +227,3 @@ &uartlite3 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts index dc71dbd0502..705ee0dd9bd 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts @@ -229,8 +229,19 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@140000 { @@ -290,9 +301,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; ieee80211-freq-limit = <2400000 2500000>; }; @@ -350,13 +360,3 @@ &uartlite2 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts index 7f0dbf772df..625edc16fe0 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts @@ -104,7 +104,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -144,13 +145,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts index 38cd1cd8fd8..a85eb55be2d 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts @@ -74,9 +74,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -144,7 +159,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -157,17 +173,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts index 23e85f99022..2241a977884 100644 --- a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts +++ b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts @@ -106,9 +106,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; firmware: partition@50000 { @@ -176,7 +187,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -193,13 +205,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts b/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts index 5a94bbda829..dca8f3d18a5 100644 --- a/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts +++ b/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts @@ -160,13 +160,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; @@ -199,7 +202,8 @@ wifi1: mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts index c626df1ef4e..f45cbf28ad0 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -116,9 +116,16 @@ }; config: partition@fa0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xfa0000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; partition@fb0000 { @@ -128,9 +135,16 @@ }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -144,9 +158,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -218,13 +231,3 @@ &xhci { vbus-supply = <®_usb_vbus>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi index 217c1b60fe4..621cb6c2d73 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi @@ -99,15 +99,29 @@ }; config: partition@fa0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xfa0000 0x50000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -128,9 +142,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; ieee80211-freq-limit = <2400000 2500000>; }; @@ -185,13 +198,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts index 3d17dbf599c..63631355bfd 100644 --- a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts +++ b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts @@ -147,9 +147,16 @@ }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -188,7 +195,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts index cd7cae63550..691f805160a 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts @@ -82,9 +82,16 @@ }; info: partition@90000 { + compatible = "nvmem-cells"; label = "product-info"; reg = <0x90000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; partition@a0000 { @@ -114,9 +121,16 @@ }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -136,9 +150,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_info_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_info_8>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -191,13 +204,3 @@ }; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts b/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts index b7475ec15ba..4ceb107129a 100644 --- a/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts +++ b/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts @@ -109,9 +109,16 @@ }; romfile: partition@fc0000 { + compatible = "nvmem-cells"; label = "romfile"; reg = <0xfc0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_romfile_f100: romfile@f100 { + reg = <0xf100 0x6>; + }; }; partition@fd0000 { @@ -121,9 +128,16 @@ }; radio: partition@fe0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xfe0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -138,10 +152,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_romfile_f100>; - nvmem-cell-names = "mac-address"; - mediatek,mtd-eeprom = <&radio 0x0>; - mtd-mac-address = <&romfile 0xf100>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -195,13 +207,3 @@ }; }; }; - -&romfile { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfile_f100: romfile@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts index 866abf87c61..e6653089311 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts @@ -108,15 +108,29 @@ }; config: partition@600000 { + compatible = "nvmem-cells"; label = "config"; reg = <0x600000 0x50000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_10008: macaddr@10008 { + reg = <0x10008 0x6>; + }; }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -129,9 +143,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; }; @@ -171,13 +184,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts index 0d466f1e661..c38068f08f1 100644 --- a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts +++ b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts @@ -112,15 +112,29 @@ }; config: partition@730000 { + compatible = "nvmem-cells"; label = "config"; reg = <0x730000 0xc0000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_2008: macaddr@2008 { + reg = <0x2008 0x6>; + }; }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -141,9 +155,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -192,13 +205,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_2008: macaddr@2008 { - reg = <0x2008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts index 54e372eca39..8f78a60557c 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -37,15 +37,33 @@ }; factory: partition@70000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x70000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; eeprom: partition@b0000 { + compatible = "nvmem-cells"; label = "eeprom"; reg = <0xb0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; }; partition@c0000 { @@ -79,10 +97,8 @@ }; &wlan_2g { - mediatek,mtd-eeprom = <&factory 0x0>; - - nvmem-cells = <&macaddr_eeprom_0>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_eeprom_0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &wlan_5g { @@ -111,17 +127,3 @@ mediatek,disable-radar-background; }; - -&eeprom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_eeprom_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_eeprom_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts index 8780b17b80b..b932f901f73 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts @@ -33,9 +33,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -56,17 +71,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi index f2900e48060..d2bad654c91 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi @@ -54,7 +54,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts index 60d0708a80e..73381416769 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts @@ -84,9 +84,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -109,10 +124,12 @@ }; &pcie0 { - wifi0: mt76@0,0 { + mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -160,24 +177,6 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; - -&wifi0{ - ieee80211-freq-limit = <2400000 2500000>; -}; - &wifi1{ ieee80211-freq-limit = <5000000 6000000>; }; diff --git a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi index cfd2344d21c..01dd9afddb0 100644 --- a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi @@ -63,9 +63,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -85,7 +100,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; led { led-sources = <0>; @@ -153,17 +169,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts index ec81839d1d2..fde07a63863 100644 --- a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts +++ b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts @@ -84,9 +84,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -106,7 +121,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -153,17 +169,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts index 32f7e5056a3..ac69a42f012 100644 --- a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts +++ b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts @@ -113,9 +113,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -139,7 +150,8 @@ wifi@0,0 { compatible = "pci1400,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -199,13 +211,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts index 2d61b875605..638923e7ce2 100644 --- a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts +++ b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts @@ -86,9 +86,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -107,7 +122,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -174,17 +190,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts index 5342b40507a..eda5ce964af 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -89,9 +89,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -112,7 +127,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { led-active-low; @@ -183,17 +199,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts index 99b9652b7ab..1244acb0dab 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts @@ -59,9 +59,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -139,7 +154,8 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -152,17 +168,3 @@ &sdhci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts index a6d0e9a7c20..decf80fa5ef 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts @@ -56,9 +56,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; firmware: partition@50000 { @@ -91,7 +106,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -145,17 +161,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi index 64492af4d8a..4dcdce72056 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi @@ -111,9 +111,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; firmware: partition@50000 { @@ -132,7 +147,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -199,17 +215,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi index c80544cfc95..45bd4a753f2 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi @@ -110,9 +110,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; firmware: partition@50000 { @@ -131,7 +146,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -198,17 +214,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi index 303708fab0e..8b5a0e7adca 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi @@ -84,13 +84,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; @@ -118,7 +121,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi index 9af057378d1..6391a51e529 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi @@ -72,9 +72,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; firmware: partition@50000 { @@ -93,7 +104,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -157,13 +169,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts index 63d992973aa..ace7a08bd89 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts @@ -89,9 +89,20 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@140000 { @@ -139,7 +150,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -163,13 +175,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts b/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts index a4672366409..5df2f3c6ab6 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts @@ -74,9 +74,20 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@300000 { @@ -123,7 +134,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -172,13 +184,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; From 2c02a9b9e4fb700e1cfc5ffd91cd8fe59544c327 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 10:12:02 +0800 Subject: [PATCH 27/78] ramips: convert MT7610 and MT7612 EEPROM to NVMEM format for MT7621 This patch converts MT7610 and MT7612 WiFi calibration data to NVMEM format. The EEPROM size is 0x200. Signed-off-by: Shiji Yang --- .../ramips/dts/mt7621_afoundry_ew1200.dts | 7 +++- .../linux/ramips/dts/mt7621_asus_rp-ac56.dts | 7 +++- .../ramips/dts/mt7621_asus_rt-ac57u-v1.dts | 7 +++- .../ramips/dts/mt7621_asus_rt-n56u-b1.dts | 7 +++- target/linux/ramips/dts/mt7621_bolt_arion.dts | 7 +++- .../ramips/dts/mt7621_buffalo_wsr-1166dhp.dts | 7 +++- .../ramips/dts/mt7621_cudy_wr1300-v1.dts | 9 ++-- .../ramips/dts/mt7621_cudy_wr1300-v2.dts | 9 ++-- .../ramips/dts/mt7621_d-team_newifi-d2.dts | 7 +++- .../linux/ramips/dts/mt7621_d-team_pbr-m1.dts | 7 +++- .../ramips/dts/mt7621_dlink_dir-860l-b1.dts | 31 ++++++++------ .../ramips/dts/mt7621_firefly_firewrt.dts | 31 ++++++++------ .../ramips/dts/mt7621_gehua_ghl-r-001.dts | 7 +++- .../ramips/dts/mt7621_hanyang_hyc-g920.dts | 39 ++++++++++------- .../dts/mt7621_hilink_hlk-7621a-evb.dts | 10 ++++- .../linux/ramips/dts/mt7621_hiwifi_hc5962.dts | 7 +++- .../ramips/dts/mt7621_huasifei_ws1208v2.dts | 7 +++- .../ramips/dts/mt7621_iodata_wn-ax1167gr.dts | 7 +++- .../ramips/dts/mt7621_iptime_a3004ns-dual.dts | 42 ++++++++++++------- .../ramips/dts/mt7621_lenovo_newifi-d1.dts | 7 +++- .../ramips/dts/mt7621_linksys_re6500.dts | 31 ++++++++------ .../linux/ramips/dts/mt7621_mqmaker_witi.dts | 35 +++++++++------- target/linux/ramips/dts/mt7621_mtc_wr1201.dts | 31 ++++++++------ .../ramips/dts/mt7621_netgear_ex6150.dts | 31 ++++++++------ .../ramips/dts/mt7621_netgear_wac104.dts | 7 +++- .../linux/ramips/dts/mt7621_netis_wf2881.dts | 39 ++++++++++------- .../dts/mt7621_samknows_whitebox-v8.dts | 7 +++- .../linux/ramips/dts/mt7621_sercomm_na502.dts | 9 ++-- .../ramips/dts/mt7621_sercomm_na502s.dts | 9 ++-- .../ramips/dts/mt7621_sercomm_s1500.dtsi | 23 ++++++---- .../ramips/dts/mt7621_snr_snr-cpe-me1.dts | 7 +++- .../dts/mt7621_storylink_sap-g3200u3.dts | 31 ++++++++------ .../dts/mt7621_telco-electronics_x1.dts | 7 +++- .../ramips/dts/mt7621_tozed_zlt-s12-pro.dts | 7 +++- .../ramips/dts/mt7621_tplink_re350-v1.dts | 9 ++-- .../dts/mt7621_unielec_u7621-01-16m.dts | 4 ++ .../ramips/dts/mt7621_unielec_u7621-01.dtsi | 3 +- .../ramips/dts/mt7621_wevo_w2914ns-v2.dtsi | 7 +++- .../dts/mt7621_xzwifi_creativebox-v1.dts | 7 +++- .../ramips/dts/mt7621_youhua_wr1200js.dts | 7 +++- .../linux/ramips/dts/mt7621_youku_yk-l2.dts | 7 +++- .../ramips/dts/mt7621_zbtlink_zbt-we1326.dts | 7 +++- .../ramips/dts/mt7621_zbtlink_zbt-we3526.dts | 7 +++- .../dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi | 7 +++- .../ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi | 7 +++- .../ramips/dts/mt7621_zbtlink_zbt-wg2626.dts | 31 ++++++++------ .../ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi | 7 +++- 47 files changed, 445 insertions(+), 201 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts index 0161fcfb410..30a03824627 100644 --- a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts +++ b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts @@ -82,6 +82,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -104,7 +108,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts index c8e6bc9f28a..bc623067a8a 100644 --- a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts @@ -147,6 +147,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -201,7 +205,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts index 347f6edb95f..322a96b700a 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts @@ -97,6 +97,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -123,7 +127,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts index bce6bd435aa..77e3fffcc18 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts @@ -116,6 +116,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -142,7 +146,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_bolt_arion.dts b/target/linux/ramips/dts/mt7621_bolt_arion.dts index bf29d079bcd..826d3f928aa 100644 --- a/target/linux/ramips/dts/mt7621_bolt_arion.dts +++ b/target/linux/ramips/dts/mt7621_bolt_arion.dts @@ -111,6 +111,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -143,7 +147,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index 85aca456cb6..795fe256b3c 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -143,6 +143,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -209,7 +213,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts index 108dbc17a5f..fcc16c31b51 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts @@ -95,6 +95,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -153,9 +157,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts index 0aafde6c085..264a0fa5c16 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts @@ -88,6 +88,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -141,9 +145,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts index f539c137671..a25787b71b8 100644 --- a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -126,6 +126,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -151,7 +155,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts index bd57bc153bf..3d27b0a942b 100644 --- a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts +++ b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts @@ -140,6 +140,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -177,7 +181,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts index fac41f206bb..36d22046a95 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -83,9 +83,24 @@ }; radio: partition@34000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x34000 0x4000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_radio_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_radio_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; }; factory: partition@38000 { @@ -163,7 +178,8 @@ &pcie0 { wifi0: mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x2000>; + nvmem-cells = <&eeprom_radio_2000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -171,7 +187,8 @@ &pcie1 { wifi1: mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -182,13 +199,3 @@ function = "gpio"; }; }; - -&radio { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_radio_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts index 46954b616f0..acc9e9865f9 100644 --- a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts +++ b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts @@ -70,9 +70,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -91,7 +106,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -99,7 +115,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -151,13 +168,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts index 824e578f954..a87f82b6811 100644 --- a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -79,6 +79,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -108,7 +112,8 @@ &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts b/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts index c4e28b96df5..94b211ab7a7 100644 --- a/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts +++ b/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts @@ -75,9 +75,28 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; partition@50000 { @@ -115,7 +134,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -129,7 +149,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -182,17 +203,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts index 3fb267d7821..99bd01c6d93 100644 --- a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts +++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts @@ -47,9 +47,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -105,7 +112,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index eab4c0faef6..63c4f5f6b24 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -91,6 +91,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@140000 { @@ -132,7 +136,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts index f8d25102c51..fc548352d54 100644 --- a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts +++ b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts @@ -104,6 +104,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -135,7 +139,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts index b6bafe8c89a..b08939a451d 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts @@ -96,6 +96,10 @@ #size-cells = <1>; read-only; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -212,7 +216,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts index c08b6427e76..0faf24e7b05 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts @@ -63,9 +63,20 @@ #size-cells = <1>; uboot: partition@0 { + compatible = "nvmem-cells"; label = "u-boot"; reg = <0x0 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; }; partition@20000 { @@ -75,9 +86,20 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@40000 { @@ -141,7 +163,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -155,7 +178,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -171,17 +195,3 @@ function = "gpio"; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts index b5d606f17ee..a6a7fc9f427 100644 --- a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts +++ b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts @@ -115,6 +115,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -140,7 +144,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_re6500.dts b/target/linux/ramips/dts/mt7621_linksys_re6500.dts index 0d0c5c3be5c..5b295a06a73 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re6500.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re6500.dts @@ -71,9 +71,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -99,7 +114,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -107,7 +123,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -154,13 +171,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts index d785d741b1c..dc70414da9c 100644 --- a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts +++ b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts @@ -58,8 +58,23 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -78,20 +93,18 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -156,13 +169,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts index 0f45743d6f4..5872a710b88 100644 --- a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts +++ b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts @@ -78,9 +78,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -150,8 +165,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; @@ -163,8 +179,9 @@ &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; @@ -179,13 +196,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts index 1695e9c845c..0ddcd6c35ed 100644 --- a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts +++ b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts @@ -118,9 +118,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -214,7 +229,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -222,7 +238,8 @@ &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -251,13 +268,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_wac104.dts b/target/linux/ramips/dts/mt7621_netgear_wac104.dts index 57365252824..53a4449b8bf 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wac104.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wac104.dts @@ -107,6 +107,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -128,7 +132,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_netis_wf2881.dts b/target/linux/ramips/dts/mt7621_netis_wf2881.dts index af09073e3d3..29f111b572d 100644 --- a/target/linux/ramips/dts/mt7621_netis_wf2881.dts +++ b/target/linux/ramips/dts/mt7621_netis_wf2881.dts @@ -63,9 +63,28 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@140000 { @@ -97,7 +116,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -111,7 +131,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -171,17 +192,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts index 76c0f19781f..e5946af9094 100644 --- a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts +++ b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts @@ -83,6 +83,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -108,7 +112,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502.dts b/target/linux/ramips/dts/mt7621_sercomm_na502.dts index f3e9e2bfd46..7fe0258223b 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502.dts @@ -135,6 +135,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -185,9 +189,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; ieee80211-freq-limit = <5000000 6000000>; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts index 705ee0dd9bd..50d4df81f60 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts @@ -239,6 +239,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -289,9 +293,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; ieee80211-freq-limit = <5000000 6000000>; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi index 91053f15bc1..11cf7752aba 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi @@ -177,13 +177,20 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x100000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; macaddr_factory_1000: macaddr@1000 { reg = <0x1000 0x6>; @@ -220,10 +227,9 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_factory_1000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_1000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; }; @@ -233,10 +239,9 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <2400000 2500000>; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_1000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_1000>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts index 625edc16fe0..9dbcbaa3c0c 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts @@ -114,7 +114,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -156,6 +157,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; diff --git a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts index 833e1b07d0c..d9f7281a77a 100644 --- a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts +++ b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts @@ -67,9 +67,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -88,7 +103,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -96,7 +112,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -152,13 +169,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts index 2241a977884..8eb406541b3 100644 --- a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts +++ b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts @@ -117,6 +117,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e006: macaddr@e006 { reg = <0xe006 0x6>; }; @@ -197,7 +201,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts b/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts index dca8f3d18a5..d90c0b4b59c 100644 --- a/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts +++ b/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts @@ -171,6 +171,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -193,7 +197,8 @@ wifi0: mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts index e6653089311..890365c199b 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts @@ -131,6 +131,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -152,10 +156,9 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts index b932f901f73..42cf121f3b0 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts @@ -44,6 +44,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi index d2bad654c91..32527835248 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi @@ -64,7 +64,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi index 01dd9afddb0..6c5a638e0f0 100644 --- a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi @@ -74,6 +74,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_2e: macaddr@2e { reg = <0x2e 0x6>; }; @@ -114,7 +118,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts index ac69a42f012..48f52eed2f7 100644 --- a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts +++ b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts @@ -124,6 +124,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -159,7 +163,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts index 638923e7ce2..2389112c3e6 100644 --- a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts +++ b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts @@ -97,6 +97,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -130,7 +134,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts index eda5ce964af..99da11a6147 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -100,6 +100,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -140,7 +144,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { led-sources = <2>; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts index 1244acb0dab..e76ce933c1c 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts @@ -70,6 +70,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -140,7 +144,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts index decf80fa5ef..73f3ea91731 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts @@ -67,6 +67,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -93,7 +97,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi index 4dcdce72056..ec9d2398cdd 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi @@ -122,6 +122,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -156,7 +160,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi index 45bd4a753f2..c578018e755 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi @@ -121,6 +121,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -155,7 +159,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts index e764cb636b0..c1d5b03964f 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts @@ -72,9 +72,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -96,7 +111,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -104,7 +120,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -156,13 +173,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi index 6391a51e529..296c5a205f9 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi @@ -83,6 +83,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -113,7 +117,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { From 65cd6a6fec891b0502350c6782f12ee914dfa6a8 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 10:12:02 +0800 Subject: [PATCH 28/78] ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621 This patch converts MT7613 and MT7615 WiFi calibration data to NVMEM format. The EEPROM size is 0x4da8. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7621_adslr_g7.dts | 31 +++++++------ .../ramips/dts/mt7621_ampedwireless_ally.dtsi | 17 +++++++- .../dts/mt7621_arcadyan_we420223-99.dts | 10 ++++- .../ramips/dts/mt7621_arcadyan_wg4xx223.dtsi | 12 ++++-- .../linux/ramips/dts/mt7621_asus_rp-ac87.dts | 19 +++++--- .../ramips/dts/mt7621_asus_rt-acx5p.dtsi | 31 +++++++------ .../dts/mt7621_beeline_smartbox-giga.dts | 9 ++-- .../mt7621_beeline_smartbox-turbo-plus.dts | 9 ++-- .../dts/mt7621_buffalo_wsr-2533dhpl.dts | 31 +++++++------ .../ramips/dts/mt7621_comfast_cf-ew72-v2.dts | 7 ++- .../linux/ramips/dts/mt7621_cudy_wr2100.dts | 7 ++- .../ramips/dts/mt7621_dlink_dir-1935-a1.dts | 14 ------ .../ramips/dts/mt7621_dlink_dir-3060-a1.dts | 43 ++++++++++--------- .../ramips/dts/mt7621_dlink_dir-853-a1.dts | 32 +++++++------- .../ramips/dts/mt7621_dlink_dir-853-a3.dts | 42 +++++++++--------- .../ramips/dts/mt7621_dlink_dir-853-r1.dts | 16 +------ .../ramips/dts/mt7621_dlink_dir-867-a1.dts | 14 ------ .../ramips/dts/mt7621_dlink_dir-878-a1.dts | 14 ------ .../ramips/dts/mt7621_dlink_dir-878-r1.dts | 14 ------ .../ramips/dts/mt7621_dlink_dir-882-a1.dts | 14 ------ .../ramips/dts/mt7621_dlink_dir-882-r1.dts | 14 ------ .../ramips/dts/mt7621_dlink_dir-8xx.dtsi | 6 ++- .../ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi | 39 ++++++++++------- .../ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi | 12 ++++-- .../ramips/dts/mt7621_dlink_flash-16m-a1.dtsi | 19 ++++++++ .../ramips/dts/mt7621_dlink_flash-16m-r1.dtsi | 23 ++++++++++ .../linux/ramips/dts/mt7621_edimax_re23s.dts | 31 +++++++------ .../linux/ramips/dts/mt7621_edimax_rx21s.dtsi | 31 +++++++------ .../dts/mt7621_elecom_wrc-1167ghbk2-s.dts | 34 +++++++-------- .../dts/mt7621_elecom_wrc-2533ghbk.dtsi | 17 +++++++- .../ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi | 3 +- .../ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi | 6 ++- .../ramips/dts/mt7621_elecom_wrc-gs.dtsi | 11 +++++ .../linux/ramips/dts/mt7621_etisalat_s3.dts | 9 ++-- .../ramips/dts/mt7621_glinet_gl-mt1300.dts | 24 ++++++----- target/linux/ramips/dts/mt7621_humax_e10.dts | 39 ++++++++++------- .../ramips/dts/mt7621_iodata_wn-dx1200gr.dts | 9 +++- .../ramips/dts/mt7621_iodata_wnpr2600g.dts | 31 +++++++------ .../ramips/dts/mt7621_iptime_a3002mesh.dts | 10 ++++- .../linux/ramips/dts/mt7621_iptime_a3004t.dts | 12 ++++-- .../ramips/dts/mt7621_iptime_a6004ns-m.dtsi | 42 +++++++++++------- .../linux/ramips/dts/mt7621_iptime_a8004t.dts | 42 +++++++++++------- .../ramips/dts/mt7621_jcg_jhr-ac876m.dts | 39 ++++++++++------- target/linux/ramips/dts/mt7621_jcg_y2.dts | 32 +++++++------- .../ramips/dts/mt7621_keenetic_kn-3010.dts | 7 ++- .../linux/ramips/dts/mt7621_linksys_e5600.dts | 7 ++- .../ramips/dts/mt7621_linksys_re7000.dts | 7 ++- .../linux/ramips/dts/mt7621_oraybox_x3a.dts | 10 ++++- .../linux/ramips/dts/mt7621_phicomm_k2p.dts | 42 +++++++++--------- .../dts/mt7621_raisecom_msg1500-x-00.dts | 14 +++--- .../dts/mt7621_renkforce_ws-wn530hp3-a.dts | 9 ++-- .../dts/mt7621_sercomm_dxx_nand_256m.dtsi | 7 ++- .../dts/mt7621_snr_snr-cpe-me2-lite.dts | 7 ++- .../ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts | 32 +++++++------- .../ramips/dts/mt7621_totolink_a7000r.dts | 31 +++++++------ .../dts/mt7621_tplink_archer-c6u-v1.dts | 9 ++-- .../dts/mt7621_tplink_archer-x6-v3.dtsi | 9 ++-- .../ramips/dts/mt7621_tplink_deco-m4r-v4.dts | 7 ++- .../dts/mt7621_tplink_eap235-wall-v1.dts | 9 ++-- .../ramips/dts/mt7621_tplink_ec330-g5u-v1.dts | 25 +++++------ .../ramips/dts/mt7621_tplink_mr600-v2-eu.dts | 9 ++-- .../ramips/dts/mt7621_tplink_re650-v2.dts | 38 +++++++++------- .../ramips/dts/mt7621_tplink_rexx0-v1.dtsi | 38 +++++++++------- .../dts/mt7621_tplink_tl-wpa8631p-v3.dts | 9 ++-- .../dts/mt7621_wavlink_ws-wn572hp3-4g.dts | 13 +++--- .../ramips/dts/mt7621_winstars_ws-wn583a6.dts | 7 ++- .../dts/mt7621_xiaomi_mi-router-3-pro.dts | 39 ++++++++++------- .../ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi | 7 ++- .../ramips/dts/mt7621_zyxel_lte3301-plus.dts | 27 ++++++------ 69 files changed, 789 insertions(+), 551 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_adslr_g7.dts b/target/linux/ramips/dts/mt7621_adslr_g7.dts index 956733f7c3e..fe04648f0e2 100644 --- a/target/linux/ramips/dts/mt7621_adslr_g7.dts +++ b/target/linux/ramips/dts/mt7621_adslr_g7.dts @@ -64,9 +64,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e00c: macaddr@e00c { + reg = <0xe00c 0x6>; + }; }; partition@50000 { @@ -86,7 +101,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -95,7 +111,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -151,13 +168,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e00c: macaddr@e00c { - reg = <0xe00c 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi index 7736b06e438..4f06271239b 100644 --- a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi +++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi @@ -64,7 +64,8 @@ wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -73,7 +74,8 @@ wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -105,9 +107,20 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; /* diff --git a/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts b/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts index 3ae441f8e3b..1d55453c8d5 100644 --- a/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts +++ b/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts @@ -130,9 +130,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; }; partition@50000 { @@ -214,6 +221,7 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi index b924d71190f..8e05c3af50d 100644 --- a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi +++ b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi @@ -79,13 +79,16 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; /* We keep the block below to prevent eth0 MAC * from randomization. Unique WAN, LAN, WLAN MACs @@ -162,7 +165,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts index 98af8752814..47df1dbe57d 100644 --- a/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts @@ -110,13 +110,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; macaddr_factory_8004: macaddr@8004 { reg = <0x8004 0x6>; @@ -140,7 +147,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -149,7 +157,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi index 59b93db5dec..bb9171bbac3 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi +++ b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi @@ -80,9 +80,24 @@ }; factory: partition@1e0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x1e0000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; factory2: partition@2e0000 { @@ -116,7 +131,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -125,7 +141,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -180,13 +197,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts index 1b61d77c036..eb64bd0bfde 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts @@ -106,6 +106,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; }; @@ -178,11 +182,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(5)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts index 9dbc7be0e92..b07346bacb4 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts @@ -112,6 +112,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; }; @@ -171,11 +175,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(5)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts index be85e8ee6ec..4ceb4e54e0a 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts @@ -131,9 +131,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -217,7 +232,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -226,7 +242,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -241,13 +258,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts b/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts index b3a823b1f08..f26e6626f54 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts @@ -120,6 +120,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_e000: macaddr@e000 { compatible = "mac-base"; reg = <0xe000 0x6>; @@ -169,7 +173,8 @@ wifi_5_0_ghz: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; // Wi-Fi device reads it's MAC address from EEPROM, (&factory + 0x8000 + 4) // adding anything related to mac-address here will cause use random MAC. }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts index 28151cdaeeb..afa13973d57 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts @@ -100,7 +100,8 @@ wifi@1,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -141,6 +142,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts index a6a0eb8ba04..0ce07141a37 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts index 943143ad634..5af9ea28ea4 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts @@ -111,9 +111,28 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@140000 { @@ -163,10 +182,9 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 6000000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; }; @@ -175,10 +193,9 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <3>; }; }; @@ -225,17 +242,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts index 2b6b811abe6..7cd4a92aa7d 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts @@ -108,9 +108,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -144,7 +159,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; /* The correct Mac addresses are set in 10_fix_wifi_mac. */ }; @@ -200,17 +216,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts index 5408e513999..36758567807 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts @@ -105,9 +105,28 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@140000 { @@ -156,11 +175,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -214,21 +232,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts index 8ec6ef3a7d2..290638f7355 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts @@ -95,12 +95,10 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; - /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -156,13 +154,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts index ae0cc8fc8a9..ab5a1103335 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts index 31b41f83847..f9ed0ddcefd 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts index dbde89b2207..1a17dddc115 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts index d6206427bf0..2f45eda02d2 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts @@ -37,17 +37,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts index 6288d19c8a8..019ad7edcf3 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts @@ -37,17 +37,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi index b570d074c6f..bd8fd6f8a15 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi @@ -68,7 +68,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -81,7 +82,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi index 07f84592e4b..fee88647775 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi @@ -76,9 +76,28 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@140000 { @@ -127,7 +146,8 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -140,7 +160,8 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -199,17 +220,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi index 8fb6de7c480..cc979df26a6 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi @@ -93,13 +93,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; @@ -123,7 +126,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; /* The correct MAC addresses are set in 10_fix_wifi_mac. */ }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi index 911de595d07..a8e518cae46 100644 --- a/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi @@ -26,9 +26,28 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@60000 { diff --git a/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi b/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi index 3f71ab971ca..dddd39ceaae 100644 --- a/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi @@ -26,9 +26,32 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/mt7621_edimax_re23s.dts b/target/linux/ramips/dts/mt7621_edimax_re23s.dts index 1a3181e4e39..c96292be33f 100644 --- a/target/linux/ramips/dts/mt7621_edimax_re23s.dts +++ b/target/linux/ramips/dts/mt7621_edimax_re23s.dts @@ -86,9 +86,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; partition@50000 { @@ -122,7 +137,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -131,7 +147,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -160,13 +177,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi index 1301f1375c8..4aac3fb6d7c 100644 --- a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi +++ b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi @@ -81,9 +81,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -103,7 +118,8 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -112,7 +128,8 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -171,13 +188,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts index 2fdb62840a6..6a9531eb332 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts @@ -136,9 +136,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -177,9 +192,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; }; @@ -187,17 +201,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi index e9f968dbe02..7096b015ef8 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi @@ -100,9 +100,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -159,7 +170,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -168,7 +180,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi index 7495453d458..8901680bf5b 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi @@ -25,6 +25,7 @@ wifi: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi index 98ce0b19940..50fc0b6e949 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi @@ -13,7 +13,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -27,7 +28,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi index acd3004eb7b..2c60f3d8b6b 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi @@ -145,9 +145,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_etisalat_s3.dts b/target/linux/ramips/dts/mt7621_etisalat_s3.dts index 411dbdb3662..d63be92c785 100644 --- a/target/linux/ramips/dts/mt7621_etisalat_s3.dts +++ b/target/linux/ramips/dts/mt7621_etisalat_s3.dts @@ -112,6 +112,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; }; @@ -171,11 +175,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(3)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts index d5440b3a510..1565666a5d8 100644 --- a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts +++ b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts @@ -88,9 +88,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x4000 0x6>; + }; }; partition@50000 { @@ -110,7 +121,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -159,13 +171,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_humax_e10.dts b/target/linux/ramips/dts/mt7621_humax_e10.dts index 638d73c3eff..ac13b4a9c59 100644 --- a/target/linux/ramips/dts/mt7621_humax_e10.dts +++ b/target/linux/ramips/dts/mt7621_humax_e10.dts @@ -89,9 +89,28 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x30000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_10007: macaddr@10007 { + reg = <0x10007 0x6>; + }; + + macaddr_factory_1000d: macaddr@1000d { + reg = <0x1000d 0x6>; + }; }; partition@70000 { @@ -113,7 +132,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -122,7 +142,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -162,17 +183,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_10007: macaddr@10007 { - reg = <0x10007 0x6>; - }; - - macaddr_factory_1000d: macaddr@1000d { - reg = <0x1000d 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts index e723bf5a618..19868fa078b 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts @@ -91,6 +91,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_1e000: macaddr@1e000 { reg = <0x1e000 0x6>; }; @@ -209,9 +213,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts index 871327f8a70..6729e94cc5a 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts @@ -93,9 +93,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x040000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -178,7 +193,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -187,7 +203,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -195,13 +212,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts b/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts index 678ce068064..fc51b9ac4f0 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts @@ -89,9 +89,16 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; }; partition@40000 { @@ -146,7 +153,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3004t.dts b/target/linux/ramips/dts/mt7621_iptime_a3004t.dts index 97b6b1c3ee0..000657c8667 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3004t.dts @@ -76,13 +76,16 @@ }; factory: partition@a0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0xa0000 0x20000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -168,7 +171,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi b/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi index b00fbeb47f9..db7743f137b 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi +++ b/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi @@ -74,9 +74,20 @@ #size-cells = <1>; uboot: partition@0 { + compatible = "nvmem-cells"; label = "u-boot"; reg = <0x0 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; }; partition@20000 { @@ -86,9 +97,20 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; partition@40000 { @@ -159,7 +181,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -168,21 +191,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts index 0f5870140fb..dc9033c3940 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts @@ -68,9 +68,20 @@ #size-cells = <1>; uboot: partition@0 { + compatible = "nvmem-cells"; label = "u-boot"; reg = <0x0 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; }; partition@20000 { @@ -80,9 +91,20 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; partition@40000 { @@ -146,7 +168,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -155,7 +178,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -166,17 +190,3 @@ function = "gpio"; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts index 5d346be1d27..5714a57c4e4 100644 --- a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts +++ b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts @@ -84,9 +84,28 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -106,7 +125,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -119,7 +139,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -178,17 +199,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_jcg_y2.dts b/target/linux/ramips/dts/mt7621_jcg_y2.dts index f8ae9b41df8..9e50d9b3ed7 100644 --- a/target/linux/ramips/dts/mt7621_jcg_y2.dts +++ b/target/linux/ramips/dts/mt7621_jcg_y2.dts @@ -62,9 +62,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -84,7 +99,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -138,17 +154,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts index 8382aaba654..8f617484533 100644 --- a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts +++ b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts @@ -134,6 +134,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -254,7 +258,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0400>; + nvmem-cells = <&eeprom_factory_400>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_e5600.dts b/target/linux/ramips/dts/mt7621_linksys_e5600.dts index 32015b6a2af..c1b8048f0cf 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e5600.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts @@ -93,6 +93,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; partition@100000 { @@ -152,7 +156,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_re7000.dts b/target/linux/ramips/dts/mt7621_linksys_re7000.dts index d3505e774dc..c5b6ecc233e 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re7000.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re7000.dts @@ -95,6 +95,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_2e: macaddr@2e { reg = <0x2e 0x6>; }; @@ -132,7 +136,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts index fe26e5af6f9..56711332556 100644 --- a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts +++ b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts @@ -77,9 +77,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; }; partition@50000 { @@ -119,7 +126,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts index b18d12608ac..fd3b42f6edb 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -70,9 +70,28 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -98,12 +117,11 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -157,21 +175,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts index 07297df0833..6dd4b581399 100644 --- a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts +++ b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts @@ -103,13 +103,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x40000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -136,11 +139,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts b/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts index 7722d3d2782..3cf29d17295 100644 --- a/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts +++ b/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts @@ -79,6 +79,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -111,10 +115,9 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi index d51ff8212af..479ea067a7b 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi @@ -110,6 +110,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_21000: macaddr@21000 { reg = <0x21000 0x6>; }; @@ -175,7 +179,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts index a85eb55be2d..1cc9b45c403 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts @@ -85,6 +85,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -169,7 +173,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts index 2a5dfe379c6..9e498b78ed7 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts @@ -113,9 +113,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -200,20 +215,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts index bba0d4a5d37..16d8edb3411 100644 --- a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts @@ -63,9 +63,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -85,7 +100,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -94,7 +110,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -150,13 +167,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts index f45cbf28ad0..330f6a0f340 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -145,6 +145,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -168,9 +172,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; ieee80211-freq-limit = <5000000 6000000>; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi index 621cb6c2d73..e713b2cfd2a 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi @@ -122,6 +122,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -153,9 +157,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts index 63631355bfd..4603263e8dd 100644 --- a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts +++ b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts @@ -157,6 +157,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -205,7 +209,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts index 691f805160a..f2aea644fa2 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts @@ -131,6 +131,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -158,10 +162,9 @@ &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_info_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_info_8>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts index 537b6f70a73..c44ede90657 100644 --- a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts @@ -225,25 +225,30 @@ }; factory: partition@7800000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x7800000 0x400000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + eeprom_factory_14000: eeprom@14000 { + reg = <0x14000 0x4da8>; + }; + macaddr_factory_165: macaddr@165 { compatible = "mac-base"; reg = <0x165 0x11>; #nvmem-cell-cells = <1>; }; }; - - }; partition@0_wholeflash { @@ -262,11 +267,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <2400000 2500000>; - - nvmem-cells = <&macaddr_factory_165 0>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_165 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -274,11 +277,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x14000>; ieee80211-freq-limit = <5000000 6000000>; - - nvmem-cells = <&macaddr_factory_165 2>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_14000>, <&macaddr_factory_165 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts b/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts index 4ceb107129a..b9d5995ed5b 100644 --- a/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts +++ b/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts @@ -138,6 +138,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -162,10 +166,9 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_romfile_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts b/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts index aa65b68f063..42b9c3cc3e3 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts @@ -117,15 +117,33 @@ }; config: partition@7c0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0x7c0000 0x2d440>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_10008: macaddr@10008 { + reg = <0x10008 0x6>; + }; }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -146,9 +164,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; ieee80211-freq-limit = <2400000 2500000>; }; @@ -158,9 +175,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; }; @@ -183,13 +199,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi index f67c0e3c6d9..4207100f343 100644 --- a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi @@ -114,9 +114,16 @@ }; config: partition@e00000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xe00000 0x50000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_10008: macaddr@10008 { + reg = <0x10008 0x6>; + }; }; /* range 0xe50000 to 0xff0000 is empty in vendor @@ -124,9 +131,20 @@ */ radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -147,9 +165,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; ieee80211-freq-limit = <2400000 2500000>; }; @@ -159,9 +176,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; }; @@ -184,13 +200,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts index c38068f08f1..7d8948bb371 100644 --- a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts +++ b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts @@ -135,6 +135,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -165,9 +169,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; ieee80211-freq-limit = <5000000 6000000>; }; diff --git a/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts index 73381416769..76fbbb99b14 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts @@ -95,6 +95,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -137,7 +141,9 @@ wifi1: mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -176,8 +182,3 @@ function = "gpio"; }; }; - -&wifi1{ - ieee80211-freq-limit = <5000000 6000000>; -}; - diff --git a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts index fde07a63863..f699b4c47a1 100644 --- a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts +++ b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts @@ -95,6 +95,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -130,7 +134,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts index 34d0e4a0318..62111520c01 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts @@ -132,9 +132,28 @@ }; factory: partition@c0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x0c0000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@100000 { @@ -179,7 +198,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -188,7 +208,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -238,17 +259,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi index 8b5a0e7adca..ff748b781c0 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi @@ -95,6 +95,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; @@ -130,7 +134,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts index ed8260534e6..d449fccd284 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts @@ -126,8 +126,19 @@ reg = <0x80000 0x80000>; /* 64 KB */ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_fe6e: macaddr@fe6e { + reg = <0xfe6e 0x6>; + }; }; partition@140000 { label = "Kernel"; @@ -197,21 +208,9 @@ compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; mediatek,firmware-eeprom = "mt7615e_eeprom.bin"; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_factory_fe6e>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_fe6e>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(1)>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - mtd-mac-address = <&factory 0xfe6e>; - - macaddr_factory_fe6e: macaddr@fe6e { - reg = <0xfe6e 0x6>; - }; -}; From 9ac891f8c44124e931c15f1257347cd8ba311a19 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 10:12:02 +0800 Subject: [PATCH 29/78] ramips: convert MT7915 EEPROM to NVMEM format This patch converts MT7915 WiFi calibration data to NVMEM format. The EEPROM size is 0xe00. Signed-off-by: Shiji Yang --- .../linux/ramips/dts/mt7621_asus_rt-ax53u.dts | 12 ++++--- .../linux/ramips/dts/mt7621_asus_rt-ax54.dts | 12 ++++--- .../linux/ramips/dts/mt7621_belkin_rt1800.dts | 10 +++++- .../ramips/dts/mt7621_comfast_cf-e390ax.dts | 24 +++++++------- target/linux/ramips/dts/mt7621_cudy_m1800.dts | 10 +++++- target/linux/ramips/dts/mt7621_cudy_x6.dtsi | 10 +++++- .../ramips/dts/mt7621_dlink_dap-x1860-a1.dts | 12 ++++--- .../linux/ramips/dts/mt7621_h3c_tx180x.dtsi | 10 +++++- .../ramips/dts/mt7621_haier-sim_wr1800k.dtsi | 12 ++++--- .../ramips/dts/mt7621_iptime_ax2004m.dts | 12 ++++--- target/linux/ramips/dts/mt7621_jcg_q20.dts | 32 +++++++++--------- .../linux/ramips/dts/mt7621_linksys_e7350.dts | 10 +++++- .../ramips/dts/mt7621_mercusys_mr70x-v1.dts | 29 ++++++++-------- .../linux/ramips/dts/mt7621_netgear_eax12.dts | 10 +++++- .../ramips/dts/mt7621_netgear_wax202.dts | 10 +++++- .../ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts | 24 +++++++------- .../ramips/dts/mt7621_totolink_x5000r.dts | 32 +++++++++--------- .../dts/mt7621_tplink_archer-ax23-v1.dts | 29 ++++++++-------- .../ramips/dts/mt7621_tplink_eap613-v1.dts | 10 +++++- .../dts/mt7621_tplink_eap615-wall-v1.dts | 27 ++++++++------- .../ramips/dts/mt7621_ubnt_unifi-6-lite.dts | 10 +++--- .../ramips/dts/mt7621_wavlink_wl-wn573hx1.dts | 26 +++++++-------- .../dts/mt7621_xiaomi_mi-router-cr660x.dtsi | 32 +++++++++--------- .../linux/ramips/dts/mt7621_yuncore_ax820.dts | 24 +++++++------- .../ramips/dts/mt7621_yuncore_fap640.dts | 33 ++++++++++--------- .../ramips/dts/mt7621_yuncore_fap690.dts | 24 +++++++------- .../linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi | 27 ++++++++------- .../linux/ramips/dts/mt7621_zyxel_wsm20.dts | 32 +++++++++--------- 28 files changed, 332 insertions(+), 213 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts index d740d00c6df..8aa141b1080 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts @@ -95,13 +95,16 @@ }; factory: partition@1e0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x1e0000 0x100000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -155,7 +158,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts index 3191692e4ef..571d8375a4b 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts @@ -87,13 +87,16 @@ }; factory: partition@1e0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x1e0000 0x100000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -128,7 +131,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_belkin_rt1800.dts b/target/linux/ramips/dts/mt7621_belkin_rt1800.dts index 16ae7324290..2e5fcc8bca7 100644 --- a/target/linux/ramips/dts/mt7621_belkin_rt1800.dts +++ b/target/linux/ramips/dts/mt7621_belkin_rt1800.dts @@ -86,9 +86,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; partition@180000 { @@ -133,7 +140,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts index 80600470e77..8c0dd1ac2e0 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts @@ -59,7 +59,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -87,9 +88,20 @@ }; factory: partition@50000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@90000 { @@ -101,16 +113,6 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; - &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_cudy_m1800.dts b/target/linux/ramips/dts/mt7621_cudy_m1800.dts index 314fdb206ca..90110da4fb3 100644 --- a/target/linux/ramips/dts/mt7621_cudy_m1800.dts +++ b/target/linux/ramips/dts/mt7621_cudy_m1800.dts @@ -81,7 +81,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -114,9 +115,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/mt7621_cudy_x6.dtsi b/target/linux/ramips/dts/mt7621_cudy_x6.dtsi index 4c34f58a4b2..84e053cb42a 100644 --- a/target/linux/ramips/dts/mt7621_cudy_x6.dtsi +++ b/target/linux/ramips/dts/mt7621_cudy_x6.dtsi @@ -76,9 +76,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; /* additional partitions in DTS */ @@ -94,7 +101,8 @@ wifi:wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts index 818d2d8c413..3be48e11af6 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts @@ -125,13 +125,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -175,7 +178,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi index fe374bfa6b0..afb188dff45 100644 --- a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi +++ b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi @@ -97,9 +97,16 @@ }; factory: partition@180000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x0180000 0x0080000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; partition@200000 { @@ -133,7 +140,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi index 4dd6f3b0ae5..afda347ee73 100644 --- a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi +++ b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi @@ -103,13 +103,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x0100000 0x0080000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; macaddr_factory_8004: macaddr@8004 { reg = <0x8004 0x6>; @@ -147,7 +150,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts index 554d73ce3d4..10fa667f04a 100644 --- a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts +++ b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts @@ -73,13 +73,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -168,6 +171,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts index 34236954d0b..4f480ab2c8f 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20.dts +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts @@ -88,9 +88,24 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + + macaddr_factory_3fffa: macaddr@3fffa { + reg = <0x3fffa 0x6>; + }; }; partition@180000 { @@ -139,7 +154,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -184,17 +200,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; - - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_linksys_e7350.dts b/target/linux/ramips/dts/mt7621_linksys_e7350.dts index ea8a6841488..4451e5e3f3e 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e7350.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e7350.dts @@ -80,9 +80,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; partition@180000 { @@ -127,7 +134,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts index 245d130a1fc..ce365450aba 100644 --- a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts +++ b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts @@ -72,9 +72,16 @@ }; config: partition@fa0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xfa0000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; partition@fb0000 { @@ -84,9 +91,16 @@ }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; }; @@ -100,9 +114,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; + nvmem-cell-names = "eeprom", "mac-address"; mediatek,disable-radar-background; }; }; @@ -153,13 +166,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_eax12.dts b/target/linux/ramips/dts/mt7621_netgear_eax12.dts index d5ad404be0b..e65d881e826 100644 --- a/target/linux/ramips/dts/mt7621_netgear_eax12.dts +++ b/target/linux/ramips/dts/mt7621_netgear_eax12.dts @@ -107,9 +107,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; partition@180000 { @@ -171,7 +178,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_wax202.dts b/target/linux/ramips/dts/mt7621_netgear_wax202.dts index fbe17ef0d38..eb7d1bb7e5f 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wax202.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wax202.dts @@ -113,9 +113,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; partition@180000 { @@ -213,7 +220,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts index 2d91d1c481a..a7e048f9ae6 100644 --- a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts +++ b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts @@ -105,7 +105,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -194,9 +195,20 @@ }; factory: partition@50000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@90000 { @@ -207,13 +219,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts index 79667caf73d..23d47d6ea35 100644 --- a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts @@ -70,9 +70,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@50000 { @@ -92,7 +107,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -147,17 +163,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts index 50834c58664..69652772acf 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts @@ -105,9 +105,16 @@ }; config: partition@fa0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xfa0000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; partition@fb0000 { @@ -117,9 +124,16 @@ }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; }; @@ -133,9 +147,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; + nvmem-cell-names = "eeprom", "mac-address"; mediatek,disable-radar-background; }; }; @@ -191,13 +204,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts index d25bf575602..277b2bbcf48 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts @@ -108,9 +108,16 @@ }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; }; @@ -131,7 +138,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts index 58e4bbf7574..d23ab9c4db4 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts @@ -90,9 +90,16 @@ }; info: partition@90000 { + compatible = "nvmem-cells"; label = "product-info"; reg = <0x90000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; partition@a0000 { @@ -120,9 +127,16 @@ }; radio: partition@ff0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; }; @@ -143,7 +157,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -186,13 +201,3 @@ }; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts index 8f78a60557c..c0b6b775859 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -47,6 +47,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_20000: eeprom@20000 { + reg = <0x20000 0xe00>; + }; }; eeprom: partition@b0000 { @@ -104,10 +108,8 @@ &wlan_5g { compatible = "mediatek,mt76"; - mediatek,mtd-eeprom = <&factory 0x20000>; - - nvmem-cells = <&macaddr_eeprom_6>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_eeprom_6>; + nvmem-cell-names = "eeprom", "mac-address"; /* This is a workaround. * diff --git a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts index d8a94c85b9f..1bdbebfad77 100755 --- a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts @@ -61,7 +61,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -87,8 +88,19 @@ }; factory:partition@50000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; }; partition@90000 { @@ -119,15 +131,3 @@ }; }; }; - - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; - -}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi index 14ad0f26ba1..f0e0ae8e7e7 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi @@ -86,9 +86,24 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + + macaddr_factory_3fffa: macaddr@3fffa { + reg = <0x3fffa 0x6>; + }; }; partition@180000 { @@ -135,7 +150,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -185,17 +201,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; - - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts index 1aba94a9125..277c584509a 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts @@ -112,9 +112,20 @@ */ factory: partition@50000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x50000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@90000 { @@ -134,7 +145,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -178,13 +190,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_yuncore_fap640.dts b/target/linux/ramips/dts/mt7621_yuncore_fap640.dts index d525dde385b..8fd6ad347ed 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap640.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap640.dts @@ -120,9 +120,24 @@ */ factory: partition@50000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x50000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; partition@90000 { @@ -142,7 +157,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -201,18 +217,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; - diff --git a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts index a998b95d4c5..35e320b9745 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts @@ -90,9 +90,20 @@ */ factory: partition@50000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x50000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; }; partition@90000 { @@ -112,7 +123,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -137,13 +149,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi index fa7e23dd471..8dfb2ceaa78 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi +++ b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi @@ -37,9 +37,16 @@ }; factory: partition@100000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; partition@180000 { @@ -93,9 +100,16 @@ }; mrd: partition@7780000 { + compatible = "nvmem-cells"; label = "mrd"; reg = <0x7780000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_mrd_1fff8: macaddr@1fff8 { + reg = <0x1fff8 0x6>; + }; }; }; }; @@ -109,7 +123,8 @@ reg = <0x0 0 0 0 0>; compatible = "mediatek,mt76"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; /* MAC-Address set in userspace */ }; @@ -129,16 +144,6 @@ }; }; -&mrd { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_mrd_1fff8: macaddr@1fff8 { - reg = <0x1fff8 0x6>; - }; -}; - &state_default { gpio { groups = "uart3"; diff --git a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts index 299d982dc11..5615e568649 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts @@ -103,9 +103,24 @@ }; factory: partition@200000 { + compatible = "nvmem-cells"; reg = <0x200000 0x1c0000>; + #address-cells = <1>; + #size-cells = <1>; label = "Factory"; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_1fdfa: macaddr@1fdfa { + reg = <0x1fdfa 0x6>; + }; + + macaddr_factory_1fdf4: macaddr@1fdf4 { + reg = <0x1fdf4 0x6>; + }; }; partition@3c0000 { @@ -185,7 +200,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -217,17 +233,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_1fdfa: macaddr@1fdfa { - reg = <0x1fdfa 0x6>; - }; - - macaddr_factory_1fdf4: macaddr@1fdf4 { - reg = <0x1fdf4 0x6>; - }; -}; From 94ed8f73e1db7d2e685689bcf029b1270ed92d06 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 8 Oct 2023 14:05:39 +0200 Subject: [PATCH 30/78] ipq806x: fix broken onhub dtsi Fix broken onhub dtsi. The gmac node have a redundant phy-handle that doesn't point to the swconfig phy node as they got dropped in the DSA conversion. Drop these extra binding to restore correct compilation of this subtarget. Fixes: 337e36e0ef98 ("ipq806x: convert each device to DSA implementation") Signed-off-by: Christian Marangi --- .../ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi index b84c8512ae9..ba53a7391de 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi @@ -345,7 +345,6 @@ status = "okay"; phy-mode = "rgmii"; qcom,id = <0>; - phy-handle = <&phy1>; pinctrl-0 = <&rgmii0_pins>; pinctrl-names = "default"; @@ -360,7 +359,6 @@ status = "okay"; phy-mode = "sgmii"; qcom,id = <2>; - phy-handle = <&phy0>; fixed-link { speed = <1000>; From 666c80d33f2ec3998e8c7877e9c3c1af5f4a59f0 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 9 Oct 2023 12:47:38 +0200 Subject: [PATCH 31/78] ath79: add WWAN serial driver for GL.iNET GL-XE300 The driver for the cellular modems serial interface was missing from the default device packages. The driver is required to interact with the modem using AT commands. Other devices with a 4G modem also ship with this package, thus let's add it to the default packages for the board. Signed-off-by: David Bauer --- target/linux/ath79/image/nand.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index e4ee5554512..fd324507023 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -208,7 +208,7 @@ define Device/glinet_gl-xe300 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-XE300 DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 \ - kmod-usb-net-qmi-wwan uqmi + kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi KERNEL_SIZE := 4096k IMAGE_SIZE := 131072k PAGESIZE := 2048 From 987c96e88927094ff61e83870f872f0560d8e5c1 Mon Sep 17 00:00:00 2001 From: Kevin Jilissen Date: Sun, 8 Oct 2023 16:56:40 +0200 Subject: [PATCH 32/78] realtek: rename hpe,1920-8g-poe to match hardware There are two hardware models of the HPE 1920-8g-poe switch. The version currently in the repository is the model with a PoE budget of 180W. In preparation of the addition of the 65W model, the existing model is renamed to clarify the hardware version it targets. As suggested by Pawel, the 'SUPPORTED_DEVICES' includes the old target name to enable an upgrade path of builds with the old name. Suggested-by: Pawel Dembicki Signed-off-by: Kevin Jilissen --- target/linux/realtek/base-files/etc/board.d/02_network | 4 ++-- .../linux/realtek/base-files/etc/board.d/03_gpio_switches | 2 +- ...pe_1920-8g-poe.dts => rtl8380_hpe_1920-8g-poe-180w.dts} | 4 ++-- target/linux/realtek/image/rtl838x.mk | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) rename target/linux/realtek/dts-5.15/{rtl8380_hpe_1920-8g-poe.dts => rtl8380_hpe_1920-8g-poe-180w.dts} (55%) diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 90b45abf94b..84d3e68e48f 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -31,7 +31,7 @@ lan_mac_end="" label_mac="" case $board in hpe,1920-8g|\ -hpe,1920-8g-poe|\ +hpe,1920-8g-poe-180w|\ hpe,1920-16g|\ hpe,1920-24g) label_mac=$(mtd_get_mac_binary factory 0x68) @@ -67,7 +67,7 @@ done [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac case $board in -hpe,1920-8g-poe) +hpe,1920-8g-poe-180w) ucidef_set_poe 180 "$lan_list_rev" "lan9 lan10" ;; netgear,gs110tpp-v1) diff --git a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches index abfcb8e5924..1e49d89c64a 100644 --- a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches @@ -6,7 +6,7 @@ board_config_update board=$(board_name) case "$board" in -hpe,1920-8g-poe) +hpe,1920-8g-poe-180w) ucidef_add_gpio_switch "fan_ctrl" "Fan control" "456" "0" ;; esac diff --git a/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe.dts b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-180w.dts similarity index 55% rename from target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe.dts rename to target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-180w.dts index 3b00c314119..6398e6d034d 100644 --- a/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe.dts +++ b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-180w.dts @@ -3,8 +3,8 @@ #include "rtl8380_hpe_1920-8g.dtsi" / { - compatible = "hpe,1920-8g-poe", "realtek,rtl838x-soc"; - model = "HPE 1920-8G-PoE+ (JG922A)"; + compatible = "hpe,1920-8g-poe-180w", "realtek,rtl838x-soc"; + model = "HPE 1920-8G-PoE+ 180W (JG922A)"; }; &uart1 { diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 73930f4d6f4..c0b9c70bb6f 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -99,13 +99,14 @@ define Device/hpe_1920-8g endef TARGET_DEVICES += hpe_1920-8g -define Device/hpe_1920-8g-poe +define Device/hpe_1920-8g-poe-180w $(Device/hpe_1920) SOC := rtl8380 - DEVICE_MODEL := 1920-8G-PoE+ (JG922A) + DEVICE_MODEL := 1920-8G-PoE+ 180W (JG922A) H3C_DEVICE_ID := 0x00010025 + SUPPORTED_DEVICES += hpe_1920-8g-poe endef -TARGET_DEVICES += hpe_1920-8g-poe +TARGET_DEVICES += hpe_1920-8g-poe-180w define Device/hpe_1920-16g $(Device/hpe_1920) From f4ee08677cdeefba7cfda40a830b6b747c6ea36e Mon Sep 17 00:00:00 2001 From: Kevin Jilissen Date: Sun, 8 Oct 2023 17:21:23 +0200 Subject: [PATCH 33/78] realtek: add support for HPE 1920-8g-poe+ (65W) Hardware information: --------------------- - RTL8380 SoC - 8 Gigabit RJ45 PoE ports (built-in RTL8218B) - 2 SFP ports (built-in SerDes) - RJ45 RS232 port on front panel - 32 MiB NOR Flash - 128 MiB DDR3 DRAM - PT7A7514 watchdog - PoE chip - Fanless Known issues: --------------------- - PoE LEDs are uncontrolled. (Manual taken from f2f09bc) Booting initramfs image: ------------------------ - Prepare a FTP or TFTP server serving the OpenWrt initramfs image and connect the server to a switch port. - Connect to the console port of the device and enter the extended boot menu by typing Ctrl+B when prompted. - Choose the menu option "<3> Enter Ethernet SubMenu". - Set network parameters via the option "<5> Modify Ethernet Parameter". Enter the FTP/TFTP filename as "Load File Name" ("Target File Name" can be left blank, it is not required for booting from RAM). Note that the configuration is saved on flash, so it only needs to be done once. - Select "<1> Download Application Program To SDRAM And Run". Initial installation: --------------------- - Boot an initramfs image as described above, then use sysupgrade to install OpenWrt permanently. After initial installation, the bootloader needs to be configured to load the correct image file - Enter the extended boot menu again and choose "<4> File Control", then select "<2> Set Application File type". - Enter the number of the file "openwrt-kernel.bin" (should be 1), and use the option "<1> +Main" to select it as boot image. - Choose "<0> Exit To Main Menu" and then "<1> Boot System". NOTE: The bootloader on these devices can only boot from the VFS filesystem which normally spans most of the flash. With OpenWrt, only the first part of the firmware partition contains a valid filesystem, the rest is used for rootfs. As the bootloader does not know about this, you must not do any file operations in the bootloader, as this may corrupt the OpenWrt installation (selecting the boot image is an exception, as it only stores a flag in the bootloader data, but doesn't write to the filesystem). Example PoE config file (/etc/config/poe): --------------------- config global option budget '65' config port option enable '1' option id '1' option name 'lan8' option poe_plus '1' option priority '2' config port option enable '1' option id '2' option name 'lan7' option poe_plus '1' option priority '2' config port option enable '1' option id '3' option name 'lan6' option poe_plus '1' option priority '2' config port option enable '1' option id '4' option name 'lan5' option poe_plus '1' option priority '2' config port option enable '1' option id '5' option name 'lan4' option poe_plus '1' option priority '2' config port option enable '1' option id '6' option name 'lan3' option poe_plus '1' option priority '2' config port option enable '1' option id '7' option name 'lan2' option poe_plus '1' option priority '2' config port option enable '1' option id '8' option name 'lan1' option poe_plus '1' option priority '2' Signed-off-by: Kevin Jilissen --- .../linux/realtek/base-files/etc/board.d/02_network | 4 ++++ .../realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts | 12 ++++++++++++ target/linux/realtek/image/rtl838x.mk | 9 +++++++++ 3 files changed, 25 insertions(+) create mode 100644 target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 84d3e68e48f..45bc2196d40 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -31,6 +31,7 @@ lan_mac_end="" label_mac="" case $board in hpe,1920-8g|\ +hpe,1920-8g-poe-65w|\ hpe,1920-8g-poe-180w|\ hpe,1920-16g|\ hpe,1920-24g) @@ -67,6 +68,9 @@ done [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac case $board in +hpe,1920-8g-poe-65w) + ucidef_set_poe 65 "$lan_list_rev" "lan9 lan10" + ;; hpe,1920-8g-poe-180w) ucidef_set_poe 180 "$lan_list_rev" "lan9 lan10" ;; diff --git a/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts new file mode 100644 index 00000000000..341f535e938 --- /dev/null +++ b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl8380_hpe_1920-8g.dtsi" + +/ { + compatible = "hpe,1920-8g-poe-65w", "realtek,rtl838x-soc"; + model = "HPE 1920-8G-PoE+ 65W (JG921A)"; +}; + +&uart1 { + status = "okay"; +}; diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index c0b9c70bb6f..09b4f3ebb03 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -99,6 +99,15 @@ define Device/hpe_1920-8g endef TARGET_DEVICES += hpe_1920-8g +define Device/hpe_1920-8g-poe-65w + $(Device/hpe_1920) + SOC := rtl8380 + DEVICE_MODEL := 1920-8G-PoE+ 65W (JG921A) + DEVICE_PACKAGES += realtek-poe + H3C_DEVICE_ID := 0x00010024 +endef +TARGET_DEVICES += hpe_1920-8g-poe-65w + define Device/hpe_1920-8g-poe-180w $(Device/hpe_1920) SOC := rtl8380 From cac723e8b8748938b8d80603578c60189fc32b24 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 7 Oct 2023 21:07:20 +0200 Subject: [PATCH 34/78] bsdiff: Add patches for CVEs Add two patches from Debian fixing CVEs in the bsdiff application. CVE-2014-9862: Heap vulnerability in bspatch CVE-2020-14315: Memory Corruption Vulnerability in bspatch Copied the patches from this location: https://salsa.debian.org/debian/bsdiff/-/blob/debian/latest/debian/patches/20-CVE-2014-9862.patch https://salsa.debian.org/debian/bsdiff/-/blob/debian/latest/debian/patches/33-CVE-2020-14315.patch Signed-off-by: Hauke Mehrtens --- package/utils/bsdiff/Makefile | 2 +- package/utils/bsdiff/patches/001-musl.patch | 24 +- .../bsdiff/patches/020-CVE-2014-9862.patch | 37 ++ .../bsdiff/patches/033-CVE-2020-14315.patch | 383 ++++++++++++++++++ 4 files changed, 433 insertions(+), 13 deletions(-) create mode 100644 package/utils/bsdiff/patches/020-CVE-2014-9862.patch create mode 100644 package/utils/bsdiff/patches/033-CVE-2020-14315.patch diff --git a/package/utils/bsdiff/Makefile b/package/utils/bsdiff/Makefile index 32e59cea9c6..d86be2dc0c6 100644 --- a/package/utils/bsdiff/Makefile +++ b/package/utils/bsdiff/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bsdiff PKG_VERSION:=4.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.daemonology.net/bsdiff/ diff --git a/package/utils/bsdiff/patches/001-musl.patch b/package/utils/bsdiff/patches/001-musl.patch index 5232bc1fe78..1eeb1140c00 100644 --- a/package/utils/bsdiff/patches/001-musl.patch +++ b/package/utils/bsdiff/patches/001-musl.patch @@ -1,6 +1,6 @@ ---- a/bsdiff.c 2005-08-17 00:13:52.000000000 +0200 -+++ b/bsdiff.c 2016-02-21 01:39:31.157915765 +0100 -@@ -101,7 +101,7 @@ +--- a/bsdiff.c ++++ b/bsdiff.c +@@ -101,7 +101,7 @@ static void split(off_t *I,off_t *V,off_ if(start+len>kk) split(I,V,kk,start+len-kk,h); } @@ -9,7 +9,7 @@ { off_t buckets[256]; off_t i,h,len; -@@ -139,7 +139,7 @@ +@@ -139,7 +139,7 @@ static void qsufsort(off_t *I,off_t *V,u for(i=0;i #include @@ -71,7 +71,7 @@ { off_t y; -@@ -62,8 +62,8 @@ +@@ -62,8 +62,8 @@ int main(int argc,char * argv[]) int fd; ssize_t oldsize,newsize; ssize_t bzctrllen,bzdatalen; diff --git a/package/utils/bsdiff/patches/020-CVE-2014-9862.patch b/package/utils/bsdiff/patches/020-CVE-2014-9862.patch new file mode 100644 index 00000000000..98a49312f3b --- /dev/null +++ b/package/utils/bsdiff/patches/020-CVE-2014-9862.patch @@ -0,0 +1,37 @@ +From: The FreeBSD Project +Bug: https://security-tracker.debian.org/tracker/CVE-2014-9862 +Subject: CVE-2014-9862 - check for a negative value on numbers of bytes + The implementation of bspatch does not check for a negative value on numbers + of bytes read from the diff and extra streams, allowing an attacker who + can control the patch file to write at arbitrary locations in the heap. + . + bspatch's main loop reads three numbers from the "control" stream in + the patch: X, Y and Z. The first two are the number of bytes to read + from "diff" and "extra" (and thus only non-negative), while the + third one could be positive or negative and moves the oldpos pointer + on the source image. These 3 values are 64bits signed ints (encoded + somehow on the file) that are later passed the function that reads + from the streams, but those values are not verified to be + non-negative. + . + Official report https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-9862 + The patch was downloaded from a link pointed by + https://security.freebsd.org/advisories/FreeBSD-SA-16:25.bsp + +--- + bspatch.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/bspatch.c ++++ b/bspatch.c +@@ -152,6 +152,10 @@ int main(int argc,char * argv[]) + }; + + /* Sanity-check */ ++ if ((ctrl[0] < 0) || (ctrl[1] < 0)) ++ errx(1,"Corrupt patch\n"); ++ ++ /* Sanity-check */ + if(newpos+ctrl[0]>newsize) + errx(1,"Corrupt patch\n"); + diff --git a/package/utils/bsdiff/patches/033-CVE-2020-14315.patch b/package/utils/bsdiff/patches/033-CVE-2020-14315.patch new file mode 100644 index 00000000000..975cb181dcd --- /dev/null +++ b/package/utils/bsdiff/patches/033-CVE-2020-14315.patch @@ -0,0 +1,383 @@ +Description: patch for CVE-2020-14315 + A memory corruption vulnerability is present in bspatch as shipped in + Colin Percival’s bsdiff tools version 4.3. Insufficient checks when + handling external inputs allows an attacker to bypass the sanity checks + in place and write out of a dynamically allocated buffer boundaries. +Source: https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co +Author: tony mancill +Comment: The patch was created by comparing the Debian sources to the + "Confirmed Patched Version" [1] documented in the + X41 D-SEC GmbH Security Advisory: X41-2020-006 [2]. + References to FreeBSD capsicum have been dropped. Definitions for + TYPE_MINIMUM and TYPE_MAXIMUM have been borrowed from the Debian + coreutils package sources but originate in gnulib [3] and are used to + define OFF_MIN and OFF_MAX (limits of off_t). Whitespace changes from + the confirmed patched version are also included and keep the difference + between the Debian sources and the confirmed patched version minimal. + . + [1] https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co + [2] https://www.openwall.com/lists/oss-security/2020/07/09/2 + [3] https://www.gnu.org/software/gnulib/ +Last-Update: 2021-04-03 +Forwarded: not-needed +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964796 + +--- a/bspatch.c ++++ b/bspatch.c +@@ -1,4 +1,6 @@ + /*- ++ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD ++ * + * Copyright 2003-2005 Colin Percival + * All rights reserved + * +@@ -25,55 +27,147 @@ + */ + + #if 0 +-__FBSDID("$FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.c,v 1.1 2005/08/06 01:59:06 cperciva Exp $"); ++__FBSDID("$FreeBSD$"); + #endif + + #include +-#include ++#include ++#include ++#include ++#include ++#include + #include ++#include + #include +-#include + #include +-#include ++ ++#ifndef O_BINARY ++#define O_BINARY 0 ++#endif ++#define HEADER_SIZE 32 ++ ++/* TYPE_MINIMUM and TYPE_MAXIMUM taken from coreutils */ ++#ifndef TYPE_MINIMUM ++#define TYPE_MINIMUM(t) \ ++ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) ++#endif ++#ifndef TYPE_MAXIMUM ++#define TYPE_MAXIMUM(t) \ ++ ((t) ((t) 0 < (t) -1 \ ++ ? (t) -1 \ ++ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) ++#endif ++ ++#ifndef OFF_MAX ++#define OFF_MAX TYPE_MAXIMUM(off_t) ++#endif ++ ++#ifndef OFF_MIN ++#define OFF_MIN TYPE_MINIMUM(off_t) ++#endif ++ ++static char *newfile; ++static int dirfd = -1; ++ ++static void ++exit_cleanup(void) ++{ ++ ++ if (dirfd != -1 && newfile != NULL) ++ if (unlinkat(dirfd, newfile, 0)) ++ warn("unlinkat"); ++} ++ ++static inline off_t ++add_off_t(off_t a, off_t b) ++{ ++ off_t result; ++ ++#if __GNUC__ >= 5 || \ ++ (defined(__has_builtin) && __has_builtin(__builtin_add_overflow)) ++ if (__builtin_add_overflow(a, b, &result)) ++ errx(1, "Corrupt patch"); ++#else ++ if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b)) ++ errx(1, "Corrupt patch"); ++ result = a + b; ++#endif ++ return result; ++} + + static off_t offtin(unsigned char *buf) + { + off_t y; + +- y=buf[7]&0x7F; +- y=y*256;y+=buf[6]; +- y=y*256;y+=buf[5]; +- y=y*256;y+=buf[4]; +- y=y*256;y+=buf[3]; +- y=y*256;y+=buf[2]; +- y=y*256;y+=buf[1]; +- y=y*256;y+=buf[0]; ++ y = buf[7] & 0x7F; ++ y = y * 256; y += buf[6]; ++ y = y * 256; y += buf[5]; ++ y = y * 256; y += buf[4]; ++ y = y * 256; y += buf[3]; ++ y = y * 256; y += buf[2]; ++ y = y * 256; y += buf[1]; ++ y = y * 256; y += buf[0]; + +- if(buf[7]&0x80) y=-y; ++ if (buf[7] & 0x80) ++ y = -y; + +- return y; ++ return (y); + } + +-int main(int argc,char * argv[]) ++static void ++usage(void) + { +- FILE * f, * cpf, * dpf, * epf; +- BZFILE * cpfbz2, * dpfbz2, * epfbz2; ++ ++ fprintf(stderr, "usage: bspatch oldfile newfile patchfile\n"); ++ exit(1); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ FILE *f, *cpf, *dpf, *epf; ++ BZFILE *cpfbz2, *dpfbz2, *epfbz2; ++ char *directory, *namebuf; + int cbz2err, dbz2err, ebz2err; +- int fd; +- ssize_t oldsize,newsize; +- ssize_t bzctrllen,bzdatalen; +- unsigned char header[32],buf[8]; ++ int newfd, oldfd; ++ off_t oldsize, newsize; ++ off_t bzctrllen, bzdatalen; ++ unsigned char header[HEADER_SIZE], buf[8]; + unsigned char *old, *new; +- off_t oldpos,newpos; ++ off_t oldpos, newpos; + off_t ctrl[3]; +- off_t lenread; +- off_t i; ++ off_t i, lenread, offset; + +- if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); ++ if (argc != 4) ++ usage(); + + /* Open patch file */ +- if ((f = fopen(argv[3], "r")) == NULL) ++ if ((f = fopen(argv[3], "rb")) == NULL) ++ err(1, "fopen(%s)", argv[3]); ++ /* Open patch file for control block */ ++ if ((cpf = fopen(argv[3], "rb")) == NULL) ++ err(1, "fopen(%s)", argv[3]); ++ /* open patch file for diff block */ ++ if ((dpf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); ++ /* open patch file for extra block */ ++ if ((epf = fopen(argv[3], "rb")) == NULL) ++ err(1, "fopen(%s)", argv[3]); ++ /* open oldfile */ ++ if ((oldfd = open(argv[1], O_RDONLY | O_BINARY, 0)) < 0) ++ err(1, "open(%s)", argv[1]); ++ /* open directory where we'll write newfile */ ++ if ((namebuf = strdup(argv[2])) == NULL || ++ (directory = dirname(namebuf)) == NULL || ++ (dirfd = open(directory, O_DIRECTORY)) < 0) ++ err(1, "open %s", argv[2]); ++ free(namebuf); ++ if ((newfile = basename(argv[2])) == NULL) ++ err(1, "basename"); ++ /* open newfile */ ++ if ((newfd = openat(dirfd, newfile, ++ O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0) ++ err(1, "open(%s)", argv[2]); ++ atexit(exit_cleanup); + + /* + File format: +@@ -90,104 +184,104 @@ int main(int argc,char * argv[]) + */ + + /* Read header */ +- if (fread(header, 1, 32, f) < 32) { ++ if (fread(header, 1, HEADER_SIZE, f) < HEADER_SIZE) { + if (feof(f)) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + err(1, "fread(%s)", argv[3]); + } + + /* Check for appropriate magic */ + if (memcmp(header, "BSDIFF40", 8) != 0) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + + /* Read lengths from header */ +- bzctrllen=offtin(header+8); +- bzdatalen=offtin(header+16); +- newsize=offtin(header+24); +- if((bzctrllen<0) || (bzdatalen<0) || (newsize<0)) +- errx(1,"Corrupt patch\n"); ++ bzctrllen = offtin(header + 8); ++ bzdatalen = offtin(header + 16); ++ newsize = offtin(header + 24); ++ if (bzctrllen < 0 || bzctrllen > OFF_MAX - HEADER_SIZE || ++ bzdatalen < 0 || bzctrllen + HEADER_SIZE > OFF_MAX - bzdatalen || ++ newsize < 0 || newsize > SSIZE_MAX) ++ errx(1, "Corrupt patch"); + + /* Close patch file and re-open it via libbzip2 at the right places */ + if (fclose(f)) + err(1, "fclose(%s)", argv[3]); +- if ((cpf = fopen(argv[3], "r")) == NULL) +- err(1, "fopen(%s)", argv[3]); +- if (fseeko(cpf, 32, SEEK_SET)) +- err(1, "fseeko(%s, %lld)", argv[3], +- (long long)32); ++ offset = HEADER_SIZE; ++ if (fseeko(cpf, offset, SEEK_SET)) ++ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); + if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) + errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); +- if ((dpf = fopen(argv[3], "r")) == NULL) +- err(1, "fopen(%s)", argv[3]); +- if (fseeko(dpf, 32 + bzctrllen, SEEK_SET)) +- err(1, "fseeko(%s, %lld)", argv[3], +- (long long)(32 + bzctrllen)); ++ offset = add_off_t(offset, bzctrllen); ++ if (fseeko(dpf, offset, SEEK_SET)) ++ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); + if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) + errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); +- if ((epf = fopen(argv[3], "r")) == NULL) +- err(1, "fopen(%s)", argv[3]); +- if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET)) +- err(1, "fseeko(%s, %lld)", argv[3], +- (long long)(32 + bzctrllen + bzdatalen)); ++ offset = add_off_t(offset, bzdatalen); ++ if (fseeko(epf, offset, SEEK_SET)) ++ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); + if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) + errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); + +- if(((fd=open(argv[1],O_RDONLY,0))<0) || +- ((oldsize=lseek(fd,0,SEEK_END))==-1) || +- ((old=malloc(oldsize+1))==NULL) || +- (lseek(fd,0,SEEK_SET)!=0) || +- (read(fd,old,oldsize)!=oldsize) || +- (close(fd)==-1)) err(1,"%s",argv[1]); +- if((new=malloc(newsize+1))==NULL) err(1,NULL); +- +- oldpos=0;newpos=0; +- while(newpos SSIZE_MAX || ++ (old = malloc(oldsize)) == NULL || ++ lseek(oldfd, 0, SEEK_SET) != 0 || ++ read(oldfd, old, oldsize) != oldsize || ++ close(oldfd) == -1) ++ err(1, "%s", argv[1]); ++ if ((new = malloc(newsize)) == NULL) ++ err(1, NULL); ++ ++ oldpos = 0; ++ newpos = 0; ++ while (newpos < newsize) { + /* Read control data */ +- for(i=0;i<=2;i++) { ++ for (i = 0; i <= 2; i++) { + lenread = BZ2_bzRead(&cbz2err, cpfbz2, buf, 8); + if ((lenread < 8) || ((cbz2err != BZ_OK) && + (cbz2err != BZ_STREAM_END))) +- errx(1, "Corrupt patch\n"); +- ctrl[i]=offtin(buf); +- }; ++ errx(1, "Corrupt patch"); ++ ctrl[i] = offtin(buf); ++ } + + /* Sanity-check */ +- if ((ctrl[0] < 0) || (ctrl[1] < 0)) +- errx(1,"Corrupt patch\n"); ++ if (ctrl[0] < 0 || ctrl[0] > INT_MAX || ++ ctrl[1] < 0 || ctrl[1] > INT_MAX) ++ errx(1, "Corrupt patch"); + + /* Sanity-check */ +- if(newpos+ctrl[0]>newsize) +- errx(1,"Corrupt patch\n"); ++ if (add_off_t(newpos, ctrl[0]) > newsize) ++ errx(1, "Corrupt patch"); + + /* Read diff string */ + lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]); + if ((lenread < ctrl[0]) || + ((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END))) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + + /* Add old data to diff string */ +- for(i=0;i=0) && (oldpos+inewsize) +- errx(1,"Corrupt patch\n"); ++ if (add_off_t(newpos, ctrl[1]) > newsize) ++ errx(1, "Corrupt patch"); + + /* Read extra string */ + lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]); + if ((lenread < ctrl[1]) || + ((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END))) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + + /* Adjust pointers */ +- newpos+=ctrl[1]; +- oldpos+=ctrl[2]; +- }; ++ newpos = add_off_t(newpos, ctrl[1]); ++ oldpos = add_off_t(oldpos, ctrl[2]); ++ } + + /* Clean up the bzip2 reads */ + BZ2_bzReadClose(&cbz2err, cpfbz2); +@@ -197,12 +291,13 @@ int main(int argc,char * argv[]) + err(1, "fclose(%s)", argv[3]); + + /* Write the new file */ +- if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY,0666))<0) || +- (write(fd,new,newsize)!=newsize) || (close(fd)==-1)) +- err(1,"%s",argv[2]); ++ if (write(newfd, new, newsize) != newsize || close(newfd) == -1) ++ err(1, "%s", argv[2]); ++ /* Disable atexit cleanup */ ++ newfile = NULL; + + free(new); + free(old); + +- return 0; ++ return (0); + } From 66f6c20e45aa0eb2649d1e0552eab9e138e38601 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 9 Oct 2023 02:06:55 +0200 Subject: [PATCH 35/78] lantiq: Fix an sleeping function called from invalid context The ifx_pcie_bus_enum_hack() function is called in ifx_pcie_read_config() while holding the ifx_pcie_lock spinlock. The ifx_pcie_bus_enum_hack() function calls pci_get_slot() which could sleep. Add a new function for pci_get_slot() which does not use a semaphore, the mutex should be sufficient. This fixes the sleep in atomic context which could cause a hang of the system. This fixes the following warning seen with CONFIG_KERNEL_DEBUG_ATOMIC_SLEEP=y. [ 12.264300] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff] [ 12.272226] BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1487 [ 12.280684] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 9, name: kworker/u4:0 [ 12.288781] CPU: 0 PID: 9 Comm: kworker/u4:0 Not tainted 5.15.134 #0 [ 12.295135] Workqueue: events_unbound deferred_probe_work_func [ 12.300964] Stack : 80e70000 8008ac80 00000000 00000004 807c776c 8145b9ec 81424c00 800520ec [ 12.309316] 808a0000 8145ba2b 8145b844 8145b838 80414178 00000001 8145b9f8 81439ea0 [ 12.317674] 00000000 00000000 807c776c 8145b838 ffffefff 00000000 00000000 ffffffea [ 12.326030] 00000081 8145b844 00000081 808a6f50 807c776c 00000000 00000000 80910000 [ 12.334391] 00111bef 00000000 00000001 00000000 00000018 00000030 00000000 80e40000 [ 12.342741] ... [ 12.345177] Call Trace: [ 12.347613] [<8000c1d0>] show_stack+0x28/0xf0 [ 12.351974] [<8038ba1c>] dump_stack_lvl+0x60/0x80 [ 12.356667] [<8005eefc>] ___might_sleep+0x124/0x138 [ 12.361547] [<806daf30>] down_read+0x24/0x88 [ 12.365807] [<803cdd20>] pci_get_slot+0x2c/0xc0 [ 12.370333] [<806d56ac>] ifx_pcie_read_config+0x164/0x330 [ 12.375735] [<803be610>] pci_bus_read_config_dword+0x6c/0xd0 [ 12.381399] [<803c20cc>] pci_bus_generic_read_dev_vendor_id+0x3c/0x1a8 [ 12.387915] [<803c27ec>] pci_scan_single_device+0x88/0x154 [ 12.393404] [<803c2928>] pci_scan_slot+0x70/0x134 [ 12.398099] [<803c3bf0>] pci_scan_child_bus_extend+0x5c/0x320 [ 12.403849] [<803c4178>] pci_scan_root_bus_bridge+0xd0/0xec [ 12.409414] [<806d45a8>] pcibios_scanbus+0xe4/0x21c [ 12.414293] [<806d4908>] register_pci_controller+0xb8/0x11c [ 12.419858] [<806d5f9c>] ifx_pcie_bios_probe+0x724/0x940 [ 12.425174] [<80417574>] platform_probe+0x38/0x90 [ 12.429868] [<80414d68>] really_probe.part.0+0xac/0x354 [ 12.435103] [<80415298>] driver_probe_device+0x4c/0x154 [ 12.440313] [<80415904>] __device_attach_driver+0xd0/0x15c [ 12.445802] [<804129d8>] bus_for_each_drv+0x70/0xb0 [ 12.450676] [<80415610>] __device_attach+0xdc/0x194 [ 12.455545] [<80413ca8>] bus_probe_device+0x9c/0xb8 [ 12.460419] [<8041420c>] deferred_probe_work_func+0x94/0xd4 [ 12.465995] [<8004fcb4>] process_one_work+0x27c/0x4c8 [ 12.471044] [<80050710>] worker_thread+0x34c/0x5f8 [ 12.475825] [<800587a8>] kthread+0x168/0x18c [ 12.480090] [<80006ef8>] ret_from_kernel_thread+0x14/0x1c Signed-off-by: Hauke Mehrtens --- .../0001-MIPS-lantiq-add-pcie-driver.patch | 57 +++++++++++++++++-- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch index 9cd3b08b8e1..b0995cbccf5 100644 --- a/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch @@ -1470,7 +1470,7 @@ Signed-off-by: John Crispin + --- /dev/null +++ b/arch/mips/pci/ifxmips_pcie_ar10.h -@@ -0,0 +1,290 @@ +@@ -0,0 +1,305 @@ +/**************************************************************************** + Copyright (c) 2010 + Lantiq Deutschland GmbH @@ -1722,6 +1722,21 @@ Signed-off-by: John Crispin + return tbus_number; +} + ++static struct pci_dev *ifx_pci_get_slot(struct pci_bus *bus, unsigned int devfn) ++{ ++ struct pci_dev *dev; ++ ++ list_for_each_entry(dev, &bus->devices, bus_list) { ++ if (dev->devfn == devfn) ++ goto out; ++ } ++ ++ dev = NULL; ++ out: ++ pci_dev_get(dev); ++ return dev; ++} ++ +static inline u32 +ifx_pcie_bus_enum_hack(struct pci_bus *bus, u32 devfn, int where, u32 value, int pcie_port, int read) +{ @@ -1729,7 +1744,7 @@ Signed-off-by: John Crispin + u32 tvalue = value; + + /* Sanity check */ -+ pdev = pci_get_slot(bus, devfn); ++ pdev = ifx_pci_get_slot(bus, devfn); + if (pdev == NULL) { + return tvalue; + } @@ -3860,7 +3875,7 @@ Signed-off-by: John Crispin + --- /dev/null +++ b/arch/mips/pci/ifxmips_pcie_vr9.h -@@ -0,0 +1,269 @@ +@@ -0,0 +1,284 @@ +/**************************************************************************** + Copyright (c) 2010 + Lantiq Deutschland GmbH @@ -4094,6 +4109,21 @@ Signed-off-by: John Crispin + return tbus_number; +} + ++static inline struct pci_dev *ifx_pci_get_slot(struct pci_bus *bus, unsigned int devfn) ++{ ++ struct pci_dev *dev; ++ ++ list_for_each_entry(dev, &bus->devices, bus_list) { ++ if (dev->devfn == devfn) ++ goto out; ++ } ++ ++ dev = NULL; ++ out: ++ pci_dev_get(dev); ++ return dev; ++} ++ +static inline u32 +ifx_pcie_bus_enum_hack(struct pci_bus *bus, u32 devfn, int where, u32 value, int pcie_port, int read) +{ @@ -4101,7 +4131,7 @@ Signed-off-by: John Crispin + u32 tvalue = value; + + /* Sanity check */ -+ pdev = pci_get_slot(bus, devfn); ++ pdev = ifx_pci_get_slot(bus, devfn); + if (pdev == NULL) { + return tvalue; + } @@ -4165,7 +4195,7 @@ Signed-off-by: John Crispin +EXPORT_SYMBOL(pcibios_1st_host_bus_nr); --- /dev/null +++ b/arch/mips/pci/pcie-lantiq.h -@@ -0,0 +1,1301 @@ +@@ -0,0 +1,1316 @@ +/****************************************************************************** +** +** FILE NAME : ifxmips_pcie_reg.h @@ -5431,6 +5461,21 @@ Signed-off-by: John Crispin + return tbus_number; +} + ++static struct pci_dev *ifx_pci_get_slot(struct pci_bus *bus, unsigned int devfn) ++{ ++ struct pci_dev *dev; ++ ++ list_for_each_entry(dev, &bus->devices, bus_list) { ++ if (dev->devfn == devfn) ++ goto out; ++ } ++ ++ dev = NULL; ++ out: ++ pci_dev_get(dev); ++ return dev; ++} ++ +static inline u32 +ifx_pcie_bus_enum_hack(struct pci_bus *bus, u32 devfn, int where, u32 value, int pcie_port, int read) +{ @@ -5438,7 +5483,7 @@ Signed-off-by: John Crispin + u32 tvalue = value; + + /* Sanity check */ -+ pdev = pci_get_slot(bus, devfn); ++ pdev = ifx_pci_get_slot(bus, devfn); + if (pdev == NULL) { + return tvalue; + } From 67e465b32ea236225924f43b9cf64faad9594be7 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Tue, 1 Aug 2023 23:43:12 +0200 Subject: [PATCH 36/78] util-linux: update to 2.39.2 Changelog: 4d3079ad4 build-sys: release++ (v2.39.2) 9dc7d9808 docs: update v2.39.2-ReleaseNotes 4ffb7ac7c docs: update AUTHORS file 20781132f po-man: merge changes 76228ce1c po: merge changes 86c851c27 po-man: update sr.po (from translationproject.org) c695dce97 po: update sr.po (from translationproject.org) b168eef36 po: update ja.po (from translationproject.org) 83557da34 po: update hr.po (from translationproject.org) 5495eeb64 po: update es.po (from translationproject.org) 7de55c1ea setarch: add PER_LINUX_FDPIC fallback b101de3d0 libblkid: fix topology chain types mismatch 131098cc8 uuidd: improve man page for -cont-clock 112d2245e zramctl: add hint about supported algorithms f5b01cd95 meson: check for HAVE_STRUCT_STATX_STX_MNT_ID a1f803340 include: define pidfd syscalls if needed 032c502d5 wall: do not error for ttys that do not exist 140404e1f column: fix -l 1632bd6d4 lscpu: Even more Arm part numbers (early 2023) fc0a64480 chrt: (man) add note about --sched-period lower limit 073d02941 meson: add check for struct statx 9d54f7c99 meson: add check for linux/mount.h d14d39cbd libmount: improve EPERM interpretation ce266c9e1 libmount: ifdef statx() call a64cec15a libmount: check for struct statx 396798d6b libmount: check for linux/mount.h 03435a7c6 libmount: (utils) fix statx fallback 993581379 libmount: cleanup --fake mode 501227232 libmount: (python): work around python 3.12 bug 8950e9852 build-sys: add AX_COMPARE_VERSION 1e05167df libmount: update documentation for MNT_ERR_APPLYFLAGS e7c34902f libmount: fix typo e5858dbb6 libmount: use some MS_* flags as superblock flags f1875239b libmount: use mount(2) for remount on Linux < 5.14 58cb00c63 github: check apt-cache in more robust way 0a9bf6166 libmount: handle failure to apply flags as part of a mount operation e98ef85a8 build-sys: release++ (v2.39.1) 12169133e docs: update v2.39.1-ReleaseNotes 508e25110 docs: update AUTHORS file 6b865e1b0 po-man: merge changes aa4f94cb5 po: merge changes cad75b635 po-man: add ro.po (from translationproject.org) 8acfe93b7 po-man: add ko.po (from translationproject.org) 5f31e774c po-man: update uk.po (from translationproject.org) 29626b095 po: update hr.po (from translationproject.org) 90835e74a cal: fix long option name for -c 7826c3ebe cal: fix error message for bad -c argument 07e6b9a12 lib/strutils: fix typo cc99bfd06 build-sys: don't call pkg-config --static if unnecessary 3b59942da logger: initialize socket credentials contol union 4746cf936 unshare: fix error message for unexpected time offsets a34e6aced losetup: deduplicate find_unused() logic 423d9efab lib/loopdev: consistently return error values from loopcxt_find_unused() 8feec98a8 lib/loopdev: document function return values 36ce0c250 tests: (run.sh) detect builddir from working directory 1943ad6cd hardlink: (man) add missing comma 1a4522541 libmount: fix sync options between context and fs structs 3aba3fb95 tests: (lsfd) add a case for verifying ENDPOINTS column output in JSON mode c289c152a lsfd: use ARRAY_STRING for ENDPOINTS column in JSON output mode 665e28c30 lsfd: (filter) weakly support ARRAY_STRING and ARRAY_NUMBER json types d9fca2b62 sfdisk: add hint about duplicate UUIDs when use dump d84ee5a46 lib: remove pager.c from libcommon c50da4b07 lib/ include/: cleanup license headers d5adeed7a lib/color-names: fix license header 868f7f10c tests: fix update special mount test output 2278e2f91 tests: backport special mount script d8a4e680f libmount: always ignore user= 22d0a6557 meson: check for _NL_TIME_WEEK_1STDAY in langinfo.h 205e88e51 meson: conditionalize waitpid aebfa97d5 meson: add conditionalization for test progs bbe24d5b1 meson: implement HAVE_PTY bc58e3b35 meson: install write setgid f5a411883 meson: install wall setgid 64e67f720 meson: install umount setuid 4c3c05006 meson: install mount setuid 58c107277 meson: install newgrp setuid 8549017af meson: install su setuid fa818dc8d meson: install chsh setuid 1e9fc724e meson: install chfn setuid 53ff0fcda libmount: introduce LIBMOUNT_FORCE_MOUNT2={always,never,auto} 61307a950 libmount: (optlist) correctly detect ro status 8c85b0805 tests: backport mount_setattr test 5004732d8 libblkid: jfs - avoid undefined shift c082e6182 build-sys: fix typo in waitpid check b04446bfd Update fsck.8.adoc 9429cc72b dmesg: make kmsg read() buffer big enough for kernel 198fd3fb2 Fix Blizzard-M2-Max 20c04a509 Add recent Apple ARM cores 9d4d768f2 libmount: don't call hooks after mount. helper 98ed3edf8 meson: install symlink for vigr man page f25cc3372 meson: include bash-completion for write 760c01641 meson: include bash-completion for newgrp ddf48064f libmount: cleanup enosys returns from mount hoop 230459358 libmount: don't call mount. helper with usernames 6fa034d0a libmount: fix options prepend/insert and merging f8c9ef62e libmount: check for availability of mount_setattr 9422991c9 libmount: don't pass option "defaults" to helper 2806759b5 build-sys: add --disable-waitpid 01e3ec515 mesg.1 cleanups/updates 00a19fb8c libblkid: (bcache) also calculate checksum over journal buckets 158639a2a libblkid: (bcache) extend superblock definition 43926e0b0 ci: prevent prompts during installation 01bb5d12d tools: (asciidoctor) explicitly require extensions module da22c179c build-sys: only pass --failure-level if supported 1bfc285fa lsfd: (tests) fix typo 66fac3e71 blkzone: don't take address of struct blk_zone d2e3ac959 enosys: add support for loongarch a369feacc meson: require 0.57 f084562c3 enosys: split audit arch detection into dedicated header 88f76e37a enosys: add support for sparc f65c49002 waitpid: only build when pidfd_open is available ddf9b36ea libsmartcols: (samples): fix format truncation warning 0d0766fbe test_uuidd: make pthread_t formatting more robust 873a896e0 mkfs.minix: handle 64bit time on 32bit system 69d8400e4 enosys: add support for MIPS, PowerPC and ARC 0ee8ac065 test_enosys: fix build on old kernels Remove upstreamed patches: - 0001-test_enosys-add-support-for-mips.patch - 200-meson-no-po.patch Backport patch: - 001-meson-properly-handle-gettext-non-existence.patch Signed-off-by: Nick Hainke --- package/utils/util-linux/Makefile | 6 ++-- ...001-test_enosys-add-support-for-mips.patch | 36 ------------------- ...roperly-handle-gettext-non-existence.patch | 28 +++++++++++++++ .../util-linux/patches/200-meson-no-po.patch | 10 ------ 4 files changed, 31 insertions(+), 49 deletions(-) delete mode 100644 package/utils/util-linux/patches/0001-test_enosys-add-support-for-mips.patch create mode 100644 package/utils/util-linux/patches/001-meson-properly-handle-gettext-non-existence.patch delete mode 100644 package/utils/util-linux/patches/200-meson-no-po.patch diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 90724eb3f62..2ab72a2d2c8 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.39 -PKG_RELEASE:=2 +PKG_VERSION:=2.39.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.39 -PKG_HASH:=32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb +PKG_HASH:=87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_LICENSE:=GPL-2.0-only diff --git a/package/utils/util-linux/patches/0001-test_enosys-add-support-for-mips.patch b/package/utils/util-linux/patches/0001-test_enosys-add-support-for-mips.patch deleted file mode 100644 index f8c8f851ec6..00000000000 --- a/package/utils/util-linux/patches/0001-test_enosys-add-support-for-mips.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2558932c65524d953e4c86d7fda2282a582aa5ec Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= -Date: Wed, 17 May 2023 16:50:47 +0200 -Subject: [PATCH] test_enosys: add support for mips, powerpc and arc -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Thomas Weißschuh ---- - tests/helpers/test_enosys.c | 14 ++ - 1 file changed, 2 insertions(+) - ---- a/tests/helpers/test_enosys.c -+++ b/tests/helpers/test_enosys.c -@@ -53,6 +53,20 @@ - # else - # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PPC64LE - # endif -+#elif __powerpc__ -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PPC -+#elif __mips__ -+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_MIPS -+# else -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_MIPSEL -+# endif -+#elif __arc__ -+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARCV2BE -+# else -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARCV2 -+# endif - #else - # error Unknown target architecture - #endif diff --git a/package/utils/util-linux/patches/001-meson-properly-handle-gettext-non-existence.patch b/package/utils/util-linux/patches/001-meson-properly-handle-gettext-non-existence.patch new file mode 100644 index 00000000000..f3d49d8d2de --- /dev/null +++ b/package/utils/util-linux/patches/001-meson-properly-handle-gettext-non-existence.patch @@ -0,0 +1,28 @@ +From b8bed37a1493b913bf5bda938487ae0c06c11ce7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sat, 5 Aug 2023 08:57:28 +0200 +Subject: [PATCH] meson: properly handle gettext non-existence +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit e91a49c9747f ("meson: don't build po if no gettext") +tried to add the possibility to build util-linux without gettext. + +Unfortunately by default the call to find_program() would abort the +build if the program is not found. +Avoid aborting the build. + +Signed-off-by: Thomas Weißschuh +--- + po/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/po/meson.build ++++ b/po/meson.build +@@ -1,4 +1,4 @@ +-if not find_program('gettext').found() ++if not find_program('gettext', required : false).found() + subdir_done() + endif + diff --git a/package/utils/util-linux/patches/200-meson-no-po.patch b/package/utils/util-linux/patches/200-meson-no-po.patch deleted file mode 100644 index 4d94f6b89ab..00000000000 --- a/package/utils/util-linux/patches/200-meson-no-po.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/meson.build -+++ b/meson.build -@@ -874,7 +874,6 @@ subdir('disk-utils') - subdir('misc-utils') - subdir('text-utils') - subdir('term-utils') --subdir('po') - - includes = [dir_include, - dir_libblkid, From 9947fe74e3f0daae42b103490f674841f822907b Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 11 Oct 2023 08:28:24 +0200 Subject: [PATCH 37/78] tools/cmake: update to 3.27.5 Release Notes: - https://www.kitware.com/cmake-3-27-5-available-for-download/ - https://www.kitware.com/cmake-3-27-6-available-for-download/ - https://www.kitware.com/cmake-3-27-7-available-for-download/ Signed-off-by: Nick Hainke --- tools/cmake/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 9ed7ccb5a51..813e4849159 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.27.4 +PKG_VERSION:=3.27.7 PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION))) PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:kitware:cmake @@ -15,7 +15,7 @@ PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ https://cmake.org/files/v$(PKG_VERSION_MAJOR)/ -PKG_HASH:=0a905ca8635ca81aa152e123bdde7e54cbe764fdd9a70d62af44cad8b92967af +PKG_HASH:=08f71a106036bf051f692760ef9558c0577c42ac39e96ba097e7662bd4158d8e HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 From 6d9af0ee5a643166d338b49b276e7285038dfdec Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 11 Oct 2023 14:38:51 +0200 Subject: [PATCH 38/78] tools/ccache: update to 4.8.3 Release Notes: https://ccache.dev/releasenotes.html#_ccache_4_8_3 Signed-off-by: Nick Hainke --- tools/ccache/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 7b89b441010..f76be9f90ed 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ccache -PKG_VERSION:=4.8.2 +PKG_VERSION:=4.8.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=3d3fb3f888a5b16c4fa7ee5214cca76348afd6130e8443de5f6f2424f2076a49 +PKG_HASH:=e47374c810b248cfca3665ee1d86c7c763ffd68d9944bc422d9c1872611f2b11 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From 01ae733e061cf5e4d258654d177a0d82b05fe48b Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 11 Oct 2023 16:54:13 +0200 Subject: [PATCH 39/78] tools/gmp: update to 6.3 Release Notes: https://gmplib.org/gmp6.3 Signed-off-by: Nick Hainke --- tools/gmp/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gmp/Makefile b/tools/gmp/Makefile index c48069dd7bc..7f0a7a7a6a1 100644 --- a/tools/gmp/Makefile +++ b/tools/gmp/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gmp -PKG_VERSION:=6.2.1 +PKG_VERSION:=6.3.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gmp/ -PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 +PKG_HASH:=a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898 PKG_CPE_ID:=cpe:/a:gmplib:gmp HOST_FIXUP:=autoreconf From c0f1980adf3db2a2651ab4ef621b8ea741837a6d Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 11 Oct 2023 17:04:00 +0200 Subject: [PATCH 40/78] tools/libdeflate: update to 1.19 Release Notes: https://github.com/ebiggers/libdeflate/blob/master/NEWS.md#version-119 Signed-off-by: Nick Hainke --- tools/libdeflate/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libdeflate/Makefile b/tools/libdeflate/Makefile index e0f348196dc..5da6c693eac 100644 --- a/tools/libdeflate/Makefile +++ b/tools/libdeflate/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libdeflate -PKG_VERSION:=1.18 +PKG_VERSION:=1.19 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/ebiggers/libdeflate.git PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=v$(PKG_VERSION) -PKG_MIRROR_HASH:=015cbd33b1382b812f7c035640709186bc5d3d6a0ab177bffa7948f26f64edf9 +PKG_MIRROR_HASH:=5aac9801815384a5e417c8345d25d07547648e28403566ef73a46295ec26b6c4 include $(INCLUDE_DIR)/host-build.mk From cdcabbd490c846766edb2bb66a596999c05e49ac Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 11 Oct 2023 17:22:40 +0200 Subject: [PATCH 41/78] tools/pkgconf: update to 2.0.3 News: - https://github.com/pkgconf/pkgconf/blob/752a9825dc8660d247c457aa4d256db4800ebd7c/NEWS#L13 - https://github.com/pkgconf/pkgconf/blob/752a9825dc8660d247c457aa4d256db4800ebd7c/NEWS#L4 Signed-off-by: Nick Hainke --- tools/pkgconf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index da1f005be63..0b460a9891a 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=2.0.1 +PKG_VERSION:=2.0.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=3238af7473740844e5159dd8fb6540603e3fbcebf60beb3c8a426cdca2e29c51 +PKG_HASH:=cabdf3c474529854f7ccce8573c5ac68ad34a7e621037535cbc3981f6b23836c PKG_CPE_ID:=cpe:/a:pkgconf:pkgconf From 096bb8ed82cebeb8926a5b64466afec649385159 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 11 Oct 2023 15:53:45 -0400 Subject: [PATCH 42/78] kernel: bump 5.15 to 5.15.135 Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.135 All patches automatically rebased. Build system: x86_64 Build-tested: ramips/tplink_archer-a6-v3 Run-tested: ramips/tplink_archer-a6-v3 Signed-off-by: John Audia --- include/kernel-5.15 | 4 ++-- .../ath79/patches-5.15/900-unaligned_access_hacks.patch | 8 ++++---- ...dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch | 6 +++--- ...-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch | 2 +- .../711-net-dsa-mv88e6xxx-disable-ATU-violation.patch | 2 +- ...auto-attach-mtd-device-named-ubi-or-data-on-boot.patch | 4 ++-- ...-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 35a21308aab..313e735a543 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .134 -LINUX_KERNEL_HASH-5.15.134 = f37182aecb57ed6853d01e1074d3a60a653331e35f3115728381e08be050b9d3 +LINUX_VERSION-5.15 = .135 +LINUX_KERNEL_HASH-5.15.135 = 14835e629e237f136cfed484fdb533c95242429809bdcdb2a2d66dfcb7447170 diff --git a/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch index 53f5b1472d9..47216bee71f 100644 --- a/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch @@ -349,7 +349,7 @@ SVN-Revision: 35130 list_for_each_entry(p, head, list) { --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -610,48 +610,53 @@ static void tcp_options_write(__be32 *pt +@@ -609,48 +609,53 @@ static void tcp_options_write(__be32 *pt u16 options = opts->options; /* mungable copy */ if (unlikely(OPTION_MD5 & options)) { @@ -426,7 +426,7 @@ SVN-Revision: 35130 } if (unlikely(opts->num_sack_blocks)) { -@@ -659,16 +664,17 @@ static void tcp_options_write(__be32 *pt +@@ -658,16 +663,17 @@ static void tcp_options_write(__be32 *pt tp->duplicate_sack : tp->selective_acks; int this_sack; @@ -450,7 +450,7 @@ SVN-Revision: 35130 } tp->rx_opt.dsack = 0; -@@ -681,13 +687,14 @@ static void tcp_options_write(__be32 *pt +@@ -680,13 +686,14 @@ static void tcp_options_write(__be32 *pt if (foc->exp) { len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; @@ -750,7 +750,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4157,14 +4157,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4170,14 +4170,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch b/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch index 01bc65609c5..8aa498046dc 100644 --- a/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch +++ b/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5370,7 +5370,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5372,7 +5372,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6191X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .port_base_addr = 0x0, .phy_base_addr = 0x0, -@@ -5392,7 +5393,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5394,7 +5395,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6193X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .port_base_addr = 0x0, .phy_base_addr = 0x0, -@@ -5702,7 +5704,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5704,7 +5706,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6393X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ diff --git a/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch b/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch index c8254e5e427..d86adf034ed 100644 --- a/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch +++ b/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch @@ -71,7 +71,7 @@ Signed-off-by: Robert Marko mv88e6065_phylink_validate(chip, port, mask, state); } -@@ -5649,6 +5671,31 @@ static const struct mv88e6xxx_info mv88e +@@ -5651,6 +5673,31 @@ static const struct mv88e6xxx_info mv88e .ptp_support = true, .ops = &mv88e6352_ops, }, diff --git a/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch index a63bb25f1a5..b2278069ddb 100644 --- a/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch +++ b/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -3015,6 +3015,9 @@ static int mv88e6xxx_setup_port(struct m +@@ -3017,6 +3017,9 @@ static int mv88e6xxx_setup_port(struct m else reg = 1 << port; diff --git a/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 2751da541a0..e8da36edba5 100644 --- a/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1200,6 +1200,73 @@ static struct mtd_info * __init open_mtd +@@ -1207,6 +1207,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1283,6 +1350,12 @@ static int __init ubi_init(void) +@@ -1290,6 +1357,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index fa9d7ff0b85..092e7933b76 100644 --- a/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -6391,6 +6391,7 @@ static int mv88e6xxx_register_switch(str +@@ -6393,6 +6393,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; From 63f5b5ed3f4a23e78d72b38c18c76409190a5c14 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 00:33:04 +0200 Subject: [PATCH 43/78] tools/zlib: update to 1.3 Changes in 1.3 (18 Aug 2023) - Remove K&R function definitions and zlib2ansi - Fix bug in deflateBound() for level 0 and memLevel 9 - Fix bug when gzungetc() is used immediately after gzopen() - Fix bug when using gzflush() with a very small buffer - Fix crash when gzsetparams() attempted for transparent write - Fix test/example.c to work with FORCE_STORED - Rewrite of zran in examples (see zran.c version history) - Fix minizip to allow it to open an empty zip file - Fix reading disk number start on zip64 files in minizip - Fix logic error in minizip argument processing - Add minizip testing to Makefile - Read multiple bytes instead of byte-by-byte in minizip unzip.c - Add memory sanitizer to configure (--memory) - Various portability improvements - Various documentation improvements - Various spelling and typo corrections Signed-off-by: Nick Hainke --- tools/zlib/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/zlib/Makefile b/tools/zlib/Makefile index 17fe9fa233d..e802a0272e4 100644 --- a/tools/zlib/Makefile +++ b/tools/zlib/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib -PKG_VERSION:=1.2.13 +PKG_VERSION:=1.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/madler/zlib/releases/download/v$(PKG_VERSION) -PKG_HASH:=d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98 +PKG_HASH:=8a9ba2898e1d0d774eca6ba5b4627a11e5588ba85c8851336eb38de4683050a7 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README From bf4092cf61d4a348c41cb26297fb979b7ba9acc7 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 00:51:16 +0200 Subject: [PATCH 44/78] libjson-c: update to 0.17 Release Notes: https://github.com/json-c/json-c/blob/ad8b8afa7d567053b87f2d37ee4a534e13c210c7/ChangeLog#L2 Refresh patch: - 001-dont-build-docs.patch Delete upstreamed patch: - 010-fix-build-with-clang-15.patch Signed-off-by: Nick Hainke --- package/libs/libjson-c/Makefile | 6 +- .../patches/001-dont-build-docs.patch | 2 +- .../patches/010-fix-build-with-clang-15.patch | 184 ------------------ 3 files changed, 4 insertions(+), 188 deletions(-) delete mode 100644 package/libs/libjson-c/patches/010-fix-build-with-clang-15.patch diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index d925ac750d6..063cf264427 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=json-c -PKG_VERSION:=0.16 -PKG_RELEASE:=3 +PKG_VERSION:=0.17 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/ -PKG_HASH:=ac8a3dd6820daaca579b23fbc74664310fbc3d67f52f6707cda67d21dde5570f +PKG_HASH:=8df3b66597333dd365762cab2de2ff68e41e3808a04b692e696e0550648eefaa PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=MIT diff --git a/package/libs/libjson-c/patches/001-dont-build-docs.patch b/package/libs/libjson-c/patches/001-dont-build-docs.patch index f35da807248..1de420f8b87 100644 --- a/package/libs/libjson-c/patches/001-dont-build-docs.patch +++ b/package/libs/libjson-c/patches/001-dont-build-docs.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -433,8 +433,6 @@ configure_file(json.h.cmakein ${PROJECT_ +@@ -451,8 +451,6 @@ configure_file(json.h.cmakein ${PROJECT_ include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_BINARY_DIR}) diff --git a/package/libs/libjson-c/patches/010-fix-build-with-clang-15.patch b/package/libs/libjson-c/patches/010-fix-build-with-clang-15.patch deleted file mode 100644 index d6af772e06b..00000000000 --- a/package/libs/libjson-c/patches/010-fix-build-with-clang-15.patch +++ /dev/null @@ -1,184 +0,0 @@ -From 6eca65617aacd19f4928acd5766b8dd20eda0b34 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 13 Aug 2022 20:37:03 -0700 -Subject: [PATCH] Fix build with clang-15+ - -Fixes -json_util.c:63:35: error: a function declaration without a prototype is deprecated in all versions of C [-We -rror,-Wstrict-prototypes] -const char *json_util_get_last_err() - ^ - void - -Signed-off-by: Khem Raj ---- - json_util.c | 2 +- - tests/test1.c | 6 +++--- - tests/test4.c | 2 +- - tests/test_cast.c | 2 +- - tests/test_charcase.c | 2 +- - tests/test_parse.c | 8 ++++---- - tests/test_printbuf.c | 4 ++-- - tests/test_util_file.c | 6 +++--- - 8 files changed, 16 insertions(+), 16 deletions(-) - ---- a/json_util.c -+++ b/json_util.c -@@ -60,7 +60,7 @@ static int _json_object_to_fd(int fd, st - - static char _last_err[256] = ""; - --const char *json_util_get_last_err() -+const char *json_util_get_last_err(void) - { - if (_last_err[0] == '\0') - return NULL; ---- a/tests/test1.c -+++ b/tests/test1.c -@@ -58,7 +58,7 @@ static const char *to_json_string(json_o - #endif - - json_object *make_array(void); --json_object *make_array() -+json_object *make_array(void) - { - json_object *my_array; - -@@ -74,7 +74,7 @@ json_object *make_array() - } - - void test_array_del_idx(void); --void test_array_del_idx() -+void test_array_del_idx(void) - { - int rc; - size_t ii; -@@ -140,7 +140,7 @@ void test_array_del_idx() - } - - void test_array_list_expand_internal(void); --void test_array_list_expand_internal() -+void test_array_list_expand_internal(void) - { - int rc; - size_t ii; ---- a/tests/test4.c -+++ b/tests/test4.c -@@ -28,7 +28,7 @@ void print_hex(const char *s) - } - - static void test_lot_of_adds(void); --static void test_lot_of_adds() -+static void test_lot_of_adds(void) - { - int ii; - char key[50]; ---- a/tests/test_cast.c -+++ b/tests/test_cast.c -@@ -94,7 +94,7 @@ static void getit(struct json_object *ne - printf("new_obj.%s json_object_get_double()=%f\n", field, json_object_get_double(o)); - } - --static void checktype_header() -+static void checktype_header(void) - { - printf("json_object_is_type: %s,%s,%s,%s,%s,%s,%s\n", json_type_to_name(json_type_null), - json_type_to_name(json_type_boolean), json_type_to_name(json_type_double), ---- a/tests/test_charcase.c -+++ b/tests/test_charcase.c -@@ -19,7 +19,7 @@ int main(int argc, char **argv) - } - - /* make sure only lowercase forms are parsed in strict mode */ --static void test_case_parse() -+static void test_case_parse(void) - { - struct json_tokener *tok; - json_object *new_obj; ---- a/tests/test_parse.c -+++ b/tests/test_parse.c -@@ -92,7 +92,7 @@ static void single_basic_parse(const cha - if (getenv("TEST_PARSE_CHUNKSIZE") != NULL) - single_incremental_parse(test_string, clear_serializer); - } --static void test_basic_parse() -+static void test_basic_parse(void) - { - single_basic_parse("\"\003\"", 0); - single_basic_parse("/* hello */\"foo\"", 0); -@@ -195,7 +195,7 @@ static void test_basic_parse() - single_basic_parse("[18446744073709551616]", 1); - } - --static void test_utf8_parse() -+static void test_utf8_parse(void) - { - // json_tokener_parse doesn't support checking for byte order marks. - // It's the responsibility of the caller to detect and skip a BOM. -@@ -222,7 +222,7 @@ static int clear_serializer(json_object - return JSON_C_VISIT_RETURN_CONTINUE; - } - --static void test_verbose_parse() -+static void test_verbose_parse(void) - { - json_object *new_obj; - enum json_tokener_error error = json_tokener_success; -@@ -562,7 +562,7 @@ struct incremental_step - {NULL, -1, -1, json_tokener_success, 0}, - }; - --static void test_incremental_parse() -+static void test_incremental_parse(void) - { - json_object *new_obj; - enum json_tokener_error jerr; ---- a/tests/test_printbuf.c -+++ b/tests/test_printbuf.c -@@ -16,7 +16,7 @@ static void test_printbuf_memset_length( - #define __func__ __FUNCTION__ - #endif - --static void test_basic_printbuf_memset() -+static void test_basic_printbuf_memset(void) - { - struct printbuf *pb; - -@@ -29,7 +29,7 @@ static void test_basic_printbuf_memset() - printf("%s: end test\n", __func__); - } - --static void test_printbuf_memset_length() -+static void test_printbuf_memset_length(void) - { - struct printbuf *pb; - ---- a/tests/test_util_file.c -+++ b/tests/test_util_file.c -@@ -35,7 +35,7 @@ static void test_read_fd_equal(const cha - #define PATH_MAX 256 - #endif - --static void test_write_to_file() -+static void test_write_to_file(void) - { - json_object *jso; - -@@ -231,7 +231,7 @@ static void test_read_valid_nested_with_ - close(d); - } - --static void test_read_nonexistant() -+static void test_read_nonexistant(void) - { - const char *filename = "./not_present.json"; - -@@ -249,7 +249,7 @@ static void test_read_nonexistant() - } - } - --static void test_read_closed() -+static void test_read_closed(void) - { - // Test reading from a closed fd - int d = open("/dev/null", O_RDONLY, 0); From 22174e7c2ac954a5fe0c65e6668073e7df7e4b9b Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 00:58:20 +0200 Subject: [PATCH 45/78] libmd: update to 1.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: 16d68ab Release libmd 1.1.0 054bca1 build: Terminate lists in variables with «# EOL» 84d269e test: Add cases for SHA224 and SHA512-256 a677e68 test: Add a new test_eq() helper function 4c5931f Sync SHA2 changes from OpenBSD 9934d94 Sync SHA1 changes from OpenBSD 457e30a Sync RMD160 changes from OpenBSD b2e54bc Sync MD5 changes from OpenBSD ee56a52 Sync MD4 changes from OpenBSD b9496ac Sync MD2 changes from NetBSD 09d5824 Remove unused 08b2c5d build: Rename libmd_alias() to libmd_strong_alias() ed69599 On Darwin use assembler to support symbol aliases b74b777 build: Do not use strong aliases on macOS 94838ec build: Require automake 1.11 39cbc7b build: Fix configure.ac indentation 4620a04 build: Switch to debian:latest Docker image e408786 build: Fix version script linker support detection 0ef1e4d doc: Move mailing list reference to the end a3f1671 man: Add new libmd(7) man page Signed-off-by: Nick Hainke --- package/libs/libmd/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libmd/Makefile b/package/libs/libmd/Makefile index faba27e5e94..06e516cef93 100644 --- a/package/libs/libmd/Makefile +++ b/package/libs/libmd/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libmd -PKG_VERSION:=1.0.4 +PKG_VERSION:=1.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://archive.hadrons.org/software/libmd/ -PKG_HASH:=f51c921042e34beddeded4b75557656559cf5b1f2448033b4c1eec11c07e530f +PKG_HASH:=1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=COPYING From 4e5d45f1e6cbc0cfd6018d6dddaa9997067cad09 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 01:05:38 +0200 Subject: [PATCH 46/78] libnl: update to 3.8.0 Changes: 6b2533c0 libnl-3.8.0 release 1558bd62 build: replace old "NOTE" in configure output and add summary f66383a4 build: avoid aclocal warning about missing "m4" directory e4402a4c build: run `autoupdate` for AM_PROG_LIBTOOL 5761b6af build: add "-Wno-portability" to AC_INIT_AUTOMAKE() 661f10a1 license: fix/adjust license for "src/nl-cls-add.c" c8fcb412 license: fix/adjust license for "src/nl-addr-{add,delete,list}.c" e3e6fd6d tests: use thread-safe localtime_r() instead of localtime() f520471c lib/xfrm: use thread-safe gmtime_r() instead of gmtime() be5add72 tests: avoid srandom()/random() in favor of _nltst_rand_u32() 40578a62 lib: use getprotobyname_r(), getprotobynumber_r() if available 8ee8b05f lib: fix error handling in nl_str2ip_proto() 09f03f29 tests: check nl_str2ip_proto() 74bffbf6 route: fix documentation comment for nl_nh_group_info 59f8db0d clang-format: add "-l" alias for option in "tools/clang-format.sh" 935cc90a clang-format: ignore reformatting commit in ".git-blame-ignore-revs" 53da4712 clang-format: reformat files with new format 65c43bfe clang-format: update ".clang-format" from linux kernel 4c39a2ce include: use instead of a1e9fb3d include/linux: add all linux headers that we use d37ffe15 include/linux: update all linux headers 1af767a8 include: add missing "extern "C"" specifier to public headers e0a5d12b all: drop "extern "C"" from internal code d9a1e0ce build: add "check-local-build-headers" test target to build public headers 02b87012 build: add a "check-local" build target f9413915 include: fix headers "include/netlink/route/{netconf.h,route/qdisc/red.h}" to be self-contained 680df173 idiag: "fix" license for "idiag-socket-details" tool 2f210d9a github: test build on alpine:latest for musl dcc4c0a5 Revert "gitignore: ignore patch files" 39106309 github: add test for linking with mold and fail on unknown versions f475c3b2 route/nh: drop not implemented "nh" API from headers 4c681e77 build: fix exporting symbol rtnl_link_info_ops_get 260c9575 include: don't explicitly include headers from "nl-default.h" 98c1e696 tests: cleanup include of netlink headers 42bec462 build: cleanup default include list in Makefile.am 4c1a119a include: include private linux headers with explicit path ca063725 python: add make target for python build 25c90193 python: drop unused "python/netlink/fixes.h" 3f3da7fd gitignore: ignore python build artifacts 61ef5609 gitignore: ignore generated doc files 298c5dc6 include: drop "netlink-private/netlink.h" and move declarations 862eed54 all: cleanup includes and use "nm-default.h" 2b3cd741 include: add "nl-default.h" header 8952ce6f build: move "lib/defs.h" to "include/config.h" 1010776d include: split and drop "netlink-private/types.h" d1d57846 include: rename "nl-shared-core" to "nl-priv-dynamic-core" fc91c4f8 include: rename "nl-hidden-route" to "nl-priv-dynamic-route" 9bb6f770 include: rename "nl-intern-route" to "nl-priv-static-route" b5195db9 genl: rename private header "nl-priv-genl.h" to "nl-genl.h" 0eacf658 include: make "netlink/route/link/{inet,inet6}.h" self-contained ad014ad1 route/tc: avoid unalinged access in rtnl_tc_msg_parse() 05bd6366 add support for TC action statistics 776fc5a6 lib: move "include/netlink-private/object-api" to include/nl-shared-core fad34560 lib: move "include/netlink-private/cache-api" to include/nl-shared-core ed2be537 route: move "include/netlink-private/route/link/sriov.h" to lib/route/link-sriov.h 97f61eda lib: move "include/netlink-private/socket.h" to lib/nl-core.h 96e1cc5b route: move "include/netlink-private/route/nexthop-encap.h" to lib/route 391e03d3 route: merge "include/netlink-private/tc.h" to lib/route/tc-api.h 7fc4f5b3 route: move rtnl_tc_build_rate_table() to "tc-api.h" cf41e14d route: move "include/netlink-private/route/tc-api.h" to lib/route db810cfb route: move hidden symbols from "include/netlink-private/route/tc-api.h" ff08e618 build: don't add lib/route to include directory for all libs eb8da16d include: move "include/netlink-private/route/link/api.h" to lib/route 8b2074aa include: move "include/netlink-private/route/utils.h" to nl-intern-route fd470c06 include: move "include/netlink-private/route/mpls.h" to "lib/mpls.h" 78056ad2 genl: add comment about wrongly exported symbol genl_resolve_id() befc4ab4 include: move "include/netlink-private/genl.h" to "lib/genl/nl-priv-genl.h" f6c26127 nl-aux: add "include/nl-aux-{core,route}" headers 2da8481b base: move "netlink-private/utils.h" to "base/nl-base-utils.h" d3e9b513 include/utils: move nl-auto base defines to "utils.h" 543b9f8f clang-format: reformat "include/netlink-private/nl-auto.h" aa565460 route: cleanup ATTR_DIFF() macros beba5a18 cli: add nl-nh-list utility 780d06ae route: add nh type 1b6433d9 neigh: add support of NHID attribute e0140c5f include: import kernel headers "linux/{neighbour,nexthop,rtnetlink}.h" eef06744 utils: add static-assert for signedness of arguments of _NL_CMP_DIRECT() macro 679c4c51 cli: use in cli and _nl_{init,exit} a9c5de52 lib: use _nl_{init,exit} instead of __{init,exit} 102f9bd2 include/private: add _nl_init/_nl_exit macros 6782678e include/private: drop unused __deprecated macro a0535a58 all: use "_nl_packed" macro instead of "__attribute__((packed))" 8c9f98cf all: rework ATTR_DIFF() macros to not generate attribute names ca34ad52 lib: handle negative and zero size in nla_memcpy() 859b89dc include: drop now unused min()/max()/min_t()/max_t() macros 2e0ae977 all: use _NL_{MIN,MAX}() macros 57c451fa utils: add various helpers to "include/netlink-private/utils.h" a9a9dcea style: format "include/netlink-private/utils.h" with clang-format 590e8a61 tools: improve failure message with "tools/clang-format.sh -n" 06dc5ae0 github: fix format checking with clang-format 7738f239 route/trivial: sort entries in "libnl-route-3.sym" asciibetically fc805c56 route/bond: Add support for link_info for bond 6af26981 lib: accept NULL argument in nla_nest_cancel() for robustness e9662091 macsec: Drop offload capability validation check 35a68109 github: update flake8 linter to not explicitly select checks 9a266405 python: add ".flake8" file for configuring "flake8" e6b934a5 python: fix flake8 warnings E712 2cea738b python: fix flake8 warnings E711 d561096c python: fix flake8 warnings E302 29b06d0f python: fix flake8 warnings E741 4dc1f498 python: fix flake8 warnings F841 f4875c69 python: fix flake8 warnings W605 9a3d91df python: fix flake8 warnings F401 6baf2339 clang-format: add "tools/clang-format-container.sh" script ee2876e3 github: add test for checking clang-format style 45c7aae3 clang-format: add "tools/clang-format.sh" script 02e0fd3f github: check python-black code formatting in github actions 2dd53895 build: add ".git-blame-ignore-revs" file for "blame.ignoreRevsFile" git config 3c753e3c python: reformat all Python files with python-black 298ee58e python add "pyproject.toml" for configuring black a0e4b7f9 github: skip Python flake8 test with clang build c4240c0b github: run "Build Release" test also with clang 143cee1d bridge: fix bridge info parsing 96bbe55c test-cache-mngr: Flush output after object dumps cf5dcbcd test-cache-mngr: Add option to print timestamps bd570952 test-cache-mngr: Add an option to iterate over all supported address families bf80da90 test-cache-mngr: Add dump interval options 80febeea test-cache-mngr: Add an option to control which oo_dump function is used 6519a917 route/link: prevent segfault in af_request_type() a68260f8 github: fix installing python dependencies via pip 39c04bc7 build: drop redundant "autogen.sh" call from "tools/build_release.sh" d411b88d build: change proper working directory in "doc/autogen.sh" 2fa73ce0 build: ensure "autogen.sh" scripts fail on error fc786296 gitignore: ignore "*~" files 4c4e614b docs: rtnl_link_put() 'releases' instead of 'returns' 336b15dc include/linux: update copy of kernel header "linux/ipv6.h" e2cacc26 route/link: improve handling of IFLA_INET6_CONF ec8c493c route/link: remove rtnl_link_inet6_set_conf() API e790f8ad route/link: various fixes for rtnl_link_inet6_get_conf() API d83c6d54 route/link: add accessor API for IPv6 DEVCONF 9167504d bridge: drop unnecessary goto in bridge_info_parse() 984d6e93 bridge: don't normalize the u8 argument in rtnl_link_bridge_set_vlan_filtering() to boolean 3662a5da bridge: expose rtnl_link_bridge_get_vlan_protocol() in host byte order 5a1ef219 bridge: fix parsing vlan-protocol in bridge_info_parse() ad1c2927 bridge: minor cleanups in "bridge_info.c" 1c74725a bridge: use SPDX license identifiers in bridge_info files 26ca549d bridge: reformat bridge_info file with clang-format 08dc5d9c bridge: extend libnl with options needed for VLAN aware forwarding 7391a38e bridge: Add support for link_info of a bridge 1f1e8385 route/vlan: drop unnecessary "else" in vlan_put_attrs() 2bc30e57 route/vlan: fix error handling in 'lib/route/link/vlan.c' 8273d6ce build: add comments to linker version scripts about the version tags 6ac7a812 doc: fix typo 07d274ab doc: fix typo 0461a425 attr: reject zero length addresses 8d40d9eb route: construct all-zero addresses for default route destination 25d42a4f addr: allow constructing all-zero addresses 0c0aee82 addr: create an all-zero addresses when parsing "any" or "default" Signed-off-by: Nick Hainke --- package/libs/libnl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 56549dcc0a2..74fb5b848e9 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.7.0 +PKG_VERSION:=3.8.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION)) -PKG_HASH:=9fe43ccbeeea72c653bdcf8c93332583135cda46a79507bfd0a483bb57f65939 +PKG_HASH:=bb726c6d7a08b121978d73ff98425bf313fa26a27a331d465e4f1d7ec5b838c6 PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING From 802a5f5cb4a7b42d25e82b787d7ab1323a20183f Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Sat, 30 Sep 2023 22:22:13 +0300 Subject: [PATCH 47/78] bcm53xx: build a single device per profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far every build of a single bcm53xx Target Profile (it means: when NOT using CONFIG_TARGET_MULTI_PROFILE) resulted in all target devices images being built. Now it only builds the one matching selected profile. Fixes: #13572 Suggested-by: Jonas Gorski Signed-off-by: Rani Hod [rmilecki: update commit subject + body & move PROFILES line] Signed-off-by: Rafał Miłecki --- target/linux/bcm53xx/image/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 39b7efbef78..8799f500579 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -143,6 +143,7 @@ USB2_PACKAGES += kmod-usb-ledtrig-usbport USB3_PACKAGES := $(USB2_PACKAGES) kmod-usb3 kmod-phy-bcm-ns-usb3 define Device/Default + PROFILES = Generic $$(DEVICE_NAME) # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names # extract the full dtb name based on the device info DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(subst _,-,$(1)).dtb))) From 518923178cfeba6a05ca6fb610f9c6d6e808fd75 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 12 Oct 2023 18:07:11 -0400 Subject: [PATCH 48/78] tools/cmake: disable cmake script debugger Upstream commit a9a592f96e6498da302f8e968be1db0ad3c32123 ("cmake: Add debugger") added a huge amount of code in order to create a debugging feature for CMakeLists.txt of other projects. This was added to CMake since 3.27.x. Unforunately, this new debugger will not build on ARM systems like arm-linux-gnueabihf (Raspberry Pi 4), and takes up extra build time for something Openwrt doesn't need, yet it was enabled by default. (Thanks Microsoft....) Specifically, it's a failure to link to functions like __atomic_store_8, __atomic_load_8, __atomic_fetch_add_8, etc. Let's just disable it. Someone who really needs this for developing can have CMake with the debugger on their host machine or manually re-enable it here. Link: https://gitlab.kitware.com/cmake/cmake/-/issues/21510 Link: https://devblogs.microsoft.com/cppblog/cmake-debugger-allows-you-to-debug-your-cmake-scripts-and-more/ Signed-off-by: Michael Pratt --- tools/cmake/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 813e4849159..19c4a5b8b80 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -30,6 +30,7 @@ HOST_CONFIGURE_VARS += \ MAKE="$(STAGING_DIR_HOST)/bin/ninja" HOST_CONFIGURE_ARGS := \ + --no-debugger \ $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \ --prefix="$(STAGING_DIR_HOST)" \ --system-expat \ From 9188c77cbee55a933d0fa75c74e175fbc52c556d Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 13 Oct 2023 17:47:11 +0200 Subject: [PATCH 49/78] ath79: wpj563: enable 2nd USB controller The compex WPJ563 actually has both usb controllers wired: usb0 --> pci-e slot usb1 --> pin header As the board exposes it for generic use, enable this controller too. fixes: #13650 Signed-off-by: Koen Vandeputte --- target/linux/ath79/dts/qca9563_compex_wpj563.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts index ceac53f415a..407e912ad26 100644 --- a/target/linux/ath79/dts/qca9563_compex_wpj563.dts +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -130,6 +130,14 @@ status = "okay"; }; +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; + &wmac { status = "okay"; From f5e66b5fd9a524d207386fa8ecd4535964a616e5 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 12:01:07 +0200 Subject: [PATCH 50/78] tools/mold: update to 2.2.0 Release Notes: https://github.com/rui314/mold/releases/tag/v2.2.0 Signed-off-by: Nick Hainke --- tools/mold/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mold/Makefile b/tools/mold/Makefile index b266cea77dc..c82aa781616 100644 --- a/tools/mold/Makefile +++ b/tools/mold/Makefile @@ -3,12 +3,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mold -PKG_VERSION:=2.1.0 +PKG_VERSION:=2.2.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL_FILE:=v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/rui314/mold/archive/refs/tags -PKG_HASH:=a32bec1282671b18ea4691855aed925ea2f348dfef89cb7689cd81273ea0c5df +PKG_HASH:=78ddddaaa004e50f8d92a13d8e792a46a1b37745fab48d39ad16aeb5a776e7c6 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From 316b8e09099eb1a479dc05e94395f95547c821a8 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 10:02:56 +0200 Subject: [PATCH 51/78] strace: update to 6.5 Release Notes: https://github.com/strace/strace/releases/tag/v6.5 Signed-off-by: Nick Hainke --- package/devel/strace/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index e572cc0315d..3343177c3e9 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=6.4 +PKG_VERSION:=6.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) -PKG_HASH:=27987dbac57fdfd260c6db4dc8328df35c95c6867c8a3d4371d59cdcf4eb9238 +PKG_HASH:=dfb051702389e1979a151892b5901afc9e93bbc1c70d84c906ade3224ca91980 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=LGPL-2.1-or-later From abe908ca53f7cfa857c362cb766effca3571d0b6 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 10:13:12 +0200 Subject: [PATCH 52/78] ethtool: update to 6.5 Release Notes: https://lore.kernel.org/netdev/20230912223336.zywfpavr3ln3trp3@lion.mk-sys.cz/T/ Signed-off-by: Nick Hainke --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index 024fdf1e63f..92ee2103c93 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=6.4 +PKG_VERSION:=6.5 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=5eaa083e8108e1dd3876b2c803a1942a2763942715b7f6eb916e189adbb44972 +PKG_HASH:=814171ea4b8026b081c0741dbbf32e6968311483ecf64711232faec2ac70a14c PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From 5b85c19642cb5dfda4e4cd443796e5361161f9a5 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 10:19:07 +0200 Subject: [PATCH 53/78] iproute2: update to 6.5.0 Release Notes: https://lore.kernel.org/netdev/20230906093918.394a1b1d@hermes.local/T/ Signed-off-by: Nick Hainke --- package/network/utils/iproute2/Makefile | 4 ++-- .../iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 194edcb35a9..7f4556e7d38 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=6.4.0 +PKG_VERSION:=6.5.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=4c51b8decbc7e4da159ffb066f590cfb93dbf9af7ff86b1647ce42b7c179a272 +PKG_HASH:=a70179085fa1b96d3c33b040c809b75e2b57563adc505a4ad05e2609df373463 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch index 2a3f9eb90f1..ba6ca4c9b24 100644 --- a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch +++ b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -65,9 +65,9 @@ WFLAGS += -Wmissing-declarations -Wold-s +@@ -67,9 +67,9 @@ WFLAGS += -Wmissing-declarations -Wold-s CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v From d19bf76da12e2e0f3652640a6207557b019f2566 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 12 Oct 2023 10:48:58 +0200 Subject: [PATCH 54/78] tools/mtd-utils: update to 2.1.6 Release Notes: https://lists.infradead.org/pipermail/linux-mtd/2023-August/100922.html Refresh patch: - 110-portability.patch Signed-off-by: Nick Hainke --- tools/mtd-utils/Makefile | 4 ++-- tools/mtd-utils/patches/110-portability.patch | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 90108019769..59b1716072c 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.5 +PKG_VERSION:=2.1.6 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ -PKG_HASH:=386e27fd121699b6b729bc2e8e04dda987b31cca6b16e12fb6cc6dcf26449f46 +PKG_HASH:=c1d853bc4adf83bcabd2792fc95af33bdd8643c97e8f7b3f0180af36af76f0e5 PKG_CPE_ID:=cpe:/a:mtd-utils_project:mtd-utils PKG_FIXUP:=autoreconf diff --git a/tools/mtd-utils/patches/110-portability.patch b/tools/mtd-utils/patches/110-portability.patch index 73b97796a2f..e25fd82bb3c 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -70,7 +70,7 @@ #include --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c -@@ -1541,6 +1541,7 @@ static int add_inode(struct stat *st, in +@@ -1542,6 +1542,7 @@ static int add_inode(struct stat *st, in if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -78,7 +78,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1553,6 +1554,7 @@ static int add_inode(struct stat *st, in +@@ -1554,6 +1555,7 @@ static int add_inode(struct stat *st, in use_flags |= UBIFS_DIRSYNC_FL; if (fctx) use_flags |= UBIFS_CRYPT_FL; @@ -86,7 +86,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); ino_key_init(&key, inum); -@@ -1638,7 +1640,9 @@ static int add_dir_inode(const char *pat +@@ -1639,7 +1641,9 @@ static int add_dir_inode(const char *pat fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -96,7 +96,7 @@ flags = 0; } -@@ -1849,6 +1853,7 @@ static int add_file(const char *path_nam +@@ -1850,6 +1854,7 @@ static int add_file(const char *path_nam dn->ch.node_type = UBIFS_DATA_NODE; key_write(&key, &dn->key); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; @@ -104,7 +104,7 @@ if (c->default_compr == UBIFS_COMPR_NONE && !c->encrypted && (flags & FS_COMPR_FL)) #ifdef WITHOUT_LZO -@@ -1857,6 +1862,7 @@ static int add_file(const char *path_nam +@@ -1858,6 +1863,7 @@ static int add_file(const char *path_nam use_compr = UBIFS_COMPR_LZO; #endif else @@ -112,7 +112,7 @@ use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1916,7 +1922,9 @@ static int add_non_dir(const char *path_ +@@ -1917,7 +1923,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name); From aab2e6d9ae5c6cf2f2e6471d8cf24b9afd3bc69a Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 12 Oct 2023 12:24:06 +0200 Subject: [PATCH 55/78] mac80211: backport upstream DFS CAC time export DFS CAC time export is required for backport of a ath11k fix so lets backport the required cfg80211 upstream commit as well. Signed-off-by: Robert Marko --- ...port-DFS-CAC-time-and-usable-state-h.patch | 111 ++++++++++++++++++ ...race-period-for-DFS-available-after-.patch | 8 +- 2 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch diff --git a/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch new file mode 100644 index 00000000000..78ec030e18b --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch @@ -0,0 +1,111 @@ +From 30ca8b0c4d6c9fb1d76e5894b1e8bf7c6a12224d Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 12 Sep 2023 10:48:55 +0530 +Subject: [PATCH] wifi: cfg80211: export DFS CAC time and usable state helper + functions + +cfg80211 has cfg80211_chandef_dfs_usable() function to know whether +at least one channel in the chandef is in usable state or not. Also, +cfg80211_chandef_dfs_cac_time() function is there which tells the CAC +time required for the given chandef. + +Make these two functions visible to drivers by exporting their symbol +to global list of kernel symbols. + +Lower level drivers can make use of these two functions to be aware +if CAC is required on the given chandef and for how long. For example +drivers which maintains the CAC state internally can make use of these. + +Signed-off-by: Aditya Kumar Singh +Reviewed-by: Jeff Johnson +Link: https://lore.kernel.org/r/20230912051857.2284-2-quic_adisi@quicinc.com +Signed-off-by: Johannes Berg +--- + include/net/cfg80211.h | 24 ++++++++++++++++++++++++ + net/wireless/chan.c | 2 ++ + net/wireless/core.h | 17 ----------------- + 3 files changed, 26 insertions(+), 17 deletions(-) + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -1008,6 +1008,30 @@ int cfg80211_chandef_dfs_required(struct + enum nl80211_iftype iftype); + + /** ++ * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable and we ++ * can/need start CAC on such channel ++ * @wiphy: the wiphy to validate against ++ * @chandef: the channel definition to check ++ * ++ * Return: true if all channels available and at least ++ * one channel requires CAC (NL80211_DFS_USABLE) ++ */ ++bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy, ++ const struct cfg80211_chan_def *chandef); ++ ++/** ++ * cfg80211_chandef_dfs_cac_time - get the DFS CAC time (in ms) for given ++ * channel definition ++ * @wiphy: the wiphy to validate against ++ * @chandef: the channel definition to check ++ * ++ * Returns: DFS CAC time (in ms) which applies for this channel definition ++ */ ++unsigned int ++cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, ++ const struct cfg80211_chan_def *chandef); ++ ++/** + * nl80211_send_chandef - sends the channel definition. + * @msg: the msg to send channel definition + * @chandef: the channel definition to check +--- a/net/wireless/chan.c ++++ b/net/wireless/chan.c +@@ -666,6 +666,7 @@ bool cfg80211_chandef_dfs_usable(struct + + return (r1 + r2 > 0); + } ++EXPORT_SYMBOL(cfg80211_chandef_dfs_usable); + + /* + * Checks if center frequency of chan falls with in the bandwidth +@@ -965,6 +966,7 @@ cfg80211_chandef_dfs_cac_time(struct wip + + return max(t1, t2); + } ++EXPORT_SYMBOL(cfg80211_chandef_dfs_cac_time); + + static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy, + u32 center_freq, u32 bandwidth, +--- a/net/wireless/core.h ++++ b/net/wireless/core.h +@@ -469,29 +469,12 @@ int cfg80211_scan(struct cfg80211_regist + + extern struct work_struct cfg80211_disconnect_work; + +-/** +- * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable +- * @wiphy: the wiphy to validate against +- * @chandef: the channel definition to check +- * +- * Checks if chandef is usable and we can/need start CAC on such channel. +- * +- * Return: true if all channels available and at least +- * one channel requires CAC (NL80211_DFS_USABLE) +- */ +-bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy, +- const struct cfg80211_chan_def *chandef); +- + void cfg80211_set_dfs_state(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef, + enum nl80211_dfs_state dfs_state); + + void cfg80211_dfs_channels_update_work(struct work_struct *work); + +-unsigned int +-cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, +- const struct cfg80211_chan_def *chandef); +- + void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev); + + int diff --git a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch index d04b1165bfc..28e2144f7f5 100644 --- a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch +++ b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau } } -@@ -873,6 +875,49 @@ static bool cfg80211_get_chans_dfs_avail +@@ -874,6 +876,49 @@ static bool cfg80211_get_chans_dfs_avail return true; } @@ -113,15 +113,15 @@ Signed-off-by: Felix Fietkau { --- a/net/wireless/core.h +++ b/net/wireless/core.h -@@ -487,6 +487,8 @@ void cfg80211_set_dfs_state(struct wiphy +@@ -474,6 +474,8 @@ void cfg80211_set_dfs_state(struct wiphy enum nl80211_dfs_state dfs_state); void cfg80211_dfs_channels_update_work(struct work_struct *work); +void cfg80211_update_last_available(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef); - unsigned int - cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, + void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev); + --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -915,6 +915,8 @@ void cfg80211_dfs_channels_update_work(s From 359a6e36e972c06845ffff750f200bca3a95c724 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 12 Oct 2023 12:25:32 +0200 Subject: [PATCH 56/78] mac80211: ath11k: sync with ath-next Synchronize the ath11k backports with the current ath-next tree. All of the changes are various bugfixes, there is no new major feature. Notable bugfixes are: * WCN6855 board name fixes * One MSI vector booting is working again This is rather important for most of the older platforms. * DFS CAC state in virtual interfaces was fixed * TX power during CAC reporting Signed-off-by: Robert Marko --- ...chip-id-board-name-while-searching-b.patch | 214 ++++++++++ ...fix-boot-failure-with-one-MSI-vector.patch | 103 +++++ ...-NULL-pointer-check-in-ath11k_update.patch | 32 ++ ...-redundant-check-in-ath11k_dp_rx_mon.patch | 38 ++ ...ve-unused-members-of-struct-ath11k_b.patch | 46 +++ ...kstrtoul_from_user-where-appropriate.patch | 60 +++ ...-remove-unnecessary-void-conversions.patch | 248 +++++++++++ ...ath11k_mac_op_remain_on_channel-stac.patch | 96 +++++ ...fix-struct-ieee80211_sband_iftype_da.patch | 67 +++ ...CAC-running-state-during-virtual-int.patch | 80 ++++ ...fix-Tx-power-value-during-active-CAC.patch | 43 ++ ...-ath11k_mac_fils_discovery-without-c.patch | 37 ++ ...1k_debugfs_register-fix-format-trunc.patch | 39 ++ ...-parsing-of-phy-bitmap-for-reg-rules.patch | 84 ++++ ...emove-unused-struct-ath11k_htc_frame.patch | 38 ++ ...ntroduce-and-use-ath11k_sta_to_arsta.patch | 384 ++++++++++++++++++ ...upport-setting-FW-memory-mode-via-DT.patch | 4 +- ...tersection-support-for-regulatory-ru.patch | 20 +- 18 files changed, 1621 insertions(+), 12 deletions(-) create mode 100644 package/kernel/mac80211/patches/ath11k/0016-wifi-ath11k-add-chip-id-board-name-while-searching-b.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0017-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0018-wifi-ath11k-drop-NULL-pointer-check-in-ath11k_update.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-drop-redundant-check-in-ath11k_dp_rx_mon.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-remove-unused-members-of-struct-ath11k_b.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-use-kstrtoul_from_user-where-appropriate.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-remove-unnecessary-void-conversions.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-fix-ath11k_mac_op_remain_on_channel-stac.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-mac-fix-struct-ieee80211_sband_iftype_da.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-fix-CAC-running-state-during-virtual-int.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-fix-Tx-power-value-during-active-CAC.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-call-ath11k_mac_fils_discovery-without-c.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-ath11k_debugfs_register-fix-format-trunc.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-add-parsing-of-phy-bitmap-for-reg-rules.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-Remove-unused-struct-ath11k_htc_frame.patch create mode 100644 package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-Introduce-and-use-ath11k_sta_to_arsta.patch diff --git a/package/kernel/mac80211/patches/ath11k/0016-wifi-ath11k-add-chip-id-board-name-while-searching-b.patch b/package/kernel/mac80211/patches/ath11k/0016-wifi-ath11k-add-chip-id-board-name-while-searching-b.patch new file mode 100644 index 00000000000..662e28f4ef8 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0016-wifi-ath11k-add-chip-id-board-name-while-searching-b.patch @@ -0,0 +1,214 @@ +From 1133af5aea588a58043244a4ecb5ce511b310356 Mon Sep 17 00:00:00 2001 +From: Wen Gong +Date: Wed, 30 Aug 2023 02:02:26 -0400 +Subject: [PATCH] wifi: ath11k: add chip id board name while searching + board-2.bin for WCN6855 + +Sometimes board-2.bin does not have the board data which matched the +parameters such as bus type, vendor, device, subsystem-vendor, +subsystem-device, qmi-chip-id and qmi-board-id, then wlan will load fail. + +Hence add another type which only matches the bus type and qmi-chip-id, +then the ratio of missing board data reduced. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 + +Signed-off-by: Wen Gong +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230830060226.18664-1-quic_wgong@quicinc.com +--- + drivers/net/wireless/ath/ath11k/core.c | 108 ++++++++++++++++++++----- + 1 file changed, 87 insertions(+), 21 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -985,9 +985,15 @@ int ath11k_core_check_dt(struct ath11k_b + return 0; + } + ++enum ath11k_bdf_name_type { ++ ATH11K_BDF_NAME_FULL, ++ ATH11K_BDF_NAME_BUS_NAME, ++ ATH11K_BDF_NAME_CHIP_ID, ++}; ++ + static int __ath11k_core_create_board_name(struct ath11k_base *ab, char *name, + size_t name_len, bool with_variant, +- bool bus_type_mode) ++ enum ath11k_bdf_name_type name_type) + { + /* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */ + char variant[9 + ATH11K_QMI_BDF_EXT_STR_LENGTH] = { 0 }; +@@ -998,11 +1004,8 @@ static int __ath11k_core_create_board_na + + switch (ab->id.bdf_search) { + case ATH11K_BDF_SEARCH_BUS_AND_BOARD: +- if (bus_type_mode) +- scnprintf(name, name_len, +- "bus=%s", +- ath11k_bus_str(ab->hif.bus)); +- else ++ switch (name_type) { ++ case ATH11K_BDF_NAME_FULL: + scnprintf(name, name_len, + "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x,qmi-chip-id=%d,qmi-board-id=%d%s", + ath11k_bus_str(ab->hif.bus), +@@ -1012,6 +1015,19 @@ static int __ath11k_core_create_board_na + ab->qmi.target.chip_id, + ab->qmi.target.board_id, + variant); ++ break; ++ case ATH11K_BDF_NAME_BUS_NAME: ++ scnprintf(name, name_len, ++ "bus=%s", ++ ath11k_bus_str(ab->hif.bus)); ++ break; ++ case ATH11K_BDF_NAME_CHIP_ID: ++ scnprintf(name, name_len, ++ "bus=%s,qmi-chip-id=%d", ++ ath11k_bus_str(ab->hif.bus), ++ ab->qmi.target.chip_id); ++ break; ++ } + break; + default: + scnprintf(name, name_len, +@@ -1030,19 +1046,29 @@ static int __ath11k_core_create_board_na + static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name, + size_t name_len) + { +- return __ath11k_core_create_board_name(ab, name, name_len, true, false); ++ return __ath11k_core_create_board_name(ab, name, name_len, true, ++ ATH11K_BDF_NAME_FULL); + } + + static int ath11k_core_create_fallback_board_name(struct ath11k_base *ab, char *name, + size_t name_len) + { +- return __ath11k_core_create_board_name(ab, name, name_len, false, false); ++ return __ath11k_core_create_board_name(ab, name, name_len, false, ++ ATH11K_BDF_NAME_FULL); + } + + static int ath11k_core_create_bus_type_board_name(struct ath11k_base *ab, char *name, + size_t name_len) + { +- return __ath11k_core_create_board_name(ab, name, name_len, false, true); ++ return __ath11k_core_create_board_name(ab, name, name_len, false, ++ ATH11K_BDF_NAME_BUS_NAME); ++} ++ ++static int ath11k_core_create_chip_id_board_name(struct ath11k_base *ab, char *name, ++ size_t name_len) ++{ ++ return __ath11k_core_create_board_name(ab, name, name_len, false, ++ ATH11K_BDF_NAME_CHIP_ID); + } + + const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, +@@ -1289,16 +1315,21 @@ int ath11k_core_fetch_board_data_api_1(s + #define BOARD_NAME_SIZE 200 + int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd) + { +- char boardname[BOARD_NAME_SIZE], fallback_boardname[BOARD_NAME_SIZE]; ++ char *boardname = NULL, *fallback_boardname = NULL, *chip_id_boardname = NULL; + char *filename, filepath[100]; +- int ret; ++ int ret = 0; + + filename = ATH11K_BOARD_API2_FILE; ++ boardname = kzalloc(BOARD_NAME_SIZE, GFP_KERNEL); ++ if (!boardname) { ++ ret = -ENOMEM; ++ goto exit; ++ } + +- ret = ath11k_core_create_board_name(ab, boardname, sizeof(boardname)); ++ ret = ath11k_core_create_board_name(ab, boardname, BOARD_NAME_SIZE); + if (ret) { + ath11k_err(ab, "failed to create board name: %d", ret); +- return ret; ++ goto exit; + } + + ab->bd_api = 2; +@@ -1307,13 +1338,19 @@ int ath11k_core_fetch_bdf(struct ath11k_ + ATH11K_BD_IE_BOARD_NAME, + ATH11K_BD_IE_BOARD_DATA); + if (!ret) +- goto success; ++ goto exit; ++ ++ fallback_boardname = kzalloc(BOARD_NAME_SIZE, GFP_KERNEL); ++ if (!fallback_boardname) { ++ ret = -ENOMEM; ++ goto exit; ++ } + + ret = ath11k_core_create_fallback_board_name(ab, fallback_boardname, +- sizeof(fallback_boardname)); ++ BOARD_NAME_SIZE); + if (ret) { + ath11k_err(ab, "failed to create fallback board name: %d", ret); +- return ret; ++ goto exit; + } + + ret = ath11k_core_fetch_board_data_api_n(ab, bd, fallback_boardname, +@@ -1321,7 +1358,28 @@ int ath11k_core_fetch_bdf(struct ath11k_ + ATH11K_BD_IE_BOARD_NAME, + ATH11K_BD_IE_BOARD_DATA); + if (!ret) +- goto success; ++ goto exit; ++ ++ chip_id_boardname = kzalloc(BOARD_NAME_SIZE, GFP_KERNEL); ++ if (!chip_id_boardname) { ++ ret = -ENOMEM; ++ goto exit; ++ } ++ ++ ret = ath11k_core_create_chip_id_board_name(ab, chip_id_boardname, ++ BOARD_NAME_SIZE); ++ if (ret) { ++ ath11k_err(ab, "failed to create chip id board name: %d", ret); ++ goto exit; ++ } ++ ++ ret = ath11k_core_fetch_board_data_api_n(ab, bd, chip_id_boardname, ++ ATH11K_BD_IE_BOARD, ++ ATH11K_BD_IE_BOARD_NAME, ++ ATH11K_BD_IE_BOARD_DATA); ++ ++ if (!ret) ++ goto exit; + + ab->bd_api = 1; + ret = ath11k_core_fetch_board_data_api_1(ab, bd, ATH11K_DEFAULT_BOARD_FILE); +@@ -1334,14 +1392,22 @@ int ath11k_core_fetch_bdf(struct ath11k_ + ath11k_err(ab, "failed to fetch board data for %s from %s\n", + fallback_boardname, filepath); + ++ ath11k_err(ab, "failed to fetch board data for %s from %s\n", ++ chip_id_boardname, filepath); ++ + ath11k_err(ab, "failed to fetch board.bin from %s\n", + ab->hw_params.fw.dir); +- return ret; + } + +-success: +- ath11k_dbg(ab, ATH11K_DBG_BOOT, "using board api %d\n", ab->bd_api); +- return 0; ++exit: ++ kfree(boardname); ++ kfree(fallback_boardname); ++ kfree(chip_id_boardname); ++ ++ if (!ret) ++ ath11k_dbg(ab, ATH11K_DBG_BOOT, "using board api %d\n", ab->bd_api); ++ ++ return ret; + } + + int ath11k_core_fetch_regdb(struct ath11k_base *ab, struct ath11k_board_data *bd) diff --git a/package/kernel/mac80211/patches/ath11k/0017-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch b/package/kernel/mac80211/patches/ath11k/0017-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch new file mode 100644 index 00000000000..9101a1ea1ce --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0017-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch @@ -0,0 +1,103 @@ +From 39564b475ac5a589e6c22c43a08cbd283c295d2c Mon Sep 17 00:00:00 2001 +From: Baochen Qiang +Date: Thu, 7 Sep 2023 09:56:06 +0800 +Subject: [PATCH] wifi: ath11k: fix boot failure with one MSI vector + +Commit 5b32b6dd96633 ("ath11k: Remove core PCI references from +PCI common code") breaks with one MSI vector because it moves +affinity setting after IRQ request, see below log: + +[ 1417.278835] ath11k_pci 0000:02:00.0: failed to receive control response completion, polling.. +[ 1418.302829] ath11k_pci 0000:02:00.0: Service connect timeout +[ 1418.302833] ath11k_pci 0000:02:00.0: failed to connect to HTT: -110 +[ 1418.303669] ath11k_pci 0000:02:00.0: failed to start core: -110 + +The detail is, if do affinity request after IRQ activated, +which is done in request_irq(), kernel caches that request and +returns success directly. Later when a subsequent MHI interrupt is +fired, kernel will do the real affinity setting work, as a result, +changs the MSI vector. However at that time host has configured +old vector to hardware, so host never receives CE or DP interrupts. + +Fix it by setting affinity before registering MHI controller +where host is, for the first time, doing IRQ request. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 +Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 +Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01160-QCAMSLSWPLZ-1 + +Fixes: 5b32b6dd9663 ("ath11k: Remove core PCI references from PCI common code") +Signed-off-by: Baochen Qiang +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230907015606.16297-1-quic_bqiang@quicinc.com +--- + drivers/net/wireless/ath/ath11k/pci.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -852,10 +852,16 @@ unsupported_wcn6855_soc: + if (ret) + goto err_pci_disable_msi; + ++ ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); ++ if (ret) { ++ ath11k_err(ab, "failed to set irq affinity %d\n", ret); ++ goto err_pci_disable_msi; ++ } ++ + ret = ath11k_mhi_register(ab_pci); + if (ret) { + ath11k_err(ab, "failed to register mhi: %d\n", ret); +- goto err_pci_disable_msi; ++ goto err_irq_affinity_cleanup; + } + + ret = ath11k_hal_srng_init(ab); +@@ -876,12 +882,6 @@ unsupported_wcn6855_soc: + goto err_ce_free; + } + +- ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); +- if (ret) { +- ath11k_err(ab, "failed to set irq affinity %d\n", ret); +- goto err_free_irq; +- } +- + /* kernel may allocate a dummy vector before request_irq and + * then allocate a real vector when request_irq is called. + * So get msi_data here again to avoid spurious interrupt +@@ -890,20 +890,17 @@ unsupported_wcn6855_soc: + ret = ath11k_pci_config_msi_data(ab_pci); + if (ret) { + ath11k_err(ab, "failed to config msi_data: %d\n", ret); +- goto err_irq_affinity_cleanup; ++ goto err_free_irq; + } + + ret = ath11k_core_init(ab); + if (ret) { + ath11k_err(ab, "failed to init core: %d\n", ret); +- goto err_irq_affinity_cleanup; ++ goto err_free_irq; + } + ath11k_qmi_fwreset_from_cold_boot(ab); + return 0; + +-err_irq_affinity_cleanup: +- ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); +- + err_free_irq: + ath11k_pcic_free_irq(ab); + +@@ -916,6 +913,9 @@ err_hal_srng_deinit: + err_mhi_unregister: + ath11k_mhi_unregister(ab_pci); + ++err_irq_affinity_cleanup: ++ ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); ++ + err_pci_disable_msi: + ath11k_pci_free_msi(ab_pci); + diff --git a/package/kernel/mac80211/patches/ath11k/0018-wifi-ath11k-drop-NULL-pointer-check-in-ath11k_update.patch b/package/kernel/mac80211/patches/ath11k/0018-wifi-ath11k-drop-NULL-pointer-check-in-ath11k_update.patch new file mode 100644 index 00000000000..ccf7461a758 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0018-wifi-ath11k-drop-NULL-pointer-check-in-ath11k_update.patch @@ -0,0 +1,32 @@ +From ac13a7842ab46a87aa315514d6d7e19b03cb2adc Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Wed, 6 Sep 2023 12:36:55 +0300 +Subject: [PATCH] wifi: ath11k: drop NULL pointer check in + ath11k_update_per_peer_tx_stats() + +Since 'user_stats' is a fixed-size array of 'struct htt_ppdu_user_stats' +in 'struct htt_ppdu_stats', any of its member can't be NULL and so +relevant check may be dropped. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230906093704.14001-1-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1388,9 +1388,6 @@ ath11k_update_per_peer_tx_stats(struct a + u8 tid = HTT_PPDU_STATS_NON_QOS_TID; + bool is_ampdu = false; + +- if (!usr_stats) +- return; +- + if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE))) + return; + diff --git a/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-drop-redundant-check-in-ath11k_dp_rx_mon.patch b/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-drop-redundant-check-in-ath11k_dp_rx_mon.patch new file mode 100644 index 00000000000..ace199315b2 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-drop-redundant-check-in-ath11k_dp_rx_mon.patch @@ -0,0 +1,38 @@ +From 82ae3f4635382ff23e2ece55b5d5e713223951ec Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Thu, 24 Aug 2023 10:50:44 +0300 +Subject: [PATCH] wifi: ath11k: drop redundant check in + ath11k_dp_rx_mon_dest_process() + +In 'ath11k_dp_rx_mon_dest_process()', 'mon_dst_srng' points to +a member of 'srng_list', which is a fixed-size array inside +'struct ath11k_hal'. This way, if 'ring_id' is valid (i. e. +between 0 and HAL_SRNG_RING_ID_MAX - 1 inclusive), 'mon_dst_srng' +can't be NULL and so relevant check may be dropped. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230824075121.121144-1-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 7 ------- + 1 file changed, 7 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -5094,13 +5094,6 @@ static void ath11k_dp_rx_mon_dest_proces + + mon_dst_srng = &ar->ab->hal.srng_list[ring_id]; + +- if (!mon_dst_srng) { +- ath11k_warn(ar->ab, +- "HAL Monitor Destination Ring Init Failed -- %p", +- mon_dst_srng); +- return; +- } +- + spin_lock_bh(&pmon->mon_lock); + + ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); diff --git a/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-remove-unused-members-of-struct-ath11k_b.patch b/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-remove-unused-members-of-struct-ath11k_b.patch new file mode 100644 index 00000000000..ffb210cc106 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-remove-unused-members-of-struct-ath11k_b.patch @@ -0,0 +1,46 @@ +From 9066794113c4813b6ce4a66ed6ce14ecdf35625d Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Thu, 24 Aug 2023 10:50:45 +0300 +Subject: [PATCH] wifi: ath11k: remove unused members of 'struct ath11k_base' + +Remove set but otherwise unused 'wlan_init_status' and +'wmi_ready' members of 'struct ath11k_base', adjust +'ath11k_wmi_tlv_rdy_parse()' accordingly. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230824075121.121144-2-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/core.h | 2 -- + drivers/net/wireless/ath/ath11k/wmi.c | 2 -- + 2 files changed, 4 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -901,8 +901,6 @@ struct ath11k_base { + struct list_head peers; + wait_queue_head_t peer_mapping_wq; + u8 mac_addr[ETH_ALEN]; +- bool wmi_ready; +- u32 wlan_init_status; + int irq_num[ATH11K_IRQ_NUM_MAX]; + struct ath11k_ext_irq_grp ext_irq_grp[ATH11K_EXT_IRQ_GRP_NUM_MAX]; + struct ath11k_targ_cap target_caps; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -7222,14 +7222,12 @@ static int ath11k_wmi_tlv_rdy_parse(stru + memset(&fixed_param, 0, sizeof(fixed_param)); + memcpy(&fixed_param, (struct wmi_ready_event *)ptr, + min_t(u16, sizeof(fixed_param), len)); +- ab->wlan_init_status = fixed_param.ready_event_min.status; + rdy_parse->num_extra_mac_addr = + fixed_param.ready_event_min.num_extra_mac_addr; + + ether_addr_copy(ab->mac_addr, + fixed_param.ready_event_min.mac_addr.addr); + ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; +- ab->wmi_ready = true; + break; + case WMI_TAG_ARRAY_FIXED_STRUCT: + addr_list = (struct wmi_mac_addr *)ptr; diff --git a/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-use-kstrtoul_from_user-where-appropriate.patch b/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-use-kstrtoul_from_user-where-appropriate.patch new file mode 100644 index 00000000000..7a6b11b6d3f --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-use-kstrtoul_from_user-where-appropriate.patch @@ -0,0 +1,60 @@ +From 458f66c30df2b8495790cf6fca76ebad44046921 Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Thu, 21 Sep 2023 11:16:57 +0300 +Subject: [PATCH] wifi: ath11k: use kstrtoul_from_user() where appropriate + +Use 'kstrtoul_from_user()' in 'ath11k_write_file_spectral_count()' +and 'ath11k_write_file_spectral_bins()' + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230824075121.121144-4-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/spectral.c | 26 +++++++--------------- + 1 file changed, 8 insertions(+), 18 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/spectral.c ++++ b/drivers/net/wireless/ath/ath11k/spectral.c +@@ -386,16 +386,11 @@ static ssize_t ath11k_write_file_spectra + { + struct ath11k *ar = file->private_data; + unsigned long val; +- char buf[32]; +- ssize_t len; +- +- len = min(count, sizeof(buf) - 1); +- if (copy_from_user(buf, user_buf, len)) +- return -EFAULT; ++ ssize_t ret; + +- buf[len] = '\0'; +- if (kstrtoul(buf, 0, &val)) +- return -EINVAL; ++ ret = kstrtoul_from_user(user_buf, count, 0, &val); ++ if (ret) ++ return ret; + + if (val > ATH11K_SPECTRAL_SCAN_COUNT_MAX) + return -EINVAL; +@@ -441,16 +436,11 @@ static ssize_t ath11k_write_file_spectra + { + struct ath11k *ar = file->private_data; + unsigned long val; +- char buf[32]; +- ssize_t len; +- +- len = min(count, sizeof(buf) - 1); +- if (copy_from_user(buf, user_buf, len)) +- return -EFAULT; ++ ssize_t ret; + +- buf[len] = '\0'; +- if (kstrtoul(buf, 0, &val)) +- return -EINVAL; ++ ret = kstrtoul_from_user(user_buf, count, 0, &val); ++ if (ret) ++ return ret; + + if (val < ATH11K_SPECTRAL_MIN_BINS || + val > ar->ab->hw_params.spectral.max_fft_bins) diff --git a/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-remove-unnecessary-void-conversions.patch b/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-remove-unnecessary-void-conversions.patch new file mode 100644 index 00000000000..cbd664dad58 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-remove-unnecessary-void-conversions.patch @@ -0,0 +1,248 @@ +From 87fd0602610d6965c45afc61780ac98842e8f902 Mon Sep 17 00:00:00 2001 +From: Wu Yunchuan +Date: Thu, 21 Sep 2023 11:50:05 +0300 +Subject: [PATCH] wifi: ath11k: remove unnecessary (void*) conversions + +No need cast (void *) to (struct ath11k_base *), +struct hal_rx_msdu_link *), (struct ath11k_buffer_addr *) or +other types. + +Signed-off-by: Wu Yunchuan +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com +--- + drivers/net/wireless/ath/ath11k/dp.c | 2 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 13 +++++-------- + drivers/net/wireless/ath/ath11k/hal.c | 8 +++----- + drivers/net/wireless/ath/ath11k/hal_rx.c | 17 +++++++---------- + drivers/net/wireless/ath/ath11k/hal_tx.c | 2 +- + drivers/net/wireless/ath/ath11k/mac.c | 4 ++-- + drivers/net/wireless/ath/ath11k/spectral.c | 2 +- + drivers/net/wireless/ath/ath11k/wmi.c | 6 +++--- + 8 files changed, 23 insertions(+), 31 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -1009,7 +1009,7 @@ void ath11k_dp_vdev_tx_attach(struct ath + + static int ath11k_dp_tx_pending_cleanup(int buf_id, void *skb, void *ctx) + { +- struct ath11k_base *ab = (struct ath11k_base *)ctx; ++ struct ath11k_base *ab = ctx; + struct sk_buff *msdu = skb; + + dma_unmap_single(ab->dev, ATH11K_SKB_CB(msdu)->paddr, msdu->len, +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1256,7 +1256,7 @@ static int ath11k_htt_tlv_ppdu_stats_par + int cur_user; + u16 peer_id; + +- ppdu_info = (struct htt_ppdu_stats_info *)data; ++ ppdu_info = data; + + switch (tag) { + case HTT_PPDU_STATS_TAG_COMMON: +@@ -4486,8 +4486,7 @@ int ath11k_dp_rx_monitor_link_desc_retur + src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng); + + if (src_srng_desc) { +- struct ath11k_buffer_addr *src_desc = +- (struct ath11k_buffer_addr *)src_srng_desc; ++ struct ath11k_buffer_addr *src_desc = src_srng_desc; + + *src_desc = *((struct ath11k_buffer_addr *)p_last_buf_addr_info); + } else { +@@ -4506,8 +4505,7 @@ void ath11k_dp_rx_mon_next_link_desc_get + u8 *rbm, + void **pp_buf_addr_info) + { +- struct hal_rx_msdu_link *msdu_link = +- (struct hal_rx_msdu_link *)rx_msdu_link_desc; ++ struct hal_rx_msdu_link *msdu_link = rx_msdu_link_desc; + struct ath11k_buffer_addr *buf_addr_info; + + buf_addr_info = (struct ath11k_buffer_addr *)&msdu_link->buf_addr_info; +@@ -4548,7 +4546,7 @@ static void ath11k_hal_rx_msdu_list_get( + u32 first = FIELD_PREP(RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU, 1); + u8 tmp = 0; + +- msdu_link = (struct hal_rx_msdu_link *)msdu_link_desc; ++ msdu_link = msdu_link_desc; + msdu_details = &msdu_link->msdu_link[0]; + + for (i = 0; i < HAL_RX_NUM_MSDU_DESC; i++) { +@@ -4645,8 +4643,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k + bool is_frag, is_first_msdu; + bool drop_mpdu = false; + struct ath11k_skb_rxcb *rxcb; +- struct hal_reo_entrance_ring *ent_desc = +- (struct hal_reo_entrance_ring *)ring_entry; ++ struct hal_reo_entrance_ring *ent_desc = ring_entry; + int buf_id; + u32 rx_link_buf_info[2]; + u8 rbm; +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -571,7 +571,7 @@ u32 ath11k_hal_ce_get_desc_size(enum hal + void ath11k_hal_ce_src_set_desc(void *buf, dma_addr_t paddr, u32 len, u32 id, + u8 byte_swap_data) + { +- struct hal_ce_srng_src_desc *desc = (struct hal_ce_srng_src_desc *)buf; ++ struct hal_ce_srng_src_desc *desc = buf; + + desc->buffer_addr_low = paddr & HAL_ADDR_LSB_REG_MASK; + desc->buffer_addr_info = +@@ -586,8 +586,7 @@ void ath11k_hal_ce_src_set_desc(void *bu + + void ath11k_hal_ce_dst_set_desc(void *buf, dma_addr_t paddr) + { +- struct hal_ce_srng_dest_desc *desc = +- (struct hal_ce_srng_dest_desc *)buf; ++ struct hal_ce_srng_dest_desc *desc = buf; + + desc->buffer_addr_low = paddr & HAL_ADDR_LSB_REG_MASK; + desc->buffer_addr_info = +@@ -597,8 +596,7 @@ void ath11k_hal_ce_dst_set_desc(void *bu + + u32 ath11k_hal_ce_dst_status_get_length(void *buf) + { +- struct hal_ce_srng_dst_status_desc *desc = +- (struct hal_ce_srng_dst_status_desc *)buf; ++ struct hal_ce_srng_dst_status_desc *desc = buf; + u32 len; + + len = FIELD_GET(HAL_CE_DST_STATUS_DESC_FLAGS_LEN, desc->flags); +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -265,7 +265,7 @@ out: + void ath11k_hal_rx_buf_addr_info_set(void *desc, dma_addr_t paddr, + u32 cookie, u8 manager) + { +- struct ath11k_buffer_addr *binfo = (struct ath11k_buffer_addr *)desc; ++ struct ath11k_buffer_addr *binfo = desc; + u32 paddr_lo, paddr_hi; + + paddr_lo = lower_32_bits(paddr); +@@ -279,7 +279,7 @@ void ath11k_hal_rx_buf_addr_info_set(voi + void ath11k_hal_rx_buf_addr_info_get(void *desc, dma_addr_t *paddr, + u32 *cookie, u8 *rbm) + { +- struct ath11k_buffer_addr *binfo = (struct ath11k_buffer_addr *)desc; ++ struct ath11k_buffer_addr *binfo = desc; + + *paddr = + (((u64)FIELD_GET(BUFFER_ADDR_INFO1_ADDR, binfo->info1)) << 32) | +@@ -292,7 +292,7 @@ void ath11k_hal_rx_msdu_link_info_get(vo + u32 *msdu_cookies, + enum hal_rx_buf_return_buf_manager *rbm) + { +- struct hal_rx_msdu_link *link = (struct hal_rx_msdu_link *)link_desc; ++ struct hal_rx_msdu_link *link = link_desc; + struct hal_rx_msdu_details *msdu; + int i; + +@@ -699,7 +699,7 @@ u32 ath11k_hal_reo_qdesc_size(u32 ba_win + void ath11k_hal_reo_qdesc_setup(void *vaddr, int tid, u32 ba_window_size, + u32 start_seq, enum hal_pn_type type) + { +- struct hal_rx_reo_queue *qdesc = (struct hal_rx_reo_queue *)vaddr; ++ struct hal_rx_reo_queue *qdesc = vaddr; + struct hal_rx_reo_queue_ext *ext_desc; + + memset(qdesc, 0, sizeof(*qdesc)); +@@ -809,8 +809,7 @@ static inline void + ath11k_hal_rx_handle_ofdma_info(void *rx_tlv, + struct hal_rx_user_status *rx_user_status) + { +- struct hal_rx_ppdu_end_user_stats *ppdu_end_user = +- (struct hal_rx_ppdu_end_user_stats *)rx_tlv; ++ struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv; + + rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6); + +@@ -821,8 +820,7 @@ static inline void + ath11k_hal_rx_populate_byte_count(void *rx_tlv, void *ppduinfo, + struct hal_rx_user_status *rx_user_status) + { +- struct hal_rx_ppdu_end_user_stats *ppdu_end_user = +- (struct hal_rx_ppdu_end_user_stats *)rx_tlv; ++ struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv; + + rx_user_status->mpdu_ok_byte_count = + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT, +@@ -1540,8 +1538,7 @@ void ath11k_hal_rx_reo_ent_buf_paddr_get + u32 *sw_cookie, void **pp_buf_addr, + u8 *rbm, u32 *msdu_cnt) + { +- struct hal_reo_entrance_ring *reo_ent_ring = +- (struct hal_reo_entrance_ring *)rx_desc; ++ struct hal_reo_entrance_ring *reo_ent_ring = rx_desc; + struct ath11k_buffer_addr *buf_addr_info; + struct rx_mpdu_desc *rx_mpdu_desc_info_details; + +--- a/drivers/net/wireless/ath/ath11k/hal_tx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_tx.c +@@ -37,7 +37,7 @@ static const u8 dscp_tid_map[DSCP_TID_MA + void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd, + struct hal_tx_info *ti) + { +- struct hal_tcl_data_cmd *tcl_cmd = (struct hal_tcl_data_cmd *)cmd; ++ struct hal_tcl_data_cmd *tcl_cmd = cmd; + + tcl_cmd->buf_addr_info.info0 = + FIELD_PREP(BUFFER_ADDR_INFO0_ADDR, ti->paddr); +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6970,8 +6970,8 @@ err: + + static int ath11k_mac_vif_unref(int buf_id, void *skb, void *ctx) + { +- struct ieee80211_vif *vif = (struct ieee80211_vif *)ctx; +- struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB((struct sk_buff *)skb); ++ struct ieee80211_vif *vif = ctx; ++ struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB(skb); + + if (skb_cb->vif == vif) + skb_cb->vif = NULL; +--- a/drivers/net/wireless/ath/ath11k/spectral.c ++++ b/drivers/net/wireless/ath/ath11k/spectral.c +@@ -592,7 +592,7 @@ int ath11k_spectral_process_fft(struct a + return -EINVAL; + } + +- tlv = (struct spectral_tlv *)data; ++ tlv = data; + tlv_len = FIELD_GET(SPECTRAL_TLV_HDR_LEN, __le32_to_cpu(tlv->header)); + /* convert Dword into bytes */ + tlv_len *= ATH11K_SPECTRAL_DWORD_SIZE; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -2281,7 +2281,7 @@ int ath11k_wmi_send_scan_start_cmd(struc + tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | + FIELD_PREP(WMI_TLV_LEN, len); + ptr += TLV_HDR_SIZE; +- tmp_ptr = (u32 *)ptr; ++ tmp_ptr = ptr; + + for (i = 0; i < params->num_chan; ++i) + tmp_ptr[i] = params->chan_list[i]; +@@ -4148,7 +4148,7 @@ static int ath11k_init_cmd_send(struct a + ptr += TLV_HDR_SIZE + len; + + if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) { +- hw_mode = (struct wmi_pdev_set_hw_mode_cmd_param *)ptr; ++ hw_mode = ptr; + hw_mode->tlv_header = FIELD_PREP(WMI_TLV_TAG, + WMI_TAG_PDEV_SET_HW_MODE_CMD) | + FIELD_PREP(WMI_TLV_LEN, +@@ -4168,7 +4168,7 @@ static int ath11k_init_cmd_send(struct a + len = sizeof(*band_to_mac); + + for (idx = 0; idx < param->num_band_to_mac; idx++) { +- band_to_mac = (void *)ptr; ++ band_to_mac = ptr; + + band_to_mac->tlv_header = FIELD_PREP(WMI_TLV_TAG, + WMI_TAG_PDEV_BAND_TO_MAC) | diff --git a/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-fix-ath11k_mac_op_remain_on_channel-stac.patch b/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-fix-ath11k_mac_op_remain_on_channel-stac.patch new file mode 100644 index 00000000000..2c7f196f8ee --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-fix-ath11k_mac_op_remain_on_channel-stac.patch @@ -0,0 +1,96 @@ +From 4fd15bb705d3faa7e6adab2daba2e3af80d9b6bd Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Tue, 26 Sep 2023 07:29:04 +0300 +Subject: [PATCH] wifi: ath11k: fix ath11k_mac_op_remain_on_channel() stack + usage + +When compiling with clang 16.0.6, I've noticed the following: + +drivers/net/wireless/ath/ath11k/mac.c:8903:12: warning: stack frame +size (1032) exceeds limit (1024) in 'ath11k_mac_op_remain_on_channel' +[-Wframe-larger-than] +static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw, + ^ +68/1032 (6.59%) spills, 964/1032 (93.41%) variables + +So switch to kzalloc()'ed instance of 'struct scan_req_params' like +it's done in 'ath11k_mac_op_hw_scan()'. Compile tested only. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230926042906.13725-1-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/mac.c | 44 +++++++++++++++------------ + 1 file changed, 25 insertions(+), 19 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -8908,7 +8908,7 @@ static int ath11k_mac_op_remain_on_chann + { + struct ath11k *ar = hw->priv; + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); +- struct scan_req_params arg; ++ struct scan_req_params *arg; + int ret; + u32 scan_time_msec; + +@@ -8940,27 +8940,31 @@ static int ath11k_mac_op_remain_on_chann + + scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2; + +- memset(&arg, 0, sizeof(arg)); +- ath11k_wmi_start_scan_init(ar, &arg); +- arg.num_chan = 1; +- arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list), +- GFP_KERNEL); +- if (!arg.chan_list) { ++ arg = kzalloc(sizeof(*arg), GFP_KERNEL); ++ if (!arg) { + ret = -ENOMEM; + goto exit; + } ++ ath11k_wmi_start_scan_init(ar, arg); ++ arg->num_chan = 1; ++ arg->chan_list = kcalloc(arg->num_chan, sizeof(*arg->chan_list), ++ GFP_KERNEL); ++ if (!arg->chan_list) { ++ ret = -ENOMEM; ++ goto free_arg; ++ } + +- arg.vdev_id = arvif->vdev_id; +- arg.scan_id = ATH11K_SCAN_ID; +- arg.chan_list[0] = chan->center_freq; +- arg.dwell_time_active = scan_time_msec; +- arg.dwell_time_passive = scan_time_msec; +- arg.max_scan_time = scan_time_msec; +- arg.scan_flags |= WMI_SCAN_FLAG_PASSIVE; +- arg.scan_flags |= WMI_SCAN_FILTER_PROBE_REQ; +- arg.burst_duration = duration; ++ arg->vdev_id = arvif->vdev_id; ++ arg->scan_id = ATH11K_SCAN_ID; ++ arg->chan_list[0] = chan->center_freq; ++ arg->dwell_time_active = scan_time_msec; ++ arg->dwell_time_passive = scan_time_msec; ++ arg->max_scan_time = scan_time_msec; ++ arg->scan_flags |= WMI_SCAN_FLAG_PASSIVE; ++ arg->scan_flags |= WMI_SCAN_FILTER_PROBE_REQ; ++ arg->burst_duration = duration; + +- ret = ath11k_start_scan(ar, &arg); ++ ret = ath11k_start_scan(ar, arg); + if (ret) { + ath11k_warn(ar->ab, "failed to start roc scan: %d\n", ret); + +@@ -8986,7 +8990,9 @@ static int ath11k_mac_op_remain_on_chann + ret = 0; + + free_chan_list: +- kfree(arg.chan_list); ++ kfree(arg->chan_list); ++free_arg: ++ kfree(arg); + exit: + mutex_unlock(&ar->conf_mutex); + return ret; diff --git a/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-mac-fix-struct-ieee80211_sband_iftype_da.patch b/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-mac-fix-struct-ieee80211_sband_iftype_da.patch new file mode 100644 index 00000000000..90da6a8c44a --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-mac-fix-struct-ieee80211_sband_iftype_da.patch @@ -0,0 +1,67 @@ +From 9e61589ac3c2d23c528d3ffd44604d98553ea1cb Mon Sep 17 00:00:00 2001 +From: Kalle Valo +Date: Wed, 27 Sep 2023 17:27:08 +0300 +Subject: [PATCH] wifi: ath11k: mac: fix struct ieee80211_sband_iftype_data + handling + +Commit e8c1841278a7 ("wifi: cfg80211: annotate iftype_data pointer with +sparse") added sparse checks for struct ieee80211_sband_iftype_data handling +which immediately found an issue in ath11k: + +drivers/net/wireless/ath/ath11k/mac.c:7952:22: warning: incorrect type in argument 1 (different address spaces) +drivers/net/wireless/ath/ath11k/mac.c:7952:22: expected struct ieee80211_sta_he_cap const *he_cap +drivers/net/wireless/ath/ath11k/mac.c:7952:22: got struct ieee80211_sta_he_cap const [noderef] __iftype_data * + +The problem here is that we are accessing sband->iftype_data directly even +though we should use for_each_sband_iftype_data() or similar. Fortunately +there's ieee80211_get_he_iftype_cap_vif() which is just what we need here so +use it to get HE capabilities. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 + +Reported-by: Johannes Berg +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230927142708.2897504-2-kvalo@kernel.org +--- + drivers/net/wireless/ath/ath11k/mac.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -7913,12 +7913,14 @@ ath11k_mac_get_tx_mcs_map(const struct i + + static bool + ath11k_mac_bitrate_mask_get_single_nss(struct ath11k *ar, ++ struct ath11k_vif *arvif, + enum nl80211_band band, + const struct cfg80211_bitrate_mask *mask, + int *nss) + { + struct ieee80211_supported_band *sband = &ar->mac.sbands[band]; + u16 vht_mcs_map = le16_to_cpu(sband->vht_cap.vht_mcs.tx_mcs_map); ++ const struct ieee80211_sta_he_cap *he_cap; + u16 he_mcs_map = 0; + u8 ht_nss_mask = 0; + u8 vht_nss_mask = 0; +@@ -7949,7 +7951,11 @@ ath11k_mac_bitrate_mask_get_single_nss(s + return false; + } + +- he_mcs_map = le16_to_cpu(ath11k_mac_get_tx_mcs_map(&sband->iftype_data->he_cap)); ++ he_cap = ieee80211_get_he_iftype_cap_vif(sband, arvif->vif); ++ if (!he_cap) ++ return false; ++ ++ he_mcs_map = le16_to_cpu(ath11k_mac_get_tx_mcs_map(he_cap)); + + for (i = 0; i < ARRAY_SIZE(mask->control[band].he_mcs); i++) { + if (mask->control[band].he_mcs[i] == 0) +@@ -8365,7 +8371,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie + ieee80211_iterate_stations_atomic(ar->hw, + ath11k_mac_disable_peer_fixed_rate, + arvif); +- } else if (ath11k_mac_bitrate_mask_get_single_nss(ar, band, mask, ++ } else if (ath11k_mac_bitrate_mask_get_single_nss(ar, arvif, band, mask, + &single_nss)) { + rate = WMI_FIXED_RATE_NONE; + nss = single_nss; diff --git a/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-fix-CAC-running-state-during-virtual-int.patch b/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-fix-CAC-running-state-during-virtual-int.patch new file mode 100644 index 00000000000..eee0bf0fb5a --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-fix-CAC-running-state-during-virtual-int.patch @@ -0,0 +1,80 @@ +From 69fcb525905600a151997cd16367bb92c34a2b14 Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 3 Oct 2023 17:26:54 +0300 +Subject: [PATCH] wifi: ath11k: fix CAC running state during virtual interface + start + +Currently channel definition's primary channel's DFS CAC time +as well as primary channel's state i.e usable are used to set +the CAC_RUNNING flag for the ath11k radio structure. However, +this is wrong since certain channel definition are possbile +where primary channel may not be a DFS channel but, secondary +channel is a DFS channel. For example - channel 36 with 160 MHz +bandwidth. +In such cases, the flag will not be set which is wrong. + +Fix this issue by using cfg80211_chandef_dfs_usable() function +from cfg80211 which return trues if at least one channel is in +usable state. + +While at it, modify the CAC running debug log message to print +the CAC time as well in milli-seconds. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Aditya Kumar Singh +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230912051857.2284-3-quic_adisi@quicinc.com +--- + drivers/net/wireless/ath/ath11k/mac.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5,6 +5,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -7196,6 +7197,7 @@ ath11k_mac_vdev_start_restart(struct ath + struct wmi_vdev_start_req_arg arg = {}; + const struct cfg80211_chan_def *chandef = &ctx->def; + int ret = 0; ++ unsigned int dfs_cac_time; + + lockdep_assert_held(&ar->conf_mutex); + +@@ -7275,20 +7277,21 @@ ath11k_mac_vdev_start_restart(struct ath + ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM started, vdev_id %d\n", + arvif->vif->addr, arvif->vdev_id); + +- /* Enable CAC Flag in the driver by checking the channel DFS cac time, +- * i.e dfs_cac_ms value which will be valid only for radar channels +- * and state as NL80211_DFS_USABLE which indicates CAC needs to be ++ /* Enable CAC Flag in the driver by checking the all sub-channel's DFS ++ * state as NL80211_DFS_USABLE which indicates CAC needs to be + * done before channel usage. This flags is used to drop rx packets. + * during CAC. + */ + /* TODO Set the flag for other interface types as required */ +- if (arvif->vdev_type == WMI_VDEV_TYPE_AP && +- chandef->chan->dfs_cac_ms && +- chandef->chan->dfs_state == NL80211_DFS_USABLE) { ++ if (arvif->vdev_type == WMI_VDEV_TYPE_AP && ctx->radar_enabled && ++ cfg80211_chandef_dfs_usable(ar->hw->wiphy, chandef)) { + set_bit(ATH11K_CAC_RUNNING, &ar->dev_flags); ++ dfs_cac_time = cfg80211_chandef_dfs_cac_time(ar->hw->wiphy, ++ chandef); + ath11k_dbg(ab, ATH11K_DBG_MAC, +- "CAC Started in chan_freq %d for vdev %d\n", +- arg.channel.freq, arg.vdev_id); ++ "cac started dfs_cac_time %u center_freq %d center_freq1 %d for vdev %d\n", ++ dfs_cac_time, arg.channel.freq, chandef->center_freq1, ++ arg.vdev_id); + } + + ret = ath11k_mac_set_txbf_conf(arvif); diff --git a/package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-fix-Tx-power-value-during-active-CAC.patch b/package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-fix-Tx-power-value-during-active-CAC.patch new file mode 100644 index 00000000000..79c1d735b82 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-fix-Tx-power-value-during-active-CAC.patch @@ -0,0 +1,43 @@ +From 77f1ee6fd8b6e470f721d05a2e269039d5cafcb7 Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 3 Oct 2023 17:26:54 +0300 +Subject: [PATCH] wifi: ath11k: fix Tx power value during active CAC + +Tx power is fetched from firmware's pdev stats. However, during active +CAC, firmware does not fill the current Tx power and sends the max +initialised value filled during firmware init. If host sends this power +to user space, this is wrong since in certain situations, the Tx power +could be greater than the max allowed by the regulatory. Hence, host +should not be fetching the Tx power during an active CAC. + +Fix this issue by returning -EAGAIN error so that user space knows that there's +no valid value available. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Fixes: 9a2aa68afe3d ("wifi: ath11k: add get_txpower mac ops") +Signed-off-by: Aditya Kumar Singh +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230912051857.2284-4-quic_adisi@quicinc.com +--- + drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -9060,6 +9060,14 @@ static int ath11k_mac_op_get_txpower(str + if (ar->state != ATH11K_STATE_ON) + goto err_fallback; + ++ /* Firmware doesn't provide Tx power during CAC hence no need to fetch ++ * the stats. ++ */ ++ if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) { ++ mutex_unlock(&ar->conf_mutex); ++ return -EAGAIN; ++ } ++ + req_param.pdev_id = ar->pdev->pdev_id; + req_param.stats_id = WMI_REQUEST_PDEV_STAT; + diff --git a/package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-call-ath11k_mac_fils_discovery-without-c.patch b/package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-call-ath11k_mac_fils_discovery-without-c.patch new file mode 100644 index 00000000000..d233492513d --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-call-ath11k_mac_fils_discovery-without-c.patch @@ -0,0 +1,37 @@ +From e149353e6562f3e3246f75dfc4cca6a0cc5b4efc Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Mon, 9 Oct 2023 10:13:54 +0300 +Subject: [PATCH] wifi: ath11k: call ath11k_mac_fils_discovery() without + condition + +Mac80211 does not set flags BSS_CHANGED_FILS_DISCOVERY and +BSS_CHANGED_UNSOL_BCAST_PROBE_RESP if there are no updates to +FILS discovery and unsolicited broadcast probe response transmission +configurations respectively. This results in the transmissions getting +stopped during BSS change operations which do not include these +attributes. Remove the checks for the flags and always send the existing +configuration to firmware. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Aloka Dixit +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231004044915.6817-1-quic_alokad@quicinc.com +--- + drivers/net/wireless/ath/ath11k/mac.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3732,9 +3732,7 @@ static void ath11k_mac_op_bss_info_chang + arvif->vdev_id, ret); + } + +- if (changed & BSS_CHANGED_FILS_DISCOVERY || +- changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP) +- ath11k_mac_fils_discovery(arvif, info); ++ ath11k_mac_fils_discovery(arvif, info); + + if (changed & BSS_CHANGED_ARP_FILTER) { + ipv4_cnt = min(vif->cfg.arp_addr_cnt, ATH11K_IPV4_MAX_COUNT); diff --git a/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-ath11k_debugfs_register-fix-format-trunc.patch b/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-ath11k_debugfs_register-fix-format-trunc.patch new file mode 100644 index 00000000000..df8a4283fae --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-ath11k_debugfs_register-fix-format-trunc.patch @@ -0,0 +1,39 @@ +From a47111663491ff2829df0626493ce81b48dd880a Mon Sep 17 00:00:00 2001 +From: Kalle Valo +Date: Tue, 10 Oct 2023 09:22:50 +0300 +Subject: [PATCH] wifi: ath11k: ath11k_debugfs_register(): fix + format-truncation warning + +In v6.6-rc4 with GCC 13.2 I see a new warning: + +drivers/net/wireless/ath/ath11k/debugfs.c: In function 'ath11k_debugfs_register': +drivers/net/wireless/ath/ath11k/debugfs.c:1597:51: error: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Werror=format-truncation=] +drivers/net/wireless/ath/ath11k/debugfs.c:1597:48: note: directive argument in the range [0, 255] +drivers/net/wireless/ath/ath11k/debugfs.c:1597:9: note: 'snprintf' output between 5 and 7 bytes into a destination of size 5 + +Increase the size of pdev_name to 10 bytes to make sure there's enough room for +the string. Also change the format to '%u' as ar->pdev_idx is u8. + +Compile tested only. + +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231010062250.2580951-1-kvalo@kernel.org +--- + drivers/net/wireless/ath/ath11k/debugfs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1591,10 +1591,10 @@ static const struct file_operations fops + int ath11k_debugfs_register(struct ath11k *ar) + { + struct ath11k_base *ab = ar->ab; +- char pdev_name[5]; ++ char pdev_name[10]; + char buf[100] = {0}; + +- snprintf(pdev_name, sizeof(pdev_name), "%s%d", "mac", ar->pdev_idx); ++ snprintf(pdev_name, sizeof(pdev_name), "%s%u", "mac", ar->pdev_idx); + + ar->debug.debugfs_pdev = debugfs_create_dir(pdev_name, ab->debugfs_soc); + if (IS_ERR(ar->debug.debugfs_pdev)) diff --git a/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-add-parsing-of-phy-bitmap-for-reg-rules.patch b/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-add-parsing-of-phy-bitmap-for-reg-rules.patch new file mode 100644 index 00000000000..10d517a27a5 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-add-parsing-of-phy-bitmap-for-reg-rules.patch @@ -0,0 +1,84 @@ +From 534c2dd8099a9cc4bad8ea8b3c7fa1f730e10d5d Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 10 Oct 2023 10:27:19 +0300 +Subject: [PATCH] wifi: ath11k: add parsing of phy bitmap for reg rules + +Certain regulatory domains could put restrictions on phy mode operation. +For example, in a few countries HE Operation is not allowed. For such +countries, firmware indicates this via phy bitmap in each reg rule. + +Currently, there is no logic to parse this info and then pass it on to the +cfg80211/regulatory. + +Add parsing of this phy bitmap from the regulatory channel change event and +then accordingly map it to cfg80211/regulatory flags and pass it on to it. + +While at it, correct typo in debug print s/dsf/dfs. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Aditya Kumar Singh +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231004092655.25020-1-quic_adisi@quicinc.com +--- + drivers/net/wireless/ath/ath11k/reg.c | 11 +++++++++++ + drivers/net/wireless/ath/ath11k/reg.h | 3 +++ + drivers/net/wireless/ath/ath11k/wmi.c | 5 +++-- + 3 files changed, 17 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/reg.c ++++ b/drivers/net/wireless/ath/ath11k/reg.c +@@ -352,6 +352,16 @@ static u32 ath11k_map_fw_reg_flags(u16 r + return flags; + } + ++static u32 ath11k_map_fw_phy_flags(u32 phy_flags) ++{ ++ u32 flags = 0; ++ ++ if (phy_flags & ATH11K_REG_PHY_BITMAP_NO11AX) ++ flags |= NL80211_RRF_NO_HE; ++ ++ return flags; ++} ++ + static bool + ath11k_reg_can_intersect(struct ieee80211_reg_rule *rule1, + struct ieee80211_reg_rule *rule2) +@@ -685,6 +695,7 @@ ath11k_reg_build_regd(struct ath11k_base + } + + flags |= ath11k_map_fw_reg_flags(reg_rule->flags); ++ flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); + + ath11k_reg_update_rule(tmp_regd->reg_rules + i, + reg_rule->start_freq, +--- a/drivers/net/wireless/ath/ath11k/reg.h ++++ b/drivers/net/wireless/ath/ath11k/reg.h +@@ -24,6 +24,9 @@ enum ath11k_dfs_region { + ATH11K_DFS_REG_UNDEF, + }; + ++/* Phy bitmaps */ ++#define ATH11K_REG_PHY_BITMAP_NO11AX BIT(5) ++ + /* ATH11K Regulatory API's */ + void ath11k_reg_init(struct ath11k *ar); + void ath11k_reg_free(struct ath11k_base *ab); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -5440,10 +5440,11 @@ static int ath11k_pull_reg_chan_list_ext + } + + ath11k_dbg(ab, ATH11K_DBG_WMI, +- "cc_ext %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d", ++ "cc_ext %s dfs %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d phy_bitmap 0x%x", + reg_info->alpha2, reg_info->dfs_region, + reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, +- reg_info->min_bw_5ghz, reg_info->max_bw_5ghz); ++ reg_info->min_bw_5ghz, reg_info->max_bw_5ghz, ++ reg_info->phybitmap); + + ath11k_dbg(ab, ATH11K_DBG_WMI, + "num_2ghz_reg_rules %d num_5ghz_reg_rules %d", diff --git a/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-Remove-unused-struct-ath11k_htc_frame.patch b/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-Remove-unused-struct-ath11k_htc_frame.patch new file mode 100644 index 00000000000..df4235388a5 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-Remove-unused-struct-ath11k_htc_frame.patch @@ -0,0 +1,38 @@ +From 480d230bef0ecd06e72ae3a84117142e38e77503 Mon Sep 17 00:00:00 2001 +From: Jeff Johnson +Date: Mon, 9 Oct 2023 09:36:54 -0700 +Subject: [PATCH] wifi: ath11k: Remove unused struct ath11k_htc_frame + +struct ath11k_htc_frame is unused, and since it illogically contains +two consecutive flexible arrays, it could never be used, so remove it. + +No functional changes, compile tested only. + +Signed-off-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231009-ath11k_htc_frame-v1-1-81d405b7a195@quicinc.com +--- + drivers/net/wireless/ath/ath11k/htc.h | 12 ------------ + 1 file changed, 12 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/htc.h ++++ b/drivers/net/wireless/ath/ath11k/htc.h +@@ -156,18 +156,6 @@ struct ath11k_htc_record { + }; + } __packed __aligned(4); + +-/* note: the trailer offset is dynamic depending +- * on payload length. this is only a struct layout draft +- */ +-struct ath11k_htc_frame { +- struct ath11k_htc_hdr hdr; +- union { +- struct ath11k_htc_msg msg; +- u8 payload[0]; +- }; +- struct ath11k_htc_record trailer[0]; +-} __packed __aligned(4); +- + enum ath11k_htc_svc_gid { + ATH11K_HTC_SVC_GRP_RSVD = 0, + ATH11K_HTC_SVC_GRP_WMI = 1, diff --git a/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-Introduce-and-use-ath11k_sta_to_arsta.patch b/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-Introduce-and-use-ath11k_sta_to_arsta.patch new file mode 100644 index 00000000000..59af3b92979 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-Introduce-and-use-ath11k_sta_to_arsta.patch @@ -0,0 +1,384 @@ +From 10c65f97b424fcee439463f933140df2a0022f98 Mon Sep 17 00:00:00 2001 +From: Jeff Johnson +Date: Mon, 9 Oct 2023 09:39:42 -0700 +Subject: [PATCH] wifi: ath11k: Introduce and use ath11k_sta_to_arsta() + +Currently, the logic to return an ath11k_sta pointer, given a +ieee80211_sta pointer, uses typecasting throughout the driver. In +general, conversion functions are preferable to typecasting since +using a conversion function allows the compiler to validate the types +of both the input and output parameters. + +ath11k already defines a conversion function ath11k_vif_to_arvif() for +a similar conversion. So introduce ath11k_sta_to_arsta() for this use +case, and convert all of the existing typecasting to use this +function. + +No functional changes, compile tested only. + +Signed-off-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231009-ath11k_sta_to_arsta-v1-1-1563e3a307e8@quicinc.com +--- + drivers/net/wireless/ath/ath11k/core.h | 5 ++++ + drivers/net/wireless/ath/ath11k/debugfs.c | 4 +-- + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 30 +++++++++---------- + drivers/net/wireless/ath/ath11k/dp_rx.c | 8 ++--- + drivers/net/wireless/ath/ath11k/dp_tx.c | 4 +-- + drivers/net/wireless/ath/ath11k/mac.c | 18 +++++------ + drivers/net/wireless/ath/ath11k/peer.c | 2 +- + drivers/net/wireless/ath/ath11k/wmi.c | 6 ++-- + 8 files changed, 41 insertions(+), 36 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -1223,6 +1223,11 @@ static inline struct ath11k_vif *ath11k_ + return (struct ath11k_vif *)vif->drv_priv; + } + ++static inline struct ath11k_sta *ath11k_sta_to_arsta(struct ieee80211_sta *sta) ++{ ++ return (struct ath11k_sta *)sta->drv_priv; ++} ++ + static inline struct ath11k *ath11k_ab_to_ar(struct ath11k_base *ab, + int mac_id) + { +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1459,7 +1459,7 @@ static void ath11k_reset_peer_ps_duratio + struct ieee80211_sta *sta) + { + struct ath11k *ar = data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + + spin_lock_bh(&ar->data_lock); + arsta->ps_total_duration = 0; +@@ -1510,7 +1510,7 @@ static void ath11k_peer_ps_state_disable + struct ieee80211_sta *sta) + { + struct ath11k *ar = data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + + spin_lock_bh(&ar->data_lock); + arsta->peer_ps_state = WMI_PEER_PS_STATE_DISABLED; +--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -136,7 +136,7 @@ static ssize_t ath11k_dbg_sta_dump_tx_st + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct ath11k_htt_data_stats *stats; + static const char *str_name[ATH11K_STATS_TYPE_MAX] = {"succ", "fail", +@@ -243,7 +243,7 @@ static ssize_t ath11k_dbg_sta_dump_rx_st + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; + int len = 0, i, retval = 0; +@@ -340,7 +340,7 @@ static int + ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file) + { + struct ieee80211_sta *sta = inode->i_private; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct debug_htt_stats_req *stats_req; + int type = ar->debug.htt_stats.type; +@@ -376,7 +376,7 @@ static int + ath11k_dbg_sta_release_htt_peer_stats(struct inode *inode, struct file *file) + { + struct ieee80211_sta *sta = inode->i_private; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + + mutex_lock(&ar->conf_mutex); +@@ -413,7 +413,7 @@ static ssize_t ath11k_dbg_sta_write_peer + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + int ret, enable; + +@@ -453,7 +453,7 @@ static ssize_t ath11k_dbg_sta_read_peer_ + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[32] = {0}; + int len; +@@ -480,7 +480,7 @@ static ssize_t ath11k_dbg_sta_write_delb + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 tid, initiator, reason; + int ret; +@@ -531,7 +531,7 @@ static ssize_t ath11k_dbg_sta_write_addb + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 tid, status; + int ret; +@@ -581,7 +581,7 @@ static ssize_t ath11k_dbg_sta_write_addb + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 tid, buf_size; + int ret; +@@ -632,7 +632,7 @@ static ssize_t ath11k_dbg_sta_read_aggr_ + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[64]; + int len = 0; +@@ -652,7 +652,7 @@ static ssize_t ath11k_dbg_sta_write_aggr + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 aggr_mode; + int ret; +@@ -697,7 +697,7 @@ ath11k_write_htt_peer_stats_reset(struct + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct htt_ext_stats_cfg_params cfg_params = { 0 }; + int ret; +@@ -756,7 +756,7 @@ static ssize_t ath11k_dbg_sta_read_peer_ + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[20]; + int len; +@@ -783,7 +783,7 @@ static ssize_t ath11k_dbg_sta_read_curre + loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u64 time_since_station_in_power_save; + char buf[20]; +@@ -817,7 +817,7 @@ static ssize_t ath11k_dbg_sta_read_total + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[20]; + u64 power_save_duration; +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1099,7 +1099,7 @@ int ath11k_dp_rx_ampdu_start(struct ath1 + struct ieee80211_ampdu_params *params) + { + struct ath11k_base *ab = ar->ab; +- struct ath11k_sta *arsta = (void *)params->sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(params->sta); + int vdev_id = arsta->arvif->vdev_id; + int ret; + +@@ -1117,7 +1117,7 @@ int ath11k_dp_rx_ampdu_stop(struct ath11 + { + struct ath11k_base *ab = ar->ab; + struct ath11k_peer *peer; +- struct ath11k_sta *arsta = (void *)params->sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(params->sta); + int vdev_id = arsta->arvif->vdev_id; + dma_addr_t paddr; + bool active; +@@ -1456,7 +1456,7 @@ ath11k_update_per_peer_tx_stats(struct a + } + + sta = peer->sta; +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + memset(&arsta->txrate, 0, sizeof(arsta->txrate)); + +@@ -5242,7 +5242,7 @@ int ath11k_dp_rx_process_mon_status(stru + goto next_skb; + } + +- arsta = (struct ath11k_sta *)peer->sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(peer->sta); + ath11k_dp_rx_update_peer_stats(arsta, ppdu_info); + + if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -467,7 +467,7 @@ void ath11k_dp_tx_update_txcompl(struct + } + + sta = peer->sta; +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + memset(&arsta->txrate, 0, sizeof(arsta->txrate)); + pkt_type = FIELD_GET(HAL_TX_RATE_STATS_INFO0_PKT_TYPE, +@@ -627,7 +627,7 @@ static void ath11k_dp_tx_complete_msdu(s + ieee80211_free_txskb(ar->hw, msdu); + return; + } +- arsta = (struct ath11k_sta *)peer->sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(peer->sta); + status.sta = peer->sta; + status.skb = msdu; + status.info = info; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -2832,7 +2832,7 @@ static void ath11k_peer_assoc_prepare(st + + lockdep_assert_held(&ar->conf_mutex); + +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + memset(arg, 0, sizeof(*arg)); + +@@ -4313,7 +4313,7 @@ static int ath11k_mac_op_set_key(struct + ath11k_warn(ab, "peer %pM disappeared!\n", peer_addr); + + if (sta) { +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + switch (key->cipher) { + case WLAN_CIPHER_SUITE_TKIP: +@@ -4904,7 +4904,7 @@ static int ath11k_mac_station_add(struct + { + struct ath11k_base *ab = ar->ab; + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct peer_create_params peer_param; + int ret; + +@@ -5028,7 +5028,7 @@ static int ath11k_mac_op_sta_state(struc + { + struct ath11k *ar = hw->priv; + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k_peer *peer; + int ret = 0; + +@@ -5194,7 +5194,7 @@ static void ath11k_mac_op_sta_set_4addr( + struct ieee80211_sta *sta, bool enabled) + { + struct ath11k *ar = hw->priv; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + + if (enabled && !arsta->use_4addr_set) { + ieee80211_queue_work(ar->hw, &arsta->set_4addr_wk); +@@ -5208,7 +5208,7 @@ static void ath11k_mac_op_sta_rc_update( + u32 changed) + { + struct ath11k *ar = hw->priv; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ath11k_peer *peer; + u32 bw, smps; +@@ -6201,7 +6201,7 @@ static void ath11k_mac_op_tx(struct ieee + } + + if (control->sta) +- arsta = (struct ath11k_sta *)control->sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(control->sta); + + ret = ath11k_dp_tx(ar, arvif, arsta, skb); + if (unlikely(ret)) { +@@ -8233,7 +8233,7 @@ static void ath11k_mac_set_bitrate_mask_ + struct ieee80211_sta *sta) + { + struct ath11k_vif *arvif = data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arvif->ar; + + spin_lock_bh(&ar->data_lock); +@@ -8637,7 +8637,7 @@ static void ath11k_mac_op_sta_statistics + struct ieee80211_sta *sta, + struct station_info *sinfo) + { +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + s8 signal; + bool db2dbm = test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT, +--- a/drivers/net/wireless/ath/ath11k/peer.c ++++ b/drivers/net/wireless/ath/ath11k/peer.c +@@ -446,7 +446,7 @@ int ath11k_peer_create(struct ath11k *ar + peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; + + if (sta) { +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + arsta->tcl_metadata |= FIELD_PREP(HTT_TCL_META_DATA_TYPE, 0) | + FIELD_PREP(HTT_TCL_META_DATA_PEER_ID, + peer->peer_id); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -6453,7 +6453,7 @@ static int ath11k_wmi_tlv_rssi_chain_par + goto exit; + } + +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) > + ARRAY_SIZE(stats_rssi->rssi_avg_beacon)); +@@ -6541,7 +6541,7 @@ static int ath11k_wmi_tlv_fw_stats_data_ + arvif->bssid, + NULL); + if (sta) { +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + arsta->rssi_beacon = src->beacon_snr; + ath11k_dbg(ab, ATH11K_DBG_WMI, + "stats vdev id %d snr %d\n", +@@ -7468,7 +7468,7 @@ static void ath11k_wmi_event_peer_sta_ps + goto exit; + } + +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + spin_lock_bh(&ar->data_lock); + diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch index aacbb348399..71373b2136f 100644 --- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch +++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch @@ -31,7 +31,7 @@ Signed-off-by: Robert Marko { .hw_rev = ATH11K_HW_IPQ8074, .name = "ipq8074 hw2.0", -@@ -1974,7 +1974,8 @@ static void ath11k_core_reset(struct wor +@@ -2040,7 +2040,8 @@ static void ath11k_core_reset(struct wor static int ath11k_init_hw_params(struct ath11k_base *ab) { const struct ath11k_hw_params *hw_params = NULL; @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) { hw_params = &ath11k_hw_params[i]; -@@ -1990,7 +1991,31 @@ static int ath11k_init_hw_params(struct +@@ -2056,7 +2057,31 @@ static int ath11k_init_hw_params(struct ab->hw_params = *hw_params; diff --git a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch index 5b02bcba660..74317e0262a 100644 --- a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch +++ b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch @@ -23,7 +23,7 @@ Signed-off-by: Aditya Kumar Singh --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c -@@ -352,129 +352,6 @@ static u32 ath11k_map_fw_reg_flags(u16 r +@@ -362,129 +362,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p return flags; } @@ -153,7 +153,7 @@ Signed-off-by: Aditya Kumar Singh static const char * ath11k_reg_get_regdom_str(enum nl80211_dfs_regions dfs_region) { -@@ -609,9 +486,9 @@ ath11k_reg_update_weather_radar_band(str +@@ -619,9 +496,9 @@ ath11k_reg_update_weather_radar_band(str struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, @@ -165,7 +165,7 @@ Signed-off-by: Aditya Kumar Singh struct cur_reg_rule *reg_rule; u8 i = 0, j = 0, k = 0; u8 num_rules; -@@ -628,26 +505,26 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -638,26 +515,26 @@ ath11k_reg_build_regd(struct ath11k_base num_rules += reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP]; if (!num_rules) @@ -199,16 +199,16 @@ Signed-off-by: Aditya Kumar Singh reg_info->dfs_region, num_rules); /* Update reg_rules[] below. Firmware is expected to * send these rules in order(2 GHz rules first and then 5 GHz) -@@ -686,7 +563,7 @@ ath11k_reg_build_regd(struct ath11k_base - +@@ -697,7 +574,7 @@ ath11k_reg_build_regd(struct ath11k_base flags |= ath11k_map_fw_reg_flags(reg_rule->flags); + flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); - ath11k_reg_update_rule(tmp_regd->reg_rules + i, + ath11k_reg_update_rule(new_regd->reg_rules + i, reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, -@@ -701,7 +578,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -712,7 +589,7 @@ ath11k_reg_build_regd(struct ath11k_base reg_info->dfs_region == ATH11K_DFS_REG_ETSI && (reg_rule->end_freq > ETSI_WEATHER_RADAR_BAND_LOW && reg_rule->start_freq < ETSI_WEATHER_RADAR_BAND_HIGH)){ @@ -217,7 +217,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule, &i, flags, max_bw); continue; -@@ -712,37 +589,20 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -723,37 +600,20 @@ ath11k_reg_build_regd(struct ath11k_base "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n", i + 1, reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, @@ -260,7 +260,7 @@ Signed-off-by: Aditya Kumar Singh --- a/drivers/net/wireless/ath/ath11k/reg.h +++ b/drivers/net/wireless/ath/ath11k/reg.h -@@ -30,7 +30,7 @@ void ath11k_reg_free(struct ath11k_base +@@ -33,7 +33,7 @@ void ath11k_reg_free(struct ath11k_base void ath11k_regd_update_work(struct work_struct *work); struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, @@ -271,7 +271,7 @@ Signed-off-by: Aditya Kumar Singh #endif --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -7059,24 +7059,12 @@ static void ath11k_wmi_htc_tx_complete(s +@@ -7060,24 +7060,12 @@ static void ath11k_wmi_htc_tx_complete(s wake_up(&wmi->tx_ce_desc_wq); } @@ -296,7 +296,7 @@ Signed-off-by: Aditya Kumar Singh int ret = 0, pdev_idx, i, j; struct ath11k *ar; -@@ -7140,17 +7128,7 @@ static int ath11k_reg_chan_list_event(st +@@ -7141,17 +7129,7 @@ static int ath11k_reg_chan_list_event(st (char *)reg_info->alpha2, 2)) goto mem_free; From 9e1c5ad4b0c99c45927ccd44504cd8fdbbd03bb0 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 14 Oct 2023 00:37:34 +0200 Subject: [PATCH 57/78] mbedtls: Update to version 2.28.5 This fixes some minor security problems. Changelog: https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-2.28.5 Signed-off-by: Hauke Mehrtens --- package/libs/mbedtls/Makefile | 4 ++-- .../mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 4c3cb965c55..6f0b5162ebf 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.28.4 +PKG_VERSION:=2.28.5 PKG_RELEASE:=1 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=578c4dcd15bbff3f5cd56aa07cd4f850fc733634e3d5947be4f7157d5bfd81ac +PKG_HASH:=849e86b626e42ded6bf67197b64aa771daa54e2a7e2868dc67e1e4711959e5e3 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=gpl-2.0.txt diff --git a/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch b/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch index 02632cdb4ba..4ad2e8c7dbe 100644 --- a/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch +++ b/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch @@ -33,7 +33,7 @@ Signed-off-by: Glenn Strauss #include #else #include -@@ -3001,6 +3005,61 @@ find_parent: +@@ -3002,6 +3006,61 @@ find_parent: } } @@ -95,7 +95,7 @@ Signed-off-by: Glenn Strauss /* * Check for CN match */ -@@ -3021,24 +3080,51 @@ static int x509_crt_check_cn(const mbedt +@@ -3022,24 +3081,51 @@ static int x509_crt_check_cn(const mbedt return -1; } @@ -158,7 +158,7 @@ Signed-off-by: Glenn Strauss } /* -@@ -3049,31 +3135,23 @@ static void x509_crt_verify_name(const m +@@ -3050,31 +3136,23 @@ static void x509_crt_verify_name(const m uint32_t *flags) { const mbedtls_x509_name *name; From ccf24b5dcd14fbdd5fb24a3f1f1eadcb89b22ea0 Mon Sep 17 00:00:00 2001 From: John Audia Date: Fri, 13 Oct 2023 02:29:29 -0400 Subject: [PATCH 58/78] config-6.1: disable CONFIG_ARM64_ERRATUM_2966298 Disable new ksym globally as OpenWrt does not have any targets that use A520 cores. Reviewed-by: Robert Marko Signed-off-by: John Audia --- target/linux/generic/config-6.1 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-6.1 b/target/linux/generic/config-6.1 index 8c078b20118..3b9590ce6b7 100644 --- a/target/linux/generic/config-6.1 +++ b/target/linux/generic/config-6.1 @@ -375,6 +375,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_843419 is not set # CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_858921 is not set +# CONFIG_ARM64_ERRATUM_2966298 is not set # CONFIG_ARM64_HW_AFDBM is not set # CONFIG_ARM64_LSE_ATOMICS is not set CONFIG_ARM64_MODULE_PLTS=y From b35756446391d1b21970a0e05f8f6f5e069f73cf Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 11 Oct 2023 14:55:10 -0400 Subject: [PATCH 59/78] kernel: bump 6.1 to 6.1.57 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.57 Manually rebased: generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch Removed upstreamed: qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.57&id=2dfb5f324d799f4545e17631415aba6d302a8e2b Build system: x86/64 Build-tested: x86/64/AMD Cezanne Run-tested: x86/64/AMD Cezanne Reviewed-by: Robert Marko Signed-off-by: John Audia --- include/kernel-6.1 | 4 +- .../900-unaligned_access_hacks.patch | 8 ++-- ...a-introduce-a-customisable-threshold.patch | 4 +- ...ci_sync-Add-fallback-bd-address-prop.patch | 4 +- ...i-gen-LRU-per-node-lru_gen_folio-lis.patch | 2 +- ...3-10-UPSTREAM-mm-add-vma_has_recency.patch | 4 +- ...x-fix-88E6393X-family-internal-phys-.patch | 6 +-- ...x-pass-mv88e6xxx_chip-structure-to-p.patch | 2 +- ...xx-enable-support-for-88E6361-switch.patch | 2 +- ...-dsa-mv88e6xxx-disable-ATU-violation.patch | 2 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- ...les-ignore-EOPNOTSUPP-on-flowtable-d.patch | 2 +- ...net-mtk_eth_soc-enable-threaded-NAPI.patch | 20 --------- ...equest-assisted-learning-on-CPU-port.patch | 2 +- .../pending-6.1/834-ledtrig-libata.patch | 6 +-- .../901-arm-add-cmdline-override.patch | 2 +- ...om-Add-support-for-IPQ8074-Gen3-port.patch | 2 +- ...broken-pcie-enumeration-for-2_3_3-co.patch | 44 ------------------- 19 files changed, 29 insertions(+), 93 deletions(-) delete mode 100644 target/linux/qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch diff --git a/include/kernel-6.1 b/include/kernel-6.1 index 0354d642c85..c91629d5d85 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .56 -LINUX_KERNEL_HASH-6.1.56 = 9edefdde32c2298389dcd19566402332b3c2016f5ada17e5820f500b908d478c +LINUX_VERSION-6.1 = .57 +LINUX_KERNEL_HASH-6.1.57 = f9ebfe3ddc5152d87b37e33be30e31875d137433be10a57ce29d2eae7b6e91b1 diff --git a/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch index 943aa1a132f..c919a8f2631 100644 --- a/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch @@ -349,7 +349,7 @@ SVN-Revision: 35130 list_for_each_entry(p, head, list) { --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -611,48 +611,53 @@ static void tcp_options_write(struct tcp +@@ -610,48 +610,53 @@ static void tcp_options_write(struct tcp u16 options = opts->options; /* mungable copy */ if (unlikely(OPTION_MD5 & options)) { @@ -426,7 +426,7 @@ SVN-Revision: 35130 } if (unlikely(opts->num_sack_blocks)) { -@@ -660,16 +665,17 @@ static void tcp_options_write(struct tcp +@@ -659,16 +664,17 @@ static void tcp_options_write(struct tcp tp->duplicate_sack : tp->selective_acks; int this_sack; @@ -450,7 +450,7 @@ SVN-Revision: 35130 } tp->rx_opt.dsack = 0; -@@ -682,13 +688,14 @@ static void tcp_options_write(struct tcp +@@ -681,13 +687,14 @@ static void tcp_options_write(struct tcp if (foc->exp) { len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; @@ -750,7 +750,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4165,14 +4165,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4178,14 +4178,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch b/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch index 34f1cea30e0..fed130ca854 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch @@ -20,7 +20,7 @@ Signed-off-by: David Plowman --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -273,6 +273,27 @@ EXPORT_SYMBOL(init_on_alloc); +@@ -253,6 +253,27 @@ EXPORT_SYMBOL(init_on_alloc); DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); EXPORT_SYMBOL(init_on_free); @@ -48,7 +48,7 @@ Signed-off-by: David Plowman static bool _init_on_alloc_enabled_early __read_mostly = IS_ENABLED(CONFIG_INIT_ON_ALLOC_DEFAULT_ON); static int __init early_init_on_alloc(char *buf) -@@ -3093,12 +3114,13 @@ __rmqueue(struct zone *zone, unsigned in +@@ -3073,12 +3094,13 @@ __rmqueue(struct zone *zone, unsigned in if (IS_ENABLED(CONFIG_CMA)) { /* * Balance movable allocations between regular and CMA areas by diff --git a/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch b/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch index 7bb65c28d48..d4c5a0183e4 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0699-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 -@@ -4635,6 +4635,7 @@ static const struct { +@@ -4630,6 +4630,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; -@@ -4663,7 +4664,9 @@ static int hci_dev_setup_sync(struct hci +@@ -4658,7 +4659,9 @@ static int hci_dev_setup_sync(struct hci if (!ret) { if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) && diff --git a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch index 71bee2d2a71..612ed6f6bab 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch @@ -361,7 +361,7 @@ Signed-off-by: T.J. Mercier static void mem_cgroup_css_free(struct cgroup_subsys_state *css) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7957,6 +7957,7 @@ static void __init free_area_init_node(i +@@ -7943,6 +7943,7 @@ static void __init free_area_init_node(i pgdat_set_deferred_range(pgdat); free_area_init_core(pgdat); diff --git a/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch b/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch index 8fd5564d007..aea6aa18e28 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch @@ -77,7 +77,7 @@ Signed-off-by: T.J. Mercier #endif --- a/mm/memory.c +++ b/mm/memory.c -@@ -1435,8 +1435,7 @@ again: +@@ -1445,8 +1445,7 @@ again: force_flush = 1; set_page_dirty(page); } @@ -87,7 +87,7 @@ Signed-off-by: T.J. Mercier mark_page_accessed(page); } rss[mm_counter(page)]--; -@@ -5189,8 +5188,8 @@ static inline void mm_account_fault(stru +@@ -5199,8 +5198,8 @@ static inline void mm_account_fault(stru #ifdef CONFIG_LRU_GEN static void lru_gen_enter_fault(struct vm_area_struct *vma) { diff --git a/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch b/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch index b7db7fb1bc4..12ea3ebda07 100644 --- a/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch +++ b/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5942,7 +5942,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5944,7 +5944,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6191X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .max_sid = 63, .port_base_addr = 0x0, -@@ -5965,7 +5966,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5967,7 +5968,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6193X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .max_sid = 63, .port_base_addr = 0x0, -@@ -6284,7 +6286,8 @@ static const struct mv88e6xxx_info mv88e +@@ -6286,7 +6288,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6393X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ diff --git a/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch b/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch index 92ce97b27b4..72dfcee82c1 100644 --- a/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch +++ b/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch @@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -3326,7 +3326,7 @@ static int mv88e6xxx_setup_port(struct m +@@ -3328,7 +3328,7 @@ static int mv88e6xxx_setup_port(struct m caps = pl_config.mac_capabilities; if (chip->info->ops->port_max_speed_mode) diff --git a/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch b/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch index e5e815d2a4b..dc6d5497f21 100644 --- a/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch +++ b/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch @@ -58,7 +58,7 @@ Signed-off-by: Jakub Kicinski } } -@@ -6229,6 +6235,32 @@ static const struct mv88e6xxx_info mv88e +@@ -6231,6 +6237,32 @@ static const struct mv88e6xxx_info mv88e .ptp_support = true, .ops = &mv88e6352_ops, }, diff --git a/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch index 5a8f253c348..f09ad117b0d 100644 --- a/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch +++ b/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -3486,6 +3486,9 @@ static int mv88e6xxx_setup_port(struct m +@@ -3488,6 +3488,9 @@ static int mv88e6xxx_setup_port(struct m else reg = 1 << port; diff --git a/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index c381bcf8e19..4bf473f9a79 100644 --- a/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7911,7 +7911,7 @@ static void __init alloc_node_mem_map(st +@@ -7897,7 +7897,7 @@ static void __init alloc_node_mem_map(st if (pgdat == NODE_DATA(0)) { mem_map = NODE_DATA(0)->node_mem_map; if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 99a03e31c37..765eecd9d71 100644 --- a/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1205,6 +1205,73 @@ static struct mtd_info * __init open_mtd +@@ -1212,6 +1212,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1289,6 +1356,12 @@ static int __init ubi_init(void) +@@ -1296,6 +1363,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index 0901213491d..6e913bbaf68 100644 --- a/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -7864,7 +7864,7 @@ static int nft_register_flowtable_net_ho +@@ -7876,7 +7876,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index a48a993e2fb..842fef3a9c5 100644 --- a/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,26 +10,6 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3155,8 +3155,8 @@ static irqreturn_t mtk_handle_irq_rx(int - - eth->rx_events++; - if (likely(napi_schedule_prep(ð->rx_napi))) { -- __napi_schedule(ð->rx_napi); - mtk_rx_irq_disable(eth, eth->soc->txrx.rx_irq_done_mask); -+ __napi_schedule(ð->rx_napi); - } - - return IRQ_HANDLED; -@@ -3168,8 +3168,8 @@ static irqreturn_t mtk_handle_irq_tx(int - - eth->tx_events++; - if (likely(napi_schedule_prep(ð->tx_napi))) { -- __napi_schedule(ð->tx_napi); - mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); -+ __napi_schedule(ð->tx_napi); - } - - return IRQ_HANDLED; @@ -4941,6 +4941,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ diff --git a/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index a32c7d3603f..9556c90b579 100644 --- a/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -7023,6 +7023,7 @@ static int mv88e6xxx_register_switch(str +@@ -7025,6 +7025,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/generic/pending-6.1/834-ledtrig-libata.patch b/target/linux/generic/pending-6.1/834-ledtrig-libata.patch index 57fdb020f81..e9339c22068 100644 --- a/target/linux/generic/pending-6.1/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-6.1/834-ledtrig-libata.patch @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle /* clear exclusive status */ if (unlikely(qc->flags & ATA_QCFLAG_CLEAR_EXCL && -@@ -5328,6 +5344,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -5344,6 +5360,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -5363,6 +5382,12 @@ static void ata_host_release(struct kref +@@ -5379,6 +5398,12 @@ static void ata_host_release(struct kref kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -5765,7 +5790,23 @@ int ata_host_register(struct ata_host *h +@@ -5781,7 +5806,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } diff --git a/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch b/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch index 3978f52db13..f9fc450277c 100644 --- a/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch +++ b/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch @@ -37,7 +37,7 @@ * CONFIG_CMDLINE is meant to be a default in case nothing else --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -2221,6 +2221,14 @@ config CMDLINE_FORCE +@@ -2234,6 +2234,14 @@ config CMDLINE_FORCE endchoice diff --git a/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch b/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch index 8f4ef91b762..3d5c2182e9b 100644 --- a/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch +++ b/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch @@ -16,7 +16,7 @@ Signed-off-by: Bjorn Helgaas --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -1764,6 +1764,7 @@ static const struct of_device_id qcom_pc +@@ -1762,6 +1762,7 @@ static const struct of_device_id qcom_pc { .compatible = "qcom,pcie-ipq8064", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8074", .data = &cfg_2_3_3 }, diff --git a/target/linux/qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch b/target/linux/qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch deleted file mode 100644 index 1b34cdda461..00000000000 --- a/target/linux/qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch +++ /dev/null @@ -1,44 +0,0 @@ -From f92c2f22197b7beed59b81f2aa179e16987c02e4 Mon Sep 17 00:00:00 2001 -From: Sricharan Ramabadhran -Date: Mon, 24 Jul 2023 12:04:29 +0530 -Subject: [PATCH] PCI: qcom: Fixing broken pcie enumeration for 2_3_3 configs - ops - -PARF_SLV_ADDR_SPACE_SIZE_2_3_3 macro is used for IPQ8074 2_3_3 post_init. -PCIe slave addr register offset is 0x358, but was wrongly changed to -0x168 as a part of commit 39171b33f652 ("PCI: qcom: Remove PCIE20_ prefix -from register definitions"). Fixing it, by using the right macro and remove -the unused PARF_SLV_ADDR_SPACE_SIZE_2_3_3. - -Without this access to the registers of slave addr space like iATU etc -are broken leading to pcie enumeration failure. - -Fixes: 39171b33f652 ("PCI: qcom: Remove PCIE20_ prefix from register definitions") -Cc: -Reviewed-by: Manivannan Sadhasivam -Reviewed-by: Konrad Dybcio -Signed-off-by: Sricharan Ramabadhran ---- - drivers/pci/controller/dwc/pcie-qcom.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - ---- a/drivers/pci/controller/dwc/pcie-qcom.c -+++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -40,7 +40,6 @@ - #define PARF_PHY_REFCLK 0x4c - #define PARF_CONFIG_BITS 0x50 - #define PARF_DBI_BASE_ADDR 0x168 --#define PARF_SLV_ADDR_SPACE_SIZE_2_3_3 0x16c /* Register offset specific to IP ver 2.3.3 */ - #define PARF_MHI_CLOCK_RESET_CTRL 0x174 - #define PARF_AXI_MSTR_WR_ADDR_HALT 0x178 - #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8 -@@ -1148,8 +1147,7 @@ static int qcom_pcie_post_init_2_3_3(str - u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); - u32 val; - -- writel(SLV_ADDR_SPACE_SZ, -- pcie->parf + PARF_SLV_ADDR_SPACE_SIZE_2_3_3); -+ writel(SLV_ADDR_SPACE_SZ, pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); - - val = readl(pcie->parf + PARF_PHY_CTRL); - val &= ~BIT(0); From f8ea89c2d4727357af4151583a7df633c6c6350d Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 15 Oct 2023 17:29:39 +0200 Subject: [PATCH 60/78] qualcommax: add pending GPLL parent fixes SBL will configure IPQ807x cores to boot at 800MHz as a safe default frequency that is provided by GPLL0, but GPLL0 is not currently configured as a possible parent in the APSS clock driver not being passed to it via DTS which will then cause the kernel to not properly identify the current CPU frequency during booting and will think that CPU is currently at XO frequency of 19.2MHz instead of 800MHz cores are actually at and print: cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 19200 KHz, changing to: 1017600 KHz So, lets import patches pending upstream to prevent GPLL scaling and feed the GPLL0 clock to APSS clock driver so we get: cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 800000 KHz, changing to: 1017600 KHz This is mostly cosmetic fix, but with all of the possible SBL and FW versions there could be edge cases resolved by this and not scaling GPLL-s anymore. Signed-off-by: Robert Marko --- ...-drop-the-CLK_SET_RATE_PARENT-flag-f.patch | 71 +++++++++++++++++++ ...q6018-add-the-GPLL0-clock-also-as-cl.patch | 43 +++++++++++ ...pq8074-include-the-GPLL0-as-clock-pr.patch | 32 +++++++++ 3 files changed, 146 insertions(+) create mode 100644 target/linux/qualcommax/patches-6.1/0131-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch create mode 100644 target/linux/qualcommax/patches-6.1/0132-clk-qcom-apss-ipq6018-add-the-GPLL0-clock-also-as-cl.patch create mode 100644 target/linux/qualcommax/patches-6.1/0133-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch diff --git a/target/linux/qualcommax/patches-6.1/0131-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch b/target/linux/qualcommax/patches-6.1/0131-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch new file mode 100644 index 00000000000..a3e0c20f03a --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0131-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch @@ -0,0 +1,71 @@ +From 007ad475ba7f0d5d4d3e43a06e46a8a46d31c9d2 Mon Sep 17 00:00:00 2001 +From: Kathiravan Thirumoorthy +Date: Thu, 14 Sep 2023 12:29:51 +0530 +Subject: [PATCH] clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from + PLL clocks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GPLL, NSS crypto PLL clock rates are fixed and shouldn't be scaled based +on the request from dependent clocks. Doing so will result in the +unexpected behaviour. So drop the CLK_SET_RATE_PARENT flag from the PLL +clocks. + +Cc: stable@vger.kernel.org +Fixes: b8e7e519625f ("clk: qcom: ipq8074: add remaining PLL’s") +Signed-off-by: Kathiravan Thirumoorthy +--- + drivers/clk/qcom/gcc-ipq8074.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/drivers/clk/qcom/gcc-ipq8074.c ++++ b/drivers/clk/qcom/gcc-ipq8074.c +@@ -76,7 +76,6 @@ static struct clk_fixed_factor gpll0_out + &gpll0_main.clkr.hw }, + .num_parents = 1, + .ops = &clk_fixed_factor_ops, +- .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -122,7 +121,6 @@ static struct clk_alpha_pll_postdiv gpll + &gpll2_main.clkr.hw }, + .num_parents = 1, + .ops = &clk_alpha_pll_postdiv_ro_ops, +- .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -155,7 +153,6 @@ static struct clk_alpha_pll_postdiv gpll + &gpll4_main.clkr.hw }, + .num_parents = 1, + .ops = &clk_alpha_pll_postdiv_ro_ops, +- .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -189,7 +186,6 @@ static struct clk_alpha_pll_postdiv gpll + &gpll6_main.clkr.hw }, + .num_parents = 1, + .ops = &clk_alpha_pll_postdiv_ro_ops, +- .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -202,7 +198,6 @@ static struct clk_fixed_factor gpll6_out + &gpll6_main.clkr.hw }, + .num_parents = 1, + .ops = &clk_fixed_factor_ops, +- .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -267,7 +262,6 @@ static struct clk_alpha_pll_postdiv nss_ + &nss_crypto_pll_main.clkr.hw }, + .num_parents = 1, + .ops = &clk_alpha_pll_postdiv_ro_ops, +- .flags = CLK_SET_RATE_PARENT, + }, + }; + diff --git a/target/linux/qualcommax/patches-6.1/0132-clk-qcom-apss-ipq6018-add-the-GPLL0-clock-also-as-cl.patch b/target/linux/qualcommax/patches-6.1/0132-clk-qcom-apss-ipq6018-add-the-GPLL0-clock-also-as-cl.patch new file mode 100644 index 00000000000..ddd53f9d427 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0132-clk-qcom-apss-ipq6018-add-the-GPLL0-clock-also-as-cl.patch @@ -0,0 +1,43 @@ +From c917237a7cb17b97cc48e073881a9873f3caeaa2 Mon Sep 17 00:00:00 2001 +From: Kathiravan Thirumoorthy +Date: Thu, 14 Sep 2023 12:29:57 +0530 +Subject: [PATCH] clk: qcom: apss-ipq6018: add the GPLL0 clock also as clock + provider + +While the kernel is booting up, APSS PLL will be running at 800MHz with +GPLL0 as source. Once the cpufreq driver is available, APSS PLL will be +configured and select the rate based on the opp table and the source will +be changed to APSS_PLL_EARLY. + +Without this patch, CPU Freq driver reports that CPU is running at 24MHz +instead of the 800MHz. + +Reviewed-by: Konrad Dybcio +Tested-by: Robert Marko +Signed-off-by: Kathiravan Thirumoorthy +--- + drivers/clk/qcom/apss-ipq6018.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/clk/qcom/apss-ipq6018.c ++++ b/drivers/clk/qcom/apss-ipq6018.c +@@ -20,16 +20,19 @@ + + enum { + P_XO, ++ P_GPLL0, + P_APSS_PLL_EARLY, + }; + + static const struct clk_parent_data parents_apcs_alias0_clk_src[] = { + { .fw_name = "xo" }, ++ { .fw_name = "gpll0" }, + { .fw_name = "pll" }, + }; + + static const struct parent_map parents_apcs_alias0_clk_src_map[] = { + { P_XO, 0 }, ++ { P_GPLL0, 4 }, + { P_APSS_PLL_EARLY, 5 }, + }; + diff --git a/target/linux/qualcommax/patches-6.1/0133-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch b/target/linux/qualcommax/patches-6.1/0133-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch new file mode 100644 index 00000000000..693fb6cf2d8 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0133-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch @@ -0,0 +1,32 @@ +From 3b48a7d925a757b3fa53c04baaf68bb8313c3ffb Mon Sep 17 00:00:00 2001 +From: Kathiravan Thirumoorthy +Date: Thu, 14 Sep 2023 12:29:58 +0530 +Subject: [PATCH] arm64: dts: qcom: ipq8074: include the GPLL0 as clock + provider for mailbox + +While the kernel is booting up, APSS PLL will be running at 800MHz with +GPLL0 as source. Once the cpufreq driver is available, APSS PLL will be +configured to the rate based on the opp table and the source also will +be changed to APSS_PLL_EARLY. So allow the mailbox to consume the GPLL0, +with this inclusion, CPU Freq correctly reports that CPU is running at +800MHz rather than 24MHz. + +Signed-off-by: Kathiravan Thirumoorthy +Reviewed-by: Konrad Dybcio +--- + arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi ++++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi +@@ -920,8 +920,8 @@ + apcs_glb: mailbox@b111000 { + compatible = "qcom,ipq8074-apcs-apps-global"; + reg = <0x0b111000 0x1000>; +- clocks = <&a53pll>, <&xo>; +- clock-names = "pll", "xo"; ++ clocks = <&a53pll>, <&xo>, <&gcc GPLL0>; ++ clock-names = "pll", "xo", "gpll0"; + + #clock-cells = <1>; + #mbox-cells = <1>; From 2e57028424d0e914490a80178cd729adb17ba09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Sun, 15 Oct 2023 19:28:51 +0200 Subject: [PATCH 61/78] ramips: fix ZyXEL NR7101 bricking typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A typo snuck in with the addition of Cudy M1800, changing "nr7101" to "nt7101". The result is a default network config for NR7101 without the only ethernet interface on the NR7101, thereby soft bricking it. Fixes: f6d394e9f2fd ("ramips: add support for Cudy M1800") Signed-off-by: Bjørn Mork --- target/linux/ramips/mt7621/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 67fe45f6336..b4c2c6dd68a 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -95,7 +95,7 @@ ramips_setup_interfaces() ;; cudy,m1800|\ yuncore,ax820|\ - zyxel,nt7101) + zyxel,nr7101) ucidef_set_interfaces_lan_wan "lan" "wan" ;; gnubee,gb-pc1) From bea4f5020790611e44670e8b329bcbe5fb592f72 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 15 Oct 2023 16:07:22 +0200 Subject: [PATCH 62/78] mac80211: rt2x00: improve EEPROM load patches Improve EEPROME load patches. Reorganize and rework them. The current patch are bugged and with the case of MTD loading, leaks and never free the EEPROM read values. Also add support for loading EEPROM using NVMEM cells. As a cleanup, change the binding to swap EEPROM read from mtd to ralink,eeprom-swap and generilize it. Signed-off-by: Christian Marangi --- ...upport-for-loading-EEPROM-from-user.patch} | 184 +++++------------- ...option-to-pass-EEPROM-file-name-from.patch | 43 ++++ ...support-for-loading-EEPROM-from-MTD.patch} | 51 +++-- ...i-rt2x00-Support-EEPROM-swap-binding.patch | 44 +++++ ...port-loading-eeprom-from-NVMEM-cells.patch | 96 +++++++++ .../603-rt2x00-of_load_eeprom_filename.patch | 31 --- ...c-loadable-via-OF-on-rt288x-305x-SoC.patch | 2 +- ...t-support-for-external-LNA-on-MT7620.patch | 2 +- ...duce-accessors-for-CHIP_VER-register.patch | 6 +- ...-rework-MT7620-PA-LNA-RF-calibration.patch | 2 +- 10 files changed, 265 insertions(+), 196 deletions(-) rename package/kernel/mac80211/patches/rt2x00/{602-rt2x00-introduce-rt2x00eeprom.patch => 602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch} (54%) create mode 100644 package/kernel/mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch rename package/kernel/mac80211/patches/rt2x00/{604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch => 602-03-wifi-rt2x00-Add-support-for-loading-EEPROM-from-MTD.patch} (63%) create mode 100644 package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch create mode 100644 package/kernel/mac80211/patches/rt2x00/602-05-wifi-rt2x00-support-loading-eeprom-from-NVMEM-cells.patch delete mode 100644 package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch similarity index 54% rename from package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch rename to package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch index 6ef356516fb..5040b5af621 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch @@ -1,3 +1,24 @@ +From 1046fc9e98936991aeb0b0656c84833d96a63c0f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 15 Oct 2023 14:22:49 +0200 +Subject: [PATCH 1/5] wifi: rt2x00: Add support for loading EEPROM from + userspace + +Add support for loading EEPROM from userspace. + +Signed-off-by: Christian Marangi +--- + drivers/net/wireless/ralink/rt2x00/Kconfig | 5 ++ + drivers/net/wireless/ralink/rt2x00/Makefile | 1 + + .../net/wireless/ralink/rt2x00/rt2800soc.c | 15 +--- + drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 + + .../net/wireless/ralink/rt2x00/rt2x00dev.c | 9 +++ + .../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 75 +++++++++++++++++++ + .../net/wireless/ralink/rt2x00/rt2x00soc.c | 1 + + .../net/wireless/ralink/rt2x00/rt2x00soc.h | 9 +++ + 8 files changed, 102 insertions(+), 14 deletions(-) + create mode 100644 drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c + --- a/local-symbols +++ b/local-symbols @@ -350,6 +350,7 @@ RT2X00_LIB_FIRMWARE= @@ -46,33 +67,6 @@ obj-$(CPTCFG_RT2X00_LIB) += rt2x00lib.o obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -@@ -47,6 +47,8 @@ struct rt2800_drv_data { - struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE]; - }; - -+#include "rt2800.h" -+ - struct rt2800_ops { - u32 (*register_read)(struct rt2x00_dev *rt2x00dev, - const unsigned int offset); -@@ -145,6 +147,15 @@ static inline int rt2800_read_eeprom(str - { - const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; - -+ if (rt2x00dev->eeprom_file) { -+ memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, -+ EEPROM_SIZE); -+ return 0; -+ } -+ -+ if (!rt2800ops->read_eeprom) -+ return -EINVAL; -+ - return rt2800ops->read_eeprom(rt2x00dev); - } - --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c @@ -90,19 +90,6 @@ static int rt2800soc_set_device_state(st @@ -95,11 +89,12 @@ /* Firmware functions */ static char *rt2800soc_get_firmware_name(struct rt2x00_dev *rt2x00dev) { -@@ -168,7 +155,6 @@ static const struct rt2800_ops rt2800soc +@@ -168,7 +155,7 @@ static const struct rt2800_ops rt2800soc .register_multiread = rt2x00mmio_register_multiread, .register_multiwrite = rt2x00mmio_register_multiwrite, .regbusy_read = rt2x00mmio_regbusy_read, - .read_eeprom = rt2800soc_read_eeprom, ++ .read_eeprom = rt2x00lib_read_eeprom, .hwcrypt_disabled = rt2800soc_hwcrypt_disabled, .drv_write_firmware = rt2800soc_write_firmware, .drv_init_registers = rt2800mmio_init_registers, @@ -113,77 +108,24 @@ /* * Capabilities -@@ -980,6 +981,11 @@ struct rt2x00_dev { - const struct firmware *fw; - - /* -+ * EEPROM image. -+ */ -+ const struct firmware *eeprom_file; -+ -+ /* - * FIFO for storing tx status reports between isr and tasklet. - */ - DECLARE_KFIFO_PTR(txstatus_fifo, u32); ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -1420,6 +1420,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de - INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup); - INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep); - -+ retval = rt2x00lib_load_eeprom_file(rt2x00dev); -+ if (retval) -+ goto exit; -+ - /* - * Let the driver probe the device to detect the capabilities. - */ -@@ -1560,6 +1564,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ - * Free the driver data. - */ - kfree(rt2x00dev->drv_data); -+ -+ /* -+ * Free EEPROM image. -+ */ -+ rt2x00lib_free_eeprom_file(rt2x00dev); - } - EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev); - --- /dev/null +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -@@ -0,0 +1,106 @@ -+/* -+ Copyright (C) 2004 - 2009 Ivo van Doorn -+ Copyright (C) 2004 - 2009 Gertjan van Wingerde -+ -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the -+ Free Software Foundation, Inc., -+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +@@ -0,0 +1,77 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* Copyright (C) 2004 - 2009 Ivo van Doorn ++ * Copyright (C) 2004 - 2009 Gertjan van Wingerde ++ * + */ + -+/* -+ Module: rt2x00lib -+ Abstract: rt2x00 eeprom file loading routines. ++/* Module: rt2x00lib ++ * Abstract: rt2x00 eeprom file loading routines. + */ + +#include +#include + +#include "rt2x00.h" -+#include "rt2x00lib.h" ++#include "rt2x00soc.h" + +static const char * +rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) @@ -196,7 +138,7 @@ + return NULL; +} + -+static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev) ++static int rt2x00lib_read_eeprom_file(struct rt2x00_dev *rt2x00dev) +{ + const struct firmware *ee; + const char *ee_name; @@ -233,8 +175,7 @@ + goto err_release_ee; + } + -+ rt2x00dev->eeprom_file = ee; -+ return 0; ++ memcpy(rt2x00dev->eeprom, ee->data, rt2x00dev->ops->eeprom_size); + +err_release_ee: + release_firmware(ee); @@ -242,48 +183,11 @@ + return retval; +} + -+int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev) ++int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev) +{ -+ int retval; -+ -+ retval = rt2x00lib_request_eeprom_file(rt2x00dev); -+ if (retval) -+ return retval; -+ -+ return 0; ++ return rt2x00lib_read_eeprom_file(rt2x00dev); +} -+ -+void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev) -+{ -+ if (rt2x00dev->eeprom_file && rt2x00dev->eeprom_file->size) -+ release_firmware(rt2x00dev->eeprom_file); -+ rt2x00dev->eeprom_file = NULL; -+} ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h -@@ -286,6 +286,22 @@ static inline void rt2x00lib_free_firmwa - #endif /* CPTCFG_RT2X00_LIB_FIRMWARE */ - - /* -+ * EEPROM file handlers. -+ */ -+#ifdef CPTCFG_RT2X00_LIB_EEPROM -+int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev); -+void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev); -+#else -+static inline int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev) -+{ -+ return 0; -+} -+static inline void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev) -+{ -+} -+#endif /* CPTCFG_RT2X00_LIB_EEPROM */ -+ -+/* - * Debugfs handlers. - */ - #ifdef CPTCFG_RT2X00_LIB_DEBUGFS ++EXPORT_SYMBOL_GPL(rt2x00lib_read_eeprom); --- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c @@ -86,6 +86,7 @@ int rt2x00soc_probe(struct platform_devi @@ -294,3 +198,19 @@ rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC); retval = rt2x00soc_alloc_reg(rt2x00dev); +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h +@@ -26,4 +26,13 @@ int rt2x00soc_resume(struct platform_dev + #define rt2x00soc_resume NULL + #endif /* CONFIG_PM */ + ++/* ++ * EEPROM file handlers. ++ */ ++#ifdef CPTCFG_RT2X00_LIB_EEPROM ++int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev); ++#else ++#define rt2x00lib_read_eeprom NULL ++#endif /* CPTCFG_RT2X00_LIB_EEPROM */ ++ + #endif /* RT2X00SOC_H */ diff --git a/package/kernel/mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch b/package/kernel/mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch new file mode 100644 index 00000000000..90055b911f0 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch @@ -0,0 +1,43 @@ +From 15329d8b206d9c04ffad49aecd37f5d0bfb85768 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 15 Oct 2023 14:23:19 +0200 +Subject: [PATCH 2/5] wifi: rt2x00: Add option to pass EEPROM file name from DT + +Add option to pass EEPROM file name from DT using ralink,eeprom binding. + +Signed-off-by: Christian Marangi +--- + drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -10,6 +10,7 @@ + + #include + #include ++#include + + #include "rt2x00.h" + #include "rt2x00soc.h" +@@ -18,10 +19,20 @@ static const char * + rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) + { + struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data; ++#ifdef CONFIG_OF ++ struct device_node *np; ++ const char *eep; ++#endif + + if (pdata && pdata->eeprom_file_name) + return pdata->eeprom_file_name; + ++#ifdef CONFIG_OF ++ np = rt2x00dev->dev->of_node; ++ if (np && !of_property_read_string(np, "ralink,eeprom", &eep)) ++ return eep; ++#endif ++ + return NULL; + } + diff --git a/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch b/package/kernel/mac80211/patches/rt2x00/602-03-wifi-rt2x00-Add-support-for-loading-EEPROM-from-MTD.patch similarity index 63% rename from package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch rename to package/kernel/mac80211/patches/rt2x00/602-03-wifi-rt2x00-Add-support-for-loading-EEPROM-from-MTD.patch index 7338eb15b20..6a343db9c72 100644 --- a/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-03-wifi-rt2x00-Add-support-for-loading-EEPROM-from-MTD.patch @@ -1,14 +1,16 @@ -From 339fe73f340161a624cc08e738d2244814852c3e Mon Sep 17 00:00:00 2001 +From 71261ca81b491a4c3b08690347c12e96a75ad0d0 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 17 Mar 2013 00:55:04 +0100 -Subject: [PATCH] rt2x00: load eeprom on SoC from a mtd device defines inside - OF +Subject: [PATCH 3/5] wifi: rt2x00: Add support for loading EEPROM from MTD + +Add support for loading EEPROM from MTD. Signed-off-by: John Crispin +Signed-off-by: Christian Marangi --- - drivers/net/wireless/ralink/rt2x00/Kconfig | 1 + - drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 65 +++++++++++++++++++++++ - 2 files changed, 66 insertions(+) + drivers/net/wireless/ralink/rt2x00/Kconfig | 1 + + .../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 66 +++++++++++++++++++ + 2 files changed, 67 insertions(+) --- a/drivers/net/wireless/ralink/rt2x00/Kconfig +++ b/drivers/net/wireless/ralink/rt2x00/Kconfig @@ -22,7 +24,7 @@ Signed-off-by: John Crispin Supported chips: RT2880, RT3050, RT3052, RT3350, RT3352. --- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -@@ -26,11 +26,76 @@ +@@ -10,11 +10,69 @@ #include #include @@ -33,21 +35,20 @@ Signed-off-by: John Crispin #include #include "rt2x00.h" - #include "rt2x00lib.h" + #include "rt2x00soc.h" +#if IS_ENABLED(CONFIG_MTD) +static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) +{ + int ret = -EINVAL; +#ifdef CONFIG_OF -+ static struct firmware mtd_fw; + struct device_node *np = rt2x00dev->dev->of_node, *mtd_np = NULL; -+ size_t retlen, len = rt2x00dev->ops->eeprom_size; -+ int i, size, offset = 0; ++ int size, offset = 0; + struct mtd_info *mtd; + const char *part; + const __be32 *list; + phandle phandle; ++ size_t retlen; + + list = of_get_property(np, "ralink,mtd-eeprom", &size); + if (!list) @@ -74,21 +75,15 @@ Signed-off-by: John Crispin + if (size > sizeof(*list)) + offset = be32_to_cpup(list); + -+ ret = mtd_read(mtd, offset, len, &retlen, (u_char *) rt2x00dev->eeprom); ++ ret = mtd_read(mtd, offset, rt2x00dev->ops->eeprom_size, ++ &retlen, (u_char *)rt2x00dev->eeprom); + put_mtd_device(mtd); + -+ if ((retlen != rt2x00dev->ops->eeprom_size) || ret) { ++ if (retlen != rt2x00dev->ops->eeprom_size || ret) { + dev_err(rt2x00dev->dev, "failed to load eeprom from device \"%s\"\n", part); + return ret; + } + -+ if (of_find_property(np, "ralink,mtd-eeprom-swap", NULL)) -+ for (i = 0; i < len/sizeof(u16); i++) -+ rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); -+ -+ rt2x00dev->eeprom_file = &mtd_fw; -+ mtd_fw.data = (const u8 *) rt2x00dev->eeprom; -+ + dev_info(rt2x00dev->dev, "loaded eeprom from mtd device \"%s\"\n", part); +#endif + @@ -99,15 +94,17 @@ Signed-off-by: John Crispin static const char * rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) { -@@ -58,6 +123,11 @@ static int rt2x00lib_request_eeprom_file - const char *ee_name; - int retval; +@@ -83,5 +141,13 @@ err_exit: + int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev) + { ++ int ret; ++ +#if IS_ENABLED(CONFIG_MTD) -+ if (!rt2800lib_read_eeprom_mtd(rt2x00dev)) ++ ret = rt2800lib_read_eeprom_mtd(rt2x00dev); ++ if (!ret) + return 0; +#endif + - ee_name = rt2x00lib_get_eeprom_file_name(rt2x00dev); - if (!ee_name && test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags)) { - rt2x00_err(rt2x00dev, "Required EEPROM name is missing."); + return rt2x00lib_read_eeprom_file(rt2x00dev); + } diff --git a/package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch b/package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch new file mode 100644 index 00000000000..392910d224b --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch @@ -0,0 +1,44 @@ +From 9c9a3c27b96e057f3c3f47151d7a170d84e3bb5f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 15 Oct 2023 15:31:47 +0200 +Subject: [PATCH 4/5] wifi: rt2x00: Support EEPROM swap binding + +Add binding "ralink,eeprom-swap" to swap bytes of EEPROM before using +it. + +Signed-off-by: Christian Marangi +--- + drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -20,6 +20,19 @@ + #include "rt2x00soc.h" + + #if IS_ENABLED(CONFIG_MTD) ++static void rt2800lib_eeprom_swap(struct rt2x00_dev *rt2x00dev) ++{ ++ struct device_node *np = rt2x00dev->dev->of_node; ++ size_t len = rt2x00dev->ops->eeprom_size; ++ int i; ++ ++ if (!of_find_property(np, "ralink,eeprom-swap", NULL)) ++ return; ++ ++ for (i = 0; i < len / sizeof(u16); i++) ++ rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); ++} ++ + static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) + { + int ret = -EINVAL; +@@ -66,6 +79,8 @@ static int rt2800lib_read_eeprom_mtd(str + return ret; + } + ++ rt2800lib_eeprom_swap(rt2x00dev); ++ + dev_info(rt2x00dev->dev, "loaded eeprom from mtd device \"%s\"\n", part); + #endif + diff --git a/package/kernel/mac80211/patches/rt2x00/602-05-wifi-rt2x00-support-loading-eeprom-from-NVMEM-cells.patch b/package/kernel/mac80211/patches/rt2x00/602-05-wifi-rt2x00-support-loading-eeprom-from-NVMEM-cells.patch new file mode 100644 index 00000000000..efe6e52720a --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/602-05-wifi-rt2x00-support-loading-eeprom-from-NVMEM-cells.patch @@ -0,0 +1,96 @@ +From 9008cdacdc41f8233f4444b86cf3a17201686e2d Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Tue, 18 Jul 2023 20:18:16 +0800 +Subject: [PATCH 5/5] wifi: rt2x00: support loading eeprom from NVMEM cells + +This patch allows rt2x00 to load eeprom from "eeprom" NVMEM cell. + +Example: + +/* load eeprom from NVMEM provider 'eep' */ +&wmac { + nvmem-cells = <&eep>; + nvmem-cell-names = "eeprom"; +}; + +Signed-off-by: Shiji Yang +Signed-off-by: Christian Marangi +--- + .../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 41 ++++++++++++++++++- + 1 file changed, 40 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -14,12 +14,12 @@ + #include + #include + #endif ++#include + #include + + #include "rt2x00.h" + #include "rt2x00soc.h" + +-#if IS_ENABLED(CONFIG_MTD) + static void rt2800lib_eeprom_swap(struct rt2x00_dev *rt2x00dev) + { + struct device_node *np = rt2x00dev->dev->of_node; +@@ -33,6 +33,7 @@ static void rt2800lib_eeprom_swap(struct + rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); + } + ++#if IS_ENABLED(CONFIG_MTD) + static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) + { + int ret = -EINVAL; +@@ -88,6 +89,40 @@ static int rt2800lib_read_eeprom_mtd(str + } + #endif + ++static int rt2800lib_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev) ++{ ++ struct device_node *np = rt2x00dev->dev->of_node; ++ unsigned int len = rt2x00dev->ops->eeprom_size; ++ struct nvmem_cell *cell; ++ const void *data; ++ size_t retlen; ++ int ret = 0; ++ ++ cell = of_nvmem_cell_get(np, "eeprom"); ++ if (IS_ERR(cell)) ++ return PTR_ERR(cell); ++ ++ data = nvmem_cell_read(cell, &retlen); ++ nvmem_cell_put(cell); ++ ++ if (IS_ERR(data)) ++ return PTR_ERR(data); ++ ++ if (retlen != len) { ++ dev_err(rt2x00dev->dev, "invalid eeprom size, required: 0x%04x\n", len); ++ ret = -EINVAL; ++ goto exit; ++ } ++ ++ memcpy(rt2x00dev->eeprom, data, len); ++ ++ rt2800lib_eeprom_swap(rt2x00dev); ++ ++exit: ++ kfree(data); ++ return ret; ++} ++ + static const char * + rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) + { +@@ -164,5 +199,9 @@ int rt2x00lib_read_eeprom(struct rt2x00_ + return 0; + #endif + ++ ret = rt2800lib_read_eeprom_nvmem(rt2x00dev); ++ if (!ret) ++ return 0; ++ + return rt2x00lib_read_eeprom_file(rt2x00dev); + } diff --git a/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch b/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch deleted file mode 100644 index 431e0902372..00000000000 --- a/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -@@ -26,6 +26,7 @@ - - #include - #include -+#include - - #include "rt2x00.h" - #include "rt2x00lib.h" -@@ -34,10 +35,20 @@ static const char * - rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) - { - struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data; -+#ifdef CONFIG_OF -+ struct device_node *np; -+ const char *eep; -+#endif - - if (pdata && pdata->eeprom_file_name) - return pdata->eeprom_file_name; - -+#ifdef CONFIG_OF -+ np = rt2x00dev->dev->of_node; -+ if (np && of_property_read_string(np, "ralink,eeprom", &eep) == 0) -+ return eep; -+#endif -+ - return NULL; - } - diff --git a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch index 8964f8bf105..c06ed07030e 100644 --- a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch +++ b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c -@@ -225,10 +225,17 @@ static int rt2800soc_probe(struct platfo +@@ -226,10 +226,17 @@ static int rt2800soc_probe(struct platfo return rt2x00soc_probe(pdev, &rt2800soc_ops); } diff --git a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch index 4bb1cf42482..634b677722f 100644 --- a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch @@ -123,7 +123,7 @@ Signed-off-by: Daniel Golle #include #include -@@ -1029,6 +1030,11 @@ struct rt2x00_dev { +@@ -1024,6 +1025,11 @@ struct rt2x00_dev { /* Clock for System On Chip devices. */ struct clk *clk; diff --git a/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch b/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch index 97a56de2b3d..19f1edc928b 100644 --- a/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch +++ b/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -@@ -78,6 +78,9 @@ struct rt2800_ops { +@@ -76,6 +76,9 @@ struct rt2800_ops { int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); __le32 *(*drv_get_txwi)(struct queue_entry *entry); unsigned int (*drv_get_dma_done)(struct data_queue *queue); @@ -10,7 +10,7 @@ }; static inline u32 rt2800_register_read(struct rt2x00_dev *rt2x00dev, -@@ -195,6 +198,27 @@ static inline unsigned int rt2800_drv_ge +@@ -184,6 +187,27 @@ static inline unsigned int rt2800_drv_ge return rt2800ops->drv_get_dma_done(queue); } @@ -104,7 +104,7 @@ static const struct ieee80211_ops rt2800soc_mac80211_ops = { .tx = rt2x00mac_tx, .wake_tx_queue = ieee80211_handle_wake_tx_queue, -@@ -160,6 +187,9 @@ static const struct rt2800_ops rt2800soc +@@ -161,6 +188,9 @@ static const struct rt2800_ops rt2800soc .drv_init_registers = rt2800mmio_init_registers, .drv_get_txwi = rt2800mmio_get_txwi, .drv_get_dma_done = rt2800mmio_get_dma_done, diff --git a/package/kernel/mac80211/patches/rt2x00/998-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch b/package/kernel/mac80211/patches/rt2x00/998-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch index ca1da8a8d28..1eb5ee8aa0f 100644 --- a/package/kernel/mac80211/patches/rt2x00/998-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/998-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch @@ -398,7 +398,7 @@ Signed-off-by: Shiji Yang rt2x00_rt(rt2x00dev, RT3071) || --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h -@@ -1277,6 +1277,12 @@ rt2x00_has_cap_external_lna_bg(struct rt +@@ -1272,6 +1272,12 @@ rt2x00_has_cap_external_lna_bg(struct rt } static inline bool From e0ac782a5e8c3de7cea17ead5bddbf73c77a5d29 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 15 Oct 2023 16:10:58 +0200 Subject: [PATCH 63/78] lantiq: update binding for ralink EEPROM swap Binding for ralink EEPROM swap changed from ralink,mtd-eeprom-swap to ralink,eeprom-swap. Update every entry. Signed-off-by: Christian Marangi --- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts | 2 +- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts | 2 +- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts | 2 +- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts | 2 +- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts | 2 +- .../arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi | 2 +- .../files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts index bb82da0870f..cfa5dba7c6c 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts @@ -154,7 +154,7 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; nvmem-cells = <&macaddr_boardconfig_16>; nvmem-cell-names = "mac-address"; mac-address-increment = <1>; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts index 9d5595b6075..9299f11fe32 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts @@ -178,7 +178,7 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts index c48c9c0e7ba..4f8f941c8b7 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts @@ -198,7 +198,7 @@ compatible = "pci0,0"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts index e91c291e9a7..f0900b56cc5 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts @@ -224,7 +224,7 @@ nvmem-cells = <&macaddr_boardconfig_16>; nvmem-cell-names = "mac-address"; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts index ea932d44b65..8897c9703cd 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts @@ -242,7 +242,7 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; nvmem-cells = <&macaddr_boardconfig_16>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi index 1a7a11db420..1f8ad430c00 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi @@ -220,7 +220,7 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; nvmem-cells = <&macaddr_boardconfig_16>; nvmem-cell-names = "mac-address"; mac-address-increment = <1>; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi index 381c3fc27e2..5e6a6f0c64f 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi @@ -238,7 +238,7 @@ compatible = "pci1814,3091"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; nvmem-cells = <&macaddr_boardconfig_16>; nvmem-cell-names = "mac-address"; mac-address-increment = <1>; From 1c7fd93fc2258dbadbc456faeda7033859b59621 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 16 Oct 2023 19:20:17 +0200 Subject: [PATCH 64/78] qualcommax: ipq8074: use upstreamed CPUFreq NVMEM support IPQ8074 CPUFreq NVMEM support has finally landed upstream, so lets use the upstreamed version. This has a benefit of also supporting IPQ8174 (Oak) family for which SMEM SoC ID-s were also upstreamed. Signed-off-by: Robert Marko --- ...-qcom-ids-Add-IDs-for-IPQ8174-family.patch | 29 ++++++++++++++ ...-qcom-nvmem-add-support-for-IPQ8074.patch} | 40 ++++++++++--------- 2 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 target/linux/qualcommax/patches-6.1/0024-v6.7-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ8174-family.patch rename target/linux/qualcommax/patches-6.1/{0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch => 0025-v6.7-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch} (75%) diff --git a/target/linux/qualcommax/patches-6.1/0024-v6.7-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ8174-family.patch b/target/linux/qualcommax/patches-6.1/0024-v6.7-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ8174-family.patch new file mode 100644 index 00000000000..4eb0f097cc4 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0024-v6.7-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ8174-family.patch @@ -0,0 +1,29 @@ +From 93e161c8f4b9b051e5e746814138cb5520b4b897 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 1 Sep 2023 20:10:04 +0200 +Subject: [PATCH] dt-bindings: arm: qcom,ids: Add IDs for IPQ8174 family + +IPQ8174 (Oak) family is part of the IPQ8074 family, but the ID-s for it +are missing so lets add them. + +Signed-off-by: Robert Marko +Reviewed-by: Kathiravan T +Acked-by: Conor Dooley +Link: https://lore.kernel.org/r/20230901181041.1538999-1-robimarko@gmail.com +Signed-off-by: Bjorn Andersson +--- + include/dt-bindings/arm/qcom,ids.h | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/include/dt-bindings/arm/qcom,ids.h ++++ b/include/dt-bindings/arm/qcom,ids.h +@@ -121,6 +121,9 @@ + #define QCOM_ID_SM6125 394 + #define QCOM_ID_IPQ8070A 395 + #define QCOM_ID_IPQ8071A 396 ++#define QCOM_ID_IPQ8172 397 ++#define QCOM_ID_IPQ8173 398 ++#define QCOM_ID_IPQ8174 399 + #define QCOM_ID_IPQ6018 402 + #define QCOM_ID_IPQ6028 403 + #define QCOM_ID_IPQ6000 421 diff --git a/target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch b/target/linux/qualcommax/patches-6.1/0025-v6.7-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch similarity index 75% rename from target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch rename to target/linux/qualcommax/patches-6.1/0025-v6.7-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch index 09abbfa2e59..61cc2a459bb 100644 --- a/target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch +++ b/target/linux/qualcommax/patches-6.1/0025-v6.7-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch @@ -1,10 +1,11 @@ -From 11592aa862e67f4477dee7e94d5c8244d893de1b Mon Sep 17 00:00:00 2001 +From df75a00c60c6e58bc36e4c63e9d7f1910412b132 Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Sat, 31 Dec 2022 13:03:41 +0100 +Date: Fri, 13 Oct 2023 19:20:02 +0200 Subject: [PATCH] cpufreq: qcom-nvmem: add support for IPQ8074 -IPQ8074 comes in 2 families: +IPQ8074 comes in 3 families: * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz +* IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz So, in order to be able to share one OPP table lets add support for IPQ8074 @@ -14,14 +15,12 @@ IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device will get created by NVMEM CPUFreq driver. Signed-off-by: Robert Marko ---- -Changes in v2: -* Print an error if SMEM ID is not part of the IPQ8074 family -and restrict the speed to Acorn variant (1.4GHz) +Acked-by: Konrad Dybcio +Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt-platdev.c | 1 + - drivers/cpufreq/qcom-cpufreq-nvmem.c | 43 ++++++++++++++++++++++++++++ - 2 files changed, 44 insertions(+) + drivers/cpufreq/qcom-cpufreq-nvmem.c | 48 ++++++++++++++++++++++++++++ + 2 files changed, 49 insertions(+) --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -35,17 +34,19 @@ and restrict the speed to Acorn variant (1.4GHz) { .compatible = "qcom,msm8960", }, --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c -@@ -31,6 +31,9 @@ +@@ -31,6 +31,11 @@ #include -+#define IPQ8074_HAWKEYE_VERSION BIT(0) -+#define IPQ8074_ACORN_VERSION BIT(1) ++enum ipq8074_versions { ++ IPQ8074_HAWKEYE_VERSION = 0, ++ IPQ8074_ACORN_VERSION, ++}; + struct qcom_cpufreq_drv; struct qcom_cpufreq_match_data { -@@ -204,6 +207,41 @@ len_error: +@@ -204,6 +209,44 @@ len_error: return ret; } @@ -65,19 +66,22 @@ and restrict the speed to Acorn variant (1.4GHz) + switch (msm_id) { + case QCOM_ID_IPQ8070A: + case QCOM_ID_IPQ8071A: -+ drv->versions = IPQ8074_ACORN_VERSION; ++ case QCOM_ID_IPQ8172: ++ case QCOM_ID_IPQ8173: ++ case QCOM_ID_IPQ8174: ++ drv->versions = BIT(IPQ8074_ACORN_VERSION); + break; + case QCOM_ID_IPQ8072A: + case QCOM_ID_IPQ8074A: + case QCOM_ID_IPQ8076A: + case QCOM_ID_IPQ8078A: -+ drv->versions = IPQ8074_HAWKEYE_VERSION; ++ drv->versions = BIT(IPQ8074_HAWKEYE_VERSION); + break; + default: + dev_err(cpu_dev, + "SoC ID %u is not part of IPQ8074 family, limiting to 1.4GHz!\n", + msm_id); -+ drv->versions = IPQ8074_ACORN_VERSION; ++ drv->versions = BIT(IPQ8074_ACORN_VERSION); + break; + } + @@ -87,7 +91,7 @@ and restrict the speed to Acorn variant (1.4GHz) static const struct qcom_cpufreq_match_data match_data_kryo = { .get_version = qcom_cpufreq_kryo_name_version, }; -@@ -218,6 +256,10 @@ static const struct qcom_cpufreq_match_d +@@ -218,6 +261,10 @@ static const struct qcom_cpufreq_match_d .genpd_names = qcs404_genpd_names, }; @@ -98,7 +102,7 @@ and restrict the speed to Acorn variant (1.4GHz) static int qcom_cpufreq_probe(struct platform_device *pdev) { struct qcom_cpufreq_drv *drv; -@@ -363,6 +405,7 @@ static const struct of_device_id qcom_cp +@@ -363,6 +410,7 @@ static const struct of_device_id qcom_cp { .compatible = "qcom,msm8996", .data = &match_data_kryo }, { .compatible = "qcom,qcs404", .data = &match_data_qcs404 }, { .compatible = "qcom,ipq8064", .data = &match_data_krait }, From dd43a89f77c812f6675d17bee847ffd16aabd67a Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 14 Oct 2023 08:37:11 +0200 Subject: [PATCH 65/78] binutils: update to 2.41 Release Notes: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00009.html Signed-off-by: Nick Hainke --- package/devel/binutils/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 8547190e99b..3a54a0be92c 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=binutils -PKG_VERSION:=2.40 +PKG_VERSION:=2.41 PKG_RELEASE:=1 PKG_SOURCE_URL:=@GNU/binutils PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_VERSION:=$(PKG_VERSION) -PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1 +PKG_HASH:=ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450 PKG_FIXUP:=patch-libtool PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe From 79e9bdda68985d7754e5fd9f58070947bdacb6d7 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 14 Oct 2023 08:44:53 +0200 Subject: [PATCH 66/78] zlib: update to 1.3 Changes in 1.3 (18 Aug 2023) - Remove K&R function definitions and zlib2ansi - Fix bug in deflateBound() for level 0 and memLevel 9 - Fix bug when gzungetc() is used immediately after gzopen() - Fix bug when using gzflush() with a very small buffer - Fix crash when gzsetparams() attempted for transparent write - Fix test/example.c to work with FORCE_STORED - Rewrite of zran in examples (see zran.c version history) - Fix minizip to allow it to open an empty zip file - Fix reading disk number start on zip64 files in minizip - Fix logic error in minizip argument processing - Add minizip testing to Makefile - Read multiple bytes instead of byte-by-byte in minizip unzip.c - Add memory sanitizer to configure (--memory) - Various portability improvements - Various documentation improvements - Various spelling and typo corrections Signed-off-by: Nick Hainke --- package/libs/zlib/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile index 7031bc974f8..5152c9735ea 100644 --- a/package/libs/zlib/Makefile +++ b/package/libs/zlib/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib -PKG_VERSION:=1.2.13 +PKG_VERSION:=1.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/madler/zlib/releases/download/v$(PKG_VERSION) -PKG_HASH:=d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98 +PKG_HASH:=8a9ba2898e1d0d774eca6ba5b4627a11e5588ba85c8851336eb38de4683050a7 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README From c9e6831a8926ff0ce5be5df99b0c95569c6751cf Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 14 Oct 2023 08:49:29 +0200 Subject: [PATCH 67/78] gmp: update to 6.3 Release Notes: https://gmplib.org/gmp6.3 Signed-off-by: Nick Hainke --- package/libs/gmp/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/gmp/Makefile b/package/libs/gmp/Makefile index 601e4f804de..6bcee784ed8 100644 --- a/package/libs/gmp/Makefile +++ b/package/libs/gmp/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gmp -PKG_VERSION:=6.2.1 +PKG_VERSION:=6.3.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_REVISION).tar.xz PKG_SOURCE_URL:=@GNU/gmp/ -PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 +PKG_HASH:=a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 From 58502650e13d6634d57fe09520ac9773b5eb6dba Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 11:42:08 +0800 Subject: [PATCH 68/78] ramips: convert the remaining mtd-mac-address to NVMEM format `mtd-mac-address` has been abandoned. Therefore, convert them to NVMEM format. This patch also removes some useless mtd-mac-address properties. Signed-off-by: Shiji Yang --- .../ramips/dts/mt7620a_netcore_nw5212.dts | 10 +++++++- .../ramips/dts/mt7620n_netgear_pr2000.dts | 13 +++++++++-- .../dts/mt7628an_comfast_cf-wr617ac.dts | 23 +++++++++++-------- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts index 25287ebc0bc..e4f8c0f1fe8 100644 --- a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts +++ b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts @@ -93,9 +93,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -115,8 +122,9 @@ }; ðernet { - mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; }; &ehci { diff --git a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts index 6b4dde54321..09d70af4c71 100644 --- a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts +++ b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts @@ -110,9 +110,16 @@ }; board_data: partition@f70000 { + compatible = "nvmem-cells"; label = "board_data"; reg = <0xf70000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_board_data_b0: macaddr@b0 { + reg = <0xb0 0x6>; + }; }; partition@f80000 { @@ -166,8 +173,9 @@ }; ðernet { - mtd-mac-address = <&board_data 0xb0>; mediatek,portmap = "wllll"; + nvmem-cells = <&macaddr_board_data_b0>; + nvmem-cell-names = "mac-address"; }; &ehci { @@ -180,7 +188,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; - mtd-mac-address = <&board_data 0xb0>; + nvmem-cells = <&macaddr_board_data_b0>; + nvmem-cell-names = "mac-address"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts index 81734ed4fbf..bec9e951825 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts @@ -70,9 +70,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -94,7 +105,8 @@ reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - mtd-mac-address = < 0x8004>; + nvmem-cells = <&macaddr_factory_8004>; + nvmem-cell-names = "mac-address"; mac-address-increment = <2>; }; }; @@ -112,12 +124,3 @@ status = "okay"; mediatek,mtd-eeprom = <&factory 0x0>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_factory_e000: macaddr@4 { - reg = <0xe000 0x6>; - }; -}; From 7668fc81128cc64daecd90ed6c785bb7943dcbb8 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 11:41:49 +0800 Subject: [PATCH 69/78] ramips: fix DTS EEPROM property for some MT7628 devices The MT7628 integrated wireless is driven by `mt76`, so the right EEPROM property name is `mediatek,mtd-eeprom`. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts | 1 - target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts index 37975659082..f712a280c5c 100644 --- a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts +++ b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts @@ -87,7 +87,6 @@ status = "okay"; mediatek,mtd-eeprom = <&factory 0x0>; - ralink,mtd-eeprom = <&art 0x0>; }; &pcie { diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts index 173bcd992d7..2dd855bf8fd 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts @@ -95,7 +95,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + mediatek,mtd-eeprom = <&factory 0x0>; }; From f35ddef26814b39e829c6e44d94e160bfe8bd7a2 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 11:54:59 +0800 Subject: [PATCH 70/78] ramips: fix mtd partition node names for Phicomm PSG1208 The mtd partition node name should be "partition@${offset}". However, the offsets of the PSG1208 don't match the partition 'reg' properties. This patch correct the wrong offsets. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts index 4e123c32bde..fc4f1d62585 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts @@ -67,19 +67,19 @@ read-only; }; - partition@20000 { + partition@30000 { label = "u-boot-env"; reg = <0x30000 0x10000>; read-only; }; - factory: partition@30000 { + factory: partition@40000 { label = "factory"; reg = <0x40000 0x10000>; read-only; }; - partition@40000 { + partition@50000 { compatible = "denx,uimage"; label = "firmware"; reg = <0x50000 0x7b0000>; From da42c329c6c73b5f4eb40f894195c488ba76d76b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 10:12:02 +0800 Subject: [PATCH 71/78] ramips: convert rt2x00 EEPROM to NVMEM format This patch converts legacy Ralink SoCs and MT7620 WiFi calibration data to NVMEM format. The EEPROM size is 0x200. Signed-off-by: Shiji Yang --- .../ramips/dts/mt7620a_aigale_ai-br100.dts | 24 ++++++------ .../dts/mt7620a_alfa-network_ac1200rm.dts | 24 ++++++------ .../dts/mt7620a_alfa-network_r36m-e4g.dts | 24 ++++++------ .../linux/ramips/dts/mt7620a_asus_rp-n53.dts | 17 ++++++++- .../ramips/dts/mt7620a_asus_rt-ac5x.dtsi | 24 ++++++------ .../ramips/dts/mt7620a_bdcom_wap2100-sk.dts | 24 ++++++------ .../ramips/dts/mt7620a_buffalo_whr-1166d.dts | 24 ++++++------ .../ramips/dts/mt7620a_buffalo_whr-300hp2.dts | 24 ++++++------ .../ramips/dts/mt7620a_buffalo_whr-600d.dts | 31 +++++++++------ .../linux/ramips/dts/mt7620a_cameo_810.dtsi | 27 +++++++------ .../ramips/dts/mt7620a_dlink_dch-m225.dts | 24 ++++++------ .../ramips/dts/mt7620a_dlink_dir-806a-b1.dts | 34 ++++++++--------- target/linux/ramips/dts/mt7620a_domywifi.dtsi | 24 ++++++------ .../dts/mt7620a_edimax_br-6208ac-v2.dts | 32 ++++++++-------- .../dts/mt7620a_edimax_br-6478ac-v2.dts | 24 ++++++------ .../ramips/dts/mt7620a_edimax_ew-7478apc.dts | 24 ++++++------ .../ramips/dts/mt7620a_edimax_ew-747x.dtsi | 26 ++++++------- .../ramips/dts/mt7620a_engenius_epg600.dts | 34 +++++++++++------ .../ramips/dts/mt7620a_engenius_esr600.dts | 34 +++++++++++------ .../linux/ramips/dts/mt7620a_fon_fon2601.dts | 24 ++++++------ .../ramips/dts/mt7620a_glinet_gl-mt300a.dts | 24 ++++++------ .../ramips/dts/mt7620a_glinet_gl-mt300n.dts | 24 ++++++------ .../ramips/dts/mt7620a_glinet_gl-mt750.dts | 24 ++++++------ .../dts/mt7620a_head-weblink_hdrm200.dts | 24 ++++++------ .../ramips/dts/mt7620a_hiwifi_hc5x61.dtsi | 24 ++++++------ target/linux/ramips/dts/mt7620a_hnet_c108.dts | 24 ++++++------ target/linux/ramips/dts/mt7620a_humax_e2.dts | 12 ++++-- .../ramips/dts/mt7620a_iodata_wn-ac1167gr.dts | 24 ++++++------ .../ramips/dts/mt7620a_iodata_wn-ac733gr3.dts | 24 ++++++------ target/linux/ramips/dts/mt7620a_iptime.dtsi | 25 ++++++------ .../ramips/dts/mt7620a_kimax_u25awf-h1.dts | 24 ++++++------ .../ramips/dts/mt7620a_lb-link_bl-w1200.dts | 24 ++++++------ .../ramips/dts/mt7620a_lenovo_newifi-y1.dts | 10 ----- .../ramips/dts/mt7620a_lenovo_newifi-y1.dtsi | 15 +++++++- .../ramips/dts/mt7620a_lenovo_newifi-y1s.dts | 10 ----- .../ramips/dts/mt7620a_linksys_e1700.dts | 24 ++++++------ .../dts/mt7620a_microduino_microwrt.dts | 24 ++++++------ .../ramips/dts/mt7620a_netcore_nw5212.dts | 7 +++- .../ramips/dts/mt7620a_netgear_ex2700.dts | 35 +++++++++-------- .../dts/mt7620a_netgear_ex3x00_ex61xx.dtsi | 23 ++++++----- .../ramips/dts/mt7620a_netgear_wn3x00rp.dtsi | 35 +++++++++-------- .../linux/ramips/dts/mt7620a_netis_wf2770.dts | 24 ++++++------ .../ramips/dts/mt7620a_ohyeah_oy-0001.dts | 24 ++++++------ .../linux/ramips/dts/mt7620a_phicomm_k2x.dtsi | 24 ++++++------ .../ramips/dts/mt7620a_phicomm_psg1208.dts | 24 ++++++------ .../ramips/dts/mt7620a_planex_cs-qr10.dts | 24 ++++++------ .../ramips/dts/mt7620a_planex_db-wrt01.dts | 24 ++++++------ .../ramips/dts/mt7620a_planex_mzk-750dhp.dts | 24 ++++++------ .../ramips/dts/mt7620a_planex_mzk-ex300np.dts | 24 ++++++------ .../ramips/dts/mt7620a_planex_mzk-ex750np.dts | 24 ++++++------ .../ramips/dts/mt7620a_sanlinking_d240.dts | 24 ++++++------ .../dts/mt7620a_sitecom_wlr-4100-v1-002.dts | 24 ++++++------ .../dts/mt7620a_tplink_archer-c2-v1.dts | 29 +++++++------- .../dts/mt7620a_tplink_archer-mr200.dts | 27 +++++++------ .../ramips/dts/mt7620a_tplink_archer.dtsi | 27 +++++++------ .../ramips/dts/mt7620a_tplink_re2x0-v1.dtsi | 29 +++++++------- .../dts/mt7620a_wavlink_wl-wn530hg4.dts | 25 ++++++------ .../ramips/dts/mt7620a_wavlink_wl-wn535k1.dts | 12 ++++-- .../ramips/dts/mt7620a_wavlink_wl-wn579x3.dts | 24 ++++++------ .../linux/ramips/dts/mt7620a_wevo_air-duo.dts | 13 ++++--- .../ramips/dts/mt7620a_xiaomi_miwifi-mini.dts | 25 ++++++------ .../linux/ramips/dts/mt7620a_youku_yk-l1.dtsi | 25 ++++++------ .../linux/ramips/dts/mt7620a_yukai_bocco.dts | 24 ++++++------ .../dts/mt7620a_zbtlink_zbt-ape522ii.dts | 25 ++++++------ .../dts/mt7620a_zbtlink_zbt-we1026.dtsi | 24 ++++++------ .../ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi | 24 ++++++------ target/linux/ramips/dts/mt7620a_zte_q7.dts | 24 ++++++------ .../dts/mt7620a_zyxel_keenetic-viva.dts | 24 ++++++------ .../linux/ramips/dts/mt7620n_asus_rt-n12p.dts | 24 ++++++------ .../linux/ramips/dts/mt7620n_asus_rt-n14u.dts | 24 ++++++------ .../ramips/dts/mt7620n_buffalo_wmr-300.dts | 24 ++++++------ .../ramips/dts/mt7620n_comfast_cf-wr800n.dts | 24 ++++++------ .../ramips/dts/mt7620n_elecom_wrh-300cr.dts | 24 ++++++------ .../linux/ramips/dts/mt7620n_kimax_u35wf.dts | 24 ++++++------ .../ramips/dts/mt7620n_kingston_mlw221.dts | 24 ++++++------ .../ramips/dts/mt7620n_kingston_mlwg2.dts | 24 ++++++------ .../ramips/dts/mt7620n_netgear_n300.dtsi | 24 ++++++------ .../ramips/dts/mt7620n_netgear_pr2000.dts | 12 ++++-- .../linux/ramips/dts/mt7620n_nexx_wt3020.dtsi | 24 ++++++------ .../ramips/dts/mt7620n_snr_cpe-w4n-mt.dts | 10 ++++- .../ramips/dts/mt7620n_sunvalley_filehub.dtsi | 24 ++++++------ .../ramips/dts/mt7620n_vonets_var11n-300.dts | 24 ++++++------ .../ramips/dts/mt7620n_wrtnode_wrtnode.dts | 24 ++++++------ .../ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts | 24 ++++++------ .../ramips/dts/mt7620n_zbtlink_zbt-wa05.dts | 24 ++++++------ .../ramips/dts/mt7620n_zbtlink_zbt-we2026.dts | 24 ++++++------ .../dts/mt7620n_zbtlink_zbt-wr8305rt.dts | 24 ++++++------ .../dts/mt7620n_zyxel_keenetic-lite-iii-a.dts | 10 ++++- .../dts/mt7620n_zyxel_keenetic-omni-ii.dts | 24 ++++++------ .../dts/mt7620n_zyxel_keenetic-omni.dts | 24 ++++++------ .../ramips/dts/mt7621_buffalo_wsr-600dhp.dts | 7 +++- .../ramips/dts/rt2880_airlink101_ar670w.dts | 26 +++++++------ .../ramips/dts/rt2880_airlink101_ar725w.dts | 26 +++++++------ .../linux/ramips/dts/rt2880_asus_rt-n15.dts | 24 ++++++------ .../ramips/dts/rt2880_belkin_f5d8235-v1.dts | 24 ++++++------ .../dts/rt2880_buffalo_wli-tx4-ag300n.dts | 24 ++++++------ .../dts/rt2880_buffalo_wzr-agl300nh.dts | 24 ++++++------ .../ramips/dts/rt2880_dlink_dap-1522-a1.dts | 24 ++++++------ .../ramips/dts/rt2880_ralink_v11st-fe.dts | 12 +++++- .../ramips/dts/rt3050_8devices_carambola.dts | 24 ++++++------ .../ramips/dts/rt3050_allnet_all0256n.dtsi | 24 ++++++------ .../dts/rt3050_alphanetworks_asl26555-16m.dts | 21 +++++----- .../dts/rt3050_alphanetworks_asl26555-8m.dts | 21 +++++----- .../dts/rt3050_alphanetworks_asl26555.dtsi | 3 +- .../dts/rt3050_arcwireless_freestation5.dts | 24 ++++++------ .../ramips/dts/rt3050_asus_rt-g32-b1.dts | 24 ++++++------ .../ramips/dts/rt3050_asus_rt-n10-plus.dts | 24 ++++++------ .../linux/ramips/dts/rt3050_asus_wl-330n.dts | 24 ++++++------ .../ramips/dts/rt3050_asus_wl-330n3g.dts | 24 ++++++------ .../linux/ramips/dts/rt3050_dlink_dcs-930.dts | 24 ++++++------ .../ramips/dts/rt3050_dlink_dir-300-b1.dts | 24 ++++++------ .../ramips/dts/rt3050_dlink_dir-600-b1.dts | 24 ++++++------ .../ramips/dts/rt3050_dlink_dir-615-d.dts | 10 ++++- .../ramips/dts/rt3050_dlink_dir-620-a1.dts | 24 ++++++------ .../ramips/dts/rt3050_edimax_3g-6200n.dts | 24 ++++++------ .../ramips/dts/rt3050_edimax_3g-6200nl.dts | 24 ++++++------ .../linux/ramips/dts/rt3050_huawei_d105.dts | 24 ++++++------ .../linux/ramips/dts/rt3050_jcg_jhr-n805r.dts | 24 ++++++------ .../linux/ramips/dts/rt3050_netcore_nw718.dts | 24 ++++++------ .../ramips/dts/rt3050_sparklan_wcr-150gn.dts | 24 ++++++------ .../ramips/dts/rt3050_teltonika_rut5xx.dts | 24 ++++++------ .../linux/ramips/dts/rt3050_tenda_w150m.dts | 24 ++++++------ .../dts/rt3050_trendnet_tew-638apb-v2.dts | 24 ++++++------ .../linux/ramips/dts/rt3052_accton_wr6202.dts | 24 ++++++------ .../ramips/dts/rt3052_alfa-network_w502u.dts | 24 ++++++------ .../linux/ramips/dts/rt3052_argus_atp-52b.dts | 24 ++++++------ .../ramips/dts/rt3052_asiarf_awapn2403.dts | 10 ++++- .../linux/ramips/dts/rt3052_asus_rt-n13u.dts | 24 ++++++------ .../ramips/dts/rt3052_aximcom_mr-102n.dts | 24 ++++++------ .../ramips/dts/rt3052_aztech_hw550-3g.dts | 24 ++++++------ .../ramips/dts/rt3052_belkin_f5d8235-v2.dts | 24 ++++++------ .../ramips/dts/rt3052_buffalo_whr-g300n.dts | 24 ++++++------ .../ramips/dts/rt3052_dlink_dap-1350.dts | 24 ++++++------ .../ramips/dts/rt3052_engenius_esr-9753.dts | 24 ++++++------ .../ramips/dts/rt3052_fon_fonera-20n.dts | 24 ++++++------ .../ramips/dts/rt3052_hauppauge_broadway.dts | 24 ++++++------ .../linux/ramips/dts/rt3052_huawei_hg255d.dts | 24 ++++++------ .../linux/ramips/dts/rt3052_jcg_jhr-n825r.dts | 24 ++++++------ .../linux/ramips/dts/rt3052_jcg_jhr-n926r.dts | 24 ++++++------ .../dts/rt3052_mofinetwork_mofi3500-3gn.dts | 10 ++++- .../ramips/dts/rt3052_netgear_wnce2001.dts | 24 ++++++------ .../linux/ramips/dts/rt3052_nexaira_bc2.dts | 24 ++++++------ .../ramips/dts/rt3052_omnima_miniembwifi.dts | 24 ++++++------ .../ramips/dts/rt3052_petatel_psr-680w.dts | 24 ++++++------ .../ramips/dts/rt3052_planex_mzk-w300nh2.dts | 24 ++++++------ .../ramips/dts/rt3052_planex_mzk-wdpr.dts | 24 ++++++------ .../ramips/dts/rt3052_prolink_pwh2004.dts | 10 ++++- .../ramips/dts/rt3052_ralink_v22rw-2x2.dts | 10 ++++- .../ramips/dts/rt3052_sitecom_wl-351.dts | 24 ++++++------ .../ramips/dts/rt3052_skyline_sl-r7205.dts | 24 ++++++------ .../linux/ramips/dts/rt3052_tenda_3g300m.dts | 24 ++++++------ .../ramips/dts/rt3052_tenda_w306r-v2.dts | 24 ++++++------ .../dts/rt3052_unbranded_wr512-3gn-4m.dts | 7 ++++ .../dts/rt3052_unbranded_wr512-3gn-8m.dts | 7 ++++ .../dts/rt3052_unbranded_wr512-3gn.dtsi | 3 +- .../dts/rt3052_unbranded_xdx-rn502j.dts | 24 ++++++------ .../ramips/dts/rt3052_upvel_ur-326n4g.dts | 24 ++++++------ .../ramips/dts/rt3052_upvel_ur-336un.dts | 24 ++++++------ .../ramips/dts/rt3052_zyxel_keenetic.dts | 24 ++++++------ .../ramips/dts/rt3052_zyxel_nbg-419n.dts | 24 ++++++------ .../ramips/dts/rt3352_allnet_all5002.dts | 24 ++++++------ .../ramips/dts/rt3352_dlink_dir-615-h1.dts | 24 ++++++------ .../ramips/dts/rt3352_dlink_dir-620-d1.dts | 24 ++++++------ .../linux/ramips/dts/rt3352_zte_mf283plus.dts | 24 ++++++------ .../ramips/dts/rt3352_zyxel_nbg-419n-v2.dts | 24 ++++++------ .../linux/ramips/dts/rt3662_asus_rt-n56u.dts | 33 +++++++++------- .../linux/ramips/dts/rt3662_dlink_dir-645.dts | 24 ++++++------ .../ramips/dts/rt3662_edimax_br-6475nd.dts | 38 ++++++++++++------- .../ramips/dts/rt3662_engenius_esr600h.dts | 17 ++++++++- .../ramips/dts/rt3662_loewe_wmdr-143n.dts | 10 ++++- target/linux/ramips/dts/rt3662_omnima_hpm.dts | 26 +++++++------ .../ramips/dts/rt3662_samsung_cy-swr1100.dts | 17 ++++++++- .../ramips/dts/rt3883_belkin_f9k110x.dtsi | 17 ++++++++- .../ramips/dts/rt3883_sitecom_wlr-6000.dts | 31 +++++++++------ .../ramips/dts/rt3883_trendnet_tew-691gr.dts | 28 +++++++------- .../ramips/dts/rt3883_trendnet_tew-692gr.dts | 28 +++++++------- .../ramips/dts/rt5350_7links_px-4885.dtsi | 24 ++++++------ .../ramips/dts/rt5350_airlive_air3gii.dts | 24 ++++++------ .../ramips/dts/rt5350_allnet_all5003.dts | 24 ++++++------ .../ramips/dts/rt5350_asiarf_awm002-evb.dtsi | 24 ++++++------ .../linux/ramips/dts/rt5350_belkin_f7c027.dts | 10 ++++- .../ramips/dts/rt5350_dlink_dcs-930l-b1.dts | 24 ++++++------ .../ramips/dts/rt5350_dlink_dir-300-b7.dts | 24 ++++++------ .../ramips/dts/rt5350_dlink_dir-320-b1.dts | 24 ++++++------ .../ramips/dts/rt5350_dlink_dir-610-a1.dts | 24 ++++++------ .../ramips/dts/rt5350_dlink_dwr-512-b.dts | 26 ++++++------- .../ramips/dts/rt5350_easyacc_wizard-8800.dts | 24 ++++++------ .../linux/ramips/dts/rt5350_hame_mpr-a1.dts | 24 ++++++------ .../linux/ramips/dts/rt5350_hame_mpr-a2.dts | 24 ++++++------ .../ramips/dts/rt5350_hilink_hlk-rm04.dts | 24 ++++++------ .../ramips/dts/rt5350_hootoo_ht-tm02.dts | 24 ++++++------ .../ramips/dts/rt5350_intenso_memory2move.dts | 24 ++++++------ .../linux/ramips/dts/rt5350_nexx_wt1520.dtsi | 24 ++++++------ .../linux/ramips/dts/rt5350_nixcore_x1.dtsi | 24 ++++++------ .../dts/rt5350_olimex_rt5350f-olinuxino.dtsi | 24 ++++++------ .../ramips/dts/rt5350_omnima_miniembplug.dts | 24 ++++++------ .../ramips/dts/rt5350_planex_mzk-dp150n.dts | 24 ++++++------ target/linux/ramips/dts/rt5350_poray_m3.dts | 24 ++++++------ target/linux/ramips/dts/rt5350_poray_m4.dtsi | 24 ++++++------ target/linux/ramips/dts/rt5350_poray_x5.dts | 24 ++++++------ target/linux/ramips/dts/rt5350_poray_x8.dts | 24 ++++++------ .../linux/ramips/dts/rt5350_tenda_3g150b.dts | 24 ++++++------ .../ramips/dts/rt5350_trendnet_tew-714tru.dts | 24 ++++++------ .../ramips/dts/rt5350_unbranded_a5-v11.dts | 24 ++++++------ .../ramips/dts/rt5350_vocore_vocore.dtsi | 24 ++++++------ .../ramips/dts/rt5350_wansview_ncs601w.dts | 24 ++++++------ .../ramips/dts/rt5350_wiznet_wizfi630a.dts | 25 ++++++------ .../ramips/dts/rt5350_zorlik_zl5900v2.dts | 24 ++++++------ .../ramips/dts/rt5350_zyxel_keenetic-4g-b.dts | 24 ++++++------ .../dts/rt5350_zyxel_keenetic-lite-b.dts | 24 ++++++------ .../dts/rt5350_zyxel_keenetic-start.dts | 24 ++++++------ 211 files changed, 2696 insertions(+), 2141 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts index 1142746c7af..7dd58b698f9 100644 --- a/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts +++ b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts @@ -73,9 +73,20 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@40000 { @@ -110,15 +121,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts index 19b6d5fdfba..2b9434b2448 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts @@ -132,9 +132,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -147,15 +158,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts index 09afc018e8d..becf5ba90cd 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts @@ -189,9 +189,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -208,15 +219,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts index 4c72c642724..00fcb5ec42e 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts @@ -120,9 +120,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -143,7 +154,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -167,6 +179,7 @@ compatible = "pci1814,5592"; reg = <0x0000 0 0 0 0>; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi index f61843095d5..20dab4f09fd 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi @@ -79,9 +79,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -129,19 +140,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts index b95a428656e..8788d9d93b6 100644 --- a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts +++ b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts @@ -82,9 +82,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -124,7 +135,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -145,13 +157,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts index f71545815d6..892bd73502b 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts @@ -114,9 +114,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -159,7 +170,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -174,13 +186,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts index 4b960da312b..6e48763fe01 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts @@ -114,9 +114,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -146,18 +157,9 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts index d943e3abef7..14900c432ad 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts @@ -114,9 +114,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -146,7 +161,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -157,16 +173,7 @@ wifi@0,0 { compatible = "pci1814,5592"; reg = <0x0000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi index d0113f55603..c25db1d9d83 100644 --- a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi +++ b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi @@ -81,9 +81,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; factory5g: partition@50000 { @@ -141,10 +152,8 @@ pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -161,13 +170,3 @@ mac-address-increment = <2>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts index 2884bfdb046..f0d96f8a435 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts @@ -119,9 +119,20 @@ }; factory: partition@34000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x34000 0x4000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; nvram: partition@38000 { @@ -173,18 +184,9 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts index b7fc063b7fb..995255ee8ad 100755 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts @@ -91,9 +91,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; partition@50000 { @@ -124,9 +139,8 @@ pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - ralink,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; @@ -149,17 +163,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_domywifi.dtsi b/target/linux/ramips/dts/mt7620a_domywifi.dtsi index 9a96b0a2759..3336f9c6c51 100644 --- a/target/linux/ramips/dts/mt7620a_domywifi.dtsi +++ b/target/linux/ramips/dts/mt7620a_domywifi.dtsi @@ -114,9 +114,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -175,15 +186,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts index 5f1c01b35e9..5a311ba895e 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts @@ -141,9 +141,24 @@ // Factory factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; // Cimage @@ -187,7 +202,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -201,17 +217,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts index cc902888bae..8e2030a5072 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts @@ -99,9 +99,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -183,7 +194,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -205,13 +217,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts index bc73c197c0d..ea8b8c9121c 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts @@ -91,9 +91,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -175,7 +186,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -197,13 +209,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi index abac0208d07..d5db3958d80 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -174,9 +185,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -193,13 +203,3 @@ mac-address-increment = <2>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_engenius_epg600.dts b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts index 311103f3e86..bf4c4347ded 100644 --- a/target/linux/ramips/dts/mt7620a_engenius_epg600.dts +++ b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts @@ -116,15 +116,33 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; rf: partition@50000 { + compatible = "nvmem-cells"; label = "rf"; reg = <0x50000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_rf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@60000 { @@ -194,12 +212,14 @@ wifi@0,1,0 { compatible = "pci1814,3091"; reg = <0x0 1 0 0 0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - ralink,mtd-eeprom = <&rf 0x0>; + nvmem-cells = <&eeprom_rf_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -216,13 +236,3 @@ function = "gpio"; }; }; - -&rf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rf_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts index 267525a0fce..37b06580824 100644 --- a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts +++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts @@ -98,15 +98,33 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; iNIC_rf: partition@50000 { + compatible = "nvmem-cells"; label = "iNIC_rf"; reg = <0x50000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_iNIC_rf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@60000 { @@ -179,12 +197,14 @@ wifi@0,0 { compatible = "pci1814,5592"; reg = <0x0 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - ralink,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -194,13 +214,3 @@ &ohci { status = "okay"; }; - -&iNIC_rf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_iNIC_rf_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts index 8f95204ad19..ff6844060e9 100644 --- a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts +++ b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts @@ -77,9 +77,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -142,7 +153,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>, <&wled_pins>; @@ -168,13 +180,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts index 9c9b3d3bf9f..939ced87c04 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts @@ -95,9 +95,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x4000 0x6>; + }; }; partition@50000 { @@ -134,7 +145,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -143,13 +155,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts index 70d0827ed2b..e261f1c4bb5 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts @@ -90,9 +90,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x4000 0x6>; + }; }; partition@50000 { @@ -125,7 +136,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -134,13 +146,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts index 9ee19686b76..869453fe750 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts @@ -90,9 +90,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x4000 0x6>; + }; }; partition@50000 { @@ -129,7 +140,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -149,13 +161,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts index 10c9958e0a6..d2ff424bcfd 100644 --- a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts +++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts @@ -82,9 +82,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware: partition@50000 { @@ -156,7 +167,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -183,13 +195,3 @@ &uart { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi index 4c24857df1d..508d60f6b68 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi @@ -52,9 +52,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -96,7 +107,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -105,13 +117,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_hnet_c108.dts b/target/linux/ramips/dts/mt7620a_hnet_c108.dts index 4c241a84de7..5f97eb61b1c 100644 --- a/target/linux/ramips/dts/mt7620a_hnet_c108.dts +++ b/target/linux/ramips/dts/mt7620a_hnet_c108.dts @@ -109,9 +109,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -141,7 +152,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -154,13 +166,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_humax_e2.dts b/target/linux/ramips/dts/mt7620a_humax_e2.dts index 2a2ad9043d8..92e4d58be7d 100644 --- a/target/linux/ramips/dts/mt7620a_humax_e2.dts +++ b/target/linux/ramips/dts/mt7620a_humax_e2.dts @@ -88,13 +88,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x30000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; macaddr_factory_10007: macaddr@10007 { reg = <0x10007 0x6>; @@ -131,7 +134,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts index 5eca06fcb93..eacfcc152f3 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts @@ -91,9 +91,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x8000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; iNIC_rf: partition@48000 { @@ -209,15 +220,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts index 9997e5cecf3..d7ef17abbc2 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts @@ -105,9 +105,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x8000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; iNIC_rf: partition@48000 { @@ -187,15 +198,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_iptime.dtsi b/target/linux/ramips/dts/mt7620a_iptime.dtsi index 26727893715..f5e33850ca1 100644 --- a/target/linux/ramips/dts/mt7620a_iptime.dtsi +++ b/target/linux/ramips/dts/mt7620a_iptime.dtsi @@ -29,9 +29,20 @@ #size-cells = <1>; uboot: partition@0 { + compatible = "nvmem-cells"; label = "u-boot"; reg = <0x0 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_uboot_1f400: eeprom@1f400 { + reg = <0x1f400 0x200>; + }; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; }; partition@20000 { @@ -82,16 +93,6 @@ &wmac { pinctrl-names = "default"; pinctrl-0 = <&wled_pins>; - - ralink,mtd-eeprom = <&uboot 0x1f400>; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; + nvmem-cells = <&eeprom_uboot_1f400>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts index 87e6222c534..fbd4f9ff47f 100644 --- a/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts +++ b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts @@ -73,9 +73,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -101,7 +112,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -110,13 +122,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts index 5368f939a2b..4c0ce75281e 100644 --- a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts +++ b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts @@ -65,9 +65,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -141,7 +152,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -169,13 +181,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts index bff117b7295..24b79711c5e 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts @@ -58,13 +58,3 @@ mediatek,portmap = "llllw"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi index 5e834d291dc..0360cff26fc 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi @@ -55,9 +55,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -93,8 +104,8 @@ pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts index 2b59351bd89..f1d2c873371 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts @@ -115,13 +115,3 @@ mediatek,port4-gmac; mediatek,ephy-base = /bits/ 8 <8>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts index 862f28e399f..221da9ec0f6 100644 --- a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts +++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts @@ -76,9 +76,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -150,15 +161,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts index ceecafa0669..e260b5b8e81 100644 --- a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts +++ b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts @@ -54,9 +54,20 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@40000 { @@ -87,7 +98,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -96,13 +108,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts index e4f8c0f1fe8..cf2b1f6a65b 100644 --- a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts +++ b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts @@ -100,6 +100,10 @@ #size-cells = <1>; read-only; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -136,5 +140,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts index e09d9c607b8..e4d280e35de 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts +++ b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts @@ -112,9 +112,24 @@ }; art: partition@3f0000 { + compatible = "nvmem-cells"; label = "art"; reg = <0x3f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; }; }; }; @@ -126,10 +141,8 @@ }; &wmac { - ralink,mtd-eeprom = <&art 0x1000>; - - nvmem-cells = <&macaddr_art_6>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_art_1000>, <&macaddr_art_6>; + nvmem-cell-names = "eeprom", "mac-address"; }; &state_default { @@ -138,17 +151,3 @@ function = "gpio"; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi index 6884bf7943a..c6f95b4c770 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi +++ b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi @@ -98,9 +98,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -142,7 +153,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -152,12 +164,3 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi b/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi index 914d4e6bba4..23cfe9e11a8 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi +++ b/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi @@ -116,9 +116,24 @@ }; art: partition@7f0000 { + compatible = "nvmem-cells"; label = "art"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; }; }; }; @@ -130,10 +145,8 @@ }; &wmac { - ralink,mtd-eeprom = <&art 0x1000>; - - nvmem-cells = <&macaddr_art_6>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_art_1000>, <&macaddr_art_6>; + nvmem-cell-names = "eeprom", "mac-address"; }; &state_default { @@ -142,17 +155,3 @@ function = "gpio"; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts index 2a0e52cee26..f768ac21141 100644 --- a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts +++ b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts @@ -74,9 +74,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -161,15 +172,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts index a691f4203fe..90ced171c16 100644 --- a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts +++ b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts @@ -73,9 +73,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -105,7 +116,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &sdhci { @@ -119,13 +131,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi b/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi index a8a900eac19..e8aed7e2851 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi +++ b/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi @@ -69,9 +69,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; }; @@ -102,15 +113,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts index fc4f1d62585..13230a9c43b 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts @@ -74,9 +74,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -118,15 +129,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts index e095401c4e6..a4c99d35c49 100644 --- a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts +++ b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -136,15 +147,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts index 7d875c24fcb..a2238354b29 100644 --- a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts +++ b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts @@ -64,9 +64,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -96,15 +107,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts index bfa4dac6f1b..2f14d39ac1d 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts @@ -84,9 +84,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -116,7 +127,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -129,13 +141,3 @@ mediatek,mtd-eeprom = <&factory 0x8000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts index ab53f678f5c..62ca8eddc09 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts @@ -99,9 +99,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -136,15 +147,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts index 6fc95214a29..41ea54ba2d5 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts @@ -104,9 +104,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -141,7 +152,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -154,13 +166,3 @@ mediatek,mtd-eeprom = <&factory 0x8000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts index 6b1edabc1ab..a9c75e187fb 100644 --- a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts +++ b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts @@ -111,9 +111,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -147,7 +158,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -174,13 +186,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts b/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts index 614a6103b84..3c7df99cffe 100644 --- a/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts +++ b/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts @@ -103,9 +103,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -175,7 +186,8 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -184,13 +196,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts index 63643927d51..4bce556de85 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts @@ -106,9 +106,16 @@ }; rom: partition@7d0000 { + compatible = "nvmem-cells"; label = "rom"; reg = <0x7d0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_rom_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; partition@7e0000 { @@ -118,9 +125,16 @@ }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; }; @@ -164,9 +178,8 @@ }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; &ehci { @@ -190,13 +203,3 @@ mac-address-increment = <(-1)>; }; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts index 1222ff2fcd5..47cbf9b243c 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts @@ -139,9 +139,16 @@ }; rom: partition@7d0000 { + compatible = "nvmem-cells"; label = "rom"; reg = <0x7d0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_rom_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; partition@7e0000 { @@ -151,9 +158,16 @@ }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; }; @@ -180,7 +194,8 @@ }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -193,13 +208,3 @@ mediatek,mtd-eeprom = <&radio 0x8000>; }; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi index 743d1e8db66..32a14a2b750 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi @@ -69,9 +69,16 @@ }; rom: partition@7d0000 { + compatible = "nvmem-cells"; label = "rom"; reg = <0x7d0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_rom_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; partition@7e0000 { @@ -81,9 +88,16 @@ }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; }; @@ -107,7 +121,8 @@ }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -121,13 +136,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi index e6d9b8576d9..9e4e6460209 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi @@ -45,9 +45,16 @@ #size-cells = <1>; uboot: partition@0 { + compatible = "nvmem-cells"; label = "u-boot"; reg = <0x0 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; }; partition@20000 { @@ -63,9 +70,16 @@ }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; }; @@ -77,9 +91,8 @@ }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_uboot_1fc00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_uboot_1fc00>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -96,13 +109,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts index 9f58fb86ee8..f1a05dac783 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts @@ -72,9 +72,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -134,16 +145,6 @@ pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts index bbb3e01add9..5d07db9708a 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts @@ -93,13 +93,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; @@ -174,7 +177,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts index ce617198ce9..886de51dae0 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts @@ -121,9 +121,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -201,7 +212,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -210,13 +222,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts b/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts index 8f7458e976e..54fcb32c0ba 100644 --- a/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts +++ b/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts @@ -82,13 +82,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -197,6 +200,6 @@ &wmac { pinctrl-names = "default"; pinctrl-0 = <&wled_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts index 95868c9be99..b70a95d7769 100644 --- a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts +++ b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts @@ -98,9 +98,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -144,11 +155,11 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -169,13 +180,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi index 5af7b343d9b..9e5227d848c 100644 --- a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi +++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -113,8 +124,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; @@ -131,13 +142,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts index 96ef110bdac..89b5d0e76d8 100644 --- a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts +++ b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts @@ -103,9 +103,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -143,15 +154,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts index ceb348e1d24..80c4f3640d8 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -105,11 +116,11 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -130,13 +141,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi index 57f3b4b7a62..e2f5c28c707 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi @@ -53,9 +53,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -92,7 +103,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -101,13 +113,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi index 27876fc1408..b57e58230c9 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi @@ -75,9 +75,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware: partition@50000 { @@ -117,7 +128,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -130,13 +142,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zte_q7.dts b/target/linux/ramips/dts/mt7620a_zte_q7.dts index c2dc1110082..38bd1a4475b 100644 --- a/target/linux/ramips/dts/mt7620a_zte_q7.dts +++ b/target/linux/ramips/dts/mt7620a_zte_q7.dts @@ -69,9 +69,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -98,7 +109,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &sdhci { @@ -112,13 +124,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts index a79578aa015..0b93c4ff10d 100644 --- a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts +++ b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts @@ -112,9 +112,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -163,7 +174,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -173,13 +185,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts index be1f9ee0268..44904d148e6 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts @@ -91,9 +91,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -113,7 +124,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -122,13 +134,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts index ee68ebb2d27..eb366ec1715 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts @@ -96,9 +96,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -126,7 +137,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -135,13 +147,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts index 4ecd3204c61..8fbf66abc85 100644 --- a/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts +++ b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -102,7 +113,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -111,13 +123,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts b/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts index b87e5a3530e..6f1a78dc986 100644 --- a/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts +++ b/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts @@ -86,9 +86,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -106,7 +117,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -115,13 +127,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts index 9d66b191cb2..a5f240c4bab 100644 --- a/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts +++ b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts @@ -83,9 +83,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -119,7 +130,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -128,13 +140,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts b/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts index 14e328842b3..215f96f462a 100644 --- a/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts +++ b/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts @@ -73,9 +73,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -101,7 +112,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -110,13 +122,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts index 1e8fe0d833e..5324d7dcf04 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts @@ -79,9 +79,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -114,7 +125,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -123,13 +135,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts index 5a30dee05f3..ecb0f194873 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts @@ -79,9 +79,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -114,7 +125,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -123,13 +135,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi b/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi index 1fe2cbaabc5..ce14ec3e01e 100644 --- a/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi +++ b/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi @@ -57,9 +57,20 @@ }; factory: partition@3f0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x3f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; }; @@ -73,7 +84,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -82,13 +94,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts index 09d70af4c71..8d6792289cb 100644 --- a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts +++ b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts @@ -104,9 +104,16 @@ }; factory: partition@f60000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0xf60000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; board_data: partition@f70000 { @@ -187,9 +194,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_board_data_b0>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_board_data_b0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi index 7f17f1957f8..b6e6d9d263d 100644 --- a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi @@ -60,9 +60,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware: partition@50000 { @@ -86,7 +97,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -95,13 +107,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts b/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts index 97e60436429..987869a0f3f 100644 --- a/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts +++ b/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts @@ -91,9 +91,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "Factory"; reg = <0x40000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -118,5 +125,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi index cd9e6cacce7..180d91b2cb4 100644 --- a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi +++ b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -128,7 +139,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -137,13 +149,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts index 88a968d33b9..0cd3c0b186c 100644 --- a/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts +++ b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts @@ -60,9 +60,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -82,7 +93,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -91,13 +103,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts index 4ab1b818108..d0b4804c199 100644 --- a/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts +++ b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts @@ -53,9 +53,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -83,7 +94,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -92,13 +104,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts index 8a3e96ff266..9cece28fc03 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts @@ -76,9 +76,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -106,7 +117,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -115,13 +127,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts index 69d5474bf65..59ae3e7a48b 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts @@ -84,9 +84,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -114,7 +125,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -123,13 +135,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts index 7c92f45e7b0..acf3501f903 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts @@ -77,9 +77,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -99,7 +110,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -108,13 +120,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts index 2ac2415736f..56a2b53871b 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -113,7 +124,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -122,13 +134,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts index 0d1c4696d79..4c6e2a80bc9 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts @@ -108,9 +108,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "RF-EEPROM"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -140,5 +147,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts index 917a1934bd3..94f8a650ae7 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts @@ -108,9 +108,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -137,7 +148,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -147,13 +159,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts index 9cea6ad667c..eb9ca6aba2b 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts @@ -108,9 +108,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -137,7 +148,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -147,13 +159,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index 932c36c6291..b6db48a347a 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -144,6 +144,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -172,7 +176,8 @@ &pcie0 { rt5592@0,0 { reg = <0x0000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts index 52d56466106..23e4db3aec8 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts @@ -31,9 +31,20 @@ }; factory: partition@30000 { - reg = <0x30000 0x10000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; + + macaddr_factory_2004: macaddr@2004 { + reg = <0x2004 0x6>; + }; }; partition@40000 { @@ -105,15 +116,6 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x2000>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2004: macaddr@2004 { - reg = <0x2004 0x6>; - }; + nvmem-cells = <&eeprom_factory_2000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts index bb3795aafac..8f1c07008a5 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts @@ -36,9 +36,20 @@ }; factory: partition@40000 { - reg = <0x40000 0x10000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -115,15 +126,6 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts index 3bf3e21a470..e7c5f276fa3 100644 --- a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts +++ b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts @@ -40,9 +40,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -113,15 +124,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts index 59cc965f23d..02c3f3c3351 100644 --- a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts +++ b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -234,15 +245,6 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts b/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts index 1bab37fc5ea..e02296cd5ae 100644 --- a/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts +++ b/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts @@ -40,9 +40,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -116,15 +127,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts index b3ada11220a..4665878d4b2 100644 --- a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts +++ b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts @@ -40,9 +40,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -138,15 +149,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts index ff714d12730..ade64b3f46c 100644 --- a/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts +++ b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts @@ -32,9 +32,20 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; + + macaddr_factory_2004: macaddr@2004 { + reg = <0x2004 0x6>; + }; }; partition@40000 { @@ -138,15 +149,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x2000>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2004: macaddr@2004 { - reg = <0x2004 0x6>; - }; + nvmem-cells = <&eeprom_factory_2000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts b/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts index 39045bf0267..5d518df2528 100644 --- a/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts +++ b/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts @@ -37,9 +37,16 @@ }; factory: partition@40000 { - reg = <0x00040000 0x00010000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x00040000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -80,5 +87,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_8devices_carambola.dts b/target/linux/ramips/dts/rt3050_8devices_carambola.dts index 820bbd3e99e..3aa148285a3 100644 --- a/target/linux/ramips/dts/rt3050_8devices_carambola.dts +++ b/target/linux/ramips/dts/rt3050_8devices_carambola.dts @@ -35,9 +35,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -72,19 +83,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi index 13933e335c3..f7ee55cec8f 100644 --- a/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi @@ -63,9 +63,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -94,15 +105,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts index 52b8668be92..913c29519a5 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts @@ -55,9 +55,20 @@ }; devdata: partition@ff0000 { + compatible = "nvmem-cells"; label = "devdata"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; }; }; @@ -67,13 +78,3 @@ nvmem-cells = <&macaddr_devdata_4004>; nvmem-cell-names = "mac-address"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts index 4e03f7beb74..76ca0bf83b9 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts @@ -25,9 +25,20 @@ }; devdata: partition@30000 { + compatible = "nvmem-cells"; label = "uboot-env"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; partition@40000 { @@ -61,13 +72,3 @@ nvmem-cells = <&macaddr_devdata_4004>; nvmem-cell-names = "mac-address"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi index 6cd75da68bf..41985278632 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi @@ -89,7 +89,8 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts b/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts index 036d3105610..ecce4335ff0 100644 --- a/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts +++ b/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts @@ -35,9 +35,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -103,19 +114,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts b/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts index 0d4d8f4cfd5..5817eae8174 100644 --- a/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts +++ b/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts @@ -51,9 +51,20 @@ }; devconf: partition@40000 { + compatible = "nvmem-cells"; label = "devconf"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devconf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -82,15 +93,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devconf 0x0>; -}; - -&devconf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devconf_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_devconf_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts b/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts index af6ebf00628..1154d205b76 100644 --- a/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts +++ b/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts @@ -38,9 +38,20 @@ }; devconf: partition@40000 { + compatible = "nvmem-cells"; label = "devconf"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devconf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -88,15 +99,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devconf 0x0>; -}; - -&devconf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devconf_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_devconf_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_asus_wl-330n.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n.dts index 2202cf3127d..4f137115ec9 100644 --- a/target/linux/ramips/dts/rt3050_asus_wl-330n.dts +++ b/target/linux/ramips/dts/rt3050_asus_wl-330n.dts @@ -72,9 +72,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -103,15 +114,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts index 4b9add1fda5..27fe5ba23f1 100644 --- a/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts +++ b/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts @@ -77,9 +77,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -108,19 +119,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts b/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts index 6620b1e8584..508f9080189 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -105,19 +116,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts index e1397d92f91..183dc17868d 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts @@ -32,9 +32,20 @@ }; devdata: partition@30000 { + compatible = "nvmem-cells"; label = "devdata"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; partition@40000 { @@ -115,15 +126,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; -}; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts index b0f734e4e06..bc3d5646a88 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts @@ -32,9 +32,20 @@ }; devdata: partition@30000 { + compatible = "nvmem-cells"; label = "devdata"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; factory: partition@40000 { @@ -115,15 +126,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; -}; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts b/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts index e84c9d9cb78..4fe519780dc 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts @@ -33,9 +33,16 @@ }; devdata: partition@30000 { + compatible = "nvmem-cells"; label = "devdata"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; }; partition@40000 { @@ -105,7 +112,8 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts index 4580a070633..7b9b3283883 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -120,19 +131,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts b/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts index c8f3951384d..e6682cf9dc5 100644 --- a/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts +++ b/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts @@ -39,9 +39,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@3e0000 { @@ -116,19 +127,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts b/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts index 3767afb4527..5eee298d8e6 100644 --- a/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts +++ b/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts @@ -39,9 +39,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@3e0000 { @@ -103,19 +114,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_huawei_d105.dts b/target/linux/ramips/dts/rt3050_huawei_d105.dts index 05d3847e71e..4333ed0a224 100644 --- a/target/linux/ramips/dts/rt3050_huawei_d105.dts +++ b/target/linux/ramips/dts/rt3050_huawei_d105.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -96,19 +107,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts b/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts index f449b0d0f80..384e1467c23 100644 --- a/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts +++ b/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts @@ -68,9 +68,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -92,15 +103,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_netcore_nw718.dts b/target/linux/ramips/dts/rt3050_netcore_nw718.dts index f9fda94ec0d..810fb1a2580 100644 --- a/target/linux/ramips/dts/rt3050_netcore_nw718.dts +++ b/target/linux/ramips/dts/rt3050_netcore_nw718.dts @@ -79,9 +79,20 @@ }; factory: partition@50000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@60000 { @@ -110,19 +121,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts b/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts index c00feb42889..23d1546c819 100644 --- a/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts +++ b/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -102,19 +113,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts b/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts index 6be2590a0cd..c8d51b3f02a 100644 --- a/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts +++ b/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts @@ -70,9 +70,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -101,19 +112,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_tenda_w150m.dts b/target/linux/ramips/dts/rt3050_tenda_w150m.dts index b921b7d1788..762043f423b 100644 --- a/target/linux/ramips/dts/rt3050_tenda_w150m.dts +++ b/target/linux/ramips/dts/rt3050_tenda_w150m.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -120,15 +131,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts b/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts index 36171ae591c..ed1c05a6c97 100644 --- a/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts +++ b/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -100,15 +111,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_accton_wr6202.dts b/target/linux/ramips/dts/rt3052_accton_wr6202.dts index a1c179c286b..98b0e831aac 100644 --- a/target/linux/ramips/dts/rt3052_accton_wr6202.dts +++ b/target/linux/ramips/dts/rt3052_accton_wr6202.dts @@ -66,9 +66,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -108,19 +119,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts b/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts index 97b37706fbd..33f5474f708 100644 --- a/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts +++ b/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts @@ -42,9 +42,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -106,19 +117,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_argus_atp-52b.dts b/target/linux/ramips/dts/rt3052_argus_atp-52b.dts index dffa5beefa7..0f15ac4ea69 100644 --- a/target/linux/ramips/dts/rt3052_argus_atp-52b.dts +++ b/target/linux/ramips/dts/rt3052_argus_atp-52b.dts @@ -37,8 +37,19 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -98,19 +109,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts b/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts index 5d73043425b..9550029cca2 100644 --- a/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts +++ b/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts @@ -61,9 +61,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -87,5 +94,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts b/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts index cbd586232e0..97a8dda2419 100644 --- a/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts +++ b/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -100,19 +111,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts b/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts index ada957fc528..bee541885a8 100644 --- a/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts +++ b/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -118,19 +129,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts b/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts index c547c9df69a..57d070b833d 100644 --- a/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts +++ b/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -118,19 +129,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts index 444a5af4f53..55eba3bc0a5 100644 --- a/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts +++ b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts @@ -26,9 +26,20 @@ #size-cells = <1>; uboot: partition@0 { + compatible = "nvmem-cells"; label = "uboot"; reg = <0x0 0x50000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_uboot_40000: eeprom@40000 { + reg = <0x40000 0x200>; + }; + + macaddr_uboot_40004: macaddr@40004 { + reg = <0x40004 0x6>; + }; }; partition@50000 { @@ -135,19 +146,10 @@ }; &wmac { - ralink,mtd-eeprom = <&uboot 0x40000>; + nvmem-cells = <&eeprom_uboot_40000>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_40004: macaddr@40004 { - reg = <0x40004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts b/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts index 5d61c757754..0ff041da333 100644 --- a/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts +++ b/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts @@ -37,9 +37,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -122,15 +133,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts b/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts index e33a7ef5b5e..9902e0b5b57 100644 --- a/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts +++ b/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts @@ -36,9 +36,20 @@ }; devdata: partition@30000 { + compatible = "nvmem-cells"; label = "devdata"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devdata_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devdata_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@40000 { @@ -127,19 +138,10 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x0>; + nvmem-cells = <&eeprom_devdata_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts b/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts index 4501a44c41f..889a276e2b3 100644 --- a/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts +++ b/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -100,15 +111,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts index b9fb232aa12..d77284e1639 100644 --- a/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts +++ b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -146,19 +157,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts b/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts index 9d5d4ceb1e9..27506604a54 100644 --- a/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts +++ b/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts @@ -31,9 +31,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -89,19 +100,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_huawei_hg255d.dts b/target/linux/ramips/dts/rt3052_huawei_hg255d.dts index 1cb19d01846..2018062143f 100644 --- a/target/linux/ramips/dts/rt3052_huawei_hg255d.dts +++ b/target/linux/ramips/dts/rt3052_huawei_hg255d.dts @@ -38,9 +38,20 @@ }; factory: partition@60000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x60000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@80000 { @@ -134,19 +145,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts b/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts index 0641a4e7968..fff1f2b0b58 100644 --- a/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts +++ b/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -87,15 +98,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts b/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts index 6573159985e..8b92d79672f 100644 --- a/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts +++ b/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -133,15 +144,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts index 245f01c7977..d5ab080ed51 100644 --- a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts +++ b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts @@ -38,9 +38,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -114,7 +121,8 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts b/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts index c65fc100d8c..5842515e7a5 100644 --- a/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts +++ b/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts @@ -92,9 +92,20 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@40000 { @@ -142,15 +153,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_nexaira_bc2.dts b/target/linux/ramips/dts/rt3052_nexaira_bc2.dts index c72d9372a54..21e70d394e3 100644 --- a/target/linux/ramips/dts/rt3052_nexaira_bc2.dts +++ b/target/linux/ramips/dts/rt3052_nexaira_bc2.dts @@ -31,9 +31,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -84,19 +95,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts b/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts index 4399467b290..caa374ceb1e 100644 --- a/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts +++ b/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts @@ -63,9 +63,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -94,19 +105,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts b/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts index ec46584381c..d88892f2faf 100644 --- a/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts +++ b/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts @@ -42,9 +42,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -93,19 +104,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts b/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts index 779443e70e2..1beed599e17 100644 --- a/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts +++ b/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@3e0000 { @@ -117,15 +128,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts b/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts index 7e6d47cc021..815fd9e4ef1 100644 --- a/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts +++ b/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts @@ -35,9 +35,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@7f0000 { @@ -82,19 +93,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts b/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts index 312007c68f0..1b30dc9dd0a 100644 --- a/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts +++ b/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts @@ -38,9 +38,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -89,5 +96,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts b/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts index 2689febf7fc..6f08cecacb0 100644 --- a/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts +++ b/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts @@ -38,9 +38,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -95,7 +102,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts index 13f1ae4e59d..6abaa8e887a 100644 --- a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts +++ b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -122,19 +133,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts b/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts index c897aac7c49..31214361f60 100644 --- a/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts +++ b/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -95,19 +106,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_tenda_3g300m.dts b/target/linux/ramips/dts/rt3052_tenda_3g300m.dts index 4ae42d71a58..577afd3a5c2 100644 --- a/target/linux/ramips/dts/rt3052_tenda_3g300m.dts +++ b/target/linux/ramips/dts/rt3052_tenda_3g300m.dts @@ -94,9 +94,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -125,19 +136,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts b/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts index 8a60184959f..ae998a27222 100644 --- a/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts +++ b/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -94,15 +105,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts index eee3ac9552d..ecc17fad407 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts @@ -28,9 +28,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts index 99693865cbc..eb04e4662c3 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts @@ -28,9 +28,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi index dad0da16d54..869cf32d787 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi @@ -72,7 +72,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts index 88c4c1fc892..3d2d8686e62 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -94,19 +105,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts b/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts index 211db1cbaba..d3234bd9a33 100644 --- a/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts +++ b/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; partition@50000 { @@ -115,19 +126,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts b/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts index 735f59f0670..0dffdddeb68 100644 --- a/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts +++ b/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; partition@50000 { @@ -115,19 +126,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts b/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts index c2f44ee5653..92d4304668e 100644 --- a/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts +++ b/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -114,19 +125,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts b/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts index c5990977dc5..65446842bb1 100644 --- a/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts +++ b/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -100,15 +111,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3352_allnet_all5002.dts b/target/linux/ramips/dts/rt3352_allnet_all5002.dts index 28c677041a5..a1133464b37 100644 --- a/target/linux/ramips/dts/rt3352_allnet_all5002.dts +++ b/target/linux/ramips/dts/rt3352_allnet_all5002.dts @@ -69,9 +69,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -100,7 +111,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -110,13 +122,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts b/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts index 01393c2383b..a8f1f0cd71b 100644 --- a/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts +++ b/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts @@ -89,9 +89,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -122,15 +133,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts b/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts index bb362790164..7d78ed333df 100644 --- a/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts +++ b/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts @@ -66,9 +66,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -99,7 +110,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -109,13 +121,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3352_zte_mf283plus.dts b/target/linux/ramips/dts/rt3352_zte_mf283plus.dts index b733d68586e..9108fc9b8cb 100644 --- a/target/linux/ramips/dts/rt3352_zte_mf283plus.dts +++ b/target/linux/ramips/dts/rt3352_zte_mf283plus.dts @@ -85,9 +85,20 @@ }; factory: partition@70000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x70000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@80000 { @@ -120,7 +131,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -130,13 +142,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts b/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts index 8b7c47e88b5..322609b9582 100644 --- a/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts +++ b/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts @@ -83,9 +83,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -114,7 +125,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -124,13 +136,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts index 38191d2643a..62b84207bd0 100644 --- a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts +++ b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts @@ -37,9 +37,24 @@ }; factory: partition@40000 { - reg = <0x00040000 0x00010000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x00040000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -129,14 +144,16 @@ wifi@0,0 { compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; &wmac { status = "okay"; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -146,13 +163,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_dlink_dir-645.dts b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts index b02c6b692af..8aad9974b50 100644 --- a/target/linux/ramips/dts/rt3662_dlink_dir-645.dts +++ b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts @@ -94,9 +94,20 @@ }; factory: partition@34000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x34000 0x4000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@38000 { @@ -137,7 +148,8 @@ &wmac { ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -147,13 +159,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts index fc3a5549f20..b9b44bd5128 100644 --- a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts +++ b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts @@ -75,15 +75,33 @@ }; factory: partition@40000 { - reg = <0x00040000 0x00010000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x00040000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; devdata: partition@50000 { - reg = <0x00050000 0x00020000>; + compatible = "nvmem-cells"; label = "devdata"; + reg = <0x00050000 0x00020000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_devdata_d: macaddr@d { + reg = <0xd 0x6>; + }; }; partition@70000 { @@ -149,7 +167,8 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pci { @@ -163,7 +182,8 @@ compatible = "pci0,0"; reg = <0x10000 0 0 0 0>; ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -174,13 +194,3 @@ &ohci { status = "okay"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_d: macaddr@d { - reg = <0xd 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts index cce44ed4c3a..6f0d633f972 100644 --- a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts +++ b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts @@ -89,9 +89,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -151,7 +162,8 @@ compatible = "pci1814,3091"; reg = <0x0 1 0 0 0>; ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -159,7 +171,8 @@ status = "okay"; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { diff --git a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts index 2501c172515..dfcdb760884 100644 --- a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts +++ b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts @@ -31,9 +31,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -62,5 +69,6 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3662_omnima_hpm.dts b/target/linux/ramips/dts/rt3662_omnima_hpm.dts index 84ca468e3d2..644cc557b9c 100644 --- a/target/linux/ramips/dts/rt3662_omnima_hpm.dts +++ b/target/linux/ramips/dts/rt3662_omnima_hpm.dts @@ -110,9 +110,20 @@ }; factory: partition@40000 { - reg = <0x00040000 0x00010000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x00040000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -147,7 +158,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -157,13 +169,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts index ad417856b3a..7d1d8ef5539 100644 --- a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts +++ b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts @@ -37,9 +37,20 @@ }; factory: partition@34000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x34000 0x4000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; }; partition@38000 { @@ -135,14 +146,16 @@ wifi@0,0 { compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x2000>; + nvmem-cells = <&eeprom_factory_2000>; + nvmem-cell-names = "eeprom"; }; }; &wmac { status = "okay"; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { diff --git a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi index 0b2c7602d1c..c6213a6b17b 100644 --- a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi +++ b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi @@ -42,9 +42,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -78,7 +89,8 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pci { @@ -92,7 +104,8 @@ compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts index fc437c1f62c..03f7cae6a5d 100644 --- a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts +++ b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts @@ -122,9 +122,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; partition@50000 { @@ -164,14 +179,16 @@ wifi@0,0 { compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; &wmac { status = "okay"; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -181,13 +198,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts index fe503289a3d..112e5a6fbc8 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts @@ -37,9 +37,20 @@ }; factory: partition@40000 { - reg = <0x00040000 0x00010000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x00040000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -115,19 +126,8 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; ralink,5ghz = <0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts index 26c8dfe2f29..680a0e06fe8 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts @@ -37,9 +37,20 @@ }; factory: partition@40000 { - reg = <0x00040000 0x00010000>; + compatible = "nvmem-cells"; label = "factory"; + reg = <0x00040000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -141,19 +152,8 @@ &wmac { status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; ralink,5ghz = <0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <3>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi index 2d43e0a30d1..e64437cd943 100644 --- a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi +++ b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi @@ -67,9 +67,20 @@ }; devconf: partition@40000 { + compatible = "nvmem-cells"; label = "devconf"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devconf_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -98,15 +109,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devconf 0x0>; -}; - -&devconf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devconf_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_devconf_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_airlive_air3gii.dts b/target/linux/ramips/dts/rt5350_airlive_air3gii.dts index 0082af958dc..fd4524f0fc9 100644 --- a/target/linux/ramips/dts/rt5350_airlive_air3gii.dts +++ b/target/linux/ramips/dts/rt5350_airlive_air3gii.dts @@ -61,9 +61,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -92,15 +103,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_allnet_all5003.dts b/target/linux/ramips/dts/rt5350_allnet_all5003.dts index e4e0ef1b62a..2db37120e9b 100644 --- a/target/linux/ramips/dts/rt5350_allnet_all5003.dts +++ b/target/linux/ramips/dts/rt5350_allnet_all5003.dts @@ -69,9 +69,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -100,15 +111,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi index 18e59431fba..1bd7310d5a0 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi @@ -69,9 +69,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -89,7 +100,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -102,13 +114,3 @@ &esw { mediatek,portmap = <0x3f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt5350_belkin_f7c027.dts b/target/linux/ramips/dts/rt5350_belkin_f7c027.dts index e3691b75bdb..1a218e4f6cb 100644 --- a/target/linux/ramips/dts/rt5350_belkin_f7c027.dts +++ b/target/linux/ramips/dts/rt5350_belkin_f7c027.dts @@ -88,9 +88,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -128,7 +135,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts index 5b504bea650..1b1b02bb463 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts @@ -72,9 +72,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -103,15 +114,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts index 62c68a3fc2a..00f4bd0d2c4 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts @@ -72,9 +72,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -106,15 +117,6 @@ &wmac { status = "okay"; ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts index 5c5517ccb29..8a1b4fe4b0f 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts @@ -94,9 +94,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -126,15 +137,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts index 261346ce867..780e92439b1 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts @@ -66,9 +66,20 @@ }; devdata: partition@30000 { + compatible = "nvmem-cells"; label = "devdata"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; factory: partition@40000 { @@ -107,15 +118,6 @@ &wmac { status = "okay"; ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&devdata 0x4000>; -}; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts b/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts index 7bb1d81abf9..acf03bb732b 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts @@ -103,8 +103,19 @@ }; config: partition@7f0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_e07e: macaddr@e07e { + reg = <0xe07e 0x6>; + }; + + eeprom_config_e08a: eeprom@e08a { + reg = <0xe08a 0x200>; + }; }; }; }; @@ -140,18 +151,7 @@ }; &wmac { - ralink,mtd-eeprom = <&config 0xe08a>; ralink,led-polarity = <1>; - nvmem-cells = <&macaddr_config_e07e>; - nvmem-cell-names = "mac-address"; -}; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e07e: macaddr@e07e { - reg = <0xe07e 0x6>; - }; + nvmem-cells = <&eeprom_config_e08a>, <&macaddr_config_e07e>; + nvmem-cell-names = "eeprom", "mac-address"; }; diff --git a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts index 1b80382f681..a83f5cf89ba 100644 --- a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts +++ b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts @@ -31,9 +31,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -62,15 +73,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts index a246c22c215..f29c307c829 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts @@ -83,9 +83,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -114,15 +125,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts index 710fd2d6be2..129dc1ceefd 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts @@ -83,9 +83,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -115,15 +126,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts index 7dc56673a04..c4f785d0308 100644 --- a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts +++ b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts @@ -76,9 +76,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -108,15 +119,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts index 387e4adfdc1..ce3f20fca97 100644 --- a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts +++ b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts @@ -73,9 +73,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -105,15 +116,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts index 8df91594b7e..b2368e4dcd3 100644 --- a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts +++ b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts @@ -76,9 +76,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -107,15 +118,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi index 9783e5a7e5a..99ab0a939c1 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi @@ -44,9 +44,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware: partition@50000 { @@ -71,15 +82,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi index ea10d501827..198934f5b4a 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi +++ b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi @@ -134,9 +134,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware: partition@50000 { @@ -178,15 +189,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi index 2d5d86ee1bc..f3c2aedc96e 100644 --- a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi @@ -34,9 +34,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -70,8 +81,9 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &i2c { @@ -81,13 +93,3 @@ &uart { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts index 0e69cf8919c..79eb6c3f4a0 100644 --- a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts +++ b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts @@ -86,9 +86,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -110,15 +121,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts b/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts index 89a774a060a..0ff8cd7e1ac 100644 --- a/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts +++ b/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts @@ -61,9 +61,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -100,16 +111,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m3.dts b/target/linux/ramips/dts/rt5350_poray_m3.dts index f02e7b024d3..24428ee96c7 100644 --- a/target/linux/ramips/dts/rt5350_poray_m3.dts +++ b/target/linux/ramips/dts/rt5350_poray_m3.dts @@ -68,9 +68,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -100,16 +111,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m4.dtsi b/target/linux/ramips/dts/rt5350_poray_m4.dtsi index 4addfcbef8a..9891209e452 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4.dtsi +++ b/target/linux/ramips/dts/rt5350_poray_m4.dtsi @@ -60,9 +60,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware: partition@50000 { @@ -92,16 +103,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_x5.dts b/target/linux/ramips/dts/rt5350_poray_x5.dts index 20e2a5257fa..04387a63cad 100644 --- a/target/linux/ramips/dts/rt5350_poray_x5.dts +++ b/target/linux/ramips/dts/rt5350_poray_x5.dts @@ -100,9 +100,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -132,16 +143,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_x8.dts b/target/linux/ramips/dts/rt5350_poray_x8.dts index e84f28f783c..d8fcb67cb80 100644 --- a/target/linux/ramips/dts/rt5350_poray_x8.dts +++ b/target/linux/ramips/dts/rt5350_poray_x8.dts @@ -61,9 +61,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -93,16 +104,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts index 19b6d78009e..cf9b1338b9b 100644 --- a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts +++ b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts @@ -79,9 +79,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -110,16 +121,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts index a03f33f3fc1..6d7d92cbc71 100644 --- a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts +++ b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts @@ -82,9 +82,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -114,15 +125,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts index 5f2bad2b898..8f71cc5bf10 100644 --- a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts +++ b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts @@ -84,9 +84,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -116,15 +127,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi index 652f9384e56..788c86f870b 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi +++ b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi @@ -182,9 +182,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware: partition@50000 { @@ -222,7 +233,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi1 { @@ -234,13 +246,3 @@ reg = <0>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts index 911e3e44edf..9f0cecdb9b8 100644 --- a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts +++ b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts @@ -31,9 +31,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -62,15 +73,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts index 12d41e305e5..8611c50b14e 100644 --- a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts +++ b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts @@ -100,10 +100,20 @@ }; factory: partition@40000 { - #size-cells = <1>; + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -139,15 +149,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts b/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts index 4ff2d57f729..69b725356e3 100644 --- a/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts +++ b/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts @@ -66,9 +66,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -97,15 +108,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts index 9b5c45347b3..1fd52ba79f6 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts @@ -89,9 +89,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -122,15 +133,6 @@ &wmac { ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts index d044be395a8..2c8b97f8a6a 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts @@ -73,9 +73,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -106,15 +117,6 @@ &wmac { ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts index 69a1759f36f..67d72e0d4f3 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts @@ -75,9 +75,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -109,15 +120,6 @@ &wmac { status = "okay"; ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; From e93f41adee3e5fa4046811890b92c9b86875911b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 10:12:02 +0800 Subject: [PATCH 72/78] ramips: convert MT7628 EEPROM to NVMEM format This patch converts MT7628 WiFi calibration data to NVMEM format. The EEPROM size is 0x400. Signed-off-by: Shiji Yang --- .../dts/mt7628an_alfa-network_awusfree1.dts | 24 ++++++++------- .../ramips/dts/mt7628an_asus_rt-ac1200.dtsi | 12 +++++--- .../ramips/dts/mt7628an_asus_rt-n1x.dtsi | 24 ++++++++------- .../dts/mt7628an_buffalo_wcr-1166ds.dts | 10 ++++++- .../dts/mt7628an_comfast_cf-wr617ac.dts | 7 ++++- .../dts/mt7628an_comfast_cf-wr758ac.dtsi | 24 ++++++++------- .../linux/ramips/dts/mt7628an_cudy_wr1000.dts | 24 ++++++++------- .../ramips/dts/mt7628an_dlink_dap-1325-a1.dts | 24 ++++++++------- .../ramips/dts/mt7628an_elecom_wrc-1167fs.dts | 24 ++++++++------- .../dts/mt7628an_glinet_gl-mt300n-v2.dts | 24 ++++++++------- .../mt7628an_glinet_vixmini_microuter.dtsi | 24 ++++++++------- .../dts/mt7628an_hak5_wifi-pineapple-mk7.dts | 24 ++++++++------- .../ramips/dts/mt7628an_hilink_hlk-7628n.dts | 24 ++++++++------- .../ramips/dts/mt7628an_hilink_hlk-7688a.dts | 24 ++++++++------- .../ramips/dts/mt7628an_hiwifi_hc5861b.dts | 10 ------- .../ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi | 28 ++++++++++------- target/linux/ramips/dts/mt7628an_iptime.dtsi | 27 ++++++++++------- .../ramips/dts/mt7628an_jotale_js76x8.dtsi | 24 ++++++++------- .../ramips/dts/mt7628an_keenetic_kn-1613.dts | 24 ++++++++------- target/linux/ramips/dts/mt7628an_kroks.dtsi | 24 ++++++++------- .../ramips/dts/mt7628an_linksys_e5400.dts | 14 +++++---- .../mt7628an_mediatek_linkit-smart-7688.dts | 24 ++++++++------- .../mt7628an_mediatek_mt7628an-eval-board.dts | 10 ++++++- .../dts/mt7628an_mercury_mac1200r-v2.dts | 24 ++++++++------- .../linux/ramips/dts/mt7628an_minew_g1-c.dts | 24 ++++++++------- .../ramips/dts/mt7628an_motorola_mwr03.dts | 24 ++++++++------- .../ramips/dts/mt7628an_netgear_r6xxx.dtsi | 24 ++++++++------- .../ramips/dts/mt7628an_onion_omega2.dtsi | 24 ++++++++------- .../dts/mt7628an_rakwireless_rak633.dts | 24 ++++++++------- .../ramips/dts/mt7628an_ravpower_rp-wd009.dts | 24 ++++++++------- .../ramips/dts/mt7628an_skylab_skw92a.dts | 24 ++++++++------- target/linux/ramips/dts/mt7628an_tama_w06.dts | 24 ++++++++------- .../ramips/dts/mt7628an_totolink_lr1200.dts | 24 ++++++++------- .../dts/mt7628an_tplink_8m-split-uboot.dtsi | 30 ++++++++++--------- .../linux/ramips/dts/mt7628an_tplink_8m.dtsi | 27 ++++++++--------- .../ramips/dts/mt7628an_tplink_re200.dtsi | 30 ++++++++++--------- .../ramips/dts/mt7628an_tplink_re305-v1.dts | 30 ++++++++++--------- .../ramips/dts/mt7628an_tplink_re305-v3.dts | 30 ++++++++++--------- .../dts/mt7628an_tplink_tl-mr3020-v3.dts | 27 ++++++++--------- .../dts/mt7628an_tplink_tl-wr840n-v5.dts | 27 ++++++++--------- .../dts/mt7628an_tplink_tl-wr841n-v14.dts | 27 ++++++++--------- .../dts/mt7628an_unielec_u7628-01-16m.dts | 21 ++++++------- .../ramips/dts/mt7628an_unielec_u7628-01.dtsi | 3 +- .../ramips/dts/mt7628an_vocore_vocore2.dtsi | 24 ++++++++------- .../dts/mt7628an_wavlink_wl-wn531a3.dts | 24 ++++++++------- .../dts/mt7628an_wavlink_wl-wn570ha1.dts | 24 ++++++++------- .../dts/mt7628an_wavlink_wl-wn575a3.dts | 24 ++++++++------- .../dts/mt7628an_wavlink_wl-wn576a2.dts | 24 ++++++++------- .../dts/mt7628an_wavlink_wl-wn577a2.dts | 24 ++++++++------- .../dts/mt7628an_wavlink_wl-wn578a2.dts | 24 ++++++++------- .../linux/ramips/dts/mt7628an_widora_neo.dtsi | 24 ++++++++------- .../ramips/dts/mt7628an_wiznet_wizfi630s.dts | 24 ++++++++------- .../ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi | 24 ++++++++------- .../ramips/dts/mt7628an_xiaomi_mi-ra75.dts | 23 ++------------ .../dts/mt7628an_xiaomi_mi-router-4.dtsi | 22 +++++++++++++- ...mt7628an_xiaomi_mi-router-4a-100m-intl.dts | 10 ------- .../dts/mt7628an_xiaomi_mi-router-4a-100m.dts | 10 ------- .../dts/mt7628an_xiaomi_mi-router-4c.dts | 10 ------- .../ramips/dts/mt7628an_xiaomi_miwifi-3c.dts | 24 ++++++++------- .../dts/mt7628an_xiaomi_miwifi-nano.dts | 24 ++++++++------- .../dts/mt7628an_zbtlink_zbt-we1226.dts | 24 ++++++++------- .../dts/mt7628an_zyxel_keenetic-extra-ii.dts | 24 ++++++++------- 62 files changed, 732 insertions(+), 649 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts index f5cff3bb609..67f4d07f3af 100644 --- a/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts +++ b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts @@ -114,9 +114,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -131,15 +142,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi index dbba801425e..746436570fc 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi @@ -73,13 +73,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -117,7 +120,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi index 8fd86dcb16f..7404853f8cd 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi +++ b/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi @@ -75,9 +75,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -101,7 +112,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -122,13 +134,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts index c3ea41bbf66..4f37fb89404 100644 --- a/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts +++ b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts @@ -140,9 +140,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@50000 { @@ -175,5 +182,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts index bec9e951825..6a7bdfab079 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts @@ -77,6 +77,10 @@ #size-cells = <1>; read-only; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + macaddr_factory_8004: macaddr@8004 { reg = <0x8004 0x6>; }; @@ -122,5 +126,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi index 6ac53adf520..4993e15f24e 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi @@ -84,9 +84,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; partition@50000 { @@ -101,7 +112,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -112,13 +124,3 @@ &esw { mediatek,portdisable = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts index 82f0e7c690a..bbdd6fe35f3 100644 --- a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts +++ b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts @@ -89,9 +89,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -132,7 +143,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -143,13 +155,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts b/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts index 5b50674f0b4..0bc81291d73 100644 --- a/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts +++ b/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts @@ -82,7 +82,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; nvmem-cells = <&macaddr_factory_28>; nvmem-cell-names = "mac-address"; @@ -114,9 +115,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -127,13 +139,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts index f716ad9f23b..f795838f8f2 100644 --- a/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts +++ b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts @@ -102,9 +102,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -163,15 +174,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts index a3ce8cc5921..2142eaa096e 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts @@ -88,7 +88,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi0 { @@ -117,9 +118,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -134,13 +146,3 @@ &uart1 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi b/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi index 089a3f3c427..eea070a03ad 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi +++ b/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi @@ -60,7 +60,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi0 { @@ -89,9 +90,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; /* @@ -105,13 +117,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts b/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts index 2901a2af51a..18ff6c75afa 100644 --- a/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts +++ b/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts @@ -101,9 +101,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -125,15 +136,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts index b7c3af796d5..d7d4965328a 100644 --- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts +++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts @@ -67,9 +67,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -89,15 +100,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts index 2c7299af72f..5357996e92b 100644 --- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts +++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts @@ -81,9 +81,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -115,15 +126,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts index 08bdcd73ada..a3ca7b9c843 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts @@ -53,13 +53,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi index bfc510e06fe..ad8d6cbfe17 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi @@ -57,9 +57,24 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -97,15 +112,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_iptime.dtsi b/target/linux/ramips/dts/mt7628an_iptime.dtsi index ccc6debfc9b..3f81fb56a71 100644 --- a/target/linux/ramips/dts/mt7628an_iptime.dtsi +++ b/target/linux/ramips/dts/mt7628an_iptime.dtsi @@ -43,9 +43,16 @@ #size-cells = <1>; uboot: partition@0 { + compatible = "nvmem-cells"; label = "u-boot"; reg = <0x0 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; }; partition@20000 { @@ -55,9 +62,16 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@40000 { @@ -105,15 +119,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi index 2d2f8a58b8d..a9ce7680d6f 100644 --- a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi @@ -81,9 +81,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -124,15 +135,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts index 4281682503a..510bada246d 100644 --- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts @@ -130,9 +130,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "rf-eeprom"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware1: partition@50000 { @@ -196,7 +207,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -211,13 +223,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_kroks.dtsi b/target/linux/ramips/dts/mt7628an_kroks.dtsi index dc1eee9ccab..186f8e16edd 100644 --- a/target/linux/ramips/dts/mt7628an_kroks.dtsi +++ b/target/linux/ramips/dts/mt7628an_kroks.dtsi @@ -65,8 +65,19 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -90,16 +101,6 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; - ðernet { nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; @@ -108,7 +109,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &uart1 { diff --git a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts index 3a6403fe7f8..ed1479dcd8f 100644 --- a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts +++ b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts @@ -78,13 +78,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; + read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; @@ -155,9 +158,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; diff --git a/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts b/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts index 57624c302eb..c693e69f2c3 100644 --- a/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts @@ -108,9 +108,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -159,15 +170,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts b/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts index 4dede4287f5..9210451c16e 100644 --- a/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts @@ -38,9 +38,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; partition@50000 { @@ -55,5 +62,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts index f712a280c5c..4a7915b9f00 100644 --- a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts +++ b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts @@ -43,9 +43,20 @@ }; factory: partition@1d800 { + compatible = "nvmem-cells"; label = "factory_info"; reg = <0x1d800 0x800>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_d: macaddr@d { + reg = <0xd 0x6>; + }; }; art: partition@1e000 { @@ -86,7 +97,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -100,13 +112,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_d: macaddr@d { - reg = <0xd 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_minew_g1-c.dts b/target/linux/ramips/dts/mt7628an_minew_g1-c.dts index 92fbf7c6ae5..e7a67b72c14 100644 --- a/target/linux/ramips/dts/mt7628an_minew_g1-c.dts +++ b/target/linux/ramips/dts/mt7628an_minew_g1-c.dts @@ -105,9 +105,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -131,20 +142,11 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &sdhci { status = "okay"; mediatek,cd-high; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts b/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts index 2179c48b228..b852c11e06f 100644 --- a/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts +++ b/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts @@ -68,9 +68,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -127,15 +138,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi index e6374e7bac8..a6fa581b7d6 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi +++ b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi @@ -80,9 +80,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@60000 { @@ -97,7 +108,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -116,13 +128,3 @@ ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi index b10d448a30a..79d1fbc335e 100644 --- a/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi +++ b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi @@ -118,9 +118,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -164,15 +175,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts index 61f78c162cb..ecdfa13e69c 100644 --- a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts +++ b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts @@ -52,9 +52,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -94,15 +105,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts index 5c3b14f87f2..e8cb360cca0 100644 --- a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts +++ b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts @@ -137,9 +137,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -183,20 +194,11 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts index 174272f95fd..bfb1bd808a1 100644 --- a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts +++ b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts @@ -54,7 +54,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi0 { @@ -83,9 +84,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -100,13 +112,3 @@ &uart1 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tama_w06.dts b/target/linux/ramips/dts/mt7628an_tama_w06.dts index 7a202eb6ef7..7f00db99867 100644 --- a/target/linux/ramips/dts/mt7628an_tama_w06.dts +++ b/target/linux/ramips/dts/mt7628an_tama_w06.dts @@ -75,9 +75,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -98,15 +109,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts index 9d1c930d762..4de621196c1 100644 --- a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts +++ b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts @@ -108,7 +108,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -142,9 +143,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -155,13 +167,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi index d7c65d4703e..edf5d89054a 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -53,9 +53,16 @@ }; rom: partition@7d0000 { + compatible = "nvmem-cells"; label = "rom"; reg = <0x7d0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_rom_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; partition@7e0000 { @@ -64,9 +71,16 @@ }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -75,10 +89,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { @@ -89,13 +101,3 @@ &esw { mediatek,portmap = <0x3e>; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index ecb6ce1e4ea..4e4e3c735a1 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -45,9 +45,20 @@ }; factory: partition@7d0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x7d0000 0x30000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; + + eeprom_factory_20000: eeprom@20000 { + reg = <0x20000 0x400>; + }; }; }; }; @@ -56,23 +67,11 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x20000>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { nvmem-cells = <&macaddr_factory_f100>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi b/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi index 1a8b26b1cce..d129acec0cc 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi @@ -96,15 +96,29 @@ }; config: partition@7c0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0x7c0000 0x30000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_2008: macaddr@2008 { + reg = <0x2008 0x6>; + }; }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -126,10 +140,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; @@ -147,13 +159,3 @@ mac-address-increment = <2>; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_2008: macaddr@2008 { - reg = <0x2008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts index 7948668b847..6b525832734 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts @@ -33,9 +33,16 @@ }; config: partition@600000 { + compatible = "nvmem-cells"; label = "config"; reg = <0x600000 0x50000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_10008: macaddr@10008 { + reg = <0x10008 0x6>; + }; }; /* @@ -44,9 +51,16 @@ */ radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -61,10 +75,8 @@ }; &wmac { - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <1>; }; @@ -72,13 +84,3 @@ nvmem-cells = <&macaddr_config_10008>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts index 21df0fb3e69..9f80bd57fb1 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts @@ -33,15 +33,29 @@ }; config: partition@7c0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0x7c0000 0x30000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + macaddr_config_2008: macaddr@2008 { + reg = <0x2008 0x6>; + }; }; radio: partition@7f0000 { + compatible = "nvmem-cells"; label = "radio"; reg = <0x7f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; }; @@ -56,10 +70,8 @@ }; &wmac { - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; @@ -67,13 +79,3 @@ nvmem-cells = <&macaddr_config_2008>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_2008: macaddr@2008 { - reg = <0x2008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts index 3ffa7325411..3828d859caf 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts @@ -121,9 +121,20 @@ }; factory: partition@7d0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x7d0000 0x30000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_20000: eeprom@20000 { + reg = <0x20000 0x400>; + }; + + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; }; }; @@ -139,23 +150,11 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x20000>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { nvmem-cells = <&macaddr_factory_f100>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts index 01a1a7f09e2..e5bb9f233bd 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts @@ -70,9 +70,20 @@ }; factory: partition@3f0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x3f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; }; }; @@ -89,10 +100,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { @@ -110,13 +119,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts index ff2c8d48d15..67df5c0127c 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts @@ -81,9 +81,20 @@ }; factory: partition@3f0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x3f0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; }; }; @@ -100,10 +111,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { @@ -129,13 +138,3 @@ output-high; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts index 8037b3a304a..2bc6a5f8c39 100644 --- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts @@ -38,9 +38,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -56,13 +67,3 @@ nvmem-cells = <&macaddr_factory_28>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi index f25e28abd81..b31ffba8090 100644 --- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi @@ -88,7 +88,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi index 9100e0225e8..27d6d67ed41 100644 --- a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi @@ -40,9 +40,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -64,7 +75,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -96,13 +108,3 @@ &uart2 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts index 2a09ce6f385..7a60906a566 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts @@ -108,9 +108,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -125,7 +136,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -136,13 +148,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts index dcba4b64e28..23f81619ee1 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts @@ -98,9 +98,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -115,7 +126,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -126,13 +138,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts index 83e269b3660..65f6f47b96f 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts @@ -93,9 +93,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -110,7 +121,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -121,13 +133,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts index bb1ddd0040b..9ea2a3a65ff 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts @@ -132,9 +132,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -149,7 +160,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -172,13 +184,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts index b4e6905624a..456b3ad1511 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts @@ -97,9 +97,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -114,7 +125,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -137,13 +149,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts index 1d5c99da318..267001d950a 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts @@ -127,9 +127,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -144,7 +155,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -167,13 +179,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_widora_neo.dtsi b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi index fd146e92644..5d37b124486 100644 --- a/target/linux/ramips/dts/mt7628an_widora_neo.dtsi +++ b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi @@ -74,9 +74,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; firmware: partition@50000 { @@ -167,15 +178,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts index 9ce585021ec..04b6c56bef8 100644 --- a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts +++ b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts @@ -117,9 +117,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -161,15 +172,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi index bb35357808e..c3fcaabe2fc 100644 --- a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi +++ b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi @@ -48,9 +48,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; partition@50000 { @@ -90,15 +101,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts index 2dd855bf8fd..51b99300b31 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts @@ -95,10 +95,10 @@ }; &wmac { - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; - &esw { mediatek,portmap = <0x3e>; mediatek,portdisable = <0x2a>; @@ -111,22 +111,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; - - diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi index 59d269bf03e..c5465386580 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi @@ -47,9 +47,28 @@ }; factory: partition@30000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x30000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; partition@40000 { @@ -79,5 +98,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts index 863191bc4b7..0d647c6153c 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts @@ -72,13 +72,3 @@ mediatek,portmap = <0x3e>; mediatek,portdisable = <0x2a>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts index 5ddc7af4621..7ae6b18f727 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts @@ -72,13 +72,3 @@ mediatek,portmap = <0x3e>; mediatek,portdisable = <0x2a>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts index e9bbf76e4ba..27348b3ad7d 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts @@ -71,13 +71,3 @@ mediatek,portmap = <0x3d>; mediatek,portdisable = <0x29>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts index c45f94b2f17..bc7083fb1f7 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts @@ -74,7 +74,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -113,9 +114,20 @@ }; factory: partition@50000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@60000 { @@ -144,13 +156,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts index f9adca9d714..c957388228e 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts @@ -72,7 +72,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -105,9 +106,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; partition@50000 { @@ -118,13 +130,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts index aca4555a40b..fd233cd30bb 100644 --- a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts +++ b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts @@ -86,9 +86,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; partition@50000 { @@ -103,7 +114,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -114,13 +126,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts index c53289debf0..cbe390a4de3 100644 --- a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -121,9 +121,20 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "rf-eeprom"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; firmware1: partition@50000 { @@ -193,7 +204,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -215,13 +227,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; From f53fa2a0cb9c3c802ac79409330bcba3b971c8ca Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 10:12:02 +0800 Subject: [PATCH 73/78] ramips: convert mt76 PCIe NIC EEPROM to NVMEM format for legacy SoCs This patch converts MT761{0,2,3} PCIe WiFi calibration data to NVMEM format for legacy Ralink SoCs (MT7620 and Mt7628). The EEPROM size of the MT7610 and MT7612 is 0x200. there are only three devices uses MT7613 NIC, ASUS RT-AC1200 V2, COMFAST CF-WR758AC V2 and Keenetic KN-1613. The EEPROM size of them is 0x4da8. Signed-off-by: Shiji Yang --- .../dts/mt7620a_alfa-network_ac1200rm.dts | 7 ++++- .../ramips/dts/mt7620a_asus_rt-ac51u.dts | 3 +- .../ramips/dts/mt7620a_asus_rt-ac54u.dts | 3 +- .../ramips/dts/mt7620a_asus_rt-ac5x.dtsi | 4 +++ .../ramips/dts/mt7620a_bdcom_wap2100-sk.dts | 7 ++++- .../ramips/dts/mt7620a_buffalo_whr-1166d.dts | 7 ++++- .../linux/ramips/dts/mt7620a_cameo_810.dtsi | 9 ++++-- .../ramips/dts/mt7620a_dlink_dir-510l.dts | 26 ++++++++--------- .../ramips/dts/mt7620a_dlink_dir-806a-b1.dts | 10 ++++--- .../ramips/dts/mt7620a_dlink_dwr-118-a1.dts | 26 ++++++++--------- .../ramips/dts/mt7620a_dlink_dwr-960.dts | 4 ++- .../ramips/dts/mt7620a_dlink_dwr-961-a1.dts | 4 ++- .../ramips/dts/mt7620a_dlink_dwr-96x.dtsi | 16 +++++++---- target/linux/ramips/dts/mt7620a_domywifi.dtsi | 7 ++++- .../ramips/dts/mt7620a_dovado_tiny-ac.dts | 10 ++++++- .../dts/mt7620a_edimax_br-6208ac-v2.dts | 7 ++++- .../dts/mt7620a_edimax_br-6478ac-v2.dts | 7 ++++- .../ramips/dts/mt7620a_edimax_ew-7478apc.dts | 7 ++++- .../ramips/dts/mt7620a_edimax_ew-747x.dtsi | 9 ++++-- .../linux/ramips/dts/mt7620a_fon_fon2601.dts | 7 ++++- .../ramips/dts/mt7620a_glinet_gl-mt750.dts | 7 ++++- .../dts/mt7620a_head-weblink_hdrm200.dts | 7 ++++- .../ramips/dts/mt7620a_hiwifi_hc5761.dts | 3 +- .../ramips/dts/mt7620a_hiwifi_hc5861.dts | 3 +- .../ramips/dts/mt7620a_hiwifi_hc5x61.dtsi | 4 +++ target/linux/ramips/dts/mt7620a_humax_e2.dts | 7 ++++- .../ramips/dts/mt7620a_iodata_wn-ac1167gr.dts | 10 ++++++- .../ramips/dts/mt7620a_iodata_wn-ac733gr3.dts | 10 ++++++- target/linux/ramips/dts/mt7620a_iptime.dtsi | 7 ++++- .../ramips/dts/mt7620a_lava_lr-25g001.dts | 28 +++++++++---------- .../ramips/dts/mt7620a_lb-link_bl-w1200.dts | 7 ++++- .../ramips/dts/mt7620a_lenovo_newifi-y1.dtsi | 7 ++++- .../dts/mt7620a_netgear_ex3x00_ex61xx.dtsi | 7 ++++- .../linux/ramips/dts/mt7620a_netis_wf2770.dts | 7 ++++- .../linux/ramips/dts/mt7620a_phicomm_k2x.dtsi | 7 ++++- .../ramips/dts/mt7620a_phicomm_psg1208.dts | 7 ++++- .../ramips/dts/mt7620a_planex_mzk-750dhp.dts | 7 ++++- .../ramips/dts/mt7620a_planex_mzk-ex750np.dts | 7 ++++- .../mt7620a_ralink_mt7620a-mt7610e-evb.dts | 10 ++++++- .../dts/mt7620a_tplink_archer-c2-v1.dts | 9 ++++-- .../dts/mt7620a_tplink_archer-mr200.dts | 7 ++++- .../ramips/dts/mt7620a_tplink_archer.dtsi | 7 ++++- .../ramips/dts/mt7620a_tplink_re2x0-v1.dtsi | 11 +++++--- .../dts/mt7620a_wavlink_wl-wn530hg4.dts | 7 ++++- .../ramips/dts/mt7620a_wavlink_wl-wn535k1.dts | 7 ++++- .../ramips/dts/mt7620a_wavlink_wl-wn579x3.dts | 7 ++++- .../linux/ramips/dts/mt7620a_wevo_air-duo.dts | 7 ++++- .../ramips/dts/mt7620a_xiaomi_miwifi-mini.dts | 7 ++++- target/linux/ramips/dts/mt7620a_youku_x2.dts | 3 +- .../linux/ramips/dts/mt7620a_youku_yk-l1.dtsi | 4 +++ .../dts/mt7620a_zbtlink_zbt-ape522ii.dts | 7 ++++- .../dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi | 3 +- .../dts/mt7620a_zbtlink_zbt-we1026.dtsi | 4 +++ .../ramips/dts/mt7628an_asus_rt-ac1200-v2.dts | 5 ++++ .../ramips/dts/mt7628an_asus_rt-ac1200.dtsi | 7 ++++- .../dts/mt7628an_buffalo_wcr-1166ds.dts | 7 ++++- .../dts/mt7628an_comfast_cf-wr617ac.dts | 9 ++++-- .../dts/mt7628an_comfast_cf-wr758ac-v2.dts | 5 ++++ .../dts/mt7628an_comfast_cf-wr758ac.dtsi | 7 ++++- .../linux/ramips/dts/mt7628an_cudy_wr1000.dts | 7 ++++- .../ramips/dts/mt7628an_elecom_wrc-1167fs.dts | 7 ++++- .../ramips/dts/mt7628an_hiwifi_hc5761a.dts | 3 +- .../ramips/dts/mt7628an_hiwifi_hc5861b.dts | 5 ++-- .../ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi | 4 +++ target/linux/ramips/dts/mt7628an_iptime.dtsi | 7 ++++- .../ramips/dts/mt7628an_keenetic_kn-1613.dts | 7 ++++- .../ramips/dts/mt7628an_linksys_e5400.dts | 9 ++++-- .../dts/mt7628an_mercury_mac1200r-v2.dts | 10 ++++++- .../ramips/dts/mt7628an_motorola_mwr03.dts | 7 ++++- .../ramips/dts/mt7628an_netgear_r6xxx.dtsi | 7 ++++- .../ramips/dts/mt7628an_ravpower_rp-wd009.dts | 7 ++++- .../ramips/dts/mt7628an_totolink_lr1200.dts | 7 ++++- .../dts/mt7628an_tplink_8m-split-uboot.dtsi | 4 +++ .../linux/ramips/dts/mt7628an_tplink_8m.dtsi | 4 +++ .../dts/mt7628an_tplink_archer-c20-v4.dts | 5 ++-- .../dts/mt7628an_tplink_archer-c20-v5.dts | 5 ++-- .../dts/mt7628an_tplink_archer-c50-v3.dts | 5 ++-- .../dts/mt7628an_tplink_archer-c50-v4.dts | 5 ++-- .../ramips/dts/mt7628an_tplink_re200.dtsi | 9 ++++-- .../ramips/dts/mt7628an_tplink_re305-v1.dts | 10 ++++--- .../ramips/dts/mt7628an_tplink_re305-v3.dts | 10 ++++--- .../dts/mt7628an_tplink_tl-wr902ac-v3.dts | 5 ++-- .../dts/mt7628an_wavlink_wl-wn531a3.dts | 7 ++++- .../dts/mt7628an_wavlink_wl-wn570ha1.dts | 7 ++++- .../dts/mt7628an_wavlink_wl-wn575a3.dts | 7 ++++- .../dts/mt7628an_wavlink_wl-wn576a2.dts | 7 ++++- .../dts/mt7628an_wavlink_wl-wn577a2.dts | 7 ++++- .../dts/mt7628an_wavlink_wl-wn578a2.dts | 7 ++++- .../ramips/dts/mt7628an_xiaomi_mi-ra75.dts | 3 +- .../dts/mt7628an_xiaomi_mi-router-4.dtsi | 4 +++ ...mt7628an_xiaomi_mi-router-4a-100m-intl.dts | 3 +- .../dts/mt7628an_xiaomi_mi-router-4a-100m.dts | 3 +- .../dts/mt7628an_zyxel_keenetic-extra-ii.dts | 7 ++++- 93 files changed, 512 insertions(+), 161 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts index 2b9434b2448..3bc0e69bfe2 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts @@ -84,7 +84,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -143,6 +144,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts index 0710b255710..b482b6dfc91 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts @@ -8,6 +8,7 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts index acc60807b68..2a94f5d29d0 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts @@ -10,7 +10,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi index 20dab4f09fd..3d4e6a1aad4 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi @@ -90,6 +90,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts index 8788d9d93b6..e4772a45748 100644 --- a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts +++ b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts @@ -93,6 +93,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -146,7 +150,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts index 892bd73502b..11f4d8c6c66 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts @@ -125,6 +125,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -182,7 +186,8 @@ wifi@0,0 { compatible = "pci0,0"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi index c25db1d9d83..e1ff1ecd427 100644 --- a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi +++ b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi @@ -92,6 +92,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -163,10 +167,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts index 1d29bed6f06..f73feb58c96 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts @@ -94,9 +94,20 @@ }; config: partition@ff0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_config_e05d: eeprom@e05d { + reg = <0xe05d 0x200>; + }; + + macaddr_config_e490: macaddr@e490 { + reg = <0xe490 0x6>; + }; }; }; }; @@ -117,10 +128,9 @@ &pcie0 { mt76x0e@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_config_e490>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_config_e05d>, <&macaddr_config_e490>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(2)>; - mediatek,mtd-eeprom = <&config 0xe05d>; }; }; @@ -130,13 +140,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e490: macaddr@e490 { - reg = <0xe490 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts index 995255ee8ad..ae0b7c12101 100755 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts @@ -102,6 +102,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -151,11 +155,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - - nvmem-cells = <&macaddr_factory_8004>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-3)>; led { diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts index 8ae566d448b..8c9ab02f447 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts @@ -115,9 +115,20 @@ }; config: partition@ff0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_config_e083: eeprom@e083 { + reg = <0xe083 0x200>; + }; + + macaddr_config_e496: macaddr@e496 { + reg = <0xe496 0x6>; + }; }; }; }; @@ -145,10 +156,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_config_e496>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_config_e083>, <&macaddr_config_e496>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(2)>; - mediatek,mtd-eeprom = <&config 0xe083>; led { led-sources = <0>; @@ -192,13 +202,3 @@ mediatek,port4-gmac; mediatek,ephy-base = /bits/ 8 <8>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e496: macaddr@e496 { - reg = <0xe496 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts index 3de9533edc7..a3e65c64689 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts @@ -30,5 +30,7 @@ }; &wifi { - mediatek,mtd-eeprom = <&config 0xe08e>; + nvmem-cells = <&eeprom_config_e08e>, <&macaddr_config_e50e>; + nvmem-cell-names = "eeprom", "mac-address"; + mac-address-increment = <2>; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts index 7eae6666688..f80aa716819 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts @@ -58,5 +58,7 @@ }; &wifi { - mediatek,mtd-eeprom = <&config 0xe29e>; + nvmem-cells = <&eeprom_config_e29e>, <&macaddr_config_e50e>; + nvmem-cell-names = "eeprom", "mac-address"; + mac-address-increment = <2>; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi b/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi index a5fd705eba9..4a6bab21a15 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi @@ -120,9 +120,6 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_e50e>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; }; @@ -155,13 +152,20 @@ config: partition@ff0000 { compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - label = "config"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + eeprom_config_e08e: eeprom@e08e { + reg = <0xe08e 0x200>; + }; + + eeprom_config_e29e: eeprom@e29e { + reg = <0xe29e 0x200>; + }; + macaddr_config_e50e: macaddr@e50e { reg = <0xe50e 0x6>; }; diff --git a/target/linux/ramips/dts/mt7620a_domywifi.dtsi b/target/linux/ramips/dts/mt7620a_domywifi.dtsi index 3336f9c6c51..d627d7b4fe6 100644 --- a/target/linux/ramips/dts/mt7620a_domywifi.dtsi +++ b/target/linux/ramips/dts/mt7620a_domywifi.dtsi @@ -125,6 +125,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -175,7 +179,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts index ba1a2becdab..0c61dcb24d7 100644 --- a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts +++ b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts @@ -79,9 +79,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -153,7 +160,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts index 5a311ba895e..edacffb1b14 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts @@ -152,6 +152,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -213,7 +217,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts index 8e2030a5072..c0893cd6232 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts @@ -110,6 +110,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -205,7 +209,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; mediatek,2ghz = <0>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts index ea8b8c9121c..3a3bc9aec6e 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts @@ -102,6 +102,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -197,7 +201,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; mediatek,2ghz = <0>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi index d5db3958d80..f7745b85e96 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi @@ -91,6 +91,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -196,10 +200,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts index ff6844060e9..f374c75f864 100644 --- a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts +++ b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts @@ -88,6 +88,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -168,7 +172,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts index 869453fe750..84f1153ecca 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts @@ -101,6 +101,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4000: macaddr@4000 { reg = <0x4000 0x6>; }; @@ -151,7 +155,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts index d2ff424bcfd..f435ceb9f60 100644 --- a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts +++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts @@ -93,6 +93,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -187,7 +191,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts index d1a7f69e176..741a4667696 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts @@ -64,7 +64,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts index 87eacb13d78..ef22a6639d4 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts @@ -101,7 +101,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi index 508d60f6b68..733cdeaf39f 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi @@ -63,6 +63,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; diff --git a/target/linux/ramips/dts/mt7620a_humax_e2.dts b/target/linux/ramips/dts/mt7620a_humax_e2.dts index 92e4d58be7d..de7b6ddf57b 100644 --- a/target/linux/ramips/dts/mt7620a_humax_e2.dts +++ b/target/linux/ramips/dts/mt7620a_humax_e2.dts @@ -99,6 +99,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_10007: macaddr@10007 { reg = <0x10007 0x6>; }; @@ -128,7 +132,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts index eacfcc152f3..f27274d6e17 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts @@ -108,9 +108,16 @@ }; iNIC_rf: partition@48000 { + compatible = "nvmem-cells"; label = "iNIC_rf"; reg = <0x48000 0x8000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -214,7 +221,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts index d7ef17abbc2..71a66a799d7 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts @@ -122,9 +122,16 @@ }; iNIC_rf: partition@48000 { + compatible = "nvmem-cells"; label = "iNIC_rf"; reg = <0x48000 0x8000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; partition@50000 { @@ -192,7 +199,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_iptime.dtsi b/target/linux/ramips/dts/mt7620a_iptime.dtsi index f5e33850ca1..be43f9bc99b 100644 --- a/target/linux/ramips/dts/mt7620a_iptime.dtsi +++ b/target/linux/ramips/dts/mt7620a_iptime.dtsi @@ -40,6 +40,10 @@ reg = <0x1f400 0x200>; }; + eeprom_uboot_1f800: eeprom@1f800 { + reg = <0x1f800 0x200>; + }; + macaddr_uboot_1fc20: macaddr@1fc20 { reg = <0x1fc20 0x6>; }; @@ -80,7 +84,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&uboot 0x1f800>; + nvmem-cells = <&eeprom_uboot_1f800>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index 07355a05a5a..f7a5aed064c 100644 --- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -92,9 +92,20 @@ }; config: partition@ff0000 { + compatible = "nvmem-cells"; label = "config"; reg = <0xff0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_config_e08a: eeprom@e08a { + reg = <0xe08a 0x200>; + }; + + macaddr_config_e07e: macaddr@e07e { + reg = <0xe07e 0x6>; + }; }; }; }; @@ -150,10 +161,9 @@ &pcie0 { mt76x0e@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_config_e07e>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; - mediatek,mtd-eeprom = <&config 0xe08a>; + nvmem-cells = <&eeprom_config_e08a>, <&macaddr_config_e07e>; + nvmem-cell-names = "eeprom", "mac-address"; + mac-address-increment = <2>; }; }; @@ -163,13 +173,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e07e: macaddr@e07e { - reg = <0xe07e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts index 4c0ce75281e..f7b296d2501 100644 --- a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts +++ b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts @@ -76,6 +76,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -165,7 +169,8 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi index 0360cff26fc..f30b1265fed 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi @@ -66,6 +66,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -95,7 +99,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi index c6f95b4c770..5be2a2f0449 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi +++ b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi @@ -109,6 +109,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -142,7 +146,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts index f768ac21141..93f0924bd4f 100644 --- a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts +++ b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts @@ -85,6 +85,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -166,7 +170,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi b/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi index e8aed7e2851..36cbf20f328 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi +++ b/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi @@ -80,6 +80,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -102,7 +106,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts index 13230a9c43b..e3c15871bce 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts @@ -85,6 +85,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -123,7 +127,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts index 2f14d39ac1d..5a6dee77ec5 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts @@ -95,6 +95,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -138,6 +142,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts index 41ea54ba2d5..a6b46d821a3 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts @@ -115,6 +115,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -163,6 +167,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts index b7a71c3e25a..46f3cfd3abc 100644 --- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts @@ -50,9 +50,16 @@ }; factory: partition@40000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { @@ -82,7 +89,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts index 4bce556de85..a75cbf43fcb 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts @@ -135,6 +135,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x200>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -197,9 +201,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts index 47cbf9b243c..dab106b9bfd 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts @@ -168,6 +168,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x200>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -205,6 +209,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi index 32a14a2b750..6edb7012c8e 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi @@ -98,6 +98,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x200>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -132,7 +136,8 @@ &pcie0 { wifi: mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi index 9e4e6460209..e0cb10aac69 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi @@ -80,6 +80,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x200>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -102,10 +106,9 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_uboot_1fc00>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_uboot_1fc00>; + nvmem-cell-names = "eeprom", "mac-address"; + mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts index f1a05dac783..9ab3a70d14b 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts @@ -83,6 +83,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -136,7 +140,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts index 5d07db9708a..9938c00531c 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts @@ -104,6 +104,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -131,7 +135,8 @@ &pcie0 { wifi0: wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts index 886de51dae0..0c22e9199be 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts @@ -132,6 +132,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -165,7 +169,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts b/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts index 54fcb32c0ba..2ecb78f9b5c 100644 --- a/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts +++ b/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts @@ -93,6 +93,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -187,7 +191,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts index b70a95d7769..a8a7db80828 100644 --- a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts +++ b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts @@ -109,6 +109,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -169,7 +173,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_youku_x2.dts b/target/linux/ramips/dts/mt7620a_youku_x2.dts index ad9e252f65f..da1e61e4fe5 100644 --- a/target/linux/ramips/dts/mt7620a_youku_x2.dts +++ b/target/linux/ramips/dts/mt7620a_youku_x2.dts @@ -27,7 +27,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi index 9e5227d848c..29ae863df03 100644 --- a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi +++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi @@ -91,6 +91,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts index 80c4f3640d8..d85e35b6944 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts @@ -91,6 +91,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -130,7 +134,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi index f86ac1a88ae..39c50c7366d 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi @@ -44,7 +44,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi index e2f5c28c707..1c7e1782cba 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi @@ -64,6 +64,10 @@ reg = <0x0 0x200>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts index 2dd38fba4b1..3edb6dad550 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts @@ -7,6 +7,11 @@ model = "ASUS RT-AC1200 V2"; }; +&eeprom_factory_8000 { + /* V2 has different eeprom size '0x4da8' for MT7613 */ + reg = <0x8000 0x4da8>; +}; + &state_default { spis { groups = "spis"; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi index 746436570fc..7a13921aa55 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi @@ -84,6 +84,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -132,7 +136,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts index 4f37fb89404..7f774163377 100644 --- a/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts +++ b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts @@ -102,7 +102,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -150,6 +151,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts index 6a7bdfab079..4270c48ad9f 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts @@ -81,6 +81,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_8004: macaddr@8004 { reg = <0x8004 0x6>; }; @@ -107,10 +111,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_8004>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts index bc476f2617e..b5a789f8a68 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts @@ -6,3 +6,8 @@ compatible = "comfast,cf-wr758ac-v2", "mediatek,mt7628an-soc"; model = "COMFAST CF-WR758AC V2"; }; + +&eeprom_factory_8000 { + /* V2 has different eeprom size '0x4da8' for MT7613 */ + reg = <0x8000 0x4da8>; +}; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi index 4993e15f24e..e8cabd7fd86 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi @@ -53,7 +53,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -95,6 +96,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts index bbdd6fe35f3..57405632ddd 100644 --- a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts +++ b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts @@ -100,6 +100,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -130,7 +134,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts index f795838f8f2..4e68137f3b2 100644 --- a/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts +++ b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts @@ -113,6 +113,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -159,7 +163,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts index 828e5b8b2d0..5ec041c8048 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts @@ -58,7 +58,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts index a3ca7b9c843..44ebef2ad5c 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts @@ -42,10 +42,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_factory_2e>; - nvmem-cell-names = "mac-address"; ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_2e>; + nvmem-cell-names = "eeprom", "mac-address"; led { led-sources = <2>; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi index ad8d6cbfe17..cfd4bb1dc53 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi @@ -68,6 +68,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_iptime.dtsi b/target/linux/ramips/dts/mt7628an_iptime.dtsi index 3f81fb56a71..22cc368b0b9 100644 --- a/target/linux/ramips/dts/mt7628an_iptime.dtsi +++ b/target/linux/ramips/dts/mt7628an_iptime.dtsi @@ -72,6 +72,10 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; partition@40000 { @@ -111,7 +115,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts index 510bada246d..117f278f129 100644 --- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts @@ -141,6 +141,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -219,7 +223,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0400>; + nvmem-cells = <&eeprom_factory_400>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts index ed1479dcd8f..24fd31a7e20 100644 --- a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts +++ b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts @@ -89,6 +89,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; @@ -135,11 +139,10 @@ wifi5: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <3>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts index 4a7915b9f00..fee64bc53fc 100644 --- a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts +++ b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts @@ -60,9 +60,16 @@ }; art: partition@1e000 { + compatible = "nvmem-cells"; label = "art"; reg = <0x1e000 0x2000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; }; partition@20000 { @@ -108,7 +115,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&art 0x1000>; + nvmem-cells = <&eeprom_art_1000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts b/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts index b852c11e06f..f2895481ed6 100644 --- a/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts +++ b/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts @@ -79,6 +79,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -130,7 +134,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi index a6fa581b7d6..ba38839129e 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi +++ b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi @@ -91,6 +91,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -124,7 +128,8 @@ &pcie0 { wifi5: wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts index e8cb360cca0..b2e0a5eacaf 100644 --- a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts +++ b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts @@ -106,7 +106,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5470000 6000000>; }; }; @@ -148,6 +149,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts index 4de621196c1..ea07ebe492f 100644 --- a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts +++ b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts @@ -100,7 +100,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -154,6 +155,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi index edf5d89054a..7464d1c85dc 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -81,6 +81,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index 4e4e3c735a1..b3c62eb4883 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -59,6 +59,10 @@ eeprom_factory_20000: eeprom@20000 { reg = <0x20000 0x400>; }; + + eeprom_factory_28000: eeprom@28000 { + reg = <0x28000 0x200>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts index 02d0144f4ae..2225b633338 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -99,10 +99,9 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x28000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts index 7f5b3d557a5..04eba88d198 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts @@ -94,10 +94,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts index ab81b094934..f628908b980 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -94,10 +94,9 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x28000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts index 164cf7a170f..87927da62a4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts @@ -92,10 +92,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi b/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi index d129acec0cc..24236e5c7fe 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi @@ -119,6 +119,10 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -152,10 +156,9 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts index 6b525832734..88d96bfa020 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts @@ -61,16 +61,18 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; }; &wlan5g { - mediatek,mtd-eeprom = <&radio 0x8000>; - - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <2>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts index 9f80bd57fb1..c6ae357e19c 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts @@ -56,16 +56,18 @@ eeprom_radio_0: eeprom@0 { reg = <0x0 0x400>; }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; }; &wlan5g { - mediatek,mtd-eeprom = <&radio 0x8000>; - - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-2)>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts index 9be8529bbf8..b49dc61a4cf 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts @@ -90,10 +90,9 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x28000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts index 7a60906a566..25a1c1ac8ff 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts @@ -77,7 +77,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -119,6 +120,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts index 23f81619ee1..ddf2723633c 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts @@ -67,7 +67,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -109,6 +110,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_2e: macaddr@2e { reg = <0x2e 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts index 65f6f47b96f..8bdf764fdd2 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts @@ -62,7 +62,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -104,6 +105,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts index 9ea2a3a65ff..58d5bf9168e 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts @@ -101,7 +101,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -143,6 +144,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts index 456b3ad1511..bc9bef13287 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts @@ -66,7 +66,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -108,6 +109,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts index 267001d950a..7abab0044d1 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts @@ -96,7 +96,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -138,6 +139,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_28: macaddr@28 { reg = <0x28 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts index 51b99300b31..8859038c30e 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts @@ -84,7 +84,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi index c5465386580..51737a965d1 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi @@ -58,6 +58,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts index 0d647c6153c..809a0af30af 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts @@ -57,7 +57,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts index 7ae6b18f727..7b40cdb6af3 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts @@ -57,7 +57,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts index cbe390a4de3..d173f536972 100644 --- a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -132,6 +132,10 @@ reg = <0x0 0x400>; }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; }; @@ -216,7 +220,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; From 95e241d2af820d92bad63a5daa3823174d549ba5 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 15 Oct 2023 09:40:06 +0800 Subject: [PATCH 74/78] ramips: remove useless status property from wmac dts node On the ramips target, all 'wmac' nodes in SoC dtsi are enabled by default except mt7628. There is no need to mark them as 'okay' again. So these useless properties can be removed. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts | 2 -- target/linux/ramips/dts/rt2880_airlink101_ar670w.dts | 1 - target/linux/ramips/dts/rt2880_airlink101_ar725w.dts | 1 - target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts | 1 - target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts | 1 - target/linux/ramips/dts/rt3662_asus_rt-n56u.dts | 1 - target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts | 1 - target/linux/ramips/dts/rt3662_engenius_esr600h.dts | 2 -- target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts | 1 - target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts | 1 - target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi | 1 - target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts | 1 - target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts | 1 - target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts | 1 - target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts | 1 - target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts | 1 - target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts | 1 - 17 files changed, 19 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts b/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts index 3c7df99cffe..e6c752a5017 100644 --- a/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts +++ b/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts @@ -184,8 +184,6 @@ }; &wmac { - status = "okay"; - nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts index 23e4db3aec8..4c9014b7d86 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts @@ -115,7 +115,6 @@ }; &wmac { - status = "okay"; nvmem-cells = <&eeprom_factory_2000>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts index 8f1c07008a5..95df28163ec 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts @@ -125,7 +125,6 @@ }; &wmac { - status = "okay"; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts index 02c3f3c3351..8ab53323d49 100644 --- a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts +++ b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts @@ -244,7 +244,6 @@ }; &wmac { - status = "okay"; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts index d5ab080ed51..ab058f2fea4 100644 --- a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts +++ b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts @@ -120,7 +120,6 @@ }; &wmac { - status = "okay"; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts index 62b84207bd0..1188f147b9c 100644 --- a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts +++ b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts @@ -150,7 +150,6 @@ }; &wmac { - status = "okay"; ralink,2ghz = <0>; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; diff --git a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts index b9b44bd5128..a891ab657ea 100644 --- a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts +++ b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts @@ -166,7 +166,6 @@ }; &wmac { - status = "okay"; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts index 6f0d633f972..e785f110433 100644 --- a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts +++ b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts @@ -168,8 +168,6 @@ }; &wmac { - status = "okay"; - ralink,2ghz = <0>; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; diff --git a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts index dfcdb760884..b87a573313b 100644 --- a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts +++ b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts @@ -68,7 +68,6 @@ }; &wmac { - status = "okay"; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts index 7d1d8ef5539..e4c31ae6b1a 100644 --- a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts +++ b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts @@ -152,7 +152,6 @@ }; &wmac { - status = "okay"; ralink,2ghz = <0>; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; diff --git a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi index c6213a6b17b..22b6ee40a94 100644 --- a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi +++ b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi @@ -88,7 +88,6 @@ }; &wmac { - status = "okay"; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts index 03f7cae6a5d..cb54cf0f8f2 100644 --- a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts +++ b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts @@ -185,7 +185,6 @@ }; &wmac { - status = "okay"; ralink,2ghz = <0>; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts index 112e5a6fbc8..1b9d6c06551 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts @@ -125,7 +125,6 @@ }; &wmac { - status = "okay"; ralink,5ghz = <0>; nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; nvmem-cell-names = "eeprom", "mac-address"; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts index 680a0e06fe8..daf92b90f01 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts @@ -151,7 +151,6 @@ }; &wmac { - status = "okay"; ralink,5ghz = <0>; nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; nvmem-cell-names = "eeprom", "mac-address"; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts index 00f4bd0d2c4..ff8cb821cca 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts @@ -115,7 +115,6 @@ }; &wmac { - status = "okay"; ralink,led-polarity = <1>; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts index 780e92439b1..bf3d6bb31b8 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts @@ -116,7 +116,6 @@ }; &wmac { - status = "okay"; ralink,led-polarity = <1>; nvmem-cells = <&eeprom_devdata_4000>; nvmem-cell-names = "eeprom"; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts index 67d72e0d4f3..38e2315edb4 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts @@ -118,7 +118,6 @@ }; &wmac { - status = "okay"; ralink,led-polarity = <1>; nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; From b5d059d6777a07b6473e340c1ec4b0289a855ecb Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 15 Oct 2023 10:57:44 +0800 Subject: [PATCH 75/78] ramips: fix frequency limit property for some Edimax devices These three devices uses MT7612E PCIe NIC and supported by the 'mt76' driver. So the right frequency limit property should be `ieee80211-freq-limit`. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts | 2 +- target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts index c0893cd6232..b8292624745 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts @@ -211,7 +211,7 @@ reg = <0x0000 0 0 0 0>; nvmem-cells = <&eeprom_factory_8000>; nvmem-cell-names = "eeprom"; - mediatek,2ghz = <0>; + ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts index 3a3bc9aec6e..f6aa606917a 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts @@ -203,7 +203,7 @@ reg = <0x0000 0 0 0 0>; nvmem-cells = <&eeprom_factory_8000>; nvmem-cell-names = "eeprom"; - mediatek,2ghz = <0>; + ieee80211-freq-limit = <5000000 6000000>; }; }; From 366ffa53bd0b31bc3633828686d791ad5e3d7f7f Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 15 Oct 2023 11:04:46 +0800 Subject: [PATCH 76/78] ramips: fix factory partition size for SNR-CPE-W4N The starting address of 'factory' partition is 0x40000, and the starting address of the next partition is 0x50000. It's obvious that the correct size for the 'factory' is 0x10000, just like other MT7620 devices. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts b/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts index 987869a0f3f..a1a56068429 100644 --- a/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts +++ b/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts @@ -93,7 +93,7 @@ factory: partition@40000 { compatible = "nvmem-cells"; label = "Factory"; - reg = <0x40000 0x100000>; + reg = <0x40000 0x10000>; #address-cells = <1>; #size-cells = <1>; read-only; From 9921973ca426e1df97760df35a62e676e2389ea3 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Mon, 2 Oct 2023 11:42:23 +0800 Subject: [PATCH 77/78] ramips: add missing mt76 packages for Telco Electronics X1 Telco Electronics X1 has MT7603E and MT7612E PCIe NICs. They are driven by kmod-mt7603 and kmod-mt76x2. Ref: 73e0f52b6e4e ("ramips: add support for Telco Electronics X1") Signed-off-by: Shiji Yang --- target/linux/ramips/image/mt7621.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 9838810af43..dc9e5515a7b 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2128,7 +2128,7 @@ define Device/telco-electronics_x1 IMAGE_SIZE := 16064k DEVICE_VENDOR := Telco Electronics DEVICE_MODEL := X1 - DEVICE_PACKAGES := kmod-usb3 kmod-mt76 -uboot-envtools + DEVICE_PACKAGES := kmod-usb3 kmod-mt7603 kmod-mt76x2 -uboot-envtools endef TARGET_DEVICES += telco-electronics_x1 From 6f31941d384dbea290cee6f216b260902e04b92c Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Tue, 17 Oct 2023 20:57:07 +0800 Subject: [PATCH 78/78] Revert "ramips: convert MT7915 EEPROM to NVMEM format" Some MT7915 devices need to load the second part of the eeprom to work properly. The mt76 driver is not yet ready to read the pre-cal data via the NVMEM cell. Therefore, partially revert commit to fix the device probe issue on some devices. P.S. Except for D-Link and Ubnt devices, It is still uncertain whether pre-cal data is required for other devices in the patch. This partially reverts commit 9ac891f8c44124e931c15f1257347cd8ba311a19. Fixes: https://github.com/openwrt/openwrt/issues/13700 Signed-off-by: Shiji Yang --- .../linux/ramips/dts/mt7621_asus_rt-ax53u.dts | 12 +++---- .../linux/ramips/dts/mt7621_asus_rt-ax54.dts | 12 +++---- .../ramips/dts/mt7621_comfast_cf-e390ax.dts | 24 +++++++------- target/linux/ramips/dts/mt7621_cudy_m1800.dts | 10 +----- target/linux/ramips/dts/mt7621_cudy_x6.dtsi | 10 +----- .../ramips/dts/mt7621_dlink_dap-x1860-a1.dts | 12 +++---- .../ramips/dts/mt7621_iptime_ax2004m.dts | 12 +++---- .../ramips/dts/mt7621_mercusys_mr70x-v1.dts | 29 ++++++++-------- .../linux/ramips/dts/mt7621_netgear_eax12.dts | 10 +----- .../dts/mt7621_tplink_archer-ax23-v1.dts | 29 ++++++++-------- .../ramips/dts/mt7621_tplink_eap613-v1.dts | 10 +----- .../dts/mt7621_tplink_eap615-wall-v1.dts | 27 +++++++-------- .../ramips/dts/mt7621_ubnt_unifi-6-lite.dts | 10 +++--- .../ramips/dts/mt7621_wavlink_wl-wn573hx1.dts | 26 +++++++-------- .../linux/ramips/dts/mt7621_yuncore_ax820.dts | 24 +++++++------- .../ramips/dts/mt7621_yuncore_fap640.dts | 33 +++++++++---------- .../ramips/dts/mt7621_yuncore_fap690.dts | 24 +++++++------- .../linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi | 27 +++++++-------- .../linux/ramips/dts/mt7621_zyxel_wsm20.dts | 32 +++++++++--------- 19 files changed, 149 insertions(+), 224 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts index 8aa141b1080..d740d00c6df 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts @@ -95,16 +95,13 @@ }; factory: partition@1e0000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x1e0000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -158,8 +155,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0000>; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts index 571d8375a4b..3191692e4ef 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts @@ -87,16 +87,13 @@ }; factory: partition@1e0000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x1e0000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -131,8 +128,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0000>; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts index 8c0dd1ac2e0..80600470e77 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts @@ -59,8 +59,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; }; }; @@ -88,20 +87,9 @@ }; factory: partition@50000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; }; partition@90000 { @@ -113,6 +101,16 @@ }; }; +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; +}; + &gmac0 { nvmem-cells = <&macaddr_factory_e000>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ramips/dts/mt7621_cudy_m1800.dts b/target/linux/ramips/dts/mt7621_cudy_m1800.dts index 90110da4fb3..314fdb206ca 100644 --- a/target/linux/ramips/dts/mt7621_cudy_m1800.dts +++ b/target/linux/ramips/dts/mt7621_cudy_m1800.dts @@ -81,8 +81,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0000>; mediatek,disable-radar-background; }; }; @@ -115,16 +114,9 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; partition@50000 { diff --git a/target/linux/ramips/dts/mt7621_cudy_x6.dtsi b/target/linux/ramips/dts/mt7621_cudy_x6.dtsi index 84e053cb42a..4c34f58a4b2 100644 --- a/target/linux/ramips/dts/mt7621_cudy_x6.dtsi +++ b/target/linux/ramips/dts/mt7621_cudy_x6.dtsi @@ -76,16 +76,9 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; /* additional partitions in DTS */ @@ -101,8 +94,7 @@ wifi:wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0000>; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts index 3be48e11af6..818d2d8c413 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts @@ -125,16 +125,13 @@ }; factory: partition@100000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -178,8 +175,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts index 10fa667f04a..554d73ce3d4 100644 --- a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts +++ b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts @@ -73,16 +73,13 @@ }; factory: partition@100000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; macaddr_factory_4: macaddr@4 { reg = <0x4 0x6>; @@ -171,7 +168,6 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; }; }; diff --git a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts index ce365450aba..245d130a1fc 100644 --- a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts +++ b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts @@ -72,16 +72,9 @@ }; config: partition@fa0000 { - compatible = "nvmem-cells"; label = "config"; reg = <0xfa0000 0x010000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; }; partition@fb0000 { @@ -91,16 +84,9 @@ }; radio: partition@ff0000 { - compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x010000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_radio_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; }; }; @@ -114,8 +100,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; - nvmem-cell-names = "eeprom", "mac-address"; + mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&macaddr_config_8>; + nvmem-cell-names = "mac-address"; mediatek,disable-radar-background; }; }; @@ -166,3 +153,13 @@ function = "gpio"; }; }; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_netgear_eax12.dts b/target/linux/ramips/dts/mt7621_netgear_eax12.dts index e65d881e826..d5ad404be0b 100644 --- a/target/linux/ramips/dts/mt7621_netgear_eax12.dts +++ b/target/linux/ramips/dts/mt7621_netgear_eax12.dts @@ -107,16 +107,9 @@ }; factory: partition@100000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x80000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; partition@180000 { @@ -178,8 +171,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts index 69652772acf..50834c58664 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts @@ -105,16 +105,9 @@ }; config: partition@fa0000 { - compatible = "nvmem-cells"; label = "config"; reg = <0xfa0000 0x010000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; }; partition@fb0000 { @@ -124,16 +117,9 @@ }; radio: partition@ff0000 { - compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x010000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_radio_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; }; }; @@ -147,8 +133,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; - nvmem-cell-names = "eeprom", "mac-address"; + mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&macaddr_config_8>; + nvmem-cell-names = "mac-address"; mediatek,disable-radar-background; }; }; @@ -204,3 +191,13 @@ function = "gpio"; }; }; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts index 277b2bbcf48..d25bf575602 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts @@ -108,16 +108,9 @@ }; radio: partition@ff0000 { - compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_radio_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; }; }; @@ -138,8 +131,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&radio 0x0>; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts index d23ab9c4db4..58e4bbf7574 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts @@ -90,16 +90,9 @@ }; info: partition@90000 { - compatible = "nvmem-cells"; label = "product-info"; reg = <0x90000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; }; partition@a0000 { @@ -127,16 +120,9 @@ }; radio: partition@ff0000 { - compatible = "nvmem-cells"; label = "radio"; reg = <0xff0000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_radio_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; }; }; @@ -157,8 +143,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&radio 0x0>; mediatek,disable-radar-background; }; }; @@ -201,3 +186,13 @@ }; }; }; + +&info { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts index c0b6b775859..8f78a60557c 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -47,10 +47,6 @@ eeprom_factory_0: eeprom@0 { reg = <0x0 0x400>; }; - - eeprom_factory_20000: eeprom@20000 { - reg = <0x20000 0xe00>; - }; }; eeprom: partition@b0000 { @@ -108,8 +104,10 @@ &wlan_5g { compatible = "mediatek,mt76"; - nvmem-cells = <&eeprom_factory_20000>, <&macaddr_eeprom_6>; - nvmem-cell-names = "eeprom", "mac-address"; + mediatek,mtd-eeprom = <&factory 0x20000>; + + nvmem-cells = <&macaddr_eeprom_6>; + nvmem-cell-names = "mac-address"; /* This is a workaround. * diff --git a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts index 1bdbebfad77..d8a94c85b9f 100755 --- a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts @@ -61,8 +61,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; }; }; @@ -88,19 +87,8 @@ }; factory:partition@50000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x40000>; - #address-cells = <1>; - #size-cells = <1>; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; }; partition@90000 { @@ -131,3 +119,15 @@ }; }; }; + + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + +}; diff --git a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts index 277c584509a..1aba94a9125 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts @@ -112,20 +112,9 @@ */ factory: partition@50000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x50000 0x40000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; }; partition@90000 { @@ -145,8 +134,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; mediatek,disable-radar-background; }; }; @@ -190,3 +178,13 @@ function = "gpio"; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_yuncore_fap640.dts b/target/linux/ramips/dts/mt7621_yuncore_fap640.dts index 8fd6ad347ed..d525dde385b 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap640.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap640.dts @@ -120,24 +120,9 @@ */ factory: partition@50000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x50000 0x40000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; }; partition@90000 { @@ -157,8 +142,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; mediatek,disable-radar-background; }; }; @@ -217,3 +201,18 @@ function = "gpio"; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; +}; + diff --git a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts index 35e320b9745..a998b95d4c5 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts @@ -90,20 +90,9 @@ */ factory: partition@50000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x50000 0x40000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; }; partition@90000 { @@ -123,8 +112,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; mediatek,disable-radar-background; }; }; @@ -149,3 +137,13 @@ function = "gpio"; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi index 8dfb2ceaa78..fa7e23dd471 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi +++ b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi @@ -37,16 +37,9 @@ }; factory: partition@100000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; }; partition@180000 { @@ -100,16 +93,9 @@ }; mrd: partition@7780000 { - compatible = "nvmem-cells"; label = "mrd"; reg = <0x7780000 0x80000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - - macaddr_mrd_1fff8: macaddr@1fff8 { - reg = <0x1fff8 0x6>; - }; }; }; }; @@ -123,8 +109,7 @@ reg = <0x0 0 0 0 0>; compatible = "mediatek,mt76"; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; /* MAC-Address set in userspace */ }; @@ -144,6 +129,16 @@ }; }; +&mrd { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mrd_1fff8: macaddr@1fff8 { + reg = <0x1fff8 0x6>; + }; +}; + &state_default { gpio { groups = "uart3"; diff --git a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts index 5615e568649..299d982dc11 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts @@ -103,24 +103,9 @@ }; factory: partition@200000 { - compatible = "nvmem-cells"; reg = <0x200000 0x1c0000>; - #address-cells = <1>; - #size-cells = <1>; label = "Factory"; read-only; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; - - macaddr_factory_1fdfa: macaddr@1fdfa { - reg = <0x1fdfa 0x6>; - }; - - macaddr_factory_1fdf4: macaddr@1fdf4 { - reg = <0x1fdf4 0x6>; - }; }; partition@3c0000 { @@ -200,8 +185,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; - nvmem-cell-names = "eeprom"; + mediatek,mtd-eeprom = <&factory 0x0>; mediatek,disable-radar-background; }; }; @@ -233,3 +217,17 @@ function = "gpio"; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_1fdfa: macaddr@1fdfa { + reg = <0x1fdfa 0x6>; + }; + + macaddr_factory_1fdf4: macaddr@1fdf4 { + reg = <0x1fdf4 0x6>; + }; +};