aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorJoseph Lo <josephl@nvidia.com>2013-10-11 05:58:38 -0400
committerStephen Warren <swarren@nvidia.com>2013-10-18 18:28:10 -0400
commitf0c4ac1329452e5d31a03b4bb711c330065c0369 (patch)
tree38f618cae4e1cf374681d6569aeb486dec44aa69 /arch/arm/mach-tegra
parent92e94fe1cdaf3c6c636dc2c5129f8eabc89dca6c (diff)
ARM: tegra: add LP1 support code for Tegra124
The LP1 suspend procedure is the same with Tegra30 and Tegra114. Just need to update the difference of the register address, then we can continue to share the code. Signed-off-by: Joseph Lo <josephl@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/Makefile1
-rw-r--r--arch/arm/mach-tegra/flowctrl.c2
-rw-r--r--arch/arm/mach-tegra/iomap.h3
-rw-r--r--arch/arm/mach-tegra/pm.c12
-rw-r--r--arch/arm/mach-tegra/sleep-tegra30.S33
5 files changed, 43 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index de3748ed0b42..019bb1758662 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -36,6 +36,7 @@ ifeq ($(CONFIG_CPU_IDLE),y)
36obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o 36obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
37endif 37endif
38obj-$(CONFIG_ARCH_TEGRA_124_SOC) += sleep-tegra30.o 38obj-$(CONFIG_ARCH_TEGRA_124_SOC) += sleep-tegra30.o
39obj-$(CONFIG_ARCH_TEGRA_124_SOC) += pm-tegra30.o
39ifeq ($(CONFIG_CPU_IDLE),y) 40ifeq ($(CONFIG_CPU_IDLE),y)
40obj-$(CONFIG_ARCH_TEGRA_124_SOC) += cpuidle-tegra114.o 41obj-$(CONFIG_ARCH_TEGRA_124_SOC) += cpuidle-tegra114.o
41endif 42endif
diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c
index 5348543382bf..ce8ab8abf061 100644
--- a/arch/arm/mach-tegra/flowctrl.c
+++ b/arch/arm/mach-tegra/flowctrl.c
@@ -87,6 +87,7 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid)
87 break; 87 break;
88 case TEGRA30: 88 case TEGRA30:
89 case TEGRA114: 89 case TEGRA114:
90 case TEGRA124:
90 /* clear wfe bitmap */ 91 /* clear wfe bitmap */
91 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; 92 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
92 /* clear wfi bitmap */ 93 /* clear wfi bitmap */
@@ -125,6 +126,7 @@ void flowctrl_cpu_suspend_exit(unsigned int cpuid)
125 break; 126 break;
126 case TEGRA30: 127 case TEGRA30:
127 case TEGRA114: 128 case TEGRA114:
129 case TEGRA124:
128 /* clear wfe bitmap */ 130 /* clear wfe bitmap */
129 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; 131 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
130 /* clear wfi bitmap */ 132 /* clear wfi bitmap */
diff --git a/arch/arm/mach-tegra/iomap.h b/arch/arm/mach-tegra/iomap.h
index cbee57fc4fd8..26b1c2ad0ceb 100644
--- a/arch/arm/mach-tegra/iomap.h
+++ b/arch/arm/mach-tegra/iomap.h
@@ -105,6 +105,9 @@
105#define TEGRA_EMC1_BASE 0x7001A800 105#define TEGRA_EMC1_BASE 0x7001A800
106#define TEGRA_EMC1_SIZE SZ_2K 106#define TEGRA_EMC1_SIZE SZ_2K
107 107
108#define TEGRA124_EMC_BASE 0x7001B000
109#define TEGRA124_EMC_SIZE SZ_2K
110
108#define TEGRA_CSITE_BASE 0x70040000 111#define TEGRA_CSITE_BASE 0x70040000
109#define TEGRA_CSITE_SIZE SZ_256K 112#define TEGRA_CSITE_SIZE SZ_256K
110 113
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index 36ed88af1cc1..4ae0286b468d 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -59,8 +59,10 @@ static void tegra_tear_down_cpu_init(void)
59 break; 59 break;
60 case TEGRA30: 60 case TEGRA30:
61 case TEGRA114: 61 case TEGRA114:
62 case TEGRA124:
62 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) || 63 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) ||
63 IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC)) 64 IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) ||
65 IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC))
64 tegra_tear_down_cpu = tegra30_tear_down_cpu; 66 tegra_tear_down_cpu = tegra30_tear_down_cpu;
65 break; 67 break;
66 } 68 }
@@ -216,8 +218,10 @@ static bool tegra_lp1_iram_hook(void)
216 break; 218 break;
217 case TEGRA30: 219 case TEGRA30:
218 case TEGRA114: 220 case TEGRA114:
221 case TEGRA124:
219 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) || 222 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) ||
220 IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC)) 223 IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) ||
224 IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC))
221 tegra30_lp1_iram_hook(); 225 tegra30_lp1_iram_hook();
222 break; 226 break;
223 default: 227 default:
@@ -244,8 +248,10 @@ static bool tegra_sleep_core_init(void)
244 break; 248 break;
245 case TEGRA30: 249 case TEGRA30:
246 case TEGRA114: 250 case TEGRA114:
251 case TEGRA124:
247 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) || 252 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) ||
248 IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC)) 253 IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) ||
254 IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC))
249 tegra30_sleep_core_init(); 255 tegra30_sleep_core_init();
250 break; 256 break;
251 default: 257 default:
diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
index 7c529a136ee5..b16d4a57fa59 100644
--- a/arch/arm/mach-tegra/sleep-tegra30.S
+++ b/arch/arm/mach-tegra/sleep-tegra30.S
@@ -408,8 +408,12 @@ _pll_m_c_x_done:
408 cmp r10, #TEGRA30 408 cmp r10, #TEGRA30
409 movweq r0, #:lower16:TEGRA_EMC_BASE @ r0 reserved for emc base 409 movweq r0, #:lower16:TEGRA_EMC_BASE @ r0 reserved for emc base
410 movteq r0, #:upper16:TEGRA_EMC_BASE 410 movteq r0, #:upper16:TEGRA_EMC_BASE
411 movwne r0, #:lower16:TEGRA_EMC0_BASE 411 cmp r10, #TEGRA114
412 movtne r0, #:upper16:TEGRA_EMC0_BASE 412 movweq r0, #:lower16:TEGRA_EMC0_BASE
413 movteq r0, #:upper16:TEGRA_EMC0_BASE
414 cmp r10, #TEGRA124
415 movweq r0, #:lower16:TEGRA124_EMC_BASE
416 movteq r0, #:upper16:TEGRA124_EMC_BASE
413 417
414exit_self_refresh: 418exit_self_refresh:
415 ldr r1, [r5, #0xC] @ restore EMC_XM2VTTGENPADCTRL 419 ldr r1, [r5, #0xC] @ restore EMC_XM2VTTGENPADCTRL
@@ -556,6 +560,17 @@ tegra114_sdram_pad_address:
556 .word TEGRA_EMC1_BASE + EMC_XM2VTTGENPADCTRL2 @0x30 560 .word TEGRA_EMC1_BASE + EMC_XM2VTTGENPADCTRL2 @0x30
557tegra114_sdram_pad_adress_end: 561tegra114_sdram_pad_adress_end:
558 562
563tegra124_sdram_pad_address:
564 .word TEGRA124_EMC_BASE + EMC_CFG @0x0
565 .word TEGRA124_EMC_BASE + EMC_ZCAL_INTERVAL @0x4
566 .word TEGRA124_EMC_BASE + EMC_AUTO_CAL_INTERVAL @0x8
567 .word TEGRA124_EMC_BASE + EMC_XM2VTTGENPADCTRL @0xc
568 .word TEGRA124_EMC_BASE + EMC_XM2VTTGENPADCTRL2 @0x10
569 .word TEGRA_PMC_BASE + PMC_IO_DPD_STATUS @0x14
570 .word TEGRA_CLK_RESET_BASE + CLK_RESET_CLK_SOURCE_MSELECT @0x18
571 .word TEGRA_CLK_RESET_BASE + CLK_RESET_SCLK_BURST @0x1c
572tegra124_sdram_pad_address_end:
573
559tegra30_sdram_pad_size: 574tegra30_sdram_pad_size:
560 .word tegra30_sdram_pad_address_end - tegra30_sdram_pad_address 575 .word tegra30_sdram_pad_address_end - tegra30_sdram_pad_address
561 576
@@ -700,8 +715,13 @@ tegra30_sdram_self_refresh:
700 cmp r10, #TEGRA30 715 cmp r10, #TEGRA30
701 adreq r2, tegra30_sdram_pad_address 716 adreq r2, tegra30_sdram_pad_address
702 ldreq r3, tegra30_sdram_pad_size 717 ldreq r3, tegra30_sdram_pad_size
703 adrne r2, tegra114_sdram_pad_address 718 cmp r10, #TEGRA114
704 ldrne r3, tegra114_sdram_pad_size 719 adreq r2, tegra114_sdram_pad_address
720 ldreq r3, tegra114_sdram_pad_size
721 cmp r10, #TEGRA124
722 adreq r2, tegra124_sdram_pad_address
723 ldreq r3, tegra30_sdram_pad_size
724
705 mov r9, #0 725 mov r9, #0
706 726
707padsave: 727padsave:
@@ -719,7 +739,10 @@ padsave_done:
719 739
720 cmp r10, #TEGRA30 740 cmp r10, #TEGRA30
721 ldreq r0, =TEGRA_EMC_BASE @ r0 reserved for emc base addr 741 ldreq r0, =TEGRA_EMC_BASE @ r0 reserved for emc base addr
722 ldrne r0, =TEGRA_EMC0_BASE 742 cmp r10, #TEGRA114
743 ldreq r0, =TEGRA_EMC0_BASE
744 cmp r10, #TEGRA124
745 ldreq r0, =TEGRA124_EMC_BASE
723 746
724enter_self_refresh: 747enter_self_refresh:
725 cmp r10, #TEGRA30 748 cmp r10, #TEGRA30