Ticket #2020: 0001-Updates-for-ppc440.patch
File 0001-Updates-for-ppc440.patch, 29.4 KB (added by Ric Claus, on 02/17/12 at 21:58:27) |
---|
-
c/src/lib/libbsp/powerpc/acinclude.m4
From 8018b975d9afd97d7ba81c0a43b42ba5539f197a Mon Sep 17 00:00:00 2001 From: Ric Claus <claus@SLAC.Stanford.edu> Date: Fri, 17 Feb 2012 13:25:54 -0800 Subject: [PATCH 1/7] Updates for ppc440 --- c/src/lib/libbsp/powerpc/acinclude.m4 | 4 + c/src/lib/libbsp/shared/bootcard.c | 4 +- c/src/lib/libcpu/powerpc/README | 3 +- c/src/lib/libcpu/powerpc/configure.ac | 9 +- .../new-exceptions/bspsupport/ppc_exc_categories.c | 35 +++++++-- .../new-exceptions/bspsupport/ppc_exc_initialize.c | 38 ++++++++- .../powerpc/new-exceptions/bspsupport/vectors.h | 10 ++- c/src/lib/libcpu/powerpc/ppc403/clock/clock.c | 86 +++++++++++++++++--- c/src/lib/libcpu/powerpc/rtems/powerpc/debugmod.h | 4 +- c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h | 15 +++- c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c | 12 ++- c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h | 18 ++++- cpukit/score/cpu/powerpc/rtems/asm.h | 79 ++++++++++++++++++- 13 files changed, 276 insertions(+), 41 deletions(-) diff --git a/c/src/lib/libbsp/powerpc/acinclude.m4 b/c/src/lib/libbsp/powerpc/acinclude.m4 index 871d345..52e9c3f 100644
a b AC_DEFUN([RTEMS_CHECK_BSPDIR], 36 36 AC_CONFIG_SUBDIRS([tqm8xx]);; 37 37 virtex ) 38 38 AC_CONFIG_SUBDIRS([virtex]);; 39 virtex4 ) 40 AC_CONFIG_SUBDIRS([virtex4]);; 41 virtex5 ) 42 AC_CONFIG_SUBDIRS([virtex5]);; 39 43 *) 40 44 AC_MSG_ERROR([Invalid BSP]);; 41 45 esac -
c/src/lib/libbsp/shared/bootcard.c
diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c index 939a206..9b7a781 100644
a b 46 46 * found in the file LICENSE in this distribution or at 47 47 * http://www.rtems.com/license/LICENSE. 48 48 * 49 * $Id $49 * $Id:$ 50 50 */ 51 51 52 52 #include <rtems.h> … … int boot_card( 214 214 ); 215 215 216 216 /* 217 * All BSP to do any required initialization now that RTEMS217 * Call BSP to do any required initialization now that RTEMS 218 218 * data structures are initialized. In older BSPs or those 219 219 * which do not use the shared framework, this is the typical 220 220 * time when the C Library is initialized so malloc() -
c/src/lib/libcpu/powerpc/README
diff --git a/c/src/lib/libcpu/powerpc/README b/c/src/lib/libcpu/powerpc/README index 57ac52a..8800ddf 100644
a b 1 1 # 2 # $Id $2 # $Id:$ 3 3 # 4 4 5 5 This hierarchy contains support routines for some of … … family members using the new exception processing model: 22 22 + mpc860 23 23 + mpc8260 24 24 + ppc405 25 + ppc440 25 26 26 27 Note that because of similarities in various family members, 27 28 the mpc823 should be able to use the mpc821 code and the -
c/src/lib/libcpu/powerpc/configure.ac
diff --git a/c/src/lib/libcpu/powerpc/configure.ac b/c/src/lib/libcpu/powerpc/configure.ac index d799bd2..a64d0b1 100644
a b 1 1 # Process this file with autoconf to produce a configure script. 2 2 # 3 # $Id $3 # $Id:$ 4 4 5 5 ## 6 6 # … … AM_CONDITIONAL(shared, \ 41 41 || test "$RTEMS_CPU_MODEL" = "ppc603e" \ 42 42 || test "$RTEMS_CPU_MODEL" = "ppc403" \ 43 43 || test "$RTEMS_CPU_MODEL" = "ppc405" \ 44 || test "$RTEMS_CPU_MODEL" = "ppc440" \ 44 45 || test "$RTEMS_CPU_MODEL" = "mpc604" \ 45 46 || test "$RTEMS_CPU_MODEL" = "mpc6xx" \ 46 47 || test "$RTEMS_CPU_MODEL" = "mpc8xx" \ … … AM_CONDITIONAL(mpc8xx, test "$RTEMS_CPU_MODEL" = "mpc8xx" \ 72 73 AM_CONDITIONAL(mpc8260, test "$RTEMS_CPU_MODEL" = "mpc8260") 73 74 AM_CONDITIONAL(mpc83xx, test "$RTEMS_CPU_MODEL" = "mpc83xx") 74 75 75 # the ppc405 shares files with the ppc403 76 AM_CONDITIONAL(ppc403,[test "$RTEMS_CPU_MODEL" = "ppc403" \ 77 || test "$RTEMS_CPU_MODEL" = "ppc405"]) 76 # the ppc405 and ppc440 share files with the ppc403 77 AM_CONDITIONAL(ppc403, test "$RTEMS_CPU_MODEL" = "ppc403") 78 78 AM_CONDITIONAL(ppc405, test "$RTEMS_CPU_MODEL" = "ppc405") 79 AM_CONDITIONAL(ppc440, test "$RTEMS_CPU_MODEL" = "ppc440") 79 80 80 81 AM_CONDITIONAL(e500, test "$RTEMS_CPU_MODEL" = "e500") 81 82 -
c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_categories.c
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_categories.c b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_categories.c index d71ba7b..5ebcb5e 100644
a b 25 25 * found in found in the file LICENSE in this distribution or at 26 26 * http://www.rtems.com/license/LICENSE. 27 27 * 28 * $Id $28 * $Id:$ 29 29 */ 30 30 31 31 #include <bsp/vectors.h> … … static const ppc_exc_categories ppc_405_category_table = { 56 56 [ASM_PROG_VECTOR] = PPC_EXC_CLASSIC, 57 57 [ASM_FLOAT_VECTOR] = PPC_EXC_CLASSIC, 58 58 59 [ASM_PPC405_APU_UNAVAIL_VECTOR] = PPC_EXC_CLASSIC,60 61 59 [ASM_SYS_VECTOR] = PPC_EXC_CLASSIC, 62 60 61 [ASM_PPC405_APU_UNAVAIL_VECTOR] = PPC_EXC_CLASSIC, 62 63 63 [ASM_BOOKE_DEC_VECTOR] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC, 64 64 [ASM_BOOKE_FIT_VECTOR] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC, 65 65 [ASM_BOOKE_WDOG_VECTOR] = PPC_EXC_405_CRITICAL | PPC_EXC_ASYNC, … … static const ppc_exc_categories ppc_405_category_table = { 68 68 [ASM_TRACE_VECTOR] = PPC_EXC_405_CRITICAL, 69 69 }; 70 70 71 static const ppc_exc_categories ppc_booke_category_table = { 72 [ASM_BOOKE_CRIT_VECTOR] = PPC_EXC_BOOKE_CRITICAL | PPC_EXC_ASYNC, 73 [ASM_MACH_VECTOR] = PPC_EXC_E500_MACHCHK, 74 [ASM_PROT_VECTOR] = PPC_EXC_CLASSIC, 75 [ASM_ISI_VECTOR] = PPC_EXC_CLASSIC, 76 [ASM_EXT_VECTOR] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC, 77 [ASM_ALIGN_VECTOR] = PPC_EXC_CLASSIC, 78 [ASM_PROG_VECTOR] = PPC_EXC_CLASSIC, 79 [ASM_FLOAT_VECTOR] = PPC_EXC_CLASSIC, 80 [ASM_SYS_VECTOR] = PPC_EXC_CLASSIC, 81 [ASM_BOOKE_APU_VECTOR] = PPC_EXC_CLASSIC, 82 [ASM_BOOKE_DEC_VECTOR] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC, 83 [ASM_BOOKE_FIT_VECTOR] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC, 84 [ASM_BOOKE_WDOG_VECTOR] = PPC_EXC_BOOKE_CRITICAL | PPC_EXC_ASYNC, 85 [ASM_BOOKE_DTLBMISS_VECTOR] = PPC_EXC_CLASSIC, 86 [ASM_BOOKE_ITLBMISS_VECTOR] = PPC_EXC_CLASSIC, 87 [ASM_BOOKE_DEBUG_VECTOR] = PPC_EXC_BOOKE_CRITICAL, 88 }; 89 71 90 static const ppc_exc_categories mpc_5xx_category_table = { 72 91 [ASM_RESET_VECTOR] = PPC_EXC_CLASSIC, 73 92 [ASM_MACH_VECTOR] = PPC_EXC_CLASSIC, … … static const ppc_exc_categories e200_category_table = { 166 185 [ASM_BOOKE_DTLBMISS_VECTOR] = PPC_EXC_CLASSIC, 167 186 168 187 /* FIXME: Depending on HDI0 [DAPUEN] this is a critical or debug exception */ 169 [ASM_ TRACE_VECTOR] = PPC_EXC_CLASSIC |PPC_EXC_BOOKE_CRITICAL,188 [ASM_BOOKE_DEBUG_VECTOR] = PPC_EXC_BOOKE_CRITICAL, 170 189 171 [ASM_E 200_SPE_UNAVAILABLE_VECTOR] = PPC_EXC_CLASSIC,172 [ASM_E 200_SPE_DATA_VECTOR] = PPC_EXC_CLASSIC,173 [ASM_E 200_SPE_ROUND_VECTOR] = PPC_EXC_CLASSIC,190 [ASM_E500_SPE_UNAVAILABLE_VECTOR] = PPC_EXC_CLASSIC, 191 [ASM_E500_EMB_FP_DATA_VECTOR] = PPC_EXC_CLASSIC, 192 [ASM_E500_EMB_FP_ROUND_VECTOR] = PPC_EXC_CLASSIC 174 193 }; 175 194 176 195 static const ppc_exc_categories e300_category_table = { … … const ppc_exc_categories *ppc_exc_categories_for_cpu(ppc_cpu_id_t cpu) 287 306 case PPC_405GP: 288 307 case PPC_405EX: 289 308 return &ppc_405_category_table; 309 case PPC_440: 310 return &ppc_booke_category_table; 290 311 default: 291 312 break; 292 313 } -
c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c index 93f0fb5..7ddcb20 100644
a b 21 21 * found in found in the file LICENSE in this distribution or at 22 22 * http://www.rtems.com/license/LICENSE. 23 23 * 24 * $Id $24 * $Id:$ 25 25 */ 26 26 27 27 #include <rtems.h> … … uint32_t ppc_exc_cache_wb_check = 1; 33 33 #define MTIVPR(prefix) asm volatile ("mtivpr %0" : : "r" (prefix)) 34 34 #define MTIVOR(x, vec) asm volatile ("mtivor"#x" %0" : : "r" (vec)) 35 35 36 static void ppc_exc_initialize_booke(void) 37 { 38 /* Interrupt vector prefix register */ 39 MTIVPR(ppc_exc_vector_base); 40 41 /* Interrupt vector offset registers */ 42 MTIVOR(0, ppc_exc_vector_address(ASM_BOOKE_CRIT_VECTOR)); 43 MTIVOR(1, ppc_exc_vector_address(ASM_MACH_VECTOR)); 44 MTIVOR(2, ppc_exc_vector_address(ASM_PROT_VECTOR)); 45 MTIVOR(3, ppc_exc_vector_address(ASM_ISI_VECTOR)); 46 MTIVOR(4, ppc_exc_vector_address(ASM_EXT_VECTOR)); 47 MTIVOR(5, ppc_exc_vector_address(ASM_ALIGN_VECTOR)); 48 MTIVOR(6, ppc_exc_vector_address(ASM_PROG_VECTOR)); 49 MTIVOR(7, ppc_exc_vector_address(ASM_FLOAT_VECTOR)); 50 MTIVOR(8, ppc_exc_vector_address(ASM_SYS_VECTOR)); 51 MTIVOR(9, ppc_exc_vector_address(ASM_BOOKE_APU_VECTOR)); 52 MTIVOR(10, ppc_exc_vector_address(ASM_BOOKE_DEC_VECTOR)); 53 MTIVOR(11, ppc_exc_vector_address(ASM_BOOKE_FIT_VECTOR)); 54 MTIVOR(12, ppc_exc_vector_address(ASM_BOOKE_WDOG_VECTOR)); 55 MTIVOR(13, ppc_exc_vector_address(ASM_BOOKE_DTLBMISS_VECTOR)); 56 MTIVOR(14, ppc_exc_vector_address(ASM_BOOKE_ITLBMISS_VECTOR)); 57 MTIVOR(15, ppc_exc_vector_address(ASM_BOOKE_DEBUG_VECTOR)); 58 MTIVOR(32, ppc_exc_vector_address(ASM_E500_SPE_UNAVAILABLE_VECTOR)); 59 MTIVOR(33, ppc_exc_vector_address(ASM_E500_EMB_FP_DATA_VECTOR)); 60 MTIVOR(34, ppc_exc_vector_address(ASM_E500_EMB_FP_ROUND_VECTOR)); 61 MTIVOR(35, ppc_exc_vector_address(ASM_E500_PERFMON_VECTOR)); 62 } 63 36 64 static void ppc_exc_initialize_e500(void) 37 65 { 38 66 /* Interupt vector prefix register */ … … rtems_status_code ppc_exc_initialize( 141 169 /* Need vector unit enabled to save/restore altivec context */ 142 170 ppc_exc_msr_bits |= MSR_VE; 143 171 #endif 144 145 if (ppc_cpu_is(PPC_e200z1) || 172 173 if (ppc_cpu_is(PPC_e200z1) || 146 174 ppc_cpu_is(PPC_e200z6)) { 147 175 ppc_exc_initialize_e200(); 148 } else if (ppc_cpu_is_bookE() == PPC_BOOKE_STD || ppc_cpu_is_bookE() == PPC_BOOKE_E500) { 176 } else if (ppc_cpu_is_bookE() == PPC_BOOKE_STD) { 177 ppc_exc_initialize_booke(); 178 } else if ( ppc_cpu_is_bookE() == PPC_BOOKE_E500) { 149 179 ppc_exc_initialize_e500(); 150 180 } 151 181 -
c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h index e34255e..ef0440a 100644
a b 29 29 * found in found in the file LICENSE in this distribution or at 30 30 * http://www.rtems.com/license/LICENSE. 31 31 * 32 * $Id $32 * $Id:$ 33 33 */ 34 34 35 35 /* DO NOT INTRODUCE #ifdef <cpu_flavor> in this file */ … … extern "C" { 74 74 #define ASM_BOOKE_DTLBMISS_VECTOR 0x12 75 75 #define ASM_BOOKE_FIT_VECTOR 0x13 76 76 #define ASM_BOOKE_WDOG_VECTOR 0x14 77 #define ASM_BOOKE_APU_VECTOR 0x18 78 #define ASM_BOOKE_DEBUG_VECTOR ASM_TRACE_VECTOR 77 79 78 80 #define ASM_PPC405_APU_UNAVAIL_VECTOR ASM_60X_VEC_ASSIST_VECTOR 79 81 … … extern "C" { 121 123 #define ASM_E300_ADDR_VECTOR 0x13 122 124 #define ASM_E300_SYSMGMT_VECTOR 0x14 123 125 126 /* e500 */ 127 #define ASM_E500_SPE_UNAVAILABLE_VECTOR ASM_60X_VEC_VECTOR 128 #define ASM_E500_EMB_FP_DATA_VECTOR 0x19 129 #define ASM_E500_EMB_FP_ROUND_VECTOR 0x1A 130 #define ASM_E500_PERFMON_VECTOR ASM_60X_PERFMON_VECTOR 131 124 132 /* 125 133 * If you change that number make sure to adjust the wrapper code in ppc_exc.S 126 134 * and that ppc_exc_handler_table will be correctly initialized. -
c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
diff --git a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c index 513049e..30f4d6d 100644
a b 34 34 * 35 35 * Modifications for PPC405GP by Dennis Ehlin 36 36 * 37 * $Id $37 * $Id:$ 38 38 */ 39 39 40 40 #include <rtems.h> … … static inline uint32_t get_itimer(void) 72 72 { 73 73 register uint32_t rc; 74 74 75 #if ndef ppc405/* this is a ppc403 */75 #ifdef ppc403 /* this is a ppc403 */ 76 76 asm volatile ("mfspr %0, 0x3dd" : "=r" ((rc))); /* TBLO */ 77 #else /* ppc40 5*/78 asm volatile ("mfspr %0, 0x10c" : "=r" ((rc))); /* 405 GPTBL */79 #endif /* ppc40 5*/77 #else /* ppc403 */ 78 asm volatile ("mfspr %0, 0x10c" : "=r" ((rc))); /* 405, 440 TBL */ 79 #endif /* ppc403 */ 80 80 81 81 return rc; 82 82 } … … void Clock_isr(void* handle) 135 135 /* XXX: count these! this should never happen :-) */ 136 136 } 137 137 138 #ifndef ppc440 138 139 asm volatile ("mtspr 0x3db, %0" :: "r" 139 140 (clicks_til_next_interrupt)); /* PIT */ 141 #else /* Book E */ 142 asm volatile ("mtspr 0x016, %0" :: "r" 143 (clicks_til_next_interrupt)); /* Decrementer */ 144 #endif 140 145 } 141 146 147 /* Clear the Programmable / Decrementer (Book E), Interrupt Status */ 148 #ifndef ppc440 142 149 asm volatile ( "mtspr 0x3d8, %0" :: "r" (0x08000000)); /* TSR */ 150 #else /* Book E */ 151 asm volatile ( "mtspr 0x150, %0" :: "r" (0x08000000)); /* TSR */ 152 #endif 143 153 144 154 Clock_driver_ticks++; 145 155 … … int ClockIsOn(const rtems_irq_connect_data* unused) 160 170 { 161 171 register uint32_t tcr; 162 172 173 #ifndef ppc440 163 174 asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */ 175 #else /* Book E */ 176 asm volatile ("mfspr %0, 0x154" : "=r" ((tcr))); /* TCR */ 177 #endif 164 178 165 179 return (tcr & 0x04000000) != 0; 166 180 } … … void ClockOff( 171 185 { 172 186 register uint32_t tcr; 173 187 188 /* RiC - Wed Feb 9 11:53:04 2011 189 * This appears to be an unprotected read-modify-write. 190 * Is that intentional and okay? 191 */ 192 193 #ifndef ppc440 174 194 asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */ 195 #else /* Book E */ 196 asm volatile ("mfspr %0, 0x154" : "=r" ((tcr))); /* TCR */ 197 #endif 175 198 176 199 tcr &= ~ 0x04400000; 177 200 201 #ifndef ppc440 178 202 asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */ 203 #else /* Book E */ 204 asm volatile ("mtspr 0x154, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */ 205 #endif 179 206 } 180 207 181 208 void ClockOn( … … void ClockOn( 190 217 191 218 Clock_driver_ticks = 0; 192 219 193 #if ndef ppc405/* this is a ppc403 */220 #ifdef ppc403 /* this is a ppc403 */ 194 221 asm volatile ("mfdcr %0, 0xa0" : "=r" (iocr)); /* IOCR */ 195 222 if (bsp_timer_internal_clock) { 196 223 iocr &= ~4; /* timer clocked from system clock */ … … void ClockOn( 214 241 else if ((pvr & 0xff00) == 0x0100) /* 403GB */ 215 242 auto_restart = true; 216 243 217 #else /* ppc405 */ 244 #else /* ppc403 */ 245 # ifdef ppc405 /* ppc405 */ 218 246 asm volatile ("mfdcr %0, 0x0b2" : "=r" (iocr)); /*405GP CPC0_CR1 */ 219 247 if (bsp_timer_internal_clock) { 220 iocr &=~0x800000 ;/* timer clocked from system clock CETE*/248 iocr &=~0x800000; /* timer clocked from system clock CETE*/ 221 249 } 222 250 else { 223 251 iocr |= 0x800000; /* select external timer clock CETE*/ 224 252 } 225 253 asm volatile ("mtdcr 0x0b2, %0" : "=r" (iocr) : "0" (iocr)); /* 405GP CPC0_CR1 */ 226 254 255 #else /* ppc405 */ 256 asm volatile ("mfspr %0, 0x378" : "=r" (iocr)); /* 440 CCR1 */ 257 if (bsp_timer_internal_clock) { 258 iocr &= ~0x00000100; /* timer clocked from system clock CETE */ 259 } 260 else { 261 iocr |= 0x00000100; /* select external timer clock CETE */ 262 } 263 asm volatile ("mtspr 0x378, %0" : "=r" (iocr) : "0" (iocr)); /* 440 CCR1 */ 264 #endif /* ppc405 */ 265 227 266 /* 228 267 * Enable auto restart 229 268 */ 230 269 231 auto_restart =true;270 auto_restart = true; 232 271 233 #endif /* ppc40 5*/272 #endif /* ppc403 */ 234 273 pit_value = rtems_configuration_get_microseconds_per_tick() * 235 274 bsp_clicks_per_usec; 236 275 … … void ClockOn( 238 277 * Set PIT value 239 278 */ 240 279 280 #ifndef ppc440 241 281 asm volatile ("mtspr 0x3db, %0" : : "r" (pit_value)); /* PIT */ 282 #else /* Book E */ 283 asm volatile ("mtspr 0x016, %0" : : "r" (pit_value)); /* Decrementer */ 284 #endif 242 285 243 286 /* 244 287 * Set timer to autoreload, bit TCR->ARE = 1 0x0400000 … … void ClockOn( 246 289 */ 247 290 tick_time = get_itimer() + pit_value; 248 291 292 #ifndef ppc440 249 293 asm volatile ("mfspr %0, 0x3da" : "=r" ((tcr))); /* TCR */ 250 294 tcr = (tcr & ~0x04400000) | (auto_restart ? 0x04400000 : 0x04000000); 251 #if 1252 295 asm volatile ("mtspr 0x3da, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */ 296 #else /* Book E */ 297 asm volatile ("mfspr %0, 0x154" : "=r" ((tcr))); /* TCR */ 298 tcr = (tcr & ~0x04400000) | (auto_restart ? 0x04400000 : 0x04000000); 299 asm volatile ("mtspr 0x154, %0" : "=r" ((tcr)) : "0" ((tcr))); /* TCR */ 253 300 #endif 254 255 301 } 256 302 257 303 … … void Install_clock( 279 325 clockIrqConnData.on = ClockOn; 280 326 clockIrqConnData.off = ClockOff; 281 327 clockIrqConnData.isOn = ClockIsOn; 328 #ifndef ppc440 282 329 clockIrqConnData.name = BSP_PIT; 330 #else 331 clockIrqConnData.name = BSP_DECREMENTER; 332 #endif 283 333 clockIrqConnData.hdl = clock_isr; 284 334 if (!BSP_install_rtems_irq_handler (&clockIrqConnData)) { 285 335 printk("Unable to connect Clock Irq handler\n"); … … ReInstall_clock( 300 350 rtems_interrupt_disable(isrlevel); 301 351 302 352 353 #ifndef ppc440 303 354 clockIrqConnData.name = BSP_PIT; 355 #else 356 clockIrqConnData.name = BSP_DECREMENTER; 357 #endif 304 358 if (!BSP_get_current_rtems_irq_handler(&clockIrqConnData)) { 305 359 printk("Unable to stop system clock\n"); 306 360 rtems_fatal_error_occurred(1); … … ReInstall_clock( 311 365 clockIrqConnData.on = ClockOn; 312 366 clockIrqConnData.off = ClockOff; 313 367 clockIrqConnData.isOn = ClockIsOn; 368 #ifndef ppc440 314 369 clockIrqConnData.name = BSP_PIT; 370 #else 371 clockIrqConnData.name = BSP_DECREMENTER; 372 #endif 315 373 clockIrqConnData.hdl = new_clock_isr; 316 374 317 375 if (!BSP_install_rtems_irq_handler (&clockIrqConnData)) { … … void Clock_exit(void) 335 393 { 336 394 rtems_irq_connect_data clockIrqConnData; 337 395 396 #ifndef ppc440 338 397 clockIrqConnData.name = BSP_PIT; 398 #else 399 clockIrqConnData.name = BSP_DECREMENTER; 400 #endif 339 401 if (!BSP_get_current_rtems_irq_handler(&clockIrqConnData)) { 340 402 printk("Unable to stop system clock\n"); 341 403 rtems_fatal_error_occurred(1); -
c/src/lib/libcpu/powerpc/rtems/powerpc/debugmod.h
diff --git a/c/src/lib/libcpu/powerpc/rtems/powerpc/debugmod.h b/c/src/lib/libcpu/powerpc/rtems/powerpc/debugmod.h index 692a564..b145ebe 100644
a b 35 35 * Note: 36 36 * This file is included by both C and assembler code ( -DASM ) 37 37 * 38 * $Id $38 * $Id:$ 39 39 */ 40 40 41 41 /* … … extern "C" { 78 78 #define PPC_DEBUG_MODEL_SINGLE_STEP_ONLY 2 79 79 #define PPC_DEBUG_MODEL_IBM4xx 3 80 80 81 #elif defined(ppc403) || defined(ppc405) 81 #elif defined(ppc403) || defined(ppc405) || defined(ppc440) 82 82 83 83 #define PPC_DEBUG_MODEL PPC_DEBUG_MODEL_IBM4xx 84 84 -
c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h
diff --git a/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h b/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h index 9609fd1..79cf03a 100644
a b 38 38 * Note: 39 39 * This file is included by both C and assembler code ( -DASM ) 40 40 * 41 * $Id $41 * $Id:$ 42 42 */ 43 43 44 44 … … extern "C" { 137 137 #define PPC_HAS_EXCEPTION_PREFIX 0 138 138 #define PPC_HAS_EVPR 1 139 139 140 #elif defined (ppc440) 141 142 #define PPC_CACHE_ALIGNMENT 32 143 #define PPC_HAS_RI 0 144 #define PPC_HAS_RFCI 1 145 #define PPC_USE_MULTIPLE 1 146 #define PPC_I_CACHE 32768 147 #define PPC_D_CACHE 32768 148 #define PPC_HAS_EXCEPTION_PREFIX 0 149 #define PPC_HAS_EVPR 1 150 140 151 #elif defined(mpc555) 141 152 142 153 /* Copied from mpc505 */ … … extern "C" { 380 391 381 392 #define PPC_IRQ_FIRST PPC_IRQ_SYSTEM_RESET 382 393 383 #if defined(ppc403) || defined(ppc405) 394 #if defined(ppc403) || defined(ppc405) || defined(ppc440) 384 395 385 396 #define PPC_IRQ_CRIT PPC_IRQ_SYSTEM_RESET /*0x00100- Critical int. pin */ 386 397 #define PPC_IRQ_PIT (PPC_STD_IRQ_LAST+1) /*0x01000- Pgm interval timer*/ -
c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c
diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c index 2bc7bfb..39ea5cf 100644
a b 10 10 * found in found in the file LICENSE in this distribution or at 11 11 * http://www.rtems.com/license/LICENSE. 12 12 * 13 * $Id $13 * $Id:$ 14 14 * 15 15 */ 16 16 … … ppc_feature_t current_ppc_features = { 36 36 .has_epic = 0, 37 37 .has_shadowed_gprs = 0, 38 38 .has_ivpr = 0, 39 .has_ivor = 0 39 .has_ivor = 0, 40 .has_hwivor = 0 40 41 }; 41 42 42 43 char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu) … … char *get_ppc_cpu_type_name(ppc_cpu_id_t cpu) 45 46 case PPC_405: return "PPC405"; 46 47 case PPC_405GP: return "PPC405GP"; 47 48 case PPC_405EX: return "PPC405EX"; 49 case PPC_440: return "PPC440"; 48 50 case PPC_601: return "MPC601"; 49 51 case PPC_5XX: return "MPC5XX"; 50 52 case PPC_603: return "MPC603"; … … ppc_cpu_id_t get_ppc_cpu_type(void) 110 112 case PPC_405: 111 113 case PPC_405GP: 112 114 case PPC_405EX: 115 case PPC_440: 113 116 case PPC_601: 114 117 case PPC_5XX: 115 118 case PPC_603: … … ppc_cpu_id_t get_ppc_cpu_type(void) 153 156 case PPC_7400: 154 157 /* NOTE: PSIM PVR doesn't tell us anything (its 155 158 * contents are not set based on what model 156 * the useschooses but has to be programmed via159 * the user chooses but has to be programmed via 157 160 * the device file with the special value 0xfffe 158 161 * telling us that we have a 'psim cpu'). 159 162 * … … ppc_cpu_id_t get_ppc_cpu_type(void) 185 188 case PPC_405EX: 186 189 current_ppc_features.is_bookE = PPC_BOOKE_405; 187 190 break; 191 case PPC_440: 192 current_ppc_features.is_bookE = PPC_BOOKE_STD; 188 193 case PPC_8540: 189 194 case PPC_e200z0: 190 195 case PPC_e200z1: … … ppc_cpu_id_t get_ppc_cpu_type(void) 221 226 current_ppc_features.has_hwivor = 1; 222 227 break; 223 228 case PPC_e200z6: 229 case PPC_440: 224 230 current_ppc_features.has_ivpr = 1; 225 231 current_ppc_features.has_ivor = 1; 226 232 break; -
c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h
diff --git a/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h b/c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h index 0e64af8..37427b9 100644
a b 10 10 * found in found in the file LICENSE in this distribution or at 11 11 * http://www.rtems.com/license/LICENSE. 12 12 * 13 * $Id $13 * $Id:$ 14 14 */ 15 15 16 16 #ifndef _LIBCPU_CPUIDENT_H … … typedef enum 35 35 PPC_604e = 0x9, 36 36 PPC_604r = 0xA, 37 37 PPC_7400 = 0xC, 38 PPC_405 = 0x2001, 38 PPC_405 = 0x2001, /* Xilinx Virtex-II Pro or -4 */ 39 39 PPC_405EX = 0x1291, /* + 405EXr */ 40 40 PPC_405GP = 0x4011, /* + 405CR */ 41 41 PPC_405GPr = 0x5091, 42 42 PPC_405EZ = 0x4151, 43 43 PPC_405EP = 0x5121, 44 PPC_440 = 0x7ff2, /* Xilinx Virtex-5*/ 44 45 PPC_7455 = 0x8001, /* Kate Feng */ 45 46 PPC_7457 = 0x8002, 46 47 PPC_620 = 0x16, … … static inline ppc_cpu_id_t ppc_cpu_current(void) 129 130 return current_ppc_cpu; 130 131 } 131 132 133 static inline bool ppc_cpu_is_e200() 134 { 135 return ppc_cpu_current() == PPC_e200z0 136 || ppc_cpu_current() == PPC_e200z1 137 || ppc_cpu_current() == PPC_e200z6; 138 } 139 132 140 static inline bool ppc_cpu_is_e300() 133 141 { 134 142 if (ppc_cpu_current() == PPC_UNKNOWN) { … … static inline bool ppc_cpu_is_e300() 139 147 || ppc_cpu_current() == PPC_e300c3; 140 148 } 141 149 150 static inline bool ppc_cpu_is_e500() 151 { 152 return ppc_cpu_current() == PPC_8540; 153 /* || ppc_cpu_current() == PPC_e500v2; */ 154 } 155 142 156 static inline bool ppc_cpu_is(ppc_cpu_id_t cpu) 143 157 { 144 158 return ppc_cpu_current() == cpu; -
cpukit/score/cpu/powerpc/rtems/asm.h
diff --git a/cpukit/score/cpu/powerpc/rtems/asm.h b/cpukit/score/cpu/powerpc/rtems/asm.h index d54c060..e6b90ec 100644
a b 25 25 * COPYRIGHT (c) 1994. 26 26 * On-Line Applications Research Corporation (OAR). 27 27 * 28 * $Id $28 * $Id:$ 29 29 */ 30 30 31 31 #ifndef _RTEMS_ASM_H … … 204 204 #define br5 0x085 /* DCR: memory bank register 5 */ 205 205 #define br6 0x086 /* DCR: memory bank register 6 */ 206 206 #define br7 0x087 /* DCR: memory bank register 7 */ 207 208 #elif defined(ppc440) 209 #define xer 0x001 /* SPR: Integer Exception Register */ 210 #define lr 0x008 /* SPR: Link Register */ 211 #define ctr 0x009 /* SPR: Count Register */ 212 #define pid 0x030 /* SPR: Process ID */ 213 #define decar 0x036 /* SPR: Decrementer Auto-Reload */ 214 #define dear 0x03d /* SPR: Data Exception Address Register */ 215 #define esr 0x03e /* SPR: Exception Syndrome Register */ 216 #define ivpr 0x03f /* SPR: Interrupt Vector Prefix Register */ 217 #define sprg4_w 0x104 /* SPR: Special Purpose Register General 4 (WO) */ 218 #define sprg5_w 0x105 /* SPR: Special Purpose Register General 5 (WO) */ 219 #define sprg6_w 0x107 /* SPR: Special Purpose Register General 6 (WO) */ 220 #define sprg7_w 0x108 /* SPR: Special Purpose Register General 7 (WO) */ 221 #define tbl 0x10c /* SPR: Time Base Lower */ 222 #define tbu 0x10d /* SPR: Time Base Upper */ 223 #define pir 0x11e /* SPR: Processor ID Register */ 224 #define pvr 0x11f /* SPR: Processor Version Register */ 225 #define dbsr 0x130 /* SPR: Debug Status Register */ 226 #define dbcr0 0x134 /* SPR: Debug Control Register 0 */ 227 #define dbcr1 0x135 /* SPR: Debug Control Register 1 */ 228 #define dbcr2 0x136 /* SPR: Debug Control Register 2 */ 229 #define iac1 0x138 /* SPR: Instruction Address Compare 1 */ 230 #define iac2 0x139 /* SPR: Instruction Address Compare 2 */ 231 #define iac3 0x13a /* SPR: Instruction Address Compare 3 */ 232 #define iac4 0x13b /* SPR: Instruction Address Compare 4 */ 233 #define dac1 0x13c /* SPR: Data Address Compare 1 */ 234 #define dac2 0x13d /* SPR: Data Address Compare 2 */ 235 #define dvc1 0x13e /* SPR: Data Value Compare 1 */ 236 #define dvc2 0x13f /* SPR: Data Value Compare 2 */ 237 #define tsr 0x150 /* SPR: Timer Status Register */ 238 #define tcr 0x154 /* SPR: Timer Control Register */ 239 #define ivor0 0x190 /* SPR: Interrupt Vector Offset Register 0 */ 240 #define ivor1 0x191 /* SPR: Interrupt Vector Offset Register 1 */ 241 #define ivor2 0x192 /* SPR: Interrupt Vector Offset Register 2 */ 242 #define ivor3 0x193 /* SPR: Interrupt Vector Offset Register 3 */ 243 #define ivor4 0x194 /* SPR: Interrupt Vector Offset Register 4 */ 244 #define ivor5 0x195 /* SPR: Interrupt Vector Offset Register 5 */ 245 #define ivor6 0x196 /* SPR: Interrupt Vector Offset Register 6 */ 246 #define ivor7 0x197 /* SPR: Interrupt Vector Offset Register 7 */ 247 #define ivor8 0x198 /* SPR: Interrupt Vector Offset Register 8 */ 248 #define ivor9 0x199 /* SPR: Interrupt Vector Offset Register 9 */ 249 #define ivor10 0x19a /* SPR: Interrupt Vector Offset Register 10 */ 250 #define ivor11 0x19b /* SPR: Interrupt Vector Offset Register 11 */ 251 #define ivor12 0x19c /* SPR: Interrupt Vector Offset Register 12 */ 252 #define ivor13 0x19d /* SPR: Interrupt Vector Offset Register 13 */ 253 #define ivor14 0x19e /* SPR: Interrupt Vector Offset Register 14 */ 254 #define ivor15 0x19f /* SPR: Interrupt Vector Offset Register 15 */ 255 #define mcsr 0x23c /* SPR: Machine Check Status Register */ 256 #define inv0 0x370 /* SPR: Instruction Cache Normal Victim 0 */ 257 #define inv1 0x371 /* SPR: Instruction Cache Normal Victim 1 */ 258 #define inv2 0x372 /* SPR: Instruction Cache Normal Victim 2 */ 259 #define inv3 0x373 /* SPR: Instruction Cache Normal Victim 3 */ 260 #define itv0 0x374 /* SPR: Instruction Cache Transient Victim 0 */ 261 #define itv1 0x375 /* SPR: Instruction Cache Transient Victim 1 */ 262 #define itv2 0x376 /* SPR: Instruction Cache Transient Victim 2 */ 263 #define itv3 0x377 /* SPR: Instruction Cache Transient Victim 3 */ 264 #define ccr1 0x378 /* SPR: Core Configuration Register 1 */ 265 #define dnv0 0x390 /* SPR: Data Cache Normal Victim 0 */ 266 #define dnv1 0x391 /* SPR: Data Cache Normal Victim 1 */ 267 #define dnv2 0x392 /* SPR: Data Cache Normal Victim 2 */ 268 #define dnv3 0x393 /* SPR: Data Cache Normal Victim 3 */ 269 #define dtv0 0x394 /* SPR: Data Cache Transient Victim 0 */ 270 #define dtv1 0x395 /* SPR: Data Cache Transient Victim 1 */ 271 #define dtv2 0x396 /* SPR: Data Cache Transient Victim 2 */ 272 #define dtv3 0x397 /* SPR: Data Cache Transient Victim 3 */ 273 #define dvlim 0x398 /* SPR: Data Cache Victim Limit */ 274 #define ivlim 0x399 /* SPR: Instruction Cache Victim Limit */ 275 #define rstcfg 0x39b /* SPR: Reset Configuration */ 276 #define dcdbtrl 0x39c /* SPR: Data Cache Debug Tag Register Low */ 277 #define dcdbtrh 0x39d /* SPR: Data Cache Debug Tag Register High */ 278 #define icdbtrl 0x39e /* SPR: Instruction Cache Debug Tag Register Low */ 279 #define icdbtrh 0x39f /* SPR: Instruction Cache Debug Tag Register High */ 280 #define mmucr 0x3b2 /* SPR: Memory Management Unit Control Register */ 281 #define ccr0 0x3b3 /* SPR: Core Configuration Register 0 */ 282 #define icdbdr 0x3d3 /* SPR: Instruction Cache Debug Data Register */ 283 #define dbdr 0x3f3 /* SPR: Debug Data Register */ 207 284 /* end of IBM400 series register definitions */ 208 285 209 286 #elif defined(mpc555)