forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/powerpc/boot/util.S
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copied from <file:arch/powerpc/kernel/misc_32.S>
34 *
....@@ -10,12 +11,6 @@
1011 * kexec bits:
1112 * Copyright (C) 2002-2003 Eric Biederman <ebiederm@xmission.com>
1213 * GameCube/ppc32 port Copyright (C) 2004 Albert Herranz
13
- *
14
- * This program is free software; you can redistribute it and/or
15
- * modify it under the terms of the GNU General Public License
16
- * as published by the Free Software Foundation; either version
17
- * 2 of the License, or (at your option) any later version.
18
- *
1914 */
2015 #include "ppc_asm.h"
2116
....@@ -23,7 +18,7 @@
2318
2419 .text
2520
26
-/* udelay (on non-601 processors) needs to know the period of the
21
+/* udelay needs to know the period of the
2722 * timebase in nanoseconds. This used to be hardcoded to be 60ns
2823 * (period of 66MHz/4). Now a variable is used that is initialized to
2924 * 60 for backward compatibility, but it can be overridden as necessary
....@@ -42,19 +37,6 @@
4237 */
4338 .globl udelay
4439 udelay:
45
- mfspr r4,SPRN_PVR
46
- srwi r4,r4,16
47
- cmpwi 0,r4,1 /* 601 ? */
48
- bne .Ludelay_not_601
49
-00: li r0,86 /* Instructions / microsecond? */
50
- mtctr r0
51
-10: addi r0,r0,0 /* NOP */
52
- bdnz 10b
53
- subic. r3,r3,1
54
- bne 00b
55
- blr
56
-
57
-.Ludelay_not_601:
5840 mulli r4,r3,1000 /* nanoseconds */
5941 /* Change r4 to be the number of ticks using:
6042 * (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns