ramips: use the ralink,mtd-eeprom device tree property
authorMathias Kresin <dev@kresin.me>
Mon, 7 Nov 2016 21:02:20 +0000 (22:02 +0100)
committerMathias Kresin <dev@kresin.me>
Wed, 9 Nov 2016 19:22:59 +0000 (20:22 +0100)
Use the ralink,mtd-eeprom instead of invoking the userspace firmware
loader.

Set the label and compatible string according to the the PCI binding
documentation.

Use the wifi@0,0 label and the pci0,0 compatible string in case the
PCI vendor and device id is unknown. It should work anyway since the
compatible string isn't evaluated (yet).

This commit might fixes the PCIe wireless for the Buffalo WHR-600D.
This board was mentioned in the board 10-rt2x00-eeprom firmware hotplug
script but never had the correct eeprom name set to trigger the
firmware from flash extraction.

Use the usual eeprom for the soc wmac of the Dovado Tiny AC.

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
target/linux/ramips/dts/BR-6475ND.dts
target/linux/ramips/dts/CY-SWR1100.dts
target/linux/ramips/dts/RT-N56U.dts
target/linux/ramips/dts/TINY-AC.dts
target/linux/ramips/dts/WHR-1166D.dts
target/linux/ramips/dts/WHR-600D.dts

index 4c8beac066a60fcf381c0dd594d14d68553814a6..b44bae90bb7614514f3ce871821efad0ad410167 100644 (file)
@@ -43,25 +43,14 @@ board=$(ramips_board_name)
 case "$FIRMWARE" in
 "soc_wmac.eeprom")
        case $board in
-       *)
-               rt2x00_eeprom_die "Please define mtd-eeprom in $board DTS file!"
-               ;;
-       esac
-       ;;
-
-"rt2x00pci_1_0.eeprom")
-       case $board in
-       cy-swr1100)
-               rt2x00_eeprom_extract "factory" 8192 512
-               ;;
-       br-6475nd | rt-n56u | whr-600d | whr-1166d)
-               rt2x00_eeprom_extract "factory" 32768 512
-               ;;
        tiny-ac)
                wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR)
                rt2x00_eeprom_extract "factory" 0 512
                rt2x00_eeprom_set_macaddr $wifi_mac
                ;;
+       *)
+               rt2x00_eeprom_die "Please define mtd-eeprom in $board DTS file!"
+               ;;
        esac
        ;;
 esac
index 87b048a84101c3ec3ef2a8bd24c006cc04d9dcea..2ab2cba8941c92a9d3f9d26c541b498bc3d2ec95 100644 (file)
                pci-bridge@1 {
                        status = "okay";
 
-                       wmac@0,0 {
+                       wifi@0,0 {
+                               compatible = "pci0,0";
+                               reg = <0x10000 0 0 0 0>;
                                ralink,5ghz = <0>;
-                               compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
-                               reg = < 0x10000 0 0 0 0 >;
-                               ralink,eeprom = "rt2x00pci_1_0.eeprom";
+                               ralink,mtd-eeprom = <&factory 0x8000>;
                        };
                };
        };
index 031d8f00523e6c7b7d2cc93db463cfe5f9807aea..95827d5017f534ca18111ff922eab463c5cdac5b 100644 (file)
                pci-bridge@1 {
                        status = "okay";
 
-                       wmac@0,0 {
+                       wifi@0,0 {
+                               compatible = "pci0,0";
+                               reg = <0x10000 0 0 0 0>;
                                ralink,5ghz = <0>;
-                               compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
-                               reg = < 0x10000 0 0 0 0 >;
-                               ralink,eeprom = "rt2x00pci_1_0.eeprom";
+                               ralink,mtd-eeprom = <&factory 0x2000>;
                        };
                };
        };
index d3a1f1bbfb966e24d07b993a7348ba0e92d322ba..fea73e27e722345c17bbb81f8397bfeee19ba895 100644 (file)
                pci-bridge@1 {
                        status = "okay";
 
-                       wmac@0,0 {
-                               compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
-                               reg = < 0x10000 0 0 0 0 >;
-                               ralink,eeprom = "rt2x00pci_1_0.eeprom";
+                       wifi@1814,3091 {
+                               compatible = "pci1814,3091";
+                               reg = <0x10000 0 0 0 0>;
+                               ralink,mtd-eeprom = <&factory 0x8000>;
                        };
                };
        };
index 6a2124776786b4fc1f13daff2c9ab829b58b1896..81f1adee87fc830b13fc8165449bd07032f2314a 100644 (file)
        mediatek,mt7530 = <1>;
 };
 
-&wmac {
-       ralink,eeprom = "rt2x00pci_1_0.eeprom";
-};
-
 &pcie {
        status = "okay";
 };
index 0c0f62728c7b42f493784b8849a0a7764e8e5e30..fd2e451c37738a1911bb8a6142501ee9a4989eea 100644 (file)
        status = "okay";
 
        pcie-bridge {
-               mt76@0,0 {
+               wifi@0,0 {
+                       compatible = "pci0,0";
                        reg = <0x0000 0 0 0 0>;
-                       device_type = "pci";
-                       mediatek,mtd-eeprom = <&factory 32768>;
+                       mediatek,mtd-eeprom = <&factory 0x8000>;
                        mediatek,2ghz = <0>;
                };
        };
index 7d26f32b973e323b0de3d504a354b58a03674a79..c0633559b6ae112c7e96a82becad8d3029f4ef34 100644 (file)
 
 &pcie {
        status = "okay";
+
+       pcie-bridge {
+               wifi@1814,3091 {
+                       compatible = "pci1814,3091";
+                       reg = <0x0000 0 0 0 0>;
+                       mediatek,mtd-eeprom = <&factory 0x8000>;
+               };
+       };
 };