1 ############################################################
\r
3 # Copyright Altera 2013
\r
4 # All Rights Reserved
\r
7 ############################################################
\r
10 # This is an ARM DS5 debugger script that is intended to help folks run and
\r
11 # debug uboot. It loads the preloader (a.k.a. spl) into onchip ram, runs it
\r
12 # to setup DDR, then loads uboot, lets uboot run a bit to calculate relocation
\r
13 # offset, and finally reloads symbol table with calculated offset in the
\r
18 # load and run the preloader
\r
20 source -v "$sdir/preloader.ds"
\r
24 # now load unrelocated uboot into ddr
\r
26 loadfile "$sdir/uboot-socfpga/u-boot"
\r
28 # set pc to start of uboot
\r
32 # set breakpoint at start of code that relocates uboot
\r
33 tbreak relocate_code
\r
39 # now reload the symbol table with runtime calculated relocation offset.
\r
40 # register r8 is uboot's "global data" pointer.
\r
42 symbol-file "$sdir/uboot-socfpga/u-boot" ((gd_t*)$r8)->reloc_off
\r
45 # Now set a break in the board_init_r (from uboot). It must be a hardware
\r
46 # breakpoint because this is after relocation.
\r
48 thbreak board_init_r
\r