[openwrt/openwrt] ipq806x: create DTSI for TP-Link AD7200 and C2600

LEDE Commits lede-commits at lists.infradead.org
Wed Jan 6 08:43:19 EST 2021


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8ddaeaf6424e26cc12bd8412ef6955c506b0a657

commit 8ddaeaf6424e26cc12bd8412ef6955c506b0a657
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Wed Jan 6 01:05:39 2021 +0100

    ipq806x: create DTSI for TP-Link AD7200 and C2600
    
    Both devices share most of their setup except buttons and LEDs,
    so having a common DTSI removes a lot of duplicate code.
    
    In order to have a shared partitioning scheme, device-id and
    product-info from AD7200 have been merged into a single
    product-info partition like for C2600.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 ...4-ad7200.dts => qcom-ipq8064-ad7200-c2600.dtsi} | 127 +--------
 .../arch/arm/boot/dts/qcom-ipq8064-ad7200.dts      | 313 +--------------------
 .../files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts | 308 +-------------------
 3 files changed, 4 insertions(+), 744 deletions(-)

diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
similarity index 68%
copy from target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts
copy to target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
index bd50d2d0fc..a893225b1a 100644
--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
@@ -1,12 +1,10 @@
 //SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
 #include "qcom-ipq8064-v2.0.dtsi"
 
 #include <dt-bindings/input/input.h>
 
 / {
-	model = "TP-Link Talon AD7200";
-	compatible = "tplink,ad7200", "qcom,ipq8064";
-
 	memory at 0 {
 		reg = <0x42000000 0x1e000000>;
 		device_type = "memory";
@@ -14,121 +12,11 @@
 
 	aliases {
 		mdio-gpio0 = &mdio0;
-
-		led-boot = &led_status;
-		led-failsafe = &led_status;
-		led-running = &led_status;
-		led-upgrade = &led_status;
 		label-mac-device = &gmac2;
 	};
-
-	keys {
-		compatible = "gpio-keys";
-		pinctrl-0 = <&button_pins>;
-		pinctrl-names = "default";
-
-		wifi {
-			label = "wifi";
-			gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RFKILL>;
-		};
-
-		reset {
-			label = "reset";
-			gpios = <&qcom_pinmux 7 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RESTART>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&qcom_pinmux 67 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_WPS_BUTTON>;
-		};
-
-		led_enable {
-			label = "led-enable";
-			gpios = <&qcom_pinmux 53 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_LIGHTS_TOGGLE>;
-		};
-	};
-
-	leds {
-		compatible = "gpio-leds";
-		pinctrl-0 = <&led_pins>;
-		pinctrl-names = "default";
-
-		lan {
-			label = "blue:lan";
-			gpios = <&qcom_pinmux 2 GPIO_ACTIVE_HIGH>;
-		};
-
-		usb1 {
-			label = "blue:usb1";
-			gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>;
-		};
-
-		wlan5g {
-			label = "blue:wlan5g";
-			gpios = <&qcom_pinmux 15 GPIO_ACTIVE_HIGH>;
-		};
-
-		usb3 {
-			label = "blue:usb3";
-			gpios = <&qcom_pinmux 16 GPIO_ACTIVE_HIGH>;
-		};
-
-		wlan2g {
-			label = "blue:wlan2g";
-			gpios = <&qcom_pinmux 17 GPIO_ACTIVE_HIGH>;
-		};
-
-		wan_orange {
-			label = "orange:wan";
-			gpios = <&qcom_pinmux 26 GPIO_ACTIVE_LOW>;
-		};
-
-		wan_blue {
-			label = "blue:wan";
-			gpios = <&qcom_pinmux 33 GPIO_ACTIVE_LOW>;
-		};
-
-		wps {
-			label = "blue:wps";
-			gpios = <&qcom_pinmux 55 GPIO_ACTIVE_HIGH>;
-		};
-
-		wlan60g {
-			label = "blue:wlan60g";
-			gpios = <&qcom_pinmux 56 GPIO_ACTIVE_HIGH>;
-		};
-
-		led_status: status {
-			label = "blue:status";
-			gpios = <&qcom_pinmux 66 GPIO_ACTIVE_HIGH>;
-		};
-	};
 };
 
 &qcom_pinmux {
-	button_pins: button_pins {
-		mux {
-			pins = "gpio53", "gpio54", "gpio67";
-			function = "gpio";
-			drive-strength = <2>;
-			bias-pull-up;
-		};
-	};
-
-	led_pins: led_pins {
-		mux {
-			pins = "gpio2", "gpio8", "gpio15", "gpio16", "gpio17", "gpio26",
-					"gpio33", "gpio55", "gpio56", "gpio66";
-			function = "gpio";
-			drive-strength = <2>;
-			bias-pull-up;
-		};
-	};
-
 	spi_pins: spi_pins {
 		mux {
 			pins = "gpio18", "gpio19", "gpio21";
@@ -283,14 +171,8 @@
 			};
 
 			partition at 1ef0400 {
-				label = "device-id";
-				reg = <0x1ef0400 0x00200>;
-				read-only;
-			};
-
-			partition at 1ef0600 {
 				label = "product-info";
-				reg = <0x1ef0600 0x0fa00>;
+				reg = <0x1ef0400 0x0fc00>;
 				read-only;
 			};
 
@@ -374,11 +256,6 @@
 	max-link-speed = <1>;
 };
 
-&pcie2 {
-	status = "okay";
-	max-link-speed = <1>;
-};
-
 &mdio0 {
 	status = "okay";
 
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts
index bd50d2d0fc..d26aee910b 100644
--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts
@@ -1,25 +1,16 @@
 //SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-#include "qcom-ipq8064-v2.0.dtsi"
 
-#include <dt-bindings/input/input.h>
+#include "qcom-ipq8064-ad7200-c2600.dtsi"
 
 / {
 	model = "TP-Link Talon AD7200";
 	compatible = "tplink,ad7200", "qcom,ipq8064";
 
-	memory at 0 {
-		reg = <0x42000000 0x1e000000>;
-		device_type = "memory";
-	};
-
 	aliases {
-		mdio-gpio0 = &mdio0;
-
 		led-boot = &led_status;
 		led-failsafe = &led_status;
 		led-running = &led_status;
 		led-upgrade = &led_status;
-		label-mac-device = &gmac2;
 	};
 
 	keys {
@@ -128,311 +119,9 @@
 			bias-pull-up;
 		};
 	};
-
-	spi_pins: spi_pins {
-		mux {
-			pins = "gpio18", "gpio19", "gpio21";
-			function = "gsbi5";
-			bias-pull-down;
-		};
-
-		data {
-			pins = "gpio18", "gpio19";
-			drive-strength = <10>;
-		};
-
-		cs {
-			pins = "gpio20";
-			function = "gpio";
-			drive-strength = <10>;
-			bias-pull-up;
-		};
-
-		clk {
-			pins = "gpio21";
-			drive-strength = <12>;
-		};
-	};
-
-	usb0_pwr_en_pin: usb0_pwr_en_pin {
-		mux {
-			pins = "gpio25";
-			function = "gpio";
-			drive-strength = <10>;
-			bias-pull-up;
-			output-high;
-		};
-	};
-
-	usb1_pwr_en_pin: usb1_pwr_en_pin {
-		mux {
-			pins = "gpio23";
-			function = "gpio";
-			drive-strength = <10>;
-			bias-pull-up;
-			output-high;
-		};
-	};
-};
-
-&gsbi5 {
-	qcom,mode = <GSBI_PROT_SPI>;
-	status = "okay";
-
-	spi at 1a280000 {
-		status = "okay";
-
-		pinctrl-0 = <&spi_pins>;
-		pinctrl-names = "default";
-
-		cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
-
-		flash at 0 {
-			compatible = "jedec,spi-nor";
-			#address-cells = <1>;
-			#size-cells = <1>;
-			spi-max-frequency = <50000000>;
-			reg = <0>;
-
-			partition at 0 {
-				label = "SBL1";
-				reg = <0x0 0x20000>;
-				read-only;
-			};
-
-			partition at 20000 {
-				label = "MIBIB";
-				reg = <0x20000 0x20000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "SBL2";
-				reg = <0x40000 0x20000>;
-				read-only;
-			};
-
-			partition at 60000 {
-				label = "SBL3";
-				reg = <0x60000 0x30000>;
-				read-only;
-			};
-
-			partition at 90000 {
-				label = "DDRCONFIG";
-				reg = <0x90000 0x10000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "SSD";
-				reg = <0xa0000 0x10000>;
-				read-only;
-			};
-
-			partition at b0000 {
-				label = "TZ";
-				reg = <0xb0000 0x30000>;
-				read-only;
-			};
-
-			partition at e0000 {
-				label = "RPM";
-				reg = <0xe0000 0x20000>;
-				read-only;
-			};
-
-			partition at 100000 {
-				label = "fs-uboot";
-				reg = <0x100000 0x70000>;
-				read-only;
-			};
-
-			partition at 170000 {
-				label = "uboot-env";
-				reg = <0x170000 0x40000>;
-				read-only;
-			};
-
-			partition at 1b0000 {
-				label = "radio";
-				reg = <0x1b0000 0x40000>;
-				read-only;
-			};
-
-			partition at 1f0000 {
-				label = "os-image";
-				reg = <0x1f0000 0x400000>;
-			};
-
-			partition at 5f0000 {
-				label = "rootfs";
-				reg = <0x5f0000 0x1900000>;
-			};
-
-			defaultmac: partition at 1ef0000 {
-				label = "default-mac";
-				reg = <0x1ef0000 0x00200>;
-				read-only;
-			};
-
-			partition at 1ef0200 {
-				label = "pin";
-				reg = <0x1ef0200 0x00200>;
-				read-only;
-			};
-
-			partition at 1ef0400 {
-				label = "device-id";
-				reg = <0x1ef0400 0x00200>;
-				read-only;
-			};
-
-			partition at 1ef0600 {
-				label = "product-info";
-				reg = <0x1ef0600 0x0fa00>;
-				read-only;
-			};
-
-			partition at 1f00000 {
-				label = "partition-table";
-				reg = <0x1f00000 0x10000>;
-				read-only;
-			};
-
-			partition at 1f10000 {
-				label = "soft-version";
-				reg = <0x1f10000 0x10000>;
-				read-only;
-			};
-
-			partition at 1f20000 {
-				label = "support-list";
-				reg = <0x1f20000 0x10000>;
-				read-only;
-			};
-
-			partition at 1f30000 {
-				label = "profile";
-				reg = <0x1f30000 0x10000>;
-				read-only;
-			};
-
-			partition at 1f40000 {
-				label = "default-config";
-				reg = <0x1f40000 0x10000>;
-				read-only;
-			};
-
-			partition at 1f50000 {
-				label = "user-config";
-				reg = <0x1f50000 0x40000>;
-				read-only;
-			};
-
-			partition at 1f90000 {
-				label = "qos-db";
-				reg = <0x1f90000 0x40000>;
-				read-only;
-			};
-
-			partition at 1fd0000 {
-				label = "usb-config";
-				reg = <0x1fd0000 0x10000>;
-				read-only;
-			};
-
-			partition at 1fe0000 {
-				label = "log";
-				reg = <0x1fe0000 0x20000>;
-				read-only;
-			};
-		};
-	};
-};
-
-&usb3_0 {
-	status = "okay";
-
-	pinctrl-0 = <&usb0_pwr_en_pin>;
-	pinctrl-names = "default";
-};
-
-&usb3_1 {
-	status = "okay";
-
-	pinctrl-0 = <&usb1_pwr_en_pin>;
-	pinctrl-names = "default";
-};
-
-&pcie0 {
-	status = "okay";
-};
-
-&pcie1 {
-	status = "okay";
-	max-link-speed = <1>;
 };
 
 &pcie2 {
 	status = "okay";
 	max-link-speed = <1>;
 };
-
-&mdio0 {
-	status = "okay";
-
-	pinctrl-0 = <&mdio0_pins>;
-	pinctrl-names = "default";
-
-	phy0: ethernet-phy at 0 {
-		reg = <0>;
-		qca,ar8327-initvals = <
-			0x00004 0x7600000   /* PAD0_MODE */
-			0x00008 0x1000000   /* PAD5_MODE */
-			0x0000c 0x80        /* PAD6_MODE */
-			0x000e4 0x6a545     /* MAC_POWER_SEL */
-			0x000e0 0xc74164de  /* SGMII_CTRL */
-			0x0007c 0x4e        /* PORT0_STATUS */
-			0x00094 0x4e        /* PORT6_STATUS */
-			>;
-	};
-
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
-&gmac1 {
-	status = "okay";
-	phy-mode = "rgmii";
-	qcom,id = <1>;
-
-	pinctrl-0 = <&rgmii2_pins>;
-	pinctrl-names = "default";
-
-	mtd-mac-address = <&defaultmac 0x8>;
-	mtd-mac-address-increment = <1>;
-
-	fixed-link {
-		speed = <1000>;
-		full-duplex;
-	};
-};
-
-&gmac2 {
-	status = "okay";
-	phy-mode = "sgmii";
-	qcom,id = <2>;
-
-	mtd-mac-address = <&defaultmac 0x8>;
-
-	fixed-link {
-		speed = <1000>;
-		full-duplex;
-	};
-};
-
-&adm_dma {
-	status = "okay";
-};
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
index 4ae7de604b..3f2a90fdee 100644
--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
@@ -1,24 +1,14 @@
-#include "qcom-ipq8064-v2.0.dtsi"
-
-#include <dt-bindings/input/input.h>
+#include "qcom-ipq8064-ad7200-c2600.dtsi"
 
 / {
 	model = "TP-Link Archer C2600";
 	compatible = "tplink,c2600", "qcom,ipq8064";
 
-	memory at 0 {
-		reg = <0x42000000 0x1e000000>;
-		device_type = "memory";
-	};
-
 	aliases {
-		mdio-gpio0 = &mdio0;
-
 		led-boot = &power;
 		led-failsafe = &general;
 		led-running = &power;
 		led-upgrade = &general;
-		label-mac-device = &gmac2;
 	};
 
 	keys {
@@ -118,300 +108,4 @@
 			bias-pull-up;
 		};
 	};
-
-	spi_pins: spi_pins {
-		mux {
-			pins = "gpio18", "gpio19", "gpio21";
-			function = "gsbi5";
-			bias-pull-down;
-		};
-
-		data {
-			pins = "gpio18", "gpio19";
-			drive-strength = <10>;
-		};
-
-		cs {
-			pins = "gpio20";
-			function = "gpio";
-			drive-strength = <10>;
-			bias-pull-up;
-		};
-
-		clk {
-			pins = "gpio21";
-			drive-strength = <12>;
-		};
-	};
-
-	usb0_pwr_en_pin: usb0_pwr_en_pin {
-		mux {
-			pins = "gpio25";
-			function = "gpio";
-			drive-strength = <10>;
-			bias-pull-up;
-			output-high;
-		};
-	};
-
-	usb1_pwr_en_pin: usb1_pwr_en_pin {
-		mux {
-			pins = "gpio23";
-			function = "gpio";
-			drive-strength = <10>;
-			bias-pull-up;
-			output-high;
-		};
-	};
-};
-
-&gsbi5 {
-	qcom,mode = <GSBI_PROT_SPI>;
-	status = "okay";
-
-	spi5: spi at 1a280000 {
-		status = "okay";
-
-		pinctrl-0 = <&spi_pins>;
-		pinctrl-names = "default";
-
-		cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
-
-		m25p80 at 0 {
-			compatible = "jedec,spi-nor";
-			#address-cells = <1>;
-			#size-cells = <1>;
-			spi-max-frequency = <50000000>;
-			reg = <0>;
-
-			SBL1 at 0 {
-				label = "SBL1";
-				reg = <0x0 0x20000>;
-				read-only;
-			};
-
-			MIBIB at 20000 {
-				label = "MIBIB";
-				reg = <0x20000 0x20000>;
-				read-only;
-			};
-
-			SBL2 at 40000 {
-				label = "SBL2";
-				reg = <0x40000 0x20000>;
-				read-only;
-			};
-
-			SBL3 at 60000 {
-				label = "SBL3";
-				reg = <0x60000 0x30000>;
-				read-only;
-			};
-
-			DDRCONFIG at 90000 {
-				label = "DDRCONFIG";
-				reg = <0x90000 0x10000>;
-				read-only;
-			};
-
-			SSD at a0000 {
-				label = "SSD";
-				reg = <0xa0000 0x10000>;
-				read-only;
-			};
-
-			TZ at b0000 {
-				label = "TZ";
-				reg = <0xb0000 0x30000>;
-				read-only;
-			};
-
-			RPM at e0000 {
-				label = "RPM";
-				reg = <0xe0000 0x20000>;
-				read-only;
-			};
-
-			fs-uboot at 100000 {
-				label = "fs-uboot";
-				reg = <0x100000 0x70000>;
-				read-only;
-			};
-
-			uboot-env at 170000 {
-				label = "uboot-env";
-				reg = <0x170000 0x40000>;
-				read-only;
-			};
-
-			radio at 1b0000 {
-				label = "radio";
-				reg = <0x1b0000 0x40000>;
-				read-only;
-			};
-
-			os-image at 1f0000 {
-				label = "os-image";
-				reg = <0x1f0000 0x400000>;
-			};
-
-			rootfs at 5f0000 {
-				label = "rootfs";
-				reg = <0x5f0000 0x1900000>;
-			};
-
-			defaultmac: default-mac at 1ef0000 {
-				label = "default-mac";
-				reg = <0x1ef0000 0x00200>;
-				read-only;
-			};
-
-			pin at 1ef0200 {
-				label = "pin";
-				reg = <0x1ef0200 0x00200>;
-				read-only;
-			};
-
-			product-info at 1ef0400 {
-				label = "product-info";
-				reg = <0x1ef0400 0x0fc00>;
-				read-only;
-			};
-
-			partition-table at 1f00000 {
-				label = "partition-table";
-				reg = <0x1f00000 0x10000>;
-				read-only;
-			};
-
-			soft-version at 1f10000 {
-				label = "soft-version";
-				reg = <0x1f10000 0x10000>;
-				read-only;
-			};
-
-			support-list at 1f20000 {
-				label = "support-list";
-				reg = <0x1f20000 0x10000>;
-				read-only;
-			};
-
-			profile at 1f30000 {
-				label = "profile";
-				reg = <0x1f30000 0x10000>;
-				read-only;
-			};
-
-			default-config at 1f40000 {
-				label = "default-config";
-				reg = <0x1f40000 0x10000>;
-				read-only;
-			};
-
-			user-config at 1f50000 {
-				label = "user-config";
-				reg = <0x1f50000 0x40000>;
-				read-only;
-			};
-
-			qos-db at 1f90000 {
-				label = "qos-db";
-				reg = <0x1f90000 0x40000>;
-				read-only;
-			};
-
-			usb-config at 1fd0000 {
-				label = "usb-config";
-				reg = <0x1fd0000 0x10000>;
-				read-only;
-			};
-
-			log at 1fe0000 {
-				label = "log";
-				reg = <0x1fe0000 0x20000>;
-				read-only;
-			};
-		};
-	};
-};
-
-&usb3_0 {
-	status = "okay";
-
-	pinctrl-0 = <&usb0_pwr_en_pin>;
-	pinctrl-names = "default";
-};
-
-&usb3_1 {
-	status = "okay";
-
-	pinctrl-0 = <&usb1_pwr_en_pin>;
-	pinctrl-names = "default";
-};
-
-&pcie0 {
-	status = "okay";
-};
-
-&pcie1 {
-	status = "okay";
-	max-link-speed = <1>;
-};
-
-&mdio0 {
-	status = "okay";
-
-	pinctrl-0 = <&mdio0_pins>;
-	pinctrl-names = "default";
-
-	phy0: ethernet-phy at 0 {
-		reg = <0>;
-		qca,ar8327-initvals = <
-			0x00004 0x7600000   /* PAD0_MODE */
-			0x00008 0x1000000   /* PAD5_MODE */
-			0x0000c 0x80        /* PAD6_MODE */
-			0x000e4 0x6a545     /* MAC_POWER_SEL */
-			0x000e0 0xc74164de  /* SGMII_CTRL */
-			0x0007c 0x4e        /* PORT0_STATUS */
-			0x00094 0x4e        /* PORT6_STATUS */
-			>;
-	};
-
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
-&gmac1 {
-	status = "okay";
-	phy-mode = "rgmii";
-	qcom,id = <1>;
-
-	pinctrl-0 = <&rgmii2_pins>;
-	pinctrl-names = "default";
-
-	mtd-mac-address = <&defaultmac 0x8>;
-	mtd-mac-address-increment = <1>;
-
-	fixed-link {
-		speed = <1000>;
-		full-duplex;
-	};
-};
-
-&gmac2 {
-	status = "okay";
-	phy-mode = "sgmii";
-	qcom,id = <2>;
-
-	mtd-mac-address = <&defaultmac 0x8>;
-
-	fixed-link {
-		speed = <1000>;
-		full-duplex;
-	};
-};
-
-&adm_dma {
-	status = "okay";
 };



More information about the lede-commits mailing list