Robin Getz | 0c90955 | 2009-12-21 18:40:42 -0500 | [diff] [blame] | 1 | /* |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 2 | * U-Boot - stub functions for common kgdb code, |
Robin Getz | 0c90955 | 2009-12-21 18:40:42 -0500 | [diff] [blame] | 3 | * can be overridden in board specific files |
| 4 | * |
| 5 | * Copyright 2009 Analog Devices Inc. |
| 6 | * |
| 7 | * Licensed under the GPL-2 or later. |
| 8 | */ |
| 9 | |
| 10 | #include <common.h> |
| 11 | #include <kgdb.h> |
Simon Glass | b03e051 | 2019-11-14 12:57:24 -0700 | [diff] [blame] | 12 | #include <serial.h> |
Robin Getz | 0c90955 | 2009-12-21 18:40:42 -0500 | [diff] [blame] | 13 | |
| 14 | int (*debugger_exception_handler)(struct pt_regs *); |
| 15 | |
| 16 | __attribute__((weak)) |
| 17 | void kgdb_serial_init(void) |
| 18 | { |
| 19 | puts("[on serial] "); |
| 20 | } |
| 21 | |
| 22 | __attribute__((weak)) |
| 23 | void putDebugChar(int c) |
| 24 | { |
| 25 | serial_putc(c); |
| 26 | } |
| 27 | |
| 28 | __attribute__((weak)) |
| 29 | void putDebugStr(const char *str) |
| 30 | { |
| 31 | #ifdef DEBUG |
| 32 | serial_puts(str); |
| 33 | #endif |
| 34 | } |
| 35 | |
| 36 | __attribute__((weak)) |
| 37 | int getDebugChar(void) |
| 38 | { |
| 39 | return serial_getc(); |
| 40 | } |
| 41 | |
| 42 | __attribute__((weak)) |
| 43 | void kgdb_interruptible(int yes) |
| 44 | { |
| 45 | return; |
| 46 | } |
| 47 | |
| 48 | __attribute__((weak)) |
| 49 | void kgdb_flush_cache_range(void *from, void *to) |
| 50 | { |
| 51 | flush_cache((unsigned long)from, (unsigned long)(to - from)); |
| 52 | } |
| 53 | |
| 54 | __attribute__((weak)) |
| 55 | void kgdb_flush_cache_all(void) |
| 56 | { |
| 57 | if (dcache_status()) { |
| 58 | dcache_disable(); |
| 59 | dcache_enable(); |
| 60 | } |
| 61 | if (icache_status()) { |
| 62 | icache_disable(); |
| 63 | icache_enable(); |
| 64 | } |
| 65 | } |