[U-Boot-Users] ARM exception vectors -- relocating

Hello,
I have a question about relocating the exception vectors for the ARM platform. I am working with cpu/arm720t/start.S and want to use interrupts, but I think I see a problem with the code as it stands now. Consider the following scenario:
1. power on, cpu starts executing from address 0x0, which is located in flash.
2. memsetup.S configures 8MB SRAM to begin at address 0x0 and remaps flash to address 0x01000000.
3. back in start.S u-boot is relocated(copied) from flash to TEXT_BASE = 0x007d0000.
Now the exception vectors are sitting in SRAM @ 0x007d0000 and in flash @ 0x0100000 -- if I want to use interrupts, however, the exception vectors need to be in SRAM at address 0x0.
Currently I have added an additional relocation step to start.S that explicitly copies the vectors from flash to 0x0 (in SRAM) if TEXT_BASE is not equal 0x0 (if TEXT_BASE is equal to 0x0 there is no problem).
Question: Is start.S the correct place to put this, perhaps bracketed with "#ifdef CONFIG_USE_IRQ/#endif"? It seems like a global problem that all arm720t boards that use interrupts would have. Or is memsetup.S a better place for this?
Comments?
Cheers, Curt

In message 20040706102730.B25870@cucy.com you wrote:
I have a question about relocating the exception vectors for the ARM platform. I am working with cpu/arm720t/start.S and want to use
...
Now the exception vectors are sitting in SRAM @ 0x007d0000 and in flash @ 0x0100000 -- if I want to use interrupts, however, the exception vectors need to be in SRAM at address 0x0.
This is one of the areas where the old ARMBoot code hits us hard. They never implemented the relocation correctly.
Currently I have added an additional relocation step to start.S that explicitly copies the vectors from flash to 0x0 (in SRAM) if TEXT_BASE is not equal 0x0 (if TEXT_BASE is equal to 0x0 there is no problem).
Please submit a patch.
Question: Is start.S the correct place to put this, perhaps bracketed
Yes, it is. See function trap_init() [in cpu/*/start.S] as used in PowerPC systems. trap_init() should be called from board_init_r().
with "#ifdef CONFIG_USE_IRQ/#endif"? It seems like a global problem
No.
that all arm720t boards that use interrupts would have. Or is memsetup.S a better place for this?
No.
Best regards,
Wolfgang Denk

On Tue, 6 Jul 2004, Wolfgang Denk wrote:
In message 20040706102730.B25870@cucy.com you wrote:
I have a question about relocating the exception vectors for the ARM platform. I am working with cpu/arm720t/start.S and want to use
...
Now the exception vectors are sitting in SRAM @ 0x007d0000 and in flash @ 0x0100000 -- if I want to use interrupts, however, the exception vectors need to be in SRAM at address 0x0.
This is one of the areas where the old ARMBoot code hits us hard. They never implemented the relocation correctly.
Interrupts worked fine in ARMboot. Maybe you broke CONFIG_USE_IRQ when you ripped the code.
Regards, Marius

In message Pine.LNX.4.56.0407070943450.1753@mag.sysgo.com you wrote:
This is one of the areas where the old ARMBoot code hits us hard. They never implemented the relocation correctly.
Interrupts worked fine in ARMboot. Maybe you broke CONFIG_USE_IRQ when you ripped the code.
Maybe, but I don't think so. At least I see no code in ARMBoot to relocate the exception vectors.
Do you still have access to an ARMBoot based system using interrupts? Do interrupts continue to work when you are running from RAM and erase the flash?
Best regards,
Wolfgang Denk

On Wed, 7 Jul 2004, Wolfgang Denk wrote:
In message Pine.LNX.4.56.0407070943450.1753@mag.sysgo.com you wrote:
This is one of the areas where the old ARMBoot code hits us hard. They never implemented the relocation correctly.
Interrupts worked fine in ARMboot. Maybe you broke CONFIG_USE_IRQ when you ripped the code.
Maybe, but I don't think so. At least I see no code in ARMBoot to relocate the exception vectors.
Because they can't be. The vectors always sit at address 0000'0000, and thus in the flash. You can only change that by turning on the MMU. So the relocated entry points are loaded to the pc via ldr, the only exception being the RESET vector, obviosly. In other words, interrupts in ARMboot can only be used _after_ relocation.
Do interrupts continue to work when you are running from RAM and erase the flash?
For the reasons given above, this cannot work if the flash to be programmed sits at 0000'0000.
Regards, Marius
participants (3)
-
Curt Brune
-
Marius Groeger
-
Wolfgang Denk