blob: f6e962a21701643fc7a4c9d418403b5edeee2d46 [file] [log] [blame]
Aparna Mallavarapuca676882015-01-19 20:39:06 +05301/* Copyright (c) 2015, The Linux Foundation. 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 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 __MSM8952_CLOCK_H
30#define __MSM8952_CLOCK_H
31
32#include <clock.h>
33#include <clock_lib2.h>
34
35#define UART_DM_CLK_RX_TX_BIT_RATE 0xCC
36
Padmanabhan Komandurufba66322015-04-13 12:47:31 -070037#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
Padmanabhan Komanduru2655ea62015-06-08 12:23:32 +053068#define DSI_BYTE1_CMD_RCGR REG_MM(0x4D0B0)
69#define DSI_BYTE1_CFG_RCGR REG_MM(0x4D0B4)
70#define DSI_BYTE1_CBCR REG_MM(0x4D0A0)
71#define DSI_ESC1_CMD_RCGR REG_MM(0x4D0A8)
72#define DSI_ESC1_CFG_RCGR REG_MM(0x4D0AC)
73#define DSI_ESC1_CBCR REG_MM(0x4D09C)
74#define DSI_PIXEL1_CMD_RCGR REG_MM(0x4D0B8)
75#define DSI_PIXEL1_CFG_RCGR REG_MM(0x4D0BC)
76#define DSI_PIXEL1_CBCR REG_MM(0x4D0A4)
77#define DSI_PIXEL1_M REG_MM(0x4D0C0)
78#define DSI_PIXEL1_N REG_MM(0x4D0C4)
79#define DSI_PIXEL1_D REG_MM(0x4D0C8)
80
Padmanabhan Komanduru82ae7132015-06-08 15:46:33 +053081#define MMSS_DSI_CLKS_FLAG_DSI0 BIT(0)
82#define MMSS_DSI_CLKS_FLAG_DSI1 BIT(1)
83
Aparna Mallavarapuca676882015-01-19 20:39:06 +053084void platform_clock_init(void);
85
86void clock_init_mmc(uint32_t interface);
87void clock_config_mmc(uint32_t interface, uint32_t freq);
88void clock_config_uart_dm(uint8_t id);
89void hsusb_clock_init(void);
90void clock_config_ce(uint8_t instance);
Aparna Mallavarapubc6315e2015-04-11 04:00:43 +053091void clock_ce_enable(uint8_t instance);
92void clock_ce_disable(uint8_t instance);
Padmanabhan Komandurufba66322015-04-13 12:47:31 -070093void mdp_gdsc_ctrl(uint8_t enable);
94void mdss_bus_clocks_enable(void);
95void mdss_bus_clocks_disable(void);
96void mdp_clock_enable(void);
97void mdp_clock_disable(void);
Padmanabhan Komanduru82ae7132015-06-08 15:46:33 +053098void gcc_dsi_clocks_enable(uint32_t flags, uint8_t pclk0_m,
99 uint8_t pclk0_n, uint8_t pclk0_d);
100void gcc_dsi_clocks_disable(uint32_t flags);
Aparna Mallavarapuca676882015-01-19 20:39:06 +0530101#endif