[mc1322x] _rom_data_init_ branch
Giandomenico Rossi
rossi at dermotricos.com
Tue Jul 14 10:56:47 EDT 2009
Thank you a lot for your precious advices!
> I can't say for sure exactly what rom_data_init does --- unfortunatly
> only Freescale has the answer to that.
> .org 0x120
> ROM_var_start: .word 0
> .org 0x7ff
> ROM_var_end: .word 0
> reserves space for the ROM services and I believe rom_data_init does
> work in this area.
>
You are right!
I've looked inside, disassembling that part of rom code, and I
discovered that it takes 2 entries ( probably in C language would be an
array of struct) at address 0x11788 and 11798 of the form :
+-----------------------------------------------------+
| address1 | address2 | size | function adddress |
+-----------------------------------------------------+
| 0x40020c | 0x40020c | 0x520 | 0x10b2c |
+-----------------------------------------------------+
| 0x400120 | 0x400120 | 0x97 | 0x10a9c |
+-----------------------------------------------------+
The second entry point refers to address 0x400120 which is ROM_var_start
as you said !
For instance the routine to 0x10b2c set to 0 memory
from 0x40020c to 0x40020c+0x520.
> You also need to set up the rom patching vectors.
Sorry ; could you briefly explain me what do you mean when you say
rom vectors ? Exception Vector Table ?
> Are you having trouble with calling rom_data_init or with ROM service
> calls in general?
both ! But I solved.
Rom_data_init uses R12 register without save it.
In forth that's a particular register used for DATA stack, so my calls
to Rom_data_init never came back.
ROM service call are coded in Thumb instruction, whereas I use ARM
assembler instruction so I simply had to make a BLX jump in place o a
BL .
> > Why add current position ( "." ) -base ?
>
> The assembler treats the label after the bl command as relative.
Yes, it sound strange to me because my assembler straight code the
relative address.
Thanks
Giandomenico
More information about the mc1322x
mailing list