From a43da1be43ae251f0edaa6419612e600fc6ec972 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Wed, 18 Aug 2021 16:11:11 +0300 Subject: [PATCH 01/18] ipq40xx: fix Edgecore ECW5211 boot The bootloader will look for a configuration section named ap.dk01.1-c2 in the FIT image. If this doesn't exist, the device won't boot. Signed-off-by: Stijn Tintel --- target/linux/ipq40xx/image/generic.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 9dee742eb4..c7e3583613 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -365,6 +365,7 @@ define Device/edgecore_ecw5211 SOC := qcom-ipq4018 BLOCKSIZE := 128k PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm endef TARGET_DEVICES += edgecore_ecw5211 From 8ae3d5f9ca17756ff73db6117784f426a8c6226b Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 13 May 2021 16:23:26 +0300 Subject: [PATCH 02/18] busybox: fix compilation with GCC 10 When compiling busybox with GCC 10 and CONFIG_PKG_ASLR_PIE_ALL=y, there are hundreds of errors like: relocation R_MIPS16_26 against `xzalloc' cannot be used when making a shared object; recompile with -fPIC Simply solve this by no longer disabling PKG_ASLR_PIE, so that $(FPIC) is properly added to the CFLAGS and LDFLAGS. Signed-off-by: Stijn Tintel Acked-by: Hauke Mehrtens --- package/utils/busybox/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 32f0d2c755..76a1de33b7 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -18,9 +18,6 @@ PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 PKG_CHECK_FORMAT_SECURITY:=0 -#Busybox use it's own PIE config flag and LDFLAGS are used with ld, not gcc. -PKG_ASLR_PIE:=0 - PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE PKG_CPE_ID:=cpe:/a:busybox:busybox From 959838ed03d4cbb2c97fa74746f00ccf9961d8e3 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Wed, 18 Aug 2021 20:45:14 +0300 Subject: [PATCH 03/18] umbim: bump to git HEAD de56231 umbim: fix compilation with GCC 10 Signed-off-by: Stijn Tintel Acked-by: Hauke Mehrtens --- package/network/utils/umbim/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index a0f5e4756b..d339783f6c 100644 --- a/package/network/utils/umbim/Makefile +++ b/package/network/utils/umbim/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git -PKG_SOURCE_DATE:=2019-09-11 -PKG_SOURCE_VERSION:=184b707ddaa0acee84d02e0ffe599cb8b67782bd -PKG_MIRROR_HASH:=482ff69144f81fafed99035840f5a24e772472f2df2f3ac0219d6de791ac5835 +PKG_SOURCE_DATE:=2021-08-18 +PKG_SOURCE_VERSION:=de5623104baee6e0c13c92f05c15bf4b4145c0b1 +PKG_MIRROR_HASH:=2d4a75d2b53c8413521a2fd138895e327bff3f4b4d29a540342b2d2e1e009852 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 From 3f41153b1c28999e9d9f7e6d9e4c3f9c2cba57d4 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 13 May 2021 19:54:34 +0300 Subject: [PATCH 04/18] toolchain/binutils: switch to version 2.36.1 by default Runtime-tested on: * ath79 * bcm27xx/bcm2708 * bcm27xx/bcm2709 * bcm27xx/bcm2711 * mvebu/cortexa53 * octeon * realtek * x86/64 Signed-off-by: Stijn Tintel Acked-by: Hauke Mehrtens --- toolchain/binutils/Config.in | 2 +- toolchain/binutils/Config.version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in index 4b9579379c..0f69a003d3 100644 --- a/toolchain/binutils/Config.in +++ b/toolchain/binutils/Config.in @@ -2,7 +2,7 @@ choice prompt "Binutils Version" if TOOLCHAINOPTS - default BINUTILS_USE_VERSION_2_34 + default BINUTILS_USE_VERSION_2_36_1 help Select the version of binutils you wish to use. diff --git a/toolchain/binutils/Config.version b/toolchain/binutils/Config.version index 985e3b1b32..a1622abd96 100644 --- a/toolchain/binutils/Config.version +++ b/toolchain/binutils/Config.version @@ -2,13 +2,13 @@ config BINUTILS_VERSION_2_32 bool config BINUTILS_VERSION_2_34 - default y if !TOOLCHAINOPTS bool config BINUTILS_VERSION_2_35_2 bool config BINUTILS_VERSION_2_36_1 + default y if !TOOLCHAINOPTS bool config BINUTILS_VERSION_2_37 From 6d0cefcf426724c1b0a6a9481a6596e9616122a6 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 13 May 2021 19:45:48 +0300 Subject: [PATCH 05/18] toolchain/gcc: switch to version 10 by default Runtime-tested on: * ath79 * bcm27xx/bcm2708 * bcm27xx/bcm2709 * bcm27xx/bcm2711 * mvebu/cortexa53 * octeon * realtek * x86/64 Signed-off-by: Stijn Tintel Acked-by: Hauke Mehrtens --- toolchain/gcc/Config.in | 2 +- toolchain/gcc/Config.version | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index 5ac93217f8..4b25c85016 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -2,7 +2,7 @@ choice prompt "GCC compiler Version" if TOOLCHAINOPTS - default GCC_USE_VERSION_8 + default GCC_USE_VERSION_10 help Select the version of gcc you wish to use. diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index dd61d1e210..608de37317 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -2,12 +2,12 @@ config GCC_VERSION_7 default y if GCC_USE_VERSION_7 bool -config GCC_VERSION_9 - default y if GCC_USE_VERSION_9 +config GCC_VERSION_8 + default y if GCC_USE_VERSION_8 bool -config GCC_VERSION_10 - default y if GCC_USE_VERSION_10 +config GCC_VERSION_9 + default y if GCC_USE_VERSION_9 bool config GCC_VERSION_11 @@ -17,10 +17,10 @@ config GCC_VERSION_11 config GCC_VERSION string default "7.5.0" if GCC_VERSION_7 + default "8.4.0" if GCC_VERSION_8 default "9.3.0" if GCC_VERSION_9 - default "10.3.0" if GCC_VERSION_10 default "11.2.0" if GCC_VERSION_11 - default "8.4.0" + default "10.3.0" config GCC_USE_IREMAP bool From 9a79fe20e81744805805abbf8ff028351e5d2f32 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Sat, 27 Mar 2021 20:48:30 +0100 Subject: [PATCH 06/18] bcm27xx-userland: factor out a -dev package Installing headers and static libraries to the target system seems to be not required for most use cases, so let's factor them out into a dedicated -dev package. This cuts down to disk usage to around 50% of the original package to ~ 2MB - not that disk space is an issue normally, but when using inside an initramfs only project, it counts. Signed-off-by: Michael Heimpold --- package/utils/bcm27xx-userland/Makefile | 34 ++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/package/utils/bcm27xx-userland/Makefile b/package/utils/bcm27xx-userland/Makefile index 098c039f1f..b38e11d074 100644 --- a/package/utils/bcm27xx-userland/Makefile +++ b/package/utils/bcm27xx-userland/Makefile @@ -8,16 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bcm27xx-userland -PKG_VERSION:=4a0a19b88b43e48c6b51b526b9378289fb712a4c +PKG_VERSION:=3fd8527eefd8790b4e8393458efc5f94eb21a615 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/raspberrypi/userland/tar.gz/$(PKG_VERSION)? -PKG_HASH:=0f42d48095d1f680cbe8781c2e974b76bdd0507aaef64cce8b8b472ca3a09588 +PKG_HASH:=7de1527d8e9bb7632f68aa083d3b79b44fa711360e3292d59e330e0591c65ebd PKG_FLAGS:=nonshared PKG_MAINTAINER:=Álvaro Fernández Rojas +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENCE CMAKE_INSTALL:=1 CMAKE_OPTIONS+=-DVMCS_INSTALL_PREFIX=/usr @@ -46,6 +48,19 @@ define Package/bcm27xx-userland/description BCM27xx userland tools including vcgencmd and tvservice. endef +define Package/bcm27xx-userland-dev + SECTION:=devel + CATEGORY:=Development + SUBMENU:=Libraries + DEPENDS:=@TARGET_bcm27xx +bcm27xx-userland + TITLE:=Development files of BCM27xx userland tools +endef + +define Package/bcm27xx-userland-dev/description + This package contains the header and static libraries of + the BCM27xx userland tools. +endef + define Package/bcm27xx-userland/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtmerge $(1)/usr/bin @@ -61,11 +76,22 @@ endif $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vcgencmd $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vcmailbox $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/ +ifneq ($(ARCH),aarch64) + $(INSTALL_DIR) $(1)/usr/lib/plugins + $(CP) $(PKG_INSTALL_DIR)/usr/lib/plugins/ $(1)/usr/lib/ +endif +endef + +define Package/bcm27xx-userland-dev/install $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/ $(1)/usr/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/ $(1)/usr/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.a $(1)/usr/lib/ endef $(eval $(call BuildPackage,bcm27xx-userland)) +$(eval $(call BuildPackage,bcm27xx-userland-dev)) From ba3d92c5a087cd4d28124fc366fc63a34732ff3d Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 17 Aug 2021 20:53:27 +0200 Subject: [PATCH 07/18] ramips: convert most mtd-mac-address cases in DTSI to nvmem Convert most of the cases from mtd-mac-address to nvmem where MAC addresses are set in the DTSI, but the partitions are only located in the device DTS. This posed some problems earlier, since in these cases we are using partitions before they are defined, and the nvmem system did not seem to like that. There have been a few different resolution approaches, based on the different tradeoffs of deduplication vs. maintainability: 1. In many cases, the partition tables were identical except for the firmware partition size, and the firmware partition was the last in the table. In these cases, the partition table has been moved to the DTSI, and only the firmware partition's "reg" property has been kept in the DTS files. So, the updated nvmem definition could stay in the DTSI files as well. 2. For all other cases, splitting up the partition table would have introduced additional complexity. Thus, the nodes to be converted to nvmem have been moved to the DTS files where the partitioning was defined. 3. For Netgear EX2700 and WN3000RP v3, the remaining DTSI file was completely dissolved, as it was quite small and the name was not really nice either. 4. The D-Link DIR-853 A3 was converted to nvmem as well, though it is just a plain DTS file not taken care of in the first wave. In addition, some minor rearrangements have been made for tidyness. Not covered (yet) by this patch are: * Various unielec devices * The D-Link DIR-8xx family Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7620a_netgear_ex2700.dts | 112 ++++++++++++++---- .../mt7620a_netgear_ex2700_wn3000rp-v3.dtsi | 58 --------- .../dts/mt7620a_netgear_wn3000rp-v3.dts | 112 ++++++++++++++---- .../dts/mt7620a_zbtlink_zbt-we826-16m.dts | 40 +------ .../dts/mt7620a_zbtlink_zbt-we826-32m.dts | 40 +------ .../dts/mt7620a_zbtlink_zbt-we826-e.dts | 40 +------ .../ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi | 53 ++++++++- .../ramips/dts/mt7620n_nexx_wt3020-4m.dts | 40 +------ .../ramips/dts/mt7620n_nexx_wt3020-8m.dts | 44 +------ .../linux/ramips/dts/mt7620n_nexx_wt3020.dtsi | 53 ++++++++- .../ramips/dts/mt7621_dlink_dir-853-a3.dts | 27 ++++- .../linux/ramips/dts/mt7621_netgear_r6220.dts | 25 ++++ .../dts/mt7621_netgear_sercomm_ayx.dtsi | 9 +- .../ramips/dts/mt7621_netgear_wndr3700-v5.dts | 25 ++++ .../ramips/dts/mt7621_ubnt_unifi-6-lite.dts | 8 ++ .../ramips/dts/mt7621_ubnt_unifi-nanohd.dts | 19 +++ .../linux/ramips/dts/mt7621_ubnt_unifi.dtsi | 5 - .../dts/mt7628an_vocore_vocore2-lite.dts | 40 +------ .../ramips/dts/mt7628an_vocore_vocore2.dts | 40 +------ .../ramips/dts/mt7628an_vocore_vocore2.dtsi | 53 ++++++++- .../ramips/dts/mt7628an_widora_neo-16m.dts | 50 +------- .../ramips/dts/mt7628an_widora_neo-32m.dts | 50 +------- .../linux/ramips/dts/mt7628an_widora_neo.dtsi | 63 +++++++++- .../ramips/dts/rt3050_allnet_all0256n-4m.dts | 40 +------ .../ramips/dts/rt3050_allnet_all0256n-8m.dts | 40 +------ .../ramips/dts/rt3050_allnet_all0256n.dtsi | 53 ++++++++- .../dts/rt3050_alphanetworks_asl26555-16m.dts | 15 +++ .../dts/rt3050_alphanetworks_asl26555-8m.dts | 15 +++ .../dts/rt3050_alphanetworks_asl26555.dtsi | 4 - .../ramips/dts/rt5350_7links_px-4885-4m.dts | 40 +------ .../ramips/dts/rt5350_7links_px-4885-8m.dts | 40 +------ .../ramips/dts/rt5350_7links_px-4885.dtsi | 53 ++++++++- .../dts/rt5350_asiarf_awm002-evb-4m.dts | 40 +------ .../dts/rt5350_asiarf_awm002-evb-8m.dts | 40 +------ .../ramips/dts/rt5350_asiarf_awm002-evb.dtsi | 53 ++++++++- .../ramips/dts/rt5350_nexx_wt1520-4m.dts | 40 +------ .../ramips/dts/rt5350_nexx_wt1520-8m.dts | 40 +------ .../linux/ramips/dts/rt5350_nexx_wt1520.dtsi | 53 ++++++++- .../ramips/dts/rt5350_nixcore_x1-16m.dts | 40 +------ .../linux/ramips/dts/rt5350_nixcore_x1-8m.dts | 40 +------ .../linux/ramips/dts/rt5350_nixcore_x1.dtsi | 53 ++++++++- .../linux/ramips/dts/rt5350_poray_m4-4m.dts | 40 +------ .../linux/ramips/dts/rt5350_poray_m4-8m.dts | 40 +------ target/linux/ramips/dts/rt5350_poray_m4.dtsi | 53 ++++++++- .../ramips/dts/rt5350_vocore_vocore-16m.dts | 40 +------ .../ramips/dts/rt5350_vocore_vocore-8m.dts | 40 +------ .../ramips/dts/rt5350_vocore_vocore.dtsi | 53 ++++++++- 47 files changed, 944 insertions(+), 1027 deletions(-) delete mode 100644 target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts index 9ed0883b45..e09d9c607b 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts +++ b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts @@ -3,7 +3,10 @@ * Copyright (C) 2016 Joseph C. Lehner */ -#include "mt7620a_netgear_ex2700_wn3000rp-v3.dtsi" +#include "mt7620a.dtsi" + +#include +#include / { compatible = "netgear,ex2700", "ralink,mt7620a-soc"; @@ -16,6 +19,22 @@ led-upgrade = &led_power_green; }; + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + leds { compatible = "gpio-leds"; @@ -57,28 +76,79 @@ }; }; -&partitions { - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; +&gpio1 { + status = "okay"; +}; - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; +&spi0 { + status = "okay"; - partition@40000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x40000 0x3b0000>; - }; + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; - art: partition@3f0000 { - label = "art"; - reg = <0x3f0000 0x10000>; - read-only; + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x40000 0x3b0000>; + }; + + art: partition@3f0000 { + label = "art"; + reg = <0x3f0000 0x10000>; + read-only; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + ralink,mtd-eeprom = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&state_default { + default { + groups = "i2c", "uartf", "spi refclk"; + function = "gpio"; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi b/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi deleted file mode 100644 index e7b1f4bf40..0000000000 --- a/target/linux/ramips/dts/mt7620a_netgear_ex2700_wn3000rp-v3.dtsi +++ /dev/null @@ -1,58 +0,0 @@ -#include "mt7620a.dtsi" - -#include -#include - -/ { - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions: partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - }; - }; -}; - -ðernet { - mtd-mac-address = <&art 0x0>; -}; - -&wmac { - ralink,mtd-eeprom = <&art 0x1000>; - mtd-mac-address = <&art 0x6>; -}; - -&state_default { - default { - groups = "i2c", "uartf", "spi refclk"; - function = "gpio"; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts b/target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts index c9b1806243..c6fe7baa67 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts +++ b/target/linux/ramips/dts/mt7620a_netgear_wn3000rp-v3.dts @@ -1,6 +1,9 @@ /* This file is released into the public domain */ -#include "mt7620a_netgear_ex2700_wn3000rp-v3.dtsi" +#include "mt7620a.dtsi" + +#include +#include / { compatible = "netgear,wn3000rp-v3", "ralink,mt7620a-soc"; @@ -13,6 +16,22 @@ led-upgrade = &led_power_green; }; + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + leds { compatible = "gpio-leds"; @@ -64,28 +83,79 @@ }; }; -&partitions { - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; +&gpio1 { + status = "okay"; +}; - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; +&spi0 { + status = "okay"; - partition@40000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x40000 0x7b0000>; - }; + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; - art: partition@7f0000 { - label = "art"; - reg = <0x7f0000 0x10000>; - read-only; + 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 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x40000 0x7b0000>; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + ralink,mtd-eeprom = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&state_default { + default { + groups = "i2c", "uartf", "spi refclk"; + function = "gpio"; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts index c3de5330b0..ecad0d6582 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-16m.dts @@ -5,42 +5,6 @@ model = "Zbtlink ZBT-WE826 (16M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - firmware: partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xfb0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0xfb0000>; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts index 6f5bc41d5d..c86890193d 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-32m.dts @@ -5,42 +5,6 @@ model = "Zbtlink ZBT-WE826 (32M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - firmware: partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x1fb0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x1fb0000>; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts index bce6afe263..3808538ab8 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826-e.dts @@ -33,44 +33,8 @@ }; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - firmware: partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x1fb0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x1fb0000>; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi index cf2ca1cd27..8e781aa505 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi @@ -49,6 +49,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &gpio1 { status = "okay"; }; @@ -70,7 +110,8 @@ }; ðernet { - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; mediatek,portmap = "llllw"; }; @@ -89,3 +130,13 @@ &pcie { status = "okay"; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts b/target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts index ed9170fed4..bcbe22eaa4 100644 --- a/target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020-4m.dts @@ -5,42 +5,6 @@ model = "Nexx WT3020 (4M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x3b0000>; }; diff --git a/target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts b/target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts index ac46ccbfad..8bbb22220b 100644 --- a/target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020-8m.dts @@ -5,6 +5,10 @@ model = "Nexx WT3020 (8M)"; }; +&firmware { + reg = <0x50000 0x7b0000>; +}; + &ehci { status = "okay"; }; @@ -12,43 +16,3 @@ &ohci { status = "okay"; }; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi index 1597c088bc..7f17f1957f 100644 --- a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi @@ -34,12 +34,53 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &gpio3 { status = "okay"; }; ðernet { - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; mediatek,portmap = "wllll"; }; @@ -54,3 +95,13 @@ function = "gpio"; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts index 738bcdc7d6..e866fb1242 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts @@ -158,12 +158,14 @@ mediatek,mtd-eeprom = <&factory 0x0>; /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; }; &gmac0 { - mtd-mac-address = <&factory 0xe000>; + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; }; &switch0 { @@ -191,7 +193,8 @@ port@4 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0xe006>; + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; }; }; }; @@ -202,3 +205,21 @@ function = "gpio"; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_netgear_r6220.dts b/target/linux/ramips/dts/mt7621_netgear_r6220.dts index cc29d4ea8e..54489243b8 100644 --- a/target/linux/ramips/dts/mt7621_netgear_r6220.dts +++ b/target/linux/ramips/dts/mt7621_netgear_r6220.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,r6220", "mediatek,mt7621-soc"; model = "Netgear R6220"; + + aliases { + label-mac-device = &gmac0; + }; }; &nand { @@ -50,3 +54,24 @@ }; }; }; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi index eaf9059e39..ae9e40e621 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi @@ -13,7 +13,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = &gmac0; }; keys { @@ -106,10 +105,6 @@ }; }; -&gmac0 { - mtd-mac-address = <&factory 0x4>; -}; - &switch0 { ports { port@0 { @@ -132,11 +127,9 @@ label = "lan1"; }; - port@4 { + wan: port@4 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0x4>; - mac-address-increment = <1>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts b/target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts index 90c0ca1276..972aba1c5e 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3700-v5", "mediatek,mt7621-soc"; model = "Netgear WNDR3700 v5"; + + aliases { + label-mac-device = &gmac0; + }; }; &spi0 { @@ -46,3 +50,24 @@ }; }; }; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts index 1265a92123..0e56d16a7f 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -73,13 +73,21 @@ }; }; +&gmac0 { + nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cell-names = "mac-address"; +}; + &wlan_2g { + mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; &wlan_5g { mediatek,mtd-eeprom = <&factory 0x20000>; + nvmem-cells = <&macaddr_eeprom_6>; nvmem-cell-names = "mac-address"; ieee80211-freq-limit = <5000000 6000000>; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts index 7a36ecfa7b..2762a777a3 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts @@ -70,6 +70,25 @@ }; }; +&gmac0 { + nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cell-names = "mac-address"; +}; + +&wlan_2g { + mediatek,mtd-eeprom = <&factory 0x0>; +}; + &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_unifi.dtsi b/target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi index e0625ba500..8a0109f91b 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi @@ -50,7 +50,6 @@ &pcie0 { wlan_2g: wifi@0,0 { reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; }; }; @@ -60,10 +59,6 @@ }; }; -&gmac0 { - mtd-mac-address = <&eeprom 0x0>; -}; - &switch0 { ports { port@0 { diff --git a/target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts b/target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts index f8bdc27c4c..26012a6a4f 100644 --- a/target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2-lite.dts @@ -21,42 +21,6 @@ }; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dts b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dts index f4bb8720d3..44baa16bad 100644 --- a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dts +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dts @@ -21,42 +21,6 @@ }; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xfb0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0xfb0000>; }; diff --git a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi index 06a80fdde7..9100e0225e 100644 --- a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi @@ -14,6 +14,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &state_default { gpio { groups = "wled_an", "refclk", "wdt"; @@ -28,7 +68,8 @@ }; ðernet { - mtd-mac-address = <&factory 0x28>; + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; }; &esw { @@ -55,3 +96,13 @@ &uart2 { status = "okay"; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_widora_neo-16m.dts b/target/linux/ramips/dts/mt7628an_widora_neo-16m.dts index c6bd640a6d..bd72078eff 100644 --- a/target/linux/ramips/dts/mt7628an_widora_neo-16m.dts +++ b/target/linux/ramips/dts/mt7628an_widora_neo-16m.dts @@ -5,52 +5,6 @@ model = "Widora-NEO (16M)"; }; -&spi0 { - status = "okay"; - - pinctrl-names = "default"; - pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>; - - 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>; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x0fb0000>; - }; - }; - }; - - spidev@1 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "linux,spidev"; - reg = <1>; - spi-max-frequency = <40000000>; - }; +&firmware { + reg = <0x50000 0xfb0000>; }; diff --git a/target/linux/ramips/dts/mt7628an_widora_neo-32m.dts b/target/linux/ramips/dts/mt7628an_widora_neo-32m.dts index adc74e6643..c2387984c8 100644 --- a/target/linux/ramips/dts/mt7628an_widora_neo-32m.dts +++ b/target/linux/ramips/dts/mt7628an_widora_neo-32m.dts @@ -5,52 +5,6 @@ model = "Widora-NEO (32M)"; }; -&spi0 { - status = "okay"; - - pinctrl-names = "default"; - pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>; - - 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>; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x1fb0000>; - }; - }; - }; - - spidev@1 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "linux,spidev"; - reg = <1>; - spi-max-frequency = <40000000>; - }; +&firmware { + reg = <0x50000 0x1fb0000>; }; diff --git a/target/linux/ramips/dts/mt7628an_widora_neo.dtsi b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi index 185f554df7..74f865aac9 100644 --- a/target/linux/ramips/dts/mt7628an_widora_neo.dtsi +++ b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi @@ -46,6 +46,56 @@ }; }; +&spi0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>; + + 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>; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; + + spidev@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "linux,spidev"; + reg = <1>; + spi-max-frequency = <40000000>; + }; +}; + &state_default { gpio { groups = "gpio"; @@ -105,7 +155,8 @@ }; ðernet { - mtd-mac-address = <&factory 0x28>; + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; }; &sdhci { @@ -118,3 +169,13 @@ mediatek,mtd-eeprom = <&factory 0x0>; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts b/target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts index efb96da57a..fc1d050c02 100644 --- a/target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n-4m.dts @@ -5,42 +5,6 @@ model = "Allnet ALL0256N (4M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x3b0000>; }; diff --git a/target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts b/target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts index 866d9a9b35..c2ae6f423b 100644 --- a/target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n-8m.dts @@ -5,42 +5,6 @@ model = "Allnet ALL0256N (8M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi index 7458165bc4..13933e335c 100644 --- a/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi @@ -37,6 +37,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &state_default { gpio { groups = "i2c", "jtag", "rgmii", "mdio", "uartf"; @@ -45,7 +85,8 @@ }; ðernet { - mtd-mac-address = <&factory 0x28>; + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; }; &esw { @@ -55,3 +96,13 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts index 9cc29d0afd..52b8668be9 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts @@ -62,3 +62,18 @@ }; }; }; + +ðernet { + nvmem-cells = <&macaddr_devdata_4004>; + nvmem-cell-names = "mac-address"; +}; + +&devdata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts index c5465b4812..4e03f7beb7 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts @@ -56,3 +56,18 @@ }; }; }; + +ðernet { + nvmem-cells = <&macaddr_devdata_4004>; + nvmem-cell-names = "mac-address"; +}; + +&devdata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi index 028238a3d2..6cd75da68b 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi @@ -84,10 +84,6 @@ }; }; -ðernet { - mtd-mac-address = <&devdata 0x4004>; -}; - &esw { mediatek,portmap = <0x1e>; }; diff --git a/target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts b/target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts index 383bde706f..40c4ff48b4 100644 --- a/target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts +++ b/target/linux/ramips/dts/rt5350_7links_px-4885-4m.dts @@ -5,42 +5,6 @@ model = "7Links PX-4885 (4M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x20000>; - read-only; - }; - - partition@20000 { - label = "devdata"; - reg = <0x20000 0x20000>; - read-only; - }; - - devconf: partition@40000 { - label = "devconf"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x3b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts b/target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts index 25c635aa11..930e875762 100644 --- a/target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts +++ b/target/linux/ramips/dts/rt5350_7links_px-4885-8m.dts @@ -5,42 +5,6 @@ model = "7Links PX-4885 (8M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x20000>; - read-only; - }; - - partition@20000 { - label = "devdata"; - reg = <0x20000 0x20000>; - read-only; - }; - - devconf: partition@40000 { - label = "devconf"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi index a15d140f3e..2d43e0a30d 100644 --- a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi +++ b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi @@ -41,6 +41,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "devdata"; + reg = <0x20000 0x20000>; + read-only; + }; + + devconf: partition@40000 { + label = "devconf"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &state_default { gpio { groups = "i2c", "jtag", "uartf"; @@ -49,7 +89,8 @@ }; ðernet { - mtd-mac-address = <&devconf 0x28>; + nvmem-cells = <&macaddr_devconf_28>; + nvmem-cell-names = "mac-address"; }; &esw { @@ -59,3 +100,13 @@ &wmac { ralink,mtd-eeprom = <&devconf 0x0>; }; + +&devconf { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_devconf_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts index 56f1cedebd..0a60e07fcd 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-4m.dts @@ -5,42 +5,6 @@ model = "AsiaRF AWM002 EVB (4M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - reg = <0>; - compatible = "jedec,spi-nor"; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x3b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts index 43b599abe6..529220ae9d 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb-8m.dts @@ -5,42 +5,6 @@ model = "AsiaRF AWM002 EVB (8M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - reg = <0>; - compatible = "jedec,spi-nor"; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi index 80965a48b8..18e59431fb 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi @@ -43,8 +43,49 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + ðernet { - mtd-mac-address = <&factory 0x28>; + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; }; &wmac { @@ -61,3 +102,13 @@ &esw { mediatek,portmap = <0x3f>; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts b/target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts index 0b1b57c99a..de291f7d51 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520-4m.dts @@ -5,42 +5,6 @@ model = "Nexx WT1520 (4M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x3b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts b/target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts index c28dae3468..7520d21a63 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520-8m.dts @@ -5,42 +5,6 @@ model = "Nexx WT1520 (8M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi index 540fd253eb..9783e5a7e5 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi @@ -18,6 +18,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &state_default { gpio { groups = "jtag", "uartf"; @@ -26,9 +66,20 @@ }; ðernet { - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts b/target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts index 19b7f39cf4..ff44041571 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts +++ b/target/linux/ramips/dts/rt5350_nixcore_x1-16m.dts @@ -5,42 +5,6 @@ model = "NixcoreX1 (16M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "uboot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "uboot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xfb0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0xfb0000>; }; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts b/target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts index 888c67ddf0..8cecba3fa7 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts +++ b/target/linux/ramips/dts/rt5350_nixcore_x1-8m.dts @@ -5,42 +5,6 @@ model = "NixcoreX1 (8M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "uboot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "uboot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi index 2459c6b65b..ea10d50182 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi +++ b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi @@ -108,6 +108,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "uboot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "uboot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &gpio1 { status = "okay"; }; @@ -129,7 +169,8 @@ }; ðernet { - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; &esw { @@ -139,3 +180,13 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt5350_poray_m4-4m.dts b/target/linux/ramips/dts/rt5350_poray_m4-4m.dts index f6f6a5a332..a457929457 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4-4m.dts +++ b/target/linux/ramips/dts/rt5350_poray_m4-4m.dts @@ -5,42 +5,6 @@ model = "Poray M4 (4M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x3b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x3b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m4-8m.dts b/target/linux/ramips/dts/rt5350_poray_m4-8m.dts index 2cf5891495..7d860186f2 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4-8m.dts +++ b/target/linux/ramips/dts/rt5350_poray_m4-8m.dts @@ -5,42 +5,6 @@ model = "Poray M4 (8M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m4.dtsi b/target/linux/ramips/dts/rt5350_poray_m4.dtsi index 9b36961ffb..4addfcbef8 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4.dtsi +++ b/target/linux/ramips/dts/rt5350_poray_m4.dtsi @@ -34,6 +34,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &state_default { gpio { groups = "i2c", "jtag", "uartf"; @@ -42,7 +82,8 @@ }; ðernet { - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; &esw { @@ -54,3 +95,13 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts b/target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts index e28563c608..624f0fb6c9 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts +++ b/target/linux/ramips/dts/rt5350_vocore_vocore-16m.dts @@ -5,42 +5,6 @@ model = "VoCore (16M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "uboot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "uboot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xfb0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0xfb0000>; }; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts b/target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts index 4fa291a2e2..a824e9dfc7 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts +++ b/target/linux/ramips/dts/rt5350_vocore_vocore-8m.dts @@ -5,42 +5,6 @@ model = "VoCore (8M)"; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "uboot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "uboot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0x7b0000>; }; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi index 0c82919669..652f9384e5 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi +++ b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi @@ -156,6 +156,46 @@ }; }; +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "uboot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "uboot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + &gpio1 { status = "okay"; }; @@ -172,7 +212,8 @@ }; ðernet { - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; &esw { @@ -193,3 +234,13 @@ reg = <0>; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; From e826b642945ee7b196044a07faddd71c1bd6c6ef Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 18 Aug 2021 20:06:29 +0200 Subject: [PATCH 08/18] ath79: convert remaining mtd-mac-address cases to nvmem Since the nvmem-based approach for retrieving MAC addresses appears to depend on the addresses being set up after the partitions, it is no longer possible to keep the MAC address setup in shared DTSI files while the partitions itself are set up in DTS files for the individual devices. In ath79 the firmware partition is typically located somewhere "in the middle" of the partition table. Thus, it's not trivial to share the partitions containing MAC address information in a common DTSI (like we did in some cases on ramips). In this commit, MAC address setup is thus moved to the relevant partitions, and in most cases needs to be duplicated. While the duplication is not really nice, it eventually provides a cleaner and more tidy setup, making the DTS(I) file fragmentation a bit more logical. This should also help with adding new devices, as information is distributed across less locations. For consistency, this commit also moves the mtd-cal-data property "down" together with the MAC address setup, so it's not based on a partition before the latter is defined either. (This is only done for those files touched due to nvmem conversion.) Signed-off-by: Adrian Schmutzler --- .../linux/ath79/dts/ar7161_netgear_wndr.dtsi | 9 +--- .../ath79/dts/ar7161_netgear_wndr3700-v2.dts | 42 +++++++++++++++++ .../ath79/dts/ar7161_netgear_wndr3700.dts | 40 ++++++++++++++++ .../ath79/dts/ar7161_netgear_wndr3800.dts | 42 +++++++++++++++++ .../ath79/dts/ar7161_netgear_wndr3800ch.dts | 41 +++++++++++++++++ .../ath79/dts/ar7161_netgear_wndrmac-v1.dts | 42 +++++++++++++++++ .../ath79/dts/ar7161_netgear_wndrmac-v2.dts | 42 +++++++++++++++++ .../ath79/dts/ar7241_netgear_wnr2200-16m.dts | 34 ++++++++++++++ .../ath79/dts/ar7241_netgear_wnr2200-8m.dts | 34 ++++++++++++++ .../ath79/dts/ar7241_netgear_wnr2200.dtsi | 7 --- .../dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts | 9 ++++ target/linux/ath79/dts/ar7241_ubnt_unifi.dts | 15 ++++++ target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi | 2 - target/linux/ath79/dts/ar9331_glinet_6408.dts | 31 +++++++++++++ target/linux/ath79/dts/ar9331_glinet_6416.dts | 31 +++++++++++++ .../linux/ath79/dts/ar9331_glinet_64xx.dtsi | 11 ----- .../ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi | 34 ++++++++++++++ .../ath79/dts/ar9331_tplink_tl-wr710n.dtsi | 9 ---- target/linux/ath79/dts/ar9341_tplink.dtsi | 9 ---- .../ath79/dts/ar9341_tplink_tl-mr3420-v2.dts | 32 +++++++++++++ .../ath79/dts/ar9341_tplink_tl-wr841-v8.dts | 32 +++++++++++++ .../ath79/dts/ar9341_tplink_tl-wr842n-v2.dts | 30 ++++++++++++ .../ath79/dts/qca9531_glinet_gl-x300b.dts | 21 +++++++-- .../linux/ath79/dts/qca9533_qca_ap143-16m.dts | 28 +++++++++++ .../linux/ath79/dts/qca9533_qca_ap143-8m.dts | 28 +++++++++++ target/linux/ath79/dts/qca9533_qca_ap143.dtsi | 6 --- .../dts/qca9558_comfast_cf-wr650ac-v1.dts | 35 ++++++++++++++ .../dts/qca9558_comfast_cf-wr650ac-v2.dts | 35 ++++++++++++++ .../ath79/dts/qca9558_comfast_cf-wr650ac.dtsi | 7 +-- .../ath79/dts/qca9558_tplink_archer-c.dtsi | 7 --- .../ath79/dts/qca9558_tplink_archer-c5-v1.dts | 32 +++++++++++++ .../ath79/dts/qca9558_tplink_archer-c7-v1.dts | 32 +++++++++++++ .../ath79/dts/qca9558_tplink_archer-c7-v2.dts | 32 +++++++++++++ .../dts/qca9558_tplink_tl-wdr7500-v3.dts | 32 +++++++++++++ .../dts/qca9561_tplink_archer-c58-v1.dts | 32 +++++++++++++ .../dts/qca9561_tplink_archer-c59-v1.dts | 32 +++++++++++++ .../dts/qca9561_tplink_archer-c59-v2.dts | 32 +++++++++++++ .../ath79/dts/qca9561_tplink_archer-c5x.dtsi | 9 ---- .../dts/qca9561_tplink_archer-c60-v1.dts | 32 +++++++++++++ .../dts/qca9561_tplink_archer-c60-v2.dts | 32 +++++++++++++ .../dts/qca9561_tplink_archer-c60-v3.dts | 33 +++++++++++++ .../ath79/dts/qca9561_tplink_archer-c6x.dtsi | 9 ---- .../dts/qca9563_elecom_wrc-1750ghbk2-i.dts | 20 ++++++++ .../dts/qca9563_elecom_wrc-300ghbk2-i.dts | 20 ++++++++ .../ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi | 3 -- .../ath79/dts/qca9563_tplink_archer-a7-v5.dts | 26 +++++++++++ .../dts/qca9563_tplink_archer-c6-v2-us.dts | 24 ++++++++++ .../ath79/dts/qca9563_tplink_archer-c6-v2.dts | 24 ++++++++++ .../ath79/dts/qca9563_tplink_archer-c7-v5.dts | 26 +++++++++++ .../dts/qca9563_tplink_archer-x6-v2.dtsi | 11 ----- .../dts/qca9563_tplink_archer-x7-v5.dtsi | 5 -- .../ath79/dts/qca9563_tplink_re450-v2.dts | 26 +++++++++++ .../ath79/dts/qca9563_tplink_re450-v3.dts | 26 +++++++++++ .../linux/ath79/dts/qca9563_tplink_re450.dtsi | 6 --- .../ath79/dts/qca9563_tplink_re455-v1.dts | 26 +++++++++++ .../dts/qca9563_tplink_tl-wpa8630-v1.dts | 2 + .../ath79/dts/qca9563_tplink_tl-wpa8630.dtsi | 2 - .../dts/qca9563_tplink_tl-wpa8630p-v2-int.dts | 46 ++++++++++++++++++- .../qca9563_tplink_tl-wpa8630p-v2.0-eu.dts | 46 ++++++++++++++++++- .../qca9563_tplink_tl-wpa8630p-v2.1-eu.dts | 46 ++++++++++++++++++- .../dts/qca9563_tplink_tl-wpa8630p-v2.dtsi | 37 --------------- .../dts/qca9563_tplink_tl-wr1043n-v5.dts | 26 +++++++++++ .../ath79/dts/qca9563_tplink_tl-wr1043n.dtsi | 5 -- .../dts/qca9563_tplink_tl-wr1043nd-v4.dts | 26 +++++++++++ 64 files changed, 1406 insertions(+), 157 deletions(-) delete mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi index 369c89a97e..414d5e6d99 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi @@ -12,7 +12,6 @@ led-failsafe = &led_power_orange; led-running = &led_power_green; led-upgrade = &led_power_orange; - label-mac-device = ð0; }; extosc: ref { @@ -153,7 +152,7 @@ ath9k0: wifi@0,11 { compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; - mtd-mac-address = <&art 0xc>; + qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -181,7 +180,7 @@ ath9k1: wifi@0,12 { compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; + qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -209,8 +208,6 @@ pll-data = <0x11110000 0x00001099 0x00991099>; - mtd-mac-address = <&art 0x00>; - fixed-link { speed = <1000>; full-duplex; @@ -222,7 +219,5 @@ pll-data = <0x11110000 0x00001099 0x00991099>; - mtd-mac-address = <&art 0x06>; - phy-handle = <&phy4>; }; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts index 6d78c019da..0a133ce52e 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3700-v2", "qca,ar7161"; model = "Netgear WNDR3700 v2"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -33,3 +37,41 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + 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>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts index ad29d256f6..99bc5f56bb 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3700", "qca,ar7161"; model = "Netgear WNDR3700"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -34,7 +38,15 @@ }; }; +&ath9k0 { + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + &ath9k1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + /* The original WNDR3700(v1) variant have four antennae dedicated * to the 5GHz radio as well. Again, two antennae are available for * each chain to switch between. The following configuration is the @@ -54,3 +66,31 @@ output-high; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + 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>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts index 80b25492b1..0ad5c9d0e8 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3800", "qca,ar7161"; model = "Netgear WNDR3800"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -34,3 +38,41 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + 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>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts index cc51aca8b6..be997211a9 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndr3800ch", "qca,ar7161"; model = "Netgear WNDR3800CH"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -35,3 +39,40 @@ }; }; +&ath9k0 { + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + 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>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts index 8604414d19..fa0f40c424 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndrmac-v1", "qca,ar7161"; model = "Netgear WNDRMAC v1"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -33,3 +37,41 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + 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>; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts index bebd96c72f..ba96eba262 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wndrmac-v2", "qca,ar7161"; model = "Netgear WNDRMAC v2"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -34,3 +38,41 @@ read-only; }; }; + +&ath9k0 { + nvmem-cells = <&macaddr_art_c>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k1 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + 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>; + }; +}; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts index 3842238e54..f5c060d780 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wnr2200-16m", "qca,ar7241"; model = "Netgear WNR2200 (16M)"; + + aliases { + label-mac-device = ð1; + }; }; &partitions { @@ -33,3 +37,33 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k { + nvmem-cells = <&macaddr_art_0>; + 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 4eb15e2313..e47336e4d2 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts @@ -5,6 +5,10 @@ / { compatible = "netgear,wnr2200-8m", "qca,ar7241"; model = "Netgear WNR2200 (8M)"; + + aliases { + label-mac-device = ð1; + }; }; &partitions { @@ -33,3 +37,33 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&ath9k { + nvmem-cells = <&macaddr_art_0>; + 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.dtsi b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi index 0098b0f03e..6119af4a03 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi @@ -16,7 +16,6 @@ led-failsafe = &led_power_amber; led-running = &led_power_green; led-upgrade = &led_power_amber; - label-mac-device = ð1; }; ath9k-keys { @@ -154,14 +153,10 @@ ð0 { status = "okay"; - - mtd-mac-address = <&art 0x0>; }; ð1 { compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; - - mtd-mac-address = <&art 0x6>; }; &pcie { @@ -170,8 +165,6 @@ ath9k: wifi@0,0 { compatible = "pci168c,002e"; reg = <0x0000 0 0 0 0>; - mtd-mac-address = <&art 0x0>; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; 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 3a0cc4250e..9ccbdbd450 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 @@ -91,6 +91,11 @@ }; }; +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + ð1 { status = "okay"; @@ -107,6 +112,10 @@ #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_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts index 287e8cc7db..e8d903b305 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts @@ -80,6 +80,21 @@ }; }; +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + ð1 { compatible = "syscon", "simple-mfd"; }; + +&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/ar7241_ubnt_unifi.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi index 614ac1454f..54f133ab19 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi @@ -42,6 +42,4 @@ ð0 { status = "okay"; - - mtd-mac-address = <&art 0x0>; }; diff --git a/target/linux/ath79/dts/ar9331_glinet_6408.dts b/target/linux/ath79/dts/ar9331_glinet_6408.dts index 658fa1aa5e..0d3b7d6410 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6408.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6408.dts @@ -5,6 +5,10 @@ / { model = "GL.iNet 6408"; compatible = "glinet,6408", "qca,ar9331"; + + aliases { + label-mac-device = &wmac; + }; }; &spi { @@ -40,3 +44,30 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 189563aaf9..91b7cc0c1c 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6416.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6416.dts @@ -5,6 +5,10 @@ / { model = "GL.iNet 6416"; compatible = "glinet,6416", "qca,ar9331"; + + aliases { + label-mac-device = &wmac; + }; }; &spi { @@ -40,3 +44,30 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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_64xx.dtsi b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi index 2f92123c34..8d003ce090 100644 --- a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi +++ b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi @@ -6,10 +6,6 @@ #include / { - aliases { - label-mac-device = &wmac; - }; - keys { compatible = "gpio-keys"; @@ -48,8 +44,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - gmac-config { device = <&gmac>; @@ -60,8 +54,6 @@ ð1 { status = "okay"; - - mtd-mac-address = <&uboot 0x1fc00>; }; &usb { @@ -76,7 +68,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; 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 759e765294..61ef9fb99f 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi @@ -2,6 +2,12 @@ #include "ar9331_tplink_tl-wr710n.dtsi" +/ { + aliases { + label-mac-device = ð0; + }; +}; + &spi { status = "okay"; @@ -35,3 +41,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi index 9207a0fde0..329822ad10 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = ð0; }; keys { @@ -47,8 +46,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - gmac-config { device = <&gmac>; @@ -59,9 +56,6 @@ ð1 { status = "okay"; - - mtd-mac-address = <&uboot 0x1fc00>; - mac-address-increment = <(-1)>; }; &usb { @@ -77,7 +71,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9341_tplink.dtsi b/target/linux/ath79/dts/ar9341_tplink.dtsi index 0f6e0bc114..9c505f2785 100644 --- a/target/linux/ath79/dts/ar9341_tplink.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = &wmac; }; leds: leds { @@ -80,14 +79,9 @@ status = "okay"; phy-handle = <&swphy0>; - - mtd-mac-address = <&uboot 0x1fc00>; - mac-address-increment = <(-1)>; }; ð1 { - mtd-mac-address = <&uboot 0x1fc00>; - gmac-config { device = <&gmac>; switch-phy-swap = <1>; @@ -96,7 +90,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; 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 9adc9a1faf..f86c4423bf 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts @@ -6,6 +6,10 @@ model = "TP-Link TL-MR3420 v2"; compatible = "tplink,tl-mr3420-v2", "qca,ar9341"; + aliases { + label-mac-device = &wmac; + }; + keys { compatible = "gpio-keys"; @@ -91,3 +95,31 @@ &usb_phy { status = "okay"; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 cd7532d27a..d86571c531 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts @@ -6,6 +6,10 @@ model = "TP-Link TL-WR841N/ND v8"; compatible = "tplink,tl-wr841-v8", "qca,ar9341"; + aliases { + label-mac-device = &wmac; + }; + keys { compatible = "gpio-keys"; @@ -59,3 +63,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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-wr842n-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts index 8c27fe1971..5d20df9261 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts @@ -6,6 +6,10 @@ model = "TP-Link TL-WR842N/ND v2"; compatible = "tplink,tl-wr842n-v2", "qca,ar9341"; + aliases { + label-mac-device = &wmac; + }; + keys { compatible = "gpio-keys"; @@ -93,6 +97,32 @@ status = "okay"; }; +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + ð1 { phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9531_glinet_gl-x300b.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts index 5e722bbc26..5f5646b3e0 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts @@ -88,7 +88,7 @@ reg = <0>; spi-max-frequency = <25000000>; - nor_partitions: partitions { + partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; @@ -123,13 +123,16 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + phy-handle = <&swphy4>; }; ð1 { - mtd-mac-address = <&art 0x0>; - mtd-mac-address-increment = <1>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; }; &wmac { @@ -137,3 +140,13 @@ 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/qca9533_qca_ap143-16m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts index 31e61de175..05d87e3995 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts @@ -47,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&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 bdb93420b5..db6a92720b 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts @@ -47,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&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.dtsi b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi index 95a24175a5..2836234b4c 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143.dtsi +++ b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi @@ -97,14 +97,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; - phy-handle = <&swphy4>; }; ð1 { - mtd-mac-address = <&art 0x6>; - gmac-config { device = <&gmac>; }; @@ -112,8 +108,6 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; }; &usb0 { 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 639c877177..ba145d6fb0 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts @@ -46,3 +46,38 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 5dda5f1869..d0929f981c 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts @@ -46,3 +46,38 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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.dtsi b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi index d8a311614f..4daad4b0b0 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi @@ -84,7 +84,7 @@ status = "okay"; pll-data = <0xa6000000 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x0>; + fixed-link { speed = <1000>; full-duplex; @@ -95,7 +95,7 @@ status = "okay"; pll-data = <0x03000101 0x00000101 0x00001616>; - mtd-mac-address = <&art 0x6>; + fixed-link { speed = <1000>; full-duplex; @@ -104,9 +104,6 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&art 0x18>; }; // This node is required for the Ethernet ports to work correctly. diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi index 3f965f5b95..f629838f1a 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = ð1; }; leds: leds { @@ -149,8 +148,6 @@ ð0 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; - mac-address-increment = <1>; phy-handle = <&phy0>; pll-data = <0x56000000 0x00000101 0x00001616>; @@ -163,7 +160,6 @@ ð1 { status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -174,7 +170,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; 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 9ffbce0a21..85012d3aac 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c5-v1", "qca,qca9558"; model = "TP-Link Archer C5 v1"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -43,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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_tplink_archer-c7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts index e2d1d63813..dfa64d6ca3 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c7-v1", "qca,qca9558"; model = "TP-Link Archer C7 v1"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -43,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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_tplink_archer-c7-v2.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts index be99b8e3e4..9e959a276a 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c7-v2", "qca,qca9558"; model = "TP-Link Archer C7 v2"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -43,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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_tplink_tl-wdr7500-v3.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts index 04368b9244..998ede85cb 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,tl-wdr7500-v3", "qca,qca9558"; model = "TP-Link TL-WDR7500 v3"; + + aliases { + label-mac-device = ð1; + }; }; &keys { @@ -43,3 +47,31 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9561_tplink_archer-c58-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts index ea86b8f35e..180efada12 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c58-v1", "qca,qca9560"; model = "TP-Link Archer C58 v1"; + + aliases { + label-mac-device = ð1; + }; }; &spi { @@ -52,3 +56,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9561_tplink_archer-c59-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts index 07e8379172..c385eb1592 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c59-v1", "qca,qca9560"; model = "TP-Link Archer C59 v1"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -76,3 +80,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9561_tplink_archer-c59-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts index c1321f5d20..5a277723e3 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c59-v2", "qca,qca9560"; model = "TP-Link Archer C59 v2"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -82,3 +86,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9561_tplink_archer-c5x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi index 673805e132..bb942078dc 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi @@ -13,7 +13,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ð1; }; led_spi { @@ -126,9 +125,6 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&info 0x8>; - mac-address-increment = <1>; - gmac-config { device = <&gmac>; @@ -139,13 +135,8 @@ ð1 { status = "okay"; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; 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 a3bbf3e49c..f5ab2e5977 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c60-v1", "qca,qca9561"; model = "TP-Link Archer C60 v1"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -64,3 +68,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9561_tplink_archer-c60-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts index 2bcab77dbf..014222770f 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c60-v2", "qca,qca9561"; model = "TP-Link Archer C60 v2"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -70,3 +74,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9561_tplink_archer-c60-v3.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts index c1a0a8c2e5..a2f46ecd60 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c60-v3", "qca,qca9561"; model = "TP-Link Archer C60 v3"; + + aliases { + label-mac-device = ð1; + }; }; &leds { @@ -13,6 +17,7 @@ gpios = <&gpio 19 GPIO_ACTIVE_LOW>; }; }; + &spi { status = "okay"; @@ -64,3 +69,31 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +ð1 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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/qca9561_tplink_archer-c6x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi index 5c5d1620b9..e5f9d0bcc5 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ð1; }; keys { @@ -71,20 +70,12 @@ status = "okay"; phy-handle = <&swphy4>; - - mtd-mac-address = <&info 0x8>; - mac-address-increment = <1>; }; ð1 { status = "okay"; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; 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 b4f7718230..510b577d19 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts @@ -50,3 +50,23 @@ &pcie { status = "okay"; }; + +ð0 { + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&wmac { + 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/qca9563_elecom_wrc-300ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts index 3af6f59d09..28ffce6434 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts @@ -40,3 +40,23 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&wmac { + 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/qca9563_elecom_wrc-ghbk2-i.dtsi b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi index 044485316c..a6706da1a5 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi @@ -105,13 +105,10 @@ pll-data = <0x03000101 0x00000101 0x00001919>; - mtd-mac-address = <&art 0x1002>; - mac-address-increment = <(-1)>; phy-mode = "sgmii"; phy-handle = <&phy0>; }; &wmac { status = "okay"; - mtd-cal-data = <&art 0x1000>; }; 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 eecfe35455..3bb6d685cc 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-a7-v5", "qca,qca9563"; model = "TP-Link Archer A7 v5"; + + aliases { + label-mac-device = ð0; + }; }; &keys { @@ -59,3 +63,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 892e87ebaf..76e19294f8 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 @@ -7,6 +7,8 @@ model = "TP-Link Archer C6 v2 (US) / A6 v2 (US/TW)"; aliases { + label-mac-device = ð0; + led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -125,3 +127,25 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 c64402bcfe..c40fe0f292 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts @@ -7,6 +7,8 @@ model = "TP-Link Archer C6 v2 (EU/RU/JP)"; aliases { + label-mac-device = ð0; + led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -119,3 +121,25 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 da8d0c1fc7..d2631e227c 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,archer-c7-v5", "qca,qca9563"; model = "TP-Link Archer C7 v5"; + + aliases { + label-mac-device = ð0; + }; }; &keys { @@ -65,3 +69,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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-x6-v2.dtsi b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi index 1a074e63a6..fc6206d891 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi @@ -5,12 +5,6 @@ #include #include -/ { - aliases { - label-mac-device = ð0; - }; -}; - &pcie { status = "okay"; }; @@ -37,13 +31,8 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi index 3644cf863e..6763fe9d3d 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = ð0; }; leds { @@ -162,13 +161,9 @@ pll-data = <0x03000101 0x00000101 0x00001919>; phy-mode = "sgmii"; - mtd-mac-address = <&info 0x8>; phy-handle = <&phy0>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts index d0356d6680..73cf5323ee 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,re450-v2", "qca,qca9563"; model = "TP-Link RE450 v2"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -44,3 +48,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 695f78ed02..ffebcb9bae 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,re450-v3", "qca,qca9563"; model = "TP-Link RE450 v3"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -50,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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.dtsi b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi index 3354baee08..3841a4c8fd 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi @@ -7,7 +7,6 @@ / { aliases { - label-mac-device = ð0; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -129,13 +128,8 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; - - mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts index b6c1efb846..bf4e5848af 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,re455-v1", "qca,qca9563"; model = "TP-Link RE455 v1"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { @@ -50,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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-wpa8630-v1.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts index d0fa6d332f..0ccfb42d9a 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts @@ -43,6 +43,8 @@ }; &wmac { + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_uboot_fc00>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi index 5fd314b856..431c990815 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi @@ -128,6 +128,4 @@ &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; }; 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 50a88f344a..95ff6b0363 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 @@ -1,13 +1,35 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" +#include "qca9563_tplink_tl-wpa8630.dtsi" / { compatible = "tplink,tl-wpa8630p-v2-int", "qca,qca9563"; model = "TP-Link WPA8630P v2 (Int.)"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x040000 0x5e0000>; + }; + partition@620000 { label = "partition-table"; reg = <0x620000 0x010000>; @@ -32,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 9eff2fcf68..34efeb9450 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 @@ -1,13 +1,35 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" +#include "qca9563_tplink_tl-wpa8630.dtsi" / { compatible = "tplink,tl-wpa8630p-v2.0-eu", "qca,qca9563"; model = "TP-Link WPA8630P v2.0 (EU)"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x040000 0x5e0000>; + }; + partition@620000 { label = "partition-table"; reg = <0x620000 0x010000>; @@ -32,3 +54,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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 e8d92419c6..a477b50417 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 @@ -1,13 +1,35 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" +#include "qca9563_tplink_tl-wpa8630.dtsi" / { compatible = "tplink,tl-wpa8630p-v2.1-eu", "qca,qca9563"; model = "TP-Link WPA8630P v2.1 (EU)"; + + aliases { + label-mac-device = ð0; + }; }; &partitions { + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x040000 0x5e0000>; + }; + /* 0x620000 to 0x680000 is empty in OEM partitioning */ partition@680000 { @@ -28,3 +50,25 @@ read-only; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi deleted file mode 100644 index 9e6d23de4e..0000000000 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qca9563_tplink_tl-wpa8630.dtsi" - -/ { - aliases { - label-mac-device = ð0; - }; -}; - -&partitions { - partition@0 { - label = "factory-uboot"; - reg = <0x000000 0x020000>; - read-only; - }; - - partition@20000 { - label = "u-boot"; - reg = <0x020000 0x020000>; - read-only; - }; - - partition@40000 { - compatible = "tplink,firmware"; - label = "firmware"; - reg = <0x040000 0x5e0000>; - }; -}; - -ð0 { - mtd-mac-address = <&info 0x8>; -}; - -&wmac { - mtd-mac-address = <&info 0x8>; -}; 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 cba124aa85..6d75824515 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts @@ -5,6 +5,10 @@ / { compatible = "tplink,tl-wr1043n-v5", "qca,qca9563"; model = "TP-Link TL-WR1043N v5"; + + aliases { + label-mac-device = &wmac; + }; }; &spi { @@ -70,3 +74,25 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi index c8c69e8a65..b99412eb79 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi @@ -11,7 +11,6 @@ led-failsafe = &led_system; led-running = &led_system; led-upgrade = &led_system; - label-mac-device = &wmac; }; leds: leds { @@ -103,14 +102,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&info 0x8>; phy-mode = "sgmii"; phy-handle = <&phy0>; }; &wmac { status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; }; 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 ddb986ffdd..bf01f06de6 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts @@ -6,6 +6,10 @@ compatible = "tplink,tl-wr1043nd-v4", "qca,qca9563"; model = "TP-Link TL-WR1043ND v4"; + aliases { + label-mac-device = &wmac; + }; + gpio-export { compatible = "gpio-export"; #size-cells = <0>; @@ -99,3 +103,25 @@ #trigger-source-cells = <0>; }; }; + +ð0 { + nvmem-cells = <&macaddr_info_8>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + mtd-cal-data = <&art 0x1000>; + + 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>; + }; +}; From c5616a8ae1649ef55d362462a39aa133b65dc1e3 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 19 Aug 2021 01:23:41 +0100 Subject: [PATCH 09/18] image: fix build with SELinux The option '-xattr' for mksquashfs4 should be '-xattrs' which lead to build failure with SELinux enabled. Add the missing 's'. Fixes: 4baf47b9a8 ("images: squashfs: xattrs should not depend on buld host") Signed-off-by: Daniel Golle --- include/image.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/image.mk b/include/image.mk index d2b34d25a7..6298e3085e 100644 --- a/include/image.mk +++ b/include/image.mk @@ -75,7 +75,7 @@ JFFS2OPTS += $(MKFS_DEVTABLE_OPT) SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE) SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' -SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattr,-no-xattrs) +SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattrs,-no-xattrs) SQUASHFSCOMP := gzip LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2 ifeq ($(CONFIG_SQUASHFS_XZ),y) From cc0112d9d73302b7548a8b3b089d4f7a5308a2fd Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 20 Aug 2021 01:46:14 +0100 Subject: [PATCH 10/18] selinux-policy: update to version 0.9 592ac0f add a note 4bacd14 sslcertfile: list /etc/ssl 7bdefa4 example: indicate that skip is an option d1e9a85 wifi: sys pipe usage eb903e1 README: add note about policycoreutils-setfiles weak dependency 762e011 ttyd: signull all subjects fbfc079 acme: add basic support for acme_cleanup.sh and acme_setup.sh 9ac7592 acme: transition to sys.subj on generic initscript execution f3dd1ba acme: missing rules related to sys.subj trans on file.initscriptfile ae273fa odhcp6c/netifd: support drop-in directories 5fa9b41 subj: do not encourage misconfiguration 44722b6 blockd, logd, odhcpc6, ubiutil, mtdstordev a775d93 21.02 related a473691 rcboot runs rcuhttpd which creates /tmp/etc for /tmp/etc/uhttpd 290e9fb rcuhttpd: related to rcboot and uci-defaults 3fc0d8b rcuhttpd: lists /etc/uci-defaults 1f5ef48 removes ubvol.lock policy and adds move mtd/ubi partitions Signed-off-by: Daniel Golle --- package/system/selinux-policy/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile index 4980ed6f21..219ebc7995 100644 --- a/package/system/selinux-policy/Makefile +++ b/package/system/selinux-policy/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=selinux-policy PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git -PKG_VERSION:=0.8 -PKG_MIRROR_HASH:=3b58f751a21394e3aef47fd6c9fe9430fadde6427deb5c79f08478904837ec91 +PKG_VERSION:=0.9 +PKG_MIRROR_HASH:=f1a37a4fc104fbacde3012178fc117b473899360f26a8735156394288441d99c PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host From 7f1b0f68f16c3f063322887ee10b0ae8f47603af Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 19 Aug 2021 01:16:39 +0200 Subject: [PATCH 11/18] ramips: convert mtd-mac-address to nvmem for D-Link DIR-8xx Convert this series by moving the definitions to the individual devices. Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7621_dlink_dir-853-a3.dts | 1 + .../ramips/dts/mt7621_dlink_dir-853-r1.dts | 26 +++++++++++++---- .../ramips/dts/mt7621_dlink_dir-860l-b1.dts | 3 +- .../ramips/dts/mt7621_dlink_dir-867-a1.dts | 28 +++++++++++++++++++ .../ramips/dts/mt7621_dlink_dir-878-a1.dts | 28 +++++++++++++++++++ .../ramips/dts/mt7621_dlink_dir-882-a1.dts | 28 +++++++++++++++++++ .../ramips/dts/mt7621_dlink_dir-882-r1.dts | 28 +++++++++++++++++++ .../ramips/dts/mt7621_dlink_dir-8xx.dtsi | 8 +----- 8 files changed, 137 insertions(+), 13 deletions(-) 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 e866fb1242..49d0c050f5 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts @@ -11,6 +11,7 @@ aliases { label-mac-device = &gmac0; + led-boot = &led_power_orange; led-failsafe = &led_power_blue; led-running = &led_power_blue; 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 09e46b011e..c0ad172939 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts @@ -13,6 +13,7 @@ aliases { label-mac-device = &wan; + led-boot = &led_power_orange; led-failsafe = &led_power_blue; led-running = &led_power_blue; @@ -93,16 +94,20 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - mtd-mac-address = <&factory 0x4>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; }; &gmac0 { - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <(-1)>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; }; &switch0 { @@ -130,8 +135,9 @@ wan: port@4 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0x4>; - mtd-mac-address-increment = <(-2)>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; }; }; }; @@ -142,3 +148,13 @@ function = "gpio"; }; }; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts index 26f142dcff..7a48a931e7 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -8,11 +8,12 @@ model = "D-Link DIR-860L B1"; aliases { + label-mac-device = &gmac0; + led-boot = &led_power_green; led-failsafe = &led_power_green; led-running = &led_power_green; led-upgrade = &led_power_green; - label-mac-device = &gmac0; }; leds { diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts index e02eb9eebf..0f09fae246 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts @@ -6,4 +6,32 @@ / { compatible = "dlink,dir-867-a1", "mediatek,mt7621-soc"; model = "D-Link DIR-867 A1"; + + aliases { + label-mac-device = &gmac0; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts index 1f1d5824f2..9c73ffa123 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts @@ -6,4 +6,32 @@ / { compatible = "dlink,dir-878-a1", "mediatek,mt7621-soc"; model = "D-Link DIR-878 A1"; + + aliases { + label-mac-device = &gmac0; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts index 01739fc258..3db056f68f 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts @@ -6,6 +6,10 @@ / { compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc"; model = "D-Link DIR-882 A1"; + + aliases { + label-mac-device = &gmac0; + }; }; &leds { @@ -23,3 +27,27 @@ linux,default-trigger = "usbport"; }; }; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts index 9b0cd8e7be..6cfa28b7cf 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts @@ -6,6 +6,10 @@ / { compatible = "dlink,dir-882-r1", "mediatek,mt7621-soc"; model = "D-Link DIR-882 R1"; + + aliases { + label-mac-device = &gmac0; + }; }; &leds { @@ -23,3 +27,27 @@ linux,default-trigger = "usbport"; }; }; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi index 7ab0e8bd5d..556ca8b003 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi @@ -7,7 +7,6 @@ / { aliases { - label-mac-device = &gmac0; led-boot = &led_power_orange; led-failsafe = &led_power_green; led-running = &led_power_green; @@ -91,10 +90,6 @@ }; }; -&gmac0 { - mtd-mac-address = <&factory 0xe000>; -}; - &switch0 { ports { port@0 { @@ -117,10 +112,9 @@ label = "lan1"; }; - port@4 { + wan: port@4 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0xe006>; }; }; }; From 9cb5853592c5f146fd82506168f53d8ada0639fa Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 19 Aug 2021 01:32:56 +0200 Subject: [PATCH 12/18] ramips: fix indent in DTS for GL.iNet VIXMINI/microuter-N300 Use correct indent. Signed-off-by: Adrian Schmutzler --- target/linux/ramips/dts/mt7628an_glinet_microuter-n300.dts | 2 +- target/linux/ramips/dts/mt7628an_glinet_vixmini.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_glinet_microuter-n300.dts b/target/linux/ramips/dts/mt7628an_glinet_microuter-n300.dts index 09afe7211b..49695e2222 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_microuter-n300.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_microuter-n300.dts @@ -8,5 +8,5 @@ }; &firmware_part { - reg = <0x50000 0xfb0000>; + reg = <0x50000 0xfb0000>; }; diff --git a/target/linux/ramips/dts/mt7628an_glinet_vixmini.dts b/target/linux/ramips/dts/mt7628an_glinet_vixmini.dts index 02c29d1ba0..87ea22fc6a 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_vixmini.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_vixmini.dts @@ -8,5 +8,5 @@ }; &firmware_part { - reg = <0x50000 0x7b0000>; + reg = <0x50000 0x7b0000>; }; From f13c7a56f0352b001e9495fb64fc4e7cfa268d31 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 19 Aug 2021 01:50:27 +0200 Subject: [PATCH 13/18] ramips: remove redundant nvmem definitions Due to use of a script when migrating from mtd-mac-address, a few of the definitions are redundant in DTSI and DTS files. Remove those. Signed-off-by: Adrian Schmutzler --- target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts | 10 ---------- .../linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts | 10 ---------- target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts | 10 ---------- .../linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts | 10 ---------- target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts | 10 ---------- target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts | 10 ---------- target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts | 10 ---------- target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts | 10 ---------- target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts | 10 ---------- .../linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts | 10 ---------- target/linux/ramips/dts/mt7628an_netgear_r6120.dts | 10 ---------- .../linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts | 10 ---------- .../linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts | 10 ---------- .../linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts | 10 ---------- .../linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts | 10 ---------- .../linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts | 10 ---------- .../linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts | 10 ---------- 17 files changed, 170 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts index 6222efcca5..10aa0ddf6f 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts @@ -110,13 +110,3 @@ pinctrl-names = "default"; pinctrl-0 = <&pa_pins>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts index 2248da5b10..e3c077cb0d 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts @@ -82,13 +82,3 @@ nvmem-cell-names = "mac-address"; mac-address-increment = <(-1)>; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts index ba9bf1db99..88165c02be 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts @@ -62,13 +62,3 @@ nvmem-cell-names = "mac-address"; mac-address-increment = <(-1)>; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts index db92af7e37..aefd951f43 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts @@ -82,13 +82,3 @@ nvmem-cell-names = "mac-address"; mac-address-increment = <(-1)>; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts index 8af4d2cc08..c74fee3102 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts @@ -23,13 +23,3 @@ }; }; }; - -&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_asiarf_ap7621-nv1.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts index 4900e8db66..907b6d1470 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts @@ -28,13 +28,3 @@ }; }; }; - -&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_dlink_dir-1960-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts index 82ba8cf3f7..d352d27b76 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts @@ -27,13 +27,3 @@ nvmem-cell-names = "mac-address"; mac-address-increment = <2>; }; - -&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_dlink_dir-2640-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts index 14a79cef51..127a9a3417 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts @@ -34,13 +34,3 @@ nvmem-cell-names = "mac-address"; mac-address-increment = <2>; }; - -&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_dlink_dir-2660-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts index a90856c0b6..02fd35d60e 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts @@ -34,13 +34,3 @@ nvmem-cell-names = "mac-address"; mac-address-increment = <2>; }; - -&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_ubnt_edgerouter-x-sfp.dts b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts index 8f97ba3353..897aa90ea3 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x-sfp.dts @@ -72,13 +72,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_22: macaddr@22 { - reg = <0x22 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts index 02a22b7495..e9fc6d7090 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts +++ b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts @@ -48,13 +48,3 @@ nvmem-cell-names = "mac-address"; mac-address-increment = <(2)>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts index c2c6e922b7..02d0144f4a 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -106,13 +106,3 @@ mac-address-increment = <(-1)>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts index 4f5faf2ee0..7f5b3d557a 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts @@ -101,13 +101,3 @@ mac-address-increment = <(-1)>; }; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts index 8fc2334ae2..ab81b09493 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -101,13 +101,3 @@ mac-address-increment = <(-1)>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts index 2a6963ab1c..164cf7a170 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts @@ -99,13 +99,3 @@ mac-address-increment = <(-1)>; }; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts index 2141abc442..46c18d6b2d 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts @@ -52,13 +52,3 @@ nvmem-cells = <&macaddr_factory_f100>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts index fe10600cb9..9be8529bbf 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts @@ -97,13 +97,3 @@ mac-address-increment = <(-1)>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; From 41aa765946c55a91543cc872f595f5e3298dcf0a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 20 Aug 2021 00:09:58 +0200 Subject: [PATCH 14/18] ath79: remove redundant nvmem definitions Due to use of a script when migrating from mtd-mac-address, a few of the definitions are redundant in DTSI and DTS files. Remove those and consolidate the definitions in parent DTSI files in a few cases. Signed-off-by: Adrian Schmutzler --- target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi | 10 ---------- target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi | 10 ---------- target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts | 4 ++-- target/linux/ath79/dts/ar9342_ubnt_wa.dtsi | 10 ++++++++++ target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi | 10 ---------- target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi | 10 ---------- .../linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts | 10 ---------- target/linux/ath79/dts/ar9344_teltonika_rut955.dts | 10 ---------- target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi | 10 ---------- target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts | 10 ---------- target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts | 10 ---------- target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts | 10 ---------- target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts | 10 ---------- target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts | 10 ---------- target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi | 10 ---------- target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi | 10 ---------- target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi | 10 ++++++++++ target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi | 10 ---------- target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts | 10 ---------- target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts | 10 ---------- 20 files changed, 22 insertions(+), 172 deletions(-) diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi index ceb6b1d7a2..2bded28ea4 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi @@ -21,13 +21,3 @@ &ath9k { compatible = "pci168c,002a"; }; - -&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 40a2ca2399..9d896360dc 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi @@ -44,13 +44,3 @@ &ath9k { compatible = "pci168c,002b"; }; - -&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/ar7242_ubnt_edgeswitch-8xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts index ec17d59d1a..f5433a30a3 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts @@ -169,7 +169,6 @@ full-duplex; }; }; - }; }; }; @@ -177,12 +176,13 @@ ð0 { status = "okay"; + phy-handle = <&phy0>; phy-mode = "rgmii-rxid"; pll-data = <0x16000000 0x00000101 0x00001313>; + nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; - phy-handle = <&phy0>; fixed-link { speed = <1000>; full-duplex; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index ac036ccd85..549daace7e 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -81,3 +81,13 @@ qca,disable-5ghz; 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_wa_1port.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi index bd6feb3d78..045cbe8985 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa_1port.dtsi @@ -30,13 +30,3 @@ rxdv-delay = <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/ar9342_ubnt_wa_2port.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi index 5024a140f3..2567c77759 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa_2port.dtsi @@ -38,13 +38,3 @@ rxdv-delay = <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/ar9344_teltonika_rut955-h7v3c0.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts index e017ae2308..2cb8d4015c 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts @@ -192,13 +192,3 @@ pinctrl-single,bits = <0x0 0x002e0000 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_teltonika_rut955.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts index 56821fccde..7a1f05afcc 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts @@ -188,13 +188,3 @@ <0x14 0x08 0xff>; }; }; - -&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_2port.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi index d539d2e0a6..e35fa486e4 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe_2port.dtsi @@ -54,13 +54,3 @@ switch-only-mode = <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/qca9533_tplink_cpe220-v3.dts b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts index fb31aa2872..920d2db996 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts @@ -29,13 +29,3 @@ switch-only-mode = <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_devolo_dvl1200e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts index d078df1989..af305f8f07 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts @@ -67,13 +67,3 @@ qca955x-sgmii-fixup; }; - -&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_devolo_dvl1750e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts index d60e7c4857..6202ff3799 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts @@ -102,13 +102,3 @@ qca955x-sgmii-fixup; }; - -&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 ff33a075f5..211255cdde 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts @@ -24,13 +24,3 @@ mac-address-increment = <16>; }; }; - -&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-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts index 12ebb67ba6..0d29c5cf06 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts @@ -24,13 +24,3 @@ mac-address-increment = <16>; }; }; - -&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_ubnt_unifiac-lite.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi index d2797086f4..5eb358014b 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dtsi @@ -28,13 +28,3 @@ pll-data = <0x03000000 0x00000101 0x00001313>; }; - -&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_ubnt_unifiac-pro.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi index f3dc068605..dbf6c27146 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dtsi @@ -29,13 +29,3 @@ nvmem-cell-names = "mac-address"; 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/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 42fe25c781..2e407c3486 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -105,3 +105,13 @@ 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/tp9343_tplink_tl-wr940n-v3.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi index 416623fec4..b2c009c346 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi @@ -67,13 +67,3 @@ 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/tp9343_tplink_tl-wr940n-v4.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts index 35facbdade..daf7779314 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts @@ -69,13 +69,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/tp9343_tplink_tl-wr940n-v6.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts index 1bc3b0ae90..409f288f07 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts @@ -33,13 +33,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>; - }; -}; From 8a78d6129975bb6faf168c5b51c05186e9f90856 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 20 Aug 2021 00:18:12 +0200 Subject: [PATCH 15/18] ramips: convert mtd-mac-address to nvmem for UniElec devices Convert this series by moving the definitions to the individual devices. Now all devices on ramips are converted. Signed-off-by: Adrian Schmutzler --- .../dts/mt7621_unielec_u7621-01-16m.dts | 21 +++++++++++++++++++ .../ramips/dts/mt7621_unielec_u7621-01.dtsi | 8 +------ .../dts/mt7621_unielec_u7621-06-16m.dts | 21 +++++++++++++++++++ .../dts/mt7621_unielec_u7621-06-64m.dts | 21 +++++++++++++++++++ .../ramips/dts/mt7621_unielec_u7621-06.dtsi | 8 +------ .../dts/mt7628an_unielec_u7628-01-16m.dts | 15 +++++++++++++ .../ramips/dts/mt7628an_unielec_u7628-01.dtsi | 4 ---- 7 files changed, 80 insertions(+), 18 deletions(-) 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 d063f08711..84172cdd17 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts @@ -46,3 +46,24 @@ }; }; }; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&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_unielec_u7621-01.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi index b9b16fbb4b..1d070c7909 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi @@ -72,17 +72,11 @@ }; }; -&gmac0 { - mtd-mac-address = <&factory 0xe000>; -}; - &switch0 { ports { - port@0 { + wan: port@0 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mac-address-increment = <1>; }; port@1 { 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 e9789cff5d..41aa2dce5e 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts @@ -51,3 +51,24 @@ }; }; }; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&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_unielec_u7621-06-64m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts index 74e4d6625b..a66969a803 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts @@ -52,3 +52,24 @@ }; }; }; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&wan { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&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_unielec_u7621-06.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi index 29e6251721..8dad53812f 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi @@ -73,10 +73,6 @@ status = "okay"; }; -&gmac0 { - mtd-mac-address = <&factory 0xe000>; -}; - &switch0 { ports { port@0 { @@ -99,11 +95,9 @@ label = "lan4"; }; - port@4 { + wan: port@4 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0xe000>; - mac-address-increment = <1>; }; }; }; 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 c25a31f0ab..8037b3a304 100644 --- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts @@ -51,3 +51,18 @@ }; }; }; + +ðernet { + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi index 805d5debf5..f25e28abd8 100644 --- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi @@ -85,10 +85,6 @@ status = "okay"; }; -ðernet { - mtd-mac-address = <&factory 0x28>; -}; - &wmac { status = "okay"; From adb3e46616c69472964bfc0763ff622f468cb2ff Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 20 Aug 2021 14:27:13 +0200 Subject: [PATCH 16/18] lantiq: convert mtd-mac-address to nvmem for Fritz!Box 736x Convert this series by moving the definitions to the individual devices. Signed-off-by: Adrian Schmutzler --- .../boot/dts/lantiq/vr9_avm_fritz7360-v2.dts | 16 ++++++++++++++++ .../mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts | 16 ++++++++++++++++ .../mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts | 16 ++++++++++++++++ .../mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi | 5 ----- 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts index 3bd6ff0ee7..8881745819 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts @@ -51,3 +51,19 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_urlader_a91>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; +}; + +&urlader { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_urlader_a91: macaddr@a91 { + reg = <0xa91 0x6>; + }; +}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts index 898ca00c34..945c553688 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts @@ -51,3 +51,19 @@ }; }; }; + +ð0 { + nvmem-cells = <&macaddr_urlader_a91>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; +}; + +&urlader { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_urlader_a91: macaddr@a91 { + reg = <0xa91 0x6>; + }; +}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts index c26908642c..b1423e5dea 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts @@ -83,3 +83,19 @@ #address-cells = <2>; }; }; + +ð0 { + nvmem-cells = <&macaddr_urlader_a91>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; +}; + +&urlader { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_urlader_a91: macaddr@a91 { + reg = <0xa91 0x6>; + }; +}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi index d91dc74e2f..83ef415423 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi @@ -80,11 +80,6 @@ }; }; -ð0 { - mtd-mac-address = <&urlader 0xa91>; - mac-address-increment = <(-2)>; -}; - &gphy0 { lantiq,gphy-mode = ; }; From 05ccca031e1654d5cdff912dd7276cca40d37e44 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 20 Aug 2021 14:42:56 +0200 Subject: [PATCH 17/18] mediatek: convert mtd-mac-address to nvmem for MT7629 RFB This conversion appears to have been overlooked since it's in a kernel patch. Signed-off-by: Adrian Schmutzler --- .../101-dts-update-mt7629-rfb.patch | 39 ++++++++++++---- .../130-dts-mt7629-add-snand-support.patch | 2 +- ...dts-mediatek-Update-mt7629-PCIe-node.patch | 2 +- .../patches-5.4/0005-dts-mt7629-add-gsw.patch | 45 ++++++++++++++----- ...ts-mt7629-rfb-fix-firmware-partition.patch | 2 +- .../0307-dts-mt7629-add-snand-support.patch | 2 +- ...dts-mediatek-Update-mt7629-PCIe-node.patch | 2 +- 7 files changed, 70 insertions(+), 24 deletions(-) diff --git a/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch b/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch index 8d3e283315..254b5f9eb7 100644 --- a/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch +++ b/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch @@ -8,23 +8,28 @@ }; gpio-keys { -@@ -69,6 +70,7 @@ - gmac0: mac@0 { +@@ -70,6 +71,10 @@ compatible = "mediatek,eth-mac"; reg = <0>; -+ mtd-mac-address = <&factory 0x2a>; phy-mode = "2500base-x"; ++ ++ nvmem-cells = <&macaddr_factory_2a>; ++ nvmem-cell-names = "mac-address"; ++ fixed-link { speed = <2500>; -@@ -80,6 +82,7 @@ - gmac1: mac@1 { - compatible = "mediatek,eth-mac"; + full-duplex; +@@ -82,6 +87,9 @@ reg = <1>; -+ mtd-mac-address = <&factory 0x24>; phy-mode = "gmii"; phy-handle = <&phy0>; ++ ++ nvmem-cells = <&macaddr_factory_24>; ++ nvmem-cell-names = "mac-address"; }; -@@ -133,8 +136,9 @@ + + mdio: mdio-bus { +@@ -133,8 +141,9 @@ }; partition@b0000 { @@ -35,3 +40,21 @@ }; }; }; +@@ -272,3 +281,17 @@ + pinctrl-0 = <&watchdog_pins>; + status = "okay"; + }; ++ ++&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>; ++ }; ++}; diff --git a/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch b/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch index 479694b400..8febc65d1b 100644 --- a/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch +++ b/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch @@ -42,7 +42,7 @@ Signed-off-by: Xiangsheng Hou "mediatek,mt7622-spi"; --- a/arch/arm/boot/dts/mt7629-rfb.dts +++ b/arch/arm/boot/dts/mt7629-rfb.dts -@@ -249,6 +249,52 @@ +@@ -254,6 +254,52 @@ }; }; diff --git a/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch b/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch index 799cc31ab7..252ef080f5 100644 --- a/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch +++ b/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch @@ -135,7 +135,7 @@ Signed-off-by: chuanjia.liu --- a/arch/arm/boot/dts/mt7629-rfb.dts +++ b/arch/arm/boot/dts/mt7629-rfb.dts -@@ -144,9 +144,10 @@ +@@ -149,9 +149,10 @@ }; }; diff --git a/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch b/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch index 773a69f052..4028bad4df 100644 --- a/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch +++ b/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch @@ -22,27 +22,31 @@ memory@40000000 { device_type = "memory"; reg = <0x40000000 0x10000000>; -@@ -69,6 +77,7 @@ - gmac0: mac@0 { +@@ -70,6 +78,10 @@ compatible = "mediatek,eth-mac"; reg = <0>; -+ mtd-mac-address = <&factory 0x2a>; phy-mode = "2500base-x"; ++ ++ nvmem-cells = <&macaddr_factory_2a>; ++ nvmem-cell-names = "mac-address"; ++ fixed-link { speed = <2500>; -@@ -80,6 +89,7 @@ - gmac1: mac@1 { - compatible = "mediatek,eth-mac"; + full-duplex; +@@ -82,6 +94,9 @@ reg = <1>; -+ mtd-mac-address = <&factory 0x24>; phy-mode = "gmii"; phy-handle = <&phy0>; ++ ++ nvmem-cells = <&macaddr_factory_24>; ++ nvmem-cell-names = "mac-address"; }; -@@ -93,6 +103,26 @@ - }; + + mdio: mdio-bus { +@@ -94,6 +109,26 @@ }; }; -+ + +&gsw { + mediatek,mdio = <&mdio>; + mediatek,portmap = "llllw"; @@ -62,6 +66,25 @@ + }; + }; +}; - ++ &i2c { pinctrl-names = "default"; + pinctrl-0 = <&i2c_pins>; +@@ -272,3 +307,17 @@ + pinctrl-0 = <&watchdog_pins>; + status = "okay"; + }; ++ ++&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>; ++ }; ++}; diff --git a/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch b/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch index 5d0a19ed4c..2c48e5706f 100644 --- a/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch +++ b/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/mt7629-rfb.dts +++ b/arch/arm/boot/dts/mt7629-rfb.dts -@@ -163,8 +163,9 @@ +@@ -168,8 +168,9 @@ }; partition@b0000 { diff --git a/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch b/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch index 753c1117b9..233face4c5 100644 --- a/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch +++ b/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch @@ -42,7 +42,7 @@ Signed-off-by: Xiangsheng Hou "mediatek,mt7622-spi"; --- a/arch/arm/boot/dts/mt7629-rfb.dts +++ b/arch/arm/boot/dts/mt7629-rfb.dts -@@ -276,6 +276,52 @@ +@@ -281,6 +281,52 @@ }; }; diff --git a/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch b/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch index b20e1fce6c..f166aa75de 100644 --- a/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch +++ b/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch @@ -135,7 +135,7 @@ Signed-off-by: chuanjia.liu --- a/arch/arm/boot/dts/mt7629-rfb.dts +++ b/arch/arm/boot/dts/mt7629-rfb.dts -@@ -171,9 +171,10 @@ +@@ -176,9 +176,10 @@ }; }; From 718a4f47806da8f68cb8f1fe2ebecf403e14ae96 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 20 Aug 2021 23:45:20 +0300 Subject: [PATCH 18/18] wolfssl: fix build with GCC 10 on 32 x86 targets Backport upstream patch to fix build with GCC 10 on 32 x86 targets. Signed-off-by: Stijn Tintel --- ...change-asm-snippets-to-get-compiling.patch | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch diff --git a/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch new file mode 100644 index 0000000000..091b241285 --- /dev/null +++ b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch @@ -0,0 +1,123 @@ +From fa8f23284d4689c2a737204b337b58d966dcbd8c Mon Sep 17 00:00:00 2001 +From: Sean Parkinson +Date: Fri, 20 Aug 2021 10:23:38 +1000 +Subject: [PATCH] Maths x86 asm: change asm snippets to get compiling + +TFM: + Use register or memory for c0, c1, c2 in SQRADD and SQRADD2. +SP: + Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD, +SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD. +--- + wolfcrypt/src/asm.c | 29 ++++++++++++++++++++--------- + wolfcrypt/src/sp_int.c | 6 +++--- + 2 files changed, 23 insertions(+), 12 deletions(-) + +diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c +index b7f53d073..a37e75e02 100644 +--- a/wolfcrypt/src/asm.c ++++ b/wolfcrypt/src/asm.c +@@ -698,33 +698,39 @@ __asm__( \ + + #define SQRADD(i, j) \ + __asm__( \ +- "movl %6,%%eax \n\t" \ ++ "movl %3,%%eax \n\t" \ + "mull %%eax \n\t" \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ +- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc"); ++ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \ ++ : "m"(i) \ ++ :"%eax","%edx","cc"); + + #define SQRADD2(i, j) \ + __asm__( \ +- "movl %6,%%eax \n\t" \ +- "mull %7 \n\t" \ ++ "movl %3,%%eax \n\t" \ ++ "mull %4 \n\t" \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ +- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc"); ++ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \ ++ : "m"(i), "m"(j) \ ++ :"%eax","%edx", "cc"); + + #define SQRADDSC(i, j) \ +-__asm__( \ ++__asm__( \ + "movl %3,%%eax \n\t" \ + "mull %4 \n\t" \ + "movl %%eax,%0 \n\t" \ + "movl %%edx,%1 \n\t" \ + "xorl %2,%2 \n\t" \ +- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc"); ++ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \ ++ : "g"(i), "g"(j) \ ++ :"%eax","%edx","cc"); + + #define SQRADDAC(i, j) \ + __asm__( \ +@@ -733,7 +739,9 @@ __asm__( \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ +- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc"); ++ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \ ++ : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \ ++ :"%eax","%edx","cc"); + + #define SQRADDDB \ + __asm__( \ +@@ -743,7 +751,10 @@ __asm__( \ + "addl %6,%0 \n\t" \ + "adcl %7,%1 \n\t" \ + "adcl %8,%2 \n\t" \ +- :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc"); ++ :"=r"(c0), "=r"(c1), "=r"(c2) \ ++ : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), \ ++ "r"(sc2) \ ++ : "cc"); + + #elif defined(TFM_X86_64) + /* x86-64 optimized */ +diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c +index 6070faaa9..d26702e47 100644 +--- a/wolfcrypt/src/sp_int.c ++++ b/wolfcrypt/src/sp_int.c +@@ -477,7 +477,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, + "addl %%eax, %[l] \n\t" \ + "adcl %%edx, %[h] \n\t" \ + "adcl $0 , %[o] \n\t" \ +- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ ++ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ + : [a] "r" (va), [b] "r" (vb) \ + : "eax", "edx", "cc" \ + ) +@@ -503,7 +503,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, + "addl %%eax, %[l] \n\t" \ + "adcl %%edx, %[h] \n\t" \ + "adcl $0 , %[o] \n\t" \ +- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ ++ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ + : [a] "r" (va), [b] "r" (vb) \ + : "eax", "edx", "cc" \ + ) +@@ -542,7 +542,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, + "addl %%eax, %[l] \n\t" \ + "adcl %%edx, %[h] \n\t" \ + "adcl $0 , %[o] \n\t" \ +- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ ++ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ + : [a] "m" (va) \ + : "eax", "edx", "cc" \ + ) +-- +2.31.1 +