Skip to contentSkip to conversation

arm:omap:am33xx: Add voltage and power domain data

PATCH Superseded Vaibhav Hiremath 3 participants 17 messages Dec 25, 2011 – Mar 8, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover arm:omap:am33xx: Add voltage and power domain data

Last time I had submitted a big patch-series, almost changing >7.5K lines for AM33XX voltage, power, clock and HWMOD data support (as a RFC); which I believe is very hard to review and difficult to manage also. So I decided to split the patches as and when they are clean and ready for review/merge/acceptance,
- Voltage and Power data (ready)
- Clock (common-clk migration) and HWMOD

This patch-series is created on top of my last patch submitted for OMAP4 PRM cleanup for PWRSTCTRL & PWRSTST -
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg60468.html

As always, I maintain a seperate git repository where you can find these patches + some patches to get AM335xEVM/BeagleBone to boot cleanly.

http://arago-project.org/git/people/?p=vaibhav/ti-psp-omap-video.git;a=summary
Branch - am335x-staging

Link to first version (RFC version) -
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg58742.html

Changes form V1:
- Splitted patchs based on dependencies.
- Incorporated all Kevin Hilman's review comments
* Have only one patch for data and Makefile/Kconfig changes
* Voltage Data: Add ".scalable = false" entry, to indicate clearly that scaling is not supported yet.
- Reuse all OMAP4 PRM implementation
* Thanks to Kevin and Rajendra for helping me out in this.

Vaibhav Hiremath (2):
arm:omap:am33xx: Add voltage domain data
arm:omap:am33xx: Add power domain data

 arch/arm/mach-omap2/Makefile                  |    5 +
 arch/arm/mach-omap2/io.c                      |    2 +
 arch/arm/mach-omap2/omap_hwmod.c              |    1 +
 arch/arm/mach-omap2/powerdomain.h             |    5 +-
 arch/arm/mach-omap2/powerdomains33xx_data.c   |  134 +++++++++++++++++++++++++
 arch/arm/mach-omap2/prm33xx.h                 |  118 ++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.h                 |    1 +
 arch/arm/mach-omap2/voltagedomains33xx_data.c |   46 +++++++++
 8 files changed, 310 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/powerdomains33xx_data.c
 create mode 100644 arch/arm/mach-omap2/prm33xx.h
 create mode 100644 arch/arm/mach-omap2/voltagedomains33xx_data.c
#1 lore raw

PATCH v2 1/2 arm:omap:am33xx: 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.

---
 arch/arm/mach-omap2/Makefile                  |    2 +
 arch/arm/mach-omap2/io.c                      |    1 +
 arch/arm/mach-omap2/voltage.h                 |    1 +
 arch/arm/mach-omap2/voltagedomains33xx_data.c |   46 +++++++++++++++++++++++++
 4 files changed, 50 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/voltagedomains33xx_data.c
arch/arm/mach-omap2/Makefile +2 -0
index 74ae499..8d90f9f 100644
@@ -99,6 +99,8 @@ obj-$(CONFIG_ARCH_OMAP2)		+= $(voltagedomain-common) \
 					   voltagedomains2xxx_data.o
 obj-$(CONFIG_ARCH_OMAP3)		+= $(voltagedomain-common) \
 					   voltagedomains3xxx_data.o
+obj-$(CONFIG_SOC_OMAPAM33XX)		+= $(voltagedomain-common) \
+					   voltagedomains33xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(voltagedomain-common) \
 					   voltagedomains44xx_data.o
 
arch/arm/mach-omap2/io.c +1 -0
index 5c180de..d50cbd7 100644
@@ -472,6 +472,7 @@ void __init am33xx_init_early(void)
 {
 	omap2_set_globals_am33xx();
 	omap_common_init_early();
+	am33xx_voltagedomains_init();
 	omap3xxx_clk_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 +46 -0

46 lines not on this page · raw message

--
1.7.0.4

#2 lore raw

PATCH v2 1/2 arm:omap:am33xx: Add voltage domain data

Quoted 8 lines · Vaibhav Hiremath

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.

Data looks OK, but why the dummy voltage domains? Does this device not
support voltage scaling?

Also, I think it was my idea in an earlier review to add the '.scalable = false', but it's not really necessary since the default is false. Sorry 'bout that.

Kevin

#3 lore raw

PATCH v2 1/2 arm:omap:am33xx: Add voltage domain data

Quoted 6 lines · Kevin
Quoted 4 lines · Vaibhav Hiremath

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 8 lines
Quoted 4 lines

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

Data looks OK, but why the dummy voltage domains? Does this device not
support voltage scaling?

It does support voltage scaling.

Kevin,
This is part of initial baseport patches and complete PM support
along with voltage scaling will follow slowly as-n-when it is ready for submission. We still haven't got full power management working internally which we can submit immediately.

Quoted 4 lines

Also, I think it was my idea in an earlier review to add the '.scalable = false', but it's not really necessary since the default is false. Sorry 'bout that.

Sorry it's my miss as well, I should have conformed it before submission. I will correct it in next version.

Thanks,
Vaibhav

Quoted 2 lines

Kevin

#4 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

In reply to Vaibhav Hiremath

This patch adds AM33XX power domain data (powerdomains33xx_data.c) and header file with respective PRM register offsets. PRM module in AM33XX family of device is close to that of OMAP4 PRM with respect to register bit-fields and offsets, so reusing all existing OMAP4 API's to access AM33XX PRM module.

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

This patch is based on OMAP4 cleanup patch of hardcoded reg-offs for PWRSTCTRL & PWRSTST.
Patch -
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg60468.html

---
 arch/arm/mach-omap2/Makefile                |    3 +
 arch/arm/mach-omap2/io.c                    |    1 +
 arch/arm/mach-omap2/omap_hwmod.c            |    1 +
 arch/arm/mach-omap2/powerdomain.h           |    5 +-
 arch/arm/mach-omap2/powerdomains33xx_data.c |  134 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/prm33xx.h               |  118 +++++++++++++++++++++++
 6 files changed, 260 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/powerdomains33xx_data.c
 create mode 100644 arch/arm/mach-omap2/prm33xx.h
arch/arm/mach-omap2/Makefile +3 -0
index 8d90f9f..d30c50c 100644
@@ -114,6 +114,9 @@ obj-$(CONFIG_ARCH_OMAP3)		+= $(powerdomain-common) \
 					   powerdomain2xxx_3xxx.o \
 					   powerdomains3xxx_data.o \
 					   powerdomains2xxx_3xxx_data.o
+obj-$(CONFIG_SOC_OMAPAM33XX)		+= prminst44xx.o \
+					   powerdomain44xx.o \
+					   powerdomains33xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)		+= $(powerdomain-common) \
 					   powerdomain44xx.o \
 					   powerdomains44xx_data.o
arch/arm/mach-omap2/io.c +1 -0
index d50cbd7..5f96aa5 100644
@@ -473,6 +473,7 @@ void __init am33xx_init_early(void)
 	omap2_set_globals_am33xx();
 	omap_common_init_early();
 	am33xx_voltagedomains_init();
+	am33xx_powerdomains_init();
 	omap3xxx_clk_init();
 }
 #endif
arch/arm/mach-omap2/omap_hwmod.c +1 -0
index 4fd53d4..34dc29b 100644
@@ -150,6 +150,7 @@
 #include "cminst44xx.h"
 #include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
+#include "prm33xx.h"
 #include "prminst44xx.h"
 #include "mux.h"
 
arch/arm/mach-omap2/powerdomain.h +3 -2
index 9ebb872..284eb22 100644
@@ -67,9 +67,9 @@
 
 /*
  * Maximum number of clockdomains that can be associated with a powerdomain.
- * CORE powerdomain on OMAP4 is the worst case
+ * CORE 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
@@ -227,6 +227,7 @@ 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;
arch/arm/mach-omap2/powerdomains33xx_data.c new file +134 -0

134 lines not on this page · raw message

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

118 lines not on this page · raw message

--
1.7.0.4

maintainer
#5 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Hi

a question -

Quoted 12 lines · Vaibhav Hiremath
arch/arm/mach-omap2/powerdomains33xx_data.c new file +12 -0
+static struct powerdomain mpu_33xx_pwrdm = {
+	.name			= "mpu_pwrdm",
+	.voltdm			= { .name = "mpu" },
+	.prcm_partition		= AM33XX_PRM_PARTITION,
+	.prcm_offs		= AM33XX_PRM_MPU_MOD,
+	.pwrsts			= PWRSTS_OFF_RET_ON,
+	.pwrsts_logic_ret	= PWRSTS_OFF_RET,
+	.pwrstctrl_offs		= AM33XX_PM_MPU_PWRSTCTRL_OFFSET,
+	.pwrstst_offs		= AM33XX_PM_MPU_PWRSTST_OFFSET,
+	.flags			= PWRDM_HAS_LOWPOWERSTATECHANGE,
+	.banks			= 3,
+	.pwrsts_mem_ret		= {

arch/arm/mach-omap2/powerdomains33xx_data.c line 107

Quoted 10 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +10 -0
+		[0]	= PWRSTS_OFF_RET,	/* mpu_l1 */
+		[1]	= PWRSTS_OFF_RET,	/* mpu_l2 */
+		[2]	= PWRSTS_OFF_RET,	/* mpu_ram */
+	},
+	.pwrsts_mem_on		= {
+		[0]	= PWRSTS_ON,		/* mpu_l1 */
+		[1]	= PWRSTS_ON,		/* mpu_l2 */
+		[2]	= PWRSTS_ON,		/* mpu_ram */
+	},
+};

Comparing this with Table 8-191 "PM_MPU_PWRSTCTRL Register Field Descriptions" of the AM335x TRM Rev C [SPRUH73C], it seems that something is really wrong here.

On the OMAP4430's *_PWRSTCTRL registers,

- the memory bank RETSTATE fields always start at bit 8;

- the RETSTATE fields are contiguous;

- the bank ONSTATE fields always start at bit 16; and

- the ONSTATE fields are contiguous;

- the order of the RETSTATE and ONSTATE fields always matches.

The OMAP4430 TRM Rev O [SWPU231O] Table 3-449 "PM_CORE_PWRSTCTRL" table is a good illustration of this.

But, looking at SPRUH73C, none of these criteria seem to apply consistently on AM335x :-(

Table 8-191 "PM_MPU_PWRSTCTRL Register Field Descriptions" starts its RETSTATE bitfields at bit 22, not bit 8. The ONSTATE bitfields are at bit 16 (at least this part is normal). And both sets of bitfields are internally contiguous. But then the order of the bitfields does not match between the RETSTATE bitfields and ONSTATE bitfields - the RETSTATE order is (L1, L2, RAM), but the ONSTATE order is (RAM, L1, L2)!

Then looking at Table 8-184 "PM_PER_PWRSTCTRL Register Field Descriptions" for the same chip, the layout is completely different. The PRUSS memory ONSTATE starts at bit 5, and its RETSTATE field is at bit 7. But then PER_MEM's ONSTATE field starts at bit 25, and is followed immediately by *RAM*_MEM's RETSTATE field at bit 27! And then PER_MEM's RETSTATE field shows up at bit 29, followed by RAM_MEM's ONSTATE field at bit 30.

Is the TRM accurate in these examples? Or is this a documentation bug?

Anyway, if this is really accurate, this per-powerdomain bitfield reordering is definitely not expected by the existing powerdomain code. Looks to me that someone will have to add bitshift fields into the struct powerdomain for every single bank RETSTATE and ONSTATE field.

Does this match your understanding?

- Paul

#6 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Quoted 58 lines · Paul Walmsley

Hi

a question -

Quoted 12 lines · Vaibhav Hiremath
arch/arm/mach-omap2/powerdomains33xx_data.c new file +12 -0
+static struct powerdomain mpu_33xx_pwrdm = {
+	.name			= "mpu_pwrdm",
+	.voltdm			= { .name = "mpu" },
+	.prcm_partition		= AM33XX_PRM_PARTITION,
+	.prcm_offs		= AM33XX_PRM_MPU_MOD,
+	.pwrsts			= PWRSTS_OFF_RET_ON,
+	.pwrsts_logic_ret	= PWRSTS_OFF_RET,
+	.pwrstctrl_offs		= AM33XX_PM_MPU_PWRSTCTRL_OFFSET,
+	.pwrstst_offs		= AM33XX_PM_MPU_PWRSTST_OFFSET,
+	.flags			= PWRDM_HAS_LOWPOWERSTATECHANGE,
+	.banks			= 3,
+	.pwrsts_mem_ret		= {

arch/arm/mach-omap2/powerdomains33xx_data.c line 107

Quoted 10 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +10 -0
+		[0]	= PWRSTS_OFF_RET,	/* mpu_l1 */
+		[1]	= PWRSTS_OFF_RET,	/* mpu_l2 */
+		[2]	= PWRSTS_OFF_RET,	/* mpu_ram */
+	},
+	.pwrsts_mem_on		= {
+		[0]	= PWRSTS_ON,		/* mpu_l1 */
+		[1]	= PWRSTS_ON,		/* mpu_l2 */
+		[2]	= PWRSTS_ON,		/* mpu_ram */
+	},
+};

Comparing this with Table 8-191 "PM_MPU_PWRSTCTRL Register Field Descriptions" of the AM335x TRM Rev C [SPRUH73C], it seems that something is really wrong here.

On the OMAP4430's *_PWRSTCTRL registers,

- the memory bank RETSTATE fields always start at bit 8;

- the RETSTATE fields are contiguous;

- the bank ONSTATE fields always start at bit 16; and

- the ONSTATE fields are contiguous;

- the order of the RETSTATE and ONSTATE fields always matches.

The OMAP4430 TRM Rev O [SWPU231O] Table 3-449 "PM_CORE_PWRSTCTRL" table is a good illustration of this.

But, looking at SPRUH73C, none of these criteria seem to apply consistently on AM335x :-(

Table 8-191 "PM_MPU_PWRSTCTRL Register Field Descriptions" starts its RETSTATE bitfields at bit 22, not bit 8. The ONSTATE bitfields are at bit 16 (at least this part is normal). And both sets of bitfields are internally contiguous. But then the order of the bitfields does not match between the RETSTATE bitfields and ONSTATE bitfields - the RETSTATE order is (L1, L2, RAM), but the ONSTATE order is (RAM, L1, L2)!

Quoted 9 lines

Then looking at Table 8-184 "PM_PER_PWRSTCTRL Register Field Descriptions" for the same chip, the layout is completely different. The PRUSS memory ONSTATE starts at bit 5, and its RETSTATE field is at bit 7. But then PER_MEM's ONSTATE field starts at bit 25, and is followed immediately by *RAM*_MEM's RETSTATE field at bit 27! And then PER_MEM's RETSTATE field shows up at bit 29, followed by RAM_MEM's ONSTATE field at bit 30.

Is the TRM accurate in these examples? Or is this a documentation bug?

Unfortunately, the spec is correct in this context.

Quoted 5 lines

Anyway, if this is really accurate, this per-powerdomain bitfield reordering is definitely not expected by the existing powerdomain code. Looks to me that someone will have to add bitshift fields into the struct powerdomain for every single bank RETSTATE and ONSTATE field.

That would be me... :)
I have started looking at it and will soon submit the patches for this.

Side note,

I am not sure whether we access these bits explicitly. If I understand correctly, API's which access these bits are not being called from anywhere, For example,

omap4_pwrdm_read_mem_retst
omap4_pwrdm_set_mem_retst
omap4_pwrdm_set_mem_onst

Currently the major issue would be, for PM_PER_PWRSTCTRL, where LogicRETState bit has been moved to offset 3. This is being used in omap4_pwrdm_set_logic_retst() api.

And in order to support weird/non-standard bit-offsets, we have to clean omap2_pwrdm_get_mem_bank_onstate/retst/_mask() api and have bitshift field in struct powerdomain, as you have rightly pointed out.

Is my all understanding correct?

If yes, do you think this patch should get blocked for above cleanup? I feel Cleanup can still follow, since this won't impact the AM33xx boot.

What's your opinion on this??

Quoted 2 lines

Does this match your understanding?

Yes, certainly.

Thanks,
Vaibhav

Quoted 3 lines

- Paul

maintainer
#7 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Hi

Quoted 7 lines · Vaibhav

I am not sure whether we access these bits explicitly. If I understand correctly, API's which access these bits are not being called from anywhere, For example,

omap4_pwrdm_read_mem_retst
omap4_pwrdm_set_mem_retst
omap4_pwrdm_set_mem_onst

They'll be needed for the functional powerstate code, device PM QoS, and OSWR.

Quoted 7 lines

Currently the major issue would be, for PM_PER_PWRSTCTRL, where LogicRETState bit has been moved to offset 3. This is being used in omap4_pwrdm_set_logic_retst() api.

And in order to support weird/non-standard bit-offsets, we have to clean omap2_pwrdm_get_mem_bank_onstate/retst/_mask() api and have bitshift field in struct powerdomain, as you have rightly pointed out.

As you work on this, I have a request. Please place the AM33xx powerdomain implementation functions into a separate file, powerdomain33xx.c perhaps, rather than trying to merge them with the OMAP4 powerdomain implementation functions.

Some functions can be shared -- maybe place those into a separate file, powerdomain33xx_44xx.c perhaps?

Quoted 6 lines

Is my all understanding correct?

If yes, do you think this patch should get blocked for above cleanup? I feel Cleanup can still follow, since this won't impact the AM33xx boot.

What's your opinion on this??

We can't merge patches which are known to be broken. That's a rule from Linus (and a good one). Better to try to get it right the first time it hits mainline.

- Paul

#8 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Quoted 19 lines · Paul Walmsley

Hi

Quoted 7 lines · Vaibhav

I am not sure whether we access these bits explicitly. If I understand correctly, API's which access these bits are not being called from anywhere, For example,

omap4_pwrdm_read_mem_retst
omap4_pwrdm_set_mem_retst
omap4_pwrdm_set_mem_onst

They'll be needed for the functional powerstate code, device PM QoS, and OSWR.

Quoted 4 lines

Currently the major issue would be, for PM_PER_PWRSTCTRL, where LogicRETState bit has been moved to offset 3. This is being used in omap4_pwrdm_set_logic_retst() api.

Quoted 9 lines
Quoted 3 lines

And in order to support weird/non-standard bit-offsets, we have to clean omap2_pwrdm_get_mem_bank_onstate/retst/_mask() api and have bitshift field in struct powerdomain, as you have rightly pointed out.

As you work on this, I have a request. Please place the AM33xx powerdomain implementation functions into a separate file, powerdomain33xx.c perhaps, rather than trying to merge them with the OMAP4 powerdomain implementation functions.

That was my initial code and I had submitted same to the list as an RFC, Request you to refer to the link -
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg58746.html

And the reason behind merging am33xx with omap4 thing was triggered from the discussion on the above patch (between me, KevinH and RajendraNaik), and we all believed that, with some cleanup in OMAP4 code we can reuse it for am33xx.

Thanks,
Vaibhav

Quoted 17 lines

Some functions can be shared -- maybe place those into a separate file, powerdomain33xx_44xx.c perhaps?

Quoted 6 lines

Is my all understanding correct?

If yes, do you think this patch should get blocked for above cleanup? I feel Cleanup can still follow, since this won't impact the AM33xx boot.

What's your opinion on this??

We can't merge patches which are known to be broken. That's a rule from Linus (and a good one). Better to try to get it right the first time it hits mainline.

- Paul

maintainer
#9 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

In reply to Vaibhav Hiremath

Hi

some other observations:

Quoted 12 lines · Vaibhav Hiremath
arch/arm/mach-omap2/powerdomains33xx_data.c new file +12 -0
+static struct powerdomain per_33xx_pwrdm = {
+	.name			= "per_pwrdm",
+	.voltdm			= { .name = "core" },
+	.prcm_partition		= AM33XX_PRM_PARTITION,
+	.prcm_offs		= AM33XX_PRM_PER_MOD,
+	.pwrsts			= PWRSTS_OFF_RET_ON,
+	.pwrsts_logic_ret	= PWRSTS_OFF_RET,
+	.pwrstctrl_offs		= AM33XX_PM_PER_PWRSTCTRL_OFFSET,
+	.pwrstst_offs		= AM33XX_PM_PER_PWRSTST_OFFSET,
+	.flags			= PWRDM_HAS_LOWPOWERSTATECHANGE,
+	.banks			= 3,
+	.pwrsts_mem_ret		= {

arch/arm/mach-omap2/powerdomains33xx_data.c line 84

Quoted 10 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +10 -0
+		[0]	= PWRSTS_OFF_RET,	/* icss_mem */
+		[1]	= PWRSTS_OFF_RET,	/* per_mem */
+		[2]	= PWRSTS_OFF_RET,	/* ram_mem */
+	},
+	.pwrsts_mem_on		= {
+		[0]	= PWRSTS_ON,		/* icss_mem */
+		[1]	= PWRSTS_ON,		/* per_mem */
+		[2]	= PWRSTS_ON,		/* ram_mem */
+	},
+};

According to SPRUH73C Table 8-184 "PM_PER_PWRSTCTRL Register Field Descriptions" the pwrsts_mem_on field for RAM_MEM should be PWRSTS_OFF_RET_ON.

Quoted 6 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +6 -0
+static struct powerdomain mpu_33xx_pwrdm = {
+     .name                   = "mpu_pwrdm",
+     .voltdm                 = { .name = "mpu" },
+     .prcm_partition         = AM33XX_PRM_PARTITION,
+     .prcm_offs              = AM33XX_PRM_MPU_MOD,
+     .pwrsts                 = PWRSTS_OFF_RET_ON,

arch/arm/mach-omap2/powerdomains33xx_data.c line 101

Quoted 10 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +10 -0
+     .pwrsts_logic_ret       = PWRSTS_OFF_RET,
+     .pwrstctrl_offs         = AM33XX_PM_MPU_PWRSTCTRL_OFFSET,
+     .pwrstst_offs           = AM33XX_PM_MPU_PWRSTST_OFFSET,
+     .flags                  = PWRDM_HAS_LOWPOWERSTATECHANGE,
+     .banks                  = 3,
+     .pwrsts_mem_ret         = {
+             [0]     = PWRSTS_OFF_RET,       /* mpu_l1 */
+             [1]     = PWRSTS_OFF_RET,       /* mpu_l2 */
+             [2]     = PWRSTS_OFF_RET,       /* mpu_ram */
+     },

Again SPRUH73C Table 8-191 "PM_MPU_PWRSTCTRL Register Field Descriptions" claims these should simply by PWRSTS_RET.

arch/arm/mach-omap2/powerdomains33xx_data.c line 107

Quoted 6 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +6 -0
+     .pwrsts_mem_on          = {
+             [0]     = PWRSTS_ON,            /* mpu_l1 */
+             [1]     = PWRSTS_ON,            /* mpu_l2 */
+             [2]     = PWRSTS_ON,            /* mpu_ram */
+     },
+};

And the same table claims the MPU_RAM pwrsts_mem_on field should be PWRSTS_OFF_ON.

Can you please reconcile these differences and let us know which values should be correct?

thanks

- Paul

#10 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Quoted 60 lines · Paul Walmsley

Hi

some other observations:

Quoted 12 lines · Vaibhav Hiremath
arch/arm/mach-omap2/powerdomains33xx_data.c new file +12 -0
+static struct powerdomain per_33xx_pwrdm = {
+	.name			= "per_pwrdm",
+	.voltdm			= { .name = "core" },
+	.prcm_partition		= AM33XX_PRM_PARTITION,
+	.prcm_offs		= AM33XX_PRM_PER_MOD,
+	.pwrsts			= PWRSTS_OFF_RET_ON,
+	.pwrsts_logic_ret	= PWRSTS_OFF_RET,
+	.pwrstctrl_offs		= AM33XX_PM_PER_PWRSTCTRL_OFFSET,
+	.pwrstst_offs		= AM33XX_PM_PER_PWRSTST_OFFSET,
+	.flags			= PWRDM_HAS_LOWPOWERSTATECHANGE,
+	.banks			= 3,
+	.pwrsts_mem_ret		= {

arch/arm/mach-omap2/powerdomains33xx_data.c line 84

Quoted 10 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +10 -0
+		[0]	= PWRSTS_OFF_RET,	/* icss_mem */
+		[1]	= PWRSTS_OFF_RET,	/* per_mem */
+		[2]	= PWRSTS_OFF_RET,	/* ram_mem */
+	},
+	.pwrsts_mem_on		= {
+		[0]	= PWRSTS_ON,		/* icss_mem */
+		[1]	= PWRSTS_ON,		/* per_mem */
+		[2]	= PWRSTS_ON,		/* ram_mem */
+	},
+};

According to SPRUH73C Table 8-184 "PM_PER_PWRSTCTRL Register Field Descriptions" the pwrsts_mem_on field for RAM_MEM should be PWRSTS_OFF_RET_ON.

Quoted 6 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +6 -0
+static struct powerdomain mpu_33xx_pwrdm = {
+     .name                   = "mpu_pwrdm",
+     .voltdm                 = { .name = "mpu" },
+     .prcm_partition         = AM33XX_PRM_PARTITION,
+     .prcm_offs              = AM33XX_PRM_MPU_MOD,
+     .pwrsts                 = PWRSTS_OFF_RET_ON,

arch/arm/mach-omap2/powerdomains33xx_data.c line 101

Quoted 10 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +10 -0
+     .pwrsts_logic_ret       = PWRSTS_OFF_RET,
+     .pwrstctrl_offs         = AM33XX_PM_MPU_PWRSTCTRL_OFFSET,
+     .pwrstst_offs           = AM33XX_PM_MPU_PWRSTST_OFFSET,
+     .flags                  = PWRDM_HAS_LOWPOWERSTATECHANGE,
+     .banks                  = 3,
+     .pwrsts_mem_ret         = {
+             [0]     = PWRSTS_OFF_RET,       /* mpu_l1 */
+             [1]     = PWRSTS_OFF_RET,       /* mpu_l2 */
+             [2]     = PWRSTS_OFF_RET,       /* mpu_ram */
+     },

Again SPRUH73C Table 8-191 "PM_MPU_PWRSTCTRL Register Field Descriptions" claims these should simply by PWRSTS_RET.

arch/arm/mach-omap2/powerdomains33xx_data.c line 107

Quoted 6 lines
arch/arm/mach-omap2/powerdomains33xx_data.c new file +6 -0
+     .pwrsts_mem_on          = {
+             [0]     = PWRSTS_ON,            /* mpu_l1 */
+             [1]     = PWRSTS_ON,            /* mpu_l2 */
+             [2]     = PWRSTS_ON,            /* mpu_ram */
+     },
+};
Quoted 6 lines

And the same table claims the MPU_RAM pwrsts_mem_on field should be PWRSTS_OFF_ON.

Can you please reconcile these differences and let us know which values should be correct?

Paul,

The initialization used in the patch is correct. Unfortunately, the TRM is
incorrect here. I have already raised this issue with respective folks and soon it will get corrected.

Thanks,
Vaibhav

Quoted 5 lines

thanks

- Paul

maintainer
#11 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Hi,

Quoted 3 lines · Vaibhav

The initialization used in the patch is correct. Unfortunately, the TRM is incorrect here. I have already raised this issue with respective folks and soon it will get corrected.

thanks for looking into this. Could you add a brief comment or comments in this file to indicate that the TRM Rev C is incorrect about those? That will help others who may be reviewing this code as they track down bugs.

thanks

- Paul

#12 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Quoted 4 lines · Paul Walmsley

Hi,

On Thu, 1 Mar 2012, Hiremath, Vaibhav wrote:

Quoted 9 lines
Quoted 3 lines

The initialization used in the patch is correct. Unfortunately, the TRM is incorrect here. I have already raised this issue with respective folks and soon it will get corrected.

thanks for looking into this. Could you add a brief comment or comments in this file to indicate that the TRM Rev C is incorrect about those? That will help others who may be reviewing this code as they track down bugs.

Good point. I will certainly add it in the next version of patch-sets.

Paul,
Thanks for your review comments, can we also align on the approach, Whether to merge am33xx powerdomain with omap4 (same direction we are now) OR
Have separate implementation (my original approach).

Thanks,
Vaibhav

Quoted 6 lines

thanks

- Paul

maintainer
#13 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Hi

Quoted 5 lines · Vaibhav

Paul,
Thanks for your review comments, can we also align on the approach, Whether to merge am33xx powerdomain with omap4 (same direction we are now) OR
Have separate implementation (my original approach).

Could you please take a look at the "am335x_prcm_devel_3.4" branch on
git://git.pwsan.com/linux-2.6 and let me know what you think?

It is still rough, incomplete, and compile-tested only; and the patch commit messages have to be updated and revised; but I think it is a slightly better approach.

A significant change is that the prminst code changes have been removed. That is only needed when PRM registers are spread across multiple PRCM IP blocks. This does not appear to be the case with AM33xx? So the implementation has been modified to create a prm33xx.c file instead. This avoids an extra, unnecessary layer of indirection for PRM accesses.

This, along with the other differences between OMAP4 and this chip, means that a separate powerdomain33xx.c file had to be created.

The powerdomains33xx_data.c file is still missing the bitmask position data, but the structure members are there.

Feel free to combine, rework, or merge this series with what you are working on if you feel that it is a good approach. Otherwise, let's discuss.

- Paul

#14 lore raw

PATCH v2 2/2 arm:omap:am33xx: Add power domain data

Quoted 10 lines · Paul Walmsley

Hi

Quoted 5 lines · Vaibhav

Paul,
Thanks for your review comments, can we also align on the approach, Whether to merge am33xx powerdomain with omap4 (same direction we are now) OR
Have separate implementation (my original approach).

Quoted 7 lines

Could you please take a look at the "am335x_prcm_devel_3.4" branch on
git://git.pwsan.com/linux-2.6 and let me know what you think?

It is still rough, incomplete, and compile-tested only; and the patch commit messages have to be updated and revised; but I think it is a slightly better approach.

Paul,

Sorry for delayed response, was bit stuck with some baseport thing.

I have reviewed the changes from your above branch. And as I mentioned before, it looks closer to my earlier approach + some good and important changes/cleanups.

Quoted 3 lines

A significant change is that the prminst code changes have been removed. That is only needed when PRM registers are spread across multiple PRCM IP blocks.

Make sense actually...I don't know, why didn't thought about this before...

Quoted 10 lines

This does not appear to be the case with AM33xx? So the implementation has been modified to create a prm33xx.c file instead. This avoids an extra, unnecessary layer of indirection for PRM accesses.

This, along with the other differences between OMAP4 and this chip, means that a separate powerdomain33xx.c file had to be created.

The powerdomains33xx_data.c file is still missing the bitmask position data, but the structure members are there.

Yeah, I understand, I think without this it won't be usefule. I will also get this done in next (aligned) changes.

Quoted 4 lines

Feel free to combine, rework, or merge this series with what you are working on if you feel that it is a good approach. Otherwise, let's discuss.

Thanks, Thanks a lot for your time/support/review, as always its helpful.

Thanks,
Vaibhav

Quoted 3 lines

- Paul

#15 lore raw

v2 cover arm:omap:am33xx: Add voltage and power domain data

In reply to Vaibhav Hiremath
Quoted 5 lines · Vaibhav Hiremath

Last time I had submitted a big patch-series, almost changing >7.5K lines for AM33XX voltage, power, clock and HWMOD data support (as a RFC); which I believe is very hard to review and difficult to manage also. So I decided to split the patches as and when they are clean and ready for review/merge/acceptance,

FYI...

In usually (but not always) helps to specifically Cc the maintainers of the code you're changin. In this case, Paul & Benoit are maintaining most of this core code/data, so you should make sure they are Cc'd as well.

Thanks,

Kevin

#16 lore raw

v2 cover arm:omap:am33xx: Add voltage and power domain data

Quoted 8 lines · Kevin
Quoted 5 lines · Vaibhav Hiremath

Last time I had submitted a big patch-series, almost changing >7.5K lines for AM33XX voltage, power, clock and HWMOD data support (as a RFC); which I believe is very hard to review and difficult to manage also. So I decided to split the patches as and when they are clean and ready for review/merge/acceptance,

Quoted 7 lines

FYI...

In usually (but not always) helps to specifically Cc the maintainers of the code you're changin. In this case, Paul & Benoit are maintaining most of this core code/data, so you should make sure they are Cc'd as well.

My bad. I fully agree with you and will make sure that I will follow this.

Thanks,
Vaibhav

Quoted 4 lines

Thanks,

Kevin