Commit 0c909551f88c0d92a919ff70127df7b33cdd473d

Authored by Robin Getz
Committed by Wolfgang Denk
1 parent fa2744de65
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

kgdb: add default generic stubs

The default kgdb functions can be implemented with common U-Boot functions,
so rather than force everyone to copy & paste these things, create a set of
weak stubs.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Showing 2 changed files with 65 additions and 1 deletions Side-by-side Diff

... ... @@ -157,7 +157,7 @@
157 157 COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
158 158 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
159 159 COBJS-y += flash.o
160   -COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
  160 +COBJS-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
161 161 COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
162 162 COBJS-$(CONFIG_LCD) += lcd.o
163 163 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
  1 +/*
  2 + * U-boot - stub functions for common kgdb code,
  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>
  12 +
  13 +int (*debugger_exception_handler)(struct pt_regs *);
  14 +
  15 +__attribute__((weak))
  16 +void kgdb_serial_init(void)
  17 +{
  18 + puts("[on serial] ");
  19 +}
  20 +
  21 +__attribute__((weak))
  22 +void putDebugChar(int c)
  23 +{
  24 + serial_putc(c);
  25 +}
  26 +
  27 +__attribute__((weak))
  28 +void putDebugStr(const char *str)
  29 +{
  30 +#ifdef DEBUG
  31 + serial_puts(str);
  32 +#endif
  33 +}
  34 +
  35 +__attribute__((weak))
  36 +int getDebugChar(void)
  37 +{
  38 + return serial_getc();
  39 +}
  40 +
  41 +__attribute__((weak))
  42 +void kgdb_interruptible(int yes)
  43 +{
  44 + return;
  45 +}
  46 +
  47 +__attribute__((weak))
  48 +void kgdb_flush_cache_range(void *from, void *to)
  49 +{
  50 + flush_cache((unsigned long)from, (unsigned long)(to - from));
  51 +}
  52 +
  53 +__attribute__((weak))
  54 +void kgdb_flush_cache_all(void)
  55 +{
  56 + if (dcache_status()) {
  57 + dcache_disable();
  58 + dcache_enable();
  59 + }
  60 + if (icache_status()) {
  61 + icache_disable();
  62 + icache_enable();
  63 + }
  64 +}