hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
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
Device-Tree bindings for rockchip mipi dsi lcd driver
 
Required properties:
 - rockchip,screen_init: Whether you need this screen initialization.
   <0>: Don't need to be initialized.
   <1>: Do need to be initialized.
   
 - rockchip,dsi_lane: mipi lcd data lane number.
 
 - rockchip,dsi_hs_clk: mipi lcd high speed clock.
 
 - rockchip,mipi_dsi_num: mipi lcd dsi number.
 
 - mipi_lcd_rst:mipi_lcd_rst: Should specify pin control groups used for reset this lcd.
 
 - mipi_lcd_en:mipi_lcd_en: Should specify pin control groups used for enable this lcd.
 
 - rockchip,gpios: gpio pin
 
 - rockchip,delay: delay the millisecond.
 
 - rockchip,cmd_debug : debug the cammands.
   <0>: close the debug;
   <1>: open the debug;
   
 - rockchip,on-cmds1: write cammand to mipi lcd.
 
- rockchip,cmd_type:
   <LPDT>: close the debug;
   <HSDT>: open the debug;
   
 - rockchip,dsi_id: write cammand to mipi lcd(left and right).
   <0>: left dsi;
   <1>: right dsi;
   <2>: left and right dsis;
   
 - rockchip,cmd: cammand context.
     The first parameter was data type;
     The second parameter was index(register);
     The third and ... parameter are cammand context;
 
 - rockchip,cmd_delay: delay the millisecond.
 
 - screen-type: mipi lcd type.
     <SCREEN_DUAL_MIPI>: Dual channel mipi lcd. 
     <SCREEN_MIPI>: single channel mipi lcd. 
     
 - lvds-format:No relationship.
 
 - out-face: DPI color coding as follows:
     <OUT_P888>:24bit
     <OUT_P666>:18bit
     <OUT_P565>:16bit
     
 - hactive, vactive: display resolution
 - hfront-porch, hback-porch, hsync-len: horizontal display timing parameters
   in pixels
   vfront-porch, vback-porch, vsync-len: vertical display timing parameters in
   lines
 - clock-frequency: display clock in Hz
 
 - swap-rb :exchange of red and blue.
 - swap-rg :exchange of red and green.
 - swap-gb :exchange of green and blue.
 
 - hsync-active: hsync pulse is active low/high/ignored
 - vsync-active: vsync pulse is active low/high/ignored
 - de-active: data-enable pulse is active low/high/ignored
 - pixelclk-active: with
           - active high = drive pixel data on rising edge/
                   sample data on falling edge
           - active low  = drive pixel data on falling edge/
                   sample data on rising edge
           - ignored     = ignored
 - interlaced (bool): boolean to enable interlaced mode
 - doublescan (bool): boolean to enable doublescan mode
 
All the optional properties that are not bool follow the following logic:
    <1>: high active
    <0>: low active
    omitted: not used on hardware
 
There are different ways of describing the capabilities of a display. The
devicetree representation corresponds to the one commonly found in datasheets
for displays. If a display supports multiple signal timings, the native-mode
can be specified.
 
The parameters are defined as:
 
  +----------+-------------------------------------+----------+-------+
  |          |        ª                            |          |       |
  |          |        |vback_porch                 |          |       |
  |          |        «                            |          |       |
  +----------#######################################----------+-------+
  |          #        ª                            #          |       |
  |          #        |                            #          |       |
  |  hback   #        |                            #  hfront  | hsync |
  |   porch  #        |       hactive              #  porch   |  len  |
  |<-------->#<-------+--------------------------->#<-------->|<----->|
  |          #        |                            #          |       |
  |          #        |vactive                     #          |       |
  |          #        |                            #          |       |
  |          #        «                            #          |       |
  +----------#######################################----------+-------+
  |          |        ª                            |          |       |
  |          |        |vfront_porch                |          |       |
  |          |        «                            |          |       |
  +----------+-------------------------------------+----------+-------+
  |          |        ª                            |          |       |
  |          |        |vsync_len                   |          |       |
  |          |        «                            |          |       |
  +----------+-------------------------------------+----------+-------+
 
 
Example:
 
{
       /* about mipi */
       disp_mipi_init: mipi_dsi_init{
                   rockchip,screen_init    = <1>;
                   rockchip,dsi_lane        = <4>;
                   rockchip,dsi_hs_clk        = <1020>;
                   rockchip,mipi_dsi_num    = <2>;
       };
       disp_mipi_power_ctr: mipi_power_ctr {
                   mipi_lcd_rst:mipi_lcd_rst{
                           rockchip,gpios = <&gpio7 GPIO_B2 GPIO_ACTIVE_HIGH>;
                           rockchip,delay = <10>;
                   };
                   /*mipi_lcd_en:mipi_lcd_en {
                           rockchip,gpios = <&gpio6 GPIO_A7 GPIO_ACTIVE_HIGH>;
                           rockchip,delay = <10>;
                   };*/
       };
       disp_mipi_init_cmds: screen-on-cmds {
                   rockchip,cmd_debug = <0>;
                    rockchip,on-cmds1 {
                           rockchip,cmd_type = <LPDT>;
                           rockchip,dsi_id = <2>;
                           rockchip,cmd = <0x05 0x01>; //set soft reset
                           rockchip,cmd_delay = <10>;
                   };
       };
 
       disp_timings: display-timings {
                        native-mode = <&timing0>;
                        timing0: timing0 {
               screen-type = <SCREEN_DUAL_MIPI>;
               lvds-format = <LVDS_8BIT_2>;
               out-face    = <OUT_P888>;
               clock-frequency = <285000000>;
               hactive = <2560>;
               vactive = <1600>;
               
               hsync-len = <38>;//19
               hback-porch = <80>;//40
               hfront-porch = <246>;//123
               
               vsync-len = <4>;
               vback-porch = <4>;
               vfront-porch = <12>;
               
               hsync-active = <0>;
               vsync-active = <0>;
               de-active = <0>;
               pixelclk-active = <0>;
               swap-rb = <0>;
               swap-rg = <0>;
               swap-gb = <0>;
                         };
               };
};