blob: b2e813b7d12be8ee33909d316f29bbc42ecca55f [file] [log] [blame]
Jayant Shekhare1c955f2016-01-14 14:33:46 +05301/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
Aparna Mallavarapu01fc00a2015-06-01 20:37:05 +05302 *
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
Gaurav Nebhwani6c945a42016-02-16 17:26:51 +053029#ifndef __MSM8953_CLOCK_H
30#define __MSM8953_CLOCK_H
Aparna Mallavarapu01fc00a2015-06-01 20:37:05 +053031
32#include <clock.h>
33#include <clock_lib2.h>
34
35#define UART_DM_CLK_RX_TX_BIT_RATE 0xCC
36
Jayant Shekhare1c955f2016-01-14 14:33:46 +053037#define REG_MM(off) (CLK_CTL_BASE + (off))
38
39#define MDP_GDSCR REG_MM(0x4D078)
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(0x4D02C)
46#define VSYNC_CFG_RCGR REG_MM(0x4D030)
47#define MDSS_VSYNC_CBCR REG_MM(0x4D090)
48
49#define MDP_CMD_RCGR REG_MM(0x4D014)
50#define MDP_CFG_RCGR REG_MM(0x4D018)
51#define MDP_CBCR REG_MM(0x4D088)
52#define MDP_AHB_CBCR REG_MM(0x4D07C)
53#define MDP_AXI_CBCR REG_MM(0x4D080)
54
55#define DSI_BYTE0_CMD_RCGR REG_MM(0x4D044)
56#define DSI_BYTE0_CFG_RCGR REG_MM(0x4D048)
57#define DSI_BYTE0_CBCR REG_MM(0x4D094)
58#define DSI_ESC0_CMD_RCGR REG_MM(0x4D05C)
59#define DSI_ESC0_CFG_RCGR REG_MM(0x4D060)
60#define DSI_ESC0_CBCR REG_MM(0x4D098)
61#define DSI_PIXEL0_CMD_RCGR REG_MM(0x4D000)
62#define DSI_PIXEL0_CFG_RCGR REG_MM(0x4D004)
63#define DSI_PIXEL0_CBCR REG_MM(0x4D084)
64#define DSI_PIXEL0_M REG_MM(0x4D008)
65#define DSI_PIXEL0_N REG_MM(0x4D00C)
66#define DSI_PIXEL0_D REG_MM(0x4D010)
67
68#define DSI0_PHY_PLL_OUT BIT(8)
69#define DSI1_PHY_PLL_OUT BIT(9)
70#define PIXEL_SRC_DIV_1_5 BIT(1)
71
72#define DSI_BYTE1_CMD_RCGR REG_MM(0x4D0B0)
73#define DSI_BYTE1_CFG_RCGR REG_MM(0x4D0B4)
74#define DSI_BYTE1_CBCR REG_MM(0x4D0A0)
75#define DSI_ESC1_CMD_RCGR REG_MM(0x4D0A8)
76#define DSI_ESC1_CFG_RCGR REG_MM(0x4D0AC)
77#define DSI_ESC1_CBCR REG_MM(0x4D09C)
78#define DSI_PIXEL1_CMD_RCGR REG_MM(0x4D0B8)
79#define DSI_PIXEL1_CFG_RCGR REG_MM(0x4D0BC)
80#define DSI_PIXEL1_CBCR REG_MM(0x4D0A4)
81#define DSI_PIXEL1_M REG_MM(0x4D0C0)
82#define DSI_PIXEL1_N REG_MM(0x4D0C4)
83#define DSI_PIXEL1_D REG_MM(0x4D0C8)
84
85#define MMSS_DSI_CLKS_FLAG_DSI0 BIT(0)
86#define MMSS_DSI_CLKS_FLAG_DSI1 BIT(1)
87
Aparna Mallavarapu01fc00a2015-06-01 20:37:05 +053088void platform_clock_init(void);
89
90void clock_init_mmc(uint32_t interface);
91void clock_config_mmc(uint32_t interface, uint32_t freq);
92void clock_config_uart_dm(uint8_t id);
93void hsusb_clock_init(void);
94void clock_config_ce(uint8_t instance);
P.V. Phani Kumar9451ebe2015-12-26 16:31:18 +053095void clock_ce_enable(uint8_t instance);
96void clock_ce_disable(uint8_t instance);
Jayant Shekhare1c955f2016-01-14 14:33:46 +053097void mdp_gdsc_ctrl(uint8_t enable);
98void mdss_bus_clocks_enable(void);
99void mdss_bus_clocks_disable(void);
100void mdp_clock_enable(void);
101void mdp_clock_disable(void);
102void mmss_dsi_clock_enable(uint32_t cfg_rcgr, uint32_t dual_dsi,
103 uint8_t pclk0_m, uint8_t pclk0_n, uint8_t pclk0_d);
104void mmss_dsi_clock_disable(uint32_t dual_dsi);
P.V. Phani Kumar9451ebe2015-12-26 16:31:18 +0530105void clock_usb30_init(void);
106void clock_reset_usb_phy();
Aparna Mallavarapu01fc00a2015-06-01 20:37:05 +0530107#endif