blob: 07f09648925e66c8e7f2b1bce28593037bf699f1 [file] [log] [blame]
Googler9398cc32022-12-02 17:21:52 +08001/* SPDX-License-Identifier: GPL-2.0+ */
Googler4f18c0c2022-09-20 17:23:36 +08002/*
Googler4f18c0c2022-09-20 17:23:36 +08003 *
Googler9398cc32022-12-02 17:21:52 +08004 * Copyright (C) 2019 Amlogic, Inc. All rights reserved.
Googler4f18c0c2022-09-20 17:23:36 +08005 *
Googler4f18c0c2022-09-20 17:23:36 +08006 *
7 */
8
9#ifndef __LCD_REG_H__
10#define __LCD_REG_H__
Googler9398cc32022-12-02 17:21:52 +080011#include <linux/amlogic/media/vout/lcd/lcd_vout.h>
12#include "edp_tx_reg.h"
Googler4f18c0c2022-09-20 17:23:36 +080013
14/* register offset address define */
15/* base & offset */
16
Googler9398cc32022-12-02 17:21:52 +080017#define LCD_REG_OFFSET(reg) (((reg) << 2))
Googler4f18c0c2022-09-20 17:23:36 +080018#define LCD_REG_OFFSET_BYTE(reg) ((reg))
19
Googler4f18c0c2022-09-20 17:23:36 +080020/* PERIPHS: 0xc8834400 */
21#define PREG_PAD_GPIO1_EN_N 0x0f
22#define PREG_PAD_GPIO1_O 0x10
23#define PREG_PAD_GPIO1_I 0x11
24#define PREG_PAD_GPIO2_EN_N 0x12
25#define PREG_PAD_GPIO2_O 0x13
26#define PREG_PAD_GPIO2_I 0x14
27#define PREG_PAD_GPIO3_EN_N 0x15
28#define PREG_PAD_GPIO3_O 0x16
29#define PREG_PAD_GPIO3_I 0x17
30#define PREG_PAD_GPIO4_EN_N 0x18
31#define PREG_PAD_GPIO4_O 0x19
32#define PREG_PAD_GPIO4_I 0x1a
33#define PREG_PAD_GPIO5_EN_N 0x1b
34#define PREG_PAD_GPIO5_O 0x1c
35#define PREG_PAD_GPIO5_I 0x1d
36
37#define PERIPHS_PIN_MUX_0 0x2c
38#define PERIPHS_PIN_MUX_1 0x2d
39#define PERIPHS_PIN_MUX_2 0x2e
40#define PERIPHS_PIN_MUX_3 0x2f
41#define PERIPHS_PIN_MUX_4 0x30
42#define PERIPHS_PIN_MUX_5 0x31
43#define PERIPHS_PIN_MUX_6 0x32
44#define PERIPHS_PIN_MUX_7 0x33
45#define PERIPHS_PIN_MUX_8 0x34
46#define PERIPHS_PIN_MUX_9 0x35
47#define PERIPHS_PIN_MUX_10 0x36
48#define PERIPHS_PIN_MUX_11 0x37
49#define PERIPHS_PIN_MUX_12 0x38
50
51#define PERIPHS_PIN_MUX_0_TL1 0x0b0
52#define PERIPHS_PIN_MUX_1_TL1 0x0b1
53#define PERIPHS_PIN_MUX_2_TL1 0x0b2
54#define PERIPHS_PIN_MUX_3_TL1 0x0b3
55#define PERIPHS_PIN_MUX_4_TL1 0x0b4
56#define PERIPHS_PIN_MUX_5_TL1 0x0b5
57#define PERIPHS_PIN_MUX_6_TL1 0x0b6
58#define PERIPHS_PIN_MUX_7_TL1 0x0b7
59#define PERIPHS_PIN_MUX_8_TL1 0x0b8
60#define PERIPHS_PIN_MUX_9_TL1 0x0b9
61#define PERIPHS_PIN_MUX_A_TL1 0x0ba
62#define PERIPHS_PIN_MUX_B_TL1 0x0bb
63#define PERIPHS_PIN_MUX_C_TL1 0x0bc
64#define PERIPHS_PIN_MUX_D_TL1 0x0bd
65#define PERIPHS_PIN_MUX_E_TL1 0x0be
66#define PERIPHS_PIN_MUX_F_TL1 0x0bf
67
Googler9398cc32022-12-02 17:21:52 +080068#define PADCTRL_PIN_MUX_REG0 0x0000
69#define PADCTRL_PIN_MUX_REG1 0x0001
70#define PADCTRL_PIN_MUX_REG2 0x0002
71#define PADCTRL_PIN_MUX_REG3 0x0003
72#define PADCTRL_PIN_MUX_REG4 0x0004
73#define PADCTRL_PIN_MUX_REG5 0x0005
74#define PADCTRL_PIN_MUX_REG6 0x0006
75#define PADCTRL_PIN_MUX_REG7 0x0007
76#define PADCTRL_PIN_MUX_REG8 0x0008
77#define PADCTRL_PIN_MUX_REG9 0x0009
78#define PADCTRL_PIN_MUX_REGA 0x000a
79#define PADCTRL_PIN_MUX_REGB 0x000b
80#define PADCTRL_PIN_MUX_REGC 0x000c
81#define PADCTRL_PIN_MUX_REGD 0x000d
82#define PADCTRL_PIN_MUX_REGE 0x000e
83#define PADCTRL_PIN_MUX_REGF 0x000f
84#define PADCTRL_PIN_MUX_REGG 0x0010
85#define PADCTRL_PIN_MUX_REGH 0x0011
86#define PADCTRL_PIN_MUX_REGI 0x0012
87#define PADCTRL_PIN_MUX_REGJ 0x0013
88#define PADCTRL_PIN_MUX_REGK 0x0014
89#define PADCTRL_PIN_MUX_REGL 0x0015
90#define PADCTRL_PIN_MUX_REGM 0x0016
91#define PADCTRL_PIN_MUX_REGN 0x0017
92#define PADCTRL_PIN_MUX_REGO 0x0018
Googler4f18c0c2022-09-20 17:23:36 +080093
94/* HIU: HHI_CBUS_BASE = 0x10 */
Googler4f18c0c2022-09-20 17:23:36 +080095#define HHI_VIID_PLL_CNTL4 0x46
96#define HHI_VIID_PLL_CNTL 0x47
97#define HHI_VIID_PLL_CNTL2 0x48
98#define HHI_VIID_PLL_CNTL3 0x49
99#define HHI_VIID_CLK_DIV 0x4a
100 #define DAC0_CLK_SEL 28
101 #define DAC1_CLK_SEL 24
102 #define DAC2_CLK_SEL 20
103 #define VCLK2_XD_RST 17
104 #define VCLK2_XD_EN 16
105 #define ENCL_CLK_SEL 12
106 #define VCLK2_XD 0
107#define HHI_VIID_CLK_CNTL 0x4b
108 #define VCLK2_EN 19
109 #define VCLK2_CLK_IN_SEL 16
110 #define VCLK2_SOFT_RST 15
111 #define VCLK2_DIV12_EN 4
112 #define VCLK2_DIV6_EN 3
113 #define VCLK2_DIV4_EN 2
114 #define VCLK2_DIV2_EN 1
115 #define VCLK2_DIV1_EN 0
116#define HHI_VIID_DIVIDER_CNTL 0x4c
117 #define DIV_CLK_IN_EN 16
118 #define DIV_CLK_SEL 15
119 #define DIV_POST_TCNT 12
120 #define DIV_LVDS_CLK_EN 11
121 #define DIV_LVDS_DIV2 10
122 #define DIV_POST_SEL 8
123 #define DIV_POST_SOFT_RST 7
124 #define DIV_PRE_SEL 4
125 #define DIV_PRE_SOFT_RST 3
126 #define DIV_POST_RST 1
127 #define DIV_PRE_RST 0
128#define HHI_VID_CLK_DIV 0x59
129 #define ENCI_CLK_SEL 28
130 #define ENCP_CLK_SEL 24
131 #define ENCT_CLK_SEL 20
132 #define VCLK_XD_RST 17
133 #define VCLK_XD_EN 16
134 #define ENCL_CLK_SEL 12
135 #define VCLK_XD1 8
136 #define VCLK_XD0 0
137#define HHI_VID_CLK_CNTL 0x5f
138#define HHI_VID_CLK_CNTL2 0x65
Googler9398cc32022-12-02 17:21:52 +0800139#define HHI_VID_CLK_CNTL2_T5W 0xa4
Googler4f18c0c2022-09-20 17:23:36 +0800140 #define HDMI_TX_PIXEL_GATE_VCLK 5
141 #define VDAC_GATE_VCLK 4
142 #define ENCL_GATE_VCLK 3
143 #define ENCP_GATE_VCLK 2
144 #define ENCT_GATE_VCLK 1
145 #define ENCI_GATE_VCLK 0
146#define HHI_VID_DIVIDER_CNTL 0x66
147#define HHI_VID_PLL_CLK_DIV 0x68
148#define HHI_EDP_APB_CLK_CNTL 0x7b
149#define HHI_EDP_APB_CLK_CNTL_M8M2 0x82
150#define HHI_EDP_TX_PHY_CNTL0 0x9c
151#define HHI_EDP_TX_PHY_CNTL1 0x9d
Googler9398cc32022-12-02 17:21:52 +0800152/* T7 */
153#define CLKCTRL_VID_CLK0_CTRL 0x0030
154#define CLKCTRL_VID_CLK0_CTRL2 0x0031
155#define CLKCTRL_VID_CLK0_DIV 0x0032
156#define CLKCTRL_VIID_CLK0_DIV 0x0033
157#define CLKCTRL_VIID_CLK0_CTRL 0x0034
158#define CLKCTRL_VID_CLK1_CTRL 0x0073
159#define CLKCTRL_VID_CLK1_CTRL2 0x0074
160#define CLKCTRL_VID_CLK1_DIV 0x0075
161#define CLKCTRL_VIID_CLK1_DIV 0x0076
162#define CLKCTRL_VIID_CLK1_CTRL 0x0077
163#define CLKCTRL_VID_CLK2_CTRL 0x0078
164#define CLKCTRL_VID_CLK2_CTRL2 0x0079
165#define CLKCTRL_VID_CLK2_DIV 0x007a
166#define CLKCTRL_VIID_CLK2_DIV 0x007b
167#define CLKCTRL_VIID_CLK2_CTRL 0x007c
168#define CLKCTRL_MIPIDSI_PHY_CLK_CTRL 0x0041
169#define CLKCTRL_MIPI_DSI_MEAS_CLK_CTRL 0x0080
170/* T3 */
171#define CLKCTRL_TCON_CLK_CNTL 0x0087
172
173/* T5W */
174#define HHI_VIID_CLK0_DIV 0x0a0
175#define HHI_VIID_CLK0_CTRL 0x0a1
176#define HHI_VID_CLK0_CTRL2 0x0a4
177
178/* g12A */
179#define HHI_HDMI_PLL_CNTL0 0xc8
180#define HHI_HDMI_PLL_CNTL1 0xc9
181#define HHI_HDMI_PLL_CNTL2 0xca
182#define HHI_HDMI_PLL_CNTL3 0xcb
183#define HHI_HDMI_PLL_CNTL4 0xcc
184#define HHI_HDMI_PLL_CNTL5 0xcd
185#define HHI_HDMI_PLL_CNTL6 0xce
Googler4f18c0c2022-09-20 17:23:36 +0800186/* TL1 */
187#define HHI_TCON_PLL_CNTL0 0x020
188#define HHI_TCON_PLL_CNTL1 0x021
189#define HHI_TCON_PLL_CNTL2 0x022
190#define HHI_TCON_PLL_CNTL3 0x023
191#define HHI_TCON_PLL_CNTL4 0x0df
192
193#define HHI_DSI_LVDS_EDP_CNTL0 0xd1
194#define HHI_DSI_LVDS_EDP_CNTL1 0xd2
195#define HHI_DIF_CSI_PHY_CNTL1 0xd9
196#define HHI_DIF_CSI_PHY_CNTL2 0xda
197#define HHI_DIF_CSI_PHY_CNTL3 0xdb
Googler9398cc32022-12-02 17:21:52 +0800198#define HHI_LVDS_TX_PHY_CNTL0 0x9a
199#define HHI_LVDS_TX_PHY_CNTL1 0x9b
Googler4f18c0c2022-09-20 17:23:36 +0800200#define HHI_VID2_PLL_CNTL 0xe0
201#define HHI_VID2_PLL_CNTL2 0xe1
202#define HHI_VID2_PLL_CNTL3 0xe2
203#define HHI_VID2_PLL_CNTL4 0xe3
204#define HHI_VID2_PLL_CNTL5 0xe4
205#define HHI_VID2_PLL_CNTL6 0xe5
206#define HHI_VID_LOCK_CLK_CNTL 0xf2
207
208#define HHI_DIF_CSI_PHY_CNTL10 0x8e
209#define HHI_DIF_CSI_PHY_CNTL11 0x8f
210#define HHI_DIF_CSI_PHY_CNTL12 0x90
211#define HHI_DIF_CSI_PHY_CNTL13 0x91
212#define HHI_DIF_CSI_PHY_CNTL14 0x92
213#define HHI_DIF_CSI_PHY_CNTL15 0x93
214#define HHI_DIF_CSI_PHY_CNTL16 0xde
215#define HHI_DIF_CSI_PHY_CNTL4 0xe9
216#define HHI_DIF_CSI_PHY_CNTL6 0xea
217#define HHI_DIF_CSI_PHY_CNTL7 0xeb
218#define HHI_DIF_CSI_PHY_CNTL8 0xec
219#define HHI_DIF_CSI_PHY_CNTL9 0xed
220
Googler4f18c0c2022-09-20 17:23:36 +0800221/* G12A use PLL 0xff63c000 */
Googler9398cc32022-12-02 17:21:52 +0800222#define HHI_GP0_PLL_CNTL0 0x10
223#define HHI_GP0_PLL_CNTL1 0x11
224#define HHI_GP0_PLL_CNTL2 0x12
225#define HHI_GP0_PLL_CNTL3 0x13
226#define HHI_GP0_PLL_CNTL4 0x14
227#define HHI_GP0_PLL_CNTL5 0x15
228#define HHI_GP0_PLL_CNTL6 0x16
Googler4f18c0c2022-09-20 17:23:36 +0800229
230#define HHI_MIPIDSI_PHY_CLK_CNTL 0x95
Googler9398cc32022-12-02 17:21:52 +0800231#define HHI_VDIN_MEAS_CLK_CNTL 0x094
Googler4f18c0c2022-09-20 17:23:36 +0800232
233#define HHI_MIPI_CNTL0 0x00
234#define HHI_MIPI_CNTL1 0x01
235#define HHI_MIPI_CNTL2 0x02
236
237#define HHI_DIF_TCON_CNTL0 0x3c
238#define HHI_DIF_TCON_CNTL1 0x3d
239#define HHI_DIF_TCON_CNTL2 0x3e
240#define HHI_TCON_CLK_CNTL 0x9c
241
Googler9398cc32022-12-02 17:21:52 +0800242#define ANACTRL_DIF_PHY_CNTL1 0x00c8
243#define ANACTRL_DIF_PHY_CNTL2 0x00c9
244#define ANACTRL_DIF_PHY_CNTL3 0x00ca
245#define ANACTRL_DIF_PHY_CNTL4 0x00cb
246#define ANACTRL_DIF_PHY_CNTL5 0x00cc
247#define ANACTRL_DIF_PHY_CNTL6 0x00cd
248#define ANACTRL_DIF_PHY_CNTL7 0x00ce
249#define ANACTRL_DIF_PHY_CNTL8 0x00cf
250#define ANACTRL_DIF_PHY_CNTL9 0x00d0
251#define ANACTRL_DIF_PHY_CNTL10 0x00d1
252#define ANACTRL_DIF_PHY_CNTL11 0x00d2
253#define ANACTRL_DIF_PHY_CNTL12 0x00d3
254#define ANACTRL_DIF_PHY_CNTL13 0x00d4
255#define ANACTRL_DIF_PHY_CNTL14 0x00d5
256#define ANACTRL_DIF_PHY_CNTL15 0x00d6
257#define ANACTRL_DIF_PHY_CNTL16 0x00d7
258#define ANACTRL_DIF_PHY_CNTL17 0x00d8
259#define ANACTRL_DIF_PHY_CNTL18 0x00d9
260#define ANACTRL_DIF_PHY_CNTL19 0x00da
261#define ANACTRL_DIF_PHY_CNTL20 0x00db
262#define ANACTRL_DIF_PHY_CNTL21 0x00dc
263#define ANACTRL_TCON_PLL0_CNTL0 0x00e0
264#define ANACTRL_TCON_PLL0_CNTL1 0x00e1
265#define ANACTRL_TCON_PLL0_CNTL2 0x00e2
266#define ANACTRL_TCON_PLL0_CNTL3 0x00e3
267#define ANACTRL_TCON_PLL0_CNTL4 0x00e4
268#define ANACTRL_TCON_PLL1_CNTL0 0x00e5
269#define ANACTRL_TCON_PLL1_CNTL1 0x00e6
270#define ANACTRL_TCON_PLL1_CNTL2 0x00e7
271#define ANACTRL_TCON_PLL1_CNTL3 0x00e8
272#define ANACTRL_TCON_PLL1_CNTL4 0x00e9
273#define ANACTRL_TCON_PLL2_CNTL0 0x00ea
274#define ANACTRL_TCON_PLL2_CNTL1 0x00eb
275#define ANACTRL_TCON_PLL2_CNTL2 0x00ec
276#define ANACTRL_TCON_PLL2_CNTL3 0x00ed
277#define ANACTRL_TCON_PLL2_CNTL4 0x00ee
278#define ANACTRL_TCON_PLL0_STS 0x00ef
279#define ANACTRL_TCON_PLL1_STS 0x00f0
280#define ANACTRL_TCON_PLL2_STS 0x00f1
281
282/*T3*/
283#define ANACTRL_LVDS_TX_PHY_CNTL0 0x00f4
284#define ANACTRL_LVDS_TX_PHY_CNTL1 0x00f5
285#define ANACTRL_LVDS_TX_PHY_CNTL2 0x00f6
286#define ANACTRL_LVDS_TX_PHY_CNTL3 0x00f7
287#define ANACTRL_VID_PLL_CLK_DIV 0x00f8
288
289#define COMBO_DPHY_CNTL0 0x0000
290#define COMBO_DPHY_CNTL1 0x0001
291#define COMBO_DPHY_VID_PLL0_DIV 0x0002
292#define COMBO_DPHY_VID_PLL1_DIV 0x0003
293#define COMBO_DPHY_VID_PLL2_DIV 0x0004
294#define COMBO_DPHY_EDP_PIXEL_CLK_DIV 0x0005
295#define COMBO_DPHY_EDP_LVDS_TX_PHY0_CNTL0 0x0006
296#define COMBO_DPHY_EDP_LVDS_TX_PHY1_CNTL0 0x0007
297#define COMBO_DPHY_EDP_LVDS_TX_PHY2_CNTL0 0x0008
298#define COMBO_DPHY_EDP_LVDS_TX_PHY0_CNTL1 0x0009
299#define COMBO_DPHY_EDP_LVDS_TX_PHY1_CNTL1 0x000a
300#define COMBO_DPHY_EDP_LVDS_TX_PHY2_CNTL1 0x000b
301#define COMBO_DPHY_RO_EDP_LVDS_TX_PHY0_CNTL1 0x0010
302#define COMBO_DPHY_RO_EDP_LVDS_TX_PHY1_CNTL1 0x0011
303#define COMBO_DPHY_RO_EDP_LVDS_TX_PHY2_CNTL1 0x0012
304
Googler4f18c0c2022-09-20 17:23:36 +0800305/* Global control: RESET_CBUS_BASE = 0x11 */
306#define VERSION_CTRL 0x1100
307#define RESET0_REGISTER 0x1101
308#define RESET1_REGISTER 0x1102
309#define RESET2_REGISTER 0x1103
310#define RESET3_REGISTER 0x1104
311#define RESET4_REGISTER 0x1105
312#define RESET5_REGISTER 0x1106
313#define RESET6_REGISTER 0x1107
314#define RESET7_REGISTER 0x1108
315#define RESET0_MASK 0x1110
316#define RESET1_MASK 0x1111
317#define RESET2_MASK 0x1112
318#define RESET3_MASK 0x1113
319#define RESET4_MASK 0x1114
320#define RESET5_MASK 0x1115
321#define RESET6_MASK 0x1116
322#define CRT_MASK 0x1117
323#define RESET7_MASK 0x1118
324
Googler9398cc32022-12-02 17:21:52 +0800325/* t5 */
326#define RESET0_MASK_T5 0x0010
327#define RESET1_MASK_T5 0x0011
328#define RESET2_MASK_T5 0x0012
329#define RESET3_MASK_T5 0x0013
330#define RESET4_MASK_T5 0x0014
331#define RESET5_MASK_T5 0x0015
332#define RESET6_MASK_T5 0x0016
333#define RESET7_MASK_T5 0x0017
334#define RESET0_LEVEL_T5 0x0020
335#define RESET1_LEVEL_T5 0x0021
336#define RESET2_LEVEL_T5 0x0022
337#define RESET3_LEVEL_T5 0x0023
338#define RESET4_LEVEL_T5 0x0024
339#define RESET5_LEVEL_T5 0x0025
340#define RESET6_LEVEL_T5 0x0026
341#define RESET7_LEVEL_T5 0x0027
342
343#define RESETCTRL_RESET0 0x0000
344#define RESETCTRL_RESET1 0x0001
345#define RESETCTRL_RESET2 0x0002
346#define RESETCTRL_RESET3 0x0003
347#define RESETCTRL_RESET4 0x0004
348#define RESETCTRL_RESET5 0x0005
349#define RESETCTRL_RESET6 0x0006
350#define RESETCTRL_RESET0_LEVEL 0x0010
351#define RESETCTRL_RESET1_LEVEL 0x0011
352#define RESETCTRL_RESET2_LEVEL 0x0012
353#define RESETCTRL_RESET3_LEVEL 0x0013
354#define RESETCTRL_RESET4_LEVEL 0x0014
355#define RESETCTRL_RESET5_LEVEL 0x0015
356#define RESETCTRL_RESET6_LEVEL 0x0016
357#define RESETCTRL_RESET0_MASK 0x0020
358#define RESETCTRL_RESET1_MASK 0x0021
359#define RESETCTRL_RESET2_MASK 0x0022
360#define RESETCTRL_RESET3_MASK 0x0023
361#define RESETCTRL_RESET4_MASK 0x0024
362#define RESETCTRL_RESET5_MASK 0x0025
363#define RESETCTRL_RESET6_MASK 0x0026
364
Googler4f18c0c2022-09-20 17:23:36 +0800365/* ********************************
366 * TCON: VCBUS_BASE = 0x14
367 */
368/* TCON_L register */
369#define L_GAMMA_CNTL_PORT 0x1400
370#define L_GAMMA_DATA_PORT 0x1401
371#define L_GAMMA_ADDR_PORT 0x1402
372#define L_GAMMA_VCOM_HSWITCH_ADDR 0x1403
373#define L_RGB_BASE_ADDR 0x1405
374#define L_RGB_COEFF_ADDR 0x1406
375#define L_POL_CNTL_ADDR 0x1407
376#define L_DITH_CNTL_ADDR 0x1408
377#define L_GAMMA_PROBE_CTRL 0x1409
Googler9398cc32022-12-02 17:21:52 +0800378
379#define LCD_GAMMA_CNTL_PORT0 0x14b4
380
Googler4f18c0c2022-09-20 17:23:36 +0800381/* read only */
382#define L_GAMMA_PROBE_COLOR_L 0x140a
383#define L_GAMMA_PROBE_COLOR_H 0x140b
384#define L_GAMMA_PROBE_HL_COLOR 0x140c
385#define L_GAMMA_PROBE_POS_X 0x140d
386#define L_GAMMA_PROBE_POS_Y 0x140e
387#define L_STH1_HS_ADDR 0x1410
388#define L_STH1_HE_ADDR 0x1411
389#define L_STH1_VS_ADDR 0x1412
390#define L_STH1_VE_ADDR 0x1413
391#define L_STH2_HS_ADDR 0x1414
392#define L_STH2_HE_ADDR 0x1415
393#define L_STH2_VS_ADDR 0x1416
394#define L_STH2_VE_ADDR 0x1417
395#define L_OEH_HS_ADDR 0x1418
396#define L_OEH_HE_ADDR 0x1419
397#define L_OEH_VS_ADDR 0x141a
398#define L_OEH_VE_ADDR 0x141b
399#define L_VCOM_HSWITCH_ADDR 0x141c
400#define L_VCOM_VS_ADDR 0x141d
401#define L_VCOM_VE_ADDR 0x141e
402#define L_CPV1_HS_ADDR 0x141f
403#define L_CPV1_HE_ADDR 0x1420
404#define L_CPV1_VS_ADDR 0x1421
405#define L_CPV1_VE_ADDR 0x1422
406#define L_CPV2_HS_ADDR 0x1423
407#define L_CPV2_HE_ADDR 0x1424
408#define L_CPV2_VS_ADDR 0x1425
409#define L_CPV2_VE_ADDR 0x1426
410#define L_STV1_HS_ADDR 0x1427
411#define L_STV1_HE_ADDR 0x1428
412#define L_STV1_VS_ADDR 0x1429
413#define L_STV1_VE_ADDR 0x142a
414#define L_STV2_HS_ADDR 0x142b
415#define L_STV2_HE_ADDR 0x142c
416#define L_STV2_VS_ADDR 0x142d
417#define L_STV2_VE_ADDR 0x142e
418#define L_OEV1_HS_ADDR 0x142f
419#define L_OEV1_HE_ADDR 0x1430
420#define L_OEV1_VS_ADDR 0x1431
421#define L_OEV1_VE_ADDR 0x1432
422#define L_OEV2_HS_ADDR 0x1433
423#define L_OEV2_HE_ADDR 0x1434
424#define L_OEV2_VS_ADDR 0x1435
425#define L_OEV2_VE_ADDR 0x1436
426#define L_OEV3_HS_ADDR 0x1437
427#define L_OEV3_HE_ADDR 0x1438
428#define L_OEV3_VS_ADDR 0x1439
429#define L_OEV3_VE_ADDR 0x143a
430#define L_LCD_PWR_ADDR 0x143b
431#define L_LCD_PWM0_LO_ADDR 0x143c
432#define L_LCD_PWM0_HI_ADDR 0x143d
433#define L_LCD_PWM1_LO_ADDR 0x143e
434#define L_LCD_PWM1_HI_ADDR 0x143f
435#define L_INV_CNT_ADDR 0x1440
436#define L_TCON_MISC_SEL_ADDR 0x1441
437#define L_DUAL_PORT_CNTL_ADDR 0x1442
438#define MLVDS_CLK_CTL1_HI 0x1443
439#define MLVDS_CLK_CTL1_LO 0x1444
440/* [31:30] enable mlvds clocks
441 * [24] mlvds_clk_half_delay 24 // Bit 0
442 * [23:0] mlvds_clk_pattern 0 // Bit 23:0
443 */
444#define L_TCON_DOUBLE_CTL 0x1449
445#define L_TCON_PATTERN_HI 0x144a
446#define L_TCON_PATTERN_LO 0x144b
447#define LDIM_BL_ADDR_PORT 0x144e
448#define LDIM_BL_DATA_PORT 0x144f
449#define L_DE_HS_ADDR 0x1451
450#define L_DE_HE_ADDR 0x1452
451#define L_DE_VS_ADDR 0x1453
452#define L_DE_VE_ADDR 0x1454
453#define L_HSYNC_HS_ADDR 0x1455
454#define L_HSYNC_HE_ADDR 0x1456
455#define L_HSYNC_VS_ADDR 0x1457
456#define L_HSYNC_VE_ADDR 0x1458
457#define L_VSYNC_HS_ADDR 0x1459
458#define L_VSYNC_HE_ADDR 0x145a
459#define L_VSYNC_VS_ADDR 0x145b
460#define L_VSYNC_VE_ADDR 0x145c
461/* bit 8 -- vfifo_mcu_enable
462 * bit 7 -- halt_vs_de
463 * bit 6 -- R8G8B8_format
464 * bit 5 -- R6G6B6_format (round to 6 bits)
465 * bit 4 -- R5G6B5_format
466 * bit 3 -- dac_dith_sel
467 * bit 2 -- lcd_mcu_enable_de -- ReadOnly
468 * bit 1 -- lcd_mcu_enable_vsync -- ReadOnly
469 * bit 0 -- lcd_mcu_enable
470 */
471#define L_LCD_MCU_CTL 0x145d
472
473/* **************************************************
Googler9398cc32022-12-02 17:21:52 +0800474 * Dual port MLVDS registers
Googler4f18c0c2022-09-20 17:23:36 +0800475 */
476/* bit 3 - enable_u_dual_mlvds_dp_clk
477 * bit 2 - enable_u_map_mlvds_r_clk
478 * bit 1 - enable_u_map_mlvds_l_clk
479 * bit 0 - dual_mlvds_en
480 */
481#define DUAL_MLVDS_CTL 0x1460
482/* bit[12:0] - dual_mlvds_line_start */
483#define DUAL_MLVDS_LINE_START 0x1461
484/* bit[12:0] - dual_mlvds_line_end */
485#define DUAL_MLVDS_LINE_END 0x1462
486/* bit[12:0] - dual_mlvds_w_pixel_start_l */
487#define DUAL_MLVDS_PIXEL_W_START_L 0x1463
488/* bit[12:0] - dual_mlvds_w_pixel_end_l */
489#define DUAL_MLVDS_PIXEL_W_END_L 0x1464
490/* bit[12:0] - dual_mlvds_w_pixel_start_r */
491#define DUAL_MLVDS_PIXEL_W_START_R 0x1465
492/* bit[12:0] - dual_mlvds_w_pixel_end_r */
493#define DUAL_MLVDS_PIXEL_W_END_R 0x1466
494/* bit[12:0] - dual_mlvds_r_pixel_start_l */
495#define DUAL_MLVDS_PIXEL_R_START_L 0x1467
496/* bit[12:0] - dual_mlvds_r_pixel_cnt_l */
497#define DUAL_MLVDS_PIXEL_R_CNT_L 0x1468
498/* bit[12:0] - dual_mlvds_r_pixel_start_r */
499#define DUAL_MLVDS_PIXEL_R_START_R 0x1469
500/* bit[12:0] - dual_mlvds_r_pixel_cnt_r */
501#define DUAL_MLVDS_PIXEL_R_CNT_R 0x146a
502/* bit[15] - v_inversion_en
503 * bit[12:0] - v_inversion_pixel
504 */
505#define V_INVERSION_PIXEL 0x1470
506/* bit[15] - v_inversion_sync_en
507 * bit[12:0] - v_inversion_line
508 */
509#define V_INVERSION_LINE 0x1471
510/* bit[15:12] - v_loop_r
511 * bit[11:10] - v_pattern_1_r
512 * bit[9:8] - v_pattern_0_r
513 * bit[7:4] - v_loop_l
514 * bit[3:2] - v_pattern_1_l
515 * bit[1:0] - v_pattern_0_l
516 */
517#define V_INVERSION_CONTROL 0x1472
518#define MLVDS2_CONTROL 0x1474
Googler9398cc32022-12-02 17:21:52 +0800519 #define MLVDS2_RESERVED 15
520 #define MLVDS2_DOUBLE_PATTERN 14
Googler4f18c0c2022-09-20 17:23:36 +0800521 /* 13:8 // each channel has one bit */
Googler9398cc32022-12-02 17:21:52 +0800522 #define MLVDS2_INS_RESET 8
523 #define MLVDS2_DUAL_GATE 7
Googler4f18c0c2022-09-20 17:23:36 +0800524 /* 0=6Bits, 1=8Bits */
Googler9398cc32022-12-02 17:21:52 +0800525 #define MLVDS2_BIT_NUM 6
Googler4f18c0c2022-09-20 17:23:36 +0800526 /* 0=3Pairs, 1=6Pairs */
Googler9398cc32022-12-02 17:21:52 +0800527 #define MLVDS2_PAIR_NUM 5
528 #define MLVDS2_MSB_FIRST 4
529 #define MLVDS2_PORT_SWAP 3
530 #define MLVDS2_MLSB_SWAP 2
531 #define MLVDS2_PN_SWAP 1
532 #define MLVDS2_EN 0
Googler4f18c0c2022-09-20 17:23:36 +0800533#define MLVDS2_CONFIG_HI 0x1475
534#define MLVDS2_CONFIG_LO 0x1476
535 /* Bit 31:29 */
Googler9398cc32022-12-02 17:21:52 +0800536 #define MLVDS2_RESET_OFFSET 29
Googler4f18c0c2022-09-20 17:23:36 +0800537 /* Bit 28:23 */
Googler9398cc32022-12-02 17:21:52 +0800538 #define MLVDS2_RESET_LENGTH 23
Googler4f18c0c2022-09-20 17:23:36 +0800539 /* Bit 22:20 */
Googler9398cc32022-12-02 17:21:52 +0800540 #define MLVDS2_CONFIG_RESERVED 20
541 #define MLVDS2_RESET_START_BIT12 19
542 #define MLVDS2_DATA_WRITE_TOGGLE 18
543 #define MLVDS2_DATA_WRITE_INI 17
544 #define MLVDS2_DATA_LATCH_1_TOGGLE 16
545 #define MLVDS2_DATA_LATCH_1_INI 15
546 #define MLVDS2_DATA_LATCH_0_TOGGLE 14
547 #define MLVDS2_DATA_LATCH_0_INI 13
Googler4f18c0c2022-09-20 17:23:36 +0800548 /* 0=same as reset_0, 1=1 clock delay of reset_0 */
Googler9398cc32022-12-02 17:21:52 +0800549 #define MLVDS2_RESET_1_SELECT 12
Googler4f18c0c2022-09-20 17:23:36 +0800550 /* Bit 11:0 */
Googler9398cc32022-12-02 17:21:52 +0800551 #define MLVDS2_RESET_START 0
Googler4f18c0c2022-09-20 17:23:36 +0800552#define MLVDS2_DUAL_GATE_WR_START 0x1477
553 /* Bit 12:0 */
554 #define mlvds2_dual_gate_wr_start 0
555#define MLVDS2_DUAL_GATE_WR_END 0x1478
556 /* Bit 12:0 */
557 #define mlvds2_dual_gate_wr_end 0
558#define MLVDS2_DUAL_GATE_RD_START 0x1479
559 /* Bit 12:0 */
560 #define mlvds2_dual_gate_rd_start 0
561#define MLVDS2_DUAL_GATE_RD_END 0x147a
562 /* Bit 12:0 */
563 #define mlvds2_dual_gate_rd_end 0
564#define MLVDS2_SECOND_RESET_CTL 0x147b
565 /* Bit 12:0 */
Googler9398cc32022-12-02 17:21:52 +0800566 #define MLVDS2_2ND_RESET_START 0
Googler4f18c0c2022-09-20 17:23:36 +0800567#define MLVDS2_DUAL_GATE_CTL_HI 0x147c
568#define MLVDS2_DUAL_GATE_CTL_LO 0x147d
569 /* Bit 7:0 */
570 #define mlvds2_tcon_field_en 24
571 /* Bit 2:0 */
572 #define mlvds2_dual_gate_reserved 21
573 #define mlvds2_scan_mode_start_line_bit12 20
574 /* Bit 3:0 */
575 #define mlvds2_scan_mode_odd 16
576 /* Bit 3:0 */
577 #define mlvds2_scan_mode_even 12
578 /* Bit 11:0 */
579 #define mlvds2_scan_mode_start_line 0
580#define MLVDS2_RESET_CONFIG_HI 0x147e
581#define MLVDS2_RESET_CONFIG_LO 0x147f
Googler9398cc32022-12-02 17:21:52 +0800582 #define MLVDS2_RESET_RANGE_ENABLE 31
583 #define MLVDS2_RESET_RANGE_INV 30
584 #define MLVDS2_RESET_CONFIG_RES1 29
Googler4f18c0c2022-09-20 17:23:36 +0800585 /* Bit 11:0 */
Googler9398cc32022-12-02 17:21:52 +0800586 #define MLVDS2_RESET_RANGE_LINE_0 16
Googler4f18c0c2022-09-20 17:23:36 +0800587 /* Bit 2:0 */
Googler9398cc32022-12-02 17:21:52 +0800588 #define MLVDS2_RESET_CONFIG_RES3 13
Googler4f18c0c2022-09-20 17:23:36 +0800589 /* Bit 11:0 */
Googler9398cc32022-12-02 17:21:52 +0800590 #define MLVDS2_RESET_RANGE_LINE_1 0
Googler4f18c0c2022-09-20 17:23:36 +0800591
592/* ************************************
593 * TCON register
594 */
595#define GAMMA_CNTL_PORT 0x1480
596 #define GAMMA_VCOM_POL 7
597 #define GAMMA_RVS_OUT 6
598 /* Read Only */
599 #define ADR_RDY 5
600 /* Read Only */
601 #define WR_RDY 4
602 /* Read Only */
603 #define RD_RDY 3
604 #define GAMMA_TR 2
605 #define GAMMA_SET 1
606 #define GAMMA_EN 0
607#define GAMMA_DATA_PORT 0x1481
608#define GAMMA_ADDR_PORT 0x1482
609 #define H_RD 12
610 #define H_AUTO_INC 11
611 #define H_SEL_R 10
612 #define H_SEL_G 9
613 #define H_SEL_B 8
614 /* 7:0 */
615 #define HADR_MSB 7
616 #define HADR 0
617#define GAMMA_VCOM_HSWITCH_ADDR 0x1483
618#define RGB_BASE_ADDR 0x1485
619#define RGB_COEFF_ADDR 0x1486
620#define POL_CNTL_ADDR 0x1487
621 /* FOR DCLK OUTPUT */
622 #define DCLK_SEL 14
623 /* FOR RGB format DVI output */
624 #define TCON_VSYNC_SEL_DVI 11
625 /* FOR RGB format DVI output */
626 #define TCON_HSYNC_SEL_DVI 10
627 /* FOR RGB format DVI output */
628 #define TCON_DE_SEL_DVI 9
629 #define CPH3_POL 8
630 #define CPH2_POL 7
631 #define CPH1_POL 6
632 #define TCON_DE_SEL 5
633 #define TCON_VS_SEL 4
634 #define TCON_HS_SEL 3
635 #define DE_POL 2
636 #define VS_POL 1
637 #define HS_POL 0
638#define DITH_CNTL_ADDR 0x1488
639 #define DITH10_EN 10
640 #define DITH8_EN 9
641 #define DITH_MD 8
642 /* 7:4 */
643 #define DITH10_CNTL_MSB 7
644 #define DITH10_CNTL 4
645 /* 3:0 */
646 #define DITH8_CNTL_MSB 3
647 #define DITH8_CNTL 0
648/* Bit 1 highlight_en
649 * Bit 0 probe_en
650 */
651#define GAMMA_PROBE_CTRL 0x1489
652/* read only
653 * Bit [15:0] probe_color[15:0]
654 */
655#define GAMMA_PROBE_COLOR_L 0x148a
656/* Read only
657 * Bit 15: if true valid probed color
658 * Bit [13:0] probe_color[29:16]
659 */
660#define GAMMA_PROBE_COLOR_H 0x148b
661/* bit 15:0, 5:6:5 color */
662#define GAMMA_PROBE_HL_COLOR 0x148c
663/* 12:0 pos_x */
664#define GAMMA_PROBE_POS_X 0x148d
665/* 12:0 pos_y */
666#define GAMMA_PROBE_POS_Y 0x148e
667#define STH1_HS_ADDR 0x1490
668#define STH1_HE_ADDR 0x1491
669#define STH1_VS_ADDR 0x1492
670#define STH1_VE_ADDR 0x1493
671#define STH2_HS_ADDR 0x1494
672#define STH2_HE_ADDR 0x1495
673#define STH2_VS_ADDR 0x1496
674#define STH2_VE_ADDR 0x1497
675#define OEH_HS_ADDR 0x1498
676#define OEH_HE_ADDR 0x1499
677#define OEH_VS_ADDR 0x149a
678#define OEH_VE_ADDR 0x149b
679#define VCOM_HSWITCH_ADDR 0x149c
680#define VCOM_VS_ADDR 0x149d
681#define VCOM_VE_ADDR 0x149e
682#define CPV1_HS_ADDR 0x149f
683#define CPV1_HE_ADDR 0x14a0
684#define CPV1_VS_ADDR 0x14a1
685#define CPV1_VE_ADDR 0x14a2
686#define CPV2_HS_ADDR 0x14a3
687#define CPV2_HE_ADDR 0x14a4
688#define CPV2_VS_ADDR 0x14a5
689#define CPV2_VE_ADDR 0x14a6
690#define STV1_HS_ADDR 0x14a7
691#define STV1_HE_ADDR 0x14a8
692#define STV1_VS_ADDR 0x14a9
693#define STV1_VE_ADDR 0x14aa
694#define STV2_HS_ADDR 0x14ab
695#define STV2_HE_ADDR 0x14ac
696#define STV2_VS_ADDR 0x14ad
697#define STV2_VE_ADDR 0x14ae
698#define OEV1_HS_ADDR 0x14af
699#define OEV1_HE_ADDR 0x14b0
700#define OEV1_VS_ADDR 0x14b1
701#define OEV1_VE_ADDR 0x14b2
702#define OEV2_HS_ADDR 0x14b3
703#define OEV2_HE_ADDR 0x14b4
704#define OEV2_VS_ADDR 0x14b5
705#define OEV2_VE_ADDR 0x14b6
706#define OEV3_HS_ADDR 0x14b7
707#define OEV3_HE_ADDR 0x14b8
708#define OEV3_VS_ADDR 0x14b9
709#define OEV3_VE_ADDR 0x14ba
710#define LCD_PWR_ADDR 0x14bb
711 #define LCD_VDD 5
712 #define LCD_VBL 4
713 #define LCD_GPI_MSB 3
714 #define LCD_GPIO 0
715#define LCD_PWM0_LO_ADDR 0x14bc
716#define LCD_PWM0_HI_ADDR 0x14bd
717#define LCD_PWM1_LO_ADDR 0x14be
718#define LCD_PWM1_HI_ADDR 0x14bf
719#define INV_CNT_ADDR 0x14c0
720 #define INV_EN 4
721 #define INV_CNT_MSB 3
722 #define INV_CNT 0
723#define TCON_MISC_SEL_ADDR 0x14c1
724 #define STH2_SEL 12
725 #define STH1_SEL 11
726 #define OEH_SEL 10
727 #define VCOM_SEL 9
728 #define DB_LINE_SW 8
729 #define CPV2_SEL 7
730 #define CPV1_SEL 6
731 #define STV2_SEL 5
732 #define STV1_SEL 4
733 #define OEV_UNITE 3
734 #define OEV3_SEL 2
735 #define OEV2_SEL 1
736 #define OEV1_SEL 0
737#define DUAL_PORT_CNTL_ADDR 0x14c2
738 #define OUTPUT_YUV 15
739 /* 14:12 */
740 #define DUAL_IDF 12
741 /* 11:9 */
742 #define DUAL_ISF 9
743 #define LCD_ANALOG_SEL_CPH3 8
744 #define LCD_ANALOG_3PHI_CLK_SEL 7
745 #define LCD_LVDS_SEL54 6
746 #define LCD_LVDS_SEL27 5
747 #define LCD_TTL_SEL 4
748 #define DUAL_LVDC_EN 3
749 #define PORT_SWP 2
750 #define RGB_SWP 1
751 #define BIT_SWP 0
752#define MLVDS_CONTROL 0x14c3
Googler9398cc32022-12-02 17:21:52 +0800753 #define MLVDS_RESERVED 15
754 #define MLVDS_DOUBLE_PATTERN 14
Googler4f18c0c2022-09-20 17:23:36 +0800755 /* 13:8 // each channel has one bit */
Googler9398cc32022-12-02 17:21:52 +0800756 #define MLVDS_INS_RESET 8
757 #define MLVDS_DUAL_GATE 7
Googler4f18c0c2022-09-20 17:23:36 +0800758 /* 0=6Bits, 1=8Bits */
Googler9398cc32022-12-02 17:21:52 +0800759 #define MLVDS_BIT_NUM 6
Googler4f18c0c2022-09-20 17:23:36 +0800760 /* 0=3Pairs, 1=6Pairs */
Googler9398cc32022-12-02 17:21:52 +0800761 #define MLVDS_PAIR_NUM 5
762 #define MLVDS_MSB_FIRST 4
763 #define MLVDS_PORT_SWAP 3
764 #define MLVDS_MLSB_SWAP 2
765 #define MLVDS_PN_SWAP 1
766 #define MLVDS_EN 0
Googler4f18c0c2022-09-20 17:23:36 +0800767#define MLVDS_RESET_PATTERN_HI 0x14c4
768#define MLVDS_RESET_PATTERN_LO 0x14c5
769 /* Bit 47:16 */
Googler9398cc32022-12-02 17:21:52 +0800770 #define MLVDS_RESET_ 0
771#define MLVDS_RESET_PATTERN_EXT 0x14c6
Googler4f18c0c2022-09-20 17:23:36 +0800772 /* Bit 15:0 */
Googler9398cc32022-12-02 17:21:52 +0800773 #define mlvds_reset_pattern_ext 0
Googler4f18c0c2022-09-20 17:23:36 +0800774#define MLVDS_CONFIG_HI 0x14c7
775#define MLVDS_CONFIG_LO 0x14c8
776 /* Bit 31:29 */
Googler9398cc32022-12-02 17:21:52 +0800777 #define MLVDS_RESET_OFFSET 29
Googler4f18c0c2022-09-20 17:23:36 +0800778 /* Bit 28:23 */
Googler9398cc32022-12-02 17:21:52 +0800779 #define MLVDS_RESET_LENGTH 23
Googler4f18c0c2022-09-20 17:23:36 +0800780 /* Bit 22:20 */
Googler9398cc32022-12-02 17:21:52 +0800781 #define MLVDS_CONFIG_RESERVED 20
782 #define MLVDS_RESET_START_BIT12 19
783 #define MLVDS_DATA_WRITE_TOGGLE 18
784 #define MLVDS_DATA_WRITE_INI 17
785 #define MLVDS_DATA_LATCH_1_TOGGLE 16
786 #define MLVDS_DATA_LATCH_1_INI 15
787 #define MLVDS_DATA_LATCH_0_TOGGLE 14
788 #define MLVDS_DATA_LATCH_0_INI 13
Googler4f18c0c2022-09-20 17:23:36 +0800789 /* 0 - same as reset_0, 1 - 1 clock delay of reset_0 */
Googler9398cc32022-12-02 17:21:52 +0800790 #define MLVDS_RESET_1_SELECT 12
Googler4f18c0c2022-09-20 17:23:36 +0800791 /* Bit 11:0 */
Googler9398cc32022-12-02 17:21:52 +0800792 #define MLVDS_RESET_START 0
Googler4f18c0c2022-09-20 17:23:36 +0800793#define TCON_DOUBLE_CTL 0x14c9
794 /* Bit 7:0 */
795 #define tcon_double_ini 8
796 /* Bit 7:0 */
797 #define tcon_double_inv 0
798#define TCON_PATTERN_HI 0x14ca
799#define TCON_PATTERN_LO 0x14cb
800 /* Bit 15:0 */
801 #define tcon_pattern_loop_data 16
802 /* Bit 3:0 */
803 #define tcon_pattern_loop_start 12
804 /* Bit 3:0 */
805 #define tcon_pattern_loop_end 8
806 /* Bit 7:0 */
807 #define tcon_pattern_enable 0
808#define TCON_CONTROL_HI 0x14cc
809#define TCON_CONTROL_LO 0x14cd
810 /* Bit 5:0 (enable pclk on TCON channel 7 to 2) */
811 #define tcon_pclk_enable 26
812 /* Bit 1:0 (control phy clok divide 2,4,6,8) */
813 #define tcon_pclk_div 24
814 /* Bit 23:0 (3 bit for each channel) */
815 #define tcon_delay 0
816#define LVDS_BLANK_DATA_HI 0x14ce
817#define LVDS_BLANK_DATA_LO 0x14cf
818 /* 31:30 */
819 #define LVDS_blank_data_reserved 30
820 /* 29:20 */
821 #define LVDS_blank_data_r 20
822 /* 19:10 */
823 #define LVDS_blank_data_g 10
824 /* 9:0 */
825 #define LVDS_blank_data_b 0
826#define LVDS_PACK_CNTL_ADDR 0x14d0
827 #define LVDS_USE_TCON 7
828 #define LVDS_DUAL 6
829 #define PN_SWP 5
830 #define LSB_FIRST 4
831 #define LVDS_RESV 3
832 #define ODD_EVEN_SWP 2
833 #define LVDS_REPACK 0
834/* New from M3 :
835 * Bit 15:12 -- Enable OFFSET Double Generate(TOCN7-TCON4)
836 * Bit 11:0 -- de_hs(old tcon) second offset_hs (new tcon)
837 */
838#define DE_HS_ADDR 0x14d1
839/* New from M3 :
840 * Bit 15:12 -- Enable OFFSET Double Generate(TOCN3-TCON0)
841 */
842#define DE_HE_ADDR 0x14d2
843#define DE_VS_ADDR 0x14d3
844#define DE_VE_ADDR 0x14d4
845#define HSYNC_HS_ADDR 0x14d5
846#define HSYNC_HE_ADDR 0x14d6
847#define HSYNC_VS_ADDR 0x14d7
848#define HSYNC_VE_ADDR 0x14d8
849#define VSYNC_HS_ADDR 0x14d9
850#define VSYNC_HE_ADDR 0x14da
851#define VSYNC_VS_ADDR 0x14db
852#define VSYNC_VE_ADDR 0x14dc
853/* bit 8 -- vfifo_mcu_enable
854 * bit 7 -- halt_vs_de
855 * bit 6 -- R8G8B8_format
856 * bit 5 -- R6G6B6_format (round to 6 bits)
857 * bit 4 -- R5G6B5_format
858 * bit 3 -- dac_dith_sel
859 * bit 2 -- lcd_mcu_enable_de -- ReadOnly
860 * bit 1 -- lcd_mcu_enable_vsync -- ReadOnly
861 * bit 0 -- lcd_mcu_enable
862 */
863#define LCD_MCU_CTL 0x14dd
864/* ReadOnly
865 * R5G6B5 when R5G6B5_format
866 * G8R8 when R8G8B8_format
867 * G5R10 Other
868 */
869#define LCD_MCU_DATA_0 0x14de
870/* ReadOnly
871 * G8B8 when R8G8B8_format
872 * G5B10 Other
873 */
874#define LCD_MCU_DATA_1 0x14df
875#define LVDS_CH_SWAP0 0x14e1
876#define LVDS_CH_SWAP1 0x14e2
877#define LVDS_CH_SWAP2 0x14e3
878/* LVDS */
879#define LVDS_GEN_CNTL 0x14e0
880#define LVDS_PHY_CNTL0 0x14e1
881#define LVDS_PHY_CNTL1 0x14e2
882#define LVDS_PHY_CNTL2 0x14e3
883#define LVDS_PHY_CNTL3 0x14e4
884#define LVDS_PHY_CNTL4 0x14e5
885#define LVDS_PHY_CNTL5 0x14e6
886#define LVDS_SRG_TEST 0x14e8
887#define LVDS_BIST_MUX0 0x14e9
888#define LVDS_BIST_MUX1 0x14ea
889#define LVDS_BIST_FIXED0 0x14eb
890#define LVDS_BIST_FIXED1 0x14ec
891#define LVDS_BIST_CNTL0 0x14ed
892#define LVDS_CLKB_CLKA 0x14ee
893#define LVDS_PHY_CLK_CNTL 0x14ef
894#define LVDS_SER_EN 0x14f0
895#define LVDS_PHY_CNTL6 0x14f1
896#define LVDS_PHY_CNTL7 0x14f2
897#define LVDS_PHY_CNTL8 0x14f3
898#define MLVDS_CLK_CTL0_HI 0x14f4
899#define MLVDS_CLK_CTL0_LO 0x14f5
900 #define mlvds_clk_pattern_reserved 31
901 /* Bit 2:0 */
902 #define mpclk_dly 28
903 /* Bit 1:0 (control phy clok divide 2,4,6,8) */
904 #define mpclk_div 26
905 #define use_mpclk 25
906 #define mlvds_clk_half_delay 24
907 /* Bit 23:0 */
908 #define mlvds_clk_pattern 0
909#define MLVDS_DUAL_GATE_WR_START 0x14f6
910 /* Bit 12:0 */
911 #define mlvds_dual_gate_wr_start 0
912#define MLVDS_DUAL_GATE_WR_END 0x14f7
913 /* Bit 12:0 */
914 #define mlvds_dual_gate_wr_end 0
915#define MLVDS_DUAL_GATE_RD_START 0x14f8
916 /* Bit 12:0 */
917 #define mlvds_dual_gate_rd_start 0
918#define MLVDS_DUAL_GATE_RD_END 0x14f9
919 /* Bit 12:0 */
920 #define mlvds_dual_gate_rd_end 0
921#define MLVDS_SECOND_RESET_CTL 0x14fa
922 /* Bit 12:0 */
Googler9398cc32022-12-02 17:21:52 +0800923 #define MLVDS_2ND_RESET_START 0
Googler4f18c0c2022-09-20 17:23:36 +0800924#define MLVDS_DUAL_GATE_CTL_HI 0x14fb
925#define MLVDS_DUAL_GATE_CTL_LO 0x14fc
926 /* Bit 7:0 */
927 #define mlvds_tcon_field_en 24
928 /* Bit 2:0 */
929 #define mlvds_dual_gate_reserved 21
930 #define mlvds_scan_mode_start_line_bit12 20
931 /* Bit 3:0 */
932 #define mlvds_scan_mode_odd 16
933 /* Bit 3:0 */
934 #define mlvds_scan_mode_even 12
935 /* Bit 11:0 */
936 #define mlvds_scan_mode_start_line 0
937#define MLVDS_RESET_CONFIG_HI 0x14fd
938#define MLVDS_RESET_CONFIG_LO 0x14fe
Googler9398cc32022-12-02 17:21:52 +0800939 #define MLVDS_RESET_RANGE_ENABLE 31
940 #define MLVDS_RESET_RANGE_INV 30
941 #define MLVDS_RESET_CONFIG_RES1 29
Googler4f18c0c2022-09-20 17:23:36 +0800942 /* Bit 11:0 */
Googler9398cc32022-12-02 17:21:52 +0800943 #define MLVDS_RESET_RANGE_LINE_0 16
Googler4f18c0c2022-09-20 17:23:36 +0800944 /* Bit 2:0 */
Googler9398cc32022-12-02 17:21:52 +0800945 #define MLVDS_RESET_CONFIG_RES3 13
Googler4f18c0c2022-09-20 17:23:36 +0800946 /* Bit 11:0 */
Googler9398cc32022-12-02 17:21:52 +0800947 #define MLVDS_RESET_RANGE_LINE_1 0
Googler4f18c0c2022-09-20 17:23:36 +0800948
Googler9398cc32022-12-02 17:21:52 +0800949#define DE_HS_ADDR_T7 0x19d1
950// New from M3 :
951// Bit 15:12 -- Enable OFFSET Double Generate(TOCN3-TCON0)
952#define DE_HE_ADDR_T7 0x19d2
953#define DE_VS_ADDR_T7 0x19d3
954#define DE_VE_ADDR_T7 0x19d4
955#define HSYNC_HS_ADDR_T7 0x19d5
956#define HSYNC_HE_ADDR_T7 0x19d6
957#define HSYNC_VS_ADDR_T7 0x19d7
958#define HSYNC_VE_ADDR_T7 0x19d8
959#define VSYNC_HS_ADDR_T7 0x19d9
960#define VSYNC_HE_ADDR_T7 0x19da
961#define VSYNC_VS_ADDR_T7 0x19db
962#define VSYNC_VE_ADDR_T7 0x19dc
963
964#define LVDS_SER_EN_T7 0x19f0
965#define LVDS_PACK_CNTL_ADDR_T7 0x19d0
966#define LVDS_GEN_CNTL_T7 0x19e0
967#define P2P_CH_SWAP0_T7 0x195e
968#define P2P_CH_SWAP1_T7 0x195f
969#define P2P_BIT_REV_T7 0x1950
Googler4f18c0c2022-09-20 17:23:36 +0800970/* **************************************************************************
971 * Vbyone registers (Note: no MinLVDS in G9tv, share the register)
972 */
973#define VBO_CTRL_L 0x1460
974#define VBO_CTRL_H 0x1461
975#define VBO_SOFT_RST 0x1462
976#define VBO_LANES 0x1463
977#define VBO_VIN_CTRL 0x1464
978#define VBO_ACT_VSIZE 0x1465
979#define VBO_REGION_00 0x1466
980#define VBO_REGION_01 0x1467
981#define VBO_REGION_02 0x1468
982#define VBO_REGION_03 0x1469
983#define VBO_VBK_CTRL_0 0x146a
984#define VBO_VBK_CTRL_1 0x146b
985#define VBO_HBK_CTRL 0x146c
986#define VBO_PXL_CTRL 0x146d
987#define VBO_LANE_SKEW_L 0x146e
988#define VBO_LANE_SKEW_H 0x146f
989#define VBO_GCLK_LANE_L 0x1470
990#define VBO_GCLK_LANE_H 0x1471
991#define VBO_GCLK_MAIN 0x1472
992#define VBO_STATUS_L 0x1473
993#define VBO_STATUS_H 0x1474
994#define VBO_LANE_OUTPUT 0x1475
995#define LCD_PORT_SWAP 0x1476
996#define VBO_TMCHK_THRD_L 0x1478
997#define VBO_TMCHK_THRD_H 0x1479
998#define VBO_FSM_HOLDER_L 0x147a
999#define VBO_FSM_HOLDER_H 0x147b
1000#define VBO_INTR_STATE_CTRL 0x147c
1001#define VBO_INTR_UNMASK 0x147d
1002#define VBO_TMCHK_HSYNC_STATE_L 0x147e
1003#define VBO_TMCHK_HSYNC_STATE_H 0x147f
1004#define VBO_TMCHK_VSYNC_STATE_L 0x14f4
1005#define VBO_TMCHK_VSYNC_STATE_H 0x14f5
1006#define VBO_TMCHK_VDE_STATE_L 0x14f6
1007#define VBO_TMCHK_VDE_STATE_H 0x14f7
1008#define VBO_INTR_STATE 0x14f8
1009#define VBO_INFILTER_CTRL 0x14f9
1010#define VBO_INFILTER_TICK_PERIOD_L 0x14f9
1011#define VBO_INSGN_CTRL 0x14fa
1012#define VBO_INFILTER_TICK_PERIOD_H 0x1477
Googler9398cc32022-12-02 17:21:52 +08001013/* T7 */
1014#define VBO_CTRL_L_T7 0x1960
1015#define VBO_CTRL_H_T7 0x1961
1016#define VBO_SOFT_RST_T7 0x1962
1017#define VBO_LANES_T7 0x1963
1018#define VBO_VIN_CTRL_T7 0x1964
1019#define VBO_ACT_VSIZE_T7 0x1965
1020#define VBO_REGION_00_T7 0x1966
1021#define VBO_REGION_01_T7 0x1967
1022#define VBO_REGION_02_T7 0x1968
1023#define VBO_REGION_03_T7 0x1969
1024#define VBO_VBK_CTRL_0_T7 0x196a
1025#define VBO_VBK_CTRL_1_T7 0x196b
1026#define VBO_HBK_CTRL_T7 0x196c
1027#define VBO_PXL_CTRL_T7 0x196d
1028#define VBO_LANE_SKEW_L_T7 0x196e
1029#define VBO_LANE_SKEW_H_T7 0x196f
1030#define VBO_GCLK_LANE_L_T7 0x1970
1031#define VBO_GCLK_LANE_H_T7 0x1971
1032#define VBO_GCLK_MAIN_T7 0x1972
1033#define VBO_STATUS_L_T7 0x1973
1034#define VBO_STATUS_H_T7 0x1974
1035#define VBO_LANE_OUTPUT_T7 0x1975
1036#define LCD_PORT_SWAP_T7 0x1976
1037#define VBO_TMCHK_THRD_L_T7 0x1978
1038#define VBO_TMCHK_THRD_H_T7 0x1979
1039#define VBO_FSM_HOLDER_L_T7 0x197a
1040#define VBO_FSM_HOLDER_H_T7 0x197b
1041#define VBO_INTR_STATE_CTRL_T7 0x197c
1042#define VBO_INTR_UNMASK_T7 0x197d
1043#define VBO_TMCHK_HSYNC_STATE_L_T7 0x197e
1044#define VBO_TMCHK_HSYNC_STATE_H_T7 0x197f
1045#define VBO_TMCHK_VSYNC_STATE_L_T7 0x19f4
1046#define VBO_TMCHK_VSYNC_STATE_H_T7 0x19f5
1047#define VBO_TMCHK_VDE_STATE_L_T7 0x19f6
1048#define VBO_TMCHK_VDE_STATE_H_T7 0x19f7
1049#define VBO_INTR_STATE_T7 0x19f8
1050#define VBO_INFILTER_CTRL_T7 0x19f9
1051#define VBO_INSGN_CTRL_T7 0x19fa
1052#define VBO_INFILTER_CTRL_H_T7 0x1977
Googler4f18c0c2022-09-20 17:23:36 +08001053
1054/* ********************************
1055 * Video Interface: VENC_VCBUS_BASE = 0x1b
1056 */
1057#define VENC_INTCTRL 0x1b6e
1058
1059/* ********************************
1060 * ENCL: VCBUS_BASE = 0x1c
1061 */
1062/* ENCL */
1063/* bit 15:8 -- vfifo2vd_vd_sel
1064 * bit 7 -- vfifo2vd_drop
1065 * bit 6:1 -- vfifo2vd_delay
1066 * bit 0 -- vfifo2vd_en
1067 */
1068#define ENCL_VFIFO2VD_CTL 0x1c90
1069/* bit 12:0 -- vfifo2vd_pixel_start */
1070#define ENCL_VFIFO2VD_PIXEL_START 0x1c91
1071/* bit 12:00 -- vfifo2vd_pixel_end */
1072#define ENCL_VFIFO2VD_PIXEL_END 0x1c92
1073/* bit 10:0 -- vfifo2vd_line_top_start */
1074#define ENCL_VFIFO2VD_LINE_TOP_START 0x1c93
1075/* bit 10:00 -- vfifo2vd_line_top_end */
1076#define ENCL_VFIFO2VD_LINE_TOP_END 0x1c94
1077/* bit 10:00 -- vfifo2vd_line_bot_start */
1078#define ENCL_VFIFO2VD_LINE_BOT_START 0x1c95
1079/* bit 10:00 -- vfifo2vd_line_bot_end */
1080#define ENCL_VFIFO2VD_LINE_BOT_END 0x1c96
1081#define ENCL_VFIFO2VD_CTL2 0x1c97
1082#define ENCL_TST_EN 0x1c98
1083#define ENCL_TST_MDSEL 0x1c99
1084#define ENCL_TST_Y 0x1c9a
1085#define ENCL_TST_CB 0x1c9b
1086#define ENCL_TST_CR 0x1c9c
1087#define ENCL_TST_CLRBAR_STRT 0x1c9d
1088#define ENCL_TST_CLRBAR_WIDTH 0x1c9e
1089#define ENCL_TST_VDCNT_STSET 0x1c9f
1090
1091/* ENCL registers */
1092#define ENCL_VIDEO_EN 0x1ca0
1093#define ENCL_VIDEO_Y_SCL 0x1ca1
1094#define ENCL_VIDEO_PB_SCL 0x1ca2
1095#define ENCL_VIDEO_PR_SCL 0x1ca3
1096#define ENCL_VIDEO_Y_OFFST 0x1ca4
1097#define ENCL_VIDEO_PB_OFFST 0x1ca5
1098#define ENCL_VIDEO_PR_OFFST 0x1ca6
1099/* ----- Video mode */
1100#define ENCL_VIDEO_MODE 0x1ca7
1101#define ENCL_VIDEO_MODE_ADV 0x1ca8
1102/* --------------- Debug pins */
1103#define ENCL_DBG_PX_RST 0x1ca9
1104#define ENCL_DBG_LN_RST 0x1caa
1105#define ENCL_DBG_PX_INT 0x1cab
1106#define ENCL_DBG_LN_INT 0x1cac
1107/* ----------- Video Advanced setting */
1108#define ENCL_VIDEO_YFP1_HTIME 0x1cad
1109#define ENCL_VIDEO_YFP2_HTIME 0x1cae
1110#define ENCL_VIDEO_YC_DLY 0x1caf
1111#define ENCL_VIDEO_MAX_PXCNT 0x1cb0
1112#define ENCL_VIDEO_HAVON_END 0x1cb1
1113#define ENCL_VIDEO_HAVON_BEGIN 0x1cb2
1114#define ENCL_VIDEO_VAVON_ELINE 0x1cb3
1115#define ENCL_VIDEO_VAVON_BLINE 0x1cb4
1116#define ENCL_VIDEO_HSO_BEGIN 0x1cb5
1117#define ENCL_VIDEO_HSO_END 0x1cb6
1118#define ENCL_VIDEO_VSO_BEGIN 0x1cb7
1119#define ENCL_VIDEO_VSO_END 0x1cb8
1120#define ENCL_VIDEO_VSO_BLINE 0x1cb9
1121#define ENCL_VIDEO_VSO_ELINE 0x1cba
1122#define ENCL_VIDEO_MAX_LNCNT 0x1cbb
1123#define ENCL_VIDEO_BLANKY_VAL 0x1cbc
1124#define ENCL_VIDEO_BLANKPB_VAL 0x1cbd
1125#define ENCL_VIDEO_BLANKPR_VAL 0x1cbe
1126#define ENCL_VIDEO_HOFFST 0x1cbf
1127#define ENCL_VIDEO_VOFFST 0x1cc0
1128#define ENCL_VIDEO_RGB_CTRL 0x1cc1
1129#define ENCL_VIDEO_FILT_CTRL 0x1cc2
1130#define ENCL_VIDEO_OFLD_VPEQ_OFST 0x1cc3
1131#define ENCL_VIDEO_OFLD_VOAV_OFST 0x1cc4
1132#define ENCL_VIDEO_MATRIX_CB 0x1cc5
1133#define ENCL_VIDEO_MATRIX_CR 0x1cc6
1134#define ENCL_VIDEO_RGBIN_CTRL 0x1cc7
1135#define ENCL_MAX_LINE_SWITCH_POINT 0x1cc8
1136#define ENCL_DACSEL_0 0x1cc9
1137#define ENCL_DACSEL_1 0x1cca
1138
1139#define ENCL_VIDEO_H_PRE_DE_END 0x1ccf
1140#define ENCL_VIDEO_H_PRE_DE_BEGIN 0x1cd0
1141#define ENCL_VIDEO_V_PRE_DE_ELINE 0x1cd1
1142#define ENCL_VIDEO_V_PRE_DE_BLINE 0x1cd2
1143#define ENCL_INBUF_CNTL0 0x1cd3
1144#define ENCL_INBUF_CNTL1 0x1cd4
1145#define ENCL_INBUF_CNT 0x1cd5
1146
Googler9398cc32022-12-02 17:21:52 +08001147#define VPU_VENC_CTRL 0x1cef
1148#define VPU_DISP_VIU0_CTRL 0x2786
1149#define VPU_DISP_VIU1_CTRL 0x2787
1150#define VPU_DISP_VIU2_CTRL 0x2788
1151
1152#define LCD_RGB_BASE_ADDR 0x14a5
1153#define LCD_RGB_COEFF_ADDR 0x14a6
1154#define LCD_POL_CNTL_ADDR 0x14a7
1155#define LCD_DITH_CNTL_ADDR 0x14a8
Googler4f18c0c2022-09-20 17:23:36 +08001156/* ********************************
1157 * TCON TOP: TCON_TOP_BASE = 0x2000
1158 * ********************************
1159 */
Googler4f18c0c2022-09-20 17:23:36 +08001160#define TCON_CTRL_TIMING_BASE 0x01b0
1161
1162#define TCON_TOP_BASE 0x2000
1163#define TCON_TOP_CTRL 0x2000
1164#define TCON_RGB_IN_MUX 0x2001
1165#define TCON_OUT_CH_SEL0 0x2002
1166#define TCON_OUT_CH_SEL1 0x2003
1167#define TCON_I2C_DEGLITCH_CNTL 0x2004
1168#define TCON_STATUS0 0x2008 /* read only */
1169#define TCON_PLLLOCK_CNTL 0x2009
1170#define TCON_PLLLCK_RST_CNT 0x200a
1171#define TCON_RST_CTRL 0x200b
1172#define TCON_AXI_OFST0 0x200c
1173#define TCON_DDRIF_CTRL0 0x200d
1174#define TCON_CLK_CTRL 0x200e
1175#define TCON_DDRIF_CTRL1 0x200f
1176#define TCON_STATUS1 0x2010 /* read only */
1177#define TCON_DDRIF_CTRL2 0x2011
1178#define TCON_STATUS2 0x2012 /* read only */
1179#define TCON_AXI_OFST1 0x2013
1180#define TCON_AXI_OFST2 0x2014
1181#define TCON_GPO_CTRL0 0x2015
1182#define TCON_GPO_CTRL1 0x2016
1183#define TCON_GPO_CTRL2 0x2017
1184#define TCON_INTR_WR 0x2020
1185#define TCON_INTR_CLR 0x2021
1186#define TCON_INTR_MASKN 0x2022
1187#define TCON_INTR_RO 0x2023 /* read only */
1188
1189#define P2P_CH_SWAP0 0x4200
1190#define P2P_CH_SWAP1 0x4201
1191
1192/* ********************************
1193 * Video post-processing: VPP_VCBUS_BASE = 0x1d
1194 * Bit 31 vd1_bgosd_exchange_en for preblend
1195 * Bit 30 vd1_bgosd_exchange_en for postblend
1196 * bit 28 color management enable
1197 * Bit 27, reserved
1198 * Bit 26:18, reserved
1199 * Bit 17, osd2 enable for preblend
1200 * Bit 16, osd1 enable for preblend
1201 * Bit 15, reserved
1202 * Bit 14, vd1 enable for preblend
1203 * Bit 13, osd2 enable for postblend
1204 * Bit 12, osd1 enable for postblend
1205 * Bit 11, reserved
1206 * Bit 10, vd1 enable for postblend
1207 * Bit 9, if true, osd1 is alpha premultipiled
1208 * Bit 8, if true, osd2 is alpha premultipiled
1209 * Bit 7, postblend module enable
1210 * Bit 6, preblend module enable
1211 * Bit 5, if true, osd2 foreground compared with osd1 in preblend
1212 * Bit 4, if true, osd2 foreground compared with osd1 in postblend
1213 * Bit 3,
1214 * Bit 2, if true, disable resetting async fifo every vsync, otherwise every
1215 * vsync the aync fifo will be reseted.
1216 * Bit 1,
1217 * Bit 0 if true, the output result of VPP is saturated
1218 */
1219#define VPP2_MISC 0x1926
1220/* Bit 31 vd1_bgosd_exchange_en for preblend
1221 * Bit 30 vd1_bgosd_exchange_en for postblend
1222 * Bit 28 color management enable
1223 * Bit 27, if true, vd2 use viu2 output as the input, otherwise use normal
1224 * vd2 from memory
1225 * Bit 26:18, vd2 alpha
1226 * Bit 17, osd2 enable for preblend
1227 * Bit 16, osd1 enable for preblend
1228 * Bit 15, vd2 enable for preblend
1229 * Bit 14, vd1 enable for preblend
1230 * Bit 13, osd2 enable for postblend
1231 * Bit 12, osd1 enable for postblend
1232 * Bit 11, vd2 enable for postblend
1233 * Bit 10, vd1 enable for postblend
1234 * Bit 9, if true, osd1 is alpha premultipiled
1235 * Bit 8, if true, osd2 is alpha premultipiled
1236 * Bit 7, postblend module enable
1237 * Bit 6, preblend module enable
1238 * Bit 5, if true, osd2 foreground compared with osd1 in preblend
1239 * Bit 4, if true, osd2 foreground compared with osd1 in postblend
1240 * Bit 3,
1241 * Bit 2, if true, disable resetting async fifo every vsync, otherwise every
1242 * vsync the aync fifo will be reseted.
1243 * Bit 1,
1244 * Bit 0 if true, the output result of VPP is saturated
1245 */
1246#define VPP_MISC 0x1d26
1247
1248#define VPP2_POSTBLEND_H_SIZE 0x1921
1249#define VPP_POSTBLEND_H_SIZE 0x1d21
1250/* Bit 3 minus black level enable for vadj2
1251 * Bit 2 Video adjustment enable for vadj2
1252 * Bit 1 minus black level enable for vadj1
1253 * Bit 0 Video adjustment enable for vadj1
1254 */
1255#define VPP_VADJ_CTRL 0x1d40
1256/* Bit 16:8 brightness, signed value
1257 * Bit 7:0 contrast, unsigned value,
1258 * contrast from 0 <= contrast <2
1259 */
1260#define VPP_VADJ1_Y 0x1d41
1261/* cb' = cb*ma + cr*mb
1262 * cr' = cb*mc + cr*md
1263 * all are bit 9:0, signed value, -2 < ma/mb/mc/md < 2
1264 */
1265#define VPP_VADJ1_MA_MB 0x1d42
1266#define VPP_VADJ1_MC_MD 0x1d43
1267/* Bit 16:8 brightness, signed value
1268 * Bit 7:0 contrast, unsigned value,
1269 * contrast from 0 <= contrast <2
1270 */
1271#define VPP_VADJ2_Y 0x1d44
1272/* cb' = cb*ma + cr*mb
1273 * cr' = cb*mc + cr*md
1274 * all are bit 9:0, signed value, -2 < ma/mb/mc/md < 2
1275 */
1276#define VPP_VADJ2_MA_MB 0x1d45
1277#define VPP_VADJ2_MC_MD 0x1d46
1278
1279#define VPP_MATRIX_CTRL 0x1d5f
1280/* Bit 28:16 coef00 */
1281/* Bit 12:0 coef01 */
1282#define VPP_MATRIX_COEF00_01 0x1d60
1283/* Bit 28:16 coef02 */
1284/* Bit 12:0 coef10 */
1285#define VPP_MATRIX_COEF02_10 0x1d61
1286/* Bit 28:16 coef11 */
1287/* Bit 12:0 coef12 */
1288#define VPP_MATRIX_COEF11_12 0x1d62
1289/* Bit 28:16 coef20 */
1290/* Bit 12:0 coef21 */
1291#define VPP_MATRIX_COEF20_21 0x1d63
1292#define VPP_MATRIX_COEF22 0x1d64
1293/* Bit 26:16 offset0 */
1294/* Bit 10:0 offset1 */
1295#define VPP_MATRIX_OFFSET0_1 0x1d65
1296/* Bit 10:0 offset2 */
1297#define VPP_MATRIX_OFFSET2 0x1d66
1298/* Bit 26:16 pre_offset0 */
1299/* Bit 10:0 pre_offset1 */
1300#define VPP_MATRIX_PRE_OFFSET0_1 0x1d67
1301/* Bit 10:0 pre_offset2 */
1302#define VPP_MATRIX_PRE_OFFSET2 0x1d68
1303
1304/* ********************************
1305 * VPU: VPU_VCBUS_BASE = 0x27
1306 * [31:11] Reserved.
1307 * [10: 8] cntl_viu_vdin_sel_data. Select VIU to VDIN data path,
1308 * must clear it first before changing the path selection:
1309 * 3'b000=Disable VIU to VDIN path;
1310 * 3'b001=Enable VIU of ENC_I domain to VDIN;
1311 * 3'b010=Enable VIU of ENC_P domain to VDIN;
1312 * 3'b100=Enable VIU of ENC_T domain to VDIN;
1313 * [ 6: 4] cntl_viu_vdin_sel_clk. Select which clock to VDIN path,
1314 * must clear it first before changing the clock:
1315 * 3'b000=Disable VIU to VDIN clock;
1316 * 3'b001=Select encI clock to VDIN;
1317 * 3'b010=Select encP clock to VDIN;
1318 * 3'b100=Select encT clock to VDIN;
1319 * [ 3: 2] cntl_viu2_sel_venc. Select which one of the encI/P/T
1320 * that VIU2 connects to:
1321 * 0=ENCL, 1=ENCI, 2=ENCP, 3=ENCT.
1322 * [ 1: 0] cntl_viu1_sel_venc. Select which one of the encI/P/T
1323 * that VIU1 connects to:
1324 * 0=ENCL, 1=ENCI, 2=ENCP, 3=ENCT.
1325 */
1326#define VPU_VIU_VENC_MUX_CTRL 0x271a
1327#define ENCL_INFO_READ 0x271f
Googler9398cc32022-12-02 17:21:52 +08001328#define VPU_VENCP_STAT 0x1cec
Googler4f18c0c2022-09-20 17:23:36 +08001329
1330/* Bit 6 RW, gclk_mpeg_vpu_misc
1331 * Bit 5 RW, gclk_mpeg_venc_l_top
1332 * Bit 4 RW, gclk_mpeg_vencl_int
1333 * Bit 3 RW, gclk_mpeg_vencp_int
1334 * Bit 2 RW, gclk_mpeg_vi2_top
1335 * Bit 1 RW, gclk_mpeg_vi_top
1336 * Bit 0 RW, gclk_mpeg_venc_p_top
1337 */
1338#define VPU_CLK_GATE 0x2723
1339#define VPU_MISC_CTRL 0x2740
1340
1341#define VPU_VENCL_DITH_CTRL 0x27e0
1342
1343#define VPU_VLOCK_CTRL 0x3000
1344#define VPU_VLOCK_ADJ_EN_SYNC_CTRL 0x301d
1345#define VPU_VLOCK_GCLK_EN 0x301e
1346/* ******************************** */
1347
1348/* ***********************************************
1349 * DSI Host Controller register offset address define
1350 * VCBUS_BASE = 0x2c(0x2c00 - 0x2cff)
1351 */
1352/* DWC IP registers */
Googler9398cc32022-12-02 17:21:52 +08001353#define MIPI_DSI_DWC_VERSION_OS 0x0000
1354#define MIPI_DSI_DWC_PWR_UP_OS 0x0001
1355#define MIPI_DSI_DWC_CLKMGR_CFG_OS 0x0002
1356#define MIPI_DSI_DWC_DPI_VCID_OS 0x0003
1357#define MIPI_DSI_DWC_DPI_COLOR_CODING_OS 0x0004
1358#define MIPI_DSI_DWC_DPI_CFG_POL_OS 0x0005
1359#define MIPI_DSI_DWC_DPI_LP_CMD_TIM_OS 0x0006
1360#define MIPI_DSI_DWC_PCKHDL_CFG_OS 0x000b
1361#define MIPI_DSI_DWC_GEN_VCID_OS 0x000c
1362#define MIPI_DSI_DWC_MODE_CFG_OS 0x000d
1363#define MIPI_DSI_DWC_VID_MODE_CFG_OS 0x000e
1364#define MIPI_DSI_DWC_VID_PKT_SIZE_OS 0x000f
1365#define MIPI_DSI_DWC_VID_NUM_CHUNKS_OS 0x0010
1366#define MIPI_DSI_DWC_VID_NULL_SIZE_OS 0x0011
1367#define MIPI_DSI_DWC_VID_HSA_TIME_OS 0x0012
1368#define MIPI_DSI_DWC_VID_HBP_TIME_OS 0x0013
1369#define MIPI_DSI_DWC_VID_HLINE_TIME_OS 0x0014
1370#define MIPI_DSI_DWC_VID_VSA_LINES_OS 0x0015
1371#define MIPI_DSI_DWC_VID_VBP_LINES_OS 0x0016
1372#define MIPI_DSI_DWC_VID_VFP_LINES_OS 0x0017
1373#define MIPI_DSI_DWC_VID_VACTIVE_LINES_OS 0x0018
1374#define MIPI_DSI_DWC_EDPI_CMD_SIZE_OS 0x0019
1375#define MIPI_DSI_DWC_CMD_MODE_CFG_OS 0x001a
1376#define MIPI_DSI_DWC_GEN_HDR_OS 0x001b
1377#define MIPI_DSI_DWC_GEN_PLD_DATA_OS 0x001c
1378#define MIPI_DSI_DWC_CMD_PKT_STATUS_OS 0x001d
1379#define MIPI_DSI_DWC_TO_CNT_CFG_OS 0x001e
1380#define MIPI_DSI_DWC_HS_RD_TO_CNT_OS 0x001f
1381#define MIPI_DSI_DWC_LP_RD_TO_CNT_OS 0x0020
1382#define MIPI_DSI_DWC_HS_WR_TO_CNT_OS 0x0021
1383#define MIPI_DSI_DWC_LP_WR_TO_CNT_OS 0x0022
1384#define MIPI_DSI_DWC_BTA_TO_CNT_OS 0x0023
1385#define MIPI_DSI_DWC_SDF_3D_OS 0x0024
1386#define MIPI_DSI_DWC_LPCLK_CTRL_OS 0x0025
1387#define MIPI_DSI_DWC_PHY_TMR_LPCLK_CFG_OS 0x0026
1388#define MIPI_DSI_DWC_PHY_TMR_CFG_OS 0x0027
1389#define MIPI_DSI_DWC_PHY_RSTZ_OS 0x0028
1390#define MIPI_DSI_DWC_PHY_IF_CFG_OS 0x0029
1391#define MIPI_DSI_DWC_PHY_ULPS_CTRL_OS 0x002a
1392#define MIPI_DSI_DWC_PHY_TX_TRIGGERS_OS 0x002b
1393#define MIPI_DSI_DWC_PHY_STATUS_OS 0x002c
1394#define MIPI_DSI_DWC_PHY_TST_CTRL0_OS 0x002d
1395#define MIPI_DSI_DWC_PHY_TST_CTRL1_OS 0x002e
1396#define MIPI_DSI_DWC_INT_ST0_OS 0x002f
1397#define MIPI_DSI_DWC_INT_ST1_OS 0x0030
1398#define MIPI_DSI_DWC_INT_MSK0_OS 0x0031
1399#define MIPI_DSI_DWC_INT_MSK1_OS 0x0032
Googler4f18c0c2022-09-20 17:23:36 +08001400
1401/* Top-level registers */
1402/* [31: 3] Reserved. Default 0.
1403 * [2] RW dpi_rst_n: Default 1.
1404 * 1=Assert SW reset on mipi_dsi_host_dpi block. 0=Release reset.
1405 * [1] RW intr_rst_n: Default 1.
1406 * 1=Assert SW reset on mipi_dsi_host_intr block. 0=Release reset.
1407 * [0] RW dwc_rst_n: Default 1.
1408 * 1=Assert SW reset on IP core. 0=Release reset.
1409 */
Googler9398cc32022-12-02 17:21:52 +08001410#define MIPI_DSI_TOP_SW_RESET 0x00f0
Googler4f18c0c2022-09-20 17:23:36 +08001411/* [31: 5] Reserved. Default 0.
1412 * [4] RW manual_edpihalt: Default 0.
1413 * 1=Manual suspend VencL; 0=do not suspend VencL.
1414 * [3] RW auto_edpihalt_en: Default 0.
1415 * 1=Enable IP's edpihalt signal to suspend VencL;
1416 * 0=IP's edpihalt signal does not affect VencL.
1417 * [2] RW clock_freerun: Apply to auto-clock gate only. Default 0.
1418 * 0=Default, use auto-clock gating to save power;
1419 * 1=use free-run clock, disable auto-clock gating, for debug mode.
1420 * [1] RW enable_pixclk: A manual clock gate option, due to DWC IP does not
1421 * have auto-clock gating. 1=Enable pixclk. Default 0.
1422 * [0] RW enable_sysclk: A manual clock gate option, due to DWC IP does not
1423 * have auto-clock gating. 1=Enable sysclk. Default 0.
1424 */
Googler9398cc32022-12-02 17:21:52 +08001425#define MIPI_DSI_TOP_CLK_CNTL 0x00f1
Googler4f18c0c2022-09-20 17:23:36 +08001426/* [31:24] Reserved. Default 0.
1427 * [23:20] RW dpi_color_mode: Define DPI pixel format. Default 0.
1428 * 0=16-bit RGB565 config 1;
1429 * 1=16-bit RGB565 config 2;
1430 * 2=16-bit RGB565 config 3;
1431 * 3=18-bit RGB666 config 1;
1432 * 4=18-bit RGB666 config 2;
1433 * 5=24-bit RGB888;
1434 * 6=20-bit YCbCr 4:2:2;
1435 * 7=24-bit YCbCr 4:2:2;
1436 * 8=16-bit YCbCr 4:2:2;
1437 * 9=30-bit RGB;
1438 * 10=36-bit RGB;
1439 * 11=12-bit YCbCr 4:2:0.
1440 * [19] Reserved. Default 0.
1441 * [18:16] RW in_color_mode: Define VENC data width. Default 0.
1442 * 0=30-bit pixel;
1443 * 1=24-bit pixel;
1444 * 2=18-bit pixel, RGB666;
1445 * 3=16-bit pixel, RGB565.
1446 * [15:14] RW chroma_subsample: Define method of chroma subsampling. Default 0.
1447 * Applicable to YUV422 or YUV420 only.
1448 * 0=Use even pixel's chroma;
1449 * 1=Use odd pixel's chroma;
1450 * 2=Use averaged value between even and odd pair.
1451 * [13:12] RW comp2_sel: Select which component to be Cr or B: Default 2.
1452 * 0=comp0; 1=comp1; 2=comp2.
1453 * [11:10] RW comp1_sel: Select which component to be Cb or G: Default 1.
1454 * 0=comp0; 1=comp1; 2=comp2.
1455 * [9: 8] RW comp0_sel: Select which component to be Y or R: Default 0.
1456 * 0=comp0; 1=comp1; 2=comp2.
1457 * [7] Reserved. Default 0.
1458 * [6] RW de_pol: Default 0.
1459 * If DE input is active low, set to 1 to invert to active high.
1460 * [5] RW hsync_pol: Default 0.
1461 * If HS input is active low, set to 1 to invert to active high.
1462 * [4] RW vsync_pol: Default 0.
1463 * If VS input is active low, set to 1 to invert to active high.
1464 * [3] RW dpicolorm: Signal to IP. Default 0.
1465 * [2] RW dpishutdn: Signal to IP. Default 0.
1466 * [1] Reserved. Default 0.
1467 * [0] Reserved. Default 0.
1468 */
Googler9398cc32022-12-02 17:21:52 +08001469#define MIPI_DSI_TOP_CNTL 0x00f2
1470#define MIPI_DSI_TOP_SUSPEND_CNTL 0x00f3
1471#define MIPI_DSI_TOP_SUSPEND_LINE 0x00f4
1472#define MIPI_DSI_TOP_SUSPEND_PIX 0x00f5
1473#define MIPI_DSI_TOP_MEAS_CNTL 0x00f6
Googler4f18c0c2022-09-20 17:23:36 +08001474/* [0] R stat_edpihalt: edpihalt signal from IP. Default 0. */
Googler9398cc32022-12-02 17:21:52 +08001475#define MIPI_DSI_TOP_STAT 0x00f7
1476#define MIPI_DSI_TOP_MEAS_STAT_TE0 0x00f8
1477#define MIPI_DSI_TOP_MEAS_STAT_TE1 0x00f9
1478#define MIPI_DSI_TOP_MEAS_STAT_VS0 0x00fa
1479#define MIPI_DSI_TOP_MEAS_STAT_VS1 0x00fb
Googler4f18c0c2022-09-20 17:23:36 +08001480/* [31:16] RW intr_stat/clr. Default 0.
1481 * For each bit, read as this interrupt level status,
1482 * write 1 to clear.
1483 * [31:22] Reserved
1484 * [ 21] stat/clr of eof interrupt
1485 * [ 21] vde_fall interrupt
1486 * [ 19] stat/clr of de_rise interrupt
1487 * [ 18] stat/clr of vs_fall interrupt
1488 * [ 17] stat/clr of vs_rise interrupt
1489 * [ 16] stat/clr of dwc_edpite interrupt
1490 * [15: 0] RW intr_enable. Default 0.
1491 * For each bit, 1=enable this interrupt, 0=disable.
1492 * [15: 6] Reserved
1493 * [ 5] eof interrupt
1494 * [ 4] de_fall interrupt
1495 * [ 3] de_rise interrupt
1496 * [ 2] vs_fall interrupt
1497 * [ 1] vs_rise interrupt
1498 * [ 0] dwc_edpite interrupt
1499 */
Googler9398cc32022-12-02 17:21:52 +08001500#define MIPI_DSI_TOP_INTR_CNTL_STAT 0x00fc
Googler4f18c0c2022-09-20 17:23:36 +08001501// 31: 2 Reserved. Default 0.
1502// 1: 0 RW mem_pd. Default 3.
Googler9398cc32022-12-02 17:21:52 +08001503#define MIPI_DSI_TOP_MEM_PD 0x00fd
Googler4f18c0c2022-09-20 17:23:36 +08001504
Googler4f18c0c2022-09-20 17:23:36 +08001505/* ***********************************************
1506 * DSI PHY register offset address define
1507 */
Googler4f18c0c2022-09-20 17:23:36 +08001508/* [31] soft reset for the phy.
1509 * 1: reset. 0: dessert the reset.
1510 * [30] clock lane soft reset.
1511 * [29] data byte lane 3 soft reset.
1512 * [28] data byte lane 2 soft reset.
1513 * [27] data byte lane 1 soft reset.
1514 * [26] data byte lane 0 soft reset.
1515 * [25] mipi dsi pll clock selection.
1516 * 1: clock from fixed 850Mhz clock source. 0: from VID2 PLL.
1517 * [12] mipi HSbyteclk enable.
1518 * [11] mipi divider clk selection.
1519 * 1: select the mipi DDRCLKHS from clock divider.
1520 * 0: from PLL clock.
1521 * [10] mipi clock divider control.
1522 * 1: /4. 0: /2.
1523 * [9] mipi divider output enable.
1524 * [8] mipi divider counter enable.
1525 * [7] PLL clock enable.
1526 * [5] LPDT data endian.
1527 * 1 = transfer the high bit first. 0 : transfer the low bit first.
1528 * [4] HS data endian.
1529 * [3] force data byte lane in stop mode.
1530 * [2] force data byte lane 0 in receiver mode.
1531 * [1] write 1 to sync the txclkesc input. the internal logic have to
1532 * use txclkesc to decide Txvalid and Txready.
1533 * [0] enalbe the MIPI DSI PHY TxDDRClk.
1534 */
1535#define MIPI_DSI_PHY_CTRL 0x0
1536/* [31] clk lane tx_hs_en control selection.
1537 * 1: from register. 0: use clk lane state machine.
1538 * [30] register bit for clock lane tx_hs_en.
1539 * [29] clk lane tx_lp_en contrl selection.
1540 * 1: from register. 0: from clk lane state machine.
1541 * [28] register bit for clock lane tx_lp_en.
1542 * [27] chan0 tx_hs_en control selection.
1543 * 1: from register. 0: from chan0 state machine.
1544 * [26] register bit for chan0 tx_hs_en.
1545 * [25] chan0 tx_lp_en control selection.
1546 * 1: from register. 0: from chan0 state machine.
1547 * [24] register bit from chan0 tx_lp_en.
1548 * [23] chan0 rx_lp_en control selection.
1549 * 1: from register. 0: from chan0 state machine.
1550 * [22] register bit from chan0 rx_lp_en.
1551 * [21] chan0 contention detection enable control selection.
1552 * 1: from register. 0: from chan0 state machine.
1553 * [20] register bit from chan0 contention dectection enable.
1554 * [19] chan1 tx_hs_en control selection.
1555 * 1: from register. 0: from chan0 state machine.
1556 * [18] register bit for chan1 tx_hs_en.
1557 * [17] chan1 tx_lp_en control selection.
1558 * 1: from register. 0: from chan0 state machine.
1559 * [16] register bit from chan1 tx_lp_en.
1560 * [15] chan2 tx_hs_en control selection.
1561 * 1: from register. 0: from chan0 state machine.
1562 * [14] register bit for chan2 tx_hs_en.
1563 * [13] chan2 tx_lp_en control selection.
1564 * 1: from register. 0: from chan0 state machine.
1565 * [12] register bit from chan2 tx_lp_en.
1566 * [11] chan3 tx_hs_en control selection.
1567 * 1: from register. 0: from chan0 state machine.
1568 * [10] register bit for chan3 tx_hs_en.
1569 * [9] chan3 tx_lp_en control selection.
1570 * 1: from register. 0: from chan0 state machine.
1571 * [8] register bit from chan3 tx_lp_en.
1572 * [4] clk chan power down. this bit is also used as the power down
1573 * of the whole MIPI_DSI_PHY.
1574 * [3] chan3 power down.
1575 * [2] chan2 power down.
1576 * [1] chan1 power down.
1577 * [0] chan0 power down.
1578 */
1579#define MIPI_DSI_CHAN_CTRL 0x1
1580/* [24] rx turn watch dog triggered.
1581 * [23] rx esc watchdog triggered.
1582 * [22] mbias ready.
1583 * [21] txclkesc synced and ready.
1584 * [20:17] clk lane state. {mbias_ready, tx_stop, tx_ulps, tx_hs_active}
1585 * [16:13] chan3 state{0, tx_stop, tx_ulps, tx_hs_active}
1586 * [12:9] chan2 state.{0, tx_stop, tx_ulps, tx_hs_active}
1587 * [8:5] chan1 state. {0, tx_stop, tx_ulps, tx_hs_active}
1588 * [4:0] chan0 state. {TX_STOP, tx_ULPS, hs_active, direction, rxulpsesc}
1589 */
1590#define MIPI_DSI_CHAN_STS 0x2
1591/* [31:24] TCLK_PREPARE.
1592 * [23:16] TCLK_ZERO.
1593 * [15:8] TCLK_POST.
1594 * [7:0] TCLK_TRAIL.
1595 */
1596#define MIPI_DSI_CLK_TIM 0x3
1597/* [31:24] THS_PREPARE.
1598 * [23:16] THS_ZERO.
1599 * [15:8] THS_TRAIL.
1600 * [7:0] THS_EXIT.
1601 */
1602#define MIPI_DSI_HS_TIM 0x4
1603/* [31:24] tTA_GET.
1604 * [23:16] tTA_GO.
1605 * [15:8] tTA_SURE.
1606 * [7:0] tLPX.
1607 */
1608#define MIPI_DSI_LP_TIM 0x5
1609/* wait time to MIPI DIS analog ready. */
1610#define MIPI_DSI_ANA_UP_TIM 0x6
1611/* TINIT. */
1612#define MIPI_DSI_INIT_TIM 0x7
1613/* TWAKEUP. */
1614#define MIPI_DSI_WAKEUP_TIM 0x8
1615/* when in RxULPS check state, after the the logic enable the analog,
1616 * how long we should wait to check the lP state .
1617 */
1618#define MIPI_DSI_LPOK_TIM 0x9
1619/* Watchdog for RX low power state no finished. */
1620#define MIPI_DSI_LP_WCHDOG 0xa
1621/* tMBIAS, after send power up signals to analog,
1622 * how long we should wait for analog powered up.
1623 */
1624#define MIPI_DSI_ANA_CTRL 0xb
1625/* [31:8] reserved for future.
1626 * [7:0] tCLK_PRE.
1627 */
1628#define MIPI_DSI_CLK_TIM1 0xc
1629/* watchdog for turn around waiting time. */
1630#define MIPI_DSI_TURN_WCHDOG 0xd
1631/* When in RxULPS state, how frequency we should to check
1632 * if the TX side out of ULPS state.
1633 */
1634#define MIPI_DSI_ULPS_CHECK 0xe
1635
1636#define MIPI_DSI_TEST_CTRL0 0xf
1637
1638#define MIPI_DSI_TEST_CTRL1 0x10
1639
Googler9398cc32022-12-02 17:21:52 +08001640/*******************backlight***********************/
1641#define VPU_VPU_PWM_V0 0x2730
1642#define VPU_VPU_PWM_V1 0x2731
1643#define VPU_VPU_PWM_V2 0x2732
1644#define VPU_VPU_PWM_V3 0x2733
1645#define VPU_VPU_PWM_H0 0x2734
1646
1647#define VPU_VPU_PWM_V0_T7 0x1ce0
1648#define VPU_VPU_PWM_V1_T7 0x1ce1
1649#define VPU_VPU_PWM_V2_T7 0x1ce2
1650#define VPU_VPU_PWM_V3_T7 0x1ce3
1651#define VPU_VPU_PWM_H0_T7 0x1ce4
Googler4f18c0c2022-09-20 17:23:36 +08001652/* ***********************************************
1653 * register access api
1654 */
Googler9726be62022-12-14 05:53:31 +00001655extern int lcd_reg_gxb[];
Googler9398cc32022-12-02 17:21:52 +08001656extern int lcd_reg_g12a[];
Googler4f18c0c2022-09-20 17:23:36 +08001657extern int lcd_reg_tl1[];
Googler9398cc32022-12-02 17:21:52 +08001658extern int lcd_reg_t5[];
1659extern int lcd_reg_t7[];
Googler4f18c0c2022-09-20 17:23:36 +08001660
Googler9398cc32022-12-02 17:21:52 +08001661int lcd_ioremap(struct aml_lcd_drv_s *pdrv, struct platform_device *pdev);
1662unsigned int lcd_vcbus_read(unsigned int reg);
1663void lcd_vcbus_write(unsigned int reg, unsigned int value);
1664void lcd_vcbus_setb(unsigned int reg, unsigned int value,
1665 unsigned int start, unsigned int len);
1666unsigned int lcd_vcbus_getb(unsigned int reg,
1667 unsigned int start, unsigned int len);
1668void lcd_vcbus_set_mask(unsigned int reg, unsigned int mask);
1669void lcd_vcbus_clr_mask(unsigned int reg, unsigned int mask);
Googler4f18c0c2022-09-20 17:23:36 +08001670
Googler9398cc32022-12-02 17:21:52 +08001671unsigned int lcd_clk_read(unsigned int reg);
1672void lcd_clk_write(unsigned int reg, unsigned int value);
1673void lcd_clk_setb(unsigned int reg, unsigned int value,
1674 unsigned int start, unsigned int len);
1675unsigned int lcd_clk_getb(unsigned int reg,
1676 unsigned int start, unsigned int len);
1677void lcd_clk_set_mask(unsigned int reg, unsigned int mask);
1678void lcd_clk_clr_mask(unsigned int reg, unsigned int mask);
Googler4f18c0c2022-09-20 17:23:36 +08001679
Googler9398cc32022-12-02 17:21:52 +08001680unsigned int lcd_ana_read(unsigned int reg);
1681void lcd_ana_write(unsigned int reg, unsigned int value);
1682void lcd_ana_setb(unsigned int reg, unsigned int value,
1683 unsigned int start, unsigned int len);
1684unsigned int lcd_ana_getb(unsigned int reg,
1685 unsigned int start, unsigned int len);
Googler4f18c0c2022-09-20 17:23:36 +08001686
Googler9398cc32022-12-02 17:21:52 +08001687unsigned int lcd_cbus_read(unsigned int reg);
1688void lcd_cbus_write(unsigned int reg, unsigned int value);
1689void lcd_cbus_setb(unsigned int reg, unsigned int value,
1690 unsigned int start, unsigned int len);
Googler4f18c0c2022-09-20 17:23:36 +08001691
Googler9398cc32022-12-02 17:21:52 +08001692unsigned int lcd_periphs_read(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1693void lcd_periphs_write(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1694 unsigned int value);
Googler4f18c0c2022-09-20 17:23:36 +08001695
Googler9398cc32022-12-02 17:21:52 +08001696unsigned int dsi_host_read(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1697void dsi_host_write(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1698 unsigned int value);
1699void dsi_host_setb(struct aml_lcd_drv_s *pdrv,
1700 unsigned int reg, unsigned int value,
1701 unsigned int start, unsigned int len);
1702unsigned int dsi_host_getb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1703 unsigned int start, unsigned int len);
1704void dsi_host_set_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1705 unsigned int mask);
1706void dsi_host_clr_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1707 unsigned int mask);
1708unsigned int dsi_phy_read(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1709void dsi_phy_write(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1710 unsigned int value);
1711void dsi_phy_setb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1712 unsigned int value,
1713 unsigned int start, unsigned int len);
1714unsigned int dsi_phy_getb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1715 unsigned int start, unsigned int len);
1716void dsi_phy_set_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1717 unsigned int mask);
1718void dsi_phy_clr_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1719 unsigned int mask);
Googler4f18c0c2022-09-20 17:23:36 +08001720
Googler9398cc32022-12-02 17:21:52 +08001721unsigned int lcd_tcon_read(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1722void lcd_tcon_write(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1723 unsigned int value);
1724void lcd_tcon_setb(struct aml_lcd_drv_s *pdrv,
1725 unsigned int reg, unsigned int value,
1726 unsigned int start, unsigned int len);
1727unsigned int lcd_tcon_getb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1728 unsigned int start, unsigned int len);
1729void lcd_tcon_set_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1730 unsigned int mask);
1731void lcd_tcon_clr_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1732 unsigned int mask);
1733void lcd_tcon_update_bits(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1734 unsigned int mask, unsigned int value);
1735int lcd_tcon_check_bits(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1736 unsigned int mask, unsigned int value);
1737unsigned char lcd_tcon_read_byte(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1738void lcd_tcon_write_byte(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1739 unsigned char value);
1740void lcd_tcon_setb_byte(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1741 unsigned char value,
1742 unsigned int start, unsigned int len);
1743unsigned char lcd_tcon_getb_byte(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1744 unsigned int start, unsigned int len);
1745void lcd_tcon_update_bits_byte(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1746 unsigned char mask, unsigned char value);
1747int lcd_tcon_check_bits_byte(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1748 unsigned char mask, unsigned char value);
1749
1750unsigned int dptx_reg_read(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1751void dptx_reg_write(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1752 unsigned int value);
1753void dptx_reg_setb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1754 unsigned int value,
1755 unsigned int start, unsigned int len);
1756unsigned int dptx_reg_getb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1757 unsigned int start, unsigned int len);
1758
1759unsigned int lcd_combo_dphy_read(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1760void lcd_combo_dphy_write(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1761 unsigned int value);
1762void lcd_combo_dphy_setb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1763 unsigned int value,
1764 unsigned int start, unsigned int len);
1765unsigned int lcd_combo_dphy_getb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1766 unsigned int start, unsigned int len);
1767unsigned int lcd_reset_read(struct aml_lcd_drv_s *pdrv, unsigned int reg);
1768void lcd_reset_write(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1769 unsigned int value);
1770void lcd_reset_setb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1771 unsigned int value, unsigned int start, unsigned int len);
1772unsigned int lcd_reset_getb(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1773 unsigned int start, unsigned int len);
1774void lcd_reset_set_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1775 unsigned int mask);
1776void lcd_reset_clr_mask(struct aml_lcd_drv_s *pdrv, unsigned int reg,
1777 unsigned int mask);
Googler4f18c0c2022-09-20 17:23:36 +08001778#endif
1779