Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
 */

/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/input/input.h>
#include "px30-robot-no-gpu.dtsi"

/ {
	model = "Rockchip rk3326 evb lpddr3 v10 board for robot linux";
	compatible = "rockchip,rk3326-evb-lp3-v10-robot-linux", "rockchip,rk3326";

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

		esc-key {
			linux,code = <KEY_ESC>;
			label = "esc";
			press-threshold-microvolt = <1310000>;
		};

		home-key {
			linux,code = <KEY_HOME>;
			label = "home";
			press-threshold-microvolt = <624000>;
		};

		menu-key {
			linux,code = <KEY_MENU>;
			label = "menu";
			press-threshold-microvolt = <987000>;
		};

		vol-down-key {
			linux,code = <KEY_VOLUMEDOWN>;
			label = "volume down";
			press-threshold-microvolt = <300000>;
		};

		vol-up-key {
			linux,code = <KEY_VOLUMEUP>;
			label = "volume up";
			press-threshold-microvolt = <17000>;
		};
	};

	rk817-sound {
		compatible = "simple-audio-card";
		simple-audio-card,format = "i2s";
		simple-audio-card,name = "rockchip,rk817-codec";
		simple-audio-card,mclk-fs = <256>;
		simple-audio-card,cpu {
			sound-dai = <&i2s1_2ch>;
		};
		simple-audio-card,codec {
			sound-dai = <&rk817_codec>;
		};
	};

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		/*clocks = <&rk817 1>;*/
		/*clock-names = "ext_clock";*/
		pinctrl-names = "default";
		pinctrl-0 = <&wifi_enable_h>;

		/*
		 * On the module itself this is one of these (depending
		 * on the actual card populated):
		 * - SDIO_RESET_L_WL_REG_ON
		 * - PDN (power down when low)
		 */
		reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>; /* GPIO3_A4 */
	};

	vccsys: vccsys {
		compatible = "regulator-fixed";
		regulator-name = "vcc3v8_sys";
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <3800000>;
		regulator-max-microvolt = <3800000>;
	};

	wireless-wlan {
		compatible = "wlan-platdata";
		wifi_chip_type = "AP6210";
		WIFI,host_wake_irq = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>;
		status = "okay";
	};
};

&bus_apll {
	bus-supply = <&vdd_logic>;
	status = "okay";
};

&cif_new {
	status = "okay";

	port {
		cif_in: endpoint {
			remote-endpoint = <&gc2155_out>;
			vsync-active = <0>;
			hsync-active = <1>;
		};
	};
};

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

&dfi {
	status = "okay";
};

&dmc {
	center-supply = <&vdd_logic>;
	status = "okay";
};

&emmc {
	bus-width = <8>;
	cap-mmc-highspeed;
	mmc-hs200-1_8v;
	no-sdio;
	no-sd;
	disable-wp;
	non-removable;
	num-slots = <1>;
	status = "okay";
};

&i2c0 {
	status = "okay";
	clock-frequency = <400000>;
	i2c-scl-rising-time-ns = <280>;
	i2c-scl-falling-time-ns = <16>;

	rk817: pmic@20 {
		compatible = "rockchip,rk817";
		reg = <0x20>;
		interrupt-parent = <&gpio0>;
		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default", "pmic-sleep",
				"pmic-power-off", "pmic-reset";
		pinctrl-0 = <&pmic_int>;
		pinctrl-1 = <&soc_slppin_slp>, <&rk817_slppin_slp>;
		pinctrl-2 = <&soc_slppin_gpio>, <&rk817_slppin_pwrdn>;
		pinctrl-3 = <&soc_slppin_rst>, <&rk817_slppin_rst>;
		rockchip,system-power-controller;
		wakeup-source;
		#clock-cells = <1>;
		clock-output-names = "rk808-clkout1", "rk808-clkout2";
		//fb-inner-reg-idxs = <2>;
		/* 1: rst regs (default in codes), 0: rst the pmic */
		pmic-reset-func = <1>;

		vcc1-supply = <&vccsys>;
		vcc2-supply = <&vccsys>;
		vcc3-supply = <&vccsys>;
		vcc4-supply = <&vccsys>;
		vcc5-supply = <&vccsys>;
		vcc6-supply = <&vccsys>;
		vcc7-supply = <&vcc_3v0>;
		vcc8-supply = <&vccsys>;
		vcc9-supply = <&dcdc_boost>;

		pwrkey {
			status = "okay";
		};

		pinctrl_rk8xx: pinctrl_rk8xx {
			gpio-controller;
			#gpio-cells = <2>;

			rk817_ts_gpio1: rk817_ts_gpio1 {
				pins = "gpio_ts";
				function = "pin_fun1";
				/* output-low; */
				/* input-enable; */
			};

			rk817_gt_gpio2: rk817_gt_gpio2 {
				pins = "gpio_gt";
				function = "pin_fun1";
			};

			rk817_pin_ts: rk817_pin_ts {
				pins = "gpio_ts";
				function = "pin_fun0";
			};

			rk817_pin_gt: rk817_pin_gt {
				pins = "gpio_gt";
				function = "pin_fun0";
			};

			rk817_slppin_null: rk817_slppin_null {
				pins = "gpio_slp";
				function = "pin_fun0";
			};

			rk817_slppin_slp: rk817_slppin_slp {
				pins = "gpio_slp";
				function = "pin_fun1";
			};

			rk817_slppin_pwrdn: rk817_slppin_pwrdn {
				pins = "gpio_slp";
				function = "pin_fun2";
			};

			rk817_slppin_rst: rk817_slppin_rst {
				pins = "gpio_slp";
				function = "pin_fun3";
			};
		};

		regulators {
			vdd_logic: DCDC_REG1 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <850000>;
				regulator-max-microvolt = <1350000>;
				regulator-ramp-delay = <6001>;
				regulator-initial-mode = <0x2>;
				regulator-name = "vdd_logic";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <950000>;
				};
			};

			vdd_arm: DCDC_REG2 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <850000>;
				regulator-max-microvolt = <1350000>;
				regulator-ramp-delay = <6001>;
				regulator-initial-mode = <0x2>;
				regulator-name = "vdd_arm";
				regulator-state-mem {
					regulator-off-in-suspend;
					regulator-suspend-microvolt = <950000>;
				};
			};

			vcc_ddr: DCDC_REG3 {
				regulator-always-on;
				regulator-boot-on;
				regulator-initial-mode = <0x2>;
				regulator-name = "vcc_ddr";
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			vcc_3v0: DCDC_REG4 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;
				regulator-initial-mode = <0x2>;
				regulator-name = "vcc_3v0";
				regulator-state-mem {
					regulator-off-in-suspend;
					regulator-suspend-microvolt = <3000000>;
				};
			};

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

			vcc1v8_soc: LDO_REG2 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;

				regulator-name = "vcc1v8_soc";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1800000>;
				};
			};

			vdd1v0_soc: LDO_REG3 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;

				regulator-name = "vcc1v0_soc";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1000000>;
				};
			};

			vcc3v0_pmu: LDO_REG4 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <3000000>;

				regulator-name = "vcc3v0_pmu";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3000000>;

				};
			};

			vccio_sd: LDO_REG5 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;

				regulator-name = "vccio_sd";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3300000>;
				};
			};

			vcc_sd: LDO_REG6 {
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;

				regulator-name = "vcc_sd";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <3300000>;

				};
			};

			vcc2v8_dvp: LDO_REG7 {
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2800000>;

				regulator-name = "vcc2v8_dvp";
				regulator-state-mem {
					regulator-off-in-suspend;
					regulator-suspend-microvolt = <2800000>;
				};
			};

			vcc1v8_dvp: LDO_REG8 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;

				regulator-name = "vcc1v8_dvp";
				regulator-state-mem {
					regulator-on-in-suspend;
					regulator-suspend-microvolt = <1800000>;
				};
			};

			vdd1v5_dvp: LDO_REG9 {
				regulator-min-microvolt = <1500000>;
				regulator-max-microvolt = <1500000>;

				regulator-name = "vdd1v5_dvp";
				regulator-state-mem {
					regulator-off-in-suspend;
					regulator-suspend-microvolt = <1500000>;
				};
			};

			dcdc_boost: BOOST {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <4700000>;
				regulator-max-microvolt = <5400000>;
				regulator-name = "boost";
			};

			otg_switch: OTG_SWITCH {
				regulator-name = "otg_switch";
			};
		};

		battery {
			compatible = "rk817,battery";
			ocv_table = <3500 3625 3685 3697 3718 3735 3748
			3760 3774 3788 3802 3816 3834 3853
			3877 3908 3946 3975 4018 4071 4106>;
			design_capacity = <2500>;
			design_qmax = <2750>;
			bat_res = <100>;
			sleep_enter_current = <300>;
			sleep_exit_current = <300>;
			sleep_filter_current = <100>;
			power_off_thresd = <3500>;
			zero_algorithm_vol = <3850>;
			max_soc_offset = <60>;
			monitor_sec = <5>;
			sample_res = <10>;
			virtual_power = <1>;
		};

		charger {
			compatible = "rk817,charger";
			min_input_voltage = <4500>;
			max_input_current = <1500>;
			max_chrg_current = <2000>;
			max_chrg_voltage = <4200>;
			chrg_term_mode = <0>;
			chrg_finish_cur = <300>;
			virtual_power = <0>;
			dc_det_adc = <0>;
			extcon = <&u2phy>;
		};

		rk817_codec: codec {
			#sound-dai-cells = <0>;
			compatible = "rockchip,rk817-codec";
			clocks = <&cru SCLK_I2S1_OUT>;
			clock-names = "mclk";
			pinctrl-names = "default";
			pinctrl-0 = <&i2s1_2ch_mclk>;
			hp-volume = <20>;
			spk-volume = <3>;
			status = "okay";
		};
	};
};

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

	/* 24M mclk is shared for multiple cameras */
	pinctrl-0 = <&i2c2_xfer &cif_clkout_m0>;

	/* These are relatively safe rise/fall times; TODO: measure */
	i2c-scl-falling-time-ns = <50>;
	i2c-scl-rising-time-ns = <300>;

	gc2155: gc2155@3c {
		compatible = "gc,gc2155";
		reg = <0x3c>;
		pinctrl-names = "default";
		pinctrl-0 = <&cif_pin_m0>;

		clocks = <&cru SCLK_CIF_OUT>;
		clock-names = "xvclk";

		avdd-supply = <&vcc2v8_dvp>;
		dovdd-supply = <&vcc1v8_dvp>;
		dvdd-supply = <&vcc1v8_dvp>;

		/* hw changed the pwdn to gpio2_b5 */
		pwdn-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;

		port {
			gc2155_out: endpoint {
				remote-endpoint = <&cif_in>;
			};
		};
	};

	ov5695: ov5695@36 {
		compatible = "ovti,ov5695";
		reg = <0x36>;

		clocks = <&cru SCLK_CIF_OUT>;
		clock-names = "xvclk";

		avdd-supply = <&vcc2v8_dvp>;
		dovdd-supply = <&vcc1v8_dvp>;
		dvdd-supply = <&vcc1v8_dvp>;

		/*reset-gpios = <&gpio2 14 GPIO_ACTIVE_HIGH>;*/
		pwdn-gpios = <&gpio2 14 GPIO_ACTIVE_HIGH>;

		port {
			ucam_out: endpoint {
				remote-endpoint = <&mipi_in_ucam>;
				data-lanes = <1 2>;
			};
		};
	};
};

&i2s1_2ch {
	status = "okay";
	#sound-dai-cells = <0>;
};

&io_domains {
	status = "okay";

	vccio1-supply = <&vcc1v8_soc>;
	vccio2-supply = <&vccio_sd>;
	vccio3-supply = <&vcc1v8_dvp>;
	vccio4-supply = <&vcc_3v0>;
	vccio5-supply = <&vcc_3v0>;
};

&isp_mmu {
	status = "okay";
};

&mipi_dphy_rx0 {
	status = "okay";

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

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

			mipi_in_ucam: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&ucam_out>;
				data-lanes = <1 2>;
			};
		};

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

			dphy_rx0_out: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&isp0_mipi_in>;
			};
		};
	};
};

&nandc0 {
	status = "okay";
};

&rkisp1 {
	status = "okay";

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

		isp0_mipi_in: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&dphy_rx0_out>;
		};
	};
};

&pmu_io_domains {
	status = "okay";

	pmuio1-supply = <&vcc3v0_pmu>;
	pmuio2-supply = <&vcc3v0_pmu>;
};

&rk_rga {
	status = "okay";
};

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

&sdmmc {
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	no-sdio;
	no-mmc;
	card-detect-delay = <800>;
	ignore-pm-notify;
	/*cd-gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>; [> CD GPIO <]*/
	sd-uhs-sdr12;
	sd-uhs-sdr25;
	sd-uhs-sdr50;
	sd-uhs-sdr104;
	vqmmc-supply = <&vccio_sd>;
	vmmc-supply = <&vcc_sd>;
	status = "disabled";
};

&sdio {
	bus-width = <4>;
	cap-sd-highspeed;
	no-sd;
	no-mmc;
	ignore-pm-notify;
	keep-power-in-suspend;
	non-removable;
	mmc-pwrseq = <&sdio_pwrseq>;
	sd-uhs-sdr104;
	status = "okay";
};

&tsadc {
	pinctrl-names = "init", "default";
	pinctrl-0 = <&tsadc_otp_gpio>;
	pinctrl-1 = <&tsadc_otp_out>;
	status = "okay";
};

&u2phy {
	status = "okay";

	u2phy_host: host-port {
		status = "okay";
	};

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

&usb20_otg {
	status = "okay";
};

&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_xfer &uart1_cts>;
	status = "okay";
};

&vip_mmu {
	status = "okay";
};

&mpp_srv {
	status = "okay";
};

&vdpu {
	status = "okay";
};

&vepu {
	status = "okay";
};

&vpu_mmu {
	status = "okay";
};

&hevc {
	status = "okay";
};

&hevc_mmu {
	status = "okay";
};

&pinctrl {
	cif-pin-m0 {
		cif_pin_m0: cif-pin-m0 {
			rockchip,pins =
				<2 RK_PA0 1 &pcfg_pull_none>,/* cif_data2 */
				<2 RK_PA1 1 &pcfg_pull_none>,/* cif_data3 */
				<2 RK_PA2 1 &pcfg_pull_none>,/* cif_data4 */
				<2 RK_PA3 1 &pcfg_pull_none>,/* cif_data5 */
				<2 RK_PA4 1 &pcfg_pull_none>,/* cif_data6 */
				<2 RK_PA5 1 &pcfg_pull_none>,/* cif_data7 */
				<2 RK_PA6 1 &pcfg_pull_none>,/* cif_data8 */
				<2 RK_PA7 1 &pcfg_pull_none>,/* cif_data9 */
				<2 RK_PB0 1 &pcfg_pull_none>,/* cif_sync */
				<2 RK_PB1 1 &pcfg_pull_none>,/* cif_href */
				<2 RK_PB2 1 &pcfg_pull_none>;/* cif_clkin */
		};
	};

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

		soc_slppin_gpio: soc_slppin_gpio {
			rockchip,pins =
				<0 RK_PA4 RK_FUNC_GPIO &pcfg_output_low>;
		};

		soc_slppin_slp: soc_slppin_slp {
			rockchip,pins =
				<0 RK_PA4 1 &pcfg_pull_none>;
		};

		soc_slppin_rst: soc_slppin_rst {
			rockchip,pins =
				<0 RK_PA4 2 &pcfg_pull_none>;
		};
	};

	sdio-pwrseq {
		wifi_enable_h: wifi-enable-h {
			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

/* DON'T PUT ANYTHING BELOW HERE.  PUT IT ABOVE PINCTRL */
/* DON'T PUT ANYTHING BELOW HERE.  PUT IT ABOVE PINCTRL */
/* DON'T PUT ANYTHING BELOW HERE.  PUT IT ABOVE PINCTRL */