2 * Copyright (C) 2000 Murray Jensen <Murray.Jensen@cmst.csiro.au>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/ppc4xx.h>
12 #define CONFIG_405GP 1 /* needed for Linux kernel header files */
13 #define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
15 #include <ppc_asm.tmpl>
18 #include <asm/cache.h>
21 #if defined(CONFIG_CMD_KGDB)
23 * cache flushing routines for kgdb
26 .globl kgdb_flush_cache_all
29 iccci r0,r0 /* iccci invalidates the entire I cache */
31 addi r6,0,0x0000 /* clear GPR 6 */
32 addi r7,r0, 128 /* do loop for # of dcache lines */
33 /* NOTE: dccci invalidates both */
34 mtctr r7 /* ways in the D cache */
36 dccci 0,r6 /* invalidate line */
37 addi r6,r6, 32 /* bump to next line */
41 .globl kgdb_flush_cache_range
42 kgdb_flush_cache_range:
43 li r5,L1_CACHE_BYTES-1
47 srwi. r4,r4,L1_CACHE_SHIFT
52 addi r3,r3,L1_CACHE_BYTES
54 sync /* wait for dcbst's to get to ram */
57 addi r6,r6,L1_CACHE_BYTES