diff options
Diffstat (limited to 'arch/arm/mach-tegra/flowctrl.c')
-rw-r--r-- | arch/arm/mach-tegra/flowctrl.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c index 5393eb2cae21..b477ef310dcd 100644 --- a/arch/arm/mach-tegra/flowctrl.c +++ b/arch/arm/mach-tegra/flowctrl.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include "flowctrl.h" | 26 | #include "flowctrl.h" |
27 | #include "iomap.h" | 27 | #include "iomap.h" |
28 | #include "fuse.h" | ||
28 | 29 | ||
29 | static u8 flowctrl_offset_halt_cpu[] = { | 30 | static u8 flowctrl_offset_halt_cpu[] = { |
30 | FLOW_CTRL_HALT_CPU0_EVENTS, | 31 | FLOW_CTRL_HALT_CPU0_EVENTS, |
@@ -75,11 +76,26 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid) | |||
75 | int i; | 76 | int i; |
76 | 77 | ||
77 | reg = flowctrl_read_cpu_csr(cpuid); | 78 | reg = flowctrl_read_cpu_csr(cpuid); |
78 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; /* clear wfe bitmap */ | 79 | switch (tegra_chip_id) { |
79 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; /* clear wfi bitmap */ | 80 | case TEGRA20: |
81 | /* clear wfe bitmap */ | ||
82 | reg &= ~TEGRA20_FLOW_CTRL_CSR_WFE_BITMAP; | ||
83 | /* clear wfi bitmap */ | ||
84 | reg &= ~TEGRA20_FLOW_CTRL_CSR_WFI_BITMAP; | ||
85 | /* pwr gating on wfe */ | ||
86 | reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid; | ||
87 | break; | ||
88 | case TEGRA30: | ||
89 | /* clear wfe bitmap */ | ||
90 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; | ||
91 | /* clear wfi bitmap */ | ||
92 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; | ||
93 | /* pwr gating on wfi */ | ||
94 | reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid; | ||
95 | break; | ||
96 | } | ||
80 | reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */ | 97 | reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */ |
81 | reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event flag */ | 98 | reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event flag */ |
82 | reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid; /* pwr gating on wfi */ | ||
83 | reg |= FLOW_CTRL_CSR_ENABLE; /* pwr gating */ | 99 | reg |= FLOW_CTRL_CSR_ENABLE; /* pwr gating */ |
84 | flowctrl_write_cpu_csr(cpuid, reg); | 100 | flowctrl_write_cpu_csr(cpuid, reg); |
85 | 101 | ||
@@ -99,8 +115,20 @@ void flowctrl_cpu_suspend_exit(unsigned int cpuid) | |||
99 | 115 | ||
100 | /* Disable powergating via flow controller for CPU0 */ | 116 | /* Disable powergating via flow controller for CPU0 */ |
101 | reg = flowctrl_read_cpu_csr(cpuid); | 117 | reg = flowctrl_read_cpu_csr(cpuid); |
102 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; /* clear wfe bitmap */ | 118 | switch (tegra_chip_id) { |
103 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; /* clear wfi bitmap */ | 119 | case TEGRA20: |
120 | /* clear wfe bitmap */ | ||
121 | reg &= ~TEGRA20_FLOW_CTRL_CSR_WFE_BITMAP; | ||
122 | /* clear wfi bitmap */ | ||
123 | reg &= ~TEGRA20_FLOW_CTRL_CSR_WFI_BITMAP; | ||
124 | break; | ||
125 | case TEGRA30: | ||
126 | /* clear wfe bitmap */ | ||
127 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; | ||
128 | /* clear wfi bitmap */ | ||
129 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP; | ||
130 | break; | ||
131 | } | ||
104 | reg &= ~FLOW_CTRL_CSR_ENABLE; /* clear enable */ | 132 | reg &= ~FLOW_CTRL_CSR_ENABLE; /* clear enable */ |
105 | reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr */ | 133 | reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr */ |
106 | reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event */ | 134 | reg |= FLOW_CTRL_CSR_EVENT_FLAG; /* clear event */ |