18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2015 Caesar Wang <wxt@rock-chips.com>
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#include <dt-bindings/input/input.h>
78c2ecf20Sopenharmony_ci#include <dt-bindings/pwm/pwm.h>
88c2ecf20Sopenharmony_ci#include "rk3368.dtsi"
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/ {
118c2ecf20Sopenharmony_ci	chosen {
128c2ecf20Sopenharmony_ci		stdout-path = "serial2:115200n8";
138c2ecf20Sopenharmony_ci	};
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci	memory {
168c2ecf20Sopenharmony_ci		device_type = "memory";
178c2ecf20Sopenharmony_ci		reg = <0x0 0x0 0x0 0x40000000>;
188c2ecf20Sopenharmony_ci	};
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci	backlight: backlight {
218c2ecf20Sopenharmony_ci		compatible = "pwm-backlight";
228c2ecf20Sopenharmony_ci		brightness-levels = <
238c2ecf20Sopenharmony_ci			  0   1   2   3   4   5   6   7
248c2ecf20Sopenharmony_ci			  8   9  10  11  12  13  14  15
258c2ecf20Sopenharmony_ci			 16  17  18  19  20  21  22  23
268c2ecf20Sopenharmony_ci			 24  25  26  27  28  29  30  31
278c2ecf20Sopenharmony_ci			 32  33  34  35  36  37  38  39
288c2ecf20Sopenharmony_ci			 40  41  42  43  44  45  46  47
298c2ecf20Sopenharmony_ci			 48  49  50  51  52  53  54  55
308c2ecf20Sopenharmony_ci			 56  57  58  59  60  61  62  63
318c2ecf20Sopenharmony_ci			 64  65  66  67  68  69  70  71
328c2ecf20Sopenharmony_ci			 72  73  74  75  76  77  78  79
338c2ecf20Sopenharmony_ci			 80  81  82  83  84  85  86  87
348c2ecf20Sopenharmony_ci			 88  89  90  91  92  93  94  95
358c2ecf20Sopenharmony_ci			 96  97  98  99 100 101 102 103
368c2ecf20Sopenharmony_ci			104 105 106 107 108 109 110 111
378c2ecf20Sopenharmony_ci			112 113 114 115 116 117 118 119
388c2ecf20Sopenharmony_ci			120 121 122 123 124 125 126 127
398c2ecf20Sopenharmony_ci			128 129 130 131 132 133 134 135
408c2ecf20Sopenharmony_ci			136 137 138 139 140 141 142 143
418c2ecf20Sopenharmony_ci			144 145 146 147 148 149 150 151
428c2ecf20Sopenharmony_ci			152 153 154 155 156 157 158 159
438c2ecf20Sopenharmony_ci			160 161 162 163 164 165 166 167
448c2ecf20Sopenharmony_ci			168 169 170 171 172 173 174 175
458c2ecf20Sopenharmony_ci			176 177 178 179 180 181 182 183
468c2ecf20Sopenharmony_ci			184 185 186 187 188 189 190 191
478c2ecf20Sopenharmony_ci			192 193 194 195 196 197 198 199
488c2ecf20Sopenharmony_ci			200 201 202 203 204 205 206 207
498c2ecf20Sopenharmony_ci			208 209 210 211 212 213 214 215
508c2ecf20Sopenharmony_ci			216 217 218 219 220 221 222 223
518c2ecf20Sopenharmony_ci			224 225 226 227 228 229 230 231
528c2ecf20Sopenharmony_ci			232 233 234 235 236 237 238 239
538c2ecf20Sopenharmony_ci			240 241 242 243 244 245 246 247
548c2ecf20Sopenharmony_ci			248 249 250 251 252 253 254 255>;
558c2ecf20Sopenharmony_ci		default-brightness-level = <128>;
568c2ecf20Sopenharmony_ci		enable-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
578c2ecf20Sopenharmony_ci		pinctrl-names = "default";
588c2ecf20Sopenharmony_ci		pinctrl-0 = <&bl_en>;
598c2ecf20Sopenharmony_ci		pwms = <&pwm0 0 1000000 PWM_POLARITY_INVERTED>;
608c2ecf20Sopenharmony_ci		pwm-delay-us = <10000>;
618c2ecf20Sopenharmony_ci	};
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	emmc_pwrseq: emmc-pwrseq {
648c2ecf20Sopenharmony_ci		compatible = "mmc-pwrseq-emmc";
658c2ecf20Sopenharmony_ci		pinctrl-0 = <&emmc_reset>;
668c2ecf20Sopenharmony_ci		pinctrl-names = "default";
678c2ecf20Sopenharmony_ci		reset-gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
688c2ecf20Sopenharmony_ci	};
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci	keys: gpio-keys {
718c2ecf20Sopenharmony_ci		compatible = "gpio-keys";
728c2ecf20Sopenharmony_ci		pinctrl-names = "default";
738c2ecf20Sopenharmony_ci		pinctrl-0 = <&pwr_key>;
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci		power {
768c2ecf20Sopenharmony_ci			wakeup-source;
778c2ecf20Sopenharmony_ci			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
788c2ecf20Sopenharmony_ci			label = "GPIO Power";
798c2ecf20Sopenharmony_ci			linux,code = <KEY_POWER>;
808c2ecf20Sopenharmony_ci		};
818c2ecf20Sopenharmony_ci	};
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci	/* supplies both host and otg */
848c2ecf20Sopenharmony_ci	vcc_host: vcc-host-regulator {
858c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
868c2ecf20Sopenharmony_ci		enable-active-high;
878c2ecf20Sopenharmony_ci		gpio = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
888c2ecf20Sopenharmony_ci		pinctrl-names = "default";
898c2ecf20Sopenharmony_ci		pinctrl-0 = <&host_vbus_drv>;
908c2ecf20Sopenharmony_ci		regulator-name = "vcc_host";
918c2ecf20Sopenharmony_ci		regulator-always-on;
928c2ecf20Sopenharmony_ci		regulator-boot-on;
938c2ecf20Sopenharmony_ci		vin-supply = <&vcc_sys>;
948c2ecf20Sopenharmony_ci	};
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci	vcc_lan: vcc-lan-regulator {
978c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
988c2ecf20Sopenharmony_ci		regulator-name = "vcc_lan";
998c2ecf20Sopenharmony_ci		regulator-min-microvolt = <3300000>;
1008c2ecf20Sopenharmony_ci		regulator-max-microvolt = <3300000>;
1018c2ecf20Sopenharmony_ci		regulator-always-on;
1028c2ecf20Sopenharmony_ci		regulator-boot-on;
1038c2ecf20Sopenharmony_ci		vin-supply = <&vcc_io>;
1048c2ecf20Sopenharmony_ci	};
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci	vcc_sys: vcc-sys-regulator {
1078c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
1088c2ecf20Sopenharmony_ci		regulator-name = "vcc_sys";
1098c2ecf20Sopenharmony_ci		regulator-min-microvolt = <5000000>;
1108c2ecf20Sopenharmony_ci		regulator-max-microvolt = <5000000>;
1118c2ecf20Sopenharmony_ci		regulator-always-on;
1128c2ecf20Sopenharmony_ci		regulator-boot-on;
1138c2ecf20Sopenharmony_ci	};
1148c2ecf20Sopenharmony_ci};
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci&emmc {
1178c2ecf20Sopenharmony_ci	bus-width = <8>;
1188c2ecf20Sopenharmony_ci	cap-mmc-highspeed;
1198c2ecf20Sopenharmony_ci	mmc-pwrseq = <&emmc_pwrseq>;
1208c2ecf20Sopenharmony_ci	non-removable;
1218c2ecf20Sopenharmony_ci	pinctrl-names = "default";
1228c2ecf20Sopenharmony_ci	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
1238c2ecf20Sopenharmony_ci	status = "okay";
1248c2ecf20Sopenharmony_ci};
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci&gmac {
1278c2ecf20Sopenharmony_ci	phy-supply = <&vcc_lan>;
1288c2ecf20Sopenharmony_ci	phy-mode = "rmii";
1298c2ecf20Sopenharmony_ci	clock_in_out = "output";
1308c2ecf20Sopenharmony_ci	snps,reset-gpio = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>;
1318c2ecf20Sopenharmony_ci	snps,reset-active-low;
1328c2ecf20Sopenharmony_ci	snps,reset-delays-us = <0 10000 1000000>;
1338c2ecf20Sopenharmony_ci	pinctrl-names = "default";
1348c2ecf20Sopenharmony_ci	pinctrl-0 = <&rmii_pins>;
1358c2ecf20Sopenharmony_ci	tx_delay = <0x30>;
1368c2ecf20Sopenharmony_ci	rx_delay = <0x10>;
1378c2ecf20Sopenharmony_ci	status = "okay";
1388c2ecf20Sopenharmony_ci};
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci&i2c0 {
1418c2ecf20Sopenharmony_ci	status = "okay";
1428c2ecf20Sopenharmony_ci};
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci&pinctrl {
1458c2ecf20Sopenharmony_ci	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
1468c2ecf20Sopenharmony_ci		bias-disable;
1478c2ecf20Sopenharmony_ci		drive-strength = <8>;
1488c2ecf20Sopenharmony_ci	};
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
1518c2ecf20Sopenharmony_ci		bias-pull-up;
1528c2ecf20Sopenharmony_ci		drive-strength = <8>;
1538c2ecf20Sopenharmony_ci	};
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci	backlight {
1568c2ecf20Sopenharmony_ci		bl_en: bl-en {
1578c2ecf20Sopenharmony_ci			rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
1588c2ecf20Sopenharmony_ci		};
1598c2ecf20Sopenharmony_ci	};
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci	emmc {
1628c2ecf20Sopenharmony_ci		emmc_bus8: emmc-bus8 {
1638c2ecf20Sopenharmony_ci			rockchip,pins = <1 RK_PC2 2 &pcfg_pull_up_drv_8ma>,
1648c2ecf20Sopenharmony_ci					<1 RK_PC3 2 &pcfg_pull_up_drv_8ma>,
1658c2ecf20Sopenharmony_ci					<1 RK_PC4 2 &pcfg_pull_up_drv_8ma>,
1668c2ecf20Sopenharmony_ci					<1 RK_PC5 2 &pcfg_pull_up_drv_8ma>,
1678c2ecf20Sopenharmony_ci					<1 RK_PC6 2 &pcfg_pull_up_drv_8ma>,
1688c2ecf20Sopenharmony_ci					<1 RK_PC7 2 &pcfg_pull_up_drv_8ma>,
1698c2ecf20Sopenharmony_ci					<1 RK_PD0 2 &pcfg_pull_up_drv_8ma>,
1708c2ecf20Sopenharmony_ci					<1 RK_PD1 2 &pcfg_pull_up_drv_8ma>;
1718c2ecf20Sopenharmony_ci		};
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci		emmc-clk {
1748c2ecf20Sopenharmony_ci			rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none_drv_8ma>;
1758c2ecf20Sopenharmony_ci		};
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci		emmc-cmd {
1788c2ecf20Sopenharmony_ci			rockchip,pins = <1 RK_PD2 2 &pcfg_pull_up_drv_8ma>;
1798c2ecf20Sopenharmony_ci		};
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci		emmc_reset: emmc-reset {
1828c2ecf20Sopenharmony_ci			rockchip,pins = <2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
1838c2ecf20Sopenharmony_ci		};
1848c2ecf20Sopenharmony_ci	};
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci	keys {
1878c2ecf20Sopenharmony_ci		pwr_key: pwr-key {
1888c2ecf20Sopenharmony_ci			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
1898c2ecf20Sopenharmony_ci		};
1908c2ecf20Sopenharmony_ci	};
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci	pmic {
1938c2ecf20Sopenharmony_ci		pmic_int: pmic-int {
1948c2ecf20Sopenharmony_ci			rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
1958c2ecf20Sopenharmony_ci		};
1968c2ecf20Sopenharmony_ci	};
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci	sdio {
1998c2ecf20Sopenharmony_ci		wifi_reg_on: wifi-reg-on {
2008c2ecf20Sopenharmony_ci			rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
2018c2ecf20Sopenharmony_ci		};
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci		bt_rst: bt-rst {
2048c2ecf20Sopenharmony_ci			rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
2058c2ecf20Sopenharmony_ci		};
2068c2ecf20Sopenharmony_ci	};
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci	usb {
2098c2ecf20Sopenharmony_ci		host_vbus_drv: host-vbus-drv {
2108c2ecf20Sopenharmony_ci			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
2118c2ecf20Sopenharmony_ci		};
2128c2ecf20Sopenharmony_ci	};
2138c2ecf20Sopenharmony_ci};
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci&pwm0 {
2168c2ecf20Sopenharmony_ci	status = "okay";
2178c2ecf20Sopenharmony_ci};
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci&tsadc {
2208c2ecf20Sopenharmony_ci	rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
2218c2ecf20Sopenharmony_ci	rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
2228c2ecf20Sopenharmony_ci	status = "okay";
2238c2ecf20Sopenharmony_ci};
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci&uart2 {
2268c2ecf20Sopenharmony_ci	status = "okay";
2278c2ecf20Sopenharmony_ci};
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci&usb_host0_ehci {
2308c2ecf20Sopenharmony_ci	status = "okay";
2318c2ecf20Sopenharmony_ci};
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci&usb_otg {
2348c2ecf20Sopenharmony_ci	dr_mode = "host";
2358c2ecf20Sopenharmony_ci	status = "okay";
2368c2ecf20Sopenharmony_ci};
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci&wdt {
2398c2ecf20Sopenharmony_ci	status = "okay";
2408c2ecf20Sopenharmony_ci};
241