]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/powerpc/cpu/ppc4xx/kgdb.S
remove unnecessary version.h includes
[karo-tx-uboot.git] / arch / powerpc / cpu / ppc4xx / kgdb.S
1 /*
2  *  Copyright (C) 2000  Murray Jensen <Murray.Jensen@cmst.csiro.au>
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #include <config.h>
8 #include <command.h>
9 #include <asm/ppc4xx.h>
10
11 #define CONFIG_405GP 1          /* needed for Linux kernel header files */
12
13 #include <ppc_asm.tmpl>
14 #include <ppc_defs.h>
15
16 #include <asm/cache.h>
17 #include <asm/mmu.h>
18
19 #if defined(CONFIG_CMD_KGDB)
20  /*
21  * cache flushing routines for kgdb
22  */
23
24         .globl  kgdb_flush_cache_all
25 kgdb_flush_cache_all:
26         /* icache */
27         iccci   r0,r0           /* iccci invalidates the entire I cache */
28         /* dcache */
29         addi    r6,0,0x0000     /* clear GPR 6 */
30         addi    r7,r0, 128      /* do loop for # of dcache lines */
31                                 /* NOTE: dccci invalidates both */
32         mtctr   r7              /* ways in the D cache */
33 ..dcloop:
34         dccci   0,r6            /* invalidate line */
35         addi    r6,r6, 32       /* bump to next line */
36         bdnz    ..dcloop
37         blr
38
39         .globl  kgdb_flush_cache_range
40 kgdb_flush_cache_range:
41         li      r5,L1_CACHE_BYTES-1
42         andc    r3,r3,r5
43         subf    r4,r3,r4
44         add     r4,r4,r5
45         srwi.   r4,r4,L1_CACHE_SHIFT
46         beqlr
47         mtctr   r4
48         mr      r6,r3
49 1:      dcbst   0,r3
50         addi    r3,r3,L1_CACHE_BYTES
51         bdnz    1b
52         sync                    /* wait for dcbst's to get to ram */
53         mtctr   r4
54 2:      icbi    0,r6
55         addi    r6,r6,L1_CACHE_BYTES
56         bdnz    2b
57         SYNC
58         blr
59
60 #endif