Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Aneesh V | d2f18c2 | 2011-07-21 09:09:59 -0400 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2010 |
| 4 | * Texas Instruments, <www.ti.com> |
| 5 | * |
| 6 | * Aneesh V <aneesh@ti.com> |
Aneesh V | d2f18c2 | 2011-07-21 09:09:59 -0400 | [diff] [blame] | 7 | */ |
| 8 | #ifndef _OMAP_COMMON_H_ |
| 9 | #define _OMAP_COMMON_H_ |
| 10 | |
SRICHARAN R | 4a0eb75 | 2013-04-24 00:41:24 +0000 | [diff] [blame] | 11 | #ifndef __ASSEMBLY__ |
| 12 | |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 13 | #include <common.h> |
| 14 | |
Lokesh Vutla | 97405d8 | 2013-05-30 03:19:38 +0000 | [diff] [blame] | 15 | #define NUM_SYS_CLKS 7 |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 16 | |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 17 | struct prcm_regs { |
| 18 | /* cm1.ckgen */ |
| 19 | u32 cm_clksel_core; |
| 20 | u32 cm_clksel_abe; |
| 21 | u32 cm_dll_ctrl; |
| 22 | u32 cm_clkmode_dpll_core; |
| 23 | u32 cm_idlest_dpll_core; |
| 24 | u32 cm_autoidle_dpll_core; |
| 25 | u32 cm_clksel_dpll_core; |
| 26 | u32 cm_div_m2_dpll_core; |
| 27 | u32 cm_div_m3_dpll_core; |
| 28 | u32 cm_div_h11_dpll_core; |
| 29 | u32 cm_div_h12_dpll_core; |
| 30 | u32 cm_div_h13_dpll_core; |
| 31 | u32 cm_div_h14_dpll_core; |
SRICHARAN R | afc2f9d | 2013-02-12 01:33:42 +0000 | [diff] [blame] | 32 | u32 cm_div_h21_dpll_core; |
| 33 | u32 cm_div_h24_dpll_core; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 34 | u32 cm_ssc_deltamstep_dpll_core; |
| 35 | u32 cm_ssc_modfreqdiv_dpll_core; |
| 36 | u32 cm_emu_override_dpll_core; |
| 37 | u32 cm_div_h22_dpllcore; |
| 38 | u32 cm_div_h23_dpll_core; |
| 39 | u32 cm_clkmode_dpll_mpu; |
| 40 | u32 cm_idlest_dpll_mpu; |
| 41 | u32 cm_autoidle_dpll_mpu; |
| 42 | u32 cm_clksel_dpll_mpu; |
| 43 | u32 cm_div_m2_dpll_mpu; |
| 44 | u32 cm_ssc_deltamstep_dpll_mpu; |
| 45 | u32 cm_ssc_modfreqdiv_dpll_mpu; |
| 46 | u32 cm_bypclk_dpll_mpu; |
| 47 | u32 cm_clkmode_dpll_iva; |
| 48 | u32 cm_idlest_dpll_iva; |
| 49 | u32 cm_autoidle_dpll_iva; |
| 50 | u32 cm_clksel_dpll_iva; |
| 51 | u32 cm_div_h11_dpll_iva; |
| 52 | u32 cm_div_h12_dpll_iva; |
| 53 | u32 cm_ssc_deltamstep_dpll_iva; |
| 54 | u32 cm_ssc_modfreqdiv_dpll_iva; |
| 55 | u32 cm_bypclk_dpll_iva; |
| 56 | u32 cm_clkmode_dpll_abe; |
| 57 | u32 cm_idlest_dpll_abe; |
| 58 | u32 cm_autoidle_dpll_abe; |
| 59 | u32 cm_clksel_dpll_abe; |
| 60 | u32 cm_div_m2_dpll_abe; |
| 61 | u32 cm_div_m3_dpll_abe; |
| 62 | u32 cm_ssc_deltamstep_dpll_abe; |
| 63 | u32 cm_ssc_modfreqdiv_dpll_abe; |
| 64 | u32 cm_clkmode_dpll_ddrphy; |
| 65 | u32 cm_idlest_dpll_ddrphy; |
| 66 | u32 cm_autoidle_dpll_ddrphy; |
| 67 | u32 cm_clksel_dpll_ddrphy; |
| 68 | u32 cm_div_m2_dpll_ddrphy; |
| 69 | u32 cm_div_h11_dpll_ddrphy; |
| 70 | u32 cm_div_h12_dpll_ddrphy; |
| 71 | u32 cm_div_h13_dpll_ddrphy; |
| 72 | u32 cm_ssc_deltamstep_dpll_ddrphy; |
Lokesh Vutla | d4e4129 | 2013-02-17 23:33:37 +0000 | [diff] [blame] | 73 | u32 cm_clkmode_dpll_dsp; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 74 | u32 cm_shadow_freq_config1; |
Lokesh Vutla | 65e9d56 | 2013-07-08 16:04:39 +0530 | [diff] [blame] | 75 | u32 cm_clkmode_dpll_gmac; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 76 | u32 cm_mpu_mpu_clkctrl; |
| 77 | |
| 78 | /* cm1.dsp */ |
| 79 | u32 cm_dsp_clkstctrl; |
| 80 | u32 cm_dsp_dsp_clkctrl; |
| 81 | |
| 82 | /* cm1.abe */ |
| 83 | u32 cm1_abe_clkstctrl; |
| 84 | u32 cm1_abe_l4abe_clkctrl; |
| 85 | u32 cm1_abe_aess_clkctrl; |
| 86 | u32 cm1_abe_pdm_clkctrl; |
| 87 | u32 cm1_abe_dmic_clkctrl; |
| 88 | u32 cm1_abe_mcasp_clkctrl; |
| 89 | u32 cm1_abe_mcbsp1_clkctrl; |
| 90 | u32 cm1_abe_mcbsp2_clkctrl; |
| 91 | u32 cm1_abe_mcbsp3_clkctrl; |
| 92 | u32 cm1_abe_slimbus_clkctrl; |
| 93 | u32 cm1_abe_timer5_clkctrl; |
| 94 | u32 cm1_abe_timer6_clkctrl; |
| 95 | u32 cm1_abe_timer7_clkctrl; |
| 96 | u32 cm1_abe_timer8_clkctrl; |
| 97 | u32 cm1_abe_wdt3_clkctrl; |
| 98 | |
| 99 | /* cm2.ckgen */ |
| 100 | u32 cm_clksel_mpu_m3_iss_root; |
| 101 | u32 cm_clksel_usb_60mhz; |
| 102 | u32 cm_scale_fclk; |
| 103 | u32 cm_core_dvfs_perf1; |
| 104 | u32 cm_core_dvfs_perf2; |
| 105 | u32 cm_core_dvfs_perf3; |
| 106 | u32 cm_core_dvfs_perf4; |
| 107 | u32 cm_core_dvfs_current; |
| 108 | u32 cm_iva_dvfs_perf_tesla; |
| 109 | u32 cm_iva_dvfs_perf_ivahd; |
| 110 | u32 cm_iva_dvfs_perf_abe; |
| 111 | u32 cm_iva_dvfs_current; |
| 112 | u32 cm_clkmode_dpll_per; |
| 113 | u32 cm_idlest_dpll_per; |
| 114 | u32 cm_autoidle_dpll_per; |
| 115 | u32 cm_clksel_dpll_per; |
| 116 | u32 cm_div_m2_dpll_per; |
| 117 | u32 cm_div_m3_dpll_per; |
| 118 | u32 cm_div_h11_dpll_per; |
| 119 | u32 cm_div_h12_dpll_per; |
SRICHARAN R | afc2f9d | 2013-02-12 01:33:42 +0000 | [diff] [blame] | 120 | u32 cm_div_h13_dpll_per; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 121 | u32 cm_div_h14_dpll_per; |
| 122 | u32 cm_ssc_deltamstep_dpll_per; |
| 123 | u32 cm_ssc_modfreqdiv_dpll_per; |
| 124 | u32 cm_emu_override_dpll_per; |
| 125 | u32 cm_clkmode_dpll_usb; |
| 126 | u32 cm_idlest_dpll_usb; |
| 127 | u32 cm_autoidle_dpll_usb; |
| 128 | u32 cm_clksel_dpll_usb; |
| 129 | u32 cm_div_m2_dpll_usb; |
| 130 | u32 cm_ssc_deltamstep_dpll_usb; |
| 131 | u32 cm_ssc_modfreqdiv_dpll_usb; |
| 132 | u32 cm_clkdcoldo_dpll_usb; |
Lokesh Vutla | d4e4129 | 2013-02-17 23:33:37 +0000 | [diff] [blame] | 133 | u32 cm_clkmode_dpll_pcie_ref; |
| 134 | u32 cm_clkmode_apll_pcie; |
| 135 | u32 cm_idlest_apll_pcie; |
| 136 | u32 cm_div_m2_apll_pcie; |
| 137 | u32 cm_clkvcoldo_apll_pcie; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 138 | u32 cm_clkmode_dpll_unipro; |
| 139 | u32 cm_idlest_dpll_unipro; |
| 140 | u32 cm_autoidle_dpll_unipro; |
| 141 | u32 cm_clksel_dpll_unipro; |
| 142 | u32 cm_div_m2_dpll_unipro; |
| 143 | u32 cm_ssc_deltamstep_dpll_unipro; |
| 144 | u32 cm_ssc_modfreqdiv_dpll_unipro; |
Kishon Vijay Abraham I | d3cfcb3 | 2015-02-23 18:39:44 +0530 | [diff] [blame] | 145 | u32 cm_coreaon_usb_phy1_core_clkctrl; |
Dan Murphy | 834e91a | 2013-10-11 12:28:17 -0500 | [diff] [blame] | 146 | u32 cm_coreaon_usb_phy2_core_clkctrl; |
Roger Quadros | 3599774 | 2016-05-23 17:37:49 +0300 | [diff] [blame] | 147 | u32 cm_coreaon_usb_phy3_core_clkctrl; |
Kishon Vijay Abraham I | 7beaf8b | 2015-08-10 16:52:55 +0530 | [diff] [blame] | 148 | u32 cm_coreaon_l3init_60m_gfclk_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 149 | |
| 150 | /* cm2.core */ |
| 151 | u32 cm_coreaon_bandgap_clkctrl; |
Lokesh Vutla | d4d986e | 2013-02-12 01:33:45 +0000 | [diff] [blame] | 152 | u32 cm_coreaon_io_srcomp_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 153 | u32 cm_l3_1_clkstctrl; |
| 154 | u32 cm_l3_1_dynamicdep; |
| 155 | u32 cm_l3_1_l3_1_clkctrl; |
| 156 | u32 cm_l3_2_clkstctrl; |
| 157 | u32 cm_l3_2_dynamicdep; |
| 158 | u32 cm_l3_2_l3_2_clkctrl; |
Lokesh Vutla | d4e4129 | 2013-02-17 23:33:37 +0000 | [diff] [blame] | 159 | u32 cm_l3_gpmc_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 160 | u32 cm_l3_2_ocmc_ram_clkctrl; |
| 161 | u32 cm_mpu_m3_clkstctrl; |
| 162 | u32 cm_mpu_m3_staticdep; |
| 163 | u32 cm_mpu_m3_dynamicdep; |
| 164 | u32 cm_mpu_m3_mpu_m3_clkctrl; |
| 165 | u32 cm_sdma_clkstctrl; |
| 166 | u32 cm_sdma_staticdep; |
| 167 | u32 cm_sdma_dynamicdep; |
| 168 | u32 cm_sdma_sdma_clkctrl; |
| 169 | u32 cm_memif_clkstctrl; |
| 170 | u32 cm_memif_dmm_clkctrl; |
| 171 | u32 cm_memif_emif_fw_clkctrl; |
| 172 | u32 cm_memif_emif_1_clkctrl; |
| 173 | u32 cm_memif_emif_2_clkctrl; |
| 174 | u32 cm_memif_dll_clkctrl; |
| 175 | u32 cm_memif_emif_h1_clkctrl; |
| 176 | u32 cm_memif_emif_h2_clkctrl; |
| 177 | u32 cm_memif_dll_h_clkctrl; |
| 178 | u32 cm_c2c_clkstctrl; |
| 179 | u32 cm_c2c_staticdep; |
| 180 | u32 cm_c2c_dynamicdep; |
| 181 | u32 cm_c2c_sad2d_clkctrl; |
| 182 | u32 cm_c2c_modem_icr_clkctrl; |
| 183 | u32 cm_c2c_sad2d_fw_clkctrl; |
| 184 | u32 cm_l4cfg_clkstctrl; |
| 185 | u32 cm_l4cfg_dynamicdep; |
| 186 | u32 cm_l4cfg_l4_cfg_clkctrl; |
| 187 | u32 cm_l4cfg_hw_sem_clkctrl; |
| 188 | u32 cm_l4cfg_mailbox_clkctrl; |
| 189 | u32 cm_l4cfg_sar_rom_clkctrl; |
| 190 | u32 cm_l3instr_clkstctrl; |
| 191 | u32 cm_l3instr_l3_3_clkctrl; |
| 192 | u32 cm_l3instr_l3_instr_clkctrl; |
| 193 | u32 cm_l3instr_intrconn_wp1_clkctrl; |
| 194 | |
| 195 | /* cm2.ivahd */ |
| 196 | u32 cm_ivahd_clkstctrl; |
| 197 | u32 cm_ivahd_ivahd_clkctrl; |
| 198 | u32 cm_ivahd_sl2_clkctrl; |
| 199 | |
| 200 | /* cm2.cam */ |
| 201 | u32 cm_cam_clkstctrl; |
| 202 | u32 cm_cam_iss_clkctrl; |
| 203 | u32 cm_cam_fdif_clkctrl; |
Lokesh Vutla | d4e4129 | 2013-02-17 23:33:37 +0000 | [diff] [blame] | 204 | u32 cm_cam_vip1_clkctrl; |
| 205 | u32 cm_cam_vip2_clkctrl; |
| 206 | u32 cm_cam_vip3_clkctrl; |
| 207 | u32 cm_cam_lvdsrx_clkctrl; |
| 208 | u32 cm_cam_csi1_clkctrl; |
| 209 | u32 cm_cam_csi2_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 210 | |
| 211 | /* cm2.dss */ |
| 212 | u32 cm_dss_clkstctrl; |
| 213 | u32 cm_dss_dss_clkctrl; |
| 214 | |
| 215 | /* cm2.sgx */ |
| 216 | u32 cm_sgx_clkstctrl; |
| 217 | u32 cm_sgx_sgx_clkctrl; |
| 218 | |
| 219 | /* cm2.l3init */ |
| 220 | u32 cm_l3init_clkstctrl; |
| 221 | |
| 222 | /* cm2.l3init */ |
| 223 | u32 cm_l3init_hsmmc1_clkctrl; |
| 224 | u32 cm_l3init_hsmmc2_clkctrl; |
| 225 | u32 cm_l3init_hsi_clkctrl; |
| 226 | u32 cm_l3init_hsusbhost_clkctrl; |
| 227 | u32 cm_l3init_hsusbotg_clkctrl; |
| 228 | u32 cm_l3init_hsusbtll_clkctrl; |
| 229 | u32 cm_l3init_p1500_clkctrl; |
Roger Quadros | 8ffcf74 | 2013-11-11 16:56:40 +0200 | [diff] [blame] | 230 | u32 cm_l3init_sata_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 231 | u32 cm_l3init_fsusb_clkctrl; |
| 232 | u32 cm_l3init_ocp2scp1_clkctrl; |
Dan Murphy | d861a33 | 2013-08-26 08:54:50 -0500 | [diff] [blame] | 233 | u32 cm_l3init_ocp2scp3_clkctrl; |
Kishon Vijay Abraham I | d3cfcb3 | 2015-02-23 18:39:44 +0530 | [diff] [blame] | 234 | u32 cm_l3init_usb_otg_ss1_clkctrl; |
Kishon Vijay Abraham I | 7beaf8b | 2015-08-10 16:52:55 +0530 | [diff] [blame] | 235 | u32 cm_l3init_usb_otg_ss2_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 236 | |
Nishanth Menon | a818097 | 2016-04-21 14:34:24 -0500 | [diff] [blame] | 237 | u32 prm_irqstatus_mpu; |
Andrii Tseglytskyi | 4d0df9c | 2013-05-20 22:42:08 +0000 | [diff] [blame] | 238 | u32 prm_irqstatus_mpu_2; |
| 239 | |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 240 | /* cm2.l4per */ |
| 241 | u32 cm_l4per_clkstctrl; |
| 242 | u32 cm_l4per_dynamicdep; |
| 243 | u32 cm_l4per_adc_clkctrl; |
| 244 | u32 cm_l4per_gptimer10_clkctrl; |
| 245 | u32 cm_l4per_gptimer11_clkctrl; |
| 246 | u32 cm_l4per_gptimer2_clkctrl; |
| 247 | u32 cm_l4per_gptimer3_clkctrl; |
| 248 | u32 cm_l4per_gptimer4_clkctrl; |
| 249 | u32 cm_l4per_gptimer9_clkctrl; |
| 250 | u32 cm_l4per_elm_clkctrl; |
| 251 | u32 cm_l4per_gpio2_clkctrl; |
| 252 | u32 cm_l4per_gpio3_clkctrl; |
| 253 | u32 cm_l4per_gpio4_clkctrl; |
| 254 | u32 cm_l4per_gpio5_clkctrl; |
| 255 | u32 cm_l4per_gpio6_clkctrl; |
| 256 | u32 cm_l4per_hdq1w_clkctrl; |
| 257 | u32 cm_l4per_hecc1_clkctrl; |
| 258 | u32 cm_l4per_hecc2_clkctrl; |
| 259 | u32 cm_l4per_i2c1_clkctrl; |
| 260 | u32 cm_l4per_i2c2_clkctrl; |
| 261 | u32 cm_l4per_i2c3_clkctrl; |
| 262 | u32 cm_l4per_i2c4_clkctrl; |
| 263 | u32 cm_l4per_l4per_clkctrl; |
| 264 | u32 cm_l4per_mcasp2_clkctrl; |
| 265 | u32 cm_l4per_mcasp3_clkctrl; |
| 266 | u32 cm_l4per_mgate_clkctrl; |
| 267 | u32 cm_l4per_mcspi1_clkctrl; |
| 268 | u32 cm_l4per_mcspi2_clkctrl; |
| 269 | u32 cm_l4per_mcspi3_clkctrl; |
| 270 | u32 cm_l4per_mcspi4_clkctrl; |
| 271 | u32 cm_l4per_gpio7_clkctrl; |
| 272 | u32 cm_l4per_gpio8_clkctrl; |
| 273 | u32 cm_l4per_mmcsd3_clkctrl; |
| 274 | u32 cm_l4per_mmcsd4_clkctrl; |
| 275 | u32 cm_l4per_msprohg_clkctrl; |
| 276 | u32 cm_l4per_slimbus2_clkctrl; |
Matt Porter | c97a9b3 | 2013-10-07 15:52:59 +0530 | [diff] [blame] | 277 | u32 cm_l4per_qspi_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 278 | u32 cm_l4per_uart1_clkctrl; |
| 279 | u32 cm_l4per_uart2_clkctrl; |
| 280 | u32 cm_l4per_uart3_clkctrl; |
| 281 | u32 cm_l4per_uart4_clkctrl; |
| 282 | u32 cm_l4per_mmcsd5_clkctrl; |
| 283 | u32 cm_l4per_i2c5_clkctrl; |
| 284 | u32 cm_l4per_uart5_clkctrl; |
| 285 | u32 cm_l4per_uart6_clkctrl; |
| 286 | u32 cm_l4sec_clkstctrl; |
| 287 | u32 cm_l4sec_staticdep; |
| 288 | u32 cm_l4sec_dynamicdep; |
| 289 | u32 cm_l4sec_aes1_clkctrl; |
| 290 | u32 cm_l4sec_aes2_clkctrl; |
| 291 | u32 cm_l4sec_des3des_clkctrl; |
| 292 | u32 cm_l4sec_pkaeip29_clkctrl; |
| 293 | u32 cm_l4sec_rng_clkctrl; |
| 294 | u32 cm_l4sec_sha2md51_clkctrl; |
| 295 | u32 cm_l4sec_cryptodma_clkctrl; |
| 296 | |
| 297 | /* l4 wkup regs */ |
| 298 | u32 cm_abe_pll_ref_clksel; |
| 299 | u32 cm_sys_clksel; |
Lokesh Vutla | 97405d8 | 2013-05-30 03:19:38 +0000 | [diff] [blame] | 300 | u32 cm_abe_pll_sys_clksel; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 301 | u32 cm_wkup_clkstctrl; |
| 302 | u32 cm_wkup_l4wkup_clkctrl; |
| 303 | u32 cm_wkup_wdtimer1_clkctrl; |
| 304 | u32 cm_wkup_wdtimer2_clkctrl; |
| 305 | u32 cm_wkup_gpio1_clkctrl; |
| 306 | u32 cm_wkup_gptimer1_clkctrl; |
| 307 | u32 cm_wkup_gptimer12_clkctrl; |
| 308 | u32 cm_wkup_synctimer_clkctrl; |
| 309 | u32 cm_wkup_usim_clkctrl; |
| 310 | u32 cm_wkup_sarram_clkctrl; |
| 311 | u32 cm_wkup_keyboard_clkctrl; |
| 312 | u32 cm_wkup_rtc_clkctrl; |
| 313 | u32 cm_wkup_bandgap_clkctrl; |
| 314 | u32 cm_wkupaon_scrm_clkctrl; |
Lokesh Vutla | d4d986e | 2013-02-12 01:33:45 +0000 | [diff] [blame] | 315 | u32 cm_wkupaon_io_srcomp_clkctrl; |
Lokesh Vutla | d4e4129 | 2013-02-17 23:33:37 +0000 | [diff] [blame] | 316 | u32 prm_rstctrl; |
| 317 | u32 prm_rstst; |
Lokesh Vutla | 0b1b60c | 2013-04-17 20:49:40 +0000 | [diff] [blame] | 318 | u32 prm_rsttime; |
Lokesh Vutla | eda6fbc | 2015-06-04 16:42:36 +0530 | [diff] [blame] | 319 | u32 prm_io_pmctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 320 | u32 prm_vc_val_bypass; |
| 321 | u32 prm_vc_cfg_i2c_mode; |
| 322 | u32 prm_vc_cfg_i2c_clk; |
Andrii Tseglytskyi | 4d0df9c | 2013-05-20 22:42:08 +0000 | [diff] [blame] | 323 | u32 prm_abbldo_mpu_setup; |
| 324 | u32 prm_abbldo_mpu_ctrl; |
Nishanth Menon | a818097 | 2016-04-21 14:34:24 -0500 | [diff] [blame] | 325 | u32 prm_abbldo_mm_setup; |
| 326 | u32 prm_abbldo_mm_ctrl; |
Nishanth Menon | e52e334 | 2016-04-21 14:34:25 -0500 | [diff] [blame] | 327 | u32 prm_abbldo_iva_setup; |
| 328 | u32 prm_abbldo_iva_ctrl; |
| 329 | u32 prm_abbldo_eve_setup; |
| 330 | u32 prm_abbldo_eve_ctrl; |
| 331 | u32 prm_abbldo_gpu_setup; |
| 332 | u32 prm_abbldo_gpu_ctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 333 | |
| 334 | u32 cm_div_m4_dpll_core; |
| 335 | u32 cm_div_m5_dpll_core; |
| 336 | u32 cm_div_m6_dpll_core; |
| 337 | u32 cm_div_m7_dpll_core; |
| 338 | u32 cm_div_m4_dpll_iva; |
| 339 | u32 cm_div_m5_dpll_iva; |
| 340 | u32 cm_div_m4_dpll_ddrphy; |
| 341 | u32 cm_div_m5_dpll_ddrphy; |
| 342 | u32 cm_div_m6_dpll_ddrphy; |
| 343 | u32 cm_div_m4_dpll_per; |
| 344 | u32 cm_div_m5_dpll_per; |
| 345 | u32 cm_div_m6_dpll_per; |
| 346 | u32 cm_div_m7_dpll_per; |
| 347 | u32 cm_l3instr_intrconn_wp1_clkct; |
| 348 | u32 cm_l3init_usbphy_clkctrl; |
| 349 | u32 cm_l4per_mcbsp4_clkctrl; |
| 350 | u32 prm_vc_cfg_channel; |
Lubomir Popov | ee28eda | 2013-05-15 04:41:01 +0000 | [diff] [blame] | 351 | |
| 352 | /* SCRM stuff, used by some boards */ |
| 353 | u32 scrm_auxclk0; |
| 354 | u32 scrm_auxclk1; |
Mugunthan V N | f986d97 | 2013-07-08 16:04:40 +0530 | [diff] [blame] | 355 | |
| 356 | /* GMAC Clk Ctrl */ |
| 357 | u32 cm_gmac_gmac_clkctrl; |
| 358 | u32 cm_gmac_clkstctrl; |
Lokesh Vutla | 37be54f | 2015-06-05 15:19:21 +0530 | [diff] [blame] | 359 | |
| 360 | /* IPU */ |
| 361 | u32 cm_ipu_clkstctrl; |
| 362 | u32 cm_ipu_i2c5_clkctrl; |
Vignesh R | 8a09cfe | 2015-08-17 13:29:52 +0530 | [diff] [blame] | 363 | |
| 364 | /*l3main1 edma*/ |
| 365 | u32 cm_l3main1_tptc1_clkctrl; |
| 366 | u32 cm_l3main1_tptc2_clkctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 367 | }; |
| 368 | |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 369 | struct omap_sys_ctrl_regs { |
| 370 | u32 control_status; |
Mugunthan V N | b1e26e3 | 2013-07-08 16:04:41 +0530 | [diff] [blame] | 371 | u32 control_core_mac_id_0_lo; |
| 372 | u32 control_core_mac_id_0_hi; |
| 373 | u32 control_core_mac_id_1_lo; |
| 374 | u32 control_core_mac_id_1_hi; |
Dan Murphy | d861a33 | 2013-08-26 08:54:50 -0500 | [diff] [blame] | 375 | u32 control_phy_power_usb; |
Lokesh Vutla | 8b12f17 | 2013-02-12 21:29:06 +0000 | [diff] [blame] | 376 | u32 control_core_mmr_lock1; |
| 377 | u32 control_core_mmr_lock2; |
| 378 | u32 control_core_mmr_lock3; |
| 379 | u32 control_core_mmr_lock4; |
| 380 | u32 control_core_mmr_lock5; |
| 381 | u32 control_core_control_io1; |
| 382 | u32 control_core_control_io2; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 383 | u32 control_id_code; |
Dileep Katta | f12467d | 2015-03-25 04:04:51 +0530 | [diff] [blame] | 384 | u32 control_std_fuse_die_id_0; |
| 385 | u32 control_std_fuse_die_id_1; |
| 386 | u32 control_std_fuse_die_id_2; |
| 387 | u32 control_std_fuse_die_id_3; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 388 | u32 control_std_fuse_opp_bgap; |
| 389 | u32 control_ldosram_iva_voltage_ctrl; |
| 390 | u32 control_ldosram_mpu_voltage_ctrl; |
| 391 | u32 control_ldosram_core_voltage_ctrl; |
Lokesh Vutla | 9239f5b | 2013-05-30 02:54:30 +0000 | [diff] [blame] | 392 | u32 control_usbotghs_ctrl; |
Roger Quadros | 8ffcf74 | 2013-11-11 16:56:40 +0200 | [diff] [blame] | 393 | u32 control_phy_power_sata; |
Lokesh Vutla | 8b12f17 | 2013-02-12 21:29:06 +0000 | [diff] [blame] | 394 | u32 control_padconf_core_base; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 395 | u32 control_paconf_global; |
| 396 | u32 control_paconf_mode; |
| 397 | u32 control_smart1io_padconf_0; |
| 398 | u32 control_smart1io_padconf_1; |
| 399 | u32 control_smart1io_padconf_2; |
| 400 | u32 control_smart2io_padconf_0; |
| 401 | u32 control_smart2io_padconf_1; |
| 402 | u32 control_smart2io_padconf_2; |
| 403 | u32 control_smart3io_padconf_0; |
| 404 | u32 control_smart3io_padconf_1; |
| 405 | u32 control_pbias; |
| 406 | u32 control_i2c_0; |
| 407 | u32 control_camera_rx; |
| 408 | u32 control_hdmi_tx_phy; |
| 409 | u32 control_uniportm; |
| 410 | u32 control_dsiphy; |
| 411 | u32 control_mcbsplp; |
| 412 | u32 control_usb2phycore; |
| 413 | u32 control_hdmi_1; |
| 414 | u32 control_hsi; |
| 415 | u32 control_ddr3ch1_0; |
| 416 | u32 control_ddr3ch2_0; |
| 417 | u32 control_ddrch1_0; |
| 418 | u32 control_ddrch1_1; |
| 419 | u32 control_ddrch2_0; |
| 420 | u32 control_ddrch2_1; |
| 421 | u32 control_lpddr2ch1_0; |
| 422 | u32 control_lpddr2ch1_1; |
| 423 | u32 control_ddrio_0; |
| 424 | u32 control_ddrio_1; |
| 425 | u32 control_ddrio_2; |
Sricharan R | 92b0482 | 2013-05-30 03:19:39 +0000 | [diff] [blame] | 426 | u32 control_ddr_control_ext_0; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 427 | u32 control_lpddr2io1_0; |
| 428 | u32 control_lpddr2io1_1; |
| 429 | u32 control_lpddr2io1_2; |
| 430 | u32 control_lpddr2io1_3; |
| 431 | u32 control_lpddr2io2_0; |
| 432 | u32 control_lpddr2io2_1; |
| 433 | u32 control_lpddr2io2_2; |
| 434 | u32 control_lpddr2io2_3; |
| 435 | u32 control_hyst_1; |
| 436 | u32 control_usbb_hsic_control; |
| 437 | u32 control_c2c; |
| 438 | u32 control_core_control_spare_rw; |
| 439 | u32 control_core_control_spare_r; |
| 440 | u32 control_core_control_spare_r_c0; |
| 441 | u32 control_srcomp_north_side; |
| 442 | u32 control_srcomp_south_side; |
| 443 | u32 control_srcomp_east_side; |
| 444 | u32 control_srcomp_west_side; |
| 445 | u32 control_srcomp_code_latch; |
| 446 | u32 control_pbiaslite; |
| 447 | u32 control_port_emif1_sdram_config; |
| 448 | u32 control_port_emif1_lpddr2_nvm_config; |
| 449 | u32 control_port_emif2_sdram_config; |
| 450 | u32 control_emif1_sdram_config_ext; |
| 451 | u32 control_emif2_sdram_config_ext; |
Andrii Tseglytskyi | 4d0df9c | 2013-05-20 22:42:08 +0000 | [diff] [blame] | 452 | u32 control_wkup_ldovbb_mpu_voltage_ctrl; |
Nishanth Menon | a818097 | 2016-04-21 14:34:24 -0500 | [diff] [blame] | 453 | u32 control_wkup_ldovbb_mm_voltage_ctrl; |
Nishanth Menon | e52e334 | 2016-04-21 14:34:25 -0500 | [diff] [blame] | 454 | u32 control_wkup_ldovbb_iva_voltage_ctrl; |
| 455 | u32 control_wkup_ldovbb_eve_voltage_ctrl; |
| 456 | u32 control_wkup_ldovbb_gpu_voltage_ctrl; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 457 | u32 control_smart1nopmio_padconf_0; |
| 458 | u32 control_smart1nopmio_padconf_1; |
| 459 | u32 control_padconf_mode; |
| 460 | u32 control_xtal_oscillator; |
| 461 | u32 control_i2c_2; |
| 462 | u32 control_ckobuffer; |
| 463 | u32 control_wkup_control_spare_rw; |
| 464 | u32 control_wkup_control_spare_r; |
| 465 | u32 control_wkup_control_spare_r_c0; |
| 466 | u32 control_srcomp_east_side_wkup; |
| 467 | u32 control_efuse_1; |
| 468 | u32 control_efuse_2; |
| 469 | u32 control_efuse_3; |
| 470 | u32 control_efuse_4; |
| 471 | u32 control_efuse_5; |
| 472 | u32 control_efuse_6; |
| 473 | u32 control_efuse_7; |
| 474 | u32 control_efuse_8; |
| 475 | u32 control_efuse_9; |
| 476 | u32 control_efuse_10; |
| 477 | u32 control_efuse_11; |
| 478 | u32 control_efuse_12; |
| 479 | u32 control_efuse_13; |
Lokesh Vutla | 8b12f17 | 2013-02-12 21:29:06 +0000 | [diff] [blame] | 480 | u32 control_padconf_wkup_base; |
Lokesh Vutla | eda6fbc | 2015-06-04 16:42:36 +0530 | [diff] [blame] | 481 | u32 iodelay_config_base; |
| 482 | u32 ctrl_core_sma_sw_0; |
Nishanth Menon | 76cff2b | 2015-08-13 09:51:00 -0500 | [diff] [blame] | 483 | u32 ctrl_core_sma_sw_1; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 484 | }; |
| 485 | |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 486 | #if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 487 | struct dpll_params { |
| 488 | u32 m; |
| 489 | u32 n; |
| 490 | s8 m2; |
| 491 | s8 m3; |
| 492 | s8 m4_h11; |
| 493 | s8 m5_h12; |
| 494 | s8 m6_h13; |
| 495 | s8 m7_h14; |
SRICHARAN R | 47abc3d | 2013-02-12 01:33:43 +0000 | [diff] [blame] | 496 | s8 h21; |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 497 | s8 h22; |
| 498 | s8 h23; |
SRICHARAN R | 47abc3d | 2013-02-12 01:33:43 +0000 | [diff] [blame] | 499 | s8 h24; |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 500 | }; |
| 501 | |
| 502 | struct dpll_regs { |
| 503 | u32 cm_clkmode_dpll; |
| 504 | u32 cm_idlest_dpll; |
| 505 | u32 cm_autoidle_dpll; |
| 506 | u32 cm_clksel_dpll; |
| 507 | u32 cm_div_m2_dpll; |
| 508 | u32 cm_div_m3_dpll; |
| 509 | u32 cm_div_m4_h11_dpll; |
| 510 | u32 cm_div_m5_h12_dpll; |
| 511 | u32 cm_div_m6_h13_dpll; |
| 512 | u32 cm_div_m7_h14_dpll; |
SRICHARAN R | 47abc3d | 2013-02-12 01:33:43 +0000 | [diff] [blame] | 513 | u32 reserved[2]; |
| 514 | u32 cm_div_h21_dpll; |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 515 | u32 cm_div_h22_dpll; |
| 516 | u32 cm_div_h23_dpll; |
SRICHARAN R | 47abc3d | 2013-02-12 01:33:43 +0000 | [diff] [blame] | 517 | u32 cm_div_h24_dpll; |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 518 | }; |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 519 | #endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */ |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 520 | |
| 521 | struct dplls { |
| 522 | const struct dpll_params *mpu; |
| 523 | const struct dpll_params *core; |
| 524 | const struct dpll_params *per; |
| 525 | const struct dpll_params *abe; |
| 526 | const struct dpll_params *iva; |
| 527 | const struct dpll_params *usb; |
Lokesh Vutla | ea8eff1 | 2013-02-12 21:29:05 +0000 | [diff] [blame] | 528 | const struct dpll_params *ddr; |
Lokesh Vutla | 65e9d56 | 2013-07-08 16:04:39 +0530 | [diff] [blame] | 529 | const struct dpll_params *gmac; |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 530 | }; |
| 531 | |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 532 | struct pmic_data { |
| 533 | u32 base_offset; |
| 534 | u32 step; |
| 535 | u32 start_code; |
| 536 | unsigned gpio; |
| 537 | int gpio_en; |
Lokesh Vutla | 4ca94d8 | 2013-05-30 02:54:33 +0000 | [diff] [blame] | 538 | u32 i2c_slave_addr; |
| 539 | void (*pmic_bus_init)(void); |
| 540 | int (*pmic_write)(u8 sa, u8 reg_addr, u8 reg_data); |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 541 | }; |
| 542 | |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 543 | #if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) |
Lokesh Vutla | beb7127 | 2016-11-23 12:54:39 +0530 | [diff] [blame] | 544 | enum { |
| 545 | OPP_LOW, |
| 546 | OPP_NOM, |
| 547 | OPP_OD, |
| 548 | OPP_HIGH, |
| 549 | NUM_OPPS, |
| 550 | }; |
| 551 | |
Nishanth Menon | 18c9d55 | 2013-05-30 03:19:31 +0000 | [diff] [blame] | 552 | /** |
| 553 | * struct volts_efuse_data - efuse definition for voltage |
| 554 | * @reg: register address for efuse |
| 555 | * @reg_bits: Number of bits in a register address, mandatory. |
| 556 | */ |
| 557 | struct volts_efuse_data { |
Lokesh Vutla | beb7127 | 2016-11-23 12:54:39 +0530 | [diff] [blame] | 558 | u32 reg[NUM_OPPS]; |
Nishanth Menon | 18c9d55 | 2013-05-30 03:19:31 +0000 | [diff] [blame] | 559 | u8 reg_bits; |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 560 | }; |
| 561 | |
| 562 | struct volts { |
Lokesh Vutla | beb7127 | 2016-11-23 12:54:39 +0530 | [diff] [blame] | 563 | u32 value[NUM_OPPS]; |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 564 | u32 addr; |
Nishanth Menon | 18c9d55 | 2013-05-30 03:19:31 +0000 | [diff] [blame] | 565 | struct volts_efuse_data efuse; |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 566 | struct pmic_data *pmic; |
Nishanth Menon | 3708e78 | 2016-04-21 14:34:23 -0500 | [diff] [blame] | 567 | |
| 568 | u32 abb_tx_done_mask; |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 569 | }; |
| 570 | |
Lokesh Vutla | beb7127 | 2016-11-23 12:54:39 +0530 | [diff] [blame] | 571 | enum { |
| 572 | VOLT_MPU, |
| 573 | VOLT_CORE, |
| 574 | VOLT_MM, |
| 575 | VOLT_GPU, |
| 576 | VOLT_EVE, |
| 577 | VOLT_IVA, |
| 578 | NUM_VOLT_RAILS, |
| 579 | }; |
| 580 | |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 581 | struct vcores_data { |
| 582 | struct volts mpu; |
| 583 | struct volts core; |
| 584 | struct volts mm; |
Lokesh Vutla | 63fc0c7 | 2013-05-30 03:19:29 +0000 | [diff] [blame] | 585 | struct volts gpu; |
| 586 | struct volts eve; |
| 587 | struct volts iva; |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 588 | }; |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 589 | #endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */ |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 590 | |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 591 | extern struct prcm_regs const **prcm; |
| 592 | extern struct prcm_regs const omap5_es1_prcm; |
SRICHARAN R | afc2f9d | 2013-02-12 01:33:42 +0000 | [diff] [blame] | 593 | extern struct prcm_regs const omap5_es2_prcm; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 594 | extern struct prcm_regs const omap4_prcm; |
Lokesh Vutla | d4e4129 | 2013-02-17 23:33:37 +0000 | [diff] [blame] | 595 | extern struct prcm_regs const dra7xx_prcm; |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 596 | extern struct dplls const **dplls_data; |
Felipe Balbi | 56fe405 | 2014-11-06 08:28:50 -0600 | [diff] [blame] | 597 | extern struct dplls dra7xx_dplls; |
Steve Kipisz | 209742f | 2017-08-22 13:52:58 +0530 | [diff] [blame] | 598 | extern struct dplls dra72x_dplls; |
Lokesh Vutla | 10f430f | 2017-12-29 11:47:53 +0530 | [diff] [blame] | 599 | extern struct dplls dra76x_dplls; |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 600 | extern struct vcores_data const **omap_vcores; |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 601 | extern const u32 sys_clk_array[8]; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 602 | extern struct omap_sys_ctrl_regs const **ctrl; |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 603 | extern struct omap_sys_ctrl_regs const am33xx_ctrl; |
| 604 | extern struct omap_sys_ctrl_regs const omap3_ctrl; |
Lokesh Vutla | c43c833 | 2013-02-04 04:22:04 +0000 | [diff] [blame] | 605 | extern struct omap_sys_ctrl_regs const omap4_ctrl; |
| 606 | extern struct omap_sys_ctrl_regs const omap5_ctrl; |
Lokesh Vutla | 8b12f17 | 2013-02-12 21:29:06 +0000 | [diff] [blame] | 607 | extern struct omap_sys_ctrl_regs const dra7xx_ctrl; |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 608 | |
Felipe Balbi | 56fe405 | 2014-11-06 08:28:50 -0600 | [diff] [blame] | 609 | extern struct pmic_data tps659038; |
Keerthy | f56e635 | 2016-11-23 13:25:27 +0530 | [diff] [blame] | 610 | extern struct pmic_data lp8733; |
Keerthy | c247605 | 2017-08-21 12:50:54 +0530 | [diff] [blame] | 611 | extern struct pmic_data lp87565; |
Felipe Balbi | 56fe405 | 2014-11-06 08:28:50 -0600 | [diff] [blame] | 612 | |
SRICHARAN R | 01b753f | 2013-02-04 04:22:00 +0000 | [diff] [blame] | 613 | void hw_data_init(void); |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 614 | |
| 615 | const struct dpll_params *get_mpu_dpll_params(struct dplls const *); |
| 616 | const struct dpll_params *get_core_dpll_params(struct dplls const *); |
| 617 | const struct dpll_params *get_per_dpll_params(struct dplls const *); |
| 618 | const struct dpll_params *get_iva_dpll_params(struct dplls const *); |
| 619 | const struct dpll_params *get_usb_dpll_params(struct dplls const *); |
| 620 | const struct dpll_params *get_abe_dpll_params(struct dplls const *); |
| 621 | |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 622 | #if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 623 | void do_enable_clocks(u32 const *clk_domains, |
| 624 | u32 const *clk_modules_hw_auto, |
| 625 | u32 const *clk_modules_explicit_en, |
| 626 | u8 wait_for_enable); |
| 627 | |
Kishon Vijay Abraham I | 16ca1d0 | 2015-08-17 13:29:51 +0530 | [diff] [blame] | 628 | void do_disable_clocks(u32 const *clk_domains, |
| 629 | u32 const *clk_modules_disable, |
| 630 | u8 wait_for_disable); |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 631 | #endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */ |
Kishon Vijay Abraham I | 16ca1d0 | 2015-08-17 13:29:51 +0530 | [diff] [blame] | 632 | |
SRICHARAN R | ee9447b | 2013-02-04 04:22:01 +0000 | [diff] [blame] | 633 | void setup_post_dividers(u32 const base, |
| 634 | const struct dpll_params *params); |
| 635 | u32 omap_ddr_clk(void); |
| 636 | u32 get_sys_clk_index(void); |
| 637 | void enable_basic_clocks(void); |
| 638 | void enable_basic_uboot_clocks(void); |
Kishon Vijay Abraham I | ca5a0f1 | 2015-08-19 16:16:25 +0530 | [diff] [blame] | 639 | |
| 640 | void enable_usb_clocks(int index); |
| 641 | void disable_usb_clocks(int index); |
| 642 | |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 643 | #if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 644 | void scale_vcores(struct vcores_data const *); |
Semen Protsenko | 00bbe96 | 2017-06-02 18:00:00 +0300 | [diff] [blame] | 645 | #endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */ |
Lokesh Vutla | beb7127 | 2016-11-23 12:54:39 +0530 | [diff] [blame] | 646 | int get_voltrail_opp(int rail_offset); |
SRICHARAN R | 3fcdd4a | 2013-02-04 04:22:02 +0000 | [diff] [blame] | 647 | u32 get_offset_code(u32 volt_offset, struct pmic_data *pmic); |
| 648 | void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic); |
Andrii Tseglytskyi | 4d0df9c | 2013-05-20 22:42:08 +0000 | [diff] [blame] | 649 | void abb_setup(u32 fuse, u32 ldovbb, u32 setup, u32 control, |
| 650 | u32 txdone, u32 txdone_mask, u32 opp); |
| 651 | s8 abb_setup_ldovbb(u32 fuse, u32 ldovbb); |
Aneesh V | 3776801 | 2011-07-21 09:10:07 -0400 | [diff] [blame] | 652 | |
Simon Glass | 5d98285 | 2017-05-17 08:23:00 -0600 | [diff] [blame] | 653 | struct tag_serialnr; |
| 654 | |
Paul Kocialkowski | 07815eb | 2015-08-27 19:37:12 +0200 | [diff] [blame] | 655 | void omap_die_id_serial(void); |
Paul Kocialkowski | 2da87ab | 2015-08-27 19:37:14 +0200 | [diff] [blame] | 656 | void omap_die_id_get_board_serial(struct tag_serialnr *serialnr); |
Paul Kocialkowski | 07815eb | 2015-08-27 19:37:12 +0200 | [diff] [blame] | 657 | void omap_die_id_usbethaddr(void); |
Paul Kocialkowski | 679f82c | 2015-08-27 19:37:13 +0200 | [diff] [blame] | 658 | void omap_die_id_display(void); |
Paul Kocialkowski | 07815eb | 2015-08-27 19:37:12 +0200 | [diff] [blame] | 659 | |
Semen Protsenko | fa24eca | 2017-05-22 19:16:40 +0300 | [diff] [blame] | 660 | #ifdef CONFIG_FASTBOOT_FLASH |
| 661 | void omap_set_fastboot_vars(void); |
| 662 | #else |
| 663 | static inline void omap_set_fastboot_vars(void) { } |
| 664 | #endif |
| 665 | |
Lokesh Vutla | eda6fbc | 2015-06-04 16:42:36 +0530 | [diff] [blame] | 666 | void recalibrate_iodelay(void); |
Nishanth Menon | 8a0c6d6 | 2014-03-28 11:00:04 -0500 | [diff] [blame] | 667 | |
Nishanth Menon | 6d8abe6 | 2015-03-09 17:12:03 -0500 | [diff] [blame] | 668 | void omap_smc1(u32 service, u32 val); |
| 669 | |
Daniel Allred | 51d0638 | 2016-06-27 09:19:17 -0500 | [diff] [blame] | 670 | /* |
| 671 | * Low-level helper function used when performing secure ROM calls on high- |
| 672 | * security (HS) device variants by doing a specially-formed smc entry. |
| 673 | */ |
| 674 | u32 omap_smc_sec(u32 service, u32 proc_id, u32 flag, u32 *params); |
Harinarayan Bhatta | 4c158b9 | 2016-11-29 16:33:22 -0600 | [diff] [blame] | 675 | u32 omap_smc_sec_cpu1(u32 service, u32 proc_id, u32 flag, u32 *params); |
Daniel Allred | 51d0638 | 2016-06-27 09:19:17 -0500 | [diff] [blame] | 676 | |
Vignesh R | 8a09cfe | 2015-08-17 13:29:52 +0530 | [diff] [blame] | 677 | void enable_edma3_clocks(void); |
| 678 | void disable_edma3_clocks(void); |
| 679 | |
Paul Kocialkowski | 72931b1 | 2015-08-27 19:37:08 +0200 | [diff] [blame] | 680 | void omap_die_id(unsigned int *die_id); |
| 681 | |
Kipisz, Steven | 725700d | 2016-02-24 12:30:53 -0600 | [diff] [blame] | 682 | /* Initialize general purpose I2C(0) on the SoC */ |
| 683 | void gpi2c_init(void); |
| 684 | |
Andrew F. Davis | 0375023 | 2017-07-10 14:45:50 -0500 | [diff] [blame] | 685 | /* Common FDT Fixups */ |
| 686 | int ft_hs_disable_rng(void *fdt, bd_t *bd); |
| 687 | int ft_hs_fixup_dram(void *fdt, bd_t *bd); |
| 688 | int ft_hs_add_tee(void *fdt, bd_t *bd); |
| 689 | |
Andrii Tseglytskyi | 4d0df9c | 2013-05-20 22:42:08 +0000 | [diff] [blame] | 690 | /* ABB */ |
| 691 | #define OMAP_ABB_NOMINAL_OPP 0 |
| 692 | #define OMAP_ABB_FAST_OPP 1 |
| 693 | #define OMAP_ABB_SLOW_OPP 3 |
| 694 | #define OMAP_ABB_CONTROL_FAST_OPP_SEL_MASK (0x1 << 0) |
| 695 | #define OMAP_ABB_CONTROL_SLOW_OPP_SEL_MASK (0x1 << 1) |
| 696 | #define OMAP_ABB_CONTROL_OPP_CHANGE_MASK (0x1 << 2) |
| 697 | #define OMAP_ABB_CONTROL_SR2_IN_TRANSITION_MASK (0x1 << 6) |
| 698 | #define OMAP_ABB_SETUP_SR2EN_MASK (0x1 << 0) |
| 699 | #define OMAP_ABB_SETUP_ACTIVE_FBB_SEL_MASK (0x1 << 2) |
| 700 | #define OMAP_ABB_SETUP_ACTIVE_RBB_SEL_MASK (0x1 << 1) |
| 701 | #define OMAP_ABB_SETUP_SR2_WTCNT_VALUE_MASK (0xff << 8) |
| 702 | |
SRICHARAN R | 087189f | 2012-03-12 02:25:40 +0000 | [diff] [blame] | 703 | static inline u32 omap_revision(void) |
| 704 | { |
| 705 | extern u32 *const omap_si_rev; |
| 706 | return *omap_si_rev; |
| 707 | } |
Lokesh Vutla | e9d6cd0 | 2013-05-30 03:19:32 +0000 | [diff] [blame] | 708 | |
Rajendra Nayak | 8c16dd6 | 2014-07-18 11:18:48 +0530 | [diff] [blame] | 709 | #define OMAP44xx 0x44000000 |
| 710 | |
| 711 | static inline u8 is_omap44xx(void) |
| 712 | { |
| 713 | extern u32 *const omap_si_rev; |
| 714 | return (*omap_si_rev & 0xFF000000) == OMAP44xx; |
| 715 | }; |
| 716 | |
Lokesh Vutla | e9d6cd0 | 2013-05-30 03:19:32 +0000 | [diff] [blame] | 717 | #define OMAP54xx 0x54000000 |
| 718 | |
| 719 | static inline u8 is_omap54xx(void) |
| 720 | { |
| 721 | extern u32 *const omap_si_rev; |
| 722 | return ((*omap_si_rev & 0xFF000000) == OMAP54xx); |
| 723 | } |
SRICHARAN R | 39302dc | 2013-11-08 17:40:36 +0530 | [diff] [blame] | 724 | |
| 725 | #define DRA7XX 0x07000000 |
Lokesh Vutla | c7400e4 | 2015-06-03 14:43:25 +0530 | [diff] [blame] | 726 | #define DRA72X 0x07200000 |
Praneeth Bajjuri | 0f9e6ae | 2017-08-21 12:50:52 +0530 | [diff] [blame] | 727 | #define DRA76X 0x07600000 |
SRICHARAN R | 39302dc | 2013-11-08 17:40:36 +0530 | [diff] [blame] | 728 | |
| 729 | static inline u8 is_dra7xx(void) |
| 730 | { |
| 731 | extern u32 *const omap_si_rev; |
| 732 | return ((*omap_si_rev & 0xFF000000) == DRA7XX); |
| 733 | } |
Lokesh Vutla | c7400e4 | 2015-06-03 14:43:25 +0530 | [diff] [blame] | 734 | |
| 735 | static inline u8 is_dra72x(void) |
| 736 | { |
| 737 | extern u32 *const omap_si_rev; |
| 738 | return (*omap_si_rev & 0xFFF00000) == DRA72X; |
| 739 | } |
Praneeth Bajjuri | 0f9e6ae | 2017-08-21 12:50:52 +0530 | [diff] [blame] | 740 | |
| 741 | static inline u8 is_dra76x(void) |
| 742 | { |
| 743 | extern u32 *const omap_si_rev; |
| 744 | return (*omap_si_rev & 0xFFF00000) == DRA76X; |
| 745 | } |
Lokesh Vutla | 941f2fc | 2017-12-29 11:47:51 +0530 | [diff] [blame] | 746 | |
| 747 | static inline u8 is_dra76x_abz(void) |
| 748 | { |
| 749 | extern u32 *const omap_si_rev; |
| 750 | return (*omap_si_rev & 0xF) == 2; |
| 751 | } |
| 752 | |
| 753 | static inline u8 is_dra76x_acd(void) |
| 754 | { |
| 755 | extern u32 *const omap_si_rev; |
| 756 | return (*omap_si_rev & 0xF) == 3; |
| 757 | } |
SRICHARAN R | 4a0eb75 | 2013-04-24 00:41:24 +0000 | [diff] [blame] | 758 | #endif |
SRICHARAN R | 087189f | 2012-03-12 02:25:40 +0000 | [diff] [blame] | 759 | |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 760 | /* |
| 761 | * silicon revisions. |
| 762 | * Moving this to common, so that most of code can be moved to common, |
| 763 | * directories. |
| 764 | */ |
| 765 | |
| 766 | /* omap4 */ |
| 767 | #define OMAP4430_SILICON_ID_INVALID 0xFFFFFFFF |
| 768 | #define OMAP4430_ES1_0 0x44300100 |
| 769 | #define OMAP4430_ES2_0 0x44300200 |
| 770 | #define OMAP4430_ES2_1 0x44300210 |
| 771 | #define OMAP4430_ES2_2 0x44300220 |
| 772 | #define OMAP4430_ES2_3 0x44300230 |
| 773 | #define OMAP4460_ES1_0 0x44600100 |
Aneesh V | 9404758 | 2011-11-21 23:39:03 +0000 | [diff] [blame] | 774 | #define OMAP4460_ES1_1 0x44600110 |
Taras Kondratiuk | 696f81f | 2013-08-06 15:18:48 +0300 | [diff] [blame] | 775 | #define OMAP4470_ES1_0 0x44700100 |
Sricharan | 508a58f | 2011-11-15 09:49:55 -0500 | [diff] [blame] | 776 | |
| 777 | /* omap5 */ |
| 778 | #define OMAP5430_SILICON_ID_INVALID 0 |
| 779 | #define OMAP5430_ES1_0 0x54300100 |
Lokesh Vutla | 0a0bf7b | 2012-05-22 00:03:22 +0000 | [diff] [blame] | 780 | #define OMAP5432_ES1_0 0x54320100 |
SRICHARAN R | eed7c0f | 2013-02-12 01:33:41 +0000 | [diff] [blame] | 781 | #define OMAP5430_ES2_0 0x54300200 |
| 782 | #define OMAP5432_ES2_0 0x54320200 |
Lokesh Vutla | de62688 | 2013-02-12 21:29:03 +0000 | [diff] [blame] | 783 | |
| 784 | /* DRA7XX */ |
Praneeth Bajjuri | 0f9e6ae | 2017-08-21 12:50:52 +0530 | [diff] [blame] | 785 | #define DRA762_ES1_0 0x07620100 |
Lokesh Vutla | de62688 | 2013-02-12 21:29:03 +0000 | [diff] [blame] | 786 | #define DRA752_ES1_0 0x07520100 |
Nishanth Menon | 3ac8c0b | 2014-01-14 10:54:42 -0600 | [diff] [blame] | 787 | #define DRA752_ES1_1 0x07520110 |
Nishanth Menon | c1ea3be | 2015-08-13 09:50:58 -0500 | [diff] [blame] | 788 | #define DRA752_ES2_0 0x07520200 |
Lokesh Vutla | ee77a23 | 2014-05-15 11:08:38 +0530 | [diff] [blame] | 789 | #define DRA722_ES1_0 0x07220100 |
Ravi Babu | d851ad3 | 2016-03-15 18:09:11 -0500 | [diff] [blame] | 790 | #define DRA722_ES2_0 0x07220200 |
Vishal Mahaveer | ba39608 | 2017-08-26 16:51:22 -0500 | [diff] [blame] | 791 | #define DRA722_ES2_1 0x07220210 |
SRICHARAN R | f92f227 | 2013-04-24 00:41:22 +0000 | [diff] [blame] | 792 | |
Lokesh Vutla | 941f2fc | 2017-12-29 11:47:51 +0530 | [diff] [blame] | 793 | #define DRA762_ABZ_ES1_0 0x07620102 |
| 794 | #define DRA762_ACD_ES1_0 0x07620103 |
SRICHARAN R | f92f227 | 2013-04-24 00:41:22 +0000 | [diff] [blame] | 795 | /* |
Daniel Allred | 47c331e | 2016-05-19 19:10:52 -0500 | [diff] [blame] | 796 | * silicon device type |
| 797 | * Moving to common from cpu.h, since it is shared by various omap devices |
| 798 | */ |
Daniel Allred | 47c331e | 2016-05-19 19:10:52 -0500 | [diff] [blame] | 799 | #define TST_DEVICE 0x0 |
| 800 | #define EMU_DEVICE 0x1 |
| 801 | #define HS_DEVICE 0x2 |
| 802 | #define GP_DEVICE 0x3 |
| 803 | |
| 804 | |
| 805 | /* |
SRICHARAN R | f92f227 | 2013-04-24 00:41:22 +0000 | [diff] [blame] | 806 | * SRAM scratch space entries |
| 807 | */ |
SRICHARAN R | f92f227 | 2013-04-24 00:41:22 +0000 | [diff] [blame] | 808 | #define OMAP_SRAM_SCRATCH_OMAP_REV SRAM_SCRATCH_SPACE_ADDR |
| 809 | #define OMAP_SRAM_SCRATCH_EMIF_SIZE (SRAM_SCRATCH_SPACE_ADDR + 0x4) |
| 810 | #define OMAP_SRAM_SCRATCH_EMIF_T_NUM (SRAM_SCRATCH_SPACE_ADDR + 0xC) |
| 811 | #define OMAP_SRAM_SCRATCH_EMIF_T_DEN (SRAM_SCRATCH_SPACE_ADDR + 0x10) |
| 812 | #define OMAP_SRAM_SCRATCH_PRCM_PTR (SRAM_SCRATCH_SPACE_ADDR + 0x14) |
| 813 | #define OMAP_SRAM_SCRATCH_DPLLS_PTR (SRAM_SCRATCH_SPACE_ADDR + 0x18) |
| 814 | #define OMAP_SRAM_SCRATCH_VCORES_PTR (SRAM_SCRATCH_SPACE_ADDR + 0x1C) |
| 815 | #define OMAP_SRAM_SCRATCH_SYS_CTRL (SRAM_SCRATCH_SPACE_ADDR + 0x20) |
SRICHARAN R | fda0681 | 2013-04-24 00:41:23 +0000 | [diff] [blame] | 816 | #define OMAP_SRAM_SCRATCH_BOOT_PARAMS (SRAM_SCRATCH_SPACE_ADDR + 0x24) |
Lokesh Vutla | 6398928 | 2017-03-13 15:04:25 +0200 | [diff] [blame] | 817 | #ifndef TI_SRAM_SCRATCH_BOARD_EEPROM_START |
| 818 | #define TI_SRAM_SCRATCH_BOARD_EEPROM_START (SRAM_SCRATCH_SPACE_ADDR + 0x28) |
| 819 | #define TI_SRAM_SCRATCH_BOARD_EEPROM_END (SRAM_SCRATCH_SPACE_ADDR + 0x200) |
| 820 | #endif |
| 821 | #define OMAP_SRAM_SCRATCH_SPACE_END (TI_SRAM_SCRATCH_BOARD_EEPROM_END) |
SRICHARAN R | fda0681 | 2013-04-24 00:41:23 +0000 | [diff] [blame] | 822 | |
Paul Kocialkowski | 60c7c30 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 823 | /* Boot parameters */ |
| 824 | #define DEVICE_DATA_OFFSET 0x18 |
| 825 | #define BOOT_MODE_OFFSET 0x8 |
| 826 | |
| 827 | #define CH_FLAGS_CHSETTINGS (1 << 0) |
| 828 | #define CH_FLAGS_CHRAM (1 << 1) |
| 829 | #define CH_FLAGS_CHFLASH (1 << 2) |
| 830 | #define CH_FLAGS_CHMMCSD (1 << 3) |
| 831 | |
Paul Kocialkowski | ed19bda | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 832 | #ifndef __ASSEMBLY__ |
| 833 | u32 omap_sys_boot_device(void); |
| 834 | #endif |
| 835 | |
Aneesh V | d2f18c2 | 2011-07-21 09:09:59 -0400 | [diff] [blame] | 836 | #endif /* _OMAP_COMMON_H_ */ |