diff options
Diffstat (limited to 'c/src/lib/libbsp/bfin/eZKit533')
-rw-r--r-- | c/src/lib/libbsp/bfin/eZKit533/include/bsp.h | 33 | ||||
-rw-r--r-- | c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c | 92 |
2 files changed, 60 insertions, 65 deletions
diff --git a/c/src/lib/libbsp/bfin/eZKit533/include/bsp.h b/c/src/lib/libbsp/bfin/eZKit533/include/bsp.h index 78906dbe26..3eb0635856 100644 --- a/c/src/lib/libbsp/bfin/eZKit533/include/bsp.h +++ b/c/src/lib/libbsp/bfin/eZKit533/include/bsp.h @@ -21,6 +21,8 @@ #ifndef _BSP_H #define _BSP_H +#ifndef ASM + #include <libcpu/bf533.h> #ifdef __cplusplus @@ -126,12 +128,33 @@ void setLED (uint8_t value); */ uint8_t getLED (void); -rtems_isr_entry set_vector( ///< @brief returns old vector */ - rtems_isr_entry handler, ///< @brief isr routine */ - rtems_vector_number vector, ///< @brief vector number */ - int type ///< @brief RTEMS or RAW intr */ +/** + * @brief Install an interrupt handler + * + * This method installs an interrupt handle. + * + * @param[in] handler is the isr routine + * @param[in] vector is the vector number + * @param[in] type indicates whether RTEMS or RAW intr + * + * @return returns old vector + */ +rtems_isr_entry set_vector( + rtems_isr_entry handler, + rtems_vector_number vector, + int type ); +/* + * Internal BSP methods that are used across file boundaries + */ +void Init_RTC(void); + +/* + * Prototype for methods in .S files that are referenced from C. + */ +void bfin_null_isr(void); + /** @} */ /** @} */ @@ -140,4 +163,6 @@ rtems_isr_entry set_vector( ///< @brief returns old vector * } #endif +#endif /* !ASM */ + #endif diff --git a/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c b/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c index 503fb6e7e9..6c7f1d5e35 100644 --- a/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c +++ b/c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c @@ -59,47 +59,12 @@ const unsigned int _icplbs_table[16][2] = { }; /* - * Use the shared implementations of the following routines - */ - -void Init_PLL (void); -void Init_EBIU (void); -void Init_Flags(void); -void Init_RTC (void); - -void null_isr(void); - -/* - * BSP pretasking hook. Called just before drivers are initialized. - * Used to setup libc and install any BSP extensions. - */ - -void bsp_pretasking_hook(void) -{ - bfin_interrupt_init(); -} - -void bsp_start( void ) -{ - /* BSP Hardware Initialization*/ - Init_RTC(); /* Blackfin Real Time Clock initialization */ - Init_PLL(); /* PLL initialization */ - Init_EBIU(); /* EBIU initialization */ - Init_Flags(); /* GPIO initialization */ - - int i=0; - for (i=5;i<16;i++) { - set_vector((rtems_isr_entry)null_isr, i, 1); - } -} - -/* * Init_PLL * * Routine to initialize the PLL. The Ezkit uses a 27 Mhz XTAL. * See "../eZKit533/include/bsp.h" for more information. */ -void Init_PLL (void) +static void Init_PLL (void) { unsigned int n; @@ -117,13 +82,12 @@ void Init_PLL (void) for (n=0; n<200; n++) {} } - /* - * Init_EBIU - * - * Configure extern memory - */ - -void Init_EBIU (void) +/* + * Init_EBIU + * + * Configure extern memory + */ +static void Init_EBIU (void) { /* Configure FLASH */ *((uint32_t*)EBIU_AMBCTL0) = 0x7bb07bb0L; @@ -142,7 +106,7 @@ void Init_EBIU (void) * * Enable LEDs port */ -void Init_Flags(void) +static void Init_Flags(void) { *((uint16_t*)FIO_INEN) = 0x0100; *((uint16_t*)FIO_DIR) = 0x0000; @@ -154,6 +118,29 @@ void Init_Flags(void) } /* + * BSP pretasking hook. Called just before drivers are initialized. + * Used to setup libc and install any BSP extensions. + */ +void bsp_pretasking_hook(void) +{ + bfin_interrupt_init(); +} + +void bsp_start( void ) +{ + /* BSP Hardware Initialization*/ + Init_RTC(); /* Blackfin Real Time Clock initialization */ + Init_PLL(); /* PLL initialization */ + Init_EBIU(); /* EBIU initialization */ + Init_Flags(); /* GPIO initialization */ + + int i=0; + for (i=5;i<16;i++) { + set_vector((rtems_isr_entry)bfin_null_isr, i, 1); + } +} + +/* * Helper Function to use the EzKits LEDS. * Can be used by the Application. */ @@ -169,20 +156,3 @@ uint8_t getLED (void) { return *((uint8_t*)FlashA_PortB_Data); } - -void initCPLB(void) -{ - int i = 0; - unsigned int *addr; - unsigned int *data; - - addr = (unsigned int *)0xffe00100; - data = (unsigned int *)0xffe00200; - - while ( dcplbs_table[i][0] != 0xffffffff ) { - *addr = dcplbs_table[i][0]; - *data = dcplbs_table[i][1]; - addr++; - data++; - } -} |