hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/soc/tegra/flowctrl.c
....@@ -1,21 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * drivers/soc/tegra/flowctrl.c
34 *
45 * Functions and macros to control the flowcontroller
56 *
67 * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms and conditions of the GNU General Public License,
10
- * version 2, as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful, but WITHOUT
13
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
- * more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
198 */
209
2110 #include <linux/cpumask.h>
....@@ -102,8 +91,23 @@
10291 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
10392 /* clear wfi bitmap */
10493 reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP;
105
- /* pwr gating on wfi */
106
- reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid;
94
+
95
+ if (tegra_get_chip_id() == TEGRA30) {
96
+ /*
97
+ * The wfi doesn't work well on Tegra30 because
98
+ * CPU hangs under some odd circumstances after
99
+ * power-gating (like memory running off PLLP),
100
+ * hence use wfe that is working perfectly fine.
101
+ * Note that Tegra30 TRM doc clearly stands that
102
+ * wfi should be used for the "Cluster Switching",
103
+ * while wfe for the power-gating, just like it
104
+ * is done on Tegra20.
105
+ */
106
+ reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid;
107
+ } else {
108
+ /* pwr gating on wfi */
109
+ reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid;
110
+ }
107111 break;
108112 }
109113 reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */
....@@ -215,7 +219,7 @@
215219 return 0;
216220 }
217221
218
- tegra_flowctrl_base = ioremap_nocache(res.start, resource_size(&res));
222
+ tegra_flowctrl_base = ioremap(res.start, resource_size(&res));
219223 if (!tegra_flowctrl_base)
220224 return -ENXIO;
221225