Skip to contentSkip to conversation

ARM: OMAP AM33xx: PRM/CM support for 3.6

PATCH New Paul Walmsley 2 participants 11 messages May 21, 2012 – Jun 11, 2012

Subsystems (5)
lore
Share & tools
lore

Paul Walmsley

author maintainer
#0 lore raw

cover ARM: OMAP AM33xx: PRM/CM support for 3.6

Hi

This series implements low-level PRM/CM support for the AM33xx series of chips. This support is a prerequisite for the kernel to reset, enable, and disable on-chip IP blocks.

This series applies against Tony's devel-soc branch at commit 8a7289f52543cc89de73e174946edaa21a2d049d ("ARM: OMAP2+: am33xx:
Make am33xx as a separate class") plus the "ARM: OMAP2+: am33xx:
Add AM335XEVM machine support" patch from Afzal. Currently they are compile-tested only.

These patches are also available from git://git.pwsan.com/linux-2.6
in the branch 'am33xx_prcm_devel_3.6'.

- Paul

---

am33xx_prcm_devel_3.6
text data bss dec hex filename
6559798 722684 5587872 12870354 c462d2 vmlinux.omap2plus_defconfig.orig
6562162 729652 5587872 12879686 c48746 vmlinux.omap2plus_defconfig

Vaibhav Hiremath (6):
ARM: OMAP2+: control: Add AM33XX control reg & sec clkctrl offset
ARM: OMAP AM33xx: voltagedomain: Add voltage domain data
ARM: OMAP AM33xx: PRM: add PRM support
ARM: OMAP AM33xx: CM: Introduce AM33xx CM APIs and register level details
ARM: OMAP AM33xx: powerdomains: add AM335x support
ARM: OMAP AM33xx: clockdomains: Add clockdomain data and respective operations

 arch/arm/mach-omap2/Makefile                  |    7 
 arch/arm/mach-omap2/clockdomain.h             |    2 
 arch/arm/mach-omap2/clockdomain33xx.c         |   74 +++
 arch/arm/mach-omap2/clockdomains33xx_data.c   |  196 +++++++
 arch/arm/mach-omap2/cm-regbits-33xx.h         |  687 +++++++++++++++++++++++++
 arch/arm/mach-omap2/cm33xx.c                  |  313 +++++++++++
 arch/arm/mach-omap2/cm33xx.h                  |  420 +++++++++++++++
 arch/arm/mach-omap2/control.h                 |   39 +
 arch/arm/mach-omap2/io.c                      |    5 
 arch/arm/mach-omap2/powerdomain.h             |   23 +
 arch/arm/mach-omap2/powerdomain33xx.c         |  229 ++++++++
 arch/arm/mach-omap2/powerdomains33xx_data.c   |  185 +++++++
 arch/arm/mach-omap2/prm-regbits-33xx.h        |  357 +++++++++++++
 arch/arm/mach-omap2/prm33xx.c                 |  134 +++++
 arch/arm/mach-omap2/prm33xx.h                 |  129 +++++
 arch/arm/mach-omap2/voltage.h                 |    1 
 arch/arm/mach-omap2/voltagedomains33xx_data.c |   43 ++
 17 files changed, 2824 insertions(+), 20 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clockdomain33xx.c
 create mode 100644 arch/arm/mach-omap2/clockdomains33xx_data.c
 create mode 100644 arch/arm/mach-omap2/cm-regbits-33xx.h
 create mode 100644 arch/arm/mach-omap2/cm33xx.c
 create mode 100644 arch/arm/mach-omap2/cm33xx.h
 create mode 100644 arch/arm/mach-omap2/powerdomain33xx.c
 create mode 100644 arch/arm/mach-omap2/powerdomains33xx_data.c
 create mode 100644 arch/arm/mach-omap2/prm-regbits-33xx.h
 create mode 100644 arch/arm/mach-omap2/prm33xx.c
 create mode 100644 arch/arm/mach-omap2/prm33xx.h
 create mode 100644 arch/arm/mach-omap2/voltagedomains33xx_data.c
author maintainer
#1 lore raw

PATCH 1/6 ARM: OMAP2+: control: Add AM33XX control reg & sec clkctrl offset

From: Vaibhav Hiremath <[email protected]>

Define AM33XX control register, in order to allow access to control register address space, also add CONTROL_SEC_CLK_CTRL register offset; both are required in clock tree data, for wdt0 and timer0 clock source select configuration.

CONTROL.SEC_CLK_CTRL register is provided to select/configure clock input for WDT0 and TIMER0.

Cc Paul Walmsley <[email protected]>
Cc Tony Lindgren <[email protected]>

[paul at pwsan.com: added include of plat/am33xx.h to fix build break;
added AM33XX_CONTROL_STATUS bitfields that will be needed for the clock tree; fixed some control.h whitespace problems while here]

---
 arch/arm/mach-omap2/control.h |   39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)
arch/arm/mach-omap2/control.h +23 -16
index a406fd0..c43f03c 100644
@@ -21,6 +21,8 @@
 #include <mach/ctrl_module_pad_core_44xx.h>
 #include <mach/ctrl_module_pad_wkup_44xx.h>
 
+#include <plat/am33xx.h>
+
 #ifndef __ASSEMBLY__
 #define OMAP242X_CTRL_REGADDR(reg)					\
 		OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
@@ -28,6 +30,8 @@
 		OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
 #define OMAP343X_CTRL_REGADDR(reg)					\
 		OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
+#define AM33XX_CTRL_REGADDR(reg)					\
+		AM33XX_L4_WK_IO_ADDRESS(AM33XX_SCM_BASE + (reg))
 #else
 #define OMAP242X_CTRL_REGADDR(reg)					\
 		OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
@@ -35,6 +39,8 @@
 		OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
 #define OMAP343X_CTRL_REGADDR(reg)					\
 		OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
+#define AM33XX_CTRL_REGADDR(reg)					\
+		AM33XX_L4_WK_IO_ADDRESS(AM33XX_SCM_BASE + (reg))
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -312,15 +318,15 @@
 						OMAP343X_SCRATCHPAD + reg)
 
 /* AM35XX_CONTROL_IPSS_CLK_CTRL bits */
-#define AM35XX_USBOTG_VBUSP_CLK_SHIFT   0
-#define AM35XX_CPGMAC_VBUSP_CLK_SHIFT   1
-#define AM35XX_VPFE_VBUSP_CLK_SHIFT     2
-#define AM35XX_HECC_VBUSP_CLK_SHIFT     3
-#define AM35XX_USBOTG_FCLK_SHIFT        8
-#define AM35XX_CPGMAC_FCLK_SHIFT        9
-#define AM35XX_VPFE_FCLK_SHIFT          10
-
-/*AM35XX CONTROL_LVL_INTR_CLEAR bits*/
+#define AM35XX_USBOTG_VBUSP_CLK_SHIFT	0
+#define AM35XX_CPGMAC_VBUSP_CLK_SHIFT	1
+#define AM35XX_VPFE_VBUSP_CLK_SHIFT	2
+#define AM35XX_HECC_VBUSP_CLK_SHIFT	3
+#define AM35XX_USBOTG_FCLK_SHIFT	8
+#define AM35XX_CPGMAC_FCLK_SHIFT	9
+#define AM35XX_VPFE_FCLK_SHIFT		10
+
+/* AM35XX CONTROL_LVL_INTR_CLEAR bits */
 #define AM35XX_CPGMAC_C0_MISC_PULSE_CLR	BIT(0)
 #define AM35XX_CPGMAC_C0_RX_PULSE_CLR	BIT(1)
 #define AM35XX_CPGMAC_C0_RX_THRESH_CLR	BIT(2)
@@ -330,21 +336,22 @@
 #define AM35XX_VPFE_CCDC_VD1_INT_CLR	BIT(6)
 #define AM35XX_VPFE_CCDC_VD2_INT_CLR	BIT(7)
 
-/*AM35XX CONTROL_IP_SW_RESET bits*/
+/* AM35XX CONTROL_IP_SW_RESET bits */
 #define AM35XX_USBOTGSS_SW_RST		BIT(0)
 #define AM35XX_CPGMACSS_SW_RST		BIT(1)
 #define AM35XX_VPFE_VBUSP_SW_RST	BIT(2)
 #define AM35XX_HECC_SW_RST		BIT(3)
 #define AM35XX_VPFE_PCLK_SW_RST		BIT(4)
 
-/*
- * CONTROL AM33XX STATUS register
- */
+/* AM33XX CONTROL_STATUS register */
 #define AM33XX_CONTROL_STATUS		0x040
+#define AM33XX_CONTROL_SEC_CLK_CTRL	0x1bc
 
-/*
- * CONTROL OMAP STATUS register to identify OMAP3 features
- */
+/* AM33XX CONTROL_STATUS bitfields (partial) */
+#define AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT		22
+#define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK		(0x3 << 22)
+
+/* CONTROL OMAP STATUS register to identify OMAP3 features */
 #define OMAP3_CONTROL_OMAP_STATUS	0x044c
 
 #define OMAP3_SGX_SHIFT			13
author maintainer
#2 lore raw

PATCH 2/6 ARM: OMAP AM33xx: voltagedomain: Add voltage domain data

In reply to Paul Walmsley

From: Vaibhav Hiremath <[email protected]>

Currently dummy voltage domain data is being created in order to succeed boot process, nothing has been done w.r.t actual hardware (voltage control).

Also, hook up the AM33XX voltage domain to OMAP framework.

Cc Benoit Cousson <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Rajendra Nayak <[email protected]>
[paul at pwsan.com: updated for 3.5]
---
 arch/arm/mach-omap2/Makefile                  |    1 +
 arch/arm/mach-omap2/io.c                      |    3 +-
 arch/arm/mach-omap2/voltage.h                 |    1 +
 arch/arm/mach-omap2/voltagedomains33xx_data.c |   43 +++++++++++++++++++++++++
 4 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-omap2/voltagedomains33xx_data.c
arch/arm/mach-omap2/Makefile +1 -0
index 288e1a3..464e14c 100644
@@ -102,6 +102,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= voltagedomains3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(voltagedomain-common)
 obj-$(CONFIG_ARCH_OMAP4)		+= voltagedomains44xx_data.o
 obj-$(CONFIG_SOC_AM33XX)		+= $(voltagedomain-common)
+obj-$(CONFIG_SOC_AM33XX)                += voltagedomains33xx_data.o
 
 # OMAP powerdomain framework
 powerdomain-common			+= powerdomain.o powerdomain-common.o
arch/arm/mach-omap2/io.c +2 -1
index df4d119..6cdc4ac 100644
@@ -388,7 +388,7 @@ void __init omap2430_init_early(void)
  * Currently only board-omap3beagle.c should call this because of the
  * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
  */
-#ifdef CONFIG_ARCH_OMAP3
+#ifdef CONFIG_SOC_OMAP3430
 void __init omap3_init_early(void)
 {
 	omap2_set_globals_3xxx();
@@ -445,6 +445,7 @@ void __init am33xx_init_early(void)
 	omap3xxx_check_revision();
 	ti81xx_check_features();
 	omap_common_init_early();
+	am33xx_voltagedomains_init();
 }
 #endif
 
arch/arm/mach-omap2/voltage.h +1 -0
index 16a1b09..a7c43c1 100644
@@ -156,6 +156,7 @@ int omap_voltage_late_init(void);
 
 extern void omap2xxx_voltagedomains_init(void);
 extern void omap3xxx_voltagedomains_init(void);
+extern void am33xx_voltagedomains_init(void);
 extern void omap44xx_voltagedomains_init(void);
 
 struct voltagedomain *voltdm_lookup(const char *name);
arch/arm/mach-omap2/voltagedomains33xx_data.c new file +43 -0

43 lines not on this page · raw message

author maintainer
#3 lore raw

PATCH 2/6 ARM: OMAP AM33xx: voltagedomain: Add voltage domain data

Hi Vaibhav, Afzal, Tony,

Quoted 7 lines · Paul Walmsley

From: Vaibhav Hiremath <[email protected]>

Currently dummy voltage domain data is being created in order to succeed boot process, nothing has been done w.r.t actual hardware (voltage control).

Also, hook up the AM33XX voltage domain to OMAP framework.

I had to update this patch again for v3.5 to account for the lack of am33xx_init_early(). So now this patch has to add it (updated patch below).

But it seems to me that I must be missing something. Are we missing a prerequisite patch for this series from mainline? Or is this some casualty of kicking out the board file?

If the latter, how do we make sure that am33xx_init_early() is called at the right time?

Once we get this sorted out, I'll send the pull request.

Branch on git://git.pwsan.com/linux-2.6 in 'am33xx_prcm_devel_3.6'

- Paul

Quoted 1 line

From 127240db05c0d381a50712a320439c5679fb22da Mon Sep 17 00:00:00 2001

From: Vaibhav Hiremath <[email protected]>
Date: Sun, 10 Jun 2012 18:56:14 -0600
Subject: [PATCH] ARM: OMAP AM33xx: voltagedomain: Add voltage domain data

Currently dummy voltage domain data is being created in order to succeed boot process, nothing has been done w.r.t actual hardware (voltage control).

Also, hook up the AM33XX voltage domain to OMAP framework.

Cc Benoit Cousson <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Rajendra Nayak <[email protected]>
[paul at pwsan.com: updated for 3.5]
---
 arch/arm/mach-omap2/Makefile                  |    1 +
 arch/arm/mach-omap2/common.h                  |    1 +
 arch/arm/mach-omap2/io.c                      |   13 +++++++-
 arch/arm/mach-omap2/voltage.h                 |    1 +
 arch/arm/mach-omap2/voltagedomains33xx_data.c |   43 +++++++++++++++++++++++++
 5 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-omap2/voltagedomains33xx_data.c
arch/arm/mach-omap2/Makefile +1 -0
index fa742f3..6a3aef6 100644
@@ -99,6 +99,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= $(voltagedomain-common)
 obj-$(CONFIG_ARCH_OMAP3)		+= voltagedomains3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(voltagedomain-common)
 obj-$(CONFIG_ARCH_OMAP4)		+= voltagedomains44xx_data.o
+obj-$(CONFIG_SOC_AM33XX)                += voltagedomains33xx_data.o
 
 # OMAP powerdomain framework
 powerdomain-common			+= powerdomain.o powerdomain-common.o
arch/arm/mach-omap2/common.h +1 -0
index be9dfd1..dad91e2 100644
@@ -128,6 +128,7 @@ void omap3430_init_early(void);
 void omap35xx_init_early(void);
 void omap3630_init_early(void);
 void omap3_init_early(void);	/* Do not use this one */
+void am33xx_init_early(void);
 void am35xx_init_early(void);
 void ti81xx_init_early(void);
 void omap4430_init_early(void);
arch/arm/mach-omap2/io.c +12 -1
index 8d014ba..37ecc71 100644
@@ -381,11 +381,22 @@ void __init omap2430_init_late(void)
 }
 #endif
 
+#ifdef CONFIG_SOC_AM33XX
+void __init am33xx_init_early(void)
+{
+	omap2_set_globals_am33xx();
+	omap3xxx_check_revision();
+	ti81xx_check_features();
+	omap_common_init_early();
+	am33xx_voltagedomains_init();
+}
+#endif
+
 /*
  * Currently only board-omap3beagle.c should call this because of the
  * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
  */
-#ifdef CONFIG_ARCH_OMAP3
+#ifdef CONFIG_SOC_OMAP3430
 void __init omap3_init_early(void)
 {
 	omap2_set_globals_3xxx();
arch/arm/mach-omap2/voltage.h +1 -0
index 16a1b09..a7c43c1 100644
@@ -156,6 +156,7 @@ int omap_voltage_late_init(void);
 
 extern void omap2xxx_voltagedomains_init(void);
 extern void omap3xxx_voltagedomains_init(void);
+extern void am33xx_voltagedomains_init(void);
 extern void omap44xx_voltagedomains_init(void);
 
 struct voltagedomain *voltdm_lookup(const char *name);
arch/arm/mach-omap2/voltagedomains33xx_data.c new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
1.7.10
#4 lore raw

PATCH 2/6 ARM: OMAP AM33xx: voltagedomain: Add voltage domain data

Quoted 10 lines · Paul Walmsley

Hi Vaibhav, Afzal, Tony,

Quoted 6 lines · Paul Walmsley

From: Vaibhav Hiremath <[email protected]>

Currently dummy voltage domain data is being created in order to succeed boot process, nothing has been done w.r.t actual hardware (voltage control).

Quoted 6 lines
Quoted 1 line

Also, hook up the AM33XX voltage domain to OMAP framework.

I had to update this patch again for v3.5 to account for the lack of am33xx_init_early(). So now this patch has to add it (updated patch below).

Paul,

I think this is not required, since Tony has already accepted the patch which has this implementation (available on linux-omap/master). Please refer to the commit,

commit 08f3098928c991560408e8c71d4af8b1a3ff2d67

Author: Afzal Mohammed <[email protected]>
Date:   Fri May 11 00:38:49 2012 +0530

ARM: OMAP2+: am33xx: Add AM335XEVM machine support

Thanks,
Vaibhav

author maintainer
#5 lore raw

PATCH 2/6 ARM: OMAP AM33xx: voltagedomain: Add voltage domain data

Hi Vaibhav,

Quoted 9 lines · Vaibhav Hiremath

I think this is not required, since Tony has already accepted the patch which has this implementation (available on linux-omap/master). Please refer to the commit,

commit 08f3098928c991560408e8c71d4af8b1a3ff2d67

Author: Afzal Mohammed <[email protected]>
Date:   Fri May 11 00:38:49 2012 +0530

ARM: OMAP2+: am33xx: Add AM335XEVM machine support

Thanks, that's what I need. Looks like our series needs to be based on this commit, rather than mainline.

- Paul

#6 lore raw

PATCH 2/6 ARM: OMAP AM33xx: voltagedomain: Add voltage domain data

Quoted 8 lines · Paul Walmsley

Hi Vaibhav,

Quoted 4 lines · Vaibhav Hiremath

I think this is not required, since Tony has already accepted the patch which has this implementation (available on linux-omap/master). Please refer to the commit,

Quoted 9 lines
Quoted 5 lines

commit 08f3098928c991560408e8c71d4af8b1a3ff2d67

Author: Afzal Mohammed <[email protected]>
Date:   Fri May 11 00:38:49 2012 +0530

ARM: OMAP2+: am33xx: Add AM335XEVM machine support

Thanks, that's what I need. Looks like our series needs to be based on this commit, rather than mainline.

Yes, its already done. As you know I maintain this branch which always follows mainline and also integrates all the changes discussed on the list -

https://github.com/hvaibhav/am335x-linux/tree/am335x-upstream-staging

Thanks,
Vaibhav

author maintainer
#7 lore raw

PATCH 3/6 ARM: OMAP AM33xx: PRM: add PRM support

In reply to Paul Walmsley

From: Vaibhav Hiremath <[email protected]>

As far as PRM/CM/PRCM modules are concerned, AM33XX device is different than OMAP3 and OMAP4 architectures; so we need to handle it separately. This patch adds support for the PRM APIs required for AM33XX device.

Cc Benoit Cousson <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Rajendra Nayak <[email protected]>

[paul at pwsan.com: separated the PRM parts of "ARM: OMAP3+: am33xx: Add
powerdomain & PRM support" into this patch; fixed Makefile prm33xx.o location; cleaned up some checkpatch violations; updated for 3.5]

---
 arch/arm/mach-omap2/Makefile           |    2 
 arch/arm/mach-omap2/prm-regbits-33xx.h |  357 ++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/prm33xx.c          |  134 ++++++++++++
 arch/arm/mach-omap2/prm33xx.h          |  129 ++++++++++++
 4 files changed, 621 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-omap2/prm-regbits-33xx.h
 create mode 100644 arch/arm/mach-omap2/prm33xx.c
 create mode 100644 arch/arm/mach-omap2/prm33xx.h
arch/arm/mach-omap2/Makefile +1 -1
index 464e14c..32aed2d 100644
@@ -91,7 +91,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= vc3xxx_data.o vp3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cminst44xx.o cm44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= prcm_mpu44xx.o prminst44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= vc44xx_data.o vp44xx_data.o prm44xx.o
-obj-$(CONFIG_SOC_AM33XX)		+= prcm.o
+obj-$(CONFIG_SOC_AM33XX)		+= prcm.o prm33xx.o
 
 # OMAP voltage domains
 voltagedomain-common			:= voltage.o vc.o vp.o
arch/arm/mach-omap2/prm-regbits-33xx.h new file +357 -0

357 lines not on this page · raw message

arch/arm/mach-omap2/prm33xx.c new file +134 -0

134 lines not on this page · raw message

arch/arm/mach-omap2/prm33xx.h new file +129 -0

129 lines not on this page · raw message

author maintainer
#8 lore raw

PATCH 4/6 ARM: OMAP AM33xx: CM: Introduce AM33xx CM APIs and register level details

In reply to Paul Walmsley

From: Vaibhav Hiremath <[email protected]>

As far as PRM/CM/PRCM modules are concerned, AM33XX device is different than OMAP3 and OMAP4 architectures; so similar to PRM implementation, handle AM33XX CM separately.

This patch introduces AM33XX CM module low-level api's, used and required by omap clockdomain and hwmod framework.

Please note that cm-regbits-33xx.h (register bit field offset) and cm33xx.h (register addr offset) files are mostly auto generated.

Cc Kevin Hilman <[email protected]>
Cc Rajendra Nayak <[email protected]>
CC Tony Lindgren <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>

[paul at pwsan.com: split the hwmod code changes in this patch into a separate
patch; updated for 3.5]

---
 arch/arm/mach-omap2/Makefile          |    2 
 arch/arm/mach-omap2/cm-regbits-33xx.h |  687 +++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/cm33xx.c          |  313 +++++++++++++++
 arch/arm/mach-omap2/cm33xx.h          |  420 ++++++++++++++++++++
 4 files changed, 1421 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-omap2/cm-regbits-33xx.h
 create mode 100644 arch/arm/mach-omap2/cm33xx.c
 create mode 100644 arch/arm/mach-omap2/cm33xx.h
arch/arm/mach-omap2/Makefile +1 -1
index 32aed2d..8e23151 100644
@@ -91,7 +91,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= vc3xxx_data.o vp3xxx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= prcm.o cminst44xx.o cm44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= prcm_mpu44xx.o prminst44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= vc44xx_data.o vp44xx_data.o prm44xx.o
-obj-$(CONFIG_SOC_AM33XX)		+= prcm.o prm33xx.o
+obj-$(CONFIG_SOC_AM33XX)		+= prcm.o prm33xx.o cm33xx.o
 
 # OMAP voltage domains
 voltagedomain-common			:= voltage.o vc.o vp.o
arch/arm/mach-omap2/cm-regbits-33xx.h new file +687 -0

687 lines not on this page · raw message

arch/arm/mach-omap2/cm33xx.c new file +313 -0

313 lines not on this page · raw message

arch/arm/mach-omap2/cm33xx.h new file +420 -0

420 lines not on this page · raw message

author maintainer
#9 lore raw

PATCH 5/6 ARM: OMAP AM33xx: powerdomains: add AM335x support

In reply to Paul Walmsley

From: Vaibhav Hiremath <[email protected]>

Add offset & mask fields to struct powerdomain

In case of AM33xx family of devices, there is no consistency between PWRSTCTRL & PWRSTST register offsers in PRM space, for example -

PRM_XXX PWRSTCTRL PWRSTST
=======================================

PRM_PER_MOD:      0x0C,         0x08
PRM_WKUP_MOD:     0x04,         0x08
PRM_MPU_MOD:      0x00,         0x04
PRM_DEVICE_MOD:   NA,           NA

And also, there is no consistency between bit-offsets inside PWRSTCTRL & PWRSTST register, for example -

PRM_XXX LOGICRET MEMON MEMRET
=======================================

GFX_PWRCTRL:      2,        17,    6
PER_PWRCTRL:      3,        25,    29
MPU_PWRCTRL:      2,        18,    22
WKUP_PWRCTRL:     3,        NA,    NA

This means, we need to maintain and pass on all this information in powerdomain handle; so adding fields for,
- PWRSTCTRL/ST register offset
- Logic retention state mask
- mem_on/ret/pwrst/retst mask

Currently, this fields is only applicable and used for AM33XX devices.

Cc Benoit Cousson <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Rajendra Nayak <[email protected]>

[paul at pwsan.com: this patch is a combination of "Add offset & mask fields to
struct powerdomain" and the powerdomain portions of "ARM: OMAP3+: am33xx:
Add powerdomain & PRM support"; updated for 3.5]

---
 arch/arm/mach-omap2/Makefile                |    2 
 arch/arm/mach-omap2/io.c                    |    1 
 arch/arm/mach-omap2/powerdomain.h           |   23 ++-
 arch/arm/mach-omap2/powerdomain33xx.c       |  229 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/powerdomains33xx_data.c |  185 ++++++++++++++++++++++
 5 files changed, 438 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/powerdomain33xx.c
 create mode 100644 arch/arm/mach-omap2/powerdomains33xx_data.c
arch/arm/mach-omap2/Makefile +2 -0
index 8e23151..44b779f 100644
@@ -118,6 +118,8 @@ obj-$(CONFIG_ARCH_OMAP4)		+= $(powerdomain-common)
 obj-$(CONFIG_ARCH_OMAP4)		+= powerdomain44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= powerdomains44xx_data.o
 obj-$(CONFIG_SOC_AM33XX)		+= $(powerdomain-common)
+obj-$(CONFIG_SOC_AM33XX)		+= powerdomain33xx.o
+obj-$(CONFIG_SOC_AM33XX)		+= powerdomains33xx_data.o
 
 # PRCM clockdomain control
 clockdomain-common			+= clockdomain.o
arch/arm/mach-omap2/io.c +1 -0
index 6cdc4ac..0a6fc47 100644
@@ -446,6 +446,7 @@ void __init am33xx_init_early(void)
 	ti81xx_check_features();
 	omap_common_init_early();
 	am33xx_voltagedomains_init();
+	am33xx_powerdomains_init();
 }
 #endif
 
arch/arm/mach-omap2/powerdomain.h +21 -2
index 0d72a8a..5856a2c 100644
@@ -67,9 +67,9 @@
 
 /*
  * Maximum number of clockdomains that can be associated with a powerdomain.
- * CORE powerdomain on OMAP4 is the worst case
+ * PER powerdomain on AM33XX is the worst case
  */
-#define PWRDM_MAX_CLKDMS	9
+#define PWRDM_MAX_CLKDMS	11
 
 /* XXX A completely arbitrary number. What is reasonable here? */
 #define PWRDM_TRANSITION_BAILOUT 100000
@@ -92,6 +92,15 @@ struct powerdomain;
  * @pwrdm_clkdms: Clockdomains in this powerdomain
  * @node: list_head linking all powerdomains
  * @voltdm_node: list_head linking all powerdomains in a voltagedomain
+ * @pwrstctrl_offs: (AM33XX only) XXX_PWRSTCTRL reg offset from prcm_offs
+ * @pwrstst_offs: (AM33XX only) XXX_PWRSTST reg offset from prcm_offs
+ * @logicretstate_mask: (AM33XX only) mask for logic retention bitfield
+ *	in @pwrstctrl_offs
+ * @mem_on_mask: (AM33XX only) mask for mem on bitfield in @pwrstctrl_offs
+ * @mem_ret_mask: (AM33XX only) mask for mem ret bitfield in @pwrstctrl_offs
+ * @mem_pwrst_mask: (AM33XX only) mask for mem state bitfield in @pwrstst_offs
+ * @mem_retst_mask: (AM33XX only) mask for mem retention state bitfield
+ *	in @pwrstctrl_offs
  * @state:
  * @state_counter:
  * @timer:
@@ -121,6 +130,14 @@ struct powerdomain {
 	unsigned ret_logic_off_counter;
 	unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS];
 
+	const u8 pwrstctrl_offs;
+	const u8 pwrstst_offs;
+	const u32 logicretstate_mask;
+	const u32 mem_on_mask[PWRDM_MAX_MEM_BANKS];
+	const u32 mem_ret_mask[PWRDM_MAX_MEM_BANKS];
+	const u32 mem_pwrst_mask[PWRDM_MAX_MEM_BANKS];
+	const u32 mem_retst_mask[PWRDM_MAX_MEM_BANKS];
+
 #ifdef CONFIG_PM_DEBUG
 	s64 timer;
 	s64 state_timer[PWRDM_MAX_PWRSTS];
@@ -223,10 +240,12 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
 extern void omap242x_powerdomains_init(void);
 extern void omap243x_powerdomains_init(void);
 extern void omap3xxx_powerdomains_init(void);
+extern void am33xx_powerdomains_init(void);
 extern void omap44xx_powerdomains_init(void);
 
 extern struct pwrdm_ops omap2_pwrdm_operations;
 extern struct pwrdm_ops omap3_pwrdm_operations;
+extern struct pwrdm_ops am33xx_pwrdm_operations;
 extern struct pwrdm_ops omap4_pwrdm_operations;
 
 /* Common Internal functions used across OMAP rev's */
arch/arm/mach-omap2/powerdomain33xx.c new file +229 -0

229 lines not on this page · raw message

arch/arm/mach-omap2/powerdomains33xx_data.c new file +185 -0

185 lines not on this page · raw message

author maintainer
#10 lore raw

PATCH 6/6 ARM: OMAP AM33xx: clockdomains: Add clockdomain data and respective operations

In reply to Paul Walmsley

From: Vaibhav Hiremath <[email protected]>

AM33XX PRCM module consist of, various clockdomains, in all total we have 18 clockdomains available, with following controlling options,
- SW Sleep: sw forced sleep transition
- SW Wakeup: sw forced wakeup transition

This patch adds all available clockdomain data, respective clockdomain operations for AM33XX family of device, and also integrates it into existing OMAP framework.

Cc Kevin Hilman <[email protected]>
Cc Rajendra Nayak <[email protected]>
CC Tony Lindgren <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>

[paul at pwsan.com: removed CLKDM_NO_AUTODEPS from clockdomain flags, removed
unnecessary .clktrctrl_offs field; updated for 3.5]

---
 arch/arm/mach-omap2/Makefile                |    2 
 arch/arm/mach-omap2/clockdomain.h           |    2 
 arch/arm/mach-omap2/clockdomain33xx.c       |   74 ++++++++++
 arch/arm/mach-omap2/clockdomains33xx_data.c |  196 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/io.c                    |    1 
 5 files changed, 275 insertions(+)
 create mode 100644 arch/arm/mach-omap2/clockdomain33xx.c
 create mode 100644 arch/arm/mach-omap2/clockdomains33xx_data.c
arch/arm/mach-omap2/Makefile +2 -0
index 44b779f..cbb8bde 100644
@@ -137,6 +137,8 @@ obj-$(CONFIG_ARCH_OMAP4)		+= $(clockdomain-common)
 obj-$(CONFIG_ARCH_OMAP4)		+= clockdomain44xx.o
 obj-$(CONFIG_ARCH_OMAP4)		+= clockdomains44xx_data.o
 obj-$(CONFIG_SOC_AM33XX)		+= $(clockdomain-common)
+obj-$(CONFIG_SOC_AM33XX)		+= clockdomain33xx.o
+obj-$(CONFIG_SOC_AM33XX)		+= clockdomains33xx_data.o
 
 # Clock framework
 obj-$(CONFIG_ARCH_OMAP2)		+= $(clock-common) clock2xxx.o
arch/arm/mach-omap2/clockdomain.h +2 -0
index f7b5860..72cb12b 100644
@@ -195,6 +195,7 @@ int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh);
 extern void __init omap242x_clockdomains_init(void);
 extern void __init omap243x_clockdomains_init(void);
 extern void __init omap3xxx_clockdomains_init(void);
+extern void __init am33xx_clockdomains_init(void);
 extern void __init omap44xx_clockdomains_init(void);
 extern void _clkdm_add_autodeps(struct clockdomain *clkdm);
 extern void _clkdm_del_autodeps(struct clockdomain *clkdm);
@@ -202,6 +203,7 @@ extern void _clkdm_del_autodeps(struct clockdomain *clkdm);
 extern struct clkdm_ops omap2_clkdm_operations;
 extern struct clkdm_ops omap3_clkdm_operations;
 extern struct clkdm_ops omap4_clkdm_operations;
+extern struct clkdm_ops am33xx_clkdm_operations;
 
 extern struct clkdm_dep gfx_24xx_wkdeps[];
 extern struct clkdm_dep dsp_24xx_wkdeps[];
arch/arm/mach-omap2/clockdomain33xx.c new file +74 -0

74 lines not on this page · raw message

arch/arm/mach-omap2/clockdomains33xx_data.c new file +196 -0

196 lines not on this page · raw message

arch/arm/mach-omap2/io.c +1 -0
index 0a6fc47..bacab41 100644
@@ -447,6 +447,7 @@ void __init am33xx_init_early(void)
 	omap_common_init_early();
 	am33xx_voltagedomains_init();
 	am33xx_powerdomains_init();
+	am33xx_clockdomains_init();
 }
 #endif