| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * drivers/soc/tegra/flowctrl.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Functions and macros to control the flowcontroller |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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/>. |
|---|
| 19 | 8 | */ |
|---|
| 20 | 9 | |
|---|
| 21 | 10 | #include <linux/cpumask.h> |
|---|
| .. | .. |
|---|
| 102 | 91 | reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP; |
|---|
| 103 | 92 | /* clear wfi bitmap */ |
|---|
| 104 | 93 | 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 | + } |
|---|
| 107 | 111 | break; |
|---|
| 108 | 112 | } |
|---|
| 109 | 113 | reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */ |
|---|
| .. | .. |
|---|
| 215 | 219 | return 0; |
|---|
| 216 | 220 | } |
|---|
| 217 | 221 | |
|---|
| 218 | | - tegra_flowctrl_base = ioremap_nocache(res.start, resource_size(&res)); |
|---|
| 222 | + tegra_flowctrl_base = ioremap(res.start, resource_size(&res)); |
|---|
| 219 | 223 | if (!tegra_flowctrl_base) |
|---|
| 220 | 224 | return -ENXIO; |
|---|
| 221 | 225 | |
|---|