How to build flash image for MPC860 ?

Li HongSong hsli at utstar.hz.zj.cn
Mon Mar 27 04:55:45 UTC 2000


Hi,
I have problem building flash image for Motorola FADS860 
evaluation board.
The BSP is derived from eth_comm, I modified start.S to
add some initialization code for FADS860 board and relocated it
at section .entry which load address start at flash reset vector.
I also modified linkcmds which listed below to locate all
sections in dram except the section .entry. In the end of start.S,
it will copy the .text, .data and .vectors from flash to dram.
But when I finished building samples based on this BSP and program
the image to flash memory using mpc8bug software, I find only the
section .entry is programmed to flash, all other sections are 
loaded to dram instead of flash !
/*--------------------------------------------------------------*/
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
              "elf32-powerpc")
OUTPUT_ARCH(powerpc)
SEARCH_DIR(/usr/local/powerpc-rtems/lib);

ENTRY(start)

MEMORY
 {
 ram   : org = 0x00000000, l = 4M
 flash : org = 0x02800000, l = 2M
 dpram : org = 0xFF000000, l = 16K
 }

SECTIONS
{
 .entry :
 {
   *(.entry)
   . = ALIGN(0x10);
   copy.src = .;
 } > flash

 /* IMPORTANT: section ".vectors" must be the first in RAM ! */
 .vectors :          AT (copy.src)
 {
   copy.dest = .;
   *(.vectors)
   . = ALIGN(0x10);
   copy.tmptop.vec = .;
 } > ram

 .text :             AT (copy.tmptop.vec - copy.dest + copy.src)
   {
   text.start = .;
   *(.entry2)
   *(.text)
   *(.rodata)
   *(.gnu.linkonce.r*)
   *(.rodata1)
   *(.gnu.linkonce.t.*)
   *(.descriptors)
   /* .gnu.warning sections are handled specially by elf32.em.  */
   *(.gnu.warning)
   *(rom_ver)
   etext = ALIGN(0x10);
   _etext = .;

   __CTOR_LIST__ = .;
   LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
   *(.ctors)
   LONG(0)
   __CTOR_END__ = .;

   __DTOR_LIST__ = .;
   LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
   *(.dtors)
   LONG(0)
   __DTOR_END__ = .;

   *(.lit)
   *(.shdata)
   *(.init)
   *(.fini)
   . = ALIGN(0x10);
   _endtext = .;
   text.end = .;
   copy.tmptop.txt = .;
 } > ram

 text.size = text.end - text.start;

 /* R/W Data */
 .data :             AT (copy.tmptop.txt - copy.dest + copy.src)
 {
   *(.data)
   *(.data1)
   *(.gnu.linkonce.d.*)
   PROVIDE (__SDATA_START__ = .);
   *(.sdata)
   . = ALIGN(0x10);
   copy.tmptop.dat = .;
 } > ram

 PROVIDE (__EXCEPT_START__ = .);
 .gcc_except_table : AT (copy.tmptop.dat - copy.dest + copy.src)
 {
   *(.gcc_except_table)
   . = ALIGN(0x10);
   copy.tmptop.exc = .;
 } > ram
 PROVIDE (__EXCEPT_END__ = .);

 __GOT_START__ = .;
 .got :              AT (copy.tmptop.exc - copy.dest + copy.src)
 {
   s.got = .;
   *(.got.plt) *(.got)
   . = ALIGN(0x10);
   copy.tmptop.got = .;
 } > ram
 __GOT_END__ = .;

 .got1 :             AT (copy.tmptop.got - copy.dest + copy.src)
 {
   *(.got1)
   . = ALIGN(0x10);
   copy.tmptop.gt1 = .;
 } > ram

 PROVIDE (__GOT2_START__ = .);
 PROVIDE (_GOT2_START_ = .);
 .got2 :             AT (copy.tmptop.gt1 - copy.dest + copy.src)
 {
   *(.got2)
   . = ALIGN(0x10);
   copy.tmptop.gt2 = .;
 } > ram
 PROVIDE (__GOT2_END__ = .);
 PROVIDE (_GOT2_END_ = .);

 PROVIDE (__FIXUP_START__ = .);
 PROVIDE (_FIXUP_START_ = .);
 .fixup :            AT (copy.tmptop.gt2 - copy.dest + copy.src)
 {
   *(.fixup)
   . = ALIGN(0x10);
   copy.tmptop.fix = .;
 } > ram
 PROVIDE (_FIXUP_END_ = .);
 PROVIDE (__FIXUP_END__ = .);

 PROVIDE (__SDATA2_START__ = .);
 .sdata2 :           AT (copy.tmptop.fix - copy.dest + copy.src)
 {
   *(.sdata2)
   . = ALIGN(0x10);
   copy.tmptop.sda = .;
 } > ram

 copy.size = copy.tmptop.sda - copy.dest;

 .sbss2 :
 {
   *(.sbss2)
 } > ram
 PROVIDE (__SBSS2_END__ = .);

 __SBSS_START__ = .;
 .bss :
 {
   bss.start = .;
   *(.bss) *(.sbss) *(COMMON)
   . = ALIGN(4);
   bss.end = .;
 } > ram
 __SBSS_END__ = .;

 bss.size = bss.end - bss.start;

 /* reserve 16KByte for stack... */
 stack.end = bss.end + 16K;
 PROVIDE(_end = stack.end);

 dpram : 
 {
          m860 = .;
          _m860 = .;
          . += (8 * 1024);
        } > dpram

 .line 0 : { *(.line) }
 .debug 0 : { *(.debug) }
 .debug_sfnames 0 : { *(.debug_sfnames) }
 .debug_srcinfo 0 : { *(.debug_srcinfo) }
 .debug_pubnames 0 : { *(.debug_pubnames) }
 .debug_aranges 0 : { *(.debug_aranges) }
 .debug_aregion 0 : { *(.debug_aregion) }
 .debug_macinfo 0 : { *(.debug_macinfo) }
 .stab 0 : { *(.stab) }
 .stabstr 0 : { *(.stabstr) }
/*-----------------------------------------------------------*/
It seems the "AT" command didn't work at all.
Can anybody tell me what's wrong with the precedure ?
How to build boot image for my board ?
(I'm using rtems-4.5.0-beta1c)

Thanks in advance !

Li HongSong

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20000327/9cd03349/attachment.html>


More information about the users mailing list