changeset 2897:5d701b4e0c3b

* cdl/hal_powerpc.cdl: Add CYGHWR_HAL_POWERPC_BOOK_E_FIXED_VECTORS to enable support for fixed vectors. * include/arch.inc: * src/vectors.S: Add support for small fixed sized vector table present on some variants. * src/hal_misc.c (hal_enable_caches): Change test for unified cache to use HAL_CACHE_UNIFIED rather than HAL_UCACHE_ENABLE.
author nickg
date Fri, 07 Aug 2009 09:22:55 +0000
parents 49c89877fba7
children bfb377ab267a
files packages/hal/powerpc/arch/current/ChangeLog packages/hal/powerpc/arch/current/cdl/hal_powerpc.cdl packages/hal/powerpc/arch/current/include/arch.inc packages/hal/powerpc/arch/current/src/hal_misc.c packages/hal/powerpc/arch/current/src/vectors.S
diffstat 5 files changed, 81 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/powerpc/arch/current/ChangeLog
+++ b/packages/hal/powerpc/arch/current/ChangeLog
@@ -1,3 +1,15 @@
+2009-08-07  Nick Garnett  <nickg@ecoscentric.com>
+
+	* cdl/hal_powerpc.cdl: Add CYGHWR_HAL_POWERPC_BOOK_E_FIXED_VECTORS
+	to enable support for fixed vectors.
+
+	* include/arch.inc:
+	* src/vectors.S: Add support for small fixed sized vector table
+	present on some variants.
+
+	* src/hal_misc.c (hal_enable_caches): Change test for unified
+	cache to use HAL_CACHE_UNIFIED rather than HAL_UCACHE_ENABLE.
+
 2009-04-24  Nick Garnett  <nickg@ecoscentric.com>
 
 	* include/hal_arch.h (GDB_Registers): Redefine for Book E
--- a/packages/hal/powerpc/arch/current/cdl/hal_powerpc.cdl
+++ b/packages/hal/powerpc/arch/current/cdl/hal_powerpc.cdl
@@ -162,6 +162,16 @@ cdl_package CYGPKG_HAL_POWERPC {
             exception delivery."
     }
 
+    cdl_option CYGHWR_HAL_POWERPC_BOOK_E_FIXED_VECTORS {
+        display       "Enable Book E fixed vector support"
+        active_if     CYGHWR_HAL_POWERPC_BOOK_E
+        default_value 0
+        description "
+            This option indicates that the Book E variant only supports
+            a fixed sized vector table of 16 bytes each. This requires some
+            extra handling in the HAL."
+    }
+    
     cdl_option CYGHWR_HAL_POWERPC_VECTOR_ALIGNMENT {
         display       "Exception vector aligment"
         flavor        data
--- a/packages/hal/powerpc/arch/current/include/arch.inc
+++ b/packages/hal/powerpc/arch/current/include/arch.inc
@@ -263,15 +263,27 @@ 0:      lwzu    r0,4(r3)
 
 #if defined(CYGSEM_HAL_POWERPC_COPY_VECTORS)
 
+
+#if defined(CYGHWR_HAL_POWERPC_BOOK_E_FIXED_VECTORS)
+        .macro  hal_ivor_init   ivor,handler
+        .endm
+#else	
         .macro  hal_ivor_init   ivor,handler
         lwi     r3,__exception_\handler
         and     r3,r3,r4
         mtspr   \ivor,r3
         .endm
+#endif	
 
         .macro  hal_vectors_init
+
+#if defined(CYGHWR_HAL_POWERPC_BOOK_E_FIXED_VECTORS)
+        lwi     r3,hal_fixed_vectors_base
+        lwi     r4,0xFFFFF000
+#else
         lwi     r3,rom_vectors
         lwi     r4,0xFFFF0000
+#endif
         and     r3,r3,r4
         mtspr   63,r3
 #if defined(CYGHWR_HAL_POWERPC_NEED_VECTORS)
@@ -298,6 +310,40 @@ 0:      lwzu    r0,4(r3)
 #define HAL_VECTORS_INIT_DEFINED
 
 #endif
+		
+#if defined(CYGHWR_HAL_POWERPC_BOOK_E_FIXED_VECTORS)
+
+        .macro  exception_vector_fixed name
+        .p2align 4
+        .globl   exception_vector_fixed\name
+exception_vector_fixed\name:
+        b        __exception_\name
+        .endm
+
+        .macro  hal_fixed_vectors
+hal_fixed_vectors_base:
+        exception_vector_fixed          critical_input
+        exception_vector_fixed          machine_check
+        exception_vector_fixed          data_storage
+        exception_vector_fixed          instruction_storage
+        exception_vector_fixed          external
+        exception_vector_fixed          alignment
+        exception_vector_fixed          program
+        exception_vector_fixed          floatingpoint_unavailable
+        exception_vector_fixed          system_call
+        exception_vector_fixed          ap_unavailable 
+        exception_vector_fixed          decrementer
+        exception_vector_fixed          interval_timer
+        exception_vector_fixed          watchdog
+        exception_vector_fixed          data_tlb_miss
+        exception_vector_fixed          instruction_tlb_miss
+        exception_vector_fixed          debug  
+        .endm
+
+#define HAL_FIXED_VECTORS_DEFINED
+
+#endif  
+
 
 #endif // !defined(CYGHWR_HAL_POWERPC_BOOK_E)
 
@@ -309,6 +355,13 @@ 0:      lwzu    r0,4(r3)
 
 #endif        
 
+#ifndef HAL_FIXED_VECTORS_DEFINED
+
+        .macro   hal_fixed_vectors
+        .endm
+        
+#endif        
+
 #------------------------------------------------------------------------------
 # end of arch.inc
 
--- a/packages/hal/powerpc/arch/current/src/hal_misc.c
+++ b/packages/hal/powerpc/arch/current/src/hal_misc.c
@@ -301,7 +301,7 @@ hal_MMU_init (void)
 externC void
 hal_enable_caches(void)
 {
-#ifndef HAL_UCACHE_ENABLE
+#ifndef HAL_CACHE_UNIFIED
         
 #if !(defined(CYG_HAL_STARTUP_RAM) || defined(CYG_HAL_STARTUP_JTAG))
     // Invalidate caches
@@ -330,7 +330,7 @@ hal_enable_caches(void)
 #endif
 #endif
 
-#else // HAL_UCACHE_ENABLE
+#else // HAL_CACHE_UNIFIED
 
 
 #if !(defined(CYG_HAL_STARTUP_RAM) || defined(CYG_HAL_STARTUP_JTAG))
@@ -346,7 +346,7 @@ hal_enable_caches(void)
 
 #endif
     
-#endif // HAL_UCACHE_ENABLE
+#endif // HAL_CACHE_UNIFIED
     
 }
 
--- a/packages/hal/powerpc/arch/current/src/vectors.S
+++ b/packages/hal/powerpc/arch/current/src/vectors.S
@@ -227,7 +227,9 @@
 #ifdef CYG_HAL_FUDGE_VECTOR_ALIGNMENT        
         hal_fudge_vector_alignment
 #endif
-                
+
+        hal_fixed_vectors
+        
 rom_vectors:
         # These are the architecture defined vectors that
         # are always present.