blob: 0a07c14984058b70b5639231aabcc797c763347f [file] [log] [blame]
Ajay Singh Parmarfa6450d2014-07-23 23:06:29 -07001/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Deepa Dinamani554b0622013-05-16 15:00:30 -07002 *
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 The Linux Foundation 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#ifndef __APQ8084_CLOCK_H
30#define __APQ8084_CLOCK_H
31
32#include <clock.h>
33#include <clock_lib2.h>
34
35#define UART_DM_CLK_RX_TX_BIT_RATE 0xCC
36
Dhaval Patel4a87d522013-10-18 19:02:37 -070037#define REG_MM(off) (MSM_MMSS_CLK_CTL_BASE + (off))
38
39#define MDP_GDSCR REG_MM(0x2304)
40#define GDSC_POWER_ON_BIT BIT(31)
41#define GDSC_POWER_ON_STATUS_BIT BIT(29)
42#define GDSC_EN_FEW_WAIT_MASK (0x0F << 16)
43#define GDSC_EN_FEW_WAIT_256_MASK BIT(19)
44
45#define VSYNC_CMD_RCGR REG_MM(0x2080)
46#define VSYNC_CFG_RCGR REG_MM(0x2084)
47#define MDSS_VSYNC_CBCR REG_MM(0x2328)
48#define MDP_CMD_RCGR REG_MM(0x2040)
49#define MDP_CFG_RCGR REG_MM(0x2044)
50#define MDP_CBCR REG_MM(0x231C)
51#define MDP_LUT_CBCR REG_MM(0x2320)
52#define MDP_AHB_CBCR REG_MM(0x2308)
Ajay Singh Parmarfa6450d2014-07-23 23:06:29 -070053#define MDSS_HDMI_AHB_CBCR REG_MM(0x230C)
54#define MDSS_HDMI_CBCR REG_MM(0x2338)
55#define MDSS_EXTPCLK_CBCR REG_MM(0x2324)
56#define EXTPCLK_CMD_RCGR REG_MM(0x2060)
57#define EXTPCLK_CFG_RCGR REG_MM(0x2064)
58#define HDMI_CMD_RCGR REG_MM(0x2100)
59#define HDMI_CFG_RCGR REG_MM(0x2104)
Dhaval Patel4a87d522013-10-18 19:02:37 -070060
61#define MDP_AXI_CMD_RCGR REG_MM(0x5040)
62#define MDP_AXI_CFG_RCGR REG_MM(0x5044)
63
64#define MDP_AXI_CBCR REG_MM(0x2310)
65#define MMSS_S0_AXI_CBCR REG_MM(0x5064)
66#define MMSS_MMSSNOC_AXI_CBCR REG_MM(0x506C)
67
68#define DSI_BYTE0_CMD_RCGR REG_MM(0x2120)
69#define DSI_BYTE0_CFG_RCGR REG_MM(0x2124)
70#define DSI_BYTE0_CBCR REG_MM(0x233C)
71#define DSI_ESC0_CMD_RCGR REG_MM(0x2160)
72#define DSI_ESC0_CFG_RCGR REG_MM(0x2164)
73#define DSI_ESC0_CBCR REG_MM(0x2344)
74#define DSI_PIXEL0_CMD_RCGR REG_MM(0x2000)
75#define DSI_PIXEL0_CFG_RCGR REG_MM(0x2004)
76#define DSI_PIXEL0_CBCR REG_MM(0x2314)
77#define DSI_PIXEL0_M REG_MM(0x2008)
78#define DSI_PIXEL0_N REG_MM(0x200C)
79#define DSI_PIXEL0_D REG_MM(0x2010)
80
81#define DSI0_PHY_PLL_OUT BIT(8)
82#define PIXEL_SRC_DIV_1_5 BIT(1)
83
84#define DSI_BYTE1_CMD_RCGR REG_MM(0x2140)
85#define DSI_BYTE1_CFG_RCGR REG_MM(0x2144)
86#define DSI_BYTE1_CBCR REG_MM(0x2340)
87#define DSI_ESC1_CMD_RCGR REG_MM(0x2180)
88#define DSI_ESC1_CFG_RCGR REG_MM(0x2184)
89#define DSI_ESC1_CBCR REG_MM(0x2348)
90#define DSI_PIXEL1_CMD_RCGR REG_MM(0x2020)
91#define DSI_PIXEL1_CFG_RCGR REG_MM(0x2024)
92#define DSI_PIXEL1_CBCR REG_MM(0x2318)
93#define DSI_PIXEL1_M REG_MM(0x2028)
94#define DSI_PIXEL1_N REG_MM(0x202C)
95#define DSI_PIXEL1_D REG_MM(0x2030)
Deepa Dinamani554b0622013-05-16 15:00:30 -070096
Kuogee Hsiehacc31942014-06-17 15:12:10 -070097#define MDSS_EDPPIXEL_CBCR REG_MM(0x232C)
98#define MDSS_EDPLINK_CBCR REG_MM(0x2330)
99#define MDSS_EDPAUX_CBCR REG_MM(0x2334)
100#define EDPPIXEL_M REG_MM(0x20A8)
101#define EDPPIXEL_N REG_MM(0x20AC)
102#define EDPPIXEL_D REG_MM(0x20B0)
103#define EDPPIXEL_CFG_RCGR REG_MM(0x20A4)
104#define EDPPIXEL_CMD_RCGR REG_MM(0x20A0)
105#define EDPLINK_CFG_RCGR REG_MM(0x20C4)
106#define EDPLINK_CMD_RCGR REG_MM(0x20C0)
107#define EDPAUX_CFG_RCGR REG_MM(0x20E4)
108#define EDPAUX_CMD_RCGR REG_MM(0x20E0)
109
Deepa Dinamani554b0622013-05-16 15:00:30 -0700110void platform_clock_init(void);
111
112void clock_init_mmc(uint32_t interface);
113void clock_config_mmc(uint32_t interface, uint32_t freq);
114void clock_config_uart_dm(uint8_t id);
115void hsusb_clock_init(void);
116void clock_config_ce(uint8_t instance);
117void mdp_clock_init(void);
118void clock_ce_enable(uint8_t instance);
119void clock_ce_disable(uint8_t instance);
Amol Jadi0a4c9b42013-10-11 14:22:11 -0700120void clock_usb30_init(void);
Deepa Dinamani554b0622013-05-16 15:00:30 -0700121
Veera Sundaram Sankaranae0bd272014-12-17 12:12:49 -0800122void mmss_dsi_clock_enable(uint32_t dsi_pixel0_cfg_rcgr, uint32_t dual_dsi,
123 uint8_t pclk0_m, uint8_t pclk0_n, uint8_t pclk0_d);
124void mmss_dsi_clock_disable(uint32_t dual_dsi);
125void mmss_bus_clock_enable(void);
126void mmss_bus_clock_disable(void);
127void mdp_clock_enable(void);
128void mdp_clock_disable();
129
Deepa Dinamani554b0622013-05-16 15:00:30 -0700130#endif