blob: 1dab78131a8b6bd3f4fa39858f9d9e63b51f248a [file] [log] [blame]
Shashank Mittal402d0972010-09-29 10:09:52 -07001/*
Amol Jadic52c8a32011-07-12 11:27:04 -07002 * * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Shashank Mittal402d0972010-09-29 10:09:52 -07003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following
11 * disclaimer in the documentation and/or other materials provided
12 * with the distribution.
13 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29#ifndef __PLATFORM_MSM8X60_CLOCK_H
30#define __PLATFORM_MSM8X60_CLOCK_H
31
32/* MMSS CLK CTR base address */
Ajay Dudani8534b1a2011-01-26 11:35:39 -080033#define MSM_MMSS_CLK_CTL_BASE 0x04000000
34#define MSM_MMSS_CLK_CTL_SIZE 4096
35#define REG_MM(off) (MSM_MMSS_CLK_CTL_BASE + (off))
Shashank Mittal402d0972010-09-29 10:09:52 -070036
37#define AHB_NS_REG REG_MM(0x0004)
38#define AXI_NS_REG REG_MM(0x0014)
39#define MM_PLL0_CONFIG_REG REG_MM(0x0310)
40#define MM_PLL0_L_VAL_REG REG_MM(0x0304)
41#define MM_PLL0_M_VAL_REG REG_MM(0x0308)
42#define MM_PLL0_MODE_REG REG_MM(0x0300)
43#define MM_PLL0_N_VAL_REG REG_MM(0x030C)
44#define MM_PLL0_STATUS_REG REG_MM(0x0318)
45#define MM_PLL1_CONFIG_REG REG_MM(0x032C)
46#define MM_PLL1_L_VAL_REG REG_MM(0x0320)
47#define MM_PLL1_M_VAL_REG REG_MM(0x0324)
48#define MM_PLL1_MODE_REG REG_MM(0x031C)
49#define MM_PLL1_N_VAL_REG REG_MM(0x0328)
50#define MM_PLL1_STATUS_REG REG_MM(0x0334)
51#define MM_PLL2_CONFIG_REG REG_MM(0x0348)
52#define MM_PLL2_L_VAL_REG REG_MM(0x033C)
53#define MM_PLL2_M_VAL_REG REG_MM(0x0340)
54#define MM_PLL2_MODE_REG REG_MM(0x0338)
55#define MM_PLL2_N_VAL_REG REG_MM(0x0344)
56#define MM_PLL2_STATUS_REG REG_MM(0x0350)
57
58/* LCD related clock defines */
Ajay Dudani8534b1a2011-01-26 11:35:39 -080059#define MMSS_AHB_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0x04)
60#define MMSS_AHB_EN_REG (MSM_MMSS_CLK_CTL_BASE + 0x08)
61#define MMSS_AXI_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0x14)
62#define MMSS_MAXI_EN_REG (MSM_MMSS_CLK_CTL_BASE + 0x18)
63#define MMSS_MAXI_EN2_REG (MSM_MMSS_CLK_CTL_BASE + 0x20)
64#define MMSS_SAXI_EN_REG (MSM_MMSS_CLK_CTL_BASE + 0x30)
Shashank Mittal402d0972010-09-29 10:09:52 -070065
Ajay Dudani8534b1a2011-01-26 11:35:39 -080066#define MDP_CC_REG (MSM_MMSS_CLK_CTL_BASE + 0xC0)
67#define MDP_MD_REG (MSM_MMSS_CLK_CTL_BASE + 0xC4)
68#define MDP_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0xD0)
69#define LCD_PIXEL_CC_REG (MSM_MMSS_CLK_CTL_BASE + 0xD4)
70#define LCD_PIXEL_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0xDC)
71#define LCD_PIXEL_MD_REG (MSM_MMSS_CLK_CTL_BASE + 0xD8)
Shashank Mittal402d0972010-09-29 10:09:52 -070072
73/* Configured at 200 MHz */
74#define MDP_NS_VAL 0x3F000008
75#define MDP_MD_VAL 0x000001FB
76#define MDP_CC_VAL 0x00000400
77
78/* Configured at 53.99 MHz */
79#define PIXEL_NS_VAL 0xFE4F4002
80#define PIXEL_MD_VAL 0x00A9FDA6
81#define PIXEL_CC_VAL 0x00000080
82
Shashank Mittalc648e712010-10-06 18:37:42 -070083#define MSM_CLK_CTL_BASE 0x00900000
84#define BB_PLL8_L_VAL_REG (MSM_CLK_CTL_BASE + 0x3144)
85#define BB_PLL8_M_VAL_REG (MSM_CLK_CTL_BASE + 0x3148)
86#define BB_PLL8_MODE_REG (MSM_CLK_CTL_BASE + 0x3140)
87#define BB_PLL8_N_VAL_REG (MSM_CLK_CTL_BASE + 0x314C)
Subbaraman Narayanamurthy05872db2011-02-28 11:34:58 -080088#define CE2_HCLK_CTL (MSM_CLK_CTL_BASE + 0x2740)
Shashank Mittalc648e712010-10-06 18:37:42 -070089
Amol Jadic52c8a32011-07-12 11:27:04 -070090/* NS/MD value for UART */
91#define UART_DM_CLK_NS_115200 0xFD940043
92#define UART_DM_CLK_MD_115200 0x0006FD8E
93
94
95#define UART_DM_CLK_RX_TX_BIT_RATE 0xEE
96
97/* GSBI/I2C QUP APPS CLK definitions */
98#define I2C_CLK_MD_24MHz 0x000100FB
99#define I2C_CLK_NS_24MHz 0x00FC005B
Shashank Mittalc648e712010-10-06 18:37:42 -0700100
Shashank Mittal402d0972010-09-29 10:09:52 -0700101enum clk_sources {
102 PLL_0 = 0,
103 PLL_1,
104 PLL_2,
105 PLL_3,
106 PLL_4,
107 PLL_5,
108 PLL_6,
109 PLL_7,
110 PLL_8,
111 MXO,
112 PXO,
113 CXO,
114 NUM_SRC
115};
116
Amol Jadic52c8a32011-07-12 11:27:04 -0700117void hsusb_clock_init(void);
118void clock_config_uart_dm(uint8_t id);
119void clock_config_i2c(uint8_t id, uint32_t freq);
120
Shashank Mittal402d0972010-09-29 10:09:52 -0700121#endif