[source] lantiq: use the device tree bindings from rt2x00 driver

LEDE Commits lede-commits at lists.infradead.org
Wed Nov 9 12:27:36 PST 2016


mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/7fd5171a3445b1f0b3aaa45f6c43550758547f2c

commit 7fd5171a3445b1f0b3aaa45f6c43550758547f2c
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Thu Jul 14 18:15:48 2016 +0200

    lantiq: use the device tree bindings from rt2x00 driver
    
    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 at 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 at kresin.me>
---
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom        | 60 ----------------------
 target/linux/lantiq/dts/ARV7506PW11.dts            | 26 ++++++----
 target/linux/lantiq/dts/ARV7510PW22.dts            | 38 +++++++-------
 target/linux/lantiq/dts/ARV7519PW.dts              | 26 +++++-----
 target/linux/lantiq/dts/ARV7525PW.dts              | 22 ++++----
 target/linux/lantiq/dts/ARV752DPW.dts              | 28 +++++-----
 target/linux/lantiq/dts/ARV752DPW22.dts            | 38 +++++++-------
 target/linux/lantiq/dts/P2812HNUF1.dts             | 13 +++--
 target/linux/lantiq/dts/P2812HNUF3.dts             |  7 ++-
 target/linux/lantiq/dts/VGV7510KW22.dtsi           | 24 +++++----
 target/linux/lantiq/dts/VGV7519.dtsi               | 24 +++++----
 11 files changed, 136 insertions(+), 170 deletions(-)

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
index 3aa5de4..0000000
--- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ /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
diff --git a/target/linux/lantiq/dts/ARV7506PW11.dts b/target/linux/lantiq/dts/ARV7506PW11.dts
index 676c0b8..5c8b0fe 100644
--- a/target/linux/lantiq/dts/ARV7506PW11.dts
+++ b/target/linux/lantiq/dts/ARV7506PW11.dts
@@ -80,17 +80,6 @@
 			phy-mode = "rmii";
 			mtd-mac-address = <&boardconfig 0x16>;
 		};
-
-		pci at 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 {
@@ -152,3 +141,18 @@
 		};
 	};
 };
+
+&pci0 {
+	status = "okay";
+	lantiq,external-clock;
+	gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+
+	wifi at 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>;
+	};
+};
diff --git a/target/linux/lantiq/dts/ARV7510PW22.dts b/target/linux/lantiq/dts/ARV7510PW22.dts
index f288511..079c856 100644
--- a/target/linux/lantiq/dts/ARV7510PW22.dts
+++ b/target/linux/lantiq/dts/ARV7510PW22.dts
@@ -121,24 +121,6 @@
 			phy-mode = "mii";
 			mtd-mac-address = <&boardconfig 0x16>;
 		};
-
-		pci at 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 {
@@ -189,3 +171,23 @@
 		};
 	};
 };
+
+&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 at 1814,3592 {
+		compatible = "pci1814,3592";
+		reg = <0x7000 0 0 0 0>;
+		ralink,mtd-eeprom = <&boardconfig 0x410>;
+		ralink,mtd-eeprom-swap;
+	};
+};
diff --git a/target/linux/lantiq/dts/ARV7519PW.dts b/target/linux/lantiq/dts/ARV7519PW.dts
index 9c29c8c..1fa52c3 100644
--- a/target/linux/lantiq/dts/ARV7519PW.dts
+++ b/target/linux/lantiq/dts/ARV7519PW.dts
@@ -113,18 +113,6 @@
 		ifxhcd at E101000 {
 			status = "okay";
 		};
-
-		pci at 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 {
@@ -222,3 +210,17 @@
 		};
 	};
 };
+
+&pci0 {
+	status = "okay";
+	lantiq,external-clock;
+	gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+	req-mask = <0xf>;
+
+	wifi at 0,0 {
+		compatible = "pci0,0";
+		reg = <0x7000 0 0 0 0>;
+		ralink,mtd-eeprom = <&boardconfig 0x410>;
+		ralink,mtd-eeprom-swap;
+	};
+};
diff --git a/target/linux/lantiq/dts/ARV7525PW.dts b/target/linux/lantiq/dts/ARV7525PW.dts
index aeba079..f259c17 100644
--- a/target/linux/lantiq/dts/ARV7525PW.dts
+++ b/target/linux/lantiq/dts/ARV7525PW.dts
@@ -68,12 +68,6 @@
 					};
 				};
 			};
-
-			ralink_eep {
-				compatible = "ralink,eeprom";
-				ralink,eeprom = "RT2860.eeprom";
-				reg = <0 0x3f0410 0x110>;
-			};
 		};
 
 		gpio: pinmux at E100B10 {
@@ -96,11 +90,6 @@
 			phy-mode = "mii";
 			mtd-mac-address = <&boardconfig 0x16>;
 		};
-
-		pci at E105400 {
-			status = "okay";
-			interrupt-map = <0x7000 0 0 1 &icu0 135 1>;
-		};
 	};
 
 	gpio-keys-polled {
@@ -150,3 +139,14 @@
 		};
 	};
 };
+
+&pci0 {
+	status = "okay";
+	interrupt-map = <0x7000 0 0 1 &icu0 135 1>;
+
+	wifi at 0,0 {
+		compatible = "pci0,0";
+		reg = <0x7000 0 0 0 0>;
+		ralink,mtd-eeprom = <&boardconfig 0x410>;
+	};
+};
diff --git a/target/linux/lantiq/dts/ARV752DPW.dts b/target/linux/lantiq/dts/ARV752DPW.dts
index d6de881..d51a70a 100644
--- a/target/linux/lantiq/dts/ARV752DPW.dts
+++ b/target/linux/lantiq/dts/ARV752DPW.dts
@@ -135,19 +135,6 @@
 			phy-mode = "rmii";
 			mtd-mac-address = <&boardconfig 0x16>;
 		};
-
-		pci at 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 {
@@ -231,3 +218,18 @@
 		};
 	};
 };
+
+&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 at 1814,0601 {
+		compatible = "pci1814,0601";
+		reg = <0x7000 0 0 0 0>;
+		ralink,mtd-eeprom = <&boardconfig 0x410>;
+		ralink,mtd-eeprom-swap;
+	};
+};
diff --git a/target/linux/lantiq/dts/ARV752DPW22.dts b/target/linux/lantiq/dts/ARV752DPW22.dts
index 0b0fddb..7343a5d 100644
--- a/target/linux/lantiq/dts/ARV752DPW22.dts
+++ b/target/linux/lantiq/dts/ARV752DPW22.dts
@@ -134,24 +134,6 @@
 			phy-mode = "mii";
 			mtd-mac-address = <&boardconfig 0x16>;
 		};
-
-		pci at 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 {
@@ -251,3 +233,23 @@
 		};
 	};
 };
+
+&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 at 1814,3592 {
+		compatible = "pci1814,3592";
+		reg = <0x7000 0 0 0 0>;
+		ralink,mtd-eeprom = <&boardconfig 0x410>;
+		ralink,mtd-eeprom-swap;
+	};
+};
diff --git a/target/linux/lantiq/dts/P2812HNUF1.dts b/target/linux/lantiq/dts/P2812HNUF1.dts
index 53ffbdd..b1d9eed 100644
--- a/target/linux/lantiq/dts/P2812HNUF1.dts
+++ b/target/linux/lantiq/dts/P2812HNUF1.dts
@@ -50,11 +50,6 @@
 		};
 	};
 
-	ralink_eep {
-		compatible = "ralink,eeprom";
-		ralink,eeprom = "RT3062.eeprom";
-	};
-
 	gpio-leds {
 		usb1: usb1 {
 			label = "p2812hnuf1:green:usb1";
@@ -66,3 +61,11 @@
 		};
 	};
 };
+
+&pci0 {
+	wifi at 1814,3062 {
+		compatible = "pci1814,3062";
+		reg = <0x7000 0 0 0 0>;
+		ralink,eeprom = "RT3062.eeprom";
+	};
+};
diff --git a/target/linux/lantiq/dts/P2812HNUF3.dts b/target/linux/lantiq/dts/P2812HNUF3.dts
index 54795a3..366d034 100644
--- a/target/linux/lantiq/dts/P2812HNUF3.dts
+++ b/target/linux/lantiq/dts/P2812HNUF3.dts
@@ -54,9 +54,12 @@
 			};
 		};
 	};
+};
 
-	ralink_eep {
-		compatible = "ralink,eeprom";
+&pci0 {
+	wifi at 1814,3092 {
+		compatible = "pci1814,3092";
+		reg = <0x7000 0 0 0 0>;
 		ralink,eeprom = "RT3092.eeprom";
 	};
 };
diff --git a/target/linux/lantiq/dts/VGV7510KW22.dtsi b/target/linux/lantiq/dts/VGV7510KW22.dtsi
index 8af1db7..5ca2844 100644
--- a/target/linux/lantiq/dts/VGV7510KW22.dtsi
+++ b/target/linux/lantiq/dts/VGV7510KW22.dtsi
@@ -75,11 +75,6 @@
 			gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
 		};
 
-		pci at E105400 {
-			status = "okay";
-			gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-		};
-
 		pcie at d900000 {
 			status = "disabled";
 		};
@@ -92,11 +87,6 @@
 		phys = [ 00 01 ];
 	};
 
-	ralink_eep {
-		compatible = "ralink,eeprom";
-		ralink,eeprom = "RT3062.eeprom";
-	};
-
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
 		#address-cells = <1>;
@@ -167,6 +157,20 @@
 	};
 };
 
+&pci0 {
+	status = "okay";
+	gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+
+	wifi at 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 at 0 {
 		compatible = "lantiq,xrx200-pdi";
diff --git a/target/linux/lantiq/dts/VGV7519.dtsi b/target/linux/lantiq/dts/VGV7519.dtsi
index a2242bb..a7b421f 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -102,11 +102,6 @@
 			gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
 		};
 
-		pci at E105400 {
-			status = "okay";
-			gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
-		};
-
 		pcie at d900000 {
 			status = "disabled";
 		};
@@ -119,11 +114,6 @@
 		phys = [ 00 01 ];
 	};
 
-	ralink_eep {
-		compatible = "ralink,eeprom";
-		ralink,eeprom = "RT2860.eeprom";
-	};
-
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
 		#address-cells = <1>;
@@ -214,6 +204,20 @@
 	};
 };
 
+&pci0 {
+	status = "okay";
+	gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>;
+
+	wifi at 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 at 0 {
 		compatible = "lantiq,xrx200-pdi";



More information about the lede-commits mailing list