[U-Boot-Users] U-boot debugging using BDI2000

Wolfgang Denk wd at denx.de
Thu Jun 26 16:56:09 CEST 2003

In message <20030626131238.31815.qmail at web40707.mail.yahoo.com> you wrote:
> the board directory has TEXT_BASE value defined as
> 0xfe000000......so  i burned the u-boot image at this
> address in the boards flash using BDI2000.

Ummm... there are many ways  to  handle  this;  if  you  followed  he
archives  you  will  see  that some people even recommend to load and
start U-Boot to RAM initally...

My approach is usually different. I follow the same logic as the  CPU
will.  Maybe  my  imagination  is jkust limited, but I find this much

A consequence of this  approach  is  that  you  should  perform  only
minimal initialization in your BDI2000 config file, i. e. disable the
watchdog and set DER.

If you do so, you will see the boot device (flash  memory)  with  the
same  mapping  as  the  CPU will see it, i. e. your U-Boot image will
start at 0x0000 or 0xFFF00000 (depending on your HRCW) no matter what
the actual link address is.

> -------------------------------------------------------
> ;
> [INIT]
> ; init core register
> WSPR    638             0xFA200000      ;IMMR:
> internal memory at 0xFA200000
> WSPR    158             0x00000007      ;ICTRL: not
> serialized, no show cycles
> ; init SIU register
> WM32    0xFA200000      0x00612900      ;SIUMCR:
> WM32    0xFA200004      0xFFFFFF88      ;SYPCR: enable

OK until here.

I would delete everything else from here until ...

> bus monitor, disable software watchdog
> WM16    0xFA200200      0x00C2          ;TBSCR: stop
> timebase and decrementer while freeze is asserted
> WM32    0xFA200320      0x55CCAA33      ;RTCSCK:
> unlock real-time clock status and control register
> ; Setup MMU info
> WSPR    796             0x00000000      ;M_TWB
> invalidate TWB
> WM32    0x000000f0      0x00000000      ;invalidate
> page table pointer pointer

...until here.

U-Boot expects a "virgin" CPU, so you  should  not  modify  too  many
things  -  except  you  know  exactly what you are doing and what the
consequences for U-Boot are.

> [HOST]
> IP
> ;FILE        c:/cdotdelhi/prog1/fibo.elf
> ;FORMAT      ELF
> ;LOAD        MANUAL      ;load code MANUAL or AUTO
> after reset

FILE	/ttftpboot/u-boot.bin

> WORKSPACE   0xFA202000  ;workspace in target RAM for
> fast programming algorithm
> CHIPTYPE    AM29F       ;Flash type (AM29F | AM29BX8 |
> AM29BX16 | I28BX8 | I28BX16)
> CHIPSIZE    0x80000     ;The size of one flash chip in
> bytes (e.g. AM29F010 = 0x20000)
> ;BUSWIDTH    8   ;for 0xfc000000
> ;FILE        redboot_ROM.bin
> ;FORMAT      BIN 0xfc000000
> ;ERASE       0xfc000000
> ;ERASE       0xfc010000
> ;ERASE       0xfc020000
> ;ERASE       0xfc030000
> ;ERASE       0xfc040000
> ;ERASE       0xfc050000
> ;ERASE       0xfc060000
> ;ERASE       0xfc070000

Assuming that your flash sectors are really like that, and  that  you
are booting low, make this:

FILE	/ttftpboot/u-boot.bin
ERASE	0x00000000
ERASE	0x00010000
ERASE	0x00020000

> BUSWIDTH    32          ;The width of the flash memory
> bus in bits (8 | 16 | 32)
> FILE        uboot.elf  ; the file to program
> ERASE       0xFE000000  ;erase sector 0 of flash
> ERASE       0xFE040000  ;erase sector 1 of flash
> ERASE       0xFE080000  ;erase sector 2 of flash
> ERASE       0xFE0C0000  ;erase sector 3 of flash
> ERASE       0xFE100000  ;erase sector 4 of flash
> ERASE       0xFE140000  ;erase sector 5 of flash
> ERASE       0xFE180000  ;erase sector 6 of flash
> ERASE       0xFE1C0000  ;erase sector 7 of flash


FILE	/ttftpboot/u-boot.bin
ERASE	0x00000000

[U-Boot is much smaller than 256 kB]

Hope this helps.

Best regards,

Wolfgang Denk

Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
The software required `Windows 95 or better', so I installed Linux.

More information about the U-Boot mailing list