Hi Piotr:
Regarding the addressing issues I'm having with "objcopy
--output-target=binary", where the reset address 0x100 is coming up as
the first byte (address 0x000) in the .bin file, please find
file:///home/rdiez/rdiez/orbuild/Repositories/ECOS/BinAddressIssue.patchattached
a patch to fix it for the RAM scenario (the most common one).
When building for ROM, you need to change the vector addresses in
vectors.S from 0x100 to 0xF0000100 and so on. Could you look into this?
I think it's just a matter of checking configuration settings
CYG_HAL_STARTUP and CYGHWR_MEMORY_LAYOUT and defining the vector
addresses accordingly.
Or do you know some other way to make objcopy start dumping at address
0, so that it pads with zeros as necessary and the reset vector lands
then at 0x100?
Thanks,
rdiez
Index: packages/hal/openrisc/orpsoc/current/include/pkgconf/mlt_openrisc_orpsoc_rom.ldi
===================================================================
--- packages/hal/openrisc/orpsoc/current/include/pkgconf/mlt_openrisc_orpsoc_rom.ldi (revision 850)
+++ packages/hal/openrisc/orpsoc/current/include/pkgconf/mlt_openrisc_orpsoc_rom.ldi (working copy)
@@ -11,7 +11,7 @@
SECTIONS
{
SECTIONS_BEGIN
- SECTION_vectors (rom, 0xF0000100, LMA_EQ_VMA)
+ SECTION_vectors (rom)
SECTION_ROMISC (rom, ALIGN (0x8), LMA_EQ_VMA)
SECTION_RELOCS (rom, ALIGN (0x8), LMA_EQ_VMA)
SECTION_init (rom, ALIGN (0x8), LMA_EQ_VMA)
Index: packages/hal/openrisc/orpsoc/current/include/pkgconf/mlt_openrisc_orpsoc_ram.ldi
===================================================================
--- packages/hal/openrisc/orpsoc/current/include/pkgconf/mlt_openrisc_orpsoc_ram.ldi (revision 850)
+++ packages/hal/openrisc/orpsoc/current/include/pkgconf/mlt_openrisc_orpsoc_ram.ldi (working copy)
@@ -11,7 +11,7 @@
SECTIONS
{
SECTIONS_BEGIN
- SECTION_vectors (ram, 0x00000100, LMA_EQ_VMA)
+ SECTION_vectors (ram)
SECTION_ROMISC (ram, ALIGN (0x8), LMA_EQ_VMA)
SECTION_RELOCS (ram, ALIGN (0x8), LMA_EQ_VMA)
SECTION_init (ram, ALIGN (0x8), LMA_EQ_VMA)
Index: packages/hal/openrisc/arch/current/src/vectors.S
===================================================================
--- packages/hal/openrisc/arch/current/src/vectors.S (revision 850)
+++ packages/hal/openrisc/arch/current/src/vectors.S (working copy)
@@ -96,6 +96,7 @@
# Reset vector macro
.macro reset_vector name org
+ .org \org
.p2align 8
.globl __exception_\name
__exception_\name:
@@ -110,6 +111,7 @@
# Generic vector macro
.macro exception_vector name org
+ .org \org
.p2align 8
.globl __exception_\name
__exception_\name:
Index: packages/hal/openrisc/arch/current/src/openrisc.ld
===================================================================
--- packages/hal/openrisc/arch/current/src/openrisc.ld (revision 850)
+++ packages/hal/openrisc/arch/current/src/openrisc.ld (working copy)
@@ -138,8 +138,8 @@
.rela.plt : { *(.rela.plt) } > _region_ \
.rel.dyn : { *(.rel.dyn) } > _region_
-#define SECTION_vectors(_region_, _vma_, _lma_) \
- .vectors _vma_ : _lma_ \
+#define SECTION_vectors(_region_) \
+ .vectors : \
{ FORCE_OUTPUT; KEEP(*(.vectors)) } \
> _region_
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc