From: Ansuel Smith Date: Thu, 22 Jul 2021 11:35:42 +0000 (+0200) Subject: ipq806x: provide WiFI mac-addresses from dts X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f44e933458b13ab99c76dac840908104814442c8;p=openwrt%2Fstaging%2F981213.git ipq806x: provide WiFI mac-addresses from dts Use nvmem framework for supported mac-address stored in nvmem cells and drop mac patch function for hotplug script for supported devices. Signed-off-by: Ansuel Smith [rebase, move to correct node for d7800, include xr500] Signed-off-by: Adrian Schmutzler --- diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index a1cbe0a8f6..2746ef1e2a 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -22,7 +22,6 @@ case "$FIRMWARE" in ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e) ;; edgecore,ecw5410) if [ -b "$(find_mtd_part 0:art)" ]; then @@ -40,26 +39,21 @@ case "$FIRMWARE" in nec,wg2600hp |\ nec,wg2600hp3) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12) ;; netgear,d7800 |\ netgear,r7500v2 |\ netgear,r7800) caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 1) ;; netgear,xr500) caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary art 0xc) ;; tplink,ad7200 |\ tplink,c2600) caldata_extract "radio" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1) ;; tplink,vr2600v) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1) ;; zyxel,nbg6817) if [ -b "$(find_mtd_part 0:art)" ]; then @@ -88,7 +82,6 @@ case "$FIRMWARE" in ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ART 0x18) ;; linksys,ea7500-v1 |\ linksys,ea8500) @@ -98,26 +91,21 @@ case "$FIRMWARE" in nec,wg2600hp |\ nec,wg2600hp3) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc) ;; netgear,d7800 |\ netgear,r7500v2 |\ netgear,r7800) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 2) ;; netgear,xr500) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary art 0x0) ;; tplink,ad7200 |\ tplink,c2600) caldata_extract "radio" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x8) ;; tplink,vr2600v) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x0) ;; zyxel,nbg6817) if [ -b "$(find_mtd_part 0:art)" ]; then diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts index c6feb71a8e..8f1bb74540 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts @@ -359,6 +359,9 @@ reg = <0x00010000 0 0 0 0>; qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + + nvmem-cells = <&macaddr_PRODUCTDATA_12>; + nvmem-cell-names = "mac-address"; }; }; }; @@ -379,6 +382,9 @@ ieee80211-freq-limit = <2400000 2483000>; qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + + nvmem-cells = <&macaddr_PRODUCTDATA_c>; + nvmem-cell-names = "mac-address"; }; }; }; @@ -451,4 +457,12 @@ macaddr_factory_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi index cd6c0ea77d..5842c34c16 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi @@ -255,11 +255,42 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cell-names = "mac-address"; + }; + }; }; &mdio0 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts index 6e022cece0..940e01439d 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts @@ -175,6 +175,22 @@ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>; pinctrl-0 = <&pcie0_pins>; pinctrl-names = "default"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + }; }; &pcie1 { @@ -183,6 +199,22 @@ pinctrl-0 = <&pcie1_pins>; pinctrl-names = "default"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(2)>; + }; + }; }; &nand_controller { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts index 0f22480434..f2bd1705b5 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts @@ -186,6 +186,22 @@ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>; pinctrl-0 = <&pcie0_pins>; pinctrl-names = "default"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + }; }; &pcie1 { @@ -194,6 +210,22 @@ pinctrl-0 = <&pcie1_pins>; pinctrl-names = "default"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(2)>; + }; + }; }; &nand_controller { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts index 54ae07590a..863c5d7b1c 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts @@ -284,11 +284,42 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cell-names = "mac-address"; + mtd-mac-address-increment = <(-1)>; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cell-names = "mac-address"; + }; + }; }; &mdio0 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts index 7148fdf143..45da4a2b11 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts @@ -320,11 +320,41 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_PRODUCTDATA_12>; + nvmem-cell-names = "mac-address"; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_PRODUCTDATA_c>; + nvmem-cell-names = "mac-address"; + }; + }; }; &qcom_pinmux { @@ -395,4 +425,12 @@ macaddr_PRODUCTDATA_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts index 1cf5e3452f..4b4e8736d4 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts @@ -395,11 +395,41 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_ART_1e>; + nvmem-cell-names = "mac-address"; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_ART_18>; + nvmem-cell-names = "mac-address"; + }; + }; }; &qcom_pinmux { @@ -479,4 +509,12 @@ macaddr_ART_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_ART_18: macaddr@18 { + reg = <0x18 0x6>; + }; + + macaddr_ART_1e: macaddr@1e { + reg = <0x1e 0x6>; + }; };