Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1 | /* |
| 2 | * OMAP2/3 clockdomains |
| 3 | * |
| 4 | * Copyright (C) 2008 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2008 Nokia Corporation |
| 6 | * |
| 7 | * Written by Paul Walmsley |
| 8 | */ |
| 9 | |
| 10 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H |
| 11 | #define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H |
| 12 | |
| 13 | #include <mach/clockdomain.h> |
| 14 | |
| 15 | /* |
| 16 | * OMAP2/3-common clockdomains |
| 17 | */ |
| 18 | |
| 19 | /* This is an implicit clockdomain - it is never defined as such in TRM */ |
| 20 | static struct clockdomain wkup_clkdm = { |
| 21 | .name = "wkup_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 22 | .pwrdm = { .name = "wkup_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 23 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), |
| 24 | }; |
| 25 | |
| 26 | /* |
| 27 | * 2420-only clockdomains |
| 28 | */ |
| 29 | |
| 30 | #if defined(CONFIG_ARCH_OMAP2420) |
| 31 | |
| 32 | static struct clockdomain mpu_2420_clkdm = { |
| 33 | .name = "mpu_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 34 | .pwrdm = { .name = "mpu_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 35 | .flags = CLKDM_CAN_HWSUP, |
| 36 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
| 37 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
| 38 | }; |
| 39 | |
| 40 | static struct clockdomain iva1_2420_clkdm = { |
| 41 | .name = "iva1_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 42 | .pwrdm = { .name = "dsp_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 43 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 44 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, |
| 45 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
| 46 | }; |
| 47 | |
| 48 | #endif /* CONFIG_ARCH_OMAP2420 */ |
| 49 | |
| 50 | |
| 51 | /* |
| 52 | * 2430-only clockdomains |
| 53 | */ |
| 54 | |
| 55 | #if defined(CONFIG_ARCH_OMAP2430) |
| 56 | |
| 57 | static struct clockdomain mpu_2430_clkdm = { |
| 58 | .name = "mpu_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 59 | .pwrdm = { .name = "mpu_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 60 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 61 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
| 62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
| 63 | }; |
| 64 | |
| 65 | static struct clockdomain mdm_clkdm = { |
| 66 | .name = "mdm_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 67 | .pwrdm = { .name = "mdm_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 68 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 69 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, |
| 70 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
| 71 | }; |
| 72 | |
| 73 | #endif /* CONFIG_ARCH_OMAP2430 */ |
| 74 | |
| 75 | |
| 76 | /* |
| 77 | * 24XX-only clockdomains |
| 78 | */ |
| 79 | |
| 80 | #if defined(CONFIG_ARCH_OMAP24XX) |
| 81 | |
| 82 | static struct clockdomain dsp_clkdm = { |
| 83 | .name = "dsp_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 84 | .pwrdm = { .name = "dsp_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 85 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 86 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, |
| 87 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
| 88 | }; |
| 89 | |
| 90 | static struct clockdomain gfx_24xx_clkdm = { |
| 91 | .name = "gfx_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 92 | .pwrdm = { .name = "gfx_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 93 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 94 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, |
| 95 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
| 96 | }; |
| 97 | |
| 98 | static struct clockdomain core_l3_24xx_clkdm = { |
| 99 | .name = "core_l3_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 100 | .pwrdm = { .name = "core_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 101 | .flags = CLKDM_CAN_HWSUP, |
| 102 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, |
| 103 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
| 104 | }; |
| 105 | |
| 106 | static struct clockdomain core_l4_24xx_clkdm = { |
| 107 | .name = "core_l4_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 108 | .pwrdm = { .name = "core_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 109 | .flags = CLKDM_CAN_HWSUP, |
| 110 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, |
| 111 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
| 112 | }; |
| 113 | |
| 114 | static struct clockdomain dss_24xx_clkdm = { |
| 115 | .name = "dss_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 116 | .pwrdm = { .name = "core_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 117 | .flags = CLKDM_CAN_HWSUP, |
| 118 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, |
| 119 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
| 120 | }; |
| 121 | |
| 122 | #endif /* CONFIG_ARCH_OMAP24XX */ |
| 123 | |
| 124 | |
| 125 | /* |
| 126 | * 34xx clockdomains |
| 127 | */ |
| 128 | |
| 129 | #if defined(CONFIG_ARCH_OMAP34XX) |
| 130 | |
| 131 | static struct clockdomain mpu_34xx_clkdm = { |
| 132 | .name = "mpu_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 133 | .pwrdm = { .name = "mpu_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 134 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, |
| 135 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, |
| 136 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 137 | }; |
| 138 | |
| 139 | static struct clockdomain neon_clkdm = { |
| 140 | .name = "neon_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 141 | .pwrdm = { .name = "neon_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 142 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 143 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, |
| 144 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 145 | }; |
| 146 | |
| 147 | static struct clockdomain iva2_clkdm = { |
| 148 | .name = "iva2_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 149 | .pwrdm = { .name = "iva2_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 150 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 151 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, |
| 152 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 153 | }; |
| 154 | |
| 155 | static struct clockdomain gfx_3430es1_clkdm = { |
| 156 | .name = "gfx_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 157 | .pwrdm = { .name = "gfx_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 158 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 159 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, |
| 160 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), |
| 161 | }; |
| 162 | |
| 163 | static struct clockdomain sgx_clkdm = { |
| 164 | .name = "sgx_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 165 | .pwrdm = { .name = "sgx_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 166 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 167 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, |
| 168 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), |
| 169 | }; |
| 170 | |
Paul Walmsley | 333943b | 2008-08-19 11:08:45 +0300 | [diff] [blame] | 171 | /* |
| 172 | * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but |
| 173 | * then that information was removed from the 34xx ES2+ TRM. It is |
| 174 | * unclear whether the core is still there, but the clockdomain logic |
| 175 | * is there, and must be programmed to an appropriate state if the |
| 176 | * CORE clockdomain is to become inactive. |
| 177 | */ |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 178 | static struct clockdomain d2d_clkdm = { |
| 179 | .name = "d2d_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 180 | .pwrdm = { .name = "core_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 181 | .flags = CLKDM_CAN_HWSUP, |
| 182 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, |
Paul Walmsley | 333943b | 2008-08-19 11:08:45 +0300 | [diff] [blame] | 183 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 184 | }; |
| 185 | |
| 186 | static struct clockdomain core_l3_34xx_clkdm = { |
| 187 | .name = "core_l3_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 188 | .pwrdm = { .name = "core_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 189 | .flags = CLKDM_CAN_HWSUP, |
| 190 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, |
| 191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 192 | }; |
| 193 | |
| 194 | static struct clockdomain core_l4_34xx_clkdm = { |
| 195 | .name = "core_l4_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 196 | .pwrdm = { .name = "core_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 197 | .flags = CLKDM_CAN_HWSUP, |
| 198 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, |
| 199 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 200 | }; |
| 201 | |
| 202 | static struct clockdomain dss_34xx_clkdm = { |
| 203 | .name = "dss_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 204 | .pwrdm = { .name = "dss_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 205 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 206 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, |
| 207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 208 | }; |
| 209 | |
| 210 | static struct clockdomain cam_clkdm = { |
| 211 | .name = "cam_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 212 | .pwrdm = { .name = "cam_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 213 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 214 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, |
| 215 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 216 | }; |
| 217 | |
| 218 | static struct clockdomain usbhost_clkdm = { |
| 219 | .name = "usbhost_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 220 | .pwrdm = { .name = "usbhost_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 221 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 222 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, |
| 223 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), |
| 224 | }; |
| 225 | |
| 226 | static struct clockdomain per_clkdm = { |
| 227 | .name = "per_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 228 | .pwrdm = { .name = "per_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 229 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
| 230 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, |
| 231 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 232 | }; |
| 233 | |
| 234 | static struct clockdomain emu_clkdm = { |
| 235 | .name = "emu_clkdm", |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 236 | .pwrdm = { .name = "emu_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 237 | .flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_SWSUP, |
| 238 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, |
| 239 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 240 | }; |
| 241 | |
| 242 | #endif /* CONFIG_ARCH_OMAP34XX */ |
| 243 | |
| 244 | /* |
| 245 | * Clockdomain-powerdomain hwsup dependencies (34XX only) |
| 246 | */ |
| 247 | |
| 248 | static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = { |
| 249 | { |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 250 | .pwrdm = { .name = "mpu_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 251 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
| 252 | }, |
| 253 | { |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 254 | .pwrdm = { .name = "iva2_pwrdm" }, |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 255 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
| 256 | }, |
Paul Walmsley | 5b74c67 | 2009-02-03 02:10:03 -0700 | [diff] [blame^] | 257 | { |
| 258 | .pwrdm = { .name = NULL }, |
| 259 | } |
Paul Walmsley | 801954d | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 260 | }; |
| 261 | |
| 262 | /* |
| 263 | * |
| 264 | */ |
| 265 | |
| 266 | static struct clockdomain *clockdomains_omap[] = { |
| 267 | |
| 268 | &wkup_clkdm, |
| 269 | |
| 270 | #ifdef CONFIG_ARCH_OMAP2420 |
| 271 | &mpu_2420_clkdm, |
| 272 | &iva1_2420_clkdm, |
| 273 | #endif |
| 274 | |
| 275 | #ifdef CONFIG_ARCH_OMAP2430 |
| 276 | &mpu_2430_clkdm, |
| 277 | &mdm_clkdm, |
| 278 | #endif |
| 279 | |
| 280 | #ifdef CONFIG_ARCH_OMAP24XX |
| 281 | &dsp_clkdm, |
| 282 | &gfx_24xx_clkdm, |
| 283 | &core_l3_24xx_clkdm, |
| 284 | &core_l4_24xx_clkdm, |
| 285 | &dss_24xx_clkdm, |
| 286 | #endif |
| 287 | |
| 288 | #ifdef CONFIG_ARCH_OMAP34XX |
| 289 | &mpu_34xx_clkdm, |
| 290 | &neon_clkdm, |
| 291 | &iva2_clkdm, |
| 292 | &gfx_3430es1_clkdm, |
| 293 | &sgx_clkdm, |
| 294 | &d2d_clkdm, |
| 295 | &core_l3_34xx_clkdm, |
| 296 | &core_l4_34xx_clkdm, |
| 297 | &dss_34xx_clkdm, |
| 298 | &cam_clkdm, |
| 299 | &usbhost_clkdm, |
| 300 | &per_clkdm, |
| 301 | &emu_clkdm, |
| 302 | #endif |
| 303 | |
| 304 | NULL, |
| 305 | }; |
| 306 | |
| 307 | #endif |