OMAP2+ powerdomains/clockdomains: prepare for multi-OMAP configs
[pandora-kernel.git] / arch / arm / mach-omap2 / powerdomains.h
index 057b2e3..105cbca 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * OMAP2/3 common powerdomain definitions
  *
- * Copyright (C) 2007-8 Texas Instruments, Inc.
- * Copyright (C) 2007-8 Nokia Corporation
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2009 Nokia Corporation
  *
  * Written by Paul Walmsley
  * Debugging and integration fixes by Jouni Högander
  * published by the Free Software Foundation.
  */
 
+/*
+ * To Do List
+ * -> Move the Sleep/Wakeup dependencies from Power Domain framework to
+ *    Clock Domain Framework
+ */
+
 #ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS
 #define ARCH_ARM_MACH_OMAP2_POWERDOMAINS
 
 /*
  * This file contains all of the powerdomains that have some element
- * of software control for the OMAP24xx and OMAP34XX chips.
- *
- * A few notes:
+ * of software control for the OMAP24xx and OMAP34xx chips.
  *
  * This is not an exhaustive listing of powerdomains on the chips; only
  * powerdomains that can be controlled in software.
- *
- * A useful validation rule for struct powerdomain:
- * Any powerdomain referenced by a wkdep_srcs or sleepdep_srcs array
- * must have a dep_bit assigned.  So wkdep_srcs/sleepdep_srcs are really
- * just software-controllable dependencies.  Non-software-controllable
- * dependencies do exist, but they are not encoded below (yet).
- *
- * 24xx does not support programmable sleep dependencies (SLEEPDEP)
- *
  */
 
 /*
  *
  * On the 2420, this is a 'C55 DSP called, simply, the DSP.  Its
  * powerdomain is called the "DSP power domain."  On the 2430, the
- * on-board DSP is a 'C64 DSP, now called the IVA2 or IVA2.1.  Its
- * powerdomain is still called the "DSP power domain." On the 3430,
- * the DSP is a 'C64 DSP like the 2430, also known as the IVA2; but
- * its powerdomain is now called the "IVA2 power domain."
+ * on-board DSP is a 'C64 DSP, now called (along with its hardware
+ * accelerators) the IVA2 or IVA2.1.  Its powerdomain is still called
+ * the "DSP power domain." On the 3430, the DSP is a 'C64 DSP like the
+ * 2430, also known as the IVA2; but its powerdomain is now called the
+ * "IVA2 power domain."
  *
  * The 2420 also has something called the IVA, which is a separate ARM
  * core, and has nothing to do with the DSP/IVA2.
  *
  * Ideally the DSP/IVA2 could just be the same powerdomain, but the PRCM
  * address offset is different between the C55 and C64 DSPs.
- *
- * The overly-specific dep_bit names are due to a bit name collision
- * with CM_FCLKEN_{DSP,IVA2}.  The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
- * value are the same for all powerdomains: 2
- */
-
-/*
- * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
- * sanity check?
- * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
  */
 
 #include <plat/powerdomain.h>
 #include "prcm-common.h"
 #include "prm.h"
 #include "cm.h"
-
-/* OMAP2/3-common powerdomains and wakeup dependencies */
-
-/*
- * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP
- * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE
- * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE
- */
-static struct pwrdm_dep gfx_sgx_wkdeps[] = {
-       {
-               .pwrdm_name = "core_pwrdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .pwrdm_name = "iva2_pwrdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .pwrdm_name = "mpu_pwrdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
-                                           CHIP_IS_OMAP3430)
-       },
-       {
-               .pwrdm_name = "wkup_pwrdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
-                                           CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/*
- * 3430: CM_SLEEPDEP_CAM: MPU
- * 3430ES1: CM_SLEEPDEP_GFX: MPU
- * 3430ES2: CM_SLEEPDEP_SGX: MPU
- */
-static struct pwrdm_dep cam_gfx_sleepdeps[] = {
-       {
-               .pwrdm_name = "mpu_pwrdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-
 #include "powerdomains24xx.h"
 #include "powerdomains34xx.h"
+#include "powerdomains44xx.h"
 
+/* OMAP2/3-common powerdomains */
 
-/*
- * OMAP2/3 common powerdomains
- */
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
 
 /*
  * The GFX powerdomain is not present on 3430ES2, but currently we do not
  * have a macro to filter it out at compile-time.
  */
-static struct powerdomain gfx_pwrdm = {
+static struct powerdomain gfx_omap2_pwrdm = {
        .name             = "gfx_pwrdm",
        .prcm_offs        = GFX_MOD,
        .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
                                           CHIP_IS_OMAP3430ES1),
-       .wkdep_srcs       = gfx_sgx_wkdeps,
-       .sleepdep_srcs    = cam_gfx_sleepdeps,
        .pwrsts           = PWRSTS_OFF_RET_ON,
        .pwrsts_logic_ret = PWRDM_POWER_RET,
        .banks            = 1,
@@ -142,22 +82,24 @@ static struct powerdomain gfx_pwrdm = {
        },
 };
 
-static struct powerdomain wkup_pwrdm = {
+static struct powerdomain wkup_omap2_pwrdm = {
        .name           = "wkup_pwrdm",
        .prcm_offs      = WKUP_MOD,
        .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
-       .dep_bit        = OMAP_EN_WKUP_SHIFT,
 };
 
+#endif
 
 
 /* As powerdomains are added or removed above, this list must also be changed */
 static struct powerdomain *powerdomains_omap[] __initdata = {
 
-       &gfx_pwrdm,
-       &wkup_pwrdm,
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+       &wkup_omap2_pwrdm,
+       &gfx_omap2_pwrdm,
+#endif
 
-#ifdef CONFIG_ARCH_OMAP24XX
+#ifdef CONFIG_ARCH_OMAP2
        &dsp_pwrdm,
        &mpu_24xx_pwrdm,
        &core_24xx_pwrdm,
@@ -167,12 +109,12 @@ static struct powerdomain *powerdomains_omap[] __initdata = {
        &mdm_pwrdm,
 #endif
 
-#ifdef CONFIG_ARCH_OMAP34XX
+#ifdef CONFIG_ARCH_OMAP3
        &iva2_pwrdm,
-       &mpu_34xx_pwrdm,
+       &mpu_3xxx_pwrdm,
        &neon_pwrdm,
-       &core_34xx_pre_es3_1_pwrdm,
-       &core_34xx_es3_1_pwrdm,
+       &core_3xxx_pre_es3_1_pwrdm,
+       &core_3xxx_es3_1_pwrdm,
        &cam_pwrdm,
        &dss_pwrdm,
        &per_pwrdm,
@@ -186,6 +128,24 @@ static struct powerdomain *powerdomains_omap[] __initdata = {
        &dpll5_pwrdm,
 #endif
 
+#ifdef CONFIG_ARCH_OMAP4
+       &core_44xx_pwrdm,
+       &gfx_44xx_pwrdm,
+       &abe_44xx_pwrdm,
+       &dss_44xx_pwrdm,
+       &tesla_44xx_pwrdm,
+       &wkup_44xx_pwrdm,
+       &cpu0_44xx_pwrdm,
+       &cpu1_44xx_pwrdm,
+       &emu_44xx_pwrdm,
+       &mpu_44xx_pwrdm,
+       &ivahd_44xx_pwrdm,
+       &cam_44xx_pwrdm,
+       &l3init_44xx_pwrdm,
+       &l4per_44xx_pwrdm,
+       &always_on_core_44xx_pwrdm,
+       &cefuse_44xx_pwrdm,
+#endif
        NULL
 };