diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-03-02 10:04:47 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-03-02 10:04:47 -0500 |
commit | cb66bb1d6fab2d91960c20f256c6986d5afac1a1 (patch) | |
tree | 08bec33c473e85de9478b68cb1f3fbc1e6ebef07 /arch | |
parent | b23f46c7471d0adcf81092b6702299562c4149c5 (diff) | |
parent | bb07d7511e0884f913a0610d5f9a2f8a27914042 (diff) |
Merge branch 'features/imx3' of git://git.pengutronix.de/git/imx/linux-2.6 into next/soc
* 'features/imx3' of git://git.pengutronix.de/git/imx/linux-2.6:
ARM: mx3: Setup AIPS registers
ARM: mx3: Let mx31 and mx35 enter in LPM mode in WFI
Conflicts:
arch/arm/mach-imx/mm-imx3.c
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/crmregs-imx31.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx3.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/pm-imx3.c | 37 | ||||
-rw-r--r-- | arch/arm/plat-mxc/cpu.c | 24 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/common.h | 9 |
6 files changed, 78 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 55db9c488f2b..f4b6fb0730cb 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -8,8 +8,8 @@ obj-$(CONFIG_SOC_IMX25) += clock-imx25.o mm-imx25.o ehci-imx25.o cpu-imx25.o | |||
8 | obj-$(CONFIG_SOC_IMX27) += cpu-imx27.o pm-imx27.o | 8 | obj-$(CONFIG_SOC_IMX27) += cpu-imx27.o pm-imx27.o |
9 | obj-$(CONFIG_SOC_IMX27) += clock-imx27.o mm-imx27.o ehci-imx27.o | 9 | obj-$(CONFIG_SOC_IMX27) += clock-imx27.o mm-imx27.o ehci-imx27.o |
10 | 10 | ||
11 | obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clock-imx31.o iomux-imx31.o ehci-imx31.o | 11 | obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clock-imx31.o iomux-imx31.o ehci-imx31.o pm-imx3.o |
12 | obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clock-imx35.o ehci-imx35.o | 12 | obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clock-imx35.o ehci-imx35.o pm-imx3.o |
13 | 13 | ||
14 | obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clock-mx51-mx53.o ehci-imx5.o pm-imx5.o cpu_op-mx51.o | 14 | obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clock-mx51-mx53.o ehci-imx5.o pm-imx5.o cpu_op-mx51.o |
15 | 15 | ||
diff --git a/arch/arm/mach-imx/crmregs-imx31.h b/arch/arm/mach-imx/crmregs-imx31.h index 37a8a07beda3..9a34d393b813 100644 --- a/arch/arm/mach-imx/crmregs-imx31.h +++ b/arch/arm/mach-imx/crmregs-imx31.h | |||
@@ -64,6 +64,7 @@ | |||
64 | #define MXC_CCM_CCMR_SSI2S_MASK (0x3 << 21) | 64 | #define MXC_CCM_CCMR_SSI2S_MASK (0x3 << 21) |
65 | #define MXC_CCM_CCMR_LPM_OFFSET 14 | 65 | #define MXC_CCM_CCMR_LPM_OFFSET 14 |
66 | #define MXC_CCM_CCMR_LPM_MASK (0x3 << 14) | 66 | #define MXC_CCM_CCMR_LPM_MASK (0x3 << 14) |
67 | #define MXC_CCM_CCMR_LPM_WAIT_MX35 (0x1 << 14) | ||
67 | #define MXC_CCM_CCMR_FIRS_OFFSET 11 | 68 | #define MXC_CCM_CCMR_FIRS_OFFSET 11 |
68 | #define MXC_CCM_CCMR_FIRS_MASK (0x3 << 11) | 69 | #define MXC_CCM_CCMR_FIRS_MASK (0x3 << 11) |
69 | #define MXC_CCM_CCMR_UPE (1 << 9) | 70 | #define MXC_CCM_CCMR_UPE (1 << 9) |
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c index 8404ee72555a..b23bd3f09a60 100644 --- a/arch/arm/mach-imx/mm-imx3.c +++ b/arch/arm/mach-imx/mm-imx3.c | |||
@@ -34,6 +34,8 @@ static void imx3_idle(void) | |||
34 | { | 34 | { |
35 | unsigned long reg = 0; | 35 | unsigned long reg = 0; |
36 | 36 | ||
37 | mx3_cpu_lp_set(MX3_WAIT); | ||
38 | |||
37 | __asm__ __volatile__( | 39 | __asm__ __volatile__( |
38 | /* disable I and D cache */ | 40 | /* disable I and D cache */ |
39 | "mrc p15, 0, %0, c1, c0, 0\n" | 41 | "mrc p15, 0, %0, c1, c0, 0\n" |
@@ -173,6 +175,9 @@ void __init imx31_soc_init(void) | |||
173 | } | 175 | } |
174 | 176 | ||
175 | imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); | 177 | imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); |
178 | |||
179 | imx_set_aips(MX31_IO_ADDRESS(MX31_AIPS1_BASE_ADDR)); | ||
180 | imx_set_aips(MX31_IO_ADDRESS(MX31_AIPS2_BASE_ADDR)); | ||
176 | } | 181 | } |
177 | #endif /* ifdef CONFIG_SOC_IMX31 */ | 182 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
178 | 183 | ||
diff --git a/arch/arm/mach-imx/pm-imx3.c b/arch/arm/mach-imx/pm-imx3.c new file mode 100644 index 000000000000..b3752439632e --- /dev/null +++ b/arch/arm/mach-imx/pm-imx3.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | */ | ||
11 | #include <linux/io.h> | ||
12 | #include <mach/common.h> | ||
13 | #include <mach/hardware.h> | ||
14 | #include <mach/devices-common.h> | ||
15 | #include "crmregs-imx3.h" | ||
16 | |||
17 | /* | ||
18 | * Set cpu low power mode before WFI instruction. This function is called | ||
19 | * mx3 because it can be used for mx31 and mx35. | ||
20 | * Currently only WAIT_MODE is supported. | ||
21 | */ | ||
22 | void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode) | ||
23 | { | ||
24 | int reg = __raw_readl(MXC_CCM_CCMR); | ||
25 | reg &= ~MXC_CCM_CCMR_LPM_MASK; | ||
26 | |||
27 | switch (mode) { | ||
28 | case MX3_WAIT: | ||
29 | if (cpu_is_mx35()) | ||
30 | reg |= MXC_CCM_CCMR_LPM_WAIT_MX35; | ||
31 | __raw_writel(reg, MXC_CCM_CCMR); | ||
32 | break; | ||
33 | default: | ||
34 | pr_err("Unknown cpu power mode: %d\n", mode); | ||
35 | return; | ||
36 | } | ||
37 | } | ||
diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/plat-mxc/cpu.c index f5b7e0fa237f..220dd6f93126 100644 --- a/arch/arm/plat-mxc/cpu.c +++ b/arch/arm/plat-mxc/cpu.c | |||
@@ -1,5 +1,6 @@ | |||
1 | 1 | ||
2 | #include <linux/module.h> | 2 | #include <linux/module.h> |
3 | #include <linux/io.h> | ||
3 | #include <mach/hardware.h> | 4 | #include <mach/hardware.h> |
4 | 5 | ||
5 | unsigned int __mxc_cpu_type; | 6 | unsigned int __mxc_cpu_type; |
@@ -18,3 +19,26 @@ void imx_print_silicon_rev(const char *cpu, int srev) | |||
18 | pr_info("CPU identified as %s, silicon rev %d.%d\n", | 19 | pr_info("CPU identified as %s, silicon rev %d.%d\n", |
19 | cpu, (srev >> 4) & 0xf, srev & 0xf); | 20 | cpu, (srev >> 4) & 0xf, srev & 0xf); |
20 | } | 21 | } |
22 | |||
23 | void __init imx_set_aips(void __iomem *base) | ||
24 | { | ||
25 | unsigned int reg; | ||
26 | /* | ||
27 | * Set all MPROTx to be non-bufferable, trusted for R/W, | ||
28 | * not forced to user-mode. | ||
29 | */ | ||
30 | __raw_writel(0x77777777, base + 0x0); | ||
31 | __raw_writel(0x77777777, base + 0x4); | ||
32 | |||
33 | /* | ||
34 | * Set all OPACRx to be non-bufferable, to not require | ||
35 | * supervisor privilege level for access, allow for | ||
36 | * write access and untrusted master access. | ||
37 | */ | ||
38 | __raw_writel(0x0, base + 0x40); | ||
39 | __raw_writel(0x0, base + 0x44); | ||
40 | __raw_writel(0x0, base + 0x48); | ||
41 | __raw_writel(0x0, base + 0x4C); | ||
42 | reg = __raw_readl(base + 0x50) & 0x00FFFFFF; | ||
43 | __raw_writel(reg, base + 0x50); | ||
44 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 1bf0df81bdc6..7c24e5ab7d50 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h | |||
@@ -75,6 +75,7 @@ extern void mxc_restart(char, const char *); | |||
75 | extern void mxc_arch_reset_init(void __iomem *); | 75 | extern void mxc_arch_reset_init(void __iomem *); |
76 | extern int mx53_revision(void); | 76 | extern int mx53_revision(void); |
77 | extern int mx53_display_revision(void); | 77 | extern int mx53_display_revision(void); |
78 | extern void imx_set_aips(void __iomem *); | ||
78 | 79 | ||
79 | enum mxc_cpu_pwr_mode { | 80 | enum mxc_cpu_pwr_mode { |
80 | WAIT_CLOCKED, /* wfi only */ | 81 | WAIT_CLOCKED, /* wfi only */ |
@@ -84,6 +85,14 @@ enum mxc_cpu_pwr_mode { | |||
84 | STOP_POWER_OFF, /* STOP + SRPG */ | 85 | STOP_POWER_OFF, /* STOP + SRPG */ |
85 | }; | 86 | }; |
86 | 87 | ||
88 | enum mx3_cpu_pwr_mode { | ||
89 | MX3_RUN, | ||
90 | MX3_WAIT, | ||
91 | MX3_DOZE, | ||
92 | MX3_SLEEP, | ||
93 | }; | ||
94 | |||
95 | extern void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode); | ||
87 | extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode); | 96 | extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode); |
88 | extern void imx_print_silicon_rev(const char *cpu, int srev); | 97 | extern void imx_print_silicon_rev(const char *cpu, int srev); |
89 | 98 | ||