From 7e5e0100358d59e6652ddbe2869f804c19854922 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Thu, 16 Nov 2023 17:17:32 +0100 Subject: [PATCH] ath79: fortinet-fap-220-b: convert to nvmem-layout Now that MAC address parser supports the hex format (without delimiters), use the canonical MAC address stored in U-boot partition. Get rid of the "mac-address-increment" binding. While at that, convert ART partition too. Signed-off-by: Lech Perczak --- .../ath79/dts/ar7161_fortinet_fap-220-b.dts | 45 ++++++------------- .../ath79/dts/arxxxx_fortinet_loader.dtsi | 12 +++++ 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts b/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts index 63fe9ade53..ddcf68970d 100644 --- a/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts +++ b/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts @@ -99,9 +99,8 @@ compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; ieee80211-freq-limit = <2402000 2482000>; - nvmem-cells = <&macaddr_art_120c>, <&cal_art_1000>; + nvmem-cells = <&macaddr_uboot_3ff80 9>, <&cal_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <9>; #gpio-cells = <2>; gpio-controller; }; @@ -110,9 +109,8 @@ compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; ieee80211-freq-limit = <2402000 2482000 4900000 5990000>; - nvmem-cells = <&macaddr_art_520c>, <&cal_art_5000>; + nvmem-cells = <&macaddr_uboot_3ff80 2>, <&cal_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; #gpio-cells = <2>; gpio-controller; }; @@ -133,7 +131,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_uboot_3ff80 0>; nvmem-cell-names = "mac-address"; pll-data = <0x00110000 0x00001099 0x00991099>; @@ -149,35 +147,18 @@ status = "okay"; }; -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - /* Currently doesn't work, because this one lacks colons as delimiters */ - macaddr_uboot_3ff80: mac-address-ascii@3ff80 { - reg = <0x3ff80 0xc>; - }; -}; - &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_120c: mac-address@120c { - reg = <0x120c 0x6>; - }; - - cal_art_5000: calibration@5000 { - reg = <0x5000 0xeb8>; - }; + cal_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; - macaddr_art_520c: mac-address@520c { - reg = <0x520c 0x6>; + cal_art_5000: calibration@5000 { + reg = <0x5000 0xeb8>; + }; }; }; diff --git a/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi b/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi index 3bc734313f..786626828f 100644 --- a/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi +++ b/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi @@ -40,6 +40,18 @@ label = "u-boot"; reg = <0x000000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_3ff80: mac-address@3ff80 { + compatible = "mac-base"; + reg = <0x3ff80 0xc>; + #nvmem-cell-cells = <1>; + }; + }; }; fwconcat0: partition@40000 { -- 2.30.2