blob: e148aca2e84df5af913dd3eda3b6fee6ca6c4c96 [file] [log] [blame]
Donghwa Leed84f7832012-04-05 19:36:21 +00001/*
2 * Copyright (C) 2012 Samsung Electronics
3 *
4 * Author: InKi Dae <inki.dae@samsung.com>
5 * Author: Donghwa Lee <dh09.lee@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23#ifndef __ASM_ARM_ARCH_DSIM_H_
24#define __ASM_ARM_ARCH_DSIM_H_
25
26#ifndef __ASSEMBLY__
27
28struct exynos_mipi_dsim {
29 unsigned int status;
30 unsigned int swrst;
31 unsigned int clkctrl;
32 unsigned int timeout;
33 unsigned int config;
34 unsigned int escmode;
35 unsigned int mdresol;
36 unsigned int mvporch;
37 unsigned int mhporch;
38 unsigned int msync;
39 unsigned int sdresol;
40 unsigned int intsrc;
41 unsigned int intmsk;
42 unsigned int pkthdr;
43 unsigned int payload;
44 unsigned int rxfifo;
45 unsigned int fifothld;
46 unsigned int fifoctrl;
47 unsigned int memacchr;
48 unsigned int pllctrl;
49 unsigned int plltmr;
50 unsigned int phyacchr;
51 unsigned int phyacchr1;
52};
53
54#endif /* __ASSEMBLY__ */
55
56/*
57 * Bit Definitions
58 */
59/* DSIM_STATUS */
60#define DSIM_STOP_STATE_DAT(x) (((x) & 0xf) << 0)
61#define DSIM_STOP_STATE_CLK (1 << 8)
62#define DSIM_TX_READY_HS_CLK (1 << 10)
63#define DSIM_PLL_STABLE (1 << 31)
64
65/* DSIM_SWRST */
66#define DSIM_FUNCRST (1 << 16)
67#define DSIM_SWRST (1 << 0)
68
69/* EXYNOS_DSIM_TIMEOUT */
70#define DSIM_LPDR_TOUT_SHIFT (0)
71#define DSIM_BTA_TOUT_SHIFT (16)
72
73/* EXYNOS_DSIM_CLKCTRL */
74#define DSIM_LANE_ESC_CLKEN_SHIFT (19)
75#define DSIM_BYTE_CLKEN_SHIFT (24)
76#define DSIM_BYTE_CLK_SRC_SHIFT (25)
77#define DSIM_PLL_BYPASS_SHIFT (27)
78#define DSIM_ESC_CLKEN_SHIFT (28)
79#define DSIM_TX_REQUEST_HSCLK_SHIFT (31)
80#define DSIM_LANE_ESC_CLKEN(x) (((x) & 0x1f) << \
81 DSIM_LANE_ESC_CLKEN_SHIFT)
82#define DSIM_BYTE_CLK_ENABLE (1 << DSIM_BYTE_CLKEN_SHIFT)
83#define DSIM_BYTE_CLK_DISABLE (0 << DSIM_BYTE_CLKEN_SHIFT)
84#define DSIM_PLL_BYPASS_EXTERNAL (1 << DSIM_PLL_BYPASS_SHIFT)
85#define DSIM_ESC_CLKEN_ENABLE (1 << DSIM_ESC_CLKEN_SHIFT)
86#define DSIM_ESC_CLKEN_DISABLE (0 << DSIM_ESC_CLKEN_SHIFT)
87
88/* EXYNOS_DSIM_CONFIG */
89#define DSIM_NUM_OF_DATALANE_SHIFT (5)
90#define DSIM_SUBPIX_SHIFT (8)
91#define DSIM_MAINPIX_SHIFT (12)
92#define DSIM_SUBVC_SHIFT (16)
93#define DSIM_MAINVC_SHIFT (18)
94#define DSIM_HSA_MODE_SHIFT (20)
95#define DSIM_HBP_MODE_SHIFT (21)
96#define DSIM_HFP_MODE_SHIFT (22)
97#define DSIM_HSE_MODE_SHIFT (23)
98#define DSIM_AUTO_MODE_SHIFT (24)
99#define DSIM_VIDEO_MODE_SHIFT (25)
100#define DSIM_BURST_MODE_SHIFT (26)
101#define DSIM_EOT_PACKET_SHIFT (28)
102#define DSIM_AUTO_FLUSH_SHIFT (29)
103#define DSIM_LANE_ENx(x) (((x) & 0x1f) << 0)
104
105#define DSIM_NUM_OF_DATA_LANE(x) ((x) << DSIM_NUM_OF_DATALANE_SHIFT)
106
107/* EXYNOS_DSIM_ESCMODE */
108#define DSIM_TX_LPDT_SHIFT (6)
109#define DSIM_CMD_LPDT_SHIFT (7)
110#define DSIM_TX_LPDT_LP (1 << DSIM_TX_LPDT_SHIFT)
111#define DSIM_CMD_LPDT_LP (1 << DSIM_CMD_LPDT_SHIFT)
112#define DSIM_STOP_STATE_CNT_SHIFT (21)
113#define DSIM_FORCE_STOP_STATE_SHIFT (20)
114
115/* EXYNOS_DSIM_MDRESOL */
116#define DSIM_MAIN_STAND_BY (1 << 31)
117#define DSIM_MAIN_VRESOL(x) (((x) & 0x7ff) << 16)
118#define DSIM_MAIN_HRESOL(x) (((x) & 0X7ff) << 0)
119
120/* EXYNOS_DSIM_MVPORCH */
121#define DSIM_CMD_ALLOW_SHIFT (28)
122#define DSIM_STABLE_VFP_SHIFT (16)
123#define DSIM_MAIN_VBP_SHIFT (0)
124#define DSIM_CMD_ALLOW_MASK (0xf << DSIM_CMD_ALLOW_SHIFT)
125#define DSIM_STABLE_VFP_MASK (0x7ff << DSIM_STABLE_VFP_SHIFT)
126#define DSIM_MAIN_VBP_MASK (0x7ff << DSIM_MAIN_VBP_SHIFT)
127
128/* EXYNOS_DSIM_MHPORCH */
129#define DSIM_MAIN_HFP_SHIFT (16)
130#define DSIM_MAIN_HBP_SHIFT (0)
131#define DSIM_MAIN_HFP_MASK ((0xffff) << DSIM_MAIN_HFP_SHIFT)
132#define DSIM_MAIN_HBP_MASK ((0xffff) << DSIM_MAIN_HBP_SHIFT)
133
134/* EXYNOS_DSIM_MSYNC */
135#define DSIM_MAIN_VSA_SHIFT (22)
136#define DSIM_MAIN_HSA_SHIFT (0)
137#define DSIM_MAIN_VSA_MASK ((0x3ff) << DSIM_MAIN_VSA_SHIFT)
138#define DSIM_MAIN_HSA_MASK ((0xffff) << DSIM_MAIN_HSA_SHIFT)
139
140/* EXYNOS_DSIM_SDRESOL */
141#define DSIM_SUB_STANDY_SHIFT (31)
142#define DSIM_SUB_VRESOL_SHIFT (16)
143#define DSIM_SUB_HRESOL_SHIFT (0)
144#define DSIM_SUB_STANDY_MASK ((0x1) << DSIM_SUB_STANDY_SHIFT)
145#define DSIM_SUB_VRESOL_MASK ((0x7ff) << DSIM_SUB_VRESOL_SHIFT)
146#define DSIM_SUB_HRESOL_MASK ((0x7ff) << DSIM_SUB_HRESOL_SHIFT)
147
148/* EXYNOS_DSIM_INTSRC */
149#define INTSRC_FRAME_DONE (1 << 24)
150#define INTSRC_PLL_STABLE (1 << 31)
151#define INTSRC_SWRST_RELEASE (1 << 30)
152
153/* EXYNOS_DSIM_INTMSK */
154#define INTMSK_FRAME_DONE (1 << 24)
155
156/* EXYNOS_DSIM_FIFOCTRL */
157#define SFR_HEADER_EMPTY (1 << 22)
158
159/* EXYNOS_DSIM_PKTHDR */
160#define DSIM_PKTHDR_DI(x) (((x) & 0x3f) << 0)
161#define DSIM_PKTHDR_DAT0(x) ((x) << 8)
162#define DSIM_PKTHDR_DAT1(x) ((x) << 16)
163
164/* EXYNOS_DSIM_PHYACCHR */
165#define DSIM_AFC_CTL(x) (((x) & 0x7) << 5)
166#define DSIM_AFC_CTL_SHIFT (5)
167#define DSIM_AFC_EN (1 << 14)
168
169/* EXYNOS_DSIM_PHYACCHR1 */
170#define DSIM_DPDN_SWAP_DATA_SHIFT (0)
171
172/* EXYNOS_DSIM_PLLCTRL */
173#define DSIM_SCALER_SHIFT (1)
174#define DSIM_MAIN_SHIFT (4)
175#define DSIM_PREDIV_SHIFT (13)
176#define DSIM_PRECTRL_SHIFT (20)
177#define DSIM_PLL_EN_SHIFT (23)
178#define DSIM_FREQ_BAND_SHIFT (24)
179#define DSIM_ZEROCTRL_SHIFT (28)
180
181#endif