From af5306ba70733f7e736b0aef582fb93519fccde9 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 15 Dec 2022 17:04:14 +0100 Subject: [PATCH] ath79: convert WiFis based on ar7241_ubnt_unifi.dtsi to nvmem-cells Pull the calibration data from the nvmem subsystem. This allows us to move userspace caldata extraction into the device-tree definition. While working on it remove stale uboot partition label and merge art into partition node. Signed-off-by: Nick Hainke --- .../dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts | 36 ++++++++++--------- .../linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi | 29 +++++++++------ target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi | 1 - .../etc/hotplug.d/firmware/10-ath9k-eeprom | 6 +--- 4 files changed, 39 insertions(+), 33 deletions(-) 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 9ccbdbd450d..3f965ec9dea 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 @@ -41,7 +41,7 @@ #address-cells = <1>; #size-cells = <1>; - uboot: partition@0 { + partition@0 { label = "u-boot"; reg = <0x0 0x40000>; read-only; @@ -82,10 +82,26 @@ read-only; }; - art: partition@ff0000 { + partition@ff0000 { label = "art"; reg = <0xff0000 0x10000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; }; @@ -105,18 +121,6 @@ &wifi { ubnt,hsr; -}; - -&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>; - }; + nvmem-cells = <&calibration_art_1000>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi index c70a1c02dba..02166a26eb8 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi @@ -68,15 +68,32 @@ read-only; }; - art: partition@7f0000 { + partition@7f0000 { label = "art"; reg = <0x7f0000 0x010000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; }; +&wifi { + nvmem-cells = <&calibration_art_1000>; + nvmem-cell-names = "calibration"; +}; + ð0 { nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; @@ -85,13 +102,3 @@ ð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 ec8c6381e71..fa6c2337333 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dtsi @@ -26,7 +26,6 @@ wifi: wifi@0,0 { reg = <0x0000 0 0 0 0>; - qca,no-eeprom; }; }; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 5fcfcaf64fa..4f107bfe881 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -86,11 +86,7 @@ case "$FIRMWARE" in avm,fritz300e) caldata_extract_reverse "urloader" 0x1541 0x440 ;; - ubnt,unifi-ap-outdoor-plus) - caldata_extract "art" 0x1000 0xeb8 - ;; - buffalo,wzr-hp-g450h|\ - ubnt,unifi) + buffalo,wzr-hp-g450h) caldata_extract "art" 0x1000 0x440 ;; dlink,dir-825-c1|\