e398f45
From 4d321bf15d2d5e5b1b674f2a26a1c5202090a800 Mon Sep 17 00:00:00 2001
6c5f577
From: Peter Robinson <pbrobinson@gmail.com>
e398f45
Date: Thu, 17 Mar 2016 15:19:04 +0000
e398f45
Subject: [PATCH] geekbox v4 patchset
6c5f577
6c5f577
---
6c5f577
 Documentation/devicetree/bindings/arm/rockchip.txt |   9 +
6c5f577
 arch/arm64/boot/dts/rockchip/Makefile              |   2 +
e398f45
 arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi       |   2 +-
e398f45
 .../dts/rockchip/rk3368-geekbox-landingship.dts    |  57 ++++
e398f45
 arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts    | 319 +++++++++++++++++++++
e398f45
 arch/arm64/boot/dts/rockchip/rk3368-r88.dts        |   2 +-
e398f45
 6 files changed, 389 insertions(+), 2 deletions(-)
6c5f577
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3368-geekbox-landingship.dts
6c5f577
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts
6c5f577
6c5f577
diff --git a/Documentation/devicetree/bindings/arm/rockchip.txt b/Documentation/devicetree/bindings/arm/rockchip.txt
e398f45
index 078c14f..ae84f4e 100644
6c5f577
--- a/Documentation/devicetree/bindings/arm/rockchip.txt
6c5f577
+++ b/Documentation/devicetree/bindings/arm/rockchip.txt
6c5f577
@@ -87,6 +87,15 @@ Rockchip platforms device tree bindings
6c5f577
 		     "google,veyron-speedy-rev3", "google,veyron-speedy-rev2",
6c5f577
 		     "google,veyron-speedy", "google,veyron", "rockchip,rk3288";
6c5f577
 
6c5f577
+- GeekBuying GeekBox:
6c5f577
+    Required root node properties:
6c5f577
+      - compatible = "geekbuying,geekbox", "rockchip,rk3368";
6c5f577
+
e398f45
+- GeekBuying Landingship with GeekBox module:
6c5f577
+    Required root node properties:
e398f45
+      - compatible = "geekbuying,geekbox-landingship",
6c5f577
+		     "geekbuying,geekbox", "rockchip,rk3368";
6c5f577
+
6c5f577
 - Rockchip RK3368 evb:
6c5f577
     Required root node properties:
6c5f577
       - compatible = "rockchip,rk3368-evb-act8846", "rockchip,rk3368";
6c5f577
diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
6c5f577
index e3f0b5f..201bcd9 100644
6c5f577
--- a/arch/arm64/boot/dts/rockchip/Makefile
6c5f577
+++ b/arch/arm64/boot/dts/rockchip/Makefile
6c5f577
@@ -1,4 +1,6 @@
6c5f577
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-evb-act8846.dtb
6c5f577
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-geekbox.dtb
6c5f577
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-geekbox-landingship.dtb
6c5f577
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-r88.dtb
6c5f577
 
6c5f577
 always		:= $(dtb-y)
e398f45
diff --git a/arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi b/arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi
e398f45
index 8c219cc..e4ceb53 100644
e398f45
--- a/arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi
e398f45
+++ b/arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi
e398f45
@@ -48,7 +48,7 @@
e398f45
 		stdout-path = "serial2:115200n8";
e398f45
 	};
e398f45
 
e398f45
-	memory {
e398f45
+	memory@0 {
e398f45
 		device_type = "memory";
e398f45
 		reg = <0x0 0x0 0x0 0x40000000>;
e398f45
 	};
6c5f577
diff --git a/arch/arm64/boot/dts/rockchip/rk3368-geekbox-landingship.dts b/arch/arm64/boot/dts/rockchip/rk3368-geekbox-landingship.dts
6c5f577
new file mode 100644
e398f45
index 0000000..a28ace9
6c5f577
--- /dev/null
6c5f577
+++ b/arch/arm64/boot/dts/rockchip/rk3368-geekbox-landingship.dts
e398f45
@@ -0,0 +1,57 @@
6c5f577
+/*
6c5f577
+ * Copyright (c) 2016 Andreas Färber
6c5f577
+ *
6c5f577
+ * This file is dual-licensed: you can use it either under the terms
6c5f577
+ * of the GPL or the X11 license, at your option. Note that this dual
6c5f577
+ * licensing only applies to this file, and not this project as a
6c5f577
+ * whole.
6c5f577
+ *
6c5f577
+ *  a) This file is free software; you can redistribute it and/or
6c5f577
+ *     modify it under the terms of the GNU General Public License as
6c5f577
+ *     published by the Free Software Foundation; either version 2 of the
6c5f577
+ *     License, or (at your option) any later version.
6c5f577
+ *
6c5f577
+ *     This file is distributed in the hope that it will be useful,
6c5f577
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
6c5f577
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6c5f577
+ *     GNU General Public License for more details.
6c5f577
+ *
6c5f577
+ * Or, alternatively,
6c5f577
+ *
6c5f577
+ *  b) Permission is hereby granted, free of charge, to any person
6c5f577
+ *     obtaining a copy of this software and associated documentation
6c5f577
+ *     files (the "Software"), to deal in the Software without
6c5f577
+ *     restriction, including without limitation the rights to use,
6c5f577
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
6c5f577
+ *     sell copies of the Software, and to permit persons to whom the
6c5f577
+ *     Software is furnished to do so, subject to the following
6c5f577
+ *     conditions:
6c5f577
+ *
6c5f577
+ *     The above copyright notice and this permission notice shall be
6c5f577
+ *     included in all copies or substantial portions of the Software.
6c5f577
+ *
6c5f577
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
6c5f577
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6c5f577
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6c5f577
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6c5f577
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6c5f577
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6c5f577
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6c5f577
+ *     OTHER DEALINGS IN THE SOFTWARE.
6c5f577
+ */
6c5f577
+
6c5f577
+#include "rk3368-geekbox.dts"
6c5f577
+
6c5f577
+/ {
6c5f577
+	model = "GeekBox on Landingship";
e398f45
+	compatible = "geekbuying,geekbox-landingship",
e398f45
+		     "geekbuying,geekbox", "rockchip,rk3368";
6c5f577
+};
6c5f577
+
6c5f577
+&i2c1 {
e398f45
+	status = "disabled";
6c5f577
+};
6c5f577
+
6c5f577
+&i2c2 {
6c5f577
+	status = "okay";
6c5f577
+};
6c5f577
diff --git a/arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts b/arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts
6c5f577
new file mode 100644
e398f45
index 0000000..46cdddf
6c5f577
--- /dev/null
6c5f577
+++ b/arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts
e398f45
@@ -0,0 +1,319 @@
6c5f577
+/*
6c5f577
+ * Copyright (c) 2016 Andreas Färber
6c5f577
+ *
6c5f577
+ * This file is dual-licensed: you can use it either under the terms
6c5f577
+ * of the GPL or the X11 license, at your option. Note that this dual
6c5f577
+ * licensing only applies to this file, and not this project as a
6c5f577
+ * whole.
6c5f577
+ *
6c5f577
+ *  a) This file is free software; you can redistribute it and/or
6c5f577
+ *     modify it under the terms of the GNU General Public License as
6c5f577
+ *     published by the Free Software Foundation; either version 2 of the
6c5f577
+ *     License, or (at your option) any later version.
6c5f577
+ *
6c5f577
+ *     This file is distributed in the hope that it will be useful,
6c5f577
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
6c5f577
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6c5f577
+ *     GNU General Public License for more details.
6c5f577
+ *
6c5f577
+ * Or, alternatively,
6c5f577
+ *
6c5f577
+ *  b) Permission is hereby granted, free of charge, to any person
6c5f577
+ *     obtaining a copy of this software and associated documentation
6c5f577
+ *     files (the "Software"), to deal in the Software without
6c5f577
+ *     restriction, including without limitation the rights to use,
6c5f577
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
6c5f577
+ *     sell copies of the Software, and to permit persons to whom the
6c5f577
+ *     Software is furnished to do so, subject to the following
6c5f577
+ *     conditions:
6c5f577
+ *
6c5f577
+ *     The above copyright notice and this permission notice shall be
6c5f577
+ *     included in all copies or substantial portions of the Software.
6c5f577
+ *
6c5f577
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
6c5f577
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6c5f577
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6c5f577
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6c5f577
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6c5f577
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6c5f577
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6c5f577
+ *     OTHER DEALINGS IN THE SOFTWARE.
6c5f577
+ */
6c5f577
+
6c5f577
+/dts-v1/;
6c5f577
+#include "rk3368.dtsi"
e398f45
+#include <dt-bindings/input/input.h>
6c5f577
+
6c5f577
+/ {
6c5f577
+	model = "GeekBox";
6c5f577
+	compatible = "geekbuying,geekbox", "rockchip,rk3368";
6c5f577
+
6c5f577
+	chosen {
6c5f577
+		stdout-path = "serial2:115200n8";
6c5f577
+	};
6c5f577
+
e398f45
+	memory@0 {
6c5f577
+		device_type = "memory";
6c5f577
+		reg = <0x0 0x0 0x0 0x80000000>;
6c5f577
+	};
6c5f577
+
6c5f577
+	ext_gmac: gmac-clk {
6c5f577
+		compatible = "fixed-clock";
6c5f577
+		clock-frequency = <125000000>;
6c5f577
+		clock-output-names = "ext_gmac";
6c5f577
+		#clock-cells = <0>;
6c5f577
+	};
6c5f577
+
6c5f577
+	ir: ir-receiver {
6c5f577
+		compatible = "gpio-ir-receiver";
6c5f577
+		gpios = <&gpio3 30 GPIO_ACTIVE_LOW>;
6c5f577
+		pinctrl-names = "default";
6c5f577
+		pinctrl-0 = <&ir_int>;
6c5f577
+	};
6c5f577
+
6c5f577
+	keys: gpio-keys {
6c5f577
+		compatible = "gpio-keys";
6c5f577
+		pinctrl-names = "default";
6c5f577
+		pinctrl-0 = <&pwr_key>;
6c5f577
+
e398f45
+		power {
6c5f577
+			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
6c5f577
+			label = "GPIO Power";
e398f45
+			linux,code = <KEY_POWER>;
e398f45
+			wakeup-source;
6c5f577
+		};
6c5f577
+	};
6c5f577
+
6c5f577
+	leds: gpio-leds {
6c5f577
+		compatible = "gpio-leds";
6c5f577
+
6c5f577
+		blue {
6c5f577
+			gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
6c5f577
+			label = "geekbox:blue:led";
6c5f577
+			default-state = "on";
6c5f577
+		};
6c5f577
+
6c5f577
+		red {
6c5f577
+			gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
6c5f577
+			label = "geekbox:red:led";
6c5f577
+			default-state = "off";
6c5f577
+		};
6c5f577
+	};
6c5f577
+
6c5f577
+	vcc_sys: vcc-sys-regulator {
6c5f577
+		compatible = "regulator-fixed";
6c5f577
+		regulator-name = "vcc_sys";
6c5f577
+		regulator-min-microvolt = <5000000>;
6c5f577
+		regulator-max-microvolt = <5000000>;
6c5f577
+		regulator-always-on;
6c5f577
+		regulator-boot-on;
6c5f577
+	};
6c5f577
+};
6c5f577
+
6c5f577
+&emmc {
6c5f577
+	status = "okay";
6c5f577
+	bus-width = <8>;
6c5f577
+	cap-mmc-highspeed;
6c5f577
+	clock-frequency = <150000000>;
6c5f577
+	disable-wp;
6c5f577
+	keep-power-in-suspend;
6c5f577
+	non-removable;
6c5f577
+	num-slots = <1>;
6c5f577
+	vmmc-supply = <&vcc_io>;
6c5f577
+	vqmmc-supply = <&vcc18_flash>;
6c5f577
+	pinctrl-names = "default";
6c5f577
+	pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
6c5f577
+};
6c5f577
+
6c5f577
+&gmac {
6c5f577
+	status = "okay";
6c5f577
+	phy-supply = <&vcc_lan>;
6c5f577
+	phy-mode = "rgmii";
6c5f577
+	clock_in_out = "input";
6c5f577
+	assigned-clocks = <&cru SCLK_MAC>;
6c5f577
+	assigned-clock-parents = <&ext_gmac>;
6c5f577
+	pinctrl-names = "default";
6c5f577
+	pinctrl-0 = <&rgmii_pins>;
6c5f577
+	tx_delay = <0x30>;
6c5f577
+	rx_delay = <0x10>;
6c5f577
+};
6c5f577
+
6c5f577
+&i2c0 {
6c5f577
+	status = "okay";
6c5f577
+
6c5f577
+	rk808: pmic@1b {
6c5f577
+		compatible = "rockchip,rk808";
6c5f577
+		reg = <0x1b>;
6c5f577
+		pinctrl-names = "default";
6c5f577
+		pinctrl-0 = <&pmic_int>, <&pmic_sleep>;
6c5f577
+		interrupt-parent = <&gpio0>;
6c5f577
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
6c5f577
+		rockchip,system-power-controller;
6c5f577
+		vcc1-supply = <&vcc_sys>;
6c5f577
+		vcc2-supply = <&vcc_sys>;
6c5f577
+		vcc3-supply = <&vcc_sys>;
6c5f577
+		vcc4-supply = <&vcc_sys>;
6c5f577
+		vcc6-supply = <&vcc_sys>;
6c5f577
+		vcc7-supply = <&vcc_sys>;
6c5f577
+		vcc8-supply = <&vcc_io>;
6c5f577
+		vcc9-supply = <&vcc_sys>;
6c5f577
+		vcc10-supply = <&vcc_sys>;
6c5f577
+		vcc11-supply = <&vcc_sys>;
6c5f577
+		vcc12-supply = <&vcc_io>;
6c5f577
+		clock-output-names = "xin32k", "rk808-clkout2";
6c5f577
+		#clock-cells = <1>;
6c5f577
+
6c5f577
+		regulators {
6c5f577
+			vdd_cpu: DCDC_REG1 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <700000>;
6c5f577
+				regulator-max-microvolt = <1500000>;
6c5f577
+				regulator-name = "vdd_cpu";
6c5f577
+			};
6c5f577
+
6c5f577
+			vdd_log: DCDC_REG2 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <700000>;
6c5f577
+				regulator-max-microvolt = <1500000>;
6c5f577
+				regulator-name = "vdd_log";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc_ddr: DCDC_REG3 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-name = "vcc_ddr";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc_io: DCDC_REG4 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <3300000>;
6c5f577
+				regulator-max-microvolt = <3300000>;
6c5f577
+				regulator-name = "vcc_io";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc18_flash: LDO_REG1 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <1800000>;
6c5f577
+				regulator-max-microvolt = <1800000>;
6c5f577
+				regulator-name = "vcc18_flash";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc33_lcd: LDO_REG2 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <3300000>;
6c5f577
+				regulator-max-microvolt = <3300000>;
6c5f577
+				regulator-name = "vcc33_lcd";
6c5f577
+			};
6c5f577
+
6c5f577
+			vdd_10: LDO_REG3 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <1000000>;
6c5f577
+				regulator-max-microvolt = <1000000>;
6c5f577
+				regulator-name = "vdd_10";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcca_18: LDO_REG4 {
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <1800000>;
6c5f577
+				regulator-max-microvolt = <1800000>;
6c5f577
+				regulator-name = "vcca_18";
6c5f577
+			};
6c5f577
+
6c5f577
+			vccio_sd: LDO_REG5 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <1800000>;
6c5f577
+				regulator-max-microvolt = <3300000>;
6c5f577
+				regulator-name = "vccio_sd";
6c5f577
+			};
6c5f577
+
6c5f577
+			vdd10_lcd: LDO_REG6 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <1000000>;
6c5f577
+				regulator-max-microvolt = <1000000>;
6c5f577
+				regulator-name = "vdd10_lcd";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc_18: LDO_REG7 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <1800000>;
6c5f577
+				regulator-max-microvolt = <1800000>;
6c5f577
+				regulator-name = "vcc_18";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc18_lcd: LDO_REG8 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-min-microvolt = <1800000>;
6c5f577
+				regulator-max-microvolt = <1800000>;
6c5f577
+				regulator-name = "vcc18_lcd";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc_sd: SWITCH_REG1 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-name = "vcc_sd";
6c5f577
+			};
6c5f577
+
6c5f577
+			vcc_lan: SWITCH_REG2 {
6c5f577
+				regulator-always-on;
6c5f577
+				regulator-boot-on;
6c5f577
+				regulator-name = "vcc_lan";
6c5f577
+			};
6c5f577
+		};
6c5f577
+	};
6c5f577
+};
6c5f577
+
6c5f577
+&pinctrl {
6c5f577
+	ir {
6c5f577
+		ir_int: ir-int {
e398f45
+			rockchip,pins = <3 30 RK_FUNC_GPIO &pcfg_pull_none>;
6c5f577
+		};
6c5f577
+	};
6c5f577
+
6c5f577
+	keys {
6c5f577
+		pwr_key: pwr-key {
e398f45
+			rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_none>;
6c5f577
+		};
6c5f577
+	};
6c5f577
+
6c5f577
+	pmic {
6c5f577
+		pmic_sleep: pmic-sleep {
6c5f577
+			rockchip,pins = <0 0 RK_FUNC_2 &pcfg_pull_none>;
6c5f577
+		};
6c5f577
+
6c5f577
+		pmic_int: pmic-int {
6c5f577
+			rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
6c5f577
+		};
6c5f577
+	};
6c5f577
+};
6c5f577
+
6c5f577
+&tsadc {
6c5f577
+	status = "okay";
6c5f577
+	rockchip,hw-tshut-mode = <0>; /* CRU */
e398f45
+	rockchip,hw-tshut-polarity = <1>; /* high */
6c5f577
+};
6c5f577
+
6c5f577
+&uart2 {
6c5f577
+	status = "okay";
6c5f577
+};
6c5f577
+
6c5f577
+&usb_host0_ehci {
6c5f577
+	status = "okay";
6c5f577
+};
6c5f577
+
6c5f577
+&usb_otg {
6c5f577
+	status = "okay";
6c5f577
+};
6c5f577
+
6c5f577
+&wdt {
6c5f577
+	status = "okay";
6c5f577
+};
e398f45
diff --git a/arch/arm64/boot/dts/rockchip/rk3368-r88.dts b/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
e398f45
index 104cbee..9548129 100644
e398f45
--- a/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
e398f45
+++ b/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
e398f45
@@ -51,7 +51,7 @@
e398f45
 		stdout-path = "serial2:115200n8";
e398f45
 	};
e398f45
 
e398f45
-	memory {
e398f45
+	memory@0 {
e398f45
 		device_type = "memory";
e398f45
 		reg = <0x0 0x0 0x0 0x40000000>;
e398f45
 	};
6c5f577
-- 
6c5f577
2.5.0
6c5f577