blob: 703a20f6dde453f9f103f030ac66fc3c2d3ffd3f [file] [log] [blame]
Kinson Chikfe931032011-07-21 10:01:34 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29#include <dev/fbcon.h>
30
31//TODO: Make a global PASS / FAIL define
32#define PASS 0
33#define FAIL 1
34
35#define MDP_OVERLAYPROC0_START REG_MDP(0x00004)
36#define MDP_DMA_P_START REG_MDP(0x0000C)
37#define MDP_DMA_S_START REG_MDP(0x00010)
38#define MDP_AXI_RDMASTER_CONFIG REG_MDP(0x00028)
39#define MDP_AXI_WRMASTER_CONFIG REG_MDP(0x00030)
40#define MDP_DISP_INTF_SEL REG_MDP(0x00038)
41#define MDP_MAX_RD_PENDING_CMD_CONFIG REG_MDP(0x0004C)
42#define MDP_INTR_ENABLE REG_MDP(0x00050)
43#define MDP_DSI_CMD_MODE_ID_MAP REG_MDP(0x000A0)
44#define MDP_DSI_CMD_MODE_TRIGGER_EN REG_MDP(0x000A4)
45#define MDP_OVERLAYPROC0_CFG REG_MDP(0x10004)
46#define MDP_DMA_P_CONFIG REG_MDP(0x90000)
47#define MDP_DMA_P_OUT_XY REG_MDP(0x90010)
48#define MDP_DMA_P_SIZE REG_MDP(0x90004)
49#define MDP_DMA_P_BUF_ADDR REG_MDP(0x90008)
50#define MDP_DMA_P_BUF_Y_STRIDE REG_MDP(0x9000C)
51#define MDP_DMA_P_OP_MODE REG_MDP(0x90070)
52#define MDP_DSI_VIDEO_EN REG_MDP(0xE0000)
53#define MDP_DSI_VIDEO_HSYNC_CTL REG_MDP(0xE0004)
54#define MDP_DSI_VIDEO_VSYNC_PERIOD REG_MDP(0xE0008)
55#define MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH REG_MDP(0xE000C)
56#define MDP_DSI_VIDEO_DISPLAY_HCTL REG_MDP(0xE0010)
57#define MDP_DSI_VIDEO_DISPLAY_V_START REG_MDP(0xE0014)
58#define MDP_DSI_VIDEO_DISPLAY_V_END REG_MDP(0xE0018)
59#define MDP_DSI_VIDEO_ACTIVE_HCTL REG_MDP(0xE001C)
60#define MDP_DSI_VIDEO_BORDER_CLR REG_MDP(0xE0028)
61#define MDP_DSI_VIDEO_HSYNC_SKEW REG_MDP(0xE0030)
62#define MDP_DSI_VIDEO_CTL_POLARITY REG_MDP(0xE0038)
63#define MDP_DSI_VIDEO_TEST_CTL REG_MDP(0xE0034)
64
65#define MDP_TEST_MODE_CLK REG_MDP(0xF0000)
66#define MDP_INTR_STATUS REG_MDP(0x00054)
67
68void mdp_setup_dma_p_video_config(unsigned short pack_pattern,
69 unsigned short img_width,
70 unsigned short img_height,
71 unsigned long input_img_addr,
72 unsigned short img_width_full_size,
73 unsigned char ystride);
74int mdp_setup_dma_p_video_mode(unsigned short disp_width,
75 unsigned short disp_height,
76 unsigned short img_width,
77 unsigned short img_height,
78 unsigned short hsync_porch0_fp,
79 unsigned short hsync_porch0_bp,
80 unsigned short vsync_porch0_fp,
81 unsigned short vsync_porch0_bp,
82 unsigned short hsync_width,
83 unsigned short vsync_width,
84 unsigned long input_img_addr,
85 unsigned short img_width_full_size,
86 unsigned short pack_pattern,
87 unsigned char ystride);
88int mipi_dsi_cmd_config(struct fbcon_config mipi_fb_cfg, unsigned short num_of_lanes);
89void mdp_shutdown(void);
90void mdp_disable(void);
91void mdp_start_dma(void);