
Because I want to use LED controlled by OR3 to debug the code,so I don't want to clear OR0.
You remind me, so I enable the "Calculate absolute address in FLASH and jump there " part,
It seems that I get close to the point: jump to "in_flash:" failed.
Here is the start.S part:
/* Calculate absolute address in FLASH and jump there */ /*--------------------------------------------------------------*/
lis r3, CONFIG_SYS_MONITOR_BASE@h ori r3, r3, CONFIG_SYS_MONITOR_BASE@l addi r3, r3, in_flash - _start + EXC_OFF_SYS_RESET mtlr r3 blr
in_flash: ... ...
The disassemble part :
fff80158: 3c 60 ff f8 lis r3,-8 fff8015c: 60 63 00 00 ori r3,r3,0 /*r3 is 0xfff80000 */ fff80160: 38 63 01 6c addi r3,r3,364 /* 0xfff8016c */ fff80164: 7c 68 03 a6 mtlr r3 fff80168: 4e 80 00 20 blr
fff8016c <in_flash>:
And my text_base is 0xfff80000. Something is wrong with the "absolute address" and "relative address", I am not sure about that. Expect for your advise.
--JRJR
Subject: RE: [U-Boot] Instructions in TEXT section can not load data from other section To: jason622@hotmail.com CC: u-boot@lists.denx.de From: joakim.tjernlund@transmode.se Date: Wed, 17 Mar 2010 09:48:42 +0100
jrjr jason622@hotmail.com wrote on 2010/03/17 09:45:08:
And I have made some change in cpu/mpc8260/start.S, I removed following lines:
#ifndef CONFIG_SYS_RAMBOOT /* When booting from ROM (Flash or EPROM), clear the */ /* Address Mask in OR0 so ROM appears everywhere */ /*--------------------------------------------------------------*/
lis r3, (CONFIG_SYS_IMMR+IM_REGBASE)@h lwz r4, IM_OR0@l(r3) li r5, 0x7fff and r4, r4, r5 stw r4, IM_OR0@l(r3) /* Calculate absolute address in FLASH and jump there */ /*--------------------------------------------------------------*/ lis &nbs p; r3, CONFIG_SYS_MONITOR_BASE@h ori r3, r3, CONFIG_SYS_MONITOR_BASE@l addi r3, r3, in_flash - _start + EXC_OFF_SYS_RESET mtlr r3 blr
in_flash: #endif /* CONFIG_SYS_RAMBOOT */
Becasue I don't think I need to clear the Address Mask in OR0, Is there anything wrong?
uhh, Why did you remove that? It is vital code, especially the /* Calculate absolute address in FLASH and jump there */ part.
_________________________________________________________________ MSN十年回馈,每位用户可免费获得价值25元的卡巴斯基反病毒软件2010激活码,快来领取! http://kaba.msn.com.cn/?k=1