about Jump from Flash to RAM code in Colilo.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

about Jump from Flash to RAM code in Colilo.

2,074 次查看
Jiandong
Contributor I
HI Freescale,
 
the following  code is  in boot.S in Colilo. and I am confused with the Jump.
 
#ifdef CONFIG_COLILO_SOLO
 move.l #0xFF800000, %a0 /* Colilo's in Boot flash */
#else
 move.l #0xE0000000, %a0 /* Colilo's in Code flash */
#endif
 move.l #0x1000000, %a1  /* RAM destination address */
 move.l #0x7FFC, %d0  /* 32K long = 128 Kb */
loop_copy:
 move.l %a0@+,%d1
 move.l %d1,%a1@+
 subq.l #1,%d0
 bne.s loop_copy
 
 move.l #real_start,%a0
 jmp (%a0) /* Jump to colilo start address in RAM */   What this mean?? I think the #real_start is still in Flash. So didn't jump to the RAM.
#endif
 /*
 * Disable the cache. Don't want it on just yet.
 */
real_start: 
 jsr disableCache
 
 jsr  mcf548x_init
 move.l #__SP_INIT, %SP
 /*
 * Most of the setup work is done in main().
 */
 jsr start_main
标签 (1)
0 项奖励
回复
2 回复数

918 次查看
Jiandong
Contributor I
After remap and code copying  , the RAM remap to Flash address at 0x00000000, So #real_start is in Ram after.
0 项奖励
回复

918 次查看
CompilerGuru
NXP Employee
NXP Employee
I dont know Colilo, but looking at the code it does make sence if
the labels are evaluated by the linker to RAM addresses.
Then the code before the JMP is assembled to a different address than it is executed from. The code starts out of flash, copies itself to RAM, and once this is done, it jumps there.
Can you decode/disassemble it and check to what #real_start actually evaluates, to a RAM or to a FLASH address?

Daniel
0 项奖励
回复