u-boot/arch/sandbox/include/asm
Simon Glass 001d1885f0 sandbox: Improve debugging in initcall_run_list()
At present if one of the initcalls fails on sandbox the address printing
is not help, e.g.:

  initcall sequence 0000557678967c80 failed at call 00005576709dfe1f (err=-96)

This is because U-Boot gets relocated high into memory and the relocation
offset (gd->reloc_off) does not work correctly for sandbox.

Add support for finding the base address of the text region (at least on
Linux) and use that to set the relocation offset. This makes the output
better:

  initcall sequence 0000560775957c80 failed at call 0000000000048134 (err=-96)

Then you use can use grep to see which init call failed, e.g.:

   $ grep 0000000000048134 u-boot.map
   stdio_add_devices

Of course another option is to run it with a debugger such as gdb:

   $ gdb u-boot
   ...
   (gdb) br initcall.h:41
   Breakpoint 1 at 0x4db9d: initcall.h:41. (2 locations)

Note that two locations are reported, since this function is used in both
board_init_f() and board_init_r().

   (gdb) r
   Starting program: /tmp/b/sandbox/u-boot
   [Thread debugging using libthread_db enabled]
   Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

   U-Boot 2018.09-00264-ge0c2ba9814-dirty (Sep 22 2018 - 12:21:46 -0600)

   DRAM:  128 MiB
   MMC:

Breakpoint 1, initcall_run_list (init_sequence=0x5555559619e0 <init_sequence_f>)
    at /scratch/sglass/cosarm/src/third_party/u-boot/files/include/initcall.h:41
41				printf("initcall sequence %p failed at call %p (err=%d)\n",
   (gdb) print *init_fnc_ptr
   $1 = (const init_fnc_t) 0x55555559c114 <stdio_add_devices>
   (gdb)

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-04-23 20:26:43 -06:00
..
axi.h axi: Add AXI sandbox driver and simple emulator 2018-08-11 08:09:39 +02:00
bitops.h sandbox: Use the generic bitops headers 2015-11-05 10:52:14 -05:00
byteorder.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
cache.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
clk.h clk: add clk_valid() 2018-08-03 19:53:10 -04:00
config.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
eth-raw-os.h sandbox: eth-raw: Add a SIMPLE_BUS to enumerate host interfaces 2018-07-26 14:08:19 -05:00
eth.h test: eth: Add a test for the target being pinged 2018-10-10 12:29:00 -05:00
getopt.h sandbox: Rename sb_cmdline_option to sandbox_cmdline_option 2013-12-09 12:22:02 -07:00
global_data.h sandbox: Improve debugging in initcall_run_list() 2019-04-23 20:26:43 -06:00
gpio.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
handoff.h spl: Add support for passing handoff info to U-Boot proper 2018-11-26 08:25:37 -05:00
io.h sandbox: add memset_io(..), memcpy_fromio(..) and memcpy_toio(..) 2019-01-14 17:47:13 -07:00
linkage.h efi: Use asmlinkage for EFIAPI 2016-10-19 09:01:53 +02:00
mbox.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
posix_types.h sandbox: Add architecture header files 2011-10-17 22:45:50 +02:00
power-domain.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
processor.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ptrace.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
reset.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
rtc.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sdl.h dm: sound: make all functions static inline 2019-04-11 20:10:50 -06:00
sections.h sandbox: Rename sb_cmdline_option to sandbox_cmdline_option 2013-12-09 12:22:02 -07:00
setjmp.h sandbox: Fix setjmp/longjmp 2018-09-23 21:55:30 +02:00
spi.h dm: sf: sandbox: Convert SPI flash driver to driver model 2014-10-22 10:36:51 -06:00
spl.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
state.h sandbox: Add a note about the growing state_info struct 2019-02-20 15:25:29 +08:00
string.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
system.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
test.h sound: Add uclass operations for beeping 2019-02-20 15:27:08 +08:00
types.h sandbox: Use correct phys_{addr, size}_t for PHYS_64BIT=y 2019-04-11 20:10:05 -06:00
u-boot-sandbox.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u-boot.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
unaligned.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00