Shashank Mittal | 402d097 | 2010-09-29 10:09:52 -0700 | [diff] [blame] | 1 | /* |
Amol Jadi | c52c8a3 | 2011-07-12 11:27:04 -0700 | [diff] [blame] | 2 | * * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. |
Shashank Mittal | 402d097 | 2010-09-29 10:09:52 -0700 | [diff] [blame] | 3 | * |
| 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 Dudani | 8534b1a | 2011-01-26 11:35:39 -0800 | [diff] [blame] | 33 | #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 Mittal | 402d097 | 2010-09-29 10:09:52 -0700 | [diff] [blame] | 36 | |
| 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 Dudani | 8534b1a | 2011-01-26 11:35:39 -0800 | [diff] [blame] | 59 | #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 Mittal | 402d097 | 2010-09-29 10:09:52 -0700 | [diff] [blame] | 65 | |
Ajay Dudani | 8534b1a | 2011-01-26 11:35:39 -0800 | [diff] [blame] | 66 | #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 Mittal | 402d097 | 2010-09-29 10:09:52 -0700 | [diff] [blame] | 72 | |
| 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 Mittal | c648e71 | 2010-10-06 18:37:42 -0700 | [diff] [blame] | 83 | #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 Narayanamurthy | 05872db | 2011-02-28 11:34:58 -0800 | [diff] [blame] | 88 | #define CE2_HCLK_CTL (MSM_CLK_CTL_BASE + 0x2740) |
Shashank Mittal | c648e71 | 2010-10-06 18:37:42 -0700 | [diff] [blame] | 89 | |
Amol Jadi | c52c8a3 | 2011-07-12 11:27:04 -0700 | [diff] [blame] | 90 | /* 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 Mittal | c648e71 | 2010-10-06 18:37:42 -0700 | [diff] [blame] | 100 | |
Shashank Mittal | 402d097 | 2010-09-29 10:09:52 -0700 | [diff] [blame] | 101 | enum 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 Jadi | c52c8a3 | 2011-07-12 11:27:04 -0700 | [diff] [blame] | 117 | void hsusb_clock_init(void); |
| 118 | void clock_config_uart_dm(uint8_t id); |
| 119 | void clock_config_i2c(uint8_t id, uint32_t freq); |
| 120 | |
Shashank Mittal | 402d097 | 2010-09-29 10:09:52 -0700 | [diff] [blame] | 121 | #endif |