forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/mach-tegra/sleep.S
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * arch/arm/mach-tegra/sleep.S
34 *
....@@ -6,20 +7,6 @@
67 *
78 * Author: Colin Cross <ccross@android.com>
89 * 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.
2310 */
2411
2512 #include <linux/linkage.h>
....@@ -49,8 +36,9 @@
4936
5037 /* Disable the D-cache */
5138 mrc p15, 0, r2, c1, c0, 0
39
+ tst r2, #CR_C @ see tegra_sleep_cpu()
5240 bic r2, r2, #CR_C
53
- mcr p15, 0, r2, c1, c0, 0
41
+ mcrne p15, 0, r2, c1, c0, 0
5442 isb
5543
5644 /* Flush the D-cache */
....@@ -132,10 +120,13 @@
132120 #ifdef CONFIG_CACHE_L2X0
133121 /* Disable L2 cache */
134122 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]
139130 #endif
140131 ret r0
141132 ENDPROC(tegra_shut_off_mmu)