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]

Latest ROMRAM diff for PID



Hi,
	I've redone my ROMRAM diff file for the PID...

this is against the 26 Feb CVS update, there is one minor change (to go
with a change in CVS)...

you still need the tgz file from my last mail ...

Dave.

-- 
      David Airlie, Software Engineer, Parthus Technologies plc.,
       Mary Rosse Centre, National Tech Park, Limerick, Ireland.
   t: +353-61-508116 / f: +353-61-508101 / David.Airlie@parthus.com
Index: hal/arm/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.50
diff -u -r1.50 ChangeLog
--- ChangeLog	2001/02/27 01:21:46	1.50
+++ ChangeLog	2001/03/01 17:09:48
@@ -1,3 +1,12 @@
+2001-02-28  Dave Airlie <airlied@parthus.com>
+       * src/vectors.S (UNMAPPED()): added a case for the ROMRAM startup
+         where we want to boot code from ROM and have it jump to RAM.
+         Currently only implemented on PID board.
+         Also added CYGHWR_HAL_RAM_VADDR, for when the code is compiled
+         for ROMRAM, it doesn't get compiled for RAM at 0, but an offset
+         value.
+
+
 2001-02-24  Gary Thomas  <gthomas@redhat.com>
 
 	* include/hal_mmu.h (MMU_Control_X): Add - used by Win/CE.
Index: hal/arm/arch/current/src/vectors.S
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/src/vectors.S,v
retrieving revision 1.37
diff -u -r1.37 vectors.S
--- vectors.S	2001/02/27 01:21:46	1.37
+++ vectors.S	2001/03/01 17:09:49
@@ -52,6 +52,7 @@
 # undef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
 # undef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
 #endif
+#include CYGHWR_MEMORY_LAYOUT_H
 #include <cyg/hal/hal_platform_setup.h>
 
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
@@ -119,12 +120,25 @@
 // 
 // But usually it's not defined, so the behaviour is the obvious.
 
+// CYGHWR_HAL_RAM_VADDR is used when compiling for a ROM RAM startup
+// Where the image is generated for RAM starting a CYG_HAL_RAM_VADDR
+// but the reset vector needs to be in ROM, so the code can be found
+// at initialisation. this can be defined in hal_platform_setup.h
+// e.g. on a PID board, code is generated for 0x8000, but is in ROM
+// at 0x4000000, in this case the reset vector is at 0x8044 - 0 + 0x4000000 
+// - 8000 which gives a reset vector of 0x4000044 which is correct.
+
 #ifndef UNMAPPED        
 #ifdef CYGHWR_HAL_ARM_HAS_MMU
 # ifndef CYGHWR_HAL_ROM_VADDR
 #  define CYGHWR_HAL_ROM_VADDR __exception_handlers
 # endif
 # define UNMAPPED(x) ((x)-CYGHWR_HAL_ROM_VADDR)
+#elif defined(CYG_HAL_STARTUP_ROMRAM)
+# ifndef CYGHWR_HAL_RAM_VADDR
+#  define CYGHWR_HAL_RAM_VADDR 0
+# endif
+# define UNMAPPED(x) ((x)-CYGMEM_REGION_ram+CYGMEM_REGION_rom-CYGHWR_HAL_RAM_VADDR)
 #else
 # define UNMAPPED(x) (x)
 #endif
@@ -159,7 +173,7 @@
         .section ".vectors","ax"
         .global __exception_handlers
 __exception_handlers:
-#if defined(CYG_HAL_STARTUP_ROM)
+#if defined(CYG_HAL_STARTUP_ROM)||defined(CYG_HAL_STARTUP_ROMRAM)
 // Assumption:  ROM code has these vectors at the hardware reset address.
 // A simple jump removes any address-space dependencies [i.e. safer]
         b       reset_vector                    // 0x00
@@ -325,7 +339,7 @@
 
         LED 4
 
-#if defined(CYG_HAL_STARTUP_ROM)
+#if defined(CYG_HAL_STARTUP_ROM)||defined(CYG_HAL_STARTUP_ROMRAM)
         // Set up reset vector
         mov     r0,#0
         ldr     r1,.__exception_handlers
@@ -333,6 +347,7 @@
         str     r2,[r0,#0x00]
         ldr     r2,=warm_reset
         str     r2,[r0,#0x20]
+#if defined(CYG_HAL_STARTUP_ROM)
         // Relocate [copy] data from ROM to RAM
         ldr     r3,.__rom_data_start
         ldr     r4,.__ram_data_start
@@ -346,6 +361,7 @@
         cmp     r4,r5
         bne     1b
 2:
+#endif
 #endif
 
         // initialize interrupt/exception environments
Index: hal/arm/pid/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/pid/current/ChangeLog,v
retrieving revision 1.25
diff -u -r1.25 ChangeLog
--- ChangeLog	2001/02/27 01:21:46	1.25
+++ ChangeLog	2001/03/01 17:09:49
@@ -1,3 +1,15 @@
+2001-02-28  David Airlie <airlied@parthus.com>
+       * cdl/hal_arm_pid.cdl: Added ROMRAM option for CYG_HAL_STARTUP
+
+       * include/hal_platform_setup.h: Added define for RAM_VADDR
+        and macro to RELOCATE_TEXT_SEGMENT for ROMRAM startup
+  
+       * src/hal_diag.c: changes for ROMRAM startup
+
+       * include/pkgconf/mlt_arm_pid_romram.mlt
+         include/pkgconf/mlt_arm_pid_romram.ldi
+         include/pkgconf/mlt_arm_pid_romram.h: files added for ROMRAM startup
+
 2001-02-24  Gary Thomas  <gthomas@redhat.com>
 
 	* cdl/hal_arm_pid.cdl: Add CYGSEM_HAL_ARM_PID_ANGEL_BOOT so
Index: hal/arm/pid/current/cdl/hal_arm_pid.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/pid/current/cdl/hal_arm_pid.cdl,v
retrieving revision 1.7
diff -u -r1.7 hal_arm_pid.cdl
--- hal_arm_pid.cdl	2001/02/27 01:21:46	1.7
+++ hal_arm_pid.cdl	2001/03/01 17:09:50
@@ -70,7 +70,7 @@
     cdl_component CYG_HAL_STARTUP {
         display       "Startup type"
         flavor        data
-        legal_values  {"RAM" "ROM"}
+        legal_values  {"RAM" "ROM" "ROMRAM" }
         default_value {"RAM"}
 	no_define
 	define -file system.h CYG_HAL_STARTUP
@@ -314,7 +314,8 @@
         flavor data
         no_define
         calculated { CYG_HAL_STARTUP == "RAM" ? "arm_pid_ram" : \
-                                                "arm_pid_rom" }
+                     CYG_HAL_STARTUP == "ROM" ? "arm_pid_rom" : \
+						"arm_pid_romram" }
 
         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
             display "Memory layout linker script fragment"
@@ -322,7 +323,8 @@
             no_define
             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_pid_ram.ldi>" : \
-                                                    "<pkgconf/mlt_arm_pid_rom.ldi>" }
+		   	 CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_pid_rom.ldi>" : \
+                                                    "<pkgconf/mlt_arm_pid_romram.ldi>" }
         }
 
         cdl_option CYGHWR_MEMORY_LAYOUT_H {
@@ -331,7 +333,8 @@
             no_define
             define -file system.h CYGHWR_MEMORY_LAYOUT_H
             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_pid_ram.h>" : \
-                                                    "<pkgconf/mlt_arm_pid_rom.h>" }
+                         CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_pid_rom.h>" : \
+                                                    "<pkgconf/mlt_arm_pid_romram.h>" }
         }
     }
 
Index: hal/arm/pid/current/include/hal_platform_setup.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/pid/current/include/hal_platform_setup.h,v
retrieving revision 1.4
diff -u -r1.4 hal_platform_setup.h
--- hal_platform_setup.h	2000/02/02 19:57:07	1.4
+++ hal_platform_setup.h	2001/03/01 17:09:50
@@ -59,10 +59,32 @@
 #endif
 
 #define MEM_RESET         0x0B000020  // Write to this location to enable RAM
+#define CYGHWR_HAL_RAM_VADDR 0x0008000
 
+#if defined(CYG_HAL_STARTUP_ROMRAM)
+#define RELOCATE_TEXT_SEGMENT                                          \
+       ldr     r2,=__exception_handlers                               ;\
+       ldr     r3,=CYGMEM_REGION_rom                                   ;\
+       cmp     r2,r3                                                   ;\
+       beq     20f                                                     ;\
+       ldr     r4,=_end                                        ;\
+15:                                                                    ;\
+       ldr     r0, [r3], #4                                            ;\
+       str     r0, [r2], #4                                            ;\
+       cmp     r2, r4                                                  ;\
+       bne     15b                                     ;\
+       b __new_pc ;\
+__new_pc: ;\
+20:
+#else
+#define RELOCATE_TEXT_SEGMENT
+#endif
+
+
 #define PLATFORM_SETUP1                                 \
 	ldr	r0,=MEM_RESET	/* enable RAM */       ;\
-	str	r0,[r0]
+	str	r0,[r0]				       ;\
+	RELOCATE_TEXT_SEGMENT
 
 /*---------------------------------------------------------------------------*/
 /* end of hal_platform_setup.h                                               */
Index: hal/arm/pid/current/src/hal_diag.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/pid/current/src/hal_diag.c,v
retrieving revision 1.13
diff -u -r1.13 hal_diag.c
--- hal_diag.c	2001/02/13 01:23:23	1.13
+++ hal_diag.c	2001/03/01 17:09:50
@@ -427,7 +427,7 @@
 // Assumption: all diagnostic output must be GDB packetized unless this is a ROM (i.e.
 // totally stand-alone) system.
 
-#if defined(CYG_HAL_STARTUP_ROM) || !defined(CYGDBG_HAL_DIAG_TO_DEBUG_CHAN)
+#if defined(CYG_HAL_STARTUP_ROMRAM || defined(CYG_HAL_STARTUP_ROM) || !defined(CYGDBG_HAL_DIAG_TO_DEBUG_CHAN)
 #define HAL_DIAG_USES_HARDWARE
 #endif
 

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