]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/powerpc/cpu/mpc8260/kgdb.S
Merge branch 'karo-tx-uboot' into kc-merge
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc8260 / 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 <mpc8260.h>
10 #include <version.h>
11
12 #include <ppc_asm.tmpl>
13 #include <ppc_defs.h>
14
15 #include <asm/cache.h>
16 #include <asm/mmu.h>
17
18 #if defined(CONFIG_CMD_KGDB)
19
20  /*
21  * cache flushing routines for kgdb
22  */
23
24         .globl  kgdb_flush_cache_all
25 kgdb_flush_cache_all:
26         mfspr   r3, HID0
27         ori     r3, r3, HID0_ICFI|HID0_DCI      /* Invalidate All */
28         SYNC
29         mtspr   HID0, r3
30         blr
31
32         .globl  kgdb_flush_cache_range
33 kgdb_flush_cache_range:
34         li      r5,CONFIG_SYS_CACHELINE_SIZE-1
35         andc    r3,r3,r5
36         subf    r4,r3,r4
37         add     r4,r4,r5
38         srwi.   r4,r4,CONFIG_SYS_CACHELINE_SHIFT
39         beqlr
40         mtctr   r4
41         mr      r6,r3
42 1:      dcbst   0,r3
43         addi    r3,r3,CONFIG_SYS_CACHELINE_SIZE
44         bdnz    1b
45         sync                            /* wait for dcbst's to get to ram */
46         mtctr   r4
47 2:      icbi    0,r6
48         addi    r6,r6,CONFIG_SYS_CACHELINE_SIZE
49         bdnz    2b
50         SYNC
51         blr
52
53 #endif