summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorOvidiu Panait <ovidiu.panait@windriver.com>2022-01-01 20:13:27 +0300
committerTom Rini <trini@konsulko.com>2022-01-18 16:31:02 +0300
commit78fc0395c01640df0fa9b8be736bf855a0416b56 (patch)
treed9d621f78628d6dff4d16f7a2e4ca736378cf1ed /common
parent485c90c06bbb01f9ae3e5746836152ce5ea36c0f (diff)
downloadu-boot-78fc0395c01640df0fa9b8be736bf855a0416b56.tar.xz
common: board_r: drop initr_kgdb wrapper
Add a return value to kgdb_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Also, move the "KGDB" print message inside kgdb_init(). Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Diffstat (limited to 'common')
-rw-r--r--common/board_r.c11
-rw-r--r--common/kgdb.c7
2 files changed, 6 insertions, 12 deletions
diff --git a/common/board_r.c b/common/board_r.c
index f81d21a282..f12e2458ec 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -498,15 +498,6 @@ static int initr_ethaddr(void)
}
#endif /* CONFIG_CMD_NET */
-#ifdef CONFIG_CMD_KGDB
-static int initr_kgdb(void)
-{
- puts("KGDB: ");
- kgdb_init();
- return 0;
-}
-#endif
-
#if defined(CONFIG_LED_STATUS)
static int initr_status_led(void)
{
@@ -769,7 +760,7 @@ static init_fnc_t init_sequence_r[] = {
#endif
INIT_FUNC_WATCHDOG_RESET
#ifdef CONFIG_CMD_KGDB
- initr_kgdb,
+ kgdb_init,
#endif
interrupt_init,
#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K)
diff --git a/common/kgdb.c b/common/kgdb.c
index 4493a15919..29b09fcfe5 100644
--- a/common/kgdb.c
+++ b/common/kgdb.c
@@ -527,15 +527,18 @@ handle_exception (struct pt_regs *regs)
* kgdb_init must be called *after* the
* monitor is relocated into ram
*/
-void
-kgdb_init(void)
+int kgdb_init(void)
{
+ puts("KGDB: ");
+
kgdb_serial_init();
debugger_exception_handler = handle_exception;
initialized = 1;
putDebugStr("kgdb ready\n");
puts("ready\n");
+
+ return 0;
}
void