RK3288W Android8.1開發日誌(一)

1、板子是參考官方公版設計,SDK版本是RK3288_ANDROID8.1_SDK_20180512;

2、解壓SDK,直接執行source build.sh,再執行./mkimage.sh,燒錄進板子,發現系統正常啓動。

3、設備只有HDMI和LVDS,點LVDS屏,修改屏參,修改文件rk3288-evb-android-rk808-edp.dts;

/dts-v1/;
#include "rk3288-evb.dtsi"
#include "rk3288-android.dtsi"

/ {
	compatible = "rockchip,rk3288-evb-android-rk808-edp", "rockchip,rk3288";

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		clocks = <&rk808 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 = <&gpio4 28 GPIO_ACTIVE_LOW>;
	};

	wireless-bluetooth {
		clocks = <&rk808 1>;
		clock-names = "ext_clock";
	};

	/delete-node/ sdmmc-regulator;

	vcc_lcd: vcc-lcd {
		compatible = "regulator-fixed";
		regulator-boot-on;
		enable-active-high;
		gpio = <&gpio7 3 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&lcd_en>;
		regulator-name = "vcc_lcd";
		vin-supply = <&vcc_io>;
	};
};

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

&cif_isp0 {
	status = "okay";
};
&dfi {
	status = "okay";
};

&lvds_in_vopl {
	status = "okay";
};

&lvds_in_vopb {
	status = "disabled";
};


&route_lvds {
	status = "okay";
};

&lvds {
	status = "okay";
};

&lvds_panel {
    status = "okay";
    compatible ="simple-panel";
    backlight = <&backlight>;
    bus-format = <MEDIA_BUS_FMT_RGB888_1X24>;
    power-supply = <&vcc_lcd>;
    delay,disable = <10>;
    enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
    //rockchip,data-mapping = "jeida";
    rockchip,data-mapping = "vesa";
    rockchip,data-width = <24>;
    rockchip,output = "duallvds";

    display-timings {
        native-mode = <&timing0>;
        timing0: timing0 {
                clock-frequency = <148000000>;
                hactive = <1920>;             /* Horizontal display area thd 1024       DCLK            */
                vactive = <1080>;             /* Vertical display area tvd   600        H               */
                hback-porch = <48>;           /* HS Width +Back Porch   160  160   160  DCLK (Thw+ thbp)*/
                hfront-porch = <60>;          /* HS front porch thfp    16   160   216  DCLK            */
                vback-porch = <8>;            /* VS front porch tvfp    1    12    127  H               */
                vfront-porch = <33>;       /* VS Width+Back Porch    23   23    23   H (Tvw+ tvbp)   */
                hsync-len = <32>;             /* HS Pulse Width thw     1     -    140  DCLK            */
                vsync-len = <4>;              /* VS Pulse Width tvw     1     -     20  H               */
                hsync-active = <0>;
                vsync-active = <0>;
                de-active = <0>;
                pixelclk-active = <0>;
        };
    };

};

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

&gmac {
	max-speed = <1000>;
};

&hdmi_analog_sound {
	status = "disabled";
};

&i2c0 {
	clock-frequency = <400000>;

	rk808: pmic@1b {
		compatible = "rockchip,rk808";
		reg = <0x1b>;
		interrupt-parent = <&gpio0>;
		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pmic_int &global_pwroff>;
		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>;
		vcc8-supply = <&vcc_io>;
		vcc9-supply = <&vcc_io>;
		vcc12-supply = <&vcc_io>;
		vddio-supply = <&vccio_pmu>;

		regulators {
			vdd_cpu: DCDC_REG1 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <750000>;
				regulator-max-microvolt = <1400000>;
				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-ramp-delay = <6000>;
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

			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_tp: LDO_REG1 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc_tp";
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

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

			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>;
				};
			};

			vcc_wl: LDO_REG4 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc_wl";
				regulator-state-mem {
					regulator-on-in-suspend;
				};
			};

			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-off-in-suspend;
				};
			};

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

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

			vcc18_lcd: LDO_REG8 {
				regulator-always-on;
				regulator-boot-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc18_lcd";
				regulator-state-mem {
					regulator-off-in-suspend;
				};
			};

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

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

	CW2015@62 {
		compatible = "cw201x";
		reg = <0x62>;
		bat_low_gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
		dc_det_gpio = <&gpio0 8 GPIO_ACTIVE_LOW>;
		chg_ok_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
		bat_config_info = <0x15 0x42 0x60 0x59 0x52 0x58 0x4D 0x48 0x48 0x44 0x44 0x46 0x49 0x48 0x32
			0x24 0x20 0x17 0x13 0x0F 0x19 0x3E 0x51 0x45 0x08 0x76 0x0B 0x85 0x0E 0x1C 0x2E 0x3E 0x4D 0x52 0x52
			0x57 0x3D 0x1B 0x6A 0x2D 0x25 0x43 0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92 0x96 0xFF 0x7B 0xBB
			0xCB 0x2F 0x7D 0x72 0xA5 0xB5 0xC1 0x46 0xAE>;
		is_dc_charge = <1>;
		is_usb_charge = <0>;
		monitor_sec = <5>;
		virtual_power = <0>;
		divider_res1 = <200>;
		divider_res2 = <200>;
	};
};

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

	mpu6050@68 {
		compatible = "invensense,mpu6050";
		status = "okay";
		pinctrl-names = "default";
		pinctrl-0 = <&mpu6050_irq_gpio>;
		reg = <0x68>;
		irq-gpio = <&gpio8 0 IRQ_TYPE_EDGE_RISING>;
		mpu-int_config = <0x10>;
		mpu-level_shifter = <0>;
		mpu-orientation = <0 1 0 1 0 0 0 0 1>;
		orientation-x= <0>;
		orientation-y= <0>;
		orientation-z= <1>;
		support-hw-poweroff = <0>;
		mpu-debug = <1>;
	};

	ak8963:compass@0d{
		compatible = "mpu_ak8963";
		reg = <0x0d>;
		compass-bus = <0>;
		compass-adapt_num = <0>;
		compass-orientation = <1 0 0 0 1 0 0 0 1>;
		orientation-x= <0>;
		orientation-y= <0>;
		orientation-z= <1>;
		compass-debug = <1>;
		status = "okay";
	};
};

&io_domains {
	status = "okay";
	audio-supply = <&vcc_io>;
	bb-supply = <&vcc_io>;
	dvp-supply = <&vcc_io>;
	flash0-supply = <&vcc_18>;
	flash1-supply = <&vcc_io>;
	gpio30-supply = <&vcc_io>;
	gpio1830 = <&vcc_io>;
	lcdc-supply = <&vcc_lcd>;
	sdcard-supply = <&vccio_sd>;
	wifi-supply = <&vcc_wl>;
};


&rockchip_suspend {
	status = "okay";
	rockchip,pwm-regulator-config = <
	(0
	| PWM1_REGULATOR_EN
	)
	>;
};

&pwm1 {
	status = "okay";
	pinctrl-names = "active";
	pinctrl-0 = <&pwm1_pin_pull_down>;
};

&pinctrl {
	lcd {
		lcd_en: lcd-en  {
			rockchip,pins = <7 3 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
	mpu6050 {
		mpu6050_irq_gpio: mpu6050-irq-gpio {
			rockchip,pins = <8 0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

4、燒錄進去,完美點亮;

5、系統默認顯示中文;

alps\device\rockchip\rk3288\device.mk 添加以下代碼:

PRODUCT_PROPERTY_OVERRIDES += \
            persist.sys.timezone=Asia/Shanghai\
            persist.sys.language=zh\
            persist.sys.country=CN\

6、修改屏幕密度

ro.sf.lcd_density=160

7、關閉節能模式

alps\frameworks\packages\SettingsProvider\res\values\defaults.xml

<bool name="def_dim_screen">false</bool>

8、設置屏幕永不休眠;

alps\frameworks\packages\SettingsProvider\res\values\defaults.xml

    <integer name="def_screen_off_timeout">-1</integer>
    <integer name="def_sleep_timeout">-1</integer>

發覺改動無效。。。。。。。

下班,下週繼續,查看源代碼。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章