This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

again ROMRAM startup on SA1100


Hi folks,

I may have a working version now, but I found it far too easy to do. 
So I suppose it's wrong somewhere. Here's what I did:

In hal_platform_setup.h (of course PLATFORM_SETUP isn't empty for ROMRAM
startup)
[...]
#if defined(CYG_HAL_STARTUP_ROMRAM)
#define RELOCATE_CODE                  \
       ldr     r2, =0xC0000000        ;\
       ldr     r3, =__exception_handlers ;\
       mov     r4, #0                 ;\
       ldr     r5, =_end              ;\
       add     r5, r5, r2             ;\
       add     r2, r2, r3             ;\
15:                                   ;\
       ldr     r6, [r4], #4           ;\
       str     r6, [r2], #4           ;\
       cmp     r2, r5                 ;\
       bne     15b                    ;\
       nop                            ;\
       nop                            ;\
       nop                            ;\
       nop                            ;\
       nop                            ;\
       nop                            ;\
20:                                   ;\
       nop                            ;\
       nop
#else
#define RELOCATE_CODE
#endif
[...]
       RELOCATE_CODE
       _blink     
       // Create MMU tables
       bl      hal_mmu_init
       // Enable MMU
       ldr     r2,=10f
       ldr     r1,=MMU_Control_Init|MMU_Control_M
       mcr     MMU_CP,0,r1,MMU_Control,c0
       mov     pc,r2    /* Change address spaces */
       nop
       nop
       nop
       nop
       nop
10:
[...]

My application now starts from ROM and seems to run in RAM, but there
*must* be a trap waiting for me (?).


-- 
-----------------------------------------------------
i.A. Andreas Bürgel     GenoLogic GmbH
     Software Engineer  Joseph-von-Fraunhofer-Str. 13
                        D-44227 DORTMUND
                        Germany               
                        
     ab@genologic.de    phone  +49 (0) 231/477349-0
                        fax    +49 (0) 231/4761234


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]