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