[rtems commit] mpc83xx: Use shared linkcmds.base

Sebastian Huber sebh at rtems.org
Thu Mar 14 09:51:47 UTC 2013


Module:    rtems
Branch:    master
Commit:    f88da30ee8ef1c76410b0fb0fe048a821fd0054e
Changeset: http://git.rtems.org/rtems/commit/?id=f88da30ee8ef1c76410b0fb0fe048a821fd0054e

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Mar 11 17:50:27 2013 +0100

mpc83xx: Use shared linkcmds.base

---

 c/src/lib/libbsp/powerpc/gen83xx/Makefile.am       |    8 +-
 c/src/lib/libbsp/powerpc/gen83xx/configure.ac      |    3 +
 c/src/lib/libbsp/powerpc/gen83xx/preinstall.am     |   14 +-
 c/src/lib/libbsp/powerpc/gen83xx/start/start.S     |   84 ++---
 .../lib/libbsp/powerpc/gen83xx/startup/bspstart.c  |    8 +-
 .../libbsp/powerpc/gen83xx/startup/linkcmds.base   |  357 --------------------
 .../libbsp/powerpc/gen83xx/startup/linkcmds.br_uid |   15 +-
 .../powerpc/gen83xx/startup/linkcmds.hsc_cm01      |   15 +-
 .../powerpc/gen83xx/startup/linkcmds.mpc8309som    |   15 +-
 .../powerpc/gen83xx/startup/linkcmds.mpc8313erdb   |   15 +-
 .../powerpc/gen83xx/startup/linkcmds.mpc8349eamds  |   15 +-
 .../powerpc/gen83xx/startup/linkcmds.mpc83xx       |   45 +++
 .../libbsp/powerpc/gen83xx/startup/mpc83xx_regs.c  |   30 --
 13 files changed, 129 insertions(+), 495 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
index 7d970ae..f32c299 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
@@ -18,6 +18,8 @@ include_bsp_HEADERS += ../../shared/include/irq-generic.h
 include_bsp_HEADERS += ../../shared/include/irq-info.h
 include_bsp_HEADERS += ../../shared/include/u-boot.h
 include_bsp_HEADERS += ../../shared/include/utility.h
+include_bsp_HEADERS += ../shared/include/linker-symbols.h
+include_bsp_HEADERS += ../shared/include/start.h
 include_bsp_HEADERS += ../shared/include/tictac.h
 include_bsp_HEADERS += ../shared/include/u-boot-board-info.h
 include_bsp_HEADERS += include/hwreg_vals.h
@@ -39,7 +41,8 @@ libbspstart_a_SOURCES += ../../powerpc/shared/start/rtems_crti.S
 project_lib_DATA += rtems_crti.$(OBJEXT)
 
 dist_project_lib_DATA += startup/linkcmds \
-    startup/linkcmds.base \
+    ../shared/startup/linkcmds.base \
+    startup/linkcmds.mpc83xx \
     startup/linkcmds.mpc8309som \
     startup/linkcmds.mpc8313erdb \
     startup/linkcmds.br_uid \
@@ -49,9 +52,6 @@ dist_project_lib_DATA += startup/linkcmds \
 noinst_LIBRARIES += libbsp.a
 libbsp_a_SOURCES =
 
-# mpc83xx_regs
-libbsp_a_SOURCES += startup/mpc83xx_regs.c
-
 # startup
 libbsp_a_SOURCES += ../../shared/bsplibc.c \
 	../../shared/bsppost.c \
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/configure.ac b/c/src/lib/libbsp/powerpc/gen83xx/configure.ac
index 7d623bf..14ce93e 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/configure.ac
+++ b/c/src/lib/libbsp/powerpc/gen83xx/configure.ac
@@ -19,6 +19,9 @@ RTEMS_BSPOPTS_HELP_DATA_CACHE_ENABLED
 RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([*],[1])
 RTEMS_BSPOPTS_HELP_INSTRUCTION_CACHE_ENABLED
 
+RTEMS_BSPOPTS_SET([BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN],[indicate that the interrupt stack is at the work area begin])
+
 RTEMS_BSPOPTS_SET([MPC83XX_BOARD_MPC8313ERDB],[mpc8313erdb],[1])
 RTEMS_BSPOPTS_HELP([MPC83XX_BOARD_MPC8313ERDB],
 [if defined, then use settings for the MPC8313ERDB board])
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am b/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am
index 13bed48..8fe05dc 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/preinstall.am
@@ -69,6 +69,14 @@ $(PROJECT_INCLUDE)/bsp/utility.h: ../../shared/include/utility.h $(PROJECT_INCLU
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/utility.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/utility.h
 
+$(PROJECT_INCLUDE)/bsp/linker-symbols.h: ../shared/include/linker-symbols.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/linker-symbols.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/linker-symbols.h
+
+$(PROJECT_INCLUDE)/bsp/start.h: ../shared/include/start.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/start.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/start.h
+
 $(PROJECT_INCLUDE)/bsp/tictac.h: ../shared/include/tictac.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/tictac.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/tictac.h
@@ -113,10 +121,14 @@ $(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
 
-$(PROJECT_LIB)/linkcmds.base: startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp)
+$(PROJECT_LIB)/linkcmds.base: ../shared/startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base
 
+$(PROJECT_LIB)/linkcmds.mpc83xx: startup/linkcmds.mpc83xx $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.mpc83xx
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.mpc83xx
+
 $(PROJECT_LIB)/linkcmds.mpc8309som: startup/linkcmds.mpc8309som $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.mpc8309som
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.mpc8309som
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/start/start.S b/c/src/lib/libbsp/powerpc/gen83xx/start/start.S
index 770256d..59c342c 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/start/start.S
+++ b/c/src/lib/libbsp/powerpc/gen83xx/start/start.S
@@ -53,10 +53,9 @@ PUBLIC_VAR (reset_vec)
 reset_vec:
 	bl rom_entry
 
-.section ".entry"
-PUBLIC_VAR (start)
-start:
-
+.section ".bsp_start_text", "ax"
+PUBLIC_VAR (_start)
+_start:
 	/* Reset time base */
 	li	r0, 0
 	mtspr	TBWU, r0
@@ -359,14 +358,13 @@ start_rom_skip1:
 	/*
 	 * ROM or relocatable startup: copy startup code to SDRAM
 	 */
-	/* get start address of text section in RAM */
-	LA	r29, bsp_section_text_start
-	/* get start address of text section in ROM (add reloc offset) */
+	/* get start address of start section in RAM */
+	LA	r29, bsp_section_start_begin
+	/* get start address of start section in ROM (add reloc offset) */
 	add	r30, r20, r29
 	/* get size of startup code */
-	LA	r28, end_reloc_startup
-	LA	r31, bsp_section_text_start
-	sub	28,r28,r31
+	LA	r28, bsp_section_start_end
+	sub	28,r28,r29
 	/* copy startup code from ROM to RAM location */
 	bl	copy_image
 
@@ -385,58 +383,29 @@ copy_rest_of_text:
 	/*
 	 * ROM or relocatable startup: copy rest of code to SDRAM
 	 */
-	/* get start address of rest of code in RAM */
-	LA	r29, end_reloc_startup
-	/* get start address of text section in ROM (add reloc offset) */
+	/* get start address of rest of loadable sections in RAM */
+	LA	r29, bsp_section_text_begin
+	/* get start address of loadable sections in ROM (add reloc offset) */
 	add	r30, r20, r29
-	/* get size of rest of code */
-	LA	r28, bsp_section_text_start
-	LA	r31, bsp_section_text_size
-	add	r28,r28,r31
+	/* get size of rest of loadable sections */
+	LA	r28, bsp_section_data_end
 	sub	r28,r28,r29
 	bl	copy_image      /* copy text section from ROM to RAM location */
 
-	/*
-	 * ROM or relocatable startup: copy data to SDRAM
-	 */
-	/* get start address of data section in RAM */
-	LA	r29, bsp_section_data_start
-	/* get start address of data section in ROM (add reloc offset) */
-	add	r30, r20, r29
-	/* get size of RAM image */
-	LA	r28, bsp_section_data_size
-	/* copy initialized data section from ROM to RAM location */
-	bl	copy_image
-
 start_code_in_ram:
 
 	/*
 	 * ROM/RAM startup: clear bss in SDRAM
 	 */
-	LA	r3, bsp_section_bss_start  /* get start address of bss section */
-	LWI	r4, bsp_section_bss_size   /* get size of bss section */
-	bl	mpc83xx_zero_4          /* Clear the bss section */
+	LA	r3, bsp_section_sbss_begin  /* get start address of bss section */
+	LA	r4, bsp_section_bss_end     /* get end address of bss section */
+	sub	r4, r4, r3                  /* get size of bss section */
+	bl	mpc83xx_zero_4              /* Clear the bss section */
 
 #ifdef HAS_UBOOT
 	mr	r3, r14
 	bl	bsp_uboot_copy_board_info
 #endif /* HAS_UBOOT */
-	/*
-	 * call boot_card
-	 */
-
-	/* Set stack pointer (common for RAM/ROM startup) */
-	LA	r1, bsp_section_text_start
-        addi    r1, r1, -0x10 /* Set up stack pointer = beginning of text section - 0x10 */
-
-	/* Create NULL */
-	li r0, 0
-
-	/* Return address */
-	stw r0, 4(r1)
-
-	/* Back chain */
-	stw r0, 0(r1)
 
 	/* Read-only small data */
 	LA r2, _SDA2_BASE_
@@ -444,12 +413,16 @@ start_code_in_ram:
 	/* Read-write small data */
 	LA r13, _SDA_BASE_
 
-/* clear arguments and do further init. in C (common for RAM/ROM startup) */
-
         /* Clear cmdline */
-        xor r3, r3, r3
+	li	r3, 0
+
+	/* Set start stack pointer */
+	LA	r1, start_stack_end
+	stwu	r3, -4(r1)
+	stwu	r3, -4(r1)
 
-        bl      SYM (boot_card)  /* Call the first C routine */
+	/* Call the first C routine */
+        bl      SYM (boot_card)
 
 twiddle:
 	/* We don't expect to return from boot_card but if we do */
@@ -548,4 +521,9 @@ mpc83xx_zero_4_tail:
 	/* Return */
 	blr
 
-end_reloc_startup:
+.section ".bsp_rwextra", "aw", @nobits
+
+	/* Start stack area */
+.align 4
+.space 4096
+start_stack_end:
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
index f60d1be..c3e87b4 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
@@ -27,6 +27,7 @@
 #include <bsp/vectors.h>
 #include <bsp/bootcard.h>
 #include <bsp/irq-generic.h>
+#include <bsp/linker-symbols.h>
 #include <bsp/u-boot.h>
 
 /* Configuration parameters for console driver, ... */
@@ -80,9 +81,6 @@ void bsp_start( void)
   ppc_cpu_id_t myCpu;
   ppc_cpu_revision_t myCpuRevision;
 
-  uintptr_t interrupt_stack_start = (uintptr_t) bsp_interrupt_stack_start;
-  uintptr_t interrupt_stack_size = (uintptr_t) bsp_interrupt_stack_size;
-
   /*
    * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
    * store the result in global variables so that it can be used latter...
@@ -136,8 +134,8 @@ void bsp_start( void)
 #endif
   ppc_exc_initialize(
     PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
-    interrupt_stack_start,
-    interrupt_stack_size
+    (uintptr_t) bsp_section_work_begin,
+    rtems_configuration_get_interrupt_stack_size()
   );
 
   /* Install default handler for the decrementer exception */
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.base b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.base
deleted file mode 100644
index 56f14fb..0000000
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.base
+++ /dev/null
@@ -1,357 +0,0 @@
-/**
- * @file
- *
- * Derived from internal linker script of GNU ld (GNU Binutils) 2.18 for elf32ppc emulation.
- */
-
-OUTPUT_FORMAT ("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
-OUTPUT_ARCH (powerpc)
-ENTRY (start)
-
-bsp_ram_start = ORIGIN (RAM);
-bsp_ram_end = ORIGIN (RAM) + LENGTH (RAM);
-bsp_ram_size = LENGTH (RAM);
-
-bsp_rom_start = ORIGIN (ROM);
-bsp_rom_end = ORIGIN (ROM) + LENGTH (ROM);
-bsp_rom_size = LENGTH (ROM);
-
-bsp_section_align = 32;
-
-RamBase = bsp_ram_start;
-RamSize = bsp_ram_size;
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
-
-MEMORY {
-	UNEXPECTED_SECTIONS : ORIGIN = 0xffffffff, LENGTH = 0
-}
-
-SECTIONS {
-	/*
-	 * BSP: MPC83XX registers
-	 */
-	.mpc83xx_regs (NOLOAD) : { 
-		IMMRBAR = .;
-		mpc83xx_regs*(.text)
-		mpc83xx_regs*(.data)
-		mpc83xx_regs*(.bss)
-		mpc83xx_regs*(COMMON)
-	} > MPC83XX_REGS
-
-	/*
-	 * BSP: Reset configuration
-	 */
-	.resconf 0x0 : {
-		*(.resconf)
-	} > RAM
-
-	/*
-	 * BSP: Exception vectors
-	 */
-	.vectors 0x100 : {
-		*(.vectors)
-	} > RAM
-
-	/* 
-	 * BSP: The initial stack will live in this area - between the vectors
-	 * and the text section.
-	 */
-
-	.text 0x10000 : {
-		/*
-		 * BSP: Start of text section
-		 */
-		bsp_section_text_start = .;
-
-		/*
-		 * BSP: System startup entry
-		 */
-		KEEP (*(.entry))
-
-		/*
-		 * BSP: Moved into .text from .init
-		 */
-		KEEP (*(.init))
-
-		*(.text .stub .text.* .gnu.linkonce.t.*)
-		KEEP (*(.text.*personality*))
-		/* .gnu.warning sections are handled specially by elf32.em.  */
-		*(.gnu.warning)
-		*(.glink)
-		
-		/*
-		 * BSP: Special FreeBSD sysctl sections
-		 */
-		. = ALIGN (16);
-		__start_set_sysctl_set = .;
-		*(set_sysctl_*);
-		__stop_set_sysctl_set = ABSOLUTE(.);
-		*(set_domain_*);
-		*(set_pseudo_*);
-
-		/*
-		 * BSP: Moved into .text from .*
-		 */
-		*(.rodata .rodata.* .gnu.linkonce.r.*)
-		*(.rodata1)
-		*(.interp)
-		*(.note.gnu.build-id)
-		*(.hash)
-		*(.gnu.hash)
-		*(.dynsym)
-		*(.dynstr)
-		*(.gnu.version)
-		*(.gnu.version_d)
-		*(.gnu.version_r)
-		*(.eh_frame_hdr)
-
-		. = ALIGN (4);
-
-		_bsd__start_set_modmetadata_set = .;
-		*(_bsd_set_modmetadata_set);
-		_bsd__stop_set_modmetadata_set = .;
-
-		_bsd__start_set_sysctl_set = .;
-		*(_bsd_set_sysctl_set);
-		_bsd__stop_set_sysctl_set = .;
-
-		/*
-		 * BSP: Magic PPC stuff
-		 */
-		*(.PPC.*)
-
-		/*
-		 * BSP: Required by cpukit/score/src/threadhandler.c
-		 */
-		PROVIDE (_fini = .);
-
-		/*
-		 * BSP: Moved into .text from .fini
-		 */
-		KEEP (*(.fini))
-
-		. = ALIGN (bsp_section_align);
-
-		PROVIDE (__etext = .);
-		PROVIDE (_etext = .);
-		PROVIDE (etext = .);
-	} > RAM
-
-	.sdata2 : {
-		PROVIDE (_SDA2_BASE_ = 32768);
-
-		*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
-
-		. = ALIGN (bsp_section_align);
-	} > RAM
-
-	.sbss2 : {
-		*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
-
-		. = ALIGN (bsp_section_align);
-
-		/*
-		 * BSP: End of text section
-		 */
-		bsp_section_text_end = .;
-	} > RAM
-
-	.data : {
-		/*
-		 * BSP: Start of data section
-		 */
-		bsp_section_data_start = .;
-
-		/*
-		 * BSP: Moved into .data from .ctors
-		 */
-		/* gcc uses crtbegin.o to find the start of
-		   the constructors, so we make sure it is
-		   first.  Because this is a wildcard, it
-		   doesn't matter if the user does not
-		   actually link against crtbegin.o; the
-		   linker won't look for a file to match a
-		   wildcard.  The wildcard also means that it
-		   doesn't matter which directory crtbegin.o
-		   is in.  */
-		KEEP (*crtbegin.o(.ctors))
-		KEEP (*crtbegin?.o(.ctors))
-		/* We don't want to include the .ctor section from
-		   the crtend.o file until after the sorted ctors.
-		   The .ctor section from the crtend file contains the
-		   end of ctors marker and it must be last */
-		KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
-		KEEP (*(SORT(.ctors.*)))
-		KEEP (*(.ctors))
-
-		/*
-		 * BSP: Moved into .data from .dtors
-		 */
-		KEEP (*crtbegin.o(.dtors))
-		KEEP (*crtbegin?.o(.dtors))
-		KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
-		KEEP (*(SORT(.dtors.*)))
-		KEEP (*(.dtors))
-
-		/*
-		 * BSP: Moved into .data from .*
-		 */
-		*(.tdata .tdata.* .gnu.linkonce.td.*)
-		*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
-		*(.data1)
-		KEEP (*(.eh_frame))
-		*(.gcc_except_table .gcc_except_table.*)
-		KEEP (*(.jcr))
-		*(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
-		*(.fixup)
-		*(.got1)
-		*(.got2)
-		*(.dynamic)
-		*(.got)
-		*(.plt)
-		PROVIDE_HIDDEN (__preinit_array_start = .);
-		KEEP (*(.preinit_array))
-		PROVIDE_HIDDEN (__preinit_array_end = .);
-		PROVIDE_HIDDEN (__init_array_start = .);
-		KEEP (*(SORT(.init_array.*)))
-		KEEP (*(.init_array))
-		PROVIDE_HIDDEN (__init_array_end = .);
-		PROVIDE_HIDDEN (__fini_array_start = .);
-		KEEP (*(.fini_array))
-		KEEP (*(SORT(.fini_array.*)))
-		PROVIDE_HIDDEN (__fini_array_end = .);
-
-		*(.data .data.* .gnu.linkonce.d.*)
-		KEEP (*(.gnu.linkonce.d.*personality*))
-		SORT(CONSTRUCTORS)
-
-		. = ALIGN (4);
-
-		_bsd__start_set_sysinit_set = .;
-		*(_bsd_set_sysinit_set);
-		_bsd__stop_set_sysinit_set = .;
-
-		. = ALIGN (bsp_section_align);
-	} > RAM
-
-	.sdata : {
-		PROVIDE (_SDA_BASE_ = 32768);
-		*(.sdata .sdata.* .gnu.linkonce.s.*)
-
-		. = ALIGN (bsp_section_align);
-
-		_edata = .;
-		PROVIDE (edata = .);
-
-		/*
-		 * BSP: End of data section
-		 */
-		bsp_section_data_end = .;
-	} > RAM
-
-	.sbss : {
-		/*
-		 * BSP: Start of bss section
-		 */
-		bsp_section_bss_start = .;
-
-		__bss_start = .;
-
-		PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
-		*(.scommon)
-		*(.dynsbss)
-		*(.sbss .sbss.* .gnu.linkonce.sb.*)
-		PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
-
-		. = ALIGN (bsp_section_align);
-	} > RAM
-
-	.bss : {
-		*(COMMON)
-		*(.dynbss)
-		*(.bss .bss.* .gnu.linkonce.b.*)
-
-		. = ALIGN (bsp_section_align);
-
-		__end = .;
-		_end = .;
-		PROVIDE (end = .);
-
-		/*
-		 * BSP: End of bss section
-		 */
-		bsp_section_bss_end = .;
-	} > RAM
-
-	/*
-	 * BSP: Section sizes
-	 */
-	bsp_section_text_size = bsp_section_text_end - bsp_section_text_start;
-	bsp_section_data_size = bsp_section_data_end - bsp_section_data_start;
-	bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_start;
-
-	/*
-	 * BSP: Interrupt stack
-	 */
-	bsp_interrupt_stack_start = bsp_section_bss_end;
-	bsp_interrupt_stack_end = bsp_interrupt_stack_start + 32k;
-	bsp_interrupt_stack_size = bsp_interrupt_stack_end - bsp_interrupt_stack_start;
-
-	/*
-	 * BSP: Work area start
-	 */
-	bsp_work_area_start = bsp_interrupt_stack_end;
-	WorkAreaBase = bsp_work_area_start;
-	
-	/* Stabs debugging sections.  */
-	.stab          0 : { *(.stab) }
-	.stabstr       0 : { *(.stabstr) }
-	.stab.excl     0 : { *(.stab.excl) }
-	.stab.exclstr  0 : { *(.stab.exclstr) }
-	.stab.index    0 : { *(.stab.index) }
-	.stab.indexstr 0 : { *(.stab.indexstr) }
-	.comment       0 : { *(.comment) }
-	/* DWARF debug sections.
-	   Symbols in the DWARF debugging sections are relative to the beginning
-	   of the section so we begin them at 0.  */
-	/* DWARF 1 */
-	.debug          0 : { *(.debug) }
-	.line           0 : { *(.line) }
-	/* GNU DWARF 1 extensions */
-	.debug_srcinfo  0 : { *(.debug_srcinfo) }
-	.debug_sfnames  0 : { *(.debug_sfnames) }
-	/* DWARF 1.1 and DWARF 2 */
-	.debug_aranges  0 : { *(.debug_aranges) }
-	.debug_pubnames 0 : { *(.debug_pubnames) }
-	/* DWARF 2 */
-	.debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
-	.debug_abbrev   0 : { *(.debug_abbrev) }
-	.debug_line     0 : { *(.debug_line) }
-	.debug_frame    0 : { *(.debug_frame) }
-	.debug_str      0 : { *(.debug_str) }
-	.debug_loc      0 : { *(.debug_loc) }
-	.debug_macinfo  0 : { *(.debug_macinfo) }
-	/* SGI/MIPS DWARF 2 extensions */
-	.debug_weaknames 0 : { *(.debug_weaknames) }
-	.debug_funcnames 0 : { *(.debug_funcnames) }
-	.debug_typenames 0 : { *(.debug_typenames) }
-	.debug_varnames  0 : { *(.debug_varnames) }
-	/* DWARF 3 */
-	.debug_pubtypes 0 : { *(.debug_pubtypes) }
-	.debug_ranges   0 : { *(.debug_ranges) }
-	.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
-
-	/DISCARD/ : {
-		*(.note.GNU-stack) *(.gnu_debuglink)
-	}
-
-	/*
-	 * This is a RTEMS specific section to catch all unexpected input
-	 * sections.  In case you get an error like
-	 *   "section `.unexpected_sections' will not fit in region
-	 *   `UNEXPECTED_SECTIONS'"
-	 * you have to figure out the offending input section and add it to the
-	 * appropriate output section definition above.
-	 */
-	.unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
-}
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.br_uid b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.br_uid
index db004b8..3d8c3a1 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.br_uid
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.br_uid
@@ -1,13 +1,10 @@
-/**
- * @file
- *
- * MPC8309 System on Module.
- */
-
 MEMORY {
-	RAM : ORIGIN = 0x0, LENGTH = 256M
+	RESCONF : ORIGIN = 0x0, LENGTH = 0x100
+	VECTORS : ORIGIN = 0x100, LENGTH = 0x10000 - 0x100
+	WORK : ORIGIN = 0x10000, LENGTH = 256M - 0x10000
 	ROM : ORIGIN = 0xfe000000, LENGTH = 2M
-	MPC83XX_REGS : ORIGIN = 0xe0000000, LENGTH = 256k
 }
 
-INCLUDE linkcmds.base
+REGION_ALIAS ("START", WORK);
+
+INCLUDE linkcmds.mpc83xx
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.hsc_cm01 b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.hsc_cm01
index 021d241..d5b4b1e 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.hsc_cm01
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.hsc_cm01
@@ -1,13 +1,10 @@
-/**
- * @file
- *
- * HSC_CM01 Board.
- */
-
 MEMORY {
-	RAM : ORIGIN = 0x0, LENGTH = 256M
+	RESCONF : ORIGIN = 0x0, LENGTH = 0x100
+	VECTORS : ORIGIN = 0x100, LENGTH = 0x10000 - 0x100
+	WORK : ORIGIN = 0x10000, LENGTH = 256M - 0x10000
 	ROM : ORIGIN = 0xfe000000, LENGTH = 8M
-	MPC83XX_REGS : ORIGIN = 0xe0000000, LENGTH = 1M
 }
 
-INCLUDE linkcmds.base
+REGION_ALIAS ("START", WORK);
+
+INCLUDE linkcmds.mpc83xx
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8309som b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8309som
index e2195b7..d5b4b1e 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8309som
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8309som
@@ -1,13 +1,10 @@
-/**
- * @file
- *
- * MPC8309 System on Module.
- */
-
 MEMORY {
-	RAM : ORIGIN = 0x0, LENGTH = 256M
+	RESCONF : ORIGIN = 0x0, LENGTH = 0x100
+	VECTORS : ORIGIN = 0x100, LENGTH = 0x10000 - 0x100
+	WORK : ORIGIN = 0x10000, LENGTH = 256M - 0x10000
 	ROM : ORIGIN = 0xfe000000, LENGTH = 8M
-	MPC83XX_REGS : ORIGIN = 0xe0000000, LENGTH = 256k
 }
 
-INCLUDE linkcmds.base
+REGION_ALIAS ("START", WORK);
+
+INCLUDE linkcmds.mpc83xx
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8313erdb b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8313erdb
index 4a47c9d..717b3b4 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8313erdb
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8313erdb
@@ -1,13 +1,10 @@
-/**
- * @file
- *
- * MPC8313E Reference Design Board.
- */
-
 MEMORY {
-	RAM : ORIGIN = 0x0, LENGTH = 128M
+	RESCONF : ORIGIN = 0x0, LENGTH = 0x100
+	VECTORS : ORIGIN = 0x100, LENGTH = 0x10000 - 0x100
+	WORK : ORIGIN = 0x10000, LENGTH = 128M - 0x10000
 	ROM : ORIGIN = 0xfe000000, LENGTH = 8M
-	MPC83XX_REGS : ORIGIN = 0xe0000000, LENGTH = 256k
 }
 
-INCLUDE linkcmds.base
+REGION_ALIAS ("START", WORK);
+
+INCLUDE linkcmds.mpc83xx
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8349eamds b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8349eamds
index d140e07..d5b4b1e 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8349eamds
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8349eamds
@@ -1,13 +1,10 @@
-/**
- * @file
- *
- * MPC8349EAMDS Board.
- */
-
 MEMORY {
-	RAM : ORIGIN = 0x0, LENGTH = 256M
+	RESCONF : ORIGIN = 0x0, LENGTH = 0x100
+	VECTORS : ORIGIN = 0x100, LENGTH = 0x10000 - 0x100
+	WORK : ORIGIN = 0x10000, LENGTH = 256M - 0x10000
 	ROM : ORIGIN = 0xfe000000, LENGTH = 8M
-	MPC83XX_REGS : ORIGIN = 0xe0000000, LENGTH = 256k
 }
 
-INCLUDE linkcmds.base
+REGION_ALIAS ("START", WORK);
+
+INCLUDE linkcmds.mpc83xx
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc83xx b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc83xx
new file mode 100644
index 0000000..66430a8
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc83xx
@@ -0,0 +1,45 @@
+bsp_ram_start = ORIGIN (RESCONF);
+bsp_ram_end = ORIGIN (WORK) + LENGTH (WORK);
+bsp_ram_size = bsp_ram_end - bsp_ram_start;
+
+bsp_rom_start = ORIGIN (ROM);
+bsp_rom_size = LENGTH (ROM);
+bsp_rom_end = bsp_rom_start + bsp_rom_size;
+
+IMMRBAR = 0xe0000000;
+mpc83xx = IMMRBAR;
+
+MEMORY {
+	EMPTY : ORIGIN = 0x0, LENGTH = 0
+}
+
+SECTIONS {
+	.resconf : {
+		*(.resconf)
+	} > RESCONF AT > RESCONF
+
+	.vectors : {
+		*(.vectors)
+	} > VECTORS AT > VECTORS
+}
+
+REGION_ALIAS ("REGION_START", START);
+REGION_ALIAS ("REGION_FAST_TEXT", WORK);
+REGION_ALIAS ("REGION_FAST_TEXT_LOAD", WORK);
+REGION_ALIAS ("REGION_TEXT", WORK);
+REGION_ALIAS ("REGION_TEXT_LOAD", WORK);
+REGION_ALIAS ("REGION_RODATA", WORK);
+REGION_ALIAS ("REGION_RODATA_LOAD", WORK);
+REGION_ALIAS ("REGION_FAST_DATA", WORK);
+REGION_ALIAS ("REGION_FAST_DATA_LOAD", WORK);
+REGION_ALIAS ("REGION_DATA", WORK);
+REGION_ALIAS ("REGION_DATA_LOAD", WORK);
+REGION_ALIAS ("REGION_BSS", WORK);
+REGION_ALIAS ("REGION_RWEXTRA", WORK);
+REGION_ALIAS ("REGION_WORK", WORK);
+REGION_ALIAS ("REGION_STACK", WORK);
+REGION_ALIAS ("REGION_NOCACHE", EMPTY);
+REGION_ALIAS ("REGION_NOCACHE_LOAD", EMPTY);
+REGION_ALIAS ("REGION_NVRAM", EMPTY);
+
+INCLUDE linkcmds.base
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/mpc83xx_regs.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/mpc83xx_regs.c
deleted file mode 100644
index d32b763..0000000
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/mpc83xx_regs.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*===============================================================*\
-| Project: RTEMS generic MPC83xx BSP                              |
-+-----------------------------------------------------------------+
-| Partially based on the code references which are named below.   |
-| Adaptions, modifications, enhancements and any recent parts of  |
-| the code are:                                                   |
-|                    Copyright (c) 2005                           |
-|                    Embedded Brains GmbH                         |
-|                    Obere Lagerstr. 30                           |
-|                    D-82178 Puchheim                             |
-|                    Germany                                      |
-|                    rtems at embedded-brains.de                     |
-+-----------------------------------------------------------------+
-| The license and distribution terms for this file may be         |
-| found in the file LICENSE in this distribution or at            |
-|                                                                 |
-| http://www.rtems.com/license/LICENSE.                           |
-|                                                                 |
-+-----------------------------------------------------------------+
-| this file places the mpc83xx registers into a special section   |
-\*===============================================================*/
-
-
-#include <mpc83xx/mpc83xx.h>
-
-/*
- * this uninitialized variable will be overlayed to the hardware
- * registers in the linker command file
- */
-m83xxRegisters_t mpc83xx;




More information about the vc mailing list