* [U-Boot-Users] start.S for mpc85xx and debug via BDI2000
@ 2005-05-25 12:58 Armand Ciejak
2005-05-25 14:12 ` Kylo Ginsberg
0 siblings, 1 reply; 2+ messages in thread
From: Armand Ciejak @ 2005-05-25 12:58 UTC (permalink / raw)
To: u-boot
I'm having problem in debugging U-boot for a MPC8540 processor.
I'm debugging the very first instructions with the BDI2000. The system
crash at 2 places in start.S:
1- when clearing debug registers
2- when setting up interrupt vectors
/* clear registers */
li r0,0
mtspr SRR0,r0
mtspr SRR1,r0
mtspr CSRR0,r0
mtspr CSRR1,r0
mtspr MCSRR0,r0
mtspr MCSRR1,r0
mtspr ESR,r0
mtspr MCSR,r0
mtspr DEAR,r0
HERE -> mtspr DBCR0,r0
mtspr DBCR1,r0
mtspr DBCR2,r0
mtspr IAC1,r0
mtspr IAC2,r0
mtspr DAC1,r0
mtspr DAC2,r0
mfspr r1,DBSR
mtspr DBSR,r1 /* Clear all valid bits */
mtspr PID0,r0
mtspr PID1,r0
mtspr PID2,r0
mtspr TCR,r0
mtspr BUCSR,r0 /* disable branch prediction */
mtspr MAS4,r0
mtspr MAS6,r0
isync
/* Setup interrupt vectors */
HERE -> lis r1,0xfff8
mtspr IVPR, r1
li r1,0x0100
mtspr IVOR0,r1 /* 0: Critical input */
li r1,0x0200
mtspr IVOR1,r1 /* 1: Machine check */
li r1,0x0300
mtspr IVOR2,r1 /* 2: Data storage */
li r1,0x0400
mtspr IVOR3,r1 /* 3: Instruction storage */
li r1,0x0500
mtspr IVOR4,r1 /* 4: External interrupt */
li r1,0x0600
mtspr IVOR5,r1 /* 5: Alignment */
li r1,0x0700
mtspr IVOR6,r1 /* 6: Program check */
li r1,0x0800
mtspr IVOR7,r1 /* 7: floating point unavailable */
li r1,0x0c00
mtspr IVOR8,r1 /* 8: System call */
/* 9: Auxiliary processor unavailable(unsupported) */
li r1,0x1000
mtspr IVOR10,r1 /* 10: Decrementer */
li r1,0x1400
mtspr IVOR13,r1 /* 13: Data TLB error */
li r1,0x1300
mtspr IVOR14,r1 /* 14: Instruction TLB error */
li r1,0x2000
mtspr IVOR15,r1 /* 15: Debug */
What should I do to be able to debug this part?
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot-Users] start.S for mpc85xx and debug via BDI2000
2005-05-25 12:58 [U-Boot-Users] start.S for mpc85xx and debug via BDI2000 Armand Ciejak
@ 2005-05-25 14:12 ` Kylo Ginsberg
0 siblings, 0 replies; 2+ messages in thread
From: Kylo Ginsberg @ 2005-05-25 14:12 UTC (permalink / raw)
To: u-boot
On 5/25/05, Armand Ciejak <armand.ciejak@free.fr> wrote:
> I'm having problem in debugging U-boot for a MPC8540 processor.
> I'm debugging the very first instructions with the BDI2000. The system
> crash at 2 places in start.S:
>
> 1- when clearing debug registers
> 2- when setting up interrupt vectors
I'm assuming you mean "the system crashes if I set a breakpoint at
...". The 85xx is a real pain in this regard, because it wants to
fetch andexecute the debug exception vector first thing, so BDM
debugging only works if the debug exception is enabled and its vector
is fetchable. So the two points you list below: 1) disable debug
exceptions 2) overwrite the base address for exceptions.
I just work around this by using TI to step through this very early code.
Also, btw, you'll encounter a similar problem when debugging early
linux startup b/c u-boot doesn't currently relocate exception vectors
to ram. I posted a u-boot patch for this issue a month or so back;
you might want to google for that.
Cheers,
Kylo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-25 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-25 12:58 [U-Boot-Users] start.S for mpc85xx and debug via BDI2000 Armand Ciejak
2005-05-25 14:12 ` Kylo Ginsberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox