* i.MX31 suspend and VSTBY question
@ 2011-03-21 12:54 Helmut Raiger
2011-03-21 15:59 ` Nguyen Dinh-R00091
0 siblings, 1 reply; 5+ messages in thread
From: Helmut Raiger @ 2011-03-21 12:54 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
I'm currently testing 'suspend to memory' on our i.MX31 platform,
therefore I created a file named pm-imx31.c in arch/arm/plat-mxc. It
contains some debugging code for the PMIC registers, that was hacked
into mc13xxx_core.c.
------------------- snip: pm-imx31.c --------------------------
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/suspend.h>
#include <linux/regulator/machine.h>
#include <mach/system.h>
// HACK
#include "../mach-mx3/crm_regs.h"
extern void mc13xxx_dump_registers(void);
static void mxc_modify_reg(void *reg_offset, unsigned int mask,
unsigned int data)
{
u32 reg;
reg = __raw_readl(reg_offset);
reg = (reg & (~mask)) | data;
__raw_writel(reg, reg_offset);
}
static int mx31_suspend_prepare(void)
{
#ifdef CONFIG_PM_DEBUG
mc13xxx_dump_registers();
#endif
return 0;
}
static int mx31_suspend_enter(suspend_state_t state)
{
unsigned long *reg;
switch (state) {
case PM_SUSPEND_MEM:
/* TODO: Enable Well Bias, disable core clock in standby */
mxc_modify_reg(MXC_CCM_CCMR,
MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_SBYCS,
MXC_CCM_CCMR_SBYCS);
mxc_modify_reg(MXC_CCM_CCMR,
MXC_CCM_CCMR_LPM_MASK,
2 << MXC_CCM_CCMR_LPM_OFFSET);
/* enable VSTBY signalling */
mxc_modify_reg(MXC_CCM_CCMR, MXC_CCM_CCMR_VSTBY,
MXC_CCM_CCMR_VSTBY);
printk(KERN_INFO "Now supsending! CCMR=0x%x\n",
__raw_readl(MXC_CCM_CCMR));
for (reg = MXC_CCM_CCMR; reg <= MXC_CCM_PDR2; reg++)
printk(KERN_INFO "0x%p: 0x%08lx\n", reg, *reg);
arch_idle();
printk(KERN_INFO "Now resuming\n");
break;
default:
return -EINVAL;
}
return 0;
}
static void mx31_resume_done(void)
{
#ifdef CONFIG_PM_DEBUG
mc13xxx_dump_registers();
#endif
}
struct platform_suspend_ops mx31_suspend_ops = {
.valid = suspend_valid_only_mem,
.prepare = mx31_suspend_prepare,
.enter = mx31_suspend_enter,
.end = mx31_resume_done,
};
static int __init mx31_pm_init(void)
{
printk(KERN_INFO "Power Management for Freescale MX31\n");
suspend_set_ops(&mx31_suspend_ops);
return 0;
}
------------------- snip --------------------------
'echo mem >/sys/power/state' does what is expected, however the VSTBY
line is not asserted.
We had this platform running with a 2.6.21 LTIB based kernel. When I use
this image (hardly comparable) the signal appears as expected. I'm
running out of ideas, so any pointers would be very much appreciated.
Helmut
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 5+ messages in thread
* i.MX31 suspend and VSTBY question
2011-03-21 12:54 i.MX31 suspend and VSTBY question Helmut Raiger
@ 2011-03-21 15:59 ` Nguyen Dinh-R00091
2011-03-21 16:19 ` Helmut Raiger
0 siblings, 1 reply; 5+ messages in thread
From: Nguyen Dinh-R00091 @ 2011-03-21 15:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
>-----Original Message-----
From: linux-arm-kernel-bounces@lists.infradead.org [mailto:linux-arm-kernel-
>bounces at lists.infradead.org] On Behalf Of Helmut Raiger
>Sent: Monday, March 21, 2011 7:54 AM
>To: linux-arm-kernel at lists.infradead.org
>Subject: i.MX31 suspend and VSTBY question
>
>Hi,
> I'm currently testing 'suspend to memory' on our i.MX31 platform,
>therefore I created a file named pm-imx31.c in arch/arm/plat-mxc. It
>contains some debugging code for the PMIC registers, that was hacked
>into mc13xxx_core.c.
>
>------------------- snip: pm-imx31.c --------------------------
>
>#include <linux/kernel.h>
>#include <linux/err.h>
>#include <linux/suspend.h>
>#include <linux/regulator/machine.h>
>
>#include <mach/system.h>
>// HACK
>#include "../mach-mx3/crm_regs.h"
>
>extern void mc13xxx_dump_registers(void);
>
>static void mxc_modify_reg(void *reg_offset, unsigned int mask,
> unsigned int data)
>{
> u32 reg;
>
> reg = __raw_readl(reg_offset);
> reg = (reg & (~mask)) | data;
> __raw_writel(reg, reg_offset);
>}
>
>static int mx31_suspend_prepare(void)
>{
>#ifdef CONFIG_PM_DEBUG
> mc13xxx_dump_registers();
>#endif
> return 0;
>}
>
>static int mx31_suspend_enter(suspend_state_t state)
>{
> unsigned long *reg;
>
> switch (state) {
> case PM_SUSPEND_MEM:
> /* TODO: Enable Well Bias, disable core clock in standby */
> mxc_modify_reg(MXC_CCM_CCMR,
> MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_SBYCS,
> MXC_CCM_CCMR_SBYCS);
For our release that has LPM working:
/* Enable Well Bias and set VSTBY
* VSTBY pin will be asserted during SR mode. This asks the
* PM IC to set the core voltage to the standby voltage
* Must clear the MXC_CCM_CCMR_SBYCS bit as well */
mxc_ccm_modify_reg(MXC_CCM_CCMR,
MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_VSTBY |
MXC_CCM_CCMR_SBYCS,
MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_VSTBY);
Dinh
>
> mxc_modify_reg(MXC_CCM_CCMR,
> MXC_CCM_CCMR_LPM_MASK,
> 2 << MXC_CCM_CCMR_LPM_OFFSET);
>
> /* enable VSTBY signalling */
> mxc_modify_reg(MXC_CCM_CCMR, MXC_CCM_CCMR_VSTBY,
>MXC_CCM_CCMR_VSTBY);
>
> printk(KERN_INFO "Now supsending! CCMR=0x%x\n",
>__raw_readl(MXC_CCM_CCMR));
>
> for (reg = MXC_CCM_CCMR; reg <= MXC_CCM_PDR2; reg++)
> printk(KERN_INFO "0x%p: 0x%08lx\n", reg, *reg);
>
> arch_idle();
>
> printk(KERN_INFO "Now resuming\n");
> break;
> default:
> return -EINVAL;
> }
> return 0;
>}
>
>static void mx31_resume_done(void)
>{
>#ifdef CONFIG_PM_DEBUG
> mc13xxx_dump_registers();
>#endif
>
>}
>
>struct platform_suspend_ops mx31_suspend_ops = {
> .valid = suspend_valid_only_mem,
> .prepare = mx31_suspend_prepare,
> .enter = mx31_suspend_enter,
> .end = mx31_resume_done,
>};
>
>static int __init mx31_pm_init(void)
>{
> printk(KERN_INFO "Power Management for Freescale MX31\n");
> suspend_set_ops(&mx31_suspend_ops);
>
> return 0;
>}
>
>------------------- snip --------------------------
>
>'echo mem >/sys/power/state' does what is expected, however the VSTBY
>line is not asserted.
>
>We had this platform running with a 2.6.21 LTIB based kernel. When I use
>this image (hardly comparable) the signal appears as expected. I'm
>running out of ideas, so any pointers would be very much appreciated.
>
>Helmut
>
>
>
>--
>Scanned by MailScanner.
>
>
>_______________________________________________
>linux-arm-kernel mailing list
>linux-arm-kernel at lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* i.MX31 suspend and VSTBY question
2011-03-21 15:59 ` Nguyen Dinh-R00091
@ 2011-03-21 16:19 ` Helmut Raiger
2011-03-21 16:43 ` Nguyen Dinh-R00091
0 siblings, 1 reply; 5+ messages in thread
From: Helmut Raiger @ 2011-03-21 16:19 UTC (permalink / raw)
To: linux-arm-kernel
Thanks for your response! Your CCMR register setting does not change the
behaviour on my board.
A few questions:
1) What kernel version are you running?
2) Did you verify the VSTBY pin action (i.e. pin changes to high in
state retention mode and the pmic changes the voltages to their
programmed standby mode) ?
3) As I already mentioned in my first post, the VSTBY signal is
asserted, when I use a LTIB 2.6.21 build, but not in 2.6.38-rc1+
> For our release that has LPM working:
> /* Enable Well Bias and set VSTBY
> * VSTBY pin will be asserted during SR mode. This asks the
> * PM IC to set the core voltage to the standby voltage
> * Must clear the MXC_CCM_CCMR_SBYCS bit as well */
> mxc_ccm_modify_reg(MXC_CCM_CCMR,
> MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_VSTBY |
> MXC_CCM_CCMR_SBYCS,
> MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_VSTBY);
>
> Dinh
>
Helmut
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 5+ messages in thread
* i.MX31 suspend and VSTBY question
2011-03-21 16:19 ` Helmut Raiger
@ 2011-03-21 16:43 ` Nguyen Dinh-R00091
2011-03-24 7:06 ` Helmut Raiger
0 siblings, 1 reply; 5+ messages in thread
From: Nguyen Dinh-R00091 @ 2011-03-21 16:43 UTC (permalink / raw)
To: linux-arm-kernel
Hi Helmut,
>-----Original Message-----
From: linux-arm-kernel-bounces@lists.infradead.org [mailto:linux-arm-kernel-
>bounces at lists.infradead.org] On Behalf Of Helmut Raiger
>Sent: Monday, March 21, 2011 11:20 AM
>To: linux-arm-kernel at lists.infradead.org
>Subject: Re: i.MX31 suspend and VSTBY question
>
>Thanks for your response! Your CCMR register setting does not change the
>behaviour on my board.
>
>A few questions:
>
>1) What kernel version are you running?
Unfortunately our last fully tested version was on 2.6.24. I'll dig around some more to see if there's something that might be useful to you.
Dinh
>2) Did you verify the VSTBY pin action (i.e. pin changes to high in
>state retention mode and the pmic changes the voltages to their
>programmed standby mode) ?
>3) As I already mentioned in my first post, the VSTBY signal is
>asserted, when I use a LTIB 2.6.21 build, but not in 2.6.38-rc1+
>
>> For our release that has LPM working:
>> /* Enable Well Bias and set VSTBY
>> * VSTBY pin will be asserted during SR mode. This asks the
>> * PM IC to set the core voltage to the standby voltage
>> * Must clear the MXC_CCM_CCMR_SBYCS bit as well */
>> mxc_ccm_modify_reg(MXC_CCM_CCMR,
>> MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_VSTBY |
>> MXC_CCM_CCMR_SBYCS,
>> MXC_CCM_CCMR_WBEN | MXC_CCM_CCMR_VSTBY);
>>
>> Dinh
>>
>
>Helmut
>
>
>--
>Scanned by MailScanner.
>
>
>_______________________________________________
>linux-arm-kernel mailing list
>linux-arm-kernel at lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread
* i.MX31 suspend and VSTBY question
2011-03-21 16:43 ` Nguyen Dinh-R00091
@ 2011-03-24 7:06 ` Helmut Raiger
0 siblings, 0 replies; 5+ messages in thread
From: Helmut Raiger @ 2011-03-24 7:06 UTC (permalink / raw)
To: linux-arm-kernel
Hi Dinh,
did you find something, I've still got no solution to this. I
checked the CCM registers and compared them with the 2.6.21 version. The
differences I found were concerning the DPTC and DVFS registers mainly.
However quite a few clock gate settings were different as well. Might
this influence the state retention mode in some way?
Helmut
> Unfortunately our last fully tested version was on 2.6.24. I'll dig around some more to see if there's something that might be useful to you.
>
> Dinh
>
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-24 7:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 12:54 i.MX31 suspend and VSTBY question Helmut Raiger
2011-03-21 15:59 ` Nguyen Dinh-R00091
2011-03-21 16:19 ` Helmut Raiger
2011-03-21 16:43 ` Nguyen Dinh-R00091
2011-03-24 7:06 ` Helmut Raiger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).