2 * Copyright (C) 2000 Murray Jensen <Murray.Jensen@cmst.csiro.au>
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 #define CONFIG_405GP 1 /* needed for Linux kernel header files */
29 #define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
31 #include <ppc_asm.tmpl>
34 #include <asm/cache.h>
37 #if defined(CONFIG_CMD_KGDB)
39 * cache flushing routines for kgdb
42 .globl kgdb_flush_cache_all
45 iccci r0,r0 /* iccci invalidates the entire I cache */
47 addi r6,0,0x0000 /* clear GPR 6 */
48 addi r7,r0, 128 /* do loop for # of dcache lines */
49 /* NOTE: dccci invalidates both */
50 mtctr r7 /* ways in the D cache */
52 dccci 0,r6 /* invalidate line */
53 addi r6,r6, 32 /* bump to next line */
57 .globl kgdb_flush_cache_range
58 kgdb_flush_cache_range:
59 li r5,L1_CACHE_BYTES-1
63 srwi. r4,r4,L1_CACHE_SHIFT
68 addi r3,r3,L1_CACHE_BYTES
70 sync /* wait for dcbst's to get to ram */
73 addi r6,r6,L1_CACHE_BYTES