about Jump from Flash to RAM code in Colilo.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

about Jump from Flash to RAM code in Colilo.

1,672件の閲覧回数
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 返答(返信)

516件の閲覧回数
Jiandong
Contributor I
After remap and code copying  , the RAM remap to Flash address at 0x00000000, So #real_start is in Ram after.
0 件の賞賛
返信

516件の閲覧回数
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 件の賞賛
返信