Browse Source

ipq806x: overhaul AVM FRITZ!box 4040 device-tree file

This patch aligns the device-tree file with the latest
guidelines.
 - No longer include qcom-ipq4019-ap.dk01.1.dtsi. This
   file is only partially upstream and therefore subjected
   to changes that might not be compatible with the board.

   As a result, the definitions from the file have been
   copied into this dts.

 - exclusively use decimal GPIO addresses.

 - reorganize the reserved-memory layout to waste less
   memory. There's no point in keeping the u-boot loader
   around. This should also make it possible    to create
   an image that will boot with the original EVA/ADAM2 loader
   without needing to install the modified u-boot loader.
   And finally mark the "tz-apps" as reusable.
   There isn't a way to  upload apps to the trust-zone in OpenWrt
   yet. But it might see some use in the future as a "secure"
   key-store/TPM.

 - sort the first-level nodes alphabetically.
 - sort nodes with an address by the address.

Signed-off-by: Christian Lamparter <[email protected]>
Christian Lamparter 7 years ago
parent
commit
42b47f1b40

+ 143 - 38
target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-fritz4040.dts

@@ -14,51 +14,107 @@
  *
  */
 
-#include "qcom-ipq4019-ap.dk01.1.dtsi"
+#include "qcom-ipq4019.dtsi"
 #include "qcom-ipq4019-bus.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/soc/qcom,tcsr.h>
 
 / {
 	model = "AVM FRITZ!Box 4040";
 	compatible = "avm,fritzbox-4040", "qcom,ipq4019";
 
+	aliases {
+		led-boot = &power;
+		led-failsafe = &flash;
+		led-running = &power;
+		led-upgrade = &flash;
+	};
+
 	reserved-memory {
 		#address-cells = <0x1>;
 		#size-cells = <0x1>;
 		ranges;
 
-		rsvd1@87000000 {
-			reg = <0x87000000 0x500000>;
-			no-map;
+		tz_apps@87b80000 {
+			reg = <0x87b80000 0x280000>;
+			reusable;
 		};
 
-		wifi_dump@87500000 {
-			reg = <0x87500000 0x600000>;
+		smem@87e00000 {
+			reg = <0x87e00000 0x080000>;
 			no-map;
 		};
 
-		rsvd2@87B00000 {
-			reg = <0x87b00000 0x500000>;
+		tz@87e80000 {
+			reg = <0x87e80000 0x180000>;
 			no-map;
 		};
 	};
-/*
-	This also works. Maybe it could be smaller still.
 
-	reserved-memory {
-		#address-cells = <0x1>;
-		#size-cells = <0x1>;
-		ranges;
+	soc {
+		mdio@90000 {
+			status = "okay";
+		};
 
-		rsvd1@87E00000 {
-			reg = <0x87e00000 0x200000>;
-			no-map;
+		ess-psgmii@98000 {
+			status = "okay";
+		};
+
+		tcsr@1949000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1949000 0x100>;
+			qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
+		};
+
+		tcsr@194b000 {
+			compatible = "qcom,tcsr";
+			reg = <0x194b000 0x100>;
+			qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+		};
+
+		ess_tcsr@1953000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1953000 0x1000>;
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+		};
+
+		tcsr@1957000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1957000 0x100>;
+			qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
+		};
+
+		usb2@60f8800 {
+			status = "ok";
+		};
+
+		serial@78af000 {
+			pinctrl-0 = <&serial_pins>;
+			pinctrl-names = "default";
+			status = "ok";
+		};
+
+		usb3@8af8800 {
+			status = "ok";
+		};
+
+		crypto@8e3a000 {
+			status = "ok";
+		};
+
+		wifi@a000000 {
+			status = "okay";
+		};
+
+		wifi@a800000 {
+			status = "okay";
+		};
+
+		watchdog@b017000 {
+			status = "ok";
 		};
-	};
-*/
 
-	soc {
 		qca8075: ess-switch@c000000 {
 			status = "okay";
 
@@ -68,10 +124,14 @@
 			enable-usb-power {
 				gpio-hog;
 				line-name = "enable USB3 power";
-				gpios = <0x7 GPIO_ACTIVE_HIGH>;
+				gpios = <7 GPIO_ACTIVE_HIGH>;
 				output-high;
 			};
 		};
+
+		edma@c080000 {
+			status = "okay";
+		};
 	};
 
 	gpio-keys {
@@ -79,7 +139,7 @@
 
 		wlan {
 			label = "wlan";
-			gpios = <&tlmm 0x3a GPIO_ACTIVE_LOW>;
+			gpios = <&tlmm 58 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_RFKILL>;
 		};
 
@@ -90,52 +150,85 @@
 		};
 	};
 
-	aliases {
-		led-boot = &power;
-		led-failsafe = &flash;
-		led-running = &power;
-		led-upgrade = &flash;
-	};
-
 	gpio-leds {
 		compatible = "gpio-leds";
 
 		wlan {
 			label = "fritz4040:green:wlan";
-			gpios = <&qca8075 0x1 GPIO_ACTIVE_HIGH>;
+			gpios = <&qca8075 1 GPIO_ACTIVE_HIGH>;
 		};
 
 		panic: info_red {
 			label = "fritz4040:red:info";
-			gpios = <&qca8075 0x3 GPIO_ACTIVE_HIGH>;
+			gpios = <&qca8075 3 GPIO_ACTIVE_HIGH>;
 			panic-indicator;
 		};
 
 		wan {
 			label = "fritz4040:green:wan";
-			gpios = <&qca8075 0x5 GPIO_ACTIVE_HIGH>;
+			gpios = <&qca8075 5 GPIO_ACTIVE_HIGH>;
 		};
 
 		power: power {
 			label = "fritz4040:green:power";
-			gpios = <&qca8075 0xb GPIO_ACTIVE_HIGH>;
+			gpios = <&qca8075 11 GPIO_ACTIVE_HIGH>;
 		};
 
 		lan {
 			label = "fritz4040:green:lan";
-			gpios = <&qca8075 0xd GPIO_ACTIVE_HIGH>;
+			gpios = <&qca8075 13 GPIO_ACTIVE_HIGH>;
 		};
 
 		flash: info_amber {
 			label = "fritz4040:amber:info";
-			gpios = <&qca8075 0xf GPIO_ACTIVE_HIGH>;
+			gpios = <&qca8075 15 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&tlmm {
+	serial_pins: serial_pinmux {
+		mux {
+			pins = "gpio60", "gpio61";
+			function = "blsp_uart0";
+			bias-disable;
 		};
 	};
+
+	spi_0_pins: spi_0_pinmux {
+		mux {
+			function = "blsp_spi0";
+			pins = "gpio55", "gpio56", "gpio57";
+			drive-strength = <12>;
+			bias-disable;
+		};
+
+		mux_cs {
+			function = "gpio";
+			pins = "gpio54";
+			drive-strength = <2>;
+			bias-disable;
+			output-high;
+		};
+	};
+};
+
+&cryptobam {
+	status = "ok";
+};
+
+&blsp_dma {
+	status = "ok";
 };
 
 &spi_0 { /* BLSP1 QUP1 */
+	pinctrl-0 = <&spi_0_pins>;
+	pinctrl-names = "default";
+	status = "ok";
+	cs-gpios = <&tlmm 54 0>;
+
 	mx25l25635f@0 {
-		compatible = "mx25l25635f", "jedec,spi-nor";
+		compatible = "jedec,spi-nor";
 		#address-cells = <1>;
 		#size-cells = <0>;
 		reg = <0>;
@@ -206,12 +299,24 @@
 			};
 			partition11@2A0000 {
 				label = "firmware";
-				reg = <0x002A0000 0x01C60000>;
+				reg = <0x002a0000 0x01c60000>;
 			};
 			partition12@1f00000 {
 				label = "jffs2";
-				reg = <0x01F00000 0x00100000>;
+				reg = <0x01f00000 0x00100000>;
 			};
 		};
 	};
 };
+
+&usb3_ss_phy {
+	status = "ok";
+};
+
+&usb3_hs_phy {
+	status = "ok";
+};
+
+&usb2_hs_phy {
+	status = "ok";
+};