[U-Boot-Users] Need Help w/ PPC Boot

Greetings:
I apologize in advance if this is a stupid question, or a question with an obvious answer. The fact is that I have place linux on and ARM, and an X86 board, however never on a PPC platform. In fact I have very little experience with the PPC, and RISC processors in general. I am trying to trace my way through the u-boot code - since I do not have access to an in circuit emulator, I am somewhat hindered. However I do have the capability to turn on a LED via a GPIO register. So I am tracing through the code in a "burn an learn" fashion.
I have a routine called "led" that turns on an led. The code below is from start.S from the u-boot distro from the cpu/ppc4xx, my processor is a ppc 405GPr.
The below code turns the LED on. Note the branch instruction that branches to some code to turn the led on. If I put the branch instruction AFTER the "mtmsr r4" instruction the LED does not turn on. I cannot figure out what is going on. If anyone has any recommendations on documentation to read (I have the 600 page "green book") or if there is something I am obviously missing (i.e. not being familiar enough with how a risc processor works) any advice is welcome.
. = EXC_OFF_SYS_RESET .globl _start _start:
/* Clear and set up some registers. */ addi r4,r0,0x0000 mtspr sgr,r4 mtspr dcwr,r4 mtesr r4 /* clear Exception Syndrome Reg */ mttcr r4 /* clear Timer Control Reg */ mtxer r4 /* clear Fixed-Point Exception Reg */ mtevpr r4 /* clear Exception Vector Prefix Reg */ addi r4,r0,0x1000 /* set ME bit (Machine Exceptions) */ oris r4,r4,0x0002 /* set CE bit (Critical Exceptions) */
/* the LED will turn on if I branch here */ b LED
mtmsr r4 /* change MSR */
/* the LED will NOT turn on if I branch here */ /*b LED */
addi r4,r0,(0xFFFF-0x10000) /* set r4 to 0xFFFFFFFF */ /* dbsr is cleared by setting bits to 1) */ mtdbsr r4 /* clear/reset the dbsr */

Dear Jerry,
in message EGEGIJHKDKJGAJMGIDPNIEEICDAA.jwalden@digitalatlantic.com you wrote:
I apologize in advance if this is a stupid question, or a question with an obvious answer. The fact is that I have place linux on and ARM, and an X86 board, however never on a PPC platform. In fact I have very little experience with the PPC, and RISC processors in general. I am trying to trace my way through the u-boot code - since I do not have access to an in circuit emulator, I am somewhat
You don;t need an ICE, but you definitely want a debugger.
hindered. However I do have the capability to turn on a LED via a GPIO register. So I am tracing through the code in a "burn an learn" fashion.
How much do you rate your time? I strongly recommend to get yourself a BDI2000...
Best regards,
Wolfgang Denk

Hello:
I now have a BDI2000, and I am preparing to use it to debug the u-boot code that I have generated.
Is it best to simply dissasemble the resulting image, and to single step through by referring to what gdb shows, and what the dissassembled code shows?
Essentially, I am looking for the series of steps that I would go through to build u-boot, and load, and run it using DDD or some other IDE based debugger so I can see the source as I step through the code.
Thanks
Jerry

In message EGEGIJHKDKJGAJMGIDPNAEJPCDAA.jwalden@digitalatlantic.com you wrote:
I now have a BDI2000, and I am preparing to use it to debug the u-boot code that I have generated.
Is it best to simply dissasemble the resulting image, and to single step through by referring to what gdb shows, and what the dissassembled code shows?
What makes you think GDB would show something different from the code you get from disassembling the same object files?
Essentially, I am looking for the series of steps that I would go through to build u-boot, and load, and run it using DDD or some other IDE based debugger so I can see the source as I step through the code.
With the BDI's telnet interface: "reset", "ti", "ti", ...; with GDB: "target remote bdi:2001", "detach", "target remote bdi:2001", (*) "si", "si", ...
(*) a "display/i $pc" might be useful here...
Best regards, and a Happy New Year!
Wolfgang Denk
participants (2)
-
Jerry Walden
-
Wolfgang Denk