Skip to contentSkip to conversation

OMAP: PRCM/powerdomain/clockdomain patches for 2.6.38, part one

PATCH New Paul Walmsley 6 participants 29 messages Dec 7, 2010 – Dec 22, 2010

Subsystems (9)
lore
Share & tools
lore

Paul Walmsley

author maintainer
#0 lore raw

cover OMAP: PRCM/powerdomain/clockdomain patches for 2.6.38, part one

This patch series, intended for 2.6.38:

- includes Rajendra's powerdomain changes to add OMAP4 support;

- allocates static powerdomain and clockdomain data in C files rather than header files (long overdue);

- begins the process of cleaning up mach-omap2/prcm.c;

- splits the OMAP4 PRCM header files into per-hwmod or per-PRCM partition files;

- renames the OMAP4 PRCM *_MOD macros to *_INST so the names actually have some meaning in regards to the hardware;

- moves the OMAP2/3-specific PRCM functions into OMAP2/3-specific files, in preparation for creating OMAP4-specific versions;

- moves the CM context save/restore file to CM-specific code, and removes the PRM context save/restore code - which should save a few microseconds in the off-mode save/restore path.

The series applies on top of v2.6.37-rc4. It is available via git from
git://git.pwsan.com/linux-2.6 in the branch 'pwrdm_prcm_a_2.6.38'.

Kevin, I'd appreciate review and acks, if appropriate, on the patches that touch code that you maintain. Rajendra, Santosh, I've made some minor changes to your patches; if you have the chance you might want to take a look and comment if necessary.

Boot-tested on N800, OMAP35xx Beagle, and OMAP4430ES2 Panda.

A followup series that builds on this one will be sent tomorrow.

- Paul

---

pwrdm_prcm_a_2.6.38
text data bss dec hex filename
5707592 473984 5608864 11790440 b3e868 vmlinux.orig
5709988 473952 5608800 11792740 b3f164 vmlinux.patched

Paul Walmsley (8):
OMAP2+: powerdomains: move powerdomain static data to .c files OMAP2+: clockdomains: move clockdomain static data to .c files
OMAP3: control/PRCM: add omap3_ctrl_write_boot_mode()
OMAP3: control/PRCM: move CONTROL_PADCONF_SYS_NIRQ save/restore to SCM code
OMAP4: PRCM: reorganize existing OMAP4 PRCM header files
OMAP4: PRCM: rename _MOD macros to _INST
OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files
OMAP3: PRM/CM: separate CM context save/restore; remove PRM context save/restore

Rajendra Nayak (5):
OMAP: powerdomain: Move static allocations from powerdomains.h to a .c file
OMAP: powerdomain: Infrastructure to put arch specific code
OMAP: powerdomain: Arch specific funcs for state control
OMAP: powerdomain: Arch specific funcs for logic control
OMAP: powerdomain: Arch specific funcs for mem control

Santosh Shilimkar (1):
OMAP4: powerdomain: Add pwrdm_clear_all_prev_pwrst

 arch/arm/mach-omap2/Makefile                     |   44 +
 arch/arm/mach-omap2/clkt2xxx_apll.c              |    2 
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c          |    2 
 arch/arm/mach-omap2/clkt2xxx_osc.c               |    2 
 arch/arm/mach-omap2/clkt2xxx_sys.c               |    2 
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c     |    2 
 arch/arm/mach-omap2/clkt_dpll.c                  |    1 
 arch/arm/mach-omap2/clock.c                      |    4 
 arch/arm/mach-omap2/clock2420_data.c             |    4 
 arch/arm/mach-omap2/clock2430.c                  |    2 
 arch/arm/mach-omap2/clock2430_data.c             |    4 
 arch/arm/mach-omap2/clock34xx.c                  |    2 
 arch/arm/mach-omap2/clock3517.c                  |    2 
 arch/arm/mach-omap2/clock3xxx.c                  |    4 
 arch/arm/mach-omap2/clock3xxx_data.c             |    4 
 arch/arm/mach-omap2/clock44xx_data.c             |   10 
 arch/arm/mach-omap2/clockdomain.c                |    5 
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |   67 --
 arch/arm/mach-omap2/clockdomains44xx_data.c      |   46 +
 arch/arm/mach-omap2/cm-regbits-24xx.h            |    2 
 arch/arm/mach-omap2/cm-regbits-34xx.h            |    2 
 arch/arm/mach-omap2/cm-regbits-44xx.h            |    3 
 arch/arm/mach-omap2/cm.c                         |   68 --
 arch/arm/mach-omap2/cm.h                         |  137 ----
 arch/arm/mach-omap2/cm1_44xx.h                   |  251 +++++++
 arch/arm/mach-omap2/cm2_44xx.h                   |  648 +++++++------------
 arch/arm/mach-omap2/cm2xxx_3xxx.c                |  393 ++++++++++++
 arch/arm/mach-omap2/cm2xxx_3xxx.h                |   70 +-
 arch/arm/mach-omap2/cm44xx.h                     |  668 --------------------
 arch/arm/mach-omap2/cm4xxx.c                     |    2 
 arch/arm/mach-omap2/control.c                    |   40 +
 arch/arm/mach-omap2/control.h                    |    1 
 arch/arm/mach-omap2/dpll3xxx.c                   |    4 
 arch/arm/mach-omap2/dsp.c                        |    9 
 arch/arm/mach-omap2/io.c                         |   22 -
 arch/arm/mach-omap2/omap_hwmod.c                 |    6 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c       |    4 
 arch/arm/mach-omap2/pm-debug.c                   |    4 
 arch/arm/mach-omap2/pm24xx.c                     |    4 
 arch/arm/mach-omap2/pm34xx.c                     |    8 
 arch/arm/mach-omap2/powerdomain-common.c         |  111 +++
 arch/arm/mach-omap2/powerdomain.c                |  400 +++---------
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c       |  232 +++++++
 arch/arm/mach-omap2/powerdomain44xx.c            |  177 +++++
 arch/arm/mach-omap2/powerdomains.h               |  151 ----
 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c |   81 ++
 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h |   22 +
 arch/arm/mach-omap2/powerdomains2xxx_data.c      |   47 +
 arch/arm/mach-omap2/powerdomains3xxx_data.c      |   47 +
 arch/arm/mach-omap2/powerdomains44xx_data.c      |   70 +-
 arch/arm/mach-omap2/prcm-common.h                |   85 ---
 arch/arm/mach-omap2/prcm.c                       |  481 --------------
 arch/arm/mach-omap2/prcm_mpu44xx.h               |   91 +++
 arch/arm/mach-omap2/prm-regbits-24xx.h           |    2 
 arch/arm/mach-omap2/prm-regbits-34xx.h           |    8 
 arch/arm/mach-omap2/prm-regbits-44xx.h           |    2 
 arch/arm/mach-omap2/prm.h                        |  369 -----------
 arch/arm/mach-omap2/prm2xxx_3xxx.c               |   52 +-
 arch/arm/mach-omap2/prm2xxx_3xxx.h               |  116 +--
 arch/arm/mach-omap2/prm44xx.c                    |    2 
 arch/arm/mach-omap2/prm44xx.h                    |  743 +++++++++++-----------
 arch/arm/mach-omap2/scrm44xx.h                   |   32 +
 arch/arm/mach-omap2/sdrc.c                       |    2 
 arch/arm/mach-omap2/sdrc2xxx.c                   |    2 
 arch/arm/mach-omap2/serial.c                     |    4 
 arch/arm/mach-omap2/sleep34xx.S                  |    4 
 arch/arm/mach-omap2/sram242x.S                   |    4 
 arch/arm/mach-omap2/sram243x.S                   |    4 
 arch/arm/mach-omap2/sram34xx.S                   |    2 
 arch/arm/plat-omap/include/plat/clockdomain.h    |   11 
 arch/arm/plat-omap/include/plat/common.h         |    2 
 arch/arm/plat-omap/include/plat/powerdomain.h    |   57 ++
 arch/arm/plat-omap/include/plat/prcm.h           |   10 
 arch/arm/plat-omap/mcbsp.c                       |    2 
 arch/arm/plat-omap/sram.c                        |    5 
 75 files changed, 2663 insertions(+), 3322 deletions(-)
 rename arch/arm/mach-omap2/{clockdomains.h => clockdomains2xxx_3xxx_data.c} (95%)
 rename arch/arm/mach-omap2/{clockdomains44xx.h => clockdomains44xx_data.c} (90%)
 delete mode 100644 arch/arm/mach-omap2/cm.c
 create mode 100644 arch/arm/mach-omap2/cm1_44xx.h
 copy arch/arm/mach-omap2/{cm44xx.h => cm2_44xx.h} (53%)
 create mode 100644 arch/arm/mach-omap2/cm2xxx_3xxx.c
 copy arch/arm/mach-omap2/{cm.h => cm2xxx_3xxx.h} (68%)
 create mode 100644 arch/arm/mach-omap2/powerdomain-common.c
 create mode 100644 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
 create mode 100644 arch/arm/mach-omap2/powerdomain44xx.c
 create mode 100644 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
 create mode 100644 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h
 rename arch/arm/mach-omap2/{powerdomains24xx.h => powerdomains2xxx_data.c} (76%)
 rename arch/arm/mach-omap2/{powerdomains34xx.h => powerdomains3xxx_data.c} (89%)
 rename arch/arm/mach-omap2/{powerdomains44xx.h => powerdomains44xx_data.c} (85%)
 create mode 100644 arch/arm/mach-omap2/prcm_mpu44xx.h
 copy arch/arm/mach-omap2/{prm.h => prm2xxx_3xxx.h} (82%)
 create mode 100644 arch/arm/mach-omap2/scrm44xx.h
author maintainer
#1 lore raw

PATCH 1/14 OMAP: powerdomain: Move static allocations from powerdomains.h to a .c file

From: Rajendra Nayak <[email protected]>

powerdomains.h header today has only static definitions. Adding any function declarations into it and including it in multiple source file is expected to cause issues. Hence move all the static definitions from powerdomains.h file into powerdomains_data.c file.

Also, create a new powerdomain section of the mach-omap2/Makefile, and rearrange the prcm-common part of the Makefile, now that the powerdomain code is in its own Makefile section.

[paul at pwsan.com: rearrange Makefile changes, tweaked commit message]
---
 arch/arm/mach-omap2/Makefile                  |   17 ++++++++++-------
 arch/arm/mach-omap2/clockdomains.h            |    5 +++++
 arch/arm/mach-omap2/io.c                      |    3 +--
 arch/arm/mach-omap2/powerdomains_data.c       |   10 +++++-----
 arch/arm/plat-omap/include/plat/powerdomain.h |    1 +
 5 files changed, 22 insertions(+), 14 deletions(-)
 rename arch/arm/mach-omap2/{powerdomains.h => powerdomains_data.c} (97%)
arch/arm/mach-omap2/Makefile +10 -7
index 60e51bc..ddc0a6f 100644
@@ -9,14 +9,13 @@ obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
 omap-2-3-common				= irq.o sdrc.o prm2xxx_3xxx.o
 hwmod-common				= omap_hwmod.o \
 					  omap_hwmod_common_data.o
-prcm-common				= prcm.o powerdomain.o
 clock-common				= clock.o clock_common_data.o \
 					  clockdomain.o clkt_dpll.o \
 					  clkt_clksel.o
 
-obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
-obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
-obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) prm44xx.o $(hwmod-common)
+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
+obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common)
+obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 
@@ -65,9 +64,13 @@ endif
 endif
 
 # PRCM
-obj-$(CONFIG_ARCH_OMAP2)		+= cm.o
-obj-$(CONFIG_ARCH_OMAP3)		+= cm.o
-obj-$(CONFIG_ARCH_OMAP4)		+= cm4xxx.o
+obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm.o
+obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm.o
+obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm4xxx.o
+
+# OMAP powerdomain framework
+powerdomain-common			+= powerdomain.o powerdomains_data.o
+obj-y					+= $(powerdomain-common)
 
 # Clock framework
 obj-$(CONFIG_ARCH_OMAP2)		+= $(clock-common) clock2xxx.o \
arch/arm/mach-omap2/clockdomains.h +5 -0
index 8fc19ff..2a3b10a 100644
@@ -38,6 +38,11 @@
 #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
arch/arm/mach-omap2/io.c +1 -2
index 40562dd..b5b385d 100644
@@ -40,7 +40,6 @@
 
 #include <plat/omap-pm.h>
 #include <plat/powerdomain.h>
-#include "powerdomains.h"
 
 #include <plat/clockdomain.h>
 #include "clockdomains.h"
@@ -316,7 +315,7 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 {
 	u8 skip_setup_idle = 0;
 
-	pwrdm_init(powerdomains_omap);
+	pwrdm_fw_init();
 	clkdm_init(clockdomains_omap, clkdm_autodeps);
 	if (cpu_is_omap242x())
 		omap2420_hwmod_init();
arch/arm/mach-omap2/powerdomains_data.c renamed from arch/arm/mach-omap2/powerdomains.h +5 -5
similarity index 97%
rename from arch/arm/mach-omap2/powerdomains.h
rename to arch/arm/mach-omap2/powerdomains_data.c
index 105cbca..475763e 100644
@@ -18,9 +18,6 @@
  *    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.
@@ -49,6 +46,7 @@
  * address offset is different between the C55 and C64 DSPs.
  */
 
+#include <linux/init.h>
 #include <plat/powerdomain.h>
 
 #include "prcm-common.h"
@@ -149,5 +147,7 @@ static struct powerdomain *powerdomains_omap[] __initdata = {
 	NULL
 };
 
-
-#endif
+void pwrdm_fw_init(void)
+{
+	pwrdm_init(powerdomains_omap);
+}
arch/arm/plat-omap/include/plat/powerdomain.h +1 -0
index 9ca420d..e322b39 100644
@@ -118,6 +118,7 @@ struct powerdomain {
 };
 
 
+void pwrdm_fw_init(void);
 void pwrdm_init(struct powerdomain **pwrdm_list);
 
 struct powerdomain *pwrdm_lookup(const char *name);
author maintainer
#2 lore raw

PATCH 2/14 OMAP: powerdomain: Infrastructure to put arch specific code

In reply to Paul Walmsley

From: Rajendra Nayak <[email protected]>

Put infrastructure in place, so arch specific func pointers can be hooked up to the platform-independent part of the framework.
This is in preparation of splitting the powerdomain framework into platform-independent part (for all omaps) and platform-specific parts.

---
 arch/arm/mach-omap2/powerdomain.c             |   11 +++++-
 arch/arm/mach-omap2/powerdomains_data.c       |    2 +
 arch/arm/plat-omap/include/plat/powerdomain.h |   43 ++++++++++++++++++++++++-
 3 files changed, 52 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/powerdomain.c +9 -2
index 6527ec3..3aa3eb3 100644
@@ -80,6 +80,8 @@ static u16 pwrstst_reg_offs;
 /* pwrdm_list contains all registered struct powerdomains */
 static LIST_HEAD(pwrdm_list);
 
+static struct pwrdm_ops *arch_pwrdm;
+
 /* Private functions */
 
 static struct powerdomain *_pwrdm_lookup(const char *name)
@@ -211,6 +213,7 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
 /**
  * pwrdm_init - set up the powerdomain layer
  * @pwrdm_list: array of struct powerdomain pointers to register
+ * @custom_funcs: func pointers for arch specfic implementations
  *
  * Loop through the array of powerdomains @pwrdm_list, registering all
  * that are available on the current CPU. If pwrdm_list is supplied
@@ -218,7 +221,7 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
  * registered.  No return value.  XXX pwrdm_list is not really a
  * "list"; it is an array.  Rename appropriately.
  */
-void pwrdm_init(struct powerdomain **pwrdm_list)
+void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs)
 {
 	struct powerdomain **p = NULL;
 
@@ -234,6 +237,11 @@ void pwrdm_init(struct powerdomain **pwrdm_list)
 		return;
 	}
 
+	if (!custom_funcs)
+		WARN(1, "powerdomain: No custom pwrdm functions registered\n");
+	else
+		arch_pwrdm = custom_funcs;
+
 	if (pwrdm_list) {
 		for (p = pwrdm_list; *p; p++)
 			_pwrdm_register(*p);
@@ -1074,4 +1082,3 @@ int pwrdm_post_transition(void)
 	pwrdm_for_each(_pwrdm_post_transition_cb, NULL);
 	return 0;
 }
-
arch/arm/mach-omap2/powerdomains_data.c +1 -1
index 475763e..bf5b39b 100644
@@ -149,5 +149,5 @@ static struct powerdomain *powerdomains_omap[] __initdata = {
 
 void pwrdm_fw_init(void)
 {
-	pwrdm_init(powerdomains_omap);
+	pwrdm_init(powerdomains_omap, NULL);
 }
arch/arm/plat-omap/include/plat/powerdomain.h +42 -1

51 lines not on this page · raw message

author maintainer
#3 lore raw

PATCH 3/14 OMAP: powerdomain: Arch specific funcs for state control

In reply to Paul Walmsley

From: Rajendra Nayak <[email protected]>

Define the following architecture specific funtions for omap2/3/4 .pwrdm_set_next_pwrst
.pwrdm_read_next_pwrst
.pwrdm_read_pwrst
.pwrdm_read_prev_pwrst

Convert the platform-independent framework to call these functions.

[paul at pwsan.com: remove remaining static allocations in powerdomains.h file;
remove path in file header comments, rearranged Makefile changes]

Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-omap2/Makefile               |    7 +++
 arch/arm/mach-omap2/powerdomain.c          |   33 ++++++++++-----
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c |   62 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/powerdomain44xx.c      |   55 +++++++++++++++++++++++++
 arch/arm/mach-omap2/powerdomains.h         |   22 ++++++++++
 arch/arm/mach-omap2/powerdomains_data.c    |    8 +++-
 6 files changed, 175 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
 create mode 100644 arch/arm/mach-omap2/powerdomain44xx.c
 create mode 100644 arch/arm/mach-omap2/powerdomains.h
arch/arm/mach-omap2/Makefile +6 -1
index ddc0a6f..f8dcaf8 100644
@@ -70,7 +70,12 @@ obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm4xxx.o
 
 # OMAP powerdomain framework
 powerdomain-common			+= powerdomain.o powerdomains_data.o
-obj-y					+= $(powerdomain-common)
+obj-$(CONFIG_ARCH_OMAP2)		+= $(powerdomain-common) \
+					   powerdomain2xxx_3xxx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= $(powerdomain-common) \
+					   powerdomain2xxx_3xxx.o
+obj-$(CONFIG_ARCH_OMAP4)		+= $(powerdomain-common) \
+					   powerdomain44xx.o
 
 # Clock framework
 obj-$(CONFIG_ARCH_OMAP2)		+= $(clock-common) clock2xxx.o \
arch/arm/mach-omap2/powerdomain.c +23 -10
index 3aa3eb3..0ae1ebf 100644
@@ -439,6 +439,8 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm)
  */
 int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 {
+	int ret = -EINVAL;
+
 	if (!pwrdm)
 		return -EINVAL;
 
@@ -448,11 +450,10 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
 		 pwrdm->name, pwrst);
 
-	prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
-			     (pwrst << OMAP_POWERSTATE_SHIFT),
-			     pwrdm->prcm_offs, pwrstctrl_reg_offs);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
+		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
 
-	return 0;
+	return ret;
 }
 
 /**
@@ -465,11 +466,15 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
  */
 int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
 {
+	int ret = -EINVAL;
+
 	if (!pwrdm)
 		return -EINVAL;
 
-	return prm_read_mod_bits_shift(pwrdm->prcm_offs,
-				 pwrstctrl_reg_offs, OMAP_POWERSTATE_MASK);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_read_next_pwrst)
+		ret = arch_pwrdm->pwrdm_read_next_pwrst(pwrdm);
+
+	return ret;
 }
 
 /**
@@ -482,11 +487,15 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
  */
 int pwrdm_read_pwrst(struct powerdomain *pwrdm)
 {
+	int ret = -EINVAL;
+
 	if (!pwrdm)
 		return -EINVAL;
 
-	return prm_read_mod_bits_shift(pwrdm->prcm_offs,
-				 pwrstst_reg_offs, OMAP_POWERSTATEST_MASK);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst)
+		ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm);
+
+	return ret;
 }
 
 /**
@@ -499,11 +508,15 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
  */
 int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
 {
+	int ret = -EINVAL;
+
 	if (!pwrdm)
 		return -EINVAL;
 
-	return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
-					OMAP3430_LASTPOWERSTATEENTERED_MASK);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_pwrst)
+		ret = arch_pwrdm->pwrdm_read_prev_pwrst(pwrdm);
+
+	return ret;
 }
 
 /**
arch/arm/mach-omap2/powerdomain2xxx_3xxx.c new file +62 -0

62 lines not on this page · raw message

arch/arm/mach-omap2/powerdomain44xx.c new file +55 -0

55 lines not on this page · raw message

arch/arm/mach-omap2/powerdomains.h new file +22 -0
new file mode 100644
index 0000000..e57bc41
@@ -0,0 +1,22 @@
+/*
+ * OMAP2+ powerdomain prototypes
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ *
+ * Rajendra Nayak <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS
+#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS
+
+#include <plat/powerdomain.h>
+
+extern struct pwrdm_ops omap2_pwrdm_operations;
+extern struct pwrdm_ops omap3_pwrdm_operations;
+extern struct pwrdm_ops omap4_pwrdm_operations;
+
+#endif /* ARCH_ARM_MACH_OMAP2_POWERDOMAINS */
arch/arm/mach-omap2/powerdomains_data.c +7 -1
index bf5b39b..29690c6 100644
@@ -55,6 +55,7 @@
 #include "powerdomains24xx.h"
 #include "powerdomains34xx.h"
 #include "powerdomains44xx.h"
+#include "powerdomains.h"
 
 /* OMAP2/3-common powerdomains */
 
@@ -149,5 +150,10 @@ static struct powerdomain *powerdomains_omap[] __initdata = {
 
 void pwrdm_fw_init(void)
 {
-	pwrdm_init(powerdomains_omap, NULL);
+	if (cpu_is_omap24xx())
+		pwrdm_init(powerdomains_omap, &omap2_pwrdm_operations);
+	else if (cpu_is_omap34xx())
+		pwrdm_init(powerdomains_omap, &omap3_pwrdm_operations);
+	else if (cpu_is_omap44xx())
+		pwrdm_init(powerdomains_omap, &omap4_pwrdm_operations);
 }
author maintainer
#4 lore raw

PATCH 4/14 OMAP: powerdomain: Arch specific funcs for logic control

In reply to Paul Walmsley

From: Rajendra Nayak <[email protected]>

Define the following architecture specific funtions for omap2/3/4 .pwrdm_set_logic_retst
.pwrdm_read_logic_pwrst
.pwrdm_read_prev_logic_pwrst
.pwrdm_read_logic_retst

Convert the platform-independent framework to call these functions.

---
 arch/arm/mach-omap2/powerdomain.c          |   51 ++++++++++++----------------
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c |   34 +++++++++++++++++++
 arch/arm/mach-omap2/powerdomain44xx.c      |   26 ++++++++++++++
 3 files changed, 82 insertions(+), 29 deletions(-)
arch/arm/mach-omap2/powerdomain.c +22 -29
index 0ae1ebf..562a3fe 100644
@@ -532,7 +532,7 @@ int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
  */
 int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
 {
-	u32 v;
+	int ret = -EINVAL;
 
 	if (!pwrdm)
 		return -EINVAL;
@@ -543,17 +543,10 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
 	pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n",
 		 pwrdm->name, pwrst);
 
-	/*
-	 * The register bit names below may not correspond to the
-	 * actual names of the bits in each powerdomain's register,
-	 * but the type of value returned is the same for each
-	 * powerdomain.
-	 */
-	v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
-	prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
-			     pwrdm->prcm_offs, pwrstctrl_reg_offs);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst)
+		ret = arch_pwrdm->pwrdm_set_logic_retst(pwrdm, pwrst);
 
-	return 0;
+	return ret;
 }
 
 /**
@@ -696,11 +689,15 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
  */
 int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
 {
+	int ret = -EINVAL;
+
 	if (!pwrdm)
 		return -EINVAL;
 
-	return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstst_reg_offs,
-				       OMAP3430_LOGICSTATEST_MASK);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_pwrst)
+		ret = arch_pwrdm->pwrdm_read_logic_pwrst(pwrdm);
+
+	return ret;
 }
 
 /**
@@ -713,17 +710,15 @@ int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
  */
 int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
 {
+	int ret = -EINVAL;
+
 	if (!pwrdm)
 		return -EINVAL;
 
-	/*
-	 * The register bit names below may not correspond to the
-	 * actual names of the bits in each powerdomain's register,
-	 * but the type of value returned is the same for each
-	 * powerdomain.
-	 */
-	return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
-					OMAP3430_LASTLOGICSTATEENTERED_MASK);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_logic_pwrst)
+		ret = arch_pwrdm->pwrdm_read_prev_logic_pwrst(pwrdm);
+
+	return ret;
 }
 
 /**
@@ -736,17 +731,15 @@ int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
  */
 int pwrdm_read_logic_retst(struct powerdomain *pwrdm)
 {
+	int ret = -EINVAL;
+
 	if (!pwrdm)
 		return -EINVAL;
 
-	/*
-	 * The register bit names below may not correspond to the
-	 * actual names of the bits in each powerdomain's register,
-	 * but the type of value returned is the same for each
-	 * powerdomain.
-	 */
-	return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstctrl_reg_offs,
-				       OMAP3430_LOGICSTATEST_MASK);
+	if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_retst)
+		ret = arch_pwrdm->pwrdm_read_logic_retst(pwrdm);
+
+	return ret;
 }
 
 /**
arch/arm/mach-omap2/powerdomain2xxx_3xxx.c +34 -0
index a25dd64..b7ea191 100644
@@ -41,6 +41,17 @@ static int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
 				OMAP2_PM_PWSTST, OMAP_POWERSTATEST_MASK);
 }
 
+static int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
+{
+	u32 v;
+
+	v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
+	prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
+				pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
+
+	return 0;
+}
+
 /* Applicable only for OMAP3. Not supported on OMAP2 */
 static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
 {
@@ -48,10 +59,29 @@ static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
 				OMAP3430_LASTPOWERSTATEENTERED_MASK);
 }
 
+static int omap3_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
+{
+	return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
+				OMAP3430_LOGICSTATEST_MASK);
+}
+
+static int omap3_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
+{
+	return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL,
+				OMAP3430_LOGICSTATEST_MASK);
+}
+
+static int omap3_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
+{
+	return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
+				OMAP3430_LASTLOGICSTATEENTERED_MASK);
+}
+
 struct pwrdm_ops omap2_pwrdm_operations = {
 	.pwrdm_set_next_pwrst	= omap2_pwrdm_set_next_pwrst,
 	.pwrdm_read_next_pwrst	= omap2_pwrdm_read_next_pwrst,
 	.pwrdm_read_pwrst	= omap2_pwrdm_read_pwrst,
+	.pwrdm_set_logic_retst	= omap2_pwrdm_set_logic_retst,
 };
 
 struct pwrdm_ops omap3_pwrdm_operations = {
@@ -59,4 +89,8 @@ struct pwrdm_ops omap3_pwrdm_operations = {
 	.pwrdm_read_next_pwrst	= omap2_pwrdm_read_next_pwrst,
 	.pwrdm_read_pwrst	= omap2_pwrdm_read_pwrst,
 	.pwrdm_read_prev_pwrst	= omap3_pwrdm_read_prev_pwrst,
+	.pwrdm_set_logic_retst	= omap2_pwrdm_set_logic_retst,
+	.pwrdm_read_logic_pwrst	= omap3_pwrdm_read_logic_pwrst,
+	.pwrdm_read_logic_retst	= omap3_pwrdm_read_logic_retst,
+	.pwrdm_read_prev_logic_pwrst	= omap3_pwrdm_read_prev_logic_pwrst,
 };
arch/arm/mach-omap2/powerdomain44xx.c +26 -0
index 5dc337c..996790a 100644
@@ -47,9 +47,35 @@ static int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
 				OMAP4430_LASTPOWERSTATEENTERED_MASK);
 }
 
+static int omap4_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
+{
+	u32 v;
+
+	v = pwrst << __ffs(OMAP4430_LOGICRETSTATE_MASK);
+	prm_rmw_mod_reg_bits(OMAP4430_LOGICRETSTATE_MASK, v,
+				pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
+
+	return 0;
+}
+
+static int omap4_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
+{
+	return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP4_PM_PWSTST,
+				OMAP4430_LOGICSTATEST_MASK);
+}
+
+static int omap4_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
+{
+	return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL,
+				OMAP4430_LOGICRETSTATE_MASK);
+}
+
 struct pwrdm_ops omap4_pwrdm_operations = {
 	.pwrdm_set_next_pwrst	= omap4_pwrdm_set_next_pwrst,
 	.pwrdm_read_next_pwrst	= omap4_pwrdm_read_next_pwrst,
 	.pwrdm_read_pwrst	= omap4_pwrdm_read_pwrst,
 	.pwrdm_read_prev_pwrst	= omap4_pwrdm_read_prev_pwrst,
+	.pwrdm_set_logic_retst	= omap4_pwrdm_set_logic_retst,
+	.pwrdm_read_logic_pwrst	= omap4_pwrdm_read_logic_pwrst,
+	.pwrdm_read_logic_retst	= omap4_pwrdm_read_logic_retst,
 };
author maintainer
#5 lore raw

PATCH 5/14 OMAP: powerdomain: Arch specific funcs for mem control

In reply to Paul Walmsley

From: Rajendra Nayak <[email protected]>

Define the following architecture specific funtions for omap2/3/4 .pwrdm_set_mem_onst
.pwrdm_set_mem_retst
.pwrdm_read_mem_pwrst
.pwrdm_read_prev_mem_pwrst
.pwrdm_read_mem_retst
.pwrdm_clear_all_prev_pwrst
.pwrdm_enable_hdwr_sar
.pwrdm_disable_hdwr_sar
.pwrdm_wait_transition
.pwrdm_set_lowpwrstchange

Convert the platform-independent framework to call these functions.

[paul at pwsan.com: rearranged Makefile changes]
Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-omap2/Makefile               |    2 
 arch/arm/mach-omap2/powerdomain-common.c   |  111 ++++++++++
 arch/arm/mach-omap2/powerdomain.c          |  303 +++++-----------------------
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c |  131 ++++++++++++
 arch/arm/mach-omap2/powerdomain44xx.c      |   85 ++++++++
 arch/arm/mach-omap2/powerdomains.h         |    5 
 6 files changed, 389 insertions(+), 248 deletions(-)
 create mode 100644 arch/arm/mach-omap2/powerdomain-common.c
arch/arm/mach-omap2/Makefile +1 -1
index f8dcaf8..b5c4fe8 100644
@@ -69,7 +69,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm.o
 obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm4xxx.o
 
 # OMAP powerdomain framework
-powerdomain-common			+= powerdomain.o powerdomains_data.o
+powerdomain-common			+= powerdomain.o powerdomains_data.o powerdomain-common.o
 obj-$(CONFIG_ARCH_OMAP2)		+= $(powerdomain-common) \
 					   powerdomain2xxx_3xxx.o
 obj-$(CONFIG_ARCH_OMAP3)		+= $(powerdomain-common) \
arch/arm/mach-omap2/powerdomain-common.c new file +111 -0

111 lines not on this page · raw message

arch/arm/mach-omap2/powerdomain.c +56 -247

458 lines not on this page · raw message

arch/arm/mach-omap2/powerdomain2xxx_3xxx.c +131 -0

158 lines not on this page · raw message

arch/arm/mach-omap2/powerdomain44xx.c +85 -0

109 lines not on this page · raw message

arch/arm/mach-omap2/powerdomains.h +5 -0
index e57bc41..55cd8e6 100644
@@ -19,4 +19,9 @@ extern struct pwrdm_ops omap2_pwrdm_operations;
 extern struct pwrdm_ops omap3_pwrdm_operations;
 extern struct pwrdm_ops omap4_pwrdm_operations;
 
+/* Common Internal functions used across OMAP rev's */
+extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank);
+extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank);
+extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank);
+
 #endif /* ARCH_ARM_MACH_OMAP2_POWERDOMAINS */
author maintainer
#6 lore raw

PATCH 6/14 OMAP4: powerdomain: Add pwrdm_clear_all_prev_pwrst

In reply to Paul Walmsley

From: Santosh Shilimkar <[email protected]>

Like OMAP3, OMAP4430 ES2 has additional bitfields in PWRSTST register which help identify the previous power state entered by the powerdomain. Add pwrdm_clear_all_prev_pwrst to the OMAP4 powerdomains implementation to support this.

[paul at pwsan.com: clarified commit message]
Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-omap2/powerdomain44xx.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/powerdomain44xx.c +9 -0
index 123a25f..2903c7c 100644
@@ -55,6 +55,14 @@ static int omap4_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
 	return 0;
 }
 
+static int omap4_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
+{
+	prm_rmw_mod_reg_bits(OMAP4430_LASTPOWERSTATEENTERED_MASK,
+				OMAP4430_LASTPOWERSTATEENTERED_MASK,
+				pwrdm->prcm_offs, OMAP4_PM_PWSTST);
+	return 0;
+}
+
 static int omap4_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
 {
 	u32 v;
@@ -155,6 +163,7 @@ struct pwrdm_ops omap4_pwrdm_operations = {
 	.pwrdm_read_pwrst	= omap4_pwrdm_read_pwrst,
 	.pwrdm_read_prev_pwrst	= omap4_pwrdm_read_prev_pwrst,
 	.pwrdm_set_lowpwrstchange	= omap4_pwrdm_set_lowpwrstchange,
+	.pwrdm_clear_all_prev_pwrst	= omap4_pwrdm_clear_all_prev_pwrst,
 	.pwrdm_set_logic_retst	= omap4_pwrdm_set_logic_retst,
 	.pwrdm_read_logic_pwrst	= omap4_pwrdm_read_logic_pwrst,
 	.pwrdm_read_logic_retst	= omap4_pwrdm_read_logic_retst,
author maintainer
#7 lore raw

PATCH 7/14 OMAP2+: powerdomains: move powerdomain static data to .c files

In reply to Paul Walmsley

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 powerdomain data.

Cc Rajendra Nayak <[email protected]>
Cc Santosh Shilimkar <[email protected]>
---
 arch/arm/mach-omap2/Makefile                     |   13 +-
 arch/arm/mach-omap2/io.c                         |   19 ++-
 arch/arm/mach-omap2/powerdomain2xxx_3xxx.c       |    7 +
 arch/arm/mach-omap2/powerdomain44xx.c            |    1 
 arch/arm/mach-omap2/powerdomains.h               |    9 +
 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c |   81 +++++++++++
 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h |   22 +++
 arch/arm/mach-omap2/powerdomains2xxx_data.c      |   43 ++++--
 arch/arm/mach-omap2/powerdomains3xxx_data.c      |   43 ++++--
 arch/arm/mach-omap2/powerdomains44xx_data.c      |   33 ++++-
 arch/arm/mach-omap2/powerdomains_data.c          |  159 ----------------------
 arch/arm/plat-omap/include/plat/powerdomain.h    |   13 +-
 12 files changed, 234 insertions(+), 209 deletions(-)
 create mode 100644 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
 create mode 100644 arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h
 rename arch/arm/mach-omap2/{powerdomains24xx.h => powerdomains2xxx_data.c} (78%)
 rename arch/arm/mach-omap2/{powerdomains34xx.h => powerdomains3xxx_data.c} (89%)
 rename arch/arm/mach-omap2/{powerdomains44xx.h => powerdomains44xx_data.c} (93%)
 delete mode 100644 arch/arm/mach-omap2/powerdomains_data.c
arch/arm/mach-omap2/Makefile +9 -4
index b5c4fe8..609fa78 100644
@@ -69,13 +69,18 @@ obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm.o
 obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm4xxx.o
 
 # OMAP powerdomain framework
-powerdomain-common			+= powerdomain.o powerdomains_data.o powerdomain-common.o
+powerdomain-common			+= powerdomain.o powerdomain-common.o
 obj-$(CONFIG_ARCH_OMAP2)		+= $(powerdomain-common) \
-					   powerdomain2xxx_3xxx.o
+					   powerdomain2xxx_3xxx.o \
+					   powerdomains2xxx_data.o \
+					   powerdomains2xxx_3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP3)		+= $(powerdomain-common) \
-					   powerdomain2xxx_3xxx.o
+					   powerdomain2xxx_3xxx.o \
+					   powerdomains3xxx_data.o \
+					   powerdomains2xxx_3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(powerdomain-common) \
-					   powerdomain44xx.o
+					   powerdomain44xx.o \
+					   powerdomains44xx_data.o
 
 # Clock framework
 obj-$(CONFIG_ARCH_OMAP2)		+= $(clock-common) clock2xxx.o \
arch/arm/mach-omap2/io.c +13 -6
index b5b385d..6336044 100644
@@ -315,16 +315,23 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 {
 	u8 skip_setup_idle = 0;
 
-	pwrdm_fw_init();
-	clkdm_init(clockdomains_omap, clkdm_autodeps);
-	if (cpu_is_omap242x())
+	if (cpu_is_omap242x()) {
+		omap2xxx_powerdomains_init();
+		clkdm_init(clockdomains_omap, clkdm_autodeps);
 		omap2420_hwmod_init();
-	else if (cpu_is_omap243x())
+	} else if (cpu_is_omap243x()) {
+		omap2xxx_powerdomains_init();
+		clkdm_init(clockdomains_omap, clkdm_autodeps);
 		omap2430_hwmod_init();
-	else if (cpu_is_omap34xx())
+	} else if (cpu_is_omap34xx()) {
+		omap3xxx_powerdomains_init();
+		clkdm_init(clockdomains_omap, clkdm_autodeps);
 		omap3xxx_hwmod_init();
-	else if (cpu_is_omap44xx())
+	} else if (cpu_is_omap44xx()) {
+		omap44xx_powerdomains_init();
+		clkdm_init(clockdomains_omap, clkdm_autodeps);
 		omap44xx_hwmod_init();
+	}
 
 	/* The OPP tables have to be registered before a clk init */
 	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
arch/arm/mach-omap2/powerdomain2xxx_3xxx.c +6 -1
index 6cdf678..838ac75 100644
@@ -15,10 +15,15 @@
 #include <linux/io.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
+
 #include <plat/prcm.h>
-#include "prm.h"
+
 #include "prm-regbits-34xx.h"
 #include "powerdomains.h"
+#include "prm.h"
+#include "prm-regbits-24xx.h"
+#include "prm-regbits-34xx.h"
+
 
 /* Common functions across OMAP2 and OMAP3 */
 static int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
arch/arm/mach-omap2/powerdomain44xx.c +1 -0
index 2903c7c..366e869 100644
@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
+
 #include <plat/powerdomain.h>
 #include <plat/prcm.h>
 #include "prm.h"
arch/arm/mach-omap2/powerdomains.h +6 -3
index 55cd8e6..f83adaf 100644
@@ -10,8 +10,8 @@
  * published by the Free Software Foundation.
  */
 
-#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS
-#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS
+#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS_H
+#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS_H
 
 #include <plat/powerdomain.h>
 
@@ -24,4 +24,7 @@ extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank);
 extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank);
 extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank);
 
-#endif /* ARCH_ARM_MACH_OMAP2_POWERDOMAINS */
+extern struct powerdomain wkup_omap2_pwrdm;
+extern struct powerdomain gfx_omap2_pwrdm;
+
+#endif
arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c new file +81 -0

81 lines not on this page · raw message

arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h new file +22 -0
new file mode 100644
index 0000000..45d684a
@@ -0,0 +1,22 @@
+/*
+ * OMAP2/3 common powerdomains - prototypes
+ *
+ * Copyright (C) 2008 Texas Instruments, Inc.
+ * Copyright (C) 2008-2010 Nokia Corporation
+ *
+ * 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.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAINS2XXX_3XXX_DATA_H
+#define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS2XXX_3XXX_DATA_H
+
+#include <plat/powerdomain.h>
+
+extern struct powerdomain gfx_omap2_pwrdm;
+extern struct powerdomain wkup_omap2_pwrdm;
+
+#endif
arch/arm/mach-omap2/powerdomains2xxx_data.c renamed from arch/arm/mach-omap2/powerdomains24xx.h +27 -16

75 lines not on this page · raw message

arch/arm/mach-omap2/powerdomains3xxx_data.c renamed from arch/arm/mach-omap2/powerdomains34xx.h +32 -11

63 lines not on this page · raw message

arch/arm/mach-omap2/powerdomains44xx_data.c renamed from arch/arm/mach-omap2/powerdomains44xx.h +27 -6
similarity index 93%
rename from arch/arm/mach-omap2/powerdomains44xx.h
rename to arch/arm/mach-omap2/powerdomains44xx_data.c
index 9c01b55..2512f69 100644
@@ -19,10 +19,11 @@
  * published by the Free Software Foundation.
  */
 
-#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H
-#define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H
+#include <linux/kernel.h>
+#include <linux/init.h>
 
 #include <plat/powerdomain.h>
+#include "powerdomains.h"
 
 #include "prcm-common.h"
 #include "cm.h"
@@ -30,8 +31,6 @@
 #include "prm.h"
 #include "prm-regbits-44xx.h"
 
-#if defined(CONFIG_ARCH_OMAP4)
-
 /* core_44xx_pwrdm: CORE power domain */
 static struct powerdomain core_44xx_pwrdm = {
 	.name		  = "core_pwrdm",
@@ -314,6 +313,28 @@ static struct powerdomain cefuse_44xx_pwrdm = {
  * stdefuse
  */
 
-#endif
+/* As powerdomains are added or removed above, this list must also be changed */
+static struct powerdomain *powerdomains_omap44xx[] __initdata = {
+	&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,
+	NULL
+};
 
-#endif
+void __init omap44xx_powerdomains_init(void)
+{
+	pwrdm_init(powerdomains_omap44xx, &omap4_pwrdm_operations);
+}
arch/arm/mach-omap2/powerdomains_data.c deleted +0 -159

159 lines not on this page · raw message

arch/arm/plat-omap/include/plat/powerdomain.h +10 -3
index 583758c..b79eebb 100644
@@ -2,17 +2,20 @@
  * OMAP2/3 powerdomain control
  *
  * Copyright (C) 2007-2008 Texas Instruments, Inc.
- * Copyright (C) 2007-2009 Nokia Corporation
+ * Copyright (C) 2007-2010 Nokia Corporation
  *
  * Written by 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 the mach-omap2/ directory at the earliest
+ * opportunity.
  */
 
-#ifndef ASM_ARM_ARCH_OMAP_POWERDOMAIN
-#define ASM_ARM_ARCH_OMAP_POWERDOMAIN
+#ifndef ASM_ARM_PLAT_OMAP_INCLUDE_PLAT_POWERDOMAIN
+#define ASM_ARM_PLAT_OMAP_INCLUDE_PLAT_POWERDOMAIN
 
 #include <linux/types.h>
 #include <linux/list.h>
@@ -206,4 +209,8 @@ int pwrdm_pre_transition(void);
 int pwrdm_post_transition(void);
 int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
 
+extern void omap2xxx_powerdomains_init(void);
+extern void omap3xxx_powerdomains_init(void);
+extern void omap44xx_powerdomains_init(void);
+
 #endif
author maintainer
#8 lore raw

PATCH 8/14 OMAP2+: clockdomains: move clockdomain static data to .c files

In reply to Paul Walmsley

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.

---
 arch/arm/mach-omap2/Makefile                     |   10 +++-
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |   58 +++-------------------
 arch/arm/mach-omap2/clockdomains44xx_data.c      |   42 ++++++++++++++--
 arch/arm/mach-omap2/io.c                         |   10 ++--
 arch/arm/plat-omap/include/plat/clockdomain.h    |   11 +++-
 5 files changed, 66 insertions(+), 65 deletions(-)
 rename arch/arm/mach-omap2/{clockdomains.h => clockdomains2xxx_3xxx_data.c} (95%)
 rename arch/arm/mach-omap2/{clockdomains44xx.h => clockdomains44xx_data.c} (90%)
arch/arm/mach-omap2/Makefile +8 -2
index 609fa78..78a2a5d 100644
@@ -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)
@@ -82,6 +81,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 \
arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c renamed from arch/arm/mach-omap2/clockdomains.h +8 -50

115 lines not on this page · raw message

arch/arm/mach-omap2/clockdomains44xx_data.c renamed from arch/arm/mach-omap2/clockdomains44xx.h +37 -5

55 lines not on this page · raw message

arch/arm/mach-omap2/io.c +4 -6
index 6336044..d05638ac 100644
@@ -42,8 +42,6 @@
 #include <plat/powerdomain.h>
 
 #include <plat/clockdomain.h>
-#include "clockdomains.h"
-
 #include <plat/omap_hwmod.h>
 
 /*
@@ -317,19 +315,19 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 
 	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();
 	}
 
arch/arm/plat-omap/include/plat/clockdomain.h +9 -2
index ba0a6c0..a5f8579 100644
@@ -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
author maintainer
#9 lore raw

PATCH 9/14 OMAP3: control/PRCM: add omap3_ctrl_write_boot_mode()

In reply to Paul Walmsley

Get rid of the open-coded scratchpad write in mach-omap2/prcm.c and replace it with an actual API, omap3_ctrl_write_boot_mode(). While there, get rid of the gratuitous omap_writel().

There's not much documentation available for what should wind up in the scratchpad here, so more documentation would be appreciated. Also, at some point, we should formalize our treatment of the scratchpad; right now, accesses to the scratchpad are not well-documented.

---
 arch/arm/mach-omap2/control.c |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/control.h |    1 +
 arch/arm/mach-omap2/prcm.c    |   10 +---------
 3 files changed, 33 insertions(+), 9 deletions(-)
arch/arm/mach-omap2/control.c +31 -0
index 1fa3294..9fda3d7 100644
@@ -209,6 +209,37 @@ void omap4_ctrl_pad_writel(u32 val, u16 offset)
 	__raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset));
 }
 
+#ifdef CONFIG_ARCH_OMAP3
+
+/**
+ * omap3_ctrl_write_boot_mode - set scratchpad boot mode for the next boot
+ * @bootmode: 8-bit value to pass to some boot code
+ *
+ * Set the bootmode in the scratchpad RAM.  This is used after the
+ * system restarts.  Not sure what actually uses this - it may be the
+ * bootloader, rather than the boot ROM - contrary to the preserved
+ * comment below.  No return value.
+ */
+void omap3_ctrl_write_boot_mode(u8 bootmode)
+{
+	u32 l;
+
+	l = ('B' << 24) | ('M' << 16) | bootmode;
+
+	/*
+	 * Reserve the first word in scratchpad for communicating
+	 * with the boot ROM. A pointer to a data structure
+	 * describing the boot process can be stored there,
+	 * cf. OMAP34xx TRM, Initialization / Software Booting
+	 * Configuration.
+	 *
+	 * XXX This should use some omap_ctrl_writel()-type function
+	 */
+	__raw_writel(l, OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD + 4));
+}
+
+#endif
+
 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
 /*
  * Clears the scratchpad contents in case of cold boot-
arch/arm/mach-omap2/control.h +1 -0
index b6c6b7c..a9325ad 100644
@@ -350,6 +350,7 @@ extern u32 *get_es3_restore_pointer(void);
 extern u32 omap3_arm_context[128];
 extern void omap3_control_save_context(void);
 extern void omap3_control_restore_context(void);
+extern void omap3_ctrl_write_boot_mode(u8 bootmode);
 
 #else
 #define omap_ctrl_base_get()		0
arch/arm/mach-omap2/prcm.c +1 -9
index a51846e..2eca847 100644
@@ -143,16 +143,8 @@ void omap_prcm_arch_reset(char mode, const char *cmd)
 
 		prcm_offs = WKUP_MOD;
 	} else if (cpu_is_omap34xx()) {
-		u32 l;
-
 		prcm_offs = OMAP3430_GR_MOD;
-		l = ('B' << 24) | ('M' << 16) | (cmd ? (u8)*cmd : 0);
-		/* Reserve the first word in scratchpad for communicating
-		 * with the boot ROM. A pointer to a data structure
-		 * describing the boot process can be stored there,
-		 * cf. OMAP34xx TRM, Initialization / Software Booting
-		 * Configuration. */
-		omap_writel(l, OMAP343X_SCRATCHPAD + 4);
+		omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
 	} else if (cpu_is_omap44xx())
 		prcm_offs = OMAP4430_PRM_DEVICE_MOD;
 	else
author maintainer
#10 lore raw

PATCH 10/14 OMAP3: control/PRCM: move CONTROL_PADCONF_SYS_NIRQ save/restore to SCM code

In reply to Paul Walmsley

For some reason, the PRCM context save/restore code also saves and restores a single System Control Module register, CONTROL_PADCONF_SYS_NIRQ. This is probably just an error -- the register should be handled by SCM code -- so this patch moves it there.

If this register really does need to be saved and restored before the rest of the PRCM registers, the code to do so should live in the SCM code, and the PM code should call this separate function. This register pertains to devices with a stacked modem, so this patch is unlikely to affect most OMAP devices out there.

---
 arch/arm/mach-omap2/control.c |    5 +++++
 arch/arm/mach-omap2/prcm.c    |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/control.c +5 -0
index 9fda3d7..b260e1b 100644
@@ -134,6 +134,7 @@ struct omap3_control_regs {
 	u32 sramldo4;
 	u32 sramldo5;
 	u32 csi;
+	u32 padconf_sys_nirq;
 };
 
 static struct omap3_control_regs control_context;
@@ -447,6 +448,8 @@ void omap3_control_save_context(void)
 	control_context.sramldo4 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4);
 	control_context.sramldo5 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5);
 	control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI);
+	control_context.padconf_sys_nirq =
+		omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
 	return;
 }
 
@@ -503,6 +506,8 @@ void omap3_control_restore_context(void)
 	omap_ctrl_writel(control_context.sramldo4, OMAP343X_CONTROL_SRAMLDO4);
 	omap_ctrl_writel(control_context.sramldo5, OMAP343X_CONTROL_SRAMLDO5);
 	omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI);
+	omap_ctrl_writel(control_context.padconf_sys_nirq,
+			 OMAP343X_CONTROL_PADCONF_SYSNIRQ);
 	return;
 }
 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
arch/arm/mach-omap2/prcm.c +0 -5
index 2eca847..d27cdba 100644
@@ -42,7 +42,6 @@ static void __iomem *cm2_base;
 #define MAX_MODULE_ENABLE_WAIT		100000
 
 struct omap3_prcm_regs {
-	u32 control_padconf_sys_nirq;
 	u32 iva2_cm_clksel1;
 	u32 iva2_cm_clksel2;
 	u32 cm_sysconfig;
@@ -312,8 +311,6 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)
 #ifdef CONFIG_ARCH_OMAP3
 void omap3_prcm_save_context(void)
 {
-	prcm_context.control_padconf_sys_nirq =
-			 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
 	prcm_context.iva2_cm_clksel1 =
 			 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
 	prcm_context.iva2_cm_clksel2 =
@@ -466,8 +463,6 @@ void omap3_prcm_save_context(void)
 
 void omap3_prcm_restore_context(void)
 {
-	omap_ctrl_writel(prcm_context.control_padconf_sys_nirq,
-					 OMAP343X_CONTROL_PADCONF_SYSNIRQ);
 	cm_write_mod_reg(prcm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
 					 CM_CLKSEL1);
 	cm_write_mod_reg(prcm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,
author maintainer
#11 lore raw

PATCH 11/14 OMAP4: PRCM: reorganize existing OMAP4 PRCM header files

In reply to Paul Walmsley

Split the existing cm44xx.h file into cm1_44xx.h and cm2_44xx.h files so they match their underlying OMAP hardware modules. Add clockdomain offset information.

Add header files for the MPU local PRCM, prcm_mpu44xx.h, and for the SCRM, scrm44xx.h. SCRM register offsets still need to be added; TI should do this.

Move the "_MOD" macros out of the prcm-common.h header file, into the header file of the hardware module that they belong to. For example, OMAP4430_PRM_*_MOD macros have been moved into the prm44xx.h header.

Adjust #includes of all files that used the old PRCM header file names to point to the new filenames.

The autogeneration scripts have been updated accordingly.

Cc Beno?t Cousson <[email protected]>
Cc Rajendra Nayak <[email protected]>
---
 arch/arm/mach-omap2/clock44xx_data.c        |    4 
 arch/arm/mach-omap2/clockdomains44xx_data.c |    8 
 arch/arm/mach-omap2/cm.h                    |    5 
 arch/arm/mach-omap2/cm1_44xx.h              |  256 ++++++++++
 arch/arm/mach-omap2/cm2_44xx.h              |  232 +--------
 arch/arm/mach-omap2/cm44xx.h                |  667 +--------------------------
 arch/arm/mach-omap2/omap_hwmod.c            |    1 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c  |    4 
 arch/arm/mach-omap2/powerdomain.c           |    1 
 arch/arm/mach-omap2/powerdomain44xx.c       |    2 
 arch/arm/mach-omap2/powerdomains44xx_data.c |    4 
 arch/arm/mach-omap2/prcm-common.h           |   79 ---
 arch/arm/mach-omap2/prcm.c                  |    1 
 arch/arm/mach-omap2/prcm_mpu44xx.h          |   91 ++++
 arch/arm/mach-omap2/prm.h                   |   17 -
 arch/arm/mach-omap2/prm44xx.c               |    2 
 arch/arm/mach-omap2/prm44xx.h               |  107 ++--
 arch/arm/mach-omap2/scrm44xx.h              |   32 +
 18 files changed, 502 insertions(+), 1011 deletions(-)
 create mode 100644 arch/arm/mach-omap2/cm1_44xx.h
 copy arch/arm/mach-omap2/{cm44xx.h => cm2_44xx.h} (68%)
 create mode 100644 arch/arm/mach-omap2/prcm_mpu44xx.h
 create mode 100644 arch/arm/mach-omap2/scrm44xx.h
arch/arm/mach-omap2/clock44xx_data.c +3 -1
index 1599836..2605e2e 100644
@@ -30,9 +30,11 @@
 
 #include "clock.h"
 #include "clock44xx.h"
-#include "cm.h"
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
 #include "cm-regbits-44xx.h"
 #include "prm.h"
+#include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "control.h"
 
arch/arm/mach-omap2/clockdomains44xx_data.c +5 -3
index c847a8b..d4a5206 100644
@@ -28,10 +28,12 @@
 
 #include <plat/clockdomain.h>
 
-#include "cm44xx.h"
-#include "prm44xx.h"
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
 #include "cm-regbits-44xx.h"
-#include "prm-regbits-44xx.h"
+#include "prm44xx.h"
+#include "prcm_mpu44xx.h"
+
 
 static struct clockdomain l4_cefuse_44xx_clkdm = {
 	.name		  = "l4_cefuse_clkdm",
arch/arm/mach-omap2/cm.h +1 -4
index a02ca30..bf21375 100644
@@ -22,10 +22,7 @@
 			OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
 #define OMAP34XX_CM_REGADDR(module, reg)				\
 			OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
-#define OMAP44XX_CM1_REGADDR(module, reg)				\
-			OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (module) + (reg))
-#define OMAP44XX_CM2_REGADDR(module, reg)				\
-			OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE + (module) + (reg))
+
 
 #include "cm44xx.h"
 
arch/arm/mach-omap2/cm1_44xx.h new file +256 -0

256 lines not on this page · raw message

arch/arm/mach-omap2/cm2_44xx.h renamed from arch/arm/mach-omap2/cm44xx.h +24 -208

248 lines not on this page · raw message

arch/arm/mach-omap2/cm44xx.h +15 -652

682 lines not on this page · raw message

arch/arm/mach-omap2/omap_hwmod.c +1 -0
index 5a30658..cafcd87 100644
@@ -146,6 +146,7 @@
 
 #include "cm.h"
 #include "prm.h"
+#include "prm44xx.h"
 
 /* Maximum microseconds to wait for OMAP module to softreset */
 #define MAX_MODULE_SOFTRESET_WAIT	10000
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +3 -1
index 7274db4..a29bd00 100644
@@ -25,7 +25,9 @@
 
 #include "omap_hwmod_common_data.h"
 
-#include "cm.h"
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
+#include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 
 /* Base offset for all OMAP4 interrupts external to MPUSS */
arch/arm/mach-omap2/powerdomain.c +1 -0
index 6206721..77f42b9 100644
@@ -19,6 +19,7 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include "prm44xx.h"
 
 #include <plat/cpu.h>
 #include <plat/powerdomain.h>
arch/arm/mach-omap2/powerdomain44xx.c +1 -1
index 366e869..7efdf68 100644
@@ -18,7 +18,7 @@
 
 #include <plat/powerdomain.h>
 #include <plat/prcm.h>
-#include "prm.h"
+#include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "powerdomains.h"
 
arch/arm/mach-omap2/powerdomains44xx_data.c +2 -2
index 2512f69..d078c88 100644
@@ -26,10 +26,10 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "cm.h"
-#include "cm-regbits-44xx.h"
 #include "prm.h"
 #include "prm-regbits-44xx.h"
+#include "prm44xx.h"
+#include "prcm_mpu44xx.h"
 
 /* core_44xx_pwrdm: CORE power domain */
 static struct powerdomain core_44xx_pwrdm = {
arch/arm/mach-omap2/prcm-common.h +7 -72

102 lines not on this page · raw message

arch/arm/mach-omap2/prcm.c +1 -0
index d27cdba..df55fdf 100644
@@ -31,6 +31,7 @@
 #include "clock2xxx.h"
 #include "cm.h"
 #include "prm.h"
+#include "prm44xx.h"
 #include "prm-regbits-24xx.h"
 #include "prm-regbits-44xx.h"
 #include "control.h"
arch/arm/mach-omap2/prcm_mpu44xx.h new file +91 -0

91 lines not on this page · raw message

arch/arm/mach-omap2/prm.h +0 -17
index 7be040b..10a24ca 100644
@@ -22,12 +22,6 @@
 		OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
 #define OMAP34XX_PRM_REGADDR(module, reg)				\
 		OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
-#define OMAP44XX_PRM_REGADDR(module, reg)				\
-		OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (module) + (reg))
-#define OMAP44XX_PRCM_MPU_REGADDR(module, reg)				\
-		OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE + (module) + (reg))
-
-#include "prm44xx.h"
 
 /*
  * Architecture-specific global PRM registers
@@ -220,13 +214,6 @@
 #define OMAP3430_PRM_IRQSTATUS_IVA2			0x00f8
 #define OMAP3430_PRM_IRQENABLE_IVA2			0x00fc
 
-/* Omap4 specific registers */
-#define OMAP4_RM_RSTCTRL				0x0000
-#define OMAP4_RM_RSTTIME				0x0004
-#define OMAP4_RM_RSTST					0x0008
-#define OMAP4_PM_PWSTCTRL				0x0000
-#define OMAP4_PM_PWSTST					0x0004
-
 
 #ifndef __ASSEMBLER__
 
@@ -251,10 +238,6 @@ int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
 int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
 int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift);
 
-int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift);
-int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift);
-int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
-
 #endif
 
 /*
arch/arm/mach-omap2/prm44xx.c +1 -1
index a1ff918..697b58f 100644
@@ -20,7 +20,7 @@
 #include <plat/cpu.h>
 #include <plat/prcm.h>
 
-#include "prm.h"
+#include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 
 /*
arch/arm/mach-omap2/prm44xx.h +58 -49

123 lines not on this page · raw message

arch/arm/mach-omap2/scrm44xx.h new file +32 -0
new file mode 100644
index 0000000..53ea8e8
@@ -0,0 +1,32 @@
+/*
+ * OMAP44xx SCRM instance offset macros
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Copyright (C) 2010 Nokia Corporation
+ *
+ * Paul Walmsley (paul at pwsan.com)
+ * Rajendra Nayak (rnayak at ti.com)
+ * Benoit Cousson (b-cousson at 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 at 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.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_SCRM44XX_H
+#define __ARCH_ARM_MACH_OMAP2_SCRM44XX_H
+
+#define OMAP4430_SCRM_BASE		0x4a30a000
+
+/* SCRM instances */
+#define OMAP4430_SCRM_SCRM_MOD		0x0000
+
+/* XXX SCRM registers should go here */
+
+#endif
#12 lore raw

PATCH 11/14 OMAP4: PRCM: reorganize existing OMAP4 PRCM header files

Salut Paul,

Quoted 7 lines · Paul Walmsley

Split the existing cm44xx.h file into cm1_44xx.h and cm2_44xx.h files so they match their underlying OMAP hardware modules. Add clockdomain offset information.

Add header files for the MPU local PRCM, prcm_mpu44xx.h, and for the SCRM, scrm44xx.h. SCRM register offsets still need to be added; TI should do this.

And we did it :-)

I sent it last week along with clock data series:
https://patchwork.kernel.org/patch/373751/

OK, I've just realized that it was a little bit hidden in the clock data patch, and maybe we should have been sent two patches.
Sorry for that. Do you want to take it in that series, or should I re-sent the clock data one?

Regards,
Benoit

Quoted 1,808 lines

Move the "_MOD" macros out of the prcm-common.h header file, into the header file of the hardware module that they belong to. For example, OMAP4430_PRM_*_MOD macros have been moved into the prm44xx.h header.

Adjust #includes of all files that used the old PRCM header file names to point to the new filenames.

The autogeneration scripts have been updated accordingly.

Cc Beno?t Cousson<[email protected]>
Cc Rajendra Nayak<[email protected]>
---
  arch/arm/mach-omap2/clock44xx_data.c        |    4
  arch/arm/mach-omap2/clockdomains44xx_data.c |    8
  arch/arm/mach-omap2/cm.h                    |    5
  arch/arm/mach-omap2/cm1_44xx.h              |  256 ++++++++++
  arch/arm/mach-omap2/cm2_44xx.h              |  232 +--------
  arch/arm/mach-omap2/cm44xx.h                |  667 +--------------------------
  arch/arm/mach-omap2/omap_hwmod.c            |    1
  arch/arm/mach-omap2/omap_hwmod_44xx_data.c  |    4
  arch/arm/mach-omap2/powerdomain.c           |    1
  arch/arm/mach-omap2/powerdomain44xx.c       |    2
  arch/arm/mach-omap2/powerdomains44xx_data.c |    4
  arch/arm/mach-omap2/prcm-common.h           |   79 ---
  arch/arm/mach-omap2/prcm.c                  |    1
  arch/arm/mach-omap2/prcm_mpu44xx.h          |   91 ++++
  arch/arm/mach-omap2/prm.h                   |   17 -
  arch/arm/mach-omap2/prm44xx.c               |    2
  arch/arm/mach-omap2/prm44xx.h               |  107 ++--
  arch/arm/mach-omap2/scrm44xx.h              |   32 +
  18 files changed, 502 insertions(+), 1011 deletions(-)

create mode 100644 arch/arm/mach-omap2/cm1_44xx.h copy arch/arm/mach-omap2/{cm44xx.h => cm2_44xx.h} (68%) create mode 100644 arch/arm/mach-omap2/prcm_mpu44xx.h create mode 100644 arch/arm/mach-omap2/scrm44xx.h

arch/arm/mach-omap2/clock44xx_data.c +3 -1
index 1599836..2605e2e 100644
@@ -30,9 +30,11 @@
 
  #include "clock.h"
  #include "clock44xx.h"
-#include "cm.h"
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
  #include "cm-regbits-44xx.h"
  #include "prm.h"
+#include "prm44xx.h"
  #include "prm-regbits-44xx.h"
  #include "control.h"
 
arch/arm/mach-omap2/clockdomains44xx_data.c +5 -3
index c847a8b..d4a5206 100644
@@ -28,10 +28,12 @@
 
  #include<plat/clockdomain.h>
 
-#include "cm44xx.h"
-#include "prm44xx.h"
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
  #include "cm-regbits-44xx.h"
-#include "prm-regbits-44xx.h"
+#include "prm44xx.h"
+#include "prcm_mpu44xx.h"
+
 
  static struct clockdomain l4_cefuse_44xx_clkdm = {
         .name             = "l4_cefuse_clkdm",
arch/arm/mach-omap2/cm.h +1 -4
index a02ca30..bf21375 100644
@@ -22,10 +22,7 @@
                         OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
  #define OMAP34XX_CM_REGADDR(module, reg)                               \
                         OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
-#define OMAP44XX_CM1_REGADDR(module, reg)                              \
-                       OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (module) + (reg))
-#define OMAP44XX_CM2_REGADDR(module, reg)                              \
-                       OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE + (module) + (reg))
+
 
  #include "cm44xx.h"
 
arch/arm/mach-omap2/cm1_44xx.h new file +256 -0
new file mode 100644
index 0000000..f3bba21
@@ -0,0 +1,256 @@
+/*
+ * OMAP44xx CM1 instance offset macros
+ *
+ * Copyright (C) 2009-2010 Texas Instruments, Inc.
+ * Copyright (C) 2009-2010 Nokia Corporation
+ *
+ * Paul Walmsley (paul at pwsan.com)
+ * Rajendra Nayak (rnayak at ti.com)
+ * Benoit Cousson (b-cousson at 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 at 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.
+ *
+ * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
+ *     or "OMAP4430".
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CM1_44XX_H
+#define __ARCH_ARM_MACH_OMAP2_CM1_44XX_H
+
+/* CM1 base address */
+#define OMAP4430_CM1_BASE              0x4a004000
+
+#define OMAP44XX_CM1_REGADDR(module, reg)                              \
+       OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (module) + (reg))
+
+/* CM1 instances */
+#define OMAP4430_CM1_OCP_SOCKET_MOD    0x0000
+#define OMAP4430_CM1_CKGEN_MOD         0x0100
+#define OMAP4430_CM1_MPU_MOD           0x0300
+#define OMAP4430_CM1_TESLA_MOD         0x0400
+#define OMAP4430_CM1_ABE_MOD           0x0500
+#define OMAP4430_CM1_RESTORE_MOD       0x0e00
+#define OMAP4430_CM1_INSTR_MOD         0x0f00
+
+/* CM1 */
+
+/* CM1.OCP_SOCKET_CM1 register offsets */
+#define OMAP4_REVISION_CM1_OFFSET                      0x0000
+#define OMAP4430_REVISION_CM1                          OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0000)
+#define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET          0x0040
+#define OMAP4430_CM_CM1_PROFILING_CLKCTRL              OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0040)
+
+/* CM1.CKGEN_CM1 register offsets */
+#define OMAP4_CM_CLKSEL_CORE_OFFSET                    0x0000
+#define OMAP4430_CM_CLKSEL_CORE                                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0000)
+#define OMAP4_CM_CLKSEL_ABE_OFFSET                     0x0008
+#define OMAP4430_CM_CLKSEL_ABE                         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0008)
+#define OMAP4_CM_DLL_CTRL_OFFSET                       0x0010
+#define OMAP4430_CM_DLL_CTRL                           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0010)
+#define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET              0x0020
+#define OMAP4430_CM_CLKMODE_DPLL_CORE                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0020)
+#define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET               0x0024
+#define OMAP4430_CM_IDLEST_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0024)
+#define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET             0x0028
+#define OMAP4430_CM_AUTOIDLE_DPLL_CORE                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0028)
+#define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET               0x002c
+#define OMAP4430_CM_CLKSEL_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x002c)
+#define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET               0x0030
+#define OMAP4430_CM_DIV_M2_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0030)
+#define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET               0x0034
+#define OMAP4430_CM_DIV_M3_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0034)
+#define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET               0x0038
+#define OMAP4430_CM_DIV_M4_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0038)
+#define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET               0x003c
+#define OMAP4430_CM_DIV_M5_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x003c)
+#define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET               0x0040
+#define OMAP4430_CM_DIV_M6_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0040)
+#define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET               0x0044
+#define OMAP4430_CM_DIV_M7_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0044)
+#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET       0x0048
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0048)
+#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_OFFSET       0x004c
+#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x004c)
+#define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET         0x0050
+#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE             OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0050)
+#define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET               0x0060
+#define OMAP4430_CM_CLKMODE_DPLL_MPU                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0060)
+#define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET                        0x0064
+#define OMAP4430_CM_IDLEST_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0064)
+#define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET              0x0068
+#define OMAP4430_CM_AUTOIDLE_DPLL_MPU                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0068)
+#define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET                        0x006c
+#define OMAP4430_CM_CLKSEL_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x006c)
+#define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET                        0x0070
+#define OMAP4430_CM_DIV_M2_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0070)
+#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET                0x0088
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0088)
+#define OMAP4_CM_SSC_MODFREQDIV_DPLL_MPU_OFFSET                0x008c
+#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_MPU            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x008c)
+#define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET                        0x009c
+#define OMAP4430_CM_BYPCLK_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x009c)
+#define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET               0x00a0
+#define OMAP4430_CM_CLKMODE_DPLL_IVA                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a0)
+#define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET                        0x00a4
+#define OMAP4430_CM_IDLEST_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a4)
+#define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET              0x00a8
+#define OMAP4430_CM_AUTOIDLE_DPLL_IVA                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a8)
+#define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET                        0x00ac
+#define OMAP4430_CM_CLKSEL_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ac)
+#define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET                        0x00b8
+#define OMAP4430_CM_DIV_M4_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00b8)
+#define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET                        0x00bc
+#define OMAP4430_CM_DIV_M5_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00bc)
+#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET                0x00c8
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00c8)
+#define OMAP4_CM_SSC_MODFREQDIV_DPLL_IVA_OFFSET                0x00cc
+#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_IVA            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00cc)
+#define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET                        0x00dc
+#define OMAP4430_CM_BYPCLK_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00dc)
+#define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET               0x00e0
+#define OMAP4430_CM_CLKMODE_DPLL_ABE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e0)
+#define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET                        0x00e4
+#define OMAP4430_CM_IDLEST_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e4)
+#define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET              0x00e8
+#define OMAP4430_CM_AUTOIDLE_DPLL_ABE                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e8)
+#define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET                        0x00ec
+#define OMAP4430_CM_CLKSEL_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ec)
+#define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET                        0x00f0
+#define OMAP4430_CM_DIV_M2_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f0)
+#define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET                        0x00f4
+#define OMAP4430_CM_DIV_M3_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f4)
+#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET                0x0108
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0108)
+#define OMAP4_CM_SSC_MODFREQDIV_DPLL_ABE_OFFSET                0x010c
+#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_ABE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x010c)
+#define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET            0x0120
+#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0120)
+#define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET             0x0124
+#define OMAP4430_CM_IDLEST_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0124)
+#define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET           0x0128
+#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY               OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0128)
+#define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET             0x012c
+#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x012c)
+#define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET             0x0130
+#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0130)
+#define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET             0x0138
+#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0138)
+#define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET             0x013c
+#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x013c)
+#define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET             0x0140
+#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0140)
+#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET     0x0148
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0148)
+#define OMAP4_CM_SSC_MODFREQDIV_DPLL_DDRPHY_OFFSET     0x014c
+#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_DDRPHY         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x014c)
+#define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET            0x0160
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG1                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0160)
+#define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET            0x0164
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG2                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0164)
+#define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET                        0x0170
+#define OMAP4430_CM_DYN_DEP_PRESCAL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0170)
+#define OMAP4_CM_RESTORE_ST_OFFSET                     0x0180
+#define OMAP4430_CM_RESTORE_ST                         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0180)
+
+/* CM1.MPU_CM1 register offsets */
+#define OMAP4_CM_MPU_CLKSTCTRL_OFFSET                  0x0000
+#define OMAP4430_CM_MPU_CLKSTCTRL                      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0000)
+#define OMAP4_CM_MPU_STATICDEP_OFFSET                  0x0004
+#define OMAP4430_CM_MPU_STATICDEP                      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0004)
+#define OMAP4_CM_MPU_DYNAMICDEP_OFFSET                 0x0008
+#define OMAP4430_CM_MPU_DYNAMICDEP                     OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0008)
+#define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET                        0x0020
+#define OMAP4430_CM_MPU_MPU_CLKCTRL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0020)
+
+/* CM1.TESLA_CM1 register offsets */
+#define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET                        0x0000
+#define OMAP4430_CM_TESLA_CLKSTCTRL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0000)
+#define OMAP4_CM_TESLA_STATICDEP_OFFSET                        0x0004
+#define OMAP4430_CM_TESLA_STATICDEP                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0004)
+#define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET               0x0008
+#define OMAP4430_CM_TESLA_DYNAMICDEP                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0008)
+#define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET            0x0020
+#define OMAP4430_CM_TESLA_TESLA_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0020)
+
+/* CM1.ABE_CM1 register offsets */
+#define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET                 0x0000
+#define OMAP4430_CM1_ABE_CLKSTCTRL                     OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0000)
+#define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET             0x0020
+#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0020)
+#define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET              0x0028
+#define OMAP4430_CM1_ABE_AESS_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0028)
+#define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET               0x0030
+#define OMAP4430_CM1_ABE_PDM_CLKCTRL                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0030)
+#define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET              0x0038
+#define OMAP4430_CM1_ABE_DMIC_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0038)
+#define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET             0x0040
+#define OMAP4430_CM1_ABE_MCASP_CLKCTRL                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0040)
+#define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET            0x0048
+#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0048)
+#define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET            0x0050
+#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0050)
+#define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET            0x0058
+#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0058)
+#define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET           0x0060
+#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL               OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0060)
+#define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET            0x0068
+#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0068)
+#define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET            0x0070
+#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0070)
+#define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET            0x0078
+#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0078)
+#define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET            0x0080
+#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0080)
+#define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET              0x0088
+#define OMAP4430_CM1_ABE_WDT3_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088)
+
+/* CM1.RESTORE_CM1 register offsets */
+#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET            0x0000
+#define OMAP4430_CM_CLKSEL_CORE_RESTORE                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0000)
+#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET       0x0004
+#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004)
+#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET       0x0008
+#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008)
+#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET       0x000c
+#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c)
+#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET       0x0010
+#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010)
+#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET       0x0014
+#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014)
+#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET       0x0018
+#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018)
+#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET       0x001c
+#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c)
+#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET       0x0020
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020)
+#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET       0x0024
+#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024)
+#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET      0x0028
+#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE          OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028)
+#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET    0x002c
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c)
+#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET    0x0030
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030)
+#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET     0x0034
+#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034)
+#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET          0x0038
+#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE              OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038)
+#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET  0x003c
+#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c)
+#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET                0x0040
+#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040)
+
+/* Function prototypes */
+extern u32 omap4_cm1_read_mod_reg(s16 module, u16 idx);
+extern void omap4_cm1_write_mod_reg(u32 val, s16 module, u16 idx);
+extern u32 omap4_cm1_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
+
+#endif
arch/arm/mach-omap2/cm2_44xx.h renamed from arch/arm/mach-omap2/cm44xx.h +24 -208
similarity index 68%
copy from arch/arm/mach-omap2/cm44xx.h
copy to arch/arm/mach-omap2/cm2_44xx.h
index 3c35a87..678cff6 100644
@@ -1,5 +1,5 @@
  /*
- * OMAP44xx CM1&  CM2 instance offset macros
+ * OMAP44xx CM2 instance offset macros
   *
   * Copyright (C) 2009-2010 Texas Instruments, Inc.
   * Copyright (C) 2009-2010 Nokia Corporation
@@ -17,219 +17,35 @@
   * 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 file needs to be updated to align on one of "OMAP4", "OMAP44XX",
+ *     or "OMAP4430".
   */
 
-#ifndef __ARCH_ARM_MACH_OMAP2_CM44XX_H
-#define __ARCH_ARM_MACH_OMAP2_CM44XX_H
-
-
-/* CM1 */
-
-/* CM1.OCP_SOCKET_CM1 register offsets */
-#define OMAP4_REVISION_CM1_OFFSET                      0x0000
-#define OMAP4430_REVISION_CM1                          OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0000)
-#define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET          0x0040
-#define OMAP4430_CM_CM1_PROFILING_CLKCTRL              OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0040)
-
-/* CM1.CKGEN_CM1 register offsets */
-#define OMAP4_CM_CLKSEL_CORE_OFFSET                    0x0000
-#define OMAP4430_CM_CLKSEL_CORE                                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0000)
-#define OMAP4_CM_CLKSEL_ABE_OFFSET                     0x0008
-#define OMAP4430_CM_CLKSEL_ABE                         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0008)
-#define OMAP4_CM_DLL_CTRL_OFFSET                       0x0010
-#define OMAP4430_CM_DLL_CTRL                           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0010)
-#define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET              0x0020
-#define OMAP4430_CM_CLKMODE_DPLL_CORE                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0020)
-#define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET               0x0024
-#define OMAP4430_CM_IDLEST_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0024)
-#define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET             0x0028
-#define OMAP4430_CM_AUTOIDLE_DPLL_CORE                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0028)
-#define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET               0x002c
-#define OMAP4430_CM_CLKSEL_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x002c)
-#define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET               0x0030
-#define OMAP4430_CM_DIV_M2_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0030)
-#define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET               0x0034
-#define OMAP4430_CM_DIV_M3_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0034)
-#define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET               0x0038
-#define OMAP4430_CM_DIV_M4_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0038)
-#define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET               0x003c
-#define OMAP4430_CM_DIV_M5_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x003c)
-#define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET               0x0040
-#define OMAP4430_CM_DIV_M6_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0040)
-#define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET               0x0044
-#define OMAP4430_CM_DIV_M7_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0044)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET       0x0048
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0048)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_OFFSET       0x004c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x004c)
-#define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET         0x0050
-#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE             OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0050)
-#define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET               0x0060
-#define OMAP4430_CM_CLKMODE_DPLL_MPU                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0060)
-#define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET                        0x0064
-#define OMAP4430_CM_IDLEST_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0064)
-#define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET              0x0068
-#define OMAP4430_CM_AUTOIDLE_DPLL_MPU                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0068)
-#define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET                        0x006c
-#define OMAP4430_CM_CLKSEL_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x006c)
-#define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET                        0x0070
-#define OMAP4430_CM_DIV_M2_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0070)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET                0x0088
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0088)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_MPU_OFFSET                0x008c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_MPU            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x008c)
-#define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET                        0x009c
-#define OMAP4430_CM_BYPCLK_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x009c)
-#define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET               0x00a0
-#define OMAP4430_CM_CLKMODE_DPLL_IVA                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a0)
-#define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET                        0x00a4
-#define OMAP4430_CM_IDLEST_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a4)
-#define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET              0x00a8
-#define OMAP4430_CM_AUTOIDLE_DPLL_IVA                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a8)
-#define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET                        0x00ac
-#define OMAP4430_CM_CLKSEL_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ac)
-#define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET                        0x00b8
-#define OMAP4430_CM_DIV_M4_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00b8)
-#define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET                        0x00bc
-#define OMAP4430_CM_DIV_M5_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00bc)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET                0x00c8
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00c8)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_IVA_OFFSET                0x00cc
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_IVA            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00cc)
-#define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET                        0x00dc
-#define OMAP4430_CM_BYPCLK_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00dc)
-#define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET               0x00e0
-#define OMAP4430_CM_CLKMODE_DPLL_ABE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e0)
-#define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET                        0x00e4
-#define OMAP4430_CM_IDLEST_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e4)
-#define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET              0x00e8
-#define OMAP4430_CM_AUTOIDLE_DPLL_ABE                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e8)
-#define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET                        0x00ec
-#define OMAP4430_CM_CLKSEL_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ec)
-#define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET                        0x00f0
-#define OMAP4430_CM_DIV_M2_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f0)
-#define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET                        0x00f4
-#define OMAP4430_CM_DIV_M3_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f4)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET                0x0108
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0108)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_ABE_OFFSET                0x010c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_ABE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x010c)
-#define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET            0x0120
-#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0120)
-#define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET             0x0124
-#define OMAP4430_CM_IDLEST_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0124)
-#define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET           0x0128
-#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY               OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0128)
-#define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET             0x012c
-#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x012c)
-#define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET             0x0130
-#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0130)
-#define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET             0x0138
-#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0138)
-#define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET             0x013c
-#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x013c)
-#define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET             0x0140
-#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0140)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET     0x0148
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0148)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_DDRPHY_OFFSET     0x014c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_DDRPHY         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x014c)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET            0x0160
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG1                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0160)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET            0x0164
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG2                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0164)
-#define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET                        0x0170
-#define OMAP4430_CM_DYN_DEP_PRESCAL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0170)
-#define OMAP4_CM_RESTORE_ST_OFFSET                     0x0180
-#define OMAP4430_CM_RESTORE_ST                         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0180)
+#ifndef __ARCH_ARM_MACH_OMAP2_CM2_44XX_H
+#define __ARCH_ARM_MACH_OMAP2_CM2_44XX_H
 
-/* CM1.MPU_CM1 register offsets */
-#define OMAP4_CM_MPU_CLKSTCTRL_OFFSET                  0x0000
-#define OMAP4430_CM_MPU_CLKSTCTRL                      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0000)
-#define OMAP4_CM_MPU_STATICDEP_OFFSET                  0x0004
-#define OMAP4430_CM_MPU_STATICDEP                      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0004)
-#define OMAP4_CM_MPU_DYNAMICDEP_OFFSET                 0x0008
-#define OMAP4430_CM_MPU_DYNAMICDEP                     OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0008)
-#define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET                        0x0020
-#define OMAP4430_CM_MPU_MPU_CLKCTRL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0020)
+/* CM2 base address */
+#define OMAP4430_CM2_BASE              0x4a008000
 
-/* CM1.TESLA_CM1 register offsets */
-#define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET                        0x0000
-#define OMAP4430_CM_TESLA_CLKSTCTRL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0000)
-#define OMAP4_CM_TESLA_STATICDEP_OFFSET                        0x0004
-#define OMAP4430_CM_TESLA_STATICDEP                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0004)
-#define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET               0x0008
-#define OMAP4430_CM_TESLA_DYNAMICDEP                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0008)
-#define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET            0x0020
-#define OMAP4430_CM_TESLA_TESLA_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0020)
+#define OMAP44XX_CM2_REGADDR(module, reg)                              \
+       OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE + (module) + (reg))
 
-/* CM1.ABE_CM1 register offsets */
-#define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET                 0x0000
-#define OMAP4430_CM1_ABE_CLKSTCTRL                     OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0000)
-#define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET             0x0020
-#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0020)
-#define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET              0x0028
-#define OMAP4430_CM1_ABE_AESS_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0028)
-#define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET               0x0030
-#define OMAP4430_CM1_ABE_PDM_CLKCTRL                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0030)
-#define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET              0x0038
-#define OMAP4430_CM1_ABE_DMIC_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0038)
-#define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET             0x0040
-#define OMAP4430_CM1_ABE_MCASP_CLKCTRL                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0040)
-#define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET            0x0048
-#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0048)
-#define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET            0x0050
-#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0050)
-#define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET            0x0058
-#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0058)
-#define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET           0x0060
-#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL               OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0060)
-#define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET            0x0068
-#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0068)
-#define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET            0x0070
-#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0070)
-#define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET            0x0078
-#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0078)
-#define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET            0x0080
-#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0080)
-#define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET              0x0088
-#define OMAP4430_CM1_ABE_WDT3_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088)
+/* CM2 instances */
+#define OMAP4430_CM2_OCP_SOCKET_MOD    0x0000
+#define OMAP4430_CM2_CKGEN_MOD         0x0100
+#define OMAP4430_CM2_ALWAYS_ON_MOD     0x0600
+#define OMAP4430_CM2_CORE_MOD          0x0700
+#define OMAP4430_CM2_IVAHD_MOD         0x0f00
+#define OMAP4430_CM2_CAM_MOD           0x1000
+#define OMAP4430_CM2_DSS_MOD           0x1100
+#define OMAP4430_CM2_GFX_MOD           0x1200
+#define OMAP4430_CM2_L3INIT_MOD                0x1300
+#define OMAP4430_CM2_L4PER_MOD         0x1400
+#define OMAP4430_CM2_CEFUSE_MOD                0x1600
+#define OMAP4430_CM2_RESTORE_MOD       0x1e00
+#define OMAP4430_CM2_INSTR_MOD         0x1f00
 
-/* CM1.RESTORE_CM1 register offsets */
-#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET            0x0000
-#define OMAP4430_CM_CLKSEL_CORE_RESTORE                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0000)
-#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET       0x0004
-#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004)
-#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET       0x0008
-#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008)
-#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET       0x000c
-#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c)
-#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET       0x0010
-#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010)
-#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET       0x0014
-#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014)
-#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET       0x0018
-#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018)
-#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET       0x001c
-#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET       0x0020
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET       0x0024
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024)
-#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET      0x0028
-#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE          OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET    0x002c
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET    0x0030
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030)
-#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET     0x0034
-#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034)
-#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET          0x0038
-#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE              OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038)
-#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET  0x003c
-#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c)
-#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET                0x0040
-#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040)
 
  /* CM2 */
 
arch/arm/mach-omap2/cm44xx.h +15 -652
index 3c35a87..d390526 100644
@@ -1,667 +1,30 @@
  /*
- * OMAP44xx CM1&  CM2 instance offset macros
+ * OMAP4 Clock Management (CM) definitions
   *
- * Copyright (C) 2009-2010 Texas Instruments, Inc.
- * Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright (C) 2007-2009 Texas Instruments, Inc.
+ * Copyright (C) 2007-2009 Nokia Corporation
   *
- * Paul Walmsley (paul at pwsan.com)
- * Rajendra Nayak (rnayak at ti.com)
- * Benoit Cousson (b-cousson at 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 at vger.kernel.org mailing list and the
- * authors above to ensure that the autogeneration scripts are kept
- * up-to-date with the file contents.
+ * Written by 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.
+ *
+ * OMAP4 has two separate CM blocks, CM1 and CM2.  This file contains
+ * macros and function prototypes that are applicable to both.
   */
+#ifndef __ARCH_ASM_MACH_OMAP2_CM44XX_H
+#define __ARCH_ASM_MACH_OMAP2_CM44XX_H
 
-#ifndef __ARCH_ARM_MACH_OMAP2_CM44XX_H
-#define __ARCH_ARM_MACH_OMAP2_CM44XX_H
-
-
-/* CM1 */
-
-/* CM1.OCP_SOCKET_CM1 register offsets */
-#define OMAP4_REVISION_CM1_OFFSET                      0x0000
-#define OMAP4430_REVISION_CM1                          OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0000)
-#define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET          0x0040
-#define OMAP4430_CM_CM1_PROFILING_CLKCTRL              OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0040)
-
-/* CM1.CKGEN_CM1 register offsets */
-#define OMAP4_CM_CLKSEL_CORE_OFFSET                    0x0000
-#define OMAP4430_CM_CLKSEL_CORE                                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0000)
-#define OMAP4_CM_CLKSEL_ABE_OFFSET                     0x0008
-#define OMAP4430_CM_CLKSEL_ABE                         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0008)
-#define OMAP4_CM_DLL_CTRL_OFFSET                       0x0010
-#define OMAP4430_CM_DLL_CTRL                           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0010)
-#define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET              0x0020
-#define OMAP4430_CM_CLKMODE_DPLL_CORE                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0020)
-#define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET               0x0024
-#define OMAP4430_CM_IDLEST_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0024)
-#define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET             0x0028
-#define OMAP4430_CM_AUTOIDLE_DPLL_CORE                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0028)
-#define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET               0x002c
-#define OMAP4430_CM_CLKSEL_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x002c)
-#define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET               0x0030
-#define OMAP4430_CM_DIV_M2_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0030)
-#define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET               0x0034
-#define OMAP4430_CM_DIV_M3_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0034)
-#define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET               0x0038
-#define OMAP4430_CM_DIV_M4_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0038)
-#define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET               0x003c
-#define OMAP4430_CM_DIV_M5_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x003c)
-#define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET               0x0040
-#define OMAP4430_CM_DIV_M6_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0040)
-#define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET               0x0044
-#define OMAP4430_CM_DIV_M7_DPLL_CORE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0044)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET       0x0048
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0048)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_OFFSET       0x004c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x004c)
-#define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET         0x0050
-#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE             OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0050)
-#define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET               0x0060
-#define OMAP4430_CM_CLKMODE_DPLL_MPU                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0060)
-#define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET                        0x0064
-#define OMAP4430_CM_IDLEST_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0064)
-#define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET              0x0068
-#define OMAP4430_CM_AUTOIDLE_DPLL_MPU                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0068)
-#define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET                        0x006c
-#define OMAP4430_CM_CLKSEL_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x006c)
-#define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET                        0x0070
-#define OMAP4430_CM_DIV_M2_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0070)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET                0x0088
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0088)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_MPU_OFFSET                0x008c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_MPU            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x008c)
-#define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET                        0x009c
-#define OMAP4430_CM_BYPCLK_DPLL_MPU                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x009c)
-#define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET               0x00a0
-#define OMAP4430_CM_CLKMODE_DPLL_IVA                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a0)
-#define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET                        0x00a4
-#define OMAP4430_CM_IDLEST_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a4)
-#define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET              0x00a8
-#define OMAP4430_CM_AUTOIDLE_DPLL_IVA                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a8)
-#define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET                        0x00ac
-#define OMAP4430_CM_CLKSEL_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ac)
-#define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET                        0x00b8
-#define OMAP4430_CM_DIV_M4_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00b8)
-#define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET                        0x00bc
-#define OMAP4430_CM_DIV_M5_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00bc)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET                0x00c8
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00c8)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_IVA_OFFSET                0x00cc
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_IVA            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00cc)
-#define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET                        0x00dc
-#define OMAP4430_CM_BYPCLK_DPLL_IVA                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00dc)
-#define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET               0x00e0
-#define OMAP4430_CM_CLKMODE_DPLL_ABE                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e0)
-#define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET                        0x00e4
-#define OMAP4430_CM_IDLEST_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e4)
-#define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET              0x00e8
-#define OMAP4430_CM_AUTOIDLE_DPLL_ABE                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e8)
-#define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET                        0x00ec
-#define OMAP4430_CM_CLKSEL_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ec)
-#define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET                        0x00f0
-#define OMAP4430_CM_DIV_M2_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f0)
-#define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET                        0x00f4
-#define OMAP4430_CM_DIV_M3_DPLL_ABE                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f4)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET                0x0108
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0108)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_ABE_OFFSET                0x010c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_ABE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x010c)
-#define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET            0x0120
-#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0120)
-#define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET             0x0124
-#define OMAP4430_CM_IDLEST_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0124)
-#define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET           0x0128
-#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY               OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0128)
-#define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET             0x012c
-#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x012c)
-#define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET             0x0130
-#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0130)
-#define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET             0x0138
-#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0138)
-#define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET             0x013c
-#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x013c)
-#define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET             0x0140
-#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0140)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET     0x0148
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0148)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_DDRPHY_OFFSET     0x014c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_DDRPHY         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x014c)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET            0x0160
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG1                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0160)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET            0x0164
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG2                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0164)
-#define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET                        0x0170
-#define OMAP4430_CM_DYN_DEP_PRESCAL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0170)
-#define OMAP4_CM_RESTORE_ST_OFFSET                     0x0180
-#define OMAP4430_CM_RESTORE_ST                         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0180)
-
-/* CM1.MPU_CM1 register offsets */
-#define OMAP4_CM_MPU_CLKSTCTRL_OFFSET                  0x0000
-#define OMAP4430_CM_MPU_CLKSTCTRL                      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0000)
-#define OMAP4_CM_MPU_STATICDEP_OFFSET                  0x0004
-#define OMAP4430_CM_MPU_STATICDEP                      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0004)
-#define OMAP4_CM_MPU_DYNAMICDEP_OFFSET                 0x0008
-#define OMAP4430_CM_MPU_DYNAMICDEP                     OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0008)
-#define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET                        0x0020
-#define OMAP4430_CM_MPU_MPU_CLKCTRL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0020)
-
-/* CM1.TESLA_CM1 register offsets */
-#define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET                        0x0000
-#define OMAP4430_CM_TESLA_CLKSTCTRL                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0000)
-#define OMAP4_CM_TESLA_STATICDEP_OFFSET                        0x0004
-#define OMAP4430_CM_TESLA_STATICDEP                    OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0004)
-#define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET               0x0008
-#define OMAP4430_CM_TESLA_DYNAMICDEP                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0008)
-#define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET            0x0020
-#define OMAP4430_CM_TESLA_TESLA_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0020)
-
-/* CM1.ABE_CM1 register offsets */
-#define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET                 0x0000
-#define OMAP4430_CM1_ABE_CLKSTCTRL                     OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0000)
-#define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET             0x0020
-#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0020)
-#define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET              0x0028
-#define OMAP4430_CM1_ABE_AESS_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0028)
-#define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET               0x0030
-#define OMAP4430_CM1_ABE_PDM_CLKCTRL                   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0030)
-#define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET              0x0038
-#define OMAP4430_CM1_ABE_DMIC_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0038)
-#define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET             0x0040
-#define OMAP4430_CM1_ABE_MCASP_CLKCTRL                 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0040)
-#define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET            0x0048
-#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0048)
-#define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET            0x0050
-#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0050)
-#define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET            0x0058
-#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0058)
-#define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET           0x0060
-#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL               OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0060)
-#define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET            0x0068
-#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0068)
-#define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET            0x0070
-#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0070)
-#define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET            0x0078
-#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0078)
-#define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET            0x0080
-#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0080)
-#define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET              0x0088
-#define OMAP4430_CM1_ABE_WDT3_CLKCTRL                  OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088)
-
-/* CM1.RESTORE_CM1 register offsets */
-#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET            0x0000
-#define OMAP4430_CM_CLKSEL_CORE_RESTORE                        OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0000)
-#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET       0x0004
-#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004)
-#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET       0x0008
-#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008)
-#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET       0x000c
-#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c)
-#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET       0x0010
-#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010)
-#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET       0x0014
-#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014)
-#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET       0x0018
-#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018)
-#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET       0x001c
-#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE           OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET       0x0020
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET       0x0024
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE   OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024)
-#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET      0x0028
-#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE          OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET    0x002c
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c)
-#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET    0x0030
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE                OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030)
-#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET     0x0034
-#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE         OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034)
-#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET          0x0038
-#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE              OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038)
-#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET  0x003c
-#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE      OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c)
-#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET                0x0040
-#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE            OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040)
-
-/* CM2 */
-
-/* CM2.OCP_SOCKET_CM2 register offsets */
-#define OMAP4_REVISION_CM2_OFFSET                      0x0000
-#define OMAP4430_REVISION_CM2                          OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_MOD, 0x0000)
-#define OMAP4_CM_CM2_PROFILING_CLKCTRL_OFFSET          0x0040
-#define OMAP4430_CM_CM2_PROFILING_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_MOD, 0x0040)
-
-/* CM2.CKGEN_CM2 register offsets */
-#define OMAP4_CM_CLKSEL_DUCATI_ISS_ROOT_OFFSET         0x0000
-#define OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0000)
-#define OMAP4_CM_CLKSEL_USB_60MHZ_OFFSET               0x0004
-#define OMAP4430_CM_CLKSEL_USB_60MHZ                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0004)
-#define OMAP4_CM_SCALE_FCLK_OFFSET                     0x0008
-#define OMAP4430_CM_SCALE_FCLK                         OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0008)
-#define OMAP4_CM_CORE_DVFS_PERF1_OFFSET                        0x0010
-#define OMAP4430_CM_CORE_DVFS_PERF1                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0010)
-#define OMAP4_CM_CORE_DVFS_PERF2_OFFSET                        0x0014
-#define OMAP4430_CM_CORE_DVFS_PERF2                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0014)
-#define OMAP4_CM_CORE_DVFS_PERF3_OFFSET                        0x0018
-#define OMAP4430_CM_CORE_DVFS_PERF3                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0018)
-#define OMAP4_CM_CORE_DVFS_PERF4_OFFSET                        0x001c
-#define OMAP4430_CM_CORE_DVFS_PERF4                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x001c)
-#define OMAP4_CM_CORE_DVFS_CURRENT_OFFSET              0x0024
-#define OMAP4430_CM_CORE_DVFS_CURRENT                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0024)
-#define OMAP4_CM_IVA_DVFS_PERF_TESLA_OFFSET            0x0028
-#define OMAP4430_CM_IVA_DVFS_PERF_TESLA                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0028)
-#define OMAP4_CM_IVA_DVFS_PERF_IVAHD_OFFSET            0x002c
-#define OMAP4430_CM_IVA_DVFS_PERF_IVAHD                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x002c)
-#define OMAP4_CM_IVA_DVFS_PERF_ABE_OFFSET              0x0030
-#define OMAP4430_CM_IVA_DVFS_PERF_ABE                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0030)
-#define OMAP4_CM_IVA_DVFS_CURRENT_OFFSET               0x0038
-#define OMAP4430_CM_IVA_DVFS_CURRENT                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0038)
-#define OMAP4_CM_CLKMODE_DPLL_PER_OFFSET               0x0040
-#define OMAP4430_CM_CLKMODE_DPLL_PER                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0040)
-#define OMAP4_CM_IDLEST_DPLL_PER_OFFSET                        0x0044
-#define OMAP4430_CM_IDLEST_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0044)
-#define OMAP4_CM_AUTOIDLE_DPLL_PER_OFFSET              0x0048
-#define OMAP4430_CM_AUTOIDLE_DPLL_PER                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0048)
-#define OMAP4_CM_CLKSEL_DPLL_PER_OFFSET                        0x004c
-#define OMAP4430_CM_CLKSEL_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x004c)
-#define OMAP4_CM_DIV_M2_DPLL_PER_OFFSET                        0x0050
-#define OMAP4430_CM_DIV_M2_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0050)
-#define OMAP4_CM_DIV_M3_DPLL_PER_OFFSET                        0x0054
-#define OMAP4430_CM_DIV_M3_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0054)
-#define OMAP4_CM_DIV_M4_DPLL_PER_OFFSET                        0x0058
-#define OMAP4430_CM_DIV_M4_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0058)
-#define OMAP4_CM_DIV_M5_DPLL_PER_OFFSET                        0x005c
-#define OMAP4430_CM_DIV_M5_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x005c)
-#define OMAP4_CM_DIV_M6_DPLL_PER_OFFSET                        0x0060
-#define OMAP4430_CM_DIV_M6_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0060)
-#define OMAP4_CM_DIV_M7_DPLL_PER_OFFSET                        0x0064
-#define OMAP4430_CM_DIV_M7_DPLL_PER                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0064)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_PER_OFFSET                0x0068
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_PER            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0068)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_PER_OFFSET                0x006c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_PER            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x006c)
-#define OMAP4_CM_CLKMODE_DPLL_USB_OFFSET               0x0080
-#define OMAP4430_CM_CLKMODE_DPLL_USB                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0080)
-#define OMAP4_CM_IDLEST_DPLL_USB_OFFSET                        0x0084
-#define OMAP4430_CM_IDLEST_DPLL_USB                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0084)
-#define OMAP4_CM_AUTOIDLE_DPLL_USB_OFFSET              0x0088
-#define OMAP4430_CM_AUTOIDLE_DPLL_USB                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0088)
-#define OMAP4_CM_CLKSEL_DPLL_USB_OFFSET                        0x008c
-#define OMAP4430_CM_CLKSEL_DPLL_USB                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x008c)
-#define OMAP4_CM_DIV_M2_DPLL_USB_OFFSET                        0x0090
-#define OMAP4430_CM_DIV_M2_DPLL_USB                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0090)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_USB_OFFSET                0x00a8
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_USB            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00a8)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_USB_OFFSET                0x00ac
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_USB            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00ac)
-#define OMAP4_CM_CLKDCOLDO_DPLL_USB_OFFSET             0x00b4
-#define OMAP4430_CM_CLKDCOLDO_DPLL_USB                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00b4)
-#define OMAP4_CM_CLKMODE_DPLL_UNIPRO_OFFSET            0x00c0
-#define OMAP4430_CM_CLKMODE_DPLL_UNIPRO                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c0)
-#define OMAP4_CM_IDLEST_DPLL_UNIPRO_OFFSET             0x00c4
-#define OMAP4430_CM_IDLEST_DPLL_UNIPRO                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c4)
-#define OMAP4_CM_AUTOIDLE_DPLL_UNIPRO_OFFSET           0x00c8
-#define OMAP4430_CM_AUTOIDLE_DPLL_UNIPRO               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c8)
-#define OMAP4_CM_CLKSEL_DPLL_UNIPRO_OFFSET             0x00cc
-#define OMAP4430_CM_CLKSEL_DPLL_UNIPRO                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00cc)
-#define OMAP4_CM_DIV_M2_DPLL_UNIPRO_OFFSET             0x00d0
-#define OMAP4430_CM_DIV_M2_DPLL_UNIPRO                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00d0)
-#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_UNIPRO_OFFSET     0x00e8
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_UNIPRO         OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00e8)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_UNIPRO_OFFSET     0x00ec
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_UNIPRO         OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00ec)
-
-/* CM2.ALWAYS_ON_CM2 register offsets */
-#define OMAP4_CM_ALWON_CLKSTCTRL_OFFSET                        0x0000
-#define OMAP4430_CM_ALWON_CLKSTCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0000)
-#define OMAP4_CM_ALWON_MDMINTC_CLKCTRL_OFFSET          0x0020
-#define OMAP4430_CM_ALWON_MDMINTC_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0020)
-#define OMAP4_CM_ALWON_SR_MPU_CLKCTRL_OFFSET           0x0028
-#define OMAP4430_CM_ALWON_SR_MPU_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0028)
-#define OMAP4_CM_ALWON_SR_IVA_CLKCTRL_OFFSET           0x0030
-#define OMAP4430_CM_ALWON_SR_IVA_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0030)
-#define OMAP4_CM_ALWON_SR_CORE_CLKCTRL_OFFSET          0x0038
-#define OMAP4430_CM_ALWON_SR_CORE_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0038)
-#define OMAP4_CM_ALWON_USBPHY_CLKCTRL_OFFSET           0x0040
-#define OMAP4430_CM_ALWON_USBPHY_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0040)
-
-/* CM2.CORE_CM2 register offsets */
-#define OMAP4_CM_L3_1_CLKSTCTRL_OFFSET                 0x0000
-#define OMAP4430_CM_L3_1_CLKSTCTRL                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0000)
-#define OMAP4_CM_L3_1_DYNAMICDEP_OFFSET                        0x0008
-#define OMAP4430_CM_L3_1_DYNAMICDEP                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0008)
-#define OMAP4_CM_L3_1_L3_1_CLKCTRL_OFFSET              0x0020
-#define OMAP4430_CM_L3_1_L3_1_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0020)
-#define OMAP4_CM_L3_2_CLKSTCTRL_OFFSET                 0x0100
-#define OMAP4430_CM_L3_2_CLKSTCTRL                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0100)
-#define OMAP4_CM_L3_2_DYNAMICDEP_OFFSET                        0x0108
-#define OMAP4430_CM_L3_2_DYNAMICDEP                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0108)
-#define OMAP4_CM_L3_2_L3_2_CLKCTRL_OFFSET              0x0120
-#define OMAP4430_CM_L3_2_L3_2_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0120)
-#define OMAP4_CM_L3_2_GPMC_CLKCTRL_OFFSET              0x0128
-#define OMAP4430_CM_L3_2_GPMC_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0128)
-#define OMAP4_CM_L3_2_OCMC_RAM_CLKCTRL_OFFSET          0x0130
-#define OMAP4430_CM_L3_2_OCMC_RAM_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0130)
-#define OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET               0x0200
-#define OMAP4430_CM_DUCATI_CLKSTCTRL                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0200)
-#define OMAP4_CM_DUCATI_STATICDEP_OFFSET               0x0204
-#define OMAP4430_CM_DUCATI_STATICDEP                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0204)
-#define OMAP4_CM_DUCATI_DYNAMICDEP_OFFSET              0x0208
-#define OMAP4430_CM_DUCATI_DYNAMICDEP                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0208)
-#define OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET          0x0220
-#define OMAP4430_CM_DUCATI_DUCATI_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0220)
-#define OMAP4_CM_SDMA_CLKSTCTRL_OFFSET                 0x0300
-#define OMAP4430_CM_SDMA_CLKSTCTRL                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0300)
-#define OMAP4_CM_SDMA_STATICDEP_OFFSET                 0x0304
-#define OMAP4430_CM_SDMA_STATICDEP                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0304)
-#define OMAP4_CM_SDMA_DYNAMICDEP_OFFSET                        0x0308
-#define OMAP4430_CM_SDMA_DYNAMICDEP                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0308)
-#define OMAP4_CM_SDMA_SDMA_CLKCTRL_OFFSET              0x0320
-#define OMAP4430_CM_SDMA_SDMA_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0320)
-#define OMAP4_CM_MEMIF_CLKSTCTRL_OFFSET                        0x0400
-#define OMAP4430_CM_MEMIF_CLKSTCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0400)
-#define OMAP4_CM_MEMIF_DMM_CLKCTRL_OFFSET              0x0420
-#define OMAP4430_CM_MEMIF_DMM_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0420)
-#define OMAP4_CM_MEMIF_EMIF_FW_CLKCTRL_OFFSET          0x0428
-#define OMAP4430_CM_MEMIF_EMIF_FW_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0428)
-#define OMAP4_CM_MEMIF_EMIF_1_CLKCTRL_OFFSET           0x0430
-#define OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0430)
-#define OMAP4_CM_MEMIF_EMIF_2_CLKCTRL_OFFSET           0x0438
-#define OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0438)
-#define OMAP4_CM_MEMIF_DLL_CLKCTRL_OFFSET              0x0440
-#define OMAP4430_CM_MEMIF_DLL_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0440)
-#define OMAP4_CM_MEMIF_EMIF_H1_CLKCTRL_OFFSET          0x0450
-#define OMAP4430_CM_MEMIF_EMIF_H1_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0450)
-#define OMAP4_CM_MEMIF_EMIF_H2_CLKCTRL_OFFSET          0x0458
-#define OMAP4430_CM_MEMIF_EMIF_H2_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0458)
-#define OMAP4_CM_MEMIF_DLL_H_CLKCTRL_OFFSET            0x0460
-#define OMAP4430_CM_MEMIF_DLL_H_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0460)
-#define OMAP4_CM_D2D_CLKSTCTRL_OFFSET                  0x0500
-#define OMAP4430_CM_D2D_CLKSTCTRL                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0500)
-#define OMAP4_CM_D2D_STATICDEP_OFFSET                  0x0504
-#define OMAP4430_CM_D2D_STATICDEP                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0504)
-#define OMAP4_CM_D2D_DYNAMICDEP_OFFSET                 0x0508
-#define OMAP4430_CM_D2D_DYNAMICDEP                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0508)
-#define OMAP4_CM_D2D_SAD2D_CLKCTRL_OFFSET              0x0520
-#define OMAP4430_CM_D2D_SAD2D_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0520)
-#define OMAP4_CM_D2D_MODEM_ICR_CLKCTRL_OFFSET          0x0528
-#define OMAP4430_CM_D2D_MODEM_ICR_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0528)
-#define OMAP4_CM_D2D_SAD2D_FW_CLKCTRL_OFFSET           0x0530
-#define OMAP4430_CM_D2D_SAD2D_FW_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0530)
-#define OMAP4_CM_L4CFG_CLKSTCTRL_OFFSET                        0x0600
-#define OMAP4430_CM_L4CFG_CLKSTCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0600)
-#define OMAP4_CM_L4CFG_DYNAMICDEP_OFFSET               0x0608
-#define OMAP4430_CM_L4CFG_DYNAMICDEP                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0608)
-#define OMAP4_CM_L4CFG_L4_CFG_CLKCTRL_OFFSET           0x0620
-#define OMAP4430_CM_L4CFG_L4_CFG_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0620)
-#define OMAP4_CM_L4CFG_HW_SEM_CLKCTRL_OFFSET           0x0628
-#define OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0628)
-#define OMAP4_CM_L4CFG_MAILBOX_CLKCTRL_OFFSET          0x0630
-#define OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0630)
-#define OMAP4_CM_L4CFG_SAR_ROM_CLKCTRL_OFFSET          0x0638
-#define OMAP4430_CM_L4CFG_SAR_ROM_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0638)
-#define OMAP4_CM_L3INSTR_CLKSTCTRL_OFFSET              0x0700
-#define OMAP4430_CM_L3INSTR_CLKSTCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0700)
-#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_OFFSET           0x0720
-#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0720)
-#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_OFFSET       0x0728
-#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL           OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0728)
-#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_OFFSET                0x0740
-#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0740)
-
-/* CM2.IVAHD_CM2 register offsets */
-#define OMAP4_CM_IVAHD_CLKSTCTRL_OFFSET                        0x0000
-#define OMAP4430_CM_IVAHD_CLKSTCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0000)
-#define OMAP4_CM_IVAHD_STATICDEP_OFFSET                        0x0004
-#define OMAP4430_CM_IVAHD_STATICDEP                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0004)
-#define OMAP4_CM_IVAHD_DYNAMICDEP_OFFSET               0x0008
-#define OMAP4430_CM_IVAHD_DYNAMICDEP                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0008)
-#define OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET            0x0020
-#define OMAP4430_CM_IVAHD_IVAHD_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0020)
-#define OMAP4_CM_IVAHD_SL2_CLKCTRL_OFFSET              0x0028
-#define OMAP4430_CM_IVAHD_SL2_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0028)
-
-/* CM2.CAM_CM2 register offsets */
-#define OMAP4_CM_CAM_CLKSTCTRL_OFFSET                  0x0000
-#define OMAP4430_CM_CAM_CLKSTCTRL                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0000)
-#define OMAP4_CM_CAM_STATICDEP_OFFSET                  0x0004
-#define OMAP4430_CM_CAM_STATICDEP                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0004)
-#define OMAP4_CM_CAM_DYNAMICDEP_OFFSET                 0x0008
-#define OMAP4430_CM_CAM_DYNAMICDEP                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0008)
-#define OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET                        0x0020
-#define OMAP4430_CM_CAM_ISS_CLKCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0020)
-#define OMAP4_CM_CAM_FDIF_CLKCTRL_OFFSET               0x0028
-#define OMAP4430_CM_CAM_FDIF_CLKCTRL                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0028)
-
-/* CM2.DSS_CM2 register offsets */
-#define OMAP4_CM_DSS_CLKSTCTRL_OFFSET                  0x0000
-#define OMAP4430_CM_DSS_CLKSTCTRL                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0000)
-#define OMAP4_CM_DSS_STATICDEP_OFFSET                  0x0004
-#define OMAP4430_CM_DSS_STATICDEP                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0004)
-#define OMAP4_CM_DSS_DYNAMICDEP_OFFSET                 0x0008
-#define OMAP4430_CM_DSS_DYNAMICDEP                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0008)
-#define OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET                        0x0020
-#define OMAP4430_CM_DSS_DSS_CLKCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0020)
-#define OMAP4_CM_DSS_DEISS_CLKCTRL_OFFSET              0x0028
-#define OMAP4430_CM_DSS_DEISS_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0028)
 
-/* CM2.GFX_CM2 register offsets */
-#define OMAP4_CM_GFX_CLKSTCTRL_OFFSET                  0x0000
-#define OMAP4430_CM_GFX_CLKSTCTRL                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0000)
-#define OMAP4_CM_GFX_STATICDEP_OFFSET                  0x0004
-#define OMAP4430_CM_GFX_STATICDEP                      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0004)
-#define OMAP4_CM_GFX_DYNAMICDEP_OFFSET                 0x0008
-#define OMAP4430_CM_GFX_DYNAMICDEP                     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0008)
-#define OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET                        0x0020
-#define OMAP4430_CM_GFX_GFX_CLKCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0020)
+#include "prcm-common.h"
 
-/* CM2.L3INIT_CM2 register offsets */
-#define OMAP4_CM_L3INIT_CLKSTCTRL_OFFSET               0x0000
-#define OMAP4430_CM_L3INIT_CLKSTCTRL                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0000)
-#define OMAP4_CM_L3INIT_STATICDEP_OFFSET               0x0004
-#define OMAP4430_CM_L3INIT_STATICDEP                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0004)
-#define OMAP4_CM_L3INIT_DYNAMICDEP_OFFSET              0x0008
-#define OMAP4430_CM_L3INIT_DYNAMICDEP                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0008)
-#define OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET            0x0028
-#define OMAP4430_CM_L3INIT_MMC1_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0028)
-#define OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET            0x0030
-#define OMAP4430_CM_L3INIT_MMC2_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0030)
-#define OMAP4_CM_L3INIT_HSI_CLKCTRL_OFFSET             0x0038
-#define OMAP4430_CM_L3INIT_HSI_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0038)
-#define OMAP4_CM_L3INIT_UNIPRO1_CLKCTRL_OFFSET         0x0040
-#define OMAP4430_CM_L3INIT_UNIPRO1_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0040)
-#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET                0x0058
-#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0058)
-#define OMAP4_CM_L3INIT_USB_OTG_CLKCTRL_OFFSET         0x0060
-#define OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0060)
-#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET         0x0068
-#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0068)
-#define OMAP4_CM_L3INIT_P1500_CLKCTRL_OFFSET           0x0078
-#define OMAP4430_CM_L3INIT_P1500_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0078)
-#define OMAP4_CM_L3INIT_EMAC_CLKCTRL_OFFSET            0x0080
-#define OMAP4430_CM_L3INIT_EMAC_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0080)
-#define OMAP4_CM_L3INIT_SATA_CLKCTRL_OFFSET            0x0088
-#define OMAP4430_CM_L3INIT_SATA_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0088)
-#define OMAP4_CM_L3INIT_TPPSS_CLKCTRL_OFFSET           0x0090
-#define OMAP4430_CM_L3INIT_TPPSS_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0090)
-#define OMAP4_CM_L3INIT_PCIESS_CLKCTRL_OFFSET          0x0098
-#define OMAP4430_CM_L3INIT_PCIESS_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0098)
-#define OMAP4_CM_L3INIT_CCPTX_CLKCTRL_OFFSET           0x00a8
-#define OMAP4430_CM_L3INIT_CCPTX_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00a8)
-#define OMAP4_CM_L3INIT_XHPI_CLKCTRL_OFFSET            0x00c0
-#define OMAP4430_CM_L3INIT_XHPI_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00c0)
-#define OMAP4_CM_L3INIT_MMC6_CLKCTRL_OFFSET            0x00c8
-#define OMAP4430_CM_L3INIT_MMC6_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00c8)
-#define OMAP4_CM_L3INIT_USB_HOST_FS_CLKCTRL_OFFSET     0x00d0
-#define OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL         OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00d0)
-#define OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET   0x00e0
-#define OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL       OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00e0)
+#define OMAP4_CM_CLKSTCTRL                             0x0000
 
-/* CM2.L4PER_CM2 register offsets */
-#define OMAP4_CM_L4PER_CLKSTCTRL_OFFSET                        0x0000
-#define OMAP4430_CM_L4PER_CLKSTCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0000)
-#define OMAP4_CM_L4PER_DYNAMICDEP_OFFSET               0x0008
-#define OMAP4430_CM_L4PER_DYNAMICDEP                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0008)
-#define OMAP4_CM_L4PER_ADC_CLKCTRL_OFFSET              0x0020
-#define OMAP4430_CM_L4PER_ADC_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0020)
-#define OMAP4_CM_L4PER_DMTIMER10_CLKCTRL_OFFSET                0x0028
-#define OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0028)
-#define OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET                0x0030
-#define OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0030)
-#define OMAP4_CM_L4PER_DMTIMER2_CLKCTRL_OFFSET         0x0038
-#define OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0038)
-#define OMAP4_CM_L4PER_DMTIMER3_CLKCTRL_OFFSET         0x0040
-#define OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0040)
-#define OMAP4_CM_L4PER_DMTIMER4_CLKCTRL_OFFSET         0x0048
-#define OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0048)
-#define OMAP4_CM_L4PER_DMTIMER9_CLKCTRL_OFFSET         0x0050
-#define OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0050)
-#define OMAP4_CM_L4PER_ELM_CLKCTRL_OFFSET              0x0058
-#define OMAP4430_CM_L4PER_ELM_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0058)
-#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET            0x0060
-#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0060)
-#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET            0x0068
-#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0068)
-#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET            0x0070
-#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0070)
-#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET            0x0078
-#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0078)
-#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET            0x0080
-#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0080)
-#define OMAP4_CM_L4PER_HDQ1W_CLKCTRL_OFFSET            0x0088
-#define OMAP4430_CM_L4PER_HDQ1W_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0088)
-#define OMAP4_CM_L4PER_HECC1_CLKCTRL_OFFSET            0x0090
-#define OMAP4430_CM_L4PER_HECC1_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0090)
-#define OMAP4_CM_L4PER_HECC2_CLKCTRL_OFFSET            0x0098
-#define OMAP4430_CM_L4PER_HECC2_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0098)
-#define OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET             0x00a0
-#define OMAP4430_CM_L4PER_I2C1_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00a0)
-#define OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET             0x00a8
-#define OMAP4430_CM_L4PER_I2C2_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00a8)
-#define OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET             0x00b0
-#define OMAP4430_CM_L4PER_I2C3_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00b0)
-#define OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET             0x00b8
-#define OMAP4430_CM_L4PER_I2C4_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00b8)
-#define OMAP4_CM_L4PER_L4PER_CLKCTRL_OFFSET            0x00c0
-#define OMAP4430_CM_L4PER_L4PER_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00c0)
-#define OMAP4_CM_L4PER_MCASP2_CLKCTRL_OFFSET           0x00d0
-#define OMAP4430_CM_L4PER_MCASP2_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00d0)
-#define OMAP4_CM_L4PER_MCASP3_CLKCTRL_OFFSET           0x00d8
-#define OMAP4430_CM_L4PER_MCASP3_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00d8)
-#define OMAP4_CM_L4PER_MCBSP4_CLKCTRL_OFFSET           0x00e0
-#define OMAP4430_CM_L4PER_MCBSP4_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00e0)
-#define OMAP4_CM_L4PER_MGATE_CLKCTRL_OFFSET            0x00e8
-#define OMAP4430_CM_L4PER_MGATE_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00e8)
-#define OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET           0x00f0
-#define OMAP4430_CM_L4PER_MCSPI1_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00f0)
-#define OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET           0x00f8
-#define OMAP4430_CM_L4PER_MCSPI2_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00f8)
-#define OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET           0x0100
-#define OMAP4430_CM_L4PER_MCSPI3_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0100)
-#define OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET           0x0108
-#define OMAP4430_CM_L4PER_MCSPI4_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0108)
-#define OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET           0x0120
-#define OMAP4430_CM_L4PER_MMCSD3_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0120)
-#define OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET           0x0128
-#define OMAP4430_CM_L4PER_MMCSD4_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0128)
-#define OMAP4_CM_L4PER_MSPROHG_CLKCTRL_OFFSET          0x0130
-#define OMAP4430_CM_L4PER_MSPROHG_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0130)
-#define OMAP4_CM_L4PER_SLIMBUS2_CLKCTRL_OFFSET         0x0138
-#define OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0138)
-#define OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET            0x0140
-#define OMAP4430_CM_L4PER_UART1_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0140)
-#define OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET            0x0148
-#define OMAP4430_CM_L4PER_UART2_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0148)
-#define OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET            0x0150
-#define OMAP4430_CM_L4PER_UART3_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0150)
-#define OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET            0x0158
-#define OMAP4430_CM_L4PER_UART4_CLKCTRL                        OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0158)
-#define OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET           0x0160
-#define OMAP4430_CM_L4PER_MMCSD5_CLKCTRL               OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0160)
-#define OMAP4_CM_L4PER_I2C5_CLKCTRL_OFFSET             0x0168
-#define OMAP4430_CM_L4PER_I2C5_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0168)
-#define OMAP4_CM_L4SEC_CLKSTCTRL_OFFSET                        0x0180
-#define OMAP4430_CM_L4SEC_CLKSTCTRL                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0180)
-#define OMAP4_CM_L4SEC_STATICDEP_OFFSET                        0x0184
-#define OMAP4430_CM_L4SEC_STATICDEP                    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0184)
-#define OMAP4_CM_L4SEC_DYNAMICDEP_OFFSET               0x0188
-#define OMAP4430_CM_L4SEC_DYNAMICDEP                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0188)
-#define OMAP4_CM_L4SEC_AES1_CLKCTRL_OFFSET             0x01a0
-#define OMAP4430_CM_L4SEC_AES1_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01a0)
-#define OMAP4_CM_L4SEC_AES2_CLKCTRL_OFFSET             0x01a8
-#define OMAP4430_CM_L4SEC_AES2_CLKCTRL                 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01a8)
-#define OMAP4_CM_L4SEC_DES3DES_CLKCTRL_OFFSET          0x01b0
-#define OMAP4430_CM_L4SEC_DES3DES_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01b0)
-#define OMAP4_CM_L4SEC_PKAEIP29_CLKCTRL_OFFSET         0x01b8
-#define OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01b8)
-#define OMAP4_CM_L4SEC_RNG_CLKCTRL_OFFSET              0x01c0
-#define OMAP4430_CM_L4SEC_RNG_CLKCTRL                  OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01c0)
-#define OMAP4_CM_L4SEC_SHA2MD51_CLKCTRL_OFFSET         0x01c8
-#define OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01c8)
-#define OMAP4_CM_L4SEC_CRYPTODMA_CLKCTRL_OFFSET                0x01d8
-#define OMAP4430_CM_L4SEC_CRYPTODMA_CLKCTRL            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01d8)
+/* Function prototypes */
+# ifndef __ASSEMBLER__
 
-/* CM2.CEFUSE_CM2 register offsets */
-#define OMAP4_CM_CEFUSE_CLKSTCTRL_OFFSET               0x0000
-#define OMAP4430_CM_CEFUSE_CLKSTCTRL                   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_MOD, 0x0000)
-#define OMAP4_CM_CEFUSE_CEFUSE_CLKCTRL_OFFSET          0x0020
-#define OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_MOD, 0x0020)
+extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
 
-/* CM2.RESTORE_CM2 register offsets */
-#define OMAP4_CM_L3_1_CLKSTCTRL_RESTORE_OFFSET         0x0000
-#define OMAP4430_CM_L3_1_CLKSTCTRL_RESTORE             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0000)
-#define OMAP4_CM_L3_2_CLKSTCTRL_RESTORE_OFFSET         0x0004
-#define OMAP4430_CM_L3_2_CLKSTCTRL_RESTORE             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0004)
-#define OMAP4_CM_L4CFG_CLKSTCTRL_RESTORE_OFFSET                0x0008
-#define OMAP4430_CM_L4CFG_CLKSTCTRL_RESTORE            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0008)
-#define OMAP4_CM_MEMIF_CLKSTCTRL_RESTORE_OFFSET                0x000c
-#define OMAP4430_CM_MEMIF_CLKSTCTRL_RESTORE            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x000c)
-#define OMAP4_CM_L4PER_CLKSTCTRL_RESTORE_OFFSET                0x0010
-#define OMAP4430_CM_L4PER_CLKSTCTRL_RESTORE            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0010)
-#define OMAP4_CM_L3INIT_CLKSTCTRL_RESTORE_OFFSET       0x0014
-#define OMAP4430_CM_L3INIT_CLKSTCTRL_RESTORE           OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0014)
-#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_RESTORE_OFFSET   0x0018
-#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL_RESTORE       OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0018)
-#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE_OFFSET       0x001c
-#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE   OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x001c)
-#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE_OFFSET        0x0020
-#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0020)
-#define OMAP4_CM_CM2_PROFILING_CLKCTRL_RESTORE_OFFSET  0x0024
-#define OMAP4430_CM_CM2_PROFILING_CLKCTRL_RESTORE      OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0024)
-#define OMAP4_CM_D2D_STATICDEP_RESTORE_OFFSET          0x0028
-#define OMAP4430_CM_D2D_STATICDEP_RESTORE              OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0028)
-#define OMAP4_CM_L3_1_DYNAMICDEP_RESTORE_OFFSET                0x002c
-#define OMAP4430_CM_L3_1_DYNAMICDEP_RESTORE            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x002c)
-#define OMAP4_CM_L3_2_DYNAMICDEP_RESTORE_OFFSET                0x0030
-#define OMAP4430_CM_L3_2_DYNAMICDEP_RESTORE            OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0030)
-#define OMAP4_CM_D2D_DYNAMICDEP_RESTORE_OFFSET         0x0034
-#define OMAP4430_CM_D2D_DYNAMICDEP_RESTORE             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0034)
-#define OMAP4_CM_L4CFG_DYNAMICDEP_RESTORE_OFFSET       0x0038
-#define OMAP4430_CM_L4CFG_DYNAMICDEP_RESTORE           OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0038)
-#define OMAP4_CM_L4PER_DYNAMICDEP_RESTORE_OFFSET       0x003c
-#define OMAP4430_CM_L4PER_DYNAMICDEP_RESTORE           OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x003c)
-#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_RESTORE_OFFSET    0x0040
-#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL_RESTORE                OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0040)
-#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_RESTORE_OFFSET    0x0044
-#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL_RESTORE                OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0044)
-#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_RESTORE_OFFSET    0x0048
-#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL_RESTORE                OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0048)
-#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_RESTORE_OFFSET    0x004c
-#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL_RESTORE                OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x004c)
-#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_RESTORE_OFFSET    0x0050
-#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL_RESTORE                OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0050)
-#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE_OFFSET        0x0054
-#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE    OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0054)
-#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE_OFFSET 0x0058
-#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE     OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0058)
-#define OMAP4_CM_SDMA_STATICDEP_RESTORE_OFFSET         0x005c
-#define OMAP4430_CM_SDMA_STATICDEP_RESTORE             OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x005c)
+# endif
  #endif
arch/arm/mach-omap2/omap_hwmod.c +1 -0
index 5a30658..cafcd87 100644
@@ -146,6 +146,7 @@
 
  #include "cm.h"
  #include "prm.h"
+#include "prm44xx.h"
 
  /* Maximum microseconds to wait for OMAP module to softreset */
  #define MAX_MODULE_SOFTRESET_WAIT      10000
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +3 -1
index 7274db4..a29bd00 100644
@@ -25,7 +25,9 @@
 
  #include "omap_hwmod_common_data.h"
 
-#include "cm.h"
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
+#include "prm44xx.h"
  #include "prm-regbits-44xx.h"
 
  /* Base offset for all OMAP4 interrupts external to MPUSS */
arch/arm/mach-omap2/powerdomain.c +1 -0
index 6206721..77f42b9 100644
@@ -19,6 +19,7 @@
  #include<linux/list.h>
  #include<linux/errno.h>
  #include<linux/string.h>
+#include "prm44xx.h"
 
  #include<plat/cpu.h>
  #include<plat/powerdomain.h>
arch/arm/mach-omap2/powerdomain44xx.c +1 -1
index 366e869..7efdf68 100644
@@ -18,7 +18,7 @@
 
  #include<plat/powerdomain.h>
  #include<plat/prcm.h>
-#include "prm.h"
+#include "prm44xx.h"
  #include "prm-regbits-44xx.h"
  #include "powerdomains.h"
 
arch/arm/mach-omap2/powerdomains44xx_data.c +2 -2
index 2512f69..d078c88 100644
@@ -26,10 +26,10 @@
  #include "powerdomains.h"
 
  #include "prcm-common.h"
-#include "cm.h"
-#include "cm-regbits-44xx.h"
  #include "prm.h"
  #include "prm-regbits-44xx.h"
+#include "prm44xx.h"
+#include "prcm_mpu44xx.h"
 
  /* core_44xx_pwrdm: CORE power domain */
  static struct powerdomain core_44xx_pwrdm = {
arch/arm/mach-omap2/prcm-common.h +7 -72
index 298a22a..4979160 100644
@@ -8,15 +8,12 @@
   * Copyright (C) 2007-2009 Nokia Corporation
   *
   * Written by Paul Walmsley
- * OMAP4 defines in this file are automatically generated from the OMAP hardware
- * databases.
   *
   * 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.
   */
 
-
  /* Module offsets from both CM_BASE&  PRM_BASE */
 
  /*
@@ -51,75 +48,6 @@
  #define OMAP3430_NEON_MOD                              0xb00
  #define OMAP3430ES2_USBHOST_MOD                                0xc00
 
-#define BITS(n_bit)    \
-       (((1<<  n_bit) - 1) | (1<<  n_bit))
-
-#define BITFIELD(l_bit, u_bit) \
-       (BITS(u_bit)&  ~((BITS(l_bit))>>  1))
-
-/* OMAP44XX specific module offsets */
-
-/* CM1 instances */
-
-#define OMAP4430_CM1_OCP_SOCKET_MOD    0x0000
-#define OMAP4430_CM1_CKGEN_MOD         0x0100
-#define OMAP4430_CM1_MPU_MOD           0x0300
-#define OMAP4430_CM1_TESLA_MOD         0x0400
-#define OMAP4430_CM1_ABE_MOD           0x0500
-#define OMAP4430_CM1_RESTORE_MOD       0x0e00
-#define OMAP4430_CM1_INSTR_MOD         0x0f00
-
-/* CM2 instances */
-
-#define OMAP4430_CM2_OCP_SOCKET_MOD    0x0000
-#define OMAP4430_CM2_CKGEN_MOD         0x0100
-#define OMAP4430_CM2_ALWAYS_ON_MOD     0x0600
-#define OMAP4430_CM2_CORE_MOD          0x0700
-#define OMAP4430_CM2_IVAHD_MOD         0x0f00
-#define OMAP4430_CM2_CAM_MOD           0x1000
-#define OMAP4430_CM2_DSS_MOD           0x1100
-#define OMAP4430_CM2_GFX_MOD           0x1200
-#define OMAP4430_CM2_L3INIT_MOD                0x1300
-#define OMAP4430_CM2_L4PER_MOD         0x1400
-#define OMAP4430_CM2_CEFUSE_MOD                0x1600
-#define OMAP4430_CM2_RESTORE_MOD       0x1e00
-#define OMAP4430_CM2_INSTR_MOD         0x1f00
-
-/* PRM instances */
-
-#define OMAP4430_PRM_OCP_SOCKET_MOD    0x0000
-#define OMAP4430_PRM_CKGEN_MOD         0x0100
-#define OMAP4430_PRM_MPU_MOD           0x0300
-#define OMAP4430_PRM_TESLA_MOD         0x0400
-#define OMAP4430_PRM_ABE_MOD           0x0500
-#define OMAP4430_PRM_ALWAYS_ON_MOD     0x0600
-#define OMAP4430_PRM_CORE_MOD          0x0700
-#define OMAP4430_PRM_IVAHD_MOD         0x0f00
-#define OMAP4430_PRM_CAM_MOD           0x1000
-#define OMAP4430_PRM_DSS_MOD           0x1100
-#define OMAP4430_PRM_GFX_MOD           0x1200
-#define OMAP4430_PRM_L3INIT_MOD                0x1300
-#define OMAP4430_PRM_L4PER_MOD         0x1400
-#define OMAP4430_PRM_CEFUSE_MOD                0x1600
-#define OMAP4430_PRM_WKUP_MOD          0x1700
-#define OMAP4430_PRM_WKUP_CM_MOD       0x1800
-#define OMAP4430_PRM_EMU_MOD           0x1900
-#define OMAP4430_PRM_EMU_CM_MOD                0x1a00
-#define OMAP4430_PRM_DEVICE_MOD                0x1b00
-#define OMAP4430_PRM_INSTR_MOD         0x1f00
-
-/* SCRM instances */
-
-#define OMAP4430_SCRM_SCRM_MOD 0x0000
-
-/* PRCM_MPU instances */
-
-#define OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD  0x0000
-#define OMAP4430_PRCM_MPU_DEVICE_PRM_MOD       0x0200
-#define OMAP4430_PRCM_MPU_CPU0_MOD             0x0400
-#define OMAP4430_PRCM_MPU_CPU1_MOD             0x0800
-
-
  /* 24XX register bits shared between CM&  PRM registers */
 
  /* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
@@ -460,5 +388,12 @@
  #define OMAP3430_EN_CORE_SHIFT                         0
  #define OMAP3430_EN_CORE_MASK                          (1<<  0)
 
+
+/*
+ * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
+ * submodule to exit hardreset
+ */
+#define MAX_MODULE_HARDRESET_WAIT              10000
+
  #endif
 
arch/arm/mach-omap2/prcm.c +1 -0
index d27cdba..df55fdf 100644
@@ -31,6 +31,7 @@
  #include "clock2xxx.h"
  #include "cm.h"
  #include "prm.h"
+#include "prm44xx.h"
  #include "prm-regbits-24xx.h"
  #include "prm-regbits-44xx.h"
  #include "control.h"
arch/arm/mach-omap2/prcm_mpu44xx.h new file +91 -0
new file mode 100644
index 0000000..5b828df
@@ -0,0 +1,91 @@
+/*
+ * OMAP44xx PRCM MPU instance offset macros
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Copyright (C) 2010 Nokia Corporation
+ *
+ * Paul Walmsley (paul at pwsan.com)
+ * Rajendra Nayak (rnayak at ti.com)
+ * Benoit Cousson (b-cousson at 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 at 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.
+ *
+ * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
+ *     or "OMAP4430".
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
+#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
+
+#define OMAP4430_PRCM_MPU_BASE                 0x48243000
+
+#define OMAP44XX_PRCM_MPU_REGADDR(module, reg)                         \
+       OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE + (module) + (reg))
+
+/* PRCM_MPU instances */
+
+#define OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD  0x0000
+#define OMAP4430_PRCM_MPU_DEVICE_PRM_MOD       0x0200
+#define OMAP4430_PRCM_MPU_CPU0_MOD             0x0400
+#define OMAP4430_PRCM_MPU_CPU1_MOD             0x0800
+
+/*
+ * PRCM_MPU
+ *
+ * The PRCM_MPU is a local PRCM inside the MPU subsystem. For the PRCM (global)
+ * point of view the PRCM_MPU is a single entity. It shares the same
+ * programming model as the global PRCM and thus can be assimilate as two new
+ * MOD inside the PRCM
+ */
+
+/* PRCM_MPU.OCP_SOCKET_PRCM register offsets */
+#define OMAP4_REVISION_PRCM_OFFSET                     0x0000
+#define OMAP4430_REVISION_PRCM                         OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD, 0x0000)
+
+/* PRCM_MPU.DEVICE_PRM register offsets */
+#define OMAP4_PRCM_MPU_PRM_RSTST_OFFSET                        0x0000
+#define OMAP4430_PRCM_MPU_PRM_RSTST                    OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0000)
+#define OMAP4_PRCM_MPU_PRM_PSCON_COUNT_OFFSET          0x0004
+#define OMAP4430_PRCM_MPU_PRM_PSCON_COUNT              OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0004)
+
+/* PRCM_MPU.CPU0 register offsets */
+#define OMAP4_PM_CPU0_PWRSTCTRL_OFFSET                 0x0000
+#define OMAP4430_PM_CPU0_PWRSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0000)
+#define OMAP4_PM_CPU0_PWRSTST_OFFSET                   0x0004
+#define OMAP4430_PM_CPU0_PWRSTST                       OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0004)
+#define OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET              0x0008
+#define OMAP4430_RM_CPU0_CPU0_CONTEXT                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0008)
+#define OMAP4_RM_CPU0_CPU0_RSTCTRL_OFFSET              0x000c
+#define OMAP4430_RM_CPU0_CPU0_RSTCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x000c)
+#define OMAP4_RM_CPU0_CPU0_RSTST_OFFSET                        0x0010
+#define OMAP4430_RM_CPU0_CPU0_RSTST                    OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0010)
+#define OMAP4_CM_CPU0_CPU0_CLKCTRL_OFFSET              0x0014
+#define OMAP4430_CM_CPU0_CPU0_CLKCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0014)
+#define OMAP4_CM_CPU0_CLKSTCTRL_OFFSET                 0x0018
+#define OMAP4430_CM_CPU0_CLKSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0018)
+
+/* PRCM_MPU.CPU1 register offsets */
+#define OMAP4_PM_CPU1_PWRSTCTRL_OFFSET                 0x0000
+#define OMAP4430_PM_CPU1_PWRSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0000)
+#define OMAP4_PM_CPU1_PWRSTST_OFFSET                   0x0004
+#define OMAP4430_PM_CPU1_PWRSTST                       OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0004)
+#define OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET              0x0008
+#define OMAP4430_RM_CPU1_CPU1_CONTEXT                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0008)
+#define OMAP4_RM_CPU1_CPU1_RSTCTRL_OFFSET              0x000c
+#define OMAP4430_RM_CPU1_CPU1_RSTCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x000c)
+#define OMAP4_RM_CPU1_CPU1_RSTST_OFFSET                        0x0010
+#define OMAP4430_RM_CPU1_CPU1_RSTST                    OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0010)
+#define OMAP4_CM_CPU1_CPU1_CLKCTRL_OFFSET              0x0014
+#define OMAP4430_CM_CPU1_CPU1_CLKCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0014)
+#define OMAP4_CM_CPU1_CLKSTCTRL_OFFSET                 0x0018
+#define OMAP4430_CM_CPU1_CLKSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0018)
+
+#endif
arch/arm/mach-omap2/prm.h +0 -17
index 7be040b..10a24ca 100644
@@ -22,12 +22,6 @@
                 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
  #define OMAP34XX_PRM_REGADDR(module, reg)                              \
                 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
-#define OMAP44XX_PRM_REGADDR(module, reg)                              \
-               OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (module) + (reg))
-#define OMAP44XX_PRCM_MPU_REGADDR(module, reg)                         \
-               OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE + (module) + (reg))
-
-#include "prm44xx.h"
 
  /*
   * Architecture-specific global PRM registers
@@ -220,13 +214,6 @@
  #define OMAP3430_PRM_IRQSTATUS_IVA2                    0x00f8
  #define OMAP3430_PRM_IRQENABLE_IVA2                    0x00fc
 
-/* Omap4 specific registers */
-#define OMAP4_RM_RSTCTRL                               0x0000
-#define OMAP4_RM_RSTTIME                               0x0004
-#define OMAP4_RM_RSTST                                 0x0008
-#define OMAP4_PM_PWSTCTRL                              0x0000
-#define OMAP4_PM_PWSTST                                        0x0004
-
 
  #ifndef __ASSEMBLER__
 
@@ -251,10 +238,6 @@ int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
  int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
  int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift);
 
-int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift);
-int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift);
-int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
-
  #endif
 
  /*
arch/arm/mach-omap2/prm44xx.c +1 -1
index a1ff918..697b58f 100644
@@ -20,7 +20,7 @@
  #include<plat/cpu.h>
  #include<plat/prcm.h>
 
-#include "prm.h"
+#include "prm44xx.h"
  #include "prm-regbits-44xx.h"
 
  /*
arch/arm/mach-omap2/prm44xx.h +58 -49
index 59839db..4343881 100644
@@ -17,11 +17,52 @@
   * 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 file needs to be updated to align on one of "OMAP4", "OMAP44XX",
+ *     or "OMAP4430".
   */
 
  #ifndef __ARCH_ARM_MACH_OMAP2_PRM44XX_H
  #define __ARCH_ARM_MACH_OMAP2_PRM44XX_H
 
+#include "prcm-common.h"
+
+#define OMAP4430_PRM_BASE              0x4a306000
+
+#define OMAP44XX_PRM_REGADDR(module, reg)                              \
+       OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (module) + (reg))
+
+
+/* PRM instances */
+#define OMAP4430_PRM_OCP_SOCKET_MOD    0x0000
+#define OMAP4430_PRM_CKGEN_MOD         0x0100
+#define OMAP4430_PRM_MPU_MOD           0x0300
+#define OMAP4430_PRM_TESLA_MOD         0x0400
+#define OMAP4430_PRM_ABE_MOD           0x0500
+#define OMAP4430_PRM_ALWAYS_ON_MOD     0x0600
+#define OMAP4430_PRM_CORE_MOD          0x0700
+#define OMAP4430_PRM_IVAHD_MOD         0x0f00
+#define OMAP4430_PRM_CAM_MOD           0x1000
+#define OMAP4430_PRM_DSS_MOD           0x1100
+#define OMAP4430_PRM_GFX_MOD           0x1200
+#define OMAP4430_PRM_L3INIT_MOD                0x1300
+#define OMAP4430_PRM_L4PER_MOD         0x1400
+#define OMAP4430_PRM_CEFUSE_MOD                0x1600
+#define OMAP4430_PRM_WKUP_MOD          0x1700
+#define OMAP4430_PRM_WKUP_CM_MOD       0x1800
+#define OMAP4430_PRM_EMU_MOD           0x1900
+#define OMAP4430_PRM_EMU_CM_MOD                0x1a00
+#define OMAP4430_PRM_DEVICE_MOD                0x1b00
+#define OMAP4430_PRM_INSTR_MOD         0x1f00
+
+
+/* OMAP4 specific register offsets */
+#define OMAP4_RM_RSTCTRL                               0x0000
+#define OMAP4_RM_RSTTIME                               0x0004
+#define OMAP4_RM_RSTST                                 0x0008
+#define OMAP4_PM_PWSTCTRL                              0x0000
+#define OMAP4_PM_PWSTST                                        0x0004
+
 
  /* PRM */
 
@@ -699,54 +740,22 @@
  #define OMAP4_PRM_VC_ERRST_OFFSET                      0x00f8
  #define OMAP4430_PRM_VC_ERRST                          OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00f8)
 
-/*
- * PRCM_MPU
- *
- * The PRCM_MPU is a local PRCM inside the MPU subsystem. For the PRCM (global)
- * point of view the PRCM_MPU is a single entity. It shares the same
- * programming model as the global PRCM and thus can be assimilate as two new
- * MOD inside the PRCM
- */
+/* Function prototypes */
+# ifndef __ASSEMBLER__
+
+extern u32 omap4_prm_read_mod_reg(s16 module, u16 idx);
+extern void omap4_prm_write_mod_reg(u32 val, s16 module, u16 idx);
+extern u32 omap4_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
+extern u32 omap4_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
+extern u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
+extern u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
+extern u32 omap4_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx);
+extern u32 omap4_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx);
+
+extern int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift);
+extern int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift);
+extern int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
+
+# endif
 
-/* PRCM_MPU.OCP_SOCKET_PRCM register offsets */
-#define OMAP4_REVISION_PRCM_OFFSET                     0x0000
-#define OMAP4430_REVISION_PRCM                         OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD, 0x0000)
-
-/* PRCM_MPU.DEVICE_PRM register offsets */
-#define OMAP4_PRCM_MPU_PRM_RSTST_OFFSET                        0x0000
-#define OMAP4430_PRCM_MPU_PRM_RSTST                    OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0000)
-#define OMAP4_PRCM_MPU_PRM_PSCON_COUNT_OFFSET          0x0004
-#define OMAP4430_PRCM_MPU_PRM_PSCON_COUNT              OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0004)
-
-/* PRCM_MPU.CPU0 register offsets */
-#define OMAP4_PM_CPU0_PWRSTCTRL_OFFSET                 0x0000
-#define OMAP4430_PM_CPU0_PWRSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0000)
-#define OMAP4_PM_CPU0_PWRSTST_OFFSET                   0x0004
-#define OMAP4430_PM_CPU0_PWRSTST                       OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0004)
-#define OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET              0x0008
-#define OMAP4430_RM_CPU0_CPU0_CONTEXT                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0008)
-#define OMAP4_RM_CPU0_CPU0_RSTCTRL_OFFSET              0x000c
-#define OMAP4430_RM_CPU0_CPU0_RSTCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x000c)
-#define OMAP4_RM_CPU0_CPU0_RSTST_OFFSET                        0x0010
-#define OMAP4430_RM_CPU0_CPU0_RSTST                    OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0010)
-#define OMAP4_CM_CPU0_CPU0_CLKCTRL_OFFSET              0x0014
-#define OMAP4430_CM_CPU0_CPU0_CLKCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0014)
-#define OMAP4_CM_CPU0_CLKSTCTRL_OFFSET                 0x0018
-#define OMAP4430_CM_CPU0_CLKSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0018)
-
-/* PRCM_MPU.CPU1 register offsets */
-#define OMAP4_PM_CPU1_PWRSTCTRL_OFFSET                 0x0000
-#define OMAP4430_PM_CPU1_PWRSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0000)
-#define OMAP4_PM_CPU1_PWRSTST_OFFSET                   0x0004
-#define OMAP4430_PM_CPU1_PWRSTST                       OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0004)
-#define OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET              0x0008
-#define OMAP4430_RM_CPU1_CPU1_CONTEXT                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0008)
-#define OMAP4_RM_CPU1_CPU1_RSTCTRL_OFFSET              0x000c
-#define OMAP4430_RM_CPU1_CPU1_RSTCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x000c)
-#define OMAP4_RM_CPU1_CPU1_RSTST_OFFSET                        0x0010
-#define OMAP4430_RM_CPU1_CPU1_RSTST                    OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0010)
-#define OMAP4_CM_CPU1_CPU1_CLKCTRL_OFFSET              0x0014
-#define OMAP4430_CM_CPU1_CPU1_CLKCTRL                  OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0014)
-#define OMAP4_CM_CPU1_CLKSTCTRL_OFFSET                 0x0018
-#define OMAP4430_CM_CPU1_CLKSTCTRL                     OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0018)
  #endif
arch/arm/mach-omap2/scrm44xx.h new file +32 -0
new file mode 100644
index 0000000..53ea8e8
@@ -0,0 +1,32 @@
+/*
+ * OMAP44xx SCRM instance offset macros
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Copyright (C) 2010 Nokia Corporation
+ *
+ * Paul Walmsley (paul at pwsan.com)
+ * Rajendra Nayak (rnayak at ti.com)
+ * Benoit Cousson (b-cousson at 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 at 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.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_SCRM44XX_H
+#define __ARCH_ARM_MACH_OMAP2_SCRM44XX_H
+
+#define OMAP4430_SCRM_BASE             0x4a30a000
+
+/* SCRM instances */
+#define OMAP4430_SCRM_SCRM_MOD         0x0000
+
+/* XXX SCRM registers should go here */
+
+#endif
author maintainer
#13 lore raw

PATCH 11/14 OMAP4: PRCM: reorganize existing OMAP4 PRCM header files

Salut Beno?t,

Quoted 7 lines · Benoit

Salut Paul,

Quoted 4 lines · Paul Walmsley

Split the existing cm44xx.h file into cm1_44xx.h and cm2_44xx.h files so they match their underlying OMAP hardware modules. Add clockdomain offset information.

Quoted 5 lines
Quoted 3 lines

Add header files for the MPU local PRCM, prcm_mpu44xx.h, and for the SCRM, scrm44xx.h. SCRM register offsets still need to be added; TI should do this.

And we did it :-)

Even better :-)

Quoted 7 lines

I sent it last week along with clock data series:
https://patchwork.kernel.org/patch/373751/

OK, I've just realized that it was a little bit hidden in the clock data patch, and maybe we should have been sent two patches.
Sorry for that. Do you want to take it in that series, or should I re-sent the clock data one?

I guess it's better done in the clock series; that should avoid a branch dependency between the PRCM patchsets and the clock patch sets.

One thing that would be nice on the scrm44xx.h file is to keep the _OFFSET macros. It would be nice in the long run to get rid of the absolute addressing macros in case someone decides to shuffle around the IP block addresses again... can you update your clock series with that change? Getting the clock patchsets put together for 2.6.38 is one of the next big projects here.

- Paul

#14 lore raw

PATCH 11/14 OMAP4: PRCM: reorganize existing OMAP4 PRCM header files

Salut Paul,

Quoted 27 lines · Paul Walmsley

Salut Beno?t,

Quoted 7 lines · Benoit

Salut Paul,

Quoted 4 lines · Paul Walmsley

Split the existing cm44xx.h file into cm1_44xx.h and cm2_44xx.h files so they match their underlying OMAP hardware modules. Add clockdomain offset information.

Quoted 5 lines
Quoted 3 lines

Add header files for the MPU local PRCM, prcm_mpu44xx.h, and for the SCRM, scrm44xx.h. SCRM register offsets still need to be added; TI should do this.

And we did it :-)

Even better :-)

Quoted 7 lines

I sent it last week along with clock data series:
https://patchwork.kernel.org/patch/373751/

OK, I've just realized that it was a little bit hidden in the clock data patch, and maybe we should have been sent two patches.
Sorry for that. Do you want to take it in that series, or should I re-sent the clock data one?

Quoted 7 lines

I guess it's better done in the clock series; that should avoid a branch dependency between the PRCM patchsets and the clock patch sets.

One thing that would be nice on the scrm44xx.h file is to keep the _OFFSET macros. It would be nice in the long run to get rid of the absolute addressing macros in case someone decides to shuffle around the IP block addresses again... can you update your clock series with that change?

OK, this is done. I've just posted it.

Regards,
Benoit

#15 lore raw

PATCH 11/14 OMAP4: PRCM: reorganize existing OMAP4 PRCM header files

In reply to Paul Walmsley

On 12/7/2010 2:25 AM, Paul Walmsley wrote:

[...]

Quoted 3 lines

+ *
+ * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
+ * or "OMAP4430".

Yep, I was thinking to change that as well. My first thought was OMAP4 to get a shorter name, but when we will introduce OMAP4440, we might have some new entries, that will looks ugly close to OMAP4. So at the end I will prefer OMAP44XX for the moment and we might renamed to OMAP4430 or OMAP4440 for the entries that will diverge.

Do you want to change that for 2.6.38?
It will require some sync with the various users of these defines, but that should be doable.

Regards,
Benoit

author maintainer
#16 lore raw

PATCH 11/14 OMAP4: PRCM: reorganize existing OMAP4 PRCM header files

Quoted 15 lines · Benoit

On 12/7/2010 2:25 AM, Paul Walmsley wrote:

[...]

Quoted 4 lines

+ *
+ * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
+ * or "OMAP4430".

Yep, I was thinking to change that as well. My first thought was OMAP4 to get a shorter name, but when we will introduce OMAP4440, we might have some new entries, that will looks ugly close to OMAP4.
So at the end I will prefer OMAP44XX for the moment and we might renamed to OMAP4430 or OMAP4440 for the entries that will diverge.

Quoted 3 lines

Do you want to change that for 2.6.38?
It will require some sync with the various users of these defines, but that should be doable.

I don't mind waiting until after 2.6.38, I think we'll have a pretty huge pile of patches on our hands to merge already for .38... maybe Tony or Kevin have some opinions though.

- Paul

#17 lore raw

PATCH 11/14 OMAP4: PRCM: reorganize existing OMAP4 PRCM header files

Quoted 17 lines · Paul Walmsley
Quoted 15 lines · Benoit

On 12/7/2010 2:25 AM, Paul Walmsley wrote:

[...]

Quoted 4 lines

+ *
+ * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
+ * or "OMAP4430".

Yep, I was thinking to change that as well. My first thought was OMAP4 to get a shorter name, but when we will introduce OMAP4440, we might have some new entries, that will looks ugly close to OMAP4.
So at the end I will prefer OMAP44XX for the moment and we might renamed to OMAP4430 or OMAP4440 for the entries that will diverge.

Quoted 7 lines
Quoted 3 lines

Do you want to change that for 2.6.38?
It will require some sync with the various users of these defines, but that should be doable.

I don't mind waiting until after 2.6.38, I think we'll have a pretty huge pile of patches on our hands to merge already for .38... maybe Tony or Kevin have some opinions though.

I think this should wait 'til after 2.6.38, but be early in the next cycle so all dependencies can be handled early.

Kevin

author maintainer
#18 lore raw

PATCH 12/14 OMAP4: PRCM: rename _MOD macros to _INST

In reply to Paul Walmsley

Back in the OMAP2/3 PRCM interface days, the macros that referred to the offsets of individual PRM/CM instances from the top of the PRM/CM hardware modules were incorrectly suffixed with "_MOD". (They should have been suffixed with something like "_INST" or "_INSTANCE".) These days, now that we have better contact with the OMAP hardware people, we know that this naming is wrong. And in fact in OMAP4, there are actual hardware module offsets inside the instances, so the incorrect naming gets confusing very quickly for anyone who knows the hardware.

Fix this naming for OMAP4, before things get too far along, by changing "_MOD" to "_INST" on the end of these macros. So, for example, OMAP4430_CM2_INSTR_MOD becomes OMAP4430_CM2_INSTR_INST.

This unfortunately creates quite a large diff, but it is a straightforward rename. This patch should not result in any functional changes.

The autogeneration scripts have been updated accordingly.

Cc Beno?t Cousson <[email protected]>
Cc Rajendra Nayak <[email protected]>
Cc Santosh Shilimkar <[email protected]>
---
 arch/arm/mach-omap2/cm1_44xx.h              |  229 ++++-----
 arch/arm/mach-omap2/cm2_44xx.h              |  446 +++++++++--------
 arch/arm/mach-omap2/powerdomains44xx_data.c |   32 +
 arch/arm/mach-omap2/prcm.c                  |    2 
 arch/arm/mach-omap2/prcm_mpu44xx.h          |   46 +-
 arch/arm/mach-omap2/prm44xx.h               |  693 +++++++++++++--------------
 6 files changed, 718 insertions(+), 730 deletions(-)
arch/arm/mach-omap2/cm1_44xx.h +112 -117
index f3bba21..aa2ee78 100644
@@ -28,229 +28,224 @@
 /* CM1 base address */
 #define OMAP4430_CM1_BASE		0x4a004000
 
-#define OMAP44XX_CM1_REGADDR(module, reg)				\
-	OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (module) + (reg))
+#define OMAP44XX_CM1_REGADDR(inst, reg)				\
+	OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (inst) + (reg))
 
 /* CM1 instances */
-#define OMAP4430_CM1_OCP_SOCKET_MOD	0x0000
-#define OMAP4430_CM1_CKGEN_MOD		0x0100
-#define OMAP4430_CM1_MPU_MOD		0x0300
-#define OMAP4430_CM1_TESLA_MOD		0x0400
-#define OMAP4430_CM1_ABE_MOD		0x0500
-#define OMAP4430_CM1_RESTORE_MOD	0x0e00
-#define OMAP4430_CM1_INSTR_MOD		0x0f00
+#define OMAP4430_CM1_OCP_SOCKET_INST	0x0000
+#define OMAP4430_CM1_CKGEN_INST		0x0100
+#define OMAP4430_CM1_MPU_INST		0x0300
+#define OMAP4430_CM1_TESLA_INST		0x0400
+#define OMAP4430_CM1_ABE_INST		0x0500
+#define OMAP4430_CM1_RESTORE_INST	0x0e00
+#define OMAP4430_CM1_INSTR_INST		0x0f00
 
 /* CM1 */
 
 /* CM1.OCP_SOCKET_CM1 register offsets */
 #define OMAP4_REVISION_CM1_OFFSET			0x0000
-#define OMAP4430_REVISION_CM1				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0000)
+#define OMAP4430_REVISION_CM1				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_INST, 0x0000)
 #define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET		0x0040
-#define OMAP4430_CM_CM1_PROFILING_CLKCTRL		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0040)
+#define OMAP4430_CM_CM1_PROFILING_CLKCTRL		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_INST, 0x0040)
 
 /* CM1.CKGEN_CM1 register offsets */
 #define OMAP4_CM_CLKSEL_CORE_OFFSET			0x0000
-#define OMAP4430_CM_CLKSEL_CORE				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0000)
+#define OMAP4430_CM_CLKSEL_CORE				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0000)
 #define OMAP4_CM_CLKSEL_ABE_OFFSET			0x0008
-#define OMAP4430_CM_CLKSEL_ABE				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0008)
+#define OMAP4430_CM_CLKSEL_ABE				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0008)
 #define OMAP4_CM_DLL_CTRL_OFFSET			0x0010
-#define OMAP4430_CM_DLL_CTRL				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0010)
+#define OMAP4430_CM_DLL_CTRL				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0010)
 #define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET		0x0020
-#define OMAP4430_CM_CLKMODE_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0020)
+#define OMAP4430_CM_CLKMODE_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0020)
 #define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET		0x0024
-#define OMAP4430_CM_IDLEST_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0024)
+#define OMAP4430_CM_IDLEST_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0024)
 #define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET		0x0028
-#define OMAP4430_CM_AUTOIDLE_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0028)
+#define OMAP4430_CM_AUTOIDLE_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0028)
 #define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET		0x002c
-#define OMAP4430_CM_CLKSEL_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x002c)
+#define OMAP4430_CM_CLKSEL_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x002c)
 #define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET		0x0030
-#define OMAP4430_CM_DIV_M2_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0030)
+#define OMAP4430_CM_DIV_M2_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0030)
 #define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET		0x0034
-#define OMAP4430_CM_DIV_M3_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0034)
+#define OMAP4430_CM_DIV_M3_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0034)
 #define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET		0x0038
-#define OMAP4430_CM_DIV_M4_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0038)
+#define OMAP4430_CM_DIV_M4_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0038)
 #define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET		0x003c
-#define OMAP4430_CM_DIV_M5_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x003c)
+#define OMAP4430_CM_DIV_M5_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x003c)
 #define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET		0x0040
-#define OMAP4430_CM_DIV_M6_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0040)
+#define OMAP4430_CM_DIV_M6_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0040)
 #define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET		0x0044
-#define OMAP4430_CM_DIV_M7_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0044)
+#define OMAP4430_CM_DIV_M7_DPLL_CORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0044)
 #define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET	0x0048
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0048)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_OFFSET	0x004c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x004c)
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0048)
+#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_CORE_OFFSET	0x004c
+#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_CORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x004c)
 #define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET		0x0050
-#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0050)
+#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0050)
 #define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET		0x0060
-#define OMAP4430_CM_CLKMODE_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0060)
+#define OMAP4430_CM_CLKMODE_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0060)
 #define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET			0x0064
-#define OMAP4430_CM_IDLEST_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0064)
+#define OMAP4430_CM_IDLEST_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0064)
 #define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET		0x0068
-#define OMAP4430_CM_AUTOIDLE_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0068)
+#define OMAP4430_CM_AUTOIDLE_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0068)
 #define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET			0x006c
-#define OMAP4430_CM_CLKSEL_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x006c)
+#define OMAP4430_CM_CLKSEL_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x006c)
 #define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET			0x0070
-#define OMAP4430_CM_DIV_M2_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0070)
+#define OMAP4430_CM_DIV_M2_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0070)
 #define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET		0x0088
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0088)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_MPU_OFFSET		0x008c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_MPU		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x008c)
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0088)
+#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_MPU_OFFSET		0x008c
+#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_MPU		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x008c)
 #define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET			0x009c
-#define OMAP4430_CM_BYPCLK_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x009c)
+#define OMAP4430_CM_BYPCLK_DPLL_MPU			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x009c)
 #define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET		0x00a0
-#define OMAP4430_CM_CLKMODE_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a0)
+#define OMAP4430_CM_CLKMODE_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a0)
 #define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET			0x00a4
-#define OMAP4430_CM_IDLEST_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a4)
+#define OMAP4430_CM_IDLEST_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a4)
 #define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET		0x00a8
-#define OMAP4430_CM_AUTOIDLE_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a8)
+#define OMAP4430_CM_AUTOIDLE_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a8)
 #define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET			0x00ac
-#define OMAP4430_CM_CLKSEL_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ac)
+#define OMAP4430_CM_CLKSEL_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00ac)
 #define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET			0x00b8
-#define OMAP4430_CM_DIV_M4_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00b8)
+#define OMAP4430_CM_DIV_M4_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00b8)
 #define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET			0x00bc
-#define OMAP4430_CM_DIV_M5_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00bc)
+#define OMAP4430_CM_DIV_M5_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00bc)
 #define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET		0x00c8
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00c8)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_IVA_OFFSET		0x00cc
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_IVA		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00cc)
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00c8)
+#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_IVA_OFFSET		0x00cc
+#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_IVA		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00cc)
 #define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET			0x00dc
-#define OMAP4430_CM_BYPCLK_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00dc)
+#define OMAP4430_CM_BYPCLK_DPLL_IVA			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00dc)
 #define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET		0x00e0
-#define OMAP4430_CM_CLKMODE_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e0)
+#define OMAP4430_CM_CLKMODE_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e0)
 #define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET			0x00e4
-#define OMAP4430_CM_IDLEST_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e4)
+#define OMAP4430_CM_IDLEST_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e4)
 #define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET		0x00e8
-#define OMAP4430_CM_AUTOIDLE_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e8)
+#define OMAP4430_CM_AUTOIDLE_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e8)
 #define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET			0x00ec
-#define OMAP4430_CM_CLKSEL_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ec)
+#define OMAP4430_CM_CLKSEL_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00ec)
 #define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET			0x00f0
-#define OMAP4430_CM_DIV_M2_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f0)
+#define OMAP4430_CM_DIV_M2_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00f0)
 #define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET			0x00f4
-#define OMAP4430_CM_DIV_M3_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f4)
+#define OMAP4430_CM_DIV_M3_DPLL_ABE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00f4)
 #define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET		0x0108
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0108)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_ABE_OFFSET		0x010c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_ABE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x010c)
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0108)
+#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_ABE_OFFSET		0x010c
+#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_ABE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x010c)
 #define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET		0x0120
-#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0120)
+#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0120)
 #define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET		0x0124
-#define OMAP4430_CM_IDLEST_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0124)
+#define OMAP4430_CM_IDLEST_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0124)
 #define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET		0x0128
-#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0128)
+#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0128)
 #define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET		0x012c
-#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x012c)
+#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x012c)
 #define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET		0x0130
-#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0130)
+#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0130)
 #define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET		0x0138
-#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0138)
+#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0138)
 #define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET		0x013c
-#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x013c)
+#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x013c)
 #define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET		0x0140
-#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0140)
+#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0140)
 #define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET	0x0148
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0148)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_DDRPHY_OFFSET	0x014c
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_DDRPHY		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x014c)
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0148)
+#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_DDRPHY_OFFSET	0x014c
+#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_DDRPHY		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x014c)
 #define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET		0x0160
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG1			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0160)
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG1			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0160)
 #define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET		0x0164
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG2			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0164)
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG2			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0164)
 #define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET			0x0170
-#define OMAP4430_CM_DYN_DEP_PRESCAL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0170)
+#define OMAP4430_CM_DYN_DEP_PRESCAL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0170)
 #define OMAP4_CM_RESTORE_ST_OFFSET			0x0180
-#define OMAP4430_CM_RESTORE_ST				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0180)
+#define OMAP4430_CM_RESTORE_ST				OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0180)
 
 /* CM1.MPU_CM1 register offsets */
 #define OMAP4_CM_MPU_CLKSTCTRL_OFFSET			0x0000
-#define OMAP4430_CM_MPU_CLKSTCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0000)
+#define OMAP4430_CM_MPU_CLKSTCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0000)
 #define OMAP4_CM_MPU_STATICDEP_OFFSET			0x0004
-#define OMAP4430_CM_MPU_STATICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0004)
+#define OMAP4430_CM_MPU_STATICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0004)
 #define OMAP4_CM_MPU_DYNAMICDEP_OFFSET			0x0008
-#define OMAP4430_CM_MPU_DYNAMICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0008)
+#define OMAP4430_CM_MPU_DYNAMICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0008)
 #define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET			0x0020
-#define OMAP4430_CM_MPU_MPU_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0020)
+#define OMAP4430_CM_MPU_MPU_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0020)
 
 /* CM1.TESLA_CM1 register offsets */
 #define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET			0x0000
-#define OMAP4430_CM_TESLA_CLKSTCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0000)
+#define OMAP4430_CM_TESLA_CLKSTCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0000)
 #define OMAP4_CM_TESLA_STATICDEP_OFFSET			0x0004
-#define OMAP4430_CM_TESLA_STATICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0004)
+#define OMAP4430_CM_TESLA_STATICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0004)
 #define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET		0x0008
-#define OMAP4430_CM_TESLA_DYNAMICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0008)
+#define OMAP4430_CM_TESLA_DYNAMICDEP			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0008)
 #define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET		0x0020
-#define OMAP4430_CM_TESLA_TESLA_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0020)
+#define OMAP4430_CM_TESLA_TESLA_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0020)
 
 /* CM1.ABE_CM1 register offsets */
 #define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET			0x0000
-#define OMAP4430_CM1_ABE_CLKSTCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0000)
+#define OMAP4430_CM1_ABE_CLKSTCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0000)
 #define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET		0x0020
-#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0020)
+#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0020)
 #define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET		0x0028
-#define OMAP4430_CM1_ABE_AESS_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0028)
+#define OMAP4430_CM1_ABE_AESS_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0028)
 #define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET		0x0030
-#define OMAP4430_CM1_ABE_PDM_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0030)
+#define OMAP4430_CM1_ABE_PDM_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0030)
 #define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET		0x0038
-#define OMAP4430_CM1_ABE_DMIC_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0038)
+#define OMAP4430_CM1_ABE_DMIC_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0038)
 #define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET		0x0040
-#define OMAP4430_CM1_ABE_MCASP_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0040)
+#define OMAP4430_CM1_ABE_MCASP_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0040)
 #define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET		0x0048
-#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0048)
+#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0048)
 #define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET		0x0050
-#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0050)
+#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0050)
 #define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET		0x0058
-#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0058)
+#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0058)
 #define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET		0x0060
-#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0060)
+#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0060)
 #define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET		0x0068
-#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0068)
+#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0068)
 #define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET		0x0070
-#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0070)
+#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0070)
 #define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET		0x0078
-#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0078)
+#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0078)
 #define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET		0x0080
-#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0080)
+#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0080)
 #define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET		0x0088
-#define OMAP4430_CM1_ABE_WDT3_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088)
+#define OMAP4430_CM1_ABE_WDT3_CLKCTRL			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0088)
 
 /* CM1.RESTORE_CM1 register offsets */
 #define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET		0x0000
-#define OMAP4430_CM_CLKSEL_CORE_RESTORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0000)
+#define OMAP4430_CM_CLKSEL_CORE_RESTORE			OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0000)
 #define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET	0x0004
-#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004)
+#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0004)
 #define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET	0x0008
-#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008)
+#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0008)
 #define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET	0x000c
-#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c)
+#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x000c)
 #define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET	0x0010
-#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010)
+#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0010)
 #define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET	0x0014
-#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014)
+#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0014)
 #define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET	0x0018
-#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018)
+#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0018)
 #define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET	0x001c
-#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c)
+#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x001c)
 #define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET	0x0020
-#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE	OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020)
-#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET	0x0024
-#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE	OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024)
+#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE	OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0020)
+#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_CORE_RESTORE_OFFSET	0x0024
+#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_CORE_RESTORE	OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0024)
 #define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET	0x0028
-#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028)
+#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0028)
 #define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET	0x002c
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c)
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x002c)
 #define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET	0x0030
-#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030)
+#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0030)
 #define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET	0x0034
-#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034)
+#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0034)
 #define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET		0x0038
-#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038)
+#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0038)
 #define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET	0x003c
-#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE	OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c)
+#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE	OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x003c)
 #define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET		0x0040
-#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040)
-
-/* Function prototypes */
-extern u32 omap4_cm1_read_mod_reg(s16 module, u16 idx);
-extern void omap4_cm1_write_mod_reg(u32 val, s16 module, u16 idx);
-extern u32 omap4_cm1_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
+#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE		OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0040)
 
 #endif
arch/arm/mach-omap2/cm2_44xx.h +223 -223

679 lines not on this page · raw message

arch/arm/mach-omap2/powerdomains44xx_data.c +16 -16
index d078c88..cf6adfc 100644
@@ -34,7 +34,7 @@
 /* core_44xx_pwrdm: CORE power domain */
 static struct powerdomain core_44xx_pwrdm = {
 	.name		  = "core_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_CORE_MOD,
+	.prcm_offs	  = OMAP4430_PRM_CORE_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -59,7 +59,7 @@ static struct powerdomain core_44xx_pwrdm = {
 /* gfx_44xx_pwrdm: 3D accelerator power domain */
 static struct powerdomain gfx_44xx_pwrdm = {
 	.name		  = "gfx_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_GFX_MOD,
+	.prcm_offs	  = OMAP4430_PRM_GFX_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_ON,
 	.banks		  = 1,
@@ -75,7 +75,7 @@ static struct powerdomain gfx_44xx_pwrdm = {
 /* abe_44xx_pwrdm: Audio back end power domain */
 static struct powerdomain abe_44xx_pwrdm = {
 	.name		  = "abe_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_ABE_MOD,
+	.prcm_offs	  = OMAP4430_PRM_ABE_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRDM_POWER_OFF,
@@ -94,7 +94,7 @@ static struct powerdomain abe_44xx_pwrdm = {
 /* dss_44xx_pwrdm: Display subsystem power domain */
 static struct powerdomain dss_44xx_pwrdm = {
 	.name		  = "dss_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_DSS_MOD,
+	.prcm_offs	  = OMAP4430_PRM_DSS_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF,
@@ -111,7 +111,7 @@ static struct powerdomain dss_44xx_pwrdm = {
 /* tesla_44xx_pwrdm: Tesla processor power domain */
 static struct powerdomain tesla_44xx_pwrdm = {
 	.name		  = "tesla_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_TESLA_MOD,
+	.prcm_offs	  = OMAP4430_PRM_TESLA_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -132,7 +132,7 @@ static struct powerdomain tesla_44xx_pwrdm = {
 /* wkup_44xx_pwrdm: Wake-up power domain */
 static struct powerdomain wkup_44xx_pwrdm = {
 	.name		  = "wkup_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_WKUP_MOD,
+	.prcm_offs	  = OMAP4430_PRM_WKUP_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_ON,
 	.banks		  = 1,
@@ -147,7 +147,7 @@ static struct powerdomain wkup_44xx_pwrdm = {
 /* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */
 static struct powerdomain cpu0_44xx_pwrdm = {
 	.name		  = "cpu0_pwrdm",
-	.prcm_offs	  = OMAP4430_PRCM_MPU_CPU0_MOD,
+	.prcm_offs	  = OMAP4430_PRCM_MPU_CPU0_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -163,7 +163,7 @@ static struct powerdomain cpu0_44xx_pwrdm = {
 /* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */
 static struct powerdomain cpu1_44xx_pwrdm = {
 	.name		  = "cpu1_pwrdm",
-	.prcm_offs	  = OMAP4430_PRCM_MPU_CPU1_MOD,
+	.prcm_offs	  = OMAP4430_PRCM_MPU_CPU1_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -179,7 +179,7 @@ static struct powerdomain cpu1_44xx_pwrdm = {
 /* emu_44xx_pwrdm: Emulation power domain */
 static struct powerdomain emu_44xx_pwrdm = {
 	.name		  = "emu_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_EMU_MOD,
+	.prcm_offs	  = OMAP4430_PRM_EMU_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_ON,
 	.banks		  = 1,
@@ -194,7 +194,7 @@ static struct powerdomain emu_44xx_pwrdm = {
 /* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */
 static struct powerdomain mpu_44xx_pwrdm = {
 	.name		  = "mpu_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_MPU_MOD,
+	.prcm_offs	  = OMAP4430_PRM_MPU_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -214,7 +214,7 @@ static struct powerdomain mpu_44xx_pwrdm = {
 /* ivahd_44xx_pwrdm: IVA-HD power domain */
 static struct powerdomain ivahd_44xx_pwrdm = {
 	.name		  = "ivahd_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_IVAHD_MOD,
+	.prcm_offs	  = OMAP4430_PRM_IVAHD_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRDM_POWER_OFF,
@@ -237,7 +237,7 @@ static struct powerdomain ivahd_44xx_pwrdm = {
 /* cam_44xx_pwrdm: Camera subsystem power domain */
 static struct powerdomain cam_44xx_pwrdm = {
 	.name		  = "cam_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_CAM_MOD,
+	.prcm_offs	  = OMAP4430_PRM_CAM_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_ON,
 	.banks		  = 1,
@@ -253,7 +253,7 @@ static struct powerdomain cam_44xx_pwrdm = {
 /* l3init_44xx_pwrdm: L3 initators pheripherals power domain  */
 static struct powerdomain l3init_44xx_pwrdm = {
 	.name		  = "l3init_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_L3INIT_MOD,
+	.prcm_offs	  = OMAP4430_PRM_L3INIT_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -270,7 +270,7 @@ static struct powerdomain l3init_44xx_pwrdm = {
 /* l4per_44xx_pwrdm: Target peripherals power domain */
 static struct powerdomain l4per_44xx_pwrdm = {
 	.name		  = "l4per_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_L4PER_MOD,
+	.prcm_offs	  = OMAP4430_PRM_L4PER_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -292,7 +292,7 @@ static struct powerdomain l4per_44xx_pwrdm = {
  */
 static struct powerdomain always_on_core_44xx_pwrdm = {
 	.name		  = "always_on_core_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_ALWAYS_ON_MOD,
+	.prcm_offs	  = OMAP4430_PRM_ALWAYS_ON_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_ON,
 };
@@ -300,7 +300,7 @@ static struct powerdomain always_on_core_44xx_pwrdm = {
 /* cefuse_44xx_pwrdm: Customer efuse controller power domain */
 static struct powerdomain cefuse_44xx_pwrdm = {
 	.name		  = "cefuse_pwrdm",
-	.prcm_offs	  = OMAP4430_PRM_CEFUSE_MOD,
+	.prcm_offs	  = OMAP4430_PRM_CEFUSE_INST,
 	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
 	.pwrsts		  = PWRSTS_OFF_ON,
 };
arch/arm/mach-omap2/prcm.c +1 -1
index df55fdf..aac8070 100644
@@ -146,7 +146,7 @@ void omap_prcm_arch_reset(char mode, const char *cmd)
 		prcm_offs = OMAP3430_GR_MOD;
 		omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
 	} else if (cpu_is_omap44xx())
-		prcm_offs = OMAP4430_PRM_DEVICE_MOD;
+		prcm_offs = OMAP4430_PRM_DEVICE_INST;
 	else
 		WARN_ON(1);
 
arch/arm/mach-omap2/prcm_mpu44xx.h +23 -23

82 lines not on this page · raw message

arch/arm/mach-omap2/prm44xx.h +343 -350

1,063 lines not on this page · raw message

author maintainer
#19 lore raw

PATCH 13/14 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

In reply to Paul Walmsley

In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific.

This process also requires the #includes in each of these files to be changed to reference the new file name. As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so.

Cc Jarkko Nikula <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
---
 arch/arm/mach-omap2/Makefile                     |   11 -
 arch/arm/mach-omap2/clkt2xxx_apll.c              |    2 
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c          |    2 
 arch/arm/mach-omap2/clkt2xxx_osc.c               |    2 
 arch/arm/mach-omap2/clkt2xxx_sys.c               |    2 
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c     |    2 
 arch/arm/mach-omap2/clkt_dpll.c                  |    1 
 arch/arm/mach-omap2/clock.c                      |    4 
 arch/arm/mach-omap2/clock2420_data.c             |    4 
 arch/arm/mach-omap2/clock2430.c                  |    2 
 arch/arm/mach-omap2/clock2430_data.c             |    4 
 arch/arm/mach-omap2/clock34xx.c                  |    2 
 arch/arm/mach-omap2/clock3517.c                  |    2 
 arch/arm/mach-omap2/clock3xxx.c                  |    4 
 arch/arm/mach-omap2/clock3xxx_data.c             |    4 
 arch/arm/mach-omap2/clock44xx_data.c             |    6 
 arch/arm/mach-omap2/clockdomain.c                |    5 
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |    4 
 arch/arm/mach-omap2/clockdomains44xx_data.c      |    2 
 arch/arm/mach-omap2/cm-regbits-24xx.h            |    2 
 arch/arm/mach-omap2/cm-regbits-34xx.h            |    2 
 arch/arm/mach-omap2/cm-regbits-44xx.h            |    3 
 arch/arm/mach-omap2/cm.h                         |  134 --------
 arch/arm/mach-omap2/cm2xxx_3xxx.c                |   39 ++
 arch/arm/mach-omap2/cm2xxx_3xxx.h                |   64 +---
 arch/arm/mach-omap2/cm44xx.h                     |    1 
 arch/arm/mach-omap2/cm4xxx.c                     |    2 
 arch/arm/mach-omap2/control.c                    |    4 
 arch/arm/mach-omap2/dpll3xxx.c                   |    4 
 arch/arm/mach-omap2/dsp.c                        |    9 -
 arch/arm/mach-omap2/omap_hwmod.c                 |    5 
 arch/arm/mach-omap2/pm-debug.c                   |    4 
 arch/arm/mach-omap2/pm24xx.c                     |    4 
 arch/arm/mach-omap2/pm34xx.c                     |    4 
 arch/arm/mach-omap2/powerdomain.c                |    3 
 arch/arm/mach-omap2/powerdomain44xx.c            |    1 
 arch/arm/mach-omap2/powerdomains2xxx_data.c      |    4 
 arch/arm/mach-omap2/powerdomains3xxx_data.c      |    4 
 arch/arm/mach-omap2/powerdomains44xx_data.c      |    1 
 arch/arm/mach-omap2/prcm-common.h                |    6 
 arch/arm/mach-omap2/prcm.c                       |   88 +-----
 arch/arm/mach-omap2/prm-regbits-24xx.h           |    2 
 arch/arm/mach-omap2/prm-regbits-34xx.h           |    8 -
 arch/arm/mach-omap2/prm-regbits-44xx.h           |    2 
 arch/arm/mach-omap2/prm.h                        |  352 ----------------------
 arch/arm/mach-omap2/prm2xxx_3xxx.c               |   51 +++
 arch/arm/mach-omap2/prm2xxx_3xxx.h               |  101 ++----
 arch/arm/mach-omap2/prm44xx.h                    |    1 
 arch/arm/mach-omap2/sdrc.c                       |    2 
 arch/arm/mach-omap2/sdrc2xxx.c                   |    2 
 arch/arm/mach-omap2/serial.c                     |    4 
 arch/arm/mach-omap2/sleep34xx.S                  |    4 
 arch/arm/mach-omap2/sram242x.S                   |    4 
 arch/arm/mach-omap2/sram243x.S                   |    4 
 arch/arm/mach-omap2/sram34xx.S                   |    2 
 arch/arm/plat-omap/include/plat/common.h         |    2 
 arch/arm/plat-omap/include/plat/prcm.h           |    7 
 arch/arm/plat-omap/mcbsp.c                       |    2 
 arch/arm/plat-omap/sram.c                        |    5 
 59 files changed, 248 insertions(+), 760 deletions(-)
 rename arch/arm/mach-omap2/{cm.c => cm2xxx_3xxx.c} (67%)
 copy arch/arm/mach-omap2/{cm.h => cm2xxx_3xxx.h} (72%)
 copy arch/arm/mach-omap2/{prm.h => prm2xxx_3xxx.h} (86%)
arch/arm/mach-omap2/Makefile +7 -4
index 78a2a5d..7f3302f 100644
@@ -6,7 +6,7 @@
 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
 	 common.o
 
-omap-2-3-common				= irq.o sdrc.o prm2xxx_3xxx.o
+omap-2-3-common				= irq.o sdrc.o
 hwmod-common				= omap_hwmod.o \
 					  omap_hwmod_common_data.o
 clock-common				= clock.o clock_common_data.o \
@@ -63,9 +63,12 @@ endif
 endif
 
 # PRCM
-obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm.o
-obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm.o
-obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm4xxx.o
+obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
+# XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
+# will be removed once the OMAP4 part of the codebase is converted to
+# use OMAP4-specific PRCM functions.
+obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm2xxx_3xxx.o cm4xxx.o
 
 # OMAP powerdomain framework
 powerdomain-common			+= powerdomain.o powerdomain-common.o
arch/arm/mach-omap2/clkt2xxx_apll.c +1 -1
index 66e01ac..954d11f 100644
@@ -26,7 +26,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
arch/arm/mach-omap2/clkt2xxx_dpllcore.c +1 -1
index 01904843..530a76b 100644
@@ -32,7 +32,7 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /* #define DOWN_VARIABLE_DPLL 1 */		/* Experimental */
arch/arm/mach-omap2/clkt2xxx_osc.c +1 -1
index 2167be8..df7b805 100644
@@ -27,7 +27,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 
 static int omap2_enable_osc_ck(struct clk *clk)
arch/arm/mach-omap2/clkt2xxx_sys.c +1 -1
index 822b5a7..8693cfd 100644
@@ -26,7 +26,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 
 void __iomem *prcm_clksrc_ctrl;
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +1 -1
index aef6291..f49f47d 100644
@@ -40,7 +40,7 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 const struct prcm_config *curr_prcm_set;
arch/arm/mach-omap2/clkt_dpll.c +0 -1
index 6ce512e..337392c 100644
@@ -24,7 +24,6 @@
 #include <plat/clock.h>
 
 #include "clock.h"
-#include "cm.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
arch/arm/mach-omap2/clock.c +1 -3
index b5babf5..cda2f1d 100644
@@ -29,9 +29,7 @@
 #include <plat/prcm.h>
 
 #include "clock.h"
-#include "prm.h"
-#include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
arch/arm/mach-omap2/clock2420_data.c +2 -2
index 21f8562..05ec9df 100644
@@ -22,8 +22,8 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
arch/arm/mach-omap2/clock2430.c +1 -1
index 44d0ccc..d87bc9c 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /**
arch/arm/mach-omap2/clock2430_data.c +2 -2
index e32afcb..5da4295 100644
@@ -22,8 +22,8 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
arch/arm/mach-omap2/clock34xx.c +1 -1
index 6febd5f..287abc4 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /**
arch/arm/mach-omap2/clock3517.c +1 -1
index b496a93..74116a3 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock3517.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/clock3xxx.c +2 -2
index a447c4d..81f5fdb 100644
@@ -25,9 +25,9 @@
 
 #include "clock.h"
 #include "clock3xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/clock3xxx_data.c +2 -2
index d85ecd5..0c740d7 100644
@@ -28,9 +28,9 @@
 #include "clock36xx.h"
 #include "clock3517.h"
 
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
 #include "control.h"
 
arch/arm/mach-omap2/clock44xx_data.c +5 -1
index 2605e2e..76e900b 100644
@@ -33,11 +33,15 @@
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
 #include "cm-regbits-44xx.h"
-#include "prm.h"
+#include "prm44xx.h"
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "control.h"
 
+/* OMAP4 modulemode control */
+#define OMAP4430_MODULEMODE_HWCTRL			0
+#define OMAP4430_MODULEMODE_SWCTRL			1
+
 /* Root clocks */
 
 static struct clk extalt_clkin_ck = {
arch/arm/mach-omap2/clockdomain.c +3 -2
index 6fb61b1..a2142e0 100644
@@ -27,9 +27,10 @@
 
 #include <linux/bitops.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 
 #include <plat/clock.h>
 #include <plat/powerdomain.h>
arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +2 -2
index 8dadf75..de1d3b7 100644
@@ -36,8 +36,8 @@
 #include <linux/io.h>
 
 #include <plat/clockdomain.h>
-#include "cm.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 #include "cm-regbits-44xx.h"
arch/arm/mach-omap2/clockdomains44xx_data.c +2 -0
index d4a5206..7fc81f6 100644
@@ -27,6 +27,8 @@
 #include <linux/io.h>
 
 #include <plat/clockdomain.h>
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
 
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
arch/arm/mach-omap2/cm-regbits-24xx.h +0 -2
index da51cc3..bab62ee 100644
@@ -14,8 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include "cm.h"
-
 /* Bits shared between registers */
 
 /* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
arch/arm/mach-omap2/cm-regbits-34xx.h +0 -2
index 4f959a7..cd9ff8b 100644
@@ -14,8 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include "cm.h"
-
 /* Bits shared between registers */
 
 /* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
arch/arm/mach-omap2/cm-regbits-44xx.h +0 -3
index 0b72be4..9d47a05 100644
@@ -22,9 +22,6 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 
-#include "cm.h"
-
-
 /*
  * Used by CM_L3_1_DYNAMICDEP, CM_L3_1_DYNAMICDEP_RESTORE, CM_MPU_DYNAMICDEP,
  * CM_TESLA_DYNAMICDEP
arch/arm/mach-omap2/cm.h +3 -131

144 lines not on this page · raw message

arch/arm/mach-omap2/cm2xxx_3xxx.c renamed from arch/arm/mach-omap2/cm.c +35 -4
similarity index 67%
rename from arch/arm/mach-omap2/cm.c
rename to arch/arm/mach-omap2/cm2xxx_3xxx.c
index 721c3b6..5978ce4 100644
@@ -10,7 +10,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
@@ -19,11 +18,10 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <asm/atomic.h>
-
 #include <plat/common.h>
 
 #include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
@@ -31,6 +29,40 @@ static const u8 cm_idlest_offs[] = {
 	CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
 };
 
+
+u32 cm_read_mod_reg(s16 module, u16 idx)
+{
+	return __raw_readl(cm_base + module + idx);
+}
+
+void cm_write_mod_reg(u32 val, s16 module, u16 idx)
+{
+	__raw_writel(val, cm_base + module + idx);
+}
+
+/* Read-modify-write a register in a CM module. Caller must lock */
+u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
+{
+	u32 v;
+
+	v = cm_read_mod_reg(module, idx);
+	v &= ~mask;
+	v |= bits;
+	cm_write_mod_reg(v, module, idx);
+
+	return v;
+}
+
+u32 cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
+{
+	return cm_rmw_mod_reg_bits(bits, bits, module, idx);
+}
+
+u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
+{
+	return cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
+}
+
 /**
  * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby
  * @prcm_mod: PRCM module offset
@@ -59,7 +91,6 @@ int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
 	else
 		BUG();
 
-	/* XXX should be OMAP2 CM */
 	omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
 			  MAX_MODULE_READY_TIME, i);
 
arch/arm/mach-omap2/cm2xxx_3xxx.h renamed from arch/arm/mach-omap2/cm.h +21 -43

123 lines not on this page · raw message

arch/arm/mach-omap2/cm44xx.h +1 -0
index d390526..48fc3f4 100644
@@ -18,6 +18,7 @@
 
 
 #include "prcm-common.h"
+#include "cm.h"
 
 #define OMAP4_CM_CLKSTCTRL				0x0000
 
arch/arm/mach-omap2/cm4xxx.c +1 -1
index f8a660a..25d2b3e 100644
@@ -23,7 +23,7 @@
 
 #include <plat/common.h>
 
-#include "cm.h"
+#include "cm44xx.h"
 #include "cm-regbits-44xx.h"
 
 /**
arch/arm/mach-omap2/control.c +2 -2
index b260e1b..fee6620 100644
@@ -20,8 +20,8 @@
 
 #include "cm-regbits-34xx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 #include "pm.h"
 #include "control.h"
arch/arm/mach-omap2/dpll3xxx.c +1 -3
index ed8d330..cb535ee 100644
@@ -32,9 +32,7 @@
 #include <asm/clkdev.h>
 
 #include "clock.h"
-#include "prm.h"
-#include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /* CM_AUTOIDLE_PLL*.AUTO_* bit values */
arch/arm/mach-omap2/dsp.c +7 -2
index 6feeeae..a8b62d7 100644
@@ -9,11 +9,16 @@
  * 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 The function pointers to the PRM/CM functions are incorrect and
+ * should be removed.  No device driver should be changing PRM/CM bits
+ * directly; that's a layering violation -- those bits are the responsibility
+ * of the OMAP PM core code.
  */
 
 #include <linux/platform_device.h>
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #ifdef CONFIG_BRIDGE_DVFS
 #include <plat/omap-pm.h>
 #endif
arch/arm/mach-omap2/omap_hwmod.c +3 -2
index cafcd87..63d3f4d 100644
@@ -144,8 +144,9 @@
 #include <plat/omap_hwmod.h>
 #include <plat/prcm.h>
 
-#include "cm.h"
-#include "prm.h"
+#include "cm2xxx_3xxx.h"
+#include "cm44xx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
 /* Maximum microseconds to wait for OMAP module to softreset */
arch/arm/mach-omap2/pm-debug.c +2 -2
index 5e81517..26eda02 100644
@@ -33,8 +33,8 @@
 #include <plat/clockdomain.h>
 #include <plat/dmtimer.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
 
 int omap2_pm_debug;
arch/arm/mach-omap2/pm24xx.c +2 -2
index c85923e5..de89d89 100644
@@ -42,9 +42,9 @@
 #include <plat/dma.h>
 #include <plat/board.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
 #include "pm.h"
arch/arm/mach-omap2/pm34xx.c +2 -2
index 0ec8a04..0d73d75 100644
@@ -41,11 +41,11 @@
 
 #include <asm/tlbflush.h>
 
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 #include "prm-regbits-34xx.h"
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
 #include "sdrc.h"
 #include "control.h"
arch/arm/mach-omap2/powerdomain.c +3 -0
index 77f42b9..8a0dcd0 100644
@@ -19,6 +19,9 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include "cm2xxx_3xxx.h"
+#include "cm44xx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
 #include <plat/cpu.h>
arch/arm/mach-omap2/powerdomain44xx.c +1 -0
index 7efdf68..dae767b 100644
@@ -18,6 +18,7 @@
 
 #include <plat/powerdomain.h>
 #include <plat/prcm.h>
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "powerdomains.h"
arch/arm/mach-omap2/powerdomains2xxx_data.c +1 -3
index adc85d3..e136895 100644
@@ -19,10 +19,8 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
-#include "cm-regbits-24xx.h"
 
 /* 24XX powerdomains and dependencies */
 
arch/arm/mach-omap2/powerdomains3xxx_data.c +2 -2
index 4335dbb..f383784 100644
@@ -19,9 +19,9 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/powerdomains44xx_data.c +0 -1
index cf6adfc..069a21d 100644
@@ -26,7 +26,6 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
 #include "prm-regbits-44xx.h"
 #include "prm44xx.h"
 #include "prcm_mpu44xx.h"
arch/arm/mach-omap2/prcm-common.h +6 -0
index 4979160..a837824 100644
@@ -395,5 +395,11 @@
  */
 #define MAX_MODULE_HARDRESET_WAIT		10000
 
+# ifndef __ASSEMBLER__
+extern void __iomem *prm_base;
+extern void __iomem *cm_base;
+extern void __iomem *cm2_base;
+# endif
+
 #endif
 
arch/arm/mach-omap2/prcm.c +9 -79

117 lines not on this page · raw message

arch/arm/mach-omap2/prm-regbits-24xx.h +1 -1
index 0b188ff..6ac9661 100644
@@ -14,7 +14,7 @@
  * published by the Free Software Foundation.
  */
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 
 /* Bits shared between registers */
 
arch/arm/mach-omap2/prm-regbits-34xx.h +4 -4
index 9e63cb7..62017ce 100644
@@ -1,6 +1,3 @@
-#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
-#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
-
 /*
  * OMAP3430 Power/Reset Management register bits
  *
@@ -13,8 +10,11 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 
 /* Shared register bits */
 
arch/arm/mach-omap2/prm-regbits-44xx.h +0 -2
index 25b19b6..6d2776f 100644
@@ -22,8 +22,6 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 
-#include "prm.h"
-
 
 /*
  * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
arch/arm/mach-omap2/prm.h +4 -348

378 lines not on this page · raw message

arch/arm/mach-omap2/prm2xxx_3xxx.c +49 -2

67 lines not on this page · raw message

arch/arm/mach-omap2/prm2xxx_3xxx.h renamed from arch/arm/mach-omap2/prm.h +34 -67

175 lines not on this page · raw message

arch/arm/mach-omap2/prm44xx.h +1 -0
index 0d444a5..3d36149 100644
@@ -26,6 +26,7 @@
 #define __ARCH_ARM_MACH_OMAP2_PRM44XX_H
 
 #include "prcm-common.h"
+#include "prm.h"
 
 #define OMAP4430_PRM_BASE		0x4a306000
 
arch/arm/mach-omap2/sdrc.c +0 -2
index 4c65f56..da6f3a6 100644
@@ -27,8 +27,6 @@
 #include <plat/clock.h>
 #include <plat/sram.h>
 
-#include "prm.h"
-
 #include <plat/sdrc.h>
 #include "sdrc.h"
 
arch/arm/mach-omap2/sdrc2xxx.c +1 -1
index 0f4d27a..64778b6 100644
@@ -28,7 +28,7 @@
 #include <plat/clock.h>
 #include <plat/sram.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "clock.h"
 #include <plat/sdrc.h>
 #include "sdrc.h"
arch/arm/mach-omap2/serial.c +2 -2
index d17960a..a60ac51 100644
@@ -40,9 +40,9 @@
 #include <plat/omap_hwmod.h>
 #include <plat/omap_device.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
 #include "control.h"
 
arch/arm/mach-omap2/sleep34xx.S +2 -2
index 2fb205a..da454c0 100644
@@ -28,8 +28,8 @@
 #include <asm/assembler.h>
 #include <mach/io.h>
 
-#include "cm.h"
-#include "prm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "sdrc.h"
 #include "control.h"
 
arch/arm/mach-omap2/sram242x.S +2 -2
index 92e6e1a..8e7e6fe 100644
@@ -27,8 +27,8 @@
 #include <mach/io.h>
 #include <mach/hardware.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 
 	.text
arch/arm/mach-omap2/sram243x.S +2 -2
index ab49736..9ea87f6 100644
@@ -27,8 +27,8 @@
 #include <mach/io.h>
 #include <mach/hardware.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 
 	.text
arch/arm/mach-omap2/sram34xx.S +1 -1
index 3637274..b7aba60 100644
@@ -32,7 +32,7 @@
 #include <mach/io.h>
 
 #include "sdrc.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 
 	.text
 
arch/arm/plat-omap/include/plat/common.h +2 -0
index a9d69a0..6b8088e 100644
@@ -27,6 +27,8 @@
 #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
 #define __ARCH_ARM_MACH_OMAP_COMMON_H
 
+#include <linux/delay.h>
+
 #include <plat/i2c.h>
 
 struct sys_timer;
arch/arm/plat-omap/include/plat/prcm.h +0 -7
index ab77442..3769fc6 100644
@@ -34,15 +34,8 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
 void omap3_prcm_save_context(void);
 void omap3_prcm_restore_context(void);
 
-u32 prm_read_mod_reg(s16 module, u16 idx);
-void prm_write_mod_reg(u32 val, s16 module, u16 idx);
-u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
-u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
 u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
 u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
-u32 cm_read_mod_reg(s16 module, u16 idx);
-void cm_write_mod_reg(u32 val, s16 module, u16 idx);
-u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
 
 #endif
 
arch/arm/plat-omap/mcbsp.c +2 -0
index eac4b97..e66ad3e 100644
@@ -28,6 +28,8 @@
 #include <plat/dma.h>
 #include <plat/mcbsp.h>
 
+/* XXX These "sideways" includes are a sign that something is wrong */
+#include "../mach-omap2/cm2xxx_3xxx.h"
 #include "../mach-omap2/cm-regbits-34xx.h"
 
 struct omap_mcbsp **mcbsp_ptr;
arch/arm/plat-omap/sram.c +3 -2
index e2c8eeb..aef5f9b 100644
@@ -33,9 +33,10 @@
 
 #include "sram.h"
 #include "fb.h"
+
+/* XXX These "sideways" includes are a sign that something is wrong */
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-# include "../mach-omap2/prm.h"
-# include "../mach-omap2/cm.h"
+# include "../mach-omap2/prm2xxx_3xxx.h"
 # include "../mach-omap2/sdrc.h"
 #endif
 
#20 lore raw

PATCH 13/14 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

Quoted 5 lines · Paul Walmsley

In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific.

author maintainer
#21 lore raw

PATCH 13/14 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

In reply to Paul Walmsley

Hi,

Quoted 11 lines · Paul Walmsley

In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific.

This process also requires the #includes in each of these files to be changed to reference the new file name. As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so.

This patch has been updated to also take care of getting DSPBridge to build again. Omar, Felipe, could you please take a look at the mach-omap2/dsp.c and _tiomap.h changes and ack them?

regards

- Paul

[PATCH] OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific.

This process also requires the #includes in each of these files to be changed to reference the new file name. As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so.

Cc Jarkko Nikula <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Omar Ramirez Luna <[email protected]>
Cc Felipe Contreras <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 arch/arm/mach-omap2/Makefile                     |   11 +-
 arch/arm/mach-omap2/clkt2xxx_apll.c              |    2 +-
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c          |    2 +-
 arch/arm/mach-omap2/clkt2xxx_osc.c               |    2 +-
 arch/arm/mach-omap2/clkt2xxx_sys.c               |    2 +-
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c     |    2 +-
 arch/arm/mach-omap2/clkt_dpll.c                  |    1 -
 arch/arm/mach-omap2/clock.c                      |    4 +-
 arch/arm/mach-omap2/clock2420_data.c             |    4 +-
 arch/arm/mach-omap2/clock2430.c                  |    2 +-
 arch/arm/mach-omap2/clock2430_data.c             |    4 +-
 arch/arm/mach-omap2/clock34xx.c                  |    2 +-
 arch/arm/mach-omap2/clock3517.c                  |    2 +-
 arch/arm/mach-omap2/clock3xxx.c                  |    4 +-
 arch/arm/mach-omap2/clock3xxx_data.c             |    4 +-
 arch/arm/mach-omap2/clock44xx_data.c             |    6 +-
 arch/arm/mach-omap2/clockdomain.c                |    5 +-
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |    4 +-
 arch/arm/mach-omap2/clockdomains44xx_data.c      |    2 +
 arch/arm/mach-omap2/cm-regbits-24xx.h            |    2 -
 arch/arm/mach-omap2/cm-regbits-34xx.h            |    2 -
 arch/arm/mach-omap2/cm-regbits-44xx.h            |    3 -
 arch/arm/mach-omap2/cm.h                         |  134 +--------
 arch/arm/mach-omap2/{cm.c => cm2xxx_3xxx.c}      |   39 ++-
 arch/arm/mach-omap2/cm2xxx_3xxx.h                |  131 ++++++++
 arch/arm/mach-omap2/cm44xx.h                     |    1 +
 arch/arm/mach-omap2/cm4xxx.c                     |    2 +-
 arch/arm/mach-omap2/control.c                    |    4 +-
 arch/arm/mach-omap2/dpll3xxx.c                   |    4 +-
 arch/arm/mach-omap2/dsp.c                        |    9 +-
 arch/arm/mach-omap2/omap_hwmod.c                 |    5 +-
 arch/arm/mach-omap2/pm-debug.c                   |    4 +-
 arch/arm/mach-omap2/pm24xx.c                     |    4 +-
 arch/arm/mach-omap2/pm34xx.c                     |    4 +-
 arch/arm/mach-omap2/powerdomain.c                |    3 +
 arch/arm/mach-omap2/powerdomain44xx.c            |    1 +
 arch/arm/mach-omap2/powerdomains2xxx_data.c      |    4 +-
 arch/arm/mach-omap2/powerdomains3xxx_data.c      |    4 +-
 arch/arm/mach-omap2/powerdomains44xx_data.c      |    1 -
 arch/arm/mach-omap2/prcm-common.h                |    6 +
 arch/arm/mach-omap2/prcm.c                       |   88 +-----
 arch/arm/mach-omap2/prm-regbits-24xx.h           |    2 +-
 arch/arm/mach-omap2/prm-regbits-34xx.h           |    8 +-
 arch/arm/mach-omap2/prm-regbits-44xx.h           |    2 -
 arch/arm/mach-omap2/prm.h                        |  352 +--------------------
 arch/arm/mach-omap2/prm2xxx_3xxx.c               |   51 +++-
 arch/arm/mach-omap2/prm2xxx_3xxx.h               |  367 ++++++++++++++++++++++
 arch/arm/mach-omap2/prm44xx.h                    |    1 +
 arch/arm/mach-omap2/sdrc.c                       |    2 -
 arch/arm/mach-omap2/sdrc2xxx.c                   |    2 +-
 arch/arm/mach-omap2/serial.c                     |    4 +-
 arch/arm/mach-omap2/sleep34xx.S                  |    4 +-
 arch/arm/mach-omap2/sram242x.S                   |    4 +-
 arch/arm/mach-omap2/sram243x.S                   |    4 +-
 arch/arm/mach-omap2/sram34xx.S                   |    2 +-
 arch/arm/plat-omap/include/plat/common.h         |    2 +
 arch/arm/plat-omap/include/plat/prcm.h           |    7 -
 arch/arm/plat-omap/mcbsp.c                       |    2 +
 arch/arm/plat-omap/sram.c                        |    5 +-
 drivers/staging/tidspbridge/core/_tiomap.h       |    6 +
 60 files changed, 697 insertions(+), 650 deletions(-)
 rename arch/arm/mach-omap2/{cm.c => cm2xxx_3xxx.c} (67%)
 create mode 100644 arch/arm/mach-omap2/cm2xxx_3xxx.h
 create mode 100644 arch/arm/mach-omap2/prm2xxx_3xxx.h
arch/arm/mach-omap2/Makefile +7 -4
index a9cfef7..aee22f9 100644
@@ -6,7 +6,7 @@
 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
 	 common.o gpio.o wd_timer.o
 
-omap-2-3-common				= irq.o sdrc.o prm2xxx_3xxx.o
+omap-2-3-common				= irq.o sdrc.o
 hwmod-common				= omap_hwmod.o \
 					  omap_hwmod_common_data.o
 clock-common				= clock.o clock_common_data.o \
@@ -64,9 +64,12 @@ endif
 endif
 
 # PRCM
-obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm.o
-obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm.o
-obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm4xxx.o
+obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
+# XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
+# will be removed once the OMAP4 part of the codebase is converted to
+# use OMAP4-specific PRCM functions.
+obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm2xxx_3xxx.o cm4xxx.o
 
 # OMAP powerdomain framework
 powerdomain-common			+= powerdomain.o powerdomain-common.o
arch/arm/mach-omap2/clkt2xxx_apll.c +1 -1
index 66e01ac..954d11f 100644
@@ -26,7 +26,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
arch/arm/mach-omap2/clkt2xxx_dpllcore.c +1 -1
index 01904843..530a76b 100644
@@ -32,7 +32,7 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /* #define DOWN_VARIABLE_DPLL 1 */		/* Experimental */
arch/arm/mach-omap2/clkt2xxx_osc.c +1 -1
index 2167be8..df7b805 100644
@@ -27,7 +27,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 
 static int omap2_enable_osc_ck(struct clk *clk)
arch/arm/mach-omap2/clkt2xxx_sys.c +1 -1
index 822b5a7..8693cfd 100644
@@ -26,7 +26,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 
 void __iomem *prcm_clksrc_ctrl;
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +1 -1
index aef6291..f49f47d 100644
@@ -40,7 +40,7 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 const struct prcm_config *curr_prcm_set;
arch/arm/mach-omap2/clkt_dpll.c +0 -1
index 6ce512e..337392c 100644
@@ -24,7 +24,6 @@
 #include <plat/clock.h>
 
 #include "clock.h"
-#include "cm.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
arch/arm/mach-omap2/clock.c +1 -3
index b5babf5..cda2f1d 100644
@@ -29,9 +29,7 @@
 #include <plat/prcm.h>
 
 #include "clock.h"
-#include "prm.h"
-#include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
arch/arm/mach-omap2/clock2420_data.c +2 -2
index 21f8562..05ec9df 100644
@@ -22,8 +22,8 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
arch/arm/mach-omap2/clock2430.c +1 -1
index 44d0ccc..d87bc9c 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /**
arch/arm/mach-omap2/clock2430_data.c +2 -2
index e32afcb..5da4295 100644
@@ -22,8 +22,8 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
arch/arm/mach-omap2/clock34xx.c +1 -1
index 6febd5f..287abc4 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /**
arch/arm/mach-omap2/clock3517.c +1 -1
index b496a93..74116a3 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock3517.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/clock3xxx.c +2 -2
index a447c4d..81f5fdb 100644
@@ -25,9 +25,9 @@
 
 #include "clock.h"
 #include "clock3xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/clock3xxx_data.c +2 -2
index d85ecd5..0c740d7 100644
@@ -28,9 +28,9 @@
 #include "clock36xx.h"
 #include "clock3517.h"
 
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
 #include "control.h"
 
arch/arm/mach-omap2/clock44xx_data.c +5 -1
index 2605e2e..76e900b 100644
@@ -33,11 +33,15 @@
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
 #include "cm-regbits-44xx.h"
-#include "prm.h"
+#include "prm44xx.h"
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "control.h"
 
+/* OMAP4 modulemode control */
+#define OMAP4430_MODULEMODE_HWCTRL			0
+#define OMAP4430_MODULEMODE_SWCTRL			1
+
 /* Root clocks */
 
 static struct clk extalt_clkin_ck = {
arch/arm/mach-omap2/clockdomain.c +3 -2
index 6fb61b1..a2142e0 100644
@@ -27,9 +27,10 @@
 
 #include <linux/bitops.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 
 #include <plat/clock.h>
 #include <plat/powerdomain.h>
arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +2 -2
index 8dadf75..de1d3b7 100644
@@ -36,8 +36,8 @@
 #include <linux/io.h>
 
 #include <plat/clockdomain.h>
-#include "cm.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 #include "cm-regbits-44xx.h"
arch/arm/mach-omap2/clockdomains44xx_data.c +2 -0
index d4a5206..7fc81f6 100644
@@ -27,6 +27,8 @@
 #include <linux/io.h>
 
 #include <plat/clockdomain.h>
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
 
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
arch/arm/mach-omap2/cm-regbits-24xx.h +0 -2
index 9a106c0..0856f2b 100644
@@ -14,8 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include "cm.h"
-
 /* Bits shared between registers */
 
 /* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
arch/arm/mach-omap2/cm-regbits-34xx.h +0 -2
index 4f959a7..cd9ff8b 100644
@@ -14,8 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include "cm.h"
-
 /* Bits shared between registers */
 
 /* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
arch/arm/mach-omap2/cm-regbits-44xx.h +0 -3
index 0b72be4..9d47a05 100644
@@ -22,9 +22,6 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 
-#include "cm.h"
-
-
 /*
  * Used by CM_L3_1_DYNAMICDEP, CM_L3_1_DYNAMICDEP_RESTORE, CM_MPU_DYNAMICDEP,
  * CM_TESLA_DYNAMICDEP
arch/arm/mach-omap2/cm.h +3 -131

144 lines not on this page · raw message

arch/arm/mach-omap2/cm2xxx_3xxx.c renamed from arch/arm/mach-omap2/cm.c +35 -4
similarity index 67%
rename from arch/arm/mach-omap2/cm.c
rename to arch/arm/mach-omap2/cm2xxx_3xxx.c
index 721c3b6..5978ce4 100644
@@ -10,7 +10,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
@@ -19,11 +18,10 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <asm/atomic.h>
-
 #include <plat/common.h>
 
 #include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
@@ -31,6 +29,40 @@ static const u8 cm_idlest_offs[] = {
 	CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
 };
 
+
+u32 cm_read_mod_reg(s16 module, u16 idx)
+{
+	return __raw_readl(cm_base + module + idx);
+}
+
+void cm_write_mod_reg(u32 val, s16 module, u16 idx)
+{
+	__raw_writel(val, cm_base + module + idx);
+}
+
+/* Read-modify-write a register in a CM module. Caller must lock */
+u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
+{
+	u32 v;
+
+	v = cm_read_mod_reg(module, idx);
+	v &= ~mask;
+	v |= bits;
+	cm_write_mod_reg(v, module, idx);
+
+	return v;
+}
+
+u32 cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
+{
+	return cm_rmw_mod_reg_bits(bits, bits, module, idx);
+}
+
+u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
+{
+	return cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
+}
+
 /**
  * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby
  * @prcm_mod: PRCM module offset
@@ -59,7 +91,6 @@ int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
 	else
 		BUG();
 
-	/* XXX should be OMAP2 CM */
 	omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
 			  MAX_MODULE_READY_TIME, i);
 
arch/arm/mach-omap2/cm2xxx_3xxx.h new file +131 -0

131 lines not on this page · raw message

arch/arm/mach-omap2/cm44xx.h +1 -0
index d390526..48fc3f4 100644
@@ -18,6 +18,7 @@
 
 
 #include "prcm-common.h"
+#include "cm.h"
 
 #define OMAP4_CM_CLKSTCTRL				0x0000
 
arch/arm/mach-omap2/cm4xxx.c +1 -1
index f8a660a..25d2b3e 100644
@@ -23,7 +23,7 @@
 
 #include <plat/common.h>
 
-#include "cm.h"
+#include "cm44xx.h"
 #include "cm-regbits-44xx.h"
 
 /**
arch/arm/mach-omap2/control.c +2 -2
index b260e1b..fee6620 100644
@@ -20,8 +20,8 @@
 
 #include "cm-regbits-34xx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 #include "pm.h"
 #include "control.h"
arch/arm/mach-omap2/dpll3xxx.c +1 -3
index ed8d330..cb535ee 100644
@@ -32,9 +32,7 @@
 #include <asm/clkdev.h>
 
 #include "clock.h"
-#include "prm.h"
-#include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /* CM_AUTOIDLE_PLL*.AUTO_* bit values */
arch/arm/mach-omap2/dsp.c +7 -2
index 6feeeae..a8b62d7 100644
@@ -9,11 +9,16 @@
  * 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 The function pointers to the PRM/CM functions are incorrect and
+ * should be removed.  No device driver should be changing PRM/CM bits
+ * directly; that's a layering violation -- those bits are the responsibility
+ * of the OMAP PM core code.
  */
 
 #include <linux/platform_device.h>
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #ifdef CONFIG_BRIDGE_DVFS
 #include <plat/omap-pm.h>
 #endif
arch/arm/mach-omap2/omap_hwmod.c +3 -2
index 2b660e5..1312ce2 100644
@@ -145,8 +145,9 @@
 #include <plat/omap_hwmod.h>
 #include <plat/prcm.h>
 
-#include "cm.h"
-#include "prm.h"
+#include "cm2xxx_3xxx.h"
+#include "cm44xx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
 /* Maximum microseconds to wait for OMAP module to softreset */
arch/arm/mach-omap2/pm-debug.c +2 -2
index 5e81517..26eda02 100644
@@ -33,8 +33,8 @@
 #include <plat/clockdomain.h>
 #include <plat/dmtimer.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
 
 int omap2_pm_debug;
arch/arm/mach-omap2/pm24xx.c +2 -2
index c85923e5..de89d89 100644
@@ -42,9 +42,9 @@
 #include <plat/dma.h>
 #include <plat/board.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
 #include "pm.h"
arch/arm/mach-omap2/pm34xx.c +2 -2
index 0ec8a04..0d73d75 100644
@@ -41,11 +41,11 @@
 
 #include <asm/tlbflush.h>
 
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 #include "prm-regbits-34xx.h"
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
 #include "sdrc.h"
 #include "control.h"
arch/arm/mach-omap2/powerdomain.c +3 -0
index 77f42b9..8a0dcd0 100644
@@ -19,6 +19,9 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include "cm2xxx_3xxx.h"
+#include "cm44xx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
 #include <plat/cpu.h>
arch/arm/mach-omap2/powerdomain44xx.c +1 -0
index 7efdf68..dae767b 100644
@@ -18,6 +18,7 @@
 
 #include <plat/powerdomain.h>
 #include <plat/prcm.h>
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "powerdomains.h"
arch/arm/mach-omap2/powerdomains2xxx_data.c +1 -3
index adc85d3..e136895 100644
@@ -19,10 +19,8 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
-#include "cm-regbits-24xx.h"
 
 /* 24XX powerdomains and dependencies */
 
arch/arm/mach-omap2/powerdomains3xxx_data.c +2 -2
index 4335dbb..f383784 100644
@@ -19,9 +19,9 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/powerdomains44xx_data.c +0 -1
index cf6adfc..069a21d 100644
@@ -26,7 +26,6 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
 #include "prm-regbits-44xx.h"
 #include "prm44xx.h"
 #include "prcm_mpu44xx.h"
arch/arm/mach-omap2/prcm-common.h +6 -0
index 4979160..a837824 100644
@@ -395,5 +395,11 @@
  */
 #define MAX_MODULE_HARDRESET_WAIT		10000
 
+# ifndef __ASSEMBLER__
+extern void __iomem *prm_base;
+extern void __iomem *cm_base;
+extern void __iomem *cm2_base;
+# endif
+
 #endif
 
arch/arm/mach-omap2/prcm.c +9 -79

117 lines not on this page · raw message

arch/arm/mach-omap2/prm-regbits-24xx.h +1 -1
index 0b188ff..6ac9661 100644
@@ -14,7 +14,7 @@
  * published by the Free Software Foundation.
  */
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 
 /* Bits shared between registers */
 
arch/arm/mach-omap2/prm-regbits-34xx.h +4 -4
index ec1a710..64c087a 100644
@@ -1,6 +1,3 @@
-#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
-#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
-
 /*
  * OMAP3430 Power/Reset Management register bits
  *
@@ -13,8 +10,11 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 
 /* Shared register bits */
 
arch/arm/mach-omap2/prm-regbits-44xx.h +0 -2
index 25b19b6..6d2776f 100644
@@ -22,8 +22,6 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 
-#include "prm.h"
-
 
 /*
  * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
arch/arm/mach-omap2/prm.h +4 -348

378 lines not on this page · raw message

arch/arm/mach-omap2/prm2xxx_3xxx.c +49 -2

67 lines not on this page · raw message

arch/arm/mach-omap2/prm2xxx_3xxx.h new file +367 -0

367 lines not on this page · raw message

arch/arm/mach-omap2/prm44xx.h +1 -0
index 0d444a5..3d36149 100644
@@ -26,6 +26,7 @@
 #define __ARCH_ARM_MACH_OMAP2_PRM44XX_H
 
 #include "prcm-common.h"
+#include "prm.h"
 
 #define OMAP4430_PRM_BASE		0x4a306000
 
arch/arm/mach-omap2/sdrc.c +0 -2
index 4c65f56..da6f3a6 100644
@@ -27,8 +27,6 @@
 #include <plat/clock.h>
 #include <plat/sram.h>
 
-#include "prm.h"
-
 #include <plat/sdrc.h>
 #include "sdrc.h"
 
arch/arm/mach-omap2/sdrc2xxx.c +1 -1
index 0f4d27a..64778b6 100644
@@ -28,7 +28,7 @@
 #include <plat/clock.h>
 #include <plat/sram.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "clock.h"
 #include <plat/sdrc.h>
 #include "sdrc.h"
arch/arm/mach-omap2/serial.c +2 -2
index 0548bbd..26770d8 100644
@@ -40,9 +40,9 @@
 #include <plat/omap_hwmod.h>
 #include <plat/omap_device.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
 #include "control.h"
 
arch/arm/mach-omap2/sleep34xx.S +2 -2
index 2fb205a..da454c0 100644
@@ -28,8 +28,8 @@
 #include <asm/assembler.h>
 #include <mach/io.h>
 
-#include "cm.h"
-#include "prm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "sdrc.h"
 #include "control.h"
 
arch/arm/mach-omap2/sram242x.S +2 -2
index 92e6e1a..8e7e6fe 100644
@@ -27,8 +27,8 @@
 #include <mach/io.h>
 #include <mach/hardware.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 
 	.text
arch/arm/mach-omap2/sram243x.S +2 -2
index ab49736..9ea87f6 100644
@@ -27,8 +27,8 @@
 #include <mach/io.h>
 #include <mach/hardware.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 
 	.text
arch/arm/mach-omap2/sram34xx.S +1 -1
index 3637274..b7aba60 100644
@@ -32,7 +32,7 @@
 #include <mach/io.h>
 
 #include "sdrc.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 
 	.text
 
arch/arm/plat-omap/include/plat/common.h +2 -0
index a9d69a0..6b8088e 100644
@@ -27,6 +27,8 @@
 #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
 #define __ARCH_ARM_MACH_OMAP_COMMON_H
 
+#include <linux/delay.h>
+
 #include <plat/i2c.h>
 
 struct sys_timer;
arch/arm/plat-omap/include/plat/prcm.h +0 -7
index ab77442..3769fc6 100644
@@ -34,15 +34,8 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
 void omap3_prcm_save_context(void);
 void omap3_prcm_restore_context(void);
 
-u32 prm_read_mod_reg(s16 module, u16 idx);
-void prm_write_mod_reg(u32 val, s16 module, u16 idx);
-u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
-u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
 u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
 u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
-u32 cm_read_mod_reg(s16 module, u16 idx);
-void cm_write_mod_reg(u32 val, s16 module, u16 idx);
-u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
 
 #endif
 
arch/arm/plat-omap/mcbsp.c +2 -0
index fdecd33..95449b9 100644
@@ -28,6 +28,8 @@
 #include <plat/dma.h>
 #include <plat/mcbsp.h>
 
+/* XXX These "sideways" includes are a sign that something is wrong */
+#include "../mach-omap2/cm2xxx_3xxx.h"
 #include "../mach-omap2/cm-regbits-34xx.h"
 
 struct omap_mcbsp **mcbsp_ptr;
arch/arm/plat-omap/sram.c +3 -2
index 93641df..6ef0bde 100644
@@ -33,9 +33,10 @@
 
 #include "sram.h"
 #include "fb.h"
+
+/* XXX These "sideways" includes are a sign that something is wrong */
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-# include "../mach-omap2/prm.h"
-# include "../mach-omap2/cm.h"
+# include "../mach-omap2/prm2xxx_3xxx.h"
 # include "../mach-omap2/sdrc.h"
 #endif
 
drivers/staging/tidspbridge/core/_tiomap.h +6 -0
index 1c1f157..7fac488 100644
@@ -21,6 +21,12 @@
 
 #include <plat/powerdomain.h>
 #include <plat/clockdomain.h>
+/*
+ * XXX These mach-omap2/ includes are wrong and should be removed.  No
+ * driver should read or write to PRM/CM registers directly; they
+ * should rely on OMAP core code to do this.
+ */
+#include <mach-omap2/cm2xxx_3xxx.h>
 #include <mach-omap2/prm-regbits-34xx.h>
 #include <mach-omap2/cm-regbits-34xx.h>
 #include <dspbridge/devdefs.h>
Signature · 1 line
1.7.2.3
#22 lore raw

PATCH 13/14 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

Hi,

Quoted 14 lines · Paul Walmsley
Quoted 11 lines · Paul Walmsley

In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. ?Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific.

This process also requires the #includes in each of these files to be changed to reference the new file name. ?As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so.

Quoted 3 lines

This patch has been updated to also take care of getting DSPBridge to build again. ?Omar, Felipe, could you please take a look at the mach-omap2/dsp.c and _tiomap.h changes and ack them?

I would prefer the XX comments in a separate chunk:

/*
* license notice
*/

/*
* XXX
*/

But otherwise it's ok.

Signature · 1 line
Felipe Contreras
author maintainer
#23 lore raw

PATCH 13/14 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

Hi Felipe

Quoted 11 lines · Felipe Contreras

I would prefer the XX comments in a separate chunk:

/*
* license notice
*/

/*
* XXX
*/

But otherwise it's ok.

Thanks, I've made that change and added your Ack. The updated patch follows.

- Paul

From: Paul Walmsley <[email protected]>
Date: Tue, 21 Dec 2010 15:30:55 -0700
Subject: [PATCH] OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific.

This process also requires the #includes in each of these files to be changed to reference the new file name. As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so.

Thanks to Felipe Contreras <[email protected]> for comments on this patch.

---
 arch/arm/mach-omap2/Makefile                     |   11 +-
 arch/arm/mach-omap2/clkt2xxx_apll.c              |    2 +-
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c          |    2 +-
 arch/arm/mach-omap2/clkt2xxx_osc.c               |    2 +-
 arch/arm/mach-omap2/clkt2xxx_sys.c               |    2 +-
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c     |    2 +-
 arch/arm/mach-omap2/clkt_dpll.c                  |    1 -
 arch/arm/mach-omap2/clock.c                      |    4 +-
 arch/arm/mach-omap2/clock2420_data.c             |    4 +-
 arch/arm/mach-omap2/clock2430.c                  |    2 +-
 arch/arm/mach-omap2/clock2430_data.c             |    4 +-
 arch/arm/mach-omap2/clock34xx.c                  |    2 +-
 arch/arm/mach-omap2/clock3517.c                  |    2 +-
 arch/arm/mach-omap2/clock3xxx.c                  |    4 +-
 arch/arm/mach-omap2/clock3xxx_data.c             |    4 +-
 arch/arm/mach-omap2/clock44xx_data.c             |    6 +-
 arch/arm/mach-omap2/clockdomain.c                |    5 +-
 arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c |    4 +-
 arch/arm/mach-omap2/clockdomains44xx_data.c      |    2 +
 arch/arm/mach-omap2/cm-regbits-24xx.h            |    2 -
 arch/arm/mach-omap2/cm-regbits-34xx.h            |    2 -
 arch/arm/mach-omap2/cm-regbits-44xx.h            |    3 -
 arch/arm/mach-omap2/cm.h                         |  134 +--------
 arch/arm/mach-omap2/{cm.c => cm2xxx_3xxx.c}      |   39 ++-
 arch/arm/mach-omap2/cm2xxx_3xxx.h                |  131 ++++++++
 arch/arm/mach-omap2/cm44xx.h                     |    1 +
 arch/arm/mach-omap2/cm4xxx.c                     |    2 +-
 arch/arm/mach-omap2/control.c                    |    4 +-
 arch/arm/mach-omap2/dpll3xxx.c                   |    4 +-
 arch/arm/mach-omap2/dsp.c                        |   11 +-
 arch/arm/mach-omap2/omap_hwmod.c                 |    5 +-
 arch/arm/mach-omap2/pm-debug.c                   |    4 +-
 arch/arm/mach-omap2/pm24xx.c                     |    4 +-
 arch/arm/mach-omap2/pm34xx.c                     |    4 +-
 arch/arm/mach-omap2/powerdomain.c                |    3 +
 arch/arm/mach-omap2/powerdomain44xx.c            |    1 +
 arch/arm/mach-omap2/powerdomains2xxx_data.c      |    4 +-
 arch/arm/mach-omap2/powerdomains3xxx_data.c      |    4 +-
 arch/arm/mach-omap2/powerdomains44xx_data.c      |    1 -
 arch/arm/mach-omap2/prcm-common.h                |    6 +
 arch/arm/mach-omap2/prcm.c                       |   88 +-----
 arch/arm/mach-omap2/prm-regbits-24xx.h           |    2 +-
 arch/arm/mach-omap2/prm-regbits-34xx.h           |    8 +-
 arch/arm/mach-omap2/prm-regbits-44xx.h           |    2 -
 arch/arm/mach-omap2/prm.h                        |  352 +--------------------
 arch/arm/mach-omap2/prm2xxx_3xxx.c               |   51 +++-
 arch/arm/mach-omap2/prm2xxx_3xxx.h               |  367 ++++++++++++++++++++++
 arch/arm/mach-omap2/prm44xx.h                    |    1 +
 arch/arm/mach-omap2/sdrc.c                       |    2 -
 arch/arm/mach-omap2/sdrc2xxx.c                   |    2 +-
 arch/arm/mach-omap2/serial.c                     |    4 +-
 arch/arm/mach-omap2/sleep34xx.S                  |    4 +-
 arch/arm/mach-omap2/sram242x.S                   |    4 +-
 arch/arm/mach-omap2/sram243x.S                   |    4 +-
 arch/arm/mach-omap2/sram34xx.S                   |    2 +-
 arch/arm/plat-omap/include/plat/common.h         |    2 +
 arch/arm/plat-omap/include/plat/prcm.h           |    7 -
 arch/arm/plat-omap/mcbsp.c                       |    2 +
 arch/arm/plat-omap/sram.c                        |    5 +-
 drivers/staging/tidspbridge/core/_tiomap.h       |    6 +
 60 files changed, 699 insertions(+), 650 deletions(-)
 rename arch/arm/mach-omap2/{cm.c => cm2xxx_3xxx.c} (67%)
 create mode 100644 arch/arm/mach-omap2/cm2xxx_3xxx.h
 create mode 100644 arch/arm/mach-omap2/prm2xxx_3xxx.h
arch/arm/mach-omap2/Makefile +7 -4
index 2006dee..b2e4f7b 100644
@@ -6,7 +6,7 @@
 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o
 
-omap-2-3-common				= irq.o sdrc.o prm2xxx_3xxx.o
+omap-2-3-common				= irq.o sdrc.o
 hwmod-common				= omap_hwmod.o \
 					  omap_hwmod_common_data.o
 clock-common				= clock.o clock_common_data.o \
@@ -72,9 +72,12 @@ endif
 endif
 
 # PRCM
-obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm.o
-obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm.o
-obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm4xxx.o
+obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
+# XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
+# will be removed once the OMAP4 part of the codebase is converted to
+# use OMAP4-specific PRCM functions.
+obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cm2xxx_3xxx.o cm4xxx.o
 
 # OMAP powerdomain framework
 powerdomain-common			+= powerdomain.o powerdomain-common.o
arch/arm/mach-omap2/clkt2xxx_apll.c +1 -1
index 66e01ac..954d11f 100644
@@ -26,7 +26,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
arch/arm/mach-omap2/clkt2xxx_dpllcore.c +1 -1
index 01904843..530a76b 100644
@@ -32,7 +32,7 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /* #define DOWN_VARIABLE_DPLL 1 */		/* Experimental */
arch/arm/mach-omap2/clkt2xxx_osc.c +1 -1
index 2167be8..df7b805 100644
@@ -27,7 +27,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 
 static int omap2_enable_osc_ck(struct clk *clk)
arch/arm/mach-omap2/clkt2xxx_sys.c +1 -1
index 822b5a7..8693cfd 100644
@@ -26,7 +26,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 
 void __iomem *prcm_clksrc_ctrl;
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +1 -1
index aef6291..f49f47d 100644
@@ -40,7 +40,7 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 const struct prcm_config *curr_prcm_set;
arch/arm/mach-omap2/clkt_dpll.c +0 -1
index 6ce512e..337392c 100644
@@ -24,7 +24,6 @@
 #include <plat/clock.h>
 
 #include "clock.h"
-#include "cm.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
arch/arm/mach-omap2/clock.c +1 -3
index b5babf5..cda2f1d 100644
@@ -29,9 +29,7 @@
 #include <plat/prcm.h>
 
 #include "clock.h"
-#include "prm.h"
-#include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
arch/arm/mach-omap2/clock2420_data.c +2 -2
index ed61ac2..0b2471a 100644
@@ -22,8 +22,8 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
arch/arm/mach-omap2/clock2430.c +1 -1
index 44d0ccc..d87bc9c 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock2xxx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 
 /**
arch/arm/mach-omap2/clock2430_data.c +2 -2
index 1bded4e..570c26d 100644
@@ -22,8 +22,8 @@
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
arch/arm/mach-omap2/clock34xx.c +1 -1
index 6febd5f..287abc4 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /**
arch/arm/mach-omap2/clock3517.c +1 -1
index b496a93..74116a3 100644
@@ -25,7 +25,7 @@
 
 #include "clock.h"
 #include "clock3517.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/clock3xxx.c +2 -2
index a447c4d..81f5fdb 100644
@@ -25,9 +25,9 @@
 
 #include "clock.h"
 #include "clock3xxx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/clock3xxx_data.c +2 -2
index ee8aa39..a179edb 100644
@@ -28,9 +28,9 @@
 #include "clock36xx.h"
 #include "clock3517.h"
 
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
 #include "control.h"
 
arch/arm/mach-omap2/clock44xx_data.c +5 -1
index 254f341..91ab6f2 100644
@@ -33,11 +33,15 @@
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
 #include "cm-regbits-44xx.h"
-#include "prm.h"
+#include "prm44xx.h"
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "control.h"
 
+/* OMAP4 modulemode control */
+#define OMAP4430_MODULEMODE_HWCTRL			0
+#define OMAP4430_MODULEMODE_SWCTRL			1
+
 /* Root clocks */
 
 static struct clk extalt_clkin_ck = {
arch/arm/mach-omap2/clockdomain.c +3 -2
index 6fb61b1..a2142e0 100644
@@ -27,9 +27,10 @@
 
 #include <linux/bitops.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 
 #include <plat/clock.h>
 #include <plat/powerdomain.h>
arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +2 -2
index 8dadf75..de1d3b7 100644
@@ -36,8 +36,8 @@
 #include <linux/io.h>
 
 #include <plat/clockdomain.h>
-#include "cm.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 #include "cm-regbits-44xx.h"
arch/arm/mach-omap2/clockdomains44xx_data.c +2 -0
index d4a5206..7fc81f6 100644
@@ -27,6 +27,8 @@
 #include <linux/io.h>
 
 #include <plat/clockdomain.h>
+#include "cm1_44xx.h"
+#include "cm2_44xx.h"
 
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
arch/arm/mach-omap2/cm-regbits-24xx.h +0 -2
index 9a106c0..0856f2b 100644
@@ -14,8 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include "cm.h"
-
 /* Bits shared between registers */
 
 /* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
arch/arm/mach-omap2/cm-regbits-34xx.h +0 -2
index 4f959a7..cd9ff8b 100644
@@ -14,8 +14,6 @@
  * published by the Free Software Foundation.
  */
 
-#include "cm.h"
-
 /* Bits shared between registers */
 
 /* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
arch/arm/mach-omap2/cm-regbits-44xx.h +0 -3
index 0b72be4..9d47a05 100644
@@ -22,9 +22,6 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 
-#include "cm.h"
-
-
 /*
  * Used by CM_L3_1_DYNAMICDEP, CM_L3_1_DYNAMICDEP_RESTORE, CM_MPU_DYNAMICDEP,
  * CM_TESLA_DYNAMICDEP
arch/arm/mach-omap2/cm.h +3 -131

144 lines not on this page · raw message

arch/arm/mach-omap2/cm2xxx_3xxx.c renamed from arch/arm/mach-omap2/cm.c +35 -4
similarity index 67%
rename from arch/arm/mach-omap2/cm.c
rename to arch/arm/mach-omap2/cm2xxx_3xxx.c
index 721c3b6..5978ce4 100644
@@ -10,7 +10,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
@@ -19,11 +18,10 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <asm/atomic.h>
-
 #include <plat/common.h>
 
 #include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"
 
@@ -31,6 +29,40 @@ static const u8 cm_idlest_offs[] = {
 	CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
 };
 
+
+u32 cm_read_mod_reg(s16 module, u16 idx)
+{
+	return __raw_readl(cm_base + module + idx);
+}
+
+void cm_write_mod_reg(u32 val, s16 module, u16 idx)
+{
+	__raw_writel(val, cm_base + module + idx);
+}
+
+/* Read-modify-write a register in a CM module. Caller must lock */
+u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
+{
+	u32 v;
+
+	v = cm_read_mod_reg(module, idx);
+	v &= ~mask;
+	v |= bits;
+	cm_write_mod_reg(v, module, idx);
+
+	return v;
+}
+
+u32 cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
+{
+	return cm_rmw_mod_reg_bits(bits, bits, module, idx);
+}
+
+u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
+{
+	return cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
+}
+
 /**
  * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby
  * @prcm_mod: PRCM module offset
@@ -59,7 +91,6 @@ int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
 	else
 		BUG();
 
-	/* XXX should be OMAP2 CM */
 	omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
 			  MAX_MODULE_READY_TIME, i);
 
arch/arm/mach-omap2/cm2xxx_3xxx.h new file +131 -0

131 lines not on this page · raw message

arch/arm/mach-omap2/cm44xx.h +1 -0
index d390526..48fc3f4 100644
@@ -18,6 +18,7 @@
 
 
 #include "prcm-common.h"
+#include "cm.h"
 
 #define OMAP4_CM_CLKSTCTRL				0x0000
 
arch/arm/mach-omap2/cm4xxx.c +1 -1
index f8a660a..25d2b3e 100644
@@ -23,7 +23,7 @@
 
 #include <plat/common.h>
 
-#include "cm.h"
+#include "cm44xx.h"
 #include "cm-regbits-44xx.h"
 
 /**
arch/arm/mach-omap2/control.c +2 -2
index b066c6e..2506edf 100644
@@ -20,8 +20,8 @@
 
 #include "cm-regbits-34xx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 #include "pm.h"
 #include "control.h"
arch/arm/mach-omap2/dpll3xxx.c +1 -3
index ed8d330..cb535ee 100644
@@ -32,9 +32,7 @@
 #include <asm/clkdev.h>
 
 #include "clock.h"
-#include "prm.h"
-#include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /* CM_AUTOIDLE_PLL*.AUTO_* bit values */
arch/arm/mach-omap2/dsp.c +9 -2
index 6feeeae..cf5f333 100644
@@ -11,9 +11,16 @@
  * published by the Free Software Foundation.
  */
 
+/*
+ * XXX The function pointers to the PRM/CM functions are incorrect and
+ * should be removed.  No device driver should be changing PRM/CM bits
+ * directly; that's a layering violation -- those bits are the responsibility
+ * of the OMAP PM core code.
+ */
+
 #include <linux/platform_device.h>
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #ifdef CONFIG_BRIDGE_DVFS
 #include <plat/omap-pm.h>
 #endif
arch/arm/mach-omap2/omap_hwmod.c +3 -2
index 2b660e5..1312ce2 100644
@@ -145,8 +145,9 @@
 #include <plat/omap_hwmod.h>
 #include <plat/prcm.h>
 
-#include "cm.h"
-#include "prm.h"
+#include "cm2xxx_3xxx.h"
+#include "cm44xx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
 /* Maximum microseconds to wait for OMAP module to softreset */
arch/arm/mach-omap2/pm-debug.c +2 -2
index a8afb61..1f5d68b 100644
@@ -33,8 +33,8 @@
 #include <plat/clockdomain.h>
 #include <plat/dmtimer.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
 
 int omap2_pm_debug;
arch/arm/mach-omap2/pm24xx.c +2 -2
index aea7ced..8ea49dc 100644
@@ -42,9 +42,9 @@
 #include <plat/dma.h>
 #include <plat/board.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
 #include "sdrc.h"
 #include "pm.h"
arch/arm/mach-omap2/pm34xx.c +2 -2
index c45b4fa..7e500d8 100644
@@ -41,11 +41,11 @@
 
 #include <asm/tlbflush.h>
 
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 #include "prm-regbits-34xx.h"
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
 #include "sdrc.h"
 #include "control.h"
arch/arm/mach-omap2/powerdomain.c +3 -0
index 77f42b9..8a0dcd0 100644
@@ -19,6 +19,9 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include "cm2xxx_3xxx.h"
+#include "cm44xx.h"
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
 #include <plat/cpu.h>
arch/arm/mach-omap2/powerdomain44xx.c +1 -0
index 7efdf68..dae767b 100644
@@ -18,6 +18,7 @@
 
 #include <plat/powerdomain.h>
 #include <plat/prcm.h>
+#include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
 #include "powerdomains.h"
arch/arm/mach-omap2/powerdomains2xxx_data.c +1 -3
index adc85d3..e136895 100644
@@ -19,10 +19,8 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
-#include "cm.h"
-#include "cm-regbits-24xx.h"
 
 /* 24XX powerdomains and dependencies */
 
arch/arm/mach-omap2/powerdomains3xxx_data.c +2 -2
index 1ddc040..1830c63 100644
@@ -19,9 +19,9 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
 /*
arch/arm/mach-omap2/powerdomains44xx_data.c +0 -1
index cf6adfc..069a21d 100644
@@ -26,7 +26,6 @@
 #include "powerdomains.h"
 
 #include "prcm-common.h"
-#include "prm.h"
 #include "prm-regbits-44xx.h"
 #include "prm44xx.h"
 #include "prcm_mpu44xx.h"
arch/arm/mach-omap2/prcm-common.h +6 -0
index 427ab61..87486f5 100644
@@ -396,5 +396,11 @@
  */
 #define MAX_MODULE_HARDRESET_WAIT		10000
 
+# ifndef __ASSEMBLER__
+extern void __iomem *prm_base;
+extern void __iomem *cm_base;
+extern void __iomem *cm2_base;
+# endif
+
 #endif
 
arch/arm/mach-omap2/prcm.c +9 -79

117 lines not on this page · raw message

arch/arm/mach-omap2/prm-regbits-24xx.h +1 -1
index 0b188ff..6ac9661 100644
@@ -14,7 +14,7 @@
  * published by the Free Software Foundation.
  */
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 
 /* Bits shared between registers */
 
arch/arm/mach-omap2/prm-regbits-34xx.h +4 -4
index ec1a710..64c087a 100644
@@ -1,6 +1,3 @@
-#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
-#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
-
 /*
  * OMAP3430 Power/Reset Management register bits
  *
@@ -13,8 +10,11 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 
 /* Shared register bits */
 
arch/arm/mach-omap2/prm-regbits-44xx.h +0 -2
index 25b19b6..6d2776f 100644
@@ -22,8 +22,6 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 
-#include "prm.h"
-
 
 /*
  * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
arch/arm/mach-omap2/prm.h +4 -348

378 lines not on this page · raw message

arch/arm/mach-omap2/prm2xxx_3xxx.c +49 -2

67 lines not on this page · raw message

arch/arm/mach-omap2/prm2xxx_3xxx.h new file +367 -0

367 lines not on this page · raw message

arch/arm/mach-omap2/prm44xx.h +1 -0
index 0d444a5..3d36149 100644
@@ -26,6 +26,7 @@
 #define __ARCH_ARM_MACH_OMAP2_PRM44XX_H
 
 #include "prcm-common.h"
+#include "prm.h"
 
 #define OMAP4430_PRM_BASE		0x4a306000
 
arch/arm/mach-omap2/sdrc.c +0 -2
index 4c65f56..da6f3a6 100644
@@ -27,8 +27,6 @@
 #include <plat/clock.h>
 #include <plat/sram.h>
 
-#include "prm.h"
-
 #include <plat/sdrc.h>
 #include "sdrc.h"
 
arch/arm/mach-omap2/sdrc2xxx.c +1 -1
index 0f4d27a..64778b6 100644
@@ -28,7 +28,7 @@
 #include <plat/clock.h>
 #include <plat/sram.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "clock.h"
 #include <plat/sdrc.h>
 #include "sdrc.h"
arch/arm/mach-omap2/serial.c +2 -2
index 0548bbd..26770d8 100644
@@ -40,9 +40,9 @@
 #include <plat/omap_hwmod.h>
 #include <plat/omap_device.h>
 
-#include "prm.h"
+#include "prm2xxx_3xxx.h"
 #include "pm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
 #include "control.h"
 
arch/arm/mach-omap2/sleep34xx.S +2 -2
index e3b5cd7..98d8232 100644
@@ -27,8 +27,8 @@
 #include <plat/sram.h>
 #include <mach/io.h>
 
-#include "cm.h"
-#include "prm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
 #include "sdrc.h"
 #include "control.h"
 
arch/arm/mach-omap2/sram242x.S +2 -2
index 92e6e1a..8e7e6fe 100644
@@ -27,8 +27,8 @@
 #include <mach/io.h>
 #include <mach/hardware.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 
 	.text
arch/arm/mach-omap2/sram243x.S +2 -2
index ab49736..9ea87f6 100644
@@ -27,8 +27,8 @@
 #include <mach/io.h>
 #include <mach/hardware.h>
 
-#include "prm.h"
-#include "cm.h"
+#include "prm2xxx_3xxx.h"
+#include "cm2xxx_3xxx.h"
 #include "sdrc.h"
 
 	.text
arch/arm/mach-omap2/sram34xx.S +1 -1
index 3637274..b7aba60 100644
@@ -32,7 +32,7 @@
 #include <mach/io.h>
 
 #include "sdrc.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
 
 	.text
 
arch/arm/plat-omap/include/plat/common.h +2 -0
index a9d69a0..6b8088e 100644
@@ -27,6 +27,8 @@
 #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
 #define __ARCH_ARM_MACH_OMAP_COMMON_H
 
+#include <linux/delay.h>
+
 #include <plat/i2c.h>
 
 struct sys_timer;
arch/arm/plat-omap/include/plat/prcm.h +0 -7
index ab77442..3769fc6 100644
@@ -34,15 +34,8 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
 void omap3_prcm_save_context(void);
 void omap3_prcm_restore_context(void);
 
-u32 prm_read_mod_reg(s16 module, u16 idx);
-void prm_write_mod_reg(u32 val, s16 module, u16 idx);
-u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
-u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
 u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
 u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
-u32 cm_read_mod_reg(s16 module, u16 idx);
-void cm_write_mod_reg(u32 val, s16 module, u16 idx);
-u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
 
 #endif
 
arch/arm/plat-omap/mcbsp.c +2 -0
index fdecd33..95449b9 100644
@@ -28,6 +28,8 @@
 #include <plat/dma.h>
 #include <plat/mcbsp.h>
 
+/* XXX These "sideways" includes are a sign that something is wrong */
+#include "../mach-omap2/cm2xxx_3xxx.h"
 #include "../mach-omap2/cm-regbits-34xx.h"
 
 struct omap_mcbsp **mcbsp_ptr;
arch/arm/plat-omap/sram.c +3 -2
index 1a686c8..e26e504 100644
@@ -33,9 +33,10 @@
 
 #include "sram.h"
 #include "fb.h"
+
+/* XXX These "sideways" includes are a sign that something is wrong */
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
-# include "../mach-omap2/prm.h"
-# include "../mach-omap2/cm.h"
+# include "../mach-omap2/prm2xxx_3xxx.h"
 # include "../mach-omap2/sdrc.h"
 #endif
 
drivers/staging/tidspbridge/core/_tiomap.h +6 -0
index 1c1f157..7fac488 100644
@@ -21,6 +21,12 @@
 
 #include <plat/powerdomain.h>
 #include <plat/clockdomain.h>
+/*
+ * XXX These mach-omap2/ includes are wrong and should be removed.  No
+ * driver should read or write to PRM/CM registers directly; they
+ * should rely on OMAP core code to do this.
+ */
+#include <mach-omap2/cm2xxx_3xxx.h>
 #include <mach-omap2/prm-regbits-34xx.h>
 #include <mach-omap2/cm-regbits-34xx.h>
 #include <dspbridge/devdefs.h>
Signature · 1 line
1.7.2.3
#24 lore raw

PATCH 13/14 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

In reply to Paul Walmsley
Quoted 19 lines · Paul Walmsley

Hi,

Quoted 11 lines · Paul Walmsley

In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. ?Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific.

This process also requires the #includes in each of these files to be changed to reference the new file name. ?As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so.

This patch has been updated to also take care of getting DSPBridge to build again. ?Omar, Felipe, could you please take a look at the mach-omap2/dsp.c and _tiomap.h changes and ack them?

...

Quoted 20 lines
arch/arm/mach-omap2/dsp.c +0 -0
index 6feeeae..a8b62d7 100644
@@ -9,11 +9,16 @@

?* 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 The function pointers to the PRM/CM functions are incorrect and
+ * should be removed. ?No device driver should be changing PRM/CM bits
+ * directly; that's a layering violation -- those bits are the responsibility
+ * of the OMAP PM core code.
?*/

?#include <linux/platform_device.h>

arch/arm/mach-omap2/dsp.c +2 -2
-#include "prm.h"
-#include "cm.h"
+#include "cm2xxx_3xxx.h"
+#include "prm2xxx_3xxx.h"
Quoted 3 lines

?#ifdef CONFIG_BRIDGE_DVFS
?#include <plat/omap-pm.h>
?#endif

I don't have a preference, I guess part of the license header makes them even more noticeable.

Quoted 14 lines
drivers/staging/tidspbridge/core/_tiomap.h +0 -0
index 1c1f157..7fac488 100644
@@ -21,6 +21,12 @@
 

?#include <plat/powerdomain.h>
?#include <plat/clockdomain.h>

drivers/staging/tidspbridge/core/_tiomap.h +6 -0
+/*
+ * XXX These mach-omap2/ includes are wrong and should be removed. ?No
+ * driver should read or write to PRM/CM registers directly; they
+ * should rely on OMAP core code to do this.
+ */
+#include <mach-omap2/cm2xxx_3xxx.h>
Quoted 3 lines

?#include <mach-omap2/prm-regbits-34xx.h>
?#include <mach-omap2/cm-regbits-34xx.h>
?#include <dspbridge/devdefs.h>

Just in case someone is wondering, there is a plan to use hwmod and move start/stop/monitor functions to dsp.c code, so, the driver can call them through pdata.

Regards,

Omar

author maintainer
#25 lore raw

PATCH 13/14 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files

Hello Omar,

Quoted 2 lines · Omar

I don't have a preference, I guess part of the license header makes them even more noticeable.

I wound up moving those comments below, per Felipe's comment.

Quoted 1 line

Thanks, ack added to the patch.

- Paul

author maintainer
#26 lore raw

PATCH 14/14 OMAP3: PRM/CM: separate CM context save/restore; remove PRM context save/restore

In reply to Paul Walmsley

The OMAP3 PRM module is in the WKUP powerdomain, which is always powered when the chip is powered, so it shouldn't be necessary to save and restore those PRM registers. Remove the PRM register save/restore code, which should save several microseconds during off-mode entry/exit, since PRM register accesses are relatively slow.

While doing so, move the CM register save/restore code into CM-specific code. The CM module has been distinct from the PRM module since 2430.

This patch includes some minor changes to pm34xx.c.

Cc Kevin Hilman <[email protected]>
Cc Rajendra Nayak <[email protected]>
Cc Tero Kristo <[email protected]>
Cc Kalle Jokiniemi <[email protected]>
---
 arch/arm/mach-omap2/cm2xxx_3xxx.c      |  296 +++++++++++++++++++++++++
 arch/arm/mach-omap2/cm2xxx_3xxx.h      |    7 +
 arch/arm/mach-omap2/pm34xx.c           |    4 
 arch/arm/mach-omap2/prcm.c             |  375 --------------------------------
 arch/arm/mach-omap2/prm2xxx_3xxx.c     |    1 
 arch/arm/plat-omap/include/plat/prcm.h |    3 
 6 files changed, 304 insertions(+), 382 deletions(-)
arch/arm/mach-omap2/cm2xxx_3xxx.c +295 -1
index 5978ce4..1c98dfc 100644
@@ -29,7 +29,6 @@ static const u8 cm_idlest_offs[] = {
 	CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
 };
 
-
 u32 cm_read_mod_reg(s16 module, u16 idx)
 {
 	return __raw_readl(cm_base + module + idx);
@@ -97,3 +96,298 @@ int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
 	return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
 }
 
+/*
+ * Context save/restore code - OMAP3 only
+ */
+#ifdef CONFIG_ARCH_OMAP3
+struct omap3_cm_regs {
+	u32 iva2_cm_clksel1;
+	u32 iva2_cm_clksel2;
+	u32 cm_sysconfig;
+	u32 sgx_cm_clksel;
+	u32 dss_cm_clksel;
+	u32 cam_cm_clksel;
+	u32 per_cm_clksel;
+	u32 emu_cm_clksel;
+	u32 emu_cm_clkstctrl;
+	u32 pll_cm_autoidle2;
+	u32 pll_cm_clksel4;
+	u32 pll_cm_clksel5;
+	u32 pll_cm_clken2;
+	u32 cm_polctrl;
+	u32 iva2_cm_fclken;
+	u32 iva2_cm_clken_pll;
+	u32 core_cm_fclken1;
+	u32 core_cm_fclken3;
+	u32 sgx_cm_fclken;
+	u32 wkup_cm_fclken;
+	u32 dss_cm_fclken;
+	u32 cam_cm_fclken;
+	u32 per_cm_fclken;
+	u32 usbhost_cm_fclken;
+	u32 core_cm_iclken1;
+	u32 core_cm_iclken2;
+	u32 core_cm_iclken3;
+	u32 sgx_cm_iclken;
+	u32 wkup_cm_iclken;
+	u32 dss_cm_iclken;
+	u32 cam_cm_iclken;
+	u32 per_cm_iclken;
+	u32 usbhost_cm_iclken;
+	u32 iva2_cm_autoidle2;
+	u32 mpu_cm_autoidle2;
+	u32 iva2_cm_clkstctrl;
+	u32 mpu_cm_clkstctrl;
+	u32 core_cm_clkstctrl;
+	u32 sgx_cm_clkstctrl;
+	u32 dss_cm_clkstctrl;
+	u32 cam_cm_clkstctrl;
+	u32 per_cm_clkstctrl;
+	u32 neon_cm_clkstctrl;
+	u32 usbhost_cm_clkstctrl;
+	u32 core_cm_autoidle1;
+	u32 core_cm_autoidle2;
+	u32 core_cm_autoidle3;
+	u32 wkup_cm_autoidle;
+	u32 dss_cm_autoidle;
+	u32 cam_cm_autoidle;
+	u32 per_cm_autoidle;
+	u32 usbhost_cm_autoidle;
+	u32 sgx_cm_sleepdep;
+	u32 dss_cm_sleepdep;
+	u32 cam_cm_sleepdep;
+	u32 per_cm_sleepdep;
+	u32 usbhost_cm_sleepdep;
+	u32 cm_clkout_ctrl;
+};
+
+static struct omap3_cm_regs cm_context;
+
+void omap3_cm_save_context(void)
+{
+	cm_context.iva2_cm_clksel1 =
+		cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
+	cm_context.iva2_cm_clksel2 =
+		cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL2);
+	cm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG);
+	cm_context.sgx_cm_clksel =
+		cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL);
+	cm_context.dss_cm_clksel =
+		cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL);
+	cm_context.cam_cm_clksel =
+		cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSEL);
+	cm_context.per_cm_clksel =
+		cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSEL);
+	cm_context.emu_cm_clksel =
+		cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
+	cm_context.emu_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.pll_cm_autoidle2 =
+		cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
+	cm_context.pll_cm_clksel4 =
+		cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4);
+	cm_context.pll_cm_clksel5 =
+		cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5);
+	cm_context.pll_cm_clken2 =
+		cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2);
+	cm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL);
+	cm_context.iva2_cm_fclken =
+		cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_FCLKEN);
+	cm_context.iva2_cm_clken_pll = cm_read_mod_reg(OMAP3430_IVA2_MOD,
+						       OMAP3430_CM_CLKEN_PLL);
+	cm_context.core_cm_fclken1 =
+		cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
+	cm_context.core_cm_fclken3 =
+		cm_read_mod_reg(CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
+	cm_context.sgx_cm_fclken =
+		cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_FCLKEN);
+	cm_context.wkup_cm_fclken =
+		cm_read_mod_reg(WKUP_MOD, CM_FCLKEN);
+	cm_context.dss_cm_fclken =
+		cm_read_mod_reg(OMAP3430_DSS_MOD, CM_FCLKEN);
+	cm_context.cam_cm_fclken =
+		cm_read_mod_reg(OMAP3430_CAM_MOD, CM_FCLKEN);
+	cm_context.per_cm_fclken =
+		cm_read_mod_reg(OMAP3430_PER_MOD, CM_FCLKEN);
+	cm_context.usbhost_cm_fclken =
+		cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
+	cm_context.core_cm_iclken1 =
+		cm_read_mod_reg(CORE_MOD, CM_ICLKEN1);
+	cm_context.core_cm_iclken2 =
+		cm_read_mod_reg(CORE_MOD, CM_ICLKEN2);
+	cm_context.core_cm_iclken3 =
+		cm_read_mod_reg(CORE_MOD, CM_ICLKEN3);
+	cm_context.sgx_cm_iclken =
+		cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_ICLKEN);
+	cm_context.wkup_cm_iclken =
+		cm_read_mod_reg(WKUP_MOD, CM_ICLKEN);
+	cm_context.dss_cm_iclken =
+		cm_read_mod_reg(OMAP3430_DSS_MOD, CM_ICLKEN);
+	cm_context.cam_cm_iclken =
+		cm_read_mod_reg(OMAP3430_CAM_MOD, CM_ICLKEN);
+	cm_context.per_cm_iclken =
+		cm_read_mod_reg(OMAP3430_PER_MOD, CM_ICLKEN);
+	cm_context.usbhost_cm_iclken =
+		cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
+	cm_context.iva2_cm_autoidle2 =
+		cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
+	cm_context.mpu_cm_autoidle2 =
+		cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
+	cm_context.iva2_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.mpu_cm_clkstctrl =
+		cm_read_mod_reg(MPU_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.core_cm_clkstctrl =
+		cm_read_mod_reg(CORE_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.sgx_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430ES2_SGX_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.dss_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.cam_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.per_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430_PER_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.neon_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430_NEON_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.usbhost_cm_clkstctrl =
+		cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_context.core_cm_autoidle1 =
+		cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1);
+	cm_context.core_cm_autoidle2 =
+		cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE2);
+	cm_context.core_cm_autoidle3 =
+		cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE3);
+	cm_context.wkup_cm_autoidle =
+		cm_read_mod_reg(WKUP_MOD, CM_AUTOIDLE);
+	cm_context.dss_cm_autoidle =
+		cm_read_mod_reg(OMAP3430_DSS_MOD, CM_AUTOIDLE);
+	cm_context.cam_cm_autoidle =
+		cm_read_mod_reg(OMAP3430_CAM_MOD, CM_AUTOIDLE);
+	cm_context.per_cm_autoidle =
+		cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
+	cm_context.usbhost_cm_autoidle =
+		cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
+	cm_context.sgx_cm_sleepdep =
+		cm_read_mod_reg(OMAP3430ES2_SGX_MOD, OMAP3430_CM_SLEEPDEP);
+	cm_context.dss_cm_sleepdep =
+		cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP3430_CM_SLEEPDEP);
+	cm_context.cam_cm_sleepdep =
+		cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP3430_CM_SLEEPDEP);
+	cm_context.per_cm_sleepdep =
+		cm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_CM_SLEEPDEP);
+	cm_context.usbhost_cm_sleepdep =
+		cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
+	cm_context.cm_clkout_ctrl =
+		cm_read_mod_reg(OMAP3430_CCR_MOD, OMAP3_CM_CLKOUT_CTRL_OFFSET);
+}
+
+void omap3_cm_restore_context(void)
+{
+	cm_write_mod_reg(cm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
+			 CM_CLKSEL1);
+	cm_write_mod_reg(cm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,
+			 CM_CLKSEL2);
+	__raw_writel(cm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG);
+	cm_write_mod_reg(cm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD,
+			 CM_CLKSEL);
+	cm_write_mod_reg(cm_context.dss_cm_clksel, OMAP3430_DSS_MOD,
+			 CM_CLKSEL);
+	cm_write_mod_reg(cm_context.cam_cm_clksel, OMAP3430_CAM_MOD,
+			 CM_CLKSEL);
+	cm_write_mod_reg(cm_context.per_cm_clksel, OMAP3430_PER_MOD,
+			 CM_CLKSEL);
+	cm_write_mod_reg(cm_context.emu_cm_clksel, OMAP3430_EMU_MOD,
+			 CM_CLKSEL1);
+	cm_write_mod_reg(cm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.pll_cm_autoidle2, PLL_MOD,
+			 CM_AUTOIDLE2);
+	cm_write_mod_reg(cm_context.pll_cm_clksel4, PLL_MOD,
+			 OMAP3430ES2_CM_CLKSEL4);
+	cm_write_mod_reg(cm_context.pll_cm_clksel5, PLL_MOD,
+			 OMAP3430ES2_CM_CLKSEL5);
+	cm_write_mod_reg(cm_context.pll_cm_clken2, PLL_MOD,
+			 OMAP3430ES2_CM_CLKEN2);
+	__raw_writel(cm_context.cm_polctrl, OMAP3430_CM_POLCTRL);
+	cm_write_mod_reg(cm_context.iva2_cm_fclken, OMAP3430_IVA2_MOD,
+			 CM_FCLKEN);
+	cm_write_mod_reg(cm_context.iva2_cm_clken_pll, OMAP3430_IVA2_MOD,
+			 OMAP3430_CM_CLKEN_PLL);
+	cm_write_mod_reg(cm_context.core_cm_fclken1, CORE_MOD, CM_FCLKEN1);
+	cm_write_mod_reg(cm_context.core_cm_fclken3, CORE_MOD,
+			 OMAP3430ES2_CM_FCLKEN3);
+	cm_write_mod_reg(cm_context.sgx_cm_fclken, OMAP3430ES2_SGX_MOD,
+			 CM_FCLKEN);
+	cm_write_mod_reg(cm_context.wkup_cm_fclken, WKUP_MOD, CM_FCLKEN);
+	cm_write_mod_reg(cm_context.dss_cm_fclken, OMAP3430_DSS_MOD,
+			 CM_FCLKEN);
+	cm_write_mod_reg(cm_context.cam_cm_fclken, OMAP3430_CAM_MOD,
+			 CM_FCLKEN);
+	cm_write_mod_reg(cm_context.per_cm_fclken, OMAP3430_PER_MOD,
+			 CM_FCLKEN);
+	cm_write_mod_reg(cm_context.usbhost_cm_fclken,
+			 OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
+	cm_write_mod_reg(cm_context.core_cm_iclken1, CORE_MOD, CM_ICLKEN1);
+	cm_write_mod_reg(cm_context.core_cm_iclken2, CORE_MOD, CM_ICLKEN2);
+	cm_write_mod_reg(cm_context.core_cm_iclken3, CORE_MOD, CM_ICLKEN3);
+	cm_write_mod_reg(cm_context.sgx_cm_iclken, OMAP3430ES2_SGX_MOD,
+			 CM_ICLKEN);
+	cm_write_mod_reg(cm_context.wkup_cm_iclken, WKUP_MOD, CM_ICLKEN);
+	cm_write_mod_reg(cm_context.dss_cm_iclken, OMAP3430_DSS_MOD,
+			 CM_ICLKEN);
+	cm_write_mod_reg(cm_context.cam_cm_iclken, OMAP3430_CAM_MOD,
+			 CM_ICLKEN);
+	cm_write_mod_reg(cm_context.per_cm_iclken, OMAP3430_PER_MOD,
+			 CM_ICLKEN);
+	cm_write_mod_reg(cm_context.usbhost_cm_iclken,
+			 OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
+	cm_write_mod_reg(cm_context.iva2_cm_autoidle2, OMAP3430_IVA2_MOD,
+			 CM_AUTOIDLE2);
+	cm_write_mod_reg(cm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2);
+	cm_write_mod_reg(cm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.mpu_cm_clkstctrl, MPU_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.core_cm_clkstctrl, CORE_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.per_cm_clkstctrl, OMAP3430_PER_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD,
+			 OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.usbhost_cm_clkstctrl,
+			 OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL);
+	cm_write_mod_reg(cm_context.core_cm_autoidle1, CORE_MOD,
+			 CM_AUTOIDLE1);
+	cm_write_mod_reg(cm_context.core_cm_autoidle2, CORE_MOD,
+			 CM_AUTOIDLE2);
+	cm_write_mod_reg(cm_context.core_cm_autoidle3, CORE_MOD,
+			 CM_AUTOIDLE3);
+	cm_write_mod_reg(cm_context.wkup_cm_autoidle, WKUP_MOD, CM_AUTOIDLE);
+	cm_write_mod_reg(cm_context.dss_cm_autoidle, OMAP3430_DSS_MOD,
+			 CM_AUTOIDLE);
+	cm_write_mod_reg(cm_context.cam_cm_autoidle, OMAP3430_CAM_MOD,
+			 CM_AUTOIDLE);
+	cm_write_mod_reg(cm_context.per_cm_autoidle, OMAP3430_PER_MOD,
+			 CM_AUTOIDLE);
+	cm_write_mod_reg(cm_context.usbhost_cm_autoidle,
+			 OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
+	cm_write_mod_reg(cm_context.sgx_cm_sleepdep, OMAP3430ES2_SGX_MOD,
+			 OMAP3430_CM_SLEEPDEP);
+	cm_write_mod_reg(cm_context.dss_cm_sleepdep, OMAP3430_DSS_MOD,
+			 OMAP3430_CM_SLEEPDEP);
+	cm_write_mod_reg(cm_context.cam_cm_sleepdep, OMAP3430_CAM_MOD,
+			 OMAP3430_CM_SLEEPDEP);
+	cm_write_mod_reg(cm_context.per_cm_sleepdep, OMAP3430_PER_MOD,
+			 OMAP3430_CM_SLEEPDEP);
+	cm_write_mod_reg(cm_context.usbhost_cm_sleepdep,
+			 OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
+	cm_write_mod_reg(cm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD,
+			 OMAP3_CM_CLKOUT_CTRL_OFFSET);
+}
+#endif
arch/arm/mach-omap2/cm2xxx_3xxx.h +7 -0
index 5e57211..ce2582c1 100644
@@ -128,4 +128,11 @@ extern u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx);
 /* CM_IDLEST_GFX */
 #define OMAP_ST_GFX_MASK				(1 << 0)
 
+
+/* Function prototypes */
+# ifndef __ASSEMBLER__
+extern void omap3_cm_save_context(void);
+extern void omap3_cm_restore_context(void);
+# endif
+
 #endif
arch/arm/mach-omap2/pm34xx.c +2 -2
index 0d73d75..a776241 100644
@@ -407,7 +407,7 @@ void omap_sram_idle(void)
 		omap_uart_prepare_idle(1);
 		if (core_next_state == PWRDM_POWER_OFF) {
 			omap3_core_save_context();
-			omap3_prcm_save_context();
+			omap3_cm_save_context();
 		}
 	}
 
@@ -447,7 +447,7 @@ void omap_sram_idle(void)
 		core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm);
 		if (core_prev_state == PWRDM_POWER_OFF) {
 			omap3_core_restore_context();
-			omap3_prcm_restore_context();
+			omap3_cm_restore_context();
 			omap3_sram_restore_context();
 			omap2_sms_restore_context();
 		}
arch/arm/mach-omap2/prcm.c +0 -375

384 lines not on this page · raw message

arch/arm/mach-omap2/prm2xxx_3xxx.c +0 -1
index 064b52a..3e1d36c 100644
@@ -154,4 +154,3 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift)
 
 	return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
 }
-
arch/arm/plat-omap/include/plat/prcm.h +0 -3
index 3769fc6..d059a05 100644
@@ -31,9 +31,6 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
 #define START_PADCONF_SAVE 0x2
 #define PADCONF_SAVE_DONE  0x1
 
-void omap3_prcm_save_context(void);
-void omap3_prcm_restore_context(void);
-
 u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
 u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
 
#27 lore raw

cover OMAP: PRCM/powerdomain/clockdomain patches for 2.6.38, part one

In reply to Paul Walmsley
Quoted 1 line · Paul Walmsley

This patch series, intended for 2.6.38:

[...]

Quoted 2 lines

Kevin, I'd appreciate review and acks, if appropriate, on the patches that touch code that you maintain.

I did some PM testing of this series on 34xx/n900 and 35xx/beagle using retention idle & sususpend and off-idle and suspend.

For testing with other PM features that are targetted for 2.6.38, I've included it as part of my pm-core branch (which also includes your previous hwmod series and the watchdog series, among other things.)

Kevin

author maintainer
#28 lore raw

cover OMAP: PRCM/powerdomain/clockdomain patches for 2.6.38, part one

Quoted 12 lines · Kevin Hilman
Quoted 1 line · Paul Walmsley

This patch series, intended for 2.6.38:

[...]

Quoted 2 lines

Kevin, I'd appreciate review and acks, if appropriate, on the patches that touch code that you maintain.

Quoted 6 lines

I did some PM testing of this series on 34xx/n900 and 35xx/beagle using retention idle & sususpend and off-idle and suspend.

For testing with other PM features that are targetted for 2.6.38, I've included it as part of my pm-core branch (which also includes your previous hwmod series and the watchdog series, among other things.)

Thanks for testing, Kevin, I'll update the patches accordingly.

- Paul