18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2015 Heiko Stuebner <heiko@sntech.de>
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci/dts-v1/;
78c2ecf20Sopenharmony_ci#include "rk3368.dtsi"
88c2ecf20Sopenharmony_ci#include <dt-bindings/input/input.h>
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/ {
118c2ecf20Sopenharmony_ci	model = "Rockchip R88";
128c2ecf20Sopenharmony_ci	compatible = "rockchip,r88", "rockchip,rk3368";
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci	chosen {
158c2ecf20Sopenharmony_ci		stdout-path = "serial2:115200n8";
168c2ecf20Sopenharmony_ci	};
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci	memory {
198c2ecf20Sopenharmony_ci		device_type = "memory";
208c2ecf20Sopenharmony_ci		reg = <0x0 0x0 0x0 0x40000000>;
218c2ecf20Sopenharmony_ci	};
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci	emmc_pwrseq: emmc-pwrseq {
248c2ecf20Sopenharmony_ci		compatible = "mmc-pwrseq-emmc";
258c2ecf20Sopenharmony_ci		pinctrl-0 = <&emmc_reset>;
268c2ecf20Sopenharmony_ci		pinctrl-names = "default";
278c2ecf20Sopenharmony_ci		reset-gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
288c2ecf20Sopenharmony_ci	};
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci	keys: gpio-keys {
318c2ecf20Sopenharmony_ci		compatible = "gpio-keys";
328c2ecf20Sopenharmony_ci		pinctrl-names = "default";
338c2ecf20Sopenharmony_ci		pinctrl-0 = <&pwr_key>;
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci		power {
368c2ecf20Sopenharmony_ci			wakeup-source;
378c2ecf20Sopenharmony_ci			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
388c2ecf20Sopenharmony_ci			label = "GPIO Power";
398c2ecf20Sopenharmony_ci			linux,code = <KEY_POWER>;
408c2ecf20Sopenharmony_ci		};
418c2ecf20Sopenharmony_ci	};
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci	leds: gpio-leds {
448c2ecf20Sopenharmony_ci		compatible = "gpio-leds";
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci		work_led: led-0 {
478c2ecf20Sopenharmony_ci			gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
488c2ecf20Sopenharmony_ci			label = "r88:green:led";
498c2ecf20Sopenharmony_ci			pinctrl-names = "default";
508c2ecf20Sopenharmony_ci			pinctrl-0 = <&led_ctl>;
518c2ecf20Sopenharmony_ci		};
528c2ecf20Sopenharmony_ci	};
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci	ir: ir-receiver {
558c2ecf20Sopenharmony_ci		compatible = "gpio-ir-receiver";
568c2ecf20Sopenharmony_ci		gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_LOW>;
578c2ecf20Sopenharmony_ci		pinctrl-names = "default";
588c2ecf20Sopenharmony_ci		pinctrl-0 = <&ir_int>;
598c2ecf20Sopenharmony_ci	};
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci	sdio_pwrseq: sdio-pwrseq {
628c2ecf20Sopenharmony_ci		compatible = "mmc-pwrseq-simple";
638c2ecf20Sopenharmony_ci		clocks = <&hym8563>;
648c2ecf20Sopenharmony_ci		clock-names = "ext_clock";
658c2ecf20Sopenharmony_ci		pinctrl-names = "default";
668c2ecf20Sopenharmony_ci		pinctrl-0 = <&bt_rst>, <&wifi_reg_on>;
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci		reset-gpios =
698c2ecf20Sopenharmony_ci			/* BT_RST_N */
708c2ecf20Sopenharmony_ci			<&gpio3 RK_PA5 GPIO_ACTIVE_LOW>,
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci			/* WL_REG_ON */
738c2ecf20Sopenharmony_ci			<&gpio3 RK_PA4 GPIO_ACTIVE_LOW>;
748c2ecf20Sopenharmony_ci	};
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	vcc_18: vcc18-regulator {
778c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
788c2ecf20Sopenharmony_ci		regulator-name = "vcc_18";
798c2ecf20Sopenharmony_ci		regulator-min-microvolt = <1800000>;
808c2ecf20Sopenharmony_ci		regulator-max-microvolt = <1800000>;
818c2ecf20Sopenharmony_ci		regulator-always-on;
828c2ecf20Sopenharmony_ci		regulator-boot-on;
838c2ecf20Sopenharmony_ci		vin-supply = <&vcc_sys>;
848c2ecf20Sopenharmony_ci	};
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci	/* supplies both host and otg */
878c2ecf20Sopenharmony_ci	vcc_host: vcc-host-regulator {
888c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
898c2ecf20Sopenharmony_ci		enable-active-high;
908c2ecf20Sopenharmony_ci		gpio = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
918c2ecf20Sopenharmony_ci		pinctrl-names = "default";
928c2ecf20Sopenharmony_ci		pinctrl-0 = <&host_vbus_drv>;
938c2ecf20Sopenharmony_ci		regulator-name = "vcc_host";
948c2ecf20Sopenharmony_ci		regulator-always-on;
958c2ecf20Sopenharmony_ci		regulator-boot-on;
968c2ecf20Sopenharmony_ci		vin-supply = <&vcc_sys>;
978c2ecf20Sopenharmony_ci	};
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci	vcc_io: vcc-io-regulator {
1008c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
1018c2ecf20Sopenharmony_ci		regulator-name = "vcc_io";
1028c2ecf20Sopenharmony_ci		regulator-min-microvolt = <3300000>;
1038c2ecf20Sopenharmony_ci		regulator-max-microvolt = <3300000>;
1048c2ecf20Sopenharmony_ci		regulator-always-on;
1058c2ecf20Sopenharmony_ci		regulator-boot-on;
1068c2ecf20Sopenharmony_ci		vin-supply = <&vcc_sys>;
1078c2ecf20Sopenharmony_ci	};
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci	vcc_lan: vcc-lan-regulator {
1108c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
1118c2ecf20Sopenharmony_ci		regulator-name = "vcc_lan";
1128c2ecf20Sopenharmony_ci		regulator-min-microvolt = <3300000>;
1138c2ecf20Sopenharmony_ci		regulator-max-microvolt = <3300000>;
1148c2ecf20Sopenharmony_ci		regulator-always-on;
1158c2ecf20Sopenharmony_ci		regulator-boot-on;
1168c2ecf20Sopenharmony_ci		vin-supply = <&vcc_io>;
1178c2ecf20Sopenharmony_ci	};
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci	vcc_sys: vcc-sys-regulator {
1208c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
1218c2ecf20Sopenharmony_ci		regulator-name = "vcc_sys";
1228c2ecf20Sopenharmony_ci		regulator-min-microvolt = <5000000>;
1238c2ecf20Sopenharmony_ci		regulator-max-microvolt = <5000000>;
1248c2ecf20Sopenharmony_ci		regulator-always-on;
1258c2ecf20Sopenharmony_ci		regulator-boot-on;
1268c2ecf20Sopenharmony_ci	};
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci	vccio_wl: vccio-wl-regulator {
1298c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
1308c2ecf20Sopenharmony_ci		regulator-name = "vccio_wl";
1318c2ecf20Sopenharmony_ci		regulator-min-microvolt = <3300000>;
1328c2ecf20Sopenharmony_ci		regulator-max-microvolt = <3300000>;
1338c2ecf20Sopenharmony_ci		regulator-always-on;
1348c2ecf20Sopenharmony_ci		regulator-boot-on;
1358c2ecf20Sopenharmony_ci		vin-supply = <&vcc_io>;
1368c2ecf20Sopenharmony_ci	};
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci	vdd_10: vdd-10-regulator {
1398c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
1408c2ecf20Sopenharmony_ci		regulator-name = "vdd_10";
1418c2ecf20Sopenharmony_ci		regulator-min-microvolt = <1000000>;
1428c2ecf20Sopenharmony_ci		regulator-max-microvolt = <1000000>;
1438c2ecf20Sopenharmony_ci		regulator-always-on;
1448c2ecf20Sopenharmony_ci		regulator-boot-on;
1458c2ecf20Sopenharmony_ci		vin-supply = <&vcc_sys>;
1468c2ecf20Sopenharmony_ci	};
1478c2ecf20Sopenharmony_ci};
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci&emmc {
1508c2ecf20Sopenharmony_ci	bus-width = <8>;
1518c2ecf20Sopenharmony_ci	cap-mmc-highspeed;
1528c2ecf20Sopenharmony_ci	mmc-pwrseq = <&emmc_pwrseq>;
1538c2ecf20Sopenharmony_ci	non-removable;
1548c2ecf20Sopenharmony_ci	pinctrl-names = "default";
1558c2ecf20Sopenharmony_ci	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
1568c2ecf20Sopenharmony_ci	status = "okay";
1578c2ecf20Sopenharmony_ci};
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci&gmac {
1608c2ecf20Sopenharmony_ci	phy-supply = <&vcc_lan>;
1618c2ecf20Sopenharmony_ci	phy-mode = "rmii";
1628c2ecf20Sopenharmony_ci	clock_in_out = "output";
1638c2ecf20Sopenharmony_ci	snps,reset-gpio = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>;
1648c2ecf20Sopenharmony_ci	snps,reset-active-low;
1658c2ecf20Sopenharmony_ci	snps,reset-delays-us = <0 10000 1000000>;
1668c2ecf20Sopenharmony_ci	pinctrl-names = "default";
1678c2ecf20Sopenharmony_ci	pinctrl-0 = <&rmii_pins>;
1688c2ecf20Sopenharmony_ci	tx_delay = <0x30>;
1698c2ecf20Sopenharmony_ci	rx_delay = <0x10>;
1708c2ecf20Sopenharmony_ci	status = "okay";
1718c2ecf20Sopenharmony_ci};
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci&i2c0 {
1748c2ecf20Sopenharmony_ci	status = "okay";
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci	vdd_cpu: syr827@40 {
1778c2ecf20Sopenharmony_ci		compatible = "silergy,syr827";
1788c2ecf20Sopenharmony_ci		reg = <0x40>;
1798c2ecf20Sopenharmony_ci		fcs,suspend-voltage-selector = <1>;
1808c2ecf20Sopenharmony_ci		regulator-name = "vdd_cpu";
1818c2ecf20Sopenharmony_ci		regulator-enable-ramp-delay = <300>;
1828c2ecf20Sopenharmony_ci		regulator-min-microvolt = <712500>;
1838c2ecf20Sopenharmony_ci		regulator-max-microvolt = <1500000>;
1848c2ecf20Sopenharmony_ci		regulator-ramp-delay = <8000>;
1858c2ecf20Sopenharmony_ci		regulator-always-on;
1868c2ecf20Sopenharmony_ci		regulator-boot-on;
1878c2ecf20Sopenharmony_ci		vin-supply = <&vcc_sys>;
1888c2ecf20Sopenharmony_ci	};
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci	hym8563: hym8563@51 {
1918c2ecf20Sopenharmony_ci		compatible = "haoyu,hym8563";
1928c2ecf20Sopenharmony_ci		reg = <0x51>;
1938c2ecf20Sopenharmony_ci		#clock-cells = <0>;
1948c2ecf20Sopenharmony_ci		clock-frequency = <32768>;
1958c2ecf20Sopenharmony_ci		clock-output-names = "xin32k";
1968c2ecf20Sopenharmony_ci		/* rtc_int is not connected */
1978c2ecf20Sopenharmony_ci	};
1988c2ecf20Sopenharmony_ci};
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci&io_domains {
2018c2ecf20Sopenharmony_ci	status = "okay";
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci	audio-supply = <&vcc_io>;
2048c2ecf20Sopenharmony_ci	gpio30-supply = <&vcc_io>;
2058c2ecf20Sopenharmony_ci	gpio1830-supply = <&vcc_io>;
2068c2ecf20Sopenharmony_ci	wifi-supply = <&vccio_wl>;
2078c2ecf20Sopenharmony_ci};
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci&sdio0 {
2108c2ecf20Sopenharmony_ci	assigned-clocks = <&cru SCLK_SDIO0>;
2118c2ecf20Sopenharmony_ci	assigned-clock-parents = <&cru PLL_CPLL>;
2128c2ecf20Sopenharmony_ci	bus-width = <4>;
2138c2ecf20Sopenharmony_ci	cap-sd-highspeed;
2148c2ecf20Sopenharmony_ci	cap-sdio-irq;
2158c2ecf20Sopenharmony_ci	keep-power-in-suspend;
2168c2ecf20Sopenharmony_ci	mmc-pwrseq = <&sdio_pwrseq>;
2178c2ecf20Sopenharmony_ci	non-removable;
2188c2ecf20Sopenharmony_ci	pinctrl-names = "default";
2198c2ecf20Sopenharmony_ci	pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_bus4>;
2208c2ecf20Sopenharmony_ci	vmmc-supply = <&vcc_io>;
2218c2ecf20Sopenharmony_ci	vqmmc-supply = <&vccio_wl>;
2228c2ecf20Sopenharmony_ci	status = "okay";
2238c2ecf20Sopenharmony_ci};
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci&pinctrl {
2268c2ecf20Sopenharmony_ci	pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
2278c2ecf20Sopenharmony_ci		bias-disable;
2288c2ecf20Sopenharmony_ci		drive-strength = <8>;
2298c2ecf20Sopenharmony_ci	};
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci	pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
2328c2ecf20Sopenharmony_ci		bias-pull-up;
2338c2ecf20Sopenharmony_ci		drive-strength = <8>;
2348c2ecf20Sopenharmony_ci	};
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci	emmc {
2378c2ecf20Sopenharmony_ci		emmc_bus8: emmc-bus8 {
2388c2ecf20Sopenharmony_ci			rockchip,pins = <1 RK_PC2 2 &pcfg_pull_up_drv_8ma>,
2398c2ecf20Sopenharmony_ci					<1 RK_PC3 2 &pcfg_pull_up_drv_8ma>,
2408c2ecf20Sopenharmony_ci					<1 RK_PC4 2 &pcfg_pull_up_drv_8ma>,
2418c2ecf20Sopenharmony_ci					<1 RK_PC5 2 &pcfg_pull_up_drv_8ma>,
2428c2ecf20Sopenharmony_ci					<1 RK_PC6 2 &pcfg_pull_up_drv_8ma>,
2438c2ecf20Sopenharmony_ci					<1 RK_PC7 2 &pcfg_pull_up_drv_8ma>,
2448c2ecf20Sopenharmony_ci					<1 RK_PD0 2 &pcfg_pull_up_drv_8ma>,
2458c2ecf20Sopenharmony_ci					<1 RK_PD1 2 &pcfg_pull_up_drv_8ma>;
2468c2ecf20Sopenharmony_ci		};
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci		emmc-clk {
2498c2ecf20Sopenharmony_ci			rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none_drv_8ma>;
2508c2ecf20Sopenharmony_ci		};
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci		emmc-cmd {
2538c2ecf20Sopenharmony_ci			rockchip,pins = <1 RK_PD2 2 &pcfg_pull_up_drv_8ma>;
2548c2ecf20Sopenharmony_ci		};
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci		emmc_reset: emmc-reset {
2578c2ecf20Sopenharmony_ci			rockchip,pins = <2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
2588c2ecf20Sopenharmony_ci		};
2598c2ecf20Sopenharmony_ci	};
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci	ir {
2628c2ecf20Sopenharmony_ci		ir_int: ir-int {
2638c2ecf20Sopenharmony_ci			rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
2648c2ecf20Sopenharmony_ci		};
2658c2ecf20Sopenharmony_ci	};
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci	keys {
2688c2ecf20Sopenharmony_ci		pwr_key: pwr-key {
2698c2ecf20Sopenharmony_ci			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
2708c2ecf20Sopenharmony_ci		};
2718c2ecf20Sopenharmony_ci	};
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci	leds {
2748c2ecf20Sopenharmony_ci		stby_pwren: stby-pwren {
2758c2ecf20Sopenharmony_ci			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
2768c2ecf20Sopenharmony_ci		};
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci		led_ctl: led-ctl {
2798c2ecf20Sopenharmony_ci			rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
2808c2ecf20Sopenharmony_ci		};
2818c2ecf20Sopenharmony_ci	};
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci	sdio {
2848c2ecf20Sopenharmony_ci		wifi_reg_on: wifi-reg-on {
2858c2ecf20Sopenharmony_ci			rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
2868c2ecf20Sopenharmony_ci		};
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci		bt_rst: bt-rst {
2898c2ecf20Sopenharmony_ci			rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
2908c2ecf20Sopenharmony_ci		};
2918c2ecf20Sopenharmony_ci	};
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci	usb {
2948c2ecf20Sopenharmony_ci		host_vbus_drv: host-vbus-drv {
2958c2ecf20Sopenharmony_ci			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
2968c2ecf20Sopenharmony_ci		};
2978c2ecf20Sopenharmony_ci	};
2988c2ecf20Sopenharmony_ci};
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ci&pmu_io_domains {
3018c2ecf20Sopenharmony_ci	status = "okay";
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci	pmu-supply = <&vcc_io>;
3048c2ecf20Sopenharmony_ci	vop-supply = <&vcc_io>;
3058c2ecf20Sopenharmony_ci};
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ci&saradc {
3088c2ecf20Sopenharmony_ci	vref-supply = <&vcc_18>;
3098c2ecf20Sopenharmony_ci	status = "okay";
3108c2ecf20Sopenharmony_ci};
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci&tsadc {
3138c2ecf20Sopenharmony_ci	rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
3148c2ecf20Sopenharmony_ci	rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
3158c2ecf20Sopenharmony_ci	status = "okay";
3168c2ecf20Sopenharmony_ci};
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci&uart2 {
3198c2ecf20Sopenharmony_ci	status = "okay";
3208c2ecf20Sopenharmony_ci};
3218c2ecf20Sopenharmony_ci
3228c2ecf20Sopenharmony_ci&usb_host0_ehci {
3238c2ecf20Sopenharmony_ci	status = "okay";
3248c2ecf20Sopenharmony_ci};
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci&usb_otg {
3278c2ecf20Sopenharmony_ci	dr_mode = "host";
3288c2ecf20Sopenharmony_ci	status = "okay";
3298c2ecf20Sopenharmony_ci};
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_ci&wdt {
3328c2ecf20Sopenharmony_ci	status = "okay";
3338c2ecf20Sopenharmony_ci};
334