| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * arch/arm/mach-tegra/sleep.S |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Author: Colin Cross <ccross@android.com> |
|---|
| 8 | 9 | * Gary King <gking@nvidia.com> |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 12 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 13 | | - * (at your option) any later version. |
|---|
| 14 | | - * |
|---|
| 15 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 16 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 17 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 18 | | - * more details. |
|---|
| 19 | | - * |
|---|
| 20 | | - * You should have received a copy of the GNU General Public License along |
|---|
| 21 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 22 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 23 | 10 | */ |
|---|
| 24 | 11 | |
|---|
| 25 | 12 | #include <linux/linkage.h> |
|---|
| .. | .. |
|---|
| 49 | 36 | |
|---|
| 50 | 37 | /* Disable the D-cache */ |
|---|
| 51 | 38 | mrc p15, 0, r2, c1, c0, 0 |
|---|
| 39 | + tst r2, #CR_C @ see tegra_sleep_cpu() |
|---|
| 52 | 40 | bic r2, r2, #CR_C |
|---|
| 53 | | - mcr p15, 0, r2, c1, c0, 0 |
|---|
| 41 | + mcrne p15, 0, r2, c1, c0, 0 |
|---|
| 54 | 42 | isb |
|---|
| 55 | 43 | |
|---|
| 56 | 44 | /* Flush the D-cache */ |
|---|
| .. | .. |
|---|
| 132 | 120 | #ifdef CONFIG_CACHE_L2X0 |
|---|
| 133 | 121 | /* Disable L2 cache */ |
|---|
| 134 | 122 | check_cpu_part_num 0xc09, r9, r10 |
|---|
| 135 | | - movweq r2, #:lower16:(TEGRA_ARM_PERIF_BASE + 0x3000) |
|---|
| 136 | | - movteq r2, #:upper16:(TEGRA_ARM_PERIF_BASE + 0x3000) |
|---|
| 137 | | - moveq r3, #0 |
|---|
| 138 | | - streq r3, [r2, #L2X0_CTRL] |
|---|
| 123 | + retne r0 |
|---|
| 124 | + |
|---|
| 125 | + mov32 r2, TEGRA_ARM_PERIF_BASE + 0x3000 |
|---|
| 126 | + ldr r3, [r2, #L2X0_CTRL] |
|---|
| 127 | + tst r3, #L2X0_CTRL_EN @ see tegra_sleep_cpu() |
|---|
| 128 | + mov r3, #0 |
|---|
| 129 | + strne r3, [r2, #L2X0_CTRL] |
|---|
| 139 | 130 | #endif |
|---|
| 140 | 131 | ret r0 |
|---|
| 141 | 132 | ENDPROC(tegra_shut_off_mmu) |
|---|