lantiq: use the device tree bindings from rt2x00 driver
authorMathias Kresin <dev@kresin.me>
Thu, 14 Jul 2016 16:15:48 +0000 (18:15 +0200)
committerMathias Kresin <dev@kresin.me>
Wed, 9 Nov 2016 19:02:18 +0000 (20:02 +0100)
Set a device specific wireless mac address for ARV7506PW11, VGV7519 and
VGV7510KW22. The one from the EEPROM is a generic one and the same on
all boards.

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

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom [deleted file]
target/linux/lantiq/dts/ARV7506PW11.dts
target/linux/lantiq/dts/ARV7510PW22.dts
target/linux/lantiq/dts/ARV7519PW.dts
target/linux/lantiq/dts/ARV7525PW.dts
target/linux/lantiq/dts/ARV752DPW.dts
target/linux/lantiq/dts/ARV752DPW22.dts
target/linux/lantiq/dts/P2812HNUF1.dts
target/linux/lantiq/dts/P2812HNUF3.dts
target/linux/lantiq/dts/VGV7510KW22.dtsi
target/linux/lantiq/dts/VGV7519.dtsi

diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
deleted file mode 100644 (file)
index 3aa5de4..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-# based on gabors ralink wisoc implementation
-
-rt2x00_eeprom_die() {
-       echo "rt2x00 eeprom: " "$*"
-       exit 1
-}
-
-rt2x00_eeprom_extract() {
-       local part=$1
-       local offset=$2
-       local count=$3
-       local swab=$4
-       local mtd
-
-       . /lib/functions.sh
-
-       mtd=$(find_mtd_part $part)
-       [ -n "$mtd" ] || \
-               rt2x00_eeprom_die "no mtd device found for partition $part"
-
-       if [ $swab -gt 0 ]; then
-               dd if=$mtd of=/lib/firmware/$FIRMWARE bs=2 skip=$offset count=$count conv=swab || \
-                       rt2x00_eeprom_die "failed to extract from $mtd"
-       else
-               dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count || \
-                       rt2x00_eeprom_die "failed to extract from $mtd"
-       fi
-}
-
-[ -e /lib/firmware/$FIRMWARE ] && exit 0
-. /lib/functions/lantiq.sh
-
-case "$FIRMWARE" in
-"RT2860.eeprom" )
-       board=$(lantiq_board_name)
-       case $board in
-       ARV7506PW11|ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22|VGV7519)
-               rt2x00_eeprom_extract "board_config" 520 256 1
-               ;;
-       ARV7525PW)
-               rt2x00_eeprom_extract "board_config" 1040 512 0
-               ;;
-       *)
-               rt2x00_eeprom_die "board $board is not supported yet"
-               ;;
-       esac
-       ;;
-"RT3062.eeprom" )
-       board=$(lantiq_board_name)
-       case $board in
-       VGV7510KW22)
-               rt2x00_eeprom_extract "board_config" 520 256 1
-               ;;
-       *)
-               rt2x00_eeprom_die "board $board is not supported yet"
-               ;;
-       esac
-       ;;
-esac
index 676c0b898b21535cf719af6651b433d015ae75fa..5c8b0fe3a377512f98c845a10b75c6c121e0a57b 100644 (file)
                        phy-mode = "rmii";
                        mtd-mac-address = <&boardconfig 0x16>;
                };
-
-               pci@E105400 {
-                       status = "okay";
-                       lantiq,external-clock;
-                       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-               };
-       };
-
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT2860.eeprom";
        };
 
        gpio-keys-polled {
                };
        };
 };
+
+&pci0 {
+       status = "okay";
+       lantiq,external-clock;
+       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+
+       wifi@1814,3592 {
+               compatible = "pci1814,3592";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+               ralink,mtd-eeprom-swap;
+               mtd-mac-address = <&boardconfig 0x16>;
+               mtd-mac-address-increment = <1>;
+       };
+};
index f288511c7ceed4f5e87738abf2dce9e95360e192..079c85630821f100eda2672a061d17a142e493bd 100644 (file)
                        phy-mode = "mii";
                        mtd-mac-address = <&boardconfig 0x16>;
                };
-
-               pci@E105400 {
-                       status = "okay";
-                       lantiq,external-clock;
-                       interrupt-map = <
-                               0x7000 0 0 1 &icu0 30
-                               0x7800 0 0 1 &icu0 135
-                               0x7800 0 0 2 &icu0 135
-                               0x7800 0 0 3 &icu0 135
-                       >;
-                       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-                       req-mask = <0x3>;
-               };
-       };
-
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT2860.eeprom";
        };
 
        gpio-keys-polled {
                };
        };
 };
+
+&pci0 {
+       status = "okay";
+       lantiq,external-clock;
+       interrupt-map = <
+               0x7000 0 0 1 &icu0 30
+               0x7800 0 0 1 &icu0 135
+               0x7800 0 0 2 &icu0 135
+               0x7800 0 0 3 &icu0 135
+       >;
+       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+       req-mask = <0x3>;
+
+       wifi@1814,3592 {
+               compatible = "pci1814,3592";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+               ralink,mtd-eeprom-swap;
+       };
+};
index 9c29c8c9c93773e341dcb79f66cf709d24b05c66..1fa52c3d905d3a5edcbc9e850e6d323f0b90c3ee 100644 (file)
                ifxhcd@E101000 {
                        status = "okay";
                };
-
-               pci@E105400 {
-                       status = "okay";
-                       lantiq,external-clock;
-                       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-                       req-mask = <0xf>;
-               };
-       };
-
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT2860.eeprom";
        };
 
        gpio-keys-polled {
                };
        };
 };
+
+&pci0 {
+       status = "okay";
+       lantiq,external-clock;
+       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+       req-mask = <0xf>;
+
+       wifi@0,0 {
+               compatible = "pci0,0";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+               ralink,mtd-eeprom-swap;
+       };
+};
index aeba079a48dce4f23500dcc0c95f07c9698a8f44..f259c17d264baecd1b61dcb758789ffbafff7a4d 100644 (file)
                                        };
                                };
                        };
-
-                       ralink_eep {
-                               compatible = "ralink,eeprom";
-                               ralink,eeprom = "RT2860.eeprom";
-                               reg = <0 0x3f0410 0x110>;
-                       };
                };
 
                gpio: pinmux@E100B10 {
                        phy-mode = "mii";
                        mtd-mac-address = <&boardconfig 0x16>;
                };
-
-               pci@E105400 {
-                       status = "okay";
-                       interrupt-map = <0x7000 0 0 1 &icu0 135 1>;
-               };
        };
 
        gpio-keys-polled {
                };
        };
 };
+
+&pci0 {
+       status = "okay";
+       interrupt-map = <0x7000 0 0 1 &icu0 135 1>;
+
+       wifi@0,0 {
+               compatible = "pci0,0";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+       };
+};
index d6de881faeb7fe5631cd8c1378b231e7785137e1..d51a70a593ee677536472e717a95b591a2d9a879 100644 (file)
                        phy-mode = "rmii";
                        mtd-mac-address = <&boardconfig 0x16>;
                };
-
-               pci@E105400 {
-                       status = "okay";
-                       lantiq,external-clock;
-                       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-                       interrupt-map = <0x7000 0 0 1 &icu0 135>;
-                       req-mask = <0x3>;
-               };
-       };
-
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT2860.eeprom";
        };
 
        gpio-keys-polled {
                };
        };
 };
+
+&pci0 {
+       status = "okay";
+       lantiq,external-clock;
+       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+       interrupt-map = <0x7000 0 0 1 &icu0 135>;
+       req-mask = <0x3>;
+
+       wifi@1814,0601 {
+               compatible = "pci1814,0601";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+               ralink,mtd-eeprom-swap;
+       };
+};
index 0b0fddbd8277b3fe6208b2eef2f38d4104a9a23d..7343a5d2ffbcbe96cc7a1d441cdeefbe55834fe1 100644 (file)
                        phy-mode = "mii";
                        mtd-mac-address = <&boardconfig 0x16>;
                };
-
-               pci@E105400 {
-                       status = "okay";
-                       lantiq,external-clock;
-                       interrupt-map = <
-                               0x7000 0 0 1 &icu0 30
-                               0x7800 0 0 1 &icu0 135
-                               0x7800 0 0 2 &icu0 135
-                               0x7800 0 0 3 &icu0 135
-                       >;
-                       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-                       req-mask = <0x3>;
-               };
-       };
-
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT2860.eeprom";
        };
 
        gpio-keys-polled {
                };
        };
 };
+
+&pci0 {
+       status = "okay";
+       lantiq,external-clock;
+       interrupt-map = <
+               0x7000 0 0 1 &icu0 30
+               0x7800 0 0 1 &icu0 135
+               0x7800 0 0 2 &icu0 135
+               0x7800 0 0 3 &icu0 135
+       >;
+       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+       req-mask = <0x3>;
+
+       wifi@1814,3592 {
+               compatible = "pci1814,3592";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+               ralink,mtd-eeprom-swap;
+       };
+};
index 53ffbdd56c724301031bf67aa6e63eec17b7368d..b1d9eedb35d769d528d07f47a4884144dbd0d6bc 100644 (file)
                };
        };
 
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT3062.eeprom";
-       };
-
        gpio-leds {
                usb1: usb1 {
                        label = "p2812hnuf1:green:usb1";
                };
        };
 };
+
+&pci0 {
+       wifi@1814,3062 {
+               compatible = "pci1814,3062";
+               reg = <0x7000 0 0 0 0>;
+               ralink,eeprom = "RT3062.eeprom";
+       };
+};
index 54795a334ddc45e15ea919063b269a27018aef77..366d0346700bc3d2e3136667709926706f38c16c 100644 (file)
                        };
                };
        };
+};
 
-       ralink_eep {
-               compatible = "ralink,eeprom";
+&pci0 {
+       wifi@1814,3092 {
+               compatible = "pci1814,3092";
+               reg = <0x7000 0 0 0 0>;
                ralink,eeprom = "RT3092.eeprom";
        };
 };
index 8af1db70c3e09c39bf3bfcb023e2032233d52dca..5ca2844d08a131ac238482e86169432fcc05a6b6 100644 (file)
                        gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
                };
 
-               pci@E105400 {
-                       status = "okay";
-                       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-               };
-
                pcie@d900000 {
                        status = "disabled";
                };
                phys = [ 00 01 ];
        };
 
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT3062.eeprom";
-       };
-
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
        };
 };
 
+&pci0 {
+       status = "okay";
+       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+
+       wifi@1814,3592 {
+               compatible = "pci1814,3592";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+               ralink,mtd-eeprom-swap;
+               mtd-mac-address = <&boardconfig 0x16>;
+               mtd-mac-address-increment = <1>;
+       };
+};
+
 &eth0 {
        lan: interface@0 {
                compatible = "lantiq,xrx200-pdi";
index a2242bb54df8574cd26768cb132b105bb730b139..a7b421fff93ab69a62875ed809623c3cd77a4bbe 100644 (file)
                        gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
                };
 
-               pci@E105400 {
-                       status = "okay";
-                       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-               };
-
                pcie@d900000 {
                        status = "disabled";
                };
                phys = [ 00 01 ];
        };
 
-       ralink_eep {
-               compatible = "ralink,eeprom";
-               ralink,eeprom = "RT2860.eeprom";
-       };
-
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
        };
 };
 
+&pci0 {
+       status = "okay";
+       gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+
+       wifi@1814,3091 {
+               compatible = "pci1814,3091";
+               reg = <0x7000 0 0 0 0>;
+               ralink,mtd-eeprom = <&boardconfig 0x410>;
+               ralink,mtd-eeprom-swap;
+               mtd-mac-address = <&boardconfig 0x16>;
+               mtd-mac-address-increment = <1>;
+       };
+};
+
 &eth0 {
        lan: interface@0 {
                compatible = "lantiq,xrx200-pdi";