diff --git a/config/Config-images.in b/config/Config-images.in index ebbcc98d006..293822975ab 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -218,11 +218,6 @@ menu "Target Images" depends on GRUB_IMAGES || GRUB_EFI_IMAGES default y - config GRUB_SERIAL - string "Serial port device" - depends on GRUB_IMAGES || GRUB_EFI_IMAGES - default "ttyS0" - config GRUB_BAUDRATE int "Serial port baud rate" depends on GRUB_IMAGES || GRUB_EFI_IMAGES @@ -231,7 +226,8 @@ menu "Target Images" config GRUB_FLOWCONTROL bool "Use RTE/CTS on serial console" - depends on GRUB_SERIAL != "" + depends on GRUB_IMAGES || GRUB_EFI_IMAGES + depends on TARGET_SERIAL != "" config GRUB_BOOTOPTS string "Extra kernel boot options" @@ -288,6 +284,11 @@ menu "Target Images" select PACKAGE_kmod-e1000 default y if BUILDBOT + config TARGET_SERIAL + string "Serial port device" + depends on TARGET_x86 || TARGET_armsr + default "ttyS0" + config TARGET_IMAGES_GZIP bool "GZip images" depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armsr || TARGET_malta diff --git a/include/image-commands.mk b/include/image-commands.mk index 0ee26562518..e98861ea56f 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -133,6 +133,8 @@ define Build/append-md5sum-ascii-salted rm $@.salted endef +UBI_NAND_SIZE_LIMIT = $(IMAGE_SIZE) - ($(NAND_SIZE)*20/1024 + 4*$(BLOCKSIZE)) + define Build/append-ubi sh $(TOPDIR)/scripts/ubinize-image.sh \ $(if $(UBOOTENV_IN_UBI),--uboot-env) \ @@ -146,6 +148,8 @@ define Build/append-ubi $(UBINIZE_OPTS) cat $@.tmp >> $@ rm $@.tmp + $(if $(and $(IMAGE_SIZE),$(NAND_SIZE)),\ + $(call Build/check-size,$(UBI_NAND_SIZE_LIMIT))) endef define Build/ubinize-kernel @@ -215,7 +219,7 @@ endef define Build/check-size @imagesize="$$(stat -c%s $@)"; \ - limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \ + limitsize="$$(($(call exp_units,$(if $(1),$(1),$(IMAGE_SIZE)))))"; \ [ $$limitsize -ge $$imagesize ] || { \ $(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \ rm -f $@; \ @@ -389,10 +393,17 @@ define Build/kernel-bin endef define Build/linksys-image - $(TOPDIR)/scripts/linksys-image.sh \ + let \ + size="$$(stat -c%s $@)" \ + pad="$(call exp_units,$(PAGESIZE))" \ + offset="256" \ + pad="(pad - ((size + offset) % pad)) % pad"; \ + dd if=/dev/zero bs=$$pad count=1 | tr '\000' '\377' >> $@ + printf ".LINKSYS.01000409%-15s%08X%-8s%-16s" \ "$(call param_get_default,type,$(1),$(DEVICE_NAME))" \ - $@ $@.new - mv $@.new $@ + "$$(cksum $@ | cut -d ' ' -f1)" \ + "0" "K0000000F0246434" >> $@ + dd if=/dev/zero bs=192 count=1 >> $@ endef define Build/lzma @@ -466,8 +477,8 @@ endef define Build/pad-offset let \ size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(word 1, $(1)))" \ - offset="$(subst k,* 1024,$(word 2, $(1)))" \ + pad="$(call exp_units,$(word 1, $(1)))" \ + offset="$(call exp_units,$(word 2, $(1)))" \ pad="(pad - ((size + offset) % pad)) % pad" \ newsize='size + pad'; \ dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync @@ -636,7 +647,7 @@ endef define Build/zyxel-ras-image let \ - newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \ + newsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \ $(STAGING_DIR_HOST)/bin/mkrasimage \ -b $(RAS_BOARD) \ -v $(RAS_VERSION) \ diff --git a/include/image.mk b/include/image.mk index 4ebff2e9ae0..096ccb5f185 100644 --- a/include/image.mk +++ b/include/image.mk @@ -20,6 +20,8 @@ include $(INCLUDE_DIR)/rootfs.mk override MAKE:=$(_SINGLE)$(SUBMAKE) override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE) +exp_units = $(subst k, * 1024,$(subst m, * 1024k,$(subst g, * 1024m,$(1)))) + target_params = $(subst +,$(space),$*) param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2))) param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3)) @@ -395,6 +397,7 @@ define Device/Init DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2) FACTORY_IMG_NAME := IMAGE_SIZE := + NAND_SIZE := KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX) KERNEL_SUFFIX := -kernel.bin KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX) @@ -455,7 +458,7 @@ DEFAULT_DEVICE_VARS := \ DEVICE_DTS_DIR DEVICE_DTS_OVERLAY DEVICE_DTS_LOADADDR \ DEVICE_FDT_NUM DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \ UIMAGE_TIME SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \ - UBOOT_PATH IMAGE_SIZE \ + UBOOT_PATH IMAGE_SIZE NAND_SIZE \ FACTORY_IMG_NAME FACTORY_SIZE \ DEVICE_PACKAGES DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \ DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 30ee7cd866a..809cec30657 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .139 -LINUX_KERNEL_HASH-5.15.139 = 9c68c10dfe18e59b892e940436dea6a18d167160d55e62563cf7282244d8044e +LINUX_VERSION-5.15 = .141 +LINUX_KERNEL_HASH-5.15.141 = 936d6ac65c692a986b4bde34b7f3d7ad90f7f86f19e4ef320e008d40f07e2cfa diff --git a/include/kernel-6.1 b/include/kernel-6.1 index 01ed1d17070..6038c652a9f 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .63 -LINUX_KERNEL_HASH-6.1.63 = c29d043b01dd4fcc61a24fd027c5c7912b15b1f10d8e3c83a0cb935885f0758d +LINUX_VERSION-6.1 = .65 +LINUX_KERNEL_HASH-6.1.65 = 407229936802a44b1e484c2e9ac3bbe53a65d825cc468ccdbd76281b491ab20a diff --git a/include/u-boot.mk b/include/u-boot.mk index 5969873af48..cffa128b4e6 100644 --- a/include/u-boot.mk +++ b/include/u-boot.mk @@ -27,10 +27,6 @@ ifdef UBOOT_USE_BINMAN endif ifdef UBOOT_USE_INTREE_DTC - $(eval $(call TestHostCommand,swig, \ - Please install the swig package, \ - swig -version)) - $(eval $(call TestHostCommand,python3-dev, \ Please install the python3-dev package, \ python3.11-config --includes 2>&1 | grep 'python3', \ @@ -39,6 +35,14 @@ ifdef UBOOT_USE_INTREE_DTC python3.8-config --includes 2>&1 | grep 'python3', \ python3.7-config --includes 2>&1 | grep 'python3', \ python3-config --includes 2>&1 | grep -E 'python3\.([7-9]|[0-9][0-9])\.?')) + + $(eval $(call TestHostCommand,python3-setuptools, \ + Please install the Python3 setuptools module, \ + $(STAGING_DIR_HOST)/bin/python3 -c 'import setuptools')) + + $(eval $(call TestHostCommand,swig, \ + Please install the swig package, \ + swig -version)) endif export GCC_HONOUR_COPTS=s diff --git a/package/base-files/files/lib/functions/leds.sh b/package/base-files/files/lib/functions/leds.sh index a7532faa2fd..333d900df0c 100644 --- a/package/base-files/files/lib/functions/leds.sh +++ b/package/base-files/files/lib/functions/leds.sh @@ -11,6 +11,36 @@ get_dt_led_path() { echo "$ledpath" } +get_dt_led_color_func() { + local enum + local func + local idx + local label + + [ -e "$1/function" ] && func=$(cat "$1/function") + [ -e "$1/color" ] && idx=$((0x$(hexdump -n 4 -e '4/1 "%02x"' "$1/color"))) + [ -e "$1/function-enumerator" ] && \ + enum=$((0x$(hexdump -n 4 -e '4/1 "%02x"' "$1/function-enumerator"))) + + [ -z "$idx" ] && [ -z "$func" ] && return 2 + + if [ -n "$idx" ]; then + for color in "white" "red" "green" "blue" "amber" \ + "violet" "yellow" "ir" "multicolor" "rgb" \ + "purple" "orange" "pink" "cyan" "lime" + do + [ $idx -eq 0 ] && label="$color" && break + idx=$((idx-1)) + done + fi + + label="$label:$func" + [ -n "$enum" ] && label="$label-$enum" + echo "$label" + + return 0 +} + get_dt_led() { local label local ledpath=$(get_dt_led_path $1) @@ -18,6 +48,7 @@ get_dt_led() { [ -n "$ledpath" ] && \ label=$(cat "$ledpath/label" 2>/dev/null) || \ label=$(cat "$ledpath/chan-name" 2>/dev/null) || \ + label=$(get_dt_led_color_func "$ledpath") || \ label=$(basename "$ledpath") echo "$label" diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index f0b7ba548e3..259a987e6bf 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -191,6 +191,15 @@ define Trusted-Firmware-A/mt7986-spim-nand-ddr4 NAND_TYPE:=spim:2k+64 endef +define Trusted-Firmware-A/mt7986-spim-nand-4k-ddr4 + NAME:=MediaTek MT7986 (SPI-NAND via SPIM, DDR4) + BOOT_DEVICE:=spim-nand + BUILD_SUBTARGET:=filogic + PLAT:=mt7986 + DDR_TYPE:=ddr4 + NAND_TYPE:=spim:4k+256 +endef + define Trusted-Firmware-A/mt7986-nor-ddr3 NAME:=MediaTek MT7986 (SPI-NOR, DDR3) BOOT_DEVICE:=nor @@ -377,6 +386,7 @@ TFA_TARGETS:= \ mt7986-sdmmc-ddr4 \ mt7986-snand-ddr4 \ mt7986-spim-nand-ddr4 \ + mt7986-spim-nand-4k-ddr4 \ mt7988-emmc-ddr3 \ mt7988-nor-ddr3 \ mt7988-sdmmc-ddr3 \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 2ad79700d76..7c0cdf9013f 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -31,6 +31,7 @@ asus,zenwifi-cd6n|\ asus,zenwifi-cd6r|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ +dlink,dap-1720-a1|\ dlink,dir-859-a1|\ dlink,dir-859-a3|\ dlink,dir-869-a1|\ diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index f1497acc364..266fdde93a7 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -38,6 +38,13 @@ bananapi,bpi-r3-mini) ;; esac ;; +cetron,ct3003-stock|\ +cetron,ct3003-ubootmod|\ +cmcc,rax3000m-nand-ubootmod|\ +netgear,wax220|\ +zbtlink,zbt-z8102ax) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" + ;; cmcc,rax3000m) case "$(cmdline_get_var root)" in /dev/mmc*) @@ -58,16 +65,39 @@ cmcc,rax3000m) cmcc,rax3000m-emmc-ubootmod) ubootenv_add_uci_config "/dev/mmcblk0p1" "0x0" "0x80000" "0x80000" ;; -glinet,gl-mt3000) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000" - ;; +glinet,gl-mt2500|\ glinet,gl-mt6000) local envdev=$(find_mmc_part "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x80000" ;; +glinet,gl-mt3000) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000" + ;; +h3c,magic-nx30-pro|\ +h3c,magic-nx30-pro-nmbm|\ +jcg,q30|\ +qihoo,360t7|\ +tplink,tl-xdr4288|\ +tplink,tl-xdr6086|\ +tplink,tl-xdr6088|\ +xiaomi,mi-router-wr30u-ubootmod|\ +xiaomi,redmi-router-ax6000-ubootmod|\ +zyxel,ex5601-t0-ubootmod) + . /lib/upgrade/nand.sh + local envubi=$(nand_find_ubi ubi) + local envdev=/dev/$(nand_find_volume $envubi ubootenv) + local envdev2=/dev/$(nand_find_volume $envubi ubootenv2) + ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1" + ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1" + ;; imou,lc-hx3001-ubootmod) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000" "1" ;; +jdcloud,re-cp-03) + local envdev=$(find_mmc_part "ubootenv" "mmcblk0") + ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1" + ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1" + ;; livinet,zr-3020|\ livinet,zr-3020-ubootmod|\ qihoo,360t7-ubootmod) @@ -77,12 +107,6 @@ mercusys,mr90x-v1) local envdev=/dev/mtd$(find_mtd_index "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1" ;; -cetron,ct3003-stock|\ -cetron,ct3003-ubootmod|\ -cmcc,rax3000m-nand-ubootmod|\ -netgear,wax220) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" - ;; ubnt,unifi-6-plus) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000" ;; @@ -93,22 +117,6 @@ xiaomi,redmi-router-ax6000-stock) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000" ;; -h3c,magic-nx30-pro|\ -h3c,magic-nx30-pro-nmbm|\ -jcg,q30|\ -qihoo,360t7|\ -tplink,tl-xdr4288|\ -tplink,tl-xdr6086|\ -tplink,tl-xdr6088|\ -xiaomi,mi-router-wr30u-ubootmod|\ -xiaomi,redmi-router-ax6000-ubootmod) - . /lib/upgrade/nand.sh - local envubi=$(nand_find_ubi ubi) - local envdev=/dev/$(nand_find_volume $envubi ubootenv) - local envdev2=/dev/$(nand_find_volume $envubi ubootenv2) - ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1" - ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1" - ;; zyxel,ex5601-t0) local envdev=/dev/mtd$(find_mtd_index "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2" diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 353c777b1b1..5e2bc77f46c 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -44,6 +44,7 @@ beeline,smartbox-giga|\ beeline,smartbox-turbo|\ beeline,smartbox-turbo-plus|\ etisalat,s3|\ +rostelecom,rt-fe-1a|\ rostelecom,rt-sf-1) ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000" ;; diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index db403611be5..e013a66199a 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -5,6 +5,8 @@ PKG_VERSION:=2023.07.02 PKG_HASH:=6b6a48581c14abb0f95bd87c1af4d740922406d7b801002a9f94727fdde021d5 PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host +UBOOT_USE_INTREE_DTC:=1 + include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -429,6 +431,18 @@ define U-Boot/mt7986_glinet_gl-mt6000 DEPENDS:=+trusted-firmware-a-mt7986-emmc-ddr4 endef +define U-Boot/mt7986_jdcloud_re-cp-03 + NAME:=JDCloud RE-CP-03 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=jdcloud_re-cp-03 + UBOOT_CONFIG:=mt7986a_jdcloud_re-cp-03 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=emmc + BL2_SOC:=mt7986 + BL2_DDRTYPE:=ddr4 + DEPENDS:=+trusted-firmware-a-mt7986-emmc-ddr4 +endef + define U-Boot/mt7986_tplink_tl-xdr4288 NAME:=TP-LINK TL-XDR4288 BUILD_SUBTARGET:=filogic @@ -477,6 +491,18 @@ define U-Boot/mt7986_xiaomi_redmi-router-ax6000 DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ddr4 endef +define U-Boot/mt7986_zyxel_ex5601-t0 + NAME:=Zyxel EX5601-T0 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=zyxel_ex5601-t0-ubootmod + UBOOT_CONFIG:=mt7986_zyxel_ex5601-t0 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand-4k + BL2_SOC:=mt7986 + BL2_DDRTYPE:=ddr4 + DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-4k-ddr4 +endef + define U-Boot/mt7988_rfb-spim-nand NAME:=MT7988 Reference Board BUILD_SUBTARGET:=filogic @@ -574,10 +600,12 @@ UBOOT_TARGETS := \ mt7986_bananapi_bpi-r3-mini-emmc \ mt7986_bananapi_bpi-r3-mini-snand \ mt7986_glinet_gl-mt6000 \ + mt7986_jdcloud_re-cp-03 \ mt7986_tplink_tl-xdr4288 \ mt7986_tplink_tl-xdr6086 \ mt7986_tplink_tl-xdr6088 \ mt7986_xiaomi_redmi-router-ax6000 \ + mt7986_zyxel_ex5601-t0 \ mt7986_rfb \ mt7988_rfb-spim-nand \ mt7988_rfb-snand \ diff --git a/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch b/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch deleted file mode 100644 index 89cdf60f950..00000000000 --- a/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -2006,26 +2006,7 @@ endif - # Check dtc and pylibfdt, if DTC is provided, else build them - PHONY += scripts_dtc - scripts_dtc: scripts_basic -- $(Q)if test "$(DTC)" = "$(DTC_INTREE)"; then \ -- $(MAKE) $(build)=scripts/dtc; \ -- else \ -- if ! $(DTC) -v >/dev/null; then \ -- echo '*** Failed to check dtc version: $(DTC)'; \ -- false; \ -- else \ -- if test "$(call dtc-version)" -lt $(DTC_MIN_VERSION); then \ -- echo '*** Your dtc is too old, please upgrade to dtc $(DTC_MIN_VERSION) or newer'; \ -- false; \ -- else \ -- if [ -n "$(CONFIG_PYLIBFDT)" ]; then \ -- if ! echo "import libfdt" | $(PYTHON3) 2>/dev/null; then \ -- echo '*** pylibfdt does not seem to be available with $(PYTHON3)'; \ -- false; \ -- fi; \ -- fi; \ -- fi; \ -- fi; \ -- fi -+ $(MAKE) $(build)=scripts/dtc - - # --------------------------------------------------------------------------- - quiet_cmd_cpp_lds = LDS $@ diff --git a/package/boot/uboot-mediatek/patches/439-add-zyxel_ex5601-t0.patch b/package/boot/uboot-mediatek/patches/439-add-zyxel_ex5601-t0.patch new file mode 100644 index 00000000000..7f0564fd497 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/439-add-zyxel_ex5601-t0.patch @@ -0,0 +1,431 @@ +--- /dev/null ++++ b/configs/mt7986_zyxel_ex5601-t0_defconfig +@@ -0,0 +1,186 @@ ++CONFIG_ARM=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TARGET_MT7986=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7986a-zyxel_ex5601-t0" ++CONFIG_DEFAULT_ENV_FILE="zyxel_ex5601-t0_env" ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-zyxel_ex5601-t0.dtb" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_DEBUG_UART=y ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_SMBIOS_PRODUCT_NAME="" ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_CFB_CONSOLE_ANSI=y ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_GPIO_HOG=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_FIT=y ++CONFIG_FIT_ENABLE_SHA256_SUPPORT=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++CONFIG_LOGLEVEL=7 ++CONFIG_LOG=y ++CONFIG_SYS_PROMPT="EX5601> " ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_BOOTP=y ++CONFIG_CMD_BUTTON=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_CPU=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_ECHO=y ++CONFIG_CMD_ENV_READMEM=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_FDT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_ITEST=y ++CONFIG_CMD_LED=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_LINK_LOCAL=y ++# CONFIG_CMD_MBR is not set ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_PWM=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_TFTPBOOT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_CMD_UBIFS=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_SETEXPR=y ++CONFIG_CMD_SLEEP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_SOURCE=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_UUID=y ++CONFIG_DISPLAY_CPUINFO=y ++CONFIG_DM_MTD=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_DM_USB=y ++CONFIG_DM_PWM=y ++CONFIG_PWM_MTK=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_PARTITION_UUIDS=y ++CONFIG_NETCONSOLE=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++CONFIG_DM_GPIO=y ++CONFIG_DM_SCSI=y ++CONFIG_AHCI=y ++CONFIG_AHCI_PCI=y ++CONFIG_SCSI_AHCI=y ++CONFIG_SCSI=y ++CONFIG_CMD_SCSI=y ++CONFIG_PHY=y ++CONFIG_PHY_MTK_TPHY=y ++CONFIG_PHY_FIXED=y ++CONFIG_MTK_AHCI=y ++CONFIG_DM_ETH=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PCI=y ++CONFIG_DM_PCI=y ++CONFIG_PCIE_MEDIATEK=y ++# CONFIG_MMC is not set ++# CONFIG_DM_MMC is not set ++CONFIG_MTD=y ++CONFIG_MTD_UBI_FASTMAP=y ++# CONFIG_DM_PCI is not set ++# CONFIG_PCIE_MEDIATEK is not set ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7622=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_RAM=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++# CONFIG_I2C is not set ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPI_NAND=y ++CONFIG_MTK_SPI_NAND_MTD=y ++CONFIG_SYSRESET_WATCHDOG=y ++CONFIG_WDT_MTK=y ++CONFIG_LZO=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y ++CONFIG_RANDOM_UUID=y ++CONFIG_REGEX=y ++CONFIG_USB=y ++CONFIG_USB_HOST=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_MTK=y ++CONFIG_USB_STORAGE=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=y ++CONFIG_ENV_UBI_PART="ubi" ++CONFIG_ENV_SIZE=0x1f000 ++CONFIG_ENV_SIZE_REDUND=0x1f000 ++CONFIG_ENV_UBI_VOLUME="ubootenv" ++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++CONFIG_PHY_FIXED=y ++CONFIG_DM_ETH=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7986=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_HEXDUMP=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_MTK_SPIM=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_NAND_TRIMFFS=y ++CONFIG_LMB_MAX_REGIONS=64 ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" +--- /dev/null ++++ b/arch/arm/dts/mt7986a-zyxel_ex5601-t0.dts +@@ -0,0 +1,181 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Author: Valerio 'ftp21' Mancini ++ * Author: Nicolò Veronese ++ */ ++ ++/dts-v1/; ++#include ++#include "mt7986.dtsi" ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "Zyxel EX5601-T0 ubootmod"; ++ compatible = "mediatek,mt7986", "mediatek,mt7986-sd-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x20000000>; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ factory { ++ label = "reset"; ++ gpios = <&gpio 21 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ ++ wps { ++ label = "wps"; ++ gpios = <&gpio 56 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_status_green: pwr { ++ label = "green:status"; ++ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ }; ++ ++ led_sfp_green: sfp { ++ label = "green:sfp"; ++ gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ }; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "disabled"; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "2500base-x"; ++ mediatek,switch = "mt7531"; ++ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&pinctrl { ++ spic_pins: spi1-pins-func-1 { ++ mux { ++ function = "spi"; ++ groups = "spi1_2"; ++ }; ++ }; ++ ++ uart1_pins: spi1-pins-func-3 { ++ mux { ++ function = "uart"; ++ groups = "uart1_2"; ++ }; ++ }; ++ ++ spi_flash_pins: spi0-pins-func-1 { ++ mux { ++ function = "flash"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&spi0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <1>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <20000000>; ++ spi-tx-buswidth = <4>; ++ spi-rx-buswidth = <4>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x0100000 0x0080000>; ++ }; ++ ++ partition@180000 { ++ label = "Factory"; ++ reg = <0x180000 0x0200000>; ++ }; ++ ++ partition@380000 { ++ label = "fip"; ++ reg = <0x380000 0x0200000>; ++ }; ++ ++ partition@540000 { ++ label = "zloader"; ++ reg = <0x540000 0x0040000>; ++ read-only; ++ }; ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x1da80000>; ++ }; ++ }; ++ }; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; ++ +--- /dev/null ++++ b/zyxel_ex5601-t0_env +@@ -0,0 +1,55 @@ ++ethaddr_factory=mtd read Factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x4008002A 0x6 ; setenv ethaddr_factory ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootargs=console=ttyS0,115200n8 console_msg_format=syslog ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-squashfs-sysupgrade.itb ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=run ubi_read_production && bootm $loadaddr#$bootconf ++boot_recovery=run ubi_read_recovery && bootm $loadaddr#$bootconf ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 ++part_fit=fit ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr ++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 ++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr $part_fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/package/boot/uboot-mediatek/patches/452-add-jdcloud_re-cp-03.patch b/package/boot/uboot-mediatek/patches/452-add-jdcloud_re-cp-03.patch new file mode 100644 index 00000000000..fca95a2c222 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/452-add-jdcloud_re-cp-03.patch @@ -0,0 +1,321 @@ +--- /dev/null ++++ b/configs/mt7986a_jdcloud_re-cp-03_defconfig +@@ -0,0 +1,112 @@ ++CONFIG_ARM=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x40000 ++CONFIG_ENV_OFFSET=0x400000 ++CONFIG_DEFAULT_DEVICE_TREE="mt7986a-jdcloud_re-cp-03" ++CONFIG_SYS_PROMPT="MT7986> " ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7986=y ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_ENV_OFFSET_REDUND=0x440000 ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-jdcloud_re-cp-03.dtb" ++CONFIG_LOGLEVEL=7 ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_LOG=y ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_CMD_CPU=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_PWM=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_DEFAULT_ENV_FILE="jdcloud_re-cp-03_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_NETCONSOLE=y ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++CONFIG_SUPPORT_EMMC_BOOT=y ++CONFIG_MMC_HS200_SUPPORT=y ++CONFIG_MMC_MTK=y ++CONFIG_PHY_FIXED=y ++CONFIG_DM_MDIO=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PHY=y ++CONFIG_PHY_MTK_TPHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7622=y ++CONFIG_PINCTRL_MT7986=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_DM_PWM=y ++CONFIG_PWM_MTK=y ++CONFIG_RAM=y ++CONFIG_SCSI=y ++CONFIG_DM_SCSI=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 +--- /dev/null ++++ b/arch/arm/dts/mt7986a-jdcloud_re-cp-03.dts +@@ -0,0 +1,145 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++/dts-v1/; ++#include ++#include "mt7986.dtsi" ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "JDCloud RE-CP-03"; ++ compatible = "mediatek,mt7986", "mediatek,mt7986-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x40000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-joylink { ++ label = "joylink"; ++ linux,code = ; ++ gpios = <&gpio 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 9 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ label = "blue:status"; ++ gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ red_led: led-1 { ++ label = "red:status"; ++ gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ green_led: led-2 { ++ label = "green:status"; ++ gpios = <&gpio 12 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_1p8v: regulator-1p8v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-1.8V"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ reg_3p3v: regulator-3p3v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-3.3V"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "2500base-x"; ++ mediatek,switch = "mt7531"; ++ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&mmc0 { ++ bus-width = <8>; ++ cap-mmc-highspeed; ++ cap-mmc-hw-reset; ++ max-frequency = <200000000>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_default>; ++ vmmc-supply = <®_3p3v>; ++ vqmmc-supply = <®_1p8v>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ mmc0_pins_default: mmc0default { ++ mux { ++ function = "flash"; ++ groups = "emmc_51"; ++ }; ++ ++ conf-cmd-dat { ++ pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", ++ "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", ++ "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; ++ input-enable; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-clk { ++ pins = "EMMC_CK"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ ++ conf-dsl { ++ pins = "EMMC_DSL"; ++ bias-pull-down = ; ++ }; ++ ++ conf-rst { ++ pins = "EMMC_RSTB"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/jdcloud_re-cp-03_env +@@ -0,0 +1,55 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootargs=root=/dev/mmcblk0p65 ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=immortalwrt-mediatek-filogic-jdcloud_re-cp-03-initramfs-recovery.itb ++bootfile_bl2=immortalwrt-mediatek-filogic-jdcloud_re-cp-03-preloader.bin ++bootfile_fip=immortalwrt-mediatek-filogic-jdcloud_re-cp-03-bl31-uboot.fip ++bootfile_upg=immortalwrt-mediatek-filogic-jdcloud_re-cp-03-squashfs-sysupgrade.itb ++bootled_pwr=red:status ++bootled_rec=blue:status ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to eMMC.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to eMMC.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_emmc=run boot_production ; run boot_recovery ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run emmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run emmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2 ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200 ++part_default=production ++part_recovery=recovery ++reset_factory=eraseenv && reset ++emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol ++emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol ++emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0 ++emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800 ++emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol ++emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol ++_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index ac6985879cd..98579806a89 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -5,9 +5,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2024.01-rc2 +PKG_VERSION:=2024.01-rc3 PKG_RELEASE:=1 -PKG_HASH:=7585328ee545bd0566a90965ef02c3a8d1c828f56a92548a03e88e7644dd76bd +PKG_HASH:=0269372d0dade58a24dac1d82be43f592cc8262ead5a9a9a22c06ea5a7f981ea PKG_MAINTAINER:=Tobias Maedel diff --git a/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch b/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch index 9f01da2c970..a124084abb1 100644 --- a/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch +++ b/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch @@ -41,9 +41,9 @@ rk3568-rock-3a.dtb dtb-$(CONFIG_ROCKCHIP_RK3588) += \ -@@ -195,7 +203,9 @@ dtb-$(CONFIG_ROCKCHIP_RK3588) += \ - rk3588s-orangepi-5.dtb \ +@@ -196,7 +204,9 @@ dtb-$(CONFIG_ROCKCHIP_RK3588) += \ rk3588-orangepi-5-plus.dtb \ + rk3588-quartzpro64.dtb \ rk3588s-rock-5a.dtb \ - rk3588-rock-5b.dtb + rk3588-rock-5b.dtb \ diff --git a/package/boot/uboot-sifiveu/Makefile b/package/boot/uboot-sifiveu/Makefile index 5def1c1fcb8..4cbfe344af8 100644 --- a/package/boot/uboot-sifiveu/Makefile +++ b/package/boot/uboot-sifiveu/Makefile @@ -10,6 +10,8 @@ PKG_RELEASE:=1 PKG_VERSION:=2022.10 PKG_HASH:=50b4482a505bc281ba8470c399a3c26e145e29b23500bc35c50debd7fa46bdf8 +UBOOT_USE_INTREE_DTC:=1 + include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-sifiveu/patches/300-force-pylibfdt-build.patch b/package/boot/uboot-sifiveu/patches/300-force-pylibfdt-build.patch deleted file mode 100644 index 4abf13eda86..00000000000 --- a/package/boot/uboot-sifiveu/patches/300-force-pylibfdt-build.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -2028,26 +2028,7 @@ endif - # Check dtc and pylibfdt, if DTC is provided, else build them - PHONY += scripts_dtc - scripts_dtc: scripts_basic -- $(Q)if test "$(DTC)" = "$(DTC_INTREE)"; then \ -- $(MAKE) $(build)=scripts/dtc; \ -- else \ -- if ! $(DTC) -v >/dev/null; then \ -- echo '*** Failed to check dtc version: $(DTC)'; \ -- false; \ -- else \ -- if test "$(call dtc-version)" -lt $(DTC_MIN_VERSION); then \ -- echo '*** Your dtc is too old, please upgrade to dtc $(DTC_MIN_VERSION) or newer'; \ -- false; \ -- else \ -- if [ -n "$(CONFIG_PYLIBFDT)" ]; then \ -- if ! echo "import libfdt" | $(PYTHON3) 2>/dev/null; then \ -- echo '*** pylibfdt does not seem to be available with $(PYTHON3)'; \ -- false; \ -- fi; \ -- fi; \ -- fi; \ -- fi; \ -- fi -+ $(MAKE) $(build)=scripts/dtc - - # --------------------------------------------------------------------------- - quiet_cmd_cpp_lds = LDS $@ diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 17905802c31..7f50992e695 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -15,6 +15,8 @@ PKG_HASH:=e31cac91545ff41b71cec5d8c22afd695645cd6e2a442ccdacacd60534069341 PKG_MAINTAINER:=Zoltan HERPAI +UBOOT_USE_INTREE_DTC:=1 + include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-sunxi/patches/300-force-pylibfdt-build.patch b/package/boot/uboot-sunxi/patches/300-force-pylibfdt-build.patch deleted file mode 100644 index d34ed6f2ae5..00000000000 --- a/package/boot/uboot-sunxi/patches/300-force-pylibfdt-build.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -2000,26 +2000,7 @@ endif - # Check dtc and pylibfdt, if DTC is provided, else build them - PHONY += scripts_dtc - scripts_dtc: scripts_basic -- $(Q)if test "$(DTC)" = "$(DTC_INTREE)"; then \ -- $(MAKE) $(build)=scripts/dtc; \ -- else \ -- if ! $(DTC) -v >/dev/null; then \ -- echo '*** Failed to check dtc version: $(DTC)'; \ -- false; \ -- else \ -- if test "$(call dtc-version)" -lt $(DTC_MIN_VERSION); then \ -- echo '*** Your dtc is too old, please upgrade to dtc $(DTC_MIN_VERSION) or newer'; \ -- false; \ -- else \ -- if [ -n "$(CONFIG_PYLIBFDT)" ]; then \ -- if ! echo "import libfdt" | $(PYTHON3) 2>/dev/null; then \ -- echo '*** pylibfdt does not seem to be available with $(PYTHON3)'; \ -- false; \ -- fi; \ -- fi; \ -- fi; \ -- fi; \ -- fi -+ $(MAKE) $(build)=scripts/dtc - - # --------------------------------------------------------------------------- - quiet_cmd_cpp_lds = LDS $@ diff --git a/package/devel/tmon/Makefile b/package/devel/tmon/Makefile new file mode 100644 index 00000000000..6f9182ce9ad --- /dev/null +++ b/package/devel/tmon/Makefile @@ -0,0 +1,53 @@ +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=tmon +PKG_VERSION:=$(LINUX_VERSION) +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Florian Eckert +PKG_LICENSE:=GPL-2.0-only + +include $(INCLUDE_DIR)/package.mk + +define Package/tmon + SECTION:=devel + CATEGORY:=Development + TITLE:=Thermal monitoring and testing tool + VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) + URL:=http://www.kernel.org + DEPENDS:=+libncursesw +endef + +define Package/tmon/description + As hardware vendors cope with the thermal constraints on their products, + more and more sensors are added, new cooling capabilities are introduced. + To expose such relationship to the userspace, Linux generic thermal layer + introduced sysfs entry at /sys/class/thermal with a matrix of symbolic + links, trip point bindings, and device instances. To traverse such + matrix by hand is not a trivial task. + 'TMON' is conceived as a tool to help visualize, tune, and test the + complex thermal subsystem. +endef + +MAKE_FLAGS = \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" + +define Build/Compile + -$(MAKE) clean \ + -C $(LINUX_DIR)/tools/thermal/tmon + +$(MAKE_FLAGS) $(MAKE) \ + -C $(LINUX_DIR)/tools/thermal/tmon +endef + +define Package/tmon/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(LINUX_DIR)/tools/thermal/tmon/tmon \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,tmon)) diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index f696b28c3c7..9f8a2e9e79a 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=valgrind -PKG_VERSION:=3.21.0 +PKG_VERSION:=3.22.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://sourceware.org/pub/valgrind/ -PKG_HASH:=10ce1618bb3e33fad16eb79552b0a3e1211762448a0d7fce11c8a6243b9ac971 +PKG_HASH:=c811db5add2c5f729944caf47c4e7a65dcaabb9461e472b578765dd7bf6d2d4c PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0+ diff --git a/package/devel/valgrind/patches/130-mips_fix_soft_float.patch b/package/devel/valgrind/patches/130-mips_fix_soft_float.patch index 9d3482815c4..7c7122ecac9 100644 --- a/package/devel/valgrind/patches/130-mips_fix_soft_float.patch +++ b/package/devel/valgrind/patches/130-mips_fix_soft_float.patch @@ -48,7 +48,7 @@ This fixes the following error message when compiling with a GCC 10 MIPS BE 32: --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c -@@ -2106,6 +2106,7 @@ Bool VG_(machine_get_hwcaps)( void ) +@@ -2109,6 +2109,7 @@ Bool VG_(machine_get_hwcaps)( void ) we are using alternative way to determine FP mode */ ULong result = 0; @@ -56,7 +56,7 @@ This fixes the following error message when compiling with a GCC 10 MIPS BE 32: if (!VG_MINIMAL_SETJMP(env_unsup_insn)) { __asm__ volatile ( ".set push\n\t" -@@ -2123,6 +2124,9 @@ Bool VG_(machine_get_hwcaps)( void ) +@@ -2126,6 +2127,9 @@ Bool VG_(machine_get_hwcaps)( void ) fpmode = (result != 0x3FF0000000000000ull); } diff --git a/package/emortal/automount/Makefile b/package/emortal/automount/Makefile index bcaca1182cc..a7c5a200554 100644 --- a/package/emortal/automount/Makefile +++ b/package/emortal/automount/Makefile @@ -47,6 +47,9 @@ define Build/Compile endef define Package/automount/install + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/11-anonmount $(1)/etc/uci-defaults/ + $(INSTALL_DIR) $(1)/etc/hotplug.d/block $(INSTALL_BIN) ./files/15-automount $(1)/etc/hotplug.d/block/ endef diff --git a/package/emortal/automount/files/11-anonmount b/package/emortal/automount/files/11-anonmount new file mode 100644 index 00000000000..552e57ce3ee --- /dev/null +++ b/package/emortal/automount/files/11-anonmount @@ -0,0 +1,13 @@ +#!/bin/sh + +if ! uci -q get system.@imm_init[0].anon_mount > "/dev/null"; then + uci -q batch <<-EOF + set fstab.@global[0].anon_mount="1" + commit fstab + + set system.@imm_init[0].anon_mount="1" + commit system + EOF +fi + +exit 0 diff --git a/package/emortal/default-settings/files/99-default-settings b/package/emortal/default-settings/files/99-default-settings index 6f5cf56baac..39e7fd6812c 100755 --- a/package/emortal/default-settings/files/99-default-settings +++ b/package/emortal/default-settings/files/99-default-settings @@ -12,16 +12,6 @@ if ! uci -q get system.@imm_init[0].lang > "/dev/null"; then EOF fi -if ! uci -q get system.@imm_init[0].anon_mount > "/dev/null"; then - uci -q batch <<-EOF - set fstab.@global[0].anon_mount="1" - commit fstab - - set system.@imm_init[0].anon_mount="1" - commit system - EOF -fi - ln -sf "/sbin/ip" "/usr/bin/ip" sed -i "/log-facility/d" "/etc/dnsmasq.conf" diff --git a/package/emortal/ipv6-helper/Makefile b/package/emortal/ipv6-helper/Makefile index 084da77e5eb..4a1eaf118f0 100644 --- a/package/emortal/ipv6-helper/Makefile +++ b/package/emortal/ipv6-helper/Makefile @@ -23,9 +23,9 @@ endef define Package/ipv6helper/install $(INSTALL_DIR) $(1)/etc/hotplug.d/iface - $(INSTALL_BIN) ./files/60-6in4 $(1)/etc/hotplug.d/iface/60-6in4 + $(INSTALL_BIN) ./files/60-6in4 $(1)/etc/hotplug.d/iface/ $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/60-ipv6-hybrid $(1)/etc/uci-defaults/60-ipv6-hybrid + $(INSTALL_BIN) ./files/60-ipv6-lifetime $(1)/etc/uci-defaults/ endef $(eval $(call BuildPackage,ipv6helper)) diff --git a/package/emortal/ipv6-helper/files/60-ipv6-hybrid b/package/emortal/ipv6-helper/files/60-ipv6-hybrid deleted file mode 100755 index 72133a3a965..00000000000 --- a/package/emortal/ipv6-helper/files/60-ipv6-hybrid +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null" -uci -q get system.@imm_init[0].ipv6 > "/dev/null" && exit 0 - -uci -q batch <<-EOF - set dhcp.lan.ra="hybrid" - set dhcp.lan.ndp="hybrid" - set dhcp.lan.dhcpv6="hybrid" - set dhcp.lan.ra_management="1" - commit dhcp - - set system.@imm_init[0].ipv6="1" - commit system -EOF - -exit 0 diff --git a/package/emortal/ipv6-helper/files/60-ipv6-lifetime b/package/emortal/ipv6-helper/files/60-ipv6-lifetime new file mode 100755 index 00000000000..64fdd2f1efd --- /dev/null +++ b/package/emortal/ipv6-helper/files/60-ipv6-lifetime @@ -0,0 +1,18 @@ +#!/bin/sh + +uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null" +[ "$(uci -q get system.@imm_init[0].ipv6)" = "2" ] && exit 0 + +uci -q batch <<-EOF + delete dhcp.lan.dhcpv6 + delete dhcp.lan.ra_flags + add_list dhcp.lan.ra_flags="none" + set dhcp.lan.max_preferred_lifetime="2700" + set dhcp.lan.max_valid_lifetime="5400" + commit dhcp + + set system.@imm_init[0].ipv6="2" + commit system +EOF + +exit 0 diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk index cb7b7f4ae42..27b0d8ce64c 100644 --- a/package/firmware/linux-firmware/intel.mk +++ b/package/firmware/linux-firmware/intel.mk @@ -170,6 +170,13 @@ define Package/iwlwifi-firmware-iwl9260/install endef $(eval $(call BuildPackage,iwlwifi-firmware-iwl9260)) +Package/iwlwifi-firmware-ax101 = $(call Package/firmware-default,Intel AX101 firmware) +define Package/iwlwifi-firmware-ax101/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-hr-b0-81.ucode $(1)/lib/firmware +endef +$(eval $(call BuildPackage,iwlwifi-firmware-ax101)) + Package/iwlwifi-firmware-ax200 = $(call Package/firmware-default,Intel AX200 firmware) define Package/iwlwifi-firmware-ax200/install $(INSTALL_DIR) $(1)/lib/firmware diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 280c4de1693..69ddb77aac4 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -378,9 +378,11 @@ $(eval $(call KernelPackage,phy-smsc)) define KernelPackage/phy-aquantia SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Aquantia Ethernet PHYs - DEPENDS:=+kmod-libphy +kmod-hwmon-core + DEPENDS:=+kmod-libphy +kmod-hwmon-core +kmod-lib-crc-ccitt KCONFIG:=CONFIG_AQUANTIA_PHY - FILES:=$(LINUX_DIR)/drivers/net/phy/aquantia.ko + FILES:= \ + $(LINUX_DIR)/drivers/net/phy/aquantia.ko@lt6.1 \ + $(LINUX_DIR)/drivers/net/phy/aquantia/aquantia.ko@ge6.1 AUTOLOAD:=$(call AutoLoad,18,aquantia,1) endef @@ -1604,6 +1606,26 @@ endef $(eval $(call KernelPackage,sfp)) + +define KernelPackage/stmmac-core + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others) + DEPENDS:=@TARGET_x86_64||TARGET_armsr_armv8 +kmod-pcs-xpcs +kmod-ptp \ + +kmod-of-mdio + KCONFIG:=CONFIG_STMMAC_ETH \ + CONFIG_STMMAC_SELFTESTS=n \ + CONFIG_STMMAC_PLATFORM \ + CONFIG_CONFIG_DWMAC_DWC_QOS_ETH=n \ + CONFIG_DWMAC_GENERIC + FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko \ + $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko \ + $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.ko + AUTOLOAD=$(call AutoLoad,40,stmmac stmmac-platform dwmac-generic) +endef + +$(eval $(call KernelPackage,stmmac-core)) + + define KernelPackage/igc SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Intel(R) Ethernet Controller I225 Series support diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index cd1a1b23873..2e6cd3a31e5 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=2 +PKG_RELEASE=1 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-04-29 -PKG_SOURCE_VERSION:=6a436714d2ea0d0adf39fc4d7d45e6a17fcc9371 -PKG_MIRROR_HASH:=dcc320a8f859b732ff65c7ded0b5199a625bfba05a775a6bed15ed3c10cb2748 +PKG_SOURCE_DATE:=2023-11-29 +PKG_SOURCE_VERSION:=ebf3167445f108346dcff9a31a708534c0bd7cc5 +PKG_MIRROR_HASH:=1d39ad25f4ad1fafff03a70341c2dabde8db4075f56163d40f8ae8aef2e2bb2d PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch b/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch index 8e71918cf3f..ee64e050473 100644 --- a/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch +++ b/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch @@ -111,17 +111,15 @@ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi --- - debugfs.c | 2 +- - hif/fwcmd.c | 2 +- - hif/pcie/pcie.c | 4 ++-- - hif/pcie/tx_ndp.c | 2 +- + debugfs.c | 2 +- + hif/fwcmd.c | 2 +- + hif/pcie/8964/tx_ndp.c | 2 +- + hif/pcie/pcie.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) -diff --git a/debugfs.c b/debugfs.c -index 39b09fd..42efd28 100644 --- a/debugfs.c +++ b/debugfs.c -@@ -1332,7 +1332,7 @@ done: +@@ -1342,7 +1342,7 @@ done: priv->reg_value); else len += scnprintf(p + len, size - len, @@ -130,11 +128,9 @@ index 39b09fd..42efd28 100644 ret, priv->reg_type, priv->reg_offset, priv->reg_value); -diff --git a/hif/fwcmd.c b/hif/fwcmd.c -index 376b58f..582c8d2 100644 --- a/hif/fwcmd.c +++ b/hif/fwcmd.c -@@ -3604,7 +3604,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ieee80211_hw *hw, +@@ -3623,7 +3623,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie core_dump->size_kb = pcmd->cmd_data.coredump.size_kb; core_dump->flags = pcmd->cmd_data.coredump.flags; memcpy(buff, @@ -143,11 +139,20 @@ index 376b58f..582c8d2 100644 sizeof(struct hostcmd_cmd_get_fw_core_dump) - sizeof(struct hostcmd_cmd_get_fw_core_dump_)), MAX_CORE_DUMP_BUFFER); -diff --git a/hif/pcie/pcie.c b/hif/pcie/pcie.c -index 24453b6..5b6c633 100644 +--- a/hif/pcie/8964/tx_ndp.c ++++ b/hif/pcie/8964/tx_ndp.c +@@ -336,7 +336,7 @@ int pcie_tx_init_ndp(struct ieee80211_hw + + if (sizeof(struct pcie_tx_ctrl_ndp) > + sizeof(tx_info->driver_data)) { +- wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", ++ wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n", + sizeof(struct pcie_tx_ctrl_ndp), + sizeof(tx_info->driver_data)); + return -ENOMEM; --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -1320,8 +1320,8 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, +@@ -1466,8 +1466,8 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, &fp_data->f_pos); filp_close(fp_data, current->files); } else { @@ -158,19 +163,3 @@ index 24453b6..5b6c633 100644 } #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) -diff --git a/hif/pcie/tx_ndp.c b/hif/pcie/tx_ndp.c -index 6758cde..3140a2e 100644 ---- a/hif/pcie/tx_ndp.c -+++ b/hif/pcie/tx_ndp.c -@@ -335,7 +335,7 @@ int pcie_tx_init_ndp(struct ieee80211_hw *hw) - - if (sizeof(struct pcie_tx_ctrl_ndp) > - sizeof(tx_info->status.status_driver_data)) { -- wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", -+ wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n", - sizeof(struct pcie_tx_ctrl_ndp), - sizeof(tx_info->status.status_driver_data)); - return -ENOMEM; --- -2.39.2 - diff --git a/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch b/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch index 3d9ec4dcfb3..f37d2f8171a 100644 --- a/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch +++ b/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch @@ -19,7 +19,7 @@ Signed-off-by: Robert Marko --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -573,7 +573,8 @@ static struct device_node *pcie_get_devi +@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi struct device_node *dev_node; dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus); diff --git a/package/kernel/mwlwifi/patches/005-mac80211_update.patch b/package/kernel/mwlwifi/patches/005-mac80211_update.patch index c11cf8c9469..92a8f2f70fd 100644 --- a/package/kernel/mwlwifi/patches/005-mac80211_update.patch +++ b/package/kernel/mwlwifi/patches/005-mac80211_update.patch @@ -1,6 +1,6 @@ --- a/core.c +++ b/core.c -@@ -706,7 +706,7 @@ static void mwl_chnl_switch_event(struct +@@ -718,7 +718,7 @@ static void mwl_chnl_switch_event(struct vif = container_of((void *)mwl_vif, struct ieee80211_vif, drv_priv); @@ -11,7 +11,7 @@ spin_unlock_bh(&priv->vif_lock); --- a/debugfs.c +++ b/debugfs.c -@@ -455,9 +455,9 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -498,9 +498,9 @@ static ssize_t mwl_debugfs_vif_read(stru switch (vif->type) { case NL80211_IFTYPE_AP: len += scnprintf(p + len, size - len, "type: ap\n"); @@ -24,7 +24,7 @@ len += scnprintf(p + len, size - len, "ssid: %s\n", ssid); len += scnprintf(p + len, size - len, -@@ -479,8 +479,8 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -522,8 +522,8 @@ static ssize_t mwl_debugfs_vif_read(stru "type: unknown\n"); break; } @@ -35,62 +35,58 @@ len += scnprintf(p + len, size - len, "channel: %d: width: %d\n", chan_def->chan->hw_value, -@@ -564,28 +564,28 @@ static ssize_t mwl_debugfs_sta_read(stru - "amsdu cap: 0x%02x\n", - sta_info->amsdu_ctrl.cap); - } -- if (sta->ht_cap.ht_supported) { -+ if (sta->deflink.ht_cap.ht_supported) { - len += scnprintf(p + len, size - len, - "ht_cap: 0x%04x, ampdu: %02x, %02x\n", -- sta->ht_cap.cap, -- sta->ht_cap.ampdu_factor, -- sta->ht_cap.ampdu_density); -+ sta->deflink.ht_cap.cap, -+ sta->deflink.ht_cap.ampdu_factor, -+ sta->deflink.ht_cap.ampdu_density); - len += scnprintf(p + len, size - len, - "rx_mask: 0x%02x, %02x, %02x, %02x\n", -- sta->ht_cap.mcs.rx_mask[0], -- sta->ht_cap.mcs.rx_mask[1], -- sta->ht_cap.mcs.rx_mask[2], -- sta->ht_cap.mcs.rx_mask[3]); -+ sta->deflink.ht_cap.mcs.rx_mask[0], -+ sta->deflink.ht_cap.mcs.rx_mask[1], -+ sta->deflink.ht_cap.mcs.rx_mask[2], -+ sta->deflink.ht_cap.mcs.rx_mask[3]); - } -- if (sta->vht_cap.vht_supported) { -+ if (sta->deflink.vht_cap.vht_supported) { - len += scnprintf(p + len, size - len, - "vht_cap: 0x%08x, mcs: %02x, %02x\n", -- sta->vht_cap.cap, -- sta->vht_cap.vht_mcs.rx_mcs_map, -- sta->vht_cap.vht_mcs.tx_mcs_map); -+ sta->deflink.vht_cap.cap, -+ sta->deflink.vht_cap.vht_mcs.rx_mcs_map, -+ sta->deflink.vht_cap.vht_mcs.tx_mcs_map); - } - len += scnprintf(p + len, size - len, "rx_bw: %d, rx_nss: %d\n", -- sta->bandwidth, sta->rx_nss); -+ sta->deflink.bandwidth, sta->deflink.rx_nss); - len += scnprintf(p + len, size - len, - "tdls: %d, tdls_init: %d\n", - sta->tdls, sta->tdls_initiator); +@@ -596,18 +596,18 @@ static ssize_t mwl_debugfs_sta_read(stru + sta_info->wds ? "true" : "false", + sta_info->ba_hist.enable ? "enable" : "disable", + sta_info->is_amsdu_allowed ? sta_info->amsdu_ctrl.cap : 0 , +- sta->ht_cap.ht_supported ? sta->ht_cap.cap : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_factor : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_density : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[0] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[1] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[2] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[3] : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.cap : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.rx_mcs_map : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.tx_mcs_map : 0, +- sta->bandwidth, +- sta->rx_nss, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.cap : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_factor : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_density : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[0] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[1] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[2] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[3] : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.cap : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.rx_mcs_map : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.tx_mcs_map : 0, ++ sta->deflink.bandwidth, ++ sta->deflink.rx_nss, + sta->tdls, + sta->tdls_initiator, + sta->wme, --- a/hif/fwcmd.c +++ b/hif/fwcmd.c -@@ -634,8 +634,9 @@ einval: +@@ -633,11 +633,15 @@ einval: + } static int mwl_fwcmd_set_ap_beacon(struct mwl_priv *priv, - struct mwl_vif *mwl_vif, +- struct mwl_vif *mwl_vif, - struct ieee80211_bss_conf *bss_conf) + struct ieee80211_vif *vif) { -+ struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; struct hostcmd_cmd_ap_beacon *pcmd; struct ds_params *phy_ds_param_set; ++ struct mwl_vif *mwl_vif; ++ struct ieee80211_bss_conf *bss_conf; ++ ++ mwl_vif = mwl_dev_get_vif(vif); ++ bss_conf = &vif->bss_conf; -@@ -664,7 +665,7 @@ static int mwl_fwcmd_set_ap_beacon(struc + /* wmm structure of start command is defined less one byte, + * due to following field country is not used, add byte one +@@ -664,7 +668,7 @@ static int mwl_fwcmd_set_ap_beacon(struc pcmd->cmd_hdr.macid = mwl_vif->macid; ether_addr_copy(pcmd->start_cmd.sta_mac_addr, mwl_vif->bssid); @@ -99,16 +95,16 @@ if (priv->chip_type == MWL8997) ether_addr_copy(pcmd->start_cmd.bssid, mwl_vif->bssid); pcmd->start_cmd.bss_type = 1; -@@ -2091,7 +2092,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 +@@ -2090,7 +2094,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr)) goto err; - if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, &vif->bss_conf)) -+ if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, vif)) ++ if (mwl_fwcmd_set_ap_beacon(priv, vif)) goto err; if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT) -@@ -2153,38 +2154,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee +@@ -2152,38 +2156,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -161,7 +157,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2240,38 +2241,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct +@@ -2239,38 +2243,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -214,7 +210,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2788,9 +2789,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2787,9 +2791,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags); pcmd->ba_info.create_params.queue_id = stream->idx; pcmd->ba_info.create_params.param_info = @@ -226,7 +222,7 @@ IEEE80211_HT_AMPDU_PARM_DENSITY); if (direction == BA_FLAG_DIRECTION_UP) { pcmd->ba_info.create_params.reset_seq_no = 0; -@@ -2800,9 +2801,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2799,9 +2803,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.current_seq = cpu_to_le16(0); } if (priv->chip_type == MWL8964 && @@ -238,9 +234,51 @@ IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >> IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT); } +--- a/hif/pcie/8864/tx.c ++++ b/hif/pcie/8864/tx.c +@@ -743,7 +743,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ + index = SYSADPT_TX_WMM_QUEUES - index - 1; + txpriority = index; + +- if (sta && sta->ht_cap.ht_supported && ++ if (sta && sta->deflink.ht_cap.ht_supported && + !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && + ieee80211_is_data_qos(wh->frame_control)) { + tid = qos & 0xf; +--- a/hif/pcie/8964/tx_ndp.c ++++ b/hif/pcie/8964/tx_ndp.c +@@ -607,7 +607,7 @@ void pcie_tx_xmit_ndp(struct ieee80211_h + pcie_tx_encapsulate_frame(priv, skb, k_conf); + } else { + tid = qos & 0x7; +- if (sta && sta->ht_cap.ht_supported && !eapol_frame && ++ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && + qos != 0xFFFF) { + pcie_tx_count_packet(sta, tid); + spin_lock_bh(&priv->stream_lock); +--- a/hif/pcie/8997/tx.c ++++ b/hif/pcie/8997/tx.c +@@ -81,7 +81,7 @@ static int pcie_txbd_ring_create(struct + wiphy_info(priv->hw->wiphy, + "TX ring: - base: %p, pbase: 0x%x, len: %d\n", + pcie_priv->txbd_ring_vbase, +- pcie_priv->txbd_ring_pbase, ++ (u32)pcie_priv->txbd_ring_pbase, + pcie_priv->txbd_ring_size); + + for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { +@@ -694,7 +694,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ + index = SYSADPT_TX_WMM_QUEUES - index - 1; + txpriority = index; + +- if (sta && sta->ht_cap.ht_supported && ++ if (sta && sta->deflink.ht_cap.ht_supported && + !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && + ieee80211_is_data_qos(wh->frame_control)) { + tid = qos & 0xf; --- a/mac80211.c +++ b/mac80211.c -@@ -371,15 +371,15 @@ static void mwl_mac80211_bss_info_change +@@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change } } @@ -259,7 +297,7 @@ { struct mwl_priv *priv = hw->priv; struct mwl_vif *mwl_vif; -@@ -429,8 +429,8 @@ static void mwl_mac80211_bss_info_change +@@ -426,8 +426,8 @@ static void mwl_mac80211_bss_info_change if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) { struct sk_buff *skb; @@ -270,7 +308,7 @@ (!info->hidden_ssid)) { if (mwl_vif->broadcast_ssid != true) { mwl_fwcmd_broadcast_ssid_enable(hw, vif, true); -@@ -444,7 +444,7 @@ static void mwl_mac80211_bss_info_change +@@ -441,7 +441,7 @@ static void mwl_mac80211_bss_info_change } if (!mwl_vif->set_beacon) { @@ -279,7 +317,7 @@ if (skb) { mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len); -@@ -461,7 +461,7 @@ static void mwl_mac80211_bss_info_change +@@ -458,7 +458,7 @@ static void mwl_mac80211_bss_info_change static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -288,7 +326,7 @@ { switch (vif->type) { case NL80211_IFTYPE_AP: -@@ -584,10 +584,10 @@ static int mwl_mac80211_sta_add(struct i +@@ -583,10 +583,10 @@ static int mwl_mac80211_sta_add(struct i if (vif->type == NL80211_IFTYPE_MESH_POINT) sta_info->is_mesh_node = true; @@ -296,12 +334,12 @@ + if (sta->deflink.ht_cap.ht_supported) { sta_info->is_ampdu_allowed = true; sta_info->is_amsdu_allowed = false; -- if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) -+ if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) +- if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { ++ if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K; - else - sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_4K; -@@ -669,7 +669,7 @@ static int mwl_mac80211_sta_remove(struc + sta_info->amsdu_ctrl.amsdu_allow_size = SYSADPT_AMSDU_8K_MAX_SIZE; + } +@@ -670,7 +670,7 @@ static int mwl_mac80211_sta_remove(struc static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -310,7 +348,7 @@ const struct ieee80211_tx_queue_params *params) { struct mwl_priv *priv = hw->priv; -@@ -928,4 +928,5 @@ const struct ieee80211_ops mwl_mac80211_ +@@ -934,4 +934,5 @@ const struct ieee80211_ops mwl_mac80211_ .pre_channel_switch = mwl_mac80211_chnl_switch, .sw_scan_start = mwl_mac80211_sw_scan_start, .sw_scan_complete = mwl_mac80211_sw_scan_complete, @@ -360,34 +398,3 @@ switch (format) { case TX_RATE_FORMAT_LEGACY: ---- a/hif/pcie/tx.c -+++ b/hif/pcie/tx.c -@@ -153,7 +153,7 @@ static int pcie_txbd_ring_create(struct - wiphy_info(priv->hw->wiphy, - "TX ring: - base: %p, pbase: 0x%x, len: %d\n", - pcie_priv->txbd_ring_vbase, -- pcie_priv->txbd_ring_pbase, -+ (u32)pcie_priv->txbd_ring_pbase, - pcie_priv->txbd_ring_size); - - for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { -@@ -1091,7 +1091,7 @@ void pcie_tx_xmit(struct ieee80211_hw *h - index = SYSADPT_TX_WMM_QUEUES - index - 1; - txpriority = index; - -- if (sta && sta->ht_cap.ht_supported && !eapol_frame && -+ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && - ieee80211_is_data_qos(wh->frame_control)) { - tid = qos & 0xf; - pcie_tx_count_packet(sta, tid); ---- a/hif/pcie/tx_ndp.c -+++ b/hif/pcie/tx_ndp.c -@@ -602,7 +602,7 @@ void pcie_tx_xmit_ndp(struct ieee80211_h - pcie_tx_encapsulate_frame(priv, skb, k_conf, NULL); - } else { - tid = qos & 0x7; -- if (sta && sta->ht_cap.ht_supported && !eapol_frame && -+ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && - qos != 0xFFFF) { - pcie_tx_count_packet(sta, tid); - spin_lock_bh(&priv->stream_lock); diff --git a/package/kernel/mwlwifi/patches/006-remove-uaccess-and-get_fs-calls-from-PCIe-for-Kenel-.patch b/package/kernel/mwlwifi/patches/006-remove-uaccess-and-get_fs-calls-from-PCIe-for-Kenel-.patch deleted file mode 100644 index c81561a149d..00000000000 --- a/package/kernel/mwlwifi/patches/006-remove-uaccess-and-get_fs-calls-from-PCIe-for-Kenel-.patch +++ /dev/null @@ -1,53 +0,0 @@ -From ad911365cac3723d1c00d048905a5e22ff4a10f3 Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Sun, 18 Jun 2023 17:53:27 +0200 -Subject: [PATCH 1/2] remove uaccess and get_fs calls from PCIe for Kenel >= - 5.18 - -Remove the calls to deprecated get_fs and force_uaccess_* API for modern -kernels. - -The get_fs functionality and the transitional force_uaccess_* calls have -been removed Kernel 5.18 [1] while read and write operations have been -refactored, so the code can work on kernel- and userspace data without -the need to shifting the boundary using set_fs(). - -[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=967747bbc084b93b54e66f9047d342232314cd25 - -Signed-off-by: Stefan Kalscheuer ---- - hif/pcie/pcie.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/hif/pcie/pcie.c b/hif/pcie/pcie.c -index 24453b6..bee1cc5 100644 ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -1294,7 +1294,9 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, - const char filename[] = "/tmp/BF_MIMO_Ctrl_Field_Output.txt"; - char str_buf[256]; - char *buf = &str_buf[0]; -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - mm_segment_t oldfs; -+#endif - - #if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) - oldfs = get_fs(); -@@ -1302,7 +1304,7 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, - #elif LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) - oldfs = get_fs(); - set_fs(KERNEL_DS); --#else -+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - oldfs = force_uaccess_begin(); - #endif - -@@ -1326,7 +1328,7 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, - - #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) - set_fs(oldfs); --#else -+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - force_uaccess_end(oldfs); - #endif - } diff --git a/package/kernel/mwlwifi/patches/007-replace-usage-of-the-deprecated-pci-dma-compat.h-API.patch b/package/kernel/mwlwifi/patches/007-replace-usage-of-the-deprecated-pci-dma-compat.h-API.patch deleted file mode 100644 index 1faff18c840..00000000000 --- a/package/kernel/mwlwifi/patches/007-replace-usage-of-the-deprecated-pci-dma-compat.h-API.patch +++ /dev/null @@ -1,275 +0,0 @@ -From 61c75dce424c180b633c64613a1948df5a41cf1e Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Sun, 18 Jun 2023 17:59:07 +0200 -Subject: [PATCH 2/2] replace usage of the deprecated "pci-dma-compat.h" API - -The pci-dma-compat API has been legacy for quite a while and was removed -with 5.18 [1]. Migrate all calls, so the module can be compiled against -modern kernel versions. - -Replace some compat calls: -* pci_set_dma_mask with dma_set_mask -* pci_(un)map_single with dma_(un)map_single -* pci_dma_mapping_error with dma_mapping_error -* PCI_DMA_{FROM,TO}DEVICE with DMA_{FOM,TO}_DEVICE - -[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7968778914e53788a01c2dee2692cab157de9ac0 - -Signed-off-by: Stefan Kalscheuer ---- - hif/pcie/pcie.c | 2 +- - hif/pcie/rx.c | 20 ++++++++++---------- - hif/pcie/rx_ndp.c | 20 ++++++++++---------- - hif/pcie/tx.c | 22 +++++++++++----------- - hif/pcie/tx_ndp.c | 14 +++++++------- - 5 files changed, 39 insertions(+), 39 deletions(-) - -diff --git a/hif/pcie/pcie.c b/hif/pcie/pcie.c -index bee1cc5..d85c29e 100644 ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -1556,7 +1556,7 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) - return rc; - } - -- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); -+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); - if (rc) { - pr_err("%s: 32-bit PCI DMA not supported\n", - PCIE_DRV_NAME); -diff --git a/hif/pcie/rx.c b/hif/pcie/rx.c -index 91eb984..2857c0f 100644 ---- a/hif/pcie/rx.c -+++ b/hif/pcie/rx.c -@@ -107,11 +107,11 @@ static int pcie_rx_ring_init(struct mwl_priv *priv) - desc->prx_ring[i].rssi = 0x00; - desc->prx_ring[i].pkt_len = - cpu_to_le16(SYSADPT_MAX_AGGR_SIZE); -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - rx_hndl->psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); - return -ENOMEM; -@@ -153,11 +153,11 @@ static void pcie_rx_ring_cleanup(struct mwl_priv *priv) - if (!rx_hndl->psk_buff) - continue; - -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu - (rx_hndl->pdesc->pphys_buff_data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - - dev_kfree_skb_any(rx_hndl->psk_buff); - -@@ -335,11 +335,11 @@ static inline int pcie_rx_refill(struct mwl_priv *priv, - rx_hndl->pdesc->rssi = 0x00; - rx_hndl->pdesc->pkt_len = cpu_to_le16(desc->rx_buf_size); - -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - rx_hndl->psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - dev_kfree_skb_any(rx_hndl->psk_buff); - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); -@@ -413,10 +413,10 @@ void pcie_rx_recv(unsigned long data) - prx_skb = curr_hndl->psk_buff; - if (!prx_skb) - goto out; -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(curr_hndl->pdesc->pphys_buff_data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - pkt_len = le16_to_cpu(curr_hndl->pdesc->pkt_len); - - if (skb_tailroom(prx_skb) < pkt_len) { -diff --git a/hif/pcie/rx_ndp.c b/hif/pcie/rx_ndp.c -index 228075d..106d559 100644 ---- a/hif/pcie/rx_ndp.c -+++ b/hif/pcie/rx_ndp.c -@@ -86,11 +86,11 @@ static int pcie_rx_ring_init_ndp(struct mwl_priv *priv) - } - skb_reserve(psk_buff, MIN_BYTES_RX_HEADROOM); - -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); - return -ENOMEM; -@@ -120,11 +120,11 @@ static void pcie_rx_ring_cleanup_ndp(struct mwl_priv *priv) - if (desc->prx_ring) { - for (i = 0; i < MAX_NUM_RX_DESC; i++) { - if (desc->rx_vbuflist[i]) { -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu( - desc->prx_ring[i].data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - desc->rx_vbuflist[i] = NULL; - } - } -@@ -400,11 +400,11 @@ static inline int pcie_rx_refill_ndp(struct mwl_priv *priv, u32 buf_idx) - return -ENOMEM; - skb_reserve(psk_buff, MIN_BYTES_RX_HEADROOM); - -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - wiphy_err(priv->hw->wiphy, - "refill: failed to map pci memory!\n"); - return -ENOMEM; -@@ -509,10 +509,10 @@ recheck: - break; - } - -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(prx_desc->data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - - bad_mic = false; - ctrl = le32_to_cpu(prx_ring_done->ctrl); -diff --git a/hif/pcie/tx.c b/hif/pcie/tx.c -index 62a34a8..8f3c828 100644 ---- a/hif/pcie/tx.c -+++ b/hif/pcie/tx.c -@@ -243,11 +243,11 @@ static void pcie_tx_ring_cleanup(struct mwl_priv *priv) - desc->tx_hndl[i].psk_buff->data, - le32_to_cpu( - desc->ptx_ring[i].pkt_ptr)); -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu( - desc->ptx_ring[i].pkt_ptr), - desc->tx_hndl[i].psk_buff->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(desc->tx_hndl[i].psk_buff); - desc->ptx_ring[i].status = - cpu_to_le32(EAGLE_TXD_STATUS_IDLE); -@@ -305,10 +305,10 @@ static void pcie_txbd_ring_delete(struct mwl_priv *priv) - skb = pcie_priv->tx_buf_list[num]; - tx_desc = (struct pcie_tx_desc *)skb->data; - -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(tx_desc->pkt_ptr), - skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(skb); - } - pcie_priv->tx_buf_list[num] = NULL; -@@ -453,9 +453,9 @@ static inline void pcie_tx_skb(struct mwl_priv *priv, int desc_num, - tx_desc->type = tx_ctrl->type; - tx_desc->xmit_control = tx_ctrl->xmit_control; - tx_desc->sap_pkt_info = 0; -- dma = pci_map_single(pcie_priv->pdev, tx_skb->data, -- tx_skb->len, PCI_DMA_TODEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, tx_skb->data, -+ tx_skb->len, DMA_TO_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - dev_kfree_skb_any(tx_skb); - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); -@@ -676,10 +676,10 @@ static void pcie_pfu_tx_done(struct mwl_priv *priv) - pfu_dma = (struct pcie_pfu_dma_data *)done_skb->data; - tx_desc = &pfu_dma->tx_desc; - dma_data = &pfu_dma->dma_data; -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(data_buf->paddr), - le16_to_cpu(data_buf->len), -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - tx_desc->pkt_ptr = 0; - tx_desc->pkt_len = 0; - tx_desc->status = cpu_to_le32(EAGLE_TXD_STATUS_IDLE); -@@ -768,10 +768,10 @@ static void pcie_non_pfu_tx_done(struct mwl_priv *priv) - (tx_desc->status & cpu_to_le32(EAGLE_TXD_STATUS_OK)) && - (!(tx_desc->status & - cpu_to_le32(EAGLE_TXD_STATUS_FW_OWNED)))) { -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(tx_desc->pkt_ptr), - le16_to_cpu(tx_desc->pkt_len), -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - done_skb = tx_hndl->psk_buff; - rate = le32_to_cpu(tx_desc->rate_info); - tx_desc->pkt_ptr = 0; -diff --git a/hif/pcie/tx_ndp.c b/hif/pcie/tx_ndp.c -index 6758cde..f4256c2 100644 ---- a/hif/pcie/tx_ndp.c -+++ b/hif/pcie/tx_ndp.c -@@ -131,10 +131,10 @@ static void pcie_tx_ring_cleanup_ndp(struct mwl_priv *priv) - for (i = 0; i < MAX_TX_RING_SEND_SIZE; i++) { - tx_skb = desc->tx_vbuflist[i]; - if (tx_skb) { -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - desc->pphys_tx_buflist[i], - tx_skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(tx_skb); - desc->pphys_tx_buflist[i] = 0; - desc->tx_vbuflist[i] = NULL; -@@ -266,9 +266,9 @@ static inline int pcie_tx_skb_ndp(struct mwl_priv *priv, - (TXRING_CTRL_TAG_MGMT << TXRING_CTRL_TAG_SHIFT)); - } - -- dma = pci_map_single(pcie_priv->pdev, tx_skb->data, -- tx_skb->len, PCI_DMA_TODEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, tx_skb->data, -+ tx_skb->len, DMA_TO_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - dev_kfree_skb_any(tx_skb); - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); -@@ -450,10 +450,10 @@ void pcie_tx_done_ndp(struct ieee80211_hw *hw) - "buffer is NULL for tx done ring\n"); - break; - } -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - desc->pphys_tx_buflist[index], - skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - desc->pphys_tx_buflist[index] = 0; - desc->tx_vbuflist[index] = NULL; - - diff --git a/package/kernel/qca-nss-dp/patches/0002-edma_tx_rx-support-newer-kernels-time-stamping-API.patch b/package/kernel/qca-nss-dp/patches/0002-edma_tx_rx-support-newer-kernels-time-stamping-API.patch index d84e9a98d56..d091311b975 100644 --- a/package/kernel/qca-nss-dp/patches/0002-edma_tx_rx-support-newer-kernels-time-stamping-API.patch +++ b/package/kernel/qca-nss-dp/patches/0002-edma_tx_rx-support-newer-kernels-time-stamping-API.patch @@ -40,7 +40,7 @@ Signed-off-by: Baruch Siach ndev->phydev->drv->txtstamp(ndev->phydev, skb, 0); +#else + if (ndev && phy_has_txtstamp(ndev->phydev)) -+ phy_rxtstamp(ndev->phydev, skb, 0); ++ phy_txtstamp(ndev->phydev, skb, 0); +#endif } EXPORT_SYMBOL(nss_phy_tstamp_tx_buf); diff --git a/package/libs/libbpf/Makefile b/package/libs/libbpf/Makefile index a0342311384..240eb51d68e 100644 --- a/package/libs/libbpf/Makefile +++ b/package/libs/libbpf/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libbpf -PKG_VERSION:=1.2.2 +PKG_VERSION:=1.3.0 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/libbpf/libbpf -PKG_MIRROR_HASH:=d20f5a226e5729c87c367f3fba61c44d5e13176ef12637d0e0b30629fa3ab0d6 +PKG_MIRROR_HASH:=ff597a3635c2c099419d7e9e8bc44084f7f9e0c4ba2dcd571130165a19ed4ef4 PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=1728e3e4bef0e138ea95ffe62163eb9a6ac6fa32 +PKG_SOURCE_VERSION:=v1.3.0 PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION))) PKG_MAINTAINER:=Tony Ambardar diff --git a/package/libs/libbpf/patches/001-cflags.patch b/package/libs/libbpf/patches/001-cflags.patch index d6ffc3f907f..4c0e93a75bb 100644 --- a/package/libs/libbpf/patches/001-cflags.patch +++ b/package/libs/libbpf/patches/001-cflags.patch @@ -6,5 +6,5 @@ +CFLAGS = $(EXTRA_CFLAGS) CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89 - ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS) - ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS) + ALL_CFLAGS += $(CFLAGS) \ + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile index 4bdd7c1c397..a0c6efe517e 100644 --- a/package/libs/libnl-tiny/Makefile +++ b/package/libs/libnl-tiny/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git -PKG_SOURCE_DATE:=2023-07-27 -PKG_SOURCE_VERSION:=bc92a280186f9becc53c0f17e4e43cfbdeec7e7b -PKG_MIRROR_HASH:=57c5ac75fdb4413e98e525bee7de419fc6cce5f23389581dafd9ffe22321224d +PKG_SOURCE_DATE:=2023-12-05 +PKG_SOURCE_VERSION:=965c4bf49658342ced0bd6e7cb069571b4a1ddff +PKG_MIRROR_HASH:=93596c2686926a470b6bf322f6c166a420a08abe1ea715b4ae8c9df3de00eb28 CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index c62278adc50..549e604679a 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git -PKG_MIRROR_HASH:=f22de22a784a0135cc2869fe81ff30e52136dca36863ee713503b4be5be01869 -PKG_SOURCE_DATE:=2023-05-23 -PKG_SOURCE_VERSION:=75a3b870cace1171faf57bd55e5a9a2f1564f757 +PKG_MIRROR_HASH:=daf411244a7f87c09c383c6fb69636a038c85f351bba93e80cc9aa530301199e +PKG_SOURCE_DATE:=2023-12-04.1 +PKG_SOURCE_VERSION:=ca3f6d0cdb1e588283c42d039779ceab303ceef2 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 diff --git a/package/libs/libxml2/Makefile b/package/libs/libxml2/Makefile index ed1965c0195..d65085c9c1a 100644 --- a/package/libs/libxml2/Makefile +++ b/package/libs/libxml2/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxml2 -PKG_VERSION:=2.11.4 +PKG_VERSION:=2.12.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION)) -PKG_HASH:=737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7 +PKG_HASH:=8982b9ccdf7f456e30d8f7012d50858c6623e495333b6191def455c7e95427eb PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/libxml2/patches/010-iconv.patch b/package/libs/libxml2/patches/010-iconv.patch deleted file mode 100644 index 92b09685c56..00000000000 --- a/package/libs/libxml2/patches/010-iconv.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -469,6 +469,9 @@ if(LIBXML2_WITH_PROGRAMS) - add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM}) - target_compile_definitions(${PROGRAM} PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}") - target_link_libraries(${PROGRAM} LibXml2) -+ if(LIBXML2_WITH_ICONV AND NOT Iconv_IS_BUILT_IN) -+ target_link_libraries(${PROGRAM} iconv) -+ endif() - if(HAVE_LIBHISTORY) - target_link_libraries(${PROGRAM} history) - endif() diff --git a/package/libs/udebug/Makefile b/package/libs/udebug/Makefile index 04fd7419572..0a54515e746 100644 --- a/package/libs/udebug/Makefile +++ b/package/libs/udebug/Makefile @@ -11,9 +11,9 @@ PKG_NAME:=udebug CMAKE_INSTALL:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/udebug.git -PKG_MIRROR_HASH:=baf437fb12b1faaf6c7eea3fea253c6d87c31b85f768b48d3984fe398e5b20b8 -PKG_SOURCE_DATE:=2023-11-20 -PKG_SOURCE_VERSION:=759d9404034b7da97b3950c806ace7296a0f7a12 +PKG_MIRROR_HASH:=553a58a14b59dc7b22755557acbc74f0655a431442a4faca56d28cdb1ef14fb4 +PKG_SOURCE_DATE:=2023-12-06 +PKG_SOURCE_VERSION:=6d3f51f9fda706f0cf4732c762e4dbe8c21e12cf PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) PKG_LICENSE:=GPL-2.0 @@ -26,14 +26,14 @@ define Package/libudebug SECTION:=libs CATEGORY:=Libraries TITLE:=udebug client library - DEPENDS:=+libubox + DEPENDS:=+libubox +libubus endef define Package/udebugd SECTION:=utils CATEGORY:=Utilities TITLE:=OpenWrt debug service - DEPENDS:=+libudebug +libubus + DEPENDS:=+libudebug endef define Package/udebugd/conffiles diff --git a/package/libs/udebug/files/udebug.config b/package/libs/udebug/files/udebug.config index 36b653e3065..68ddefe6cdf 100644 --- a/package/libs/udebug/files/udebug.config +++ b/package/libs/udebug/files/udebug.config @@ -1,8 +1,30 @@ +config service procd + option enabled 0 + +config service log + option enabled 0 + option debug 0 + option kernel 1 + option syslog 1 + config service hostapd option enabled 0 + option wpa_log 1 + option wpa_nl_rx 0 + option wpa_nl_tx 0 + option wpa_nl_ctrl 0 config service wpa_supplicant option enabled 0 + option wpa_log 1 + option wpa_nl_rx 0 + option wpa_nl_tx 0 + option wpa_nl_ctrl 0 config service netifd option enabled 0 + option netifd_log 1 + option netifd_nl 0 + +config service umdns + option enabled 0 diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index ae5c8026c20..076053abf65 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git -PKG_SOURCE_DATE:=2023-02-25 -PKG_SOURCE_VERSION:=498f6e268d4d2b0ad33b430f4ba1abe397d31496 -PKG_MIRROR_HASH:=a201d065dd613e30886c9f13a0851cec79538192cfe591b6f8ecd88724d55fb1 +PKG_SOURCE_DATE:=2023-11-26 +PKG_SOURCE_VERSION:=263b9a97cf7e1e2467319c23832b705fc01190b5 +PKG_MIRROR_HASH:=1c01d633f21c6cb578a785826d1983284b28f49b20d608d82179842dcdbeed6e CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch b/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch index 39652fc995e..9a80563be43 100644 --- a/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch +++ b/package/network/config/firewall4/patches/001-firewall4-add-support-for-fullcone-nat.patch @@ -35,9 +35,9 @@ Renew: ZiMing Mo option name lan --- a/root/usr/share/firewall4/templates/ruleset.uc +++ b/root/usr/share/firewall4/templates/ruleset.uc -@@ -320,6 +320,12 @@ table inet fw4 { +@@ -327,6 +327,12 @@ table inet fw4 { {% for (let redirect in fw4.redirects(`dstnat_${zone.name}`)): %} - {%+ include("redirect.uc", { fw4, redirect }) %} + {%+ include("redirect.uc", { fw4, zone, redirect }) %} {% endfor %} +{% if (zone.masq && fw4.default_option("fullcone")): %} + {%+ include("zone-fullcone.uc", { fw4, zone, family: 4, direction: "dstnat" }) %} @@ -48,9 +48,9 @@ Renew: ZiMing Mo {% fw4.includes('chain-append', `dstnat_${zone.name}`) %} } -@@ -330,20 +336,26 @@ table inet fw4 { +@@ -337,20 +343,26 @@ table inet fw4 { {% for (let redirect in fw4.redirects(`srcnat_${zone.name}`)): %} - {%+ include("redirect.uc", { fw4, redirect }) %} + {%+ include("redirect.uc", { fw4, zone, redirect }) %} {% endfor %} -{% if (zone.masq): %} +{% if (zone.masq && !fw4.default_option("fullcone")): %} @@ -92,7 +92,7 @@ Renew: ZiMing Mo const fs = require("fs"); const uci = require("uci"); const ubus = require("ubus"); -@@ -490,6 +492,25 @@ function nft_try_hw_offload(devices) { +@@ -489,6 +491,25 @@ function nft_try_hw_offload(devices) { return (rc == 0); } @@ -118,7 +118,7 @@ Renew: ZiMing Mo return { read_kernel_version: function() { -@@ -840,6 +861,18 @@ return { +@@ -832,6 +853,18 @@ return { warn(`[!] ${msg}\n`); }, @@ -137,7 +137,7 @@ Renew: ZiMing Mo get: function(sid, opt) { return this.cursor.get("firewall", sid, opt); }, -@@ -1021,6 +1054,21 @@ return { +@@ -1013,6 +1046,21 @@ return { } }, @@ -159,7 +159,7 @@ Renew: ZiMing Mo parse_policy: function(val) { return this.parse_enum(val, [ "accept", -@@ -1460,6 +1508,7 @@ return { +@@ -1452,6 +1500,7 @@ return { "dnat", "snat", "masquerade", @@ -167,7 +167,7 @@ Renew: ZiMing Mo "accept", "reject", "drop" -@@ -1927,6 +1976,8 @@ return { +@@ -1923,6 +1972,8 @@ return { } let defs = this.parse_options(data, { @@ -176,7 +176,7 @@ Renew: ZiMing Mo input: [ "policy", "drop" ], output: [ "policy", "drop" ], forward: [ "policy", "drop" ], -@@ -1961,6 +2012,11 @@ return { +@@ -1957,6 +2008,11 @@ return { delete defs.syn_flood; @@ -188,7 +188,7 @@ Renew: ZiMing Mo this.state.defaults = defs; }, -@@ -2186,10 +2242,23 @@ return { +@@ -2182,10 +2238,23 @@ return { zone.related_subnets = related_subnets; zone.related_physdevs = related_physdevs; diff --git a/package/network/config/firewall4/patches/002-fix-adding-offloading-device.patch b/package/network/config/firewall4/patches/002-fix-adding-offloading-device.patch new file mode 100644 index 00000000000..5da456ae1c6 --- /dev/null +++ b/package/network/config/firewall4/patches/002-fix-adding-offloading-device.patch @@ -0,0 +1,13 @@ +--- a/root/usr/share/ucode/fw4.uc ++++ b/root/usr/share/ucode/fw4.uc +@@ -2101,8 +2101,8 @@ return { + }); + } + +- if (net.physdev && !e.invert) +- push(related_physdevs, net.physdev); ++ if (net.up && net.device && !e.invert) ++ push(related_physdevs, net.device); + + push(related_subnets, ...(net.ipaddrs || [])); + } diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index ccd566e0a76..78d5117ae63 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2023-11-20 -PKG_SOURCE_VERSION:=f3e06e81b347bbdec1c6c71603328b6e442728d4 -PKG_MIRROR_HASH:=f16dd61aede5597fd7b5ee8e7752a916494281bc981b35c16e788ddb7409584a +PKG_SOURCE_DATE:=2023-12-05 +PKG_SOURCE_VERSION:=cc9e928f0a12f04c82356c02dd9a84ac6b383fb9 +PKG_MIRROR_HASH:=b5bcb3e1c1841559bf202d2dc67dde62dce3c880043166cc8b3a3f97ce004c2a PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/dnsmasq/patches/200-ubus_dns.patch b/package/network/services/dnsmasq/patches/200-ubus_dns.patch index 8a70bb8bdf1..ccbe70ab9c3 100644 --- a/package/network/services/dnsmasq/patches/200-ubus_dns.patch +++ b/package/network/services/dnsmasq/patches/200-ubus_dns.patch @@ -210,7 +210,7 @@ + return; + + ubus_free(ubus); -+ ubus = NULL; ++ daemon->ubus = NULL; +} + static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj, diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 84138f29a58..b85f523b352 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -782,33 +782,9 @@ let main_obj = { }, }; -function handle_debug_config(cfg) { - hostapd.printf(`handle_debug_config: ${cfg}\n`); - if (!cfg) - return; - - let data = cfg.service; - if (!data) - return; - - data = data.hostapd; - if (!data) - return; - - hostapd.udebug_set(!!+data.enabled); -} - hostapd.data.ubus = ubus; hostapd.data.obj = ubus.publish("hostapd", main_obj); -hostapd.data.debug_sub = ubus.subscriber((req) => { - if (req.type != "config") - return; - - handle_debug_config(req.data); -}); - -hostapd.data.debug_sub.subscribe("udebug"); -handle_debug_config(ubus.call("udebug", "get_config", {})); +hostapd.udebug_set("hostapd", hostapd.data.ubus); function bss_event(type, name, data) { let ubus = hostapd.data.ubus; @@ -823,6 +799,7 @@ return { shutdown: function() { for (let phy in hostapd.data.config) iface_set_config(phy, null); + hostapd.udebug_set(null); hostapd.ubus.disconnect(); }, bss_add: function(name, obj) { diff --git a/package/network/services/hostapd/files/wpa_supplicant.uc b/package/network/services/hostapd/files/wpa_supplicant.uc index aac144b3399..1709bb019e3 100644 --- a/package/network/services/hostapd/files/wpa_supplicant.uc +++ b/package/network/services/hostapd/files/wpa_supplicant.uc @@ -244,32 +244,9 @@ let main_obj = { }, }; -function handle_debug_config(cfg) { - if (!cfg) - return; - - let data = cfg.service; - if (!data) - return; - - data = data.wpa_supplicant; - if (!data) - return; - - wpas.udebug_set(!!+data.enabled); -} - wpas.data.ubus = ubus; wpas.data.obj = ubus.publish("wpa_supplicant", main_obj); -wpas.data.debug_sub = ubus.subscriber((req) => { - if (req.type != "config") - return; - - handle_debug_config(req.data); -}); - -wpas.data.debug_sub.subscribe("udebug"); -handle_debug_config(ubus.call("udebug", "get_config", {})); +wpas.udebug_set("wpa_supplicant", wpas.data.ubus); function iface_event(type, name, data) { let ubus = wpas.data.ubus; diff --git a/package/network/services/hostapd/src/src/utils/ucode.c b/package/network/services/hostapd/src/src/utils/ucode.c index 14fd6bc5ec9..29c753c3269 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.c +++ b/package/network/services/hostapd/src/src/utils/ucode.c @@ -16,8 +16,59 @@ static uc_vm_t vm; static struct uloop_timeout gc_timer; static struct udebug ud; static struct udebug_buf ud_log, ud_nl[3]; - +static const struct udebug_buf_meta meta_log = { + .name = "wpa_log", + .format = UDEBUG_FORMAT_STRING, +}; +static const struct udebug_buf_meta meta_nl_ll = { + .name = "wpa_nl_ctrl", + .format = UDEBUG_FORMAT_PACKET, + .sub_format = UDEBUG_DLT_NETLINK, +}; +static const struct udebug_buf_meta meta_nl_tx = { + .name = "wpa_nl_tx", + .format = UDEBUG_FORMAT_PACKET, + .sub_format = UDEBUG_DLT_NETLINK, +}; #define UDEBUG_FLAG_RX_FRAME (1ULL << 0) +static const struct udebug_buf_flag rx_flags[] = { + { "rx_frame", UDEBUG_FLAG_RX_FRAME }, +}; +static const struct udebug_buf_meta meta_nl_rx = { + .name = "wpa_nl_rx", + .format = UDEBUG_FORMAT_PACKET, + .sub_format = UDEBUG_DLT_NETLINK, + .flags = rx_flags, + .n_flags = ARRAY_SIZE(rx_flags), +}; +static struct udebug_ubus_ring udebug_rings[] = { + { + .buf = &ud_log, + .meta = &meta_log, + .default_entries = 1024, + .default_size = 64 * 1024 + }, + { + .buf = &ud_nl[0], + .meta = &meta_nl_rx, + .default_entries = 1024, + .default_size = 256 * 1024, + }, + { + .buf = &ud_nl[1], + .meta = &meta_nl_tx, + .default_entries = 1024, + .default_size = 64 * 1024, + }, + { + .buf = &ud_nl[2], + .meta = &meta_nl_ll, + .default_entries = 1024, + .default_size = 32 * 1024, + } +}; +char *udebug_service; +struct udebug_ubus ud_ubus; static void uc_gc_timer(struct uloop_timeout *timeout) { @@ -301,68 +352,67 @@ static void udebug_netlink_hook(int tx, const void *data, size_t len) !(udebug_buf_flags(buf) & UDEBUG_FLAG_RX_FRAME)) return; + if (!udebug_buf_valid(buf)) + return; + udebug_entry_init(buf); udebug_entry_append(buf, &hdr, sizeof(hdr)); udebug_entry_append(buf, data, len); udebug_entry_add(buf); } +static void +wpa_udebug_config(struct udebug_ubus *ctx, struct blob_attr *data, + bool enabled) +{ + udebug_ubus_apply_config(&ud, udebug_rings, ARRAY_SIZE(udebug_rings), + data, enabled); + + if (udebug_buf_valid(&ud_log)) { + wpa_printf_hook = udebug_printf_hook; + wpa_hexdump_hook = udebug_hexdump_hook; + } else { + wpa_printf_hook = NULL; + wpa_hexdump_hook = NULL; + } + + if (udebug_buf_valid(&ud_nl[0]) || + udebug_buf_valid(&ud_nl[1]) || + udebug_buf_valid(&ud_nl[2])) + wpa_netlink_hook = udebug_netlink_hook; + else + wpa_netlink_hook = NULL; +} + uc_value_t *uc_wpa_udebug_set(uc_vm_t *vm, size_t nargs) { - static const struct udebug_buf_meta meta_log = { - .name = "wpa_log", - .format = UDEBUG_FORMAT_STRING, - }; - static const struct udebug_buf_meta meta_nl_ll = { - .name = "wpa_nl_ctrl", - .format = UDEBUG_FORMAT_PACKET, - .sub_format = UDEBUG_DLT_NETLINK, - }; - static const struct udebug_buf_meta meta_nl_tx = { - .name = "wpa_nl_tx", - .format = UDEBUG_FORMAT_PACKET, - .sub_format = UDEBUG_DLT_NETLINK, - }; - static const struct udebug_buf_flag rx_flags[] = { - { "rx_frame", UDEBUG_FLAG_RX_FRAME }, - }; - static const struct udebug_buf_meta meta_nl_rx = { - .name = "wpa_nl_rx", - .format = UDEBUG_FORMAT_PACKET, - .sub_format = UDEBUG_DLT_NETLINK, - .flags = rx_flags, - .n_flags = ARRAY_SIZE(rx_flags), - }; - bool val = ucv_is_truish(uc_fn_arg(0)); + uc_value_t *name = uc_fn_arg(0); + uc_value_t *ubus = uc_fn_arg(1); static bool enabled = false; + struct ubus_context *ctx; + bool cur_en; + + cur_en = ucv_type(name) == UC_STRING; + ctx = ucv_resource_data(ubus, "ubus.connection"); + if (!ctx) + cur_en = false; - if (enabled == val) + if (enabled == cur_en) return ucv_boolean_new(true); - enabled = val; - if (val) { + enabled = cur_en; + if (enabled) { + udebug_service = strdup(ucv_string_get(name)); udebug_init(&ud); udebug_auto_connect(&ud, NULL); - udebug_buf_init(&ud_log, 1024, 64 * 1024); - udebug_buf_add(&ud, &ud_log, &meta_log); - udebug_buf_init(&ud_nl[0], 1024, 256 * 1024); - udebug_buf_add(&ud, &ud_nl[0], &meta_nl_rx); - udebug_buf_init(&ud_nl[1], 1024, 64 * 1024); - udebug_buf_add(&ud, &ud_nl[1], &meta_nl_tx); - udebug_buf_init(&ud_nl[2], 256, 32 * 1024); - udebug_buf_add(&ud, &ud_nl[2], &meta_nl_ll); - - wpa_printf_hook = udebug_printf_hook; - wpa_hexdump_hook = udebug_hexdump_hook; - wpa_netlink_hook = udebug_netlink_hook; + udebug_ubus_init(&ud_ubus, ctx, udebug_service, wpa_udebug_config); } else { - for (size_t i = 0; i < ARRAY_SIZE(ud_nl); i++) - udebug_buf_free(&ud_nl[i]); - udebug_buf_free(&ud_log); + udebug_ubus_free(&ud_ubus); + for (size_t i = 0; i < ARRAY_SIZE(udebug_rings); i++) + if (udebug_buf_valid(udebug_rings[i].buf)) + udebug_buf_free(udebug_rings[i].buf); udebug_free(&ud); - wpa_printf_hook = NULL; - wpa_hexdump_hook = NULL; - wpa_netlink_hook = NULL; + free(udebug_service); } return ucv_boolean_new(true); diff --git a/package/network/utils/bpftool/Makefile b/package/network/utils/bpftool/Makefile index cbbba2dba59..2782a307353 100644 --- a/package/network/utils/bpftool/Makefile +++ b/package/network/utils/bpftool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bpftools -PKG_VERSION:=7.2.0 +PKG_VERSION:=7.3.0 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/libbpf/bpftool +PKG_MIRROR_HASH:=c8fe336005019fee4d4fd416ce68a749fb479786dead69d6a0b3b04bcd903b98 PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=19ff0564980a7429e730f6987a0b0bf418b3c676 -PKG_MIRROR_HASH:=f9b9871f64986dd2e5dab7060bb919398256ba93964da49c62efaf0e6bc9bbc4 +PKG_SOURCE_VERSION:=v7.3.0 PKG_MAINTAINER:=Tony Ambardar diff --git a/package/network/utils/bpftool/patches/001-cflags.patch b/package/network/utils/bpftool/patches/001-cflags.patch index b06842a0be7..39cef10c72a 100644 --- a/package/network/utils/bpftool/patches/001-cflags.patch +++ b/package/network/utils/bpftool/patches/001-cflags.patch @@ -6,5 +6,5 @@ +CFLAGS = $(EXTRA_CFLAGS) CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89 - ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS) - ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS) + ALL_CFLAGS += $(CFLAGS) \ + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 7c829260d5e..0af90c7d4ad 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=3 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=a7e42525ae65eb1342e593a714e88bc59e46467cbb5a7fd7d7aca4a9815b7c0d -PKG_SOURCE_DATE:=2023-06-25 -PKG_SOURCE_VERSION:=2db836553e8fc318143b38dbc6e12b8625cf5c33 +PKG_MIRROR_HASH:=48e5d555b5beb15cf936e1d2433b8e614de64a4eaf25293f0211eeb9ac79d534 +PKG_SOURCE_DATE:=2023-11-28 +PKG_SOURCE_VERSION:=7e6c6efd6fbcc7955801c5e2ac915a90697e1fd9 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -40,7 +40,7 @@ CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)" define Package/procd/Default SECTION:=base CATEGORY:=Base system - DEPENDS:=+ubusd +ubus +libjson-script +ubox +libubox \ + DEPENDS:=+ubusd +ubus +libjson-script +ubox +libubox +libudebug \ +libubus +libblobmsg-json +libjson-c +jshn TITLE:=OpenWrt system process manager USERID:=:dialout=20 :audio=29 diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index e91763b074d..ed55617cfa7 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ubox -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git -PKG_SOURCE_DATE:=2022-08-13 -PKG_SOURCE_VERSION:=4c7b720b9c63b826fb9404e454ae54f2ef5649d5 -PKG_MIRROR_HASH:=35178148034dfef36c5fda2bc8217617920bc1a3b86f72efbe87e85048a6a2a8 +PKG_SOURCE_DATE:=2023-11-30 +PKG_SOURCE_VERSION:=c08709cceb554cba02c935d1442f6a042fe6b2a8 +PKG_MIRROR_HASH:=719ae701546df7c5972352d778a980cbc9f48623dda86443398698837124818b CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -44,7 +44,7 @@ endef define Package/logd SECTION:=base CATEGORY:=Base system - DEPENDS:=+libubox +libubus +libblobmsg-json + DEPENDS:=+libubox +libubus +libblobmsg-json +libudebug TITLE:=OpenWrt system log implementation USERID:=logd=514:logd=514 endef @@ -63,10 +63,11 @@ define Package/ubox/install endef define Package/logd/install - $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ + $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ $(1)/usr/share/acl.d $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{logd,logread} $(1)/sbin/ $(INSTALL_BIN) ./files/log.init $(1)/etc/init.d/log + $(INSTALL_DATA) ./files/logd.json $(1)/usr/share/acl.d endef $(eval $(call BuildPackage,ubox)) diff --git a/package/system/ubox/files/logd.json b/package/system/ubox/files/logd.json new file mode 100644 index 00000000000..f0b2fb1e12c --- /dev/null +++ b/package/system/ubox/files/logd.json @@ -0,0 +1,4 @@ +{ + "user": "logd", + "publish": [ "log" ] +} diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 42737ff470a..fdf16cfeeef 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2023-11-14 -PKG_SOURCE_VERSION:=b3e8c4ef07ebb6f0f34a5c1f0dc1539068363619 -PKG_MIRROR_HASH:=bb7296b17d5a59b9080d4c9ae188dee49f49c0ce88a5cbe0317102123583d663 +PKG_SOURCE_DATE:=2023-11-28 +PKG_SOURCE_VERSION:=f84eb5998c6ea2d34989ca2d3254e56c66139313 +PKG_MIRROR_HASH:=d0c15a0275fa3d35accddb84611700bf601745ad68462bc18905bb65da931f21 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 27a6fd2248e..d5dc1a6d782 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools PKG_VERSION:=1.16.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ @@ -133,10 +133,10 @@ Package/mkf2fs-selinux/install = $(Package/mkf2fs/install) define Package/f2fsck/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs endef Package/f2fsck-selinux/install = $(Package/f2fsck/install) diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile index 067e56e02de..670b9343760 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/jow-/ucode.git -PKG_SOURCE_DATE:=2023-11-07 -PKG_SOURCE_VERSION:=a6e75e02528e36f3610a7f0073453018336def2e -PKG_MIRROR_HASH:=e1a0f98ba865ed5911d5db3bfca55a2f1b825992bf5f7c7e324928d9412d7ae2 +PKG_SOURCE_DATE:=2023-11-30 +PKG_SOURCE_VERSION:=6e89b89e95bbb140bbff5ab72b8c9632727bf6a6 +PKG_MIRROR_HASH:=20ba99f8c2591b581cdf0245dd40301e517659193cddaa3a3888125fcc85b2aa PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC diff --git a/scripts/linksys-image.sh b/scripts/linksys-image.sh deleted file mode 100755 index d251b5da8ee..00000000000 --- a/scripts/linksys-image.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2018 Oceanic Systems (UK) Ltd -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -# Maintained by: Ryan Pannell -# -# Write Linksys signature for factory image -# This is appended to the factory image and is tested by the Linksys Upgrader - as observed in civic. -# The footer is 256 bytes. The format is: -# .LINKSYS. This is detected by the Linksys upgrader before continuing with upgrade. (9 bytes) -# The version number of upgrade. Not checked so use arbitrary value (8 bytes) -# Model of target device, padded (0x20) to (15 bytes) -# CRC checksum of the image to flash (8 byte) -# Padding ('0' + 0x20 *7) (8 bytes) -# Signature of signer. Not checked so use arbitrary value (16 bytes) -# Padding (0x00) (192 bytes) - -## version history -# * version 1: initial commit - -set -e - -ME="${0##*/}" - -usage() { - echo "Usage: $ME " - [ "$IMG_OUT" ] && rm -f "$IMG_OUT" - exit 1 -} - -[ "$#" -lt 3 ] && usage - -TYPE=$1 - -tmpdir="$( mktemp -d 2> /dev/null )" -if [ -z "$tmpdir" ]; then - # try OSX signature - tmpdir="$( mktemp -t 'ubitmp' -d )" -fi - -if [ -z "$tmpdir" ]; then - exit 1 -fi - -trap "rm -rf $tmpdir" EXIT - -IMG_TMP_OUT="${tmpdir}/out" - -IMG_IN=$2 -IMG_OUT="${IMG_IN}.new" - -[ ! -f "$IMG_IN" ] && echo "$ME: Not a valid image: $IMG_IN" && usage - -dd if="${IMG_IN}" of="${IMG_TMP_OUT}" -CRC=$(printf "%08X" $(dd if="${IMG_IN}" bs=$(stat -c%s "${IMG_IN}") count=1|cksum| cut -d ' ' -f1)) - -printf ".LINKSYS.01000409%-15s%-8s%-8s%-16s" "${TYPE}" "${CRC}" "0" "K0000000F0246434" >> "${IMG_TMP_OUT}" - -dd if=/dev/zero bs=1 count=192 conv=notrunc >> "${IMG_TMP_OUT}" - -cp "${IMG_TMP_OUT}" "${IMG_OUT}" diff --git a/scripts/sercomm-pid.py b/scripts/sercomm-pid.py index 4d88a678396..2c246fc298b 100755 --- a/scripts/sercomm-pid.py +++ b/scripts/sercomm-pid.py @@ -34,7 +34,7 @@ def get_pid(args): enc = args.hw_version.rjust(8, '0').encode('ascii') struct.pack_into('>8s', buf, 0x0, enc) - enc = binascii.hexlify(args.hw_id.encode()) + enc = binascii.hexlify(args.hw_id.encode()).upper() struct.pack_into('>6s', buf, 0x8, enc) enc = args.sw_version.rjust(4, '0').encode('ascii') diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index cbfe1235e95..0788037981d 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -267,23 +267,25 @@ reg = <0x07fc0000 0x00040000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_wifi_0: macaddr@0 { - reg = <0x0 0x6>; - }; - macaddr_wifi_c: macaddr@c { - reg = <0xc 0x6>; - }; + macaddr_wifi_0: macaddr@0 { + reg = <0x0 0x6>; + }; + macaddr_wifi_c: macaddr@c { + reg = <0xc 0x6>; + }; - calibration_wifi_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_wifi_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_wifi_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_wifi_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/armsr/base-files.mk b/target/linux/armsr/base-files.mk index 88ba97d38a3..e2b7d05f573 100644 --- a/target/linux/armsr/base-files.mk +++ b/target/linux/armsr/base-files.mk @@ -1,6 +1,6 @@ -GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL)) ifeq ($(GRUB_SERIAL),) -$(error This platform requires CONFIG_GRUB_SERIAL be set!) +$(error This platform requires CONFIG_TARGET_SERIAL be set!) endif define Package/base-files/install-target diff --git a/target/linux/armsr/image/Makefile b/target/linux/armsr/image/Makefile index f04313d3862..942dd2b405d 100644 --- a/target/linux/armsr/image/Makefile +++ b/target/linux/armsr/image/Makefile @@ -15,7 +15,7 @@ ifneq ($(CONFIG_GRUB_CONSOLE),) GRUB_TERMINALS += console endif -GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL)) GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off) GRUB_TERMINALS += serial diff --git a/target/linux/armsr/modules.mk b/target/linux/armsr/modules.mk index 6e9ecda9990..521a52fec15 100644 --- a/target/linux/armsr/modules.mk +++ b/target/linux/armsr/modules.mk @@ -216,24 +216,6 @@ endef $(eval $(call KernelPackage,imx7-ulp-wdt)) -define KernelPackage/stmmac-core - SUBMENU=$(NETWORK_DEVICES_MENU) - TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others) - DEPENDS:=@(TARGET_armsr_armv8) +kmod-pcs-xpcs +kmod-ptp \ - +kmod-of-mdio - KCONFIG:=CONFIG_STMMAC_ETH \ - CONFIG_STMMAC_SELFTESTS=n \ - CONFIG_STMMAC_PLATFORM \ - CONFIG_CONFIG_DWMAC_DWC_QOS_ETH=n \ - CONFIG_DWMAC_GENERIC - FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko \ - $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko \ - $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.ko - AUTOLOAD=$(call AutoLoad,40,stmmac stmmac-platform dwmac-generic) -endef - -$(eval $(call KernelPackage,stmmac-core)) - define KernelPackage/dwmac-imx SUBMENU=$(NETWORK_DEVICES_MENU) TITLE:=NXP i.MX8 Ethernet controller diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts index 32d403fe6cd..c8510a89441 100644 --- a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts +++ b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts @@ -159,7 +159,6 @@ hwinfo: partition@fe0000 { reg = <0xfe0000 0x10000>; - compatible = "nvmem-cells"; label = "hwinfo"; read-only; diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-175.dts b/target/linux/ath79/dts/ar7161_aruba_ap-175.dts index dd29a687ba0..96a76a3cfc6 100644 --- a/target/linux/ath79/dts/ar7161_aruba_ap-175.dts +++ b/target/linux/ath79/dts/ar7161_aruba_ap-175.dts @@ -122,9 +122,8 @@ ath9k0: wifi@0,11 { compatible = "pci168c,0029"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; reg = <0x8800 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -132,9 +131,8 @@ ath9k1: wifi@0,12 { compatible = "pci168c,0029"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; reg = <0x9000 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -151,7 +149,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; @@ -187,6 +185,18 @@ label = "hwinfo"; reg = <0xfe0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hwinfo_1c: macaddr@1c { + compatible = "mac-base"; + reg = <0x1c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@ff0000 { @@ -198,16 +208,6 @@ }; }; -&hwinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_hwinfo_1c: macaddr@1c { - reg = <0x1c 0x6>; - }; -}; - &i2c0 { gpio_ext: gpio@21 { status = "okay"; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi index 6e1ba2d47e4..e3f48fee852 100644 --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi @@ -148,6 +148,22 @@ label = "art"; reg = <0x0050000 0x0010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; + + macaddr_art_520c: macaddr@520c { + compatible = "mac-base"; + reg = <0x520c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -240,23 +256,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_520c>; + nvmem-cells = <&macaddr_art_520c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; - - macaddr_art_520c: macaddr@520c { - reg = <0x520c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts index bdb678298d7..b62111c110e 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -186,7 +186,6 @@ }; partition@660000 { - compatible = "nvmem-cells"; label = "caldata"; reg = <0x660000 0x010000>; read-only; diff --git a/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts b/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts index 331bc317141..ddcf68970d3 100644 --- a/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts +++ b/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts @@ -99,9 +99,8 @@ compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; ieee80211-freq-limit = <2402000 2482000>; - nvmem-cells = <&macaddr_art_120c>, <&cal_art_1000>; + nvmem-cells = <&macaddr_uboot_3ff80 9>, <&cal_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; }; @@ -110,9 +109,8 @@ compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; ieee80211-freq-limit = <2402000 2482000 4900000 5990000>; - nvmem-cells = <&macaddr_art_520c>, <&cal_art_5000>; + nvmem-cells = <&macaddr_uboot_3ff80 2>, <&cal_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <9>; #gpio-cells = <2>; gpio-controller; }; @@ -133,7 +131,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_uboot_3ff80 0>; nvmem-cell-names = "mac-address"; pll-data = <0x00110000 0x00001099 0x00991099>; @@ -149,35 +147,18 @@ status = "okay"; }; -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - /* Currently doesn't work, because this one lacks colons as delimiters */ - macaddr_uboot_3ff80: mac-address-ascii@3ff80 { - reg = <0x3ff80 0xc>; - }; -}; - &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_120c: mac-address@120c { - reg = <0x120c 0x6>; - }; - - cal_art_5000: calibration@5000 { - reg = <0x5000 0xeb8>; - }; + cal_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; - macaddr_art_520c: mac-address@520c { - reg = <0x520c 0x6>; + cal_art_5000: calibration@5000 { + reg = <0x5000 0xeb8>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts index 7f2a118b845..2d21a54fa92 100644 --- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts +++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts @@ -158,16 +158,19 @@ label = "Atheros Board Data"; reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_wan: macaddr@1000 { - reg = <0x1000 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_wan: macaddr@1000 { + reg = <0x1000 0x6>; + }; - macaddr_lan: macaddr@1006 { - reg = <0x1006 0x6>; + macaddr_lan: macaddr@1006 { + reg = <0x1006 0x6>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7161_meraki_mr16.dts b/target/linux/ath79/dts/ar7161_meraki_mr16.dts index 7a19da82e36..6b8574e880f 100644 --- a/target/linux/ath79/dts/ar7161_meraki_mr16.dts +++ b/target/linux/ath79/dts/ar7161_meraki_mr16.dts @@ -74,9 +74,8 @@ compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; }; @@ -85,9 +84,8 @@ compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; #gpio-cells = <2>; gpio-controller; }; @@ -103,7 +101,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 0>; nvmem-cell-names = "mac-address"; pll-data = <0x00110000 0x00001099 0x00991099>; @@ -141,6 +139,18 @@ label = "config"; reg = <0x80000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_66: macaddr@66 { + compatible = "mac-base"; + reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -157,13 +167,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_66: macaddr@66 { - reg = <0x66 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndap360.dts b/target/linux/ath79/dts/ar7161_netgear_wndap360.dts index 21dc423c357..9761234714c 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndap360.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndap360.dts @@ -112,28 +112,32 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; - - macaddr_art_520c: macaddr@520c { - reg = <0x520c 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0xeb8>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; + + macaddr_art_520c: macaddr@520c { + compatible = "mac-base"; + reg = <0x520c 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0xeb8>; + }; }; }; }; @@ -155,9 +159,8 @@ ath9k1: wifi@0,12 { compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; - nvmem-cells = <&macaddr_art_520c>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_520c 1>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; }; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts index 351d5e03647..5b44505ce2b 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts @@ -35,6 +35,32 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -57,29 +83,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts index eedd375cc9f..6b89fcd0ff9 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts @@ -35,6 +35,32 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -76,29 +102,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts index 487b00b0dd0..cf23786ae31 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts @@ -36,6 +36,32 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -58,29 +84,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts index 0c2eadae5c1..72b169fc769 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts @@ -36,6 +36,32 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -58,29 +84,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts index 88c3170c6e8..2e141d07e57 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts @@ -35,6 +35,32 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -57,29 +83,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts index 0536ecb0533..83b8f216cc4 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts @@ -36,6 +36,32 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -58,29 +84,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi b/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi index e97e31e58ec..065068571cd 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi +++ b/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi @@ -223,21 +223,3 @@ &usb_phy { status = "okay"; }; - -&board_data { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdata_60: macaddr@60 { - reg = <0x60 0x6>; - }; - - macaddr_bdata_66: macaddr@66 { - reg = <0x66 0x6>; - }; - - macaddr_bdata_76: macaddr@76 { - reg = <0x76 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts b/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts index 17735e596f5..eacda20c61a 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts +++ b/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts @@ -6,3 +6,23 @@ model = "Ruckus ZoneFlex 7341[-U]"; compatible = "ruckus,zf7341", "qca,ar7161"; }; + +&board_data { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdata_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_bdata_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_bdata_76: macaddr@76 { + reg = <0x76 0x6>; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts b/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts index 37ea3057900..adaeb18eda1 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts +++ b/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts @@ -113,3 +113,23 @@ gpio-hog; }; }; + +&board_data { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdata_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_bdata_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_bdata_76: macaddr@76 { + reg = <0x76 0x6>; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts b/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts index 4ece56dd0a0..723e4d9a3b1 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts +++ b/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts @@ -33,7 +33,25 @@ }; &board_data { - macaddr_bdata_6c: macaddr@6c { - reg = <0x6c 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdata_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_bdata_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_bdata_6c: macaddr@6c { + reg = <0x6c 0x6>; + }; + + macaddr_bdata_76: macaddr@76 { + reg = <0x76 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts index cf51078bc32..ad42e0a05fd 100644 --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts @@ -147,22 +147,33 @@ reg = <0x3f0000 0x10000>; label = "art"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + compatible = "mac-base"; + reg = <0x120c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_art_120c 0>; nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_art_120c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie { @@ -172,7 +183,7 @@ compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_art_120c 0>; nvmem-cell-names = "mac-address"; #gpio-cells = <2>; gpio-controller; @@ -184,13 +195,3 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts index 9a233c836b7..ec3a3718506 100644 --- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -96,11 +96,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts index 91b72cf1db8..32903c2e8ff 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -168,13 +168,29 @@ label = "art"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -191,25 +207,10 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; - -&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/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index 9bae95b5575..ac27874c68a 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -101,13 +101,29 @@ reg = <0x3f0000 0x10000>; label = "art"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -124,25 +140,10 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; - -&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/ath79/dts/ar7240_openmesh_om2p-v1.dts b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts index a66d9140150..17a57446618 100644 --- a/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts +++ b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts @@ -127,20 +127,22 @@ reg = <0xfc0000 0x040000>; read-only; - 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>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts index 9e0671d638c..f5d0a9e3b07 100644 --- a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts +++ b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts @@ -150,6 +150,24 @@ reg = <0xfc0000 0x40000>; label = "board-data"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_board_data_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_board_data_6c: macaddr@6c { + reg = <0x6c 0x6>; + }; + }; }; }; }; @@ -176,21 +194,3 @@ nvmem-cell-names = "mac-address"; }; }; - -&board_data { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_board_data_60: macaddr@60 { - reg = <0x60 0x6>; - }; - - macaddr_board_data_66: macaddr@66 { - reg = <0x66 0x6>; - }; - - macaddr_board_data_6c: macaddr@6c { - reg = <0x6c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7240_tplink.dtsi b/target/linux/ath79/dts/ar7240_tplink.dtsi index 60cd38c220c..5bcfb54bfce 100644 --- a/target/linux/ath79/dts/ar7240_tplink.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink.dtsi @@ -77,6 +77,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -104,7 +116,7 @@ ath9k: wifi@0,0 { reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; #gpio-cells = <2>; gpio-controller; @@ -116,13 +128,3 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi index 9d896360dc1..6c090fb437e 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi @@ -30,15 +30,13 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &ath9k { diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts index 290871d648e..0a6936c5bfd 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -171,6 +171,22 @@ label = "art"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -179,7 +195,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -196,25 +212,10 @@ ath9k: wifi@0,0 { compatible = "pci168c,002e"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; - -&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/ath79/dts/ar7241_netgear_wnr2200-16m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts index f5c060d7806..324207656fc 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts @@ -35,11 +35,27 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -49,21 +65,6 @@ }; &ath9k { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&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/ath79/dts/ar7241_netgear_wnr2200-8m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts index e47336e4d29..fbd3cb8ec8f 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts @@ -35,11 +35,27 @@ label = "art"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -49,21 +65,6 @@ }; &ath9k { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&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/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi index 0861cc62322..01eee39f195 100644 --- a/target/linux/ath79/dts/ar7241_tplink.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi @@ -64,6 +64,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -89,7 +101,7 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; }; @@ -97,22 +109,11 @@ ð0 { /* WAN interface, initialized last as eth1 */ status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { /* LAN interface, initialized first as eth0 */ - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts index 6ee7d9ec4f9..e7fe31f36d0 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -102,6 +102,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -128,7 +140,7 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; }; @@ -136,23 +148,11 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts index 3f965ec9dea..e3c8f2a6099 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts @@ -87,20 +87,22 @@ reg = <0xff0000 0x10000>; read-only; - 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>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi index 02166a26eb8..d9c7336f911 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi @@ -73,16 +73,18 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts index dde91295052..c17a8df6fed 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts @@ -20,11 +20,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts index 4a2f749cc45..ac4c096961b 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts @@ -138,16 +138,18 @@ label = "art"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts index 84d029b5dce..81290479b08 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts @@ -83,11 +83,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts index 7458685802b..8e8deba9337 100644 --- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -63,7 +63,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; @@ -78,9 +78,8 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -88,11 +87,15 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts index f1f86019dd9..69629335b3c 100644 --- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -63,7 +63,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; @@ -78,9 +78,8 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -88,11 +87,15 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_meraki_mr12.dts b/target/linux/ath79/dts/ar7242_meraki_mr12.dts index 42b4966e744..adea2778eac 100644 --- a/target/linux/ath79/dts/ar7242_meraki_mr12.dts +++ b/target/linux/ath79/dts/ar7242_meraki_mr12.dts @@ -74,9 +74,8 @@ compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -91,7 +90,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 0>; nvmem-cell-names = "mac-address"; pll-data = <0x02000000 0x00000101 0x00001313>; @@ -107,7 +106,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 0>; nvmem-cell-names = "mac-address"; }; @@ -140,6 +139,18 @@ label = "config"; reg = <0x80000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_66: macaddr@66 { + compatible = "mac-base"; + reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -156,13 +167,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_66: macaddr@66 { - reg = <0x66 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts index e250f2a5b45..8df1fdb4ddb 100644 --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts @@ -107,6 +107,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -119,6 +129,16 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + }; }; }; }; @@ -157,23 +177,3 @@ full-duplex; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts index b353e760288..3d8f56a856d 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts @@ -75,13 +75,3 @@ full-duplex; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts index 2ee7ab56c5a..d5625fefce0 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts @@ -186,13 +186,3 @@ full-duplex; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi index 0268146b061..9d4ab231ccf 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi +++ b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi @@ -104,6 +104,20 @@ reg = <0x7f0000 0x010000>; label = "art"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -127,13 +141,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi index 341d0bad0d6..d9b01e17e37 100644 --- a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi +++ b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi @@ -62,6 +62,20 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -89,17 +103,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi index ac3af134577..0eb38b5712e 100644 --- a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi @@ -137,6 +137,16 @@ label = "art"; reg = <0x1fe0000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1120c: macaddr@1120c { + reg = <0x1120c 0x6>; + }; + }; }; }; }; @@ -250,13 +260,3 @@ &usb_phy { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1120c: macaddr@1120c { - reg = <0x1120c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts index fd4a6c7a4d3..476f3e18a3f 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts @@ -73,6 +73,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@1 { @@ -121,13 +131,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts index 6eb2a0acb5f..a4d19ce970a 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts @@ -99,6 +99,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -136,13 +146,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts index 106ca56e7ed..41e53e1fc8d 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -122,6 +122,16 @@ label = "u-boot"; reg = <0x000000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -158,13 +168,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index b31d0f961b3..7401cd053a7 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -105,6 +105,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -138,13 +148,3 @@ nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi index e010e5cad0c..a7fd10bd732 100644 --- a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi +++ b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi @@ -122,6 +122,20 @@ label = "ART"; reg = <0xfc0000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -146,17 +160,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 5383d658847..a2665519f46 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -86,6 +86,20 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_2: macaddr@2 { + reg = <0x2 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; }; partition@60000 { @@ -136,17 +150,3 @@ nvmem-cells = <&macaddr_art_2>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_2: macaddr@2 { - reg = <0x2 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts b/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts index 5801044f4e8..256fe5f6154 100644 --- a/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts +++ b/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts @@ -78,6 +78,18 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -86,16 +98,15 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &wmac { @@ -103,13 +114,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts index d99e0a422a7..f786f425f05 100644 --- a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -92,6 +92,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -124,17 +138,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9331_alfa-network_ap121f.dtsi b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi index 2be7cdb05d5..98de255332d 100644 --- a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi @@ -101,20 +101,22 @@ reg = <0x040000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts index 402fca80a1e..5a96d509402 100644 --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts @@ -109,6 +109,16 @@ art: art@ff0000 { reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -118,13 +128,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_6408.dts b/target/linux/ath79/dts/ar9331_glinet_6408.dts index 0d3b7d64101..eae6be30047 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6408.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6408.dts @@ -28,6 +28,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -61,13 +71,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_6416.dts b/target/linux/ath79/dts/ar9331_glinet_6416.dts index 91b7cc0c1c4..62d0acbf5d3 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6416.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6416.dts @@ -28,6 +28,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -61,13 +71,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts index e5460b299df..211c565c247 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts @@ -113,6 +113,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -144,13 +154,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts index 6f332dd99b3..541b73850a0 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts @@ -108,6 +108,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -118,13 +128,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi index 69d974eb538..565f62a0ba8 100644 --- a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi +++ b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi @@ -24,9 +24,8 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -39,9 +38,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pinmux { @@ -68,6 +66,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -92,13 +102,3 @@ &usb_phy { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts index 0502d5d14ce..5701dff64c4 100644 --- a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts +++ b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts @@ -102,6 +102,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -120,13 +130,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts b/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts index fa000ab90c7..3751374af67 100644 --- a/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts +++ b/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts @@ -77,7 +77,6 @@ }; bdinfo: partition@10000 { - compatible = "nvmem-cells"; reg = <0x10000 0x10000>; label = "bdinfo"; read-only; diff --git a/target/linux/ath79/dts/ar9331_onion_omega.dts b/target/linux/ath79/dts/ar9331_onion_omega.dts index 09e42341946..81fab872b5c 100644 --- a/target/linux/ath79/dts/ar9331_onion_omega.dts +++ b/target/linux/ath79/dts/ar9331_onion_omega.dts @@ -72,9 +72,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -100,6 +99,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -122,16 +133,6 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts index 58ef4ab0910..4868ba2fa0e 100644 --- a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts +++ b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts @@ -55,6 +55,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; firmware: partition@20000 { @@ -106,13 +116,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts index f438567e52c..61cbb1aae28 100644 --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts @@ -63,6 +63,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; firmware: partition@20000 { @@ -115,13 +125,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts index 26004c1cfd6..69965f86a8b 100644 --- a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts +++ b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts @@ -109,15 +109,14 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; }; @@ -144,6 +143,18 @@ label = "config"; reg = <0x20000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@30000 { @@ -190,17 +201,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts index c23e5dac516..7a1a577ed7f 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -113,6 +113,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -162,13 +172,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts index b0f24bbfa70..b07f9a78206 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -108,6 +108,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -151,13 +161,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi index 5fda458fbc3..a8608a77e19 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi @@ -60,6 +60,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -114,13 +124,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi index 61ef9fb99f0..d1336e96895 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi @@ -25,6 +25,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -43,29 +55,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi index 4d3b1dba1d6..613b357dc87 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi @@ -101,6 +101,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; firmware: partition@20000 { @@ -121,9 +133,8 @@ ð0 { /* WAN interface, initialized last as eth1 */ status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; gmac-config { device = <&gmac>; @@ -136,7 +147,7 @@ ð1 { /* LAN interface, initialized first as eth0 */ status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -144,16 +155,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts index 4a993c93012..9ba89324223 100644 --- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts +++ b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts @@ -57,11 +57,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts index ec574ccf9f0..eb304db8a38 100644 --- a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -88,11 +88,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi index 2dfdff03d82..bb6af232fd2 100644 --- a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi @@ -132,6 +132,20 @@ label = "ART"; reg = <0xfc0000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -156,17 +170,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts index 4e4daef1c8e..5ec17034d17 100644 --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts @@ -118,6 +118,18 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -133,16 +145,15 @@ status = "okay"; phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { phy-handle = <&swphy4>; pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -150,13 +161,3 @@ switch-phy-swap = <1>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts index 23b5cf74504..496d6579e76 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -180,6 +180,16 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -214,13 +224,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts index 2ccd50d7836..3971df17f81 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts @@ -64,6 +64,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -90,29 +102,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi index 5d5b88c5f3b..71e2c7b8d81 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi @@ -32,6 +32,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -75,13 +85,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts index d86571c5319..417461a5955 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts @@ -47,6 +47,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -65,29 +77,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts index 0fc34884453..d0f4c2e1f5a 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts @@ -65,6 +65,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -91,31 +103,20 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts index a61f4a381ea..180504523c9 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts @@ -57,6 +57,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -75,29 +87,18 @@ }; ð0 { // WAN port, initialized last as eth1 - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { // LAN ports, initialized first as eth0 - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts index cda96494e70..f14e1380262 100644 --- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts +++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts @@ -52,6 +52,7 @@ partitions { compatible = "fixed-partitions"; + #address-cells = <1>; #size-cells = <1>; partition@0 { diff --git a/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts b/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts index 7bfc85d0868..917dc297fe1 100644 --- a/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts +++ b/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts @@ -49,6 +49,26 @@ }; }; +&board_data { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_board_data_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + cal_board_data_41000: cal@41000 { + reg = <0x41000 0x440>; + }; + }; +}; + ð0 { nvmem-cells = <&macaddr_board_data_66>; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts index 49cf39062a2..c3c20985e2b 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -63,20 +63,22 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index ba0f7ad23e5..d85a07a8dcb 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -70,6 +70,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -81,13 +91,3 @@ ieee80211-freq-limit = <2402000 2482000>; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index ce49c10e5cc..899f1677488 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -98,6 +98,16 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -113,13 +123,3 @@ nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi b/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi index a05cc2e2637..b30d545fa31 100644 --- a/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi +++ b/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi @@ -92,8 +92,6 @@ reg = <0xfe0000 0x010000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -118,16 +116,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts index a2ac53b9963..2a2036201e6 100644 --- a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts +++ b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts @@ -106,9 +106,8 @@ compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cells = <&macaddr_hw_info_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; }; @@ -141,6 +140,18 @@ label = "hw-info"; reg = <0x90000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hw_info_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -161,9 +172,8 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cells = <&macaddr_hw_info_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &nand { @@ -217,7 +227,7 @@ pll-data = <0x06000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cells = <&macaddr_hw_info_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -230,13 +240,3 @@ rxdv-delay = <1>; }; }; - -&hw_info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_hw_info_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts index ca762c3bca4..789bd6df149 100644 --- a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts +++ b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts @@ -136,24 +136,26 @@ reg = <0x070000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts index ac39a626790..a45aa444de4 100644 --- a/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts +++ b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts @@ -72,7 +72,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; @@ -87,9 +87,8 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,0030"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; ieee80211-freq-limit = <2402000 2482000>; #gpio-cells = <2>; gpio-controller; @@ -101,25 +100,28 @@ ieee80211-freq-limit = <4900000 5990000>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_atheros_db120.dts b/target/linux/ath79/dts/ar9344_atheros_db120.dts index 8811d4f4576..9d504414124 100644 --- a/target/linux/ath79/dts/ar9344_atheros_db120.dts +++ b/target/linux/ath79/dts/ar9344_atheros_db120.dts @@ -140,24 +140,26 @@ reg = <0x7f0000 0x010000>; read-only; - 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>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts index 94a82baddcd..c53f03235fc 100644 --- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts +++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts @@ -100,6 +100,20 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@20000 { @@ -139,17 +153,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9344_compex_wpj344-16m.dts b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts index e456f1f0e58..21329db2584 100644 --- a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts +++ b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts @@ -78,6 +78,16 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + }; }; partition@30000 { @@ -143,13 +153,3 @@ phy-mode = "rgmii"; phy-handle = <&phy0>; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi index 1cec6625692..df157f582cf 100644 --- a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi +++ b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi @@ -116,6 +116,18 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -130,9 +142,8 @@ pll-data = <0x02000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -169,13 +180,3 @@ >; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi index 8db1bf5e0c0..96235dbbc44 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi +++ b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi @@ -116,8 +116,6 @@ reg = <0xfe0000 0x010000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -142,16 +140,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_eap600.dts b/target/linux/ath79/dts/ar9344_engenius_eap600.dts index 618660802c0..888e3f82ada 100644 --- a/target/linux/ath79/dts/ar9344_engenius_eap600.dts +++ b/target/linux/ath79/dts/ar9344_engenius_eap600.dts @@ -29,38 +29,40 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &pcie { wifi@0,0,0 { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 0>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; }; }; &wmac { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-1)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts index 5f6ffb130d7..ac9bbea5d4d 100644 --- a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts +++ b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts @@ -24,38 +24,40 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; &pcie { wifi@0,0,0 { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 (-2)>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; }; &wmac { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-1)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts b/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts index b78a588f5cc..0cad9b76d15 100644 --- a/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts +++ b/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts @@ -6,6 +6,10 @@ compatible = "fortinet,fap-221-b", "qca,ar9344"; model = "Fortinet FAP-221-B"; + aliases { + label-mac-device = <ð0>; + }; + leds { compatible = "gpio-leds"; @@ -51,25 +55,34 @@ &ath9k { ieee80211-freq-limit = <2402000 2482000>; - nvmem-cells = <&calibration_pcie>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&calibration_pcie>, <&macaddr_uboot_3ff80 8>; + nvmem-cell-names = "calibration", "mac-address"; +}; + +ð0 { + nvmem-cells = <&macaddr_uboot_3ff80 0>; + nvmem-cell-names = "mac-address"; }; &wmac { ieee80211-freq-limit = <2402000 2482000 4900000 5990000>; - nvmem-cells = <&calibration_wmac>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&calibration_wmac>, <&macaddr_uboot_3ff80 1>; + nvmem-cell-names = "calibration", "mac-address"; }; &art { - compatible = "nvmem-cells"; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_wmac: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_wmac: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_pcie: calibration@5000 { - reg = <0x5000 0x440>; + calibration_pcie: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts b/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts index 5b91dd1e4d8..b513a360352 100644 --- a/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts +++ b/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts @@ -289,20 +289,22 @@ reg = <0xffe0000 0x20000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_netgear_r6100.dts b/target/linux/ath79/dts/ar9344_netgear_r6100.dts index 76bd77d4c65..419fa51f617 100644 --- a/target/linux/ath79/dts/ar9344_netgear_r6100.dts +++ b/target/linux/ath79/dts/ar9344_netgear_r6100.dts @@ -130,6 +130,32 @@ label = "caldata"; reg = <0x0020000 0x0040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + }; }; partition@60000 { @@ -204,29 +230,3 @@ nvmem-cells = <&cal_ath9k>; nvmem-cell-names = "calibration"; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; - - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; - }; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi index 331a4c6fa32..d2a30000044 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -127,6 +127,28 @@ label = "caldata"; reg = <0x80000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; + }; }; partition@c0000 { @@ -259,25 +281,3 @@ gpio-controller; }; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts index 11205413f4c..39ba2ffc3af 100644 --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts @@ -114,28 +114,30 @@ reg = <0xff0000 0x010000>; read-only; - 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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi index b35d699bdc1..7661789e2f6 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi @@ -75,20 +75,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; @@ -110,7 +114,7 @@ pll-data = <0x02000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -127,9 +131,8 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &pcie { @@ -138,9 +141,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 8>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <8>; gpio-controller; #gpio-cells = <2>; diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts index 6fab2b3219b..38153d9dc06 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts @@ -153,20 +153,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; @@ -188,7 +192,7 @@ pll-data = <0x02000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -206,17 +210,15 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &pcie { @@ -225,8 +227,7 @@ wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 16>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts index 3e60d05ed32..e3aa19c82de 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts @@ -135,6 +135,20 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -161,17 +175,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index ea7077d2c8f..aab04b080a8 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -107,6 +107,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -118,9 +130,8 @@ ath9k: wifi@0,0 { compatible = "168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; mtd-cal-data = <&art 0x5000>; qca,no-eeprom; ieee80211-freq-limit = <2402000 2482000>; @@ -134,9 +145,8 @@ ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &mdio0 { @@ -154,19 +164,9 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts index b5fef91eacc..a5fc1160c2c 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts @@ -99,6 +99,20 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_5002: macaddr@5002 { + reg = <0x5002 0x6>; + }; + }; }; }; }; @@ -202,17 +216,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_5002: macaddr@5002 { - reg = <0x5002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts index 7c2f90e72c3..33e2990284e 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts @@ -24,15 +24,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -49,13 +48,3 @@ reg = <0x070000 0xf90000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts index 042974610ca..b20d187941d 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts @@ -24,15 +24,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -49,13 +48,3 @@ reg = <0x070000 0x790000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts index ecc3d8b8cdd..ed9cd2000a2 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts @@ -31,7 +31,7 @@ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; @@ -45,13 +45,3 @@ reg = <0x070000 0xf90000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts index e2152ff464f..5a7feba0b65 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts @@ -31,7 +31,7 @@ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; @@ -45,13 +45,3 @@ reg = <0x070000 0x790000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi b/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi index a41e626ea4a..238a59cbe8d 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi @@ -85,6 +85,18 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + compatible = "mac-base"; + reg = <0x400 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@60000 { diff --git a/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts b/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts index 2cf72409311..dbccbef023b 100644 --- a/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts +++ b/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts @@ -127,11 +127,29 @@ }; &board_data { - macaddr_board_data_6c: macaddr@6c { - reg = <0x6c 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_board_data_66: macaddr@66 { + reg = <0x66 0x6>; + }; - macaddr_board_data_76: macaddr@76 { - reg = <0x76 0x6>; + macaddr_board_data_6c: macaddr@6c { + reg = <0x6c 0x6>; + }; + + macaddr_board_data_76: macaddr@76 { + reg = <0x76 0x6>; + }; + + cal_board_data_41000: cal@41000 { + reg = <0x41000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_samsung_wam250.dts b/target/linux/ath79/dts/ar9344_samsung_wam250.dts index fd5bf9e81d4..0bbd5c92fe9 100644 --- a/target/linux/ath79/dts/ar9344_samsung_wam250.dts +++ b/target/linux/ath79/dts/ar9344_samsung_wam250.dts @@ -66,9 +66,8 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; gmac-config { device = <&gmac>; @@ -79,7 +78,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 0>; nvmem-cell-names = "mac-address"; }; @@ -137,6 +136,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -156,13 +167,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts index 2cb8d4015c5..b94b44cfc4c 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts @@ -164,15 +164,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts index 7a1f05afcca..d8ce6a10927 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts @@ -163,15 +163,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi index 937095959c9..64959c9dc29 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi +++ b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi @@ -79,6 +79,18 @@ label = "config"; reg = <0x20000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@30000 { @@ -144,9 +156,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &pinmux { @@ -169,13 +180,3 @@ <0x3c 0x000b0000 0x00ff0000>; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi index 9d8873ddaf1..f15c1c320ac 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -55,6 +55,16 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@40000 { @@ -116,13 +126,3 @@ line-name = "tp-link:ext:lna1"; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts index 1600e12b644..a66e1fefa25 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts @@ -49,16 +49,30 @@ status = "okay"; }; -&ath9k { - mac-address-increment = <1>; +&wmac { + status = "okay"; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + nvmem-cells = <&macaddr_uboot_1fc00 1>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + }; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -72,7 +86,6 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi index d2791aee709..7aa1989290b 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi @@ -76,7 +76,22 @@ }; &wmac { - mac-address-increment = <(-1)>; + status = "okay"; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + }; }; &mdio0 { @@ -104,7 +119,7 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi index a2649d19e93..7f49b9bde7a 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi @@ -83,6 +83,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -95,50 +107,21 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; - }; - }; - }; -}; - -&pcie { - status = "okay"; - - ath9k: wifi@0,0 { - compatible = "pci168c,0033"; - reg = <0x0000 0 0 0 0>; - #gpio-cells = <2>; - gpio-controller; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_art_5000>; - nvmem-cell-names = "mac-address", "calibration"; - }; -}; -&wmac { - status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_art_1000>; - nvmem-cell-names = "mac-address", "calibration"; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; + }; + }; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts index 49526fb6d23..6649e2477b2 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts @@ -95,6 +95,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -133,7 +145,7 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -142,15 +154,14 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -158,13 +169,3 @@ switch-phy-swap = <1>; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts index 55626c42995..2aba2bd2c01 100644 --- a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts +++ b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts @@ -105,20 +105,22 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_watchguard_ap100.dts b/target/linux/ath79/dts/ar9344_watchguard_ap100.dts index 0ab10c36ce2..2fd9a6e51bf 100644 --- a/target/linux/ath79/dts/ar9344_watchguard_ap100.dts +++ b/target/linux/ath79/dts/ar9344_watchguard_ap100.dts @@ -56,9 +56,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &pcie { @@ -73,25 +72,28 @@ &wmac { /delete-property/ ieee80211-freq-limit; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-2)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_watchguard_ap200.dts b/target/linux/ath79/dts/ar9344_watchguard_ap200.dts index 88c7637fc9b..9cf6819958f 100644 --- a/target/linux/ath79/dts/ar9344_watchguard_ap200.dts +++ b/target/linux/ath79/dts/ar9344_watchguard_ap200.dts @@ -56,39 +56,40 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &pcie { wifi@0,0,0 { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 (-1)>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; }; &wmac { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-2)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts index cbde191ac78..4b692b6d9bb 100644 --- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts +++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts @@ -124,16 +124,18 @@ reg = <0xfe0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; @@ -142,12 +144,16 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_addr_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_addr_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -160,9 +166,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_addr_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_addr_0 0x10>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <0x10>; #gpio-cells = <2>; gpio-controller; }; @@ -179,7 +184,7 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_addr_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_addr_0 0>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; @@ -196,9 +201,8 @@ pll-data = <0xe000000 0x04000101 0x04001313>; - nvmem-cells = <&macaddr_addr_0>; + nvmem-cells = <&macaddr_addr_0 0x21>; nvmem-cell-names = "mac-address"; - mac-address-increment = <0x21>; phy-mode = "rgmii-rxid"; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts index 8dc1ceb6666..36802a52757 100644 --- a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -133,6 +133,20 @@ art: art@ff0000 { reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -160,17 +174,3 @@ pinctrl-single,bits = <0x14 0x0 0xff00>; }; }; - -&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/ath79/dts/ar934x_ruckus_zf73xx.dtsi b/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi index a0348e7213a..d494f9b1ed8 100644 --- a/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi +++ b/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi @@ -178,21 +178,3 @@ &usb_phy { status = "okay"; }; - -&board_data { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_board_data_60: macaddr@60 { - reg = <0x60 0x6>; - }; - - macaddr_board_data_66: macaddr@66 { - reg = <0x66 0x6>; - }; - - cal_board_data_41000: cal@41000 { - reg = <0x41000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi b/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi index 3bc734313f0..786626828f2 100644 --- a/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi +++ b/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi @@ -40,6 +40,18 @@ label = "u-boot"; reg = <0x000000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_3ff80: mac-address@3ff80 { + compatible = "mac-base"; + reg = <0x3ff80 0xc>; + #nvmem-cell-cells = <1>; + }; + }; }; fwconcat0: partition@40000 { diff --git a/target/linux/ath79/dts/qca9531_8dev_lima.dts b/target/linux/ath79/dts/qca9531_8dev_lima.dts index 5a21251d6d3..19097d71836 100644 --- a/target/linux/ath79/dts/qca9531_8dev_lima.dts +++ b/target/linux/ath79/dts/qca9531_8dev_lima.dts @@ -67,6 +67,20 @@ label = "art"; reg = <0x080000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@c0000 { @@ -108,17 +122,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9531_alcatel_hh40v.dts b/target/linux/ath79/dts/qca9531_alcatel_hh40v.dts index 7873f75528b..072a0fa27c2 100644 --- a/target/linux/ath79/dts/qca9531_alcatel_hh40v.dts +++ b/target/linux/ath79/dts/qca9531_alcatel_hh40v.dts @@ -119,24 +119,26 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts index 8759198f532..c9cd7038a5d 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts @@ -106,15 +106,13 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; ð1 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts index e9e19f9d328..52a6b5431f3 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts @@ -45,9 +45,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts index 6af8d3b8b52..943731e69eb 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts @@ -50,9 +50,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; ð1 { @@ -60,9 +59,8 @@ * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &gpio_export { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi index 406985d576f..13a2e28619c 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi @@ -87,16 +87,20 @@ reg = <0x070000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -120,6 +124,6 @@ &wmac { status = "okay"; - nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002 0>; nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts index f81fe287dfe..9b35e471e59 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts @@ -46,10 +46,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - - mac-address-increment = <(-1)>; }; ð1 { diff --git a/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts b/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts index ec8b825ef2f..b2777f6cc6f 100644 --- a/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts +++ b/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts @@ -97,16 +97,18 @@ reg = <0x050000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts index 4a84e150ae6..d0d2a07c2b4 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts @@ -94,6 +94,16 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@20000 { @@ -134,13 +144,3 @@ nvmem-cell-names = "mac-address"; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts index c1875213519..d078a9dcce5 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -93,6 +93,20 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; }; partition@20000 { @@ -143,17 +157,3 @@ reg = <0 0 0 0 0>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts index 92881267885..ff053d628e4 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts @@ -108,6 +108,20 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@20000 { @@ -149,17 +163,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts index 17cbe1df142..73d45f9b7cc 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts @@ -92,6 +92,20 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@20000 { @@ -134,17 +148,3 @@ pinctrl-single,bits = <0x4 0x0 0xff>; }; }; - -&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/ath79/dts/qca9531_comfast_cf-e560ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts index 75e30ff1b7b..a316c48c5b4 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts @@ -103,6 +103,18 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -143,13 +155,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -157,17 +168,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts index e5024b39f94..f725ab1faa2 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts @@ -87,6 +87,18 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -109,13 +121,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -123,17 +134,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts index fc2f6de1114..ba33ee9a923 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts @@ -87,6 +87,18 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -109,7 +121,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -122,17 +134,6 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts index 16a2794b973..7a8f6edcee1 100644 --- a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts +++ b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts @@ -83,6 +83,20 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + + macaddr_uboot_2e018: macaddr@2e018 { + reg = <0x2e018 0x6>; + }; + }; }; partition@30000 { @@ -136,17 +150,3 @@ &usb0 { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; - - macaddr_uboot_2e018: macaddr@2e018 { - reg = <0x2e018 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index 667f779b171..652ffb9c698 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -114,6 +114,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -154,14 +166,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -169,16 +180,6 @@ mtd-cal-data = <&art 0x1000>; }; -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; - &pinmux { pinctrl-names = "default"; pinctrl-0 = <&enable_gpio17>; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts index 60bd2922a2d..1c6dcee8bf8 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts @@ -113,6 +113,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -129,14 +141,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -144,13 +155,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts index ca0784e6bf6..e0c65b7f1b8 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -83,6 +83,16 @@ label = "art"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@60000 { @@ -133,13 +143,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi index 44bb83af64a..114ad461351 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi @@ -136,8 +136,6 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts index 5f5646b3e03..104ed3c72df 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts @@ -108,6 +108,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -123,16 +135,15 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&swphy4>; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -140,13 +151,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts index 0b2030bb49c..3f1ad22a764 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts @@ -95,6 +95,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -111,14 +123,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -126,13 +137,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts index 9212c0a7548..37830c4f7d0 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts @@ -108,6 +108,18 @@ label = "art"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -145,14 +157,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -160,13 +171,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts index 2838b9c82d6..3b01fa9e421 100644 --- a/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts +++ b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts @@ -94,6 +94,20 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -122,17 +136,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9531_letv_lba-047-ch.dts b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts index 586facc9e5b..414db556cad 100644 --- a/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts +++ b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts @@ -119,20 +119,22 @@ reg = <0xff0000 0x10000>; read-only; - 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>; - }; - - cal_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi index ce515159b15..04becd63c10 100644 --- a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi +++ b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi @@ -79,6 +79,18 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + compatible = "mac-base"; + reg = <0x400 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@60000 { @@ -95,13 +107,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; }; @@ -110,13 +121,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_telco_t1.dts b/target/linux/ath79/dts/qca9531_telco_t1.dts index 540de60377e..1748d9e1c9c 100644 --- a/target/linux/ath79/dts/qca9531_telco_t1.dts +++ b/target/linux/ath79/dts/qca9531_telco_t1.dts @@ -96,6 +96,20 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@20000 { @@ -138,17 +152,3 @@ pinctrl-single,bits = <0x4 0x0 0xff>; }; }; - -&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/ath79/dts/qca9531_teltonika_rut300.dts b/target/linux/ath79/dts/qca9531_teltonika_rut300.dts index f79be8dca54..f01bcafbad3 100644 --- a/target/linux/ath79/dts/qca9531_teltonika_rut300.dts +++ b/target/linux/ath79/dts/qca9531_teltonika_rut300.dts @@ -84,6 +84,18 @@ label = "config"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@30000 { @@ -118,28 +130,17 @@ status = "okay"; }; -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; - ð0 { status = "okay"; phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; gmac-config { diff --git a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts index 0fc2bd3df82..fb594f78c06 100644 --- a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts @@ -124,6 +124,18 @@ label = "romfile"; reg = <0x7d0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfile_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@7e0000 { @@ -146,13 +158,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -160,7 +171,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -180,13 +191,3 @@ &usb0 { status = "okay"; }; - -&romfile { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfile_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts index e6fb8525961..f288317c2c3 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts @@ -149,6 +149,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -171,13 +183,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -185,7 +196,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -196,13 +207,3 @@ &usb_phy { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts index 5a990fff023..76f12887386 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts @@ -106,6 +106,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -128,22 +140,20 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -154,13 +164,3 @@ &usb_phy { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts index 09f086b90dd..048099e2604 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts @@ -125,6 +125,18 @@ label = "info"; reg = <0x750000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@760000 { @@ -147,9 +159,8 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -160,7 +171,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -180,13 +191,3 @@ &usb0 { status = "okay"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_wallys_dr531.dts b/target/linux/ath79/dts/qca9531_wallys_dr531.dts index 9982914442d..59f86170c98 100644 --- a/target/linux/ath79/dts/qca9531_wallys_dr531.dts +++ b/target/linux/ath79/dts/qca9531_wallys_dr531.dts @@ -116,6 +116,20 @@ env: partition@30000 { label = "u-boot-env"; reg = <0x030000 0x010000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_env_f810: macaddr@f810 { + reg = <0xf810 0x6>; + }; + + macaddr_env_f818: macaddr@f818 { + reg = <0xf818 0x6>; + }; + }; }; partition@40000 { @@ -152,17 +166,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&env { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_env_f810: macaddr@f810 { - reg = <0xf810 0x6>; - }; - - macaddr_env_f818: macaddr@f818 { - reg = <0xf818 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index a255342015a..fa1f7dc5fca 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -88,6 +88,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -116,17 +130,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_comfast_cf-e110n-v2.dts b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts index 64df0cff7c5..f4422e22429 100644 --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts @@ -112,6 +112,24 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; }; partition@20000 { @@ -154,21 +172,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_kuwfi_c910.dts b/target/linux/ath79/dts/qca9533_kuwfi_c910.dts index a705aa8686b..487bbf9d4c7 100644 --- a/target/linux/ath79/dts/qca9533_kuwfi_c910.dts +++ b/target/linux/ath79/dts/qca9533_kuwfi_c910.dts @@ -140,16 +140,20 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_art_1000: macaddr@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: macaddr@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -169,15 +173,14 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 0>; nvmem-cell-names = "mac-address"; gmac-config { diff --git a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi index 8a51d6b6d65..1f3bf68f69c 100644 --- a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi +++ b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi @@ -122,6 +122,22 @@ label = "ART"; reg = <0xfc0000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -132,7 +148,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -150,21 +166,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&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/ath79/dts/qca9533_plasmacloud_pa300.dtsi b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi index 602365f45d8..66ede5554d0 100644 --- a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi @@ -104,6 +104,18 @@ label = "ART"; reg = <0xfc0000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -114,7 +126,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -124,26 +136,14 @@ */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts index 05d87e39959..ce59e8a54b5 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts @@ -45,6 +45,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; @@ -61,17 +75,3 @@ &wmac { mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_qca_ap143-8m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts index db6a92720ba..f04885e47d1 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts @@ -45,6 +45,20 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; @@ -61,17 +75,3 @@ &wmac { mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_tplink_cpexxx.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi index 3f3fae1dfd7..e7044b60a43 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi @@ -80,6 +80,16 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@40000 { @@ -119,13 +129,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi index 43db72ec650..5a05869a1c0 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi @@ -80,6 +80,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -117,13 +127,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts index e7d837a5740..762197f255a 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts @@ -128,6 +128,16 @@ label = "info"; reg = <0x3c0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@3d0000 { @@ -165,13 +175,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi index 4be1ced4b21..b2d525acb70 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi @@ -51,6 +51,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -73,9 +85,8 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -86,16 +97,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi index c9c109ee392..c0e23f6d62e 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi @@ -86,6 +86,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -108,13 +120,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -122,16 +133,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts index 07b706251a3..c11f11ae185 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts @@ -108,6 +108,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -130,13 +142,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -144,16 +155,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts index 2d00159909b..33234fcb9f7 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts @@ -119,6 +119,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -141,13 +153,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -155,16 +166,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts index e854f3700cd..c5d6e66c9a7 100644 --- a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts +++ b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts @@ -66,6 +66,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -93,17 +107,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_yuncore_a930.dts b/target/linux/ath79/dts/qca9533_yuncore_a930.dts index 089eebaa9cc..30b340768f7 100644 --- a/target/linux/ath79/dts/qca9533_yuncore_a930.dts +++ b/target/linux/ath79/dts/qca9533_yuncore_a930.dts @@ -79,6 +79,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -102,17 +116,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca953x_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi index 13d41f7bd57..ff08f90106c 100644 --- a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi +++ b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi @@ -47,12 +47,14 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_ath9k: calibration@1000 { - reg = <0x1000 0x440>; + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi index e49b8fc1ca0..e3b35b810d6 100644 --- a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi +++ b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi @@ -68,6 +68,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -90,13 +102,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -104,16 +115,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9550_airtight_c-75.dts b/target/linux/ath79/dts/qca9550_airtight_c-75.dts index 8dbf1c8bc46..d4bf64ab40b 100644 --- a/target/linux/ath79/dts/qca9550_airtight_c-75.dts +++ b/target/linux/ath79/dts/qca9550_airtight_c-75.dts @@ -156,6 +156,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -191,17 +205,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9557_8dev_rambutan.dts b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts index a8168746928..f01ac7fc91c 100644 --- a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts +++ b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts @@ -45,6 +45,20 @@ label = "art"; reg = <0x500000 0x100000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@600000 { @@ -119,17 +133,3 @@ &usb1 { status = "okay"; }; - -&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/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts index bd9f3e8da8a..6d402df13f9 100644 --- a/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts +++ b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts @@ -59,6 +59,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; @@ -75,7 +87,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -89,21 +101,10 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts index a4e2a615f64..f17af66cdf9 100644 --- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts +++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts @@ -95,6 +95,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -136,17 +150,3 @@ full-duplex; }; }; - -&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/ath79/dts/qca9557_dlink_dap-2660-a1.dts b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts index 93e2fc0d974..b380fef5152 100644 --- a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts +++ b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts @@ -90,7 +90,17 @@ }; &art { - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi index 498499c1466..31d86b1cf07 100644 --- a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi @@ -102,20 +102,24 @@ reg = <0x1f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -154,18 +158,16 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cells = <&macaddr_art_0 4>, <&cal_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <4>; }; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&cal_art_1000>; + nvmem-cells = <&macaddr_art_0 3>, <&cal_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <3>; }; &usb_phy0 { @@ -196,9 +198,8 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy0>; pll-data = <0xa6000000 0x00000101 0x00001616>; diff --git a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts index d20a0444753..da159caa20c 100644 --- a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts +++ b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts @@ -62,20 +62,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -93,7 +97,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -105,17 +109,15 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &ath10k_0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts index 12740b9bdf7..154744afd51 100644 --- a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts +++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts @@ -65,6 +65,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; @@ -88,7 +100,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy1>; @@ -100,9 +112,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy2>; @@ -114,13 +125,3 @@ &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts index c8b1d94c965..a6197fd25ae 100644 --- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts +++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts @@ -83,6 +83,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; @@ -90,21 +102,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts index 520ca60144b..81a9e6ca086 100644 --- a/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts +++ b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts @@ -75,7 +75,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -88,9 +88,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { @@ -98,11 +97,15 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_aruba_ap-115.dts b/target/linux/ath79/dts/qca9558_aruba_ap-115.dts index b8aed4c283a..c15cb677b9f 100644 --- a/target/linux/ath79/dts/qca9558_aruba_ap-115.dts +++ b/target/linux/ath79/dts/qca9558_aruba_ap-115.dts @@ -97,10 +97,8 @@ reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cells = <&macaddr_oemdata_1d 1>; nvmem-cell-names = "mac-address"; - - mac-address-increment = <1>; }; }; @@ -164,6 +162,18 @@ label = "oemdata"; reg = <0xfe0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_oemdata_1d: macaddr@1d { + compatible = "mac-base"; + reg = <0x1d 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@ff0000 { @@ -178,7 +188,7 @@ status = "okay"; qca,no-eeprom; - nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cells = <&macaddr_oemdata_1d 0>; nvmem-cell-names = "mac-address"; }; @@ -200,7 +210,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cells = <&macaddr_oemdata_1d 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; @@ -219,16 +229,6 @@ }; }; -&oemdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_oemdata_1d: macaddr@1d { - reg = <0x1d 0x6>; - }; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi index 72e52129a4c..b20a36a0319 100644 --- a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi +++ b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi @@ -151,6 +151,18 @@ art: partition@ff0000 { label = "art"; reg = <0xff0000 0x010000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -178,7 +190,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; pll-data = <0xa6000000 0x00000101 0x00001616>; @@ -192,9 +204,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -217,13 +228,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts index b38e2e848f6..8ce173f70dd 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts @@ -91,6 +91,18 @@ label = "art"; reg = <0x040000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -111,7 +123,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; pll-data = <0xbe000000 0xb0000101 0xb0001313>; @@ -134,17 +146,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts index ba145d6fb0f..e0471c53487 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts @@ -30,6 +30,24 @@ label = "art"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_18: macaddr@18 { + reg = <0x18 0x6>; + }; + }; }; partition@30000 { @@ -63,21 +81,3 @@ nvmem-cells = <&macaddr_art_18>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_18: macaddr@18 { - reg = <0x18 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts index d0929f981c0..9bbbf2a9b40 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts @@ -30,6 +30,24 @@ label = "art"; reg = <0x040000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_18: macaddr@18 { + reg = <0x18 0x6>; + }; + }; }; partition@50000 { @@ -63,21 +81,3 @@ nvmem-cells = <&macaddr_art_18>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_18: macaddr@18 { - reg = <0x18 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts b/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts index 61597c89095..d6ecc7728fa 100644 --- a/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts +++ b/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts @@ -76,6 +76,16 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + }; }; firmware@30000 { @@ -131,13 +141,3 @@ &pcie0 { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts index af305f8f07a..d98600934ad 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts @@ -58,9 +58,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy1>; pll-data = <0x03000101 0x00000101 0x00001313>; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts index 6202ff37992..c5209046173 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts @@ -93,9 +93,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy1>; pll-data = <0x03000101 0x00000101 0x00001313>; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi index b96b314fa54..9a2579dd941 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi @@ -69,6 +69,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -99,7 +111,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; @@ -114,17 +126,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts index c398dd637f1..d32329b3660 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts @@ -90,7 +90,17 @@ }; &art { - precal_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + precal_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts index 1985fa48d83..3ca641a5507 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts @@ -116,7 +116,17 @@ }; &art { - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts index 27883f721cf..e72af99da24 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts @@ -104,7 +104,17 @@ }; &art { - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts index d012ae4c505..e5c2cbcb72c 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts @@ -114,8 +114,6 @@ reg = <0x048000 0x008000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -152,12 +150,14 @@ reg = <0x080000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts index 976ac551f72..73f4ed0d1e1 100644 --- a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts +++ b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts @@ -120,6 +120,24 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + }; }; }; }; @@ -193,21 +211,3 @@ nvmem-cells = <&macaddr_art_c>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts b/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts index e17eda3840b..56c08621a74 100644 --- a/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts +++ b/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts @@ -62,20 +62,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -93,7 +97,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -105,17 +109,15 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &ath10k_0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts b/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts index eca3a6091f7..9fa1927c1db 100644 --- a/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts +++ b/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts @@ -50,20 +50,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -88,7 +92,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy1>; @@ -100,9 +104,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy2>; @@ -114,17 +117,15 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &ath10k_1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 3>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <3>; }; &pcie1 { diff --git a/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts index 159013066f6..6cd93f6b33d 100644 --- a/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts +++ b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts @@ -84,20 +84,22 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_lan: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_wan: macaddr@6 { - reg = <0x6 0x6>; - }; - - calibration_art_wlan: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_lan: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_wan: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_wlan: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts index b3447f8be36..5ee38b2e884 100644 --- a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts +++ b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts @@ -139,6 +139,24 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + }; }; }; }; @@ -193,21 +211,3 @@ nvmem-cells = <&macaddr_art_c>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts b/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts index 000dbce8e11..6c799efe33a 100644 --- a/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts +++ b/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts @@ -90,20 +90,22 @@ reg = <0x140000 0x40000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_macaddr: macaddr@0 { - reg = <0x6 0x6>; - }; - - cal_ath9k_soc: cal_ath9k@1000 { - reg = <0x1000 0x440>; - }; - - cal_ath9k_pci: cal_ath9k@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_macaddr: macaddr@0 { + reg = <0x6 0x6>; + }; + + cal_ath9k_soc: cal_ath9k@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath9k_pci: cal_ath9k@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi index d668259b1b0..82b8c2ae56f 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -156,6 +156,7 @@ partitions { compatible = "fixed-partitions"; + #address-cells = <1>; #size-cells = <1>; partition@0 { diff --git a/target/linux/ath79/dts/qca9558_netgear_ex7300.dts b/target/linux/ath79/dts/qca9558_netgear_ex7300.dts index b94ccd30b7d..81898e972f0 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex7300.dts +++ b/target/linux/ath79/dts/qca9558_netgear_ex7300.dts @@ -159,6 +159,32 @@ label = "caldata"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_caldata_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; }; partition@60000 { @@ -218,29 +244,3 @@ pll-data = <0x86000000 0x80000101 0x80001313>; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - precal_caldata_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts b/target/linux/ath79/dts/qca9558_ocedo_koala.dts index 85fd43699ee..76305b2ecef 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts @@ -106,6 +106,20 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -140,17 +154,3 @@ pll-data = <0x8e000000 0x80000101 0x80001313>; }; - -&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/ath79/dts/qca9558_ocedo_ursus.dts b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts index be958d19a08..d2125c38ba3 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts @@ -77,6 +77,24 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_12: macaddr@12 { + reg = <0x12 0x6>; + }; + }; }; }; }; @@ -131,21 +149,3 @@ pll-data = <0x3000101 0x101 0x1313>; qca955x-sgmii-fixup; }; - -&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>; - }; - - macaddr_art_12: macaddr@12 { - reg = <0x12 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi index c2062a800a1..32a176b542e 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi +++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi @@ -111,6 +111,22 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -138,7 +154,7 @@ pll-data = <0x82000101 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -171,25 +187,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &pcie0 { status = "okay"; }; - -&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/ath79/dts/qca9558_openmesh_mr.dtsi b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi index 8e11760daf4..218d5eb944d 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi +++ b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi @@ -119,6 +119,18 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -139,7 +151,7 @@ pll-data = <0x82000000 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -155,21 +167,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts index 211255cddeb..8ef3241ee0d 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts @@ -19,8 +19,7 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 16>; nvmem-cell-names = "mac-address"; - mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts index 0d29c5cf06d..cd3baacd158 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts @@ -19,8 +19,7 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 16>; nvmem-cell-names = "mac-address"; - mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts index 147b98f9253..ee4b82ee8d9 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts @@ -130,6 +130,22 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -157,7 +173,7 @@ pll-data = <0x82000101 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -190,25 +206,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &pcie1 { status = "okay"; }; - -&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/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts index 1ce924b8a0b..d448ca42845 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts @@ -160,6 +160,22 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -191,7 +207,7 @@ pll-data = <0x82000101 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -224,21 +240,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&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/ath79/dts/qca9558_qxwlan_e558.dtsi b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi index 5b28af5ca6e..716bc0d77b6 100644 --- a/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi +++ b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi @@ -89,6 +89,18 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + compatible = "mac-base"; + reg = <0x400 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@60000 { @@ -127,9 +139,8 @@ phy-handle = <&phy0>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -137,7 +148,7 @@ pll-data = <0x03000101 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -167,13 +178,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap.dtsi b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi index 3d38ca79fe4..8abd3e60b77 100644 --- a/target/linux/ath79/dts/qca9558_sophos_ap.dtsi +++ b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi @@ -107,6 +107,16 @@ label = "config"; reg = <0x060000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_201a: macaddr@201a { + reg = <0x201a 0x6>; + }; + }; }; partition@70000 { @@ -157,16 +167,6 @@ mtd-cal-data = <&art 0x1000>; }; -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_201a: macaddr@201a { - reg = <0x201a 0x6>; - }; -}; - &usb0 { vbus-supply = <®_usb_vbus>; }; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap15.dts b/target/linux/ath79/dts/qca9558_sophos_ap15.dts index bb4b058a9a5..490d3ae2276 100644 --- a/target/linux/ath79/dts/qca9558_sophos_ap15.dts +++ b/target/linux/ath79/dts/qca9558_sophos_ap15.dts @@ -75,6 +75,16 @@ label = "config"; reg = <0x060000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_201a: macaddr@201a { + reg = <0x201a 0x6>; + }; + }; }; partition@70000 { @@ -126,13 +136,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_201a: macaddr@201a { - reg = <0x201a 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts index 85012d3aace..d41b065c27e 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts @@ -33,6 +33,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -49,29 +61,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts index e520a83d405..83e51b42cce 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts @@ -33,6 +33,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -46,38 +58,29 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { - nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts index 1b860dbf2d5..c722caeb553 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts @@ -34,6 +34,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -47,28 +59,29 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -79,23 +92,12 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <(-1)>; - nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; }; }; &wmac { - nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts index 4f822fbc7d1..5869ee16e39 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts @@ -52,6 +52,18 @@ label = "romfs"; reg = <0xfd0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfs_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fe0000 { @@ -70,28 +82,17 @@ }; ð0 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; - -&romfs { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfs_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts index 9adaa7fa6d3..7094077bc6f 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts @@ -46,6 +46,18 @@ label = "romfs"; reg = <0xfd0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfs_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fe0000 { @@ -64,28 +76,17 @@ }; ð0 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; - -&romfs { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfs_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts index 0966f019089..7c48326d576 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts @@ -152,6 +152,16 @@ label = "info"; reg = <0xda0000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@dc0000 { @@ -176,13 +186,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi index 31089f339da..f90ebfea155 100644 --- a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi @@ -135,6 +135,18 @@ label = "info"; reg = <0x610000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@630000 { @@ -158,7 +170,7 @@ phy-handle = <&phy4>; pll-data = <0xa6000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -166,17 +178,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; -}; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts index c6b9b077da2..0edba24040e 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts @@ -96,9 +96,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_ath9k_pci>; + nvmem-cells = <&macaddr_uboot_1fc00 (-2)>, <&cal_ath9k_pci>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; #gpio-cells = <2>; gpio-controller; }; @@ -138,12 +137,16 @@ reg = <0x000000 0x020000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -158,16 +161,18 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_ath9k_soc: cal_ath9k@1000 { - reg = <0x1000 0x440>; - }; + cal_ath9k_soc: cal_ath9k@1000 { + reg = <0x1000 0x440>; + }; - cal_ath9k_pci: cal_ath9k@5000 { - reg = <0x5000 0x440>; + cal_ath9k_pci: cal_ath9k@5000 { + reg = <0x5000 0x440>; + }; }; }; }; @@ -196,9 +201,8 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy0>; pll-data = <0x56000000 0x00000101 0x00001616>; @@ -211,7 +215,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; pll-data = <0x03000101 0x00000101 0x00001616>; @@ -224,7 +228,6 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_ath9k_soc>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>, <&cal_ath9k_soc>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts index 998ede85cb9..99a4273ad0d 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts @@ -33,6 +33,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -49,29 +61,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index 52996bba347..f4390f46568 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -97,6 +97,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -138,9 +150,8 @@ pll-data = <0x56000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy0>; }; @@ -149,7 +160,7 @@ pll-data = <0x03000101 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -161,16 +172,6 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts index 27bf82d20df..9d329000c9b 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts @@ -74,6 +74,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -117,13 +127,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts index 91675ff6153..09e7e1bf8d9 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts @@ -98,13 +98,3 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts b/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts index 3827a94b248..48f06e3dcb8 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts @@ -36,13 +36,3 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts index 836211ccd58..7df3759b628 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts @@ -36,13 +36,3 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_watchguard_ap300.dts b/target/linux/ath79/dts/qca9558_watchguard_ap300.dts index 799883c350f..5f5ef0f9687 100644 --- a/target/linux/ath79/dts/qca9558_watchguard_ap300.dts +++ b/target/linux/ath79/dts/qca9558_watchguard_ap300.dts @@ -104,6 +104,18 @@ label = "art"; reg = <0x1ff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; @@ -116,21 +128,10 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi index 3e254fa494e..1e082ffd7f6 100644 --- a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi +++ b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi @@ -46,14 +46,6 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; }; }; }; diff --git a/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi index e1b76bcbd1f..61446263c47 100644 --- a/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi +++ b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi @@ -103,14 +103,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi index 0f803945db6..519f831beab 100644 --- a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi +++ b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi @@ -50,6 +50,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts index 4b371e0e8e8..6179e621bf7 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts @@ -152,6 +152,18 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@7f0000 { @@ -172,32 +184,21 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts index 180efada127..a09e1fae6f4 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts @@ -34,6 +34,18 @@ label = "info"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -58,29 +70,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts index f05a290d2f8..720a2b01a9c 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts @@ -51,6 +51,18 @@ label = "info"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -75,29 +87,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts index 4be23ffbc02..be6e6ade1c7 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts @@ -57,6 +57,18 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@40000 { @@ -81,29 +93,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts index f5ab2e5977c..eff85d6a586 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts @@ -46,6 +46,18 @@ label = "info"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -70,29 +82,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts index 014222770f9..18053d691c8 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts @@ -46,6 +46,18 @@ label = "info"; reg = <0x01fb00 0x000500>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -76,29 +88,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts index a2f46ecd604..068f9577591 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts @@ -41,6 +41,18 @@ label = "info"; reg = <0x01fb00 0x000500>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -71,29 +83,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts index 439549d1425..cf5f3a3a4e0 100644 --- a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts @@ -63,9 +63,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -99,6 +97,18 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@40000 { @@ -132,16 +142,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -151,23 +163,13 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_info_8 0>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts b/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts index 15c58686597..04567e6b889 100644 --- a/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts @@ -81,12 +81,16 @@ reg = <0x000000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_0fc00: macaddr@0fc00 { - reg = <0x0fc00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_0fc00: macaddr@0fc00 { + compatible = "mac-base"; + reg = <0x0fc00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -101,16 +105,18 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -128,9 +134,8 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - nvmem-cells = <&macaddr_uboot_0fc00>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_uboot_0fc00 (-2)>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; }; @@ -143,24 +148,22 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_0fc00>; + nvmem-cells = <&macaddr_uboot_0fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_0fc00>; + nvmem-cells = <&macaddr_uboot_0fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_uboot_0fc00>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_uboot_0fc00 (-1)>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; &usb0 { diff --git a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts index 6e45fbb20fc..5f9f575b447 100644 --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts @@ -93,6 +93,22 @@ label = "art"; reg = <0x60000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@70000 { @@ -120,7 +136,7 @@ status = "okay"; phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -135,21 +151,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&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/ath79/dts/qca9563_asus_pl-ac56.dts b/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts index c597b566aa0..a31f188142f 100644 --- a/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts +++ b/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts @@ -91,12 +91,14 @@ reg = <0x050000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts index ac3551d1156..c4b9f347134 100644 --- a/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts +++ b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts @@ -113,12 +113,14 @@ reg = <0x050000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts b/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts index 20c97009520..2f0a0992a9d 100644 --- a/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts +++ b/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts @@ -84,6 +84,18 @@ label = "art"; reg = <0x040000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -122,7 +134,7 @@ pll-data = <0x03000101 0x00000101 0x00001919>; phy-mode = "sgmii"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; @@ -131,17 +143,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts index 407e912ad26..95ca9003983 100644 --- a/target/linux/ath79/dts/qca9563_compex_wpj563.dts +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -79,6 +79,16 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + }; }; partition@30000 { @@ -143,13 +153,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts b/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts index 43113ea7b56..3047c6f4794 100644 --- a/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts @@ -133,8 +133,6 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; diff --git a/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts new file mode 100644 index 00000000000..35f3913d9bf --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts @@ -0,0 +1,214 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + model = "D-Link DAP-1720 A1"; + compatible = "dlink,dap-1720-a1", "qca,qca9563"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + button-wps { + label = "wps"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: led-status-red { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_status_green: led-status-green { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led-rssi-middle { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <2>; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-rssi-top { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <3>; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led-rssi-bottom-green { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <1>; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + led-rssi-bottom-red { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <1>; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; // vendor calls it `bootloader` + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + compatible = "u-boot,env"; + label = "u-boot-env"; // vendor calls it `bdcfg` + reg = <0x040000 0x10000>; + read-only; + }; + + partition@50000 { + label = "devdata"; + reg = <0x050000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ath10k: macaddr@94 { + compatible = "mac-base"; + reg = <0x94 0x11>; + #nvmem-cell-cells = <1>; + }; + + macaddr_ath9k: macaddr@b0 { + compatible = "mac-base"; + reg = <0xb0 0x11>; + #nvmem-cell-cells = <1>; + }; + + macaddr_lan: macaddr@c9 { + compatible = "mac-base"; + reg = <0xc9 0x11>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@60000 { + label = "devconf"; + reg = <0x060000 0x10000>; + read-only; + }; + + partition@70000 { + compatible = "seama"; + label = "firmware"; + reg = <0x070000 0xf80000>; + }; + + partition@ff0000 { + label = "art"; // vendor calls it `radiocfg` + reg = <0xff0000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: cal@5000 { + reg = <0x5000 0x844>; + }; + }; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + phy-mode = "sgmii"; + + nvmem-cells = <&macaddr_lan 0>; + nvmem-cell-names = "mac-address"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + + nvmem-cells = <&cal_ath10k>, <&macaddr_ath10k 0>; + nvmem-cell-names = "calibration", "mac-address"; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&cal_ath9k>, <&macaddr_ath9k 0>; + nvmem-cell-names = "calibration", "mac-address"; +}; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi index 616c29a4c15..70ec60219df 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi +++ b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi @@ -67,8 +67,6 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -106,17 +104,19 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; - }; + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts index f7358891b04..a69b9d54e8b 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts @@ -45,20 +45,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -75,9 +79,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts index 5ffff57b482..51800820542 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts @@ -39,24 +39,27 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index d3562398bcb..09d2f48c2aa 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -95,6 +95,16 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; /* Firmware / Kernel flash type specific */ @@ -174,13 +184,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi index 8980f772e74..ab1f8902b10 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi @@ -95,28 +95,30 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x2f20>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; - - macaddr_art_5006: macaddr@5006 { - reg = <0x5006 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x2f20>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + + macaddr_art_5006: macaddr@5006 { + reg = <0x5006 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index 799297f4e15..c4faec8ef14 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -162,6 +162,28 @@ label = "caldata"; reg = <0x1f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; + }; }; }; }; @@ -261,25 +283,3 @@ &usb0 { status = "okay"; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi index c6c610dbee2..a4f7be3e1cd 100644 --- a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi +++ b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi @@ -82,6 +82,16 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; + }; }; art: partition@60000 { @@ -141,13 +151,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts index c73d5a6e583..6e45a20aaed 100644 --- a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts +++ b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts @@ -72,6 +72,16 @@ label = "factory"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@60000 { @@ -133,13 +143,3 @@ &usb1 { status = "okay"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts index 3bb6d685cc5..339891f6da0 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts @@ -43,6 +43,16 @@ label = "info"; reg = <0xf40000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; config: partition@f60000 { @@ -75,13 +85,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts index 6d5a21c138f..9925666f826 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts @@ -127,6 +127,16 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@7f0000 { @@ -173,13 +183,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts index e6fd689c999..6857054f1cb 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts @@ -99,6 +99,16 @@ label = "info"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@30000 { @@ -139,13 +149,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts index c40fe0f2923..e7d19c9fbd3 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts @@ -99,6 +99,16 @@ label = "info"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@30000 { @@ -133,13 +143,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts index 3c6b8c4fb94..ae6061c4cef 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts @@ -198,6 +198,16 @@ label = "info"; reg = <0xf00000 0x0f0000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@ff0000 { @@ -243,13 +253,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts index d2631e227cb..32b75cad7b4 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts @@ -49,6 +49,16 @@ label = "info"; reg = <0x060000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@80000 { @@ -81,13 +91,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts index 9421ea225ae..491ffac1326 100644 --- a/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts @@ -81,6 +81,16 @@ label = "info"; reg = <0x060000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@70000 { @@ -138,13 +148,3 @@ device = <&gmac>; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts b/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts index 8cd9004bd3f..63f42eba760 100644 --- a/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts @@ -106,6 +106,16 @@ label = "config"; reg = <0xe85000 0x16b000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@ff0000 { @@ -134,13 +144,3 @@ nvmem-cells = <&macaddr_config_8>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts index 79c45f1ea8a..9c1e82bf986 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -52,9 +64,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts index e5914c9a550..73700b626f3 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -51,9 +63,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts index 8423daf6023..1e100b31a72 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts @@ -51,8 +51,20 @@ }; &art { - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -73,9 +85,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts index 290172b0cc3..32fba980519 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -52,9 +64,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts index ae27ff70684..1c48775cdff 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -51,9 +63,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts index 236c9e7457b..e7f21fafa50 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts @@ -44,8 +44,20 @@ }; &art { - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -66,9 +78,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts index ab5bc7b1a94..1e37db82bce 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts @@ -51,9 +51,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -93,6 +91,18 @@ label = "info"; reg = <0x090000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -100,16 +110,18 @@ reg = <0x0a0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x2f20>; + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -166,23 +178,13 @@ phy-handle = <&phy0>; phy-mode = "sgmii"; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_info_8 0>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi index f384031335b..9e0b97fcbf3 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi @@ -82,12 +82,14 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; @@ -113,7 +115,7 @@ pll-data = <0x03000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; qca956x-serdes-fixup; @@ -126,16 +128,6 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_info_8 0>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts index 73cf5323eea..5eb1eafaf41 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts @@ -34,6 +34,16 @@ label = "info"; reg = <0x610000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@630000 { @@ -60,13 +70,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts index ffebcb9baea..fdd982ae2e2 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts @@ -22,6 +22,16 @@ label = "info"; reg = <0x020000 0x002000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@22000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts index bf4e5848af8..a976f4fa5a2 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts @@ -22,6 +22,16 @@ label = "info"; reg = <0x020000 0x002000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@22000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts index 71ab4f8aad5..cf13fcd6b7f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts @@ -127,6 +127,16 @@ label = "info"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@30000 { @@ -149,13 +159,3 @@ }; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts index 0ccfb42d9ac..8c6c91f1070 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts @@ -16,6 +16,16 @@ label = "u-boot"; reg = <0x000000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_fc00: macaddr@fc00 { + reg = <0xfc00 0x6>; + }; + }; }; partition@10000 { @@ -48,13 +58,3 @@ nvmem-cells = <&macaddr_uboot_fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_fc00: macaddr@fc00 { - reg = <0xfc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts index 95ff6b03631..8786e309659 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts @@ -46,6 +46,16 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@7f0000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts index 34efeb94509..3c688d67d63 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts @@ -40,6 +40,16 @@ label = "info"; reg = <0x630000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@640000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts index a477b50417d..786cd3cc039 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts @@ -42,6 +42,16 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@7f0000 { @@ -62,13 +72,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts index 6d758245159..dac0da9fdc9 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts @@ -46,6 +46,16 @@ label = "info"; reg = <0xf00000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@f20000 { @@ -86,13 +96,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts index 80a63f6efc0..4aa0ef572f6 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts @@ -51,6 +51,16 @@ label = "info"; reg = <0xf50000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@f70000 { @@ -108,13 +118,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 6704ec983b0..da01251f3bd 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -90,6 +90,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -100,13 +110,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts index b6206b046d2..2085644f766 100644 --- a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts +++ b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts @@ -109,6 +109,16 @@ label = "art"; reg = <0x60000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@70000 { @@ -174,13 +184,3 @@ &pcie { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index 6f729a21fe8..dff94282950 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -94,6 +94,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -104,13 +114,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf281.dts b/target/linux/ath79/dts/qca9563_zte_mf281.dts index 9205061e243..8fcd093d66f 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf281.dts +++ b/target/linux/ath79/dts/qca9563_zte_mf281.dts @@ -49,16 +49,18 @@ reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_caldata_5000: cal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -67,12 +69,16 @@ reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -146,14 +152,13 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; + nvmem-cells = <&macaddr_mac_0 1>, <&cal_caldata_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <1>; }; &pinmux { @@ -163,6 +168,6 @@ }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_caldata_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_zte_mf282.dts b/target/linux/ath79/dts/qca9563_zte_mf282.dts index 1f3038daced..439cc1af4af 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf282.dts +++ b/target/linux/ath79/dts/qca9563_zte_mf282.dts @@ -61,16 +61,18 @@ reg = <0x140000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_caldata_5000: cal@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -79,12 +81,16 @@ reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -113,17 +119,16 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; + nvmem-cells = <&macaddr_mac_0 1>, <&cal_caldata_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_caldata_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286.dts b/target/linux/ath79/dts/qca9563_zte_mf286.dts index 877075c7699..e64680e1121 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf286.dts +++ b/target/linux/ath79/dts/qca9563_zte_mf286.dts @@ -62,16 +62,18 @@ reg = <0x140000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_caldata_5000: cal@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -80,12 +82,16 @@ reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -114,17 +120,16 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>, <&cal_caldata_5000>; + nvmem-cells = <&macaddr_mac_0 1>, <&cal_caldata_5000>, <&cal_caldata_5000>; nvmem-cell-names = "mac-address", "calibration", "pre-calibration"; - mac-address-increment = <1>; }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_caldata_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi index 45ac3bc7ea5..89177ef2d35 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi +++ b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi @@ -65,16 +65,18 @@ reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -83,12 +85,16 @@ reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: mac-address@0 { - reg = <0x0 0x6>; + macaddr_mac_0: mac-address@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -118,17 +124,16 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&precal_art_5000>; + nvmem-cells = <&macaddr_mac_0 0x20000>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <0x20000>; }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_art_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qcn5502_asus.dtsi b/target/linux/ath79/dts/qcn5502_asus.dtsi index a2b4a76e92e..ee3ef18d20b 100644 --- a/target/linux/ath79/dts/qcn5502_asus.dtsi +++ b/target/linux/ath79/dts/qcn5502_asus.dtsi @@ -85,20 +85,22 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_factory_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_factory_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; - - precal_factory_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_factory_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_factory_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + + precal_factory_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts b/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts index 4ebbdcc1054..32b97a46013 100644 --- a/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts +++ b/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts @@ -182,20 +182,22 @@ label = "artmtd"; reg = <0xfe0000 0x10000>; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_artmtd_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_artmtd_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_artmtd_c: macaddr@c { - reg = <0xc 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_artmtd_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_artmtd_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_artmtd_c: macaddr@c { + reg = <0xc 0x6>; + }; }; }; @@ -204,16 +206,18 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts index ef0ea321e07..6266f5561be 100644 --- a/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts +++ b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts @@ -88,7 +88,7 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -118,10 +118,8 @@ compatible = "pci168c,0046"; reg = <0 0 0 0 0>; - nvmem-cells = <&macaddr_info_8>, <&precal_art_5000>; + nvmem-cells = <&macaddr_info_8 (-1)>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - - mac-address-increment = <(-1)>; }; }; @@ -162,16 +160,18 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -180,12 +180,16 @@ reg = <0x060000 0x020000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -234,6 +238,6 @@ /* TODO: missing support in ath9k */ status = "disabled"; - nvmem-cells = <&cal_art_1000>, <&macaddr_info_8>; + nvmem-cells = <&cal_art_1000>, <&macaddr_info_8 0>; nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi index b2c009c3468..b38cd418176 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi @@ -63,7 +63,6 @@ }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts index daf77793141..f837dccff9a 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts @@ -66,6 +66,6 @@ }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts index 409f288f07a..ccb3bb16709 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts @@ -30,6 +30,6 @@ }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts index d4638f1acf4..61adc08289a 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts @@ -120,6 +120,18 @@ label = "config"; reg = <0x750000 0x0a0000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@7f0000 { @@ -136,15 +148,14 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -152,16 +163,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi index 3a38b8025ab..89dff434056 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi @@ -28,6 +28,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -50,9 +62,8 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -63,16 +74,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index c1d411b9a9c..615abe4b3b3 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -241,6 +241,13 @@ dlink,dap-1365-a1) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:rssimediumhigh" "wlan0" "51" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan0" "76" "100" ;; +dlink,dap-1720-a1) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSI LOW" "red:signal-1" "wlan0" "1" "40" + ucidef_set_led_rssi "rssimediumlow" "RSSI MEDIUM-LOW" "green:signal-1" "wlan0" "21" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSI MEDIUM-HIGH" "green:signal-2" "wlan0" "61" "100" + ucidef_set_led_rssi "rssihigh" "RSSI HIGH" "green:signal-3" "wlan0" "81" "100" + ;; dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "green:internet" "switch0" "0x20" ;; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index a9b78e4350d..b74a7ff6b43 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -34,6 +34,7 @@ ath79_setup_interfaces() devolo,dvl1750x|\ dlink,dap-1330-a1|\ dlink,dap-1365-a1|\ + dlink,dap-1720-a1|\ dlink,dap-2230-a1|\ dlink,dap-2660-a1|\ dlink,dap-2680-a1|\ @@ -725,10 +726,6 @@ ath79_setup_macs() enterasys,ws-ap3705i) label_mac=$(mtd_get_mac_ascii u-boot-env0 ethaddr) ;; - fortinet,fap-221-b) - lan_mac=$(mtd_get_mac_text u-boot 0x3ff80 12) - label_mac=$lan_mac - ;; hak5,lan-turtle|\ hak5,packet-squirrel) label_mac=$(mtd_get_mac_binary u-boot 0x1fc00) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index ccff35e5c63..42b69d2ca0c 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -47,9 +47,6 @@ case "$board" in engenius,esr900) macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress ;; - fortinet,fap-221-b) - macaddr_add "$(mtd_get_mac_text u-boot 0x3ff80 12)" $((PHYNBR*7+1)) > /sys${DEVPATH}/macaddress - ;; iodata,wn-ac1600dgr) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum index 0ea81a8dc3a..4ec8c13eb75 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum @@ -21,6 +21,7 @@ dlink,dap-3320-a1|\ dlink,dap-3662-a1) fixwrgg ;; +dlink,dap-1720-a1|\ dlink,dir-629-a1|\ dlink,dir-859-a1|\ dlink,dir-859-a3|\ diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh index 8b39a17eb0c..76f4b93a356 100644 --- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -25,9 +25,6 @@ preinit_set_mac_address() { siemens,ws-ap3610) ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr) ;; - fortinet,fap-221-b) - ip link set dev eth0 address $(mtd_get_mac_text u-boot 0x3ff80 12) - ;; moxa,awk-1137c) ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env mac_addr) ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index dd76bd9d6fc..91112bb710f 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -85,7 +85,7 @@ define Build/mkmylofw_16m let \ size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(BLOCKSIZE))" \ + pad="$(call exp_units,$(BLOCKSIZE))" \ pad="(pad - (size % pad)) % pad" \ newsize='size + pad' ; \ [ $$newsize -lt $$((0x660000)) ] && newsize=0x660000 ; \ @@ -1053,6 +1053,22 @@ define Device/dlink_dap-1365-a1 endef TARGET_DEVICES += dlink_dap-1365-a1 +define Device/dlink_dap-1720-a1 + $(Device/seama) + SOC := qca9563 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-1720 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := rssileds -swconfig \ + kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct + SEAMA_SIGNATURE := wapac28_dlink.2015_dap1720 + IMAGE_SIZE := 15872k + IMAGES += recovery.bin + IMAGE/recovery.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \ + seama-seal | check-size +endef +TARGET_DEVICES += dlink_dap-1720-a1 + define Device/dlink_dap-2xxx IMAGES += factory.img IMAGE/factory.img := append-kernel | pad-offset 6144k 160 | \ diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 5c9e190e193..bf2b1a1f8ab 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -32,7 +32,7 @@ endef define Build/zyxel-factory let \ - maxsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \ + maxsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \ let size="$$(stat -c%s $@)"; \ if [ $$size -lt $$maxsize ]; then \ $(STAGING_DIR_HOST)/bin/mkrasimage \ diff --git a/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch b/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch index 53bed0d57f5..b7940da9e4f 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch @@ -266,7 +266,7 @@ Signed-off-by: Phil Elwell static inline int mmc_blk_part_switch(struct mmc_card *card, unsigned int part_type); static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, -@@ -2994,6 +3001,8 @@ static int mmc_blk_probe(struct mmc_card +@@ -2996,6 +3003,8 @@ static int mmc_blk_probe(struct mmc_card { struct mmc_blk_data *md; int ret = 0; @@ -275,7 +275,7 @@ Signed-off-by: Phil Elwell /* * Check that the card supports the command class(es) we need. -@@ -3001,7 +3010,16 @@ static int mmc_blk_probe(struct mmc_card +@@ -3003,7 +3012,16 @@ static int mmc_blk_probe(struct mmc_card if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -293,7 +293,7 @@ Signed-off-by: Phil Elwell card->complete_wq = alloc_workqueue("mmc_complete", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); -@@ -3016,6 +3034,17 @@ static int mmc_blk_probe(struct mmc_card +@@ -3018,6 +3036,17 @@ static int mmc_blk_probe(struct mmc_card goto out_free; } @@ -325,7 +325,7 @@ Signed-off-by: Phil Elwell } --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h -@@ -129,6 +129,14 @@ static const struct mmc_fixup __maybe_un +@@ -130,6 +130,14 @@ static const struct mmc_fixup __maybe_un MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd, MMC_QUIRK_BROKEN_SD_DISCARD), @@ -2007,12 +2007,12 @@ Signed-off-by: Phil Elwell sdhci_dumpregs(host); --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h -@@ -296,6 +296,8 @@ struct mmc_card { - #define MMC_QUIRK_BROKEN_SD_DISCARD (1<<14) /* Disable broken SD discard support */ +@@ -297,6 +297,8 @@ struct mmc_card { #define MMC_QUIRK_BROKEN_SD_CACHE (1<<15) /* Disable broken SD cache support */ + #define MMC_QUIRK_BROKEN_CACHE_FLUSH (1<<16) /* Don't flush cache until the write has occurred */ +#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ + + bool written_flag; /* Indicates eMMC has been written since power on */ bool reenable_cmdq; /* Re-enable Command Queue */ - unsigned int erase_size; /* erase size in sectors */ diff --git a/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index f237c581be9..f8bdac66547 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1368,6 +1371,9 @@ +@@ -1369,6 +1372,9 @@ #define USB_VENDOR_ID_XIAOMI 0x2717 #define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014 @@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL }, -@@ -198,6 +199,7 @@ static const struct hid_device_id hid_qu +@@ -199,6 +200,7 @@ static const struct hid_device_id hid_qu { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET }, diff --git a/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch b/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch index 5046dff024e..3b663351e2f 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch @@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c -@@ -3192,6 +3192,31 @@ static const struct panel_desc qishenglo +@@ -3193,6 +3193,31 @@ static const struct panel_desc qishenglo .connector_type = DRM_MODE_CONNECTOR_DPI, }; @@ -47,7 +47,7 @@ Signed-off-by: Dave Stevenson static const struct display_timing rocktech_rk070er9427_timing = { .pixelclock = { 26400000, 33300000, 46800000 }, .hactive = { 800, 800, 800 }, -@@ -4223,6 +4248,9 @@ static const struct of_device_id platfor +@@ -4224,6 +4249,9 @@ static const struct of_device_id platfor .compatible = "qishenglong,gopher2b-lcd", .data = &qishenglong_gopher2b_lcd, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch b/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch index 83ba9351132..aa446c3346d 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch @@ -46,7 +46,7 @@ Acked-by: Maxime Ripard static const struct drm_display_mode giantplus_gpg482739qs5_mode = { .clock = 9000, .hdisplay = 480, -@@ -4107,6 +4133,9 @@ static const struct of_device_id platfor +@@ -4108,6 +4134,9 @@ static const struct of_device_id platfor .compatible = "friendlyarm,hd702e", .data = &friendlyarm_hd702e, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch b/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch index 09324871aaf..505121f4cfd 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch @@ -165,7 +165,7 @@ Signed-off-by: Phil Elwell static const struct drm_display_mode innolux_at070tn92_mode = { .clock = 33333, .hdisplay = 800, -@@ -4143,6 +4175,9 @@ static const struct of_device_id platfor +@@ -4144,6 +4176,9 @@ static const struct of_device_id platfor .compatible = "innolux,at043tn24", .data = &innolux_at043tn24, }, { diff --git a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch index 25457926a48..769384f500f 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch @@ -594,7 +594,7 @@ Signed-off-by: Andrew Morton VM_BUG_ON_PAGE(tail > 2 && page_tail->mapping != TAIL_MAPPING, --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -5178,6 +5178,7 @@ static void __mem_cgroup_free(struct mem +@@ -5179,6 +5179,7 @@ static void __mem_cgroup_free(struct mem static void mem_cgroup_free(struct mem_cgroup *memcg) { @@ -602,7 +602,7 @@ Signed-off-by: Andrew Morton memcg_wb_domain_exit(memcg); __mem_cgroup_free(memcg); } -@@ -5241,6 +5242,7 @@ static struct mem_cgroup *mem_cgroup_all +@@ -5242,6 +5243,7 @@ static struct mem_cgroup *mem_cgroup_all memcg->deferred_split_queue.split_queue_len = 0; #endif idr_replace(&mem_cgroup_idr, memcg, memcg->id.id); 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 43fd69ae794..234dfd916f0 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 @@ -424,7 +424,7 @@ Signed-off-by: Andrew Morton /* will mmdrop() in finish_task_switch(). */ --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -6212,6 +6212,30 @@ static void mem_cgroup_move_task(void) +@@ -6213,6 +6213,30 @@ static void mem_cgroup_move_task(void) } #endif @@ -455,7 +455,7 @@ Signed-off-by: Andrew Morton static int seq_puts_memcg_tunable(struct seq_file *m, unsigned long value) { if (value == PAGE_COUNTER_MAX) -@@ -6555,6 +6579,7 @@ struct cgroup_subsys memory_cgrp_subsys +@@ -6556,6 +6580,7 @@ struct cgroup_subsys memory_cgrp_subsys .css_reset = mem_cgroup_css_reset, .css_rstat_flush = mem_cgroup_css_rstat_flush, .can_attach = mem_cgroup_can_attach, diff --git a/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch b/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch index 6010e617b86..8cc9abd84f0 100644 --- a/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch +++ b/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch @@ -318,7 +318,7 @@ Signed-off-by: Andrew Morton mctz = soft_limit_tree_from_page(page); if (!mctz) return; -@@ -3433,6 +3443,9 @@ unsigned long mem_cgroup_soft_limit_recl +@@ -3434,6 +3444,9 @@ unsigned long mem_cgroup_soft_limit_recl unsigned long excess; unsigned long nr_scanned; @@ -328,7 +328,7 @@ Signed-off-by: Andrew Morton if (order > 0) return 0; -@@ -5321,6 +5334,7 @@ static int mem_cgroup_css_online(struct +@@ -5322,6 +5335,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); @@ -336,7 +336,7 @@ Signed-off-by: Andrew Morton return 0; } -@@ -5347,6 +5361,7 @@ static void mem_cgroup_css_offline(struc +@@ -5348,6 +5362,7 @@ static void mem_cgroup_css_offline(struc memcg_offline_kmem(memcg); reparent_shrinker_deferred(memcg); wb_memcg_offline(memcg); @@ -344,7 +344,7 @@ Signed-off-by: Andrew Morton drain_all_stock(memcg); -@@ -5358,6 +5373,7 @@ static void mem_cgroup_css_released(stru +@@ -5359,6 +5374,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/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch index 284a6d07225..006181495c0 100644 --- a/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch +++ b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch @@ -554,7 +554,7 @@ Signed-off-by: David S. Miller static void xrs700x_mac_link_up(struct dsa_switch *ds, int port, --- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c -@@ -369,9 +369,8 @@ static int xgbe_set_link_ksettings(struc +@@ -374,9 +374,8 @@ static int xgbe_set_link_ksettings(struc __ETHTOOL_LINK_MODE_MASK_NBITS, cmd->link_modes.advertising, __ETHTOOL_LINK_MODE_MASK_NBITS, lks->link_modes.supported); @@ -566,7 +566,7 @@ Signed-off-by: David S. Miller if ((cmd->base.autoneg == AUTONEG_ENABLE) && bitmap_empty(advertising, __ETHTOOL_LINK_MODE_MASK_NBITS)) { -@@ -384,8 +383,7 @@ static int xgbe_set_link_ksettings(struc +@@ -389,8 +388,7 @@ static int xgbe_set_link_ksettings(struc pdata->phy.autoneg = cmd->base.autoneg; pdata->phy.speed = speed; pdata->phy.duplex = cmd->base.duplex; diff --git a/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch b/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch index d826877e7dc..5d5ac4b0094 100644 --- a/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch +++ b/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch @@ -125,7 +125,7 @@ Signed-off-by: David S. Miller pl = kzalloc(sizeof(*pl), GFP_KERNEL); if (!pl) return ERR_PTR(-ENOMEM); -@@ -946,9 +987,10 @@ EXPORT_SYMBOL_GPL(phylink_create); +@@ -947,9 +988,10 @@ EXPORT_SYMBOL_GPL(phylink_create); * @pl: a pointer to a &struct phylink returned from phylink_create() * @pcs: a pointer to the &struct phylink_pcs * @@ -139,7 +139,7 @@ Signed-off-by: David S. Miller * * Please note that there are behavioural changes with the mac_config() * callback if a PCS is present (denoting a newer setup) so removing a PCS -@@ -959,6 +1001,14 @@ void phylink_set_pcs(struct phylink *pl, +@@ -960,6 +1002,14 @@ void phylink_set_pcs(struct phylink *pl, { pl->pcs = pcs; pl->pcs_ops = pcs->ops; diff --git a/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch b/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch index 9e5061aaed8..924d0e954a9 100644 --- a/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch +++ b/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch @@ -66,7 +66,7 @@ Signed-off-by: Jakub Kicinski phy_interface_empty(config->supported_interfaces)) { dev_err(config->dev, "phylink: error: empty supported_interfaces but mac_select_pcs() method present\n"); -@@ -1220,6 +1227,7 @@ struct phylink *phylink_create(struct ph +@@ -1221,6 +1228,7 @@ struct phylink *phylink_create(struct ph return ERR_PTR(-EINVAL); } diff --git a/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch b/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch index ceec58466e1..c8176c90f52 100644 --- a/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch +++ b/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch @@ -75,7 +75,7 @@ Signed-off-by: David S. Miller if (pl->pcs_ops) { err = pl->pcs_ops->pcs_config(pl->pcs, pl->cur_link_an_mode, state->interface, -@@ -1260,6 +1285,7 @@ struct phylink *phylink_create(struct ph +@@ -1261,6 +1286,7 @@ struct phylink *phylink_create(struct ph pl->link_config.speed = SPEED_UNKNOWN; pl->link_config.duplex = DUPLEX_UNKNOWN; pl->link_config.an_enabled = true; @@ -83,7 +83,7 @@ Signed-off-by: David S. Miller pl->mac_ops = mac_ops; __set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); timer_setup(&pl->link_poll, phylink_fixed_poll, 0); -@@ -1651,6 +1677,8 @@ void phylink_start(struct phylink *pl) +@@ -1652,6 +1678,8 @@ void phylink_start(struct phylink *pl) if (pl->netdev) netif_carrier_off(pl->netdev); @@ -92,7 +92,7 @@ Signed-off-by: David S. Miller /* Apply the link configuration to the MAC when starting. This allows * a fixed-link to start with the correct parameters, and also * ensures that we set the appropriate advertisement for Serdes links. -@@ -1661,6 +1689,8 @@ void phylink_start(struct phylink *pl) +@@ -1662,6 +1690,8 @@ void phylink_start(struct phylink *pl) */ phylink_mac_initial_config(pl, true); @@ -101,7 +101,7 @@ Signed-off-by: David S. Miller clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); phylink_run_resolve(pl); -@@ -1680,16 +1710,9 @@ void phylink_start(struct phylink *pl) +@@ -1681,16 +1711,9 @@ void phylink_start(struct phylink *pl) poll = true; } @@ -120,7 +120,7 @@ Signed-off-by: David S. Miller if (poll) mod_timer(&pl->link_poll, jiffies + HZ); if (pl->phydev) -@@ -1726,6 +1749,10 @@ void phylink_stop(struct phylink *pl) +@@ -1727,6 +1750,10 @@ void phylink_stop(struct phylink *pl) } phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_STOPPED); diff --git a/target/linux/generic/backport-5.15/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch b/target/linux/generic/backport-5.15/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch new file mode 100644 index 00000000000..38ddcb5714c --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch @@ -0,0 +1,229 @@ +From ec51fbd1b8a2bca2948dede99c14ec63dc57ff6b Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:38 +0100 +Subject: [PATCH] r8152: add USB device driver for config selection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Subclassing the generic USB device driver to override the +default configuration selection regardless of matching interface +drivers. + +The r815x family devices expose a vendor specific function which +the r8152 interface driver wants to handle. This is the preferred +device mode. Additionally one or more USB class functions are +usually supported for hosts lacking a vendor specific driver. The +choice is USB configuration based, with one alternate function per +configuration. + +Example device with both NCM and ECM alternate cfgs: + +T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 3 +P: Vendor=0bda ProdID=8156 Rev=31.00 +S: Manufacturer=Realtek +S: Product=USB 10/100/1G/2.5G LAN +S: SerialNumber=001000001 +C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=256mA +I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=r8152 +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=83(I) Atr=03(Int.) MxPS= 2 Ivl=128ms +C: #Ifs= 2 Cfg#= 2 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +C: #Ifs= 2 Cfg#= 3 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms + +A problem with this is that Linux will prefer class functions over +vendor specific functions. Using the above example, Linux defaults +to cfg #2, running the device in a sub-optimal NCM mode. + +Previously we've attempted to work around the problem by +blacklisting the devices in the ECM class driver "cdc_ether", and +matching on the ECM class function in the vendor specific interface +driver. The latter has been used to switch back to the vendor +specific configuration when the driver is probed for a class +function. + +This workaround has several issues; +- class driver blacklists is additional maintanence cruft in an + unrelated driver +- class driver blacklists prevents users from optionally running + the devices in class mode +- each device needs double match entries in the vendor driver +- the initial probing as a class function slows down device + discovery + +Now these issues have become even worse with the introduction of +firmware supporting both NCM and ECM, where NCM ends up as the +default mode in Linux. To use the same workaround, we now have +to blacklist the devices in to two different class drivers and +add yet another match entry to the vendor specific driver. + +This patch implements an alternative workaround strategy - +independent of the interface drivers. It avoids adding a +blacklist to the cdc_ncm driver and will let us remove the +existing blacklist from the cdc_ether driver. + +As an additional bonus, removing the blacklists allow users to +select one of the other device modes if wanted. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 113 ++++++++++++++++++++++++++++------------ + 1 file changed, 81 insertions(+), 32 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9625,6 +9625,9 @@ static int rtl8152_probe(struct usb_inte + if (version == RTL_VER_UNKNOWN) + return -ENODEV; + ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ + if (!rtl_vendor_mode(intf)) + return -ENODEV; + +@@ -9834,43 +9837,35 @@ static void rtl8152_disconnect(struct us + } + } + +-#define REALTEK_USB_DEVICE(vend, prod) { \ +- USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC), \ +-}, \ +-{ \ +- USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \ +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), \ +-} + + /* table of devices that work with this driver */ + static const struct usb_device_id rtl8152_table[] = { + /* Realtek */ +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156), ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8050) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8053) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8152) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8153) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8155) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8156) }, + + /* Microsoft */ +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0c5e), +- REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387), +- REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041), +- REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff), +- REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601), ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927) }, ++ { USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x304f) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3054) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x721e) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0xa387) }, ++ { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, ++ { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, ++ { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, + {} + }; + +@@ -9890,7 +9885,61 @@ static struct usb_driver rtl8152_driver + .disable_hub_initiated_lpm = 1, + }; + +-module_usb_driver(rtl8152_driver); ++static int rtl8152_cfgselector_probe(struct usb_device *udev) ++{ ++ struct usb_host_config *c; ++ int i, num_configs; ++ ++ /* The vendor mode is not always config #1, so to find it out. */ ++ c = udev->config; ++ num_configs = udev->descriptor.bNumConfigurations; ++ for (i = 0; i < num_configs; (i++, c++)) { ++ struct usb_interface_descriptor *desc = NULL; ++ ++ if (!c->desc.bNumInterfaces) ++ continue; ++ desc = &c->intf_cache[0]->altsetting->desc; ++ if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) ++ break; ++ } ++ ++ if (i == num_configs) ++ return -ENODEV; ++ ++ if (usb_set_configuration(udev, c->desc.bConfigurationValue)) { ++ dev_err(&udev->dev, "Failed to set configuration %d\n", ++ c->desc.bConfigurationValue); ++ return -ENODEV; ++ } ++ ++ return 0; ++} ++ ++static struct usb_device_driver rtl8152_cfgselector_driver = { ++ .name = MODULENAME "-cfgselector", ++ .probe = rtl8152_cfgselector_probe, ++ .id_table = rtl8152_table, ++ .generic_subclass = 1, ++}; ++ ++static int __init rtl8152_driver_init(void) ++{ ++ int ret; ++ ++ ret = usb_register_device_driver(&rtl8152_cfgselector_driver, THIS_MODULE); ++ if (ret) ++ return ret; ++ return usb_register(&rtl8152_driver); ++} ++ ++static void __exit rtl8152_driver_exit(void) ++{ ++ usb_deregister(&rtl8152_driver); ++ usb_deregister_device_driver(&rtl8152_cfgselector_driver); ++} ++ ++module_init(rtl8152_driver_init); ++module_exit(rtl8152_driver_exit); + + MODULE_AUTHOR(DRIVER_AUTHOR); + MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/target/linux/generic/backport-5.15/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch b/target/linux/generic/backport-5.15/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch new file mode 100644 index 00000000000..2b3272cebd0 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch @@ -0,0 +1,158 @@ +From 69649ef8405320f81497f4757faac8234f61b167 Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:39 +0100 +Subject: [PATCH] cdc_ether: no need to blacklist any r8152 devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The r8152 driver does not need this anymore. + +Dropping blacklist entries adds optional support for these +devices in ECM mode. + +The 8153 devices are handled by the r8153_ecm driver when +in ECM mode, and must still be blacklisted here. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 114 ------------------------------------ + 1 file changed, 114 deletions(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -767,13 +767,6 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */ + { + USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, +@@ -781,119 +774,12 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Samsung USB Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-#if IS_ENABLED(CONFIG_USB_RTL8152) +-/* Linksys USB3GIGV1 Ethernet Adapter */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LINKSYS_VENDOR_ID, 0x0041, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +-#endif +- +-/* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3054, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad USB-C Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3069, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3082, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo Thinkpad USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7205, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB C to Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x720c, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB-C Travel Hub (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7214, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */ + { + USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), + .driver_info = 0, + }, +- +-/* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* NVIDIA Tegra USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(NVIDIA_VENDOR_ID, 0x09ff, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface 2 dock (based on Realtek RTL8152) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07ab, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, + + /* Aquantia AQtion USB to 5GbE Controller (based on AQC111U) */ + { diff --git a/target/linux/generic/backport-5.15/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch b/target/linux/generic/backport-5.15/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch new file mode 100644 index 00000000000..8bbf0be802b --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch @@ -0,0 +1,64 @@ +From 0d4cda805a183bbe523f2407edb5c14ade50b841 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 17 Jan 2023 11:03:44 +0800 +Subject: [PATCH] r8152: avoid to change cfg for all devices + +The rtl8152_cfgselector_probe() should set the USB configuration to the +vendor mode only for the devices which the driver (r8152) supports. +Otherwise, no driver would be used for such devices. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9531,9 +9531,8 @@ static int rtl_fw_init(struct r8152 *tp) + return 0; + } + +-u8 rtl8152_get_version(struct usb_interface *intf) ++static u8 __rtl_get_hw_ver(struct usb_device *udev) + { +- struct usb_device *udev = interface_to_usbdev(intf); + u32 ocp_data = 0; + __le32 *tmp; + u8 version; +@@ -9603,10 +9602,19 @@ u8 rtl8152_get_version(struct usb_interf + break; + default: + version = RTL_VER_UNKNOWN; +- dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data); ++ dev_info(&udev->dev, "Unknown version 0x%04x\n", ocp_data); + break; + } + ++ return version; ++} ++ ++u8 rtl8152_get_version(struct usb_interface *intf) ++{ ++ u8 version; ++ ++ version = __rtl_get_hw_ver(interface_to_usbdev(intf)); ++ + dev_dbg(&intf->dev, "Detected version 0x%04x\n", version); + + return version; +@@ -9890,6 +9898,12 @@ static int rtl8152_cfgselector_probe(str + struct usb_host_config *c; + int i, num_configs; + ++ /* Switch the device to vendor mode, if and only if the vendor mode ++ * driver supports it. ++ */ ++ if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN) ++ return 0; ++ + /* The vendor mode is not always config #1, so to find it out. */ + c = udev->config; + num_configs = udev->descriptor.bNumConfigurations; diff --git a/target/linux/generic/backport-5.15/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch b/target/linux/generic/backport-5.15/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch new file mode 100644 index 00000000000..c9bd0df202f --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch @@ -0,0 +1,71 @@ +From 95a4c1d617b92cdc4522297741b56e8f6cd01a1e Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:42 +0800 +Subject: [PATCH] r8152: remove rtl_vendor_mode function + +After commit ec51fbd1b8a2 ("r8152: add USB device driver for +config selection"), the code about changing USB configuration +in rtl_vendor_mode() wouldn't be run anymore. Therefore, the +function could be removed. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 39 +-------------------------------------- + 1 file changed, 1 insertion(+), 38 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -8267,43 +8267,6 @@ static bool rtl_check_vendor_ok(struct u + return true; + } + +-static bool rtl_vendor_mode(struct usb_interface *intf) +-{ +- struct usb_host_interface *alt = intf->cur_altsetting; +- struct usb_device *udev; +- struct usb_host_config *c; +- int i, num_configs; +- +- if (alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC) +- return rtl_check_vendor_ok(intf); +- +- /* The vendor mode is not always config #1, so to find it out. */ +- udev = interface_to_usbdev(intf); +- c = udev->config; +- num_configs = udev->descriptor.bNumConfigurations; +- if (num_configs < 2) +- return false; +- +- for (i = 0; i < num_configs; (i++, c++)) { +- struct usb_interface_descriptor *desc = NULL; +- +- if (c->desc.bNumInterfaces > 0) +- desc = &c->intf_cache[0]->altsetting->desc; +- else +- continue; +- +- if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) { +- usb_driver_set_configuration(udev, c->desc.bConfigurationValue); +- break; +- } +- } +- +- if (i == num_configs) +- dev_err(&intf->dev, "Unexpected Device\n"); +- +- return false; +-} +- + static int rtl8152_pre_reset(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); +@@ -9636,7 +9599,7 @@ static int rtl8152_probe(struct usb_inte + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + +- if (!rtl_vendor_mode(intf)) ++ if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + + usb_reset_device(udev); diff --git a/target/linux/generic/backport-5.15/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch b/target/linux/generic/backport-5.15/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch new file mode 100644 index 00000000000..7d1053aea5a --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch @@ -0,0 +1,46 @@ +From 02767440e1dda9861a11ca1dbe0f19a760b1d5c2 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:43 +0800 +Subject: [PATCH] r8152: reduce the control transfer of rtl8152_get_version() + +Reduce the control transfer by moving calling rtl8152_get_version() in +rtl8152_probe(). This could prevent from calling rtl8152_get_version() +for unnecessary situations. For example, after setting config #2 for the +device, there are two interfaces and rtl8152_probe() may be called +twice. However, we don't need to call rtl8152_get_version() for this +situation. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9588,20 +9588,21 @@ static int rtl8152_probe(struct usb_inte + const struct usb_device_id *id) + { + struct usb_device *udev = interface_to_usbdev(intf); +- u8 version = rtl8152_get_version(intf); + struct r8152 *tp; + struct net_device *netdev; ++ u8 version; + int ret; + +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + + if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { diff --git a/target/linux/generic/backport-5.15/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch b/target/linux/generic/backport-5.15/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch new file mode 100644 index 00000000000..5d1dfe3aef1 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch @@ -0,0 +1,55 @@ +From 5cc33f139e11b893ff6dc60d8a0ae865a65521ac Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Thu, 6 Apr 2023 17:14:26 -0700 +Subject: [PATCH] r8152: Add __GFP_NOWARN to big allocations + +When memory is a little tight on my system, it's pretty easy to see +warnings that look like this. + + ksoftirqd/0: page allocation failure: order:3, mode:0x40a20(GFP_ATOMIC|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0 + ... + Call trace: + dump_backtrace+0x0/0x1e8 + show_stack+0x20/0x2c + dump_stack_lvl+0x60/0x78 + dump_stack+0x18/0x38 + warn_alloc+0x104/0x174 + __alloc_pages+0x588/0x67c + alloc_rx_agg+0xa0/0x190 [r8152 ...] + r8152_poll+0x270/0x760 [r8152 ...] + __napi_poll+0x44/0x1ec + net_rx_action+0x100/0x300 + __do_softirq+0xec/0x38c + run_ksoftirqd+0x38/0xec + smpboot_thread_fn+0xb8/0x248 + kthread+0x134/0x154 + ret_from_fork+0x10/0x20 + +On a fragmented system it's normal that order 3 allocations will +sometimes fail, especially atomic ones. The driver handles these +failures fine and the WARN just creates spam in the logs for this +case. The __GFP_NOWARN flag is exactly for this situation, so add it +to the allocation. + +NOTE: my testing is on a 5.15 system, but there should be no reason +that this would be fundamentally different on a mainline kernel. + +Signed-off-by: Douglas Anderson +Acked-by: Hayes Wang +Link: https://lore.kernel.org/r/20230406171411.1.I84dbef45786af440fd269b71e9436a96a8e7a152@changeid +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1944,7 +1944,7 @@ static struct rx_agg *alloc_rx_agg(struc + if (!rx_agg) + return NULL; + +- rx_agg->page = alloc_pages(mflags | __GFP_COMP, order); ++ rx_agg->page = alloc_pages(mflags | __GFP_COMP | __GFP_NOWARN, order); + if (!rx_agg->page) + goto free_rx; + diff --git a/target/linux/generic/backport-5.15/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch b/target/linux/generic/backport-5.15/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch new file mode 100644 index 00000000000..df881e26083 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch @@ -0,0 +1,24 @@ +From 0fbd79c01a9a657348f7032df70c57a406468c86 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 2 May 2023 11:36:27 +0800 +Subject: [PATCH] r8152: fix the autosuspend doesn't work + +Set supports_autosuspend = 1 for the rtl8152_cfgselector_driver. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9898,6 +9898,7 @@ static struct usb_device_driver rtl8152_ + .probe = rtl8152_cfgselector_probe, + .id_table = rtl8152_table, + .generic_subclass = 1, ++ .supports_autosuspend = 1, + }; + + static int __init rtl8152_driver_init(void) diff --git a/target/linux/generic/backport-5.15/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch b/target/linux/generic/backport-5.15/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch new file mode 100644 index 00000000000..0da1a5b7cf7 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch @@ -0,0 +1,70 @@ +From 57df0fb9d511f91202114813e90128d65c0589f0 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:07 +0800 +Subject: [PATCH] r8152: adjust generic_ocp_write function + +Reduce the control transfer if all bytes of first or the last DWORD are +written. + +The original method is to split the control transfer into three parts +(the first DWORD, middle continuous data, and the last DWORD). However, +they could be combined if whole bytes of the first DWORD or last DWORD +are written. That is, the first DWORD or the last DWORD could be combined +with the middle continuous data, if the byte_en is 0xff. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-418-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 29 ++++++++++++++++++----------- + 1 file changed, 18 insertions(+), 11 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1310,16 +1310,24 @@ static int generic_ocp_write(struct r815 + byteen_end = byteen & BYTE_EN_END_MASK; + + byen = byteen_start | (byteen_start << 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; +- +- index += 4; +- data += 4; +- size -= 4; + +- if (size) { ++ /* Split the first DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) { ++ ret = set_registers(tp, index, type | byen, 4, data); ++ if (ret < 0) ++ goto error1; ++ ++ index += 4; ++ data += 4; + size -= 4; ++ } ++ ++ if (size) { ++ byen = byteen_end | (byteen_end >> 4); ++ ++ /* Split the last DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) ++ size -= 4; + + while (size) { + if (size > limit) { +@@ -1346,10 +1354,9 @@ static int generic_ocp_write(struct r815 + } + } + +- byen = byteen_end | (byteen_end >> 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; ++ /* Set the last DWORD */ ++ if (byen != BYTE_EN_DWORD) ++ ret = set_registers(tp, index, type | byen, 4, data); + } + + error1: diff --git a/target/linux/generic/backport-5.15/795-v6.6-09-r8152-set-bp-in-bulk.patch b/target/linux/generic/backport-5.15/795-v6.6-09-r8152-set-bp-in-bulk.patch new file mode 100644 index 00000000000..cfc31daf126 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-09-r8152-set-bp-in-bulk.patch @@ -0,0 +1,129 @@ +From e5c266a61186b462c388c53a3564c375e72f2244 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:08 +0800 +Subject: [PATCH] r8152: set bp in bulk + +PLA_BP_0 ~ PLA_BP_15 (0xfc28 ~ 0xfc46) are continuous registers, so we +could combine the control transfers into one control transfer. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-419-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 75 ++++++++++++++--------------------------- + 1 file changed, 25 insertions(+), 50 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -3977,29 +3977,10 @@ static void rtl_reset_bmu(struct r8152 * + /* Clear the bp to stop the firmware before loading a new one */ + static void rtl_clear_bp(struct r8152 *tp, u16 type) + { +- switch (tp->version) { +- case RTL_VER_01: +- case RTL_VER_02: +- case RTL_VER_07: +- break; +- case RTL_VER_03: +- case RTL_VER_04: +- case RTL_VER_05: +- case RTL_VER_06: +- ocp_write_byte(tp, type, PLA_BP_EN, 0); +- break; +- case RTL_VER_14: +- ocp_write_word(tp, type, USB_BP2_EN, 0); ++ u16 bp[16] = {0}; ++ u16 bp_num; + +- ocp_write_word(tp, type, USB_BP_8, 0); +- ocp_write_word(tp, type, USB_BP_9, 0); +- ocp_write_word(tp, type, USB_BP_10, 0); +- ocp_write_word(tp, type, USB_BP_11, 0); +- ocp_write_word(tp, type, USB_BP_12, 0); +- ocp_write_word(tp, type, USB_BP_13, 0); +- ocp_write_word(tp, type, USB_BP_14, 0); +- ocp_write_word(tp, type, USB_BP_15, 0); +- break; ++ switch (tp->version) { + case RTL_VER_08: + case RTL_VER_09: + case RTL_VER_10: +@@ -4007,32 +3988,31 @@ static void rtl_clear_bp(struct r8152 *t + case RTL_VER_12: + case RTL_VER_13: + case RTL_VER_15: +- default: + if (type == MCU_TYPE_USB) { + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); +- +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_10, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_14, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_15, 0); +- } else { +- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0); ++ bp_num = 16; ++ break; + } ++ fallthrough; ++ case RTL_VER_03: ++ case RTL_VER_04: ++ case RTL_VER_05: ++ case RTL_VER_06: ++ ocp_write_byte(tp, type, PLA_BP_EN, 0); ++ fallthrough; ++ case RTL_VER_01: ++ case RTL_VER_02: ++ case RTL_VER_07: ++ bp_num = 8; ++ break; ++ case RTL_VER_14: ++ default: ++ ocp_write_word(tp, type, USB_BP2_EN, 0); ++ bp_num = 16; + break; + } + +- ocp_write_word(tp, type, PLA_BP_0, 0); +- ocp_write_word(tp, type, PLA_BP_1, 0); +- ocp_write_word(tp, type, PLA_BP_2, 0); +- ocp_write_word(tp, type, PLA_BP_3, 0); +- ocp_write_word(tp, type, PLA_BP_4, 0); +- ocp_write_word(tp, type, PLA_BP_5, 0); +- ocp_write_word(tp, type, PLA_BP_6, 0); +- ocp_write_word(tp, type, PLA_BP_7, 0); ++ generic_ocp_write(tp, PLA_BP_0, BYTE_EN_DWORD, bp_num << 1, bp, type); + + /* wait 3 ms to make sure the firmware is stopped */ + usleep_range(3000, 6000); +@@ -5009,10 +4989,9 @@ static void rtl8152_fw_phy_nc_apply(stru + + static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac) + { +- u16 bp_en_addr, bp_index, type, bp_num, fw_ver_reg; ++ u16 bp_en_addr, type, fw_ver_reg; + u32 length; + u8 *data; +- int i; + + switch (__le32_to_cpu(mac->blk_hdr.type)) { + case RTL_FW_PLA: +@@ -5054,12 +5033,8 @@ static void rtl8152_fw_mac_apply(struct + ocp_write_word(tp, type, __le16_to_cpu(mac->bp_ba_addr), + __le16_to_cpu(mac->bp_ba_value)); + +- bp_index = __le16_to_cpu(mac->bp_start); +- bp_num = __le16_to_cpu(mac->bp_num); +- for (i = 0; i < bp_num; i++) { +- ocp_write_word(tp, type, bp_index, __le16_to_cpu(mac->bp[i])); +- bp_index += 2; +- } ++ generic_ocp_write(tp, __le16_to_cpu(mac->bp_start), BYTE_EN_DWORD, ++ __le16_to_cpu(mac->bp_num) << 1, mac->bp, type); + + bp_en_addr = __le16_to_cpu(mac->bp_en_addr); + if (bp_en_addr) diff --git a/target/linux/generic/backport-5.15/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch b/target/linux/generic/backport-5.15/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch new file mode 100644 index 00000000000..4d1b177ff20 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch @@ -0,0 +1,39 @@ +From 72f93a3136ee18fd59fa6579f84c07e93424681e Mon Sep 17 00:00:00 2001 +From: Antonio Napolitano +Date: Sat, 26 Aug 2023 01:05:50 +0200 +Subject: [PATCH] r8152: add vendor/device ID pair for D-Link DUB-E250 + +The D-Link DUB-E250 is an RTL8156 based 2.5G Ethernet controller. + +Add the vendor and product ID values to the driver. This makes Ethernet +work with the adapter. + +Signed-off-by: Antonio Napolitano +Link: https://lore.kernel.org/r/CV200KJEEUPC.WPKAHXCQJ05I@mercurius +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 1 + + include/linux/usb/r8152.h | 1 + + 2 files changed, 2 insertions(+) + + +--- a/include/linux/usb/r8152.h ++++ b/include/linux/usb/r8152.h +@@ -29,6 +29,7 @@ + #define VENDOR_ID_LINKSYS 0x13b1 + #define VENDOR_ID_NVIDIA 0x0955 + #define VENDOR_ID_TPLINK 0x2357 ++#define VENDOR_ID_DLINK 0x2001 + + #if IS_REACHABLE(CONFIG_USB_RTL8152) + extern u8 rtl8152_get_version(struct usb_interface *intf); +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9820,6 +9820,7 @@ static const struct usb_device_id rtl815 + { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, + { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, + { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, ++ { USB_DEVICE(VENDOR_ID_DLINK, 0xb301) }, + {} + }; + diff --git a/target/linux/generic/backport-5.15/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch b/target/linux/generic/backport-5.15/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch new file mode 100644 index 00000000000..4f0e0e1c658 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch @@ -0,0 +1,447 @@ +From 715f67f33af45ce2cc3a5b1ef133cc8c8e7787b0 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:58 -0700 +Subject: [PATCH] r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + +Whenever the RTL8152_UNPLUG is set that just tells the driver that all +accesses will fail and we should just immediately bail. A future patch +will use this same concept at a time when the driver hasn't actually +been unplugged but is about to be reset. Rename the flag in +preparation for the future patch. + +This is a no-op change and just a search and replace. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 96 ++++++++++++++++++++--------------------- + 1 file changed, 48 insertions(+), 48 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -763,7 +763,7 @@ enum rtl_register_content { + + /* rtl8152 flags */ + enum rtl8152_flags { +- RTL8152_UNPLUG = 0, ++ RTL8152_INACCESSIBLE = 0, + RTL8152_SET_RX_MODE, + WORK_ENABLE, + RTL8152_LINK_CHG, +@@ -1241,7 +1241,7 @@ int set_registers(struct r8152 *tp, u16 + static void rtl_set_unplug(struct r8152 *tp) + { + if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_UNPLUG, &tp->flags); ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); + smp_mb__after_atomic(); + } + } +@@ -1252,7 +1252,7 @@ static int generic_ocp_read(struct r8152 + u16 limit = 64; + int ret = 0; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1296,7 +1296,7 @@ static int generic_ocp_write(struct r815 + u16 byteen_start, byteen_end, byen; + u16 limit = 512; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1533,7 +1533,7 @@ static int read_mii_word(struct net_devi + struct r8152 *tp = netdev_priv(netdev); + int ret; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + if (phy_id != R8152_PHY_ID) +@@ -1549,7 +1549,7 @@ void write_mii_word(struct net_device *n + { + struct r8152 *tp = netdev_priv(netdev); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (phy_id != R8152_PHY_ID) +@@ -1754,7 +1754,7 @@ static void read_bulk_callback(struct ur + if (!tp) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -1846,7 +1846,7 @@ static void write_bulk_callback(struct u + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!skb_queue_empty(&tp->tx_queue)) +@@ -1867,7 +1867,7 @@ static void intr_callback(struct urb *ur + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + switch (status) { +@@ -2611,7 +2611,7 @@ static void bottom_half(struct tasklet_s + { + struct r8152 *tp = from_tasklet(tp, t, tx_tl); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -2654,7 +2654,7 @@ int r8152_submit_rx(struct r8152 *tp, st + int ret; + + /* The rx would be stopped, so skip submitting */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || + !test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev)) + return 0; + +@@ -3050,7 +3050,7 @@ static int rtl_enable(struct r8152 *tp) + + static int rtl8152_enable(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3137,7 +3137,7 @@ static int rtl8153_enable(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3169,7 +3169,7 @@ static void rtl_disable(struct r8152 *tp + u32 ocp_data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -3623,7 +3623,7 @@ static u16 r8153_phy_status(struct r8152 + } + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -3655,7 +3655,7 @@ static void r8153b_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -3697,7 +3697,7 @@ static void r8153c_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -4042,8 +4042,8 @@ static int rtl_phy_patch_request(struct + for (i = 0; wait && i < 5000; i++) { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) +- break; ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; + + usleep_range(1000, 2000); + ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT); +@@ -6001,7 +6001,7 @@ static int rtl8156_enable(struct r8152 * + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + r8156_fc_parameter(tp); +@@ -6059,7 +6059,7 @@ static int rtl8156b_enable(struct r8152 + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -6245,7 +6245,7 @@ out: + + static void rtl8152_up(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8152_aldps_en(tp, false); +@@ -6255,7 +6255,7 @@ static void rtl8152_up(struct r8152 *tp) + + static void rtl8152_down(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6270,7 +6270,7 @@ static void rtl8153_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6310,7 +6310,7 @@ static void rtl8153_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6331,7 +6331,7 @@ static void rtl8153b_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6355,7 +6355,7 @@ static void rtl8153b_down(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6392,7 +6392,7 @@ static void rtl8153c_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6473,7 +6473,7 @@ static void rtl8156_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6546,7 +6546,7 @@ static void rtl8156_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6684,7 +6684,7 @@ static void rtl_work_func_t(struct work_ + /* If the device is unplugged or !netif_running(), the workqueue + * doesn't need to wake the device, and could return directly. + */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6723,7 +6723,7 @@ static void rtl_hw_phy_work_func_t(struc + { + struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6850,7 +6850,7 @@ static int rtl8152_close(struct net_devi + netif_stop_queue(netdev); + + res = usb_autopm_get_interface(tp->intf); +- if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + rtl_stop_rx(tp); + } else { +@@ -6883,7 +6883,7 @@ static void r8152b_init(struct r8152 *tp + u32 ocp_data; + u16 data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + data = r8152_mdio_read(tp, MII_BMCR); +@@ -6927,7 +6927,7 @@ static void r8153_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6938,7 +6938,7 @@ static void r8153_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7067,7 +7067,7 @@ static void r8153b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7078,7 +7078,7 @@ static void r8153b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7149,7 +7149,7 @@ static void r8153c_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7169,7 +7169,7 @@ static void r8153c_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -7998,7 +7998,7 @@ static void r8156_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8019,7 +8019,7 @@ static void r8156_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -8094,7 +8094,7 @@ static void r8156b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8128,7 +8128,7 @@ static void r8156b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -9153,7 +9153,7 @@ static int rtl8152_ioctl(struct net_devi + struct mii_ioctl_data *data = if_mii(rq); + int res; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + res = usb_autopm_get_interface(tp->intf); +@@ -9255,7 +9255,7 @@ static const struct net_device_ops rtl81 + + static void rtl8152_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (tp->version != RTL_VER_01) +@@ -9264,7 +9264,7 @@ static void rtl8152_unload(struct r8152 + + static void rtl8153_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_power_cut_en(tp, false); +@@ -9272,7 +9272,7 @@ static void rtl8153_unload(struct r8152 + + static void rtl8153b_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_power_cut_en(tp, false); diff --git a/target/linux/generic/backport-5.15/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch b/target/linux/generic/backport-5.15/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch new file mode 100644 index 00000000000..0ce8206657a --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch @@ -0,0 +1,398 @@ +From d9962b0d42029bcb40fe3c38bce06d1870fa4df4 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:59 -0700 +Subject: [PATCH] r8152: Block future register access if register access fails + +Even though the functions to read/write registers can fail, most of +the places in the r8152 driver that read/write register values don't +check error codes. The lack of error code checking is problematic in +at least two ways. + +The first problem is that the r8152 driver often uses code patterns +similar to this: + x = read_register() + x = x | SOME_BIT; + write_register(x); + +...with the above pattern, if the read_register() fails and returns +garbage then we'll end up trying to write modified garbage back to the +Realtek adapter. If the write_register() succeeds that's bad. Note +that as of commit f53a7ad18959 ("r8152: Set memory to all 0xFFs on +failed reg reads") the "garbage" returned by read_register() will at +least be consistent garbage, but it is still garbage. + +It turns out that this problem is very serious. Writing garbage to +some of the hardware registers on the Ethernet adapter can put the +adapter in such a bad state that it needs to be power cycled (fully +unplugged and plugged in again) before it can enumerate again. + +The second problem is that the r8152 driver generally has functions +that are long sequences of register writes. Assuming everything will +be OK if a random register write fails in the middle isn't a great +assumption. + +One might wonder if the above two problems are real. You could ask if +we would really have a successful write after a failed read. It turns +out that the answer appears to be "yes, this can happen". In fact, +we've seen at least two distinct failure modes where this happens. + +On a sc7180-trogdor Chromebook if you drop into kdb for a while and +then resume, you can see: +1. We get a "Tx timeout" +2. The "Tx timeout" queues up a USB reset. +3. In rtl8152_pre_reset() we try to reinit the hardware. +4. The first several (2-9) register accesses fail with a timeout, then + things recover. + +The above test case was actually fixed by the patch ("r8152: Increase +USB control msg timeout to 5000ms as per spec") but at least shows +that we really can see successful calls after failed ones. + +On a different (AMD) based Chromebook with a particular adapter, we +found that during reboot tests we'd also sometimes get a transitory +failure. In this case we saw -EPIPE being returned sometimes. Retrying +worked, but retrying is not always safe for all register accesses +since reading/writing some registers might have side effects (like +registers that clear on read). + +Let's fully lock out all register access if a register access fails. +When we do this, we'll try to queue up a USB reset and try to unlock +register access after the reset. This is slightly tricker than it +sounds since the r8152 driver has an optimized reset sequence that +only works reliably after probe happens. In order to handle this, we +avoid the optimized reset if probe didn't finish. Instead, we simply +retry the probe routine in this case. + +When locking out access, we'll use the existing infrastructure that +the driver was using when it detected we were unplugged. This keeps us +from getting stuck in delay loops in some parts of the driver. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 207 ++++++++++++++++++++++++++++++++++------ + 1 file changed, 176 insertions(+), 31 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -772,6 +772,9 @@ enum rtl8152_flags { + SCHEDULE_TASKLET, + GREEN_ETHERNET, + RX_EPROTO, ++ IN_PRE_RESET, ++ PROBED_WITH_NO_ERRORS, ++ PROBE_SHOULD_RETRY, + }; + + #define DEVICE_ID_THINKPAD_ONELINK_PLUS_DOCK 0x3054 +@@ -949,6 +952,8 @@ struct r8152 { + u8 version; + u8 duplex; + u8 autoneg; ++ ++ unsigned int reg_access_reset_count; + }; + + /** +@@ -1196,6 +1201,96 @@ static unsigned int agg_buf_sz = 16384; + + #define RTL_LIMITED_TSO_SIZE (size_to_mtu(agg_buf_sz) - sizeof(struct tx_desc)) + ++/* If register access fails then we block access and issue a reset. If this ++ * happens too many times in a row without a successful access then we stop ++ * trying to reset and just leave access blocked. ++ */ ++#define REGISTER_ACCESS_MAX_RESETS 3 ++ ++static void rtl_set_inaccessible(struct r8152 *tp) ++{ ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static void rtl_set_accessible(struct r8152 *tp) ++{ ++ clear_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static ++int r8152_control_msg(struct r8152 *tp, unsigned int pipe, __u8 request, ++ __u8 requesttype, __u16 value, __u16 index, void *data, ++ __u16 size, const char *msg_tag) ++{ ++ struct usb_device *udev = tp->udev; ++ int ret; ++ ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; ++ ++ ret = usb_control_msg(udev, pipe, request, requesttype, ++ value, index, data, size, ++ USB_CTRL_GET_TIMEOUT); ++ ++ /* No need to issue a reset to report an error if the USB device got ++ * unplugged; just return immediately. ++ */ ++ if (ret == -ENODEV) ++ return ret; ++ ++ /* If the write was successful then we're done */ ++ if (ret >= 0) { ++ tp->reg_access_reset_count = 0; ++ return ret; ++ } ++ ++ dev_err(&udev->dev, ++ "Failed to %s %d bytes at %#06x/%#06x (%d)\n", ++ msg_tag, size, value, index, ret); ++ ++ /* Block all future register access until we reset. Much of the code ++ * in the driver doesn't check for errors. Notably, many parts of the ++ * driver do a read/modify/write of a register value without ++ * confirming that the read succeeded. Writing back modified garbage ++ * like this can fully wedge the adapter, requiring a power cycle. ++ */ ++ rtl_set_inaccessible(tp); ++ ++ /* If probe hasn't yet finished, then we'll request a retry of the ++ * whole probe routine if we get any control transfer errors. We ++ * never have to clear this bit since we free/reallocate the whole "tp" ++ * structure if we retry probe. ++ */ ++ if (!test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) { ++ set_bit(PROBE_SHOULD_RETRY, &tp->flags); ++ return ret; ++ } ++ ++ /* Failing to access registers in pre-reset is not surprising since we ++ * wouldn't be resetting if things were behaving normally. The register ++ * access we do in pre-reset isn't truly mandatory--we're just reusing ++ * the disable() function and trying to be nice by powering the ++ * adapter down before resetting it. Thus, if we're in pre-reset, ++ * we'll return right away and not try to queue up yet another reset. ++ * We know the post-reset is already coming. ++ */ ++ if (test_bit(IN_PRE_RESET, &tp->flags)) ++ return ret; ++ ++ if (tp->reg_access_reset_count < REGISTER_ACCESS_MAX_RESETS) { ++ usb_queue_reset_device(tp->intf); ++ tp->reg_access_reset_count++; ++ } else if (tp->reg_access_reset_count == REGISTER_ACCESS_MAX_RESETS) { ++ dev_err(&udev->dev, ++ "Tried to reset %d times; giving up.\n", ++ REGISTER_ACCESS_MAX_RESETS); ++ } ++ ++ return ret; ++} ++ + static + int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) + { +@@ -1206,9 +1301,10 @@ int get_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_in, +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- value, index, tmp, size, USB_CTRL_GET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_in, ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ value, index, tmp, size, "read"); ++ + if (ret < 0) + memset(data, 0xff, size); + else +@@ -1229,9 +1325,9 @@ int set_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_out, +- RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, +- value, index, tmp, size, USB_CTRL_SET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_out, ++ RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, ++ value, index, tmp, size, "write"); + + kfree(tmp); + +@@ -1240,10 +1336,8 @@ int set_registers(struct r8152 *tp, u16 + + static void rtl_set_unplug(struct r8152 *tp) + { +- if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_INACCESSIBLE, &tp->flags); +- smp_mb__after_atomic(); +- } ++ if (tp->udev->state == USB_STATE_NOTATTACHED) ++ rtl_set_inaccessible(tp); + } + + static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, +@@ -8254,7 +8348,7 @@ static int rtl8152_pre_reset(struct usb_ + struct r8152 *tp = usb_get_intfdata(intf); + struct net_device *netdev; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + + netdev = tp->netdev; +@@ -8269,7 +8363,9 @@ static int rtl8152_pre_reset(struct usb_ + napi_disable(&tp->napi); + if (netif_carrier_ok(netdev)) { + mutex_lock(&tp->control); ++ set_bit(IN_PRE_RESET, &tp->flags); + tp->rtl_ops.disable(tp); ++ clear_bit(IN_PRE_RESET, &tp->flags); + mutex_unlock(&tp->control); + } + +@@ -8282,9 +8378,11 @@ static int rtl8152_post_reset(struct usb + struct net_device *netdev; + struct sockaddr sa; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + ++ rtl_set_accessible(tp); ++ + /* reset the MAC address in case of policy change */ + if (determine_ethernet_addr(tp, &sa) >= 0) { + rtnl_lock(); +@@ -9482,17 +9580,29 @@ static u8 __rtl_get_hw_ver(struct usb_de + __le32 *tmp; + u8 version; + int ret; ++ int i; + + tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + if (!tmp) + return 0; + +- ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), +- USB_CTRL_GET_TIMEOUT); +- if (ret > 0) +- ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ /* Retry up to 3 times in case there is a transitory error. We do this ++ * since retrying a read of the version is always safe and this ++ * function doesn't take advantage of r8152_control_msg(). ++ */ ++ for (i = 0; i < 3; i++) { ++ ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), ++ USB_CTRL_GET_TIMEOUT); ++ if (ret > 0) { ++ ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ break; ++ } ++ } ++ ++ if (i != 0 && ret > 0) ++ dev_warn(&udev->dev, "Needed %d retries to read version\n", i); + + kfree(tmp); + +@@ -9566,25 +9676,14 @@ u8 rtl8152_get_version(struct usb_interf + } + EXPORT_SYMBOL_GPL(rtl8152_get_version); + +-static int rtl8152_probe(struct usb_interface *intf, +- const struct usb_device_id *id) ++static int rtl8152_probe_once(struct usb_interface *intf, ++ const struct usb_device_id *id, u8 version) + { + struct usb_device *udev = interface_to_usbdev(intf); + struct r8152 *tp; + struct net_device *netdev; +- u8 version; + int ret; + +- if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) +- return -ENODEV; +- +- if (!rtl_check_vendor_ok(intf)) +- return -ENODEV; +- +- version = rtl8152_get_version(intf); +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { +@@ -9757,10 +9856,20 @@ static int rtl8152_probe(struct usb_inte + else + device_set_wakeup_enable(&udev->dev, false); + ++ /* If we saw a control transfer error while probing then we may ++ * want to try probe() again. Consider this an error. ++ */ ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ goto out2; ++ ++ set_bit(PROBED_WITH_NO_ERRORS, &tp->flags); + netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION); + + return 0; + ++out2: ++ unregister_netdev(netdev); ++ + out1: + tasklet_kill(&tp->tx_tl); + cancel_delayed_work_sync(&tp->hw_phy_work); +@@ -9769,10 +9878,46 @@ out1: + rtl8152_release_firmware(tp); + usb_set_intfdata(intf, NULL); + out: ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ ret = -EAGAIN; ++ + free_netdev(netdev); + return ret; + } + ++#define RTL8152_PROBE_TRIES 3 ++ ++static int rtl8152_probe(struct usb_interface *intf, ++ const struct usb_device_id *id) ++{ ++ u8 version; ++ int ret; ++ int i; ++ ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ ++ if (!rtl_check_vendor_ok(intf)) ++ return -ENODEV; ++ ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ ++ for (i = 0; i < RTL8152_PROBE_TRIES; i++) { ++ ret = rtl8152_probe_once(intf, id, version); ++ if (ret != -EAGAIN) ++ break; ++ } ++ if (ret == -EAGAIN) { ++ dev_err(&intf->dev, ++ "r8152 failed probe after %d tries; giving up\n", i); ++ return -ENODEV; ++ } ++ ++ return ret; ++} ++ + static void rtl8152_disconnect(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); diff --git a/target/linux/generic/backport-5.15/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch b/target/linux/generic/backport-5.15/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch new file mode 100644 index 00000000000..42ca9e2ad1c --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch @@ -0,0 +1,83 @@ +From 66eee612a1ba39f9a76a9ace4a34d012044767fb Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 26 Sep 2023 19:17:13 +0800 +Subject: [PATCH] r8152: break the loop when the budget is exhausted + +[ Upstream commit 2cf51f931797d9a47e75d999d0993a68cbd2a560 ] + +A bulk transfer of the USB may contain many packets. And, the total +number of the packets in the bulk transfer may be more than budget. + +Originally, only budget packets would be handled by napi_gro_receive(), +and the other packets would be queued in the driver for next schedule. + +This patch would break the loop about getting next bulk transfer, when +the budget is exhausted. That is, only the current bulk transfer would +be handled, and the other bulk transfers would be queued for next +schedule. Besides, the packets which are more than the budget in the +current bulk trasnfer would be still queued in the driver, as the +original method. + +In addition, a bulk transfer wouldn't contain more than 400 packets, so +the check of queue length is unnecessary. Therefore, I replace it with +WARN_ON_ONCE(). + +Fixes: cf74eb5a5bc8 ("eth: r8152: try to use a normal budget") +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230926111714.9448-433-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/r8152.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -2539,7 +2539,7 @@ static int rx_bottom(struct r8152 *tp, i + } + } + +- if (list_empty(&tp->rx_done)) ++ if (list_empty(&tp->rx_done) || work_done >= budget) + goto out1; + + clear_bit(RX_EPROTO, &tp->flags); +@@ -2555,6 +2555,15 @@ static int rx_bottom(struct r8152 *tp, i + struct urb *urb; + u8 *rx_data; + ++ /* A bulk transfer of USB may contain may packets, so the ++ * total packets may more than the budget. Deal with all ++ * packets in current bulk transfer, and stop to handle the ++ * next bulk transfer until next schedule, if budget is ++ * exhausted. ++ */ ++ if (work_done >= budget) ++ break; ++ + list_del_init(cursor); + + agg = list_entry(cursor, struct rx_agg, list); +@@ -2574,9 +2583,7 @@ static int rx_bottom(struct r8152 *tp, i + unsigned int pkt_len, rx_frag_head_sz; + struct sk_buff *skb; + +- /* limit the skb numbers for rx_queue */ +- if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) +- break; ++ WARN_ON_ONCE(skb_queue_len(&tp->rx_queue) >= 1000); + + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; + if (pkt_len < ETH_ZLEN) +@@ -2654,9 +2661,10 @@ submit: + } + } + ++ /* Splice the remained list back to rx_done for next schedule */ + if (!list_empty(&rx_queue)) { + spin_lock_irqsave(&tp->rx_lock, flags); +- list_splice_tail(&rx_queue, &tp->rx_done); ++ list_splice(&rx_queue, &tp->rx_done); + spin_unlock_irqrestore(&tp->rx_lock, flags); + } + diff --git a/target/linux/generic/backport-5.15/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch b/target/linux/generic/backport-5.15/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch new file mode 100644 index 00000000000..d578d0107fd --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch @@ -0,0 +1,47 @@ +From 1b0fce8c8e69485e49a7d34aac3d4c2a2aa15d62 Mon Sep 17 00:00:00 2001 +From: Davide Tronchin +Date: Thu, 29 Jun 2023 12:37:36 +0200 +Subject: [PATCH] net: usb: cdc_ether: add u-blox 0x1313 composition. + +Add CDC-ECM support for LARA-R6 01B. + +The new LARA-R6 product variant identified by the "01B" string can be +configured (by AT interface) in three different USB modes: +* Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial +interfaces +* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial +interfaces and 1 RmNet virtual network interface +* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial +interface and 1 CDC-ECM virtual network interface +The first 4 interfaces of all the 3 configurations (default, RmNet, ECM) +are the same. + +In CDC-ECM mode LARA-R6 01B exposes the following interfaces: +If 0: Diagnostic +If 1: AT parser +If 2: AT parser +If 3: AT parset/alternative functions +If 4: CDC-ECM interface + +Signed-off-by: Davide Tronchin +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -878,6 +878,12 @@ static const struct usb_device_id produc + USB_CDC_PROTO_NONE), + .driver_info = (unsigned long)&wwan_info, + }, { ++ /* U-blox LARA-R6 01B */ ++ USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1313, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, ++ USB_CDC_PROTO_NONE), ++ .driver_info = (unsigned long)&wwan_info, ++}, { + /* ZTE modules */ + USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, diff --git a/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch index b23f9a4b9e2..725af4b52cf 100644 --- a/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch +++ b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch @@ -17,7 +17,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -2275,6 +2275,23 @@ struct btmtk_section_map { +@@ -2287,6 +2287,23 @@ struct btmtk_section_map { }; } __packed; @@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann static void btusb_mtk_wmt_recv(struct urb *urb) { struct hci_dev *hdev = urb->context; -@@ -3926,6 +3943,7 @@ static int btusb_probe(struct usb_interf +@@ -3941,6 +3958,7 @@ static int btusb_probe(struct usb_interf hdev->shutdown = btusb_mtk_shutdown; hdev->manufacturer = 70; hdev->cmd_timeout = btusb_mtk_cmd_timeout; diff --git a/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch index 6fe61a9defe..d72866eabf1 100644 --- a/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch +++ b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch @@ -18,7 +18,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -2280,7 +2280,7 @@ static int btusb_set_bdaddr_mtk(struct h +@@ -2292,7 +2292,7 @@ static int btusb_set_bdaddr_mtk(struct h struct sk_buff *skb; long ret; diff --git a/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch index d670195da1f..ebb6cc47176 100644 --- a/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch +++ b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch @@ -58,7 +58,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -464,6 +464,9 @@ static const struct usb_device_id blackl +@@ -476,6 +476,9 @@ static const struct usb_device_id blackl { USB_DEVICE(0x13d3, 0x3564), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch index be9dc734215..a8c7ca003a9 100644 --- a/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch +++ b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch @@ -56,7 +56,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -455,6 +455,9 @@ static const struct usb_device_id blackl +@@ -467,6 +467,9 @@ static const struct usb_device_id blackl BTUSB_VALID_LE_STATES }, /* Additional MediaTek MT7921 Bluetooth devices */ diff --git a/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch b/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch index 24ec68a2ca5..b46e6926d14 100644 --- a/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch +++ b/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch @@ -54,7 +54,7 @@ Signed-off-by: Luiz Augusto von Dentz --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -473,6 +473,9 @@ static const struct usb_device_id blackl +@@ -485,6 +485,9 @@ static const struct usb_device_id blackl { USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/backport-5.15/831-v6.1-dt-bindings-leds-Expand-LED_COLOR_ID-definitions.patch b/target/linux/generic/backport-5.15/831-v6.1-dt-bindings-leds-Expand-LED_COLOR_ID-definitions.patch new file mode 100644 index 00000000000..c2a938c614f --- /dev/null +++ b/target/linux/generic/backport-5.15/831-v6.1-dt-bindings-leds-Expand-LED_COLOR_ID-definitions.patch @@ -0,0 +1,47 @@ +From 472d7b9e8141729ec1e3fe6821b88563f6379533 Mon Sep 17 00:00:00 2001 +From: Olliver Schinagl +Date: Tue, 30 Aug 2022 15:46:13 +0200 +Subject: [PATCH] dt-bindings: leds: Expand LED_COLOR_ID definitions + +In commit 853a78a7d6c7 (dt-bindings: leds: Add LED_COLOR_ID definitions, +Sun Jun 9 20:19:04 2019 +0200) the most basic color definitions where +added. However, there's a little more very common LED colors. + +While the documentation states 'add what is missing', engineers tend to +be lazy and will just use what currently exists. So this patch will take +(a) list from online retailers [0], [1], [2] and use the common LED colors from +there, this being reasonable as this is what is currently available to purchase. + +Note, that LIME seems to be the modern take to 'Yellow-green' or +'Yellowish-green' from some older datasheets. + +[0]: https://www.digikey.com/en/products/filter/led-lighting-color/125 +[1]: https://eu.mouser.com/c/optoelectronics/led-lighting/led-emitters/standard-leds-smd +[2]: https://nl.farnell.com/en-NL/c/optoelectronics-displays/led-products/standard-single-colour-leds-under-75ma + +Signed-off-by: Olliver Schinagl +Acked-by: Krzysztof Kozlowski +Acked-by: Alexander Dahl +Acked-by: Jacek Anaszewski +Link: https://lore.kernel.org/r/20220830134613.1564059-1-oliver@schinagl.nl +Signed-off-by: Rob Herring +--- + include/dt-bindings/leds/common.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/include/dt-bindings/leds/common.h ++++ b/include/dt-bindings/leds/common.h +@@ -33,7 +33,12 @@ + #define LED_COLOR_ID_MULTI 8 /* For multicolor LEDs */ + #define LED_COLOR_ID_RGB 9 /* For multicolor LEDs that can do arbitrary color, + so this would include RGBW and similar */ +-#define LED_COLOR_ID_MAX 10 ++#define LED_COLOR_ID_PURPLE 10 ++#define LED_COLOR_ID_ORANGE 11 ++#define LED_COLOR_ID_PINK 12 ++#define LED_COLOR_ID_CYAN 13 ++#define LED_COLOR_ID_LIME 14 ++#define LED_COLOR_ID_MAX 15 + + /* Standard LED functions */ + /* Keyboard LEDs, usually it would be input4::capslock etc. */ diff --git a/target/linux/generic/backport-5.15/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch b/target/linux/generic/backport-5.15/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch new file mode 100644 index 00000000000..b71df6fa572 --- /dev/null +++ b/target/linux/generic/backport-5.15/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch @@ -0,0 +1,29 @@ +From a067943129b4ec6b835e02cfd5fbef01093c1471 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sun, 8 Oct 2023 16:40:13 +0200 +Subject: [PATCH] leds: core: Add more colors from DT bindings to led_colors + +The colors are already part of DT bindings. Make sure the kernel is +able to convert them to strings. + +Signed-off-by: Ondrej Jirman +Link: https://lore.kernel.org/r/20231008144014.1180334-1-megi@xff.cz +Signed-off-by: Lee Jones +--- + drivers/leds/led-core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/leds/led-core.c ++++ b/drivers/leds/led-core.c +@@ -36,6 +36,11 @@ const char * const led_colors[LED_COLOR_ + [LED_COLOR_ID_IR] = "ir", + [LED_COLOR_ID_MULTI] = "multicolor", + [LED_COLOR_ID_RGB] = "rgb", ++ [LED_COLOR_ID_PURPLE] = "purple", ++ [LED_COLOR_ID_ORANGE] = "orange", ++ [LED_COLOR_ID_PINK] = "pink", ++ [LED_COLOR_ID_CYAN] = "cyan", ++ [LED_COLOR_ID_LIME] = "lime", + }; + EXPORT_SYMBOL_GPL(led_colors); + 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 612ed6f6bab..10fee0adf63 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 @@ -325,7 +325,7 @@ Signed-off-by: T.J. Mercier mctz = soft_limit_tree.rb_tree_per_node[nid]; if (!mctz) return; -@@ -3523,6 +3533,9 @@ unsigned long mem_cgroup_soft_limit_recl +@@ -3524,6 +3534,9 @@ unsigned long mem_cgroup_soft_limit_recl struct mem_cgroup_tree_per_node *mctz; unsigned long excess; @@ -335,7 +335,7 @@ Signed-off-by: T.J. Mercier if (order > 0) return 0; -@@ -5386,6 +5399,7 @@ static int mem_cgroup_css_online(struct +@@ -5387,6 +5400,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); -@@ -5417,6 +5431,7 @@ static void mem_cgroup_css_offline(struc +@@ -5418,6 +5432,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); -@@ -5428,6 +5443,7 @@ static void mem_cgroup_css_released(stru +@@ -5429,6 +5444,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/backport-6.1/702-01-v6.7-net-phy-aquantia-move-to-separate-directory.patch b/target/linux/generic/backport-6.1/702-01-v6.7-net-phy-aquantia-move-to-separate-directory.patch new file mode 100644 index 00000000000..0cad6c53d42 --- /dev/null +++ b/target/linux/generic/backport-6.1/702-01-v6.7-net-phy-aquantia-move-to-separate-directory.patch @@ -0,0 +1,2306 @@ +From d2213db3f49bce8e7a87c8de05b9a091f78f654e Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 14 Nov 2023 15:08:41 +0100 +Subject: [PATCH 1/3] net: phy: aquantia: move to separate directory + +Move aquantia PHY driver to separate driectory in preparation for +firmware loading support to keep things tidy. + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/Kconfig | 5 +---- + drivers/net/phy/Makefile | 6 +----- + drivers/net/phy/aquantia/Kconfig | 5 +++++ + drivers/net/phy/aquantia/Makefile | 6 ++++++ + drivers/net/phy/{ => aquantia}/aquantia.h | 0 + drivers/net/phy/{ => aquantia}/aquantia_hwmon.c | 0 + drivers/net/phy/{ => aquantia}/aquantia_main.c | 0 + 7 files changed, 13 insertions(+), 9 deletions(-) + create mode 100644 drivers/net/phy/aquantia/Kconfig + create mode 100644 drivers/net/phy/aquantia/Makefile + rename drivers/net/phy/{ => aquantia}/aquantia.h (100%) + rename drivers/net/phy/{ => aquantia}/aquantia_hwmon.c (100%) + rename drivers/net/phy/{ => aquantia}/aquantia_main.c (100%) + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -90,10 +90,7 @@ config ADIN1100_PHY + Currently supports the: + - ADIN1100 - Robust,Industrial, Low Power 10BASE-T1L Ethernet PHY + +-config AQUANTIA_PHY +- tristate "Aquantia PHYs" +- help +- Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 ++source "drivers/net/phy/aquantia/Kconfig" + + config AX88796B_PHY + tristate "Asix PHYs" +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -33,11 +33,7 @@ obj-y += $(sfp-obj-y) $(sfp-obj-m) + obj-$(CONFIG_ADIN_PHY) += adin.o + obj-$(CONFIG_ADIN1100_PHY) += adin1100.o + obj-$(CONFIG_AMD_PHY) += amd.o +-aquantia-objs += aquantia_main.o +-ifdef CONFIG_HWMON +-aquantia-objs += aquantia_hwmon.o +-endif +-obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o ++obj-$(CONFIG_AQUANTIA_PHY) += aquantia/ + obj-$(CONFIG_AT803X_PHY) += at803x.o + obj-$(CONFIG_AX88796B_PHY) += ax88796b.o + obj-$(CONFIG_BCM54140_PHY) += bcm54140.o +--- /dev/null ++++ b/drivers/net/phy/aquantia/Kconfig +@@ -0,0 +1,5 @@ ++# SPDX-License-Identifier: GPL-2.0-only ++config AQUANTIA_PHY ++ tristate "Aquantia PHYs" ++ help ++ Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 +--- /dev/null ++++ b/drivers/net/phy/aquantia/Makefile +@@ -0,0 +1,6 @@ ++# SPDX-License-Identifier: GPL-2.0 ++aquantia-objs += aquantia_main.o ++ifdef CONFIG_HWMON ++aquantia-objs += aquantia_hwmon.o ++endif ++obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o +--- a/drivers/net/phy/aquantia.h ++++ /dev/null +@@ -1,16 +0,0 @@ +-/* SPDX-License-Identifier: GPL-2.0 */ +-/* HWMON driver for Aquantia PHY +- * +- * Author: Nikita Yushchenko +- * Author: Andrew Lunn +- * Author: Heiner Kallweit +- */ +- +-#include +-#include +- +-#if IS_REACHABLE(CONFIG_HWMON) +-int aqr_hwmon_probe(struct phy_device *phydev); +-#else +-static inline int aqr_hwmon_probe(struct phy_device *phydev) { return 0; } +-#endif +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia.h +@@ -0,0 +1,16 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* HWMON driver for Aquantia PHY ++ * ++ * Author: Nikita Yushchenko ++ * Author: Andrew Lunn ++ * Author: Heiner Kallweit ++ */ ++ ++#include ++#include ++ ++#if IS_REACHABLE(CONFIG_HWMON) ++int aqr_hwmon_probe(struct phy_device *phydev); ++#else ++static inline int aqr_hwmon_probe(struct phy_device *phydev) { return 0; } ++#endif +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia_hwmon.c +@@ -0,0 +1,250 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* HWMON driver for Aquantia PHY ++ * ++ * Author: Nikita Yushchenko ++ * Author: Andrew Lunn ++ * Author: Heiner Kallweit ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include "aquantia.h" ++ ++/* Vendor specific 1, MDIO_MMD_VEND2 */ ++#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 ++#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 ++#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 ++#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 ++#define VEND1_THERMAL_STAT1 0xc820 ++#define VEND1_THERMAL_STAT2 0xc821 ++#define VEND1_THERMAL_STAT2_VALID BIT(0) ++#define VEND1_GENERAL_STAT1 0xc830 ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) ++ ++#if IS_REACHABLE(CONFIG_HWMON) ++ ++static umode_t aqr_hwmon_is_visible(const void *data, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel) ++{ ++ if (type != hwmon_temp) ++ return 0; ++ ++ switch (attr) { ++ case hwmon_temp_input: ++ case hwmon_temp_min_alarm: ++ case hwmon_temp_max_alarm: ++ case hwmon_temp_lcrit_alarm: ++ case hwmon_temp_crit_alarm: ++ return 0444; ++ case hwmon_temp_min: ++ case hwmon_temp_max: ++ case hwmon_temp_lcrit: ++ case hwmon_temp_crit: ++ return 0644; ++ default: ++ return 0; ++ } ++} ++ ++static int aqr_hwmon_get(struct phy_device *phydev, int reg, long *value) ++{ ++ int temp = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); ++ ++ if (temp < 0) ++ return temp; ++ ++ /* 16 bit value is 2's complement with LSB = 1/256th degree Celsius */ ++ *value = (s16)temp * 1000 / 256; ++ ++ return 0; ++} ++ ++static int aqr_hwmon_set(struct phy_device *phydev, int reg, long value) ++{ ++ int temp; ++ ++ if (value >= 128000 || value < -128000) ++ return -ERANGE; ++ ++ temp = value * 256 / 1000; ++ ++ /* temp is in s16 range and we're interested in lower 16 bits only */ ++ return phy_write_mmd(phydev, MDIO_MMD_VEND1, reg, (u16)temp); ++} ++ ++static int aqr_hwmon_test_bit(struct phy_device *phydev, int reg, int bit) ++{ ++ int val = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); ++ ++ if (val < 0) ++ return val; ++ ++ return !!(val & bit); ++} ++ ++static int aqr_hwmon_status1(struct phy_device *phydev, int bit, long *value) ++{ ++ int val = aqr_hwmon_test_bit(phydev, VEND1_GENERAL_STAT1, bit); ++ ++ if (val < 0) ++ return val; ++ ++ *value = val; ++ ++ return 0; ++} ++ ++static int aqr_hwmon_read(struct device *dev, enum hwmon_sensor_types type, ++ u32 attr, int channel, long *value) ++{ ++ struct phy_device *phydev = dev_get_drvdata(dev); ++ int reg; ++ ++ if (type != hwmon_temp) ++ return -EOPNOTSUPP; ++ ++ switch (attr) { ++ case hwmon_temp_input: ++ reg = aqr_hwmon_test_bit(phydev, VEND1_THERMAL_STAT2, ++ VEND1_THERMAL_STAT2_VALID); ++ if (reg < 0) ++ return reg; ++ if (!reg) ++ return -EBUSY; ++ ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_STAT1, value); ++ ++ case hwmon_temp_lcrit: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, ++ value); ++ case hwmon_temp_min: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, ++ value); ++ case hwmon_temp_max: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, ++ value); ++ case hwmon_temp_crit: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, ++ value); ++ case hwmon_temp_lcrit_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_LOW_TEMP_FAIL, ++ value); ++ case hwmon_temp_min_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_LOW_TEMP_WARN, ++ value); ++ case hwmon_temp_max_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_HIGH_TEMP_WARN, ++ value); ++ case hwmon_temp_crit_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL, ++ value); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++static int aqr_hwmon_write(struct device *dev, enum hwmon_sensor_types type, ++ u32 attr, int channel, long value) ++{ ++ struct phy_device *phydev = dev_get_drvdata(dev); ++ ++ if (type != hwmon_temp) ++ return -EOPNOTSUPP; ++ ++ switch (attr) { ++ case hwmon_temp_lcrit: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, ++ value); ++ case hwmon_temp_min: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, ++ value); ++ case hwmon_temp_max: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, ++ value); ++ case hwmon_temp_crit: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, ++ value); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++static const struct hwmon_ops aqr_hwmon_ops = { ++ .is_visible = aqr_hwmon_is_visible, ++ .read = aqr_hwmon_read, ++ .write = aqr_hwmon_write, ++}; ++ ++static u32 aqr_hwmon_chip_config[] = { ++ HWMON_C_REGISTER_TZ, ++ 0, ++}; ++ ++static const struct hwmon_channel_info aqr_hwmon_chip = { ++ .type = hwmon_chip, ++ .config = aqr_hwmon_chip_config, ++}; ++ ++static u32 aqr_hwmon_temp_config[] = { ++ HWMON_T_INPUT | ++ HWMON_T_MAX | HWMON_T_MIN | ++ HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | ++ HWMON_T_CRIT | HWMON_T_LCRIT | ++ HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM, ++ 0, ++}; ++ ++static const struct hwmon_channel_info aqr_hwmon_temp = { ++ .type = hwmon_temp, ++ .config = aqr_hwmon_temp_config, ++}; ++ ++static const struct hwmon_channel_info *aqr_hwmon_info[] = { ++ &aqr_hwmon_chip, ++ &aqr_hwmon_temp, ++ NULL, ++}; ++ ++static const struct hwmon_chip_info aqr_hwmon_chip_info = { ++ .ops = &aqr_hwmon_ops, ++ .info = aqr_hwmon_info, ++}; ++ ++int aqr_hwmon_probe(struct phy_device *phydev) ++{ ++ struct device *dev = &phydev->mdio.dev; ++ struct device *hwmon_dev; ++ char *hwmon_name; ++ int i, j; ++ ++ hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); ++ if (!hwmon_name) ++ return -ENOMEM; ++ ++ for (i = j = 0; hwmon_name[i]; i++) { ++ if (isalnum(hwmon_name[i])) { ++ if (i != j) ++ hwmon_name[j] = hwmon_name[i]; ++ j++; ++ } ++ } ++ hwmon_name[j] = '\0'; ++ ++ hwmon_dev = devm_hwmon_device_register_with_info(dev, hwmon_name, ++ phydev, &aqr_hwmon_chip_info, NULL); ++ ++ return PTR_ERR_OR_ZERO(hwmon_dev); ++} ++ ++#endif +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -0,0 +1,842 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Driver for Aquantia PHY ++ * ++ * Author: Shaohui Xie ++ * ++ * Copyright 2015 Freescale Semiconductor, Inc. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "aquantia.h" ++ ++#define PHY_ID_AQ1202 0x03a1b445 ++#define PHY_ID_AQ2104 0x03a1b460 ++#define PHY_ID_AQR105 0x03a1b4a2 ++#define PHY_ID_AQR106 0x03a1b4d0 ++#define PHY_ID_AQR107 0x03a1b4e0 ++#define PHY_ID_AQCS109 0x03a1b5c2 ++#define PHY_ID_AQR405 0x03a1b4b0 ++#define PHY_ID_AQR113C 0x31c31c12 ++ ++#define MDIO_PHYXS_VEND_IF_STATUS 0xe812 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR 0 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX 1 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI 2 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII 3 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI 4 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII 6 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI 7 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII 10 ++ ++#define MDIO_AN_VEND_PROV 0xc400 ++#define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15) ++#define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14) ++#define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11) ++#define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10) ++#define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4) ++#define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0) ++#define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4 ++ ++#define MDIO_AN_TX_VEND_STATUS1 0xc800 ++#define MDIO_AN_TX_VEND_STATUS1_RATE_MASK GENMASK(3, 1) ++#define MDIO_AN_TX_VEND_STATUS1_10BASET 0 ++#define MDIO_AN_TX_VEND_STATUS1_100BASETX 1 ++#define MDIO_AN_TX_VEND_STATUS1_1000BASET 2 ++#define MDIO_AN_TX_VEND_STATUS1_10GBASET 3 ++#define MDIO_AN_TX_VEND_STATUS1_2500BASET 4 ++#define MDIO_AN_TX_VEND_STATUS1_5000BASET 5 ++#define MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX BIT(0) ++ ++#define MDIO_AN_TX_VEND_INT_STATUS1 0xcc00 ++#define MDIO_AN_TX_VEND_INT_STATUS1_DOWNSHIFT BIT(1) ++ ++#define MDIO_AN_TX_VEND_INT_STATUS2 0xcc01 ++#define MDIO_AN_TX_VEND_INT_STATUS2_MASK BIT(0) ++ ++#define MDIO_AN_TX_VEND_INT_MASK2 0xd401 ++#define MDIO_AN_TX_VEND_INT_MASK2_LINK BIT(0) ++ ++#define MDIO_AN_RX_LP_STAT1 0xe820 ++#define MDIO_AN_RX_LP_STAT1_1000BASET_FULL BIT(15) ++#define MDIO_AN_RX_LP_STAT1_1000BASET_HALF BIT(14) ++#define MDIO_AN_RX_LP_STAT1_SHORT_REACH BIT(13) ++#define MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT BIT(12) ++#define MDIO_AN_RX_LP_STAT1_AQ_PHY BIT(2) ++ ++#define MDIO_AN_RX_LP_STAT4 0xe823 ++#define MDIO_AN_RX_LP_STAT4_FW_MAJOR GENMASK(15, 8) ++#define MDIO_AN_RX_LP_STAT4_FW_MINOR GENMASK(7, 0) ++ ++#define MDIO_AN_RX_VEND_STAT3 0xe832 ++#define MDIO_AN_RX_VEND_STAT3_AFR BIT(0) ++ ++/* MDIO_MMD_C22EXT */ ++#define MDIO_C22EXT_STAT_SGMII_RX_GOOD_FRAMES 0xd292 ++#define MDIO_C22EXT_STAT_SGMII_RX_BAD_FRAMES 0xd294 ++#define MDIO_C22EXT_STAT_SGMII_RX_FALSE_CARRIER 0xd297 ++#define MDIO_C22EXT_STAT_SGMII_TX_GOOD_FRAMES 0xd313 ++#define MDIO_C22EXT_STAT_SGMII_TX_BAD_FRAMES 0xd315 ++#define MDIO_C22EXT_STAT_SGMII_TX_FALSE_CARRIER 0xd317 ++#define MDIO_C22EXT_STAT_SGMII_TX_COLLISIONS 0xd318 ++#define MDIO_C22EXT_STAT_SGMII_TX_LINE_COLLISIONS 0xd319 ++#define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a ++#define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b ++ ++/* Vendor specific 1, MDIO_MMD_VEND1 */ ++#define VEND1_GLOBAL_FW_ID 0x0020 ++#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) ++#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) ++ ++#define VEND1_GLOBAL_GEN_STAT2 0xc831 ++#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) ++ ++/* The following registers all have similar layouts; first the registers... */ ++#define VEND1_GLOBAL_CFG_10M 0x0310 ++#define VEND1_GLOBAL_CFG_100M 0x031b ++#define VEND1_GLOBAL_CFG_1G 0x031c ++#define VEND1_GLOBAL_CFG_2_5G 0x031d ++#define VEND1_GLOBAL_CFG_5G 0x031e ++#define VEND1_GLOBAL_CFG_10G 0x031f ++/* ...and now the fields */ ++#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 ++ ++#define VEND1_GLOBAL_RSVD_STAT1 0xc885 ++#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) ++#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) ++ ++#define VEND1_GLOBAL_RSVD_STAT9 0xc88d ++#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) ++#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 ++ ++#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 ++#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 ++ ++#define VEND1_GLOBAL_INT_STD_MASK 0xff00 ++#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) ++#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) ++#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) ++#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) ++#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) ++#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) ++ ++#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 ++#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) ++#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) ++#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) ++#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) ++#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) ++ ++/* Sleep and timeout for checking if the Processor-Intensive ++ * MDIO operation is finished ++ */ ++#define AQR107_OP_IN_PROG_SLEEP 1000 ++#define AQR107_OP_IN_PROG_TIMEOUT 100000 ++ ++struct aqr107_hw_stat { ++ const char *name; ++ int reg; ++ int size; ++}; ++ ++#define SGMII_STAT(n, r, s) { n, MDIO_C22EXT_STAT_SGMII_ ## r, s } ++static const struct aqr107_hw_stat aqr107_hw_stats[] = { ++ SGMII_STAT("sgmii_rx_good_frames", RX_GOOD_FRAMES, 26), ++ SGMII_STAT("sgmii_rx_bad_frames", RX_BAD_FRAMES, 26), ++ SGMII_STAT("sgmii_rx_false_carrier_events", RX_FALSE_CARRIER, 8), ++ SGMII_STAT("sgmii_tx_good_frames", TX_GOOD_FRAMES, 26), ++ SGMII_STAT("sgmii_tx_bad_frames", TX_BAD_FRAMES, 26), ++ SGMII_STAT("sgmii_tx_false_carrier_events", TX_FALSE_CARRIER, 8), ++ SGMII_STAT("sgmii_tx_collisions", TX_COLLISIONS, 8), ++ SGMII_STAT("sgmii_tx_line_collisions", TX_LINE_COLLISIONS, 8), ++ SGMII_STAT("sgmii_tx_frame_alignment_err", TX_FRAME_ALIGN_ERR, 16), ++ SGMII_STAT("sgmii_tx_runt_frames", TX_RUNT_FRAMES, 22), ++}; ++#define AQR107_SGMII_STAT_SZ ARRAY_SIZE(aqr107_hw_stats) ++ ++struct aqr107_priv { ++ u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; ++}; ++ ++static int aqr107_get_sset_count(struct phy_device *phydev) ++{ ++ return AQR107_SGMII_STAT_SZ; ++} ++ ++static void aqr107_get_strings(struct phy_device *phydev, u8 *data) ++{ ++ int i; ++ ++ for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) ++ strscpy(data + i * ETH_GSTRING_LEN, aqr107_hw_stats[i].name, ++ ETH_GSTRING_LEN); ++} ++ ++static u64 aqr107_get_stat(struct phy_device *phydev, int index) ++{ ++ const struct aqr107_hw_stat *stat = aqr107_hw_stats + index; ++ int len_l = min(stat->size, 16); ++ int len_h = stat->size - len_l; ++ u64 ret; ++ int val; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg); ++ if (val < 0) ++ return U64_MAX; ++ ++ ret = val & GENMASK(len_l - 1, 0); ++ if (len_h) { ++ val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg + 1); ++ if (val < 0) ++ return U64_MAX; ++ ++ ret += (val & GENMASK(len_h - 1, 0)) << 16; ++ } ++ ++ return ret; ++} ++ ++static void aqr107_get_stats(struct phy_device *phydev, ++ struct ethtool_stats *stats, u64 *data) ++{ ++ struct aqr107_priv *priv = phydev->priv; ++ u64 val; ++ int i; ++ ++ for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) { ++ val = aqr107_get_stat(phydev, i); ++ if (val == U64_MAX) ++ phydev_err(phydev, "Reading HW Statistics failed for %s\n", ++ aqr107_hw_stats[i].name); ++ else ++ priv->sgmii_stats[i] += val; ++ ++ data[i] = priv->sgmii_stats[i]; ++ } ++} ++ ++static int aqr_config_aneg(struct phy_device *phydev) ++{ ++ bool changed = false; ++ u16 reg; ++ int ret; ++ ++ if (phydev->autoneg == AUTONEG_DISABLE) ++ return genphy_c45_pma_setup_forced(phydev); ++ ++ ret = genphy_c45_an_config_aneg(phydev); ++ if (ret < 0) ++ return ret; ++ if (ret > 0) ++ changed = true; ++ ++ /* Clause 45 has no standardized support for 1000BaseT, therefore ++ * use vendor registers for this mode. ++ */ ++ reg = 0; ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_1000BASET_FULL; ++ ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_1000BASET_HALF; ++ ++ /* Handle the case when the 2.5G and 5G speeds are not advertised */ ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_2500BASET_FULL; ++ ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_5000BASET_FULL; ++ ++ ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, ++ MDIO_AN_VEND_PROV_1000BASET_HALF | ++ MDIO_AN_VEND_PROV_1000BASET_FULL | ++ MDIO_AN_VEND_PROV_2500BASET_FULL | ++ MDIO_AN_VEND_PROV_5000BASET_FULL, reg); ++ if (ret < 0) ++ return ret; ++ if (ret > 0) ++ changed = true; ++ ++ return genphy_c45_check_and_restart_aneg(phydev, changed); ++} ++ ++static int aqr_config_intr(struct phy_device *phydev) ++{ ++ bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED; ++ int err; ++ ++ if (en) { ++ /* Clear any pending interrupts before enabling them */ ++ err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); ++ if (err < 0) ++ return err; ++ } ++ ++ err = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_MASK2, ++ en ? MDIO_AN_TX_VEND_INT_MASK2_LINK : 0); ++ if (err < 0) ++ return err; ++ ++ err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_STD_MASK, ++ en ? VEND1_GLOBAL_INT_STD_MASK_ALL : 0); ++ if (err < 0) ++ return err; ++ ++ err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_VEND_MASK, ++ en ? VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 | ++ VEND1_GLOBAL_INT_VEND_MASK_AN : 0); ++ if (err < 0) ++ return err; ++ ++ if (!en) { ++ /* Clear any pending interrupts after we have disabled them */ ++ err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); ++ if (err < 0) ++ return err; ++ } ++ ++ return 0; ++} ++ ++static irqreturn_t aqr_handle_interrupt(struct phy_device *phydev) ++{ ++ int irq_status; ++ ++ irq_status = phy_read_mmd(phydev, MDIO_MMD_AN, ++ MDIO_AN_TX_VEND_INT_STATUS2); ++ if (irq_status < 0) { ++ phy_error(phydev); ++ return IRQ_NONE; ++ } ++ ++ if (!(irq_status & MDIO_AN_TX_VEND_INT_STATUS2_MASK)) ++ return IRQ_NONE; ++ ++ phy_trigger_machine(phydev); ++ ++ return IRQ_HANDLED; ++} ++ ++static int aqr_read_status(struct phy_device *phydev) ++{ ++ int val; ++ ++ if (phydev->autoneg == AUTONEG_ENABLE) { ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); ++ if (val < 0) ++ return val; ++ ++ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, ++ phydev->lp_advertising, ++ val & MDIO_AN_RX_LP_STAT1_1000BASET_FULL); ++ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ++ phydev->lp_advertising, ++ val & MDIO_AN_RX_LP_STAT1_1000BASET_HALF); ++ } ++ ++ return genphy_c45_read_status(phydev); ++} ++ ++static int aqr107_read_rate(struct phy_device *phydev) ++{ ++ u32 config_reg; ++ int val; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_STATUS1); ++ if (val < 0) ++ return val; ++ ++ if (val & MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX) ++ phydev->duplex = DUPLEX_FULL; ++ else ++ phydev->duplex = DUPLEX_HALF; ++ ++ switch (FIELD_GET(MDIO_AN_TX_VEND_STATUS1_RATE_MASK, val)) { ++ case MDIO_AN_TX_VEND_STATUS1_10BASET: ++ phydev->speed = SPEED_10; ++ config_reg = VEND1_GLOBAL_CFG_10M; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_100BASETX: ++ phydev->speed = SPEED_100; ++ config_reg = VEND1_GLOBAL_CFG_100M; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_1000BASET: ++ phydev->speed = SPEED_1000; ++ config_reg = VEND1_GLOBAL_CFG_1G; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_2500BASET: ++ phydev->speed = SPEED_2500; ++ config_reg = VEND1_GLOBAL_CFG_2_5G; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_5000BASET: ++ phydev->speed = SPEED_5000; ++ config_reg = VEND1_GLOBAL_CFG_5G; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_10GBASET: ++ phydev->speed = SPEED_10000; ++ config_reg = VEND1_GLOBAL_CFG_10G; ++ break; ++ default: ++ phydev->speed = SPEED_UNKNOWN; ++ return 0; ++ } ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, config_reg); ++ if (val < 0) ++ return val; ++ ++ if (FIELD_GET(VEND1_GLOBAL_CFG_RATE_ADAPT, val) == ++ VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE) ++ phydev->rate_matching = RATE_MATCH_PAUSE; ++ else ++ phydev->rate_matching = RATE_MATCH_NONE; ++ ++ return 0; ++} ++ ++static int aqr107_read_status(struct phy_device *phydev) ++{ ++ int val, ret; ++ ++ ret = aqr_read_status(phydev); ++ if (ret) ++ return ret; ++ ++ if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE) ++ return 0; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_VEND_IF_STATUS); ++ if (val < 0) ++ return val; ++ ++ switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK, val)) { ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR: ++ phydev->interface = PHY_INTERFACE_MODE_10GKR; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX: ++ phydev->interface = PHY_INTERFACE_MODE_1000BASEKX; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI: ++ phydev->interface = PHY_INTERFACE_MODE_10GBASER; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII: ++ phydev->interface = PHY_INTERFACE_MODE_USXGMII; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI: ++ phydev->interface = PHY_INTERFACE_MODE_XAUI; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII: ++ phydev->interface = PHY_INTERFACE_MODE_SGMII; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI: ++ phydev->interface = PHY_INTERFACE_MODE_RXAUI; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII: ++ phydev->interface = PHY_INTERFACE_MODE_2500BASEX; ++ break; ++ default: ++ phydev->interface = PHY_INTERFACE_MODE_NA; ++ break; ++ } ++ ++ /* Read possibly downshifted rate from vendor register */ ++ return aqr107_read_rate(phydev); ++} ++ ++static int aqr107_get_downshift(struct phy_device *phydev, u8 *data) ++{ ++ int val, cnt, enable; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV); ++ if (val < 0) ++ return val; ++ ++ enable = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_EN, val); ++ cnt = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); ++ ++ *data = enable && cnt ? cnt : DOWNSHIFT_DEV_DISABLE; ++ ++ return 0; ++} ++ ++static int aqr107_set_downshift(struct phy_device *phydev, u8 cnt) ++{ ++ int val = 0; ++ ++ if (!FIELD_FIT(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt)) ++ return -E2BIG; ++ ++ if (cnt != DOWNSHIFT_DEV_DISABLE) { ++ val = MDIO_AN_VEND_PROV_DOWNSHIFT_EN; ++ val |= FIELD_PREP(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt); ++ } ++ ++ return phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, ++ MDIO_AN_VEND_PROV_DOWNSHIFT_EN | ++ MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); ++} ++ ++static int aqr107_get_tunable(struct phy_device *phydev, ++ struct ethtool_tunable *tuna, void *data) ++{ ++ switch (tuna->id) { ++ case ETHTOOL_PHY_DOWNSHIFT: ++ return aqr107_get_downshift(phydev, data); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++static int aqr107_set_tunable(struct phy_device *phydev, ++ struct ethtool_tunable *tuna, const void *data) ++{ ++ switch (tuna->id) { ++ case ETHTOOL_PHY_DOWNSHIFT: ++ return aqr107_set_downshift(phydev, *(const u8 *)data); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++/* If we configure settings whilst firmware is still initializing the chip, ++ * then these settings may be overwritten. Therefore make sure chip ++ * initialization has completed. Use presence of the firmware ID as ++ * indicator for initialization having completed. ++ * The chip also provides a "reset completed" bit, but it's cleared after ++ * read. Therefore function would time out if called again. ++ */ ++static int aqr107_wait_reset_complete(struct phy_device *phydev) ++{ ++ int val; ++ ++ return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_FW_ID, val, val != 0, ++ 20000, 2000000, false); ++} ++ ++static void aqr107_chip_info(struct phy_device *phydev) ++{ ++ u8 fw_major, fw_minor, build_id, prov_id; ++ int val; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID); ++ if (val < 0) ++ return; ++ ++ fw_major = FIELD_GET(VEND1_GLOBAL_FW_ID_MAJOR, val); ++ fw_minor = FIELD_GET(VEND1_GLOBAL_FW_ID_MINOR, val); ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT1); ++ if (val < 0) ++ return; ++ ++ build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val); ++ prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val); ++ ++ phydev_dbg(phydev, "FW %u.%u, Build %u, Provisioning %u\n", ++ fw_major, fw_minor, build_id, prov_id); ++} ++ ++static int aqr107_config_init(struct phy_device *phydev) ++{ ++ int ret; ++ ++ /* Check that the PHY interface type is compatible */ ++ if (phydev->interface != PHY_INTERFACE_MODE_SGMII && ++ phydev->interface != PHY_INTERFACE_MODE_1000BASEKX && ++ phydev->interface != PHY_INTERFACE_MODE_2500BASEX && ++ phydev->interface != PHY_INTERFACE_MODE_XGMII && ++ phydev->interface != PHY_INTERFACE_MODE_USXGMII && ++ phydev->interface != PHY_INTERFACE_MODE_10GKR && ++ phydev->interface != PHY_INTERFACE_MODE_10GBASER && ++ phydev->interface != PHY_INTERFACE_MODE_XAUI && ++ phydev->interface != PHY_INTERFACE_MODE_RXAUI) ++ return -ENODEV; ++ ++ WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII, ++ "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n"); ++ ++ ret = aqr107_wait_reset_complete(phydev); ++ if (!ret) ++ aqr107_chip_info(phydev); ++ ++ return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); ++} ++ ++static int aqcs109_config_init(struct phy_device *phydev) ++{ ++ int ret; ++ ++ /* Check that the PHY interface type is compatible */ ++ if (phydev->interface != PHY_INTERFACE_MODE_SGMII && ++ phydev->interface != PHY_INTERFACE_MODE_2500BASEX) ++ return -ENODEV; ++ ++ ret = aqr107_wait_reset_complete(phydev); ++ if (!ret) ++ aqr107_chip_info(phydev); ++ ++ /* AQCS109 belongs to a chip family partially supporting 10G and 5G. ++ * PMA speed ability bits are the same for all members of the family, ++ * AQCS109 however supports speeds up to 2.5G only. ++ */ ++ phy_set_max_speed(phydev, SPEED_2500); ++ ++ return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); ++} ++ ++static void aqr107_link_change_notify(struct phy_device *phydev) ++{ ++ u8 fw_major, fw_minor; ++ bool downshift, short_reach, afr; ++ int mode, val; ++ ++ if (phydev->state != PHY_RUNNING || phydev->autoneg == AUTONEG_DISABLE) ++ return; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); ++ /* call failed or link partner is no Aquantia PHY */ ++ if (val < 0 || !(val & MDIO_AN_RX_LP_STAT1_AQ_PHY)) ++ return; ++ ++ short_reach = val & MDIO_AN_RX_LP_STAT1_SHORT_REACH; ++ downshift = val & MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT4); ++ if (val < 0) ++ return; ++ ++ fw_major = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MAJOR, val); ++ fw_minor = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MINOR, val); ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_VEND_STAT3); ++ if (val < 0) ++ return; ++ ++ afr = val & MDIO_AN_RX_VEND_STAT3_AFR; ++ ++ phydev_dbg(phydev, "Link partner is Aquantia PHY, FW %u.%u%s%s%s\n", ++ fw_major, fw_minor, ++ short_reach ? ", short reach mode" : "", ++ downshift ? ", fast-retrain downshift advertised" : "", ++ afr ? ", fast reframe advertised" : ""); ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT9); ++ if (val < 0) ++ return; ++ ++ mode = FIELD_GET(VEND1_GLOBAL_RSVD_STAT9_MODE, val); ++ if (mode == VEND1_GLOBAL_RSVD_STAT9_1000BT2) ++ phydev_info(phydev, "Aquantia 1000Base-T2 mode active\n"); ++} ++ ++static int aqr107_wait_processor_intensive_op(struct phy_device *phydev) ++{ ++ int val, err; ++ ++ /* The datasheet notes to wait at least 1ms after issuing a ++ * processor intensive operation before checking. ++ * We cannot use the 'sleep_before_read' parameter of read_poll_timeout ++ * because that just determines the maximum time slept, not the minimum. ++ */ ++ usleep_range(1000, 5000); ++ ++ err = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_GEN_STAT2, val, ++ !(val & VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG), ++ AQR107_OP_IN_PROG_SLEEP, ++ AQR107_OP_IN_PROG_TIMEOUT, false); ++ if (err) { ++ phydev_err(phydev, "timeout: processor-intensive MDIO operation\n"); ++ return err; ++ } ++ ++ return 0; ++} ++ ++static int aqr107_get_rate_matching(struct phy_device *phydev, ++ phy_interface_t iface) ++{ ++ if (iface == PHY_INTERFACE_MODE_10GBASER || ++ iface == PHY_INTERFACE_MODE_2500BASEX || ++ iface == PHY_INTERFACE_MODE_NA) ++ return RATE_MATCH_PAUSE; ++ return RATE_MATCH_NONE; ++} ++ ++static int aqr107_suspend(struct phy_device *phydev) ++{ ++ int err; ++ ++ err = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, ++ MDIO_CTRL1_LPOWER); ++ if (err) ++ return err; ++ ++ return aqr107_wait_processor_intensive_op(phydev); ++} ++ ++static int aqr107_resume(struct phy_device *phydev) ++{ ++ int err; ++ ++ err = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, ++ MDIO_CTRL1_LPOWER); ++ if (err) ++ return err; ++ ++ return aqr107_wait_processor_intensive_op(phydev); ++} ++ ++static int aqr107_probe(struct phy_device *phydev) ++{ ++ phydev->priv = devm_kzalloc(&phydev->mdio.dev, ++ sizeof(struct aqr107_priv), GFP_KERNEL); ++ if (!phydev->priv) ++ return -ENOMEM; ++ ++ return aqr_hwmon_probe(phydev); ++} ++ ++static struct phy_driver aqr_driver[] = { ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQ1202), ++ .name = "Aquantia AQ1202", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQ2104), ++ .name = "Aquantia AQ2104", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR105), ++ .name = "Aquantia AQR105", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR106), ++ .name = "Aquantia AQR106", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR107), ++ .name = "Aquantia AQR107", ++ .probe = aqr107_probe, ++ .get_rate_matching = aqr107_get_rate_matching, ++ .config_init = aqr107_config_init, ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr107_read_status, ++ .get_tunable = aqr107_get_tunable, ++ .set_tunable = aqr107_set_tunable, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++ .get_sset_count = aqr107_get_sset_count, ++ .get_strings = aqr107_get_strings, ++ .get_stats = aqr107_get_stats, ++ .link_change_notify = aqr107_link_change_notify, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQCS109), ++ .name = "Aquantia AQCS109", ++ .probe = aqr107_probe, ++ .get_rate_matching = aqr107_get_rate_matching, ++ .config_init = aqcs109_config_init, ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr107_read_status, ++ .get_tunable = aqr107_get_tunable, ++ .set_tunable = aqr107_set_tunable, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++ .get_sset_count = aqr107_get_sset_count, ++ .get_strings = aqr107_get_strings, ++ .get_stats = aqr107_get_stats, ++ .link_change_notify = aqr107_link_change_notify, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR405), ++ .name = "Aquantia AQR405", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C), ++ .name = "Aquantia AQR113C", ++ .probe = aqr107_probe, ++ .get_rate_matching = aqr107_get_rate_matching, ++ .config_init = aqr107_config_init, ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr107_read_status, ++ .get_tunable = aqr107_get_tunable, ++ .set_tunable = aqr107_set_tunable, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++ .get_sset_count = aqr107_get_sset_count, ++ .get_strings = aqr107_get_strings, ++ .get_stats = aqr107_get_stats, ++ .link_change_notify = aqr107_link_change_notify, ++}, ++}; ++ ++module_phy_driver(aqr_driver); ++ ++static struct mdio_device_id __maybe_unused aqr_tbl[] = { ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQ1202) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQ2104) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR105) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR106) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, ++ { } ++}; ++ ++MODULE_DEVICE_TABLE(mdio, aqr_tbl); ++ ++MODULE_DESCRIPTION("Aquantia PHY driver"); ++MODULE_AUTHOR("Shaohui Xie "); ++MODULE_LICENSE("GPL v2"); +--- a/drivers/net/phy/aquantia_hwmon.c ++++ /dev/null +@@ -1,250 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-/* HWMON driver for Aquantia PHY +- * +- * Author: Nikita Yushchenko +- * Author: Andrew Lunn +- * Author: Heiner Kallweit +- */ +- +-#include +-#include +-#include +-#include +- +-#include "aquantia.h" +- +-/* Vendor specific 1, MDIO_MMD_VEND2 */ +-#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 +-#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 +-#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 +-#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 +-#define VEND1_THERMAL_STAT1 0xc820 +-#define VEND1_THERMAL_STAT2 0xc821 +-#define VEND1_THERMAL_STAT2_VALID BIT(0) +-#define VEND1_GENERAL_STAT1 0xc830 +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) +- +-#if IS_REACHABLE(CONFIG_HWMON) +- +-static umode_t aqr_hwmon_is_visible(const void *data, +- enum hwmon_sensor_types type, +- u32 attr, int channel) +-{ +- if (type != hwmon_temp) +- return 0; +- +- switch (attr) { +- case hwmon_temp_input: +- case hwmon_temp_min_alarm: +- case hwmon_temp_max_alarm: +- case hwmon_temp_lcrit_alarm: +- case hwmon_temp_crit_alarm: +- return 0444; +- case hwmon_temp_min: +- case hwmon_temp_max: +- case hwmon_temp_lcrit: +- case hwmon_temp_crit: +- return 0644; +- default: +- return 0; +- } +-} +- +-static int aqr_hwmon_get(struct phy_device *phydev, int reg, long *value) +-{ +- int temp = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); +- +- if (temp < 0) +- return temp; +- +- /* 16 bit value is 2's complement with LSB = 1/256th degree Celsius */ +- *value = (s16)temp * 1000 / 256; +- +- return 0; +-} +- +-static int aqr_hwmon_set(struct phy_device *phydev, int reg, long value) +-{ +- int temp; +- +- if (value >= 128000 || value < -128000) +- return -ERANGE; +- +- temp = value * 256 / 1000; +- +- /* temp is in s16 range and we're interested in lower 16 bits only */ +- return phy_write_mmd(phydev, MDIO_MMD_VEND1, reg, (u16)temp); +-} +- +-static int aqr_hwmon_test_bit(struct phy_device *phydev, int reg, int bit) +-{ +- int val = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); +- +- if (val < 0) +- return val; +- +- return !!(val & bit); +-} +- +-static int aqr_hwmon_status1(struct phy_device *phydev, int bit, long *value) +-{ +- int val = aqr_hwmon_test_bit(phydev, VEND1_GENERAL_STAT1, bit); +- +- if (val < 0) +- return val; +- +- *value = val; +- +- return 0; +-} +- +-static int aqr_hwmon_read(struct device *dev, enum hwmon_sensor_types type, +- u32 attr, int channel, long *value) +-{ +- struct phy_device *phydev = dev_get_drvdata(dev); +- int reg; +- +- if (type != hwmon_temp) +- return -EOPNOTSUPP; +- +- switch (attr) { +- case hwmon_temp_input: +- reg = aqr_hwmon_test_bit(phydev, VEND1_THERMAL_STAT2, +- VEND1_THERMAL_STAT2_VALID); +- if (reg < 0) +- return reg; +- if (!reg) +- return -EBUSY; +- +- return aqr_hwmon_get(phydev, VEND1_THERMAL_STAT1, value); +- +- case hwmon_temp_lcrit: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, +- value); +- case hwmon_temp_min: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, +- value); +- case hwmon_temp_max: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, +- value); +- case hwmon_temp_crit: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, +- value); +- case hwmon_temp_lcrit_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_LOW_TEMP_FAIL, +- value); +- case hwmon_temp_min_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_LOW_TEMP_WARN, +- value); +- case hwmon_temp_max_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_HIGH_TEMP_WARN, +- value); +- case hwmon_temp_crit_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL, +- value); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-static int aqr_hwmon_write(struct device *dev, enum hwmon_sensor_types type, +- u32 attr, int channel, long value) +-{ +- struct phy_device *phydev = dev_get_drvdata(dev); +- +- if (type != hwmon_temp) +- return -EOPNOTSUPP; +- +- switch (attr) { +- case hwmon_temp_lcrit: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, +- value); +- case hwmon_temp_min: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, +- value); +- case hwmon_temp_max: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, +- value); +- case hwmon_temp_crit: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, +- value); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-static const struct hwmon_ops aqr_hwmon_ops = { +- .is_visible = aqr_hwmon_is_visible, +- .read = aqr_hwmon_read, +- .write = aqr_hwmon_write, +-}; +- +-static u32 aqr_hwmon_chip_config[] = { +- HWMON_C_REGISTER_TZ, +- 0, +-}; +- +-static const struct hwmon_channel_info aqr_hwmon_chip = { +- .type = hwmon_chip, +- .config = aqr_hwmon_chip_config, +-}; +- +-static u32 aqr_hwmon_temp_config[] = { +- HWMON_T_INPUT | +- HWMON_T_MAX | HWMON_T_MIN | +- HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | +- HWMON_T_CRIT | HWMON_T_LCRIT | +- HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM, +- 0, +-}; +- +-static const struct hwmon_channel_info aqr_hwmon_temp = { +- .type = hwmon_temp, +- .config = aqr_hwmon_temp_config, +-}; +- +-static const struct hwmon_channel_info *aqr_hwmon_info[] = { +- &aqr_hwmon_chip, +- &aqr_hwmon_temp, +- NULL, +-}; +- +-static const struct hwmon_chip_info aqr_hwmon_chip_info = { +- .ops = &aqr_hwmon_ops, +- .info = aqr_hwmon_info, +-}; +- +-int aqr_hwmon_probe(struct phy_device *phydev) +-{ +- struct device *dev = &phydev->mdio.dev; +- struct device *hwmon_dev; +- char *hwmon_name; +- int i, j; +- +- hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); +- if (!hwmon_name) +- return -ENOMEM; +- +- for (i = j = 0; hwmon_name[i]; i++) { +- if (isalnum(hwmon_name[i])) { +- if (i != j) +- hwmon_name[j] = hwmon_name[i]; +- j++; +- } +- } +- hwmon_name[j] = '\0'; +- +- hwmon_dev = devm_hwmon_device_register_with_info(dev, hwmon_name, +- phydev, &aqr_hwmon_chip_info, NULL); +- +- return PTR_ERR_OR_ZERO(hwmon_dev); +-} +- +-#endif +--- a/drivers/net/phy/aquantia_main.c ++++ /dev/null +@@ -1,842 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-/* +- * Driver for Aquantia PHY +- * +- * Author: Shaohui Xie +- * +- * Copyright 2015 Freescale Semiconductor, Inc. +- */ +- +-#include +-#include +-#include +-#include +-#include +- +-#include "aquantia.h" +- +-#define PHY_ID_AQ1202 0x03a1b445 +-#define PHY_ID_AQ2104 0x03a1b460 +-#define PHY_ID_AQR105 0x03a1b4a2 +-#define PHY_ID_AQR106 0x03a1b4d0 +-#define PHY_ID_AQR107 0x03a1b4e0 +-#define PHY_ID_AQCS109 0x03a1b5c2 +-#define PHY_ID_AQR405 0x03a1b4b0 +-#define PHY_ID_AQR113C 0x31c31c12 +- +-#define MDIO_PHYXS_VEND_IF_STATUS 0xe812 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR 0 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX 1 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI 2 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII 3 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI 4 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII 6 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI 7 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII 10 +- +-#define MDIO_AN_VEND_PROV 0xc400 +-#define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15) +-#define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14) +-#define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11) +-#define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10) +-#define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4) +-#define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0) +-#define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4 +- +-#define MDIO_AN_TX_VEND_STATUS1 0xc800 +-#define MDIO_AN_TX_VEND_STATUS1_RATE_MASK GENMASK(3, 1) +-#define MDIO_AN_TX_VEND_STATUS1_10BASET 0 +-#define MDIO_AN_TX_VEND_STATUS1_100BASETX 1 +-#define MDIO_AN_TX_VEND_STATUS1_1000BASET 2 +-#define MDIO_AN_TX_VEND_STATUS1_10GBASET 3 +-#define MDIO_AN_TX_VEND_STATUS1_2500BASET 4 +-#define MDIO_AN_TX_VEND_STATUS1_5000BASET 5 +-#define MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX BIT(0) +- +-#define MDIO_AN_TX_VEND_INT_STATUS1 0xcc00 +-#define MDIO_AN_TX_VEND_INT_STATUS1_DOWNSHIFT BIT(1) +- +-#define MDIO_AN_TX_VEND_INT_STATUS2 0xcc01 +-#define MDIO_AN_TX_VEND_INT_STATUS2_MASK BIT(0) +- +-#define MDIO_AN_TX_VEND_INT_MASK2 0xd401 +-#define MDIO_AN_TX_VEND_INT_MASK2_LINK BIT(0) +- +-#define MDIO_AN_RX_LP_STAT1 0xe820 +-#define MDIO_AN_RX_LP_STAT1_1000BASET_FULL BIT(15) +-#define MDIO_AN_RX_LP_STAT1_1000BASET_HALF BIT(14) +-#define MDIO_AN_RX_LP_STAT1_SHORT_REACH BIT(13) +-#define MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT BIT(12) +-#define MDIO_AN_RX_LP_STAT1_AQ_PHY BIT(2) +- +-#define MDIO_AN_RX_LP_STAT4 0xe823 +-#define MDIO_AN_RX_LP_STAT4_FW_MAJOR GENMASK(15, 8) +-#define MDIO_AN_RX_LP_STAT4_FW_MINOR GENMASK(7, 0) +- +-#define MDIO_AN_RX_VEND_STAT3 0xe832 +-#define MDIO_AN_RX_VEND_STAT3_AFR BIT(0) +- +-/* MDIO_MMD_C22EXT */ +-#define MDIO_C22EXT_STAT_SGMII_RX_GOOD_FRAMES 0xd292 +-#define MDIO_C22EXT_STAT_SGMII_RX_BAD_FRAMES 0xd294 +-#define MDIO_C22EXT_STAT_SGMII_RX_FALSE_CARRIER 0xd297 +-#define MDIO_C22EXT_STAT_SGMII_TX_GOOD_FRAMES 0xd313 +-#define MDIO_C22EXT_STAT_SGMII_TX_BAD_FRAMES 0xd315 +-#define MDIO_C22EXT_STAT_SGMII_TX_FALSE_CARRIER 0xd317 +-#define MDIO_C22EXT_STAT_SGMII_TX_COLLISIONS 0xd318 +-#define MDIO_C22EXT_STAT_SGMII_TX_LINE_COLLISIONS 0xd319 +-#define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a +-#define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b +- +-/* Vendor specific 1, MDIO_MMD_VEND1 */ +-#define VEND1_GLOBAL_FW_ID 0x0020 +-#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) +-#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) +- +-#define VEND1_GLOBAL_GEN_STAT2 0xc831 +-#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) +- +-/* The following registers all have similar layouts; first the registers... */ +-#define VEND1_GLOBAL_CFG_10M 0x0310 +-#define VEND1_GLOBAL_CFG_100M 0x031b +-#define VEND1_GLOBAL_CFG_1G 0x031c +-#define VEND1_GLOBAL_CFG_2_5G 0x031d +-#define VEND1_GLOBAL_CFG_5G 0x031e +-#define VEND1_GLOBAL_CFG_10G 0x031f +-/* ...and now the fields */ +-#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 +- +-#define VEND1_GLOBAL_RSVD_STAT1 0xc885 +-#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) +-#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) +- +-#define VEND1_GLOBAL_RSVD_STAT9 0xc88d +-#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) +-#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 +- +-#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 +-#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 +- +-#define VEND1_GLOBAL_INT_STD_MASK 0xff00 +-#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) +-#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) +-#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) +-#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) +-#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) +-#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) +- +-#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 +-#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) +-#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) +-#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) +-#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) +-#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) +- +-/* Sleep and timeout for checking if the Processor-Intensive +- * MDIO operation is finished +- */ +-#define AQR107_OP_IN_PROG_SLEEP 1000 +-#define AQR107_OP_IN_PROG_TIMEOUT 100000 +- +-struct aqr107_hw_stat { +- const char *name; +- int reg; +- int size; +-}; +- +-#define SGMII_STAT(n, r, s) { n, MDIO_C22EXT_STAT_SGMII_ ## r, s } +-static const struct aqr107_hw_stat aqr107_hw_stats[] = { +- SGMII_STAT("sgmii_rx_good_frames", RX_GOOD_FRAMES, 26), +- SGMII_STAT("sgmii_rx_bad_frames", RX_BAD_FRAMES, 26), +- SGMII_STAT("sgmii_rx_false_carrier_events", RX_FALSE_CARRIER, 8), +- SGMII_STAT("sgmii_tx_good_frames", TX_GOOD_FRAMES, 26), +- SGMII_STAT("sgmii_tx_bad_frames", TX_BAD_FRAMES, 26), +- SGMII_STAT("sgmii_tx_false_carrier_events", TX_FALSE_CARRIER, 8), +- SGMII_STAT("sgmii_tx_collisions", TX_COLLISIONS, 8), +- SGMII_STAT("sgmii_tx_line_collisions", TX_LINE_COLLISIONS, 8), +- SGMII_STAT("sgmii_tx_frame_alignment_err", TX_FRAME_ALIGN_ERR, 16), +- SGMII_STAT("sgmii_tx_runt_frames", TX_RUNT_FRAMES, 22), +-}; +-#define AQR107_SGMII_STAT_SZ ARRAY_SIZE(aqr107_hw_stats) +- +-struct aqr107_priv { +- u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; +-}; +- +-static int aqr107_get_sset_count(struct phy_device *phydev) +-{ +- return AQR107_SGMII_STAT_SZ; +-} +- +-static void aqr107_get_strings(struct phy_device *phydev, u8 *data) +-{ +- int i; +- +- for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) +- strscpy(data + i * ETH_GSTRING_LEN, aqr107_hw_stats[i].name, +- ETH_GSTRING_LEN); +-} +- +-static u64 aqr107_get_stat(struct phy_device *phydev, int index) +-{ +- const struct aqr107_hw_stat *stat = aqr107_hw_stats + index; +- int len_l = min(stat->size, 16); +- int len_h = stat->size - len_l; +- u64 ret; +- int val; +- +- val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg); +- if (val < 0) +- return U64_MAX; +- +- ret = val & GENMASK(len_l - 1, 0); +- if (len_h) { +- val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg + 1); +- if (val < 0) +- return U64_MAX; +- +- ret += (val & GENMASK(len_h - 1, 0)) << 16; +- } +- +- return ret; +-} +- +-static void aqr107_get_stats(struct phy_device *phydev, +- struct ethtool_stats *stats, u64 *data) +-{ +- struct aqr107_priv *priv = phydev->priv; +- u64 val; +- int i; +- +- for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) { +- val = aqr107_get_stat(phydev, i); +- if (val == U64_MAX) +- phydev_err(phydev, "Reading HW Statistics failed for %s\n", +- aqr107_hw_stats[i].name); +- else +- priv->sgmii_stats[i] += val; +- +- data[i] = priv->sgmii_stats[i]; +- } +-} +- +-static int aqr_config_aneg(struct phy_device *phydev) +-{ +- bool changed = false; +- u16 reg; +- int ret; +- +- if (phydev->autoneg == AUTONEG_DISABLE) +- return genphy_c45_pma_setup_forced(phydev); +- +- ret = genphy_c45_an_config_aneg(phydev); +- if (ret < 0) +- return ret; +- if (ret > 0) +- changed = true; +- +- /* Clause 45 has no standardized support for 1000BaseT, therefore +- * use vendor registers for this mode. +- */ +- reg = 0; +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_1000BASET_FULL; +- +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_1000BASET_HALF; +- +- /* Handle the case when the 2.5G and 5G speeds are not advertised */ +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_2500BASET_FULL; +- +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_5000BASET_FULL; +- +- ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, +- MDIO_AN_VEND_PROV_1000BASET_HALF | +- MDIO_AN_VEND_PROV_1000BASET_FULL | +- MDIO_AN_VEND_PROV_2500BASET_FULL | +- MDIO_AN_VEND_PROV_5000BASET_FULL, reg); +- if (ret < 0) +- return ret; +- if (ret > 0) +- changed = true; +- +- return genphy_c45_check_and_restart_aneg(phydev, changed); +-} +- +-static int aqr_config_intr(struct phy_device *phydev) +-{ +- bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED; +- int err; +- +- if (en) { +- /* Clear any pending interrupts before enabling them */ +- err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); +- if (err < 0) +- return err; +- } +- +- err = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_MASK2, +- en ? MDIO_AN_TX_VEND_INT_MASK2_LINK : 0); +- if (err < 0) +- return err; +- +- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_STD_MASK, +- en ? VEND1_GLOBAL_INT_STD_MASK_ALL : 0); +- if (err < 0) +- return err; +- +- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_VEND_MASK, +- en ? VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 | +- VEND1_GLOBAL_INT_VEND_MASK_AN : 0); +- if (err < 0) +- return err; +- +- if (!en) { +- /* Clear any pending interrupts after we have disabled them */ +- err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); +- if (err < 0) +- return err; +- } +- +- return 0; +-} +- +-static irqreturn_t aqr_handle_interrupt(struct phy_device *phydev) +-{ +- int irq_status; +- +- irq_status = phy_read_mmd(phydev, MDIO_MMD_AN, +- MDIO_AN_TX_VEND_INT_STATUS2); +- if (irq_status < 0) { +- phy_error(phydev); +- return IRQ_NONE; +- } +- +- if (!(irq_status & MDIO_AN_TX_VEND_INT_STATUS2_MASK)) +- return IRQ_NONE; +- +- phy_trigger_machine(phydev); +- +- return IRQ_HANDLED; +-} +- +-static int aqr_read_status(struct phy_device *phydev) +-{ +- int val; +- +- if (phydev->autoneg == AUTONEG_ENABLE) { +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); +- if (val < 0) +- return val; +- +- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, +- phydev->lp_advertising, +- val & MDIO_AN_RX_LP_STAT1_1000BASET_FULL); +- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, +- phydev->lp_advertising, +- val & MDIO_AN_RX_LP_STAT1_1000BASET_HALF); +- } +- +- return genphy_c45_read_status(phydev); +-} +- +-static int aqr107_read_rate(struct phy_device *phydev) +-{ +- u32 config_reg; +- int val; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_STATUS1); +- if (val < 0) +- return val; +- +- if (val & MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX) +- phydev->duplex = DUPLEX_FULL; +- else +- phydev->duplex = DUPLEX_HALF; +- +- switch (FIELD_GET(MDIO_AN_TX_VEND_STATUS1_RATE_MASK, val)) { +- case MDIO_AN_TX_VEND_STATUS1_10BASET: +- phydev->speed = SPEED_10; +- config_reg = VEND1_GLOBAL_CFG_10M; +- break; +- case MDIO_AN_TX_VEND_STATUS1_100BASETX: +- phydev->speed = SPEED_100; +- config_reg = VEND1_GLOBAL_CFG_100M; +- break; +- case MDIO_AN_TX_VEND_STATUS1_1000BASET: +- phydev->speed = SPEED_1000; +- config_reg = VEND1_GLOBAL_CFG_1G; +- break; +- case MDIO_AN_TX_VEND_STATUS1_2500BASET: +- phydev->speed = SPEED_2500; +- config_reg = VEND1_GLOBAL_CFG_2_5G; +- break; +- case MDIO_AN_TX_VEND_STATUS1_5000BASET: +- phydev->speed = SPEED_5000; +- config_reg = VEND1_GLOBAL_CFG_5G; +- break; +- case MDIO_AN_TX_VEND_STATUS1_10GBASET: +- phydev->speed = SPEED_10000; +- config_reg = VEND1_GLOBAL_CFG_10G; +- break; +- default: +- phydev->speed = SPEED_UNKNOWN; +- return 0; +- } +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, config_reg); +- if (val < 0) +- return val; +- +- if (FIELD_GET(VEND1_GLOBAL_CFG_RATE_ADAPT, val) == +- VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE) +- phydev->rate_matching = RATE_MATCH_PAUSE; +- else +- phydev->rate_matching = RATE_MATCH_NONE; +- +- return 0; +-} +- +-static int aqr107_read_status(struct phy_device *phydev) +-{ +- int val, ret; +- +- ret = aqr_read_status(phydev); +- if (ret) +- return ret; +- +- if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE) +- return 0; +- +- val = phy_read_mmd(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_VEND_IF_STATUS); +- if (val < 0) +- return val; +- +- switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK, val)) { +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR: +- phydev->interface = PHY_INTERFACE_MODE_10GKR; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX: +- phydev->interface = PHY_INTERFACE_MODE_1000BASEKX; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI: +- phydev->interface = PHY_INTERFACE_MODE_10GBASER; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII: +- phydev->interface = PHY_INTERFACE_MODE_USXGMII; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI: +- phydev->interface = PHY_INTERFACE_MODE_XAUI; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII: +- phydev->interface = PHY_INTERFACE_MODE_SGMII; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI: +- phydev->interface = PHY_INTERFACE_MODE_RXAUI; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII: +- phydev->interface = PHY_INTERFACE_MODE_2500BASEX; +- break; +- default: +- phydev->interface = PHY_INTERFACE_MODE_NA; +- break; +- } +- +- /* Read possibly downshifted rate from vendor register */ +- return aqr107_read_rate(phydev); +-} +- +-static int aqr107_get_downshift(struct phy_device *phydev, u8 *data) +-{ +- int val, cnt, enable; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV); +- if (val < 0) +- return val; +- +- enable = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_EN, val); +- cnt = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); +- +- *data = enable && cnt ? cnt : DOWNSHIFT_DEV_DISABLE; +- +- return 0; +-} +- +-static int aqr107_set_downshift(struct phy_device *phydev, u8 cnt) +-{ +- int val = 0; +- +- if (!FIELD_FIT(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt)) +- return -E2BIG; +- +- if (cnt != DOWNSHIFT_DEV_DISABLE) { +- val = MDIO_AN_VEND_PROV_DOWNSHIFT_EN; +- val |= FIELD_PREP(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt); +- } +- +- return phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, +- MDIO_AN_VEND_PROV_DOWNSHIFT_EN | +- MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); +-} +- +-static int aqr107_get_tunable(struct phy_device *phydev, +- struct ethtool_tunable *tuna, void *data) +-{ +- switch (tuna->id) { +- case ETHTOOL_PHY_DOWNSHIFT: +- return aqr107_get_downshift(phydev, data); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-static int aqr107_set_tunable(struct phy_device *phydev, +- struct ethtool_tunable *tuna, const void *data) +-{ +- switch (tuna->id) { +- case ETHTOOL_PHY_DOWNSHIFT: +- return aqr107_set_downshift(phydev, *(const u8 *)data); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-/* If we configure settings whilst firmware is still initializing the chip, +- * then these settings may be overwritten. Therefore make sure chip +- * initialization has completed. Use presence of the firmware ID as +- * indicator for initialization having completed. +- * The chip also provides a "reset completed" bit, but it's cleared after +- * read. Therefore function would time out if called again. +- */ +-static int aqr107_wait_reset_complete(struct phy_device *phydev) +-{ +- int val; +- +- return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, +- VEND1_GLOBAL_FW_ID, val, val != 0, +- 20000, 2000000, false); +-} +- +-static void aqr107_chip_info(struct phy_device *phydev) +-{ +- u8 fw_major, fw_minor, build_id, prov_id; +- int val; +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID); +- if (val < 0) +- return; +- +- fw_major = FIELD_GET(VEND1_GLOBAL_FW_ID_MAJOR, val); +- fw_minor = FIELD_GET(VEND1_GLOBAL_FW_ID_MINOR, val); +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT1); +- if (val < 0) +- return; +- +- build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val); +- prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val); +- +- phydev_dbg(phydev, "FW %u.%u, Build %u, Provisioning %u\n", +- fw_major, fw_minor, build_id, prov_id); +-} +- +-static int aqr107_config_init(struct phy_device *phydev) +-{ +- int ret; +- +- /* Check that the PHY interface type is compatible */ +- if (phydev->interface != PHY_INTERFACE_MODE_SGMII && +- phydev->interface != PHY_INTERFACE_MODE_1000BASEKX && +- phydev->interface != PHY_INTERFACE_MODE_2500BASEX && +- phydev->interface != PHY_INTERFACE_MODE_XGMII && +- phydev->interface != PHY_INTERFACE_MODE_USXGMII && +- phydev->interface != PHY_INTERFACE_MODE_10GKR && +- phydev->interface != PHY_INTERFACE_MODE_10GBASER && +- phydev->interface != PHY_INTERFACE_MODE_XAUI && +- phydev->interface != PHY_INTERFACE_MODE_RXAUI) +- return -ENODEV; +- +- WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII, +- "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n"); +- +- ret = aqr107_wait_reset_complete(phydev); +- if (!ret) +- aqr107_chip_info(phydev); +- +- return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); +-} +- +-static int aqcs109_config_init(struct phy_device *phydev) +-{ +- int ret; +- +- /* Check that the PHY interface type is compatible */ +- if (phydev->interface != PHY_INTERFACE_MODE_SGMII && +- phydev->interface != PHY_INTERFACE_MODE_2500BASEX) +- return -ENODEV; +- +- ret = aqr107_wait_reset_complete(phydev); +- if (!ret) +- aqr107_chip_info(phydev); +- +- /* AQCS109 belongs to a chip family partially supporting 10G and 5G. +- * PMA speed ability bits are the same for all members of the family, +- * AQCS109 however supports speeds up to 2.5G only. +- */ +- phy_set_max_speed(phydev, SPEED_2500); +- +- return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); +-} +- +-static void aqr107_link_change_notify(struct phy_device *phydev) +-{ +- u8 fw_major, fw_minor; +- bool downshift, short_reach, afr; +- int mode, val; +- +- if (phydev->state != PHY_RUNNING || phydev->autoneg == AUTONEG_DISABLE) +- return; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); +- /* call failed or link partner is no Aquantia PHY */ +- if (val < 0 || !(val & MDIO_AN_RX_LP_STAT1_AQ_PHY)) +- return; +- +- short_reach = val & MDIO_AN_RX_LP_STAT1_SHORT_REACH; +- downshift = val & MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT4); +- if (val < 0) +- return; +- +- fw_major = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MAJOR, val); +- fw_minor = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MINOR, val); +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_VEND_STAT3); +- if (val < 0) +- return; +- +- afr = val & MDIO_AN_RX_VEND_STAT3_AFR; +- +- phydev_dbg(phydev, "Link partner is Aquantia PHY, FW %u.%u%s%s%s\n", +- fw_major, fw_minor, +- short_reach ? ", short reach mode" : "", +- downshift ? ", fast-retrain downshift advertised" : "", +- afr ? ", fast reframe advertised" : ""); +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT9); +- if (val < 0) +- return; +- +- mode = FIELD_GET(VEND1_GLOBAL_RSVD_STAT9_MODE, val); +- if (mode == VEND1_GLOBAL_RSVD_STAT9_1000BT2) +- phydev_info(phydev, "Aquantia 1000Base-T2 mode active\n"); +-} +- +-static int aqr107_wait_processor_intensive_op(struct phy_device *phydev) +-{ +- int val, err; +- +- /* The datasheet notes to wait at least 1ms after issuing a +- * processor intensive operation before checking. +- * We cannot use the 'sleep_before_read' parameter of read_poll_timeout +- * because that just determines the maximum time slept, not the minimum. +- */ +- usleep_range(1000, 5000); +- +- err = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, +- VEND1_GLOBAL_GEN_STAT2, val, +- !(val & VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG), +- AQR107_OP_IN_PROG_SLEEP, +- AQR107_OP_IN_PROG_TIMEOUT, false); +- if (err) { +- phydev_err(phydev, "timeout: processor-intensive MDIO operation\n"); +- return err; +- } +- +- return 0; +-} +- +-static int aqr107_get_rate_matching(struct phy_device *phydev, +- phy_interface_t iface) +-{ +- if (iface == PHY_INTERFACE_MODE_10GBASER || +- iface == PHY_INTERFACE_MODE_2500BASEX || +- iface == PHY_INTERFACE_MODE_NA) +- return RATE_MATCH_PAUSE; +- return RATE_MATCH_NONE; +-} +- +-static int aqr107_suspend(struct phy_device *phydev) +-{ +- int err; +- +- err = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, +- MDIO_CTRL1_LPOWER); +- if (err) +- return err; +- +- return aqr107_wait_processor_intensive_op(phydev); +-} +- +-static int aqr107_resume(struct phy_device *phydev) +-{ +- int err; +- +- err = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, +- MDIO_CTRL1_LPOWER); +- if (err) +- return err; +- +- return aqr107_wait_processor_intensive_op(phydev); +-} +- +-static int aqr107_probe(struct phy_device *phydev) +-{ +- phydev->priv = devm_kzalloc(&phydev->mdio.dev, +- sizeof(struct aqr107_priv), GFP_KERNEL); +- if (!phydev->priv) +- return -ENOMEM; +- +- return aqr_hwmon_probe(phydev); +-} +- +-static struct phy_driver aqr_driver[] = { +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQ1202), +- .name = "Aquantia AQ1202", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQ2104), +- .name = "Aquantia AQ2104", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR105), +- .name = "Aquantia AQR105", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR106), +- .name = "Aquantia AQR106", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR107), +- .name = "Aquantia AQR107", +- .probe = aqr107_probe, +- .get_rate_matching = aqr107_get_rate_matching, +- .config_init = aqr107_config_init, +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr107_read_status, +- .get_tunable = aqr107_get_tunable, +- .set_tunable = aqr107_set_tunable, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +- .get_sset_count = aqr107_get_sset_count, +- .get_strings = aqr107_get_strings, +- .get_stats = aqr107_get_stats, +- .link_change_notify = aqr107_link_change_notify, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQCS109), +- .name = "Aquantia AQCS109", +- .probe = aqr107_probe, +- .get_rate_matching = aqr107_get_rate_matching, +- .config_init = aqcs109_config_init, +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr107_read_status, +- .get_tunable = aqr107_get_tunable, +- .set_tunable = aqr107_set_tunable, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +- .get_sset_count = aqr107_get_sset_count, +- .get_strings = aqr107_get_strings, +- .get_stats = aqr107_get_stats, +- .link_change_notify = aqr107_link_change_notify, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR405), +- .name = "Aquantia AQR405", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR113C), +- .name = "Aquantia AQR113C", +- .probe = aqr107_probe, +- .get_rate_matching = aqr107_get_rate_matching, +- .config_init = aqr107_config_init, +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr107_read_status, +- .get_tunable = aqr107_get_tunable, +- .set_tunable = aqr107_set_tunable, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +- .get_sset_count = aqr107_get_sset_count, +- .get_strings = aqr107_get_strings, +- .get_stats = aqr107_get_stats, +- .link_change_notify = aqr107_link_change_notify, +-}, +-}; +- +-module_phy_driver(aqr_driver); +- +-static struct mdio_device_id __maybe_unused aqr_tbl[] = { +- { PHY_ID_MATCH_MODEL(PHY_ID_AQ1202) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQ2104) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR105) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR106) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, +- { } +-}; +- +-MODULE_DEVICE_TABLE(mdio, aqr_tbl); +- +-MODULE_DESCRIPTION("Aquantia PHY driver"); +-MODULE_AUTHOR("Shaohui Xie "); +-MODULE_LICENSE("GPL v2"); diff --git a/target/linux/generic/backport-6.1/702-02-v6.7-net-phy-aquantia-move-MMD_VEND-define-to-header.patch b/target/linux/generic/backport-6.1/702-02-v6.7-net-phy-aquantia-move-MMD_VEND-define-to-header.patch new file mode 100644 index 00000000000..2b945227237 --- /dev/null +++ b/target/linux/generic/backport-6.1/702-02-v6.7-net-phy-aquantia-move-MMD_VEND-define-to-header.patch @@ -0,0 +1,183 @@ +From e1fbfa4a995d42e02e22b0dff2f8b4fdee1504b3 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 14 Nov 2023 15:08:42 +0100 +Subject: [PATCH 2/3] net: phy: aquantia: move MMD_VEND define to header + +Move MMD_VEND define to header to clean things up and in preparation for +firmware loading support that require some define placed in +aquantia_main. + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/aquantia/aquantia.h | 69 +++++++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_hwmon.c | 14 ----- + drivers/net/phy/aquantia/aquantia_main.c | 55 ------------------ + 3 files changed, 69 insertions(+), 69 deletions(-) + +--- a/drivers/net/phy/aquantia/aquantia.h ++++ b/drivers/net/phy/aquantia/aquantia.h +@@ -9,6 +9,75 @@ + #include + #include + ++/* Vendor specific 1, MDIO_MMD_VEND1 */ ++#define VEND1_GLOBAL_FW_ID 0x0020 ++#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) ++#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) ++ ++/* The following registers all have similar layouts; first the registers... */ ++#define VEND1_GLOBAL_CFG_10M 0x0310 ++#define VEND1_GLOBAL_CFG_100M 0x031b ++#define VEND1_GLOBAL_CFG_1G 0x031c ++#define VEND1_GLOBAL_CFG_2_5G 0x031d ++#define VEND1_GLOBAL_CFG_5G 0x031e ++#define VEND1_GLOBAL_CFG_10G 0x031f ++/* ...and now the fields */ ++#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 ++ ++/* Vendor specific 1, MDIO_MMD_VEND2 */ ++#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 ++#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 ++#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 ++#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 ++#define VEND1_THERMAL_STAT1 0xc820 ++#define VEND1_THERMAL_STAT2 0xc821 ++#define VEND1_THERMAL_STAT2_VALID BIT(0) ++#define VEND1_GENERAL_STAT1 0xc830 ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) ++ ++#define VEND1_GLOBAL_GEN_STAT2 0xc831 ++#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) ++ ++#define VEND1_GLOBAL_RSVD_STAT1 0xc885 ++#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) ++#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) ++ ++#define VEND1_GLOBAL_RSVD_STAT9 0xc88d ++#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) ++#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 ++ ++#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 ++#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 ++ ++#define VEND1_GLOBAL_INT_STD_MASK 0xff00 ++#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) ++#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) ++#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) ++#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) ++#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) ++#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) ++ ++#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 ++#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) ++#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) ++#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) ++#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) ++#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) ++ + #if IS_REACHABLE(CONFIG_HWMON) + int aqr_hwmon_probe(struct phy_device *phydev); + #else +--- a/drivers/net/phy/aquantia/aquantia_hwmon.c ++++ b/drivers/net/phy/aquantia/aquantia_hwmon.c +@@ -13,20 +13,6 @@ + + #include "aquantia.h" + +-/* Vendor specific 1, MDIO_MMD_VEND2 */ +-#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 +-#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 +-#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 +-#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 +-#define VEND1_THERMAL_STAT1 0xc820 +-#define VEND1_THERMAL_STAT2 0xc821 +-#define VEND1_THERMAL_STAT2_VALID BIT(0) +-#define VEND1_GENERAL_STAT1 0xc830 +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) +- + #if IS_REACHABLE(CONFIG_HWMON) + + static umode_t aqr_hwmon_is_visible(const void *data, +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -89,61 +89,6 @@ + #define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a + #define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b + +-/* Vendor specific 1, MDIO_MMD_VEND1 */ +-#define VEND1_GLOBAL_FW_ID 0x0020 +-#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) +-#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) +- +-#define VEND1_GLOBAL_GEN_STAT2 0xc831 +-#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) +- +-/* The following registers all have similar layouts; first the registers... */ +-#define VEND1_GLOBAL_CFG_10M 0x0310 +-#define VEND1_GLOBAL_CFG_100M 0x031b +-#define VEND1_GLOBAL_CFG_1G 0x031c +-#define VEND1_GLOBAL_CFG_2_5G 0x031d +-#define VEND1_GLOBAL_CFG_5G 0x031e +-#define VEND1_GLOBAL_CFG_10G 0x031f +-/* ...and now the fields */ +-#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 +- +-#define VEND1_GLOBAL_RSVD_STAT1 0xc885 +-#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) +-#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) +- +-#define VEND1_GLOBAL_RSVD_STAT9 0xc88d +-#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) +-#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 +- +-#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 +-#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 +- +-#define VEND1_GLOBAL_INT_STD_MASK 0xff00 +-#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) +-#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) +-#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) +-#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) +-#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) +-#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) +- +-#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 +-#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) +-#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) +-#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) +-#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) +-#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) +- + /* Sleep and timeout for checking if the Processor-Intensive + * MDIO operation is finished + */ diff --git a/target/linux/generic/backport-6.1/702-03-v6.7-net-phy-aquantia-add-firmware-load-support.patch b/target/linux/generic/backport-6.1/702-03-v6.7-net-phy-aquantia-add-firmware-load-support.patch new file mode 100644 index 00000000000..aa52b3baa64 --- /dev/null +++ b/target/linux/generic/backport-6.1/702-03-v6.7-net-phy-aquantia-add-firmware-load-support.patch @@ -0,0 +1,504 @@ +From e93984ebc1c82bd34f7a1b3391efaceee0a8ae96 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 14 Nov 2023 15:08:43 +0100 +Subject: [PATCH 3/3] net: phy: aquantia: add firmware load support + +Aquantia PHY-s require firmware to be loaded before they start operating. +It can be automatically loaded in case when there is a SPI-NOR connected +to Aquantia PHY-s or can be loaded from the host via MDIO. + +This patch adds support for loading the firmware via MDIO as in most cases +there is no SPI-NOR being used to save on cost. +Firmware loading code itself is ported from mainline U-boot with cleanups. + +The firmware has mixed values both in big and little endian. +PHY core itself is big-endian but it expects values to be in little-endian. +The firmware is little-endian but CRC-16 value for it is stored at the end +of firmware in big-endian. + +It seems the PHY does the conversion internally from firmware that is +little-endian to the PHY that is big-endian on using the mailbox +but mailbox returns a big-endian CRC-16 to verify the written data +integrity. + +Co-developed-by: Christian Marangi +Signed-off-by: Robert Marko +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/aquantia/Kconfig | 1 + + drivers/net/phy/aquantia/Makefile | 2 +- + drivers/net/phy/aquantia/aquantia.h | 32 ++ + drivers/net/phy/aquantia/aquantia_firmware.c | 370 +++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 6 + + 5 files changed, 410 insertions(+), 1 deletion(-) + create mode 100644 drivers/net/phy/aquantia/aquantia_firmware.c + +--- a/drivers/net/phy/aquantia/Kconfig ++++ b/drivers/net/phy/aquantia/Kconfig +@@ -1,5 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0-only + config AQUANTIA_PHY + tristate "Aquantia PHYs" ++ select CRC_CCITT + help + Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 +--- a/drivers/net/phy/aquantia/Makefile ++++ b/drivers/net/phy/aquantia/Makefile +@@ -1,5 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0 +-aquantia-objs += aquantia_main.o ++aquantia-objs += aquantia_main.o aquantia_firmware.o + ifdef CONFIG_HWMON + aquantia-objs += aquantia_hwmon.o + endif +--- a/drivers/net/phy/aquantia/aquantia.h ++++ b/drivers/net/phy/aquantia/aquantia.h +@@ -10,10 +10,35 @@ + #include + + /* Vendor specific 1, MDIO_MMD_VEND1 */ ++#define VEND1_GLOBAL_SC 0x0 ++#define VEND1_GLOBAL_SC_SOFT_RESET BIT(15) ++#define VEND1_GLOBAL_SC_LOW_POWER BIT(11) ++ + #define VEND1_GLOBAL_FW_ID 0x0020 + #define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) + #define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) + ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1 0x0200 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_EXECUTE BIT(15) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_WRITE BIT(14) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_CRC_RESET BIT(12) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_BUSY BIT(8) ++ ++#define VEND1_GLOBAL_MAILBOX_INTERFACE2 0x0201 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE3 0x0202 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR_MASK GENMASK(15, 0) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR_MASK, (u16)((x) >> 16)) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE4 0x0203 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR_MASK GENMASK(15, 2) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR_MASK, (u16)(x)) ++ ++#define VEND1_GLOBAL_MAILBOX_INTERFACE5 0x0204 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA_MASK GENMASK(15, 0) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA_MASK, (u16)((x) >> 16)) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE6 0x0205 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA_MASK GENMASK(15, 0) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA_MASK, (u16)(x)) ++ + /* The following registers all have similar layouts; first the registers... */ + #define VEND1_GLOBAL_CFG_10M 0x0310 + #define VEND1_GLOBAL_CFG_100M 0x031b +@@ -28,6 +53,11 @@ + #define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 + + /* Vendor specific 1, MDIO_MMD_VEND2 */ ++#define VEND1_GLOBAL_CONTROL2 0xc001 ++#define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_RST BIT(15) ++#define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD BIT(6) ++#define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL BIT(0) ++ + #define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 + #define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 + #define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 +@@ -83,3 +113,5 @@ int aqr_hwmon_probe(struct phy_device *p + #else + static inline int aqr_hwmon_probe(struct phy_device *phydev) { return 0; } + #endif ++ ++int aqr_firmware_load(struct phy_device *phydev); +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia_firmware.c +@@ -0,0 +1,370 @@ ++// SPDX-License-Identifier: GPL-2.0 ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "aquantia.h" ++ ++#define UP_RESET_SLEEP 100 ++ ++/* addresses of memory segments in the phy */ ++#define DRAM_BASE_ADDR 0x3FFE0000 ++#define IRAM_BASE_ADDR 0x40000000 ++ ++/* firmware image format constants */ ++#define VERSION_STRING_SIZE 0x40 ++#define VERSION_STRING_OFFSET 0x0200 ++/* primary offset is written at an offset from the start of the fw blob */ ++#define PRIMARY_OFFSET_OFFSET 0x8 ++/* primary offset needs to be then added to a base offset */ ++#define PRIMARY_OFFSET_SHIFT 12 ++#define PRIMARY_OFFSET(x) ((x) << PRIMARY_OFFSET_SHIFT) ++#define HEADER_OFFSET 0x300 ++ ++struct aqr_fw_header { ++ u32 padding; ++ u8 iram_offset[3]; ++ u8 iram_size[3]; ++ u8 dram_offset[3]; ++ u8 dram_size[3]; ++} __packed; ++ ++enum aqr_fw_src { ++ AQR_FW_SRC_NVMEM = 0, ++ AQR_FW_SRC_FS, ++}; ++ ++static const char * const aqr_fw_src_string[] = { ++ [AQR_FW_SRC_NVMEM] = "NVMEM", ++ [AQR_FW_SRC_FS] = "FS", ++}; ++ ++/* AQR firmware doesn't have fixed offsets for iram and dram section ++ * but instead provide an header with the offset to use on reading ++ * and parsing the firmware. ++ * ++ * AQR firmware can't be trusted and each offset is validated to be ++ * not negative and be in the size of the firmware itself. ++ */ ++static bool aqr_fw_validate_get(size_t size, size_t offset, size_t get_size) ++{ ++ return offset + get_size <= size; ++} ++ ++static int aqr_fw_get_be16(const u8 *data, size_t offset, size_t size, u16 *value) ++{ ++ if (!aqr_fw_validate_get(size, offset, sizeof(u16))) ++ return -EINVAL; ++ ++ *value = get_unaligned_be16(data + offset); ++ ++ return 0; ++} ++ ++static int aqr_fw_get_le16(const u8 *data, size_t offset, size_t size, u16 *value) ++{ ++ if (!aqr_fw_validate_get(size, offset, sizeof(u16))) ++ return -EINVAL; ++ ++ *value = get_unaligned_le16(data + offset); ++ ++ return 0; ++} ++ ++static int aqr_fw_get_le24(const u8 *data, size_t offset, size_t size, u32 *value) ++{ ++ if (!aqr_fw_validate_get(size, offset, sizeof(u8) * 3)) ++ return -EINVAL; ++ ++ *value = get_unaligned_le24(data + offset); ++ ++ return 0; ++} ++ ++/* load data into the phy's memory */ ++static int aqr_fw_load_memory(struct phy_device *phydev, u32 addr, ++ const u8 *data, size_t len) ++{ ++ u16 crc = 0, up_crc; ++ size_t pos; ++ ++ /* PHY expect addr in LE */ ++ addr = (__force u32)cpu_to_le32(addr); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE1_CRC_RESET); ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE3, ++ VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR(addr)); ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE4, ++ VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR(addr)); ++ ++ /* We assume and enforce the size to be word aligned. ++ * If a firmware that is not word aligned is found, please report upstream. ++ */ ++ for (pos = 0; pos < len; pos += sizeof(u32)) { ++ u32 word; ++ ++ /* FW data is always stored in little-endian */ ++ word = get_unaligned((const u32 *)(data + pos)); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE5, ++ VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA(word)); ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE6, ++ VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA(word)); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE1_EXECUTE | ++ VEND1_GLOBAL_MAILBOX_INTERFACE1_WRITE); ++ ++ /* calculate CRC as we load data to the mailbox. ++ * We convert word to big-endian as PHY is BE and mailbox will ++ * return a BE CRC. ++ */ ++ word = (__force u32)cpu_to_be32(word); ++ crc = crc_ccitt_false(crc, (u8 *)&word, sizeof(word)); ++ } ++ ++ up_crc = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE2); ++ if (crc != up_crc) { ++ phydev_err(phydev, "CRC mismatch: calculated 0x%04x PHY 0x%04x\n", ++ crc, up_crc); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static int aqr_fw_boot(struct phy_device *phydev, const u8 *data, size_t size, ++ enum aqr_fw_src fw_src) ++{ ++ u16 calculated_crc, read_crc, read_primary_offset; ++ u32 iram_offset = 0, iram_size = 0; ++ u32 dram_offset = 0, dram_size = 0; ++ char version[VERSION_STRING_SIZE]; ++ u32 primary_offset = 0; ++ int ret; ++ ++ /* extract saved CRC at the end of the fw ++ * CRC is saved in big-endian as PHY is BE ++ */ ++ ret = aqr_fw_get_be16(data, size - sizeof(u16), size, &read_crc); ++ if (ret) { ++ phydev_err(phydev, "bad firmware CRC in firmware\n"); ++ return ret; ++ } ++ calculated_crc = crc_ccitt_false(0, data, size - sizeof(u16)); ++ if (read_crc != calculated_crc) { ++ phydev_err(phydev, "bad firmware CRC: file 0x%04x calculated 0x%04x\n", ++ read_crc, calculated_crc); ++ return -EINVAL; ++ } ++ ++ /* Get the primary offset to extract DRAM and IRAM sections. */ ++ ret = aqr_fw_get_le16(data, PRIMARY_OFFSET_OFFSET, size, &read_primary_offset); ++ if (ret) { ++ phydev_err(phydev, "bad primary offset in firmware\n"); ++ return ret; ++ } ++ primary_offset = PRIMARY_OFFSET(read_primary_offset); ++ ++ /* Find the DRAM and IRAM sections within the firmware file. ++ * Make sure the fw_header is correctly in the firmware. ++ */ ++ if (!aqr_fw_validate_get(size, primary_offset + HEADER_OFFSET, ++ sizeof(struct aqr_fw_header))) { ++ phydev_err(phydev, "bad fw_header in firmware\n"); ++ return -EINVAL; ++ } ++ ++ /* offset are in LE and values needs to be converted to cpu endian */ ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, iram_offset), ++ size, &iram_offset); ++ if (ret) { ++ phydev_err(phydev, "bad iram offset in firmware\n"); ++ return ret; ++ } ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, iram_size), ++ size, &iram_size); ++ if (ret) { ++ phydev_err(phydev, "invalid iram size in firmware\n"); ++ return ret; ++ } ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, dram_offset), ++ size, &dram_offset); ++ if (ret) { ++ phydev_err(phydev, "bad dram offset in firmware\n"); ++ return ret; ++ } ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, dram_size), ++ size, &dram_size); ++ if (ret) { ++ phydev_err(phydev, "invalid dram size in firmware\n"); ++ return ret; ++ } ++ ++ /* Increment the offset with the primary offset. ++ * Validate iram/dram offset and size. ++ */ ++ iram_offset += primary_offset; ++ if (iram_size % sizeof(u32)) { ++ phydev_err(phydev, "iram size if not aligned to word size. Please report this upstream!\n"); ++ return -EINVAL; ++ } ++ if (!aqr_fw_validate_get(size, iram_offset, iram_size)) { ++ phydev_err(phydev, "invalid iram offset for iram size\n"); ++ return -EINVAL; ++ } ++ ++ dram_offset += primary_offset; ++ if (dram_size % sizeof(u32)) { ++ phydev_err(phydev, "dram size if not aligned to word size. Please report this upstream!\n"); ++ return -EINVAL; ++ } ++ if (!aqr_fw_validate_get(size, dram_offset, dram_size)) { ++ phydev_err(phydev, "invalid iram offset for iram size\n"); ++ return -EINVAL; ++ } ++ ++ phydev_dbg(phydev, "primary %d IRAM offset=%d size=%d DRAM offset=%d size=%d\n", ++ primary_offset, iram_offset, iram_size, dram_offset, dram_size); ++ ++ if (!aqr_fw_validate_get(size, dram_offset + VERSION_STRING_OFFSET, ++ VERSION_STRING_SIZE)) { ++ phydev_err(phydev, "invalid version in firmware\n"); ++ return -EINVAL; ++ } ++ strscpy(version, (char *)data + dram_offset + VERSION_STRING_OFFSET, ++ VERSION_STRING_SIZE); ++ if (version[0] == '\0') { ++ phydev_err(phydev, "invalid version in firmware\n"); ++ return -EINVAL; ++ } ++ phydev_info(phydev, "loading firmware version '%s' from '%s'\n", version, ++ aqr_fw_src_string[fw_src]); ++ ++ /* stall the microcprocessor */ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_CONTROL2, ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL | VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD); ++ ++ phydev_dbg(phydev, "loading DRAM 0x%08x from offset=%d size=%d\n", ++ DRAM_BASE_ADDR, dram_offset, dram_size); ++ ret = aqr_fw_load_memory(phydev, DRAM_BASE_ADDR, data + dram_offset, ++ dram_size); ++ if (ret) ++ return ret; ++ ++ phydev_dbg(phydev, "loading IRAM 0x%08x from offset=%d size=%d\n", ++ IRAM_BASE_ADDR, iram_offset, iram_size); ++ ret = aqr_fw_load_memory(phydev, IRAM_BASE_ADDR, data + iram_offset, ++ iram_size); ++ if (ret) ++ return ret; ++ ++ /* make sure soft reset and low power mode are clear */ ++ phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_SC, ++ VEND1_GLOBAL_SC_SOFT_RESET | VEND1_GLOBAL_SC_LOW_POWER); ++ ++ /* Release the microprocessor. UP_RESET must be held for 100 usec. */ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_CONTROL2, ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL | ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD | ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_RST); ++ usleep_range(UP_RESET_SLEEP, UP_RESET_SLEEP * 2); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_CONTROL2, ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD); ++ ++ return 0; ++} ++ ++static int aqr_firmware_load_nvmem(struct phy_device *phydev) ++{ ++ struct nvmem_cell *cell; ++ size_t size; ++ u8 *buf; ++ int ret; ++ ++ cell = nvmem_cell_get(&phydev->mdio.dev, "firmware"); ++ if (IS_ERR(cell)) ++ return PTR_ERR(cell); ++ ++ buf = nvmem_cell_read(cell, &size); ++ if (IS_ERR(buf)) { ++ ret = PTR_ERR(buf); ++ goto exit; ++ } ++ ++ ret = aqr_fw_boot(phydev, buf, size, AQR_FW_SRC_NVMEM); ++ if (ret) ++ phydev_err(phydev, "firmware loading failed: %d\n", ret); ++ ++ kfree(buf); ++exit: ++ nvmem_cell_put(cell); ++ ++ return ret; ++} ++ ++static int aqr_firmware_load_fs(struct phy_device *phydev) ++{ ++ struct device *dev = &phydev->mdio.dev; ++ const struct firmware *fw; ++ const char *fw_name; ++ int ret; ++ ++ ret = of_property_read_string(dev->of_node, "firmware-name", ++ &fw_name); ++ if (ret) ++ return ret; ++ ++ ret = request_firmware(&fw, fw_name, dev); ++ if (ret) { ++ phydev_err(phydev, "failed to find FW file %s (%d)\n", ++ fw_name, ret); ++ return ret; ++ } ++ ++ ret = aqr_fw_boot(phydev, fw->data, fw->size, AQR_FW_SRC_FS); ++ if (ret) ++ phydev_err(phydev, "firmware loading failed: %d\n", ret); ++ ++ release_firmware(fw); ++ ++ return ret; ++} ++ ++int aqr_firmware_load(struct phy_device *phydev) ++{ ++ int ret; ++ ++ /* Check if the firmware is not already loaded by pooling ++ * the current version returned by the PHY. If 0 is returned, ++ * no firmware is loaded. ++ */ ++ ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID); ++ if (ret > 0) ++ goto exit; ++ ++ ret = aqr_firmware_load_nvmem(phydev); ++ if (!ret) ++ goto exit; ++ ++ ret = aqr_firmware_load_fs(phydev); ++ if (ret) ++ return ret; ++ ++exit: ++ return 0; ++} +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -656,11 +656,17 @@ static int aqr107_resume(struct phy_devi + + static int aqr107_probe(struct phy_device *phydev) + { ++ int ret; ++ + phydev->priv = devm_kzalloc(&phydev->mdio.dev, + sizeof(struct aqr107_priv), GFP_KERNEL); + if (!phydev->priv) + return -ENOMEM; + ++ ret = aqr_firmware_load(phydev); ++ if (ret) ++ return ret; ++ + return aqr_hwmon_probe(phydev); + } + diff --git a/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch b/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch index ddb32385e4e..06dddffcaa5 100644 --- a/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch +++ b/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller F: drivers/net/phy/motorcomm.c --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -260,7 +260,7 @@ config MOTORCOMM_PHY +@@ -257,7 +257,7 @@ config MOTORCOMM_PHY tristate "Motorcomm PHYs" help Enables support for Motorcomm network PHYs. diff --git a/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch b/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch index a2f22ee99b6..d22cc69425d 100644 --- a/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch +++ b/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch @@ -22,7 +22,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -260,7 +260,7 @@ config MOTORCOMM_PHY +@@ -257,7 +257,7 @@ config MOTORCOMM_PHY tristate "Motorcomm PHYs" help Enables support for Motorcomm network PHYs. diff --git a/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch b/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch index 35495978efa..60eea4fa477 100644 --- a/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch +++ b/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -260,7 +260,7 @@ config MOTORCOMM_PHY +@@ -257,7 +257,7 @@ config MOTORCOMM_PHY tristate "Motorcomm PHYs" help Enables support for Motorcomm network PHYs. diff --git a/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch b/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch index 6ade45ee3ed..eac8966a480 100644 --- a/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch +++ b/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch @@ -76,7 +76,7 @@ Signed-off-by: David S. Miller if (pl->pcs) { err = pl->pcs->ops->pcs_config(pl->pcs, pl->cur_link_an_mode, state->interface, -@@ -1498,6 +1524,7 @@ struct phylink *phylink_create(struct ph +@@ -1499,6 +1525,7 @@ struct phylink *phylink_create(struct ph pl->link_config.speed = SPEED_UNKNOWN; pl->link_config.duplex = DUPLEX_UNKNOWN; pl->link_config.an_enabled = true; @@ -84,7 +84,7 @@ Signed-off-by: David S. Miller pl->mac_ops = mac_ops; __set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); timer_setup(&pl->link_poll, phylink_fixed_poll, 0); -@@ -1899,6 +1926,8 @@ void phylink_start(struct phylink *pl) +@@ -1900,6 +1927,8 @@ void phylink_start(struct phylink *pl) if (pl->netdev) netif_carrier_off(pl->netdev); @@ -93,7 +93,7 @@ Signed-off-by: David S. Miller /* Apply the link configuration to the MAC when starting. This allows * a fixed-link to start with the correct parameters, and also * ensures that we set the appropriate advertisement for Serdes links. -@@ -1909,6 +1938,8 @@ void phylink_start(struct phylink *pl) +@@ -1910,6 +1939,8 @@ void phylink_start(struct phylink *pl) */ phylink_mac_initial_config(pl, true); @@ -102,7 +102,7 @@ Signed-off-by: David S. Miller phylink_enable_and_run_resolve(pl, PHYLINK_DISABLE_STOPPED); if (pl->cfg_link_an_mode == MLO_AN_FIXED && pl->link_gpio) { -@@ -1927,15 +1958,9 @@ void phylink_start(struct phylink *pl) +@@ -1928,15 +1959,9 @@ void phylink_start(struct phylink *pl) poll = true; } @@ -120,7 +120,7 @@ Signed-off-by: David S. Miller if (poll) mod_timer(&pl->link_poll, jiffies + HZ); if (pl->phydev) -@@ -1972,6 +1997,10 @@ void phylink_stop(struct phylink *pl) +@@ -1973,6 +1998,10 @@ void phylink_stop(struct phylink *pl) } phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_STOPPED); diff --git a/target/linux/generic/backport-6.1/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch b/target/linux/generic/backport-6.1/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch new file mode 100644 index 00000000000..605faeec035 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch @@ -0,0 +1,229 @@ +From ec51fbd1b8a2bca2948dede99c14ec63dc57ff6b Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:38 +0100 +Subject: [PATCH] r8152: add USB device driver for config selection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Subclassing the generic USB device driver to override the +default configuration selection regardless of matching interface +drivers. + +The r815x family devices expose a vendor specific function which +the r8152 interface driver wants to handle. This is the preferred +device mode. Additionally one or more USB class functions are +usually supported for hosts lacking a vendor specific driver. The +choice is USB configuration based, with one alternate function per +configuration. + +Example device with both NCM and ECM alternate cfgs: + +T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 3 +P: Vendor=0bda ProdID=8156 Rev=31.00 +S: Manufacturer=Realtek +S: Product=USB 10/100/1G/2.5G LAN +S: SerialNumber=001000001 +C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=256mA +I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=r8152 +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=83(I) Atr=03(Int.) MxPS= 2 Ivl=128ms +C: #Ifs= 2 Cfg#= 2 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +C: #Ifs= 2 Cfg#= 3 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms + +A problem with this is that Linux will prefer class functions over +vendor specific functions. Using the above example, Linux defaults +to cfg #2, running the device in a sub-optimal NCM mode. + +Previously we've attempted to work around the problem by +blacklisting the devices in the ECM class driver "cdc_ether", and +matching on the ECM class function in the vendor specific interface +driver. The latter has been used to switch back to the vendor +specific configuration when the driver is probed for a class +function. + +This workaround has several issues; +- class driver blacklists is additional maintanence cruft in an + unrelated driver +- class driver blacklists prevents users from optionally running + the devices in class mode +- each device needs double match entries in the vendor driver +- the initial probing as a class function slows down device + discovery + +Now these issues have become even worse with the introduction of +firmware supporting both NCM and ECM, where NCM ends up as the +default mode in Linux. To use the same workaround, we now have +to blacklist the devices in to two different class drivers and +add yet another match entry to the vendor specific driver. + +This patch implements an alternative workaround strategy - +independent of the interface drivers. It avoids adding a +blacklist to the cdc_ncm driver and will let us remove the +existing blacklist from the cdc_ether driver. + +As an additional bonus, removing the blacklists allow users to +select one of the other device modes if wanted. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 113 ++++++++++++++++++++++++++++------------ + 1 file changed, 81 insertions(+), 32 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9661,6 +9661,9 @@ static int rtl8152_probe(struct usb_inte + if (version == RTL_VER_UNKNOWN) + return -ENODEV; + ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ + if (!rtl_vendor_mode(intf)) + return -ENODEV; + +@@ -9861,43 +9864,35 @@ static void rtl8152_disconnect(struct us + } + } + +-#define REALTEK_USB_DEVICE(vend, prod) { \ +- USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC), \ +-}, \ +-{ \ +- USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \ +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), \ +-} + + /* table of devices that work with this driver */ + static const struct usb_device_id rtl8152_table[] = { + /* Realtek */ +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156), ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8050) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8053) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8152) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8153) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8155) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8156) }, + + /* Microsoft */ +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0c5e), +- REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387), +- REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041), +- REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff), +- REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601), ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927) }, ++ { USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x304f) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3054) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x721e) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0xa387) }, ++ { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, ++ { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, ++ { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, + {} + }; + +@@ -9917,7 +9912,61 @@ static struct usb_driver rtl8152_driver + .disable_hub_initiated_lpm = 1, + }; + +-module_usb_driver(rtl8152_driver); ++static int rtl8152_cfgselector_probe(struct usb_device *udev) ++{ ++ struct usb_host_config *c; ++ int i, num_configs; ++ ++ /* The vendor mode is not always config #1, so to find it out. */ ++ c = udev->config; ++ num_configs = udev->descriptor.bNumConfigurations; ++ for (i = 0; i < num_configs; (i++, c++)) { ++ struct usb_interface_descriptor *desc = NULL; ++ ++ if (!c->desc.bNumInterfaces) ++ continue; ++ desc = &c->intf_cache[0]->altsetting->desc; ++ if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) ++ break; ++ } ++ ++ if (i == num_configs) ++ return -ENODEV; ++ ++ if (usb_set_configuration(udev, c->desc.bConfigurationValue)) { ++ dev_err(&udev->dev, "Failed to set configuration %d\n", ++ c->desc.bConfigurationValue); ++ return -ENODEV; ++ } ++ ++ return 0; ++} ++ ++static struct usb_device_driver rtl8152_cfgselector_driver = { ++ .name = MODULENAME "-cfgselector", ++ .probe = rtl8152_cfgselector_probe, ++ .id_table = rtl8152_table, ++ .generic_subclass = 1, ++}; ++ ++static int __init rtl8152_driver_init(void) ++{ ++ int ret; ++ ++ ret = usb_register_device_driver(&rtl8152_cfgselector_driver, THIS_MODULE); ++ if (ret) ++ return ret; ++ return usb_register(&rtl8152_driver); ++} ++ ++static void __exit rtl8152_driver_exit(void) ++{ ++ usb_deregister(&rtl8152_driver); ++ usb_deregister_device_driver(&rtl8152_cfgselector_driver); ++} ++ ++module_init(rtl8152_driver_init); ++module_exit(rtl8152_driver_exit); + + MODULE_AUTHOR(DRIVER_AUTHOR); + MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/target/linux/generic/backport-6.1/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch b/target/linux/generic/backport-6.1/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch new file mode 100644 index 00000000000..17131c16d39 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch @@ -0,0 +1,158 @@ +From 69649ef8405320f81497f4757faac8234f61b167 Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:39 +0100 +Subject: [PATCH] cdc_ether: no need to blacklist any r8152 devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The r8152 driver does not need this anymore. + +Dropping blacklist entries adds optional support for these +devices in ECM mode. + +The 8153 devices are handled by the r8153_ecm driver when +in ECM mode, and must still be blacklisted here. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 114 ------------------------------------ + 1 file changed, 114 deletions(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -768,13 +768,6 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */ + { + USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, +@@ -782,119 +775,12 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Samsung USB Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-#if IS_ENABLED(CONFIG_USB_RTL8152) +-/* Linksys USB3GIGV1 Ethernet Adapter */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LINKSYS_VENDOR_ID, 0x0041, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +-#endif +- +-/* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3054, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad USB-C Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3069, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3082, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo Thinkpad USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7205, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB C to Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x720c, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB-C Travel Hub (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7214, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */ + { + USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), + .driver_info = 0, + }, +- +-/* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* NVIDIA Tegra USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(NVIDIA_VENDOR_ID, 0x09ff, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface 2 dock (based on Realtek RTL8152) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07ab, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, + + /* Aquantia AQtion USB to 5GbE Controller (based on AQC111U) */ + { diff --git a/target/linux/generic/backport-6.1/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch b/target/linux/generic/backport-6.1/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch new file mode 100644 index 00000000000..a5b01f7b082 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch @@ -0,0 +1,64 @@ +From 0d4cda805a183bbe523f2407edb5c14ade50b841 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 17 Jan 2023 11:03:44 +0800 +Subject: [PATCH] r8152: avoid to change cfg for all devices + +The rtl8152_cfgselector_probe() should set the USB configuration to the +vendor mode only for the devices which the driver (r8152) supports. +Otherwise, no driver would be used for such devices. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9542,9 +9542,8 @@ static int rtl_fw_init(struct r8152 *tp) + return 0; + } + +-u8 rtl8152_get_version(struct usb_interface *intf) ++static u8 __rtl_get_hw_ver(struct usb_device *udev) + { +- struct usb_device *udev = interface_to_usbdev(intf); + u32 ocp_data = 0; + __le32 *tmp; + u8 version; +@@ -9614,10 +9613,19 @@ u8 rtl8152_get_version(struct usb_interf + break; + default: + version = RTL_VER_UNKNOWN; +- dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data); ++ dev_info(&udev->dev, "Unknown version 0x%04x\n", ocp_data); + break; + } + ++ return version; ++} ++ ++u8 rtl8152_get_version(struct usb_interface *intf) ++{ ++ u8 version; ++ ++ version = __rtl_get_hw_ver(interface_to_usbdev(intf)); ++ + dev_dbg(&intf->dev, "Detected version 0x%04x\n", version); + + return version; +@@ -9917,6 +9925,12 @@ static int rtl8152_cfgselector_probe(str + struct usb_host_config *c; + int i, num_configs; + ++ /* Switch the device to vendor mode, if and only if the vendor mode ++ * driver supports it. ++ */ ++ if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN) ++ return 0; ++ + /* The vendor mode is not always config #1, so to find it out. */ + c = udev->config; + num_configs = udev->descriptor.bNumConfigurations; diff --git a/target/linux/generic/backport-6.1/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch b/target/linux/generic/backport-6.1/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch new file mode 100644 index 00000000000..f97750861c3 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch @@ -0,0 +1,71 @@ +From 95a4c1d617b92cdc4522297741b56e8f6cd01a1e Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:42 +0800 +Subject: [PATCH] r8152: remove rtl_vendor_mode function + +After commit ec51fbd1b8a2 ("r8152: add USB device driver for +config selection"), the code about changing USB configuration +in rtl_vendor_mode() wouldn't be run anymore. Therefore, the +function could be removed. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 39 +-------------------------------------- + 1 file changed, 1 insertion(+), 38 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -8274,43 +8274,6 @@ static bool rtl_check_vendor_ok(struct u + return true; + } + +-static bool rtl_vendor_mode(struct usb_interface *intf) +-{ +- struct usb_host_interface *alt = intf->cur_altsetting; +- struct usb_device *udev; +- struct usb_host_config *c; +- int i, num_configs; +- +- if (alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC) +- return rtl_check_vendor_ok(intf); +- +- /* The vendor mode is not always config #1, so to find it out. */ +- udev = interface_to_usbdev(intf); +- c = udev->config; +- num_configs = udev->descriptor.bNumConfigurations; +- if (num_configs < 2) +- return false; +- +- for (i = 0; i < num_configs; (i++, c++)) { +- struct usb_interface_descriptor *desc = NULL; +- +- if (c->desc.bNumInterfaces > 0) +- desc = &c->intf_cache[0]->altsetting->desc; +- else +- continue; +- +- if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) { +- usb_driver_set_configuration(udev, c->desc.bConfigurationValue); +- break; +- } +- } +- +- if (i == num_configs) +- dev_err(&intf->dev, "Unexpected Device\n"); +- +- return false; +-} +- + static int rtl8152_pre_reset(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); +@@ -9672,7 +9635,7 @@ static int rtl8152_probe(struct usb_inte + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + +- if (!rtl_vendor_mode(intf)) ++ if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + + usb_reset_device(udev); diff --git a/target/linux/generic/backport-6.1/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch b/target/linux/generic/backport-6.1/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch new file mode 100644 index 00000000000..421f2c7f8f5 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch @@ -0,0 +1,46 @@ +From 02767440e1dda9861a11ca1dbe0f19a760b1d5c2 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:43 +0800 +Subject: [PATCH] r8152: reduce the control transfer of rtl8152_get_version() + +Reduce the control transfer by moving calling rtl8152_get_version() in +rtl8152_probe(). This could prevent from calling rtl8152_get_version() +for unnecessary situations. For example, after setting config #2 for the +device, there are two interfaces and rtl8152_probe() may be called +twice. However, we don't need to call rtl8152_get_version() for this +situation. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9624,20 +9624,21 @@ static int rtl8152_probe(struct usb_inte + const struct usb_device_id *id) + { + struct usb_device *udev = interface_to_usbdev(intf); +- u8 version = rtl8152_get_version(intf); + struct r8152 *tp; + struct net_device *netdev; ++ u8 version; + int ret; + +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + + if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { diff --git a/target/linux/generic/backport-6.1/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch b/target/linux/generic/backport-6.1/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch new file mode 100644 index 00000000000..cdabca36d2a --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch @@ -0,0 +1,55 @@ +From 5cc33f139e11b893ff6dc60d8a0ae865a65521ac Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Thu, 6 Apr 2023 17:14:26 -0700 +Subject: [PATCH] r8152: Add __GFP_NOWARN to big allocations + +When memory is a little tight on my system, it's pretty easy to see +warnings that look like this. + + ksoftirqd/0: page allocation failure: order:3, mode:0x40a20(GFP_ATOMIC|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0 + ... + Call trace: + dump_backtrace+0x0/0x1e8 + show_stack+0x20/0x2c + dump_stack_lvl+0x60/0x78 + dump_stack+0x18/0x38 + warn_alloc+0x104/0x174 + __alloc_pages+0x588/0x67c + alloc_rx_agg+0xa0/0x190 [r8152 ...] + r8152_poll+0x270/0x760 [r8152 ...] + __napi_poll+0x44/0x1ec + net_rx_action+0x100/0x300 + __do_softirq+0xec/0x38c + run_ksoftirqd+0x38/0xec + smpboot_thread_fn+0xb8/0x248 + kthread+0x134/0x154 + ret_from_fork+0x10/0x20 + +On a fragmented system it's normal that order 3 allocations will +sometimes fail, especially atomic ones. The driver handles these +failures fine and the WARN just creates spam in the logs for this +case. The __GFP_NOWARN flag is exactly for this situation, so add it +to the allocation. + +NOTE: my testing is on a 5.15 system, but there should be no reason +that this would be fundamentally different on a mainline kernel. + +Signed-off-by: Douglas Anderson +Acked-by: Hayes Wang +Link: https://lore.kernel.org/r/20230406171411.1.I84dbef45786af440fd269b71e9436a96a8e7a152@changeid +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1947,7 +1947,7 @@ static struct rx_agg *alloc_rx_agg(struc + if (!rx_agg) + return NULL; + +- rx_agg->page = alloc_pages(mflags | __GFP_COMP, order); ++ rx_agg->page = alloc_pages(mflags | __GFP_COMP | __GFP_NOWARN, order); + if (!rx_agg->page) + goto free_rx; + diff --git a/target/linux/generic/backport-6.1/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch b/target/linux/generic/backport-6.1/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch new file mode 100644 index 00000000000..b4d5b8bdb91 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch @@ -0,0 +1,24 @@ +From 0fbd79c01a9a657348f7032df70c57a406468c86 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 2 May 2023 11:36:27 +0800 +Subject: [PATCH] r8152: fix the autosuspend doesn't work + +Set supports_autosuspend = 1 for the rtl8152_cfgselector_driver. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9925,6 +9925,7 @@ static struct usb_device_driver rtl8152_ + .probe = rtl8152_cfgselector_probe, + .id_table = rtl8152_table, + .generic_subclass = 1, ++ .supports_autosuspend = 1, + }; + + static int __init rtl8152_driver_init(void) diff --git a/target/linux/generic/backport-6.1/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch b/target/linux/generic/backport-6.1/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch new file mode 100644 index 00000000000..3ba79d6cc6a --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch @@ -0,0 +1,70 @@ +From 57df0fb9d511f91202114813e90128d65c0589f0 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:07 +0800 +Subject: [PATCH] r8152: adjust generic_ocp_write function + +Reduce the control transfer if all bytes of first or the last DWORD are +written. + +The original method is to split the control transfer into three parts +(the first DWORD, middle continuous data, and the last DWORD). However, +they could be combined if whole bytes of the first DWORD or last DWORD +are written. That is, the first DWORD or the last DWORD could be combined +with the middle continuous data, if the byte_en is 0xff. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-418-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 29 ++++++++++++++++++----------- + 1 file changed, 18 insertions(+), 11 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1313,16 +1313,24 @@ static int generic_ocp_write(struct r815 + byteen_end = byteen & BYTE_EN_END_MASK; + + byen = byteen_start | (byteen_start << 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; +- +- index += 4; +- data += 4; +- size -= 4; + +- if (size) { ++ /* Split the first DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) { ++ ret = set_registers(tp, index, type | byen, 4, data); ++ if (ret < 0) ++ goto error1; ++ ++ index += 4; ++ data += 4; + size -= 4; ++ } ++ ++ if (size) { ++ byen = byteen_end | (byteen_end >> 4); ++ ++ /* Split the last DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) ++ size -= 4; + + while (size) { + if (size > limit) { +@@ -1349,10 +1357,9 @@ static int generic_ocp_write(struct r815 + } + } + +- byen = byteen_end | (byteen_end >> 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; ++ /* Set the last DWORD */ ++ if (byen != BYTE_EN_DWORD) ++ ret = set_registers(tp, index, type | byen, 4, data); + } + + error1: diff --git a/target/linux/generic/backport-6.1/795-v6.6-09-r8152-set-bp-in-bulk.patch b/target/linux/generic/backport-6.1/795-v6.6-09-r8152-set-bp-in-bulk.patch new file mode 100644 index 00000000000..485a005b174 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-09-r8152-set-bp-in-bulk.patch @@ -0,0 +1,129 @@ +From e5c266a61186b462c388c53a3564c375e72f2244 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:08 +0800 +Subject: [PATCH] r8152: set bp in bulk + +PLA_BP_0 ~ PLA_BP_15 (0xfc28 ~ 0xfc46) are continuous registers, so we +could combine the control transfers into one control transfer. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-419-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 75 ++++++++++++++--------------------------- + 1 file changed, 25 insertions(+), 50 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -3984,29 +3984,10 @@ static void rtl_reset_bmu(struct r8152 * + /* Clear the bp to stop the firmware before loading a new one */ + static void rtl_clear_bp(struct r8152 *tp, u16 type) + { +- switch (tp->version) { +- case RTL_VER_01: +- case RTL_VER_02: +- case RTL_VER_07: +- break; +- case RTL_VER_03: +- case RTL_VER_04: +- case RTL_VER_05: +- case RTL_VER_06: +- ocp_write_byte(tp, type, PLA_BP_EN, 0); +- break; +- case RTL_VER_14: +- ocp_write_word(tp, type, USB_BP2_EN, 0); ++ u16 bp[16] = {0}; ++ u16 bp_num; + +- ocp_write_word(tp, type, USB_BP_8, 0); +- ocp_write_word(tp, type, USB_BP_9, 0); +- ocp_write_word(tp, type, USB_BP_10, 0); +- ocp_write_word(tp, type, USB_BP_11, 0); +- ocp_write_word(tp, type, USB_BP_12, 0); +- ocp_write_word(tp, type, USB_BP_13, 0); +- ocp_write_word(tp, type, USB_BP_14, 0); +- ocp_write_word(tp, type, USB_BP_15, 0); +- break; ++ switch (tp->version) { + case RTL_VER_08: + case RTL_VER_09: + case RTL_VER_10: +@@ -4014,32 +3995,31 @@ static void rtl_clear_bp(struct r8152 *t + case RTL_VER_12: + case RTL_VER_13: + case RTL_VER_15: +- default: + if (type == MCU_TYPE_USB) { + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); +- +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_10, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_14, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_15, 0); +- } else { +- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0); ++ bp_num = 16; ++ break; + } ++ fallthrough; ++ case RTL_VER_03: ++ case RTL_VER_04: ++ case RTL_VER_05: ++ case RTL_VER_06: ++ ocp_write_byte(tp, type, PLA_BP_EN, 0); ++ fallthrough; ++ case RTL_VER_01: ++ case RTL_VER_02: ++ case RTL_VER_07: ++ bp_num = 8; ++ break; ++ case RTL_VER_14: ++ default: ++ ocp_write_word(tp, type, USB_BP2_EN, 0); ++ bp_num = 16; + break; + } + +- ocp_write_word(tp, type, PLA_BP_0, 0); +- ocp_write_word(tp, type, PLA_BP_1, 0); +- ocp_write_word(tp, type, PLA_BP_2, 0); +- ocp_write_word(tp, type, PLA_BP_3, 0); +- ocp_write_word(tp, type, PLA_BP_4, 0); +- ocp_write_word(tp, type, PLA_BP_5, 0); +- ocp_write_word(tp, type, PLA_BP_6, 0); +- ocp_write_word(tp, type, PLA_BP_7, 0); ++ generic_ocp_write(tp, PLA_BP_0, BYTE_EN_DWORD, bp_num << 1, bp, type); + + /* wait 3 ms to make sure the firmware is stopped */ + usleep_range(3000, 6000); +@@ -5016,10 +4996,9 @@ static void rtl8152_fw_phy_nc_apply(stru + + static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac) + { +- u16 bp_en_addr, bp_index, type, bp_num, fw_ver_reg; ++ u16 bp_en_addr, type, fw_ver_reg; + u32 length; + u8 *data; +- int i; + + switch (__le32_to_cpu(mac->blk_hdr.type)) { + case RTL_FW_PLA: +@@ -5061,12 +5040,8 @@ static void rtl8152_fw_mac_apply(struct + ocp_write_word(tp, type, __le16_to_cpu(mac->bp_ba_addr), + __le16_to_cpu(mac->bp_ba_value)); + +- bp_index = __le16_to_cpu(mac->bp_start); +- bp_num = __le16_to_cpu(mac->bp_num); +- for (i = 0; i < bp_num; i++) { +- ocp_write_word(tp, type, bp_index, __le16_to_cpu(mac->bp[i])); +- bp_index += 2; +- } ++ generic_ocp_write(tp, __le16_to_cpu(mac->bp_start), BYTE_EN_DWORD, ++ __le16_to_cpu(mac->bp_num) << 1, mac->bp, type); + + bp_en_addr = __le16_to_cpu(mac->bp_en_addr); + if (bp_en_addr) diff --git a/target/linux/generic/backport-6.1/795-v6.6-10-eth-r8152-try-to-use-a-normal-budget.patch b/target/linux/generic/backport-6.1/795-v6.6-10-eth-r8152-try-to-use-a-normal-budget.patch new file mode 100644 index 00000000000..864671bb32f --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-10-eth-r8152-try-to-use-a-normal-budget.patch @@ -0,0 +1,39 @@ +From cf74eb5a5bc867258e7d0b0d1c3c4a60e1e3de2f Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Mon, 14 Aug 2023 08:35:21 -0700 +Subject: [PATCH] eth: r8152: try to use a normal budget + +Mario reports that loading r8152 on his system leads to a: + + netif_napi_add_weight() called with weight 256 + +warning getting printed. We don't have any solid data +on why such high budget was chosen, and it may cause +stalls in processing other softirqs and rt threads. +So try to switch back to the default (64) weight. + +If this slows down someone's system we should investigate +which part of stopping starting the NAPI poll in this +driver are expensive. + +Reported-by: Mario Limonciello +Link: https://lore.kernel.org/all/0bfd445a-81f7-f702-08b0-bd5a72095e49@amd.com/ +Acked-by: Hayes Wang +Link: https://lore.kernel.org/r/20230814153521.2697982-1-kuba@kernel.org +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9770,8 +9770,7 @@ static int rtl8152_probe(struct usb_inte + + usb_set_intfdata(intf, tp); + +- netif_napi_add_weight(netdev, &tp->napi, r8152_poll, +- tp->support_2500full ? 256 : 64); ++ netif_napi_add(netdev, &tp->napi, r8152_poll); + + ret = register_netdev(netdev); + if (ret != 0) { diff --git a/target/linux/generic/backport-6.1/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch b/target/linux/generic/backport-6.1/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch new file mode 100644 index 00000000000..ab6563d5c43 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch @@ -0,0 +1,39 @@ +From 72f93a3136ee18fd59fa6579f84c07e93424681e Mon Sep 17 00:00:00 2001 +From: Antonio Napolitano +Date: Sat, 26 Aug 2023 01:05:50 +0200 +Subject: [PATCH] r8152: add vendor/device ID pair for D-Link DUB-E250 + +The D-Link DUB-E250 is an RTL8156 based 2.5G Ethernet controller. + +Add the vendor and product ID values to the driver. This makes Ethernet +work with the adapter. + +Signed-off-by: Antonio Napolitano +Link: https://lore.kernel.org/r/CV200KJEEUPC.WPKAHXCQJ05I@mercurius +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 1 + + include/linux/usb/r8152.h | 1 + + 2 files changed, 2 insertions(+) + + +--- a/include/linux/usb/r8152.h ++++ b/include/linux/usb/r8152.h +@@ -29,6 +29,7 @@ + #define VENDOR_ID_LINKSYS 0x13b1 + #define VENDOR_ID_NVIDIA 0x0955 + #define VENDOR_ID_TPLINK 0x2357 ++#define VENDOR_ID_DLINK 0x2001 + + #if IS_REACHABLE(CONFIG_USB_RTL8152) + extern u8 rtl8152_get_version(struct usb_interface *intf); +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9846,6 +9846,7 @@ static const struct usb_device_id rtl815 + { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, + { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, + { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, ++ { USB_DEVICE(VENDOR_ID_DLINK, 0xb301) }, + {} + }; + diff --git a/target/linux/generic/backport-6.1/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch b/target/linux/generic/backport-6.1/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch new file mode 100644 index 00000000000..480a60212ae --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch @@ -0,0 +1,447 @@ +From 715f67f33af45ce2cc3a5b1ef133cc8c8e7787b0 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:58 -0700 +Subject: [PATCH] r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + +Whenever the RTL8152_UNPLUG is set that just tells the driver that all +accesses will fail and we should just immediately bail. A future patch +will use this same concept at a time when the driver hasn't actually +been unplugged but is about to be reset. Rename the flag in +preparation for the future patch. + +This is a no-op change and just a search and replace. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 96 ++++++++++++++++++++--------------------- + 1 file changed, 48 insertions(+), 48 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -763,7 +763,7 @@ enum rtl_register_content { + + /* rtl8152 flags */ + enum rtl8152_flags { +- RTL8152_UNPLUG = 0, ++ RTL8152_INACCESSIBLE = 0, + RTL8152_SET_RX_MODE, + WORK_ENABLE, + RTL8152_LINK_CHG, +@@ -1244,7 +1244,7 @@ int set_registers(struct r8152 *tp, u16 + static void rtl_set_unplug(struct r8152 *tp) + { + if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_UNPLUG, &tp->flags); ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); + smp_mb__after_atomic(); + } + } +@@ -1255,7 +1255,7 @@ static int generic_ocp_read(struct r8152 + u16 limit = 64; + int ret = 0; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1299,7 +1299,7 @@ static int generic_ocp_write(struct r815 + u16 byteen_start, byteen_end, byen; + u16 limit = 512; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1536,7 +1536,7 @@ static int read_mii_word(struct net_devi + struct r8152 *tp = netdev_priv(netdev); + int ret; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + if (phy_id != R8152_PHY_ID) +@@ -1552,7 +1552,7 @@ void write_mii_word(struct net_device *n + { + struct r8152 *tp = netdev_priv(netdev); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (phy_id != R8152_PHY_ID) +@@ -1757,7 +1757,7 @@ static void read_bulk_callback(struct ur + if (!tp) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -1849,7 +1849,7 @@ static void write_bulk_callback(struct u + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!skb_queue_empty(&tp->tx_queue)) +@@ -1870,7 +1870,7 @@ static void intr_callback(struct urb *ur + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + switch (status) { +@@ -2614,7 +2614,7 @@ static void bottom_half(struct tasklet_s + { + struct r8152 *tp = from_tasklet(tp, t, tx_tl); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -2657,7 +2657,7 @@ int r8152_submit_rx(struct r8152 *tp, st + int ret; + + /* The rx would be stopped, so skip submitting */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || + !test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev)) + return 0; + +@@ -3057,7 +3057,7 @@ static int rtl_enable(struct r8152 *tp) + + static int rtl8152_enable(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3144,7 +3144,7 @@ static int rtl8153_enable(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3176,7 +3176,7 @@ static void rtl_disable(struct r8152 *tp + u32 ocp_data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -3630,7 +3630,7 @@ static u16 r8153_phy_status(struct r8152 + } + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -3662,7 +3662,7 @@ static void r8153b_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -3704,7 +3704,7 @@ static void r8153c_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -4049,8 +4049,8 @@ static int rtl_phy_patch_request(struct + for (i = 0; wait && i < 5000; i++) { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) +- break; ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; + + usleep_range(1000, 2000); + ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT); +@@ -6008,7 +6008,7 @@ static int rtl8156_enable(struct r8152 * + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + r8156_fc_parameter(tp); +@@ -6066,7 +6066,7 @@ static int rtl8156b_enable(struct r8152 + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -6252,7 +6252,7 @@ out: + + static void rtl8152_up(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8152_aldps_en(tp, false); +@@ -6262,7 +6262,7 @@ static void rtl8152_up(struct r8152 *tp) + + static void rtl8152_down(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6277,7 +6277,7 @@ static void rtl8153_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6317,7 +6317,7 @@ static void rtl8153_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6338,7 +6338,7 @@ static void rtl8153b_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6362,7 +6362,7 @@ static void rtl8153b_down(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6399,7 +6399,7 @@ static void rtl8153c_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6480,7 +6480,7 @@ static void rtl8156_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6553,7 +6553,7 @@ static void rtl8156_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6691,7 +6691,7 @@ static void rtl_work_func_t(struct work_ + /* If the device is unplugged or !netif_running(), the workqueue + * doesn't need to wake the device, and could return directly. + */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6730,7 +6730,7 @@ static void rtl_hw_phy_work_func_t(struc + { + struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6857,7 +6857,7 @@ static int rtl8152_close(struct net_devi + netif_stop_queue(netdev); + + res = usb_autopm_get_interface(tp->intf); +- if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + rtl_stop_rx(tp); + } else { +@@ -6890,7 +6890,7 @@ static void r8152b_init(struct r8152 *tp + u32 ocp_data; + u16 data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + data = r8152_mdio_read(tp, MII_BMCR); +@@ -6934,7 +6934,7 @@ static void r8153_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6945,7 +6945,7 @@ static void r8153_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7074,7 +7074,7 @@ static void r8153b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7085,7 +7085,7 @@ static void r8153b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7156,7 +7156,7 @@ static void r8153c_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7176,7 +7176,7 @@ static void r8153c_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -8005,7 +8005,7 @@ static void r8156_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8026,7 +8026,7 @@ static void r8156_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -8101,7 +8101,7 @@ static void r8156b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8135,7 +8135,7 @@ static void r8156b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -9164,7 +9164,7 @@ static int rtl8152_ioctl(struct net_devi + struct mii_ioctl_data *data = if_mii(rq); + int res; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + res = usb_autopm_get_interface(tp->intf); +@@ -9266,7 +9266,7 @@ static const struct net_device_ops rtl81 + + static void rtl8152_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (tp->version != RTL_VER_01) +@@ -9275,7 +9275,7 @@ static void rtl8152_unload(struct r8152 + + static void rtl8153_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_power_cut_en(tp, false); +@@ -9283,7 +9283,7 @@ static void rtl8153_unload(struct r8152 + + static void rtl8153b_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_power_cut_en(tp, false); diff --git a/target/linux/generic/backport-6.1/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch b/target/linux/generic/backport-6.1/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch new file mode 100644 index 00000000000..2cbe3650352 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch @@ -0,0 +1,398 @@ +From d9962b0d42029bcb40fe3c38bce06d1870fa4df4 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:59 -0700 +Subject: [PATCH] r8152: Block future register access if register access fails + +Even though the functions to read/write registers can fail, most of +the places in the r8152 driver that read/write register values don't +check error codes. The lack of error code checking is problematic in +at least two ways. + +The first problem is that the r8152 driver often uses code patterns +similar to this: + x = read_register() + x = x | SOME_BIT; + write_register(x); + +...with the above pattern, if the read_register() fails and returns +garbage then we'll end up trying to write modified garbage back to the +Realtek adapter. If the write_register() succeeds that's bad. Note +that as of commit f53a7ad18959 ("r8152: Set memory to all 0xFFs on +failed reg reads") the "garbage" returned by read_register() will at +least be consistent garbage, but it is still garbage. + +It turns out that this problem is very serious. Writing garbage to +some of the hardware registers on the Ethernet adapter can put the +adapter in such a bad state that it needs to be power cycled (fully +unplugged and plugged in again) before it can enumerate again. + +The second problem is that the r8152 driver generally has functions +that are long sequences of register writes. Assuming everything will +be OK if a random register write fails in the middle isn't a great +assumption. + +One might wonder if the above two problems are real. You could ask if +we would really have a successful write after a failed read. It turns +out that the answer appears to be "yes, this can happen". In fact, +we've seen at least two distinct failure modes where this happens. + +On a sc7180-trogdor Chromebook if you drop into kdb for a while and +then resume, you can see: +1. We get a "Tx timeout" +2. The "Tx timeout" queues up a USB reset. +3. In rtl8152_pre_reset() we try to reinit the hardware. +4. The first several (2-9) register accesses fail with a timeout, then + things recover. + +The above test case was actually fixed by the patch ("r8152: Increase +USB control msg timeout to 5000ms as per spec") but at least shows +that we really can see successful calls after failed ones. + +On a different (AMD) based Chromebook with a particular adapter, we +found that during reboot tests we'd also sometimes get a transitory +failure. In this case we saw -EPIPE being returned sometimes. Retrying +worked, but retrying is not always safe for all register accesses +since reading/writing some registers might have side effects (like +registers that clear on read). + +Let's fully lock out all register access if a register access fails. +When we do this, we'll try to queue up a USB reset and try to unlock +register access after the reset. This is slightly tricker than it +sounds since the r8152 driver has an optimized reset sequence that +only works reliably after probe happens. In order to handle this, we +avoid the optimized reset if probe didn't finish. Instead, we simply +retry the probe routine in this case. + +When locking out access, we'll use the existing infrastructure that +the driver was using when it detected we were unplugged. This keeps us +from getting stuck in delay loops in some parts of the driver. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 207 ++++++++++++++++++++++++++++++++++------ + 1 file changed, 176 insertions(+), 31 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -772,6 +772,9 @@ enum rtl8152_flags { + SCHEDULE_TASKLET, + GREEN_ETHERNET, + RX_EPROTO, ++ IN_PRE_RESET, ++ PROBED_WITH_NO_ERRORS, ++ PROBE_SHOULD_RETRY, + }; + + #define DEVICE_ID_LENOVO_USB_C_TRAVEL_HUB 0x721e +@@ -952,6 +955,8 @@ struct r8152 { + u8 version; + u8 duplex; + u8 autoneg; ++ ++ unsigned int reg_access_reset_count; + }; + + /** +@@ -1199,6 +1204,96 @@ static unsigned int agg_buf_sz = 16384; + + #define RTL_LIMITED_TSO_SIZE (size_to_mtu(agg_buf_sz) - sizeof(struct tx_desc)) + ++/* If register access fails then we block access and issue a reset. If this ++ * happens too many times in a row without a successful access then we stop ++ * trying to reset and just leave access blocked. ++ */ ++#define REGISTER_ACCESS_MAX_RESETS 3 ++ ++static void rtl_set_inaccessible(struct r8152 *tp) ++{ ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static void rtl_set_accessible(struct r8152 *tp) ++{ ++ clear_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static ++int r8152_control_msg(struct r8152 *tp, unsigned int pipe, __u8 request, ++ __u8 requesttype, __u16 value, __u16 index, void *data, ++ __u16 size, const char *msg_tag) ++{ ++ struct usb_device *udev = tp->udev; ++ int ret; ++ ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; ++ ++ ret = usb_control_msg(udev, pipe, request, requesttype, ++ value, index, data, size, ++ USB_CTRL_GET_TIMEOUT); ++ ++ /* No need to issue a reset to report an error if the USB device got ++ * unplugged; just return immediately. ++ */ ++ if (ret == -ENODEV) ++ return ret; ++ ++ /* If the write was successful then we're done */ ++ if (ret >= 0) { ++ tp->reg_access_reset_count = 0; ++ return ret; ++ } ++ ++ dev_err(&udev->dev, ++ "Failed to %s %d bytes at %#06x/%#06x (%d)\n", ++ msg_tag, size, value, index, ret); ++ ++ /* Block all future register access until we reset. Much of the code ++ * in the driver doesn't check for errors. Notably, many parts of the ++ * driver do a read/modify/write of a register value without ++ * confirming that the read succeeded. Writing back modified garbage ++ * like this can fully wedge the adapter, requiring a power cycle. ++ */ ++ rtl_set_inaccessible(tp); ++ ++ /* If probe hasn't yet finished, then we'll request a retry of the ++ * whole probe routine if we get any control transfer errors. We ++ * never have to clear this bit since we free/reallocate the whole "tp" ++ * structure if we retry probe. ++ */ ++ if (!test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) { ++ set_bit(PROBE_SHOULD_RETRY, &tp->flags); ++ return ret; ++ } ++ ++ /* Failing to access registers in pre-reset is not surprising since we ++ * wouldn't be resetting if things were behaving normally. The register ++ * access we do in pre-reset isn't truly mandatory--we're just reusing ++ * the disable() function and trying to be nice by powering the ++ * adapter down before resetting it. Thus, if we're in pre-reset, ++ * we'll return right away and not try to queue up yet another reset. ++ * We know the post-reset is already coming. ++ */ ++ if (test_bit(IN_PRE_RESET, &tp->flags)) ++ return ret; ++ ++ if (tp->reg_access_reset_count < REGISTER_ACCESS_MAX_RESETS) { ++ usb_queue_reset_device(tp->intf); ++ tp->reg_access_reset_count++; ++ } else if (tp->reg_access_reset_count == REGISTER_ACCESS_MAX_RESETS) { ++ dev_err(&udev->dev, ++ "Tried to reset %d times; giving up.\n", ++ REGISTER_ACCESS_MAX_RESETS); ++ } ++ ++ return ret; ++} ++ + static + int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) + { +@@ -1209,9 +1304,10 @@ int get_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_in, +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- value, index, tmp, size, USB_CTRL_GET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_in, ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ value, index, tmp, size, "read"); ++ + if (ret < 0) + memset(data, 0xff, size); + else +@@ -1232,9 +1328,9 @@ int set_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_out, +- RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, +- value, index, tmp, size, USB_CTRL_SET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_out, ++ RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, ++ value, index, tmp, size, "write"); + + kfree(tmp); + +@@ -1243,10 +1339,8 @@ int set_registers(struct r8152 *tp, u16 + + static void rtl_set_unplug(struct r8152 *tp) + { +- if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_INACCESSIBLE, &tp->flags); +- smp_mb__after_atomic(); +- } ++ if (tp->udev->state == USB_STATE_NOTATTACHED) ++ rtl_set_inaccessible(tp); + } + + static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, +@@ -8261,7 +8355,7 @@ static int rtl8152_pre_reset(struct usb_ + struct r8152 *tp = usb_get_intfdata(intf); + struct net_device *netdev; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + + netdev = tp->netdev; +@@ -8276,7 +8370,9 @@ static int rtl8152_pre_reset(struct usb_ + napi_disable(&tp->napi); + if (netif_carrier_ok(netdev)) { + mutex_lock(&tp->control); ++ set_bit(IN_PRE_RESET, &tp->flags); + tp->rtl_ops.disable(tp); ++ clear_bit(IN_PRE_RESET, &tp->flags); + mutex_unlock(&tp->control); + } + +@@ -8289,9 +8385,11 @@ static int rtl8152_post_reset(struct usb + struct net_device *netdev; + struct sockaddr sa; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + ++ rtl_set_accessible(tp); ++ + /* reset the MAC address in case of policy change */ + if (determine_ethernet_addr(tp, &sa) >= 0) { + rtnl_lock(); +@@ -9493,17 +9591,29 @@ static u8 __rtl_get_hw_ver(struct usb_de + __le32 *tmp; + u8 version; + int ret; ++ int i; + + tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + if (!tmp) + return 0; + +- ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), +- USB_CTRL_GET_TIMEOUT); +- if (ret > 0) +- ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ /* Retry up to 3 times in case there is a transitory error. We do this ++ * since retrying a read of the version is always safe and this ++ * function doesn't take advantage of r8152_control_msg(). ++ */ ++ for (i = 0; i < 3; i++) { ++ ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), ++ USB_CTRL_GET_TIMEOUT); ++ if (ret > 0) { ++ ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ break; ++ } ++ } ++ ++ if (i != 0 && ret > 0) ++ dev_warn(&udev->dev, "Needed %d retries to read version\n", i); + + kfree(tmp); + +@@ -9602,25 +9712,14 @@ static bool rtl8152_supports_lenovo_macp + return 0; + } + +-static int rtl8152_probe(struct usb_interface *intf, +- const struct usb_device_id *id) ++static int rtl8152_probe_once(struct usb_interface *intf, ++ const struct usb_device_id *id, u8 version) + { + struct usb_device *udev = interface_to_usbdev(intf); + struct r8152 *tp; + struct net_device *netdev; +- u8 version; + int ret; + +- if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) +- return -ENODEV; +- +- if (!rtl_check_vendor_ok(intf)) +- return -ENODEV; +- +- version = rtl8152_get_version(intf); +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { +@@ -9783,10 +9882,20 @@ static int rtl8152_probe(struct usb_inte + else + device_set_wakeup_enable(&udev->dev, false); + ++ /* If we saw a control transfer error while probing then we may ++ * want to try probe() again. Consider this an error. ++ */ ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ goto out2; ++ ++ set_bit(PROBED_WITH_NO_ERRORS, &tp->flags); + netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION); + + return 0; + ++out2: ++ unregister_netdev(netdev); ++ + out1: + tasklet_kill(&tp->tx_tl); + cancel_delayed_work_sync(&tp->hw_phy_work); +@@ -9795,10 +9904,46 @@ out1: + rtl8152_release_firmware(tp); + usb_set_intfdata(intf, NULL); + out: ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ ret = -EAGAIN; ++ + free_netdev(netdev); + return ret; + } + ++#define RTL8152_PROBE_TRIES 3 ++ ++static int rtl8152_probe(struct usb_interface *intf, ++ const struct usb_device_id *id) ++{ ++ u8 version; ++ int ret; ++ int i; ++ ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ ++ if (!rtl_check_vendor_ok(intf)) ++ return -ENODEV; ++ ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ ++ for (i = 0; i < RTL8152_PROBE_TRIES; i++) { ++ ret = rtl8152_probe_once(intf, id, version); ++ if (ret != -EAGAIN) ++ break; ++ } ++ if (ret == -EAGAIN) { ++ dev_err(&intf->dev, ++ "r8152 failed probe after %d tries; giving up\n", i); ++ return -ENODEV; ++ } ++ ++ return ret; ++} ++ + static void rtl8152_disconnect(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); diff --git a/target/linux/generic/backport-6.1/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch b/target/linux/generic/backport-6.1/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch new file mode 100644 index 00000000000..7bbd1be8208 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch @@ -0,0 +1,83 @@ +From 66eee612a1ba39f9a76a9ace4a34d012044767fb Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 26 Sep 2023 19:17:13 +0800 +Subject: [PATCH] r8152: break the loop when the budget is exhausted + +[ Upstream commit 2cf51f931797d9a47e75d999d0993a68cbd2a560 ] + +A bulk transfer of the USB may contain many packets. And, the total +number of the packets in the bulk transfer may be more than budget. + +Originally, only budget packets would be handled by napi_gro_receive(), +and the other packets would be queued in the driver for next schedule. + +This patch would break the loop about getting next bulk transfer, when +the budget is exhausted. That is, only the current bulk transfer would +be handled, and the other bulk transfers would be queued for next +schedule. Besides, the packets which are more than the budget in the +current bulk trasnfer would be still queued in the driver, as the +original method. + +In addition, a bulk transfer wouldn't contain more than 400 packets, so +the check of queue length is unnecessary. Therefore, I replace it with +WARN_ON_ONCE(). + +Fixes: cf74eb5a5bc8 ("eth: r8152: try to use a normal budget") +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230926111714.9448-433-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/r8152.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -2542,7 +2542,7 @@ static int rx_bottom(struct r8152 *tp, i + } + } + +- if (list_empty(&tp->rx_done)) ++ if (list_empty(&tp->rx_done) || work_done >= budget) + goto out1; + + clear_bit(RX_EPROTO, &tp->flags); +@@ -2558,6 +2558,15 @@ static int rx_bottom(struct r8152 *tp, i + struct urb *urb; + u8 *rx_data; + ++ /* A bulk transfer of USB may contain may packets, so the ++ * total packets may more than the budget. Deal with all ++ * packets in current bulk transfer, and stop to handle the ++ * next bulk transfer until next schedule, if budget is ++ * exhausted. ++ */ ++ if (work_done >= budget) ++ break; ++ + list_del_init(cursor); + + agg = list_entry(cursor, struct rx_agg, list); +@@ -2577,9 +2586,7 @@ static int rx_bottom(struct r8152 *tp, i + unsigned int pkt_len, rx_frag_head_sz; + struct sk_buff *skb; + +- /* limit the skb numbers for rx_queue */ +- if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) +- break; ++ WARN_ON_ONCE(skb_queue_len(&tp->rx_queue) >= 1000); + + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; + if (pkt_len < ETH_ZLEN) +@@ -2657,9 +2664,10 @@ submit: + } + } + ++ /* Splice the remained list back to rx_done for next schedule */ + if (!list_empty(&rx_queue)) { + spin_lock_irqsave(&tp->rx_lock, flags); +- list_splice_tail(&rx_queue, &tp->rx_done); ++ list_splice(&rx_queue, &tp->rx_done); + spin_unlock_irqrestore(&tp->rx_lock, flags); + } + diff --git a/target/linux/generic/backport-6.1/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch b/target/linux/generic/backport-6.1/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch new file mode 100644 index 00000000000..c858152067c --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch @@ -0,0 +1,47 @@ +From 1b0fce8c8e69485e49a7d34aac3d4c2a2aa15d62 Mon Sep 17 00:00:00 2001 +From: Davide Tronchin +Date: Thu, 29 Jun 2023 12:37:36 +0200 +Subject: [PATCH] net: usb: cdc_ether: add u-blox 0x1313 composition. + +Add CDC-ECM support for LARA-R6 01B. + +The new LARA-R6 product variant identified by the "01B" string can be +configured (by AT interface) in three different USB modes: +* Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial +interfaces +* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial +interfaces and 1 RmNet virtual network interface +* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial +interface and 1 CDC-ECM virtual network interface +The first 4 interfaces of all the 3 configurations (default, RmNet, ECM) +are the same. + +In CDC-ECM mode LARA-R6 01B exposes the following interfaces: +If 0: Diagnostic +If 1: AT parser +If 2: AT parser +If 3: AT parset/alternative functions +If 4: CDC-ECM interface + +Signed-off-by: Davide Tronchin +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -879,6 +879,12 @@ static const struct usb_device_id produc + USB_CDC_PROTO_NONE), + .driver_info = (unsigned long)&wwan_info, + }, { ++ /* U-blox LARA-R6 01B */ ++ USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1313, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, ++ USB_CDC_PROTO_NONE), ++ .driver_info = (unsigned long)&wwan_info, ++}, { + /* ZTE modules */ + USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, diff --git a/target/linux/generic/backport-6.1/795-v6.7-16-r8152-use-napi_gro_frags.patch b/target/linux/generic/backport-6.1/795-v6.7-16-r8152-use-napi_gro_frags.patch new file mode 100644 index 00000000000..3c9680a2790 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.7-16-r8152-use-napi_gro_frags.patch @@ -0,0 +1,122 @@ +From 788d30daa8f97f06166b6a63f0e51f2a4c2f036a Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 26 Sep 2023 19:17:14 +0800 +Subject: [PATCH] r8152: use napi_gro_frags + +Use napi_gro_frags() for the skb of fragments when the work_done is less +than budget. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230926111714.9448-434-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 67 ++++++++++++++++++++++++++++++----------- + 1 file changed, 50 insertions(+), 17 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -2583,8 +2583,9 @@ static int rx_bottom(struct r8152 *tp, i + while (urb->actual_length > len_used) { + struct net_device *netdev = tp->netdev; + struct net_device_stats *stats = &netdev->stats; +- unsigned int pkt_len, rx_frag_head_sz; ++ unsigned int pkt_len, rx_frag_head_sz, len; + struct sk_buff *skb; ++ bool use_frags; + + WARN_ON_ONCE(skb_queue_len(&tp->rx_queue) >= 1000); + +@@ -2597,45 +2598,77 @@ static int rx_bottom(struct r8152 *tp, i + break; + + pkt_len -= ETH_FCS_LEN; ++ len = pkt_len; + rx_data += sizeof(struct rx_desc); + +- if (!agg_free || tp->rx_copybreak > pkt_len) +- rx_frag_head_sz = pkt_len; ++ if (!agg_free || tp->rx_copybreak > len) ++ use_frags = false; + else +- rx_frag_head_sz = tp->rx_copybreak; ++ use_frags = true; ++ ++ if (use_frags) { ++ /* If the budget is exhausted, the packet ++ * would be queued in the driver. That is, ++ * napi_gro_frags() wouldn't be called, so ++ * we couldn't use napi_get_frags(). ++ */ ++ if (work_done >= budget) { ++ rx_frag_head_sz = tp->rx_copybreak; ++ skb = napi_alloc_skb(napi, ++ rx_frag_head_sz); ++ } else { ++ rx_frag_head_sz = 0; ++ skb = napi_get_frags(napi); ++ } ++ } else { ++ rx_frag_head_sz = 0; ++ skb = napi_alloc_skb(napi, len); ++ } + +- skb = napi_alloc_skb(napi, rx_frag_head_sz); + if (!skb) { + stats->rx_dropped++; + goto find_next_rx; + } + + skb->ip_summed = r8152_rx_csum(tp, rx_desc); +- memcpy(skb->data, rx_data, rx_frag_head_sz); +- skb_put(skb, rx_frag_head_sz); +- pkt_len -= rx_frag_head_sz; +- rx_data += rx_frag_head_sz; +- if (pkt_len) { ++ rtl_rx_vlan_tag(rx_desc, skb); ++ ++ if (use_frags) { ++ if (rx_frag_head_sz) { ++ memcpy(skb->data, rx_data, ++ rx_frag_head_sz); ++ skb_put(skb, rx_frag_head_sz); ++ len -= rx_frag_head_sz; ++ rx_data += rx_frag_head_sz; ++ skb->protocol = eth_type_trans(skb, ++ netdev); ++ } ++ + skb_add_rx_frag(skb, 0, agg->page, + agg_offset(agg, rx_data), +- pkt_len, +- SKB_DATA_ALIGN(pkt_len)); ++ len, SKB_DATA_ALIGN(len)); + get_page(agg->page); ++ } else { ++ memcpy(skb->data, rx_data, len); ++ skb_put(skb, len); ++ skb->protocol = eth_type_trans(skb, netdev); + } + +- skb->protocol = eth_type_trans(skb, netdev); +- rtl_rx_vlan_tag(rx_desc, skb); + if (work_done < budget) { ++ if (use_frags) ++ napi_gro_frags(napi); ++ else ++ napi_gro_receive(napi, skb); ++ + work_done++; + stats->rx_packets++; +- stats->rx_bytes += skb->len; +- napi_gro_receive(napi, skb); ++ stats->rx_bytes += pkt_len; + } else { + __skb_queue_tail(&tp->rx_queue, skb); + } + + find_next_rx: +- rx_data = rx_agg_align(rx_data + pkt_len + ETH_FCS_LEN); ++ rx_data = rx_agg_align(rx_data + len + ETH_FCS_LEN); + rx_desc = (struct rx_desc *)rx_data; + len_used = agg_offset(agg, rx_data); + len_used += sizeof(struct rx_desc); diff --git a/target/linux/generic/backport-6.1/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch b/target/linux/generic/backport-6.1/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch new file mode 100644 index 00000000000..b71df6fa572 --- /dev/null +++ b/target/linux/generic/backport-6.1/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch @@ -0,0 +1,29 @@ +From a067943129b4ec6b835e02cfd5fbef01093c1471 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sun, 8 Oct 2023 16:40:13 +0200 +Subject: [PATCH] leds: core: Add more colors from DT bindings to led_colors + +The colors are already part of DT bindings. Make sure the kernel is +able to convert them to strings. + +Signed-off-by: Ondrej Jirman +Link: https://lore.kernel.org/r/20231008144014.1180334-1-megi@xff.cz +Signed-off-by: Lee Jones +--- + drivers/leds/led-core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/leds/led-core.c ++++ b/drivers/leds/led-core.c +@@ -36,6 +36,11 @@ const char * const led_colors[LED_COLOR_ + [LED_COLOR_ID_IR] = "ir", + [LED_COLOR_ID_MULTI] = "multicolor", + [LED_COLOR_ID_RGB] = "rgb", ++ [LED_COLOR_ID_PURPLE] = "purple", ++ [LED_COLOR_ID_ORANGE] = "orange", ++ [LED_COLOR_ID_PINK] = "pink", ++ [LED_COLOR_ID_CYAN] = "cyan", ++ [LED_COLOR_ID_LIME] = "lime", + }; + EXPORT_SYMBOL_GPL(led_colors); + diff --git a/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch index 96525089ef5..26c5af8510e 100644 --- a/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: David Bauer #include #include #include -@@ -6896,6 +6897,22 @@ static void rtl_tally_reset(struct r8152 +@@ -6980,6 +6981,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -6937,6 +6954,8 @@ static void r8152b_init(struct r8152 *tp +@@ -7021,6 +7038,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -7077,6 +7096,8 @@ static void r8153_init(struct r8152 *tp) +@@ -7161,6 +7180,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -7159,6 +7180,8 @@ static void r8153b_init(struct r8152 *tp +@@ -7243,6 +7264,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ diff --git a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch index 304f5480a3f..60f02f71436 100644 --- a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch @@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1144,6 +1149,11 @@ static const struct usb_device_id option +@@ -1146,6 +1151,11 @@ static const struct usb_device_id option { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */ .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) }, @@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support /* Quectel products using Qualcomm vendor ID */ { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), -@@ -1185,6 +1195,11 @@ static const struct usb_device_id option +@@ -1187,6 +1197,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch b/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch index 33c5c271212..a463bf7c4eb 100644 --- a/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch +++ b/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle static void phylink_mac_pcs_get_state(struct phylink *pl, struct phylink_link_state *state) { -@@ -3014,6 +3013,52 @@ void phylink_mii_c22_pcs_get_state(struc +@@ -3015,6 +3014,52 @@ void phylink_mii_c22_pcs_get_state(struc EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_get_state); /** @@ -118,7 +118,7 @@ Signed-off-by: Daniel Golle * phylink_mii_c22_pcs_set_advertisement() - configure the clause 37 PCS * advertisement * @pcs: a pointer to a &struct mdio_device. -@@ -3085,6 +3130,46 @@ int phylink_mii_c22_pcs_set_advertisemen +@@ -3086,6 +3131,46 @@ int phylink_mii_c22_pcs_set_advertisemen EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_set_advertisement); /** diff --git a/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch b/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch index fd2687d8ba9..df04511c81b 100644 --- a/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch +++ b/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch @@ -7,8 +7,8 @@ PHYs AQR113C and AQR813. Signed-off-by: Birger Koblitz ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -23,6 +23,7 @@ #define PHY_ID_AQCS109 0x03a1b5c2 #define PHY_ID_AQR405 0x03a1b4b0 @@ -17,7 +17,7 @@ Signed-off-by: Birger Koblitz #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -415,6 +416,49 @@ static int aqr107_read_rate(struct phy_d +@@ -360,6 +361,49 @@ static int aqr107_read_rate(struct phy_d return 0; } @@ -67,7 +67,7 @@ Signed-off-by: Birger Koblitz static int aqr107_read_status(struct phy_device *phydev) { int val, ret; -@@ -554,7 +598,7 @@ static void aqr107_chip_info(struct phy_ +@@ -499,7 +543,7 @@ static void aqr107_chip_info(struct phy_ build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val); prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val); @@ -76,7 +76,7 @@ Signed-off-by: Birger Koblitz fw_major, fw_minor, build_id, prov_id); } -@@ -809,7 +853,7 @@ static struct phy_driver aqr_driver[] = +@@ -760,7 +804,7 @@ static struct phy_driver aqr_driver[] = .config_aneg = aqr_config_aneg, .config_intr = aqr_config_intr, .handle_interrupt = aqr_handle_interrupt, @@ -85,7 +85,7 @@ Signed-off-by: Birger Koblitz .get_tunable = aqr107_get_tunable, .set_tunable = aqr107_set_tunable, .suspend = aqr107_suspend, -@@ -819,6 +863,24 @@ static struct phy_driver aqr_driver[] = +@@ -770,6 +814,24 @@ static struct phy_driver aqr_driver[] = .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, }, @@ -110,7 +110,7 @@ Signed-off-by: Birger Koblitz }; module_phy_driver(aqr_driver); -@@ -832,6 +894,7 @@ static struct mdio_device_id __maybe_unu +@@ -783,6 +845,7 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, diff --git a/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch b/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch index 77b190464cf..3823050e341 100644 --- a/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch +++ b/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch @@ -10,11 +10,11 @@ different firmware on the PHY. Signed-off-by: Alex Marginean --- - drivers/net/phy/aquantia_main.c | 88 +++++++++++++++++++++++++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -24,6 +24,8 @@ #define PHY_ID_AQR405 0x03a1b4b0 #define PHY_ID_AQR113C 0x31c31c12 @@ -24,7 +24,7 @@ Signed-off-by: Alex Marginean #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -151,6 +153,29 @@ +@@ -96,6 +98,29 @@ #define AQR107_OP_IN_PROG_SLEEP 1000 #define AQR107_OP_IN_PROG_TIMEOUT 100000 @@ -54,7 +54,7 @@ Signed-off-by: Alex Marginean struct aqr107_hw_stat { const char *name; int reg; -@@ -282,6 +307,51 @@ static int aqr_config_aneg(struct phy_de +@@ -227,6 +252,51 @@ static int aqr_config_aneg(struct phy_de return genphy_c45_check_and_restart_aneg(phydev, changed); } @@ -106,7 +106,7 @@ Signed-off-by: Alex Marginean static int aqr_config_intr(struct phy_device *phydev) { bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED; -@@ -881,6 +951,30 @@ static struct phy_driver aqr_driver[] = +@@ -832,6 +902,30 @@ static struct phy_driver aqr_driver[] = .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, }, @@ -137,7 +137,7 @@ Signed-off-by: Alex Marginean }; module_phy_driver(aqr_driver); -@@ -895,6 +989,8 @@ static struct mdio_device_id __maybe_unu +@@ -846,6 +940,8 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) }, diff --git a/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch b/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch index 8e204cb146a..33b182eab92 100644 --- a/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch +++ b/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch @@ -9,12 +9,12 @@ these protocols leads to link issues on system side. Signed-off-by: Alex Marginean --- - drivers/net/phy/aquantia_main.c | 8 +++++++- + drivers/net/phy/aquantia/aquantia_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c -@@ -340,10 +340,16 @@ static int aqr_config_aneg_set_prot(stru +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -285,10 +285,16 @@ static int aqr_config_aneg_set_prot(stru phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE, aquantia_syscfg[if_type].start_rate); diff --git a/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch b/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch index 0a1e9706239..f59a88a1470 100644 --- a/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch +++ b/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch @@ -5,11 +5,11 @@ Subject: [PATCH] PONRTSYS-8842: aquantia: Add AQR113 driver support Add a new entry for AQR113 PHY_ID --- - drivers/net/phy/aquantia_main.c | 10 ++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -26,6 +26,7 @@ #define PHY_ID_AQR813 0x31c31cb2 #define PHY_ID_AQR112 0x03a1b662 @@ -18,7 +18,7 @@ Add a new entry for AQR113 PHY_ID #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -981,6 +982,14 @@ static struct phy_driver aqr_driver[] = +@@ -932,6 +933,14 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, }, @@ -33,7 +33,7 @@ Add a new entry for AQR113 PHY_ID }; module_phy_driver(aqr_driver); -@@ -997,6 +1006,7 @@ static struct mdio_device_id __maybe_unu +@@ -948,6 +957,7 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR412) }, diff --git a/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch b/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch index 654fea56611..c29c36aa22a 100644 --- a/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch +++ b/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch @@ -7,11 +7,11 @@ As advised by Ian Chang this PHY is used in Puzzle devices. Signed-off-by: Daniel Golle --- - drivers/net/phy/aquantia_main.c | 10 ++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -27,6 +27,8 @@ #define PHY_ID_AQR112 0x03a1b662 #define PHY_ID_AQR412 0x03a1b712 @@ -21,7 +21,7 @@ Signed-off-by: Daniel Golle #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -990,6 +992,30 @@ static struct phy_driver aqr_driver[] = +@@ -941,6 +943,30 @@ static struct phy_driver aqr_driver[] = .handle_interrupt = aqr_handle_interrupt, .read_status = aqr107_read_status, }, @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle }; module_phy_driver(aqr_driver); -@@ -1007,6 +1033,8 @@ static struct mdio_device_id __maybe_unu +@@ -958,6 +984,8 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR412) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) }, diff --git a/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch b/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch index dc25905fee1..dbae8f52f47 100644 --- a/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch +++ b/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch @@ -10,8 +10,8 @@ This is a 5GbE chip but it reports support for 10G. Implement config_init() to set max speed to 5G. Signed-off-by: Thomas Kupper ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -24,6 +24,8 @@ #define PHY_ID_AQR405 0x03a1b4b0 #define PHY_ID_AQR113C 0x31c31c12 @@ -21,7 +21,7 @@ Signed-off-by: Thomas Kupper #define PHY_ID_AQR112 0x03a1b662 #define PHY_ID_AQR412 0x03a1b712 #define PHY_ID_AQR113 0x31c31c40 -@@ -729,6 +731,34 @@ static int aqcs109_config_init(struct ph +@@ -674,6 +676,34 @@ static int aqcs109_config_init(struct ph return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); } @@ -56,7 +56,7 @@ Signed-off-by: Thomas Kupper static void aqr107_link_change_notify(struct phy_device *phydev) { u8 fw_major, fw_minor; -@@ -961,6 +991,42 @@ static struct phy_driver aqr_driver[] = +@@ -912,6 +942,42 @@ static struct phy_driver aqr_driver[] = .link_change_notify = aqr107_link_change_notify, }, { @@ -99,7 +99,7 @@ Signed-off-by: Thomas Kupper PHY_ID_MATCH_MODEL(PHY_ID_AQR112), .name = "Aquantia AQR112", .probe = aqr107_probe, -@@ -1030,6 +1096,8 @@ static struct mdio_device_id __maybe_unu +@@ -981,6 +1047,8 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) }, diff --git a/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch index 7b7fcca11f4..c842639792f 100644 --- a/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: David Bauer #include #include #include -@@ -6903,6 +6904,22 @@ static void rtl_tally_reset(struct r8152 +@@ -7020,6 +7021,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -6944,6 +6961,8 @@ static void r8152b_init(struct r8152 *tp +@@ -7061,6 +7078,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -7084,6 +7103,8 @@ static void r8153_init(struct r8152 *tp) +@@ -7201,6 +7220,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -7166,6 +7187,8 @@ static void r8153b_init(struct r8152 *tp +@@ -7283,6 +7304,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ diff --git a/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch index 98b5433d063..481185122fe 100644 --- a/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch @@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1144,6 +1149,11 @@ static const struct usb_device_id option +@@ -1146,6 +1151,11 @@ static const struct usb_device_id option { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */ .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) }, @@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support /* Quectel products using Qualcomm vendor ID */ { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), -@@ -1185,6 +1195,11 @@ static const struct usb_device_id option +@@ -1187,6 +1197,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, 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 a15fc786a0e..8743d7f3671 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 -@@ -7703,7 +7703,7 @@ static int nft_register_flowtable_net_ho +@@ -7708,7 +7708,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/920-mangle_bootargs.patch b/target/linux/generic/pending-5.15/920-mangle_bootargs.patch index 7e1f26d243f..5f2bb8c37f4 100644 --- a/target/linux/generic/pending-5.15/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-5.15/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -614,6 +614,29 @@ static inline void setup_nr_cpu_ids(void +@@ -618,6 +618,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -953,6 +976,7 @@ asmlinkage __visible void __init __no_sa +@@ -957,6 +980,7 @@ asmlinkage __visible void __init __no_sa pr_notice("%s", linux_banner); early_security_init(); setup_arch(&command_line); diff --git a/target/linux/generic/pending-5.15/980-tools-thermal-tmon-Fix-compilation-warning-for-wrong.patch b/target/linux/generic/pending-5.15/980-tools-thermal-tmon-Fix-compilation-warning-for-wrong.patch new file mode 100644 index 00000000000..6a0a19987fa --- /dev/null +++ b/target/linux/generic/pending-5.15/980-tools-thermal-tmon-Fix-compilation-warning-for-wrong.patch @@ -0,0 +1,51 @@ +From a7a94ca21ac0f347f683d33c72b4aab57ce5eec3 Mon Sep 17 00:00:00 2001 +From: Florian Eckert +Date: Mon, 20 Nov 2023 11:13:20 +0100 +Subject: [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format + +The following warnings are shown during compilation: + +tui.c: In function 'show_cooling_device': + tui.c:216:40: warning: format '%d' expects argument of type 'int', but +argument 7 has type 'long unsigned int' [-Wformat=] + 216 | "%02d %12.12s%6d %6d", + | ~~^ + | | + | int + | %6ld + ...... + 219 | ptdata.cdi[j].cur_state, + | ~~~~~~~~~~~~~~~~~~~~~~~ + | | + | long unsigned int + tui.c:216:44: warning: format '%d' expects argument of type 'int', but +argument 8 has type 'long unsigned int' [-Wformat=] + 216 | "%02d %12.12s%6d %6d", + | ~~^ + | | + | int + | %6ld + ...... + 220 | ptdata.cdi[j].max_state); + | ~~~~~~~~~~~~~~~~~~~~~~~ + | | + | long unsigned int + +To fix this, the correct string format must be used for printing. + +Signed-off-by: Florian Eckert +--- + tools/thermal/tmon/tui.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/thermal/tmon/tui.c ++++ b/tools/thermal/tmon/tui.c +@@ -213,7 +213,7 @@ void show_cooling_device(void) + * cooling device instances. skip unused idr. + */ + mvwprintw(cooling_device_window, j + 2, 1, +- "%02d %12.12s%6d %6d", ++ "%02d %12.12s%6lu %6lu", + ptdata.cdi[j].instance, + ptdata.cdi[j].type, + ptdata.cdi[j].cur_state, 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 0d6adff4eaf..8c508e36579 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 -@@ -7878,7 +7878,7 @@ static int nft_register_flowtable_net_ho +@@ -7883,7 +7883,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/920-mangle_bootargs.patch b/target/linux/generic/pending-6.1/920-mangle_bootargs.patch index 1015266084e..db7274e7aad 100644 --- a/target/linux/generic/pending-6.1/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-6.1/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -607,6 +607,29 @@ static inline void setup_nr_cpu_ids(void +@@ -611,6 +611,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -954,6 +977,7 @@ asmlinkage __visible void __init __no_sa +@@ -958,6 +981,7 @@ asmlinkage __visible void __init __no_sa pr_notice("%s", linux_banner); early_security_init(); setup_arch(&command_line); diff --git a/target/linux/generic/pending-6.1/980-tools-thermal-tmon-Fix-compilation-warning-for-wrong.patch b/target/linux/generic/pending-6.1/980-tools-thermal-tmon-Fix-compilation-warning-for-wrong.patch new file mode 100644 index 00000000000..6a0a19987fa --- /dev/null +++ b/target/linux/generic/pending-6.1/980-tools-thermal-tmon-Fix-compilation-warning-for-wrong.patch @@ -0,0 +1,51 @@ +From a7a94ca21ac0f347f683d33c72b4aab57ce5eec3 Mon Sep 17 00:00:00 2001 +From: Florian Eckert +Date: Mon, 20 Nov 2023 11:13:20 +0100 +Subject: [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format + +The following warnings are shown during compilation: + +tui.c: In function 'show_cooling_device': + tui.c:216:40: warning: format '%d' expects argument of type 'int', but +argument 7 has type 'long unsigned int' [-Wformat=] + 216 | "%02d %12.12s%6d %6d", + | ~~^ + | | + | int + | %6ld + ...... + 219 | ptdata.cdi[j].cur_state, + | ~~~~~~~~~~~~~~~~~~~~~~~ + | | + | long unsigned int + tui.c:216:44: warning: format '%d' expects argument of type 'int', but +argument 8 has type 'long unsigned int' [-Wformat=] + 216 | "%02d %12.12s%6d %6d", + | ~~^ + | | + | int + | %6ld + ...... + 220 | ptdata.cdi[j].max_state); + | ~~~~~~~~~~~~~~~~~~~~~~~ + | | + | long unsigned int + +To fix this, the correct string format must be used for printing. + +Signed-off-by: Florian Eckert +--- + tools/thermal/tmon/tui.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/thermal/tmon/tui.c ++++ b/tools/thermal/tmon/tui.c +@@ -213,7 +213,7 @@ void show_cooling_device(void) + * cooling device instances. skip unused idr. + */ + mvwprintw(cooling_device_window, j + 2, 1, +- "%02d %12.12s%6d %6d", ++ "%02d %12.12s%6lu %6lu", + ptdata.cdi[j].instance, + ptdata.cdi[j].type, + ptdata.cdi[j].cur_state, diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds index 1ba5d2b1a77..187bafccb95 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -20,8 +20,8 @@ asus,rt-ac42u) ucidef_set_led_netdev "wan" "WAN" "blue:wan" "wan" ;; asus,rt-ac58u) - ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" - ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x1e" + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "wan" + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "br-lan" ;; avm,fritzbox-4040) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" "phy1tpt" diff --git a/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration b/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration index e8818a41ed7..a8e3cfb8651 100644 --- a/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration @@ -6,6 +6,9 @@ case "$board" in asus,map-ac2200) migrate_leds ':chan=-' ;; +asus,rt-ac58u) + migrate_leds ":status=:power" ":wlan2G=:wlan-2" ":wlan5G=:wlan-5" + ;; engenius,emr3500) migrate_leds "emr3500:=" ;; diff --git a/target/linux/ipq40xx/config-6.1 b/target/linux/ipq40xx/config-6.1 index e84823aacd3..f14dd0a4749 100644 --- a/target/linux/ipq40xx/config-6.1 +++ b/target/linux/ipq40xx/config-6.1 @@ -240,6 +240,7 @@ CONFIG_KMAP_LOCAL=y CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y # CONFIG_KPSS_XCC is not set # CONFIG_KRAITCC is not set +CONFIG_LED_TRIGGER_PHY=y CONFIG_LEDS_LP5523=y CONFIG_LEDS_LP5562=y CONFIG_LEDS_LP55XX_COMMON=y diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts index b6ff09a0420..4cf5d45ff92 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts @@ -149,25 +149,28 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts index def0401ac5c..17b67c23788 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts @@ -197,16 +197,19 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts index 22a48c12c44..ea00dd83f51 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts @@ -199,24 +199,26 @@ reg = <0x00170000 0x00010000>; read-only; - 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>; - }; - - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; - - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts index cd5b4c6ccc3..d890e83c899 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts @@ -226,16 +226,19 @@ label = "ART"; reg = <0x00160000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; u_env@170000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts index a8f24aa00e6..778394a9656 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts @@ -176,16 +176,19 @@ label = "0:ART"; reg = <0x00180000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition8@190000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts index 3060b7bd1c8..c5804b4896e 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts @@ -226,16 +226,19 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi index dc5c25c84ab..0e1527ad4f6 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi @@ -240,17 +240,20 @@ partition7@170000 { label = "ART"; reg = <0x00170000 0x00010000>; - compatible = "nvmem-cells"; read-only; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -267,20 +270,22 @@ }; partition10@1a0000 { - compatible = "nvmem-cells"; label = "dnidata"; reg = <0x001a0000 0x00010000>; read-only; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_dnidata_0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_dnidata_0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_dnidata_c: macaddr@c { - reg = <0xc 0x6>; + macaddr_dnidata_c: macaddr@c { + reg = <0xc 0x6>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts index ad3d1ac120a..a646ec3358f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts @@ -176,22 +176,29 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -300,8 +307,7 @@ label = "lan2"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; - mac-address-increment = <2>; + nvmem-cells = <&macaddr_gmac0 2>; }; &swport4 { @@ -309,7 +315,7 @@ label = "lan1"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; + nvmem-cells = <&macaddr_gmac0 0>; }; &swport5 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts index 6f5d4d8a578..3f3e7cf6833 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts @@ -175,24 +175,27 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_art_0: mac-address@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: mac-address@6 { - reg = <0x6 0x6>; - }; + macaddr_art_0: mac-address@0 { + reg = <0x0 0x6>; + }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_art_6: mac-address@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi index 4d09e86dd66..bb293bb57ea 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi @@ -185,16 +185,19 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts index 43e39bdf960..fc4bae6937f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts @@ -116,16 +116,19 @@ label = "ART"; reg = <0x140000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -133,12 +136,17 @@ label = "mac"; reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi index 52272434679..a688a8aa586 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi @@ -129,8 +129,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; - mac-address-increment = <2>; + nvmem-cells = <&macaddr_mac_0 2>; }; &switch { @@ -180,12 +179,11 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0 0>; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0 1>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts index f09a77ff59f..8eb8ce85036 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts @@ -116,16 +116,19 @@ label = "ART"; reg = <0x140000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -133,12 +136,17 @@ label = "mac"; reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts index 4fd44989c5e..b4b9451cb2c 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts @@ -133,16 +133,19 @@ label = "ART"; reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -150,12 +153,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts index af4a7b196ba..30511e38860 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts @@ -141,25 +141,28 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts index 87705e5f607..38158fbfa70 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts @@ -4,6 +4,7 @@ #include #include #include +#include / { model = "ASUS RT-AC58U"; @@ -101,37 +102,50 @@ leds { compatible = "gpio-leds"; - led_power: status { - label = "blue:status"; + led_power: led-0 { + color = ; + function = LED_FUNCTION_POWER; gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + panic-indicator; }; - wan { - label = "blue:wan"; + led-1 { + color = ; + function = LED_FUNCTION_WAN; gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + /* + * linux,default-trigger = "90000.mdio-1:04:link"; + * sadly still lacks rx+tx + */ }; - wlan2G { - label = "blue:wlan2G"; + led-2 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; }; - wlan5G { - label = "blue:wlan5G"; + led-3 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy1tpt"; }; - usb { - label = "blue:usb"; + led-4 { + color = ; + function = LED_FUNCTION_USB; gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; trigger-sources = <&usb3_port1>, <&usb3_port2>; linux,default-trigger = "usbport"; }; - lan { - label = "blue:lan"; + led-5 { + color = ; + function = LED_FUNCTION_LAN; gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts index 2dbfaa086ef..ae0d8524e52 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts @@ -263,12 +263,17 @@ label = "0:MANUDATA"; reg = <0x001e0000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_manudata_6: macaddr@6 { - reg = <0x6 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_manudata_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -276,16 +281,19 @@ label = "0:ART"; reg = <0x001f0000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -367,14 +375,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_manudata_6>; + nvmem-cells = <&precal_art_1000>, <&macaddr_manudata_6 0>; qcom,ath10k-calibration-variant = "Netgear-WAC510"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_manudata_6>; - mac-address-increment = <16>; + nvmem-cells = <&precal_art_5000>, <&macaddr_manudata_6 16>; qcom,ath10k-calibration-variant = "Netgear-WAC510"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts index 5859548254f..1f26db58690 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts @@ -126,16 +126,18 @@ reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; - - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts index 4694c568191..f3c6f34bf4f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts @@ -155,24 +155,27 @@ label = "0:ART"; reg = <0x170000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_art_0: macaddr@0{ - reg = <0x0000 0x0006>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: macaddr@6{ - reg = <0x0006 0x0006>; - }; + macaddr_art_0: macaddr@0{ + reg = <0x0000 0x0006>; + }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_art_6: macaddr@6{ + reg = <0x0006 0x0006>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts index d3481011101..369b5475d05 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts @@ -156,29 +156,32 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts index 5be88fcb314..c629c38c297 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts @@ -208,24 +208,27 @@ label = "ART"; reg = <0xb00000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_1006: macaddr@1006 { - reg = <0x1006 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_art_1006: macaddr@1006 { + reg = <0x1006 0x6>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_art_5006: macaddr@5006 { - reg = <0x5006 0x6>; + macaddr_art_5006: macaddr@5006 { + reg = <0x5006 0x6>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts index 70e05c7eef3..243d19fb033 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts @@ -68,24 +68,27 @@ label = "0:ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts index 2ad794e8ecb..93005689866 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts @@ -68,24 +68,27 @@ label = "0:ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts index dc144a15847..63fd66901d8 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts @@ -146,20 +146,23 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts index 96ab73962e9..5cb5f7ca082 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts @@ -185,20 +185,23 @@ label = "ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts index 23a654dcff5..d5d00b2eefe 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts @@ -273,16 +273,19 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts index 282a0eaaa60..677b4baa0fa 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts @@ -148,16 +148,18 @@ reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; - - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts index 80d71ac0cc8..1b1a697f13b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts @@ -238,7 +238,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; }; &switch { @@ -251,8 +251,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_0 1>; }; &swport3 { @@ -282,16 +281,19 @@ label = "ART"; reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; @@ -299,12 +301,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -451,8 +458,7 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0 2>; qcom,ath10k-calibration-variant = "ZTE-MF18A"; }; @@ -472,8 +478,7 @@ wifi2: wifi@1,0 { compatible = "pci168c,0040"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_9000>, <&macaddr_config_0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_9000>, <&macaddr_config_0 3>; qcom,ath10k-calibration-variant = "ZTE-MF18A"; reg = <0x00010000 0 0 0 0>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts index 6688577c079..54353cac58e 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts @@ -223,7 +223,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; }; &nand { @@ -247,16 +247,19 @@ label = "ART"; reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -264,12 +267,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -430,8 +438,7 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0 1>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; @@ -442,7 +449,6 @@ &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_config_0 1>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts index ff04279a600..61cbdba0d12 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts @@ -216,7 +216,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; }; &nand { @@ -240,16 +240,19 @@ label = "ART"; reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -257,12 +260,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -347,8 +355,7 @@ status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_0 1>; }; &tlmm { @@ -434,15 +441,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0 2>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_config_0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_5000>, <&macaddr_config_0 3>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts index 0d9f24ad705..bbb2cb902a2 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts @@ -216,16 +216,19 @@ label = "ART"; reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -233,12 +236,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -310,7 +318,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; }; &switch { @@ -323,8 +331,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_mac_0 1>; }; &swport5 { @@ -401,8 +408,7 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0 2>; qcom,ath10k-calibration-variant = "zte,mf289f"; }; @@ -410,8 +416,7 @@ &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0 3>; qcom,ath10k-calibration-variant = "zte,mf289f"; }; @@ -430,8 +435,7 @@ wifi2: wifi@1,0 { nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; - mac-address-increment = <4>; + nvmem-cells = <&macaddr_mac_0 4>; compatible = "qcom,ath10k"; reg = <0x00010000 0 0 0 0>; qcom,ath10k-calibration-variant = "zte,mf289f"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts index beb168eb492..2080a34e2f8 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts @@ -263,16 +263,19 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts index 259ea7bb47a..49d399ed1f4 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts @@ -141,29 +141,32 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi index d7a987f98db..1566dc39a9d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi @@ -173,16 +173,19 @@ label = "ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts index 4efcdaf3941..08c55d0c27d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts @@ -65,16 +65,19 @@ label = "0:ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts index 1f0572b8798..963c0915bb3 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts @@ -267,7 +267,7 @@ status = "okay"; // RGB LEDs - pca9633: led-controller { + pca9633: led-controller@62 { compatible = "nxp,pca9633"; nxp,hw-blink; reg = <0x62>; @@ -354,29 +354,34 @@ partition@580000 { label = "ART"; reg = <0x580000 0x80000>; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; read-only; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; @@ -476,7 +481,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; + nvmem-cells = <&macaddr_gmac0 0>; }; &wifi0 { @@ -492,8 +497,7 @@ qcom,ath10k-calibration-variant = "linksys-whw03v2"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0 1>; }; &wifi1 { @@ -503,8 +507,7 @@ qcom,ath10k-calibration-variant = "linksys-whw03v2"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0 2>; }; &wifi2 { @@ -514,6 +517,5 @@ qcom,ath10k-calibration-variant = "linksys-whw03v2"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0 3>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts index ca37884db23..2dc45444334 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts @@ -206,16 +206,19 @@ label = "0:ART"; reg = <0x170000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts index 3260de23bd4..7d030c489d2 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts @@ -331,20 +331,23 @@ label = "ART"; reg = <0x0b00000 0x0080000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - precal_art_9000: precal@9000 { - reg = <0x5000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -358,21 +361,24 @@ label = "ORGDATA"; reg = <0x0c00000 0x0080000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_orgdata_20: macaddr@20 { - reg = <0x20 0x6>; - }; - macaddr_orgdata_26: macaddr@26 { - reg = <0x26 0x6>; - }; - macaddr_orgdata_2c: macaddr@2c { - reg = <0x2c 0x6>; - }; - macaddr_orgdata_32: macaddr@32 { - reg = <0x32 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_orgdata_20: macaddr@20 { + reg = <0x20 0x6>; + }; + macaddr_orgdata_26: macaddr@26 { + reg = <0x26 0x6>; + }; + macaddr_orgdata_2c: macaddr@2c { + reg = <0x2c 0x6>; + }; + macaddr_orgdata_32: macaddr@32 { + reg = <0x32 0x6>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts index 681300c502b..3d71593e86c 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts @@ -67,16 +67,19 @@ label = "0:ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts index d84d54e39bb..4b61bbb5aca 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts @@ -225,24 +225,27 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_art_e010: mac-address@e010 { + reg = <0xe010 0x6>; + }; - macaddr_art_e010: mac-address@e010 { - reg = <0xe010 0x6>; - }; + macaddr_art_e018: mac-address@e018 { + reg = <0xe018 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_art_e018: mac-address@e018 { - reg = <0xe018 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition6@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts index 6cbfa8f37df..7e484db1b5c 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts @@ -118,16 +118,19 @@ label = "ART"; reg = <0xe0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -141,12 +144,17 @@ label = "mfginfo"; reg = <0x1e0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mfginfo_1d: macaddr@1d { - reg = <0x1d 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + compatible = "mac-base"; + reg = <0x1d 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts index 23abb3537cb..41b42e8f58f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts @@ -317,16 +317,19 @@ label = "ART"; reg = <0x1f0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -352,16 +355,21 @@ label = "mfginfo"; reg = <0x390000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mfginfo_1d: macaddr@1d { - reg = <0x1d 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + reg = <0x1d 0x6>; + }; - macaddr_mfginfo_45: macaddr@45 { - reg = <0x45 0x6>; + macaddr_mfginfo_45: macaddr@45 { + compatible = "mac-base"; + reg = <0x45 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -459,14 +467,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_45>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_45 0>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_45>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_45 1>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts index 1f7b37d56d6..3477dace727 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts @@ -150,16 +150,19 @@ label = "ART"; reg = <0x1f0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -185,12 +188,17 @@ label = "mfginfo"; reg = <0x390000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mfginfo_1d: macaddr@1d { - reg = <0x1d 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + compatible = "mac-base"; + reg = <0x1d 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi index 41de6bb218b..4b3b682260e 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi @@ -259,14 +259,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_1d>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_1d 0>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_1d>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_1d 1>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts index 7e4519a7466..9694973132f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts @@ -195,24 +195,29 @@ label = "ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_gmac0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -288,8 +293,7 @@ label = "lan2"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; - mac-address-increment = <2>; + nvmem-cells = <&macaddr_gmac0 2>; }; &swport4 { @@ -297,7 +301,7 @@ label = "lan1"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; + nvmem-cells = <&macaddr_gmac0 0>; }; &swport5 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts index 0e7f4c970f4..1a61b8161de 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts @@ -193,16 +193,19 @@ label = "ART"; reg = <0x170000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi index ebfab171f51..dbf6c14b724 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi @@ -137,7 +137,9 @@ #size-cells = <1>; mac_address: mac-address@66 { + compatible = "mac-base"; reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; }; }; }; @@ -284,9 +286,8 @@ compatible = "qcom,ath10k"; status = "okay"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -390,22 +391,20 @@ &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "Meraki-MR33"; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "Meraki-MR33"; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &gmac { status = "okay"; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts index b90b6b28c32..271a9720925 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts @@ -236,34 +236,36 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_art_0: mac-address@0 { + reg = <0x0 0x6>; + }; - macaddr_art_0: mac-address@0 { - reg = <0x0 0x6>; - }; + macaddr_art_6: mac-address@6 { + reg = <0x6 0x6>; + }; - macaddr_art_6: mac-address@6 { - reg = <0x6 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_art_1006: mac-address@1006 { - reg = <0x1006 0x6>; - }; + macaddr_art_1006: mac-address@1006 { + reg = <0x1006 0x6>; + }; - macaddr_art_5006: mac-address@5006 { - reg = <0x5006 0x6>; - }; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + macaddr_art_5006: mac-address@5006 { + reg = <0x5006 0x6>; + }; + }; }; partition8@180000 { diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index d79fda3156a..f5132cb91fd 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -68,7 +68,7 @@ define Build/mkmylofw_32m let \ size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(BLOCKSIZE))" \ + pad="$(call exp_units,$(BLOCKSIZE))" \ pad="(pad - (size % pad)) % pad" \ newsize='size + pad'; \ $(STAGING_DIR_HOST)/bin/mkmylofw \ @@ -680,6 +680,7 @@ define Device/linksys_ea6350v3 PAGESIZE := 2048 KERNEL_SIZE := 5120k IMAGE_SIZE := 35840k + NAND_SIZE := 128m UBINIZE_OPTS := -E 5 IMAGES += factory.bin IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 @@ -694,6 +695,7 @@ define Device/linksys_ea8300 SOC := qcom-ipq4019 KERNEL_SIZE := 5120k IMAGE_SIZE := 84992k + NAND_SIZE := 256m BLOCKSIZE := 128k PAGESIZE := 2048 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF @@ -711,6 +713,7 @@ define Device/linksys_mr8300 SOC := qcom-ipq4019 KERNEL_SIZE := 5120k IMAGE_SIZE := 84992k + NAND_SIZE := 256m BLOCKSIZE := 128k PAGESIZE := 2048 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF @@ -728,6 +731,7 @@ define Device/linksys_whw03v2 SOC := qcom-ipq4019 KERNEL_SIZE := 6144k IMAGE_SIZE := 158720k + NAND_SIZE := 512m BLOCKSIZE := 128k PAGESIZE := 2048 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF @@ -742,7 +746,8 @@ define Device/linksys_whw01 DEVICE_VENDOR := Linksys DEVICE_MODEL := WHW01 KERNEL_SIZE := 6144k - IMAGE_SIZE := 75776K + IMAGE_SIZE := 75776k + NAND_SIZE := 256m SOC := qcom-ipq4018 BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch b/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch index 1ef46d9be37..ae7e9f97c07 100644 --- a/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch +++ b/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch @@ -27,7 +27,7 @@ Signed-off-by: Bjorn Andersson --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -400,6 +400,29 @@ int qcom_scm_set_remote_state(u32 state, +@@ -407,6 +407,29 @@ int qcom_scm_set_remote_state(u32 state, } EXPORT_SYMBOL(qcom_scm_set_remote_state); @@ -57,7 +57,7 @@ Signed-off-by: Bjorn Andersson static int __qcom_scm_set_dload_mode(struct device *dev, bool enable) { struct qcom_scm_desc desc = { -@@ -1404,6 +1427,13 @@ static int qcom_scm_probe(struct platfor +@@ -1411,6 +1434,13 @@ static int qcom_scm_probe(struct platfor __get_convention(); diff --git a/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch b/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch index a92342215e6..cb06ff353c7 100644 --- a/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch +++ b/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch @@ -118,7 +118,7 @@ Signed-off-by: Brian Norris } --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -305,6 +305,17 @@ static int qcom_scm_set_boot_addr(void * +@@ -312,6 +312,17 @@ static int qcom_scm_set_boot_addr(void * desc.args[0] = flags; desc.args[1] = virt_to_phys(entry); diff --git a/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch b/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch index 9bae6e7b96b..dbf87d4ddeb 100644 --- a/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch +++ b/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch @@ -25,7 +25,7 @@ Signed-off-by: Robert Marko --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -369,6 +369,13 @@ config AT803X_PHY +@@ -366,6 +366,13 @@ config AT803X_PHY Currently supports the AR8030, AR8031, AR8033, AR8035 and internal QCA8337(Internal qca8k PHY) model @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -94,6 +94,7 @@ obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm +@@ -90,6 +90,7 @@ obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm obj-$(CONFIG_NATIONAL_PHY) += national.o obj-$(CONFIG_NXP_C45_TJA11XX_PHY) += nxp-c45-tja11xx.o obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o diff --git a/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch b/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch index f08ff041378..c73e40429c8 100644 --- a/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch +++ b/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -1459,7 +1459,8 @@ static int qcom_scm_probe(struct platfor +@@ -1466,7 +1466,8 @@ static int qcom_scm_probe(struct platfor static void qcom_scm_shutdown(struct platform_device *pdev) { /* Clean shutdown, disable download mode to allow normal restart */ diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi index 4662e2843cb..902df23501e 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi @@ -427,7 +427,7 @@ pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; - nvmem-cells = <&macaddr_art_6>; + nvmem-cells = <&macaddr_art_6 0>; nvmem-cell-names = "mac-address"; fixed-link { diff --git a/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 0305b7e4843..4e47c390a23 100644 --- a/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -259,7 +259,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -991,6 +995,18 @@ asmlinkage __visible void __init __no_sa +@@ -995,6 +999,18 @@ asmlinkage __visible void __init __no_sa pr_notice("Kernel command line: %s\n", saved_command_line); /* parameters may set static keys */ jump_label_init(); diff --git a/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch b/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch index 2b523984257..085d38a79a7 100644 --- a/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch +++ b/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch @@ -36,7 +36,7 @@ Signed-off-by: Christian Marangi __netif_tx_unlock_bh(netdev_get_tx_queue(priv->dev, queue)); -@@ -5474,12 +5475,13 @@ static int stmmac_napi_poll_tx(struct na +@@ -5475,12 +5476,13 @@ static int stmmac_napi_poll_tx(struct na struct stmmac_channel *ch = container_of(napi, struct stmmac_channel, tx_napi); struct stmmac_priv *priv = ch->priv_data; @@ -51,7 +51,7 @@ Signed-off-by: Christian Marangi work_done = min(work_done, budget); if (work_done < budget && napi_complete_done(napi, work_done)) { -@@ -5490,6 +5492,10 @@ static int stmmac_napi_poll_tx(struct na +@@ -5491,6 +5493,10 @@ static int stmmac_napi_poll_tx(struct na spin_unlock_irqrestore(&ch->lock, flags); } @@ -62,7 +62,7 @@ Signed-off-by: Christian Marangi return work_done; } -@@ -5499,11 +5505,12 @@ static int stmmac_napi_poll_rxtx(struct +@@ -5500,11 +5506,12 @@ static int stmmac_napi_poll_rxtx(struct container_of(napi, struct stmmac_channel, rxtx_napi); struct stmmac_priv *priv = ch->priv_data; int rx_done, tx_done, rxtx_done; @@ -76,7 +76,7 @@ Signed-off-by: Christian Marangi tx_done = min(tx_done, budget); rx_done = stmmac_rx_zc(priv, budget, chan); -@@ -5528,6 +5535,10 @@ static int stmmac_napi_poll_rxtx(struct +@@ -5529,6 +5536,10 @@ static int stmmac_napi_poll_rxtx(struct spin_unlock_irqrestore(&ch->lock, flags); } diff --git a/target/linux/ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch b/target/linux/ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch deleted file mode 100644 index 1c5e44bb724..00000000000 --- a/target/linux/ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 4e242d6e08ad1d85b832e158cd0eafcb8f3f76a1 Mon Sep 17 00:00:00 2001 -From: Linus Walleij -Date: Tue, 30 May 2023 22:40:31 +0200 -Subject: [PATCH v3] mtd: cfi_cmdset_0001: Byte swap OTP info - -Currently the offset into the device when looking for OTP -bits can go outside of the address of the MTD NOR devices, -and if that memory isn't readable, bad things happen -on the IXP4xx (added prints that illustrate the problem before -the crash): - -cfi_intelext_otp_walk walk OTP on chip 0 start at reg_prot_offset 0x00000100 -ixp4xx_copy_from copy from 0x00000100 to 0xc880dd78 -cfi_intelext_otp_walk walk OTP on chip 0 start at reg_prot_offset 0x12000000 -ixp4xx_copy_from copy from 0x12000000 to 0xc880dd78 -8<--- cut here --- -Unable to handle kernel paging request at virtual address db000000 -[db000000] *pgd=00000000 -(...) - -This happens in this case because the IXP4xx is big endian and -the 32- and 16-bit fields in the struct cfi_intelext_otpinfo are not -properly byteswapped. Compare to how the code in read_pri_intelext() -byteswaps the fields in struct cfi_pri_intelext. - -Adding a small byte swapping loop for the OTP in read_pri_intelext() -and the crash goes away. - -The problem went unnoticed for many years until I enabled -CONFIG_MTD_OTP on the IXP4xx as well, triggering the bug. - -Cc: Nicolas Pitre -Cc: stable@vger.kernel.org -Signed-off-by: Linus Walleij ---- -ChangeLog v2->v3: -- Move the byte swapping to a small loop in read_pri_intelext() - so all bytes are swapped as we reach cfi_intelext_otp_walk(). -ChangeLog v1->v2: -- Drill deeper and discover a big endian compatibility issue. ---- - drivers/mtd/chips/cfi_cmdset_0001.c | 20 ++++++++++++++++++-- - 1 file changed, 18 insertions(+), 2 deletions(-) - ---- a/drivers/mtd/chips/cfi_cmdset_0001.c -+++ b/drivers/mtd/chips/cfi_cmdset_0001.c -@@ -421,9 +421,25 @@ read_pri_intelext(struct map_info *map, - extra_size = 0; - - /* Protection Register info */ -- if (extp->NumProtectionFields) -+ if (extp->NumProtectionFields) { -+ struct cfi_intelext_otpinfo *otp = -+ (struct cfi_intelext_otpinfo *)&extp->extra[0]; -+ - extra_size += (extp->NumProtectionFields - 1) * -- sizeof(struct cfi_intelext_otpinfo); -+ sizeof(struct cfi_intelext_otpinfo); -+ -+ if (extp_size >= sizeof(*extp) + extra_size) { -+ int i; -+ -+ /* Do some byteswapping if necessary */ -+ for (i = 0; i < extp->NumProtectionFields - 1; i++) { -+ otp->ProtRegAddr = le32_to_cpu(otp->ProtRegAddr); -+ otp->FactGroups = le16_to_cpu(otp->FactGroups); -+ otp->UserGroups = le16_to_cpu(otp->UserGroups); -+ otp++; -+ } -+ } -+ } - } - - if (extp->MinorVersion >= '1') { diff --git a/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch b/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch index 741011039ee..c43d9d4b355 100644 --- a/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch +++ b/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch @@ -44,7 +44,7 @@ Signed-off-by: Aleksander Jan Bajkowski /* * Some chips power-up with all sectors locked by default. -@@ -1703,6 +1707,7 @@ static int cfi_intelext_write_words (str +@@ -1719,6 +1723,7 @@ static int cfi_intelext_write_words (str } @@ -52,7 +52,7 @@ Signed-off-by: Aleksander Jan Bajkowski static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long adr, const struct kvec **pvec, unsigned long *pvec_seek, int len) -@@ -1931,6 +1936,7 @@ static int cfi_intelext_write_buffers (s +@@ -1947,6 +1952,7 @@ static int cfi_intelext_write_buffers (s return cfi_intelext_writev(mtd, &vec, 1, to, retlen); } diff --git a/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts b/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts index a9f29591912..b8fac373a0a 100644 --- a/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts +++ b/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts @@ -87,7 +87,6 @@ }; factory: partition@1c0000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x1c0000 0x40000>; read-only; diff --git a/target/linux/mediatek/dts/mt7622-dlink-eagle-pro-ai-m32-a1.dts b/target/linux/mediatek/dts/mt7622-dlink-eagle-pro-ai-m32-a1.dts index ca680e4c29f..9c90cee516a 100644 --- a/target/linux/mediatek/dts/mt7622-dlink-eagle-pro-ai-m32-a1.dts +++ b/target/linux/mediatek/dts/mt7622-dlink-eagle-pro-ai-m32-a1.dts @@ -300,22 +300,24 @@ }; odm: partition@180000 { - compatible = "nvmem-cells"; label = "Odm"; reg = <0x00180000 0x00040000>; read-only; - macaddr_odm_83: macaddr@83 { - reg = <0x83 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_odm_83: macaddr@83 { + reg = <0x83 0x6>; + }; }; }; config1: partition@1C0000 { - compatible = "nvmem-cells"; label = "Config1"; reg = <0x001C0000 0x00080000>; - #address-cells = <1>; - #size-cells = <1>; read-only; }; diff --git a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts index c7e11c80b05..c775d998181 100644 --- a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts +++ b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts @@ -326,20 +326,24 @@ reg = <0x1c0000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; }; }; @@ -394,9 +398,8 @@ reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x5000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; diff --git a/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts b/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts index 9df736eb01e..e78db1de6cf 100644 --- a/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts +++ b/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts @@ -34,6 +34,20 @@ label = "factory"; reg = <0x1c0000 0x100000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; + + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; + }; }; partition@300000 { @@ -61,17 +75,3 @@ nvmem-cells = <&macaddr_factory_7fffa>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; - - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7622-linksys-e8450.dts b/target/linux/mediatek/dts/mt7622-linksys-e8450.dts index 8552dbf1a92..dedcc057f49 100644 --- a/target/linux/mediatek/dts/mt7622-linksys-e8450.dts +++ b/target/linux/mediatek/dts/mt7622-linksys-e8450.dts @@ -45,6 +45,20 @@ factory: partition@1c0000 { label = "factory"; reg = <0x1c0000 0x0100000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; + + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; + }; }; partition@300000 { @@ -106,17 +120,3 @@ nvmem-cells = <&macaddr_factory_7fffa>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; - - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7622-netgear-wax206.dts b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts index 9e877b85f16..737ac35f3d5 100644 --- a/target/linux/mediatek/dts/mt7622-netgear-wax206.dts +++ b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts @@ -405,19 +405,22 @@ }; factory: partition@1c0000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x1c0000 0x0100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; + + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts b/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts index b634e28783a..776d38d1e31 100644 --- a/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts +++ b/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts @@ -284,6 +284,20 @@ label = "factory"; reg = <0x1c0000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_24: macaddr@24 { + reg = <0x24 0x6>; + }; + + macaddr_factory_2a: macaddr@2a { + reg = <0x2a 0x6>; + }; + }; }; partition@200000 { @@ -305,20 +319,6 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_24: macaddr@24 { - reg = <0x24 0x6>; - }; - - macaddr_factory_2a: macaddr@2a { - reg = <0x2a 0x6>; - }; -}; - &ssusb { vusb33-supply = <®_3p3v>; vbus-supply = <®_5v>; diff --git a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts index 5b1fd1d9ba8..7a7a8a81591 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts @@ -33,6 +33,20 @@ label = "eeprom"; reg = <0x110000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@120000 { @@ -68,17 +82,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts index 95f19af4cd9..7e07e1ba6b5 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts @@ -38,6 +38,20 @@ label = "eeprom"; reg = <0x110000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@120000 { @@ -84,17 +98,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts index 6a7b6868ce3..3a37d1d5004 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts @@ -33,6 +33,20 @@ label = "eeprom"; reg = <0x110000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@120000 { @@ -68,17 +82,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts index f40e8e632b0..9fef3d67210 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts @@ -38,6 +38,20 @@ label = "eeprom"; reg = <0x110000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@120000 { @@ -84,17 +98,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts index 46faf8da307..e91aaa63f58 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts @@ -33,6 +33,20 @@ label = "eeprom"; reg = <0x110000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@120000 { @@ -68,17 +82,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts index 34bdaa6254a..71ee9f0ceca 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts @@ -38,6 +38,20 @@ label = "eeprom"; reg = <0x110000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@120000 { @@ -84,17 +98,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts index ecc25fd328c..dcf851b2740 100644 --- a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts +++ b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts @@ -146,9 +146,8 @@ phy-connection-type = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; fixed-link { speed = <2500>; @@ -268,12 +267,16 @@ reg = <0x1c0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts b/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts index dc1868a0669..5b1b3083a06 100644 --- a/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts +++ b/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts @@ -97,9 +97,8 @@ compatible = "mediatek,eth-mac"; reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; fixed-link { speed = <2500>; @@ -113,9 +112,8 @@ reg = <1>; phy-mode = "gmii"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; mdio: mdio-bus { @@ -212,12 +210,16 @@ reg = <0x140000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts b/target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts index 52e22541faf..5eab714fdac 100644 --- a/target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts +++ b/target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts @@ -102,11 +102,16 @@ partition@90000 { label = "Factory"; reg = <0x00090000 0x00010000>; - compatible = "nvmem-cells"; read-only; - macaddr_factory_8: macaddr@8 { - reg = <0x8 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts index ece78ee50eb..48fe2f2fc0e 100644 --- a/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts +++ b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts @@ -115,16 +115,18 @@ reg = <0x00000 0x10000>; read-only; - 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>; + nvmem-layout { + compatible = "fixed-layout"; + #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/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts index 0dee4f42e5c..80c77df8950 100644 --- a/target/linux/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts @@ -77,9 +77,6 @@ }; ð { - pinctrl-names = "default"; - pinctrl-0 = <&mdio_pins>; - status = "okay"; gmac0: mac@0 { diff --git a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi index 4102fc933f1..1190d00bcd9 100644 --- a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi +++ b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi @@ -58,9 +58,6 @@ }; ð { - pinctrl-names = "default"; - pinctrl-0 = <&mdio_pins>; - status = "okay"; gmac0: mac@0 { diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso index ff94a550fd6..4d2b01cb63e 100644 --- a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso @@ -84,7 +84,6 @@ reg = <0x180000 0x200000>; read-only; - compatible = "nvmem-cells"; nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; diff --git a/target/linux/mediatek/dts/mt7981b-confiabits-mt7981.dts b/target/linux/mediatek/dts/mt7981b-confiabits-mt7981.dts new file mode 100644 index 00000000000..520b8494eef --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-confiabits-mt7981.dts @@ -0,0 +1,297 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/dts-v1/; + +#include "mt7981.dtsi" +#include +#include +#include + +/ { + model = "Confiabits MT7981"; + compatible = "confiabits,mt7981", "mediatek,mt7981"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-mesh { + label = "mesh"; + linux,input-type = ; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-wlan5g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-wan-red { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 6 GPIO_ACTIVE_LOW>; + }; + + led_power: led-power { + label = "blue:power"; // can be removed once #13837 is merged + color = ; + function = LED_FUNCTION_POWER; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + }; + + led-lan1 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led-lan2 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led-lan3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led-wan-blue { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-wlan2g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; + gpios = <&pio 34 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-mesh { + color = ; + function = "mesh"; // no LED_FUNCTION_MESH yet + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + + +&mdio_bus { + #address-cells = <1>; + #size-cells = <0>; + + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@4 { + reg = <4>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 1>; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x00000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + compatible = "linux,ubi"; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + }; + +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; + mediatek,u3p-dis-msk = <0x1>; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts index 56e90b17228..e2fa8bf5d3f 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts @@ -95,7 +95,7 @@ phy-mode = "2500base-x"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; fixed-link { speed = <2500>; @@ -168,6 +168,18 @@ label = "bdinfo"; reg = <0x60000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@70000 { @@ -223,8 +235,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; }; lan1: port@1 { @@ -232,7 +243,7 @@ label = "lan1"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; }; port@2 { @@ -240,7 +251,7 @@ label = "lan2"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; }; port@3 { @@ -248,7 +259,7 @@ label = "lan3"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; }; port@6 { @@ -270,13 +281,3 @@ status = "okay"; mediatek,mtd-eeprom = <&factory 0x0>; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts new file mode 100644 index 00000000000..068dd0f236e --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include "mt7981.dtsi" + +/ { + model = "GL.iNet GL-MT2500"; + compatible = "glinet,gl-mt2500", "mediatek,mt7981"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_sys_white; + led-failsafe = &led_sys_blue; + led-running = &led_sys_white; + led-upgrade = &led_sys_blue; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=PARTLABEL=rootfs rootwait"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-vpn { + label = "white:vpn"; + gpios = <&pio 31 GPIO_ACTIVE_LOW>; + }; + + led_sys_white: led-system-white { + label = "white:system"; + gpios = <&pio 30 GPIO_ACTIVE_LOW>; + }; + + led_sys_blue: led-system-blue { + label = "blue:system"; + gpios = <&pio 29 GPIO_ACTIVE_LOW>; + }; + }; + + usb_vbus: regulstor-usb { + compatible = "regulator-fixed"; + + regulator-name = "usb-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&pio 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&pio { + mmc0_pins_default: mmc0-pins-default { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + mmc0_pins_uhs: mmc0-pins-uhs { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&mdio_bus { + reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; + reset-delay-us = <600>; + reset-post-delay-us = <20000>; + + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; + vbus-supply = <&usb_vbus>; +}; + +&mmc0 { + status = "okay"; + + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + max-frequency = <52000000>; + vmmc-supply = <®_3p3v>; + cap-mmc-highspeed; + non-removable; +}; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts index f9b8c16652e..b1ebaf4312c 100644 --- a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts @@ -91,7 +91,7 @@ reg = <0>; phy-mode = "2500base-x"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr>; + nvmem-cells = <&macaddr 0>; nvmem-cell-names = "mac-address"; }; @@ -100,9 +100,8 @@ reg = <1>; phy-mode = "gmii"; phy-handle = <&int_gbe_phy>; - nvmem-cells = <&macaddr>; + nvmem-cells = <&macaddr 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -179,12 +178,16 @@ reg = <0x180000 0x0200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr: macaddr@a { - reg = <0xa 0x6>; + macaddr: macaddr@a { + compatible = "mac-base"; + reg = <0xa 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-jcg-q30.dts b/target/linux/mediatek/dts/mt7981b-jcg-q30.dts index ff586862479..d91b7959d43 100644 --- a/target/linux/mediatek/dts/mt7981b-jcg-q30.dts +++ b/target/linux/mediatek/dts/mt7981b-jcg-q30.dts @@ -59,9 +59,6 @@ }; ð { - pinctrl-names = "default"; - pinctrl-0 = <&mdio_pins>; - status = "okay"; gmac0: mac@0 { diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi index d09ae2a3e78..1e738a4474d 100644 --- a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi +++ b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi @@ -73,9 +73,8 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; fixed-link { speed = <2500>; @@ -177,12 +176,16 @@ reg = <0x180000 0x200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax.dts b/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax.dts new file mode 100644 index 00000000000..112fd777f05 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax.dts @@ -0,0 +1,331 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "mt7981.dtsi" + +/ { + model = "Zbtlink ZBT-Z8102AX"; + compatible = "zbtlink,zbt-z8102ax", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = &gmac0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 loglevel=8"; + }; + + memory { + reg = <0 0x40000000 0 0x40000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + button-mesh { + label = "mesh"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + }; + + button-hub { + label = "hub"; + linux,code = ; + gpios = <&pio 12 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: red { + label = "red:status"; + gpios = <&pio 9 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led_status_green: green { + label = "green:status"; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + blue { + label = "blue:status"; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + 4g { + label = "blue:4g"; + gpios = <&pio 8 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_USB; + function-enumerator = <0>; + }; + + 4g2 { + label = "blue:4g2"; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_USB; + function-enumerator = <1>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&pio 2 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <1000>; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + pcie { + gpio-export,name = "pcie_power"; + gpio-export,output = <1>; + gpios = <&pio 3 GPIO_ACTIVE_HIGH>; + }; + + 5g1 { + gpio-export,name = "5g1"; + gpio-export,output = <1>; + gpios = <&pio 4 GPIO_ACTIVE_HIGH>; + }; + + 5g2 { + gpio-export,name = "5g2"; + gpio-export,output = <1>; + gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + }; + + sim1 { + gpio-export,name = "sim1"; + gpio-export,output = <1>; + gpios = <&pio 6 GPIO_ACTIVE_HIGH>; + }; + + sim2 { + gpio-export,name = "sim2"; + gpio-export,output = <1>; + gpios = <&pio 7 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + /* LAN */ + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 2>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + /* WAN */ + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 3>; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <0x1f>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl2"; + reg = <0x0000000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = <8>; + bias-pull-up = <103>; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = <8>; + bias-pull-down = <103>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; + +&wifi { + status = "okay"; + + nvmem-cells = <&eeprom_factory>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts b/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts index d222cebb4fe..54df8c054ac 100644 --- a/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts +++ b/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts @@ -136,12 +136,14 @@ reg = <0x180000 0x0200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr: macaddr@a { - reg = <0xa 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr: macaddr@a { + reg = <0xa 0x6>; + }; }; }; @@ -190,12 +192,14 @@ reg = <0xef80000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mrd_1fff8: macaddr@1fff8 { - reg = <0x1fff8 0x6>; + macaddr_mrd_1fff8: macaddr@1fff8 { + reg = <0x1fff8 0x6>; + }; }; }; }; diff --git a/target/linux/mediatek/dts/mt7986a-acelink-ew-7886cax.dts b/target/linux/mediatek/dts/mt7986a-acelink-ew-7886cax.dts new file mode 100644 index 00000000000..1bf5d7317e8 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-acelink-ew-7886cax.dts @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; +#include +#include +#include + +#include "mt7986a.dtsi" + +/ { + compatible = "acelink,ew-7886cax", "mediatek,mt7986a"; + model = "Acelink EW-7886CAX"; + + aliases { + serial0 = &uart0; + led-boot = &led_status_blue; + led-running = &led_status_green; + led-upgrade = &led_status_red; + led-failsafe = &led_status_red; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x20000000>; + device_type = "memory"; + }; + + keys { + compatible = "gpio-keys"; + + key-restart { + label = "Reset"; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 18 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: led-1 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 19 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: led-2 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 20 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; + nvmem-cells = <&macaddr>; + nvmem-cell-names = "mac-address"; + }; + + mdio-bus { + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <50000>; + reset-post-delay-us = <20000>; + #address-cells = <1>; + #size-cells = <0>; + + /* Maxlinear GPY211C */ + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + }; + }; +}; + +&pcie_phy { + status = "okay"; +}; + +&pio { + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + wf_dbdc_pins: wf-dbdc-pins { + mux { + function = "wifi"; + groups = "wf_dbdc"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + status = "okay"; + + flash@0 { + compatible = "spi-nand"; + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <52000000>; + spi-rx-bus-width = <4>; + spi-tx-bus-width = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x100000>; + label = "bootloader"; + read-only; + }; + + partition@100000 { + reg = <0x100000 0x80000>; + label = "u-boot-env"; + }; + + partition@180000 { + compatible = "nvmem-cells"; + reg = <0x180000 0x200000>; + label = "factory"; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr: macaddr@4 { + reg = <0x4 0x6>; + }; + }; + }; + + partition@380000 { + reg = <0x380000 0x200000>; + label = "fip"; + }; + + partition@580000 { + reg = <0x580000 0x4000000>; + label = "ubi"; + }; + }; + }; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + pinctrl-names = "default", "dbdc"; + pinctrl-0 = <&wf_2g_5g_pins>; + pinctrl-1 = <&wf_dbdc_pins>; + nvmem-cells = <&eeprom>; + nvmem-cell-names = "eeprom"; + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts new file mode 100644 index 00000000000..f89e409b9b3 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts @@ -0,0 +1,291 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (C) 2023 Tianling Shen + */ + +/dts-v1/; +#include +#include +#include + +#include "mt7986a.dtsi" + +/ { + model = "JDCloud RE-CP-03"; + compatible = "jdcloud,re-cp-03", "mediatek,mt7986a"; + + aliases { + led-boot = &red_led; + led-failsafe = &red_led; + led-running = &green_led; + led-upgrade = &green_led; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x40000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-joylink { + label = "joylink"; + linux,code = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led-0 { + label = "blue:status"; + gpios = <&pio 7 GPIO_ACTIVE_HIGH>; + }; + + red_led: led-1 { + label = "red:status"; + gpios = <&pio 11 GPIO_ACTIVE_HIGH>; + }; + + green_led: led-2 { + label = "green:status"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&mdio { + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-assert-us = <10000>; + reset-deassert-us = <50000>; + realtek,aldps-enable; + }; + + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <66 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&mmc0 { + bus-width = <8>; + cap-mmc-highspeed; + hs400-ds-delay = <0x14014>; + max-frequency = <200000000>; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + no-sd; + no-sdio; + non-removable; + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + vmmc-supply = <®_3p3v>; + vqmmc-supply = <®_1p8v>; + status = "okay"; +}; + +&pio { + mmc0_pins_default: mmc0-pins-default { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; + }; + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + mediatek,pull-down-adv = <2>; + }; + conf-ds { + pins = "EMMC_DSL"; + mediatek,pull-down-adv = <2>; + }; + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; + }; + }; + + mmc0_pins_uhs: mmc0-uhs-pins { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; + }; + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + mediatek,pull-down-adv = <2>; + }; + conf-ds { + pins = "EMMC_DSL"; + mediatek,pull-down-adv = <2>; + }; + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + mediatek,pull-up-adv = <1>; + }; + }; + + wf_2g_5g_pins: wf-2g-5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@4 { + reg = <4>; + label = "lan4"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + pinctrl-names = "default"; + pinctrl-0 = <&wf_2g_5g_pins>; + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi b/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi index 717acfec168..220b2c641a6 100644 --- a/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi +++ b/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi @@ -95,7 +95,7 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_config_1c>; + nvmem-cells = <&macaddr_config_1c 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -111,9 +111,8 @@ phy-handle = <&phy7>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_config_1c>; + nvmem-cells = <&macaddr_config_1c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; mdio: mdio-bus { @@ -184,6 +183,18 @@ label = "config"; reg = <0x100000 0x0060000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_1c: macaddr@1c { + compatible = "mac-base"; + reg = <0x1c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; factory: partition@160000 { @@ -255,18 +266,7 @@ &wifi { mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_config_1c>; + nvmem-cells = <&macaddr_config_1c 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; status = "okay"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_1c: macaddr@1c { - reg = <0x1c 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi index 573d7ac23ca..26f1cc5b805 100644 --- a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi +++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi @@ -54,9 +54,8 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; fixed-link { speed = <2500>; @@ -167,12 +166,16 @@ reg = <0x180000 0x200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-common.dtsi b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-common.dtsi new file mode 100644 index 00000000000..04e86a737d1 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-common.dtsi @@ -0,0 +1,433 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih + */ + +#include "mt7986a.dtsi" +#include +#include + +/ { + aliases { + serial0 = &uart0; + label-mac-device = &gmac0; + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x40000000>; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible = "gpio-keys"; + poll-interval = <20>; + + reset-button { + label = "reset"; + gpios = <&pio 21 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wlan-button { + label = "wlan"; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + wps-button { + label = "wps"; + gpios = <&pio 56 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_green_wifi24g { + label = "green:wifi24g"; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_green_wifi5g { + label = "green:wifi5g"; + gpios = <&pio 2 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_green_inet { + label = "green:inet"; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_red_inet { + label = "red:inet"; + gpios = <&pio 15 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_status_green: led_green_pwr { + label = "green:pwr"; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "timer"; /* Default blinking */ + led-pattern = <125 125>; /* Fast blink is 4 HZ */ + }; + + led_status_red: led_red_pwr { + label = "red:pwr"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_green_fxs { + label = "green:fxs"; + gpios = <&pio 16 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_amber_fxs { + label = "amber:fxs"; + gpios = <&pio 17 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_amber_wps24g { + label = "amber:wps24g"; + gpios = <&pio 18 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_amber_wps5g { + label = "amber:wps5g"; + gpios = <&pio 19 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_green_lan { + label = "green:lan"; + gpios = <&pio 20 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_green_sfp { + label = "green:sfp"; + gpios = <&pio 24 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + cs-gpios = <0>, <0>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + spi_nand: spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <10000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + nand_partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <ð_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy = <&phy6>; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <1500000>; + reset-post-delay-us = <1000000>; + + phy5: phy@5 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <5>; + mxl,led-config = <0x03f0 0x0 0x0 0x0>; + }; + + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + mxl,led-config = <0x00f0 0x0 0x0 0x0>; + }; + + switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@5 { + reg = <5>; + label = "lan1"; + phy-mode = "2500base-x"; + phy = <&phy5>; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + }; + }; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + pinctrl-names = "default", "dbdc"; + pinctrl-0 = <&wf_2g_5g_pins>; + pinctrl-1 = <&wf_dbdc_pins>; +}; + +&crypto { + status = "okay"; +}; + +&pio { + eth_pins: eth-pins { + mux { + function = "eth"; + groups = "switch_int", "mdc_mdio"; + }; + }; + + spic_pins_g2: spic-pins-29-to-32 { + mux { + function = "spi"; + groups = "spi1_2"; + }; + }; + + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0"; + }; + }; + + uart1_pins: uart1-pins { + mux { + function = "uart"; + groups = "uart1"; + }; + }; + + uart2_pins: uart2-pins { + mux { + function = "uart"; + groups = "uart2"; + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + wf_dbdc_pins: wf_dbdc-pins { + mux { + function = "wifi"; + groups = "wf_dbdc"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + usb-oc-hog { + gpio-hog; + gpios = <7 GPIO_ACTIVE_LOW>; + input; + line-name = "usb-oc"; + }; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spic_pins_g2>; + status = "okay"; + + proslic_spi: proslic_spi@0 { + compatible = "silabs,proslic_spi"; + reg = <0>; + spi-max-frequency = <10000000>; + spi-cpha = <1>; + spi-cpol = <1>; + channel_count = <1>; + debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */ + reset_gpio = <&pio 25 GPIO_ACTIVE_HIGH>; + ig,enable-spi = <1>; /* 1: Enable, 0: Disable */ + }; +}; + +&ssusb { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "disabled"; + + /* EFR32MG21 Zigbee (BOOT)*/ +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + status = "disabled"; + + /* EFR32MG21 Zigbee */ +}; + +&usb_phy { + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts index 331150d85db..4dbbd136779 100644 --- a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts @@ -6,6 +6,7 @@ /dts-v1/; #include "mt7986a.dtsi" +#include "mt7986a-zyxel-ex5601-t0-common.dtsi" #include #include @@ -13,556 +14,106 @@ model = "Zyxel EX5601-T0"; compatible = "zyxel,ex5601-t0", "mediatek,mt7986a-rfb-snand"; - aliases { - serial0 = &uart0; + memory@40000000 { + device_type = "memory"; + reg = <0x40000000 0x20000000>; }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - memory { - reg = <0 0x40000000 0 0x40000000>; - }; - - reg_1p8v: regulator-1p8v { - compatible = "regulator-fixed"; - regulator-name = "fixed-1.8V"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - regulator-always-on; - }; - - reg_3p3v: regulator-3p3v { - compatible = "regulator-fixed"; - regulator-name = "fixed-3.3V"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - regulator-always-on; - }; - - reg_5v: regulator-5v { - compatible = "regulator-fixed"; - regulator-name = "fixed-5V"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-boot-on; - regulator-always-on; - }; - - gpio-keys { - compatible = "gpio-keys"; - poll-interval = <20>; - - reset-button { - label = "reset"; - gpios = <&pio 21 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wlan-button { - label = "wlan"; - gpios = <&pio 11 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - wps-button { - label = "wps"; - gpios = <&pio 56 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - zyleds { - compatible = "gpio-leds"; - - led_green_wifi24g { - label = "zyled-green-wifi24g"; - gpios = <&pio 1 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_wifi5g { - label = "zyled-green-wifi5g"; - gpios = <&pio 2 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_inet { - label = "zyled-green-inet"; - gpios = <&pio 14 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_red_inet { - label = "zyled-red-inet"; - gpios = <&pio 15 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_pwr { - label = "zyled-green-pwr"; - gpios = <&pio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "timer"; /* Default blinking */ - led-pattern = <125 125>; /* Fast blink is 4 HZ */ - }; - - led_red_pwr { - label = "zyled-red-pwr"; - gpios = <&pio 12 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_fxs { - label = "zyled-green-fxs"; - gpios = <&pio 16 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_amber_fxs { - label = "zyled-amber-fxs"; - gpios = <&pio 17 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_amber_wps24g { - label = "zyled-amber-wps24g"; - gpios = <&pio 18 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_amber_wps5g { - label = "zyled-amber-wps5g"; - gpios = <&pio 19 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_green_lan { - label = "zyled-green-lan"; - gpios = <&pio 20 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_green_sfp { - label = "zyled-green-sfp"; - gpios = <&pio 24 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - }; - -}; - -ð { - status = "okay"; - - gmac0: mac@0 { - compatible = "mediatek,eth-mac"; - reg = <0>; - phy-mode = "2500base-x"; - - nvmem-cells = <&macaddr_factory_002a>; - nvmem-cell-names = "mac-address"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - - gmac1: mac@1 { - compatible = "mediatek,eth-mac"; - reg = <1>; - phy-mode = "2500base-x"; - phy = <&phy6>; - - nvmem-cells = <&macaddr_factory_0024>; - nvmem-cell-names = "mac-address"; - }; - - mdio: mdio-bus { - #address-cells = <1>; - #size-cells = <0>; - reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; - reset-delay-us = <1500000>; - reset-post-delay-us = <1000000>; - - phy5: phy@5 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <5>; - }; - - phy6: phy@6 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <6>; - }; - - switch@1f { - compatible = "mediatek,mt7531"; - reg = <31>; - reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@1 { - reg = <1>; - label = "lan1"; - }; - - port@2 { - reg = <2>; - label = "lan2"; - }; - - port@3 { - reg = <3>; - label = "lan3"; - }; - - port@5 { - reg = <5>; - label = "lan4"; - phy-mode = "2500base-x"; - phy = <&phy5>; - }; - - port@6 { - reg = <6>; - ethernet = <&gmac0>; - phy-mode = "2500base-x"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - }; - }; - }; -}; - -&watchdog { - status = "okay"; }; -&wifi { - status = "okay"; - pinctrl-names = "default", "dbdc"; - pinctrl-0 = <&wf_2g_5g_pins>; - pinctrl-1 = <&wf_dbdc_pins>; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_0004>; - nvmem-cell-names = "mac-address"; -}; - -&crypto { - status = "okay"; -}; - -&mmc0 { - pinctrl-names = "default", "state_uhs"; - pinctrl-0 = <&mmc0_pins_default>; - pinctrl-1 = <&mmc0_pins_uhs>; - bus-width = <8>; - max-frequency = <200000000>; - cap-mmc-highspeed; - mmc-hs200-1_8v; - mmc-hs400-1_8v; - hs400-ds-delay = <0x14014>; - vmmc-supply = <®_3p3v>; - vqmmc-supply = <®_1p8v>; - non-removable; - no-sd; - no-sdio; - status = "disabled"; +&spi_nand { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; }; -&pcie { - pinctrl-names = "default"; - pinctrl-0 = <&pcie_pins>; - status = "okay"; -}; +&nand_partitions { -&pcie_phy { - status = "okay"; -}; - -&pio { - mmc0_pins_default: mmc0-pins { - mux { - function = "emmc"; - groups = "emmc_51"; - }; - conf-cmd-dat { - pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", - "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", - "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; - input-enable; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - conf-clk { - pins = "EMMC_CK"; - drive-strength = <6>; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-ds { - pins = "EMMC_DSL"; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-rst { - pins = "EMMC_RSTB"; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; + partition@0 { + label = "BL2"; + reg = <0x00000 0x0100000>; + read-only; }; - mmc0_pins_uhs: mmc0-uhs-pins { - mux { - function = "emmc"; - groups = "emmc_51"; - }; - conf-cmd-dat { - pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", - "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", - "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; - input-enable; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - conf-clk { - pins = "EMMC_CK"; - drive-strength = <6>; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-ds { - pins = "EMMC_DSL"; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-rst { - pins = "EMMC_RSTB"; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; }; - pcie_pins: pcie-pins { - mux { - function = "pcie"; - groups = "pcie_clk", "pcie_wake", "pcie_pereset"; - }; - }; - - spic_pins_g2: spic-pins-29-to-32 { - mux { - function = "spi"; - groups = "spi1_2"; - }; - }; - - spi_flash_pins: spi-flash-pins-33-to-38 { - mux { - function = "spi"; - groups = "spi0", "spi0_wp_hold"; - }; - conf-pu { - pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; - drive-strength = <8>; - mediatek,pull-up-adv = <0>; /* bias-disable */ - }; - conf-pd { - pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; - drive-strength = <8>; - mediatek,pull-down-adv = <0>; /* bias-disable */ - }; - }; + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; - uart1_pins: uart1-pins { - mux { - function = "uart"; - groups = "uart1"; - }; - }; - - uart2_pins: uart2-pins { - mux { - function = "uart"; - groups = "uart2"; - }; - }; - - wf_2g_5g_pins: wf_2g_5g-pins { - mux { - function = "wifi"; - groups = "wf_2g", "wf_5g"; - }; - conf { - pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", - "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", - "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", - "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", - "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", - "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", - "WF1_TOP_CLK", "WF1_TOP_DATA"; - drive-strength = <4>; - }; - }; - - wf_dbdc_pins: wf_dbdc-pins { - mux { - function = "wifi"; - groups = "wf_dbdc"; - }; - conf { - pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", - "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", - "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", - "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", - "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", - "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", - "WF1_TOP_CLK", "WF1_TOP_DATA"; - drive-strength = <4>; - }; - }; -}; - -&spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi_flash_pins>; - cs-gpios = <0>, <0>; - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - spi_nand: spi_nand@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spi-nand"; - reg = <1>; - spi-max-frequency = <10000000>; - spi-tx-bus-width = <4>; - spi-rx-bus-width = <4>; - - partitions { - compatible = "fixed-partitions"; + nvmem-layout { + compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; - partition@0 { - label = "BL2"; - reg = <0x00000 0x0100000>; - read-only; + eeprom_factory: eeprom@0 { + #size-cells = <1>; + reg = <0x0 0x1000>; }; - partition@100000 { - label = "u-boot-env"; - reg = <0x0100000 0x0080000>; + macaddr_factory_0004: macaddr@0004 { + compatible = "mac-base"; + reg = <0x0004 0x6>; + #nvmem-cell-cells = <1>; }; - factory: partition@180000 { - label = "Factory"; - reg = <0x180000 0x0200000>; - read-only; + macaddr_factory_0024: macaddr@0024 { + compatible = "mac-base"; + reg = <0x0024 0x6>; + #nvmem-cell-cells = <1>; }; - partition@380000 { - label = "FIP"; - reg = <0x380000 0x01C0000>; - read-only; - }; - - partition@540000 { - label = "zloader"; - reg = <0x540000 0x0040000>; - read-only; - }; - - partition@580000 { - label = "ubi"; - reg = <0x580000 0x4000000>; - }; - - partition@4580000 { - label = "ubi2"; - reg = <0x4580000 0x4000000>; - read-only; - }; - - partition@8580000 { - label = "zyubi"; - reg = <0x8580000 0x15A80000>; + macaddr_factory_002a: macaddr@002a { + compatible = "mac-base"; + reg = <0x002a 0x6>; + #nvmem-cell-cells = <1>; }; }; }; -}; -&spi1 { - pinctrl-names = "default"; - pinctrl-0 = <&spic_pins_g2>; - status = "okay"; - - proslic_spi: proslic_spi@0 { - compatible = "silabs,proslic_spi"; - reg = <0>; - spi-max-frequency = <10000000>; - spi-cpha = <1>; - spi-cpol = <1>; - channel_count = <1>; - debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */ - reset_gpio = <&pio 7 GPIO_ACTIVE_HIGH>; - ig,enable-spi = <1>; /* 1: Enable, 0: Disable */ + partition@380000 { + label = "FIP"; + reg = <0x380000 0x01C0000>; + read-only; }; -}; -&ssusb { - vusb33-supply = <®_3p3v>; - vbus-supply = <®_5v>; - status = "okay"; -}; + partition@540000 { + label = "zloader"; + reg = <0x540000 0x0040000>; + read-only; + }; -&trng { - status = "okay"; -}; + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; -&uart0 { - status = "okay"; -}; + partition@4580000 { + label = "ubi2"; + reg = <0x4580000 0x4000000>; + read-only; + }; -&uart1 { - pinctrl-names = "default"; - pinctrl-0 = <&uart1_pins>; - status = "okay"; + partition@8580000 { + label = "zyubi"; + reg = <0x8580000 0x15A80000>; + }; }; -&uart2 { - pinctrl-names = "default"; - pinctrl-0 = <&uart2_pins>; - status = "okay"; +&gmac0 { + nvmem-cells = <&macaddr_factory_002a 0>; + nvmem-cell-names = "mac-address"; }; -&usb_phy { - status = "okay"; +&gmac1 { + nvmem-cells = <&macaddr_factory_0024 0>; + nvmem-cell-names = "mac-address"; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; - - macaddr_factory_0024: macaddr@0024 { - reg = <0x0024 0x6>; - }; - - macaddr_factory_002a: macaddr@002a { - reg = <0x002a 0x6>; - }; +&wifi { + nvmem-cells = <&eeprom_factory>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-ubootmod.dts b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-ubootmod.dts new file mode 100644 index 00000000000..7422a10aef3 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-ubootmod.dts @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih + */ + +/dts-v1/; +#include "mt7986a.dtsi" +#include "mt7986a-zyxel-ex5601-t0-common.dtsi" +#include +#include + +/ { + model = "Zyxel EX5601-T0 ubootmod"; + compatible = "zyxel,ex5601-t0-ubootmod", "mediatek,mt7986a"; + memory@40000000 { + device_type = "memory"; + reg = <0x40000000 0x20000000>; + }; +}; + +&nand_partitions { + partition@0 { + label = "bl2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory: eeprom@0 { + #size-cells = <1>; + reg = <0x0 0x1000>; + }; + + macaddr_factory_0004: macaddr@0004 { + compatible = "mac-base"; + reg = <0x0004 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_0024: macaddr@0024 { + compatible = "mac-base"; + reg = <0x0024 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_002a: macaddr@002a { + compatible = "mac-base"; + reg = <0x002a 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x380000 0x0200000>; + read-only; + }; + + partition@540000 { + label = "zloader"; + reg = <0x540000 0x0040000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x1da80000>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_002a 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + nvmem-cells = <&macaddr_factory_0024 0>; + nvmem-cell-names = "mac-address"; +}; + +&wifi { + nvmem-cells = <&eeprom_factory>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts b/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts index a486f29fec8..f5bb73c97d7 100644 --- a/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts @@ -337,10 +337,6 @@ label = "Factory"; reg = <0x180000 0x200000>; read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; }; partition@380000 { label = "FIP"; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index b4c833de1e4..e419967bf2b 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -15,6 +15,12 @@ bananapi,bpi-r3-mini) ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "phy0-ap0" ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0" ;; +confiabits,mt7981) + ucidef_set_led_netdev "lan1" "lan1" "blue:lan-1" "lan1" "link tx rx" + ucidef_set_led_netdev "lan2" "lan2" "blue:lan-2" "lan2" "link tx rx" + ucidef_set_led_netdev "lan3" "lan3" "blue:lan-3" "lan3" "link tx rx" + ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx" + ;; cudy,wr3000-v1) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; @@ -50,6 +56,13 @@ xiaomi,redmi-router-ax6000-stock|\ xiaomi,redmi-router-ax6000-ubootmod) ucidef_set_led_netdev "wan" "wan" "rgb:network" "wan" "link" ;; +zyxel_ex5601-t0-stock|\ +zyxel,ex5601-t0-ubootmod) + ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" "link tx rx" + ucidef_set_led_netdev "wan" "WAN" "green:inet" "eth1" "link tx rx" + ucidef_set_led_netdev "wifi-24g" "WIFI-2.4G" "green:wifi24g" "phy0-ap0" "link tx rx" + ucidef_set_led_netdev "wifi-5g" "WIFI-5G" "green:wifi5g" "phy1-ap0" "link tx rx" + ;; esac board_config_flush diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 870250ab6fe..aa8d1b00831 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -8,6 +8,9 @@ mediatek_setup_interfaces() local board="$1" case $board in + acelink,ew-7886cax) + ucidef_set_interface_lan "eth0" "dhcp" + ;; abt,asr3000-ubootmod|\ cmcc,rax3000m|\ cmcc,rax3000m-emmc-ubootmod|\ @@ -21,17 +24,16 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1 ;; asus,tuf-ax4200|\ - mediatek,mt7981-rfb) + jdcloud,re-cp-03|\ + mediatek,mt7981-rfb|\ + zbtlink,zbt-z8102ax|\ + zyxel,ex5601-t0-stock|\ + zyxel,ex5601-t0-ubootmod) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1 ;; asus,tuf-ax6000) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 ;; - netgear,wax220|\ - ubnt,unifi-6-plus|\ - zyxel,nwa50ax-pro) - ucidef_set_interface_lan "eth0" - ;; bananapi,bpi-r3) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" ;; @@ -41,6 +43,7 @@ mediatek_setup_interfaces() cetron,ct3003-stock|\ cetron,ct3003-ubootmod|\ cmcc,a10-ubootmod|\ + confiabits,mt7981|\ cudy,wr3000-v1|\ jcg,q30|\ jcg,q30-ubootmod|\ @@ -50,9 +53,15 @@ mediatek_setup_interfaces() qihoo,360t7-ubootmod) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; + glinet,gl-mt2500|\ glinet,gl-mt3000) ucidef_set_interfaces_lan_wan eth1 eth0 ;; + glinet,gl-mt6000|\ + tplink,tl-xdr4288|\ + tplink,tl-xdr6088) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 + ;; mediatek,mt7986a-rfb) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan6" "eth1 wan" ;; @@ -65,10 +74,10 @@ mediatek_setup_interfaces() mercusys,mr90x-v1) ucidef_set_interfaces_lan_wan "lan0 lan1 lan2" eth1 ;; - glinet,gl-mt6000|\ - tplink,tl-xdr4288|\ - tplink,tl-xdr6088) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 + netgear,wax220|\ + ubnt,unifi-6-plus|\ + zyxel,nwa50ax-pro) + ucidef_set_interface_lan "eth0" ;; tplink,tl-xdr6086) ucidef_set_interfaces_lan_wan "lan1 lan2" eth1 @@ -123,6 +132,11 @@ mediatek_setup_macs() lan_mac=$(mmc_get_mac_binary factory 0x24) label_mac=$wan_mac ;; + glinet,gl-mt2500) + label_mac="$(get_mac_binary "/dev/mmcblk0boot1" 0xA)" + wan_mac="$label_mac" + lan_mac="$(macaddr_add $label_mac 1)" + ;; glinet,gl-mt6000) label_mac=$(mmc_get_mac_binary factory 0x0a) wan_mac=$label_mac @@ -139,6 +153,11 @@ mediatek_setup_macs() [ -n "$lan_mac" ] || lan_mac=$(macaddr_add $(mtd_get_mac_binary Factory 0x4) -1) wan_mac=$(macaddr_add $lan_mac 2) ;; + jdcloud,re-cp-03) + wan_mac=$(mmc_get_mac_binary factory 0x2a) + lan_mac=$(mmc_get_mac_binary factory 0x24) + label_mac=$lan_mac + ;; mercusys,mr90x-v1) label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0) lan_mac=$label_mac diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches b/target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches new file mode 100644 index 00000000000..4cbec1ef078 --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,19 @@ +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +zbtlink,zbt-z8102ax) + ucidef_add_gpio_switch "5g1" "Power 1st modem" "5g1" "1" + ucidef_add_gpio_switch "5g2" "Power 2nd modem" "5g2" "1" + ucidef_add_gpio_switch "pcie" "Power PCIe port" "pcie" "1" + ucidef_add_gpio_switch "sim1" "SIM 1" "sim1" "1" + ucidef_add_gpio_switch "sim2" "SIM 2" "sim2" "1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata index 105f28bc917..5b7d22f48f1 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata @@ -58,7 +58,8 @@ case "$FIRMWARE" in CI_UBIPART="UBI_DEV" caldata_extract_ubi "Factory" 0x0 0x1000 ;; - glinet,gl-mt6000) + glinet,gl-mt6000|\ + jdcloud,re-cp-03) caldata_extract_mmc "factory" 0x0 0x1000 ;; esac diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index f00983e3764..a2b008d1de8 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -63,7 +63,8 @@ case "$board" in esac [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress ;; - cmcc,rax3000m-emmc-ubootmod) + cmcc,rax3000m-emmc-ubootmod|\ + jdcloud,re-cp-03) [ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress ;; cudy,wr3000-v1) @@ -112,11 +113,6 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress ;; - ubnt,unifi-6-plus) - addr=$(mtd_get_mac_binary EEPROM 0x6) - [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress - ;; qihoo,360t7) addr=$(mtd_get_mac_ascii factory lanMac) [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress @@ -132,7 +128,14 @@ case "$board" in tplink,tl-xdr6088) [ "$PHYNBR" = "0" ] && get_mac_label > /sys${DEVPATH}/macaddress ;; - zyxel,ex5601-t0) + ubnt,unifi-6-plus) + addr=$(mtd_get_mac_binary EEPROM 0x6) + [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress + ;; + zbtlink,zbt-z8102ax|\ + zyxel,ex5601-t0|\ + zyxel,ex5601-t0-ubootmod) addr=$(mtd_get_mac_binary "Factory" 0x4) [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/init.d/bootcount b/target/linux/mediatek/filogic/base-files/etc/init.d/bootcount old mode 100644 new mode 100755 diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/90_extract_caldata b/target/linux/mediatek/filogic/base-files/lib/preinit/90_extract_caldata new file mode 100644 index 00000000000..e2e79a04653 --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/90_extract_caldata @@ -0,0 +1,12 @@ +. /lib/functions/system.sh + +do_extract_caldata() { + case $(board_name) in + glinet,gl-mt6000|\ + jdcloud,re-cp-03) + FIRMWARE=mediatek/mt7986_eeprom_mt7976_dual.bin \ + sh /etc/hotplug.d/firmware/11-mt76-caldata + ;; + esac +} +boot_hook_add preinit_main do_extract_caldata diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index d4ccc9a5d16..b7aa5dde69b 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -96,6 +96,7 @@ platform_do_upgrade() { esac ;; cmcc,rax3000m-emmc-ubootmod|\ + glinet,gl-mt2500|\ glinet,gl-mt6000) CI_KERNPART="kernel" CI_ROOTPART="rootfs" @@ -104,15 +105,6 @@ platform_do_upgrade() { cudy,wr3000-v1) default_do_upgrade "$1" ;; - mercusys,mr90x-v1) - CI_UBIPART="ubi0" - nand_do_upgrade "$1" - ;; - ubnt,unifi-6-plus) - CI_KERNPART="kernel0" - EMMC_ROOT_DEV="$(cmdline_get_var root)" - emmc_do_upgrade "$1" - ;; h3c,magic-nx30-pro|\ jcg,q30|\ mediatek,mt7981-rfb|\ @@ -125,12 +117,30 @@ platform_do_upgrade() { CI_KERNPART="fit" nand_do_upgrade "$1" ;; + jdcloud,re-cp-03) + CI_KERNPART="production" + emmc_do_upgrade "$1" + ;; + mercusys,mr90x-v1) + CI_UBIPART="ubi0" + nand_do_upgrade "$1" + ;; + ubnt,unifi-6-plus) + CI_KERNPART="kernel0" + EMMC_ROOT_DEV="$(cmdline_get_var root)" + emmc_do_upgrade "$1" + ;; xiaomi,mi-router-wr30u-stock|\ xiaomi,redmi-router-ax6000-stock) CI_KERN_UBIPART=ubi_kernel CI_ROOT_UBIPART=ubi nand_do_upgrade "$1" ;; + zyxel,ex5601-t0-ubootmod) + CI_KERNPART="fit" + CI_ROOTPART="ubi_rootfs" + nand_do_upgrade "$1" + ;; *) nand_do_upgrade "$1" ;; @@ -166,6 +176,14 @@ platform_check_image() { platform_copy_config() { case "$(board_name)" in + acer,predator-w6|\ + cmcc,rax3000m-emmc-ubootmod|\ + glinet,gl-mt2500|\ + glinet,gl-mt6000|\ + jdcloud,re-cp-03|\ + ubnt,unifi-6-plus) + emmc_copy_config + ;; bananapi,bpi-r3|\ bananapi,bpi-r3-mini|\ cmcc,rax3000m) @@ -175,11 +193,6 @@ platform_copy_config() { ;; esac ;; - cmcc,rax3000m-emmc-ubootmod|\ - glinet,gl-mt6000|\ - ubnt,unifi-6-plus) - emmc_copy_config - ;; esac } diff --git a/target/linux/mediatek/filogic/config-5.15 b/target/linux/mediatek/filogic/config-5.15 index e9b5e5da770..2d34fe9ef3c 100644 --- a/target/linux/mediatek/filogic/config-5.15 +++ b/target/linux/mediatek/filogic/config-5.15 @@ -171,6 +171,8 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_WATCHDOG=y +CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y diff --git a/target/linux/mediatek/filogic/config-6.1 b/target/linux/mediatek/filogic/config-6.1 index 08cccaa33a8..ac84464ffa0 100644 --- a/target/linux/mediatek/filogic/config-6.1 +++ b/target/linux/mediatek/filogic/config-6.1 @@ -189,6 +189,8 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_WATCHDOG=y +CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_GRO_CELLS=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 7f3e88c2d0b..c67ac86a302 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -105,6 +105,23 @@ define Build/cetron-header rm $@.tmp endef +define Device/acelink_ew-7886cax + DEVICE_VENDOR := Acelink + DEVICE_MODEL := EW-7886CAX + DEVICE_DTS := mt7986a-acelink-ew-7886cax + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGES += factory.bin + IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += acelink_ew-7886cax + define Device/abt_asr3000-ubootmod DEVICE_VENDOR := ABT DEVICE_MODEL := ASR3000 (custom U-Boot layout) @@ -126,6 +143,22 @@ define Device/abt_asr3000-ubootmod endef TARGET_DEVICES += abt_asr3000-ubootmod +define Device/acer_predator-w6 + DEVICE_VENDOR := Acer + DEVICE_MODEL := Predator W6 + DEVICE_DTS := mt7986a-acer-predator-w6 + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware kmod-mt7916-firmware \ + mt7986-wo-firmware f2fsck mkf2fs automount + IMAGES := sysupgrade.bin + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += acer_predator-w6 + define Device/asus_tuf-ax4200 DEVICE_VENDOR := ASUS DEVICE_MODEL := TUF-AX4200 @@ -158,21 +191,6 @@ define Device/asus_tuf-ax6000 endef TARGET_DEVICES += asus_tuf-ax6000 -define Device/acer_predator-w6 - DEVICE_VENDOR := Acer - DEVICE_MODEL := Predator W6 - DEVICE_DTS := mt7986a-acer-predator-w6 - DEVICE_DTS_DIR := ../dts - DEVICE_DTS_LOADADDR := 0x47000000 - DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware kmod-mt7916-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs - IMAGES := sysupgrade.bin - KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb - KERNEL_INITRAMFS := kernel-bin | lzma | \ - fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata -endef -TARGET_DEVICES += acer_predator-w6 - define Device/bananapi_bpi-r3 DEVICE_VENDOR := Bananapi DEVICE_MODEL := BPi-R3 @@ -234,7 +252,7 @@ define Device/bananapi_bpi-r3-mini DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTS_LOADADDR := 0x43f00000 DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7986-firmware mt7986-wo-firmware \ - kmod-usb3 automount f2fsck mkf2fs \ + kmod-nvme kmod-usb3 automount f2fsck mkf2fs \ kmod-usb-net-cdc-mbim kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi KERNEL_LOADADDR := 0x44000000 KERNEL := kernel-bin | gzip @@ -259,7 +277,8 @@ TARGET_DEVICES += bananapi_bpi-r3-mini define Device/cetron_ct3003-stock DEVICE_VENDOR := Cetron - DEVICE_MODEL := CT3003 (stock layout) + DEVICE_MODEL := CT3003 + DEVICE_VARIANT := (stock layout) DEVICE_DTS := mt7981b-cetron-ct3003-stock DEVICE_DTS_DIR := ../dts SUPPORTED_DEVICES += cetron,ct3003 mediatek,mt7981-spim-snand-rfb @@ -277,7 +296,8 @@ TARGET_DEVICES += cetron_ct3003-stock define Device/cetron_ct3003-ubootmod DEVICE_VENDOR := Cetron - DEVICE_MODEL := CT3003 (custom U-Boot layout) + DEVICE_MODEL := CT3003 + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-cetron-ct3003-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware @@ -298,7 +318,8 @@ TARGET_DEVICES += cetron_ct3003-ubootmod define Device/cmcc_a10-ubootmod DEVICE_VENDOR := CMCC - DEVICE_MODEL := A10 (custom U-Boot layout) + DEVICE_MODEL := A10 + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-cmcc-a10-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware @@ -319,7 +340,8 @@ TARGET_DEVICES += cmcc_a10-ubootmod define Device/cmcc_rax3000m DEVICE_VENDOR := CMCC - DEVICE_MODEL := RAX3000M (OpenWrt U-Boot layout) + DEVICE_MODEL := RAX3000M + DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_DTS := mt7981b-cmcc-rax3000m DEVICE_DTS_OVERLAY := mt7981b-cmcc-rax3000m-emmc mt7981b-cmcc-rax3000m-nand DEVICE_DTS_DIR := ../dts @@ -352,7 +374,8 @@ TARGET_DEVICES += cmcc_rax3000m define Device/cmcc_rax3000m-emmc-ubootmod DEVICE_VENDOR := CMCC - DEVICE_MODEL := RAX3000M eMMC version (custom U-Boot layout) + DEVICE_MODEL := RAX3000M eMMC version + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-cmcc-rax3000m-emmc-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \ @@ -366,7 +389,8 @@ TARGET_DEVICES += cmcc_rax3000m-emmc-ubootmod define Device/cmcc_rax3000m-nand-ubootmod DEVICE_VENDOR := CMCC - DEVICE_MODEL := RAX3000M NAND version (custom U-Boot layout) + DEVICE_MODEL := RAX3000M NAND version + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-cmcc-rax3000m-nand-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware \ @@ -386,6 +410,23 @@ define Device/cmcc_rax3000m-nand-ubootmod endef TARGET_DEVICES += cmcc_rax3000m-nand-ubootmod +define Device/confiabits_mt7981 + DEVICE_VENDOR := Confiabits + DEVICE_MODEL := MT7981 + DEVICE_DTS := mt7981b-confiabits-mt7981 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-2500wan-gmac2-rfb + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware \ + kmod-usb3 automount +endef +TARGET_DEVICES += confiabits_mt7981 + define Device/cudy_wr3000-v1 DEVICE_VENDOR := Cudy DEVICE_MODEL := WR3000 @@ -405,13 +446,27 @@ define Device/cudy_wr3000-v1 endef TARGET_DEVICES += cudy_wr3000-v1 +define Device/glinet_gl-mt2500 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT2500 + DEVICE_DTS := mt7981b-glinet-gl-mt2500 + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + DEVICE_PACKAGES := -kmod-mt7915e -wpad-openssl f2fsck mkf2fs kmod-usb3 automount + SUPPORTED_DEVICES += glinet,mt2500-emmc + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata +endef +TARGET_DEVICES += glinet_gl-mt2500 + define Device/glinet_gl-mt3000 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-MT3000 DEVICE_DTS := mt7981b-glinet-gl-mt3000 DEVICE_DTS_DIR := ../dts SUPPORTED_DEVICES += glinet,mt3000-snand - DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan kmod-usb3 + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-hwmon-pwmfan \ + kmod-usb3 automount UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -426,7 +481,8 @@ define Device/glinet_gl-mt6000 DEVICE_MODEL := GL-MT6000 DEVICE_DTS := mt7986a-glinet-gl-mt6000 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-usb2 kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware \ + automount f2fsck mkf2fs IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata @@ -438,7 +494,8 @@ TARGET_DEVICES += glinet_gl-mt6000 define Device/h3c_magic-nx30-pro DEVICE_VENDOR := H3C - DEVICE_MODEL := Magic NX30 Pro (OpenWrt U-Boot layout) + DEVICE_MODEL := Magic NX30 Pro + DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_DTS := mt7981b-h3c-magic-nx30-pro DEVICE_DTS_DIR := ../dts UBINIZE_OPTS := -E 5 @@ -463,7 +520,8 @@ TARGET_DEVICES += h3c_magic-nx30-pro define Device/h3c_magic-nx30-pro-nmbm DEVICE_VENDOR := H3C - DEVICE_MODEL := Magic NX30 Pro (NMBM layout) + DEVICE_MODEL := Magic NX30 Pro + DEVICE_VARIANT := (NMBM layout) DEVICE_DTS := mt7981b-h3c-magic-nx30-pro-nmbm DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware @@ -484,7 +542,8 @@ TARGET_DEVICES += h3c_magic-nx30-pro-nmbm define Device/imou_lc-hx3001-ubootmod DEVICE_VENDOR := Imou - DEVICE_MODEL := LC-HX3001 (custom U-Boot layout) + DEVICE_MODEL := LC-HX3001 + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-imou-lc-hx3001-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware @@ -506,11 +565,14 @@ TARGET_DEVICES += imou_lc-hx3001-ubootmod define Device/jcg_q30 DEVICE_VENDOR := JCG - DEVICE_MODEL := Q30 (OpenWrt U-Boot layout) + DEVICE_MODEL := Q30 + DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_ALT0_VENDOR := JCG - DEVICE_ALT0_MODEL := Q30 Pro (OpenWrt U-Boot layout) + DEVICE_ALT0_MODEL := Q30 Pro + DEVICE_ALT0_VARIANT := (OpenWrt U-Boot layout) DEVICE_ALT1_VENDOR := CMCC - DEVICE_ALT1_MODEL := MR3000D-CIq (OpenWrt U-Boot layout) + DEVICE_ALT1_MODEL := MR3000D-CIq + DEVICE_ALT1_VARIANT := (OpenWrt U-Boot layout) SUPPORTED_DEVICES += jcg,q30-pro DEVICE_DTS := mt7981b-jcg-q30 DEVICE_DTS_DIR := ../dts @@ -535,11 +597,14 @@ TARGET_DEVICES += jcg_q30 define Device/jcg_q30-ubootmod DEVICE_VENDOR := JCG - DEVICE_MODEL := Q30 (custom U-Boot layout) + DEVICE_MODEL := Q30 + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_ALT0_VENDOR := JCG - DEVICE_ALT0_MODEL := Q30 Pro (custom U-Boot layout) + DEVICE_ALT0_MODEL := Q30 Pro + DEVICE_ALT0_VARIANT := (custom U-Boot layout) DEVICE_ALT1_VENDOR := CMCC - DEVICE_ALT1_MODEL := MR3000D-CIq (custom U-Boot layout) + DEVICE_ALT1_MODEL := MR3000D-CIq + DEVICE_ALT1_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-jcg-q30-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware @@ -558,8 +623,35 @@ define Device/jcg_q30-ubootmod endef TARGET_DEVICES += jcg_q30-ubootmod +define Device/jdcloud_re-cp-03 + DEVICE_VENDOR := JDCloud + DEVICE_MODEL := RE-CP-03 + DEVICE_DTS := mt7986a-jdcloud-re-cp-03 + DEVICE_DTS_DIR := ../dts + DEVICE_DTC_FLAGS := --pad 4096 + DEVICE_DTS_LOADADDR := 0x43f00000 + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware \ + e2fsprogs f2fsck mkf2fs + KERNEL_LOADADDR := 0x44000000 + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + IMAGES := sysupgrade.itb + IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \ + pad-rootfs | append-metadata + ARTIFACTS :=gpt.bin preloader.bin bl31-uboot.fip + ARTIFACT/gpt.bin := mt798x-gpt emmc + ARTIFACT/preloader.bin := mt7986-bl2 emmc-ddr4 + ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot jdcloud_re-cp-03 +endef +TARGET_DEVICES += jdcloud_re-cp-03 + define Device/livinet_zr-3020-common DEVICE_VENDOR := Livinet + DEVICE_MODEL := ZR-3020 DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware UBINIZE_OPTS := -E 5 @@ -576,7 +668,7 @@ define Device/livinet_zr-3020-common endef define Device/livinet_zr-3020 - DEVICE_MODEL := ZR-3020 (stock layout) + DEVICE_VARIANT := (stock layout) DEVICE_DTS := mt7981b-livinet-zr-3020 SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-gsw-rfb IMAGE_SIZE := 65536k @@ -585,31 +677,13 @@ endef TARGET_DEVICES += livinet_zr-3020 define Device/livinet_zr-3020-ubootmod - DEVICE_MODEL := ZR-3020 (custom U-Boot layout) + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-livinet-zr-3020-ubootmod IMAGE_SIZE := 98304k $(call Device/livinet_zr-3020-common) endef TARGET_DEVICES += livinet_zr-3020-ubootmod -define Device/netgear_wax220 - DEVICE_VENDOR := NETGEAR - DEVICE_MODEL := WAX220 - DEVICE_DTS := mt7986b-netgear-wax220 - DEVICE_DTS_DIR := ../dts - NETGEAR_ENC_MODEL := WAX220 - NETGEAR_ENC_REGION := US - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware - KERNEL_INITRAMFS_SUFFIX := -recovery.itb - IMAGE_SIZE := 32768k - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - IMAGES += factory.img - # Padding to 10M seems to be required by OEM web interface - IMAGE/factory.img := sysupgrade-tar | \ - pad-to 10M | check-size | netgear-encrypted-factory -endef -TARGET_DEVICES += netgear_wax220 - define Device/mediatek_mt7981-rfb DEVICE_VENDOR := MediaTek DEVICE_MODEL := MT7981 rfb @@ -781,9 +855,28 @@ define Device/mercusys_mr90x-v1 endef TARGET_DEVICES += mercusys_mr90x-v1 +define Device/netgear_wax220 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := WAX220 + DEVICE_DTS := mt7986b-netgear-wax220 + DEVICE_DTS_DIR := ../dts + NETGEAR_ENC_MODEL := WAX220 + NETGEAR_ENC_REGION := US + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + IMAGE_SIZE := 32768k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGES += factory.img + # Padding to 10M seems to be required by OEM web interface + IMAGE/factory.img := sysupgrade-tar | \ + pad-to 10M | check-size | netgear-encrypted-factory +endef +TARGET_DEVICES += netgear_wax220 + define Device/qihoo_360t7 DEVICE_VENDOR := Qihoo - DEVICE_MODEL := 360T7 (OpenWrt U-Boot layout) + DEVICE_MODEL := 360T7 + DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_DTS := mt7981b-qihoo-360t7 DEVICE_DTS_DIR := ../dts UBINIZE_OPTS := -E 5 @@ -807,7 +900,8 @@ TARGET_DEVICES += qihoo_360t7 define Device/qihoo_360t7-ubootmod DEVICE_VENDOR := Qihoo - DEVICE_MODEL := 360T7 (custom U-Boot layout) + DEVICE_MODEL := 360T7 + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-qihoo-360t7-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware @@ -883,7 +977,8 @@ TARGET_DEVICES += ubnt_unifi-6-plus define Device/xiaomi_mi-router-wr30u-112m-nmbm DEVICE_VENDOR := Xiaomi - DEVICE_MODEL := Mi Router WR30U (custom U-Boot layout) + DEVICE_MODEL := Mi Router WR30U + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-112m-nmbm DEVICE_DTS_DIR := ../dts UBINIZE_OPTS := -E 5 @@ -904,7 +999,8 @@ TARGET_DEVICES += xiaomi_mi-router-wr30u-112m-nmbm define Device/xiaomi_mi-router-wr30u-stock DEVICE_VENDOR := Xiaomi - DEVICE_MODEL := Mi Router WR30U (stock layout) + DEVICE_MODEL := Mi Router WR30U + DEVICE_VARIANT := (stock layout) DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-stock DEVICE_DTS_DIR := ../dts UBINIZE_OPTS := -E 5 @@ -921,7 +1017,8 @@ TARGET_DEVICES += xiaomi_mi-router-wr30u-stock define Device/xiaomi_mi-router-wr30u-ubootmod DEVICE_VENDOR := Xiaomi - DEVICE_MODEL := Mi Router WR30U (OpenWrt U-Boot layout) + DEVICE_MODEL := Mi Router WR30U + DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-ubootmod DEVICE_DTS_DIR := ../dts UBINIZE_OPTS := -E 5 @@ -949,7 +1046,8 @@ TARGET_DEVICES += xiaomi_mi-router-wr30u-ubootmod define Device/xiaomi_redmi-router-ax6000 DEVICE_VENDOR := Xiaomi - DEVICE_MODEL := Redmi Router AX6000 (custom U-Boot layout) + DEVICE_MODEL := Redmi Router AX6000 + DEVICE_VARIANT := (custom U-Boot layout) DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000 DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware @@ -967,7 +1065,8 @@ TARGET_DEVICES += xiaomi_redmi-router-ax6000 define Device/xiaomi_redmi-router-ax6000-stock DEVICE_VENDOR := Xiaomi - DEVICE_MODEL := Redmi Router AX6000 (stock layout) + DEVICE_MODEL := Redmi Router AX6000 + DEVICE_VARIANT := (stock layout) DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-stock DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware @@ -984,7 +1083,8 @@ TARGET_DEVICES += xiaomi_redmi-router-ax6000-stock define Device/xiaomi_redmi-router-ax6000-ubootmod DEVICE_VENDOR := Xiaomi - DEVICE_MODEL := Redmi Router AX6000 (OpenWrt U-Boot layout) + DEVICE_MODEL := Redmi Router AX6000 + DEVICE_VARIANT := (OpenWrt U-Boot layout) DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-ubootmod DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware @@ -1010,12 +1110,31 @@ endif endef TARGET_DEVICES += xiaomi_redmi-router-ax6000-ubootmod +define Device/zbtlink_zbt-z8102ax + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-Z8102AX + DEVICE_DTS := mt7981b-zbtlink-zbt-z8102ax + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \ + kmod-usb-net-qmi-wwan kmod-usb-serial-option automount + KERNEL_IN_UBI := 1 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + IMAGES += factory.bin + IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += zbtlink_zbt-z8102ax + define Device/zyxel_ex5601-t0-stock DEVICE_VENDOR := Zyxel - DEVICE_MODEL := EX5601-T0 (stock layout) + DEVICE_MODEL := EX5601-T0 + DEVICE_VARIANT := (stock layout) DEVICE_DTS := mt7986a-zyxel-ex5601-t0-stock DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 automount SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand UBINIZE_OPTS := -E 5 BLOCKSIZE := 256k @@ -1032,12 +1151,42 @@ define Device/zyxel_ex5601-t0-stock endef TARGET_DEVICES += zyxel_ex5601-t0-stock +define Device/zyxel_ex5601-t0-ubootmod + DEVICE_VENDOR := Zyxel + DEVICE_MODEL := EX5601-T0 + DEVICE_VARIANT := (OpenWrt U-Boot layout) + DEVICE_DTS := mt7986a-zyxel-ex5601-t0-ubootmod + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 automount + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + IMAGES := sysupgrade.itb + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 256k + PAGESIZE := 4096 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + KERNEL := kernel-bin | lzma + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd + IMAGE/sysupgrade.itb := append-kernel | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-4k-ddr4 + ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot zyxel_ex5601-t0 +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS += initramfs-factory.ubi + ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel +endif +endef +TARGET_DEVICES += zyxel_ex5601-t0-ubootmod + define Device/zyxel_ex5700-telenor DEVICE_VENDOR := ZyXEL DEVICE_MODEL := EX5700 (Telenor) DEVICE_DTS := mt7986a-zyxel-ex5700-telenor DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7916-firmware kmod-ubootenv-nvram kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7916-firmware kmod-ubootenv-nvram kmod-usb3 \ + kmod-mt7986-firmware mt7986-wo-firmware automount UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index e362e7428bd..d0f5280dcf7 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -21,7 +21,7 @@ define Build/buffalo-trx -f $(kern_bin) \ $(if $(rtfs_bin),\ -a 0x20000 \ - -b $$(( $(subst k, * 1024,$(kern_size)) )) \ + -b $$(( $(call exp_units,$(kern_size)) )) \ -f $(rtfs_bin),) \ $(if $(apnd_bin),\ -A $(apnd_bin) \ 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 0d9fa0550b2..69f2d2a545d 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 @@ -237,7 +237,7 @@ Signed-off-by: Wolfram Sang priv->adap.algo = &hix5hd2_i2c_algorithm; --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c -@@ -1111,7 +1111,7 @@ static void dmi_check_onboard_device(u8 +@@ -1110,7 +1110,7 @@ static void dmi_check_onboard_device(u8 memset(&info, 0, sizeof(struct i2c_board_info)); info.addr = dmi_devices[i].i2c_addr; @@ -246,7 +246,7 @@ Signed-off-by: Wolfram Sang i2c_new_client_device(adap, &info); break; } -@@ -1267,7 +1267,7 @@ static void register_dell_lis3lv02d_i2c_ +@@ -1266,7 +1266,7 @@ static void register_dell_lis3lv02d_i2c_ memset(&info, 0, sizeof(struct i2c_board_info)); info.addr = dell_lis3lv02d_devices[i].i2c_addr; @@ -403,7 +403,7 @@ Signed-off-by: Wolfram Sang /* Slow down if we can't sense SCL */ --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c -@@ -1403,7 +1403,7 @@ static int i2c_pxa_probe(struct platform +@@ -1463,7 +1463,7 @@ static int i2c_pxa_probe(struct platform spin_lock_init(&i2c->lock); init_waitqueue_head(&i2c->wait); diff --git a/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch b/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch index 5ded06ff63f..54901f5549e 100644 --- a/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch +++ b/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch @@ -37,7 +37,7 @@ * managed to set the command line, unless CONFIG_CMDLINE_FORCE --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -2057,6 +2057,14 @@ config CMDLINE_FORCE +@@ -2059,6 +2059,14 @@ config CMDLINE_FORCE endchoice diff --git a/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch b/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch index e37705f388c..9c575d694b1 100644 --- a/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch +++ b/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -389,6 +389,12 @@ config ROCKCHIP_PHY +@@ -386,6 +386,12 @@ config ROCKCHIP_PHY help Currently supports the integrated Ethernet PHY. @@ -15,7 +15,7 @@ help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -98,6 +98,7 @@ obj-$(CONFIG_QSEMI_PHY) += qsemi.o +@@ -94,6 +94,7 @@ obj-$(CONFIG_QSEMI_PHY) += qsemi.o obj-$(CONFIG_REALTEK_PHY) += realtek.o obj-$(CONFIG_RENESAS_PHY) += uPD60620.o obj-$(CONFIG_ROCKCHIP_PHY) += rockchip.o diff --git a/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch b/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch index eb2a40f5c1f..389b2e4c99d 100644 --- a/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch +++ b/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller L: linux-i2c@vger.kernel.org --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -314,6 +314,18 @@ config MEDIATEK_GE_PHY +@@ -311,6 +311,18 @@ config MEDIATEK_GE_PHY help Supports the MediaTek Gigabit Ethernet PHYs. @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller depends on PTP_1588_CLOCK_OPTIONAL --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -84,6 +84,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o +@@ -80,6 +80,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o obj-$(CONFIG_MEDIATEK_GE_PHY) += mediatek-ge.o diff --git a/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch b/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch index 125bd9b0b38..a3dcefd3f18 100644 --- a/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch +++ b/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch @@ -13,7 +13,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -326,6 +326,13 @@ config MEDIATEK_GE_SOC_PHY +@@ -323,6 +323,13 @@ config MEDIATEK_GE_SOC_PHY present in the SoCs efuse and will dynamically calibrate VCM (common-mode voltage) during startup. @@ -29,7 +29,7 @@ Signed-off-by: Daniel Golle depends on PTP_1588_CLOCK_OPTIONAL --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -83,6 +83,7 @@ obj-$(CONFIG_MARVELL_10G_PHY) += marvell +@@ -79,6 +79,7 @@ obj-$(CONFIG_MARVELL_10G_PHY) += marvell obj-$(CONFIG_MARVELL_PHY) += marvell.o obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o 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 f9fc450277c..72e4d150095 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 -@@ -2234,6 +2234,14 @@ config CMDLINE_FORCE +@@ -2236,6 +2236,14 @@ config CMDLINE_FORCE endchoice diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts index f7d7b4cf08c..39c3f137da6 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts @@ -43,9 +43,7 @@ reg = <0 0xffe05000 0 0x1000>; ranges = <0x0 0x0 0x0 0xec000000 0x4000000>; - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; + nor@0 { compatible = "cfi-flash"; reg = <0x0 0x0 0x4000000>; bank-width = <2>; @@ -158,8 +156,6 @@ switch@10 { compatible = "qca,qca8327"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x10>; reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts index 607706a2d43..89d8afe463a 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts @@ -194,7 +194,7 @@ 0x1 0x0 0x0 0xff800000 0x00010000 0x3 0x0 0x0 0xffb00000 0x00000020>; - nand@1,0 { + nand@100000000 { compatible = "fsl,ifc-nand"; reg = <0x1 0x0 0x10000>; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts index f74aca58c0d..6ad5c4ccd6d 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts @@ -35,7 +35,7 @@ reg = <0 0xffe05000 0 0x1000>; ranges = <0x0 0x0 0x0 0xec000000 0x4000000>; - nor@0,0 { + nor@0 { #address-cells = <1>; #size-cells = <1>; compatible = "cfi-flash"; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts index 9be822f7bb8..4b3b52d35b1 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts @@ -31,7 +31,7 @@ 0x2 0x0 0x0 0xffa00000 0x00020000 0x3 0x0 0x0 0xffb00000 0x00020000>; - nand@1,0 { + nand@100000000 { compatible = "fsl,p1020-fcm-nand", "fsl,elbc-fcm-nand"; reg = <0x1 0x0 0x40000>; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts index db35602b94b..19bb8023ed5 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts @@ -122,7 +122,7 @@ 0x1 0x0 0x0 0xff800000 0x00010000 0x3 0x0 0x0 0xffb00000 0x00000020>; - nand@1,0 { + nand@100000000 { compatible = "fsl,ifc-nand"; reg = <0x1 0x0 0x10000>; @@ -165,19 +165,23 @@ read-only; }; - partition@300000 { - reg = <0x300000 0x800000>; - label = "kernel"; - }; - - partition@b00000 { - reg = <0xb00000 0x7500000>; - label = "ubi"; - }; - oem-partition@300000 { reg = <0x300000 0x1900000>; label = "sophos-os1"; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x800000>; + label = "kernel"; + }; + + partition@800000 { + reg = <0x800000 0x7500000>; + label = "ubi"; + }; }; oem-partition@1c00000 { diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts index ef46d8f14af..5cf3c26fc93 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts @@ -125,10 +125,8 @@ reg = <4>; }; - switch@0 { + switch@10 { compatible = "qca,qca8327"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x10>; ports { diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts index 5d81da46864..72b8f7a9d6e 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts @@ -60,7 +60,7 @@ reg = <0 0xffe05000 0 0x1000>; ranges = <0x0 0x0 0x0 0xee000000 0x2000000>; - nor@0,0 { + nor@0 { #address-cells = <1>; #size-cells = <1>; compatible = "cfi-flash"; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts index af8917ffe1a..764c8a31c8a 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts @@ -152,7 +152,7 @@ 0x1000000 0x0 0x0 0x0 0x100000>; - wifi@0,0,0 { + wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0 0 0 0 0>; ieee80211-freq-limit = <2400000 2500000>; @@ -173,7 +173,7 @@ 0x1000000 0x0 0x0 0x0 0x100000>; - wifi@0,0,0 { + wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts index ef40a4d2a3d..e72d8e93544 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts @@ -9,6 +9,9 @@ model = "Extreme Networks WS-AP3825i"; compatible = "extreme-networks,ws-ap3825i"; + #address-cells = <2>; + #size-cells = <2>; + aliases { ethernet0 = &enet0; ethernet1 = &enet2; @@ -301,8 +304,18 @@ }; memory { - /* Reserve upper MB for second-core-bootpage */ - reg = <0x0 0x0 0x0 0xff00000>; + reg = <0x0 0x0 0x0 0x10000000>; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + cpu1-bootpage@e000000 { + /* Reserve upper 1 MB for second-core-bootpage */ + reg = <0x0 0xff00000 0x0 0x100000>; + }; }; soc@ffe00000 { diff --git a/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch b/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch new file mode 100644 index 00000000000..1ff80a5016e --- /dev/null +++ b/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch @@ -0,0 +1,41 @@ +From 5f856ccc34df25060d36a5a81b7b45b574d86e35 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Sun, 3 Dec 2023 20:09:24 +0100 +Subject: [PATCH] arch: powerpc: simpleboot: prevent overwrite of CPU1 + spin-table + +Don't overwrite the spin-table of additional CPU cores with loader-heap. + +U-Boot places the spin-table for CPU1 on P1020 SoCs in the top 1MB of +system-memory. Instead of parsing reserved-memory (which would be +considerable more work), reduce the available system-memory for the +loader by 1MB. + +This prevents the loader from overwriting the spin-table of +additional CPU cores on these platforms. + +Linux itself needs to be made aware by this using reserved-memory +definitions. + +This patch is required for using CPU1 on the Extreme Networks +WS-AP3825i. + +Signed-off-by: David Bauer +--- + arch/powerpc/boot/simpleboot.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/powerpc/boot/simpleboot.c ++++ b/arch/powerpc/boot/simpleboot.c +@@ -65,6 +65,11 @@ void platform_init(unsigned long r3, uns + if (sizeof(void *) == 4 && memsize64 >= 0x100000000ULL) + memsize64 = 0xffffffff; + ++ /* Reserve upper 1 MB of memory for CPU1 spin-table */ ++ if (memsize64 > 0x100000) { ++ memsize64 = memsize64 - 0x100000; ++ } ++ + /* finally, setup the timebase */ + node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type", + "cpu", sizeof("cpu")); diff --git a/target/linux/mvebu/patches-5.15/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch b/target/linux/mvebu/patches-5.15/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch deleted file mode 100644 index 7a0dc15ff68..00000000000 --- a/target/linux/mvebu/patches-5.15/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch +++ /dev/null @@ -1,139 +0,0 @@ -From ea8444b6fa5955c16b713dc83310882b93b44e62 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 10 Nov 2023 10:10:29 +0100 -Subject: [PATCH] Revert "i2c: pxa: move to generic GPIO recovery" - -This reverts commit 0b01392c18b9993a584f36ace1d61118772ad0ca. - -Conversion of PXA to generic I2C recovery, makes the I2C bus completely -lock up if recovery pinctrl is present in the DT and I2C recovery is -enabled. - -So, until the generic I2C recovery can also work with PXA lets revert -to have working I2C and I2C recovery again. - -Signed-off-by: Robert Marko -Cc: stable@vger.kernel.org # 5.11+ ---- - drivers/i2c/busses/i2c-pxa.c | 76 ++++++++++++++++++++++++++++++++---- - 1 file changed, 68 insertions(+), 8 deletions(-) - ---- a/drivers/i2c/busses/i2c-pxa.c -+++ b/drivers/i2c/busses/i2c-pxa.c -@@ -264,6 +264,9 @@ struct pxa_i2c { - u32 hs_mask; - - struct i2c_bus_recovery_info recovery; -+ struct pinctrl *pinctrl; -+ struct pinctrl_state *pinctrl_default; -+ struct pinctrl_state *pinctrl_recovery; - }; - - #define _IBMR(i2c) ((i2c)->reg_ibmr) -@@ -1302,12 +1305,13 @@ static void i2c_pxa_prepare_recovery(str - */ - gpiod_set_value(i2c->recovery.scl_gpiod, ibmr & IBMR_SCLS); - gpiod_set_value(i2c->recovery.sda_gpiod, ibmr & IBMR_SDAS); -+ -+ WARN_ON(pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_recovery)); - } - - static void i2c_pxa_unprepare_recovery(struct i2c_adapter *adap) - { - struct pxa_i2c *i2c = adap->algo_data; -- struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; - u32 isr; - - /* -@@ -1321,7 +1325,7 @@ static void i2c_pxa_unprepare_recovery(s - i2c_pxa_do_reset(i2c); - } - -- WARN_ON(pinctrl_select_state(bri->pinctrl, bri->pins_default)); -+ WARN_ON(pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_default)); - - dev_dbg(&i2c->adap.dev, "recovery: IBMR 0x%08x ISR 0x%08x\n", - readl(_IBMR(i2c)), readl(_ISR(i2c))); -@@ -1343,20 +1347,76 @@ static int i2c_pxa_init_recovery(struct - if (IS_ENABLED(CONFIG_I2C_PXA_SLAVE)) - return 0; - -- bri->pinctrl = devm_pinctrl_get(dev); -- if (PTR_ERR(bri->pinctrl) == -ENODEV) { -- bri->pinctrl = NULL; -+ i2c->pinctrl = devm_pinctrl_get(dev); -+ if (PTR_ERR(i2c->pinctrl) == -ENODEV) -+ i2c->pinctrl = NULL; -+ if (IS_ERR(i2c->pinctrl)) -+ return PTR_ERR(i2c->pinctrl); -+ -+ if (!i2c->pinctrl) -+ return 0; -+ -+ i2c->pinctrl_default = pinctrl_lookup_state(i2c->pinctrl, -+ PINCTRL_STATE_DEFAULT); -+ i2c->pinctrl_recovery = pinctrl_lookup_state(i2c->pinctrl, "recovery"); -+ -+ if (IS_ERR(i2c->pinctrl_default) || IS_ERR(i2c->pinctrl_recovery)) { -+ dev_info(dev, "missing pinmux recovery information: %ld %ld\n", -+ PTR_ERR(i2c->pinctrl_default), -+ PTR_ERR(i2c->pinctrl_recovery)); -+ return 0; -+ } -+ -+ /* -+ * Claiming GPIOs can influence the pinmux state, and may glitch the -+ * I2C bus. Do this carefully. -+ */ -+ bri->scl_gpiod = devm_gpiod_get(dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN); -+ if (bri->scl_gpiod == ERR_PTR(-EPROBE_DEFER)) -+ return -EPROBE_DEFER; -+ if (IS_ERR(bri->scl_gpiod)) { -+ dev_info(dev, "missing scl gpio recovery information: %pe\n", -+ bri->scl_gpiod); -+ return 0; -+ } -+ -+ /* -+ * We have SCL. Pull SCL low and wait a bit so that SDA glitches -+ * have no effect. -+ */ -+ gpiod_direction_output(bri->scl_gpiod, 0); -+ udelay(10); -+ bri->sda_gpiod = devm_gpiod_get(dev, "sda", GPIOD_OUT_HIGH_OPEN_DRAIN); -+ -+ /* Wait a bit in case of a SDA glitch, and then release SCL. */ -+ udelay(10); -+ gpiod_direction_output(bri->scl_gpiod, 1); -+ -+ if (bri->sda_gpiod == ERR_PTR(-EPROBE_DEFER)) -+ return -EPROBE_DEFER; -+ -+ if (IS_ERR(bri->sda_gpiod)) { -+ dev_info(dev, "missing sda gpio recovery information: %pe\n", -+ bri->sda_gpiod); - return 0; - } -- if (IS_ERR(bri->pinctrl)) -- return PTR_ERR(bri->pinctrl); - - bri->prepare_recovery = i2c_pxa_prepare_recovery; - bri->unprepare_recovery = i2c_pxa_unprepare_recovery; -+ bri->recover_bus = i2c_generic_scl_recovery; - - i2c->adap.bus_recovery_info = bri; - -- return 0; -+ /* -+ * Claiming GPIOs can change the pinmux state, which confuses the -+ * pinctrl since pinctrl's idea of the current setting is unaffected -+ * by the pinmux change caused by claiming the GPIO. Work around that -+ * by switching pinctrl to the GPIO state here. We do it this way to -+ * avoid glitching the I2C bus. -+ */ -+ pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_recovery); -+ -+ return pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_default); - } - - static int i2c_pxa_probe(struct platform_device *dev) diff --git a/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index d064b801ecf..bedeea4784c 100644 --- a/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -258,7 +258,7 @@ Signed-off-by: Michael Gray static int kernel_init(void *); extern void init_IRQ(void); -@@ -988,6 +992,18 @@ asmlinkage __visible void __init __no_sa +@@ -992,6 +996,18 @@ asmlinkage __visible void __init __no_sa page_alloc_init(); pr_notice("Kernel command line: %s\n", saved_command_line); diff --git a/target/linux/mvebu/patches-6.1/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch b/target/linux/mvebu/patches-6.1/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch deleted file mode 100644 index 7a0dc15ff68..00000000000 --- a/target/linux/mvebu/patches-6.1/106-Revert-i2c-pxa-move-to-generic-GPIO-recovery.patch +++ /dev/null @@ -1,139 +0,0 @@ -From ea8444b6fa5955c16b713dc83310882b93b44e62 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 10 Nov 2023 10:10:29 +0100 -Subject: [PATCH] Revert "i2c: pxa: move to generic GPIO recovery" - -This reverts commit 0b01392c18b9993a584f36ace1d61118772ad0ca. - -Conversion of PXA to generic I2C recovery, makes the I2C bus completely -lock up if recovery pinctrl is present in the DT and I2C recovery is -enabled. - -So, until the generic I2C recovery can also work with PXA lets revert -to have working I2C and I2C recovery again. - -Signed-off-by: Robert Marko -Cc: stable@vger.kernel.org # 5.11+ ---- - drivers/i2c/busses/i2c-pxa.c | 76 ++++++++++++++++++++++++++++++++---- - 1 file changed, 68 insertions(+), 8 deletions(-) - ---- a/drivers/i2c/busses/i2c-pxa.c -+++ b/drivers/i2c/busses/i2c-pxa.c -@@ -264,6 +264,9 @@ struct pxa_i2c { - u32 hs_mask; - - struct i2c_bus_recovery_info recovery; -+ struct pinctrl *pinctrl; -+ struct pinctrl_state *pinctrl_default; -+ struct pinctrl_state *pinctrl_recovery; - }; - - #define _IBMR(i2c) ((i2c)->reg_ibmr) -@@ -1302,12 +1305,13 @@ static void i2c_pxa_prepare_recovery(str - */ - gpiod_set_value(i2c->recovery.scl_gpiod, ibmr & IBMR_SCLS); - gpiod_set_value(i2c->recovery.sda_gpiod, ibmr & IBMR_SDAS); -+ -+ WARN_ON(pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_recovery)); - } - - static void i2c_pxa_unprepare_recovery(struct i2c_adapter *adap) - { - struct pxa_i2c *i2c = adap->algo_data; -- struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; - u32 isr; - - /* -@@ -1321,7 +1325,7 @@ static void i2c_pxa_unprepare_recovery(s - i2c_pxa_do_reset(i2c); - } - -- WARN_ON(pinctrl_select_state(bri->pinctrl, bri->pins_default)); -+ WARN_ON(pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_default)); - - dev_dbg(&i2c->adap.dev, "recovery: IBMR 0x%08x ISR 0x%08x\n", - readl(_IBMR(i2c)), readl(_ISR(i2c))); -@@ -1343,20 +1347,76 @@ static int i2c_pxa_init_recovery(struct - if (IS_ENABLED(CONFIG_I2C_PXA_SLAVE)) - return 0; - -- bri->pinctrl = devm_pinctrl_get(dev); -- if (PTR_ERR(bri->pinctrl) == -ENODEV) { -- bri->pinctrl = NULL; -+ i2c->pinctrl = devm_pinctrl_get(dev); -+ if (PTR_ERR(i2c->pinctrl) == -ENODEV) -+ i2c->pinctrl = NULL; -+ if (IS_ERR(i2c->pinctrl)) -+ return PTR_ERR(i2c->pinctrl); -+ -+ if (!i2c->pinctrl) -+ return 0; -+ -+ i2c->pinctrl_default = pinctrl_lookup_state(i2c->pinctrl, -+ PINCTRL_STATE_DEFAULT); -+ i2c->pinctrl_recovery = pinctrl_lookup_state(i2c->pinctrl, "recovery"); -+ -+ if (IS_ERR(i2c->pinctrl_default) || IS_ERR(i2c->pinctrl_recovery)) { -+ dev_info(dev, "missing pinmux recovery information: %ld %ld\n", -+ PTR_ERR(i2c->pinctrl_default), -+ PTR_ERR(i2c->pinctrl_recovery)); -+ return 0; -+ } -+ -+ /* -+ * Claiming GPIOs can influence the pinmux state, and may glitch the -+ * I2C bus. Do this carefully. -+ */ -+ bri->scl_gpiod = devm_gpiod_get(dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN); -+ if (bri->scl_gpiod == ERR_PTR(-EPROBE_DEFER)) -+ return -EPROBE_DEFER; -+ if (IS_ERR(bri->scl_gpiod)) { -+ dev_info(dev, "missing scl gpio recovery information: %pe\n", -+ bri->scl_gpiod); -+ return 0; -+ } -+ -+ /* -+ * We have SCL. Pull SCL low and wait a bit so that SDA glitches -+ * have no effect. -+ */ -+ gpiod_direction_output(bri->scl_gpiod, 0); -+ udelay(10); -+ bri->sda_gpiod = devm_gpiod_get(dev, "sda", GPIOD_OUT_HIGH_OPEN_DRAIN); -+ -+ /* Wait a bit in case of a SDA glitch, and then release SCL. */ -+ udelay(10); -+ gpiod_direction_output(bri->scl_gpiod, 1); -+ -+ if (bri->sda_gpiod == ERR_PTR(-EPROBE_DEFER)) -+ return -EPROBE_DEFER; -+ -+ if (IS_ERR(bri->sda_gpiod)) { -+ dev_info(dev, "missing sda gpio recovery information: %pe\n", -+ bri->sda_gpiod); - return 0; - } -- if (IS_ERR(bri->pinctrl)) -- return PTR_ERR(bri->pinctrl); - - bri->prepare_recovery = i2c_pxa_prepare_recovery; - bri->unprepare_recovery = i2c_pxa_unprepare_recovery; -+ bri->recover_bus = i2c_generic_scl_recovery; - - i2c->adap.bus_recovery_info = bri; - -- return 0; -+ /* -+ * Claiming GPIOs can change the pinmux state, which confuses the -+ * pinctrl since pinctrl's idea of the current setting is unaffected -+ * by the pinmux change caused by claiming the GPIO. Work around that -+ * by switching pinctrl to the GPIO state here. We do it this way to -+ * avoid glitching the I2C bus. -+ */ -+ pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_recovery); -+ -+ return pinctrl_select_state(i2c->pinctrl, i2c->pinctrl_default); - } - - static int i2c_pxa_probe(struct platform_device *dev) diff --git a/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index 7d40019020d..f3881a0d25e 100644 --- a/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -258,7 +258,7 @@ Signed-off-by: Michael Gray static int kernel_init(void *); extern void init_IRQ(void); -@@ -989,6 +993,18 @@ asmlinkage __visible void __init __no_sa +@@ -993,6 +997,18 @@ asmlinkage __visible void __init __no_sa page_alloc_init(); pr_notice("Kernel command line: %s\n", saved_command_line); diff --git a/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch index 307c46e7b80..15762be81d4 100644 --- a/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -5222,6 +5222,16 @@ static int mvneta_setup_tc(struct net_de +@@ -5234,6 +5234,16 @@ static int mvneta_setup_tc(struct net_de } } @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -5232,6 +5242,9 @@ static const struct net_device_ops mvnet +@@ -5244,6 +5254,9 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_eth_ioctl = mvneta_ioctl, diff --git a/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch b/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch index 05eaa9aedfe..0400d1e9ddc 100644 --- a/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch +++ b/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch @@ -22,7 +22,7 @@ Signed-off-by: Tim Harvey #include #include #include -@@ -5858,3 +5859,34 @@ static void nvidia_ion_ahci_fixup(struct +@@ -5879,3 +5880,34 @@ static void nvidia_ion_ahci_fixup(struct pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup); diff --git a/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch index 1e04b9daf58..f1fa6ca45fb 100644 --- a/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -239,7 +239,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -988,6 +992,18 @@ asmlinkage __visible void __init __no_sa +@@ -992,6 +996,18 @@ asmlinkage __visible void __init __no_sa page_alloc_init(); pr_notice("Kernel command line: %s\n", saved_command_line); diff --git a/target/linux/qoriq/base-files/etc/board.d/05_compat-version b/target/linux/qoriq/base-files/etc/board.d/05_compat-version new file mode 100644 index 00000000000..2036fbcc954 --- /dev/null +++ b/target/linux/qoriq/base-files/etc/board.d/05_compat-version @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + watchguard,firebox-m300) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/qoriq/image/Makefile b/target/linux/qoriq/image/Makefile index ec46e4d5432..69fea238b5e 100644 --- a/target/linux/qoriq/image/Makefile +++ b/target/linux/qoriq/image/Makefile @@ -13,7 +13,7 @@ define Build/sdcard-img $(foreach dtb,$(DEVICE_DTS),$(CP) $(KDIR)/image-$(dtb).dtb $@.boot), \ $(CP) $(KDIR)/image-/*.dtb $@.boot) - $(SCRIPT_DIR)/gen_image_generic.sh \ + PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \ $@ \ $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \ diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi index 23b9121d5fc..2bb2cce157c 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi @@ -151,28 +151,30 @@ reg = <0x800000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_dp2: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_dp3: macaddr@c { - reg = <0xc 0x6>; - }; - - macaddr_dp4: macaddr@12 { - reg = <0x12 0x6>; - }; - - macaddr_dp5: macaddr@18 { - reg = <0x18 0x6>; - }; - - caldata_qca9889: caldata@4d000 { - reg = <0x33000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_dp2: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_dp3: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_dp4: macaddr@12 { + reg = <0x12 0x6>; + }; + + macaddr_dp5: macaddr@18 { + reg = <0x18 0x6>; + }; + + caldata_qca9889: caldata@4d000 { + reg = <0x33000 0x844>; + }; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts index fbf5b41d85f..0df16e9ad7d 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts @@ -280,32 +280,34 @@ reg = <0xf80000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_dp1: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_dp2: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_dp3: macaddr@c { - reg = <0xc 0x6>; - }; - - macaddr_dp4: macaddr@12 { - reg = <0x12 0x6>; - }; - - macaddr_dp5: macaddr@18 { - reg = <0x18 0x6>; - }; - - caldata_qca9889: caldata@4d000 { - reg = <0x4d000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_dp1: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_dp2: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_dp3: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_dp4: macaddr@12 { + reg = <0x12 0x6>; + }; + + macaddr_dp5: macaddr@18 { + reg = <0x18 0x6>; + }; + + caldata_qca9889: caldata@4d000 { + reg = <0x4d000 0x844>; + }; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts index 0a5bbb4c35d..0949d19171a 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts @@ -441,34 +441,35 @@ reg = <0x1180000 0x0100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_dp1: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_dp2: macaddr@1 { - reg = <0x6 0x6>; - }; - - macaddr_dp3: macaddr@2 { - reg = <0xc 0x6>; - }; - - macaddr_dp4: macaddr@3 { - reg = <0x12 0x6>; - }; - - macaddr_dp5: macaddr@4 { - reg = <0x18 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_dp1: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_dp2: macaddr@1 { + reg = <0x6 0x6>; + }; + + macaddr_dp3: macaddr@2 { + reg = <0xc 0x6>; + }; + + macaddr_dp4: macaddr@3 { + reg = <0x12 0x6>; + }; + + macaddr_dp5: macaddr@4 { + reg = <0x18 0x6>; + }; + + macaddr_dp6_syn: macaddr@5 { + reg = <0x1e 0x6>; + }; }; - - macaddr_dp6_syn: macaddr@5 { - reg = <0x1e 0x6>; - }; - }; partition@1280000 { diff --git a/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch b/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch index 9162ea538d3..c209adbc06f 100644 --- a/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch +++ b/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch @@ -390,8 +390,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll0_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -429,9 +86,8 @@ static struct clk_alpha_pll_postdiv gpll + }, +@@ -428,9 +85,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll0", @@ -403,7 +403,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, }, -@@ -445,8 +101,9 @@ static struct clk_alpha_pll gpll2_main = +@@ -444,8 +100,9 @@ static struct clk_alpha_pll gpll2_main = .enable_mask = BIT(2), .hw.init = &(struct clk_init_data){ .name = "gpll2_main", @@ -415,7 +415,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -461,9 +118,8 @@ static struct clk_alpha_pll_postdiv gpll +@@ -460,9 +117,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll2", @@ -426,8 +426,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll2_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -478,8 +134,9 @@ static struct clk_alpha_pll gpll4_main = + }, +@@ -476,8 +132,9 @@ static struct clk_alpha_pll gpll4_main = .enable_mask = BIT(5), .hw.init = &(struct clk_init_data){ .name = "gpll4_main", @@ -439,7 +439,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -494,9 +151,8 @@ static struct clk_alpha_pll_postdiv gpll +@@ -492,9 +149,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll4", @@ -450,8 +450,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll4_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -512,8 +168,9 @@ static struct clk_alpha_pll gpll6_main = + }, +@@ -509,8 +165,9 @@ static struct clk_alpha_pll gpll6_main = .enable_mask = BIT(7), .hw.init = &(struct clk_init_data){ .name = "gpll6_main", @@ -463,7 +463,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -528,9 +185,8 @@ static struct clk_alpha_pll_postdiv gpll +@@ -525,9 +182,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 2, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll6", @@ -474,8 +474,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll6_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -542,9 +198,8 @@ static struct clk_fixed_factor gpll6_out + }, +@@ -538,9 +194,8 @@ static struct clk_fixed_factor gpll6_out .div = 2, .hw.init = &(struct clk_init_data){ .name = "gpll6_out_main_div2", @@ -486,8 +486,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll6_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -560,8 +215,9 @@ static struct clk_alpha_pll ubi32_pll_ma + }, +@@ -555,8 +210,9 @@ static struct clk_alpha_pll ubi32_pll_ma .enable_mask = BIT(6), .hw.init = &(struct clk_init_data){ .name = "ubi32_pll_main", @@ -499,7 +499,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_huayra_ops, -@@ -575,9 +231,8 @@ static struct clk_alpha_pll_postdiv ubi3 +@@ -570,9 +226,8 @@ static struct clk_alpha_pll_postdiv ubi3 .width = 2, .clkr.hw.init = &(struct clk_init_data){ .name = "ubi32_pll", @@ -511,7 +511,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, .flags = CLK_SET_RATE_PARENT, -@@ -592,8 +247,9 @@ static struct clk_alpha_pll nss_crypto_p +@@ -587,8 +242,9 @@ static struct clk_alpha_pll nss_crypto_p .enable_mask = BIT(4), .hw.init = &(struct clk_init_data){ .name = "nss_crypto_pll_main", @@ -523,7 +523,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -607,9 +263,8 @@ static struct clk_alpha_pll_postdiv nss_ +@@ -602,9 +258,8 @@ static struct clk_alpha_pll_postdiv nss_ .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_crypto_pll", @@ -534,8 +534,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &nss_crypto_pll_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -623,6 +278,18 @@ static const struct freq_tbl ftbl_pcnoc_ + }, +@@ -617,6 +272,18 @@ static const struct freq_tbl ftbl_pcnoc_ { } }; @@ -554,7 +554,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 pcnoc_bfdcd_clk_src = { .cmd_rcgr = 0x27000, .freq_tbl = ftbl_pcnoc_bfdcd_clk_src, -@@ -630,8 +297,8 @@ static struct clk_rcg2 pcnoc_bfdcd_clk_s +@@ -624,8 +291,8 @@ static struct clk_rcg2 pcnoc_bfdcd_clk_s .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "pcnoc_bfdcd_clk_src", @@ -565,7 +565,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_IS_CRITICAL, }, -@@ -642,9 +309,8 @@ static struct clk_fixed_factor pcnoc_clk +@@ -636,9 +303,8 @@ static struct clk_fixed_factor pcnoc_clk .div = 1, .hw.init = &(struct clk_init_data){ .name = "pcnoc_clk_src", @@ -577,7 +577,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -658,8 +324,9 @@ static struct clk_branch gcc_sleep_clk_s +@@ -652,8 +318,9 @@ static struct clk_branch gcc_sleep_clk_s .enable_mask = BIT(1), .hw.init = &(struct clk_init_data){ .name = "gcc_sleep_clk_src", @@ -589,7 +589,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_branch2_ops, -@@ -682,8 +349,8 @@ static struct clk_rcg2 blsp1_qup1_i2c_ap +@@ -676,8 +343,8 @@ static struct clk_rcg2 blsp1_qup1_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup1_i2c_apps_clk_src", @@ -600,7 +600,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -708,8 +375,8 @@ static struct clk_rcg2 blsp1_qup1_spi_ap +@@ -702,8 +369,8 @@ static struct clk_rcg2 blsp1_qup1_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup1_spi_apps_clk_src", @@ -611,7 +611,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -721,8 +388,8 @@ static struct clk_rcg2 blsp1_qup2_i2c_ap +@@ -715,8 +382,8 @@ static struct clk_rcg2 blsp1_qup2_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup2_i2c_apps_clk_src", @@ -622,7 +622,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -735,8 +402,8 @@ static struct clk_rcg2 blsp1_qup2_spi_ap +@@ -729,8 +396,8 @@ static struct clk_rcg2 blsp1_qup2_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup2_spi_apps_clk_src", @@ -633,7 +633,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -748,8 +415,8 @@ static struct clk_rcg2 blsp1_qup3_i2c_ap +@@ -742,8 +409,8 @@ static struct clk_rcg2 blsp1_qup3_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup3_i2c_apps_clk_src", @@ -644,7 +644,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -762,8 +429,8 @@ static struct clk_rcg2 blsp1_qup3_spi_ap +@@ -756,8 +423,8 @@ static struct clk_rcg2 blsp1_qup3_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup3_spi_apps_clk_src", @@ -655,7 +655,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -775,8 +442,8 @@ static struct clk_rcg2 blsp1_qup4_i2c_ap +@@ -769,8 +436,8 @@ static struct clk_rcg2 blsp1_qup4_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup4_i2c_apps_clk_src", @@ -666,7 +666,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -789,8 +456,8 @@ static struct clk_rcg2 blsp1_qup4_spi_ap +@@ -783,8 +450,8 @@ static struct clk_rcg2 blsp1_qup4_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup4_spi_apps_clk_src", @@ -677,7 +677,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -802,8 +469,8 @@ static struct clk_rcg2 blsp1_qup5_i2c_ap +@@ -796,8 +463,8 @@ static struct clk_rcg2 blsp1_qup5_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup5_i2c_apps_clk_src", @@ -688,7 +688,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -816,8 +483,8 @@ static struct clk_rcg2 blsp1_qup5_spi_ap +@@ -810,8 +477,8 @@ static struct clk_rcg2 blsp1_qup5_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup5_spi_apps_clk_src", @@ -699,7 +699,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -829,8 +496,8 @@ static struct clk_rcg2 blsp1_qup6_i2c_ap +@@ -823,8 +490,8 @@ static struct clk_rcg2 blsp1_qup6_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup6_i2c_apps_clk_src", @@ -710,7 +710,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -843,8 +510,8 @@ static struct clk_rcg2 blsp1_qup6_spi_ap +@@ -837,8 +504,8 @@ static struct clk_rcg2 blsp1_qup6_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup6_spi_apps_clk_src", @@ -721,7 +721,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -877,8 +544,8 @@ static struct clk_rcg2 blsp1_uart1_apps_ +@@ -871,8 +538,8 @@ static struct clk_rcg2 blsp1_uart1_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart1_apps_clk_src", @@ -732,7 +732,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -891,8 +558,8 @@ static struct clk_rcg2 blsp1_uart2_apps_ +@@ -885,8 +552,8 @@ static struct clk_rcg2 blsp1_uart2_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart2_apps_clk_src", @@ -743,7 +743,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -905,8 +572,8 @@ static struct clk_rcg2 blsp1_uart3_apps_ +@@ -899,8 +566,8 @@ static struct clk_rcg2 blsp1_uart3_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart3_apps_clk_src", @@ -754,7 +754,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -919,8 +586,8 @@ static struct clk_rcg2 blsp1_uart4_apps_ +@@ -913,8 +580,8 @@ static struct clk_rcg2 blsp1_uart4_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart4_apps_clk_src", @@ -765,7 +765,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -933,8 +600,8 @@ static struct clk_rcg2 blsp1_uart5_apps_ +@@ -927,8 +594,8 @@ static struct clk_rcg2 blsp1_uart5_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart5_apps_clk_src", @@ -776,7 +776,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -947,8 +614,8 @@ static struct clk_rcg2 blsp1_uart6_apps_ +@@ -941,8 +608,8 @@ static struct clk_rcg2 blsp1_uart6_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart6_apps_clk_src", @@ -787,7 +787,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -958,6 +625,11 @@ static const struct clk_parent_data gcc_ +@@ -952,6 +619,11 @@ static const struct clk_parent_data gcc_ { .hw = &gpll0.clkr.hw }, }; @@ -799,7 +799,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static const struct freq_tbl ftbl_pcie_axi_clk_src[] = { F(19200000, P_XO, 1, 0, 0), F(200000000, P_GPLL0, 4, 0, 0), -@@ -972,7 +644,7 @@ static struct clk_rcg2 pcie0_axi_clk_src +@@ -966,7 +638,7 @@ static struct clk_rcg2 pcie0_axi_clk_src .clkr.hw.init = &(struct clk_init_data){ .name = "pcie0_axi_clk_src", .parent_data = gcc_xo_gpll0, @@ -808,7 +808,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -981,6 +653,18 @@ static const struct freq_tbl ftbl_pcie_a +@@ -975,6 +647,18 @@ static const struct freq_tbl ftbl_pcie_a F(19200000, P_XO, 1, 0, 0), }; @@ -827,7 +827,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 pcie0_aux_clk_src = { .cmd_rcgr = 0x75024, .freq_tbl = ftbl_pcie_aux_clk_src, -@@ -989,12 +673,22 @@ static struct clk_rcg2 pcie0_aux_clk_src +@@ -983,12 +667,22 @@ static struct clk_rcg2 pcie0_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "pcie0_aux_clk_src", @@ -852,7 +852,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux pcie0_pipe_clk_src = { .reg = 0x7501c, .shift = 8, -@@ -1003,8 +697,8 @@ static struct clk_regmap_mux pcie0_pipe_ +@@ -997,8 +691,8 @@ static struct clk_regmap_mux pcie0_pipe_ .clkr = { .hw.init = &(struct clk_init_data){ .name = "pcie0_pipe_clk_src", @@ -863,7 +863,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1019,7 +713,7 @@ static struct clk_rcg2 pcie1_axi_clk_src +@@ -1013,7 +707,7 @@ static struct clk_rcg2 pcie1_axi_clk_src .clkr.hw.init = &(struct clk_init_data){ .name = "pcie1_axi_clk_src", .parent_data = gcc_xo_gpll0, @@ -872,7 +872,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1032,12 +726,22 @@ static struct clk_rcg2 pcie1_aux_clk_src +@@ -1026,12 +720,22 @@ static struct clk_rcg2 pcie1_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "pcie1_aux_clk_src", @@ -897,7 +897,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux pcie1_pipe_clk_src = { .reg = 0x7601c, .shift = 8, -@@ -1046,8 +750,8 @@ static struct clk_regmap_mux pcie1_pipe_ +@@ -1040,8 +744,8 @@ static struct clk_regmap_mux pcie1_pipe_ .clkr = { .hw.init = &(struct clk_init_data){ .name = "pcie1_pipe_clk_src", @@ -908,7 +908,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1066,6 +770,20 @@ static const struct freq_tbl ftbl_sdcc_a +@@ -1060,6 +764,20 @@ static const struct freq_tbl ftbl_sdcc_a { } }; @@ -929,7 +929,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 sdcc1_apps_clk_src = { .cmd_rcgr = 0x42004, .freq_tbl = ftbl_sdcc_apps_clk_src, -@@ -1074,8 +792,8 @@ static struct clk_rcg2 sdcc1_apps_clk_sr +@@ -1068,8 +786,8 @@ static struct clk_rcg2 sdcc1_apps_clk_sr .parent_map = gcc_xo_gpll0_gpll2_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "sdcc1_apps_clk_src", @@ -940,7 +940,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_floor_ops, }, }; -@@ -1086,6 +804,20 @@ static const struct freq_tbl ftbl_sdcc_i +@@ -1080,6 +798,20 @@ static const struct freq_tbl ftbl_sdcc_i F(308570000, P_GPLL6, 3.5, 0, 0), }; @@ -961,7 +961,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 sdcc1_ice_core_clk_src = { .cmd_rcgr = 0x5d000, .freq_tbl = ftbl_sdcc_ice_core_clk_src, -@@ -1094,8 +826,8 @@ static struct clk_rcg2 sdcc1_ice_core_cl +@@ -1088,8 +820,8 @@ static struct clk_rcg2 sdcc1_ice_core_cl .parent_map = gcc_xo_gpll0_gpll6_gpll0_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "sdcc1_ice_core_clk_src", @@ -972,7 +972,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1108,8 +840,8 @@ static struct clk_rcg2 sdcc2_apps_clk_sr +@@ -1102,8 +834,8 @@ static struct clk_rcg2 sdcc2_apps_clk_sr .parent_map = gcc_xo_gpll0_gpll2_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "sdcc2_apps_clk_src", @@ -983,7 +983,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_floor_ops, }, }; -@@ -1121,6 +853,18 @@ static const struct freq_tbl ftbl_usb_ma +@@ -1115,6 +847,18 @@ static const struct freq_tbl ftbl_usb_ma { } }; @@ -1002,7 +1002,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 usb0_master_clk_src = { .cmd_rcgr = 0x3e00c, .freq_tbl = ftbl_usb_master_clk_src, -@@ -1129,8 +873,8 @@ static struct clk_rcg2 usb0_master_clk_s +@@ -1123,8 +867,8 @@ static struct clk_rcg2 usb0_master_clk_s .parent_map = gcc_xo_gpll0_out_main_div2_gpll0_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb0_master_clk_src", @@ -1013,7 +1013,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1148,8 +892,8 @@ static struct clk_rcg2 usb0_aux_clk_src +@@ -1142,8 +886,8 @@ static struct clk_rcg2 usb0_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb0_aux_clk_src", @@ -1024,7 +1024,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1161,6 +905,20 @@ static const struct freq_tbl ftbl_usb_mo +@@ -1155,6 +899,20 @@ static const struct freq_tbl ftbl_usb_mo { } }; @@ -1045,7 +1045,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 usb0_mock_utmi_clk_src = { .cmd_rcgr = 0x3e020, .freq_tbl = ftbl_usb_mock_utmi_clk_src, -@@ -1169,12 +927,22 @@ static struct clk_rcg2 usb0_mock_utmi_cl +@@ -1163,12 +921,22 @@ static struct clk_rcg2 usb0_mock_utmi_cl .parent_map = gcc_xo_gpll6_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb0_mock_utmi_clk_src", @@ -1070,7 +1070,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux usb0_pipe_clk_src = { .reg = 0x3e048, .shift = 8, -@@ -1183,8 +951,8 @@ static struct clk_regmap_mux usb0_pipe_c +@@ -1177,8 +945,8 @@ static struct clk_regmap_mux usb0_pipe_c .clkr = { .hw.init = &(struct clk_init_data){ .name = "usb0_pipe_clk_src", @@ -1081,7 +1081,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1199,8 +967,8 @@ static struct clk_rcg2 usb1_master_clk_s +@@ -1193,8 +961,8 @@ static struct clk_rcg2 usb1_master_clk_s .parent_map = gcc_xo_gpll0_out_main_div2_gpll0_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb1_master_clk_src", @@ -1092,7 +1092,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1213,8 +981,8 @@ static struct clk_rcg2 usb1_aux_clk_src +@@ -1207,8 +975,8 @@ static struct clk_rcg2 usb1_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb1_aux_clk_src", @@ -1103,7 +1103,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1227,12 +995,22 @@ static struct clk_rcg2 usb1_mock_utmi_cl +@@ -1221,12 +989,22 @@ static struct clk_rcg2 usb1_mock_utmi_cl .parent_map = gcc_xo_gpll6_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb1_mock_utmi_clk_src", @@ -1128,7 +1128,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux usb1_pipe_clk_src = { .reg = 0x3f048, .shift = 8, -@@ -1241,8 +1019,8 @@ static struct clk_regmap_mux usb1_pipe_c +@@ -1235,8 +1013,8 @@ static struct clk_regmap_mux usb1_pipe_c .clkr = { .hw.init = &(struct clk_init_data){ .name = "usb1_pipe_clk_src", @@ -1139,7 +1139,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1256,8 +1034,9 @@ static struct clk_branch gcc_xo_clk_src +@@ -1250,8 +1028,9 @@ static struct clk_branch gcc_xo_clk_src .enable_mask = BIT(1), .hw.init = &(struct clk_init_data){ .name = "gcc_xo_clk_src", @@ -1151,7 +1151,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, -@@ -1271,9 +1050,8 @@ static struct clk_fixed_factor gcc_xo_di +@@ -1265,9 +1044,8 @@ static struct clk_fixed_factor gcc_xo_di .div = 4, .hw.init = &(struct clk_init_data){ .name = "gcc_xo_div4_clk_src", @@ -1163,7 +1163,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1291,6 +1069,20 @@ static const struct freq_tbl ftbl_system +@@ -1285,6 +1063,20 @@ static const struct freq_tbl ftbl_system { } }; @@ -1184,7 +1184,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 system_noc_bfdcd_clk_src = { .cmd_rcgr = 0x26004, .freq_tbl = ftbl_system_noc_bfdcd_clk_src, -@@ -1298,8 +1090,8 @@ static struct clk_rcg2 system_noc_bfdcd_ +@@ -1292,8 +1084,8 @@ static struct clk_rcg2 system_noc_bfdcd_ .parent_map = gcc_xo_gpll0_gpll6_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "system_noc_bfdcd_clk_src", @@ -1195,7 +1195,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_IS_CRITICAL, }, -@@ -1310,9 +1102,8 @@ static struct clk_fixed_factor system_no +@@ -1304,9 +1096,8 @@ static struct clk_fixed_factor system_no .div = 1, .hw.init = &(struct clk_init_data){ .name = "system_noc_clk_src", @@ -1207,7 +1207,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1333,7 +1124,7 @@ static struct clk_rcg2 nss_ce_clk_src = +@@ -1327,7 +1118,7 @@ static struct clk_rcg2 nss_ce_clk_src = .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ce_clk_src", .parent_data = gcc_xo_gpll0, @@ -1216,7 +1216,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1344,6 +1135,20 @@ static const struct freq_tbl ftbl_nss_no +@@ -1338,6 +1129,20 @@ static const struct freq_tbl ftbl_nss_no { } }; @@ -1237,7 +1237,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_noc_bfdcd_clk_src = { .cmd_rcgr = 0x68088, .freq_tbl = ftbl_nss_noc_bfdcd_clk_src, -@@ -1351,8 +1156,8 @@ static struct clk_rcg2 nss_noc_bfdcd_clk +@@ -1345,8 +1150,8 @@ static struct clk_rcg2 nss_noc_bfdcd_clk .parent_map = gcc_xo_bias_pll_nss_noc_clk_gpll0_gpll2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_noc_bfdcd_clk_src", @@ -1248,7 +1248,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1362,9 +1167,8 @@ static struct clk_fixed_factor nss_noc_c +@@ -1356,9 +1161,8 @@ static struct clk_fixed_factor nss_noc_c .div = 1, .hw.init = &(struct clk_init_data){ .name = "nss_noc_clk_src", @@ -1260,7 +1260,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1377,6 +1181,18 @@ static const struct freq_tbl ftbl_nss_cr +@@ -1371,6 +1175,18 @@ static const struct freq_tbl ftbl_nss_cr { } }; @@ -1279,7 +1279,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_crypto_clk_src = { .cmd_rcgr = 0x68144, .freq_tbl = ftbl_nss_crypto_clk_src, -@@ -1385,8 +1201,8 @@ static struct clk_rcg2 nss_crypto_clk_sr +@@ -1379,8 +1195,8 @@ static struct clk_rcg2 nss_crypto_clk_sr .parent_map = gcc_xo_nss_crypto_pll_gpll0_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_crypto_clk_src", @@ -1290,7 +1290,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1400,6 +1216,24 @@ static const struct freq_tbl ftbl_nss_ub +@@ -1394,6 +1210,24 @@ static const struct freq_tbl ftbl_nss_ub { } }; @@ -1315,7 +1315,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_ubi0_clk_src = { .cmd_rcgr = 0x68104, .freq_tbl = ftbl_nss_ubi_clk_src, -@@ -1407,8 +1241,8 @@ static struct clk_rcg2 nss_ubi0_clk_src +@@ -1401,8 +1235,8 @@ static struct clk_rcg2 nss_ubi0_clk_src .parent_map = gcc_xo_ubi32_gpll0_gpll2_gpll4_gpll6_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ubi0_clk_src", @@ -1326,7 +1326,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1421,9 +1255,8 @@ static struct clk_regmap_div nss_ubi0_di +@@ -1415,9 +1249,8 @@ static struct clk_regmap_div nss_ubi0_di .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_ubi0_div_clk_src", @@ -1338,7 +1338,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ro_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1438,8 +1271,8 @@ static struct clk_rcg2 nss_ubi1_clk_src +@@ -1432,8 +1265,8 @@ static struct clk_rcg2 nss_ubi1_clk_src .parent_map = gcc_xo_ubi32_gpll0_gpll2_gpll4_gpll6_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ubi1_clk_src", @@ -1349,7 +1349,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1452,9 +1285,8 @@ static struct clk_regmap_div nss_ubi1_di +@@ -1446,9 +1279,8 @@ static struct clk_regmap_div nss_ubi1_di .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_ubi1_div_clk_src", @@ -1361,7 +1361,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ro_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1468,6 +1300,16 @@ static const struct freq_tbl ftbl_ubi_mp +@@ -1462,6 +1294,16 @@ static const struct freq_tbl ftbl_ubi_mp { } }; @@ -1378,7 +1378,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 ubi_mpt_clk_src = { .cmd_rcgr = 0x68090, .freq_tbl = ftbl_ubi_mpt_clk_src, -@@ -1475,8 +1317,8 @@ static struct clk_rcg2 ubi_mpt_clk_src = +@@ -1469,8 +1311,8 @@ static struct clk_rcg2 ubi_mpt_clk_src = .parent_map = gcc_xo_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "ubi_mpt_clk_src", @@ -1389,7 +1389,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1487,6 +1329,18 @@ static const struct freq_tbl ftbl_nss_im +@@ -1481,6 +1323,18 @@ static const struct freq_tbl ftbl_nss_im { } }; @@ -1408,7 +1408,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_imem_clk_src = { .cmd_rcgr = 0x68158, .freq_tbl = ftbl_nss_imem_clk_src, -@@ -1494,8 +1348,8 @@ static struct clk_rcg2 nss_imem_clk_src +@@ -1488,8 +1342,8 @@ static struct clk_rcg2 nss_imem_clk_src .parent_map = gcc_xo_gpll0_gpll4_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_imem_clk_src", @@ -1419,7 +1419,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1506,6 +1360,24 @@ static const struct freq_tbl ftbl_nss_pp +@@ -1500,6 +1354,24 @@ static const struct freq_tbl ftbl_nss_pp { } }; @@ -1444,7 +1444,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_ppe_clk_src = { .cmd_rcgr = 0x68080, .freq_tbl = ftbl_nss_ppe_clk_src, -@@ -1513,8 +1385,8 @@ static struct clk_rcg2 nss_ppe_clk_src = +@@ -1507,8 +1379,8 @@ static struct clk_rcg2 nss_ppe_clk_src = .parent_map = gcc_xo_bias_gpll0_gpll4_nss_ubi32_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ppe_clk_src", @@ -1455,7 +1455,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1524,9 +1396,8 @@ static struct clk_fixed_factor nss_ppe_c +@@ -1518,9 +1390,8 @@ static struct clk_fixed_factor nss_ppe_c .div = 4, .hw.init = &(struct clk_init_data){ .name = "nss_ppe_cdiv_clk_src", @@ -1467,7 +1467,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1540,6 +1411,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1534,6 +1405,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1490,7 +1490,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port1_rx_clk_src = { .cmd_rcgr = 0x68020, .freq_tbl = ftbl_nss_port1_rx_clk_src, -@@ -1547,8 +1434,8 @@ static struct clk_rcg2 nss_port1_rx_clk_ +@@ -1541,8 +1428,8 @@ static struct clk_rcg2 nss_port1_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port1_rx_clk_src", @@ -1501,7 +1501,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1560,9 +1447,8 @@ static struct clk_regmap_div nss_port1_r +@@ -1554,9 +1441,8 @@ static struct clk_regmap_div nss_port1_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port1_rx_div_clk_src", @@ -1513,7 +1513,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1577,6 +1463,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1571,6 +1457,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1536,7 +1536,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port1_tx_clk_src = { .cmd_rcgr = 0x68028, .freq_tbl = ftbl_nss_port1_tx_clk_src, -@@ -1584,8 +1486,8 @@ static struct clk_rcg2 nss_port1_tx_clk_ +@@ -1578,8 +1480,8 @@ static struct clk_rcg2 nss_port1_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port1_tx_clk_src", @@ -1547,7 +1547,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1597,9 +1499,8 @@ static struct clk_regmap_div nss_port1_t +@@ -1591,9 +1493,8 @@ static struct clk_regmap_div nss_port1_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port1_tx_div_clk_src", @@ -1559,7 +1559,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1614,8 +1515,8 @@ static struct clk_rcg2 nss_port2_rx_clk_ +@@ -1608,8 +1509,8 @@ static struct clk_rcg2 nss_port2_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port2_rx_clk_src", @@ -1570,7 +1570,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1627,9 +1528,8 @@ static struct clk_regmap_div nss_port2_r +@@ -1621,9 +1522,8 @@ static struct clk_regmap_div nss_port2_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port2_rx_div_clk_src", @@ -1582,7 +1582,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1644,8 +1544,8 @@ static struct clk_rcg2 nss_port2_tx_clk_ +@@ -1638,8 +1538,8 @@ static struct clk_rcg2 nss_port2_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port2_tx_clk_src", @@ -1593,7 +1593,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1657,9 +1557,8 @@ static struct clk_regmap_div nss_port2_t +@@ -1651,9 +1551,8 @@ static struct clk_regmap_div nss_port2_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port2_tx_div_clk_src", @@ -1605,7 +1605,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1674,8 +1573,8 @@ static struct clk_rcg2 nss_port3_rx_clk_ +@@ -1668,8 +1567,8 @@ static struct clk_rcg2 nss_port3_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port3_rx_clk_src", @@ -1616,7 +1616,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1687,9 +1586,8 @@ static struct clk_regmap_div nss_port3_r +@@ -1681,9 +1580,8 @@ static struct clk_regmap_div nss_port3_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port3_rx_div_clk_src", @@ -1628,7 +1628,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1704,8 +1602,8 @@ static struct clk_rcg2 nss_port3_tx_clk_ +@@ -1698,8 +1596,8 @@ static struct clk_rcg2 nss_port3_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port3_tx_clk_src", @@ -1639,7 +1639,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1717,9 +1615,8 @@ static struct clk_regmap_div nss_port3_t +@@ -1711,9 +1609,8 @@ static struct clk_regmap_div nss_port3_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port3_tx_div_clk_src", @@ -1651,7 +1651,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1734,8 +1631,8 @@ static struct clk_rcg2 nss_port4_rx_clk_ +@@ -1728,8 +1625,8 @@ static struct clk_rcg2 nss_port4_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port4_rx_clk_src", @@ -1662,7 +1662,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1747,9 +1644,8 @@ static struct clk_regmap_div nss_port4_r +@@ -1741,9 +1638,8 @@ static struct clk_regmap_div nss_port4_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port4_rx_div_clk_src", @@ -1674,7 +1674,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1764,8 +1660,8 @@ static struct clk_rcg2 nss_port4_tx_clk_ +@@ -1758,8 +1654,8 @@ static struct clk_rcg2 nss_port4_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port4_tx_clk_src", @@ -1685,7 +1685,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1777,9 +1673,8 @@ static struct clk_regmap_div nss_port4_t +@@ -1771,9 +1667,8 @@ static struct clk_regmap_div nss_port4_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port4_tx_div_clk_src", @@ -1697,7 +1697,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1799,6 +1694,27 @@ static const struct freq_tbl ftbl_nss_po +@@ -1793,6 +1688,27 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1725,7 +1725,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port5_rx_clk_src = { .cmd_rcgr = 0x68060, .freq_tbl = ftbl_nss_port5_rx_clk_src, -@@ -1806,8 +1722,8 @@ static struct clk_rcg2 nss_port5_rx_clk_ +@@ -1800,8 +1716,8 @@ static struct clk_rcg2 nss_port5_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port5_rx_clk_src", @@ -1736,7 +1736,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1819,9 +1735,8 @@ static struct clk_regmap_div nss_port5_r +@@ -1813,9 +1729,8 @@ static struct clk_regmap_div nss_port5_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port5_rx_div_clk_src", @@ -1748,7 +1748,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1841,6 +1756,27 @@ static const struct freq_tbl ftbl_nss_po +@@ -1835,6 +1750,27 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1776,7 +1776,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port5_tx_clk_src = { .cmd_rcgr = 0x68068, .freq_tbl = ftbl_nss_port5_tx_clk_src, -@@ -1848,8 +1784,8 @@ static struct clk_rcg2 nss_port5_tx_clk_ +@@ -1842,8 +1778,8 @@ static struct clk_rcg2 nss_port5_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port5_tx_clk_src", @@ -1787,7 +1787,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1861,9 +1797,8 @@ static struct clk_regmap_div nss_port5_t +@@ -1855,9 +1791,8 @@ static struct clk_regmap_div nss_port5_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port5_tx_div_clk_src", @@ -1799,7 +1799,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1883,6 +1818,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1877,6 +1812,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1822,7 +1822,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port6_rx_clk_src = { .cmd_rcgr = 0x68070, .freq_tbl = ftbl_nss_port6_rx_clk_src, -@@ -1890,8 +1841,8 @@ static struct clk_rcg2 nss_port6_rx_clk_ +@@ -1884,8 +1835,8 @@ static struct clk_rcg2 nss_port6_rx_clk_ .parent_map = gcc_xo_uniphy2_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port6_rx_clk_src", @@ -1833,7 +1833,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1903,9 +1854,8 @@ static struct clk_regmap_div nss_port6_r +@@ -1897,9 +1848,8 @@ static struct clk_regmap_div nss_port6_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port6_rx_div_clk_src", @@ -1845,7 +1845,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1925,6 +1875,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1919,6 +1869,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1868,7 +1868,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port6_tx_clk_src = { .cmd_rcgr = 0x68078, .freq_tbl = ftbl_nss_port6_tx_clk_src, -@@ -1932,8 +1898,8 @@ static struct clk_rcg2 nss_port6_tx_clk_ +@@ -1926,8 +1892,8 @@ static struct clk_rcg2 nss_port6_tx_clk_ .parent_map = gcc_xo_uniphy2_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port6_tx_clk_src", @@ -1879,7 +1879,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1945,9 +1911,8 @@ static struct clk_regmap_div nss_port6_t +@@ -1939,9 +1905,8 @@ static struct clk_regmap_div nss_port6_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port6_tx_div_clk_src", @@ -1891,7 +1891,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1970,8 +1935,8 @@ static struct clk_rcg2 crypto_clk_src = +@@ -1964,8 +1929,8 @@ static struct clk_rcg2 crypto_clk_src = .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "crypto_clk_src", @@ -1902,7 +1902,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1981,6 +1946,22 @@ static struct freq_tbl ftbl_gp_clk_src[] +@@ -1975,6 +1940,22 @@ static struct freq_tbl ftbl_gp_clk_src[] { } }; @@ -1925,7 +1925,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 gp1_clk_src = { .cmd_rcgr = 0x08004, .freq_tbl = ftbl_gp_clk_src, -@@ -1989,8 +1970,8 @@ static struct clk_rcg2 gp1_clk_src = { +@@ -1983,8 +1964,8 @@ static struct clk_rcg2 gp1_clk_src = { .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "gp1_clk_src", @@ -1936,7 +1936,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -2003,8 +1984,8 @@ static struct clk_rcg2 gp2_clk_src = { +@@ -1997,8 +1978,8 @@ static struct clk_rcg2 gp2_clk_src = { .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "gp2_clk_src", @@ -1947,7 +1947,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -2017,8 +1998,8 @@ static struct clk_rcg2 gp3_clk_src = { +@@ -2011,8 +1992,8 @@ static struct clk_rcg2 gp3_clk_src = { .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "gp3_clk_src", @@ -1958,7 +1958,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -2030,9 +2011,8 @@ static struct clk_branch gcc_blsp1_ahb_c +@@ -2024,9 +2005,8 @@ static struct clk_branch gcc_blsp1_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_ahb_clk", @@ -1970,7 +1970,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2047,9 +2027,8 @@ static struct clk_branch gcc_blsp1_qup1_ +@@ -2041,9 +2021,8 @@ static struct clk_branch gcc_blsp1_qup1_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup1_i2c_apps_clk", @@ -1982,7 +1982,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2064,9 +2043,8 @@ static struct clk_branch gcc_blsp1_qup1_ +@@ -2058,9 +2037,8 @@ static struct clk_branch gcc_blsp1_qup1_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup1_spi_apps_clk", @@ -1994,7 +1994,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2081,9 +2059,8 @@ static struct clk_branch gcc_blsp1_qup2_ +@@ -2075,9 +2053,8 @@ static struct clk_branch gcc_blsp1_qup2_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup2_i2c_apps_clk", @@ -2006,7 +2006,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2098,9 +2075,8 @@ static struct clk_branch gcc_blsp1_qup2_ +@@ -2092,9 +2069,8 @@ static struct clk_branch gcc_blsp1_qup2_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup2_spi_apps_clk", @@ -2018,7 +2018,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2115,9 +2091,8 @@ static struct clk_branch gcc_blsp1_qup3_ +@@ -2109,9 +2085,8 @@ static struct clk_branch gcc_blsp1_qup3_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup3_i2c_apps_clk", @@ -2030,7 +2030,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2132,9 +2107,8 @@ static struct clk_branch gcc_blsp1_qup3_ +@@ -2126,9 +2101,8 @@ static struct clk_branch gcc_blsp1_qup3_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup3_spi_apps_clk", @@ -2042,7 +2042,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2149,9 +2123,8 @@ static struct clk_branch gcc_blsp1_qup4_ +@@ -2143,9 +2117,8 @@ static struct clk_branch gcc_blsp1_qup4_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup4_i2c_apps_clk", @@ -2054,7 +2054,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2166,9 +2139,8 @@ static struct clk_branch gcc_blsp1_qup4_ +@@ -2160,9 +2133,8 @@ static struct clk_branch gcc_blsp1_qup4_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup4_spi_apps_clk", @@ -2066,7 +2066,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2183,9 +2155,8 @@ static struct clk_branch gcc_blsp1_qup5_ +@@ -2177,9 +2149,8 @@ static struct clk_branch gcc_blsp1_qup5_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup5_i2c_apps_clk", @@ -2078,7 +2078,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2200,9 +2171,8 @@ static struct clk_branch gcc_blsp1_qup5_ +@@ -2194,9 +2165,8 @@ static struct clk_branch gcc_blsp1_qup5_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup5_spi_apps_clk", @@ -2090,7 +2090,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2217,9 +2187,8 @@ static struct clk_branch gcc_blsp1_qup6_ +@@ -2211,9 +2181,8 @@ static struct clk_branch gcc_blsp1_qup6_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup6_i2c_apps_clk", @@ -2102,7 +2102,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2234,9 +2203,8 @@ static struct clk_branch gcc_blsp1_qup6_ +@@ -2228,9 +2197,8 @@ static struct clk_branch gcc_blsp1_qup6_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup6_spi_apps_clk", @@ -2114,7 +2114,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2251,9 +2219,8 @@ static struct clk_branch gcc_blsp1_uart1 +@@ -2245,9 +2213,8 @@ static struct clk_branch gcc_blsp1_uart1 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart1_apps_clk", @@ -2126,7 +2126,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2268,9 +2235,8 @@ static struct clk_branch gcc_blsp1_uart2 +@@ -2262,9 +2229,8 @@ static struct clk_branch gcc_blsp1_uart2 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart2_apps_clk", @@ -2138,7 +2138,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2285,9 +2251,8 @@ static struct clk_branch gcc_blsp1_uart3 +@@ -2279,9 +2245,8 @@ static struct clk_branch gcc_blsp1_uart3 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart3_apps_clk", @@ -2150,7 +2150,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2302,9 +2267,8 @@ static struct clk_branch gcc_blsp1_uart4 +@@ -2296,9 +2261,8 @@ static struct clk_branch gcc_blsp1_uart4 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart4_apps_clk", @@ -2162,7 +2162,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2319,9 +2283,8 @@ static struct clk_branch gcc_blsp1_uart5 +@@ -2313,9 +2277,8 @@ static struct clk_branch gcc_blsp1_uart5 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart5_apps_clk", @@ -2174,7 +2174,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2336,9 +2299,8 @@ static struct clk_branch gcc_blsp1_uart6 +@@ -2330,9 +2293,8 @@ static struct clk_branch gcc_blsp1_uart6 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart6_apps_clk", @@ -2186,7 +2186,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2354,9 +2316,8 @@ static struct clk_branch gcc_prng_ahb_cl +@@ -2348,9 +2310,8 @@ static struct clk_branch gcc_prng_ahb_cl .enable_mask = BIT(8), .hw.init = &(struct clk_init_data){ .name = "gcc_prng_ahb_clk", @@ -2198,7 +2198,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2371,9 +2332,8 @@ static struct clk_branch gcc_qpic_ahb_cl +@@ -2365,9 +2326,8 @@ static struct clk_branch gcc_qpic_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_qpic_ahb_clk", @@ -2210,7 +2210,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2388,9 +2348,8 @@ static struct clk_branch gcc_qpic_clk = +@@ -2382,9 +2342,8 @@ static struct clk_branch gcc_qpic_clk = .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_qpic_clk", @@ -2222,7 +2222,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2405,9 +2364,8 @@ static struct clk_branch gcc_pcie0_ahb_c +@@ -2399,9 +2358,8 @@ static struct clk_branch gcc_pcie0_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_ahb_clk", @@ -2234,7 +2234,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2422,9 +2380,8 @@ static struct clk_branch gcc_pcie0_aux_c +@@ -2416,9 +2374,8 @@ static struct clk_branch gcc_pcie0_aux_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_aux_clk", @@ -2246,7 +2246,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2439,9 +2396,8 @@ static struct clk_branch gcc_pcie0_axi_m +@@ -2433,9 +2390,8 @@ static struct clk_branch gcc_pcie0_axi_m .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_axi_m_clk", @@ -2258,7 +2258,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2456,9 +2412,8 @@ static struct clk_branch gcc_pcie0_axi_s +@@ -2450,9 +2406,8 @@ static struct clk_branch gcc_pcie0_axi_s .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_axi_s_clk", @@ -2270,7 +2270,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2474,9 +2429,8 @@ static struct clk_branch gcc_pcie0_pipe_ +@@ -2468,9 +2423,8 @@ static struct clk_branch gcc_pcie0_pipe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_pipe_clk", @@ -2282,7 +2282,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2491,9 +2445,8 @@ static struct clk_branch gcc_sys_noc_pci +@@ -2485,9 +2439,8 @@ static struct clk_branch gcc_sys_noc_pci .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_pcie0_axi_clk", @@ -2294,7 +2294,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2508,9 +2461,8 @@ static struct clk_branch gcc_pcie1_ahb_c +@@ -2502,9 +2455,8 @@ static struct clk_branch gcc_pcie1_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_ahb_clk", @@ -2306,7 +2306,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2525,9 +2477,8 @@ static struct clk_branch gcc_pcie1_aux_c +@@ -2519,9 +2471,8 @@ static struct clk_branch gcc_pcie1_aux_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_aux_clk", @@ -2318,7 +2318,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2542,9 +2493,8 @@ static struct clk_branch gcc_pcie1_axi_m +@@ -2536,9 +2487,8 @@ static struct clk_branch gcc_pcie1_axi_m .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_axi_m_clk", @@ -2330,7 +2330,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2559,9 +2509,8 @@ static struct clk_branch gcc_pcie1_axi_s +@@ -2553,9 +2503,8 @@ static struct clk_branch gcc_pcie1_axi_s .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_axi_s_clk", @@ -2342,7 +2342,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2577,9 +2526,8 @@ static struct clk_branch gcc_pcie1_pipe_ +@@ -2571,9 +2520,8 @@ static struct clk_branch gcc_pcie1_pipe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_pipe_clk", @@ -2354,7 +2354,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2594,9 +2542,8 @@ static struct clk_branch gcc_sys_noc_pci +@@ -2588,9 +2536,8 @@ static struct clk_branch gcc_sys_noc_pci .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_pcie1_axi_clk", @@ -2366,7 +2366,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2611,9 +2558,8 @@ static struct clk_branch gcc_usb0_aux_cl +@@ -2605,9 +2552,8 @@ static struct clk_branch gcc_usb0_aux_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_aux_clk", @@ -2378,7 +2378,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2628,9 +2574,8 @@ static struct clk_branch gcc_sys_noc_usb +@@ -2622,9 +2568,8 @@ static struct clk_branch gcc_sys_noc_usb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_usb0_axi_clk", @@ -2390,7 +2390,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2645,9 +2590,8 @@ static struct clk_branch gcc_usb0_master +@@ -2639,9 +2584,8 @@ static struct clk_branch gcc_usb0_master .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_master_clk", @@ -2402,7 +2402,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2662,9 +2606,8 @@ static struct clk_branch gcc_usb0_mock_u +@@ -2656,9 +2600,8 @@ static struct clk_branch gcc_usb0_mock_u .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_mock_utmi_clk", @@ -2414,7 +2414,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2679,9 +2622,8 @@ static struct clk_branch gcc_usb0_phy_cf +@@ -2673,9 +2616,8 @@ static struct clk_branch gcc_usb0_phy_cf .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_phy_cfg_ahb_clk", @@ -2426,7 +2426,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2697,9 +2639,8 @@ static struct clk_branch gcc_usb0_pipe_c +@@ -2691,9 +2633,8 @@ static struct clk_branch gcc_usb0_pipe_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_pipe_clk", @@ -2438,7 +2438,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2714,9 +2655,8 @@ static struct clk_branch gcc_usb0_sleep_ +@@ -2708,9 +2649,8 @@ static struct clk_branch gcc_usb0_sleep_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_sleep_clk", @@ -2450,7 +2450,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2731,9 +2671,8 @@ static struct clk_branch gcc_usb1_aux_cl +@@ -2725,9 +2665,8 @@ static struct clk_branch gcc_usb1_aux_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_aux_clk", @@ -2462,7 +2462,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2748,9 +2687,8 @@ static struct clk_branch gcc_sys_noc_usb +@@ -2742,9 +2681,8 @@ static struct clk_branch gcc_sys_noc_usb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_usb1_axi_clk", @@ -2474,7 +2474,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2765,9 +2703,8 @@ static struct clk_branch gcc_usb1_master +@@ -2759,9 +2697,8 @@ static struct clk_branch gcc_usb1_master .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_master_clk", @@ -2486,7 +2486,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2782,9 +2719,8 @@ static struct clk_branch gcc_usb1_mock_u +@@ -2776,9 +2713,8 @@ static struct clk_branch gcc_usb1_mock_u .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_mock_utmi_clk", @@ -2498,7 +2498,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2799,9 +2735,8 @@ static struct clk_branch gcc_usb1_phy_cf +@@ -2793,9 +2729,8 @@ static struct clk_branch gcc_usb1_phy_cf .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_phy_cfg_ahb_clk", @@ -2510,7 +2510,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2817,9 +2752,8 @@ static struct clk_branch gcc_usb1_pipe_c +@@ -2811,9 +2746,8 @@ static struct clk_branch gcc_usb1_pipe_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_pipe_clk", @@ -2522,7 +2522,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2834,9 +2768,8 @@ static struct clk_branch gcc_usb1_sleep_ +@@ -2828,9 +2762,8 @@ static struct clk_branch gcc_usb1_sleep_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_sleep_clk", @@ -2534,7 +2534,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2851,9 +2784,8 @@ static struct clk_branch gcc_sdcc1_ahb_c +@@ -2845,9 +2778,8 @@ static struct clk_branch gcc_sdcc1_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc1_ahb_clk", @@ -2546,7 +2546,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2868,9 +2800,8 @@ static struct clk_branch gcc_sdcc1_apps_ +@@ -2862,9 +2794,8 @@ static struct clk_branch gcc_sdcc1_apps_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc1_apps_clk", @@ -2558,7 +2558,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2885,9 +2816,8 @@ static struct clk_branch gcc_sdcc1_ice_c +@@ -2879,9 +2810,8 @@ static struct clk_branch gcc_sdcc1_ice_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc1_ice_core_clk", @@ -2570,7 +2570,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2902,9 +2832,8 @@ static struct clk_branch gcc_sdcc2_ahb_c +@@ -2896,9 +2826,8 @@ static struct clk_branch gcc_sdcc2_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc2_ahb_clk", @@ -2582,7 +2582,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2919,9 +2848,8 @@ static struct clk_branch gcc_sdcc2_apps_ +@@ -2913,9 +2842,8 @@ static struct clk_branch gcc_sdcc2_apps_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc2_apps_clk", @@ -2594,7 +2594,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2936,9 +2864,8 @@ static struct clk_branch gcc_mem_noc_nss +@@ -2930,9 +2858,8 @@ static struct clk_branch gcc_mem_noc_nss .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mem_noc_nss_axi_clk", @@ -2606,7 +2606,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2953,9 +2880,8 @@ static struct clk_branch gcc_nss_ce_apb_ +@@ -2947,9 +2874,8 @@ static struct clk_branch gcc_nss_ce_apb_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ce_apb_clk", @@ -2618,7 +2618,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2970,9 +2896,8 @@ static struct clk_branch gcc_nss_ce_axi_ +@@ -2964,9 +2890,8 @@ static struct clk_branch gcc_nss_ce_axi_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ce_axi_clk", @@ -2630,7 +2630,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2987,9 +2912,8 @@ static struct clk_branch gcc_nss_cfg_clk +@@ -2981,9 +2906,8 @@ static struct clk_branch gcc_nss_cfg_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_cfg_clk", @@ -2642,7 +2642,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3004,9 +2928,8 @@ static struct clk_branch gcc_nss_crypto_ +@@ -2998,9 +2922,8 @@ static struct clk_branch gcc_nss_crypto_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_crypto_clk", @@ -2654,7 +2654,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3021,9 +2944,8 @@ static struct clk_branch gcc_nss_csr_clk +@@ -3015,9 +2938,8 @@ static struct clk_branch gcc_nss_csr_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_csr_clk", @@ -2666,7 +2666,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3038,9 +2960,8 @@ static struct clk_branch gcc_nss_edma_cf +@@ -3032,9 +2954,8 @@ static struct clk_branch gcc_nss_edma_cf .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_edma_cfg_clk", @@ -2678,7 +2678,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3055,9 +2976,8 @@ static struct clk_branch gcc_nss_edma_cl +@@ -3049,9 +2970,8 @@ static struct clk_branch gcc_nss_edma_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_edma_clk", @@ -2690,7 +2690,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3072,9 +2992,8 @@ static struct clk_branch gcc_nss_imem_cl +@@ -3066,9 +2986,8 @@ static struct clk_branch gcc_nss_imem_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_imem_clk", @@ -2702,7 +2702,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3089,9 +3008,8 @@ static struct clk_branch gcc_nss_noc_clk +@@ -3083,9 +3002,8 @@ static struct clk_branch gcc_nss_noc_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_noc_clk", @@ -2714,7 +2714,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3106,9 +3024,8 @@ static struct clk_branch gcc_nss_ppe_btq +@@ -3100,9 +3018,8 @@ static struct clk_branch gcc_nss_ppe_btq .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_btq_clk", @@ -2726,7 +2726,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3123,9 +3040,8 @@ static struct clk_branch gcc_nss_ppe_cfg +@@ -3117,9 +3034,8 @@ static struct clk_branch gcc_nss_ppe_cfg .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_cfg_clk", @@ -2738,7 +2738,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3140,9 +3056,8 @@ static struct clk_branch gcc_nss_ppe_clk +@@ -3134,9 +3050,8 @@ static struct clk_branch gcc_nss_ppe_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_clk", @@ -2750,7 +2750,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3157,9 +3072,8 @@ static struct clk_branch gcc_nss_ppe_ipe +@@ -3151,9 +3066,8 @@ static struct clk_branch gcc_nss_ppe_ipe .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_ipe_clk", @@ -2762,7 +2762,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3174,9 +3088,8 @@ static struct clk_branch gcc_nss_ptp_ref +@@ -3168,9 +3082,8 @@ static struct clk_branch gcc_nss_ptp_ref .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ptp_ref_clk", @@ -2774,7 +2774,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3192,9 +3105,8 @@ static struct clk_branch gcc_crypto_ppe_ +@@ -3186,9 +3099,8 @@ static struct clk_branch gcc_crypto_ppe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_ppe_clk", @@ -2786,7 +2786,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3209,9 +3121,8 @@ static struct clk_branch gcc_nssnoc_ce_a +@@ -3203,9 +3115,8 @@ static struct clk_branch gcc_nssnoc_ce_a .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ce_apb_clk", @@ -2798,7 +2798,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3226,9 +3137,8 @@ static struct clk_branch gcc_nssnoc_ce_a +@@ -3220,9 +3131,8 @@ static struct clk_branch gcc_nssnoc_ce_a .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ce_axi_clk", @@ -2810,7 +2810,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3243,9 +3153,8 @@ static struct clk_branch gcc_nssnoc_cryp +@@ -3237,9 +3147,8 @@ static struct clk_branch gcc_nssnoc_cryp .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_crypto_clk", @@ -2822,7 +2822,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3260,9 +3169,8 @@ static struct clk_branch gcc_nssnoc_ppe_ +@@ -3254,9 +3163,8 @@ static struct clk_branch gcc_nssnoc_ppe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ppe_cfg_clk", @@ -2834,7 +2834,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3277,9 +3185,8 @@ static struct clk_branch gcc_nssnoc_ppe_ +@@ -3271,9 +3179,8 @@ static struct clk_branch gcc_nssnoc_ppe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ppe_clk", @@ -2846,7 +2846,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3294,9 +3201,8 @@ static struct clk_branch gcc_nssnoc_qosg +@@ -3288,9 +3195,8 @@ static struct clk_branch gcc_nssnoc_qosg .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_qosgen_ref_clk", @@ -2858,7 +2858,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3311,9 +3217,8 @@ static struct clk_branch gcc_nssnoc_snoc +@@ -3305,9 +3211,8 @@ static struct clk_branch gcc_nssnoc_snoc .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_snoc_clk", @@ -2870,7 +2870,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3328,9 +3233,8 @@ static struct clk_branch gcc_nssnoc_time +@@ -3322,9 +3227,8 @@ static struct clk_branch gcc_nssnoc_time .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_timeout_ref_clk", @@ -2882,7 +2882,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3345,9 +3249,8 @@ static struct clk_branch gcc_nssnoc_ubi0 +@@ -3339,9 +3243,8 @@ static struct clk_branch gcc_nssnoc_ubi0 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ubi0_ahb_clk", @@ -2894,7 +2894,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3362,9 +3265,8 @@ static struct clk_branch gcc_nssnoc_ubi1 +@@ -3356,9 +3259,8 @@ static struct clk_branch gcc_nssnoc_ubi1 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ubi1_ahb_clk", @@ -2906,7 +2906,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3380,9 +3282,8 @@ static struct clk_branch gcc_ubi0_ahb_cl +@@ -3374,9 +3276,8 @@ static struct clk_branch gcc_ubi0_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_ahb_clk", @@ -2918,7 +2918,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3398,9 +3299,8 @@ static struct clk_branch gcc_ubi0_axi_cl +@@ -3392,9 +3293,8 @@ static struct clk_branch gcc_ubi0_axi_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_axi_clk", @@ -2930,7 +2930,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3416,9 +3316,8 @@ static struct clk_branch gcc_ubi0_nc_axi +@@ -3410,9 +3310,8 @@ static struct clk_branch gcc_ubi0_nc_axi .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_nc_axi_clk", @@ -2942,7 +2942,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3434,9 +3333,8 @@ static struct clk_branch gcc_ubi0_core_c +@@ -3428,9 +3327,8 @@ static struct clk_branch gcc_ubi0_core_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_core_clk", @@ -2954,7 +2954,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3452,9 +3350,8 @@ static struct clk_branch gcc_ubi0_mpt_cl +@@ -3446,9 +3344,8 @@ static struct clk_branch gcc_ubi0_mpt_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_mpt_clk", @@ -2966,7 +2966,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3470,9 +3367,8 @@ static struct clk_branch gcc_ubi1_ahb_cl +@@ -3464,9 +3361,8 @@ static struct clk_branch gcc_ubi1_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_ahb_clk", @@ -2978,7 +2978,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3488,9 +3384,8 @@ static struct clk_branch gcc_ubi1_axi_cl +@@ -3482,9 +3378,8 @@ static struct clk_branch gcc_ubi1_axi_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_axi_clk", @@ -2990,7 +2990,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3506,9 +3401,8 @@ static struct clk_branch gcc_ubi1_nc_axi +@@ -3500,9 +3395,8 @@ static struct clk_branch gcc_ubi1_nc_axi .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_nc_axi_clk", @@ -3002,7 +3002,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3524,9 +3418,8 @@ static struct clk_branch gcc_ubi1_core_c +@@ -3518,9 +3412,8 @@ static struct clk_branch gcc_ubi1_core_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_core_clk", @@ -3014,7 +3014,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3542,9 +3435,8 @@ static struct clk_branch gcc_ubi1_mpt_cl +@@ -3536,9 +3429,8 @@ static struct clk_branch gcc_ubi1_mpt_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_mpt_clk", @@ -3026,7 +3026,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3559,9 +3451,8 @@ static struct clk_branch gcc_cmn_12gpll_ +@@ -3553,9 +3445,8 @@ static struct clk_branch gcc_cmn_12gpll_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_cmn_12gpll_ahb_clk", @@ -3038,7 +3038,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3576,9 +3467,8 @@ static struct clk_branch gcc_cmn_12gpll_ +@@ -3570,9 +3461,8 @@ static struct clk_branch gcc_cmn_12gpll_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_cmn_12gpll_sys_clk", @@ -3050,7 +3050,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3593,9 +3483,8 @@ static struct clk_branch gcc_mdio_ahb_cl +@@ -3587,9 +3477,8 @@ static struct clk_branch gcc_mdio_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mdio_ahb_clk", @@ -3062,7 +3062,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3610,9 +3499,8 @@ static struct clk_branch gcc_uniphy0_ahb +@@ -3604,9 +3493,8 @@ static struct clk_branch gcc_uniphy0_ahb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_ahb_clk", @@ -3074,7 +3074,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3627,9 +3515,8 @@ static struct clk_branch gcc_uniphy0_sys +@@ -3621,9 +3509,8 @@ static struct clk_branch gcc_uniphy0_sys .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_sys_clk", @@ -3086,7 +3086,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3644,9 +3531,8 @@ static struct clk_branch gcc_uniphy1_ahb +@@ -3638,9 +3525,8 @@ static struct clk_branch gcc_uniphy1_ahb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_ahb_clk", @@ -3098,7 +3098,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3661,9 +3547,8 @@ static struct clk_branch gcc_uniphy1_sys +@@ -3655,9 +3541,8 @@ static struct clk_branch gcc_uniphy1_sys .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_sys_clk", @@ -3110,7 +3110,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3678,9 +3563,8 @@ static struct clk_branch gcc_uniphy2_ahb +@@ -3672,9 +3557,8 @@ static struct clk_branch gcc_uniphy2_ahb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_ahb_clk", @@ -3122,7 +3122,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3695,9 +3579,8 @@ static struct clk_branch gcc_uniphy2_sys +@@ -3689,9 +3573,8 @@ static struct clk_branch gcc_uniphy2_sys .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_sys_clk", @@ -3134,7 +3134,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3712,9 +3595,8 @@ static struct clk_branch gcc_nss_port1_r +@@ -3706,9 +3589,8 @@ static struct clk_branch gcc_nss_port1_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port1_rx_clk", @@ -3146,7 +3146,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3729,9 +3611,8 @@ static struct clk_branch gcc_nss_port1_t +@@ -3723,9 +3605,8 @@ static struct clk_branch gcc_nss_port1_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port1_tx_clk", @@ -3158,7 +3158,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3746,9 +3627,8 @@ static struct clk_branch gcc_nss_port2_r +@@ -3740,9 +3621,8 @@ static struct clk_branch gcc_nss_port2_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port2_rx_clk", @@ -3170,7 +3170,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3763,9 +3643,8 @@ static struct clk_branch gcc_nss_port2_t +@@ -3757,9 +3637,8 @@ static struct clk_branch gcc_nss_port2_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port2_tx_clk", @@ -3182,7 +3182,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3780,9 +3659,8 @@ static struct clk_branch gcc_nss_port3_r +@@ -3774,9 +3653,8 @@ static struct clk_branch gcc_nss_port3_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port3_rx_clk", @@ -3194,7 +3194,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3797,9 +3675,8 @@ static struct clk_branch gcc_nss_port3_t +@@ -3791,9 +3669,8 @@ static struct clk_branch gcc_nss_port3_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port3_tx_clk", @@ -3206,7 +3206,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3814,9 +3691,8 @@ static struct clk_branch gcc_nss_port4_r +@@ -3808,9 +3685,8 @@ static struct clk_branch gcc_nss_port4_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port4_rx_clk", @@ -3218,7 +3218,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3831,9 +3707,8 @@ static struct clk_branch gcc_nss_port4_t +@@ -3825,9 +3701,8 @@ static struct clk_branch gcc_nss_port4_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port4_tx_clk", @@ -3230,7 +3230,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3848,9 +3723,8 @@ static struct clk_branch gcc_nss_port5_r +@@ -3842,9 +3717,8 @@ static struct clk_branch gcc_nss_port5_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port5_rx_clk", @@ -3242,7 +3242,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3865,9 +3739,8 @@ static struct clk_branch gcc_nss_port5_t +@@ -3859,9 +3733,8 @@ static struct clk_branch gcc_nss_port5_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port5_tx_clk", @@ -3254,7 +3254,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3882,9 +3755,8 @@ static struct clk_branch gcc_nss_port6_r +@@ -3876,9 +3749,8 @@ static struct clk_branch gcc_nss_port6_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port6_rx_clk", @@ -3266,7 +3266,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3899,9 +3771,8 @@ static struct clk_branch gcc_nss_port6_t +@@ -3893,9 +3765,8 @@ static struct clk_branch gcc_nss_port6_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port6_tx_clk", @@ -3278,7 +3278,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3916,9 +3787,8 @@ static struct clk_branch gcc_port1_mac_c +@@ -3910,9 +3781,8 @@ static struct clk_branch gcc_port1_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port1_mac_clk", @@ -3290,7 +3290,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3933,9 +3803,8 @@ static struct clk_branch gcc_port2_mac_c +@@ -3927,9 +3797,8 @@ static struct clk_branch gcc_port2_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port2_mac_clk", @@ -3302,7 +3302,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3950,9 +3819,8 @@ static struct clk_branch gcc_port3_mac_c +@@ -3944,9 +3813,8 @@ static struct clk_branch gcc_port3_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port3_mac_clk", @@ -3314,7 +3314,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3967,9 +3835,8 @@ static struct clk_branch gcc_port4_mac_c +@@ -3961,9 +3829,8 @@ static struct clk_branch gcc_port4_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port4_mac_clk", @@ -3326,7 +3326,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3984,9 +3851,8 @@ static struct clk_branch gcc_port5_mac_c +@@ -3978,9 +3845,8 @@ static struct clk_branch gcc_port5_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port5_mac_clk", @@ -3338,7 +3338,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4001,9 +3867,8 @@ static struct clk_branch gcc_port6_mac_c +@@ -3995,9 +3861,8 @@ static struct clk_branch gcc_port6_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port6_mac_clk", @@ -3350,7 +3350,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4018,9 +3883,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4012,9 +3877,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port1_rx_clk", @@ -3362,7 +3362,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4035,9 +3899,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4029,9 +3893,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port1_tx_clk", @@ -3374,7 +3374,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4052,9 +3915,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4046,9 +3909,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port2_rx_clk", @@ -3386,7 +3386,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4069,9 +3931,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4063,9 +3925,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port2_tx_clk", @@ -3398,7 +3398,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4086,9 +3947,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4080,9 +3941,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port3_rx_clk", @@ -3410,7 +3410,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4103,9 +3963,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4097,9 +3957,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port3_tx_clk", @@ -3422,7 +3422,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4120,9 +3979,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4114,9 +3973,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port4_rx_clk", @@ -3434,7 +3434,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4137,9 +3995,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4131,9 +3989,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port4_tx_clk", @@ -3446,7 +3446,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4154,9 +4011,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4148,9 +4005,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port5_rx_clk", @@ -3458,7 +3458,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4171,9 +4027,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4165,9 +4021,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port5_tx_clk", @@ -3470,7 +3470,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4188,9 +4043,8 @@ static struct clk_branch gcc_uniphy1_por +@@ -4182,9 +4037,8 @@ static struct clk_branch gcc_uniphy1_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_port5_rx_clk", @@ -3482,7 +3482,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4205,9 +4059,8 @@ static struct clk_branch gcc_uniphy1_por +@@ -4199,9 +4053,8 @@ static struct clk_branch gcc_uniphy1_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_port5_tx_clk", @@ -3494,7 +3494,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4222,9 +4075,8 @@ static struct clk_branch gcc_uniphy2_por +@@ -4216,9 +4069,8 @@ static struct clk_branch gcc_uniphy2_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_port6_rx_clk", @@ -3506,7 +3506,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4239,9 +4091,8 @@ static struct clk_branch gcc_uniphy2_por +@@ -4233,9 +4085,8 @@ static struct clk_branch gcc_uniphy2_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_port6_tx_clk", @@ -3518,7 +3518,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4257,9 +4108,8 @@ static struct clk_branch gcc_crypto_ahb_ +@@ -4251,9 +4102,8 @@ static struct clk_branch gcc_crypto_ahb_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_ahb_clk", @@ -3530,7 +3530,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4275,9 +4125,8 @@ static struct clk_branch gcc_crypto_axi_ +@@ -4269,9 +4119,8 @@ static struct clk_branch gcc_crypto_axi_ .enable_mask = BIT(1), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_axi_clk", @@ -3542,7 +3542,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4293,9 +4142,8 @@ static struct clk_branch gcc_crypto_clk +@@ -4287,9 +4136,8 @@ static struct clk_branch gcc_crypto_clk .enable_mask = BIT(2), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_clk", @@ -3554,7 +3554,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4310,9 +4158,8 @@ static struct clk_branch gcc_gp1_clk = { +@@ -4304,9 +4152,8 @@ static struct clk_branch gcc_gp1_clk = { .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_gp1_clk", @@ -3566,7 +3566,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4327,9 +4174,8 @@ static struct clk_branch gcc_gp2_clk = { +@@ -4321,9 +4168,8 @@ static struct clk_branch gcc_gp2_clk = { .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_gp2_clk", @@ -3578,7 +3578,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4344,9 +4190,8 @@ static struct clk_branch gcc_gp3_clk = { +@@ -4338,9 +4184,8 @@ static struct clk_branch gcc_gp3_clk = { .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_gp3_clk", @@ -3590,7 +3590,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4368,7 +4213,7 @@ static struct clk_rcg2 pcie0_rchng_clk_s +@@ -4362,7 +4207,7 @@ static struct clk_rcg2 pcie0_rchng_clk_s .clkr.hw.init = &(struct clk_init_data){ .name = "pcie0_rchng_clk_src", .parent_data = gcc_xo_gpll0, diff --git a/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch b/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch index 212fc84869c..81014ab24c9 100644 --- a/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch +++ b/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch @@ -18,7 +18,7 @@ Link: https://lore.kernel.org/r/20221107132901.489240-3-robimarko@gmail.com --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -4671,6 +4671,20 @@ static const struct qcom_reset_map gcc_i +@@ -4665,6 +4665,20 @@ static const struct qcom_reset_map gcc_i [GCC_PCIE1_AXI_SLAVE_ARES] = { 0x76040, 4 }, [GCC_PCIE1_AHB_ARES] = { 0x76040, 5 }, [GCC_PCIE1_AXI_MASTER_STICKY_ARES] = { 0x76040, 6 }, diff --git a/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch b/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch index 7372b1da8ed..35a0a07c70b 100644 --- a/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch +++ b/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch @@ -22,7 +22,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -680,7 +680,7 @@ static struct clk_rcg2 pcie0_aux_clk_src +@@ -674,7 +674,7 @@ static struct clk_rcg2 pcie0_aux_clk_src }; static const struct clk_parent_data gcc_pcie20_phy0_pipe_clk_xo[] = { @@ -31,7 +31,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .fw_name = "xo", .name = "xo" }, }; -@@ -733,7 +733,7 @@ static struct clk_rcg2 pcie1_aux_clk_src +@@ -727,7 +727,7 @@ static struct clk_rcg2 pcie1_aux_clk_src }; static const struct clk_parent_data gcc_pcie20_phy1_pipe_clk_xo[] = { @@ -40,7 +40,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .fw_name = "xo", .name = "xo" }, }; -@@ -1137,7 +1137,7 @@ static const struct freq_tbl ftbl_nss_no +@@ -1131,7 +1131,7 @@ static const struct freq_tbl ftbl_nss_no static const struct clk_parent_data gcc_xo_bias_pll_nss_noc_clk_gpll0_gpll2[] = { { .fw_name = "xo", .name = "xo" }, @@ -49,7 +49,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .hw = &gpll0.clkr.hw }, { .hw = &gpll2.clkr.hw }, }; -@@ -1362,7 +1362,7 @@ static const struct freq_tbl ftbl_nss_pp +@@ -1356,7 +1356,7 @@ static const struct freq_tbl ftbl_nss_pp static const struct clk_parent_data gcc_xo_bias_gpll0_gpll4_nss_ubi32[] = { { .fw_name = "xo", .name = "xo" }, @@ -58,7 +58,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .hw = &gpll0.clkr.hw }, { .hw = &gpll4.clkr.hw }, { .hw = &nss_crypto_pll.clkr.hw }, -@@ -1413,10 +1413,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1407,10 +1407,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_rx_tx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -72,7 +72,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map gcc_xo_uniphy0_rx_tx_ubi32_bias_map[] = { -@@ -1465,10 +1465,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1459,10 +1459,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_tx_rx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -86,7 +86,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map gcc_xo_uniphy0_tx_rx_ubi32_bias_map[] = { -@@ -1696,12 +1696,12 @@ static const struct freq_tbl ftbl_nss_po +@@ -1690,12 +1690,12 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -104,7 +104,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map -@@ -1758,12 +1758,12 @@ static const struct freq_tbl ftbl_nss_po +@@ -1752,12 +1752,12 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -122,7 +122,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map -@@ -1820,10 +1820,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1814,10 +1814,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy2_rx_tx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -136,7 +136,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map gcc_xo_uniphy2_rx_tx_ubi32_bias_map[] = { -@@ -1877,10 +1877,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1871,10 +1871,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy2_tx_rx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, diff --git a/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch b/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch index eb772be4cee..e0e8125ba65 100644 --- a/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch +++ b/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch @@ -18,7 +18,7 @@ Signed-off-by: Robert Marko --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -934,7 +934,7 @@ static struct clk_rcg2 usb0_mock_utmi_cl +@@ -928,7 +928,7 @@ static struct clk_rcg2 usb0_mock_utmi_cl }; static const struct clk_parent_data gcc_usb3phy_0_cc_pipe_clk_xo[] = { @@ -27,7 +27,7 @@ Signed-off-by: Robert Marko { .fw_name = "xo", .name = "xo" }, }; -@@ -1002,7 +1002,7 @@ static struct clk_rcg2 usb1_mock_utmi_cl +@@ -996,7 +996,7 @@ static struct clk_rcg2 usb1_mock_utmi_cl }; static const struct clk_parent_data gcc_usb3phy_1_cc_pipe_clk_xo[] = { diff --git a/target/linux/qualcommax/patches-6.1/0026-v6.7-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch b/target/linux/qualcommax/patches-6.1/0026-v6.7-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch deleted file mode 100644 index a3e0c20f03a..00000000000 --- a/target/linux/qualcommax/patches-6.1/0026-v6.7-clk-qcom-ipq8074-drop-the-CLK_SET_RATE_PARENT-flag-f.patch +++ /dev/null @@ -1,71 +0,0 @@ -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/ramips/dts/mt7620a_aigale_ai-br100.dts b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts index 7dd58b698f9..bbd8c47a829 100644 --- a/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts +++ b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts @@ -73,19 +73,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts index 3bc0e69bfe2..8ac74f70628 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts @@ -133,23 +133,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; 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 becf5ba90cd..2325d53153d 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts @@ -189,19 +189,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts index a90f9b2775d..f5fa4100908 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts @@ -165,6 +165,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -179,13 +189,3 @@ &wmac { 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/mt7620a_asus_rp-n53.dts b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts index 00fcb5ec42e..a32cb96f66f 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts @@ -120,19 +120,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi index 3d4e6a1aad4..92119ff8127 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi @@ -79,23 +79,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 e4772a45748..4d442825a97 100644 --- a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts +++ b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts @@ -82,23 +82,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_bolt_bl201.dts b/target/linux/ramips/dts/mt7620a_bolt_bl201.dts index d0acc976dcd..3f24e1ad796 100644 --- a/target/linux/ramips/dts/mt7620a_bolt_bl201.dts +++ b/target/linux/ramips/dts/mt7620a_bolt_bl201.dts @@ -131,20 +131,26 @@ compatible = "nvmem-cells"; label = "factory"; reg = <0x40000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -182,7 +188,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_28 0>; nvmem-cell-names = "mac-address"; mediatek,portmap = "llllw"; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts index 11f4d8c6c66..17bf2f8272e 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts @@ -114,23 +114,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 6e48763fe01..85946ca1e0b 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts @@ -114,19 +114,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts index 14900c432ad..b571d122cf3 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts @@ -114,23 +114,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi index e1ff1ecd427..d09f4d292eb 100644 --- a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi +++ b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi @@ -81,23 +81,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -142,7 +147,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_28 0>; nvmem-cell-names = "mac-address"; mediatek,portmap = "llllw"; @@ -156,7 +161,7 @@ pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28 0>; nvmem-cell-names = "eeprom", "mac-address"; }; @@ -168,8 +173,7 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts index f0d96f8a435..6d5d461c8fa 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts @@ -119,19 +119,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts index f73feb58c96..febfd2e32ed 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts @@ -94,19 +94,24 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_config_e05d: eeprom@e05d { + reg = <0xe05d 0x200>; + }; - macaddr_config_e490: macaddr@e490 { - reg = <0xe490 0x6>; + macaddr_config_e490: macaddr@e490 { + compatible = "mac-base"; + reg = <0xe490 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -128,9 +133,8 @@ &pcie0 { mt76x0e@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_config_e05d>, <&macaddr_config_e490>; + nvmem-cells = <&eeprom_config_e05d>, <&macaddr_config_e490 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(2)>; }; }; 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 ae0b7c12101..52739f51146 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts @@ -91,27 +91,34 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -133,9 +140,8 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &wmac { @@ -143,9 +149,8 @@ pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 (-1)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-1)>; }; &pcie { @@ -156,9 +161,8 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004 (-3)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-3)>; led { led-active-low; 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 8c9ab02f447..97fc4f0935c 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts @@ -115,19 +115,24 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_config_e083: eeprom@e083 { + reg = <0xe083 0x200>; + }; - macaddr_config_e496: macaddr@e496 { - reg = <0xe496 0x6>; + macaddr_config_e496: macaddr@e496 { + compatible = "mac-base"; + reg = <0xe496 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -156,9 +161,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_config_e083>, <&macaddr_config_e496>; + nvmem-cells = <&eeprom_config_e083>, <&macaddr_config_e496 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(2)>; led { led-sources = <0>; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts index 42f5c861609..5f11b73ad9e 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts @@ -115,6 +115,18 @@ label = "config"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_e4a8: macaddr@e4a8 { + compatible = "mac-base"; + reg = <0xe4a8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -143,9 +155,8 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_e4a8>; + nvmem-cells = <&macaddr_config_e4a8 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; led { led-sources = <2>; @@ -180,13 +191,3 @@ mediatek,port4-gmac; mediatek,ephy-base = /bits/ 8 <2>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e4a8: macaddr@e4a8 { - reg = <0xe4a8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts index a3e65c64689..c1fff814521 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts @@ -30,7 +30,6 @@ }; &wifi { - nvmem-cells = <&eeprom_config_e08e>, <&macaddr_config_e50e>; + nvmem-cells = <&eeprom_config_e08e>, <&macaddr_config_e50e 2>; 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 f80aa716819..c4220592e84 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts @@ -58,7 +58,6 @@ }; &wifi { - nvmem-cells = <&eeprom_config_e29e>, <&macaddr_config_e50e>; + nvmem-cells = <&eeprom_config_e29e>, <&macaddr_config_e50e 2>; 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 4a6bab21a15..11cd15922cc 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi @@ -151,23 +151,28 @@ }; config: partition@ff0000 { - compatible = "nvmem-cells"; label = "config"; reg = <0xff0000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_config_e08e: eeprom@e08e { - reg = <0xe08e 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_config_e29e: eeprom@e29e { - reg = <0xe29e 0x200>; - }; + eeprom_config_e08e: eeprom@e08e { + reg = <0xe08e 0x200>; + }; + + eeprom_config_e29e: eeprom@e29e { + reg = <0xe29e 0x200>; + }; - macaddr_config_e50e: macaddr@e50e { - reg = <0xe50e 0x6>; + macaddr_config_e50e: macaddr@e50e { + compatible = "mac-base"; + reg = <0xe50e 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_domywifi.dtsi b/target/linux/ramips/dts/mt7620a_domywifi.dtsi index d627d7b4fe6..778de63f1bc 100644 --- a/target/linux/ramips/dts/mt7620a_domywifi.dtsi +++ b/target/linux/ramips/dts/mt7620a_domywifi.dtsi @@ -114,23 +114,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts index 0c61dcb24d7..821aa04f953 100644 --- a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts +++ b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts @@ -79,15 +79,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; 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 edacffb1b14..34b62a025aa 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts @@ -141,27 +141,30 @@ // 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 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 b8292624745..486f6399df4 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts @@ -99,23 +99,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 f6aa606917a..5759774f6ee 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts @@ -91,23 +91,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 f7745b85e96..eb21ff7d6f9 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi @@ -80,23 +80,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -137,7 +142,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins &phy_reset_pins>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; @@ -189,7 +194,7 @@ }; &wmac { - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>; nvmem-cell-names = "eeprom", "mac-address"; }; @@ -201,8 +206,7 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_engenius_epg600.dts b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts index bf4c4347ded..f64676d8fbb 100644 --- a/target/linux/ramips/dts/mt7620a_engenius_epg600.dts +++ b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts @@ -116,32 +116,38 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_rf_4: macaddr@4 { - reg = <0x4 0x6>; + 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 37b06580824..beee73f11c8 100644 --- a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts +++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts @@ -98,32 +98,38 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_iNIC_rf_4: macaddr@4 { - reg = <0x4 0x6>; + 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 f374c75f864..7adf0faf868 100644 --- a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts +++ b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts @@ -77,23 +77,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 939ced87c04..122654d6792 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts @@ -95,19 +95,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; + 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 e261f1c4bb5..9b21689d8d1 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts @@ -90,19 +90,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; + 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 84f1153ecca..b595c581fe9 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts @@ -90,23 +90,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; + 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 f435ceb9f60..db00daaec22 100644 --- a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts +++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts @@ -82,23 +82,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 733cdeaf39f..885c1bac49c 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi @@ -52,23 +52,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 5f97eb61b1c..60c6b2a7d4a 100644 --- a/target/linux/ramips/dts/mt7620a_hnet_c108.dts +++ b/target/linux/ramips/dts/mt7620a_hnet_c108.dts @@ -109,19 +109,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 de7b6ddf57b..453208eb34e 100644 --- a/target/linux/ramips/dts/mt7620a_humax_e2.dts +++ b/target/linux/ramips/dts/mt7620a_humax_e2.dts @@ -88,23 +88,26 @@ }; 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 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_10007: macaddr@10007 { - reg = <0x10007 0x6>; + macaddr_factory_10007: macaddr@10007 { + reg = <0x10007 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts index f27274d6e17..6f95bd01514 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts @@ -91,32 +91,38 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts index 71a66a799d7..bc674fa4b30 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts @@ -105,32 +105,38 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_iptime.dtsi b/target/linux/ramips/dts/mt7620a_iptime.dtsi index be43f9bc99b..2b7421de9b7 100644 --- a/target/linux/ramips/dts/mt7620a_iptime.dtsi +++ b/target/linux/ramips/dts/mt7620a_iptime.dtsi @@ -29,23 +29,26 @@ #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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_uboot_1f800: eeprom@1f800 { - reg = <0x1f800 0x200>; - }; + eeprom_uboot_1f400: eeprom@1f400 { + reg = <0x1f400 0x200>; + }; + + eeprom_uboot_1f800: eeprom@1f800 { + reg = <0x1f800 0x200>; + }; - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts index fbd4f9ff47f..772cab32e2a 100644 --- a/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts +++ b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts @@ -73,19 +73,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index f7a5aed064c..f43aa2d3bca 100644 --- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -92,19 +92,24 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_config_e08a: eeprom@e08a { + reg = <0xe08a 0x200>; + }; - macaddr_config_e07e: macaddr@e07e { - reg = <0xe07e 0x6>; + macaddr_config_e07e: macaddr@e07e { + compatible = "mac-base"; + reg = <0xe07e 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -161,9 +166,8 @@ &pcie0 { mt76x0e@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_config_e08a>, <&macaddr_config_e07e>; + nvmem-cells = <&eeprom_config_e08a>, <&macaddr_config_e07e 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; }; }; 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 f7b296d2501..cefc3c3e925 100644 --- a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts +++ b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts @@ -65,23 +65,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 f30b1265fed..4ba9779dfdc 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi @@ -55,23 +55,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 221da9ec0f6..4310f9dfc7f 100644 --- a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts +++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts @@ -76,19 +76,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts index e260b5b8e81..afba7a06f33 100644 --- a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts +++ b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts @@ -54,19 +54,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 cf2b1f6a65b..34c3d4f42d8 100644 --- a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts +++ b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts @@ -93,19 +93,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts index e4d280e35de..79b622b1bb3 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts +++ b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts @@ -112,23 +112,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; - eeprom_art_1000: eeprom@1000 { - reg = <0x1000 0x200>; + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi index 5be2a2f0449..fe26c3b8594 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi +++ b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi @@ -98,23 +98,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 23cfe9e11a8..8810742e671 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi +++ b/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi @@ -116,23 +116,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; - eeprom_art_1000: eeprom@1000 { - reg = <0x1000 0x200>; + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts index 93f0924bd4f..c2ef1426231 100644 --- a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts +++ b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts @@ -74,23 +74,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts index 90ced171c16..2c503db80de 100644 --- a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts +++ b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts @@ -73,19 +73,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 36cbf20f328..588789239f0 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi +++ b/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi @@ -69,23 +69,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts index e3c15871bce..74faef8dea6 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts @@ -74,23 +74,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts index a4c99d35c49..eeeb7cf6576 100644 --- a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts +++ b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts @@ -80,19 +80,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts index a2238354b29..53c0215e0ce 100644 --- a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts +++ b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts @@ -64,19 +64,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts index 5a6dee77ec5..3c6f7c582ef 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts @@ -84,23 +84,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 62ca8eddc09..2879f6d870f 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts @@ -99,19 +99,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts index a6b46d821a3..de4df5d277d 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts @@ -104,23 +104,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 46f3cfd3abc..02481e5e557 100644 --- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts @@ -50,15 +50,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_rostelecom_rt-fl-1.dts b/target/linux/ramips/dts/mt7620a_rostelecom_rt-fl-1.dts new file mode 100644 index 00000000000..14081ba72ef --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_rostelecom_rt-fl-1.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a_sercomm_cpj.dtsi" + +/ { + compatible = "rostelecom,rt-fl-1", "ralink,mt7620a-soc"; + model = "Rostelecom RT-FL-1"; +}; diff --git a/target/linux/ramips/dts/mt7620a_rostelecom_s1010.dts b/target/linux/ramips/dts/mt7620a_rostelecom_s1010.dts new file mode 100644 index 00000000000..37ce9eda41f --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_rostelecom_s1010.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a_sercomm_cpj.dtsi" + +/ { + compatible = "rostelecom,s1010", "ralink,mt7620a-soc"; + model = "Rostelecom S1010"; +}; diff --git a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts index a9c75e187fb..415ecf1bd9f 100644 --- a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts +++ b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts @@ -111,19 +111,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi b/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi new file mode 100644 index 00000000000..e903f9f7298 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi @@ -0,0 +1,309 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include +#include + +/ { + aliases { + label-mac-device = ðernet; + + led-boot = &status_green; + led-failsafe = &status_amber; + led-running = &status_green; + led-upgrade = &status_amber; + }; + + keys { + compatible = "gpio-keys"; + + button-0 { + label = "reset"; + linux,code = ; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + button-1 { + label = "wps"; + linux,code = ; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_green: led-0 { + label = "green:status"; + gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + status_amber: led-1 { + label = "amber:status"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; + + led-4 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + }; + + led-5 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + }; + + led-6 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + led-7 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <24>; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,uimage"; + /* sercomm krnl hdr with fw chksums */ + openwrt,offset = <0x100>; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_label 0>; + nvmem-cell-names = "mac-address"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +/* mt7612 */ +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_label 6>; + nvmem-cell-names = "eeprom", "mac-address"; + + /* 5 GHz WLAN phy green led */ + led { + led-sources = <2>; + led-active-low; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <70000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* whole flash */ + partition@0_all { + label = "ALL"; + reg = <0x0 0x1000000>; + read-only; + }; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "ftd_and_bootflag"; + reg = <0x30000 0x20000>; + }; + + partition@50000 { + label = "Factory"; + reg = <0x50000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; + }; + + partition@60000 { + label = "SC Nvram(permanent data)"; + reg = <0x60000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_label: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + fwconcat0: partition@70000 { + label = "Firmware"; + reg = <0x70000 0x790000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Kernel"; + reg = <0x0 0x200000>; + }; + + partition@200000 { + label = "RootFS"; + reg = <0x200000 0x590000>; + }; + }; + + fwconcat1: partition@800000 { + label = "Firmware2"; + reg = <0x800000 0x790000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Kernel2"; + reg = <0x0 0x200000>; + }; + + partition@200000 { + label = "RootFS2"; + reg = <0x200000 0x590000>; + }; + }; + + partition@f90000 { + label = "MAC IP"; + reg = <0xf90000 0x10000>; + read-only; + }; + + partition@fa0000 { + label = "Critical Log"; + reg = <0xfa0000 0x10000>; + read-only; + }; + + partition@fb000 { + label = "Critical Log Bak"; + reg = <0xfb0000 0x10000>; + read-only; + }; + + partition@fc0000 { + label = "Xml Config"; + reg = <0xfc0000 0x20000>; + read-only; + }; + + partition@fe0000 { + label = "Xml Config Bak"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "ephy", "rgmii1", "uartf", "wled"; + function = "gpio"; + }; +}; + +/* mt7620 */ +&wmac { + nvmem-cells = <&eeprom_factory_0>, <&macaddr_label 2>; + nvmem-cell-names = "eeprom", "mac-address"; +}; 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 e6c752a5017..d94331a87d9 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,19 +103,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 a75cbf43fcb..88d24160101 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts @@ -106,15 +106,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -125,19 +130,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -148,7 +156,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 0>; nvmem-cell-names = "mac-address"; port@5 { @@ -182,7 +190,7 @@ }; &wmac { - nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100 0>; nvmem-cell-names = "eeprom", "mac-address"; }; @@ -201,8 +209,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts index 8fe5b9c3a2c..e631f6f4e48 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts @@ -73,13 +73,11 @@ pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &wifi { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts index 88165c02be2..d00d2195eeb 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts @@ -53,12 +53,11 @@ }; &wmac { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 0>; nvmem-cell-names = "mac-address"; }; &wifi { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts index 4dbd1b2a986..439bc36dc3a 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts @@ -73,13 +73,11 @@ pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &wifi { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "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 dab106b9bfd..cc947e212e5 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts @@ -139,15 +139,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; }; @@ -158,19 +161,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi index 6edb7012c8e..50a91be8ec5 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi @@ -69,15 +69,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -88,19 +93,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi index e0cb10aac69..02f03afc487 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi @@ -45,15 +45,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_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -70,19 +75,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -90,12 +98,12 @@ }; ðernet { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { - nvmem-cells = <&eeprom_radio_0>, <&macaddr_uboot_1fc00>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "eeprom", "mac-address"; }; @@ -107,8 +115,7 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_uboot_1fc00>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_uboot_1fc00 2>; 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 9ab3a70d14b..687b3ced37b 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts @@ -72,23 +72,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts index 9938c00531c..48f1a7f3c0d 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts @@ -93,23 +93,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts index 0c22e9199be..b2b762d63a7 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts @@ -121,23 +121,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 2ecb78f9b5c..05e61fe614e 100644 --- a/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts +++ b/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts @@ -82,23 +82,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts index a8a7db80828..8ed6b7764dc 100644 --- a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts +++ b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts @@ -98,23 +98,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 29ae863df03..fc758a45564 100644 --- a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi +++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi @@ -80,23 +80,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 89b5d0e76d8..db00c20f4f3 100644 --- a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts +++ b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts @@ -103,19 +103,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts index d85e35b6944..e41a9947330 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts @@ -80,23 +80,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 1c7e1782cba..30d2fba263d 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi @@ -53,23 +53,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 b57e58230c9..b3032af63f3 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi @@ -75,19 +75,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 38bd1a4475b..3848f7317e6 100644 --- a/target/linux/ramips/dts/mt7620a_zte_q7.dts +++ b/target/linux/ramips/dts/mt7620a_zte_q7.dts @@ -69,19 +69,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 0b93c4ff10d..abeb4c2a2d1 100644 --- a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts +++ b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts @@ -112,19 +112,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 44904d148e6..29350a85565 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts @@ -91,19 +91,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 eb366ec1715..c467ed0dde5 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts @@ -96,19 +96,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 8fbf66abc85..a714960b7f3 100644 --- a/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts +++ b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts @@ -80,19 +80,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 6f1a78dc986..19e968bf948 100644 --- a/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts +++ b/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts @@ -86,19 +86,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 a5f240c4bab..afb14b11889 100644 --- a/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts +++ b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts @@ -83,19 +83,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + 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 215f96f462a..9296d54d592 100644 --- a/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts +++ b/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts @@ -73,19 +73,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 5324d7dcf04..ce1f0e9f8b8 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts @@ -79,19 +79,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 ecb0f194873..0293b89bfa3 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts @@ -79,19 +79,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 ce14ec3e01e..1c2e5174663 100644 --- a/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi +++ b/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi @@ -57,19 +57,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 8d6792289cb..f06b9749822 100644 --- a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts +++ b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts @@ -104,28 +104,34 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_b0: macaddr@b0 { + reg = <0xb0 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi index b6e6d9d263d..8903ab5c36a 100644 --- a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi @@ -60,19 +60,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 a1a56068429..25af8d53301 100644 --- a/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts +++ b/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts @@ -91,15 +91,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi index 180d91b2cb4..88958bba141 100644 --- a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi +++ b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi @@ -80,19 +80,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 0cd3c0b186c..53229ed8656 100644 --- a/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts +++ b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts @@ -60,19 +60,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 d0b4804c199..8e608bba2e4 100644 --- a/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts +++ b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts @@ -53,19 +53,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 9cece28fc03..1510b19b17d 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts @@ -76,19 +76,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 59ae3e7a48b..52c497645b0 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts @@ -84,19 +84,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 acf3501f903..7000447c6ce 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts @@ -77,19 +77,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 56a2b53871b..20063e2b47d 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts @@ -80,19 +80,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 4c6e2a80bc9..2241b27673a 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,15 +108,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; 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 94f8a650ae7..1937c3a14c1 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts @@ -108,19 +108,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 eb9ca6aba2b..8faab1cc6b2 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts @@ -108,19 +108,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_adslr_g7.dts b/target/linux/ramips/dts/mt7621_adslr_g7.dts index fe04648f0e2..ef3a64e031a 100644 --- a/target/linux/ramips/dts/mt7621_adslr_g7.dts +++ b/target/linux/ramips/dts/mt7621_adslr_g7.dts @@ -64,23 +64,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_e00c: macaddr@e00c { - reg = <0xe00c 0x6>; + macaddr_factory_e00c: macaddr@e00c { + compatible = "mac-base"; + reg = <0xe00c 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -118,7 +123,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e00c>; + nvmem-cells = <&macaddr_factory_e00c 0>; nvmem-cell-names = "mac-address"; }; @@ -127,9 +132,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e00c>; + nvmem-cells = <&macaddr_factory_e00c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts index 30a03824627..d63ae33311f 100644 --- a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts +++ b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts @@ -71,23 +71,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -135,7 +140,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -144,9 +149,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts b/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts index 1ef1f7fb31f..e07cddefc58 100644 --- a/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts +++ b/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts @@ -117,7 +117,6 @@ }; partition@50000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x10000>; read-only; diff --git a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts index cc048d44879..2bc0fad9c58 100644 --- a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts +++ b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts @@ -245,6 +245,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -263,17 +277,3 @@ &uartlite3 { 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_ampedwireless_ally.dtsi b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi index 4f06271239b..35274afbf3a 100644 --- a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi +++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi @@ -107,19 +107,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 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 1d55453c8d5..fbf276c320e 100644 --- a/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts +++ b/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts @@ -130,15 +130,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi index 8e05c3af50d..7b3f316a8c4 100644 --- a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi +++ b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi @@ -79,25 +79,28 @@ }; 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 0x4da8>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - /* We keep the block below to prevent eth0 MAC - * from randomization. Unique WAN, LAN, WLAN MACs - * are stored in u-boot-env. - */ + /* We keep the block below to prevent eth0 MAC + * from randomization. Unique WAN, LAN, WLAN MACs + * are stored in u-boot-env. + */ - /* Default Ralink MAC (00:0c:43:28:80:xx) */ - macaddr_factory_fff0: macaddr@fff0 { - reg = <0xfff0 0x6>; + /* Default Ralink MAC (00:0c:43:28:80:xx) */ + macaddr_factory_fff0: macaddr@fff0 { + reg = <0xfff0 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts index 5e57842d681..2d4bc016c1d 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts @@ -7,22 +7,6 @@ model = "AsiaRF AP7621-001"; }; -&gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy4>; - - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&mdio { - ethphy4: ethernet-phy@4 { - reg = <4>; - }; -}; - &switch0 { ports { port@0 { diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts index dabc1a3bd34..f6914e43599 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts @@ -7,22 +7,6 @@ model = "AsiaRF AP7621-NV1"; }; -&gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy0>; - - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&mdio { - ethphy0: ethernet-phy@0 { - reg = <0>; - }; -}; - &switch0 { ports { port@2 { diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi index bea0b79df5e..acb2c81a0d8 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi @@ -78,6 +78,18 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -99,8 +111,23 @@ status = "okay"; }; +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; }; @@ -110,13 +137,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 bc623067a8a..d9fdb3b675f 100644 --- a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts @@ -136,23 +136,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts index 47df1dbe57d..34e64182cf5 100644 --- a/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts @@ -110,23 +110,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; }; 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 322a96b700a..6790b37d1ae 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts @@ -86,27 +86,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi index bb9171bbac3..7c607f962db 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi +++ b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi @@ -80,23 +80,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + 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_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts index d740d00c6df..d18a503b85f 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts @@ -99,12 +99,14 @@ reg = <0x1e0000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts index 3191692e4ef..8466cda587b 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts @@ -91,12 +91,14 @@ reg = <0x1e0000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 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 77e3fffcc18..cfc8330fe5c 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts @@ -105,27 +105,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 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 eb64bd0bfde..f2a99a63a89 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts @@ -94,24 +94,29 @@ }; factory: partition@200000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; sercomm,scpart-id = <2>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -184,9 +189,8 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000 5>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(5)>; }; }; @@ -196,14 +200,13 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000 4>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(4)>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 0>; nvmem-cell-names = "mac-address"; }; @@ -212,9 +215,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts index e3e248d48f9..e2c0165e6bb 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts @@ -116,3 +116,14 @@ * 0x10000000-0xfc00000=0x400000 */ }; + +&pcie1 { + wlan_2g: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_1000 0>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; 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 b07346bacb4..00f4957c574 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts @@ -100,24 +100,29 @@ }; factory: partition@200000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; sercomm,scpart-id = <2>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -177,9 +182,8 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000 5>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(5)>; }; }; @@ -189,14 +193,13 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000 4>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(4)>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 0>; nvmem-cell-names = "mac-address"; }; @@ -205,9 +208,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts index df80f49e97e..f9b53ae0b36 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts @@ -9,22 +9,19 @@ &pcie0 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 5>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(5)>; }; }; &pcie1 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 4>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(4)>; }; }; &gmac1 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; diff --git a/target/linux/ramips/dts/mt7621_belkin_rt1800.dts b/target/linux/ramips/dts/mt7621_belkin_rt1800.dts index 2e5fcc8bca7..e7acc55e500 100644 --- a/target/linux/ramips/dts/mt7621_belkin_rt1800.dts +++ b/target/linux/ramips/dts/mt7621_belkin_rt1800.dts @@ -86,15 +86,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_bolt_arion.dts b/target/linux/ramips/dts/mt7621_bolt_arion.dts index 826d3f928aa..83855f9dc89 100644 --- a/target/linux/ramips/dts/mt7621_bolt_arion.dts +++ b/target/linux/ramips/dts/mt7621_bolt_arion.dts @@ -100,23 +100,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -154,9 +159,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_28 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &switch0 { @@ -169,7 +173,7 @@ wan: port@1 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_28 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index 795fe256b3c..f176691aacc 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -133,19 +133,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts index 4ceb4e54e0a..b4ba1519d3d 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts @@ -131,23 +131,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + 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_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -179,9 +184,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &gmac1 { @@ -189,9 +193,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index b6db48a347a..e1b82816f0c 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -133,23 +133,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts index 80600470e77..ac0c19c0228 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts @@ -90,6 +90,18 @@ label = "factory"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@90000 { @@ -101,18 +113,8 @@ }; }; -&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-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -121,9 +123,8 @@ port@0 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; port@4 { 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 f26e6626f54..a915a5d79f0 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts @@ -107,7 +107,6 @@ factory: partition@40000 { label = "factory"; - compatible = "nvmem-cells"; reg = <0x40000 0x10000>; read-only; diff --git a/target/linux/ramips/dts/mt7621_cudy_m1800.dts b/target/linux/ramips/dts/mt7621_cudy_m1800.dts index 314fdb206ca..29d6f9e41a9 100644 --- a/target/linux/ramips/dts/mt7621_cudy_m1800.dts +++ b/target/linux/ramips/dts/mt7621_cudy_m1800.dts @@ -53,9 +53,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &gmac1 { @@ -63,7 +62,7 @@ label = "lan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; @@ -148,12 +147,16 @@ reg = <0x1ff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts index fcc16c31b51..e87209fbb1d 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts @@ -85,19 +85,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; @@ -120,15 +123,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -143,7 +151,7 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; @@ -157,9 +165,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; led { @@ -170,7 +177,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; @@ -179,9 +186,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts index a4a148f53b9..a33279e596d 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts @@ -1,143 +1,19 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include +#include "mt7621_cudy_wr1300-v2v3.dtsi" / { compatible = "cudy,wr1300-v2", "mediatek,mt7621-soc"; model = "Cudy WR1300 v2"; - - aliases { - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_sys; - led-upgrade = &led_sys; - label-mac-device = &gmac0; - }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 7 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_sys: sys { - label = "green:sys"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - - wps { - label = "green:wps"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - 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>; - }; - - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xf80000>; - }; - - partition@fd0000 { - label = "debug"; - reg = <0xfd0000 0x10000>; - read-only; - }; - - partition@fe0000 { - label = "backup"; - reg = <0xfe0000 0x10000>; - read-only; - }; - - 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>; - }; - }; - }; - }; -}; - -&pcie { - status = "okay"; }; &pcie1 { wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -145,60 +21,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; - }; -}; - -&gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; -}; - -&gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy4>; - - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&mdio { - ethphy4: ethernet-phy@4 { - reg = <4>; - }; -}; - -&switch0 { - ports { - port@0 { - status = "okay"; - label = "lan4"; - }; - - port@1 { - status = "okay"; - label = "lan3"; - }; - - port@2 { - status = "okay"; - label = "lan2"; - }; - - port@3 { - status = "okay"; - label = "lan1"; - }; - }; -}; - -&state_default { - gpio { - groups = "wdt", "i2c", "jtag"; - function = "gpio"; + ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2v3.dtsi b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2v3.dtsi new file mode 100644 index 00000000000..b4c61fb7c66 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2v3.dtsi @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "green:sys"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "green:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf80000>; + }; + + partition@fd0000 { + label = "debug"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "backup"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "bdinfo"; + reg = <0xff0000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&gmac0 { + nvmem-cells = <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_bdinfo_de00 1>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&state_default { + gpio { + groups = "wdt", "i2c", "jtag"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v3.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v3.dts new file mode 100644 index 00000000000..cb75703a0af --- /dev/null +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v3.dts @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_cudy_wr1300-v2v3.dtsi" + +/ { + compatible = "cudy,wr1300-v3", "mediatek,mt7621-soc"; + model = "Cudy WR1300 v3"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <2400000 2500000>; + + led { + led-sources = <0>; + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts index afa13973d57..fc38e27ac18 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts @@ -78,7 +78,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; @@ -132,19 +132,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; @@ -167,15 +170,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -194,9 +202,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts b/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts index cfae15e5659..940a0598c10 100644 --- a/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts +++ b/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts @@ -31,28 +31,31 @@ reg = <0x1ff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; &gmac1 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wifi { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts b/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts index 16fa15befc4..70e6a845a4b 100644 --- a/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts +++ b/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts @@ -31,28 +31,31 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; &gmac1 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wifi { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; 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 a25787b71b8..82160cff03f 100644 --- a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -115,27 +115,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 3d27b0a942b..29c212671cc 100644 --- a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts +++ b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts @@ -129,27 +129,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; 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..73f6247b477 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts @@ -129,12 +129,14 @@ reg = <0x100000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts index d352d27b76c..e0a714c9dc6 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts @@ -15,15 +15,3 @@ linux,default-trigger = "usbport"; }; }; - -&wifi0 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&wifi1 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts index 127a9a3417f..d4b8069a333 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts @@ -22,15 +22,3 @@ linux,default-trigger = "usbport"; }; }; - -&wifi0 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&wifi1 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts index 02fd35d60e9..a4590cb35fc 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts @@ -22,15 +22,3 @@ linux,default-trigger = "usbport"; }; }; - -&wifi0 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&wifi1 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; 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 5af9ea28ea4..1cca6f6b578 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts @@ -111,27 +111,32 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; @@ -183,9 +188,8 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <2400000 6000000>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; }; @@ -194,14 +198,13 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 3>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <3>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; 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 7cd4a92aa7d..8e5e35945a6 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts @@ -108,23 +108,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 36758567807..747d1de18a0 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts @@ -105,27 +105,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 290638f7355..bce0e6996be 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts @@ -97,15 +97,14 @@ /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>; nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &gmac1 { @@ -113,9 +112,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &mdio { 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 36d22046a95..451722743d9 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -83,23 +83,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_radio_0: eeprom@0 { - reg = <0x0 0x200>; - }; + macaddr_radio_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_radio_2000: eeprom@2000 { - reg = <0x2000 0x200>; + eeprom_radio_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; }; }; 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 fee88647775..6eb3f3cdd9b 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi @@ -76,27 +76,32 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; @@ -146,7 +151,7 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; @@ -160,7 +165,7 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_8000>; + nvmem-cells = <&macaddr_factory_e000 2>; nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; @@ -171,7 +176,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; 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 cc979df26a6..a933b149250 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi @@ -93,19 +93,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; 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 a8e518cae46..021c9e17c65 100644 --- a/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi @@ -26,27 +26,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; 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 dddd39ceaae..bccd19b12d8 100644 --- a/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi @@ -26,31 +26,36 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_dual-q_h721.dts b/target/linux/ramips/dts/mt7621_dual-q_h721.dts index 2a18b3982d9..2c35a8839cb 100644 --- a/target/linux/ramips/dts/mt7621_dual-q_h721.dts +++ b/target/linux/ramips/dts/mt7621_dual-q_h721.dts @@ -122,12 +122,16 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -174,9 +178,8 @@ status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -186,7 +189,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_edimax_re23s.dts b/target/linux/ramips/dts/mt7621_edimax_re23s.dts index c96292be33f..80a271f6e33 100644 --- a/target/linux/ramips/dts/mt7621_edimax_re23s.dts +++ b/target/linux/ramips/dts/mt7621_edimax_re23s.dts @@ -86,23 +86,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + 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 4aac3fb6d7c..464e2a74441 100644 --- a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi +++ b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi @@ -81,23 +81,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + 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_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 6a9531eb332..9c0353ae28b 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts @@ -67,7 +67,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -136,23 +136,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; @@ -192,9 +197,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts index 81ace64e44b..9ed7acac942 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts @@ -50,25 +50,28 @@ }; &wifi { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_fff4: macaddr@fff4 { - reg = <0xfff4 0x6>; - }; + macaddr_factory_fff4: macaddr@fff4 { + reg = <0xfff4 0x6>; + }; - macaddr_factory_fffa: macaddr@fffa { - reg = <0xfffa 0x6>; + macaddr_factory_fffa: macaddr@fffa { + reg = <0xfffa 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts index cb2e2027937..d7510c292b7 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts @@ -50,21 +50,24 @@ }; &wifi { - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + compatible = "mac-base"; + reg = <0xe006 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts index 8450af59074..c01533fafdd 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts index a57a4290aff..4157fb6c135 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts index f01f6fc25f0..d978ff82388 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts index ec433e265de..5e3b47e2746 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 7096b015ef8..618b07e798d 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi @@ -100,19 +100,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts index 7e88f7be04f..77fcb8c4298 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_fff4: macaddr@fff4 { - reg = <0xfff4 0x6>; - }; + macaddr_factory_fff4: macaddr@fff4 { + reg = <0xfff4 0x6>; + }; - macaddr_factory_fffa: macaddr@fffa { - reg = <0xfffa 0x6>; + macaddr_factory_fffa: macaddr@fffa { + reg = <0xfffa 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts index 1d174006bd0..481734a51c1 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts @@ -48,15 +48,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts index b71a2b4390f..e7c06ff359d 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi index 2c60f3d8b6b..30b8d4e0104 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi @@ -145,19 +145,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 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 d63be92c785..64e21bb704a 100644 --- a/target/linux/ramips/dts/mt7621_etisalat_s3.dts +++ b/target/linux/ramips/dts/mt7621_etisalat_s3.dts @@ -100,24 +100,29 @@ }; factory: partition@200000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; sercomm,scpart-id = <2>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -177,9 +182,8 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000 3>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(3)>; }; }; @@ -189,14 +193,13 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(2)>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 0>; nvmem-cell-names = "mac-address"; }; @@ -205,9 +208,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 11>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(11)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts index acc9e9865f9..c2c2acac9f2 100644 --- a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts +++ b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts @@ -70,23 +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 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -126,7 +131,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -155,9 +160,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; 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 a87f82b6811..d224fd388d7 100644 --- a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -68,23 +68,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -124,7 +129,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -133,9 +138,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts index 1565666a5d8..891fe7c730f 100644 --- a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts +++ b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts @@ -88,19 +88,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; + macaddr_factory_4000: macaddr@4000 { + compatible = "mac-base"; + reg = <0x4000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -127,9 +132,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_4000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &gmac1 { @@ -137,7 +141,7 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_4000 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts index 5d28e22776c..6bdba25b2b4 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts @@ -75,6 +75,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -125,13 +135,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_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts index d4998113456..9a2cffeb97c 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts @@ -95,6 +95,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -151,13 +161,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_h3c_tx180x.dtsi b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi index afb188dff45..59b49fbefc8 100644 --- a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi +++ b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi @@ -97,15 +97,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi index afda347ee73..6549abaec95 100644 --- a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi +++ b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi @@ -63,7 +63,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_8004>; + nvmem-cells = <&macaddr_factory_8004 0>; nvmem-cell-names = "mac-address"; }; @@ -72,9 +72,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_8004>; + nvmem-cells = <&macaddr_factory_8004 (-3)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-3)>; }; &mdio { @@ -103,19 +102,24 @@ }; factory: partition@100000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x0100000 0x0080000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts b/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts index 94b211ab7a7..5737c0ce68f 100644 --- a/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts +++ b/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts @@ -75,27 +75,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 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; }; @@ -161,7 +166,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -170,9 +175,8 @@ port@0 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; port@1 { 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 99bd01c6d93..41ed5088c0a 100644 --- a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts +++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts @@ -47,15 +47,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index 63c4f5f6b24..a21a6a455b3 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -81,19 +81,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts index fc548352d54..9b9a9831087 100644 --- a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts +++ b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts @@ -93,23 +93,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_humax_e10.dts b/target/linux/ramips/dts/mt7621_humax_e10.dts index ac13b4a9c59..be5f23ca7d6 100644 --- a/target/linux/ramips/dts/mt7621_humax_e10.dts +++ b/target/linux/ramips/dts/mt7621_humax_e10.dts @@ -89,27 +89,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_10007: macaddr@10007 { - reg = <0x10007 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_10007: macaddr@10007 { + reg = <0x10007 0x6>; + }; - macaddr_factory_1000d: macaddr@1000d { - reg = <0x1000d 0x6>; + macaddr_factory_1000d: macaddr@1000d { + reg = <0x1000d 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts index b08939a451d..b46ba87f394 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts @@ -89,36 +89,44 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_iNIC_rf_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_iNIC_rf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; @@ -159,9 +167,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts index b9357632e1a..b9b901a6ce0 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts @@ -119,7 +119,6 @@ }; partition@100000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; read-only; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts index 19868fa078b..9680aadfbbf 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts @@ -81,26 +81,29 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_1e000: macaddr@1e000 { - reg = <0x1e000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_1e000: macaddr@1e000 { + reg = <0x1e000 0x6>; + }; - macaddr_factory_1e006: macaddr@1e006 { - reg = <0x1e006 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 f2cd28ad1c7..6bd5e733f4a 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts @@ -89,19 +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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -139,7 +144,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -148,9 +153,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi index 4b42fcb7de7..f25d2db9b30 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi +++ b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi @@ -80,6 +80,20 @@ factory: partition@200000 { label = "factory"; reg = <0x0200000 0x0100000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@300000 { @@ -180,17 +194,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_iodata_wnpr2600g.dts b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts index 6729e94cc5a..1c46f57e584 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts @@ -93,23 +93,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + 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_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 fc51b9ac4f0..05346a10d4a 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts @@ -73,12 +73,16 @@ reg = <0x0 0x20000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc40: macaddr@1fc40 { + compatible = "mac-base"; + reg = <0x1fc40 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -89,15 +93,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; }; }; @@ -111,9 +118,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_uboot_1fc40>; + nvmem-cells = <&macaddr_uboot_1fc40 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; &gmac1 { @@ -121,7 +127,7 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_uboot_1fc40>; + nvmem-cells = <&macaddr_uboot_1fc40 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts index 0faf24e7b05..3bf0600e5fe 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts @@ -63,19 +63,22 @@ #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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; }; }; @@ -86,19 +89,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3004t.dts b/target/linux/ramips/dts/mt7621_iptime_a3004t.dts index 000657c8667..2394a343c24 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3004t.dts @@ -76,23 +76,28 @@ }; factory: partition@a0000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0xa0000 0x20000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x4da8>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; }; @@ -118,9 +123,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(3)>; }; &gmac1 { @@ -128,9 +132,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi b/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi index db7743f137b..ef58382ab61 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi +++ b/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi @@ -74,19 +74,22 @@ #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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; }; }; @@ -97,19 +100,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts index dc9033c3940..7be11315c54 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts @@ -68,19 +68,22 @@ #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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; }; }; @@ -91,19 +94,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts index 554d73ce3d4..ec02679c23b 100644 --- a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts +++ b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts @@ -77,12 +77,16 @@ reg = <0x100000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -115,9 +119,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &gmac1 { @@ -125,9 +128,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts index 5714a57c4e4..fd9bd66bf8c 100644 --- a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts +++ b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts @@ -84,27 +84,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + 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_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20-pb-boot.dts b/target/linux/ramips/dts/mt7621_jcg_q20-pb-boot.dts index 4b90458eba8..aa0df66e92a 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20-pb-boot.dts +++ b/target/linux/ramips/dts/mt7621_jcg_q20-pb-boot.dts @@ -31,19 +31,26 @@ read-only; compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; + macaddr_factory_3fff4: macaddr@3fff4 { + compatible = "mac-base"; + reg = <0x3fff4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; + macaddr_factory_3fffa: macaddr@3fffa { + compatible = "mac-base"; + reg = <0x3fffa 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts index cc4d2ad10cd..894341c7928 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20.dts +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts @@ -41,19 +41,26 @@ read-only; compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0xe00>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; + macaddr_factory_3fff4: macaddr@3fff4 { + compatible = "mac-base"; + reg = <0x3fff4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; + macaddr_factory_3fffa: macaddr@3fffa { + compatible = "mac-base"; + reg = <0x3fffa 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dtsi b/target/linux/ramips/dts/mt7621_jcg_q20.dtsi index 177676ac780..8e50dec1972 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20.dtsi +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dtsi @@ -74,7 +74,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_3fff4>; + nvmem-cells = <&macaddr_factory_3fff4 0>; nvmem-cell-names = "mac-address"; }; @@ -83,7 +83,7 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_3fffa>; + nvmem-cells = <&macaddr_factory_3fffa 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_y2.dts b/target/linux/ramips/dts/mt7621_jcg_y2.dts index 9e50d9b3ed7..2cec1af23e2 100644 --- a/target/linux/ramips/dts/mt7621_jcg_y2.dts +++ b/target/linux/ramips/dts/mt7621_jcg_y2.dts @@ -62,23 +62,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts index 1f2968f94c0..5e60bf856e8 100644 --- a/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts +++ b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts @@ -120,15 +120,18 @@ read-only; compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x400>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts index 8f617484533..264c908c45b 100644 --- a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts +++ b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts @@ -123,27 +123,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_400: eeprom@400 { - reg = <0x400 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 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 a6a7fc9f427..dd8d2244542 100644 --- a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts +++ b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts @@ -104,27 +104,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 c1b8048f0cf..3f23aa69a43 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e5600.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts @@ -83,19 +83,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_e7350.dts b/target/linux/ramips/dts/mt7621_linksys_e7350.dts index 4451e5e3f3e..2bce2d75901 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e7350.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e7350.dts @@ -80,15 +80,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_re6500.dts b/target/linux/ramips/dts/mt7621_linksys_re6500.dts index 5b295a06a73..3a682245268 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re6500.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re6500.dts @@ -71,23 +71,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_re7000.dts b/target/linux/ramips/dts/mt7621_linksys_re7000.dts index c5b6ecc233e..9b9c84a0487 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re7000.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re7000.dts @@ -84,23 +84,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts index 557abcc21af..8e2d866b3b9 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts @@ -97,6 +97,18 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_5: macaddr@5 { + compatible = "mac-base"; + reg = <0x5 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -113,7 +125,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_5>; + nvmem-cells = <&macaddr_factory_5 0>; nvmem-cell-names = "mac-address"; }; @@ -122,9 +134,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_5>; + nvmem-cells = <&macaddr_factory_5 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -160,13 +171,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_5: macaddr@5 { - reg = <0x5 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_meig_slt866.dts b/target/linux/ramips/dts/mt7621_meig_slt866.dts index 19d2f0f6fc4..d364a917942 100644 --- a/target/linux/ramips/dts/mt7621_meig_slt866.dts +++ b/target/linux/ramips/dts/mt7621_meig_slt866.dts @@ -117,7 +117,6 @@ label = "Factory"; reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; nvmem-layout { compatible = "fixed-layout"; @@ -144,7 +143,6 @@ label = "m_custom"; reg = <0xfe0000 0x20000>; read-only; - compatible = "nvmem-cells"; nvmem-layout { compatible = "fixed-layout"; diff --git a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts index ebfc370caf3..d663dc63b24 100644 --- a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts +++ b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts @@ -75,6 +75,18 @@ label = "config"; reg = <0xfa0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fb0000 { @@ -101,14 +113,14 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; mediatek,disable-radar-background; }; }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -117,9 +129,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -153,13 +164,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_mqmaker_witi.dts b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts index dc70414da9c..0052040f369 100644 --- a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts +++ b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts @@ -58,22 +58,27 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -94,7 +99,7 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 0>; nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -103,13 +108,13 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 0>; nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -119,9 +124,8 @@ phy-mode = "rgmii-rxid"; phy-handle = <ðphy5>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -156,9 +160,8 @@ status = "okay"; label = "wan1"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts index 5872a710b88..43b021fa13a 100644 --- a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts +++ b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts @@ -78,23 +78,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -118,7 +123,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -147,9 +152,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts index 0ddcd6c35ed..41e603c1605 100644 --- a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts +++ b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts @@ -118,23 +118,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_r6220.dts b/target/linux/ramips/dts/mt7621_netgear_r6220.dts index f960d8f66fe..132210cb0ce 100644 --- a/target/linux/ramips/dts/mt7621_netgear_r6220.dts +++ b/target/linux/ramips/dts/mt7621_netgear_r6220.dts @@ -42,7 +42,6 @@ }; factory: partition@2e00000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x2e00000 0x100000>; read-only; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi index ab96b8fdd12..f5cffb4a2a4 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi @@ -162,7 +162,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -171,9 +171,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &mdio { @@ -216,6 +215,7 @@ reg = <0x20>; gpio-controller; + interrupt-controller; }; }; @@ -342,6 +342,18 @@ reg = <0x4600000 0x200000>; sercomm,scpart-id = <16>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@4800000 { @@ -429,13 +441,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_netgear_sercomm_chj.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi index cd9582e5412..fd73bfcb3ed 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi @@ -96,7 +96,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -105,9 +105,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &mdio { @@ -270,6 +269,18 @@ reg = <0x4600000 0x200000>; sercomm,scpart-id = <16>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@4800000 { @@ -357,13 +368,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_netgear_wac104.dts b/target/linux/ramips/dts/mt7621_netgear_wac104.dts index 53a4449b8bf..48a3302e79c 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wac104.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wac104.dts @@ -96,23 +96,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_wax202.dts b/target/linux/ramips/dts/mt7621_netgear_wax202.dts index eb7d1bb7e5f..c0c3500af25 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wax202.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wax202.dts @@ -113,15 +113,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netis_wf2881.dts b/target/linux/ramips/dts/mt7621_netis_wf2881.dts index 29f111b572d..c58e32377e8 100644 --- a/target/linux/ramips/dts/mt7621_netis_wf2881.dts +++ b/target/linux/ramips/dts/mt7621_netis_wf2881.dts @@ -63,27 +63,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts index 56711332556..23915999633 100644 --- a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts +++ b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts @@ -77,15 +77,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; }; }; @@ -100,12 +103,16 @@ reg = <0xfe0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_bdinfo_9: macaddr@9 { - reg = <0x9 0x6>; + macaddr_bdinfo_9: macaddr@9 { + compatible = "mac-base"; + reg = <0x9 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -132,7 +139,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_9>; + nvmem-cells = <&macaddr_bdinfo_9 0>; nvmem-cell-names = "mac-address"; }; @@ -141,9 +148,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_9>; + nvmem-cells = <&macaddr_bdinfo_9 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts index fd3b42f6edb..85cf8ecfd3e 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -70,27 +70,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_planex_vr500.dts b/target/linux/ramips/dts/mt7621_planex_vr500.dts index 1da6d2cca12..93e7280b4c0 100644 --- a/target/linux/ramips/dts/mt7621_planex_vr500.dts +++ b/target/linux/ramips/dts/mt7621_planex_vr500.dts @@ -63,6 +63,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -124,17 +138,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_raisecom_msg1500-x-00.dts b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts index 6dd4b581399..4a9e420370a 100644 --- a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts +++ b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts @@ -81,8 +81,6 @@ reg = <0x80000 0x80000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -103,19 +101,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 3cf29d17295..8a32a86e7bb 100644 --- a/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts +++ b/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts @@ -68,23 +68,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -116,16 +121,14 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &gmac1 { @@ -133,9 +136,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_rostelecom_rt-fe-1a.dts b/target/linux/ramips/dts/mt7621_rostelecom_rt-fe-1a.dts new file mode 100644 index 00000000000..8afe5f54859 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_rostelecom_rt-fe-1a.dts @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "rostelecom,rt-fe-1a", "mediatek,mt7621-soc"; + model = "Rostelecom RT-FE-1A"; + + aliases { + label-mac-device = &gmac0; + + led-boot = &led_status_green; + led-failsafe = &led_status_green; + led-running = &led_status_green; + led-upgrade = &led_status_green; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <50>; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + led-1 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <24>; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + led_status_green: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + button-0 { + label = "wps"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + + button-1 { + label = "reset"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 \ + &ubiconcat3>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x5420000>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "sercomm,sc-partitions", "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x100000>; + sercomm,scpart-id = <0>; + read-only; + }; + + partition@100000 { + label = "dynamic partition map"; + reg = <0x100000 0x100000>; + sercomm,scpart-id = <1>; + read-only; + }; + + partition@200000 { + label = "Factory"; + reg = <0x200000 0x100000>; + sercomm,scpart-id = <2>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_2g: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_5g: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_label: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@300000 { + label = "Boot Flag"; + reg = <0x300000 0x100000>; + sercomm,scpart-id = <3>; + }; + + partition@400000 { + label = "kernel"; + reg = <0x400000 0x600000>; + sercomm,scpart-id = <4>; + }; + + partition@a00000 { + label = "Kernel 2"; + reg = <0xa00000 0x600000>; + sercomm,scpart-id = <5>; + read-only; + }; + + ubiconcat0: partition@1000000 { + label = "File System 1"; + reg = <0x1000000 0x1800000>; + sercomm,scpart-id = <6>; + }; + + partition@2800000 { + label = "File System 2"; + reg = <0x2800000 0x1800000>; + sercomm,scpart-id = <7>; + read-only; + }; + + ubiconcat1: partition@4000000 { + label = "Configuration/log"; + reg = <0x4000000 0x800000>; + sercomm,scpart-id = <8>; + }; + + ubiconcat2: partition@4800000 { + label = "application tmp buffer (Ftool)"; + reg = <0x4800000 0xc00000>; + sercomm,scpart-id = <9>; + }; + + ubiconcat3: partition@5400000 { + label = "free space (in stock firmware)"; + reg = <0x5400000 0x2820000>; + sercomm,scpart-id = <10>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&eeprom_5g>, <&macaddr_label 3>; + nvmem-cell-names = "eeprom", "mac-address"; + + led { + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_2g>, <&macaddr_label 2>; + nvmem-cell-names = "eeprom", "mac-address"; + + led { + led-active-low; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_label 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + nvmem-cells = <&macaddr_label 11>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&switch0 { + ports { + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "uart2", "uart3", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts b/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts index c476cf94957..b722df5bbb8 100644 --- a/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts +++ b/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts @@ -9,22 +9,19 @@ &pcie0 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(3)>; }; }; &pcie1 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; }; &gmac1 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 11>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(11)>; }; diff --git a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts index e5946af9094..c3c5a2ff4a8 100644 --- a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts +++ b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts @@ -72,27 +72,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 479ea067a7b..36d576108d7 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi @@ -98,24 +98,29 @@ }; factory: partition@200000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x200000 0x100000>; sercomm,scpart-id = <2>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502.dts b/target/linux/ramips/dts/mt7621_sercomm_na502.dts index 7fe0258223b..44b1077bc60 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502.dts @@ -100,7 +100,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -125,22 +125,27 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -189,9 +194,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -200,9 +204,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts index 50d4df81f60..bea5998935f 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts @@ -204,7 +204,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -229,22 +229,27 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -293,9 +298,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -304,9 +308,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -330,6 +333,7 @@ reg = <0x22>; gpio-controller; + interrupt-controller; }; gpio_expander0: gpio-expander0@20 { @@ -339,6 +343,7 @@ reg = <0x20>; gpio-controller; + interrupt-controller; }; gpio_expander1: gpio-expander1@21 { @@ -348,6 +353,7 @@ reg = <0x21>; gpio-controller; + interrupt-controller; }; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi index 11cf7752aba..09862b8067a 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi @@ -158,7 +158,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_1000>; + nvmem-cells = <&macaddr_factory_1000 0>; nvmem-cell-names = "mac-address"; }; @@ -177,23 +177,28 @@ }; factory: partition@100000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x100000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_1000: macaddr@1000 { - reg = <0x1000 0x6>; + macaddr_factory_1000: macaddr@1000 { + compatible = "mac-base"; + reg = <0x1000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -228,19 +233,7 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_1000>; - nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; - }; -}; - -&pcie1 { - wlan_2g: wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - ieee80211-freq-limit = <2400000 2500000>; - - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_1000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_1000 2>; nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -278,9 +271,8 @@ status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_1000>; + nvmem-cells = <&macaddr_factory_1000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; 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 9dbcbaa3c0c..7383ba1e209 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts @@ -146,27 +146,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 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 1cc9b45c403..51425b9a156 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,27 +74,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; 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 9e498b78ed7..65f33f615be 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,23 +113,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts index d9f7281a77a..60817edbbff 100644 --- a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts +++ b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts @@ -67,23 +67,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + compatible = "mac-base"; + reg = <0xe006 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -119,7 +124,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 0>; nvmem-cell-names = "mac-address"; }; @@ -128,9 +133,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts index 8eb406541b3..4d8fa7f320d 100644 --- a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts +++ b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts @@ -106,23 +106,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + compatible = "mac-base"; + reg = <0xe006 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -140,7 +145,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 0>; nvmem-cell-names = "mac-address"; }; @@ -169,9 +174,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; 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 a7e048f9ae6..7b1e5d863b5 100644 --- a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts +++ b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts @@ -112,7 +112,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -121,9 +121,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &mdio { @@ -195,19 +194,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts index 917a6beb512..da1db0366f4 100644 --- a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -82,6 +82,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -113,13 +123,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_totolink_a7000r.dts b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts index 16d8edb3411..dd6cc5d844b 100644 --- a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts @@ -63,23 +63,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + 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_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -117,7 +122,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -126,9 +131,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts index 23d47d6ea35..d2c242be6f4 100644 --- a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts @@ -70,23 +70,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + 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 d90c0b4b59c..2d8717e3cdd 100644 --- a/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts +++ b/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts @@ -160,23 +160,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 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..1bc3f7e4f50 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts @@ -108,6 +108,18 @@ label = "config"; reg = <0xfa0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fb0000 { @@ -134,14 +146,14 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; mediatek,disable-radar-background; }; }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -150,9 +162,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -191,13 +202,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_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts index 330f6a0f340..522408b220c 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -116,15 +116,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -135,19 +140,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -162,7 +170,7 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 0>; nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; @@ -172,15 +180,14 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8 (-1)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-1)>; ieee80211-freq-limit = <5000000 6000000>; }; }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -189,9 +196,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { 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 08867064ed4..d3db8cd602c 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi @@ -109,32 +109,40 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -156,9 +164,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -167,9 +174,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -179,7 +185,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; 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 4603263e8dd..087910233e2 100644 --- a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts +++ b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts @@ -131,12 +131,14 @@ reg = <0xfa0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; }; @@ -147,19 +149,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; 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 f2aea644fa2..a91a18efc75 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts @@ -82,15 +82,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -121,19 +126,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -154,7 +162,7 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_info_8>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_info_8 0>; nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -163,14 +171,13 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_info_8>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_info_8 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; }; &gmac0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -179,7 +186,7 @@ label = "lan0"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts index d25bf575602..cf08452c50d 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts @@ -70,16 +70,18 @@ }; partition@90000 { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - label = "product-info"; reg = <0x90000 0x10000>; read-only; - macaddr: macaddr@8 { - reg = <0x8 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr: macaddr@8 { + reg = <0x8 0x6>; + }; }; }; 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..f9bbd9b3928 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts @@ -93,6 +93,16 @@ label = "product-info"; reg = <0x90000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@a0000 { @@ -186,13 +196,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_ec330-g5u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts index 016ab03c7b7..84b3efe8df9 100644 --- a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts @@ -225,7 +225,6 @@ }; factory: partition@7800000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x7800000 0x400000>; read-only; diff --git a/target/linux/ramips/dts/mt7621_tplink_ex220-v1.dts b/target/linux/ramips/dts/mt7621_tplink_ex220-v1.dts new file mode 100644 index 00000000000..c809cb0c0b2 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_ex220-v1.dts @@ -0,0 +1,245 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,ex220-v1", "mediatek,mt7621-soc"; + model = "TP-Link EX220 v1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + button-wps { + label = "rfkill"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-wps { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-lan { + color = ; + function = LED_FUNCTION_LAN; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-wan-orange { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-wan-green { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-wifi5g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-wifi2g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_power: led-power { + label = "green:power"; // to be removed once #13837 is merged + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x00 0x30000>; + read-only; + }; + + partition@30000 { + label = "boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "config"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "isp_config"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + label = "rom_file"; + reg = <0x70000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_file_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@80000 { + label = "cloud"; + reg = <0x80000 0x10000>; + read-only; + }; + + radio: partition@90000 { + label = "radio"; + reg = <0x90000 0x20000>; + read-only; + }; + + partition@b0000 { + label = "config_bak"; + reg = <0xb0000 0x10000>; + read-only; + }; + + partition@c0000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0xc0000 0xf30000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&macaddr_rom_file_f100 0>; + nvmem-cell-names = "mac-address"; + mediatek,disable-radar-background; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_rom_file_f100 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_rom_file_f100 1>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; 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 b9d5995ed5b..6b73ffff24f 100644 --- a/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts +++ b/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts @@ -109,15 +109,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfile_f100: romfile@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -128,19 +133,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -156,7 +164,7 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100 0>; nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; @@ -167,14 +175,13 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100 (-1)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-1)>; }; }; &gmac0 { - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -183,7 +190,7 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts index 890365c199b..be23abf4c83 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts @@ -108,32 +108,40 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -147,9 +155,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; }; @@ -157,9 +164,8 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; }; }; @@ -168,7 +174,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts b/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts index 42b9c3cc3e3..7dcd5e553cd 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts @@ -117,32 +117,40 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -164,9 +172,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -175,9 +182,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -187,7 +193,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi index 4207100f343..3784a4f3c95 100644 --- a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi @@ -114,15 +114,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -131,19 +136,22 @@ */ 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -165,9 +173,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -176,9 +183,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -188,7 +194,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; 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 7d8948bb371..1e0fd202397 100644 --- a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts +++ b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts @@ -112,32 +112,40 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + compatible = "mac-base"; + reg = <0x2008 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; }; }; }; @@ -159,7 +167,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 0>; nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; @@ -169,9 +177,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -181,7 +188,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_2008>; + nvmem-cells = <&macaddr_config_2008 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi index 411bf6a85ac..b2b78aba632 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi @@ -83,7 +83,6 @@ }; factory: partition@e0000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0xe0000 0x60000>; 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..cd19893e145 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -37,32 +37,40 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_eeprom_6: macaddr@6 { - reg = <0x6 0x6>; + macaddr_eeprom_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -106,9 +114,6 @@ mediatek,mtd-eeprom = <&factory 0x20000>; - nvmem-cells = <&macaddr_eeprom_6>; - nvmem-cell-names = "mac-address"; - /* This is a workaround. * * Ubiquiti uses a +2 offset in the first octet relative @@ -121,7 +126,8 @@ * mac80211 increases the first octet by two for each VAP, leading * to conflicting MAC addresses for subsequent interfaces. */ - mac-address-increment = <1>; + nvmem-cells = <&macaddr_eeprom_6 1>; + nvmem-cell-names = "mac-address"; ieee80211-freq-limit = <5000000 6000000>; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts index 615bdf4e13b..36df3ef883d 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts @@ -67,6 +67,18 @@ label = "eeprom"; reg = <0x80000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@90000 { @@ -95,18 +107,8 @@ }; }; -&eeprom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_eeprom_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; - &gmac0 { - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 0>; nvmem-cell-names = "mac-address"; }; @@ -129,9 +131,8 @@ mediatek,mtd-eeprom = <&factory 0x0>; // On newer devices there is a MediaTek MAC in the above // device EEPROM, so override it with a calculated one. - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -141,9 +142,8 @@ mediatek,mtd-eeprom = <&factory 0x8000>; // On newer devices there is a MediaTek MAC in the above // device EEPROM, so override it with a calculated one. - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts index 2762a777a35..b4000464f7b 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts @@ -42,6 +42,16 @@ label = "eeprom"; reg = <0x80000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@90000 { @@ -82,13 +92,3 @@ &wlan_5g { mediatek,mtd-eeprom = <&factory 0x8000>; }; - -&eeprom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_eeprom_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts b/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts index ff328bd858b..f09ccba5855 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts @@ -138,17 +138,18 @@ }; part_eeprom: partition@80000 { - compatible = "nvmem-cells"; - - #address-cells = <1>; - #size-cells = <1>; - label = "eeprom"; reg = <0x80000 0x10000>; read-only; - macaddr_eeprom: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom: macaddr@0 { + reg = <0x0 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 42cf121f3b0..c933e443c12 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts @@ -33,27 +33,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts index 212c0009425..c51b6eebee0 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -61,17 +75,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-06-32m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-32m.dts index dc9a9773a24..4d34a787b66 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-32m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-32m.dts @@ -42,6 +42,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -62,17 +76,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-06-64m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts index f196432111b..edc3a7723a2 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts @@ -42,6 +42,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -62,17 +76,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_wavlink_wl-wn53xax.dtsi b/target/linux/ramips/dts/mt7621_wavlink_wl-wn53xax.dtsi index 843e9a30c7e..e0db05724e7 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_wl-wn53xax.dtsi +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn53xax.dtsi @@ -95,6 +95,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -178,17 +192,3 @@ &uartlite2 { 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_wavlink_wl-wn573hx1.dts b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts index d8a94c85b9f..dd2150c1a6b 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts @@ -86,9 +86,19 @@ reg = <0x30000 0x10000>; }; - factory:partition@50000 { + factory: partition@50000 { label = "factory"; reg = <0x50000 0x40000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + }; }; partition@90000 { @@ -119,15 +129,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_wavlink_ws-wn572hp3-4g.dts b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts index 76fbbb99b14..55e828a2955 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts @@ -84,27 +84,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi index 6c5a638e0f0..8b018e18ae4 100644 --- a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi @@ -63,27 +63,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts index 6c0e2965aa0..4ffe9881536 100644 --- a/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts +++ b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts @@ -76,6 +76,13 @@ */ }; -&wlan_2g { - mac-address-increment = <1>; +&pcie1 { + wlan_2g: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_1000 1>; + nvmem-cell-names = "eeprom", "mac-address"; + }; }; diff --git a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts index f699b4c47a1..78f81314fc1 100644 --- a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts +++ b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts @@ -84,27 +84,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; 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 62111520c01..a403cd3e14f 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,27 +132,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts index c13c0c95709..763973a193f 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts @@ -132,17 +132,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_xiaomi_mi-router-4.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts index 232a720e549..8340ca5d287 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts @@ -104,17 +104,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_xiaomi_mi-router-4a-common.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi index efc32733e9b..7ce9aea3351 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi @@ -64,6 +64,20 @@ label = "factory"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@60000 { @@ -122,17 +136,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_xiaomi_mi-router-cr660x.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi index f0e0ae8e7e7..d1a2c08c6de 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi @@ -86,23 +86,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; + macaddr_factory_3fffa: macaddr@3fffa { + reg = <0x3fffa 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi index 12e6bccc2e2..1dc91d8b47e 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi @@ -50,6 +50,20 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@140000 { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi index 78f154b3aed..c7d6c574aa0 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi @@ -69,17 +69,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_xiaoyu_xy-c5.dts b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts index e4de0b82310..7bb90e542ec 100644 --- a/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts +++ b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts @@ -70,6 +70,18 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -86,7 +98,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -95,9 +107,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -136,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/mt7621_xzwifi_creativebox-v1.dts b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts index 48f52eed2f7..147713ddce1 100644 --- a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts +++ b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts @@ -113,23 +113,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -174,7 +179,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -203,9 +208,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts index 2389112c3e6..e715237a401 100644 --- a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts +++ b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts @@ -86,27 +86,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 99da11a6147..98d2e689225 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -89,27 +89,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts index 1aba94a9125..bbd546f3009 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts @@ -115,6 +115,18 @@ label = "Factory"; reg = <0x50000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@90000 { @@ -140,7 +152,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -149,9 +161,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -178,13 +189,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..8c662b86cd4 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap640.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap640.dts @@ -123,6 +123,20 @@ label = "Factory"; reg = <0x50000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@90000 { @@ -201,18 +215,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..ce6a60215e2 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts @@ -93,6 +93,16 @@ label = "Factory"; reg = <0x50000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; + }; }; partition@90000 { @@ -137,13 +147,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_zbtlink_zbt-we1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts index e76ce933c1c..2c78dea114f 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts @@ -59,27 +59,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 73f3ea91731..571b50d3c77 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts @@ -56,27 +56,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 ec9d2398cdd..1a3387326a6 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi @@ -111,27 +111,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 c578018e755..e92982a8796 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi @@ -110,27 +110,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 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 ff748b781c0..d1697060a84 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi @@ -84,29 +84,31 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts index c1d5b03964f..3756baa14ef 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts @@ -72,23 +72,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -131,7 +136,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -160,9 +165,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi index 296c5a205f9..87ed1c71297 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi @@ -72,23 +72,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -132,7 +137,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -161,9 +166,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts index d449fccd284..abbb61d5341 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts @@ -126,18 +126,23 @@ 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_fe6e: macaddr@fe6e { - reg = <0xfe6e 0x6>; + macaddr_factory_fe6e: macaddr@fe6e { + compatible = "mac-base"; + reg = <0xfe6e 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; partition@140000 { @@ -172,7 +177,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_fe6e>; + nvmem-cells = <&macaddr_factory_fe6e 0>; nvmem-cell-names = "mac-address"; }; @@ -208,9 +213,8 @@ compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; mediatek,firmware-eeprom = "mt7615e_eeprom.bin"; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_fe6e>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_fe6e 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(1)>; }; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts index d6f00d9edc8..307819e746e 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts @@ -118,23 +118,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; - macaddr_factory_fe6e: macaddr@fe6e { - reg = <0xfe6e 0x6>; + macaddr_factory_fe6e: macaddr@fe6e { + reg = <0xfe6e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts index ace7a08bd89..2ceb6228b26 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts @@ -89,19 +89,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 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..85dbe2d8579 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi +++ b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi @@ -96,6 +96,16 @@ label = "mrd"; reg = <0x7780000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mrd_1fff8: macaddr@1fff8 { + reg = <0x1fff8 0x6>; + }; + }; }; }; }; @@ -129,16 +139,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_wap6805.dts b/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts index 5df2f3c6ab6..2f6654da5c3 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts @@ -74,19 +74,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts index 299d982dc11..0cd1f3274cc 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts @@ -106,6 +106,20 @@ reg = <0x200000 0x1c0000>; label = "Factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_1fdfa: macaddr@1fdfa { + reg = <0x1fdfa 0x6>; + }; + + macaddr_factory_1fdf4: macaddr@1fdf4 { + reg = <0x1fdf4 0x6>; + }; + }; }; partition@3c0000 { @@ -217,17 +231,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>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts index 67f4d07f3af..641844ccc0d 100644 --- a/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts +++ b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts @@ -114,19 +114,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi index 7a13921aa55..e91f1b60297 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi @@ -73,23 +73,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi index 7404853f8cd..aa642da11fd 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi +++ b/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi @@ -75,19 +75,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 7f774163377..1b9e0047ccc 100644 --- a/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts +++ b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts @@ -141,19 +141,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts index 4270c48ad9f..1d6304cfa77 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts @@ -70,27 +70,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; @@ -112,9 +117,8 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi index e8cabd7fd86..9cab562bda2 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi @@ -85,23 +85,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + 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 57405632ddd..883459d2f30 100644 --- a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts +++ b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts @@ -89,23 +89,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts b/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts index 5a0aeaf5f25..f5e9a169d4d 100644 --- a/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts +++ b/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts @@ -116,6 +116,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -160,13 +170,3 @@ 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_dlink_dap-1325-a1.dts b/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts index 0bc81291d73..3ad34c51c1a 100644 --- a/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts +++ b/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts @@ -115,19 +115,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_duzun_dm06.dts b/target/linux/ramips/dts/mt7628an_duzun_dm06.dts index b9a105b0e3b..e37b90d38ee 100644 --- a/target/linux/ramips/dts/mt7628an_duzun_dm06.dts +++ b/target/linux/ramips/dts/mt7628an_duzun_dm06.dts @@ -120,6 +120,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -130,13 +140,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_elecom_wrc-1167fs.dts b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts index 4e68137f3b2..9d8b360c6a3 100644 --- a/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts +++ b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts @@ -102,23 +102,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; 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 2142eaa096e..d84290d4c12 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts @@ -118,19 +118,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 eea070a03ad..a40be00887f 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi +++ b/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi @@ -90,19 +90,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 18ff6c75afa..aebbc7fa888 100644 --- a/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts +++ b/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts @@ -101,19 +101,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts index d7d4965328a..69e22f6dd7d 100644 --- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts +++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts @@ -67,19 +67,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts index 5357996e92b..121a24b5025 100644 --- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts +++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts @@ -81,19 +81,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi index cfd4bb1dc53..034a6de6c2d 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi @@ -57,27 +57,30 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_iptime.dtsi b/target/linux/ramips/dts/mt7628an_iptime.dtsi index 22cc368b0b9..9c98c6f5ca1 100644 --- a/target/linux/ramips/dts/mt7628an_iptime.dtsi +++ b/target/linux/ramips/dts/mt7628an_iptime.dtsi @@ -43,15 +43,18 @@ #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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; }; }; @@ -62,19 +65,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi index a9ce7680d6f..643f599246c 100644 --- a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi @@ -81,19 +81,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts index 117f278f129..47542689661 100644 --- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts @@ -130,23 +130,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_400: eeprom@400 { - reg = <0x400 0x4da8>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 186f8e16edd..bfe29398a9f 100644 --- a/target/linux/ramips/dts/mt7628an_kroks.dtsi +++ b/target/linux/ramips/dts/mt7628an_kroks.dtsi @@ -65,18 +65,21 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts index 24fd31a7e20..26ff86dac2d 100644 --- a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts +++ b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts @@ -78,23 +78,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -123,7 +128,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_28 0>; nvmem-cell-names = "mac-address"; }; @@ -141,9 +146,8 @@ reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28 3>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <3>; }; }; @@ -161,8 +165,7 @@ &wmac { status = "okay"; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28 2>; 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 c693e69f2c3..1bd7f8e6daa 100644 --- a/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts @@ -108,19 +108,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; 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 9210451c16e..7f19ab69475 100644 --- a/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts @@ -38,15 +38,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts index fee64bc53fc..074011fbb9b 100644 --- a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts +++ b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts @@ -43,32 +43,38 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_d: macaddr@d { - reg = <0xd 0x6>; + macaddr_factory_d: macaddr@d { + reg = <0xd 0x6>; + }; }; }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_minew_g1-c.dts b/target/linux/ramips/dts/mt7628an_minew_g1-c.dts index e7a67b72c14..a1b40e09d01 100644 --- a/target/linux/ramips/dts/mt7628an_minew_g1-c.dts +++ b/target/linux/ramips/dts/mt7628an_minew_g1-c.dts @@ -105,19 +105,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 f2895481ed6..ebaa4326aea 100644 --- a/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts +++ b/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts @@ -68,23 +68,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -117,9 +122,8 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &esw { diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts index e9fc6d7090f..e3ee55873e9 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts +++ b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts @@ -44,7 +44,6 @@ }; &wifi5 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi index ba38839129e..98d132e891f 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi +++ b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi @@ -80,23 +80,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 0x400>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -117,7 +122,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi index 79d1fbc335e..001dc227bc0 100644 --- a/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi +++ b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi @@ -118,19 +118,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_oraybox_x1.dts b/target/linux/ramips/dts/mt7628an_oraybox_x1.dts index eb9a20aae05..9f43e46fac0 100644 --- a/target/linux/ramips/dts/mt7628an_oraybox_x1.dts +++ b/target/linux/ramips/dts/mt7628an_oraybox_x1.dts @@ -91,6 +91,16 @@ label = "bdinfo"; reg = <0xfe0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_9: macaddr@9 { + reg = <0x9 0x6>; + }; + }; }; partition@ff0000 { @@ -117,13 +127,3 @@ &wmac { status = "okay"; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_9: macaddr@9 { - reg = <0x9 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts index ecdfa13e69c..46dca444b57 100644 --- a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts +++ b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts @@ -52,19 +52,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts index b2e0a5eacaf..7c0e7551ce2 100644 --- a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts +++ b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts @@ -138,23 +138,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 bfb1bd808a1..fc111019a7d 100644 --- a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts +++ b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts @@ -84,19 +84,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 7f00db99867..dfe5192e12c 100644 --- a/target/linux/ramips/dts/mt7628an_tama_w06.dts +++ b/target/linux/ramips/dts/mt7628an_tama_w06.dts @@ -75,19 +75,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts index ea07ebe492f..83bde6b9ecf 100644 --- a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts +++ b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts @@ -144,23 +144,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 7464d1c85dc..a5c9267c8d7 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -53,15 +53,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -71,19 +76,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -93,12 +101,12 @@ &wmac { status = "okay"; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100 0>; nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index b3c62eb4883..3db4bb9b9c2 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -45,37 +45,35 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_20000: eeprom@20000 { - reg = <0x20000 0x400>; - }; + macaddr_factory_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; - eeprom_factory_28000: eeprom@28000 { - reg = <0x28000 0x200>; + eeprom_factory_20000: eeprom@20000 { + reg = <0x20000 0x400>; + }; + + eeprom_factory_28000: eeprom@28000 { + reg = <0x28000 0x200>; + }; }; }; }; }; }; -&wmac { - status = "okay"; - - nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100>; - nvmem-cell-names = "eeprom", "mac-address"; -}; - ðernet { - nvmem-cells = <&macaddr_factory_f100>; + nvmem-cells = <&macaddr_factory_f100 0>; nvmem-cell-names = "mac-address"; }; 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 2225b633338..0d09e543456 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -78,7 +78,10 @@ }; &wmac { - mac-address-increment = <(-2)>; + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 (-2)>; + nvmem-cell-names = "eeprom", "mac-address"; }; &esw { @@ -100,8 +103,7 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; 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 04eba88d198..93695660aeb 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts @@ -95,8 +95,7 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 (-1)>; 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 f628908b980..bfb39b3531c 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -83,6 +83,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; @@ -95,8 +102,7 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; 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 87927da62a4..302a9d9c6a2 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts @@ -93,8 +93,7 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts index 86cefbc2309..c3a890bc2dd 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts @@ -88,9 +88,8 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 (-1)>; 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 24236e5c7fe..8826365bebf 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi @@ -96,32 +96,40 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + compatible = "mac-base"; + reg = <0x2008 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -137,16 +145,15 @@ }; ðernet { - nvmem-cells = <&macaddr_config_2008>; + nvmem-cells = <&macaddr_config_2008 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; &pcie { @@ -157,8 +164,7 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 2>; 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 88d96bfa020..9e0bea7cd11 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts @@ -33,15 +33,20 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -51,19 +56,22 @@ */ 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -71,18 +79,16 @@ }; &wlan5g { - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <2>; }; &wmac { - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; ðernet { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts index c6ae357e19c..d37febfbc87 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts @@ -33,32 +33,40 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + compatible = "mac-base"; + reg = <0x2008 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; - eeprom_radio_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; }; @@ -66,18 +74,16 @@ }; &wlan5g { - nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 (-2)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-2)>; }; &wmac { - nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 (-1)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-1)>; }; ðernet { - nvmem-cells = <&macaddr_config_2008>; + nvmem-cells = <&macaddr_config_2008 0>; nvmem-cell-names = "mac-address"; }; 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 3828d859caf..5f35cb4c7fa 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts @@ -121,19 +121,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_20000: eeprom@20000 { + reg = <0x20000 0x400>; + }; - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts index 173b4cddcad..297e7b441d4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts @@ -76,6 +76,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts index 1dfb89d5285..d0350f9924d 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts @@ -93,11 +93,13 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_1f100: macaddr@1f100 { - reg = <0x1f100 0x6>; + macaddr_factory_1f100: macaddr@1f100 { + reg = <0x1f100 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts index 408f12aeaed..f77f1acbf2a 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts @@ -93,11 +93,13 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_1f100: macaddr@1f100 { - reg = <0x1f100 0x6>; + macaddr_factory_1f100: macaddr@1f100 { + reg = <0x1f100 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts index de9a48445ad..44a483ed6d6 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts @@ -73,3 +73,10 @@ function = "gpio"; }; }; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts index 46c18d6b2d8..01cbba20244 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts @@ -49,6 +49,13 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_f100>; + nvmem-cells = <&macaddr_factory_f100 0>; nvmem-cell-names = "mac-address"; }; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts index 8a8ba81ec30..e480395ffd4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts @@ -66,6 +66,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; 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 e5bb9f233bd..3e639668bba 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts @@ -70,19 +70,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts index 5c7f9836b6a..e1e77eba237 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts @@ -92,6 +92,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; 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 67df5c0127c..5b3bcbe63ab 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts @@ -81,19 +81,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts index 9077ec00cec..b5c3bd9ab5b 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts @@ -76,6 +76,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts index 7abeae9c07b..9fc7f97ae51 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts @@ -69,6 +69,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; 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 b49dc61a4cf..0029be21e0f 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts @@ -83,6 +83,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &pcie { status = "okay"; }; @@ -91,8 +98,7 @@ mt76@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100>; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <(-1)>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts new file mode 100644 index 00000000000..a41e87edf75 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_tplink_8m.dtsi" +#include + +/ { + compatible = "tplink,tl-wr902ac-v4", "mediatek,mt7628an-soc"; + model = "TP-Link TL-WR902AC v4"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-sw1 { + label = "sw1"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-sw2 { + label = "sw2"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-wps { + label = "wps"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: led-0 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; + + led-1 { + color = ; + function = LED_FUNCTION_USB; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + trigger-sources = <&ohci_port1>, <&ehci_port1>; + linux,default-trigger = "usbport"; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-4 { + function = LED_FUNCTION_WPS; + color = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&eeprom_factory_28000 { + /* tl-wr902ac-v4 has different eeprom size '0x4da8' for MT7613 */ + reg = <0x28000 0x4da8>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; + +&state_default { + gpio { + groups = "i2c", "i2s", "p0led_an", "p2led_an", "p4led_an", "uart1", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&wmac { + status = "okay"; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; 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 2bc6a5f8c39..77d8b9fce65 100644 --- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi index 27d6d67ed41..73ee4484b4e 100644 --- a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi @@ -40,19 +40,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 25a1c1ac8ff..1ae08ed8407 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts @@ -109,23 +109,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 ddf2723633c..76e89b77b6c 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts @@ -99,23 +99,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + 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 8bdf764fdd2..7b12dac350c 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts @@ -94,23 +94,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 58d5bf9168e..fa06c44e3fc 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts @@ -133,23 +133,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 bc9bef13287..d2b45faa25d 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts @@ -98,23 +98,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 7abab0044d1..a9b98683042 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts @@ -128,23 +128,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 5d37b124486..47ed0431d2f 100644 --- a/target/linux/ramips/dts/mt7628an_widora_neo.dtsi +++ b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi @@ -74,19 +74,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts index 04b6c56bef8..3bdb06cec92 100644 --- a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts +++ b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts @@ -117,19 +117,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi index c3fcaabe2fc..207fea28e97 100644 --- a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi +++ b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi @@ -48,19 +48,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 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 51737a965d1..7655da40db9 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi @@ -47,31 +47,36 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 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 809a0af30af..49ca637cb9e 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 @@ -64,9 +64,8 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &esw { 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 7b40cdb6af3..f40717267c7 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 @@ -64,9 +64,8 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &esw { diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts index bc7083fb1f7..2adb6ba8e36 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts @@ -114,19 +114,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 c957388228e..66297232e3a 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts @@ -106,19 +106,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 fd233cd30bb..64f3d6d83f3 100644 --- a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts +++ b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts @@ -86,19 +86,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + 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 d173f536972..95eb9cfd9e6 100644 --- a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -121,23 +121,26 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts index 4c9014b7d86..dc61cd9da50 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts @@ -31,19 +31,22 @@ }; factory: partition@30000 { - compatible = "nvmem-cells"; - label = "factory"; reg = <0x30000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; + label = "factory"; read-only; - eeprom_factory_2000: eeprom@2000 { - reg = <0x2000 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; - macaddr_factory_2004: macaddr@2004 { - reg = <0x2004 0x6>; + macaddr_factory_2004: macaddr@2004 { + reg = <0x2004 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts index 95df28163ec..f41a9b8561e 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts @@ -36,19 +36,22 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; - label = "factory"; reg = <0x40000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; + label = "factory"; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts index e7c5f276fa3..0275a84bde0 100644 --- a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts +++ b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts @@ -40,19 +40,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts index 8ab53323d49..1c2b9a18da7 100644 --- a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts +++ b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 e02296cd5ae..37288e5fc40 100644 --- a/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts +++ b/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts @@ -40,19 +40,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts index 4665878d4b2..bc01bf23ef6 100644 --- a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts +++ b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts @@ -40,19 +40,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 ade64b3f46c..105a3c49d48 100644 --- a/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts +++ b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts @@ -32,19 +32,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; - macaddr_factory_2004: macaddr@2004 { - reg = <0x2004 0x6>; + macaddr_factory_2004: macaddr@2004 { + reg = <0x2004 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts b/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts index 5d518df2528..3f4142f5089 100644 --- a/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts +++ b/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts @@ -37,15 +37,18 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; - label = "factory"; reg = <0x00040000 0x00010000>; - #address-cells = <1>; - #size-cells = <1>; + label = "factory"; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3050_8devices_carambola.dts b/target/linux/ramips/dts/rt3050_8devices_carambola.dts index 3aa148285a3..8cc586207f0 100644 --- a/target/linux/ramips/dts/rt3050_8devices_carambola.dts +++ b/target/linux/ramips/dts/rt3050_8devices_carambola.dts @@ -35,19 +35,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 f7ee55cec8f..f7b64c63261 100644 --- a/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi @@ -63,19 +63,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts index 913c29519a5..1d66023ceba 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts @@ -55,19 +55,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; + 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 76ca0bf83b9..41ed37d808a 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts @@ -25,19 +25,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts b/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts index ecce4335ff0..9b696b34313 100644 --- a/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts +++ b/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts @@ -35,19 +35,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 5817eae8174..e112a1b33db 100644 --- a/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts +++ b/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts @@ -51,19 +51,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_devconf_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_devconf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 1154d205b76..a452a44202f 100644 --- a/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts +++ b/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_devconf_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_devconf_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3050_asus_wl-330n.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n.dts index 4f137115ec9..938f5d440c8 100644 --- a/target/linux/ramips/dts/rt3050_asus_wl-330n.dts +++ b/target/linux/ramips/dts/rt3050_asus_wl-330n.dts @@ -72,19 +72,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts index 27fe5ba23f1..4f8b7e73ea4 100644 --- a/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts +++ b/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts @@ -77,19 +77,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 508f9080189..e3a26bd4cf6 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 183dc17868d..a05122b6040 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts @@ -32,19 +32,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; }; 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 bc3d5646a88..73e65128e59 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts @@ -32,19 +32,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; }; 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 4fe519780dc..0d81f7e0966 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts @@ -33,15 +33,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; }; }; 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 7b9b3283883..3a5624d125e 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 e6682cf9dc5..62686b5489b 100644 --- a/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts +++ b/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts @@ -39,19 +39,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 5eee298d8e6..c0fdb9995de 100644 --- a/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts +++ b/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts @@ -39,19 +39,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 4333ed0a224..5e217aa3625 100644 --- a/target/linux/ramips/dts/rt3050_huawei_d105.dts +++ b/target/linux/ramips/dts/rt3050_huawei_d105.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 384e1467c23..61fac83b146 100644 --- a/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts +++ b/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts @@ -68,19 +68,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3050_netcore_nw718.dts b/target/linux/ramips/dts/rt3050_netcore_nw718.dts index 810fb1a2580..beceb3f35d6 100644 --- a/target/linux/ramips/dts/rt3050_netcore_nw718.dts +++ b/target/linux/ramips/dts/rt3050_netcore_nw718.dts @@ -79,19 +79,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 23d1546c819..a241e91bafb 100644 --- a/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts +++ b/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 c8d51b3f02a..95faff03b44 100644 --- a/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts +++ b/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts @@ -70,19 +70,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 762043f423b..d9a3f5ac6b4 100644 --- a/target/linux/ramips/dts/rt3050_tenda_w150m.dts +++ b/target/linux/ramips/dts/rt3050_tenda_w150m.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 ed1c05a6c97..2accb51c3f9 100644 --- a/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts +++ b/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_accton_wr6202.dts b/target/linux/ramips/dts/rt3052_accton_wr6202.dts index 98b0e831aac..a62f7757c7f 100644 --- a/target/linux/ramips/dts/rt3052_accton_wr6202.dts +++ b/target/linux/ramips/dts/rt3052_accton_wr6202.dts @@ -66,19 +66,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 33f5474f708..0b9270461bd 100644 --- a/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts +++ b/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts @@ -42,19 +42,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 0f15ac4ea69..94baf5fb89a 100644 --- a/target/linux/ramips/dts/rt3052_argus_atp-52b.dts +++ b/target/linux/ramips/dts/rt3052_argus_atp-52b.dts @@ -37,18 +37,21 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 9550029cca2..49965d4e5e8 100644 --- a/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts +++ b/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts @@ -61,15 +61,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts b/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts index 97a8dda2419..d60dabb5ea6 100644 --- a/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts +++ b/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 bee541885a8..456bc204157 100644 --- a/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts +++ b/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 57d070b833d..4a23d65628c 100644 --- a/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts +++ b/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 55eba3bc0a5..13b16921b99 100644 --- a/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts +++ b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts @@ -26,19 +26,22 @@ #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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_uboot_40000: eeprom@40000 { + reg = <0x40000 0x200>; + }; - macaddr_uboot_40004: macaddr@40004 { - reg = <0x40004 0x6>; + 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 0ff041da333..286fe0a566b 100644 --- a/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts +++ b/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts @@ -37,19 +37,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts b/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts index 9902e0b5b57..75cc1385cdd 100644 --- a/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts +++ b/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts @@ -36,19 +36,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_devdata_2e: macaddr@2e { - reg = <0x2e 0x6>; + 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 889a276e2b3..2c3b759c041 100644 --- a/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts +++ b/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts index d77284e1639..9a256e65dc8 100644 --- a/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts +++ b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 27506604a54..f7420e20920 100644 --- a/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts +++ b/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts @@ -31,19 +31,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 2018062143f..dc00110f1b7 100644 --- a/target/linux/ramips/dts/rt3052_huawei_hg255d.dts +++ b/target/linux/ramips/dts/rt3052_huawei_hg255d.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 fff1f2b0b58..6fb85b23740 100644 --- a/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts +++ b/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts b/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts index 8b92d79672f..6096019b103 100644 --- a/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts +++ b/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts index ab058f2fea4..e1d1197d709 100644 --- a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts +++ b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts @@ -38,15 +38,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts b/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts index 5842515e7a5..856dc85679d 100644 --- a/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts +++ b/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts @@ -92,19 +92,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_nexaira_bc2.dts b/target/linux/ramips/dts/rt3052_nexaira_bc2.dts index 21e70d394e3..b95e919591e 100644 --- a/target/linux/ramips/dts/rt3052_nexaira_bc2.dts +++ b/target/linux/ramips/dts/rt3052_nexaira_bc2.dts @@ -31,19 +31,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 caa374ceb1e..7dcecc078bd 100644 --- a/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts +++ b/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts @@ -63,19 +63,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 d88892f2faf..5461ee2f956 100644 --- a/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts +++ b/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts @@ -42,19 +42,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 1beed599e17..c3d7993ae66 100644 --- a/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts +++ b/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts b/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts index 815fd9e4ef1..5d445298986 100644 --- a/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts +++ b/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts @@ -35,19 +35,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_poray_ip2202.dts b/target/linux/ramips/dts/rt3052_poray_ip2202.dts index 2f340c4c310..0361004d84e 100644 --- a/target/linux/ramips/dts/rt3052_poray_ip2202.dts +++ b/target/linux/ramips/dts/rt3052_poray_ip2202.dts @@ -41,6 +41,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -96,13 +106,3 @@ &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 1b30dc9dd0a..495f187a37e 100644 --- a/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts +++ b/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts @@ -38,15 +38,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts b/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts index 6f08cecacb0..1b5ba03feb8 100644 --- a/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts +++ b/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts @@ -38,15 +38,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts index 6abaa8e887a..82c3783e1f6 100644 --- a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts +++ b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 31214361f60..8a4120175e1 100644 --- a/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts +++ b/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 577afd3a5c2..304d3bef1c5 100644 --- a/target/linux/ramips/dts/rt3052_tenda_3g300m.dts +++ b/target/linux/ramips/dts/rt3052_tenda_3g300m.dts @@ -94,19 +94,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 ae998a27222..a4d11072ea5 100644 --- a/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts +++ b/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; 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 ecc17fad407..6002342fc9e 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts @@ -28,15 +28,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; 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 eb04e4662c3..16495ddc885 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts @@ -28,15 +28,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts index 3d2d8686e62..ec5e4af5e28 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 d3234bd9a33..8104bf60538 100644 --- a/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts +++ b/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4004: macaddr@4004 { - reg = <0x4004 0x6>; + 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 0dffdddeb68..050ce21a753 100644 --- a/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts +++ b/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4004: macaddr@4004 { - reg = <0x4004 0x6>; + 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 92d4304668e..2c16736c962 100644 --- a/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts +++ b/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 65446842bb1..18dcf6b6760 100644 --- a/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts +++ b/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts @@ -38,19 +38,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3352_allnet_all5002.dts b/target/linux/ramips/dts/rt3352_allnet_all5002.dts index a1133464b37..6483e935dde 100644 --- a/target/linux/ramips/dts/rt3352_allnet_all5002.dts +++ b/target/linux/ramips/dts/rt3352_allnet_all5002.dts @@ -69,19 +69,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 a8f1f0cd71b..dc2c49cd0b8 100644 --- a/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts +++ b/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts @@ -89,19 +89,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; 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 7d78ed333df..de020706dfd 100644 --- a/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts +++ b/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts @@ -66,19 +66,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 9108fc9b8cb..01455b0d5af 100644 --- a/target/linux/ramips/dts/rt3352_zte_mf283plus.dts +++ b/target/linux/ramips/dts/rt3352_zte_mf283plus.dts @@ -85,19 +85,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 322609b9582..0ac89bce43b 100644 --- a/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts +++ b/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts @@ -83,19 +83,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 1188f147b9c..7837a4ca3da 100644 --- a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts +++ b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts @@ -37,23 +37,26 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; - label = "factory"; reg = <0x00040000 0x00010000>; - #address-cells = <1>; - #size-cells = <1>; + label = "factory"; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + 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_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 8aad9974b50..87d52d679c1 100644 --- a/target/linux/ramips/dts/rt3662_dlink_dir-645.dts +++ b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts @@ -94,19 +94,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 a891ab657ea..60ec3dacf50 100644 --- a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts +++ b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts @@ -75,32 +75,38 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x00040000 0x00010000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; devdata: partition@50000 { - compatible = "nvmem-cells"; label = "devdata"; reg = <0x00050000 0x00020000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - macaddr_devdata_d: macaddr@d { - reg = <0xd 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #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 e785f110433..6770e4cc9a3 100644 --- a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts +++ b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts @@ -89,19 +89,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts index b87a573313b..1da233ba78f 100644 --- a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts +++ b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts @@ -31,15 +31,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3662_omnima_hpm.dts b/target/linux/ramips/dts/rt3662_omnima_hpm.dts index 644cc557b9c..e06e6986ec2 100644 --- a/target/linux/ramips/dts/rt3662_omnima_hpm.dts +++ b/target/linux/ramips/dts/rt3662_omnima_hpm.dts @@ -110,19 +110,22 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; - label = "factory"; reg = <0x00040000 0x00010000>; - #address-cells = <1>; - #size-cells = <1>; + label = "factory"; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 e4c31ae6b1a..b022b5c2be7 100644 --- a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts +++ b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts @@ -37,19 +37,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_factory_2000: eeprom@2000 { - reg = <0x2000 0x200>; + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi index 22b6ee40a94..4a64d8a7fe2 100644 --- a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi +++ b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi @@ -42,19 +42,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts index cb54cf0f8f2..17f3c10bc90 100644 --- a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts +++ b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts @@ -64,9 +64,8 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_factory_8004>; + nvmem-cells = <&macaddr_factory_8004 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; port@0 { phy-handle = <&phy0>; @@ -122,23 +121,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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_8000: eeprom@8000 { - reg = <0x8000 0x200>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts index 1b9d6c06551..f23dc1cb039 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts @@ -37,19 +37,24 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; - label = "factory"; reg = <0x00040000 0x00010000>; - #address-cells = <1>; - #size-cells = <1>; + label = "factory"; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -106,7 +111,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; port@0 { @@ -126,7 +131,6 @@ &wmac { ralink,5ghz = <0>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 1>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <1>; }; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts index daf92b90f01..ee2ca91af7f 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts @@ -37,19 +37,24 @@ }; factory: partition@40000 { - compatible = "nvmem-cells"; - label = "factory"; reg = <0x00040000 0x00010000>; - #address-cells = <1>; - #size-cells = <1>; + label = "factory"; read-only; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x200>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -106,7 +111,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; port@0 { @@ -152,7 +157,6 @@ &wmac { ralink,5ghz = <0>; - nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 3>; nvmem-cell-names = "eeprom", "mac-address"; - mac-address-increment = <3>; }; diff --git a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi index e64437cd943..26db035c8e6 100644 --- a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi +++ b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi @@ -67,19 +67,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_devconf_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_devconf_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_airlive_air3gii.dts b/target/linux/ramips/dts/rt5350_airlive_air3gii.dts index fd4524f0fc9..e46b3365959 100644 --- a/target/linux/ramips/dts/rt5350_airlive_air3gii.dts +++ b/target/linux/ramips/dts/rt5350_airlive_air3gii.dts @@ -61,19 +61,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_allnet_all5003.dts b/target/linux/ramips/dts/rt5350_allnet_all5003.dts index 2db37120e9b..496f1958013 100644 --- a/target/linux/ramips/dts/rt5350_allnet_all5003.dts +++ b/target/linux/ramips/dts/rt5350_allnet_all5003.dts @@ -69,19 +69,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi index 1bd7310d5a0..b9905f62f59 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi @@ -69,19 +69,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + 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 1a218e4f6cb..b1a897a8595 100644 --- a/target/linux/ramips/dts/rt5350_belkin_f7c027.dts +++ b/target/linux/ramips/dts/rt5350_belkin_f7c027.dts @@ -88,15 +88,18 @@ }; 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>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; }; }; 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 1b1b02bb463..1e561136fae 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts @@ -72,19 +72,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 ff8cb821cca..13100edf046 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts @@ -72,19 +72,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 8a1b4fe4b0f..577b3a0a3e7 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts @@ -94,19 +94,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 bf3d6bb31b8..7467900e426 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts @@ -66,19 +66,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; }; }; 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 acf03bb732b..3475f4ccf70 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts @@ -103,18 +103,21 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_e07e: macaddr@e07e { + reg = <0xe07e 0x6>; + }; - eeprom_config_e08a: eeprom@e08a { - reg = <0xe08a 0x200>; + eeprom_config_e08a: eeprom@e08a { + reg = <0xe08a 0x200>; + }; }; }; }; diff --git a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts index a83f5cf89ba..9d7792867a6 100644 --- a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts +++ b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts @@ -31,19 +31,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts index f29c307c829..9a9580a3fba 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts @@ -83,19 +83,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts index 129dc1ceefd..5a06ef46fb3 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts @@ -83,19 +83,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts index c4f785d0308..3cc425d5af9 100644 --- a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts +++ b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts @@ -76,19 +76,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts index ce3f20fca97..70acc3fc439 100644 --- a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts +++ b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts @@ -73,19 +73,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts index b2368e4dcd3..b1a28815f6a 100644 --- a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts +++ b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts @@ -76,19 +76,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi index 99ab0a939c1..cc55507a95f 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi @@ -44,19 +44,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi index 198934f5b4a..ce7751540bb 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi +++ b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi @@ -134,19 +134,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi index f3c2aedc96e..59cbbad2313 100644 --- a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi @@ -34,19 +34,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 79eb6c3f4a0..ca98ab3599f 100644 --- a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts +++ b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts @@ -86,19 +86,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts b/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts index 0ff8cd7e1ac..db349de5e10 100644 --- a/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts +++ b/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts @@ -61,19 +61,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m3.dts b/target/linux/ramips/dts/rt5350_poray_m3.dts index 24428ee96c7..505fba650e6 100644 --- a/target/linux/ramips/dts/rt5350_poray_m3.dts +++ b/target/linux/ramips/dts/rt5350_poray_m3.dts @@ -68,19 +68,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m4.dtsi b/target/linux/ramips/dts/rt5350_poray_m4.dtsi index 9891209e452..fd358ff8efd 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4.dtsi +++ b/target/linux/ramips/dts/rt5350_poray_m4.dtsi @@ -60,19 +60,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_poray_x5.dts b/target/linux/ramips/dts/rt5350_poray_x5.dts index 04387a63cad..d441fd3144a 100644 --- a/target/linux/ramips/dts/rt5350_poray_x5.dts +++ b/target/linux/ramips/dts/rt5350_poray_x5.dts @@ -100,19 +100,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_poray_x8.dts b/target/linux/ramips/dts/rt5350_poray_x8.dts index d8fcb67cb80..f02eac27b12 100644 --- a/target/linux/ramips/dts/rt5350_poray_x8.dts +++ b/target/linux/ramips/dts/rt5350_poray_x8.dts @@ -61,19 +61,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts index cf9b1338b9b..93dc25007e8 100644 --- a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts +++ b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts @@ -79,19 +79,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts index 6d7d92cbc71..2810b7a7010 100644 --- a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts +++ b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts @@ -82,19 +82,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts index 8f71cc5bf10..64fd8c6b15e 100644 --- a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts +++ b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts @@ -84,19 +84,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi index 788c86f870b..f3ef0edfe48 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi +++ b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi @@ -182,19 +182,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + 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 9f0cecdb9b8..fd3af22eb33 100644 --- a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts +++ b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts @@ -31,19 +31,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts index 8611c50b14e..192c403a872 100644 --- a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts +++ b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts @@ -100,19 +100,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts b/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts index 69b725356e3..00fbb5e927a 100644 --- a/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts +++ b/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts @@ -66,19 +66,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; 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 1fd52ba79f6..9e1e47c099b 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts @@ -89,19 +89,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; 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 2c8b97f8a6a..6effb4f075b 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts @@ -73,19 +73,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts index 38e2315edb4..8b1e0584b6f 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts @@ -75,19 +75,22 @@ }; 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>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 265e9fb5e0c..fdc15aa1efc 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -31,7 +31,7 @@ KERNEL_DTB = kernel-bin | append-dtb | lzma define Build/jcg-header $(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \ - $(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \ + $(if $(JCG_MAXSIZE), -m $$(($(call exp_units,$(JCG_MAXSIZE)))),) \ -u $@ -o $@.new mv $@.new $@ endef @@ -142,7 +142,7 @@ endef define Build/trx $(STAGING_DIR_HOST)/bin/trx $(1) \ -o $@ \ - -m $$(($(subst k, * 1024,$(IMAGE_SIZE)))) \ + -m $$(($(call exp_units,$(IMAGE_SIZE)))) \ -f $(IMAGE_KERNEL) \ -a 4 -f $(IMAGE_ROOTFS) endef diff --git a/target/linux/ramips/image/common-sercomm.mk b/target/linux/ramips/image/common-sercomm.mk index 4060da09235..09870109112 100644 --- a/target/linux/ramips/image/common-sercomm.mk +++ b/target/linux/ramips/image/common-sercomm.mk @@ -23,6 +23,35 @@ define Build/sercomm-crypto rm -f $@.enc $@.key endef +define Build/sercomm-factory-cpj + dd bs=$$((0x1fff00)) count=1 if=$@ of=$@.kernel conv=notrunc \ + 2>/dev/null + dd bs=$$((0x1fff00)) skip=1 if=$@ of=$@.rootfs1 conv=notrunc \ + 2>/dev/null + cp $@.rootfs1 $@.rootfs2 + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@.kernel \ + --kernel-offset $(SERCOMM_KERNEL_OFFSET) \ + --rootfs-image $@.rootfs1 \ + --rootfs-offset $(SERCOMM_ROOTFS_OFFSET) \ + --output-header $@.header1 + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@.kernel \ + --kernel-offset $(SERCOMM_KERNEL2_OFFSET) \ + --rootfs-image $@.rootfs2 \ + --rootfs-offset $(SERCOMM_ROOTFS2_OFFSET) \ + --output-header $@.header2 + cat $@.header1 $@.kernel > $@.kernel1 + cat $@.header2 $@.kernel > $@.kernel2 + rm $@.header1 $@.header2 $@.kernel + $(call Build/sercomm-part-tag-common,kernel $@.kernel1) + $(call Build/sercomm-part-tag-common,kernel2 $@.kernel2) + $(call Build/sercomm-part-tag-common,rootfs $@.rootfs1) + $(call Build/sercomm-part-tag-common,rootfs2 $@.rootfs2) + cat $@.kernel2 $@.rootfs2 $@.kernel1 $@.rootfs1 > $@ + rm $@.kernel1 $@.rootfs1 $@.kernel2 $@.rootfs2 +endef + define Build/sercomm-factory-cqr $(TOPDIR)/scripts/sercomm-pid.py \ --hw-version $(SERCOMM_HWVER) \ @@ -38,10 +67,6 @@ define Build/sercomm-factory-cqr mv $@.fhdr $@ endef -define Build/sercomm-fix-buc-pid - printf 1 | dd seek=$$((0x13)) of=$@ bs=1 conv=notrunc 2>/dev/null -endef - define Build/sercomm-kernel $(TOPDIR)/scripts/sercomm-kernel-header.py \ --kernel-image $@ \ @@ -104,6 +129,10 @@ define Build/sercomm-payload rm $@.pid endef +define Build/sercomm-pid-setbit + printf 1 | dd seek=$$(($(1))) of=$@ bs=1 conv=notrunc 2>/dev/null +endef + define Build/sercomm-prepend-tagged-kernel $(CP) $(IMAGE_KERNEL) $(IMAGE_KERNEL).tagged $(call Build/sercomm-part-tag-common,$(word 1,$(1)) \ @@ -117,12 +146,46 @@ define Build/sercomm-reset-slot1-chksum dd of=$@ seek=$$((0x118)) bs=1 conv=notrunc 2>/dev/null endef +define Build/sercomm-sysupgrade-cpj + dd bs=$$((0x1fff00)) count=1 if=$@ of=$@.kernel conv=notrunc \ + 2>/dev/null + dd bs=$$((0x1fff00)) skip=1 if=$@ of=$@.rootfs conv=notrunc \ + 2>/dev/null + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@.kernel \ + --kernel-offset $(SERCOMM_KERNEL_OFFSET) \ + --rootfs-image $@.rootfs \ + --rootfs-offset $(SERCOMM_ROOTFS_OFFSET) \ + --output-header $@.header + cat $@.header $@.kernel $@.rootfs > $@ + rm $@.header $@.kernel $@.rootfs +endef + define Device/sercomm $(Device/nand) LOADER_TYPE := bin IMAGES += factory.img endef +define Device/sercomm_cpj + SOC := mt7620a + DEVICE_VENDOR := Rostelecom + DEVICE_ALT0_VENDOR := Sercomm + IMAGE_SIZE := 7743k + SERCOMM_HWID := CPJ + SERCOMM_HWVER := 10000 + SERCOMM_SWVER := 1001 + SERCOMM_KERNEL_OFFSET := 0x70100 + SERCOMM_ROOTFS_OFFSET := 0x270000 + SERCOMM_KERNEL2_OFFSET := 0x800100 + SERCOMM_ROOTFS2_OFFSET := 0xa00000 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + sercomm-sysupgrade-cpj | pad-rootfs | check-size | \ + append-metadata + ARTIFACTS := initramfs-factory.img + DEVICE_PACKAGES := kmod-mt76x2 +endef + define Device/sercomm_cxx_dxx $(Device/sercomm) KERNEL_SIZE := 6144k diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 0b245a080ea..ce30b15f0b3 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -2,6 +2,7 @@ # MT7620A Profiles # +include ./common-sercomm.mk include ./common-tp-link.mk DEVICE_VARS += DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE DLINK_IMAGE_OFFSET @@ -1113,6 +1114,27 @@ define Device/ravpower_rp-wd03 endef TARGET_DEVICES += ravpower_rp-wd03 +define Device/rostelecom_rt-fl-1 + $(Device/sercomm_cpj) + DEVICE_MODEL := RT-FL-1 + DEVICE_ALT0_MODEL := RT-FL-1 + ARTIFACT/initramfs-factory.img := \ + append-image-stage initramfs-kernel.bin | check-size | \ + sercomm-factory-cpj | gzip | sercomm-payload | \ + sercomm-pid-setbit 0x11 | sercomm-crypto +endef +TARGET_DEVICES += rostelecom_rt-fl-1 + +define Device/rostelecom_s1010 + $(Device/sercomm_cpj) + DEVICE_MODEL := S1010 + DEVICE_ALT0_MODEL := S1010.RT + ARTIFACT/initramfs-factory.img := \ + append-image-stage initramfs-kernel.bin | check-size | \ + sercomm-factory-cpj | gzip | sercomm-payload | sercomm-crypto +endef +TARGET_DEVICES += rostelecom_s1010 + define Device/sanlinking_d240 SOC := mt7620a IMAGE_SIZE := 16064k diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 89a80228d8e..7d1a0a1e19d 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -616,6 +616,18 @@ define Device/cudy_wr1300-v2 endef TARGET_DEVICES += cudy_wr1300-v2 +define Device/cudy_wr1300-v3 + $(Device/dsa-migration) + IMAGE_SIZE := 15872k + DEVICE_VENDOR := Cudy + DEVICE_MODEL := WR1300 + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + -uboot-envtools + SUPPORTED_DEVICES += cudy,wr1300 R30 +endef +TARGET_DEVICES += cudy_wr1300-v3 + define Device/cudy_wr2100 $(Device/dsa-migration) DEVICE_VENDOR := Cudy @@ -2088,6 +2100,20 @@ define Device/renkforce_ws-wn530hp3-a endef TARGET_DEVICES += renkforce_ws-wn530hp3-a +define Device/rostelecom_rt-fe-1a + $(Device/sercomm_dxx) + IMAGE_SIZE := 24576k + SERCOMM_HWID := CX4 + SERCOMM_HWVER := 11300 + SERCOMM_SWVER := 2010 + DEVICE_VENDOR := Rostelecom + DEVICE_MODEL := RT-FE-1A + DEVICE_ALT0_VENDOR := Sercomm + DEVICE_ALT0_MODEL := RT-FE-1A + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware +endef +TARGET_DEVICES += rostelecom_rt-fe-1a + define Device/rostelecom_rt-sf-1 $(Device/sercomm_dxx) IMAGE_SIZE := 32768k @@ -2388,6 +2414,20 @@ define Device/tplink_er605-v2 endef TARGET_DEVICES += tplink_er605-v2 +define Device/tplink_ex220-v1 + $(Device/dsa-migration) + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := EX220 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools + TPLINK_BOARD_ID := EX220-V1 + KERNEL_LOADADDR := 0x82000000 + KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + IMAGE_SIZE := 15744k +endef +TARGET_DEVICES += tplink_ex220-v1 + define Device/tplink_mr600-v2-eu $(Device/dsa-migration) $(Device/tplink-v2) @@ -2674,7 +2714,7 @@ define Device/wifire_s1500-nbn IMAGE_SIZE := 51200k IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \ sercomm-reset-slot1-chksum | append-ubi | check-size | \ - sercomm-factory-cqr | sercomm-fix-buc-pid | sercomm-mkhash | \ + sercomm-factory-cqr | sercomm-pid-setbit 0x13 | sercomm-mkhash | \ sercomm-crypto SERCOMM_HWID := BUC SERCOMM_HWVER := 10000 diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index b325829cf08..e630b1dcd9b 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -859,6 +859,22 @@ define Device/tplink_tl-wr902ac-v3 endef TARGET_DEVICES += tplink_tl-wr902ac-v3 +define Device/tplink_tl-wr902ac-v4 + $(Device/tplink-v2) + IMAGE_SIZE := 7808k + DEVICE_MODEL := TL-WR902AC + DEVICE_VARIANT := v4 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x000dc88f + TPLINK_HWREV := 0x89 + TPLINK_HWREVADD := 0x1 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb2 kmod-usb-ohci \ + kmod-usb-ledtrig-usbport + IMAGES := sysupgrade.bin tftp-recovery.bin + IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) +endef +TARGET_DEVICES += tplink_tl-wr902ac-v4 + define Device/unielec_u7628-01-16m IMAGE_SIZE := 16064k DEVICE_VENDOR := UniElec diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 1c9e58c77d5..bd1d6f96834 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -212,6 +212,14 @@ zbtlink,zbt-we826-e) ravpower,rp-wd03) ucidef_set_led_netdev "internet" "internet" "green:wifi" "eth0" ;; +rostelecom,rt-fl-1|\ +rostelecom,s1010) + ucidef_set_led_switch "lan-1" "lan-1" "green:lan-1" "switch0" "0x02" + ucidef_set_led_switch "lan-2" "lan-2" "green:lan-2" "switch0" "0x04" + ucidef_set_led_switch "lan-3" "lan-3" "green:lan-3" "switch0" "0x08" + ucidef_set_led_switch "lan-4" "lan-4" "green:lan-4" "switch0" "0x10" + ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01" + ;; tplink,archer-c2-v1) ucidef_set_led_switch "lan" "lan" "green:lan" "switch1" "0x1e" ucidef_set_led_switch "wan" "wan" "green:wan" "switch1" "0x01" diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 3edcda2e9d5..9f70e6288cc 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -120,6 +120,8 @@ ramips_setup_interfaces() netgear,jwnr2010-v5|\ phicomm,k2-v22.4|\ phicomm,k2-v22.5|\ + rostelecom,rt-fl-1|\ + rostelecom,s1010|\ trendnet,tew-810dr|\ zbtlink,zbt-we2026) ucidef_add_switch "switch0" \ @@ -393,6 +395,11 @@ ramips_setup_macs() linksys,e1700) wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR) ;; + rostelecom,rt-fl-1|\ + rostelecom,s1010) + label_mac=$(mtd_get_mac_binary "SC Nvram(permanent data)" 0x0) + wan_mac=$(macaddr_add "$label_mac" 10) + ;; snr,cpe-w4n-mt) lan_mac=$(mtd_get_mac_binary Factory 0x28) wan_mac=$(mtd_get_mac_binary Factory 0x2e) @@ -413,7 +420,7 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) ;; zyxel,keenetic-lite-iii-a) - lan_mac=$(mtd_get_mac_binary RF-EEPROM 0x4) + lan_mac=$(mtd_get_mac_binary RF-EEPROM 0x4) wan_mac=$(mtd_get_mac_binary RF-EEPROM 0x28) label_mac=$wan_mac ;; diff --git a/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh index 9f71dc918e5..6dd7fc7cef1 100755 --- a/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh @@ -30,6 +30,14 @@ platform_do_upgrade() { } default_do_upgrade "$1" ;; + rostelecom,rt-fl-1|\ + rostelecom,s1010) + idx="$(find_mtd_index ftd_and_bootflag)" + [ -n "$idx" ] && \ + printf 0 | dd bs=1 seek=$((0x18007)) count=1 \ + of=/dev/mtdblock$idx + default_do_upgrade "$1" + ;; *) default_do_upgrade "$1" ;; diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index eff47832fdb..01f39d94d1d 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -193,7 +193,8 @@ snr,snr-cpe-me1) tplink,archer-a6-v3|\ tplink,archer-ax23-v1|\ tplink,archer-c6-v3|\ -tplink,archer-c6u-v1) +tplink,archer-c6u-v1|\ +tplink,ex220-v1) ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" ;; diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index b6cf9052df1..8a977e68aee 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -180,6 +180,10 @@ case "$board" in hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)" macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress" ;; + tplink,ex220-v1) + hw_mac_addr="$(mtd_get_mac_binary rom_file 0xf100)" + [ "$PHYNBR" = "1" ] && macaddr_add "$hw_mac_addr" 2 > "/sys${DEVPATH}/macaddress" + ;; yuncore,ax820) [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index f61961fee75..d3614bde8b5 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -105,6 +105,7 @@ platform_do_upgrade() { netgear,wax202|\ netis,wf2881|\ raisecom,msg1500-x-00|\ + rostelecom,rt-fe-1a|\ rostelecom,rt-sf-1|\ sercomm,na502|\ sercomm,na502s|\ diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index 0b109feb6c5..c4301737b28 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -124,6 +124,9 @@ tplink,tl-wr902ac-v3) ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x10" ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" ;; +tplink,tl-wr902ac-v4) + ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" + ;; unielec,u7628-01-16m) ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x2" ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x4" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 2ec41fe2549..fe3ac9193ff 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -29,6 +29,7 @@ ramips_setup_interfaces() tplink,re305-v3|\ tplink,tl-wr802n-v4|\ tplink,tl-wa801nd-v5|\ + tplink,tl-wr902ac-v4|\ widora,neo-16m|\ widora,neo-32m) ucidef_add_switch "switch0" diff --git a/target/linux/ramips/mt76x8/config-5.15 b/target/linux/ramips/mt76x8/config-5.15 index bd1d3688b82..6d6759a7c58 100644 --- a/target/linux/ramips/mt76x8/config-5.15 +++ b/target/linux/ramips/mt76x8/config-5.15 @@ -162,6 +162,7 @@ CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RESET_CONTROLLER=y +CONFIG_RTC_CLASS=y CONFIG_SERIAL_8250_NR_UARTS=3 CONFIG_SERIAL_8250_RUNTIME_UARTS=3 CONFIG_SERIAL_MCTRL_GPIO=y diff --git a/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch b/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch index b8461b0030c..437c7611321 100644 --- a/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch +++ b/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch @@ -95,7 +95,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c phydev->mii_ts->link_state(phydev->mii_ts, phydev); --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -1369,7 +1369,8 @@ void phylink_destroy(struct phylink *pl) +@@ -1370,7 +1370,8 @@ void phylink_destroy(struct phylink *pl) } EXPORT_SYMBOL_GPL(phylink_destroy); diff --git a/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi b/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi index e727a9405ad..0706c55524b 100644 --- a/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi +++ b/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi @@ -114,15 +114,18 @@ reg = <0x1b00000 0x400000>; }; partition@1f00000 { - compatible = "nvmem-cells"; label = "para"; reg = <0x1f00000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - factory_macaddr: macaddr@fdff4 { - reg = <0xfdff4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; }; }; }; diff --git a/target/linux/realtek/dts-5.15/rtl8382_tplink_t1600g-28ts-v3.dts b/target/linux/realtek/dts-5.15/rtl8382_tplink_t1600g-28ts-v3.dts index 3b3b7ad2f84..6e9f7baed06 100644 --- a/target/linux/realtek/dts-5.15/rtl8382_tplink_t1600g-28ts-v3.dts +++ b/target/linux/realtek/dts-5.15/rtl8382_tplink_t1600g-28ts-v3.dts @@ -72,15 +72,18 @@ reg = <0x1b00000 0x400000>; }; partition@1f00000 { - compatible = "nvmem-cells"; label = "para"; reg = <0x1f00000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - factory_macaddr: macaddr@fdff4 { - reg = <0xfdff4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; }; }; }; diff --git a/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts b/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts index d2221c1d2f0..5ca342f970d 100644 --- a/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts +++ b/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts @@ -262,15 +262,18 @@ reg = <0x1b00000 0x400000>; }; partition@1f00000 { - compatible = "nvmem-cells"; label = "para"; reg = <0x1f00000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - factory_macaddr: macaddr@fdff4 { - reg = <0xfdff4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; }; }; }; diff --git a/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch b/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch index 183c9dda2fd..6b24df46748 100644 --- a/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch +++ b/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch @@ -21,7 +21,7 @@ Submitted-by: John Crispin --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -1990,6 +1990,11 @@ int phylink_ethtool_ksettings_set(struct +@@ -1991,6 +1991,11 @@ int phylink_ethtool_ksettings_set(struct * the presence of a PHY, this should not be changed as that * should be determined from the media side advertisement. */ @@ -33,7 +33,7 @@ Submitted-by: John Crispin return phy_ethtool_ksettings_set(pl->phydev, kset); } -@@ -2293,8 +2298,11 @@ int phylink_ethtool_get_eee(struct phyli +@@ -2294,8 +2299,11 @@ int phylink_ethtool_get_eee(struct phyli ASSERT_RTNL(); @@ -46,7 +46,7 @@ Submitted-by: John Crispin return ret; } -@@ -2311,8 +2319,11 @@ int phylink_ethtool_set_eee(struct phyli +@@ -2312,8 +2320,11 @@ int phylink_ethtool_set_eee(struct phyli ASSERT_RTNL(); diff --git a/target/linux/rockchip/patches-6.1/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch b/target/linux/rockchip/patches-6.1/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch index 039570635d9..88c53c9094e 100644 --- a/target/linux/rockchip/patches-6.1/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch +++ b/target/linux/rockchip/patches-6.1/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch @@ -39,7 +39,7 @@ static void rtl8168_config_eee_mac(struct rtl8169_private *tp) { /* Adjust EEE LED frequency */ -@@ -3238,6 +3256,8 @@ static void rtl_hw_start_8168h_1(struct +@@ -3242,6 +3260,8 @@ static void rtl_hw_start_8168h_1(struct r8168_mac_ocp_write(tp, 0xc094, 0x0000); r8168_mac_ocp_write(tp, 0xc09e, 0x0000); @@ -48,7 +48,7 @@ rtl_hw_aspm_clkreq_enable(tp, true); } -@@ -3610,6 +3630,8 @@ static void rtl_hw_start_8125b(struct rt +@@ -3614,6 +3634,8 @@ static void rtl_hw_start_8125b(struct rt rtl_ephy_init(tp, e_info_8125b); rtl_hw_start_8125_common(tp); diff --git a/target/linux/rockchip/patches-6.1/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch b/target/linux/rockchip/patches-6.1/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch index b39474bb757..4947739c4c6 100644 --- a/target/linux/rockchip/patches-6.1/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch +++ b/target/linux/rockchip/patches-6.1/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch @@ -23,7 +23,7 @@ static int rtl8169_led_configuration(struct rtl8169_private *tp) { u32 led_data; -@@ -3630,6 +3646,7 @@ static void rtl_hw_start_8125b(struct rt +@@ -3634,6 +3650,7 @@ static void rtl_hw_start_8125b(struct rt rtl_ephy_init(tp, e_info_8125b); rtl_hw_start_8125_common(tp); diff --git a/target/linux/rockchip/patches-6.1/804-02-PM-devfreq-event-add-support-for-rk3368-dfi.patch b/target/linux/rockchip/patches-6.1/804-02-PM-devfreq-event-add-support-for-rk3368-dfi.patch index 4708b965c13..e1bbf285f65 100644 --- a/target/linux/rockchip/patches-6.1/804-02-PM-devfreq-event-add-support-for-rk3368-dfi.patch +++ b/target/linux/rockchip/patches-6.1/804-02-PM-devfreq-event-add-support-for-rk3368-dfi.patch @@ -174,12 +174,11 @@ Signed-off-by: Finley Xiao data->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(data->regs)) return PTR_ERR(data->regs); -@@ -204,23 +289,59 @@ static int rockchip_dfi_probe(struct pla - if (IS_ERR(data->regmap_pmu)) - return PTR_ERR(data->regmap_pmu); - } +@@ -205,23 +290,58 @@ static int rockchip_dfi_probe(struct pla + if (IS_ERR(data->regmap_pmu)) + return PTR_ERR(data->regmap_pmu); + - data->dev = dev; -+ + desc->ops = &rockchip_dfi_ops; + + return 0; diff --git a/target/linux/rockchip/patches-6.1/804-05-PM-devfreq-event-make-dfi-more-extension.patch b/target/linux/rockchip/patches-6.1/804-05-PM-devfreq-event-make-dfi-more-extension.patch index 7666de6a2e2..a07e8f8db3e 100644 --- a/target/linux/rockchip/patches-6.1/804-05-PM-devfreq-event-make-dfi-more-extension.patch +++ b/target/linux/rockchip/patches-6.1/804-05-PM-devfreq-event-make-dfi-more-extension.patch @@ -172,8 +172,8 @@ Signed-off-by: CanYang He data->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(data->regs)) @@ -524,6 +537,10 @@ static __init int rockchip_dfi_init(stru - return PTR_ERR(data->regmap_pmu); - } + if (IS_ERR(data->regmap_pmu)) + return PTR_ERR(data->regmap_pmu); + regmap_read(data->regmap_pmu, PMUGRF_OS_REG2, &val); + data->dram_type = READ_DRAMTYPE_INFO(val); diff --git a/target/linux/x86/base-files.mk b/target/linux/x86/base-files.mk index 88ba97d38a3..e2b7d05f573 100644 --- a/target/linux/x86/base-files.mk +++ b/target/linux/x86/base-files.mk @@ -1,6 +1,6 @@ -GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL)) ifeq ($(GRUB_SERIAL),) -$(error This platform requires CONFIG_GRUB_SERIAL be set!) +$(error This platform requires CONFIG_TARGET_SERIAL be set!) endif define Package/base-files/install-target diff --git a/target/linux/x86/base-files/etc/board.d/01_leds b/target/linux/x86/base-files/etc/board.d/01_leds index efc5460df3c..47ea0929e62 100644 --- a/target/linux/x86/base-files/etc/board.d/01_leds +++ b/target/linux/x86/base-files/etc/board.d/01_leds @@ -28,6 +28,10 @@ traverse-technologies-geos) ucidef_set_led_netdev "wlan" "WiFi" "geos:2" "phy0tpt" ucidef_set_led_default "diag" "DIAG" "geos:3" "1" ;; +silicom-80500-0214-*) + ucidef_set_led_netdev "wan" "WAN" "multicolor:fp_center" "wan0" + ucidef_set_led_netdev "lan" "LAN" "multicolor:fp_right" "br-lan" + ;; esac board_config_flush diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network index 0a0f32eb801..b18ab60120e 100644 --- a/target/linux/x86/base-files/etc/board.d/02_network +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -78,6 +78,17 @@ traverse-technologies-geos) macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null [ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr" ;; +silicom-80500-0214-*) + ucidef_set_network_device_path "wan0" "pci0000:00/0000:00:16.0/0000:03:00.0" + ucidef_set_network_device_path "wan1" "pci0000:00/0000:00:16.0/0000:03:00.1" + ucidef_set_network_device_path "media0" "pci0000:00/0000:00:17.0/0000:02:00.1" + ucidef_set_network_device_path "media1" "pci0000:00/0000:00:17.0/0000:02:00.0" + ucidef_set_network_device_path "eth0" "pci0000:00/0000:00:0c.0/0000:04:00.0" + ucidef_set_network_device_path "eth1" "pci0000:00/0000:00:0e.0/0000:05:00.0" + ucidef_set_network_device_path "eth2" "pci0000:00/0000:00:0f.0/0000:06:00.0" + ucidef_set_network_device_path "eth3" "pci0000:00/0000:00:10.0/0000:07:00.0" + ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3" "wan0" + ;; esac board_config_flush diff --git a/target/linux/x86/image/64.mk b/target/linux/x86/image/64.mk index f45e59abbb0..75e8d01eaa4 100644 --- a/target/linux/x86/image/64.mk +++ b/target/linux/x86/image/64.mk @@ -3,7 +3,7 @@ define Device/generic DEVICE_MODEL := x86/64 DEVICE_PACKAGES += \ kmod-amazon-ena kmod-amd-xgbe kmod-bnx2 kmod-e1000 \ - kmod-forcedeth kmod-fs-vfat kmod-tg3 \ + kmod-dwmac-intel kmod-forcedeth kmod-fs-vfat kmod-tg3 \ kmod-mlxsw-core kmod-mlxsw-pci kmod-mlxsw-i2c \ kmod-mlxsw-spectrum kmod-mlxsw-minimal kmod-mlxfw \ kmod-leds-mlxcpld kmod-lib-objagg kmod-lib-parman \ diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 84b111ec7fd..b611ebebfde 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -16,7 +16,7 @@ ifneq ($(CONFIG_GRUB_CONSOLE),) GRUB_TERMINALS += console endif -GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL)) GRUB_CONSOLE_CMDLINE += console=$(GRUB_SERIAL),$(CONFIG_GRUB_BAUDRATE)n8$(if $(CONFIG_GRUB_FLOWCONTROL),r,) GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off) diff --git a/target/linux/x86/modules.mk b/target/linux/x86/modules.mk index 511410d614b..cdae01bce65 100644 --- a/target/linux/x86/modules.mk +++ b/target/linux/x86/modules.mk @@ -18,6 +18,18 @@ endef $(eval $(call KernelPackage,amd-xgbe)) +define KernelPackage/dwmac-intel + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Intel GMAC support + DEPENDS:=@TARGET_x86_64 +kmod-stmmac-core + KCONFIG:=CONFIG_DWMAC_INTEL + FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.ko + AUTOLOAD=$(call AutoLoad,45,dwmac-intel) +endef + +$(eval $(call KernelPackage,dwmac-intel)) + + define KernelPackage/f71808e-wdt SUBMENU:=$(OTHER_MENU) TITLE:=Fintek F718xx/F818xx Watchdog Timer diff --git a/target/sdk/Makefile b/target/sdk/Makefile index 243d58bbaf1..fbe35170c1a 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -89,6 +89,7 @@ USERSPACE_UTILS_FILES := \ tools/power/cpupower \ tools/scripts \ tools/spi \ + tools/thermal/tmon \ tools/usb/usbip USERSPACE_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(USERSPACE_UTILS_FILES)))) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 19c4a5b8b80..f05654b5c5f 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.27.7 +PKG_VERSION:=3.27.9 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:=08f71a106036bf051f692760ef9558c0577c42ac39e96ba097e7662bd4158d8e +PKG_HASH:=609a9b98572a6a5ea477f912cffb973109ed4d0a6a6b3f9e2353d2cdc048708e HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 diff --git a/tools/mold/Makefile b/tools/mold/Makefile index e9ad9c60357..418f04fb6b7 100644 --- a/tools/mold/Makefile +++ b/tools/mold/Makefile @@ -3,12 +3,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mold -PKG_VERSION:=2.3.1 +PKG_VERSION:=2.3.2 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:=380f540114408c37bcdb7f3bda91a056448a93124ca6992a373ae2bda35e9af7 +PKG_HASH:=db172c0e97606565a81e37995bf5c911606d3f3b9f3829e92cd26985c9b0ed3b include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/xz/Makefile b/tools/xz/Makefile index 757d5ae0e1e..e020f5a5475 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xz -PKG_VERSION:=5.4.4 +PKG_VERSION:=5.4.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/lzmautils \ http://tukaani.org/xz -PKG_HASH:=0b6fcde1ac38e90433a2556f500c065950b9bcd2d602006efc334782bdfe6296 +PKG_HASH:=8ccf5fff868c006f29522e386fb4c6a1b66463fbca65a4cfc3c4bd596e895e79 PKG_CPE_ID:=cpe:/a:tukaani:xz HOST_BUILD_PARALLEL:=1