X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=doc%2FREADME.arm-relocation;h=645b3746c8a88fe25f7c9a33cd9b8b17aa7b5a57;hb=91836d7f2a7c5844ea4992c383d081aa45088504;hp=c0957c210ceca37efd1c9c236768df57b8456c6e;hpb=d963e84c92a63b4e6c4f2f80482a5ecbe9b24fe0;p=karo-tx-uboot.git diff --git a/doc/README.arm-relocation b/doc/README.arm-relocation index c0957c210c..645b3746c8 100644 --- a/doc/README.arm-relocation +++ b/doc/README.arm-relocation @@ -40,15 +40,15 @@ Boards which are not fixed to support relocation will be REMOVED! ----------------------------------------------------------------------------- -For boards which boot from nand_spl, it is possible to save one copy +For boards which boot from spl, it is possible to save one copy if CONFIG_SYS_TEXT_BASE == relocation address! This prevents that uboot code is copied again in relocate_code(). -example for the tx25 board: +example for the tx25 board booting from NAND Flash: a) cpu starts b) it copies the first page in nand to internal ram - (nand_spl_code) + (spl code) c) end executes this code d) this initialize CPU, RAM, ... and copy itself to RAM (this bin must fit in one page, so board_init_f() @@ -79,20 +79,20 @@ TODO ----------------------------------------------------------------------------- -Relocation with NAND_SPL (example for the tx25): +Relocation with SPL (example for the tx25 booting from NAND Flash): - cpu copies the first page from NAND to 0xbb000000 (IMX_NFC_BASE) and start with code execution on this address. -- The First page contains u-boot code from u-boot:nand_spl/nand_boot_fsl_nfc.c - which inits the dram, cpu registers, reloacte itself to CONFIG_SYS_TEXT_BASE and loads +- The First page contains u-boot code from drivers/mtd/nand/mxc_nand_spl.c + which inits the dram, cpu registers, reloacte itself to CONFIG_SPL_TEXT_BASE and loads the "real" u-boot to CONFIG_SYS_NAND_U_BOOT_DST and starts execution @CONFIG_SYS_NAND_U_BOOT_START - This u-boot does no RAM init, nor CPU register setup. Just look where it has to copy and relocate itself to this address. If relocate address = CONFIG_SYS_TEXT_BASE (not the same, as the - CONFIG_SYS_TEXT_BASE from the nand_spl code), then there is no need + CONFIG_SPL_TEXT_BASE from the spl code), then there is no need to copy, just go on with bss clear and jump to board_init_r. ----------------------------------------------------------------------------- @@ -106,13 +106,9 @@ TBC Debugging u-boot in RAM: (example on the qong board) -a) add in config.mk: - -PLATFORM_CPPFLAGS += -DDEBUG - ----------------- -b) start debugger +a) start debugger arm-linux-gdb u-boot @@ -130,7 +126,7 @@ The target architecture is set automatically (currently arm) ----------------- -c) connect to target +b) connect to target target remote bdi10:2001 @@ -141,7 +137,7 @@ Remote debugging using bdi10:2001 ----------------- -d) discard symbol-file +c) discard symbol-file (gdb) symbol-file Discard symbol table from `/home/hs/celf/u-boot/u-boot'? (y or n) y @@ -150,7 +146,7 @@ No symbol file now. ----------------- -e) load new symbol table: +d) load new symbol table: (gdb) add-symbol-file u-boot 0x8ff08000 add symbol table from file "u-boot" at @@ -167,28 +163,31 @@ Program received signal SIGSTOP, Stopped (signal). add-symbol-file u-boot 0x8ff08000 ^^^^^^^^^^ - get this address from u-boot debug printfs - -U-Boot 2010.06-rc2-00009-gf77b8b8-dirty (Jun 22 2010 - 09:43:46) - -U-Boot code: A0000000 -> A0058BAC BSS: -> A0061F10 -CPU: Freescale i.MX31 at 398 MHz -Board: DAVE/DENX Qong -mon: FFFFFFFF gd->monLen: 00061F10 -Top of RAM usable for U-Boot at: 90000000 -LCD panel info: 640 x 480, 16 bit/pix -Reserving 600k for LCD Framebuffer at: 8ff6a000 -Reserving 391k for U-Boot at: 8ff08000 - ^^^^^^^^ -Reserving 1280k for malloc() at: 8fdc8000 -Reserving 24 Bytes for Board Info at: 8fdc7fe8 -Reserving 52 Bytes for Global Data at: 8fdc7fb4 -New Stack Pointer is: 8fdc7fb0 -RAM Configuration: -Bank #0: 80000000 256 MiB -relocation Offset is: eff08000 -mon: 00058BAC gd->monLen: 00061F10 -Now running in RAM - U-Boot at: 8ff08000 - ^^^^^^^^ + get this address from u-boot bdinfo command + or get it from gd->relocaddr in gdb + + => bdinfo +rch_number = XXXXXXXXXX +boot_params = XXXXXXXXXX +DRAM bank = XXXXXXXXXX +-> start = XXXXXXXXXX +-> size = XXXXXXXXXX +ethaddr = XXXXXXXXXX +ip_addr = XXXXXXXXXX +baudrate = XXXXXXXXXX +TLB addr = XXXXXXXXXX +relocaddr = 0x8ff08000 + ^^^^^^^^^^ +reloc off = XXXXXXXXXX +irq_sp = XXXXXXXXXX +sp start = XXXXXXXXXX +FB base = XXXXXXXXXX + +or interrupt execution by any means and re-load the symbols at the location +specified by gd->relocaddr -- this is only valid after board_init_f. + +(gdb) set $s = gd->relocaddr +(gdb) symbol-file +(gdb) add-symbol-file u-boot $s Now you can use gdb as usual :-)