From 570949e7f457fb453839920d4884bf6370b5d401 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 20 Nov 2013 11:13:04 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6501 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/common/ports/e200/compilers/GCC/vectors.h | 17 ++++++++++++++++- os/rt/ports/e200/chcore.h | 4 ++++ .../e200/compilers/GCC/mk/port_spc56elxx.mk | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/os/common/ports/e200/compilers/GCC/vectors.h b/os/common/ports/e200/compilers/GCC/vectors.h index 1e6ef21de..ce175e652 100644 --- a/os/common/ports/e200/compilers/GCC/vectors.h +++ b/os/common/ports/e200/compilers/GCC/vectors.h @@ -35,6 +35,10 @@ /* Module constants. */ /*===========================================================================*/ +#define INTC_MCR *((volatile uint32_t *)0xfff48000) +#define INTC_CPR *((volatile uint32_t *)0xfff48008) +#define INTC_IACKR *((volatile uint32_t *)0xfff48010) + /*===========================================================================*/ /* Module pre-compile time settings. */ /*===========================================================================*/ @@ -56,7 +60,7 @@ /*===========================================================================*/ #if !defined(__DOXYGEN__) -extern uint32_t _vectors[PPC_VECTORS_NUMBER]; +extern uint32_t _vectors[PPC_NUM_VECTORS]; #endif #ifdef __cplusplus @@ -67,6 +71,17 @@ extern "C" { } #endif +/*===========================================================================*/ +/* Module inline functions. */ +/*===========================================================================*/ + +static inline void intc_init(void) { + + INTC_MCR = 0; + INTC_CPR = 0; + INTC_IACKR = (uint32_t)_vectors; +} + #endif /* _VECTORS_H_ */ /** @} */ diff --git a/os/rt/ports/e200/chcore.h b/os/rt/ports/e200/chcore.h index 7901ed44d..f24a7111e 100644 --- a/os/rt/ports/e200/chcore.h +++ b/os/rt/ports/e200/chcore.h @@ -75,6 +75,7 @@ /* Inclusion of the PPC implementation specific parameters.*/ #include "ppcparams.h" +#include "vectors.h" /*===========================================================================*/ /* Module pre-compile time settings. */ @@ -408,6 +409,9 @@ static inline void port_init(void) { "li %%r3, _IVOR10@l \t\n" "mtIVOR10 %%r3" : : : "r3", "memory"); #endif + + /* Interrupt controller initialization.*/ + intc_init(); } /** diff --git a/os/rt/ports/e200/compilers/GCC/mk/port_spc56elxx.mk b/os/rt/ports/e200/compilers/GCC/mk/port_spc56elxx.mk index 0133e16f3..1237ad3f4 100644 --- a/os/rt/ports/e200/compilers/GCC/mk/port_spc56elxx.mk +++ b/os/rt/ports/e200/compilers/GCC/mk/port_spc56elxx.mk @@ -6,7 +6,8 @@ PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC56ELxx/boot.s \ $(CHIBIOS)/os/common/ports/e200/compilers/GCC/ivor.s \ $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s -PORTINC = ${CHIBIOS}/os/common/ports/e200/devices/SPC56ELxx \ +PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \ + ${CHIBIOS}/os/common/ports/e200/devices/SPC56ELxx \ ${CHIBIOS}/os/rt/ports/e200 \ ${CHIBIOS}/os/rt/ports/e200/compilers/GCC