SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * HW data initialization for OMAP5 |
| 4 | * |
| 5 | * (C) Copyright 2013 |
| 6 | * Texas Instruments, <www.ti.com> |
| 7 | * |
| 8 | * Sricharan R <r.sricharan@ti.com> |
| 9 | * |
| 10 | * See file CREDITS for list of people who contributed to this |
| 11 | * project. |
| 12 | * |
| 13 | * This program is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU General Public License as |
| 15 | * published by the Free Software Foundation; either version 2 of |
| 16 | * the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This program is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | * GNU General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU General Public License |
| 24 | * along with this program; if not, write to the Free Software |
| 25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 26 | * MA 02111-1307 USA |
| 27 | */ |
| 28 | #include <common.h> |
| 29 | #include <asm/arch/omap.h> |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 30 | #include <asm/arch/sys_proto.h> |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 31 | #include <asm/omap_common.h> |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 32 | #include <asm/arch/clocks.h> |
SRICHARAN R | 00d328c | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 33 | #include <asm/omap_gpio.h> |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 34 | #include <asm/io.h> |
Lokesh Vutla | d8ac050 | 2013-02-04 04:22:05 +0000 | [diff] [blame] | 35 | #include <asm/emif.h> |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 36 | |
| 37 | struct prcm_regs const **prcm = |
| 38 | (struct prcm_regs const **) OMAP_SRAM_SCRATCH_PRCM_PTR; |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 39 | struct dplls const **dplls_data = |
| 40 | (struct dplls const **) OMAP_SRAM_SCRATCH_DPLLS_PTR; |
SRICHARAN R | 00d328c | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 41 | struct vcores_data const **omap_vcores = |
| 42 | (struct vcores_data const **) OMAP_SRAM_SCRATCH_VCORES_PTR; |
Lokesh Vutla | 834b6b0 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 43 | struct omap_sys_ctrl_regs const **ctrl = |
| 44 | (struct omap_sys_ctrl_regs const **)OMAP5_SRAM_SCRATCH_SYS_CTRL; |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 45 | |
| 46 | static const struct dpll_params mpu_dpll_params_1_5ghz[NUM_SYS_CLKS] = { |
| 47 | {125, 0, 1, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 48 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 49 | {625, 6, 1, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 50 | {625, 7, 1, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 51 | {750, 12, 1, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 52 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 53 | {625, 15, 1, -1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 54 | }; |
| 55 | |
| 56 | static const struct dpll_params mpu_dpll_params_2ghz[NUM_SYS_CLKS] = { |
| 57 | {500, 2, 1, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 58 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 59 | {2024, 16, 1, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 60 | {625, 5, 1, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 61 | {1000, 12, 1, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 62 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 63 | {625, 11, 1, -1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 64 | }; |
| 65 | |
| 66 | static const struct dpll_params mpu_dpll_params_1100mhz[NUM_SYS_CLKS] = { |
| 67 | {275, 2, 1, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 68 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 69 | {1375, 20, 1, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 70 | {1375, 23, 1, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 71 | {550, 12, 1, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 72 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 73 | {1375, 47, 1, -1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 74 | }; |
| 75 | |
| 76 | static const struct dpll_params mpu_dpll_params_800mhz[NUM_SYS_CLKS] = { |
| 77 | {200, 2, 1, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 78 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 79 | {1000, 20, 1, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 80 | {375, 8, 1, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 81 | {400, 12, 1, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 82 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 83 | {375, 17, 1, -1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 84 | }; |
| 85 | |
| 86 | static const struct dpll_params mpu_dpll_params_400mhz[NUM_SYS_CLKS] = { |
| 87 | {200, 2, 2, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 88 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 89 | {1000, 20, 2, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 90 | {375, 8, 2, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 91 | {400, 12, 2, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 92 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 93 | {375, 17, 2, -1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 94 | }; |
| 95 | |
| 96 | static const struct dpll_params mpu_dpll_params_550mhz[NUM_SYS_CLKS] = { |
| 97 | {275, 2, 2, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 98 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 99 | {1375, 20, 2, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 100 | {1375, 23, 2, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 101 | {550, 12, 2, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 102 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 103 | {1375, 47, 2, -1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 104 | }; |
| 105 | |
| 106 | static const struct dpll_params |
| 107 | core_dpll_params_2128mhz_ddr532[NUM_SYS_CLKS] = { |
| 108 | {266, 2, 2, 5, 8, 4, 62, 5, 5, 7}, /* 12 MHz */ |
| 109 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 110 | {570, 8, 2, 5, 8, 4, 62, 5, 5, 7}, /* 16.8 MHz */ |
| 111 | {665, 11, 2, 5, 8, 4, 62, 5, 5, 7}, /* 19.2 MHz */ |
| 112 | {532, 12, 2, 5, 8, 4, 62, 5, 5, 7}, /* 26 MHz */ |
| 113 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 114 | {665, 23, 2, 5, 8, 4, 62, 5, 5, 7} /* 38.4 MHz */ |
| 115 | }; |
| 116 | |
| 117 | static const struct dpll_params |
| 118 | core_dpll_params_2128mhz_ddr266[NUM_SYS_CLKS] = { |
| 119 | {266, 2, 4, 5, 8, 8, 62, 10, 10, 14}, /* 12 MHz */ |
| 120 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 121 | {570, 8, 4, 5, 8, 8, 62, 10, 10, 14}, /* 16.8 MHz */ |
| 122 | {665, 11, 4, 5, 8, 8, 62, 10, 10, 14}, /* 19.2 MHz */ |
| 123 | {532, 12, 4, 8, 8, 8, 62, 10, 10, 14}, /* 26 MHz */ |
| 124 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 125 | {665, 23, 4, 8, 8, 8, 62, 10, 10, 14} /* 38.4 MHz */ |
| 126 | }; |
| 127 | |
| 128 | static const struct dpll_params per_dpll_params_768mhz[NUM_SYS_CLKS] = { |
| 129 | {32, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 12 MHz */ |
| 130 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 131 | {160, 6, 4, 3, 6, 4, -1, 2, -1, -1}, /* 16.8 MHz */ |
| 132 | {20, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 19.2 MHz */ |
| 133 | {192, 12, 4, 3, 6, 4, -1, 2, -1, -1}, /* 26 MHz */ |
| 134 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 135 | {10, 0, 4, 3, 6, 4, -1, 2, -1, -1} /* 38.4 MHz */ |
| 136 | }; |
| 137 | |
| 138 | static const struct dpll_params iva_dpll_params_2330mhz[NUM_SYS_CLKS] = { |
| 139 | {1165, 11, -1, -1, 5, 6, -1, -1, -1, -1}, /* 12 MHz */ |
| 140 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 141 | {2011, 28, -1, -1, 5, 6, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 142 | {1881, 30, -1, -1, 5, 6, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 143 | {1165, 25, -1, -1, 5, 6, -1, -1, -1, -1}, /* 26 MHz */ |
| 144 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 145 | {1972, 64, -1, -1, 5, 6, -1, -1, -1, -1} /* 38.4 MHz */ |
| 146 | }; |
| 147 | |
| 148 | /* ABE M & N values with sys_clk as source */ |
| 149 | static const struct dpll_params |
| 150 | abe_dpll_params_sysclk_196608khz[NUM_SYS_CLKS] = { |
| 151 | {49, 5, 1, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 152 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 153 | {35, 5, 1, 1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 154 | {46, 8, 1, 1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 155 | {34, 8, 1, 1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 156 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 157 | {64, 24, 1, 1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 158 | }; |
| 159 | |
| 160 | /* ABE M & N values with 32K clock as source */ |
| 161 | static const struct dpll_params abe_dpll_params_32k_196608khz = { |
| 162 | 750, 0, 1, 1, -1, -1, -1, -1, -1, -1 |
| 163 | }; |
| 164 | |
| 165 | static const struct dpll_params usb_dpll_params_1920mhz[NUM_SYS_CLKS] = { |
| 166 | {400, 4, 2, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ |
| 167 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ |
| 168 | {400, 6, 2, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ |
| 169 | {400, 7, 2, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ |
| 170 | {480, 12, 2, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ |
| 171 | {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ |
| 172 | {400, 15, 2, -1, -1, -1, -1, -1, -1, -1} /* 38.4 MHz */ |
| 173 | }; |
| 174 | |
| 175 | struct dplls omap5_dplls_es1 = { |
| 176 | .mpu = mpu_dpll_params_800mhz, |
| 177 | .core = core_dpll_params_2128mhz_ddr532, |
| 178 | .per = per_dpll_params_768mhz, |
| 179 | .iva = iva_dpll_params_2330mhz, |
| 180 | #ifdef CONFIG_SYS_OMAP_ABE_SYSCK |
| 181 | .abe = abe_dpll_params_sysclk_196608khz, |
| 182 | #else |
| 183 | .abe = &abe_dpll_params_32k_196608khz, |
| 184 | #endif |
| 185 | .usb = usb_dpll_params_1920mhz |
| 186 | }; |
| 187 | |
SRICHARAN R | 00d328c | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 188 | struct pmic_data palmas = { |
| 189 | .base_offset = PALMAS_SMPS_BASE_VOLT_UV, |
| 190 | .step = 10000, /* 10 mV represented in uV */ |
| 191 | /* |
| 192 | * Offset codes 1-6 all give the base voltage in Palmas |
| 193 | * Offset code 0 switches OFF the SMPS |
| 194 | */ |
| 195 | .start_code = 6, |
| 196 | }; |
| 197 | |
| 198 | struct vcores_data omap5430_volts = { |
| 199 | .mpu.value = VDD_MPU, |
| 200 | .mpu.addr = SMPS_REG_ADDR_12_MPU, |
| 201 | .mpu.pmic = &palmas, |
| 202 | |
| 203 | .core.value = VDD_CORE, |
| 204 | .core.addr = SMPS_REG_ADDR_8_CORE, |
| 205 | .core.pmic = &palmas, |
| 206 | |
| 207 | .mm.value = VDD_MM, |
| 208 | .mm.addr = SMPS_REG_ADDR_45_IVA, |
| 209 | .mm.pmic = &palmas, |
| 210 | }; |
| 211 | |
| 212 | struct vcores_data omap5432_volts = { |
| 213 | .mpu.value = VDD_MPU_5432, |
| 214 | .mpu.addr = SMPS_REG_ADDR_12_MPU, |
| 215 | .mpu.pmic = &palmas, |
| 216 | |
| 217 | .core.value = VDD_CORE_5432, |
| 218 | .core.addr = SMPS_REG_ADDR_8_CORE, |
| 219 | .core.pmic = &palmas, |
| 220 | |
| 221 | .mm.value = VDD_MM_5432, |
| 222 | .mm.addr = SMPS_REG_ADDR_45_IVA, |
| 223 | .mm.pmic = &palmas, |
| 224 | }; |
| 225 | |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 226 | /* |
| 227 | * Enable essential clock domains, modules and |
| 228 | * do some additional special settings needed |
| 229 | */ |
| 230 | void enable_basic_clocks(void) |
| 231 | { |
| 232 | u32 const clk_domains_essential[] = { |
| 233 | (*prcm)->cm_l4per_clkstctrl, |
| 234 | (*prcm)->cm_l3init_clkstctrl, |
| 235 | (*prcm)->cm_memif_clkstctrl, |
| 236 | (*prcm)->cm_l4cfg_clkstctrl, |
| 237 | 0 |
| 238 | }; |
| 239 | |
| 240 | u32 const clk_modules_hw_auto_essential[] = { |
| 241 | (*prcm)->cm_l3_2_gpmc_clkctrl, |
| 242 | (*prcm)->cm_memif_emif_1_clkctrl, |
| 243 | (*prcm)->cm_memif_emif_2_clkctrl, |
| 244 | (*prcm)->cm_l4cfg_l4_cfg_clkctrl, |
| 245 | (*prcm)->cm_wkup_gpio1_clkctrl, |
| 246 | (*prcm)->cm_l4per_gpio2_clkctrl, |
| 247 | (*prcm)->cm_l4per_gpio3_clkctrl, |
| 248 | (*prcm)->cm_l4per_gpio4_clkctrl, |
| 249 | (*prcm)->cm_l4per_gpio5_clkctrl, |
| 250 | (*prcm)->cm_l4per_gpio6_clkctrl, |
| 251 | 0 |
| 252 | }; |
| 253 | |
| 254 | u32 const clk_modules_explicit_en_essential[] = { |
| 255 | (*prcm)->cm_wkup_gptimer1_clkctrl, |
| 256 | (*prcm)->cm_l3init_hsmmc1_clkctrl, |
| 257 | (*prcm)->cm_l3init_hsmmc2_clkctrl, |
| 258 | (*prcm)->cm_l4per_gptimer2_clkctrl, |
| 259 | (*prcm)->cm_wkup_wdtimer2_clkctrl, |
| 260 | (*prcm)->cm_l4per_uart3_clkctrl, |
| 261 | (*prcm)->cm_l4per_i2c1_clkctrl, |
| 262 | 0 |
| 263 | }; |
| 264 | |
| 265 | /* Enable optional additional functional clock for GPIO4 */ |
| 266 | setbits_le32((*prcm)->cm_l4per_gpio4_clkctrl, |
| 267 | GPIO4_CLKCTRL_OPTFCLKEN_MASK); |
| 268 | |
| 269 | /* Enable 96 MHz clock for MMC1 & MMC2 */ |
| 270 | setbits_le32((*prcm)->cm_l3init_hsmmc1_clkctrl, |
| 271 | HSMMC_CLKCTRL_CLKSEL_MASK); |
| 272 | setbits_le32((*prcm)->cm_l3init_hsmmc2_clkctrl, |
| 273 | HSMMC_CLKCTRL_CLKSEL_MASK); |
| 274 | |
| 275 | /* Set the correct clock dividers for mmc */ |
| 276 | setbits_le32((*prcm)->cm_l3init_hsmmc1_clkctrl, |
| 277 | HSMMC_CLKCTRL_CLKSEL_DIV_MASK); |
| 278 | setbits_le32((*prcm)->cm_l3init_hsmmc2_clkctrl, |
| 279 | HSMMC_CLKCTRL_CLKSEL_DIV_MASK); |
| 280 | |
| 281 | /* Select 32KHz clock as the source of GPTIMER1 */ |
| 282 | setbits_le32((*prcm)->cm_wkup_gptimer1_clkctrl, |
| 283 | GPTIMER1_CLKCTRL_CLKSEL_MASK); |
| 284 | |
| 285 | do_enable_clocks(clk_domains_essential, |
| 286 | clk_modules_hw_auto_essential, |
| 287 | clk_modules_explicit_en_essential, |
| 288 | 1); |
| 289 | |
| 290 | /* Select 384Mhz for GPU as its the POR for ES1.0 */ |
| 291 | setbits_le32((*prcm)->cm_sgx_sgx_clkctrl, |
| 292 | CLKSEL_GPU_HYD_GCLK_MASK); |
| 293 | setbits_le32((*prcm)->cm_sgx_sgx_clkctrl, |
| 294 | CLKSEL_GPU_CORE_GCLK_MASK); |
| 295 | |
| 296 | /* Enable SCRM OPT clocks for PER and CORE dpll */ |
| 297 | setbits_le32((*prcm)->cm_wkupaon_scrm_clkctrl, |
| 298 | OPTFCLKEN_SCRM_PER_MASK); |
| 299 | setbits_le32((*prcm)->cm_wkupaon_scrm_clkctrl, |
| 300 | OPTFCLKEN_SCRM_CORE_MASK); |
| 301 | } |
| 302 | |
| 303 | void enable_basic_uboot_clocks(void) |
| 304 | { |
| 305 | u32 const clk_domains_essential[] = { |
| 306 | 0 |
| 307 | }; |
| 308 | |
| 309 | u32 const clk_modules_hw_auto_essential[] = { |
| 310 | 0 |
| 311 | }; |
| 312 | |
| 313 | u32 const clk_modules_explicit_en_essential[] = { |
| 314 | (*prcm)->cm_l4per_mcspi1_clkctrl, |
| 315 | (*prcm)->cm_l4per_i2c2_clkctrl, |
| 316 | (*prcm)->cm_l4per_i2c3_clkctrl, |
| 317 | (*prcm)->cm_l4per_i2c4_clkctrl, |
| 318 | (*prcm)->cm_l3init_hsusbtll_clkctrl, |
| 319 | (*prcm)->cm_l3init_hsusbhost_clkctrl, |
| 320 | (*prcm)->cm_l3init_fsusb_clkctrl, |
| 321 | 0 |
| 322 | }; |
| 323 | |
| 324 | do_enable_clocks(clk_domains_essential, |
| 325 | clk_modules_hw_auto_essential, |
| 326 | clk_modules_explicit_en_essential, |
| 327 | 1); |
| 328 | } |
| 329 | |
| 330 | /* |
| 331 | * Enable non-essential clock domains, modules and |
| 332 | * do some additional special settings needed |
| 333 | */ |
| 334 | void enable_non_essential_clocks(void) |
| 335 | { |
| 336 | u32 const clk_domains_non_essential[] = { |
| 337 | (*prcm)->cm_mpu_m3_clkstctrl, |
| 338 | (*prcm)->cm_ivahd_clkstctrl, |
| 339 | (*prcm)->cm_dsp_clkstctrl, |
| 340 | (*prcm)->cm_dss_clkstctrl, |
| 341 | (*prcm)->cm_sgx_clkstctrl, |
| 342 | (*prcm)->cm1_abe_clkstctrl, |
| 343 | (*prcm)->cm_c2c_clkstctrl, |
| 344 | (*prcm)->cm_cam_clkstctrl, |
| 345 | (*prcm)->cm_dss_clkstctrl, |
| 346 | (*prcm)->cm_sdma_clkstctrl, |
| 347 | 0 |
| 348 | }; |
| 349 | |
| 350 | u32 const clk_modules_hw_auto_non_essential[] = { |
| 351 | (*prcm)->cm_mpu_m3_mpu_m3_clkctrl, |
| 352 | (*prcm)->cm_ivahd_ivahd_clkctrl, |
| 353 | (*prcm)->cm_ivahd_sl2_clkctrl, |
| 354 | (*prcm)->cm_dsp_dsp_clkctrl, |
| 355 | (*prcm)->cm_l3instr_l3_3_clkctrl, |
| 356 | (*prcm)->cm_l3instr_l3_instr_clkctrl, |
| 357 | (*prcm)->cm_l3instr_intrconn_wp1_clkctrl, |
| 358 | (*prcm)->cm_l3init_hsi_clkctrl, |
| 359 | (*prcm)->cm_l4per_hdq1w_clkctrl, |
| 360 | 0 |
| 361 | }; |
| 362 | |
| 363 | u32 const clk_modules_explicit_en_non_essential[] = { |
| 364 | (*prcm)->cm1_abe_aess_clkctrl, |
| 365 | (*prcm)->cm1_abe_pdm_clkctrl, |
| 366 | (*prcm)->cm1_abe_dmic_clkctrl, |
| 367 | (*prcm)->cm1_abe_mcasp_clkctrl, |
| 368 | (*prcm)->cm1_abe_mcbsp1_clkctrl, |
| 369 | (*prcm)->cm1_abe_mcbsp2_clkctrl, |
| 370 | (*prcm)->cm1_abe_mcbsp3_clkctrl, |
| 371 | (*prcm)->cm1_abe_slimbus_clkctrl, |
| 372 | (*prcm)->cm1_abe_timer5_clkctrl, |
| 373 | (*prcm)->cm1_abe_timer6_clkctrl, |
| 374 | (*prcm)->cm1_abe_timer7_clkctrl, |
| 375 | (*prcm)->cm1_abe_timer8_clkctrl, |
| 376 | (*prcm)->cm1_abe_wdt3_clkctrl, |
| 377 | (*prcm)->cm_l4per_gptimer9_clkctrl, |
| 378 | (*prcm)->cm_l4per_gptimer10_clkctrl, |
| 379 | (*prcm)->cm_l4per_gptimer11_clkctrl, |
| 380 | (*prcm)->cm_l4per_gptimer3_clkctrl, |
| 381 | (*prcm)->cm_l4per_gptimer4_clkctrl, |
| 382 | (*prcm)->cm_l4per_mcspi2_clkctrl, |
| 383 | (*prcm)->cm_l4per_mcspi3_clkctrl, |
| 384 | (*prcm)->cm_l4per_mcspi4_clkctrl, |
| 385 | (*prcm)->cm_l4per_mmcsd3_clkctrl, |
| 386 | (*prcm)->cm_l4per_mmcsd4_clkctrl, |
| 387 | (*prcm)->cm_l4per_mmcsd5_clkctrl, |
| 388 | (*prcm)->cm_l4per_uart1_clkctrl, |
| 389 | (*prcm)->cm_l4per_uart2_clkctrl, |
| 390 | (*prcm)->cm_l4per_uart4_clkctrl, |
| 391 | (*prcm)->cm_wkup_keyboard_clkctrl, |
| 392 | (*prcm)->cm_wkup_wdtimer2_clkctrl, |
| 393 | (*prcm)->cm_cam_iss_clkctrl, |
| 394 | (*prcm)->cm_cam_fdif_clkctrl, |
| 395 | (*prcm)->cm_dss_dss_clkctrl, |
| 396 | (*prcm)->cm_sgx_sgx_clkctrl, |
| 397 | 0 |
| 398 | }; |
| 399 | |
| 400 | /* Enable optional functional clock for ISS */ |
| 401 | setbits_le32((*prcm)->cm_cam_iss_clkctrl, ISS_CLKCTRL_OPTFCLKEN_MASK); |
| 402 | |
| 403 | /* Enable all optional functional clocks of DSS */ |
| 404 | setbits_le32((*prcm)->cm_dss_dss_clkctrl, DSS_CLKCTRL_OPTFCLKEN_MASK); |
| 405 | |
| 406 | do_enable_clocks(clk_domains_non_essential, |
| 407 | clk_modules_hw_auto_non_essential, |
| 408 | clk_modules_explicit_en_non_essential, |
| 409 | 0); |
| 410 | |
| 411 | /* Put camera module in no sleep mode */ |
| 412 | clrsetbits_le32((*prcm)->cm_cam_clkstctrl, |
| 413 | MODULE_CLKCTRL_MODULEMODE_MASK, |
| 414 | CD_CLKCTRL_CLKTRCTRL_NO_SLEEP << |
| 415 | MODULE_CLKCTRL_MODULEMODE_SHIFT); |
| 416 | } |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 417 | |
Lokesh Vutla | d8ac050 | 2013-02-04 04:22:05 +0000 | [diff] [blame] | 418 | const struct ctrl_ioregs ioregs_omap5430 = { |
| 419 | .ctrl_ddrch = DDR_IO_I_34OHM_SR_FASTEST_WD_DQ_NO_PULL_DQS_PULL_DOWN, |
| 420 | .ctrl_lpddr2ch = DDR_IO_I_34OHM_SR_FASTEST_WD_CK_CKE_NCS_CA_PULL_DOWN, |
| 421 | .ctrl_ddrio_0 = DDR_IO_0_DDR2_DQ_INT_EN_ALL_DDR3_CA_DIS_ALL, |
| 422 | .ctrl_ddrio_1 = DDR_IO_1_DQ_OUT_EN_ALL_DQ_INT_EN_ALL, |
| 423 | .ctrl_ddrio_2 = DDR_IO_2_CA_OUT_EN_ALL_CA_INT_EN_ALL, |
| 424 | }; |
| 425 | |
| 426 | const struct ctrl_ioregs ioregs_omap5432_es1 = { |
| 427 | .ctrl_ddrch = DDR_IO_I_40OHM_SR_FAST_WD_DQ_NO_PULL_DQS_NO_PULL, |
| 428 | .ctrl_lpddr2ch = 0x0, |
| 429 | .ctrl_ddr3ch = DDR_IO_I_40OHM_SR_SLOWEST_WD_DQ_NO_PULL_DQS_NO_PULL, |
| 430 | .ctrl_ddrio_0 = DDR_IO_0_VREF_CELLS_DDR3_VALUE, |
| 431 | .ctrl_ddrio_1 = DDR_IO_1_VREF_CELLS_DDR3_VALUE, |
| 432 | .ctrl_ddrio_2 = DDR_IO_2_VREF_CELLS_DDR3_VALUE, |
| 433 | .ctrl_emif_sdram_config_ext = SDRAM_CONFIG_EXT_RD_LVL_11_SAMPLES, |
| 434 | }; |
| 435 | |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 436 | void hw_data_init(void) |
| 437 | { |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 438 | u32 omap_rev = omap_revision(); |
| 439 | |
| 440 | switch (omap_rev) { |
| 441 | |
| 442 | case OMAP5430_ES1_0: |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 443 | *prcm = &omap5_es1_prcm; |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 444 | *dplls_data = &omap5_dplls_es1; |
SRICHARAN R | 00d328c | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 445 | *omap_vcores = &omap5430_volts; |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 446 | break; |
| 447 | |
| 448 | case OMAP5432_ES1_0: |
| 449 | *prcm = &omap5_es1_prcm; |
| 450 | *dplls_data = &omap5_dplls_es1; |
SRICHARAN R | 00d328c | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 451 | *omap_vcores = &omap5432_volts; |
SRICHARAN R | 1a79cab | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 452 | break; |
| 453 | |
| 454 | default: |
| 455 | printf("\n INVALID OMAP REVISION "); |
| 456 | } |
Lokesh Vutla | 834b6b0 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 457 | |
| 458 | *ctrl = &omap5_ctrl; |
SRICHARAN R | fb6aa1f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 459 | } |
Lokesh Vutla | d8ac050 | 2013-02-04 04:22:05 +0000 | [diff] [blame] | 460 | |
| 461 | void get_ioregs(const struct ctrl_ioregs **regs) |
| 462 | { |
| 463 | u32 omap_rev = omap_revision(); |
| 464 | |
| 465 | switch (omap_rev) { |
| 466 | case OMAP5430_ES1_0: |
| 467 | *regs = &ioregs_omap5430; |
| 468 | break; |
| 469 | case OMAP5432_ES1_0: |
| 470 | *regs = &ioregs_omap5432_es1; |
| 471 | break; |
| 472 | |
| 473 | default: |
| 474 | printf("\n INVALID OMAP REVISION "); |
| 475 | } |
| 476 | } |