Re: [PATCH v2 3/6] omap3: pm: Update Triton2 scripts

2010-01-21 Thread Lesly AM


- Original Message - 
From: Nishanth Menon n...@ti.com

To: Manuel, Lesly Arackal x0080...@ti.com
Cc: linux-omap@vger.kernel.org; Derrick, David dderr...@ti.com; 
Samuel Ortiz sa...@linux.intel.com

Sent: Thursday, January 21, 2010 1:01 PM
Subject: Re: [PATCH v2 3/6] omap3: pm: Update Triton2 scripts



Manuel, Lesly Arackal had written, on 01/19/2010 11:35 AM, the following:

From: Lesly A M x0080...@ti.com

omap3: pm: Update Triton2 scripts

Updated the sleep, wakeup  warm_reset sequence as recommended by David 
Derrick.
Used broadcast command, modified the resource type association and remap 
sleep_state.

Added the new script changes for zoom[2,3] boards.

VDD1, VDD2 and VPLL1 are remapped to turn off during sleep state.
Changed RES_TYPE2 of VPLL1, VDD1, VDD2, REGEN, NRESPWRON  SYSEN to '1'
and VINTANA1, VINTANA2, VINTDIG, VIO, CLKEN  HFCLKOUT to '2'.

How about VMMC,VAUX and other resources?

These LDOs are controlled by drivers using regulator frame work, not through 
TRITON power sequence.




HFCLKOUT is attached to P3, to disable HFCLK when clk_req signal is 
toggled.


Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com

---
 arch/arm/mach-omap2/board-3430sdp.c  |   83 
 arch/arm/mach-omap2/board-zoom-peripherals.c |  107 
+++

 include/linux/i2c/twl.h  |4 +
 3 files changed, 161 insertions(+), 33 deletions(-)

Index: linux-omap-pm/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-pm.orig/arch/arm/mach-omap2/board-3430sdp.c 2010-01-19 
21:34:57.0 +0530
+++ linux-omap-pm/arch/arm/mach-omap2/board-3430sdp.c 2010-01-19 
21:41:26.0 +0530

@@ -448,14 +448,11 @@
 static struct twl4030_ins __initdata sleep_on_seq[] = {
- /* Turn off HFCLKOUT */
- {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 2},
- /* Turn OFF VDD1 */
- {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 2},
- /* Turn OFF VDD2 */
- {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
- /* Turn OFF VPLL1 */
- {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 2},
+ /* Broadcast message to put res to sleep */
+ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+ RES_STATE_SLEEP), 2},
+ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+ RES_STATE_SLEEP), 2},
 };
 static struct twl4030_script sleep_on_script __initdata = {
@@ -465,14 +462,9 @@
 };
 static struct twl4030_ins wakeup_p12_seq[] __initdata = {
- /* Turn on HFCLKOUT */
- {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
- /* Turn ON VDD1 */
- {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 2},
- /* Turn ON VDD2 */
- {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
- /* Turn ON VPLL1 */
- {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 2},
+ /* Broadcast message to put res to active */
+ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+ RES_STATE_ACTIVE), 2},
 };
 static struct twl4030_script wakeup_p12_script __initdata = {
@@ -482,7 +474,9 @@
 };
 static struct twl4030_ins wakeup_p3_seq[] __initdata = {
- {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+ /* Broadcast message to put res to active */
+ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+ RES_STATE_ACTIVE), 2},
 };
 static struct twl4030_script wakeup_p3_script __initdata = {
@@ -494,18 +488,23 @@
 static struct twl4030_ins wrst_seq[] __initdata = {
 /*
  * Reset twl4030.
- * Reset VDD1 regulator.
- * Reset VDD2 regulator.
- * Reset VPLL1 regulator.
- * Enable sysclk output.
+ * Reset Main_Ref.
+ * Reset All type2_group2.
+ * Reset VUSB_3v1.
+ * Reset All type2_group1.
+ * Reset RC.
  * Reenable twl4030.
  */
- {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
- {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
- {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
- {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
- {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
- {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+ {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2},
+ {MSG_SINGULAR(DEV_GRP_NULL, RES_Main_Ref, RES_STATE_WRST), 2},
+ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+ RES_STATE_WRST), 2},
+ {MSG_SINGULAR(DEV_GRP_NULL, RES_VUSB_3V1, RES_STATE_WRST), 2},
+ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+ RES_STATE_WRST), 2},
+ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_RC, RES_TYPE_ALL, RES_TYPE2_R0,
+ RES_STATE_WRST), 2},
+ {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2},
 };
 static struct twl4030_script wrst_script __initdata = {
 .script = wrst_seq,
@@ -521,12 +520,30 @@
 };
 static struct twl4030_resconfig twl4030_rconfig[] = {
- { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
- .type2 = -1 },
- { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type

Re: [PATCH v2 3/6] omap3: pm: Update Triton2 scripts

2010-01-21 Thread Nishanth Menon

Manuel, Lesly Arackal had written, on 01/21/2010 02:34 AM, the following:

From: Nishanth Menon n...@ti.com
To: Manuel, Lesly Arackal x0080...@ti.com
Cc: linux-omap@vger.kernel.org; Derrick, David dderr...@ti.com; 




Manuel, Lesly Arackal had written, on 01/19/2010 11:35 AM, the following:

From: Lesly A M x0080...@ti.com

omap3: pm: Update Triton2 scripts

Updated the sleep, wakeup  warm_reset sequence as recommended by David 
Derrick.
Used broadcast command, modified the resource type association and remap 
sleep_state.

Added the new script changes for zoom[2,3] boards.

VDD1, VDD2 and VPLL1 are remapped to turn off during sleep state.
Changed RES_TYPE2 of VPLL1, VDD1, VDD2, REGEN, NRESPWRON  SYSEN to '1'
and VINTANA1, VINTANA2, VINTDIG, VIO, CLKEN  HFCLKOUT to '2'.

How about VMMC,VAUX and other resources?

These LDOs are controlled by drivers using regulator frame work, not through 
TRITON power sequence.
Context of my question was - how do we handle devices such as eMMC which 
is required on bootup? I suppose the suspend/resume of those driver 
should ideally handle it..


but overall fair enough from me, if relevant comments are available in 
commit message.


[..]

--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 3/6] omap3: pm: Update Triton2 scripts

2010-01-20 Thread Nishanth Menon

Manuel, Lesly Arackal had written, on 01/19/2010 11:35 AM, the following:

From: Lesly A M x0080...@ti.com

omap3: pm: Update Triton2 scripts

Updated the sleep, wakeup  warm_reset sequence as recommended by David Derrick.
Used broadcast command, modified the resource type association and remap 
sleep_state.
Added the new script changes for zoom[2,3] boards.

VDD1, VDD2 and VPLL1 are remapped to turn off during sleep state.
Changed RES_TYPE2 of VPLL1, VDD1, VDD2, REGEN, NRESPWRON  SYSEN to '1'
and VINTANA1, VINTANA2, VINTDIG, VIO, CLKEN  HFCLKOUT to '2'.

How about VMMC,VAUX and other resources?



HFCLKOUT is attached to P3, to disable HFCLK when clk_req signal is toggled.

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com

---
 arch/arm/mach-omap2/board-3430sdp.c  |   83 
 arch/arm/mach-omap2/board-zoom-peripherals.c |  107 +++
 include/linux/i2c/twl.h  |4 +
 3 files changed, 161 insertions(+), 33 deletions(-)

Index: linux-omap-pm/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-pm.orig/arch/arm/mach-omap2/board-3430sdp.c  2010-01-19 
21:34:57.0 +0530
+++ linux-omap-pm/arch/arm/mach-omap2/board-3430sdp.c   2010-01-19 
21:41:26.0 +0530
@@ -448,14 +448,11 @@
 
 
 static struct twl4030_ins __initdata sleep_on_seq[] = {

-   /* Turn off HFCLKOUT */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 2},
-   /* Turn OFF VDD1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 2},
-   /* Turn OFF VDD2 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
-   /* Turn OFF VPLL1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 2},
+   /* Broadcast message to put res to sleep */
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+   RES_STATE_SLEEP), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+   RES_STATE_SLEEP), 2},
 };
 
 static struct twl4030_script sleep_on_script __initdata = {

@@ -465,14 +462,9 @@
 };
 
 static struct twl4030_ins wakeup_p12_seq[] __initdata = {

-   /* Turn on HFCLKOUT */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-   /* Turn ON VDD1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 2},
-   /* Turn ON VDD2 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
-   /* Turn ON VPLL1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 2},
+   /* Broadcast message to put res to active */
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+   RES_STATE_ACTIVE), 2},
 };
 
 static struct twl4030_script wakeup_p12_script __initdata = {

@@ -482,7 +474,9 @@
 };
 
 static struct twl4030_ins wakeup_p3_seq[] __initdata = {

-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+   /* Broadcast message to put res to active */
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+   RES_STATE_ACTIVE), 2},
 };
 
 static struct twl4030_script wakeup_p3_script __initdata = {

@@ -494,18 +488,23 @@
 static struct twl4030_ins wrst_seq[] __initdata = {
 /*
  * Reset twl4030.
- * Reset VDD1 regulator.
- * Reset VDD2 regulator.
- * Reset VPLL1 regulator.
- * Enable sysclk output.
+ * Reset Main_Ref.
+ * Reset All type2_group2.
+ * Reset VUSB_3v1.
+ * Reset All type2_group1.
+ * Reset RC.
  * Reenable twl4030.
  */
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_Main_Ref, RES_STATE_WRST), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+   RES_STATE_WRST), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_VUSB_3V1, RES_STATE_WRST), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+   RES_STATE_WRST), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_RC, RES_TYPE_ALL, RES_TYPE2_R0,
+   RES_STATE_WRST), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2},
 };
 static struct twl4030_script wrst_script __initdata = {
.script = wrst_seq,
@@ -521,12 

[PATCH v2 3/6] omap3: pm: Update Triton2 scripts

2010-01-19 Thread x0080970
From: Lesly A M x0080...@ti.com

omap3: pm: Update Triton2 scripts

Updated the sleep, wakeup  warm_reset sequence as recommended by David Derrick.
Used broadcast command, modified the resource type association and remap 
sleep_state.
Added the new script changes for zoom[2,3] boards.

VDD1, VDD2 and VPLL1 are remapped to turn off during sleep state.
Changed RES_TYPE2 of VPLL1, VDD1, VDD2, REGEN, NRESPWRON  SYSEN to '1'
and VINTANA1, VINTANA2, VINTDIG, VIO, CLKEN  HFCLKOUT to '2'.

HFCLKOUT is attached to P3, to disable HFCLK when clk_req signal is toggled.

Signed-off-by: Lesly A M x0080...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: David Derrick dderr...@ti.com
Cc: Samuel Ortiz sa...@linux.intel.com

---
 arch/arm/mach-omap2/board-3430sdp.c  |   83 
 arch/arm/mach-omap2/board-zoom-peripherals.c |  107 +++
 include/linux/i2c/twl.h  |4 +
 3 files changed, 161 insertions(+), 33 deletions(-)

Index: linux-omap-pm/arch/arm/mach-omap2/board-3430sdp.c
===
--- linux-omap-pm.orig/arch/arm/mach-omap2/board-3430sdp.c  2010-01-19 
21:34:57.0 +0530
+++ linux-omap-pm/arch/arm/mach-omap2/board-3430sdp.c   2010-01-19 
21:41:26.0 +0530
@@ -448,14 +448,11 @@
 
 
 static struct twl4030_ins __initdata sleep_on_seq[] = {
-   /* Turn off HFCLKOUT */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 2},
-   /* Turn OFF VDD1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 2},
-   /* Turn OFF VDD2 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
-   /* Turn OFF VPLL1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 2},
+   /* Broadcast message to put res to sleep */
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+   RES_STATE_SLEEP), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+   RES_STATE_SLEEP), 2},
 };
 
 static struct twl4030_script sleep_on_script __initdata = {
@@ -465,14 +462,9 @@
 };
 
 static struct twl4030_ins wakeup_p12_seq[] __initdata = {
-   /* Turn on HFCLKOUT */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-   /* Turn ON VDD1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 2},
-   /* Turn ON VDD2 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
-   /* Turn ON VPLL1 */
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 2},
+   /* Broadcast message to put res to active */
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+   RES_STATE_ACTIVE), 2},
 };
 
 static struct twl4030_script wakeup_p12_script __initdata = {
@@ -482,7 +474,9 @@
 };
 
 static struct twl4030_ins wakeup_p3_seq[] __initdata = {
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+   /* Broadcast message to put res to active */
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+   RES_STATE_ACTIVE), 2},
 };
 
 static struct twl4030_script wakeup_p3_script __initdata = {
@@ -494,18 +488,23 @@
 static struct twl4030_ins wrst_seq[] __initdata = {
 /*
  * Reset twl4030.
- * Reset VDD1 regulator.
- * Reset VDD2 regulator.
- * Reset VPLL1 regulator.
- * Enable sysclk output.
+ * Reset Main_Ref.
+ * Reset All type2_group2.
+ * Reset VUSB_3v1.
+ * Reset All type2_group1.
+ * Reset RC.
  * Reenable twl4030.
  */
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_Main_Ref, RES_STATE_WRST), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R2,
+   RES_STATE_WRST), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_VUSB_3V1, RES_STATE_WRST), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_R0, RES_TYPE2_R1,
+   RES_STATE_WRST), 2},
+   {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_RC, RES_TYPE_ALL, RES_TYPE2_R0,
+   RES_STATE_WRST), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2},
 };
 static struct twl4030_script wrst_script __initdata = {
.script = wrst_seq,
@@ -521,12 +520,30 @@
 };
 
 static struct twl4030_resconfig twl4030_rconfig[] = {
-   { .resource = RES_HFCLKOUT, .devgroup =