Skip to content

Commit

Permalink
ARM: imx: add suspend in ocram support for i.mx6q
Browse files Browse the repository at this point in the history
When system enter suspend, we can set the DDR IO to
high-Z state to save DDR IOs' power consumption, this
operation can save many power(from ~26mA@1.5V to ~15mA@1.5V,
measured on i.MX6Q SabreSD board, R25) of DDR IOs. To
achieve that, we need to copy the suspend code to ocram
and run the low level hardware related code(set DDR IOs
to high-Z state) in ocram.

If there is no ocram space available, then system will
still do suspend in external DDR, hence no DDR IOs will
be set to high-Z.

The OCRAM usage layout is as below,

ocram suspend region(4K currently):
======================== high address ======================
                              .
                              .
                              .
                              ^
                              ^
                              ^
                      imx6_suspend code
             PM_INFO structure(imx6_cpu_pm_info)
======================== low address =======================

Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
  • Loading branch information
Anson Huang authored and Shawn Guo committed Mar 5, 2014
1 parent 02ae8e8 commit df59574
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 11 deletions.
3 changes: 2 additions & 1 deletion arch/arm/mach-imx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o

obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o
AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o suspend-imx6.o
# i.MX6SL reuses i.MX6Q code
obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o

Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-imx/common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved.
*/

/*
Expand Down Expand Up @@ -145,8 +145,12 @@ void imx6sl_set_wait_clk(bool enter);
void imx_cpu_die(unsigned int cpu);
int imx_cpu_kill(unsigned int cpu);

void imx6_suspend(void __iomem *ocram_vbase);
void imx6q_pm_init(void);
void imx6dl_pm_init(void);
void imx6sl_pm_init(void);
void imx6q_pm_set_ccm_base(void __iomem *base);

#ifdef CONFIG_PM
void imx5_pm_init(void);
#else
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-imx/hardware.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright 2004-2007, 2014 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright 2008 Juergen Beisert, kernel@pengutronix.de
*
* This program is free software; you can redistribute it and/or
Expand All @@ -20,7 +20,9 @@
#ifndef __ASM_ARCH_MXC_HARDWARE_H__
#define __ASM_ARCH_MXC_HARDWARE_H__

#ifndef __ASSEMBLY__
#include <asm/io.h>
#endif
#include <asm/sizes.h>

#define addr_in_module(addr, mod) \
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mach-imx6q.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static void __init imx6q_init_machine(void)
of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);

imx_anatop_init();
imx6q_pm_init();
cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
imx6q_1588_init();
}

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-imx/mach-imx6sl.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ static void __init imx6sl_init_machine(void)

imx6sl_fec_init();
imx_anatop_init();
/* Reuse imx6q pm code */
imx6q_pm_init();
imx6sl_pm_init();
}

static void __init imx6sl_init_irq(void)
Expand Down
Loading

0 comments on commit df59574

Please sign in to comment.