diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-10-14 11:03:38 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-10-16 08:58:47 -0500 |
commit | ed6365aa08fed6dc44d2d1e3876e77bcac44a400 (patch) | |
tree | 8ba9069117d94bb601c95798b1baf2716864a6ce /c/src/lib/libbsp/bfin | |
parent | m68k/gen68340: Fix warnings (diff) | |
download | rtems-ed6365aa08fed6dc44d2d1e3876e77bcac44a400.tar.bz2 |
bfin libcpu and libbsp: Fix warnings
Diffstat (limited to 'c/src/lib/libbsp/bfin')
-rw-r--r-- | c/src/lib/libbsp/bfin/TLL6527M/include/bsp.h | 43 | ||||
-rw-r--r-- | c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c | 123 | ||||
-rw-r--r-- | c/src/lib/libbsp/bfin/bf537Stamp/console/console.c | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/bfin/bf537Stamp/include/bsp.h | 13 | ||||
-rw-r--r-- | c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c | 2 | ||||
-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 | ||||
-rw-r--r-- | c/src/lib/libbsp/bfin/shared/start/start.S | 5 |
8 files changed, 151 insertions, 164 deletions
diff --git a/c/src/lib/libbsp/bfin/TLL6527M/include/bsp.h b/c/src/lib/libbsp/bfin/TLL6527M/include/bsp.h index ab57435649..6efc30ef40 100644 --- a/c/src/lib/libbsp/bfin/TLL6527M/include/bsp.h +++ b/c/src/lib/libbsp/bfin/TLL6527M/include/bsp.h @@ -1,25 +1,23 @@ /** - * @file + * @file bsp.h * @ingroup bfin_tll6527m * @brief Global BSP definitions. + * + * This include file contains all board IO definitions for TLL6527M. */ -/** - *@file bsp.h - * - * This include file contains all board IO definitions for TLL6527M. - * +/* * COPYRIGHT (c) 2010 by ECE Northeastern University. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license */ - #ifndef _BSP_H #define _BSP_H +#ifndef ASM #ifdef __cplusplus extern "C" { @@ -95,16 +93,39 @@ extern "C" { /** @} */ -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); + /** @} */ #ifdef __cplusplus } #endif +#endif /* !ASM */ + #endif diff --git a/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c b/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c index 38c2df4526..07290d4228 100644 --- a/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c +++ b/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c @@ -1,6 +1,6 @@ /* bspstart.c for TLL6527M * - * This routine does the bulk of the system initialisation. + * This routine does the bulk of the system initialization. */ /* @@ -11,7 +11,6 @@ * http://www.rtems.org/license */ - #include <bsp.h> #include <bsp/bootcard.h> #include <cplb.h> @@ -61,62 +60,12 @@ const unsigned int _icplbs_table[16][2] = { { 0xffffffff, 0xffffffff }/* end of section - termination */ }; -void Init_PLL (void); -void Init_EBIU (void); -void Init_Flags(void); -void Init_RTC (void); -void initCPLB(void); - - -void null_isr(void); - /* - * Function: bsp_pretasking_hook - * Created: 95/03/10 - * - * Description: - * BSP pretasking hook. Called just before drivers are initialized. - * Used to setup libc and install any BSP extensions. - * - * NOTES: - * Must not use libc (to do io) from here, since drivers are - * not yet initialized. + * Init_PLL * + * Routine to initialize the PLL. The TLL6527M uses a 25 Mhz XTAL. */ - -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 */ - - /* - * Allocate the memory for the RTEMS Work Space. This can come from - * a variety of places: hard coded address, malloc'ed from outside - * RTEMS world (e.g. simulator or primitive memory manager), or (as - * typically done by stock BSPs) by subtracting the required amount - * of work space from the last physical address on the CPU board. - */ - 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 TLL6527M uses a 25 Mhz XTAL. - */ -void Init_PLL (void) +static void Init_PLL (void) { unsigned short msel = 0; unsigned short ssel = 0; @@ -138,13 +87,12 @@ void Init_PLL (void) asm("sti r0;"); } - /* - * Init_EBIU - * - * Configure extern memory - */ - -void Init_EBIU (void) +/* + * Init_EBIU + * + * Configure extern memory + */ +static void Init_EBIU (void) { /* Check if SDRAM is already enabled */ if ( 0 != (*(uint16_t *)EBIU_SDSTAT & EBIU_SDSTAT_SDRS) ){ @@ -160,12 +108,12 @@ void Init_EBIU (void) } } - /* - * Init_Flags - * - * Enable LEDs port - */ -void Init_Flags(void) +/* + * Init_Flags + * + * Enable LEDs port + */ +static void Init_Flags(void) { *((uint16_t*)PORTH_FER) = 0x0; *((uint16_t*)PORTH_MUX) = 0x0; @@ -173,22 +121,33 @@ void Init_Flags(void) *((uint16_t*)PORTHIO_SET) = 0x1<<15; } +/* + * bsp_pretasking_hook + */ +void bsp_pretasking_hook(void) +{ + bfin_interrupt_init(); +} +void bsp_start( void ) +{ + int i; -void initCPLB(void) { - - int i = 0; - unsigned int *addr; - unsigned int *data; - - addr = (unsigned int *)0xffe00100; - data = (unsigned int *)0xffe00200; + /* BSP Hardware Initialization*/ + Init_RTC(); /* Blackfin Real Time Clock initialization */ + Init_PLL(); /* PLL initialization */ + Init_EBIU(); /* EBIU initialization */ + Init_Flags(); /* GPIO initialization */ - while ( dcplbs_table[i][0] != 0xffffffff ) { - *addr = dcplbs_table[i][0]; - *data = dcplbs_table[i][1]; + /* + * Allocate the memory for the RTEMS Work Space. This can come from + * a variety of places: hard coded address, malloc'ed from outside + * RTEMS world (e.g. simulator or primitive memory manager), or (as + * typically done by stock BSPs) by subtracting the required amount + * of work space from the last physical address on the CPU board. + */ + for (i=5;i<16;i++) { + set_vector((rtems_isr_entry)bfin_null_isr, i, 1); + } - addr++; - data++; - } } diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/console/console.c b/c/src/lib/libbsp/bfin/bf537Stamp/console/console.c index 81f8ce2dab..68d32ce6e4 100644 --- a/c/src/lib/libbsp/bfin/bf537Stamp/console/console.c +++ b/c/src/lib/libbsp/bfin/bf537Stamp/console/console.c @@ -1,5 +1,7 @@ /* Console driver for bf537Stamp - * + */ + +/* * Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA * written by Allan Hessenflow <allanh@kallisti.com> * diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/include/bsp.h b/c/src/lib/libbsp/bfin/bf537Stamp/include/bsp.h index 0b48971dfa..4261c44163 100644 --- a/c/src/lib/libbsp/bfin/bf537Stamp/include/bsp.h +++ b/c/src/lib/libbsp/bfin/bf537Stamp/include/bsp.h @@ -15,6 +15,8 @@ #ifndef _BSP_H #define _BSP_H +#ifndef ASM + #ifdef __cplusplus extern "C" { #endif @@ -89,7 +91,9 @@ void setLED(uint8_t value); /* * Helper Function to use the EzKits LEDS */ -uint8_t getLED(void); +uint8_t getLEDs(void); +void setLEDs(uint8_t value); +uint8_t getButtons(void); rtems_isr_entry set_vector( /* returns old vector */ rtems_isr_entry handler, /* isr routine */ @@ -98,6 +102,11 @@ rtems_isr_entry set_vector( /* returns old vector */ ); /* + * Internal BSP methods that are used across file boundaries + */ +void Init_RTC(void); + +/* * Network driver configuration */ struct rtems_bsdnet_ifconfig; @@ -110,4 +119,6 @@ extern int bf537Stamp_network_driver_attach(struct rtems_bsdnet_ifconfig *, int) } #endif +#endif /* !ASM */ + #endif diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c b/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c index cf7fbf1984..8e77656376 100644 --- a/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c +++ b/c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c @@ -65,8 +65,6 @@ static bfin_mmu_config_t mmuRegions = { } }; -void Init_RTC(void); - static void initPLL(void); static void initEBIU(void); static void initGPIO(void); 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++; - } -} diff --git a/c/src/lib/libbsp/bfin/shared/start/start.S b/c/src/lib/libbsp/bfin/shared/start/start.S index 5106d02f30..3440f5ccc9 100644 --- a/c/src/lib/libbsp/bfin/shared/start/start.S +++ b/c/src/lib/libbsp/bfin/shared/start/start.S @@ -1,6 +1,7 @@ #include <rtems/bfin/bfin.h> +#include <bsp.h> #include <bspopts.h> #ifndef LO @@ -88,7 +89,7 @@ __start: P3 = P4; jump (p0) /* Should not return. */ -.global _null_isr -_null_isr: +.global _bfin_null_isr +_bfin_null_isr: rti; |