tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8830 / dispc_reg.h
1 /******************************************************************************
2  ** File Name:    dispc_v3_reg.h                                     *
3  ** Author:       Shan.He                                           *
4  ** DATE:         30/08/2012                                        *
5  ** Copyright:    2012 Spreatrum, Incoporated. All Rights Reserved. *
6  ** Description:                                                    *
7  ******************************************************************************/
8 /******************************************************************************
9  **                   Edit    History                               *
10  **---------------------------------------------------------------------------*
11  ** DATE          NAME            DESCRIPTION                       *
12
13  ******************************************************************************/
14 #ifndef _DISPC_REG_H_
15 #define _DISPC_REG_H_
16
17
18 #include <asm/io.h>
19 #include <asm/arch/sprd_reg_base.h>
20
21
22 /* DISPC regs offset */
23 #define DISPC_CTRL              (0x0000)
24 #define DISPC_SIZE_XY           (0x0004)
25 #define DISPC_RSTN              (0x0008)
26
27 #define DISPC_STS                       (0x0010)
28
29 #define DISPC_IMG_CTRL                  (0x0020)
30 #define DISPC_IMG_Y_BASE_ADDR   (0x0024)
31 #define DISPC_IMG_UV_BASE_ADDR  (0x0028)
32 #define DISPC_IMG_V_BASE_ADDR   (0x002c)
33 #define DISPC_IMG_SIZE_XY                       (0x0030)
34 #define DISPC_IMG_PITCH                 (0x0034)
35 #define DISPC_IMG_DISP_XY                       (0x0038)
36 #define DISPC_BG_COLOR                  (0x003c)
37
38 #define DISPC_OSD_CTRL          (0x0040)
39 #define DISPC_OSD_BASE_ADDR     (0x0044)
40 #define DISPC_OSD_SIZE_XY               (0x0048)
41 #define DISPC_OSD_PITCH         (0x004c)
42 #define DISPC_OSD_DISP_XY               (0x0050)
43 #define DISPC_OSD_ALPHA         (0x0054)
44 #define DISPC_OSD_CK                    (0x0058)
45
46 #define DISPC_Y2R_CTRL                  (0x0060)
47 #define DISPC_Y2R_CONTRAST              (0x0064)
48 #define DISPC_Y2R_SATURATION            (0x0068)
49 #define DISPC_Y2R_BRIGHTNESS            (0x006c)
50
51 #define DISPC_INT_EN                    (0x0070)
52 #define DISPC_INT_CLR                   (0x0074)
53 #define DISPC_INT_STATUS                (0x0078)
54 #define DISPC_INT_RAW           (0x007c)
55
56 #define DISPC_DPI_CTRL          (0x0080)
57 #define DISPC_DPI_H_TIMING      (0x0084)
58 #define DISPC_DPI_V_TIMING      (0x0088)
59 #define DISPC_DPI_STS0          (0x008c)
60 #define DISPC_DPI_STS1          (0x0090)
61
62 #define DISPC_DBI_CTRL          (0x00a0)
63 #define DISPC_DBI_TIMING0               (0x00a4)
64 #define DISPC_DBI_TIMING1               (0x00a8)
65 #define DISPC_DBI_RDATA         (0x00ac)
66 #define DISPC_DBI_CMD           (0x00b0)
67 #define DISPC_DBI_DATA          (0x00b4)
68 #define DISPC_DBI_QUEUE         (0x00b8)
69
70 //shadow register , read only
71 #define SHDW_IMG_CTRL                           (0x00C0)
72 #define SHDW_IMG_Y_BASE_ADDR            (0x00C4)
73 #define SHDW_IMG_UV_BASE_ADDR           (0x00C8)
74 #define SHDW_IMG_V_BASE_ADDR            (0x00CC)
75 #define SHDW_IMG_SIZE_XY                        (0x00D0)
76 #define SHDW_IMG_PITCH                          (0x00D4)
77 #define SHDW_IMG_DISP_XY                        (0x00D8)
78 #define SHDW_BG_COLOR                           (0x00DC)
79 #define SHDW_OSD_CTRL                           (0x00E0)
80 #define SHDW_OSD_BASE_ADDR                      (0x00E4)
81 #define SHDW_OSD_SIZE_XY                        (0x00E8)
82 #define SHDW_OSD_PITCH                          (0x00EC)
83 #define SHDW_OSD_DISP_XY                        (0x00F0)
84 #define SHDW_OSD_ALPHA                          (0x00F4)
85 #define SHDW_OSD_CK                                     (0x00F8)
86 #define SHDW_Y2R_CTRL                           (0x0100)
87 #define SHDW_Y2R_CONTRAST                       (0x0104)
88 #define SHDW_Y2R_SATURATION                     (0x0108)
89 #define SHDW_Y2R_BRIGHTNESS                     (0x010C)
90 #define SHDW_DPI_H_TIMING                       (0x0110)
91 #define SHDW_DPI_V_TIMING                       (0x0114)
92 #define DISPC_TE_SYNC_DELAY     (0x00bc)
93
94 static inline uint32_t dispc_read(uint32_t reg)
95 {
96         return __raw_readl(DISPC_CTL_BEGIN + reg);
97 }
98
99 static inline void dispc_write(uint32_t value, uint32_t reg)
100 {
101         __raw_writel(value, (DISPC_CTL_BEGIN + reg));
102 }
103
104 static inline void dispc_set_bits(uint32_t bits, uint32_t reg)
105 {
106         dispc_write(dispc_read(reg) | bits, reg);
107 }
108
109 static inline void dispc_clear_bits(uint32_t bits, uint32_t reg)
110 {
111         dispc_write(dispc_read(reg) & ~bits, reg);
112 }
113
114 #endif
115