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

Dheeraj Kaushik dheer_kaushik at yahoo.com
Thu Jun 26 15:12:38 CEST 2003


Dear Friends,

 I am working with a MBX860 board to which U-boot is
already ported.But i am not getting the prompt.So,in
order to look into the system, i want to debug it.as i
went through the mailing list for ppcboot as well as
u-boot i came to know that BDI2000 is of great help in
that case.So, i purchsed one for us.
 Now can anybody help me how to go about using it.
This is the way i proceeded.......

Hardware setup......
BDI2000 is connected to the board through BDM port.
System Setup
RedHat 8.0 system with toolchain from www.denx.de
System has sufficient memory and other resources....

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.
 Here is the BDI config file........

; bdiGDB configuration file for MBX860-001B / 50MHz
board
;
-------------------------------------------------------
;
[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
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
WM32    0xFA200324      0x55CCAA33      ;RTCK:  
unlock real-Time clock register
WM32    0xFA200328      0x55CCAA33      ;RTSECK:
unlock real-time alarm seconds
WM32    0xFA20032C      0x55CCAA33      ;RTCALK:
unlock real-time alarm register
WM16    0xFA200220      0x00C2          ;RTCSC: stop
real-time clock while freeze is asserted
WM16    0xFA200240      0x0082          ;PISCR: stop
periodic interrupt while freeze is asserted
WM32    0xFA200280      0x62000000      ;SCCR: disable
clock output
WM32    0xFA200284      0x0000D000      ;PLPRCR: clear
flags

; init UPM
SUPM    0xFA200168      0xFA20017C      ;Set address
for MCR and MDR

WUPM    0x00000000      0xCFAFC004      ;UPM: singel
read
WUPM    0x00000001      0x0FAFC404      ;UPM: singel
read
WUPM    0x00000002      0x0CAF8C04      ;UPM: singel
read
WUPM    0x00000003      0x10AF0C04      ;UPM: singel
read
WUPM    0x00000004      0xF0AF0C00      ;UPM: singel
read
WUPM    0x00000005      0xF3BF4805      ;UPM: singel
read
WUPM    0x00000006      0xFFFFC005      ;UPM: singel
read
WUPM    0x00000007      0xFFFFC005      ;UPM: singel
read

WUPM    0x00000008      0xCFAFC004      ;UPMA burst
read
WUPM    0x00000009      0x0FAFC404      ;UPMA burst
read
WUPM    0x0000000A      0x0CAF8C04      ;UPMA burst
read
WUPM    0x0000000B      0x00AF0C04      ;UPMA burst
read
WUPM    0x0000000C      0x07AF0C08      ;UPMA burst
read
WUPM    0x0000000D      0x0CAF0C04      ;UPMA burst
read
WUPM    0x0000000E      0x01AF0C04      ;UPMA burst
read
WUPM    0x0000000F      0x0FAF0C08      ;UPMA burst
read
WUPM    0x00000010      0x0CAF0C04      ;UPMA burst
read
WUPM    0x00000011      0x01AF0C04      ;UPMA burst
read
WUPM    0x00000012      0x0FAF0C08      ;UPMA burst
read
WUPM    0x00000013      0x0CAF0C04      ;UPMA burst
read
WUPM    0x00000014      0x10AF0C04      ;UPMA burst
read
WUPM    0x00000015      0xF0AF0C00      ;UPMA burst
read
WUPM    0x00000016      0xF3BF4805      ;UPMA burst
read
WUPM    0x00000017      0xFFFFC005      ;UPMA burst
read

WUPM    0x00000018      0xCFFF0004      ;UPMA single
write
WUPM    0x00000019      0x0FFF0404      ;UPMA single
write
WUPM    0x0000001A      0x0CFF0C00      ;UPMA single
write
WUPM    0x0000001B      0x13FF4804      ;UPMA single
write
WUPM    0x0000001C      0xFFFFC004      ;UPMA single
write
WUPM    0x0000001D      0xFFFFC005      ;UPMA single
write
WUPM    0x0000001E      0xFFFFC005      ;UPMA single
write
WUPM    0x0000001F      0xFFFFC005      ;UPMA single
write

WUPM    0x00000020      0xCFFF0004      ;UPMA burst
write
WUPM    0x00000021      0x0FFF0404      ;UPMA burst
write
WUPM    0x00000022      0x0CFF0C00      ;UPMA burst
write
WUPM    0x00000023      0x03FF0C0C      ;UPMA burst
write
WUPM    0x00000024      0x0CFF0C00      ;UPMA burst
write
WUPM    0x00000025      0x03FF0C0C      ;UPMA burst
write
WUPM    0x00000026      0x0CFF0C00      ;UPMA burst
write
WUPM    0x00000027      0x03FF0C0C      ;UPMA burst
write
WUPM    0x00000028      0x0CFF0C00      ;UPMA burst
write
WUPM    0x00000029      0x13FF4804      ;UPMA burst
write
WUPM    0x0000002A      0xFFFFC004      ;UPMA burst
write
WUPM    0x0000002B      0xFFFFC005      ;UPMA burst
write
WUPM    0x0000002C      0xFFFFC005      ;UPMA burst
write
WUPM    0x0000002D      0xFFFFC005      ;UPMA burst
write
WUPM    0x0000002E      0xFFFFC005      ;UPMA burst
write
WUPM    0x0000002F      0xFFFFC005      ;UPMA burst
write

WUPM    0x00000030      0xFCFFC004      ;UPMA refresh
WUPM    0x00000031      0xC0FFC004      ;UPMA refresh
WUPM    0x00000032      0x01FFC004      ;UPMA refresh
WUPM    0x00000033      0x0FFFC004      ;UPMA refresh
WUPM    0x00000034      0x1FFFC004      ;UPMA refresh
WUPM    0x00000035      0xFFFFC004      ;UPMA refresh
WUPM    0x00000036      0xFFFFC005      ;UPMA refresh
WUPM    0x00000037      0xFFFFC005      ;UPMA refresh
WUPM    0x00000038      0xFFFFC005      ;UPMA refresh
WUPM    0x00000039      0xFFFFC005      ;UPMA refresh
WUPM    0x0000003A      0xFFFFC005      ;UPMA refresh
WUPM    0x0000003B      0xFFFFC005      ;UPMA refresh

WUPM    0x0000003C      0xFFFFC007      ;UPMA
exception
WUPM    0x0000003D      0xFFFFC007      ;UPMA
exception
WUPM    0x0000003E      0xFFFFC007      ;UPMA
exception
WUPM    0x0000003F      0xFFFFC007      ;UPMA
exception

; init memory controller
WM32    0xFA200104      0xFFE00940      ;OR0: Flash
2MB, all accesses, CS early negate, 4ws
WM32    0xFA200100      0xFE000001      ;BR0: Flash at
0xFE000000, 32bit, R/W, no parity, use GPCM
WM32    0xFA20010C      0xFFC00400      ;OR1: DRAM
4MB, all accesses
WM32    0xFA200108      0x00000081      ;BR1: DRAM at
0x00000000, 32bit, R/W, no parity, use UPMA
WM32    0xFA200124      0xFFE00930      ;OR4: NVRAM
WM32    0xFA200120      0xFA000401      ;BR4: NVRAM
WM32    0xFA20012C      0xA0000108      ;OR5: PCI I/O
and Memory
WM32    0xFA200128      0x80000001      ;BR5: PCI I/O
and Memory
WM32    0xFA200134      0xFFFF0108      ;OR6: PCI Bus
Bridge
WM32    0xFA200130      0xFA210001      ;BR6: PCI Bus
Bridge
WM32    0xFA20013C      0xFF800940      ;OR7: 8bit
socketed Flash
WM32    0xFA200138      0xFC000401      ;BR7: 8bit
socketed Flash

WM16    0xFA20017A      0x0200          ;MPTPR :
divide by 32
WM32    0xFA200170      0x18801000      ;MAMR : PTA=24
(15.36us @ 50MHz)

; Setup MMU info
WSPR    796             0x00000000      ;M_TWB
invalidate TWB
WM32    0x000000f0      0x00000000      ;invalidate
page table pointer pointer


[TARGET]
CPUCLOCK    50000000		;the CPU clock rate after
processing the init list
BDIMODE     AGENT       	;the BDI working mode
(LOADONLY | AGENT)
BREAKMODE   HARD        	;SOFT or HARD, HARD uses PPC
hardware breakpoints
;MMU         XLAT        	;translate effective to
physical address


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


[FLASH]
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
BUSWIDTH    32          ;The width of the flash memory
bus in bits (8 | 16 | 32)
FILE        uboot.elf  ; the file to program
FORMAT      ELF
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

[REGS]
DMM1	0xFA200000
FILE  reg860.def

BDI2000 is showing the image at right location.
Now i want to debug u-boot.
So this is my approach.
bdi>bi 0xfe000000
bdi>go 0xfe000000

now at the host system
$ppc_8xx-gdb u-boot
gdb>target remote bdi:2001
Remote debugging using 196.1.105.162:2001
0xfe000000 in ??() at /u-boot/cpu/mpc8xx/start.S:97
97 _start:
gdb>c
Continuing.

Program received signal signal SIGTRAP ,
Trace/breakpoint trap.
0xfe000000 in ??() at /u-boot/cpu/mpc8xx/start.S:97
97 _start:
gdb>

Can anybody help me HOW CAN A DEBUG THE U-BOOT IMAGE
USING BDI2000.I want to single step through the code.

Your help is highly appreciated.


Best Regards

Dheeraj Kaushik



=====
Dheeraj Kaushik
Research Engineer
IMT-2000
Transmission Division
C-DOT
39,Main Pusa Road,
New Delhi-110005
Phone : +91-11-25763041,25753350-59 Ext. 301
Fax : +91-11-25756378
Mobile No. : +91-11-31088262


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com




More information about the U-Boot mailing list