当前位置:网站首页>Qualcomm LCD bring up process
Qualcomm LCD bring up process
2022-06-21 05:05:00 【bobuddy】
qualcomm LCD bring up technological process
Preface
kernel
add to LCD Of dtsi
The dtsi On the platform dtsi in
Voltage configuration
lk
Add the... Of the screen .h file
Panel configuration
Panel resolution
Panel color information
Panel on/off command information
Panel timing
oem_panel.c
Preface
The Qualcomm platform LCD Of bring up It can be divided into two parts :kernel、lk. Look carefully before clicking the screen LCD Circuit schematic diagram and IC spec, Make clear LCD Power on conditions and timing requirements to be met for the bright screen . At the same time FAE Get the initialization code .
kernel
add to LCD Of dtsi
Reference resources FAE Initialization information provided , Fill in the resolution 、hfp\hbp\hpw、vfp\vbp\vpw, In general FAE Initialization code will be provided 、hfp\hbp\hpw、vfp\vbp\vpw、spec Etc
arch/arm64/boot/dts/qcom/dsi-panel-XXX-xxxp-video.dtsi
&mdss_mdp {
dsi_hx8394f_720p_video: qcom,mdss_dsi_hx8394f_720p_video { // Just be consistent
qcom,mdss-dsi-panel-name = "hx8394f 720p video mode dsi panel";//panel name
qcom,mdss-dsi-panel-controller = <&mdss_dsi0>;// remain unchanged ; Designate this panel Will be mapped to DSI Model of controller
qcom,mdss-dsi-panel-type = "dsi_video_mode";// Specify panel operation mode .
//“dsi_video_mode” = Enable video mode
//“dsi_cmd_mode” = Enable command mode
qcom,mdss-dsi-panel-destination = "display_1";// Specify the target display of the panel , remain unchanged
qcom,mdss-dsi-panel-framerate = <60>;// Indicates display per second 60 frame , A frame is a complete image ( It's usually 60)
qcom,mdss-dsi-virtual-channel-id = <0>; // Specify the virtual channel identifier , The default is 0; remain unchanged
qcom,mdss-dsi-stream = <0>;// Specified to Used packet stream :0 = flow 0( The default value is );1 = flow 1. remain unchanged
qcom,mdss-dsi-panel-width = <720>;// The resolution of the -w
qcom,mdss-dsi-panel-height = <1440>;// The resolution of the -h
qcom,mdss-dsi-h-front-porch = <60>;//hfp- Represents the period between the end of a row of valid data and the beginning of the next horizontal synchronization signal VCLK The number of , Corresponding to... In the drive right_margin;
qcom,mdss-dsi-h-back-porch = <60>;//hbp- Represents the period from the beginning of the horizontal synchronization signal to the beginning of the valid data of a line VCLK The number of , Corresponding to... In the drive left_margin;
qcom,mdss-dsi-h-pulse-width = <18>;//hpw- Represents the width of the horizontal synchronization signal , use VCLK Calculation , Corresponding to... In the drive hsync_len;( Set the number of pixels in a row )
qcom,mdss-dsi-h-sync-skew = <0>;// Horizontal synchronous tilt value :0 = The default value is . remain unchanged
qcom,mdss-dsi-v-back-porch = <12>;//vbp- At the beginning of a frame , The number of invalid lines after the vertical sync signal , Corresponding to... In the drive upper_margin;
qcom,mdss-dsi-v-front-porch = <15>;//vfp- At the end of a frame , Invalid number of rows before VSC , Corresponding to... In the drive lower_margin;
qcom,mdss-dsi-v-pulse-width = <2>;//vpw- Represents the width of the vertical synchronization pulse , Calculate by the number of rows , Corresponding drive vsync_len;( How many lines are displayed )
qcom,mdss-dsi-h-left-border = <0>;// Horizontal left border ( Company : Pixels ):0 = The default value is . remain unchanged
qcom,mdss-dsi-h-right-border = <0>;// Horizontal right border ( Company : Pixels ):0 = The default value is . remain unchanged
qcom,mdss-dsi-v-top-border = <0>;// Vertical top border ( Company : Pixels ):0 = The default value is . remain unchanged
qcom,mdss-dsi-v-bottom-border = <0>;// Vertical bottom border ( Company : Pixels ):0 = The default value is . remain unchanged
qcom,mdss-dsi-bpp = <24>; // Specify the number of bits per pixel of the panel .
// 3 = Apply to rgb111
// 8 = Apply to rgb332
// 12 = Apply to rgb444
// 16 = Apply to rgb565
// 18 = Apply to rgb666
// 24 = Apply to rgb888
qcom,mdss-dsi-color-order = "rgb_swap_rgb"; // Appoint R、G and B Channel sorting "rgb_swap_rgb" =DSI_RGB_SWAP_RGB The default value is )
qcom,mdss-dsi-underflow-color = <0xff>;// Specify the controller settings for the panel underflow color :0xff = The default value is . remain unchanged
qcom,mdss-dsi-border-color = <0>;// If there is a border , Define border color values .0 = The default value is .
qcom,mdss-dsi-on-command = [39 01 00 00 00 00 04 B9 FF 83 94// according to FAE Fill in the initialization code provided
39 01 00 00 00 00 03 C0 1F 31
...
05 01 00 00 78 00 02 11 00
05 01 00 00 14 00 02 29 00];
qcom,mdss-dsi-off-command = [// according to FAE Fill in the initialization code provided
05 01 00 00 14 00 02 28 00
05 01 00 00 78 00 02 10 00];
qcom,mdss-dsi-on-command-state = "dsi_lp_mode";// Specify to send ON /OFF Command control state string .
//"dsi_lp_mode" = DSI Low power mode ( The default value is )
//"dsi_hs_mode" = DSI High speed mode
qcom,mdss-dsi-off-command-state = "dsi_lp_mode";
qcom,mdss-dsi-h-sync-pulse = <0>; // Specify the pulse mode options for the panel .
//0 = be not in vs/ve The packet is sent after hsa/he( The default value is )
//1 = stay vs/ve The packet is sent after hsa/he
qcom,mdss-dsi-traffic-mode = "non_burst_sync_event";// Specify panel flow mode
//"non_burst_sync_pulse" = Non burst traffic using synchronous pulses ( The default value is )
//"non_burst_sync_event" = Use synchronization Non burst traffic for start-up events
//"burst_mode" = Burst mode
qcom,mdss-dsi-lane-map = "lane_map_0123";// Specify the data channel exchange configuration ; remain unchanged
//"lane_map_0123" = <0 1 2 3>( The default value is )
qcom,mdss-dsi-bllp-eof-power-mode;// Used to determine the low power blank period (BLLP)EOF During mode DSI Channel status
qcom,mdss-dsi-bllp-power-mode;// Used to determine the low power blank period (BLLP) Pattern During the period of DSI Channel status
qcom,mdss-dsi-tx-eot-append;
qcom,mdss-dsi-lane-0-state;// Specifies whether data channels are enabled 0
qcom,mdss-dsi-lane-1-state;
qcom,mdss-dsi-lane-2-state;
qcom,mdss-dsi-lane-3-state;
qcom,mdss-dsi-panel-timings// Calculated by high pass table
= [87 1C 12 00 42 42 18 21 17 03 04 00];
qcom,mdss-dsi-t-clk-post = <0x04>;// Specify the byte clock cycle after mode switching
qcom,mdss-dsi-t-clk-pre = <0x1B>;// Specify the byte clock cycle before mode switching
qcom,mdss-dsi-dma-trigger = "trigger_sw";// Designated for DMA The triggering mechanism of the path
//"none" = No trigger
//"trigger_te" = Disconnect the check letter for triggering Line no.
//"trigger_sw" = Triggered by software ( default setting ) "trigger_sw_seof" = Software trigger and frame touch The beginning of hair / end .
//"trigger_sw_te" = Software triggers and TE
qcom,mdss-dsi-mdp-trigger = "none";// Designated for MDP The triggering mechanism of the path ;"none" = No trigger
qcom,mdss-dsi-lp11-init;// Make sure that the reset front , Guarantee DSI clock and data Must be pulled up in time
qcom,mdss-dsi-reset-sequence = <1 10>, <0 10>, <1 10>; // List reset GPIO An array of values and sleep sequences
// Each command has the format defined below :
//--> Reset GPIO value : High level low level
//--> Sleep value : How many milliseconds
};
};
The dtsi On the platform dtsi in
Specify which screen to use
#include "dsi-panel-hx8394f-720p-video.dtsi"
&mdss_dsi0 {// Corresponding .dtsi in “panel-controller”
qcom,dsi-pref-prim-pan = <&dsi_hx8394f_720p_video>;// With the screen dtsi Consistent in
pinctrl-names = "mdss_default", "mdss_sleep";
pinctrl-0 = <&mdss_dsi_active &mdss_te_active>;
pinctrl-1 = <&mdss_dsi_suspend &mdss_te_suspend>;
qcom,regulator-ldo-mode;// Low differential linear voltage regulator ( A voltage conversion chip )
qcom,platform-te-gpio = <&tlmm 24 0>;
qcom,platform-reset-gpio = <&tlmm 60 0>;
//qcom,platform-bklight-en-gpio = <&tlmm 93 0>;
//qcom,platform-enable-gpio = <&tlmm 94 0>;
};
&dsi_hx8394f_720p_video {
qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;// A node , List for DSI Power supply elements for panel power supply
qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_pwm";// Used to specify the implementation of backlight control for this panel
qcom,mdss-dsi-bl-pmic-pwm-frequency = <100>;//PWM cycle ( In microseconds )
qcom,mdss-dsi-bl-pmic-bank-select = <0>; //PG Backlight channel
qcom,mdss-dsi-pwm-gpio = <&pm8916_mpps 4 0>;// PMIC gpio Bind to backlight
// esd Check
qcom,esd-check-enabled;// Enable ESD Restore function
qcom,mdss-dsi-panel-status-check-mode = "reg_read"; // Designated for ESD Restored panel status check method ;“ reg_read” = Read the panel status register to check the panel status
qcom,mdss-dsi-panel-status-command = [06 01 00 01 00 00 01 09];// be based on qcom dsi Multiple controller protocols dcs A stream of bytes formed by packets , To read the panel status
qcom,mdss-dsi-panel-status-command-state = "dsi_hs_mode";
qcom,mdss-dsi-panel-status-value = <0x80 0x73 0x06>;// Multiple integer arrays , Each integer array specifies the value of the panel status register used to check the panel status . The size of each array is qcom,mdss-dsi-panel-status-read-length The sum of the lengths specified in , And must be equal .
qcom,mdss-dsi-panel-on-check-value = <0x80 0x73 0x06>;
qcom,mdss-dsi-panel-status-read-length = <3>;// The length of the array
};
Voltage configuration
except lab、ibb Outside , also vdd、vddio Find the platform code yourself
drivers/video/fbdev/msm/mdss_dsi.c
&mdss_dsi0 {
lab-supply = <&lab_regulator>;
ibb-supply = <&ibb_regulator>;
};
&labibb {
status = "ok";
qpnp,qpnp-labibb-mode = "lcd";
};
&ibb_regulator {
qcom,qpnp-ibb-discharge-resistor = <32>;
};
&dsi_panel_pwr_supply {
qcom,[email protected] {
reg = <2>;
qcom,supply-name = "lab";
qcom,supply-min-voltage = <4600000>;
qcom,supply-max-voltage = <6000000>;
qcom,supply-enable-load = <100000>;
qcom,supply-disable-load = <100>;
};
qcom,[email protected] {
reg = <3>;
qcom,supply-name = "ibb";
qcom,supply-min-voltage = <4600000>;
qcom,supply-max-voltage = <6000000>;
qcom,supply-enable-load = <100000>;
qcom,supply-disable-load = <100>;
qcom,supply-post-on-sleep = <20>;
};
};
Modify device tree display voltage "regulator-l17",“regulator-l6”
lk
/android/bootable/bootloader/lk
Add the... Of the screen .h file
.h Many of the parameters in are based on dtsi Completed
/dev/gcdb/display/include/panel_xxxx_xxxp_video.h
.h The structure used in is defined in
/android/bootable/bootloader/lk/dev/gcdb/display/include/panel.h
Panel configuration
static struct panel_config hx8394f_720p_video_panel_data = {
"qcom,mdss_dsi_hx8394f_720p_video", "dsi:0:", "qcom,mdss-dsi-panel",
10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, NULL
};
Corresponding structure definition and analysis
struct panel_config{
char *panel_node_id;//"qcom,mdss_dsi_st7703p_720p_video" And dtsi bring into correspondence with
char *panel_controller; //"dsi:0:" Corresponding dtsi in “panel-controller”
char *panel_compatible;// "qcom,mdss-dsi-panel" remain unchanged
uint16_t panel_interface;// Look at the circuit diagram mipi Just fill in the interface
uint16_t panel_type; //video yes MIPI_VIDEO_PANEL(0), cmd yes MIPI_CMD_PANEL(1)
char *panel_destination;// "DISPLAY_1" Corresponding dtsi in panel-destination
uint32_t panel_orientation;// Screen rotation direction , The default is 0
/* panel_clockrate is deprecated in favor of panel_bitclock_freq */
uint32_t panel_clockrate;// The default is 0, Modification is not recommended
uint16_t panel_framerate;// The refresh rate , It's usually 60
uint16_t panel_channelid;// remain unchanged
uint16_t dsi_virtualchannel_id;// Corresponding DTS Virtual channel in ID( remain unchanged )
uint16_t panel_broadcast_mode;// remain unchanged
uint16_t panel_lp11_init;// Make sure that the reset front , Guarantee DSI clock and data Must be pulled up in time
uint16_t panel_init_delay;// Initialization delay
uint16_t dsi_stream;// remain unchanged
uint8_t interleave_mode;// Staggered mode ( remain unchanged )
uint32_t panel_bitclock_freq;// remain unchanged
uint32_t panel_operating_mode;// Operation mode , The default is 0
uint32_t panel_with_enable_gpio;// remain unchanged
uint8_t mode_gpio_state;// remain unchanged
char *slave_panel_node_id;//NULL
};
Panel resolution
according to dtsi Write , Resolution from left to right (width*high)、hfp、hbp、hpw、hss、vfp、vbp、vpw…
static struct panel_resolution hx8394f_720p_video_panel_res = {
720, 1440, 58, 58, 16, 0, 15, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0
// w, h, hfp, hbp, hpw, hss, vfp, vpw ...
};
The following parameters are listed above dtsi There is a detailed introduction to , I won't repeat it here
struct panel_resolution{
uint16_t panel_width;
uint16_t panel_height;
uint16_t hfront_porch;//hfp
uint16_t hback_porch;//hbp
uint16_t hpulse_width;//hpw
uint16_t hsync_skew;//hss - Horizontal synchronous tilt value
uint16_t vfront_porch;//vfp
uint16_t vback_porch;//vbp
uint16_t vpulse_width;//vpw
uint16_t hleft_border;// Horizontal left border
uint16_t hright_border;// Horizontal right border
uint16_t vtop_border;// Vertical top border
uint16_t vbottom_border;// Vertical bottom border
uint16_t hactive_res;//0
uint16_t vactive_res;//0
uint16_t invert_data_polarity;//0
uint16_t invert_vsync_polarity;// Vertical pulse mode
uint16_t invert_hsync_polarity;// Horizontal pulse mode
};
Panel color information
static struct color_info hx8394f_720p_video_color = {
24, 0, 0xff, 0, 0, 0
};
struct color_info{
uint8_t color_format;
uint8_t color_order;
uint8_t underflow_color;
uint8_t border_color;
uint8_t pixel_packing;
uint8_t pixel_alignment;
};
Corresponding dtsi in
"rgb_swap_rgb" Corresponding 0
On Android R On ,pixel_alignment There is no parsing in the code
Panel on/off command information
Initialization code
eg:
static char st7703p_720p_video_on_cmd1[] = {
0x06, 0x00, 0x39, 0xC0,
0xB1, 0x85, 0x00, 0x24,
0xDA, 0x01, 0xFF, 0xFF,
};
dtsi Of qcom,mdss-dsi-on-command in , Every action is a cmd,cmd=0 Start
The sum of the first number and the second number in the first line is the number of values ( The first 2 Generally speaking 0x00), The last two are datatype;(23,15,05 Corresponding 80,29 and 39 Corresponding c0).
The second line starts with the number , The last line is not enough 4 Fill in the number of 0xff.
Be careful : Only one line is written in the last two lines of initialization code
static char st7703p_720p_video_on_cmd22[] = {
0x11, 0x00, 0x05, 0x80,
};
static char st7703p_720p_video_on_cmd23[] = {
0x29, 0x00, 0x05, 0x80
};
mipi_dsi_cmd In the structure , The first parameter is the total number of corresponding arrays , Include the first line and 0xff ,
static struct mipi_dsi_cmd st7703p_720p_video_on_command[] = {
{0x08, st7703p_720p_video_on_cmd0, 0x00},
{0x0C, st7703p_720p_video_on_cmd1, 0x00},
{0x08, st7703p_720p_video_on_cmd2, 0x00},
{0x10, st7703p_720p_video_on_cmd3, 0x00},
...
ST7703P_720P_VIDEO_ON_COMMAND Is the number of initialization commands , That is, just filled in cmd The number of
#define ST7703P_720P_VIDEO_ON_COMMAND 24
Panel timing
according to dtsi Of timings To calculate
oem_panel.c
android/bootable/bootloader/lk/target/msmxxxx/oem_panel.c
#include "include/panel_xxxxxx_xxxp_video.h"
take panel Add enumeration
/*---------------------------------------------------------------------------*/
/* static panel selection variable */
/*---------------------------------------------------------------------------*/
enum {
TRULY_1080P_VIDEO_PANEL,
TRULY_1080P_CMD_PANEL,
...
ST7703P_720P_VIDEO_PANEL,
ILI9881C_720P_VIDEO_PANEL,
UNKNOWN_PANEL
};
Join in panel_list
/*
* The list of panels that are supported on this target.
* Any panel in this list can be selected using fastboot oem command.
*/
static struct panel_list supp_panels[] = {
{"truly_1080p_video", TRULY_1080P_VIDEO_PANEL},
{"truly_1080p_cmd", TRULY_1080P_CMD_PANEL},
...
{"st7703p_720p_video", ST7703P_720P_VIDEO_PANEL},
{"ili9881c_720p_video", ILI9881C_720P_VIDEO_PANEL},
};
take panel_st7703p_720p_video.h The data in are assigned in turn
case ST7703P_720P_VIDEO_PANEL:
panelstruct->paneldata = &st7703p_720p_video_panel_data;
panelstruct->panelres = &st7703p_720p_video_panel_res;
panelstruct->color = &st7703p_720p_video_color;
panelstruct->videopanel = &st7703p_720p_video_video_panel;
panelstruct->commandpanel = &st7703p_720p_video_command_panel;
panelstruct->state = &st7703p_720p_video_state;
panelstruct->laneconfig = &st7703p_720p_video_lane_config;
panelstruct->paneltiminginfo
= &st7703p_720p_video_timing_info;
panelstruct->panelresetseq
= &st7703p_720p_video_panel_reset_seq;
panelstruct->backlightinfo = &st7703p_720p_video_backlight;
pinfo->mipi.panel_on_cmds
= st7703p_720p_video_on_command;
pinfo->mipi.num_of_panel_on_cmds
= ST7703P_720P_VIDEO_ON_COMMAND;
pinfo->mipi.panel_off_cmds
= st7703p_720p_video_off_command;
pinfo->mipi.num_of_panel_off_cmds
= ST7703P_720P_VIDEO_OFF_COMMAND;
memcpy(phy_db->timing,
st7703p_720p_video_timings, TIMING_SIZE);
pinfo->mipi.signature = ST7703P_720P_VIDEO_SIGNATURE;
phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE;
break;
Be careful : Don't forget to configure the power supply mode
边栏推荐
- Simulate soapUI and obtain the service class and method of WebService interface
- 猴子都能上手的Unity插件Photon之重要部分(PUN)
- 进程间通信-----aidl
- Use selenium to automatically obtain the Ajax epidemic situation and store it in the database with the date of the day as the table name
- golang正则regexp包使用-03-查找匹配字串,查找匹配字串位置,正则分组(FindSubMatch系列方法,FindSubmatchIndex系列方法)
- Selenium principle application - simulate selenium driven browser with requests
- Dayjs get the last day of the first day of the current month the last day of the first day of the current year
- Explain with pictures and deeply learn the advanced understanding of anchors in Yolo
- Day code 300 lines learning notes day 16
- Steam education subject integrates the intelligent scene of AR
猜你喜欢

迎接创客教育+互联网的黄金时代

Deeply explore the technical characteristics of maker Education

【url传参】之将?param1=...&param2...的形式转换为对象json格式

CANape a2l文件的编辑教程

JVM performance tuning - 04jvm generational model

Little sister's Jenkins study notes

Through series voltage division, 12V is changed to 5V, which is too inefficient

At mode explanation and code implementation of Seata's four modes

IDEA Debug出现:Skipped breakpoint at because it happened inside debugger evaluation

高通骁龙处理器DSP
随机推荐
Abnova chicken anti cotton mouse IgG (H & L) secondary antibody (HRP) protocol
unity中复制就能用的定时执行脚本
Eip1167 application and principle of creating minimum contract agent
Abbexa HSD11B2 抗体解决方案
Abbexa 一抗、二抗、蛋白质等生物试剂方案
No programming required, generate crud restful API interface based on PostgreSQL zero code
5. Implementation of watch method
Alien war source code
Steam education subject integrates the intelligent scene of AR
Tu Mei's blogs article update - 220613
[url reference] will? param1=...& param2... To object JSON format
【url传参】之将对象json转换为?param1=...&param2...的形式
Recall, rough sorting and fine sorting in live broadcast recommendation
518. 零钱兑换 II
Technology sharing | software project management and cross departmental communication and collaboration
解读复合型新工科机器人教育模式
Jatpack's lifecycle
猴子都能上手的PUN扩展(房间密码,房间列表,RTC)
mipi LCD 的CLK时钟频率与显示分辨率及帧率的关系
软件研发团队效能提升从点滴做起