Bootstrap

rk3288_updata

.调屏

1.搭建 	rk3288-evb-android-act8846-edp-avb.dtb \  (与使用的板子向匹配)

2.背光使用pwm1控制

backlight: backlight {
		compatible = "pwm-backlight";
		brightness-levels = <
			  0   1   2   3   4   5   6   7
			  8   9  10  11  12  13  14  15
			 16  17  18  19  20  21  22  23
			 24  25  26  27  28  29  30  31
			 32  33  34  35  36  37  38  39
			 40  41  42  43  44  45  46  47
			 48  49  50  51  52  53  54  55
			 56  57  58  59  60  61  62  63
			 64  65  66  67  68  69  70  71
			 72  73  74  75  76  77  78  79
			 80  81  82  83  84  85  86  87
			 88  89  90  91  92  93  94  95
			 96  97  98  99 100 101 102 103
			104 105 106 107 108 109 110 111
			112 113 114 115 116 117 118 119
			120 121 122 123 124 125 126 127
			128 129 130 131 132 133 134 135
			136 137 138 139 140 141 142 143
			144 145 146 147 148 149 150 151
			152 153 154 155 156 157 158 159
			160 161 162 163 164 165 166 167
			168 169 170 171 172 173 174 175
			176 177 178 179 180 181 182 183
			184 185 186 187 188 189 190 191
			192 193 194 195 196 197 198 199
			200 201 202 203 204 205 206 207
			208 209 210 211 212 213 214 215
			216 217 218 219 220 221 222 223
			224 225 226 227 228 229 230 231
			232 233 234 235 236 237 238 239
			240 241 242 243 244 245 246 247
			248 249 250 251 252 253 254 255>;
		default-brightness-level = <128>;
		//enable-gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		//pinctrl-0 = <&bl_en>;
		pwms = <&pwm1 0 1000000 0>;
	};

3. 配屏

&lvds {
	status = "okay";
};

&lvds_panel {
	compatible = "simple-panel";
	backlight = <&backlight>;
	bus-format = <MEDIA_BUS_FMT_RGB888_1X24>;		
	enable-gpios = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>;
	enable-delay-ms = <120>;
	rockchip,data-mapping = "vesa";
	rockchip,data-width = <24>;
	rockchip,output = "lvds";
	status = "okay";

	disp_timings: display-timings {
		native-mode = <&timing0>;
		timing0: timing0 {
			clock-frequency = <70000000>;
			hactive = <1280>;
			vactive = <800>;
			hback-porch = <100>;
			hfront-porch = <20>;
			vback-porch = <18>;
			vfront-porch = <8>;
			hsync-len = <10>;
			vsync-len = <2>;
			hsync-active = <0>;
			vsync-active = <0>;
			de-active = <0>;
			pixelclk-active = <0>;
		};
	};
};

//显示logo
&route_lvds {
	status = "okay";
};

4.上电时序

&i2c0 {
....
}

5.发现logo并没有显示

\sdk-9.0\u-boot\drivers\video\drm\inno_video_phy.c
+			// status & PLL_LOCK, 10000);
+			status & PLL_LOCK,1000000);

6.旋转屏幕

\sdk-9.0\device\rockchip\rk3288\BoardConfig.mk

# 0/90/180/270
SF_PRIMARY_DISPLAY_ORIENTATION := 0

7.调节像素密度 (图像或按键太大,影响美观,将其调小)

sdk-9.0\device\rockchip\rk3288\device.mk

PRODUCT_PROPERTY_OVERRIDES += \
					.....
                ro.sf.lcd_density=170 \
                    .....

7.触摸

同博文 触摸驱动

8.开机logo闪屏

&dmc {
+	vop-dclk-mode = <1>;
	center-supply = <&vdd_log>;
	status = "okay";
};

二、HDMI调试

1.开机会自动识别分辨率,连接上4k显示器,当其与屏的分辨率不一致时,会发生各种异常。

设置开机默认频率
\sdk-9.0\device\rockchip\rk3288\device.mk
PRODUCT_PROPERTY_OVERRIDES += \
		 vendor.hwc.device.primary=LVDS \
		 vendor.hwc.device.extend=HDMI-A \
		 persist.vendor.resolution.aux=1920x1080p60 

三、音频
1.make ARCH=arm menuconfig  

→ Device Drivers → Sound card support → Advanced Linux Sound Architecture → ALSA for SoC audio support → CODEC drivers→  <*> Everest Semi ES8323 CODEC

确保\sdk-9.0\kernel\arch\arm\configs\rockchip_defconfig 存在如下配置。
 
  CONFIG_SND_SOC_ES8323=y
  CONFIG_SND_SOC_HDMI_CODEC=y


2.
&i2c2 {
		status = "okay";
		es8323: es8323@10 {
		status = "okay";
		compatible = "everest,es8323";
		reg = <0x10>;
		spk-con-gpio = <&gpio7 RK_PB4 GPIO_ACTIVE_HIGH>;						              
		hp-det-gpio = <&gpio7 RK_PB1 GPIO_ACTIVE_HIGH>;
		clock-names = "mclk";
		clocks = <&cru SCLK_I2S0_OUT>;	
		pinctrl-names = "default";
		pinctrl-0 = <&i2s0_mclk>;
		#sound-dai-cells = <0>;	
	};
};

3.修改dts文件相关音频配置,使用es8323.

4.配置驱动寄存器 (修改的部分)

usleep_range(18000, 20000);
	snd_soc_write(codec, 0x02, 0xf3);
	snd_soc_write(codec, 0x2B, 0x80);
	snd_soc_write(codec, 0x08, 0x00);			/* ES8388 salve */
	snd_soc_write(codec, 0x00, 0x32); 	//0x35
	snd_soc_write(codec, 0x01, 0x72);	//0x50	/* PLAYBACK & RECORD Mode,EnRefr=1 */
	snd_soc_write(codec, 0x03, 0x59);			/* pdn_ana=0,ibiasgen_pdn=0 */
	snd_soc_write(codec, 0x05, 0x00);			/* pdn_ana=0,ibiasgen_pdn=0 */
	snd_soc_write(codec, 0x06, 0xc3);	 //0x00			/* pdn_ana=0,ibiasgen_pdn=0 */
	snd_soc_write(codec, 0x07, 0x7c);
	snd_soc_write(codec, 0x09, 0x88);			/* ADC L/R PGA =  +24dB */
	snd_soc_write(codec, 0x0a, 0xfa);	//0xf0	/* ADC INPUT=LIN1/RIN1 */
	snd_soc_write(codec, 0x0b, 0x02);	//0x82	/* ADC INPUT=LIN1/RIN1 */
	snd_soc_write(codec, 0x0C, 0x4c);			/* I2S-24BIT */
	snd_soc_write(codec, 0x0d, 0x02);			/* MCLK/LRCK=256 */
	snd_soc_write(codec, 0x10, 0x66);	//0x00	/* ADC Left Volume=0db */
	snd_soc_write(codec, 0x11, 0x66);	//0x00	/* ADC Right Volume=0db */
	snd_soc_write(codec, 0x12, 0xea);			/* ALC stereo MAXGAIN: 35.5dB,  MINGAIN: +6dB (Record Volume increased!) */
	snd_soc_write(codec, 0x13, 0xc0);
	snd_soc_write(codec, 0x14, 0x05);
	snd_soc_write(codec, 0x15, 0x06);
	snd_soc_write(codec, 0x16, 0x53);
	snd_soc_write(codec, 0x17, 0x18);			/* I2S-16BIT */
	snd_soc_write(codec, 0x18, 0x02);
	snd_soc_write(codec, 0x1A, 0x00);	//0x0A	/* DAC VOLUME=0DB */
	snd_soc_write(codec, 0x1B, 0x00); 	//0x0A
	snd_soc_write(codec, 0x26, 0x12);			/* Left DAC TO Left IXER */
	snd_soc_write(codec, 0x27, 0xb8);			/* Left DAC TO Left MIXER */
	snd_soc_write(codec, 0x28, 0x38);
	snd_soc_write(codec, 0x29, 0xb8); 	//0x38
	snd_soc_write(codec, 0x2A, 0xb8);
	snd_soc_write(codec, 0x02, 0x00);			/* START DLL and state-machine,START DSM */
	snd_soc_write(codec, 0x19, 0x02);			/* SOFT RAMP RATE=32LRCKS/STEP,Enable ZERO-CROSS CHECK,DAC MUTE */
	snd_soc_write(codec, 0x04, 0x0c);			/* pdn_ana=0,ibiasgen_pdn=0 */
	usleep_range(18000, 20000);
	snd_soc_write(codec, 0x2e, 0x00);
	snd_soc_write(codec, 0x2f, 0x00);
	snd_soc_write(codec, 0x30, 0x08);
	snd_soc_write(codec, 0x31, 0x08);
	usleep_range(18000, 20000);
	snd_soc_write(codec, 0x30, 0x0f);
	snd_soc_write(codec, 0x31, 0x0f);
	usleep_range(18000, 20000);
	snd_soc_write(codec, 0x30, 0x18);
	snd_soc_write(codec, 0x31, 0x18);
	usleep_range(18000, 20000);
	snd_soc_write(codec, 0x04, 0x2c);			/* pdn_ana=0,ibiasgen_pdn=0 */

5.对于新手,调试音频还是有一定的难度的,这是底层,上层的配置还有待研究。
6.camere

&i2c3 {
	status = "okay";
	ov13850: ov13850@10 {
		compatible = "ovti,ov13850";
		status = "okay";
		reg = <0x10>;
		clocks = <&cru SCLK_VIP_OUT>;
		clock-names = "xvclk";
		reset-gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
		pwdn-gpios = <&gpio8 8 GPIO_ACTIVE_HIGH>;
		rockchip,camera-module-index = <0>;
		rockchip,camera-module-facing = "back";
		rockchip,camera-module-name = "CMK-CT0116";
		rockchip,camera-module-lens-name = "Largan-50013A1";
		port {
			cam_out: endpoint {
				remote-endpoint = <&mipi_in_cam>;
				data-lanes = <1 2>;
			};
		};
	};
};
&mipi_phy_tx1rx1 {
 status = "okay";

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

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

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

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

   mipi_sensor_input: endpoint@0 {
    reg = <0>;
    remote-endpoint = <&isp_mipi_in>;
   };
  };
 };
};

&rkisp1 {
	status = "okay";
	pinctrl-names = "default";
   pinctrl-0 = <&isp_mipi>;
	port {
		#address-cells = <1>;
		#size-cells = <0>;
		isp_mipi_in: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&mipi_sensor_input>;
		};
	};
};

&isp {
	status = "disabled";
};


\sdk-9.0\kernel\arch\arm\configs\rockchip_defconfig

CONFIG_VIDEO_OV13850=y


7.SATA

1.GPIO 驱动,供电和复位脚使用。

2.dtsi
	gpio_driver {
		compatible = "gpio_driver";
		sata_enable_gpio = <&gpio7 RK_PB7 GPIO_ACTIVE_HIGH>;
		sata_reset_gpio = <&gpio8 RK_PA7 GPIO_ACTIVE_HIGH>;			
	}; 


3.发现一个现象,插上sata后,时间变得不准确,外接电源还是有这个现象,logcat报错,连接不上ntp,为什么会导致连接不上ntp还位置,我直接更改ntp地址。

sdk-9.0\frameworks\base\core\res\res\values\config.xml
+ <!-- <string translatable="false" name="config_ntpServer">time.android.com</string> -->
+ <string translatable="false" name="config_ntpServer">2.android.pool.ntp.org</string>

8.4G and gps 同其他文件
9.声卡

(1)dtsi
sound: sound {
		status = "okay";
		....
	};	

hdmi_analog_sound: hdmi-analog-sound {
		....
		 status = "disabled";
	};2)命令调试

1. 通过如下命令确认声卡是否注册成功

# cat /proc/asound/cards
0 [rockchiprt5640c]: rockchip_rt5640 - rockchip,rt5640-codec
rockchip,rt5640-codec

# ls -l /dev/snd/
crw-rw---- system audio 116, 2 2013-01-18 08:51 controlC0
crw-rw---- system audio 116, 4 2013-01-18 08:51 pcmC0D0c
crw-rw---- system audio 116, 3 2013-01-18 08:51 pcmC0D0p

2. 通过命令行播放录制调试声卡:

播放:
 # tinyplay
Usage: tinyplay file.wav [-D card] [-d device] [-p period_size] [-n n_periods]

 # tinyplay /sdcard/test44.wav -D 0 -d 0 -p 1024 -n 3
Playing sample: 2 ch, 44100 hz, 32 bit

录制:
 # tinycap
Usage: tinycap file.wav [-D card] [-d device] [-c channels] [-r rate] [-b bits] [-p
period_size] [-n n_periods]

 # tinycap /sdcard/rec.wav -D 0 -d 0 –c 2 –r 44100 –b 16 –p 1024
–n 33)如果HDMI有声音输出且声音正常,说明kernel没有问题,否则反之。但打开APP却没有声音输出,则需要调试应用层。(问题因人而异)

(4)耳机录音不生效,就是插入耳机的时候,没有进行耳机与麦克风的切换。后来发现是中断的问题:

//		#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)//双边沿触发 
//		#define IRQ_TYPE_LEVEL_LOW 8//低电平触发 

		if (hp_irq) {			
			ret = devm_request_threaded_irq(&i2c->dev, hp_irq, NULL, hp_det_irq_handler,
					IRQ_TYPE_LEVEL_LOW | IRQF_ONESHOT,"ES8323", NULL);
					.....
		}	
		
驱动选择的是双边沿触发,但这里双边沿触发并没有生效,所以改成下边沿触发。

(5)发现耳机录音有背景噪音,通过调试ADC得到彻底的解决,于是通过降低增益减少噪音的干扰,后续待解决。
				
10.有时进深度休眠无法唤醒

http://www.cnblogs.com/lialong1st/


;