OMAP2+: clockdomains: move clockdomain static data to .c files
authorPaul Walmsley <paul@pwsan.com>
Wed, 22 Dec 2010 03:01:20 +0000 (20:01 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 22 Dec 2010 03:01:20 +0000 (20:01 -0700)
Static data should be declared in .c files, not .h files.  It should be
possible to #include .h files at any point without creating multiple
copies of the same data.

We converted the clock data to .c files some time ago.  This patch does
the same for the clockdomain data.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Rajendra Nayak <rnayak@ti.com>
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/clockdomains.h [deleted file]
arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c [new file with mode: 0644]
arch/arm/mach-omap2/clockdomains44xx.h [deleted file]
arch/arm/mach-omap2/clockdomains44xx_data.c [new file with mode: 0644]
arch/arm/mach-omap2/io.c
arch/arm/plat-omap/include/plat/clockdomain.h

index 4d6fa15f3b628a5be9bad0a6cd77241265949e06..2006deef0183e93860c1ab6779f104da24481e3b 100644 (file)
@@ -10,8 +10,7 @@ omap-2-3-common                               = irq.o sdrc.o prm2xxx_3xxx.o
 hwmod-common                           = omap_hwmod.o \
                                          omap_hwmod_common_data.o
 clock-common                           = clock.o clock_common_data.o \
-                                         clockdomain.o clkt_dpll.o \
-                                         clkt_clksel.o
+                                         clkt_dpll.o clkt_clksel.o
 
 obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common)
@@ -91,6 +90,13 @@ obj-$(CONFIG_ARCH_OMAP4)             += $(powerdomain-common) \
                                           powerdomain44xx.o \
                                           powerdomains44xx_data.o
 
+# PRCM clockdomain control
+obj-$(CONFIG_ARCH_OMAP2)               += clockdomain.o \
+                                          clockdomains2xxx_3xxx_data.o
+obj-$(CONFIG_ARCH_OMAP3)               += clockdomain.o \
+                                          clockdomains2xxx_3xxx_data.o
+obj-$(CONFIG_ARCH_OMAP4)               += clockdomain.o \
+                                          clockdomains44xx_data.o
 # Clock framework
 obj-$(CONFIG_ARCH_OMAP2)               += $(clock-common) clock2xxx.o \
                                           clkt2xxx_sys.o \
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h
deleted file mode 100644 (file)
index 2a3b10a..0000000
+++ /dev/null
@@ -1,942 +0,0 @@
-/*
- * OMAP2/3 clockdomains
- *
- * Copyright (C) 2008-2009 Texas Instruments, Inc.
- * Copyright (C) 2008-2010 Nokia Corporation
- *
- * Written by Paul Walmsley and Jouni Högander
- *
- * This file contains clockdomains and clockdomain wakeup/sleep
- * dependencies for the OMAP2/3 chips.  Some notes:
- *
- * A useful validation rule for struct clockdomain: Any clockdomain
- * 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)
- *
- * 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
- */
-
-/*
- * To-Do List
- * -> Port the Sleep/Wakeup dependencies for the domains
- *    from the Power domain framework
- */
-
-#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H
-#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H
-
-#include <plat/clockdomain.h>
-#include "cm.h"
-#include "prm.h"
-#include "cm-regbits-24xx.h"
-#include "cm-regbits-34xx.h"
-#include "cm-regbits-44xx.h"
-#include "prm-regbits-24xx.h"
-#include "prm-regbits-34xx.h"
-
-/*
- * Clockdomain dependencies for wkdeps/sleepdeps
- *
- * XXX Hardware dependencies (e.g., dependencies that cannot be
- * changed in software) are not included here yet, but should be.
- */
-
-/* OMAP2/3-common 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
- * These can share data since they will never be present simultaneously
- * on the same device.
- */
-static struct clkdm_dep gfx_sgx_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
-                                           CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
-                                           CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-
-/* 24XX-specific possible dependencies */
-
-#ifdef CONFIG_ARCH_OMAP2
-
-/* Wakeup dependency source arrays */
-
-/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
-static struct clkdm_dep dsp_24xx_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       { NULL },
-};
-
-/*
- * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP
- * 2430 adds MDM
- */
-static struct clkdm_dep mpu_24xx_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "dsp_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "mdm_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
-       },
-       { NULL },
-};
-
-/*
- * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP
- * 2430 adds MDM
- */
-static struct clkdm_dep core_24xx_wkdeps[] = {
-       {
-               .clkdm_name = "dsp_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "gfx_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "mdm_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
-       },
-       { NULL },
-};
-
-#endif
-
-
-/* 2430-specific possible wakeup dependencies */
-
-#ifdef CONFIG_ARCH_OMAP2430
-
-/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
-static struct clkdm_dep mdm_2430_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
-       },
-       { NULL },
-};
-
-#endif /* CONFIG_ARCH_OMAP2430 */
-
-
-/* OMAP3-specific possible dependencies */
-
-#ifdef CONFIG_ARCH_OMAP3
-
-/* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */
-static struct clkdm_dep per_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */
-static struct clkdm_dep usbhost_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */
-static struct clkdm_dep mpu_3xxx_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "dss_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "per_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */
-static struct clkdm_dep iva2_wkdeps[] = {
-       {
-               .clkdm_name = "core_l3_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "core_l4_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "dss_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "per_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-
-/* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */
-static struct clkdm_dep cam_wkdeps[] = {
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */
-static struct clkdm_dep dss_wkdeps[] = {
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "wkup_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430: PM_WKDEP_NEON: MPU */
-static struct clkdm_dep neon_wkdeps[] = {
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-
-/* Sleep dependency source arrays for OMAP3-specific clkdms */
-
-/* 3430: CM_SLEEPDEP_DSS: MPU, IVA */
-static struct clkdm_dep dss_sleepdeps[] = {
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430: CM_SLEEPDEP_PER: MPU, IVA */
-static struct clkdm_dep per_sleepdeps[] = {
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */
-static struct clkdm_dep usbhost_sleepdeps[] = {
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm_name = "iva2_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/* 3430: CM_SLEEPDEP_CAM: MPU */
-static struct clkdm_dep cam_sleepdeps[] = {
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-/*
- * 3430ES1: CM_SLEEPDEP_GFX: MPU
- * 3430ES2: CM_SLEEPDEP_SGX: MPU
- * These can share data since they will never be present simultaneously
- * on the same device.
- */
-static struct clkdm_dep gfx_sgx_sleepdeps[] = {
-       {
-               .clkdm_name = "mpu_clkdm",
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       { NULL },
-};
-
-#endif /* CONFIG_ARCH_OMAP3 */
-
-
-/*
- * OMAP2/3-common clockdomains
- *
- * Even though the 2420 has a single PRCM module from the
- * interconnect's perspective, internally it does appear to have
- * separate PRM and CM clockdomains.  The usual test case is
- * sys_clkout/sys_clkout2.
- */
-
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-
-/* This is an implicit clockdomain - it is never defined as such in TRM */
-static struct clockdomain wkup_clkdm = {
-       .name           = "wkup_clkdm",
-       .pwrdm          = { .name = "wkup_pwrdm" },
-       .dep_bit        = OMAP_EN_WKUP_SHIFT,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain prm_clkdm = {
-       .name           = "prm_clkdm",
-       .pwrdm          = { .name = "wkup_pwrdm" },
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain cm_clkdm = {
-       .name           = "cm_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
-};
-
-#endif
-
-/*
- * 2420-only clockdomains
- */
-
-#if defined(CONFIG_ARCH_OMAP2420)
-
-static struct clockdomain mpu_2420_clkdm = {
-       .name           = "mpu_clkdm",
-       .pwrdm          = { .name = "mpu_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = mpu_24xx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-static struct clockdomain iva1_2420_clkdm = {
-       .name           = "iva1_clkdm",
-       .pwrdm          = { .name = "dsp_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
-       .wkdep_srcs     = dsp_24xx_wkdeps,
-       .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-static struct clockdomain dsp_2420_clkdm = {
-       .name           = "dsp_clkdm",
-       .pwrdm          = { .name = "dsp_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-static struct clockdomain gfx_2420_clkdm = {
-       .name           = "gfx_clkdm",
-       .pwrdm          = { .name = "gfx_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = gfx_sgx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-static struct clockdomain core_l3_2420_clkdm = {
-       .name           = "core_l3_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = core_24xx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-static struct clockdomain core_l4_2420_clkdm = {
-       .name           = "core_l4_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = core_24xx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-static struct clockdomain dss_2420_clkdm = {
-       .name           = "dss_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
-};
-
-#endif   /* CONFIG_ARCH_OMAP2420 */
-
-
-/*
- * 2430-only clockdomains
- */
-
-#if defined(CONFIG_ARCH_OMAP2430)
-
-static struct clockdomain mpu_2430_clkdm = {
-       .name           = "mpu_clkdm",
-       .pwrdm          = { .name = "mpu_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP2430_CM_REGADDR(MPU_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = mpu_24xx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-/* Another case of bit name collisions between several registers: EN_MDM */
-static struct clockdomain mdm_clkdm = {
-       .name           = "mdm_clkdm",
-       .pwrdm          = { .name = "mdm_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
-       .wkdep_srcs     = mdm_2430_wkdeps,
-       .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-static struct clockdomain dsp_2430_clkdm = {
-       .name           = "dsp_clkdm",
-       .pwrdm          = { .name = "dsp_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
-       .wkdep_srcs     = dsp_24xx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-static struct clockdomain gfx_2430_clkdm = {
-       .name           = "gfx_clkdm",
-       .pwrdm          = { .name = "gfx_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = gfx_sgx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-/*
- * XXX add usecounting for clkdm dependencies, otherwise the presence
- * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
- * could cause trouble
- */
-static struct clockdomain core_l3_2430_clkdm = {
-       .name           = "core_l3_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP24XX_EN_CORE_SHIFT,
-       .wkdep_srcs     = core_24xx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-/*
- * XXX add usecounting for clkdm dependencies, otherwise the presence
- * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
- * could cause trouble
- */
-static struct clockdomain core_l4_2430_clkdm = {
-       .name           = "core_l4_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP24XX_EN_CORE_SHIFT,
-       .wkdep_srcs     = core_24xx_wkdeps,
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-static struct clockdomain dss_2430_clkdm = {
-       .name           = "dss_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
-};
-
-#endif    /* CONFIG_ARCH_OMAP2430 */
-
-
-/*
- * OMAP3 clockdomains
- */
-
-#if defined(CONFIG_ARCH_OMAP3)
-
-static struct clockdomain mpu_3xxx_clkdm = {
-       .name           = "mpu_clkdm",
-       .pwrdm          = { .name = "mpu_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP3430_EN_MPU_SHIFT,
-       .wkdep_srcs     = mpu_3xxx_wkdeps,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain neon_clkdm = {
-       .name           = "neon_clkdm",
-       .pwrdm          = { .name = "neon_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = neon_wkdeps,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain iva2_clkdm = {
-       .name           = "iva2_clkdm",
-       .pwrdm          = { .name = "iva2_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
-       .wkdep_srcs     = iva2_wkdeps,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain gfx_3430es1_clkdm = {
-       .name           = "gfx_clkdm",
-       .pwrdm          = { .name = "gfx_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = gfx_sgx_wkdeps,
-       .sleepdep_srcs  = gfx_sgx_sleepdeps,
-       .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
-};
-
-static struct clockdomain sgx_clkdm = {
-       .name           = "sgx_clkdm",
-       .pwrdm          = { .name = "sgx_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = gfx_sgx_wkdeps,
-       .sleepdep_srcs  = gfx_sgx_sleepdeps,
-       .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
-};
-
-/*
- * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but
- * then that information was removed from the 34xx ES2+ TRM.  It is
- * unclear whether the core is still there, but the clockdomain logic
- * is there, and must be programmed to an appropriate state if the
- * CORE clockdomain is to become inactive.
- */
-static struct clockdomain d2d_clkdm = {
-       .name           = "d2d_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-/*
- * XXX add usecounting for clkdm dependencies, otherwise the presence
- * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
- * could cause trouble
- */
-static struct clockdomain core_l3_3xxx_clkdm = {
-       .name           = "core_l3_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP3430_EN_CORE_SHIFT,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-/*
- * XXX add usecounting for clkdm dependencies, otherwise the presence
- * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
- * could cause trouble
- */
-static struct clockdomain core_l4_3xxx_clkdm = {
-       .name           = "core_l4_clkdm",
-       .pwrdm          = { .name = "core_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP3430_EN_CORE_SHIFT,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-/* Another case of bit name collisions between several registers: EN_DSS */
-static struct clockdomain dss_3xxx_clkdm = {
-       .name           = "dss_clkdm",
-       .pwrdm          = { .name = "dss_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
-       .wkdep_srcs     = dss_wkdeps,
-       .sleepdep_srcs  = dss_sleepdeps,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain cam_clkdm = {
-       .name           = "cam_clkdm",
-       .pwrdm          = { .name = "cam_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = cam_wkdeps,
-       .sleepdep_srcs  = cam_sleepdeps,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain usbhost_clkdm = {
-       .name           = "usbhost_clkdm",
-       .pwrdm          = { .name = "usbhost_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .wkdep_srcs     = usbhost_wkdeps,
-       .sleepdep_srcs  = usbhost_sleepdeps,
-       .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
-};
-
-static struct clockdomain per_clkdm = {
-       .name           = "per_clkdm",
-       .pwrdm          = { .name = "per_pwrdm" },
-       .flags          = CLKDM_CAN_HWSUP_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .dep_bit        = OMAP3430_EN_PER_SHIFT,
-       .wkdep_srcs     = per_wkdeps,
-       .sleepdep_srcs  = per_sleepdeps,
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-/*
- * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
- * switched of even if sdti is in use
- */
-static struct clockdomain emu_clkdm = {
-       .name           = "emu_clkdm",
-       .pwrdm          = { .name = "emu_pwrdm" },
-       .flags          = /* CLKDM_CAN_ENABLE_AUTO |  */CLKDM_CAN_SWSUP,
-       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_EMU_MOD,
-                                                OMAP2_CM_CLKSTCTRL),
-       .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain dpll1_clkdm = {
-       .name           = "dpll1_clkdm",
-       .pwrdm          = { .name = "dpll1_pwrdm" },
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain dpll2_clkdm = {
-       .name           = "dpll2_clkdm",
-       .pwrdm          = { .name = "dpll2_pwrdm" },
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain dpll3_clkdm = {
-       .name           = "dpll3_clkdm",
-       .pwrdm          = { .name = "dpll3_pwrdm" },
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain dpll4_clkdm = {
-       .name           = "dpll4_clkdm",
-       .pwrdm          = { .name = "dpll4_pwrdm" },
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
-};
-
-static struct clockdomain dpll5_clkdm = {
-       .name           = "dpll5_clkdm",
-       .pwrdm          = { .name = "dpll5_pwrdm" },
-       .omap_chip      = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
-};
-
-#endif   /* CONFIG_ARCH_OMAP3 */
-
-#include "clockdomains44xx.h"
-
-/*
- * Clockdomain hwsup dependencies (OMAP3 only)
- */
-
-static struct clkdm_autodep clkdm_autodeps[] = {
-       {
-               .clkdm     = { .name = "mpu_clkdm" },
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm     = { .name = "iva2_clkdm" },
-               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
-       },
-       {
-               .clkdm     = { .name = NULL },
-       }
-};
-
-/*
- * List of clockdomain pointers per platform
- */
-
-static struct clockdomain *clockdomains_omap[] = {
-
-#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-       &wkup_clkdm,
-       &cm_clkdm,
-       &prm_clkdm,
-#endif
-
-#ifdef CONFIG_ARCH_OMAP2420
-       &mpu_2420_clkdm,
-       &iva1_2420_clkdm,
-       &dsp_2420_clkdm,
-       &gfx_2420_clkdm,
-       &core_l3_2420_clkdm,
-       &core_l4_2420_clkdm,
-       &dss_2420_clkdm,
-#endif
-
-#ifdef CONFIG_ARCH_OMAP2430
-       &mpu_2430_clkdm,
-       &mdm_clkdm,
-       &dsp_2430_clkdm,
-       &gfx_2430_clkdm,
-       &core_l3_2430_clkdm,
-       &core_l4_2430_clkdm,
-       &dss_2430_clkdm,
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-       &mpu_3xxx_clkdm,
-       &neon_clkdm,
-       &iva2_clkdm,
-       &gfx_3430es1_clkdm,
-       &sgx_clkdm,
-       &d2d_clkdm,
-       &core_l3_3xxx_clkdm,
-       &core_l4_3xxx_clkdm,
-       &dss_3xxx_clkdm,
-       &cam_clkdm,
-       &usbhost_clkdm,
-       &per_clkdm,
-       &emu_clkdm,
-       &dpll1_clkdm,
-       &dpll2_clkdm,
-       &dpll3_clkdm,
-       &dpll4_clkdm,
-       &dpll5_clkdm,
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-       &l4_cefuse_44xx_clkdm,
-       &l4_cfg_44xx_clkdm,
-       &tesla_44xx_clkdm,
-       &l3_gfx_44xx_clkdm,
-       &ivahd_44xx_clkdm,
-       &l4_secure_44xx_clkdm,
-       &l4_per_44xx_clkdm,
-       &abe_44xx_clkdm,
-       &l3_instr_44xx_clkdm,
-       &l3_init_44xx_clkdm,
-       &mpuss_44xx_clkdm,
-       &mpu0_44xx_clkdm,
-       &mpu1_44xx_clkdm,
-       &l3_emif_44xx_clkdm,
-       &l4_ao_44xx_clkdm,
-       &ducati_44xx_clkdm,
-       &l3_2_44xx_clkdm,
-       &l3_1_44xx_clkdm,
-       &l3_d2d_44xx_clkdm,
-       &iss_44xx_clkdm,
-       &l3_dss_44xx_clkdm,
-       &l4_wkup_44xx_clkdm,
-       &emu_sys_44xx_clkdm,
-       &l3_dma_44xx_clkdm,
-#endif
-
-       NULL,
-};
-
-#endif
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
new file mode 100644 (file)
index 0000000..8dadf75
--- /dev/null
@@ -0,0 +1,900 @@
+/*
+ * OMAP2/3 clockdomains
+ *
+ * Copyright (C) 2008-2009 Texas Instruments, Inc.
+ * Copyright (C) 2008-2010 Nokia Corporation
+ *
+ * Paul Walmsley, Jouni Högander
+ *
+ * This file contains clockdomains and clockdomain wakeup/sleep
+ * dependencies for the OMAP2/3 chips.  Some notes:
+ *
+ * A useful validation rule for struct clockdomain: Any clockdomain
+ * 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)
+ *
+ * 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
+ */
+
+/*
+ * To-Do List
+ * -> Port the Sleep/Wakeup dependencies for the domains
+ *    from the Power domain framework
+ */
+
+#include <linux/kernel.h>
+#include <linux/io.h>
+
+#include <plat/clockdomain.h>
+#include "cm.h"
+#include "prm.h"
+#include "cm-regbits-24xx.h"
+#include "cm-regbits-34xx.h"
+#include "cm-regbits-44xx.h"
+#include "prm-regbits-24xx.h"
+#include "prm-regbits-34xx.h"
+
+/*
+ * Clockdomain dependencies for wkdeps/sleepdeps
+ *
+ * XXX Hardware dependencies (e.g., dependencies that cannot be
+ * changed in software) are not included here yet, but should be.
+ */
+
+/* OMAP2/3-common 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
+ * These can share data since they will never be present simultaneously
+ * on the same device.
+ */
+static struct clkdm_dep gfx_sgx_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
+                                           CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
+                                           CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+
+/* 24XX-specific possible dependencies */
+
+/* Wakeup dependency source arrays */
+
+/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
+static struct clkdm_dep dsp_24xx_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       { NULL },
+};
+
+/*
+ * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP
+ * 2430 adds MDM
+ */
+static struct clkdm_dep mpu_24xx_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "dsp_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "mdm_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+       },
+       { NULL },
+};
+
+/*
+ * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP
+ * 2430 adds MDM
+ */
+static struct clkdm_dep core_24xx_wkdeps[] = {
+       {
+               .clkdm_name = "dsp_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "gfx_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "mdm_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+       },
+       { NULL },
+};
+
+
+/* 2430-specific possible wakeup dependencies */
+
+#ifdef CONFIG_ARCH_OMAP2430
+
+/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
+static struct clkdm_dep mdm_2430_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
+       },
+       { NULL },
+};
+
+#endif /* CONFIG_ARCH_OMAP2430 */
+
+
+/* OMAP3-specific possible dependencies */
+
+#ifdef CONFIG_ARCH_OMAP3
+
+/* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */
+static struct clkdm_dep per_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */
+static struct clkdm_dep usbhost_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */
+static struct clkdm_dep mpu_3xxx_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "dss_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "per_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */
+static struct clkdm_dep iva2_wkdeps[] = {
+       {
+               .clkdm_name = "core_l3_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "core_l4_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "dss_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "per_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+
+/* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */
+static struct clkdm_dep cam_wkdeps[] = {
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */
+static struct clkdm_dep dss_wkdeps[] = {
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "wkup_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430: PM_WKDEP_NEON: MPU */
+static struct clkdm_dep neon_wkdeps[] = {
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+
+/* Sleep dependency source arrays for OMAP3-specific clkdms */
+
+/* 3430: CM_SLEEPDEP_DSS: MPU, IVA */
+static struct clkdm_dep dss_sleepdeps[] = {
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430: CM_SLEEPDEP_PER: MPU, IVA */
+static struct clkdm_dep per_sleepdeps[] = {
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */
+static struct clkdm_dep usbhost_sleepdeps[] = {
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm_name = "iva2_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/* 3430: CM_SLEEPDEP_CAM: MPU */
+static struct clkdm_dep cam_sleepdeps[] = {
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+/*
+ * 3430ES1: CM_SLEEPDEP_GFX: MPU
+ * 3430ES2: CM_SLEEPDEP_SGX: MPU
+ * These can share data since they will never be present simultaneously
+ * on the same device.
+ */
+static struct clkdm_dep gfx_sgx_sleepdeps[] = {
+       {
+               .clkdm_name = "mpu_clkdm",
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       { NULL },
+};
+
+#endif /* CONFIG_ARCH_OMAP3 */
+
+
+/*
+ * OMAP2/3-common clockdomains
+ *
+ * Even though the 2420 has a single PRCM module from the
+ * interconnect's perspective, internally it does appear to have
+ * separate PRM and CM clockdomains.  The usual test case is
+ * sys_clkout/sys_clkout2.
+ */
+
+/* This is an implicit clockdomain - it is never defined as such in TRM */
+static struct clockdomain wkup_clkdm = {
+       .name           = "wkup_clkdm",
+       .pwrdm          = { .name = "wkup_pwrdm" },
+       .dep_bit        = OMAP_EN_WKUP_SHIFT,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain prm_clkdm = {
+       .name           = "prm_clkdm",
+       .pwrdm          = { .name = "wkup_pwrdm" },
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain cm_clkdm = {
+       .name           = "cm_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
+};
+
+/*
+ * 2420-only clockdomains
+ */
+
+#if defined(CONFIG_ARCH_OMAP2420)
+
+static struct clockdomain mpu_2420_clkdm = {
+       .name           = "mpu_clkdm",
+       .pwrdm          = { .name = "mpu_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = mpu_24xx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct clockdomain iva1_2420_clkdm = {
+       .name           = "iva1_clkdm",
+       .pwrdm          = { .name = "dsp_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
+       .wkdep_srcs     = dsp_24xx_wkdeps,
+       .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct clockdomain dsp_2420_clkdm = {
+       .name           = "dsp_clkdm",
+       .pwrdm          = { .name = "dsp_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct clockdomain gfx_2420_clkdm = {
+       .name           = "gfx_clkdm",
+       .pwrdm          = { .name = "gfx_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = gfx_sgx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct clockdomain core_l3_2420_clkdm = {
+       .name           = "core_l3_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = core_24xx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct clockdomain core_l4_2420_clkdm = {
+       .name           = "core_l4_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = core_24xx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+static struct clockdomain dss_2420_clkdm = {
+       .name           = "dss_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+};
+
+#endif   /* CONFIG_ARCH_OMAP2420 */
+
+
+/*
+ * 2430-only clockdomains
+ */
+
+#if defined(CONFIG_ARCH_OMAP2430)
+
+static struct clockdomain mpu_2430_clkdm = {
+       .name           = "mpu_clkdm",
+       .pwrdm          = { .name = "mpu_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP2430_CM_REGADDR(MPU_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = mpu_24xx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/* Another case of bit name collisions between several registers: EN_MDM */
+static struct clockdomain mdm_clkdm = {
+       .name           = "mdm_clkdm",
+       .pwrdm          = { .name = "mdm_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
+       .wkdep_srcs     = mdm_2430_wkdeps,
+       .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct clockdomain dsp_2430_clkdm = {
+       .name           = "dsp_clkdm",
+       .pwrdm          = { .name = "dsp_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
+       .wkdep_srcs     = dsp_24xx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct clockdomain gfx_2430_clkdm = {
+       .name           = "gfx_clkdm",
+       .pwrdm          = { .name = "gfx_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = gfx_sgx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/*
+ * XXX add usecounting for clkdm dependencies, otherwise the presence
+ * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
+ * could cause trouble
+ */
+static struct clockdomain core_l3_2430_clkdm = {
+       .name           = "core_l3_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP24XX_EN_CORE_SHIFT,
+       .wkdep_srcs     = core_24xx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+/*
+ * XXX add usecounting for clkdm dependencies, otherwise the presence
+ * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
+ * could cause trouble
+ */
+static struct clockdomain core_l4_2430_clkdm = {
+       .name           = "core_l4_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP24XX_EN_CORE_SHIFT,
+       .wkdep_srcs     = core_24xx_wkdeps,
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+static struct clockdomain dss_2430_clkdm = {
+       .name           = "dss_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+};
+
+#endif    /* CONFIG_ARCH_OMAP2430 */
+
+
+/*
+ * OMAP3 clockdomains
+ */
+
+#if defined(CONFIG_ARCH_OMAP3)
+
+static struct clockdomain mpu_3xxx_clkdm = {
+       .name           = "mpu_clkdm",
+       .pwrdm          = { .name = "mpu_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP3430_EN_MPU_SHIFT,
+       .wkdep_srcs     = mpu_3xxx_wkdeps,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain neon_clkdm = {
+       .name           = "neon_clkdm",
+       .pwrdm          = { .name = "neon_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = neon_wkdeps,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain iva2_clkdm = {
+       .name           = "iva2_clkdm",
+       .pwrdm          = { .name = "iva2_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
+       .wkdep_srcs     = iva2_wkdeps,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain gfx_3430es1_clkdm = {
+       .name           = "gfx_clkdm",
+       .pwrdm          = { .name = "gfx_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = gfx_sgx_wkdeps,
+       .sleepdep_srcs  = gfx_sgx_sleepdeps,
+       .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
+};
+
+static struct clockdomain sgx_clkdm = {
+       .name           = "sgx_clkdm",
+       .pwrdm          = { .name = "sgx_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = gfx_sgx_wkdeps,
+       .sleepdep_srcs  = gfx_sgx_sleepdeps,
+       .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
+};
+
+/*
+ * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but
+ * then that information was removed from the 34xx ES2+ TRM.  It is
+ * unclear whether the core is still there, but the clockdomain logic
+ * is there, and must be programmed to an appropriate state if the
+ * CORE clockdomain is to become inactive.
+ */
+static struct clockdomain d2d_clkdm = {
+       .name           = "d2d_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * XXX add usecounting for clkdm dependencies, otherwise the presence
+ * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
+ * could cause trouble
+ */
+static struct clockdomain core_l3_3xxx_clkdm = {
+       .name           = "core_l3_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP3430_EN_CORE_SHIFT,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * XXX add usecounting for clkdm dependencies, otherwise the presence
+ * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
+ * could cause trouble
+ */
+static struct clockdomain core_l4_3xxx_clkdm = {
+       .name           = "core_l4_clkdm",
+       .pwrdm          = { .name = "core_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP3430_EN_CORE_SHIFT,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/* Another case of bit name collisions between several registers: EN_DSS */
+static struct clockdomain dss_3xxx_clkdm = {
+       .name           = "dss_clkdm",
+       .pwrdm          = { .name = "dss_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
+       .wkdep_srcs     = dss_wkdeps,
+       .sleepdep_srcs  = dss_sleepdeps,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain cam_clkdm = {
+       .name           = "cam_clkdm",
+       .pwrdm          = { .name = "cam_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = cam_wkdeps,
+       .sleepdep_srcs  = cam_sleepdeps,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain usbhost_clkdm = {
+       .name           = "usbhost_clkdm",
+       .pwrdm          = { .name = "usbhost_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .wkdep_srcs     = usbhost_wkdeps,
+       .sleepdep_srcs  = usbhost_sleepdeps,
+       .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
+};
+
+static struct clockdomain per_clkdm = {
+       .name           = "per_clkdm",
+       .pwrdm          = { .name = "per_pwrdm" },
+       .flags          = CLKDM_CAN_HWSUP_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .dep_bit        = OMAP3430_EN_PER_SHIFT,
+       .wkdep_srcs     = per_wkdeps,
+       .sleepdep_srcs  = per_sleepdeps,
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+/*
+ * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
+ * switched of even if sdti is in use
+ */
+static struct clockdomain emu_clkdm = {
+       .name           = "emu_clkdm",
+       .pwrdm          = { .name = "emu_pwrdm" },
+       .flags          = /* CLKDM_CAN_ENABLE_AUTO |  */CLKDM_CAN_SWSUP,
+       .clkstctrl_reg  = OMAP34XX_CM_REGADDR(OMAP3430_EMU_MOD,
+                                                OMAP2_CM_CLKSTCTRL),
+       .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain dpll1_clkdm = {
+       .name           = "dpll1_clkdm",
+       .pwrdm          = { .name = "dpll1_pwrdm" },
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain dpll2_clkdm = {
+       .name           = "dpll2_clkdm",
+       .pwrdm          = { .name = "dpll2_pwrdm" },
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain dpll3_clkdm = {
+       .name           = "dpll3_clkdm",
+       .pwrdm          = { .name = "dpll3_pwrdm" },
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain dpll4_clkdm = {
+       .name           = "dpll4_clkdm",
+       .pwrdm          = { .name = "dpll4_pwrdm" },
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+};
+
+static struct clockdomain dpll5_clkdm = {
+       .name           = "dpll5_clkdm",
+       .pwrdm          = { .name = "dpll5_pwrdm" },
+       .omap_chip      = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
+};
+
+#endif   /* CONFIG_ARCH_OMAP3 */
+
+/*
+ * Clockdomain hwsup dependencies (OMAP3 only)
+ */
+
+static struct clkdm_autodep clkdm_autodeps[] = {
+       {
+               .clkdm     = { .name = "mpu_clkdm" },
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm     = { .name = "iva2_clkdm" },
+               .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+       },
+       {
+               .clkdm     = { .name = NULL },
+       }
+};
+
+static struct clockdomain *clockdomains_omap2[] __initdata = {
+       &wkup_clkdm,
+       &cm_clkdm,
+       &prm_clkdm,
+
+#ifdef CONFIG_ARCH_OMAP2420
+       &mpu_2420_clkdm,
+       &iva1_2420_clkdm,
+       &dsp_2420_clkdm,
+       &gfx_2420_clkdm,
+       &core_l3_2420_clkdm,
+       &core_l4_2420_clkdm,
+       &dss_2420_clkdm,
+#endif
+
+#ifdef CONFIG_ARCH_OMAP2430
+       &mpu_2430_clkdm,
+       &mdm_clkdm,
+       &dsp_2430_clkdm,
+       &gfx_2430_clkdm,
+       &core_l3_2430_clkdm,
+       &core_l4_2430_clkdm,
+       &dss_2430_clkdm,
+#endif
+
+#ifdef CONFIG_ARCH_OMAP3
+       &mpu_3xxx_clkdm,
+       &neon_clkdm,
+       &iva2_clkdm,
+       &gfx_3430es1_clkdm,
+       &sgx_clkdm,
+       &d2d_clkdm,
+       &core_l3_3xxx_clkdm,
+       &core_l4_3xxx_clkdm,
+       &dss_3xxx_clkdm,
+       &cam_clkdm,
+       &usbhost_clkdm,
+       &per_clkdm,
+       &emu_clkdm,
+       &dpll1_clkdm,
+       &dpll2_clkdm,
+       &dpll3_clkdm,
+       &dpll4_clkdm,
+       &dpll5_clkdm,
+#endif
+       NULL,
+};
+
+void __init omap2_clockdomains_init(void)
+{
+       clkdm_init(clockdomains_omap2, clkdm_autodeps);
+}
diff --git a/arch/arm/mach-omap2/clockdomains44xx.h b/arch/arm/mach-omap2/clockdomains44xx.h
deleted file mode 100644 (file)
index 7e5ba0f..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * OMAP4 Clock domains framework
- *
- * Copyright (C) 2009 Texas Instruments, Inc.
- * Copyright (C) 2009 Nokia Corporation
- *
- * Abhijit Pagare (abhijitpagare@ti.com)
- * Benoit Cousson (b-cousson@ti.com)
- *
- * This file is automatically generated from the OMAP hardware databases.
- * We respectfully ask that any modifications to this file be coordinated
- * with the public linux-omap@vger.kernel.org mailing list and the
- * authors above to ensure that the autogeneration scripts are kept
- * up-to-date with the file contents.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * To-Do List
- * -> Populate the Sleep/Wakeup dependencies for the domains
- */
-
-#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H
-#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H
-
-#include <plat/clockdomain.h>
-
-#if defined(CONFIG_ARCH_OMAP4)
-
-static struct clockdomain l4_cefuse_44xx_clkdm = {
-       .name             = "l4_cefuse_clkdm",
-       .pwrdm            = { .name = "cefuse_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_CEFUSE_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l4_cfg_44xx_clkdm = {
-       .name             = "l4_cfg_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_L4CFG_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain tesla_44xx_clkdm = {
-       .name             = "tesla_clkdm",
-       .pwrdm            = { .name = "tesla_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_TESLA_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_gfx_44xx_clkdm = {
-       .name             = "l3_gfx_clkdm",
-       .pwrdm            = { .name = "gfx_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_GFX_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain ivahd_44xx_clkdm = {
-       .name             = "ivahd_clkdm",
-       .pwrdm            = { .name = "ivahd_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_IVAHD_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l4_secure_44xx_clkdm = {
-       .name             = "l4_secure_clkdm",
-       .pwrdm            = { .name = "l4per_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_L4SEC_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l4_per_44xx_clkdm = {
-       .name             = "l4_per_clkdm",
-       .pwrdm            = { .name = "l4per_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_L4PER_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain abe_44xx_clkdm = {
-       .name             = "abe_clkdm",
-       .pwrdm            = { .name = "abe_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM1_ABE_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_instr_44xx_clkdm = {
-       .name             = "l3_instr_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_L3INSTR_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_init_44xx_clkdm = {
-       .name             = "l3_init_clkdm",
-       .pwrdm            = { .name = "l3init_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_L3INIT_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain mpuss_44xx_clkdm = {
-       .name             = "mpuss_clkdm",
-       .pwrdm            = { .name = "mpu_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_MPU_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain mpu0_44xx_clkdm = {
-       .name             = "mpu0_clkdm",
-       .pwrdm            = { .name = "cpu0_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_CPU0_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain mpu1_44xx_clkdm = {
-       .name             = "mpu1_clkdm",
-       .pwrdm            = { .name = "cpu1_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_CPU1_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_emif_44xx_clkdm = {
-       .name             = "l3_emif_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_MEMIF_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l4_ao_44xx_clkdm = {
-       .name             = "l4_ao_clkdm",
-       .pwrdm            = { .name = "always_on_core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_ALWON_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain ducati_44xx_clkdm = {
-       .name             = "ducati_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_DUCATI_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_2_44xx_clkdm = {
-       .name             = "l3_2_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_L3_2_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_1_44xx_clkdm = {
-       .name             = "l3_1_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_L3_1_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_d2d_44xx_clkdm = {
-       .name             = "l3_d2d_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_D2D_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain iss_44xx_clkdm = {
-       .name             = "iss_clkdm",
-       .pwrdm            = { .name = "cam_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_CAM_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_dss_44xx_clkdm = {
-       .name             = "l3_dss_clkdm",
-       .pwrdm            = { .name = "dss_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_DSS_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l4_wkup_44xx_clkdm = {
-       .name             = "l4_wkup_clkdm",
-       .pwrdm            = { .name = "wkup_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_WKUP_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain emu_sys_44xx_clkdm = {
-       .name             = "emu_sys_clkdm",
-       .pwrdm            = { .name = "emu_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_EMU_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-static struct clockdomain l3_dma_44xx_clkdm = {
-       .name             = "l3_dma_clkdm",
-       .pwrdm            = { .name = "core_pwrdm" },
-       .clkstctrl_reg    = OMAP4430_CM_SDMA_CLKSTCTRL,
-       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
-       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
-       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
-};
-
-#endif
-
-#endif
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c
new file mode 100644 (file)
index 0000000..c847a8b
--- /dev/null
@@ -0,0 +1,282 @@
+/*
+ * OMAP4 Clock domains framework
+ *
+ * Copyright (C) 2009 Texas Instruments, Inc.
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * Abhijit Pagare (abhijitpagare@ti.com)
+ * Benoit Cousson (b-cousson@ti.com)
+ *
+ * This file is automatically generated from the OMAP hardware databases.
+ * We respectfully ask that any modifications to this file be coordinated
+ * with the public linux-omap@vger.kernel.org mailing list and the
+ * authors above to ensure that the autogeneration scripts are kept
+ * up-to-date with the file contents.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * To-Do List
+ * -> Populate the Sleep/Wakeup dependencies for the domains
+ */
+
+#include <linux/kernel.h>
+#include <linux/io.h>
+
+#include <plat/clockdomain.h>
+
+#include "cm44xx.h"
+#include "prm44xx.h"
+#include "cm-regbits-44xx.h"
+#include "prm-regbits-44xx.h"
+
+static struct clockdomain l4_cefuse_44xx_clkdm = {
+       .name             = "l4_cefuse_clkdm",
+       .pwrdm            = { .name = "cefuse_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_CEFUSE_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l4_cfg_44xx_clkdm = {
+       .name             = "l4_cfg_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_L4CFG_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain tesla_44xx_clkdm = {
+       .name             = "tesla_clkdm",
+       .pwrdm            = { .name = "tesla_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_TESLA_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_gfx_44xx_clkdm = {
+       .name             = "l3_gfx_clkdm",
+       .pwrdm            = { .name = "gfx_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_GFX_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain ivahd_44xx_clkdm = {
+       .name             = "ivahd_clkdm",
+       .pwrdm            = { .name = "ivahd_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_IVAHD_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l4_secure_44xx_clkdm = {
+       .name             = "l4_secure_clkdm",
+       .pwrdm            = { .name = "l4per_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_L4SEC_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l4_per_44xx_clkdm = {
+       .name             = "l4_per_clkdm",
+       .pwrdm            = { .name = "l4per_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_L4PER_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain abe_44xx_clkdm = {
+       .name             = "abe_clkdm",
+       .pwrdm            = { .name = "abe_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM1_ABE_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_instr_44xx_clkdm = {
+       .name             = "l3_instr_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_L3INSTR_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_init_44xx_clkdm = {
+       .name             = "l3_init_clkdm",
+       .pwrdm            = { .name = "l3init_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_L3INIT_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain mpuss_44xx_clkdm = {
+       .name             = "mpuss_clkdm",
+       .pwrdm            = { .name = "mpu_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_MPU_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain mpu0_44xx_clkdm = {
+       .name             = "mpu0_clkdm",
+       .pwrdm            = { .name = "cpu0_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_CPU0_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain mpu1_44xx_clkdm = {
+       .name             = "mpu1_clkdm",
+       .pwrdm            = { .name = "cpu1_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_CPU1_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_emif_44xx_clkdm = {
+       .name             = "l3_emif_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_MEMIF_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l4_ao_44xx_clkdm = {
+       .name             = "l4_ao_clkdm",
+       .pwrdm            = { .name = "always_on_core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_ALWON_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain ducati_44xx_clkdm = {
+       .name             = "ducati_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_DUCATI_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_2_44xx_clkdm = {
+       .name             = "l3_2_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_L3_2_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_1_44xx_clkdm = {
+       .name             = "l3_1_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_L3_1_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_d2d_44xx_clkdm = {
+       .name             = "l3_d2d_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_D2D_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain iss_44xx_clkdm = {
+       .name             = "iss_clkdm",
+       .pwrdm            = { .name = "cam_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_CAM_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_dss_44xx_clkdm = {
+       .name             = "l3_dss_clkdm",
+       .pwrdm            = { .name = "dss_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_DSS_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l4_wkup_44xx_clkdm = {
+       .name             = "l4_wkup_clkdm",
+       .pwrdm            = { .name = "wkup_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_WKUP_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain emu_sys_44xx_clkdm = {
+       .name             = "emu_sys_clkdm",
+       .pwrdm            = { .name = "emu_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_EMU_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain l3_dma_44xx_clkdm = {
+       .name             = "l3_dma_clkdm",
+       .pwrdm            = { .name = "core_pwrdm" },
+       .clkstctrl_reg    = OMAP4430_CM_SDMA_CLKSTCTRL,
+       .clktrctrl_mask   = OMAP4430_CLKTRCTRL_MASK,
+       .flags            = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
+       .omap_chip        = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
+};
+
+static struct clockdomain *clockdomains_omap44xx[] __initdata = {
+       &l4_cefuse_44xx_clkdm,
+       &l4_cfg_44xx_clkdm,
+       &tesla_44xx_clkdm,
+       &l3_gfx_44xx_clkdm,
+       &ivahd_44xx_clkdm,
+       &l4_secure_44xx_clkdm,
+       &l4_per_44xx_clkdm,
+       &abe_44xx_clkdm,
+       &l3_instr_44xx_clkdm,
+       &l3_init_44xx_clkdm,
+       &mpuss_44xx_clkdm,
+       &mpu0_44xx_clkdm,
+       &mpu1_44xx_clkdm,
+       &l3_emif_44xx_clkdm,
+       &l4_ao_44xx_clkdm,
+       &ducati_44xx_clkdm,
+       &l3_2_44xx_clkdm,
+       &l3_1_44xx_clkdm,
+       &l3_d2d_44xx_clkdm,
+       &iss_44xx_clkdm,
+       &l3_dss_44xx_clkdm,
+       &l4_wkup_44xx_clkdm,
+       &emu_sys_44xx_clkdm,
+       &l3_dma_44xx_clkdm,
+       NULL,
+};
+
+void __init omap44xx_clockdomains_init(void)
+{
+       clkdm_init(clockdomains_omap44xx, NULL);
+}
index 40a548b203e35bcde7f2bc4190c6973f4366804d..ba766576e03e0a92ec65b37eb302efd54b66a870 100644 (file)
@@ -42,8 +42,6 @@
 #include <plat/powerdomain.h>
 
 #include <plat/clockdomain.h>
-#include "clockdomains.h"
-
 #include <plat/omap_hwmod.h>
 #include <plat/multi.h>
 
@@ -341,19 +339,19 @@ void __init omap2_init_common_infrastructure(void)
 
        if (cpu_is_omap242x()) {
                omap2xxx_powerdomains_init();
-               clkdm_init(clockdomains_omap, clkdm_autodeps);
+               omap2_clockdomains_init();
                omap2420_hwmod_init();
        } else if (cpu_is_omap243x()) {
                omap2xxx_powerdomains_init();
-               clkdm_init(clockdomains_omap, clkdm_autodeps);
+               omap2_clockdomains_init();
                omap2430_hwmod_init();
        } else if (cpu_is_omap34xx()) {
                omap3xxx_powerdomains_init();
-               clkdm_init(clockdomains_omap, clkdm_autodeps);
+               omap2_clockdomains_init();
                omap3xxx_hwmod_init();
        } else if (cpu_is_omap44xx()) {
                omap44xx_powerdomains_init();
-               clkdm_init(clockdomains_omap, clkdm_autodeps);
+               omap44xx_clockdomains_init();
                omap44xx_hwmod_init();
        } else {
                pr_err("Could not init hwmod data - unknown SoC\n");
index ba0a6c07c0fedfcabe4d1577dcbeb43ece3936a5..a5f8579f7aa9178550b61749e7cc1466861e2b24 100644 (file)
@@ -4,18 +4,22 @@
  * OMAP2/3 clockdomain framework functions
  *
  * Copyright (C) 2008 Texas Instruments, Inc.
- * Copyright (C) 2008-2009 Nokia Corporation
+ * Copyright (C) 2008-2010 Nokia Corporation
  *
- * Written by Paul Walmsley
+ * Paul Walmsley
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
+ *
+ * XXX This should be moved to mach-omap2/ at the earliest opportunity.
  */
 
 #ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H
 #define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H
 
+#include <linux/init.h>
+
 #include <plat/powerdomain.h>
 #include <plat/clock.h>
 #include <plat/cpu.h>
@@ -138,4 +142,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm);
 int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
 int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
 
+extern void __init omap2_clockdomains_init(void);
+extern void __init omap44xx_clockdomains_init(void);
+
 #endif