code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2014 Romain Perier <romain.perier@gmail.com>
 */

/dts-v1/;
#include "rk3066a.dtsi"

/ {
	model = "MarsBoard RK3066";
	compatible = "haoyu,marsboard-rk3066", "rockchip,rk3066a";

	aliases {
		mmc0 = &mmc0;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x40000000>;
	};

	vdd_log: vdd-log {
		compatible = "pwm-regulator";
		pwms = <&pwm3 0 1000>;
		regulator-name = "vdd_log";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		regulator-always-on;
		voltage-table = <1000000 100>,
				<1200000 42>;
		status = "okay";
	};

	vcc_sd0: sdmmc-regulator {
		compatible = "regulator-fixed";
		regulator-name = "sdmmc-supply";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
		gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};

	vsys: vsys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vsys";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-boot-on;
	};
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&cpu1 {
	cpu-supply = <&vdd_arm>;
};

&i2c1 {
	status = "okay";
	clock-frequency = <400000>;

	tps: tps@2d {
		reg = <0x2d>;

		interrupt-parent = <&gpio6>;
		interrupts = <RK_PA4 IRQ_TYPE_LEVEL_LOW>;

		vcc1-supply = <&vsys>;
		vcc2-supply = <&vsys>;
		vcc3-supply = <&vsys>;
		vcc4-supply = <&vsys>;
		vcc5-supply = <&vcc_io>;
		vcc6-supply = <&vcc_io>;
		vcc7-supply = <&vsys>;
		vccio-supply = <&vsys>;

		regulators {
			vcc_rtc: regulator@0 {
				regulator-name = "vcc_rtc";
				regulator-always-on;
			};

			vcc_io: regulator@1 {
				regulator-name = "vcc_io";
				regulator-always-on;
			};

			vdd_arm: regulator@2 {
				regulator-name = "vdd_arm";
				regulator-min-microvolt = <600000>;
				regulator-max-microvolt = <1500000>;
				regulator-boot-on;
				regulator-always-on;
			};

			vcc_ddr: regulator@3 {
				regulator-name = "vcc_ddr";
				regulator-min-microvolt = <600000>;
				regulator-max-microvolt = <1500000>;
				regulator-boot-on;
				regulator-always-on;
			};

			vcc18_cif: regulator@5 {
				regulator-name = "vcc18_cif";
				regulator-always-on;
			};

			vdd_11: regulator@6 {
				regulator-name = "vdd_11";
				regulator-always-on;
			};

			vcc_25: regulator@7 {
				regulator-name = "vcc_25";
				regulator-always-on;
			};

			vcc_18: regulator@8 {
				regulator-name = "vcc_18";
				regulator-always-on;
			};

			vcc25_hdmi: regulator@9 {
				regulator-name = "vcc25_hdmi";
				regulator-always-on;
			};

			vcca_33: regulator@10 {
				regulator-name = "vcca_33";
				regulator-always-on;
			};

			vcc_rmii: regulator@11 {
				regulator-name = "vcc_rmii";
			};

			vcc28_cif: regulator@12 {
				regulator-name = "vcc28_cif";
				regulator-always-on;
			};
		};
	};
};

/* must be included after &tps gets defined */
#include "tps65910.dtsi"

&emac {
	phy = <&phy0>;
	phy-supply = <&vcc_rmii>;
	pinctrl-names = "default";
	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&phy_int>;
	status = "okay";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;

		phy0: ethernet-phy@0 {
			reg = <0>;
			interrupt-parent = <&gpio1>;
			interrupts = <RK_PD2 IRQ_TYPE_LEVEL_LOW>;
		};
	};
};

&mmc0 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
	vmmc-supply = <&vcc_sd0>;
};

&pinctrl {
	lan8720a {
		phy_int: phy-int {
			rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pwm3 {
	status = "okay";
};

&uart0 {
	status = "okay";
};

&uart1 {
	status = "okay";
};

&uart2 {
	status = "okay";
};

&uart3 {
	status = "okay";
};

&usbphy {
	status = "okay";
};

&usb_host {
	status = "okay";
};

&usb_otg {
	status = "okay";
};

&wdt {
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2016 Paweł Jarosz <paweljarosz3691@gmail.com>
 */

/dts-v1/;
#include <dt-bindings/input/input.h>
#include "rk3066a.dtsi"

/ {
	model = "Rikomagic MK808";
	compatible = "rikomagic,mk808", "rockchip,rk3066a";

	aliases {
		mmc0 = &mmc0;
		mmc1 = &mmc1;
	};

	chosen {
		stdout-path = "serial2:115200n8";
	};

	memory@60000000 {
		reg = <0x60000000 0x40000000>;
		device_type = "memory";
	};

	adc-keys {
		compatible = "adc-keys";
		io-channels = <&saradc 1>;
		io-channel-names = "buttons";
		keyup-threshold-microvolt = <2500000>;
		poll-interval = <100>;

		button-recovery {
			label = "recovery";
			linux,code = <KEY_VENDOR>;
			press-threshold-microvolt = <0>;
		};
	};

	gpio-leds {
		compatible = "gpio-leds";

		blue_led: led-0 {
			label = "mk808:blue:power";
			gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
			default-state = "off";
			linux,default-trigger = "default-on";
		};
	};

	hdmi_con {
		compatible = "hdmi-connector";
		type = "c";

		port {
			hdmi_con_in: endpoint {
				remote-endpoint = <&hdmi_out_con>;
			};
		};
	};

	vcc_2v5: vcc-2v5 {
		compatible = "regulator-fixed";
		regulator-name = "vcc_2v5";
		regulator-min-microvolt = <2500000>;
		regulator-max-microvolt = <2500000>;
	};

	vcc_io: vcc-io {
		compatible = "regulator-fixed";
		regulator-name = "vcc_io";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	vcc_host: usb-host-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
		pinctrl-0 = <&host_drv>;
		pinctrl-names = "default";
		regulator-always-on;
		regulator-name = "host-pwr";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};

	vcc_otg: usb-otg-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		pinctrl-0 = <&otg_drv>;
		pinctrl-names = "default";
		regulator-always-on;
		regulator-name = "vcc_otg";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};

	vcc_sd: sdmmc-regulator {
		compatible = "regulator-fixed";
		gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>;
		pinctrl-0 = <&sdmmc_pwr>;
		pinctrl-names = "default";
		regulator-name = "vcc_sd";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};

	vcc_wifi: sdio-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio3 RK_PD0 GPIO_ACTIVE_HIGH>;
		pinctrl-0 = <&wifi_pwr>;
		pinctrl-names = "default";
		regulator-name = "vcc_wifi";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};
};

&hdmi {
	status = "okay";
};

&hdmi_in_vop1 {
	status = "disabled";
};

&hdmi_out {
	hdmi_out_con: endpoint {
		remote-endpoint = <&hdmi_con_in>;
	};
};

&mmc0 {
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	vmmc-supply = <&vcc_sd>;
	status = "okay";
};

&mmc1 {
	bus-width = <4>;
	non-removable;
	pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_bus4>;
	pinctrl-names = "default";
	vmmc-supply = <&vcc_wifi>;
	status = "okay";
};

&nfc {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	nand@0 {
		reg = <0>;
		label = "rk-nand";
		nand-bus-width = <8>;
		nand-ecc-mode = "hw";
		nand-ecc-step-size = <1024>;
		nand-ecc-strength = <40>;
		nand-is-boot-medium;
		rockchip,boot-blks = <8>;
		rockchip,boot-ecc-strength = <24>;
	};
};

&pinctrl {
	usb-host {
		host_drv: host-drv {
			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	usb-otg {
		otg_drv: otg-drv {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	sdmmc {
		sdmmc_pwr: sdmmc-pwr {
			rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	sdio {
		wifi_pwr: wifi-pwr {
			rockchip,pins = <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&saradc {
	vref-supply = <&vcc_2v5>;
	status = "okay";
};

&uart2 {
	status = "okay";
};

&usb_host {
	status = "okay";
};

&usb_otg {
	status = "okay";
};

&usbphy {
	status = "okay";
};

&vop0 {
	status = "okay";
};

&wdt {
	status = "okay";
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2014, 2015 FUKAUMI Naoki <naobsd@gmail.com>
 */

/dts-v1/;
#include <dt-bindings/input/input.h>
#include "rk3066a.dtsi"

/ {
	model = "Rayeager PX2";
	compatible = "chipspark,rayeager-px2", "rockchip,rk3066a";

	aliases {
		mmc0 = &mmc0;
		mmc1 = &mmc1;
		mmc2 = &emmc;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x40000000>;
	};

	ir: ir-receiver {
		compatible = "gpio-ir-receiver";
		gpios = <&gpio6 RK_PA1 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&ir_int>;
	};

	keys: gpio-keys {
		compatible = "gpio-keys";

		key-power {
			wakeup-source;
			gpios = <&gpio6 RK_PA2 GPIO_ACTIVE_LOW>;
			label = "GPIO Power";
			linux,code = <KEY_POWER>;
			pinctrl-names = "default";
			pinctrl-0 = <&pwr_key>;
		};
	};

	vdd_log: vdd-log {
		compatible = "pwm-regulator";
		pwms = <&pwm3 0 1000>;
		regulator-name = "vdd_log";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		regulator-always-on;
		voltage-table = <1000000 100>,
				<1200000 42>;
		status = "okay";
	};

	vsys: vsys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vsys";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		regulator-boot-on;
	};

	/* input for 5V_STDBY is VSYS or DC5V, selectable by jumper J4 */
	vcc_stdby: stdby-regulator {
		compatible = "regulator-fixed";
		regulator-name = "5v_stdby";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc_emmc: emmc-regulator {
		compatible = "regulator-fixed";
		regulator-name = "emmc_vccq";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
		vin-supply = <&vsys>;
	};

	vcc_sata: sata-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&sata_pwr>;
		regulator-name = "usb_5v";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		vin-supply = <&vcc_stdby>;
	};

	vcc_sd: sdmmc-regulator {
		compatible = "regulator-fixed";
		gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwr>;
		regulator-name = "vcc_sd";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};

	vcc_host: usb-host-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&host_drv>;
		regulator-name = "host-pwr";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		vin-supply = <&vcc_stdby>;
	};

	vcc_otg: usb-otg-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&otg_drv>;
		regulator-name = "vcc_otg";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		vin-supply = <&vcc_stdby>;
	};
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&cpu1 {
	cpu-supply = <&vdd_arm>;
};

&emac {
	phy = <&phy0>;
	phy-supply = <&vcc_rmii>;
	pinctrl-names = "default";
	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&rmii_rst>;
	status = "okay";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;

		phy0: ethernet-phy@0 {
			reg = <0>;
			reset-gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>;
		};
	};
};

&emmc {
	bus-width = <8>;
	cap-mmc-highspeed;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_rst>;
	vmmc-supply = <&vcc_emmc>;
	vqmmc-supply = <&vcc_emmc>;
	status = "okay";
};

&i2c0 {
	clock-frequency = <400000>;
	status = "okay";

	ak8963: ak8963@d {
		compatible = "asahi-kasei,ak8975";
		reg = <0x0d>;
		interrupt-parent = <&gpio4>;
		interrupts = <RK_PC1 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&comp_int>;
	};

	mma8452: mma8452@1d {
		compatible = "fsl,mma8452";
		reg = <0x1d>;
		interrupt-parent = <&gpio4>;
		interrupts = <RK_PC0 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&gsensor_int>;
	};
};

&i2c1 {
	clock-frequency = <400000>;
	status = "okay";

	tps: tps@2d {
		reg = <0x2d>;
		interrupt-parent = <&gpio6>;
		interrupts = <RK_PA4 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&pmic_int>, <&pwr_hold>;

		vcc1-supply = <&vsys>;
		vcc2-supply = <&vsys>;
		vcc3-supply = <&vsys>;
		vcc4-supply = <&vsys>;
		vcc5-supply = <&vcc_io>;
		vcc6-supply = <&vcc_io>;
		vcc7-supply = <&vsys>;
		vccio-supply = <&vsys>;

		regulators {
			vcc_rtc: regulator@0 {
				regulator-name = "vcc_rtc";
				regulator-always-on;
			};

			vcc_io: regulator@1 {
				regulator-name = "vcc_io";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vdd_arm: regulator@2 {
				regulator-name = "vdd_arm";
				regulator-min-microvolt = <600000>;
				regulator-max-microvolt = <1500000>;
				regulator-always-on;
				regulator-boot-on;
			};

			vcc_ddr: regulator@3 {
				regulator-name = "vcc_ddr";
				regulator-min-microvolt = <600000>;
				regulator-max-microvolt = <1500000>;
				regulator-always-on;
				regulator-boot-on;
			};

			vcc18: regulator@5 {
				regulator-name = "vcc18";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
			};

			vdd_11: regulator@6 {
				regulator-name = "vdd_11";
				regulator-min-microvolt = <1100000>;
				regulator-max-microvolt = <1100000>;
				regulator-always-on;
			};

			vcc_25: regulator@7 {
				regulator-name = "vcc_25";
				regulator-min-microvolt = <2500000>;
				regulator-max-microvolt = <2500000>;
				regulator-always-on;
			};

			vccio_wl: regulator@8 {
				regulator-name = "vccio_wl";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			vcc25_hdmi: regulator@9 {
				regulator-name = "vcc25_hdmi";
				regulator-min-microvolt = <2500000>;
				regulator-max-microvolt = <2500000>;
			};

			vcca_33: regulator@10 {
				regulator-name = "vcca_33";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

			vcc_rmii: regulator@11 {
				regulator-name = "vcc_rmii";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

			vcc28_cif: regulator@12 {
				regulator-name = "vcc28_cif";
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2800000>;
			};
		};
	};
};

#include "tps65910.dtsi"

&i2c2 {
	status = "okay";
};

&i2c3 {
	status = "okay";
};

&i2c4 {
	status = "okay";
};

&mmc0 {
	bus-width = <4>;
	disable-wp;
	pinctrl-names = "default";
	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
	vmmc-supply = <&vcc_sd>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	status = "okay";
};

&mmc1 {
	bus-width = <4>;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&sd1_clk>, <&sd1_cmd>, <&sd1_bus4>;
	vmmc-supply = <&vccio_wl>;
	status = "okay";
};

&pinctrl {
	pcfg_output_high: pcfg-output-high {
		output-high;
	};

	ak8963 {
		comp_int: comp-int {
			rockchip,pins = <4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	emac {
		rmii_rst: rmii-rst {
			rockchip,pins = <1 RK_PD6 RK_FUNC_GPIO &pcfg_output_high>;
		};
	};

	ir {
		ir_int: ir-int {
			rockchip,pins = <6 RK_PA1 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	keys {
		pwr_key: pwr-key {
			rockchip,pins = <6 RK_PA2 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	mma8452 {
		gsensor_int: gsensor-int {
			rockchip,pins = <4 RK_PC0 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	mmc {
		sdmmc_pwr: sdmmc-pwr {
			rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	usb_host {
		host_drv: host-drv {
			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_default>;
		};

		hub_rst: hub-rst {
			rockchip,pins = <1 RK_PD7 RK_FUNC_GPIO &pcfg_output_high>;
		};

		sata_pwr: sata-pwr {
			rockchip,pins = <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_default>;
		};

		sata_reset: sata-reset {
			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_output_high>;
		};
	};

	usb_otg {
		otg_drv: otg-drv {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_default>;
		};
	};

	tps {
		pmic_int: pmic-int {
			rockchip,pins = <6 RK_PA4 RK_FUNC_GPIO &pcfg_pull_default>;
		};

		pwr_hold: pwr-hold {
			rockchip,pins = <6 RK_PB0 RK_FUNC_GPIO &pcfg_output_high>;
		};
	};
};

&pwm1 {
	status = "okay";
};

&pwm2 {
	status = "okay";
};

&pwm3 {
	status = "okay";
};

&saradc {
	vref-supply = <&vcc_25>;
	status = "okay";
};

&spi0 {
	status = "okay";
};

&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
	status = "okay";
};

&uart2 {
	status = "okay";
};

&uart3 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart3_xfer>, <&uart3_cts>, <&uart3_rts>;
	status = "okay";
};

&usb_host {
	pinctrl-names = "default";
	pinctrl-0 = <&hub_rst>, <&sata_reset>;
	status = "okay";
};

&usbphy {
	status = "okay";
};

&usb_otg {
	status = "okay";
};

&wdt {
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2013 MundoReader S.L.
 * Author: Heiko Stuebner <heiko@sntech.de>
 */

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/clock/rk3066a-cru.h>
#include <dt-bindings/power/rk3066-power.h>
#include "rk3xxx.dtsi"

/ {
	compatible = "rockchip,rk3066a";

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		enable-method = "rockchip,rk3066-smp";

		cpu0: cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			next-level-cache = <&L2>;
			reg = <0x0>;
			operating-points =
				/* kHz    uV */
				<1416000 1300000>,
				<1200000 1175000>,
				<1008000 1125000>,
				<816000  1125000>,
				<600000  1100000>,
				<504000  1100000>,
				<312000  1075000>;
			clock-latency = <40000>;
			clocks = <&cru ARMCLK>;
		};
		cpu1: cpu@1 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			next-level-cache = <&L2>;
			reg = <0x1>;
		};
	};

	display-subsystem {
		compatible = "rockchip,display-subsystem";
		ports = <&vop0_out>, <&vop1_out>;
	};

	sram: sram@10080000 {
		compatible = "mmio-sram";
		reg = <0x10080000 0x10000>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges = <0 0x10080000 0x10000>;

		smp-sram@0 {
			compatible = "rockchip,rk3066-smp-sram";
			reg = <0x0 0x50>;
		};
	};

	vop0: vop@1010c000 {
		compatible = "rockchip,rk3066-vop";
		reg = <0x1010c000 0x19c>;
		interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru ACLK_LCDC0>,
			 <&cru DCLK_LCDC0>,
			 <&cru HCLK_LCDC0>;
		clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
		power-domains = <&power RK3066_PD_VIO>;
		resets = <&cru SRST_LCDC0_AXI>,
			 <&cru SRST_LCDC0_AHB>,
			 <&cru SRST_LCDC0_DCLK>;
		reset-names = "axi", "ahb", "dclk";
		status = "disabled";

		vop0_out: port {
			#address-cells = <1>;
			#size-cells = <0>;

			vop0_out_hdmi: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&hdmi_in_vop0>;
			};
		};
	};

	vop1: vop@1010e000 {
		compatible = "rockchip,rk3066-vop";
		reg = <0x1010e000 0x19c>;
		interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru ACLK_LCDC1>,
			 <&cru DCLK_LCDC1>,
			 <&cru HCLK_LCDC1>;
		clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
		power-domains = <&power RK3066_PD_VIO>;
		resets = <&cru SRST_LCDC1_AXI>,
			 <&cru SRST_LCDC1_AHB>,
			 <&cru SRST_LCDC1_DCLK>;
		reset-names = "axi", "ahb", "dclk";
		status = "disabled";

		vop1_out: port {
			#address-cells = <1>;
			#size-cells = <0>;

			vop1_out_hdmi: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&hdmi_in_vop1>;
			};
		};
	};

	hdmi: hdmi@10116000 {
		compatible = "rockchip,rk3066-hdmi";
		reg = <0x10116000 0x2000>;
		interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru HCLK_HDMI>;
		clock-names = "hclk";
		pinctrl-names = "default";
		pinctrl-0 = <&hdmii2c_xfer>, <&hdmi_hpd>;
		power-domains = <&power RK3066_PD_VIO>;
		rockchip,grf = <&grf>;
		status = "disabled";

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			hdmi_in: port@0 {
				reg = <0>;
				#address-cells = <1>;
				#size-cells = <0>;

				hdmi_in_vop0: endpoint@0 {
					reg = <0>;
					remote-endpoint = <&vop0_out_hdmi>;
				};

				hdmi_in_vop1: endpoint@1 {
					reg = <1>;
					remote-endpoint = <&vop1_out_hdmi>;
				};
			};

			hdmi_out: port@1 {
				reg = <1>;
			};
		};
	};

	i2s0: i2s@10118000 {
		compatible = "rockchip,rk3066-i2s";
		reg = <0x10118000 0x2000>;
		interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2s0_bus>;
		clocks = <&cru SCLK_I2S0>, <&cru HCLK_I2S0>;
		clock-names = "i2s_clk", "i2s_hclk";
		dmas = <&dmac1_s 4>, <&dmac1_s 5>;
		dma-names = "tx", "rx";
		rockchip,playback-channels = <8>;
		rockchip,capture-channels = <2>;
		#sound-dai-cells = <0>;
		status = "disabled";
	};

	i2s1: i2s@1011a000 {
		compatible = "rockchip,rk3066-i2s";
		reg = <0x1011a000 0x2000>;
		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2s1_bus>;
		clocks = <&cru SCLK_I2S1>, <&cru HCLK_I2S1>;
		clock-names = "i2s_clk", "i2s_hclk";
		dmas = <&dmac1_s 6>, <&dmac1_s 7>;
		dma-names = "tx", "rx";
		rockchip,playback-channels = <2>;
		rockchip,capture-channels = <2>;
		#sound-dai-cells = <0>;
		status = "disabled";
	};

	i2s2: i2s@1011c000 {
		compatible = "rockchip,rk3066-i2s";
		reg = <0x1011c000 0x2000>;
		interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2s2_bus>;
		clocks = <&cru SCLK_I2S2>, <&cru HCLK_I2S2>;
		clock-names = "i2s_clk", "i2s_hclk";
		dmas = <&dmac1_s 9>, <&dmac1_s 10>;
		dma-names = "tx", "rx";
		rockchip,playback-channels = <2>;
		rockchip,capture-channels = <2>;
		#sound-dai-cells = <0>;
		status = "disabled";
	};

	cru: clock-controller@20000000 {
		compatible = "rockchip,rk3066a-cru";
		reg = <0x20000000 0x1000>;
		clocks = <&xin24m>;
		clock-names = "xin24m";
		rockchip,grf = <&grf>;
		#clock-cells = <1>;
		#reset-cells = <1>;
		assigned-clocks = <&cru PLL_CPLL>, <&cru PLL_GPLL>,
				  <&cru ACLK_CPU>, <&cru HCLK_CPU>,
				  <&cru PCLK_CPU>, <&cru ACLK_PERI>,
				  <&cru HCLK_PERI>, <&cru PCLK_PERI>;
		assigned-clock-rates = <400000000>, <594000000>,
				       <300000000>, <150000000>,
				       <75000000>, <300000000>,
				       <150000000>, <75000000>;
	};

	timer2: timer@2000e000 {
		compatible = "snps,dw-apb-timer";
		reg = <0x2000e000 0x100>;
		interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru SCLK_TIMER2>, <&cru PCLK_TIMER2>;
		clock-names = "timer", "pclk";
	};

	efuse: efuse@20010000 {
		compatible = "rockchip,rk3066a-efuse";
		reg = <0x20010000 0x4000>;
		#address-cells = <1>;
		#size-cells = <1>;
		clocks = <&cru PCLK_EFUSE>;
		clock-names = "pclk_efuse";

		cpu_leakage: cpu_leakage@17 {
			reg = <0x17 0x1>;
		};
	};

	timer0: timer@20038000 {
		compatible = "snps,dw-apb-timer";
		reg = <0x20038000 0x100>;
		interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru SCLK_TIMER0>, <&cru PCLK_TIMER0>;
		clock-names = "timer", "pclk";
	};

	timer1: timer@2003a000 {
		compatible = "snps,dw-apb-timer";
		reg = <0x2003a000 0x100>;
		interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru SCLK_TIMER1>, <&cru PCLK_TIMER1>;
		clock-names = "timer", "pclk";
	};

	tsadc: tsadc@20060000 {
		compatible = "rockchip,rk3066-tsadc";
		reg = <0x20060000 0x100>;
		clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
		clock-names = "saradc", "apb_pclk";
		interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
		#io-channel-cells = <1>;
		resets = <&cru SRST_TSADC>;
		reset-names = "saradc-apb";
		status = "disabled";
	};

	pinctrl: pinctrl {
		compatible = "rockchip,rk3066a-pinctrl";
		rockchip,grf = <&grf>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		gpio0: gpio@20034000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x20034000 0x100>;
			interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO0>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio1: gpio@2003c000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x2003c000 0x100>;
			interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO1>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio2: gpio@2003e000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x2003e000 0x100>;
			interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO2>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio3: gpio@20080000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x20080000 0x100>;
			interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO3>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio4: gpio@20084000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x20084000 0x100>;
			interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO4>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio6: gpio@2000a000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x2000a000 0x100>;
			interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO6>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		pcfg_pull_default: pcfg-pull-default {
			bias-pull-pin-default;
		};

		pcfg_pull_none: pcfg-pull-none {
			bias-disable;
		};

		emac {
			emac_xfer: emac-xfer {
				rockchip,pins = <1 RK_PC0 2 &pcfg_pull_none>, /* mac_clk */
						<1 RK_PC1 2 &pcfg_pull_none>, /* tx_en */
						<1 RK_PC2 2 &pcfg_pull_none>, /* txd1 */
						<1 RK_PC3 2 &pcfg_pull_none>, /* txd0 */
						<1 RK_PC4 2 &pcfg_pull_none>, /* rx_err */
						<1 RK_PC5 2 &pcfg_pull_none>, /* crs_dvalid */
						<1 RK_PC6 2 &pcfg_pull_none>, /* rxd1 */
						<1 RK_PC7 2 &pcfg_pull_none>; /* rxd0 */
			};

			emac_mdio: emac-mdio {
				rockchip,pins = <1 RK_PD0 2 &pcfg_pull_none>, /* mac_md */
						<1 RK_PD1 2 &pcfg_pull_none>; /* mac_mdclk */
			};
		};

		emmc {
			emmc_clk: emmc-clk {
				rockchip,pins = <3 RK_PD7 2 &pcfg_pull_default>;
			};

			emmc_cmd: emmc-cmd {
				rockchip,pins = <4 RK_PB1 2 &pcfg_pull_default>;
			};

			emmc_rst: emmc-rst {
				rockchip,pins = <4 RK_PB2 2 &pcfg_pull_default>;
			};

			/*
			 * The data pins are shared between nandc and emmc and
			 * not accessible through pinctrl. Also they should've
			 * been already set correctly by firmware, as
			 * flash/emmc is the boot-device.
			 */
		};

		hdmi {
			hdmi_hpd: hdmi-hpd {
				rockchip,pins = <0 RK_PA0 1 &pcfg_pull_default>;
			};

			hdmii2c_xfer: hdmii2c-xfer {
				rockchip,pins = <0 RK_PA1 1 &pcfg_pull_none>,
						<0 RK_PA2 1 &pcfg_pull_none>;
			};
		};

		i2c0 {
			i2c0_xfer: i2c0-xfer {
				rockchip,pins = <2 RK_PD4 1 &pcfg_pull_none>,
						<2 RK_PD5 1 &pcfg_pull_none>;
			};
		};

		i2c1 {
			i2c1_xfer: i2c1-xfer {
				rockchip,pins = <2 RK_PD6 1 &pcfg_pull_none>,
						<2 RK_PD7 1 &pcfg_pull_none>;
			};
		};

		i2c2 {
			i2c2_xfer: i2c2-xfer {
				rockchip,pins = <3 RK_PA0 1 &pcfg_pull_none>,
						<3 RK_PA1 1 &pcfg_pull_none>;
			};
		};

		i2c3 {
			i2c3_xfer: i2c3-xfer {
				rockchip,pins = <3 RK_PA2 2 &pcfg_pull_none>,
						<3 RK_PA3 2 &pcfg_pull_none>;
			};
		};

		i2c4 {
			i2c4_xfer: i2c4-xfer {
				rockchip,pins = <3 RK_PA4 1 &pcfg_pull_none>,
						<3 RK_PA5 1 &pcfg_pull_none>;
			};
		};

		pwm0 {
			pwm0_out: pwm0-out {
				rockchip,pins = <0 RK_PA3 1 &pcfg_pull_none>;
			};
		};

		pwm1 {
			pwm1_out: pwm1-out {
				rockchip,pins = <0 RK_PA4 1 &pcfg_pull_none>;
			};
		};

		pwm2 {
			pwm2_out: pwm2-out {
				rockchip,pins = <0 RK_PD6 1 &pcfg_pull_none>;
			};
		};

		pwm3 {
			pwm3_out: pwm3-out {
				rockchip,pins = <0 RK_PD7 1 &pcfg_pull_none>;
			};
		};

		spi0 {
			spi0_clk: spi0-clk {
				rockchip,pins = <1 RK_PA5 2 &pcfg_pull_default>;
			};
			spi0_cs0: spi0-cs0 {
				rockchip,pins = <1 RK_PA4 2 &pcfg_pull_default>;
			};
			spi0_tx: spi0-tx {
				rockchip,pins = <1 RK_PA7 2 &pcfg_pull_default>;
			};
			spi0_rx: spi0-rx {
				rockchip,pins = <1 RK_PA6 2 &pcfg_pull_default>;
			};
			spi0_cs1: spi0-cs1 {
				rockchip,pins = <4 RK_PB7 1 &pcfg_pull_default>;
			};
		};

		spi1 {
			spi1_clk: spi1-clk {
				rockchip,pins = <2 RK_PC3 2 &pcfg_pull_default>;
			};
			spi1_cs0: spi1-cs0 {
				rockchip,pins = <2 RK_PC4 2 &pcfg_pull_default>;
			};
			spi1_rx: spi1-rx {
				rockchip,pins = <2 RK_PC6 2 &pcfg_pull_default>;
			};
			spi1_tx: spi1-tx {
				rockchip,pins = <2 RK_PC5 2 &pcfg_pull_default>;
			};
			spi1_cs1: spi1-cs1 {
				rockchip,pins = <2 RK_PC7 2 &pcfg_pull_default>;
			};
		};

		uart0 {
			uart0_xfer: uart0-xfer {
				rockchip,pins = <1 RK_PA0 1 &pcfg_pull_default>,
						<1 RK_PA1 1 &pcfg_pull_default>;
			};

			uart0_cts: uart0-cts {
				rockchip,pins = <1 RK_PA2 1 &pcfg_pull_default>;
			};

			uart0_rts: uart0-rts {
				rockchip,pins = <1 RK_PA3 1 &pcfg_pull_default>;
			};
		};

		uart1 {
			uart1_xfer: uart1-xfer {
				rockchip,pins = <1 RK_PA4 1 &pcfg_pull_default>,
						<1 RK_PA5 1 &pcfg_pull_default>;
			};

			uart1_cts: uart1-cts {
				rockchip,pins = <1 RK_PA6 1 &pcfg_pull_default>;
			};

			uart1_rts: uart1-rts {
				rockchip,pins = <1 RK_PA7 1 &pcfg_pull_default>;
			};
		};

		uart2 {
			uart2_xfer: uart2-xfer {
				rockchip,pins = <1 RK_PB0 1 &pcfg_pull_default>,
						<1 RK_PB1 1 &pcfg_pull_default>;
			};
			/* no rts / cts for uart2 */
		};

		uart3 {
			uart3_xfer: uart3-xfer {
				rockchip,pins = <3 RK_PD3 1 &pcfg_pull_default>,
						<3 RK_PD4 1 &pcfg_pull_default>;
			};

			uart3_cts: uart3-cts {
				rockchip,pins = <3 RK_PD5 1 &pcfg_pull_default>;
			};

			uart3_rts: uart3-rts {
				rockchip,pins = <3 RK_PD6 1 &pcfg_pull_default>;
			};
		};

		sd0 {
			sd0_clk: sd0-clk {
				rockchip,pins = <3 RK_PB0 1 &pcfg_pull_default>;
			};

			sd0_cmd: sd0-cmd {
				rockchip,pins = <3 RK_PB1 1 &pcfg_pull_default>;
			};

			sd0_cd: sd0-cd {
				rockchip,pins = <3 RK_PB6 1 &pcfg_pull_default>;
			};

			sd0_wp: sd0-wp {
				rockchip,pins = <3 RK_PB7 1 &pcfg_pull_default>;
			};

			sd0_bus1: sd0-bus-width1 {
				rockchip,pins = <3 RK_PB2 1 &pcfg_pull_default>;
			};

			sd0_bus4: sd0-bus-width4 {
				rockchip,pins = <3 RK_PB2 1 &pcfg_pull_default>,
						<3 RK_PB3 1 &pcfg_pull_default>,
						<3 RK_PB4 1 &pcfg_pull_default>,
						<3 RK_PB5 1 &pcfg_pull_default>;
			};
		};

		sd1 {
			sd1_clk: sd1-clk {
				rockchip,pins = <3 RK_PC5 1 &pcfg_pull_default>;
			};

			sd1_cmd: sd1-cmd {
				rockchip,pins = <3 RK_PC0 1 &pcfg_pull_default>;
			};

			sd1_cd: sd1-cd {
				rockchip,pins = <3 RK_PC6 1 &pcfg_pull_default>;
			};

			sd1_wp: sd1-wp {
				rockchip,pins = <3 RK_PC7 1 &pcfg_pull_default>;
			};

			sd1_bus1: sd1-bus-width1 {
				rockchip,pins = <3 RK_PC1 1 &pcfg_pull_default>;
			};

			sd1_bus4: sd1-bus-width4 {
				rockchip,pins = <3 RK_PC1 1 &pcfg_pull_default>,
						<3 RK_PC2 1 &pcfg_pull_default>,
						<3 RK_PC3 1 &pcfg_pull_default>,
						<3 RK_PC4 1 &pcfg_pull_default>;
			};
		};

		i2s0 {
			i2s0_bus: i2s0-bus {
				rockchip,pins = <0 RK_PA7 1 &pcfg_pull_default>,
						<0 RK_PB0 1 &pcfg_pull_default>,
						<0 RK_PB1 1 &pcfg_pull_default>,
						<0 RK_PB2 1 &pcfg_pull_default>,
						<0 RK_PB3 1 &pcfg_pull_default>,
						<0 RK_PB4 1 &pcfg_pull_default>,
						<0 RK_PB5 1 &pcfg_pull_default>,
						<0 RK_PB6 1 &pcfg_pull_default>,
						<0 RK_PB7 1 &pcfg_pull_default>;
			};
		};

		i2s1 {
			i2s1_bus: i2s1-bus {
				rockchip,pins = <0 RK_PC0 1 &pcfg_pull_default>,
						<0 RK_PC1 1 &pcfg_pull_default>,
						<0 RK_PC2 1 &pcfg_pull_default>,
						<0 RK_PC3 1 &pcfg_pull_default>,
						<0 RK_PC4 1 &pcfg_pull_default>,
						<0 RK_PC5 1 &pcfg_pull_default>;
			};
		};

		i2s2 {
			i2s2_bus: i2s2-bus {
				rockchip,pins = <0 RK_PD0 1 &pcfg_pull_default>,
						<0 RK_PD1 1 &pcfg_pull_default>,
						<0 RK_PD2 1 &pcfg_pull_default>,
						<0 RK_PD3 1 &pcfg_pull_default>,
						<0 RK_PD4 1 &pcfg_pull_default>,
						<0 RK_PD5 1 &pcfg_pull_default>;
			};
		};
	};
};

&gpu {
	compatible = "rockchip,rk3066-mali", "arm,mali-400";
	interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
	interrupt-names = "gp",
			  "gpmmu",
			  "pp0",
			  "ppmmu0",
			  "pp1",
			  "ppmmu1",
			  "pp2",
			  "ppmmu2",
			  "pp3",
			  "ppmmu3";
	power-domains = <&power RK3066_PD_GPU>;
};

&grf {
	compatible = "rockchip,rk3066-grf", "syscon", "simple-mfd";

	usbphy: usbphy {
		compatible = "rockchip,rk3066a-usb-phy";
		#address-cells = <1>;
		#size-cells = <0>;
		status = "disabled";

		usbphy0: usb-phy@17c {
			reg = <0x17c>;
			clocks = <&cru SCLK_OTGPHY0>;
			clock-names = "phyclk";
			#clock-cells = <0>;
			#phy-cells = <0>;
		};

		usbphy1: usb-phy@188 {
			reg = <0x188>;
			clocks = <&cru SCLK_OTGPHY1>;
			clock-names = "phyclk";
			#clock-cells = <0>;
			#phy-cells = <0>;
		};
	};
};

&i2c0 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c0_xfer>;
};

&i2c1 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c1_xfer>;
};

&i2c2 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c2_xfer>;
};

&i2c3 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c3_xfer>;
};

&i2c4 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2c4_xfer>;
};

&mmc0 {
	clock-frequency = <50000000>;
	dmas = <&dmac2 1>;
	dma-names = "rx-tx";
	max-frequency = <50000000>;
	pinctrl-names = "default";
	pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_cd &sd0_bus4>;
};

&mmc1 {
	dmas = <&dmac2 3>;
	dma-names = "rx-tx";
	pinctrl-names = "default";
	pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_cd &sd1_bus4>;
};

&emmc {
	dmas = <&dmac2 4>;
	dma-names = "rx-tx";
};

&pmu {
	power: power-controller {
		compatible = "rockchip,rk3066-power-controller";
		#power-domain-cells = <1>;
		#address-cells = <1>;
		#size-cells = <0>;

		power-domain@RK3066_PD_VIO {
			reg = <RK3066_PD_VIO>;
			clocks = <&cru ACLK_LCDC0>,
				 <&cru ACLK_LCDC1>,
				 <&cru DCLK_LCDC0>,
				 <&cru DCLK_LCDC1>,
				 <&cru HCLK_LCDC0>,
				 <&cru HCLK_LCDC1>,
				 <&cru SCLK_CIF1>,
				 <&cru ACLK_CIF1>,
				 <&cru HCLK_CIF1>,
				 <&cru SCLK_CIF0>,
				 <&cru ACLK_CIF0>,
				 <&cru HCLK_CIF0>,
				 <&cru HCLK_HDMI>,
				 <&cru ACLK_IPP>,
				 <&cru HCLK_IPP>,
				 <&cru ACLK_RGA>,
				 <&cru HCLK_RGA>;
			pm_qos = <&qos_lcdc0>,
				 <&qos_lcdc1>,
				 <&qos_cif0>,
				 <&qos_cif1>,
				 <&qos_ipp>,
				 <&qos_rga>;
			#power-domain-cells = <0>;
		};

		power-domain@RK3066_PD_VIDEO {
			reg = <RK3066_PD_VIDEO>;
			clocks = <&cru ACLK_VDPU>,
				 <&cru ACLK_VEPU>,
				 <&cru HCLK_VDPU>,
				 <&cru HCLK_VEPU>;
			pm_qos = <&qos_vpu>;
			#power-domain-cells = <0>;
		};

		power-domain@RK3066_PD_GPU {
			reg = <RK3066_PD_GPU>;
			clocks = <&cru ACLK_GPU>;
			pm_qos = <&qos_gpu>;
			#power-domain-cells = <0>;
		};
	};
};

&pwm0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm0_out>;
};

&pwm1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm1_out>;
};

&pwm2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm2_out>;
};

&pwm3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm3_out>;
};

&spi0 {
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_clk &spi0_tx &spi0_rx &spi0_cs0>;
};

&spi1 {
	pinctrl-names = "default";
	pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0>;
};

&uart0 {
	compatible = "rockchip,rk3066-uart", "snps,dw-apb-uart";
	dmas = <&dmac1_s 0>, <&dmac1_s 1>;
	dma-names = "tx", "rx";
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_xfer>;
};

&uart1 {
	compatible = "rockchip,rk3066-uart", "snps,dw-apb-uart";
	dmas = <&dmac1_s 2>, <&dmac1_s 3>;
	dma-names = "tx", "rx";
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_xfer>;
};

&uart2 {
	compatible = "rockchip,rk3066-uart", "snps,dw-apb-uart";
	dmas = <&dmac2 6>, <&dmac2 7>;
	dma-names = "tx", "rx";
	pinctrl-names = "default";
	pinctrl-0 = <&uart2_xfer>;
};

&uart3 {
	compatible = "rockchip,rk3066-uart", "snps,dw-apb-uart";
	dmas = <&dmac2 8>, <&dmac2 9>;
	dma-names = "tx", "rx";
	pinctrl-names = "default";
	pinctrl-0 = <&uart3_xfer>;
};

&vpu {
	power-domains = <&power RK3066_PD_VIDEO>;
};

&wdt {
	compatible = "rockchip,rk3066-wdt", "snps,dw-wdt";
};

&emac {
	compatible = "rockchip,rk3066-emac";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2018 MundoReader S.L.
 * Author:  Heiko Stuebner <heiko.stuebner@bq.com>
 */

/dts-v1/;
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "rk3188.dtsi"

/ {
	model = "BQ Edison2 Quad-Core";
	compatible = "mundoreader,bq-edison2qc", "rockchip,rk3188";

	aliases {
		mmc0 = &mmc0;
		mmc1 = &mmc1;
		mmc2 = &emmc;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x80000000>;
	};

	backlight: backlight {
		compatible = "pwm-backlight";
		power-supply = <&vsys>;
		pwms = <&pwm1 0 25000>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		autorepeat;
		pinctrl-names = "default";
		pinctrl-0 = <&pwr_key &usb_int>;

		key-power {
			gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_POWER>;
			label = "GPIO Key Power";
			linux,input-type = <1>;
			debounce-interval = <100>;
			wakeup-source;
		};

		wake_on_usb: key-wake-on-usb {
			label = "Wake-on-USB";
			gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WAKEUP>;
			wakeup-source;
		};
	};

	gpio-poweroff {
		compatible = "gpio-poweroff";
		gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pwr_hold>;
		/* only drive the pin low until device is off */
		active-delay-ms = <3000>;
	};

	lvds-encoder {
		compatible = "ti,sn75lvds83", "lvds-encoder";

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				lvds_in_vop0: endpoint {
					remote-endpoint = <&vop0_out_lvds>;
				};
			};

			port@1 {
				reg = <1>;

				lvds_out_panel: endpoint {
					remote-endpoint = <&panel_in_lvds>;
				};
			};
		};
	};

	panel {
		compatible = "innolux,ee101ia-01d", "panel-lvds";
		backlight = <&backlight>;

		/* pin LCD_CS, Nshtdn input of lvds-encoder */
		enable-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd_cs>;
		power-supply = <&vcc_lcd>;

		data-mapping = "vesa-24";
		height-mm = <163>;
		width-mm = <261>;

		panel-timing {
			clock-frequency = <72000000>;
			hactive = <1280>;
			vactive = <800>;
			hback-porch = <160>;
			hfront-porch = <16>;
			hsync-len = <10>;
			vback-porch = <23>;
			vfront-porch = <12>;
			vsync-len = <3>;
		};

		port {
			panel_in_lvds: endpoint {
				remote-endpoint = <&lvds_out_panel>;
			};
		};
	};

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		clocks = <&hym8563>;
		clock-names = "ext_clock";
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_reg_on>;
		reset-gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_LOW>;
	};

	avdd_cif: cif-avdd-regulator {
		compatible = "regulator-fixed";
		regulator-name = "avdd-cif";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		gpio = <&gpio1 RK_PA6 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&cif_avdd_en>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc28_cif>;
	};

	vcc_5v: vcc-5v-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vcc-5v";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		enable-active-high;
		gpio = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&v5_drv>;
		vin-supply = <&vsys>;
	};

	vcc_lcd: lcd-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vcc-lcd";
		gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd_en>;
		startup-delay-us = <50000>;
		vin-supply = <&vcc_io>;
	};

	vcc_otg: usb-otg-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vcc-otg";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		enable-active-high;
		gpio = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&otg_drv>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_5v>;
	};

	vcc_sd: sdmmc-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vcc-sd";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwr>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};

	vccq_emmc: emmc-vccq-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vccq-emmc";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		vin-supply = <&vcc_io>;
	};

	/* supplied from the bq24196 */
	vsys: vsys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vsys";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-boot-on;
	};
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&cpu1 {
	cpu-supply = <&vdd_arm>;
};

&cpu2 {
	cpu-supply = <&vdd_arm>;
};

&cpu3 {
	cpu-supply = <&vdd_arm>;
};

&cru {
	assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>,
			  <&cru ACLK_CPU>,
			  <&cru HCLK_CPU>, <&cru PCLK_CPU>,
			  <&cru ACLK_PERI>, <&cru HCLK_PERI>,
			  <&cru PCLK_PERI>;
	assigned-clock-rates = <594000000>, <504000000>,
			       <300000000>,
			       <150000000>, <75000000>,
			       <300000000>, <150000000>,
			       <75000000>;
};

&emmc {
	bus-width = <8>;
	cap-mmc-highspeed;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&emmc_clk &emmc_cmd>;
	vmmc-supply = <&vcc_io>;
	vqmmc-supply = <&vccq_emmc>;
	status = "okay";
};

&gpu {
	status = "okay";
};

&i2c0 {
	clock-frequency = <400000>;
	status = "okay";

	lis3de: accelerometer@29 {
		compatible = "st,lis3de";
		reg = <0x29>;
		interrupt-parent = <&gpio0>;
		interrupts = <RK_PB7 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&gsensor_int>;
		rotation-matrix = "1", "0", "0",
				  "0", "-1", "0",
				  "0", "0", "1";
		vdd-supply = <&vcc_io>;
	};
};

&i2c1 {
	clock-frequency = <400000>;
	status = "okay";

	tmp108@48 {
		compatible = "ti,tmp108";
		reg = <0x48>;
		interrupt-parent = <&gpio1>;
		interrupts = <RK_PA7 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&tmp_alrt>;
		#thermal-sensor-cells = <0>;
	};

	hym8563: rtc@51 {
		compatible = "haoyu,hym8563";
		reg = <0x51>;
		interrupt-parent = <&gpio0>;
		interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&rtc_int>;
		#clock-cells = <0>;
		clock-output-names = "xin32k";
	};

	bat: battery@55 {
		compatible = "ti,bq27541";
		reg = <0x55>;
		power-supplies = <&bq24196>;
	};

	act8846: pmic@5a {
		compatible = "active-semi,act8846";
		reg = <0x5a>;
		pinctrl-names = "default";
		pinctrl-0 = <&dvs0_ctl &pmic_int>;

		vp1-supply = <&vsys>;
		vp2-supply = <&vsys>;
		vp3-supply = <&vsys>;
		vp4-supply = <&vsys>;
		inl1-supply = <&vcc_io>;
		inl2-supply = <&vsys>;
		inl3-supply = <&vsys>;

		regulators {
			vcc_ddr: REG1 {
				regulator-name = "VCC_DDR";
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <1200000>;
				regulator-always-on;
			};

			vdd_log: REG2 {
				regulator-name = "VDD_LOG";
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1200000>;
				regulator-always-on;
			};

			vdd_arm: REG3 {
				regulator-name = "VDD_ARM";
				regulator-min-microvolt = <875000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
			};

			vcc_io: vcc_hdmi: REG4 {
				regulator-name = "VCC_IO";
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
				regulator-always-on;
			};

			vdd_10: REG5 {
				regulator-name = "VDD_10";
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
				regulator-always-on;
			};

			vdd_12: REG6 {
				regulator-name = "VDD_12";
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <1200000>;
				regulator-always-on;
			};

			vcc18_cif: REG7 {
				regulator-name = "VCC18_CIF";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
			};

			vcca_33: REG8 {
				regulator-name = "VCCA_33";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vcc_tp: REG9 {
				regulator-name = "VCC_TP";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vccio_wl: REG10 {
				regulator-name = "VCCIO_WL";
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2800000>;
				regulator-always-on;
			};

			vcc_18: REG11 {
				regulator-name = "VCC_18";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
			};

			vcc28_cif: REG12 {
				regulator-name = "VCC28_CIF";
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2800000>;
				regulator-always-on;
			};
		};
	};

	bq24196: charger@6b {
		compatible = "ti,bq24196";
		reg = <0x6b>;
		interrupt-parent = <&gpio0>;
		interrupts = <RK_PD7 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&charger_int &chg_ctl &otg_en>;
		ti,system-minimum-microvolt = <3200000>;
		monitored-battery = <&bat>;
		omit-battery-class;

		usb_otg_vbus: usb-otg-vbus { };
	};
};

&i2c2 {
	clock-frequency = <400000>;
	status = "okay";

	ft5606: touchscreen@3e {
		compatible = "edt,edt-ft5506";
		reg = <0x3e>;
		interrupt-parent = <&gpio1>;
		interrupts = <RK_PB7 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&tp_int &tp_rst>;
		reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
		touchscreen-inverted-y;
		/* hw ts resolution does not match display */
		touchscreen-size-y = <1024>;
		touchscreen-size-x = <768>;
		touchscreen-swapped-x-y;
	};
};

&i2c3 {
	clock-frequency = <400000>;
	status = "okay";
};

&i2c4 {
	clock-frequency = <400000>;
	status = "okay";

	rt5616: codec@1b {
		compatible = "realtek,rt5616";
		reg = <0x1b>;
		clocks = <&cru SCLK_I2S0>;
		clock-names = "mclk";
		#sound-dai-cells = <0>;
	};
};

&i2s0 {
	status = "okay";
};

&mmc0 {
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
	pinctrl-names = "default";
	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
	vmmc-supply = <&vcc_sd>;
	status = "okay";
};

&mmc1 {
	bus-width = <4>;
	cap-sd-highspeed;
	keep-power-in-suspend;
	mmc-pwrseq = <&sdio_pwrseq>;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&sd1_clk>, <&sd1_cmd>, <&sd1_bus4>;
	vqmmc-supply = <&vccio_wl>;
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	brcmf: wifi@1 {
		reg = <1>;
		compatible = "brcm,bcm4329-fmac";
		interrupt-parent = <&gpio3>;
		interrupts = <RK_PD2 IRQ_TYPE_NONE>;
		interrupt-names = "host-wake";
		brcm,drive-strength = <5>;
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_host_wake>;
	};
};

&pwm1 {
	status = "okay";
};

&pinctrl {
	pcfg_output_high: pcfg-output-high {
		output-high;
	};

	pcfg_output_low: pcfg-output-low {
		output-low;
	};

	act8846 {
		dvs0_ctl: dvs0-ctl {
			rockchip,pins = <3 RK_PD3 RK_FUNC_GPIO &pcfg_output_low>;
		};

		pmic_int: pmic-int {
			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	bq24196 {
		charger_int: charger-int {
			rockchip,pins = <0 RK_PD7 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		/* pin hog to make it select usb profile */
		chg_ctl: chg-ctl {
			rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_output_high>;
		};

		/* low: charging, high: complete, fault: blinking */
		chg_det: chg-det {
			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		/* charging enabled when pin low and register set */
		chg_en: chg-en {
			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_output_low>;
		};

		/* bq29196 powergood (when low) signal */
		dc_det: dc-det {
			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		/* wire bq24196 otg pin to high, to enable 500mA charging */
		otg_en: otg-en {
			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_output_high>;
		};
	};

	camera {
		cif0_pdn: cif0-pdn {
			rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		cif1_pdn: cif1-pdn {
			rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		cif_avdd_en: cif-avdd-en {
			rockchip,pins = <1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	display {
		lcd_cs: lcd-cs {
			rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		lcd_en: lcd-en {
			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	ft5606 {
		tp_int: tp-int {
			rockchip,pins = <1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		tp_rst: tp-rst {
			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	hdmi {
		hdmi_int: hdmi-int {
			rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		hdmi_rst: hdmi-rst {
			rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	hym8563 {
		rtc_int: rtc-int {
			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	keys {
		pwr_hold: pwr-hold {
			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		pwr_key: pwr-key {
			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	lis3de {
		gsensor_int: gsensor-int {
			rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	mmc {
		sdmmc_pwr: sdmmc-pwr {
			rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	tmp108 {
		tmp_alrt: tmp-alrt {
			rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	usb {
		v5_drv: v5-drv {
			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		otg_drv: otg-drv {
			rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		usb_int: usb-int {
			rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	rk903 {
		bt_host_wake: bt-host-wake {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		bt_reg_on: bt-reg-on {
			rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		/* pin hog to pull the reset high */
		bt_rst: bt-rst {
			rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_output_high>;
		};

		bt_wake: bt-wake {
			rockchip,pins = <3 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		wifi_host_wake: wifi-host-wake {
			rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
		};

		wifi_reg_on: wifi-reg-on {
			rockchip,pins = <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&saradc {
	vref-supply = <&vcc_18>;
	status = "okay";
};

&spdif {
	status = "okay";
};

&uart0 {
	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
	status = "okay";

	bluetooth {
		compatible = "brcm,bcm43438-bt";
		max-speed = <2000000>;
		device-wakeup-gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
		host-wakeup-gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		shutdown-gpios = <&gpio3 RK_PC7 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&bt_host_wake &bt_reg_on &bt_rst &bt_wake>;
	};
};

&uart1 {
	status = "okay";
};

&uart2 {
	status = "okay";
};

&uart3 {
	pinctrl-0 = <&uart3_xfer &uart3_cts &uart3_rts>;
	status = "okay";
};

&usbphy {
	status = "okay";
};

&usb_host {
	status = "okay";
};

&usb_otg {
	status = "okay";
};

&vop0 {
	status = "okay";
};

&vop0_out {
	vop0_out_lvds: endpoint {
		remote-endpoint = <&lvds_in_vop0>;
	};
};

&vop1 {
	pinctrl-names = "default";
	pinctrl-0 = <&lcdc1_dclk &lcdc1_den &lcdc1_hsync
		     &lcdc1_vsync &lcdc1_rgb24>;
	status = "okay";
};

&wdt {
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2016 Andy Yan <andy.yan@rock-chips.com>
 */

/dts-v1/;
#include <dt-bindings/input/input.h>
#include "rk3188.dtsi"

/ {
	model = "Rockchip PX3-EVB";
	compatible = "rockchip,px3-evb", "rockchip,px3", "rockchip,rk3188";

	aliases {
		mmc0 = &mmc0;
		mmc1 = &emmc;
	};

	chosen {
		stdout-path = "serial2:115200n8";
	};

	memory@60000000 {
		reg = <0x60000000 0x80000000>;
		device_type = "memory";
	};

	gpio-keys {
		compatible = "gpio-keys";
		autorepeat;

		key-power {
			gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_POWER>;
			label = "GPIO Key Power";
			linux,input-type = <1>;
			wakeup-source;
			debounce-interval = <100>;
		};
	};

	vcc_sys: vsys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vsys";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-boot-on;
	};
};

&cpu0 {
	cpu-supply = <&vdd_cpu>;
};

&cpu1 {
	cpu-supply = <&vdd_cpu>;
};

&cpu2 {
	cpu-supply = <&vdd_cpu>;
};

&cpu3 {
	cpu-supply = <&vdd_cpu>;
};

&emmc {
	bus-width = <8>;
	cap-mmc-highspeed;
	non-removable;
	pinctrl-names = "default";
	pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_rst>;
	status = "okay";
};

&i2c0 {
	status = "okay";

	accelerometer@18 {
		compatible = "bosch,bma250";
		reg = <0x18>;
		interrupt-parent = <&gpio0>;
		interrupts = <RK_PB7 IRQ_TYPE_LEVEL_LOW>;
	};
};

&i2c1 {
	status = "okay";
	clock-frequency = <400000>;

	rk808: pmic@1c {
		compatible = "rockchip,rk818";
		reg = <0x1c>;
		interrupt-parent = <&gpio0>;
		interrupts = <RK_PB3 IRQ_TYPE_LEVEL_LOW>;
		rockchip,system-power-controller;
		wakeup-source;
		#clock-cells = <1>;
		clock-output-names = "xin32k", "rk808-clkout2";

		vcc1-supply = <&vcc_sys>;
		vcc2-supply = <&vcc_sys>;
		vcc3-supply = <&vcc_sys>;
		vcc4-supply = <&vcc_sys>;
		vcc6-supply = <&vcc_sys>;
		vcc7-supply = <&vcc_sys>;
		vcc8-supply = <&vcc_io>;
		vcc9-supply = <&vcc_io>;

		regulators {
			vdd_cpu: DCDC_REG1 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <750000>;
				regulator-max-microvolt = <1350000>;
				regulator-name = "vdd_arm";
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

			vdd_gpu: DCDC_REG2 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <850000>;
				regulator-max-microvolt = <1250000>;
				regulator-name = "vdd_gpu";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1000000>;
				};
			};

			vcc_ddr: DCDC_REG3 {
				regulator-always-on;
				regulator-boot-on;
				regulator-name = "vcc_ddr";
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc_io: DCDC_REG4 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc_io";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3300000>;
				};
			};

			vcc_cif: LDO_REG1 {
				 regulator-min-microvolt = <3300000>;
				 regulator-max-microvolt = <3300000>;
				 regulator-name = "vcc_cif";
			};

			vcc_jetta33: LDO_REG2 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc_jetta33";
			};

			vdd_10: LDO_REG3 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
				regulator-name = "vdd_10";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1000000>;
				};
			};

			lvds_12: LDO_REG4 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "lvds_12";
			};

			lvds_25: LDO_REG5 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "lvds_25";
			};

			cif_18: LDO_REG6 {
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
				regulator-name = "cif_18";
			};

			vcc_sd: LDO_REG7 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc_sd";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3300000>;
				};
			};

			wl_18: LDO_REG8 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "wl_18";
			};

			lcd_33: SWITCH_REG {
				regulator-name = "lcd_33";
			};
		};
	};

};

&i2c2 {
	gsl1680: touchscreen@40 {
		compatible = "silead,gsl1680";
		reg = <0x40>;
		interrupt-parent = <&gpio1>;
		interrupts = <RK_PB7 IRQ_TYPE_EDGE_FALLING>;
		power-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
		touchscreen-size-x = <800>;
		touchscreen-size-y = <1280>;
		silead,max-fingers = <5>;
	};
};

&mmc0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
	vmmc-supply = <&vcc_sd>;

	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
};

&pinctrl {
	pcfg_output_low: pcfg-output-low {
		output-low;
	};

	usb {
		host_vbus_drv: host-vbus-drv {
			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
		};
		otg_vbus_drv: otg-vbus-drv {
			rockchip,pins = <2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pwm1 {
	status = "okay";
};

&pwm2 {
	status = "okay";
};

&pwm3 {
	status = "okay";
};

&uart0 {
	status = "okay";
};

&uart1 {
	status = "okay";
};

&uart2 {
	status = "okay";
};

&uart3 {
	status = "okay";
};

&usbphy {
	status = "okay";
};

&usb_host {
	status = "okay";
};

&usb_otg {
	status = "okay";
};

&wdt {
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
 */

/dts-v1/;
#include <dt-bindings/input/input.h>
#include "rk3188.dtsi"

/ {
	model = "Radxa Rock";
	compatible = "radxa,rock", "rockchip,rk3188";

	aliases {
		mmc0 = &mmc0;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x80000000>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		autorepeat;

		key-power {
			gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_POWER>;
			label = "GPIO Key Power";
			linux,input-type = <1>;
			wakeup-source;
			debounce-interval = <100>;
		};
	};

	gpio-leds {
		compatible = "gpio-leds";

		green_led: led-0 {
			label = "rock:green:user1";
			gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		blue_led: led-1 {
			label = "rock:blue:user2";
			gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		sleep_led: led-2 {
			label = "rock:red:power";
			gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};
	};

	sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "SPDIF";

		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
			cpu { sound-dai = <&spdif>; };
			codec { sound-dai = <&spdif_out>; };
		};
	};

	spdif_out: spdif-out {
		compatible = "linux,spdif-dit";
		#sound-dai-cells = <0>;
	};

	ir_recv: ir-receiver {
		compatible = "gpio-ir-receiver";
		gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&ir_recv_pin>;
	};

	vcc_otg: usb-otg-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&otg_vbus_drv>;
		regulator-name = "otg-vbus";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc_sd0: sdmmc-regulator {
		compatible = "regulator-fixed";
		regulator-name = "sdmmc-supply";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwr>;
		startup-delay-us = <100000>;
		vin-supply = <&vcc_io>;
	};

	vcc_host: usb-host-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&host_vbus_drv>;
		regulator-name = "host-pwr";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		regulator-boot-on;
	};

	vsys: vsys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vsys";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-boot-on;
	};
};

&emac {
	phy = <&phy0>;
	phy-supply = <&vcc_rmii>;
	pinctrl-names = "default";
	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&phy_int>;
	status = "okay";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;

		phy0: ethernet-phy@0 {
			reg = <0>;
			interrupt-parent = <&gpio3>;
			interrupts = <RK_PD2 IRQ_TYPE_LEVEL_LOW>;
		};
	};
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&cpu1 {
	cpu-supply = <&vdd_arm>;
};

&cpu2 {
	cpu-supply = <&vdd_arm>;
};

&cpu3 {
	cpu-supply = <&vdd_arm>;
};

&gpu {
	status = "okay";
};

&i2c1 {
	status = "okay";
	clock-frequency = <400000>;

	rtc@51 {
		compatible = "haoyu,hym8563";
		reg = <0x51>;
		interrupt-parent = <&gpio0>;
		interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&rtc_int>;
		#clock-cells = <0>;
		clock-output-names = "xin32k";
	};

	act8846: act8846@5a {
		compatible = "active-semi,act8846";
		reg = <0x5a>;
		status = "okay";
		system-power-controller;

		pinctrl-names = "default";
		pinctrl-0 = <&act8846_dvs0_ctl>;

		vp1-supply = <&vsys>;
		vp2-supply = <&vsys>;
		vp3-supply = <&vsys>;
		vp4-supply = <&vsys>;
		inl1-supply = <&vcc_io>;
		inl2-supply = <&vsys>;
		inl3-supply = <&vsys>;

		regulators {
			vcc_ddr: REG1 {
				regulator-name = "VCC_DDR";
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <1200000>;
				regulator-always-on;
			};

			vdd_log: REG2 {
				regulator-name = "VDD_LOG";
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
				regulator-always-on;
			};

			vdd_arm: REG3 {
				regulator-name = "VDD_ARM";
				regulator-min-microvolt = <875000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
			};

			vcc_io: REG4 {
				regulator-name = "VCC_IO";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vdd_10: REG5 {
				regulator-name = "VDD_10";
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
				regulator-always-on;
			};

			vdd_hdmi: REG6 {
				regulator-name = "VDD_HDMI";
				regulator-min-microvolt = <2500000>;
				regulator-max-microvolt = <2500000>;
				regulator-always-on;
			};

			vcc18: REG7 {
				regulator-name = "VCC_18";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
			};

			vcca_33: REG8 {
				regulator-name = "VCCA_33";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vcc_rmii: REG9 {
				regulator-name = "VCC_RMII";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

			vccio_wl: REG10 {
				regulator-name = "VCCIO_WL";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-always-on;
			};

			vcc_18: REG11 {
				regulator-name = "VCC18_IO";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-always-on;
			};

			vcc28: REG12 {
				regulator-name = "VCC_28";
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2800000>;
				regulator-always-on;
			};
		};
	};
};

&mmc0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
	vmmc-supply = <&vcc_sd0>;

	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
};

&pwm1 {
	status = "okay";
};

&pwm2 {
	status = "okay";
};

&pwm3 {
	status = "okay";
};

&pinctrl {
	pcfg_output_low: pcfg-output-low {
		output-low;
	};

	act8846 {
		act8846_dvs0_ctl: act8846-dvs0-ctl {
			rockchip,pins = <3 RK_PD3 RK_FUNC_GPIO &pcfg_output_low>;
		};
	};

	hym8563 {
		rtc_int: rtc-int {
			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	lan8720a  {
		phy_int: phy-int {
			rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	ir-receiver {
		ir_recv_pin: ir-recv-pin {
			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	sd0 {
		sdmmc_pwr: sdmmc-pwr {
			rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	usb {
		host_vbus_drv: host-vbus-drv {
			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
		};
		otg_vbus_drv: otg-vbus-drv {
			rockchip,pins = <2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&spdif {
	status = "okay";
};

&uart0 {
	status = "okay";
};

&uart1 {
	status = "okay";
};

&uart2 {
	status = "okay";
};

&uart3 {
	status = "okay";
};

&usbphy {
	status = "okay";
};

&usb_host {
	status = "okay";
};

&usb_otg {
	status = "okay";
};

&wdt {
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2013 MundoReader S.L.
 * Author: Heiko Stuebner <heiko@sntech.de>
 */

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/clock/rk3188-cru.h>
#include <dt-bindings/power/rk3188-power.h>
#include "rk3xxx.dtsi"

/ {
	compatible = "rockchip,rk3188";

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		enable-method = "rockchip,rk3066-smp";

		cpu0: cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			next-level-cache = <&L2>;
			reg = <0x0>;
			clock-latency = <40000>;
			clocks = <&cru ARMCLK>;
			operating-points-v2 = <&cpu0_opp_table>;
			resets = <&cru SRST_CORE0>;
		};
		cpu1: cpu@1 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			next-level-cache = <&L2>;
			reg = <0x1>;
			operating-points-v2 = <&cpu0_opp_table>;
			resets = <&cru SRST_CORE1>;
		};
		cpu2: cpu@2 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			next-level-cache = <&L2>;
			reg = <0x2>;
			operating-points-v2 = <&cpu0_opp_table>;
			resets = <&cru SRST_CORE2>;
		};
		cpu3: cpu@3 {
			device_type = "cpu";
			compatible = "arm,cortex-a9";
			next-level-cache = <&L2>;
			reg = <0x3>;
			operating-points-v2 = <&cpu0_opp_table>;
			resets = <&cru SRST_CORE3>;
		};
	};

	cpu0_opp_table: opp-table-0 {
		compatible = "operating-points-v2";
		opp-shared;

		opp-312000000 {
			opp-hz = /bits/ 64 <312000000>;
			opp-microvolt = <875000>;
			clock-latency-ns = <40000>;
		};
		opp-504000000 {
			opp-hz = /bits/ 64 <504000000>;
			opp-microvolt = <925000>;
		};
		opp-600000000 {
			opp-hz = /bits/ 64 <600000000>;
			opp-microvolt = <950000>;
			opp-suspend;
		};
		opp-816000000 {
			opp-hz = /bits/ 64 <816000000>;
			opp-microvolt = <975000>;
		};
		opp-1008000000 {
			opp-hz = /bits/ 64 <1008000000>;
			opp-microvolt = <1075000>;
		};
		opp-1200000000 {
			opp-hz = /bits/ 64 <1200000000>;
			opp-microvolt = <1150000>;
		};
		opp-1416000000 {
			opp-hz = /bits/ 64 <1416000000>;
			opp-microvolt = <1250000>;
		};
		opp-1608000000 {
			opp-hz = /bits/ 64 <1608000000>;
			opp-microvolt = <1350000>;
		};
	};

	display-subsystem {
		compatible = "rockchip,display-subsystem";
		ports = <&vop0_out>, <&vop1_out>;
	};

	sram: sram@10080000 {
		compatible = "mmio-sram";
		reg = <0x10080000 0x8000>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges = <0 0x10080000 0x8000>;

		smp-sram@0 {
			compatible = "rockchip,rk3066-smp-sram";
			reg = <0x0 0x50>;
		};
	};

	vop0: vop@1010c000 {
		compatible = "rockchip,rk3188-vop";
		reg = <0x1010c000 0x1000>;
		interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru ACLK_LCDC0>, <&cru DCLK_LCDC0>, <&cru HCLK_LCDC0>;
		clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
		power-domains = <&power RK3188_PD_VIO>;
		resets = <&cru SRST_LCDC0_AXI>, <&cru SRST_LCDC0_AHB>, <&cru SRST_LCDC0_DCLK>;
		reset-names = "axi", "ahb", "dclk";
		status = "disabled";

		vop0_out: port {
			#address-cells = <1>;
			#size-cells = <0>;
		};
	};

	vop1: vop@1010e000 {
		compatible = "rockchip,rk3188-vop";
		reg = <0x1010e000 0x1000>;
		interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru ACLK_LCDC1>, <&cru DCLK_LCDC1>, <&cru HCLK_LCDC1>;
		clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
		power-domains = <&power RK3188_PD_VIO>;
		resets = <&cru SRST_LCDC1_AXI>, <&cru SRST_LCDC1_AHB>, <&cru SRST_LCDC1_DCLK>;
		reset-names = "axi", "ahb", "dclk";
		status = "disabled";

		vop1_out: port {
			#address-cells = <1>;
			#size-cells = <0>;
		};
	};

	timer3: timer@2000e000 {
		compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer";
		reg = <0x2000e000 0x20>;
		interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru PCLK_TIMER3>, <&cru SCLK_TIMER3>;
		clock-names = "pclk", "timer";
	};

	timer6: timer@200380a0 {
		compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer";
		reg = <0x200380a0 0x20>;
		interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru PCLK_TIMER0>, <&cru SCLK_TIMER6>;
		clock-names = "pclk", "timer";
	};

	i2s0: i2s@1011a000 {
		compatible = "rockchip,rk3188-i2s", "rockchip,rk3066-i2s";
		reg = <0x1011a000 0x2000>;
		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2s0_bus>;
		clocks = <&cru SCLK_I2S0>, <&cru HCLK_I2S0>;
		clock-names = "i2s_clk", "i2s_hclk";
		dmas = <&dmac1_s 6>, <&dmac1_s 7>;
		dma-names = "tx", "rx";
		rockchip,playback-channels = <2>;
		rockchip,capture-channels = <2>;
		#sound-dai-cells = <0>;
		status = "disabled";
	};

	spdif: sound@1011e000 {
		compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
		reg = <0x1011e000 0x2000>;
		#sound-dai-cells = <0>;
		clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF>;
		clock-names = "mclk", "hclk";
		dmas = <&dmac1_s 8>;
		dma-names = "tx";
		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&spdif_tx>;
		status = "disabled";
	};

	cru: clock-controller@20000000 {
		compatible = "rockchip,rk3188-cru";
		reg = <0x20000000 0x1000>;
		clocks = <&xin24m>;
		clock-names = "xin24m";
		rockchip,grf = <&grf>;
		#clock-cells = <1>;
		#reset-cells = <1>;
	};

	efuse: efuse@20010000 {
		compatible = "rockchip,rk3188-efuse";
		reg = <0x20010000 0x4000>;
		#address-cells = <1>;
		#size-cells = <1>;
		clocks = <&cru PCLK_EFUSE>;
		clock-names = "pclk_efuse";

		cpu_leakage: cpu_leakage@17 {
			reg = <0x17 0x1>;
		};
	};

	pinctrl: pinctrl {
		compatible = "rockchip,rk3188-pinctrl";
		rockchip,grf = <&grf>;
		rockchip,pmu = <&pmu>;

		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		gpio0: gpio@2000a000 {
			compatible = "rockchip,rk3188-gpio-bank0";
			reg = <0x2000a000 0x100>;
			interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO0>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio1: gpio@2003c000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x2003c000 0x100>;
			interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO1>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio2: gpio@2003e000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x2003e000 0x100>;
			interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO2>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		gpio3: gpio@20080000 {
			compatible = "rockchip,gpio-bank";
			reg = <0x20080000 0x100>;
			interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cru PCLK_GPIO3>;

			gpio-controller;
			#gpio-cells = <2>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		pcfg_pull_up: pcfg-pull-up {
			bias-pull-up;
		};

		pcfg_pull_down: pcfg-pull-down {
			bias-pull-down;
		};

		pcfg_pull_none: pcfg-pull-none {
			bias-disable;
		};

		emmc {
			emmc_clk: emmc-clk {
				rockchip,pins = <0 RK_PD0 2 &pcfg_pull_none>;
			};

			emmc_cmd: emmc-cmd {
				rockchip,pins = <0 RK_PD2 2 &pcfg_pull_up>;
			};

			emmc_rst: emmc-rst {
				rockchip,pins = <0 RK_PD3 2 &pcfg_pull_none>;
			};

			/*
			 * The data pins are shared between nandc and emmc and
			 * not accessible through pinctrl. Also they should've
			 * been already set correctly by firmware, as
			 * flash/emmc is the boot-device.
			 */
		};

		emac {
			emac_xfer: emac-xfer {
				rockchip,pins = <3 RK_PC0 2 &pcfg_pull_none>, /* tx_en */
						<3 RK_PC1 2 &pcfg_pull_none>, /* txd1 */
						<3 RK_PC2 2 &pcfg_pull_none>, /* txd0 */
						<3 RK_PC3 2 &pcfg_pull_none>, /* rxd0 */
						<3 RK_PC4 2 &pcfg_pull_none>, /* rxd1 */
						<3 RK_PC5 2 &pcfg_pull_none>, /* mac_clk */
						<3 RK_PC6 2 &pcfg_pull_none>, /* rx_err */
						<3 RK_PC7 2 &pcfg_pull_none>; /* crs_dvalid */
			};

			emac_mdio: emac-mdio {
				rockchip,pins = <3 RK_PD0 2 &pcfg_pull_none>,
						<3 RK_PD1 2 &pcfg_pull_none>;
			};
		};

		i2c0 {
			i2c0_xfer: i2c0-xfer {
				rockchip,pins = <1 RK_PD0 1 &pcfg_pull_none>,
						<1 RK_PD1 1 &pcfg_pull_none>;
			};
		};

		i2c1 {
			i2c1_xfer: i2c1-xfer {
				rockchip,pins = <1 RK_PD2 1 &pcfg_pull_none>,
						<1 RK_PD3 1 &pcfg_pull_none>;
			};
		};

		i2c2 {
			i2c2_xfer: i2c2-xfer {
				rockchip,pins = <1 RK_PD4 1 &pcfg_pull_none>,
						<1 RK_PD5 1 &pcfg_pull_none>;
			};
		};

		i2c3 {
			i2c3_xfer: i2c3-xfer {
				rockchip,pins = <3 RK_PB6 2 &pcfg_pull_none>,
						<3 RK_PB7 2 &pcfg_pull_none>;
			};
		};

		i2c4 {
			i2c4_xfer: i2c4-xfer {
				rockchip,pins = <1 RK_PD6 1 &pcfg_pull_none>,
						<1 RK_PD7 1 &pcfg_pull_none>;
			};
		};

		lcdc1 {
			lcdc1_dclk: lcdc1-dclk {
				rockchip,pins = <2 RK_PD0 1 &pcfg_pull_none>;
			};

			lcdc1_den: lcdc1-den {
				rockchip,pins = <2 RK_PD1 1 &pcfg_pull_none>;
			};

			lcdc1_hsync: lcdc1-hsync {
				rockchip,pins = <2 RK_PD2 1 &pcfg_pull_none>;
			};

			lcdc1_vsync: lcdc1-vsync {
				rockchip,pins = <2 RK_PD3 1 &pcfg_pull_none>;
			};

			lcdc1_rgb24: lcdc1-rgb24 {
				rockchip,pins = <2 RK_PA0 1 &pcfg_pull_none>,
						<2 RK_PA1 1 &pcfg_pull_none>,
						<2 RK_PA2 1 &pcfg_pull_none>,
						<2 RK_PA3 1 &pcfg_pull_none>,
						<2 RK_PA4 1 &pcfg_pull_none>,
						<2 RK_PA5 1 &pcfg_pull_none>,
						<2 RK_PA6 1 &pcfg_pull_none>,
						<2 RK_PA7 1 &pcfg_pull_none>,
						<2 RK_PB0 1 &pcfg_pull_none>,
						<2 RK_PB1 1 &pcfg_pull_none>,
						<2 RK_PB2 1 &pcfg_pull_none>,
						<2 RK_PB3 1 &pcfg_pull_none>,
						<2 RK_PB4 1 &pcfg_pull_none>,
						<2 RK_PB5 1 &pcfg_pull_none>,
						<2 RK_PB6 1 &pcfg_pull_none>,
						<2 RK_PB7 1 &pcfg_pull_none>,
						<2 RK_PC0 1 &pcfg_pull_none>,
						<2 RK_PC1 1 &pcfg_pull_none>,
						<2 RK_PC2 1 &pcfg_pull_none>,
						<2 RK_PC3 1 &pcfg_pull_none>,
						<2 RK_PC4 1 &pcfg_pull_none>,
						<2 RK_PC5 1 &pcfg_pull_none>,
						<2 RK_PC6 1 &pcfg_pull_none>,
						<2 RK_PC7 1 &pcfg_pull_none>;
			};
		};

		pwm0 {
			pwm0_out: pwm0-out {
				rockchip,pins = <3 RK_PD3 1 &pcfg_pull_none>;
			};
		};

		pwm1 {
			pwm1_out: pwm1-out {
				rockchip,pins = <3 RK_PD4 1 &pcfg_pull_none>;
			};
		};

		pwm2 {
			pwm2_out: pwm2-out {
				rockchip,pins = <3 RK_PD5 1 &pcfg_pull_none>;
			};
		};

		pwm3 {
			pwm3_out: pwm3-out {
				rockchip,pins = <3 RK_PD6 1 &pcfg_pull_none>;
			};
		};

		spi0 {
			spi0_clk: spi0-clk {
				rockchip,pins = <1 RK_PA6 2 &pcfg_pull_up>;
			};
			spi0_cs0: spi0-cs0 {
				rockchip,pins = <1 RK_PA7 2 &pcfg_pull_up>;
			};
			spi0_tx: spi0-tx {
				rockchip,pins = <1 RK_PA5 2 &pcfg_pull_up>;
			};
			spi0_rx: spi0-rx {
				rockchip,pins = <1 RK_PA4 2 &pcfg_pull_up>;
			};
			spi0_cs1: spi0-cs1 {
				rockchip,pins = <1 RK_PB7 1 &pcfg_pull_up>;
			};
		};

		spi1 {
			spi1_clk: spi1-clk {
				rockchip,pins = <0 RK_PD6 1 &pcfg_pull_up>;
			};
			spi1_cs0: spi1-cs0 {
				rockchip,pins = <0 RK_PD7 1 &pcfg_pull_up>;
			};
			spi1_rx: spi1-rx {
				rockchip,pins = <0 RK_PD4 1 &pcfg_pull_up>;
			};
			spi1_tx: spi1-tx {
				rockchip,pins = <0 RK_PD5 1 &pcfg_pull_up>;
			};
			spi1_cs1: spi1-cs1 {
				rockchip,pins = <1 RK_PB6 2 &pcfg_pull_up>;
			};
		};

		uart0 {
			uart0_xfer: uart0-xfer {
				rockchip,pins = <1 RK_PA0 1 &pcfg_pull_up>,
						<1 RK_PA1 1 &pcfg_pull_none>;
			};

			uart0_cts: uart0-cts {
				rockchip,pins = <1 RK_PA2 1 &pcfg_pull_none>;
			};

			uart0_rts: uart0-rts {
				rockchip,pins = <1 RK_PA3 1 &pcfg_pull_none>;
			};
		};

		uart1 {
			uart1_xfer: uart1-xfer {
				rockchip,pins = <1 RK_PA4 1 &pcfg_pull_up>,
						<1 RK_PA5 1 &pcfg_pull_none>;
			};

			uart1_cts: uart1-cts {
				rockchip,pins = <1 RK_PA6 1 &pcfg_pull_none>;
			};

			uart1_rts: uart1-rts {
				rockchip,pins = <1 RK_PA7 1 &pcfg_pull_none>;
			};
		};

		uart2 {
			uart2_xfer: uart2-xfer {
				rockchip,pins = <1 RK_PB0 1 &pcfg_pull_up>,
						<1 RK_PB1 1 &pcfg_pull_none>;
			};
			/* no rts / cts for uart2 */
		};

		uart3 {
			uart3_xfer: uart3-xfer {
				rockchip,pins = <1 RK_PB2 1 &pcfg_pull_up>,
						<1 RK_PB3 1 &pcfg_pull_none>;
			};

			uart3_cts: uart3-cts {
				rockchip,pins = <1 RK_PB4 1 &pcfg_pull_none>;
			};

			uart3_rts: uart3-rts {
				rockchip,pins = <1 RK_PB5 1 &pcfg_pull_none>;
			};
		};

		sd0 {
			sd0_clk: sd0-clk {
				rockchip,pins = <3 RK_PA2 1 &pcfg_pull_none>;
			};

			sd0_cmd: sd0-cmd {
				rockchip,pins = <3 RK_PA3 1 &pcfg_pull_none>;
			};

			sd0_cd: sd0-cd {
				rockchip,pins = <3 RK_PB0 1 &pcfg_pull_none>;
			};

			sd0_wp: sd0-wp {
				rockchip,pins = <3 RK_PB1 1 &pcfg_pull_none>;
			};

			sd0_pwr: sd0-pwr {
				rockchip,pins = <3 RK_PA1 1 &pcfg_pull_none>;
			};

			sd0_bus1: sd0-bus-width1 {
				rockchip,pins = <3 RK_PA4 1 &pcfg_pull_none>;
			};

			sd0_bus4: sd0-bus-width4 {
				rockchip,pins = <3 RK_PA4 1 &pcfg_pull_none>,
						<3 RK_PA5 1 &pcfg_pull_none>,
						<3 RK_PA6 1 &pcfg_pull_none>,
						<3 RK_PA7 1 &pcfg_pull_none>;
			};
		};

		sd1 {
			sd1_clk: sd1-clk {
				rockchip,pins = <3 RK_PC5 1 &pcfg_pull_none>;
			};

			sd1_cmd: sd1-cmd {
				rockchip,pins = <3 RK_PC0 1 &pcfg_pull_none>;
			};

			sd1_cd: sd1-cd {
				rockchip,pins = <3 RK_PC6 1 &pcfg_pull_none>;
			};

			sd1_wp: sd1-wp {
				rockchip,pins = <3 RK_PC7 1 &pcfg_pull_none>;
			};

			sd1_bus1: sd1-bus-width1 {
				rockchip,pins = <3 RK_PC1 1 &pcfg_pull_none>;
			};

			sd1_bus4: sd1-bus-width4 {
				rockchip,pins = <3 RK_PC1 1 &pcfg_pull_none>,
						<3 RK_PC2 1 &pcfg_pull_none>,
						<3 RK_PC3 1 &pcfg_pull_none>,
						<3 RK_PC4 1 &pcfg_pull_none>;
			};
		};

		i2s0 {
			i2s0_bus: i2s0-bus {
				rockchip,pins = <1 RK_PC0 1 &pcfg_pull_none>,
						<1 RK_PC1 1 &pcfg_pull_none>,
						<1 RK_PC2 1 &pcfg_pull_none>,
						<1 RK_PC3 1 &pcfg_pull_none>,
						<1 RK_PC4 1 &pcfg_pull_none>,
						<1 RK_PC5 1 &pcfg_pull_none>;
			};
		};

		spdif {
			spdif_tx: spdif-tx {
				rockchip,pins = <1 RK_PB6 1 &pcfg_pull_none>;
			};
		};
	};
};

&emac {
	compatible = "rockchip,rk3188-emac";
};

&global_timer {
	interrupts = <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
};

&local_timer {
	interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
};

&gpu {
	compatible = "rockchip,rk3188-mali", "arm,mali-400";
	interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
		     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
	interrupt-names = "gp",
			  "gpmmu",
			  "pp0",
			  "ppmmu0",
			  "pp1",
			  "ppmmu1",
			  "pp2",
			  "ppmmu2",
			  "pp3",
			  "ppmmu3";
	power-domains = <&power RK3188_PD_GPU>;
};

&grf {
	compatible = "rockchip,rk3188-grf", "syscon", "simple-mfd";

	io_domains: io-domains {
		compatible = "rockchip,rk3188-io-voltage-domain";
		status = "disabled";
	};

	usbphy: usbphy {
		compatible = "rockchip,rk3188-usb-phy";
		#address-cells = <1>;
		#size-cells = <0>;
		status = "disabled";

		usbphy0: usb-phy@10c {
			reg = <0x10c>;
			clocks = <&cru SCLK_OTGPHY0>;
			clock-names = "phyclk";
			#clock-cells = <0>;
			#phy-cells = <0>;
		};

		usbphy1: usb-phy@11c {
			reg = <0x11c>;
			clocks = <&cru SCLK_OTGPHY1>;
			clock-names = "phyclk";
			#clock-cells = <0>;
			#phy-cells = <0>;
		};
	};
};

&i2c0 {
	compatible = "rockchip,rk3188-i2c";
	pinctrl-names = "default";
	pinctrl-0 = <&i2c0_xfer>;
};

&i2c1 {
	compatible = "rockchip,rk3188-i2c";
	pinctrl-names = "default";
	pinctrl-0 = <&i2c1_xfer>;
};

&i2c2 {
	compatible = "rockchip,rk3188-i2c";
	pinctrl-names = "default";
	pinctrl-0 = <&i2c2_xfer>;
};

&i2c3 {
	compatible = "rockchip,rk3188-i2c";
	pinctrl-names = "default";
	pinctrl-0 = <&i2c3_xfer>;
};

&i2c4 {
	compatible = "rockchip,rk3188-i2c";
	pinctrl-names = "default";
	pinctrl-0 = <&i2c4_xfer>;
};

&pmu {
	power: power-controller {
		compatible = "rockchip,rk3188-power-controller";
		#power-domain-cells = <1>;
		#address-cells = <1>;
		#size-cells = <0>;

		power-domain@RK3188_PD_VIO {
			reg = <RK3188_PD_VIO>;
			clocks = <&cru ACLK_LCDC0>,
				 <&cru ACLK_LCDC1>,
				 <&cru DCLK_LCDC0>,
				 <&cru DCLK_LCDC1>,
				 <&cru HCLK_LCDC0>,
				 <&cru HCLK_LCDC1>,
				 <&cru SCLK_CIF0>,
				 <&cru ACLK_CIF0>,
				 <&cru HCLK_CIF0>,
				 <&cru ACLK_IPP>,
				 <&cru HCLK_IPP>,
				 <&cru ACLK_RGA>,
				 <&cru HCLK_RGA>;
			pm_qos = <&qos_lcdc0>,
				 <&qos_lcdc1>,
				 <&qos_cif0>,
				 <&qos_ipp>,
				 <&qos_rga>;
			#power-domain-cells = <0>;
		};

		power-domain@RK3188_PD_VIDEO {
			reg = <RK3188_PD_VIDEO>;
			clocks = <&cru ACLK_VDPU>,
				 <&cru ACLK_VEPU>,
				 <&cru HCLK_VDPU>,
				 <&cru HCLK_VEPU>;
			pm_qos = <&qos_vpu>;
			#power-domain-cells = <0>;
		};

		power-domain@RK3188_PD_GPU {
			reg = <RK3188_PD_GPU>;
			clocks = <&cru ACLK_GPU>;
			pm_qos = <&qos_gpu>;
			#power-domain-cells = <0>;
		};
	};
};

&pwm0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm0_out>;
};

&pwm1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm1_out>;
};

&pwm2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm2_out>;
};

&pwm3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm3_out>;
};

&spi0 {
	compatible = "rockchip,rk3188-spi", "rockchip,rk3066-spi";
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_clk &spi0_tx &spi0_rx &spi0_cs0>;
};

&spi1 {
	compatible = "rockchip,rk3188-spi", "rockchip,rk3066-spi";
	pinctrl-names = "default";
	pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0>;
};

&uart0 {
	compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart";
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_xfer>;
};

&uart1 {
	compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart";
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_xfer>;
};

&uart2 {
	compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart";
	pinctrl-names = "default";
	pinctrl-0 = <&uart2_xfer>;
};

&uart3 {
	compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart";
	pinctrl-names = "default";
	pinctrl-0 = <&uart3_xfer>;
};

&vpu {
	compatible = "rockchip,rk3188-vpu", "rockchip,rk3066-vpu";
	power-domains = <&power RK3188_PD_VIDEO>;
};

&wdt {
	compatible = "rockchip,rk3188-wdt", "snps,dw-wdt";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

/dts-v1/;

#include "rk322x.dtsi"

/ {
	model = "Rockchip RK3228 Evaluation board";
	compatible = "rockchip,rk3228-evb", "rockchip,rk3228";

	aliases {
		mmc0 = &emmc;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x40000000>;
	};

	vcc_phy: vcc-phy-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		regulator-name = "vcc_phy";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
		regulator-boot-on;
	};
};

&emmc {
	cap-mmc-highspeed;
	mmc-ddr-1_8v;
	disable-wp;
	non-removable;
	status = "okay";
};

&gmac {
	assigned-clocks = <&cru SCLK_MAC_SRC>;
	assigned-clock-rates = <50000000>;
	clock_in_out = "output";
	phy-supply = <&vcc_phy>;
	phy-mode = "rmii";
	phy-handle = <&phy>;
	status = "okay";

	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;

		phy: ethernet-phy@0 {
			compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22";
			reg = <0>;
			clocks = <&cru SCLK_MAC_PHY>;
			resets = <&cru SRST_MACPHY>;
			phy-is-integrated;
		};
	};
};

&tsadc {
	status = "okay";

	rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
	rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
};

&uart2 {
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

/dts-v1/;

#include <dt-bindings/input/input.h>
#include "rk3229.dtsi"

/ {
	model = "Rockchip RK3229 Evaluation board";
	compatible = "rockchip,rk3229-evb", "rockchip,rk3229";

	aliases {
		mmc0 = &emmc;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x40000000>;
	};

	dc_12v: dc-12v-regulator {
		compatible = "regulator-fixed";
		regulator-name = "dc_12v";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
	};

	ext_gmac: ext_gmac {
		compatible = "fixed-clock";
		clock-frequency = <125000000>;
		clock-output-names = "ext_gmac";
		#clock-cells = <0>;
	};

	vcc_host: vcc-host-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&host_vbus_drv>;
		regulator-name = "vcc_host";
		regulator-always-on;
		regulator-boot-on;
		vin-supply = <&vcc_sys>;
	};

	vcc_phy: vcc-phy-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		regulator-name = "vcc_phy";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
		regulator-boot-on;
		vin-supply = <&vccio_1v8>;
	};

	vcc_sys: vcc-sys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vcc_sys";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&dc_12v>;
	};

	vccio_1v8: vccio-1v8-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vccio_1v8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
		vin-supply = <&vcc_sys>;
	};

	vccio_3v3: vccio-3v3-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vccio_3v3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
		vin-supply = <&vcc_sys>;
	};

	vdd_arm: vdd-arm-regulator {
		compatible = "pwm-regulator";
		pwms = <&pwm1 0 25000 1>;
		pwm-supply = <&vcc_sys>;
		regulator-name = "vdd_arm";
		regulator-min-microvolt = <950000>;
		regulator-max-microvolt = <1400000>;
		regulator-always-on;
		regulator-boot-on;
	};

	vdd_log: vdd-log-regulator {
		compatible = "pwm-regulator";
		pwms = <&pwm2 0 25000 1>;
		pwm-supply = <&vcc_sys>;
		regulator-name = "vdd_log";
		regulator-min-microvolt = <1000000>;
		regulator-max-microvolt = <1300000>;
		regulator-always-on;
		regulator-boot-on;
	};

	gpio-keys {
		compatible = "gpio-keys";
		autorepeat;
		pinctrl-names = "default";
		pinctrl-0 = <&pwr_key>;

		power_key: power-key {
			label = "GPIO Key Power";
			gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_POWER>;
			debounce-interval = <100>;
			wakeup-source;
		};
	};
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&cpu1 {
	cpu-supply = <&vdd_arm>;
};

&cpu2 {
	cpu-supply = <&vdd_arm>;
};

&cpu3 {
	cpu-supply = <&vdd_arm>;
};

&emmc {
	cap-mmc-highspeed;
	non-removable;
	status = "okay";
};

&gmac {
	assigned-clocks = <&cru SCLK_MAC_EXTCLK>, <&cru SCLK_MAC>;
	assigned-clock-parents = <&ext_gmac>, <&cru SCLK_MAC_EXTCLK>;
	clock_in_out = "input";
	phy-supply = <&vcc_phy>;
	phy-mode = "rgmii";
	pinctrl-names = "default";
	pinctrl-0 = <&rgmii_pins>;
	snps,reset-gpio = <&gpio2 RK_PD0 GPIO_ACTIVE_LOW>;
	snps,reset-active-low;
	snps,reset-delays-us = <0 10000 1000000>;
	tx_delay = <0x30>;
	rx_delay = <0x10>;
	status = "okay";
};

&io_domains {
	status = "okay";

	vccio1-supply = <&vccio_3v3>;
	vccio2-supply = <&vccio_1v8>;
	vccio4-supply = <&vccio_3v3>;
};

&pinctrl {
	keys {
		pwr_key: pwr-key {
			rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
		};
	};

	usb {
		host_vbus_drv: host-vbus-drv {
			rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pwm1 {
	status = "okay";
};

&pwm2 {
	status = "okay";
};

&tsadc {
	rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
	status = "okay";
};

&uart2 {
	status = "okay";
};

&u2phy0 {
	status = "okay";

	u2phy0_otg: otg-port {
		status = "okay";
	};

	u2phy0_host: host-port {
		phy-supply = <&vcc_host>;
		status = "okay";
	};
};

&u2phy1 {
	status = "okay";

	u2phy1_otg: otg-port {
		phy-supply = <&vcc_host>;
		status = "okay";
	};

	u2phy1_host: host-port {
		phy-supply = <&vcc_host>;
		status = "okay";
	};
};

&usb_host0_ehci {
	status = "okay";
};

&usb_host0_ohci {
	status = "okay";
};

&usb_host1_ehci {
	status = "okay";
};

&usb_host1_ohci {
	status = "okay";
};

&usb_host2_ehci {
	status = "okay";
};

&usb_host2_ohci {
	status = "okay";
};

&usb_otg {
	status = "okay";
};


code:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

/dts-v1/;

#include <dt-bindings/input/input.h>
#include "rk3229.dtsi"

/ {
	model = "Mecer Xtreme Mini S6";
	compatible = "mecer,xms6", "rockchip,rk3229";

	aliases {
		mmc0 = &sdmmc;
		mmc1 = &sdio;
		mmc2 = &emmc;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x40000000>;
	};

	dc_12v: dc-12v-regulator {
		compatible = "regulator-fixed";
		regulator-name = "dc_12v";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
	};

	ext_gmac: ext_gmac {
		compatible = "fixed-clock";
		clock-frequency = <125000000>;
		clock-output-names = "ext_gmac";
		#clock-cells = <0>;
	};

	power-led {
		compatible = "gpio-leds";

		blue_led: led-0 {
			gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};
	};

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio2 26 GPIO_ACTIVE_LOW>,
		              <&gpio2 29 GPIO_ACTIVE_LOW>;
	};

	vcc_host: vcc-host-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&host_vbus_drv>;
		regulator-name = "vcc_host";
		regulator-always-on;
		regulator-boot-on;
		vin-supply = <&vcc_sys>;
	};

	vcc_phy: vcc-phy-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		regulator-name = "vcc_phy";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
		regulator-boot-on;
		vin-supply = <&vccio_1v8>;
	};

	vcc_sys: vcc-sys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vcc_sys";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&dc_12v>;
	};

	vccio_1v8: vccio-1v8-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vccio_1v8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
		vin-supply = <&vcc_sys>;
	};

	vccio_3v3: vccio-3v3-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vccio_3v3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
		vin-supply = <&vcc_sys>;
	};

	vdd_arm: vdd-arm-regulator {
		compatible = "pwm-regulator";
		pwms = <&pwm1 0 25000 1>;
		pwm-supply = <&vcc_sys>;
		regulator-name = "vdd_arm";
		regulator-min-microvolt = <950000>;
		regulator-max-microvolt = <1400000>;
		regulator-always-on;
		regulator-boot-on;
	};

	vdd_log: vdd-log-regulator {
		compatible = "pwm-regulator";
		pwms = <&pwm2 0 25000 1>;
		pwm-supply = <&vcc_sys>;
		regulator-name = "vdd_log";
		regulator-min-microvolt = <1000000>;
		regulator-max-microvolt = <1300000>;
		regulator-always-on;
		regulator-boot-on;
	};
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&cpu1 {
	cpu-supply = <&vdd_arm>;
};

&cpu2 {
	cpu-supply = <&vdd_arm>;
};

&cpu3 {
	cpu-supply = <&vdd_arm>;
};

&emmc {
	cap-mmc-highspeed;
	non-removable;
	status = "okay";
};

&gmac {
	assigned-clocks = <&cru SCLK_MAC_SRC>;
	assigned-clock-rates = <50000000>;
	clock_in_out = "output";
	phy-handle = <&phy>;
	phy-mode = "rmii";
	phy-supply = <&vcc_phy>;
	status = "okay";

	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;

		phy: ethernet-phy@0 {
			compatible = "ethernet-phy-id1234.d400",
			             "ethernet-phy-ieee802.3-c22";
			reg = <0>;
			clocks = <&cru SCLK_MAC_PHY>;
			phy-is-integrated;
			resets = <&cru SRST_MACPHY>;
		};
	};
};

&gpu {
	mali-supply = <&vdd_log>;
	status = "okay";
};

&hdmi {
	status = "okay";
};

&hdmi_phy {
	status = "okay";
};

&iep_mmu {
	status = "okay";
};

&io_domains {
	status = "okay";

	vccio1-supply = <&vccio_3v3>;
	vccio2-supply = <&vccio_1v8>;
	vccio4-supply = <&vccio_3v3>;
};

&pinctrl {
	usb {
		host_vbus_drv: host-vbus-drv {
			rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pwm1 {
	status = "okay";
};

&pwm2 {
	status = "okay";
};

&sdio {
	bus-width = <4>;
	cap-sd-highspeed;
	cap-sdio-irq;
	mmc-pwrseq = <&sdio_pwrseq>;
	non-removable;
	vqmmc-supply = <&vccio_1v8>;
	status = "okay";
};

&sdmmc {
	cap-mmc-highspeed;
	disable-wp;
	status = "okay";
};

&tsadc {
	rockchip,hw-tshut-mode = <0>;
	status = "okay";
};

&u2phy0 {
	status = "okay";

	u2phy0_host: host-port {
		phy-supply = <&vcc_host>;
		status = "okay";
	};

	u2phy0_otg: otg-port {
		phy-supply = <&vcc_host>;
		status = "okay";
	};
};

&u2phy1 {
	status = "okay";

	u2phy1_host: host-port {
		phy-supply = <&vcc_host>;
		status = "okay";
	};

	u2phy1_otg: otg-port {
		phy-supply = <&vcc_host>;
		status = "okay";
	};
};

&uart2 {
	pinctrl-0 = <&uart21_xfer>;
	status = "okay";
};

&usb_host0_ehci {
	status = "okay";
};

&usb_host0_ohci {
	status = "okay";
};

&usb_host1_ehci {
	status = "okay";
};

&usb_host1_ohci {
	status = "okay";
};

&usb_host2_ehci {
	status = "okay";
};

&usb_host2_ohci {
	status = "okay";
};

&usb_otg {
	status = "okay";
};

&vop {
	status = "okay";
};

&vop_mmu {
	status = "okay";
};