From: helmut.raiger@hale.at (Helmut Raiger)
To: linux-arm-kernel@lists.infradead.org
Subject: i.MX31 suspend and VSTBY question
Date: Mon, 21 Mar 2011 13:54:01 +0100 [thread overview]
Message-ID: <4D874A69.9010209@hale.at> (raw)
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.
next reply other threads:[~2011-03-21 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 12:54 Helmut Raiger [this message]
2011-03-21 15:59 ` i.MX31 suspend and VSTBY question 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D874A69.9010209@hale.at \
--to=helmut.raiger@hale.at \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.