bfin libcpu and libbsp: Fix warnings

This commit is contained in:
Joel Sherrill committed 2014-10-16 08:58:47 -05:00
1 parent c28f5033e5
commit ed6365aa08
12 files changed
+225 -338

No files matched your search

+32 -11
View File
@@ -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
@@ -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;
}
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++;
}
/*
* bsp_pretasking_hook
*/
void bsp_pretasking_hook(void)
{
bfin_interrupt_init();
}
void bsp_start( void )
{
int i;
/* 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.
*/
for (i=5;i<16;i++) {
set_vector((rtems_isr_entry)bfin_null_isr, i, 1);
}
}
@@ -1,5 +1,7 @@
/* Console driver for bf537Stamp
*
*/
/*
* Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
* written by Allan Hessenflow <allanh@kallisti.com>
*
+12 -1
View File
@@ -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 */
@@ -97,6 +101,11 @@ rtems_isr_entry set_vector( /* returns old vector */
int type /* RTEMS or RAW intr */
);
/*
* Internal BSP methods that are used across file boundaries
*/
void Init_RTC(void);
/*
* Network driver configuration
*/
@@ -110,4 +119,6 @@ extern int bf537Stamp_network_driver_attach(struct rtems_bsdnet_ifconfig *, int)
}
#endif
#endif /* !ASM */
#endif
@@ -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);
+29 -4
View File
@@ -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
@@ -58,48 +58,13 @@ 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;
@@ -153,6 +117,29 @@ void Init_Flags(void)
*((uint8_t*)FlashA_PortB_Data) = 0x00;
}
/*
* 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++;
}
}
+3 -2
View File
@@ -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;
+1 -1
View File
@@ -37,7 +37,7 @@ static rtems_isr clockISR(rtems_vector_number vector) {
} while (
_Thread_Heir == _Thread_Executing
&& _Thread_Executing->Start.entry_point
== rtems_configuration_get_idle_task()
== (Thread_Entry) rtems_configuration_get_idle_task()
);
#else
rtems_clock_tick();
+2 -1
View File
@@ -1,4 +1,5 @@
/* Real Time Clock Driver for Blackfin
/*
* Real Time Clock Driver for Blackfin
*/
/*
File diff suppressed because it is too large. Load diff
+1
View File
@@ -6,6 +6,7 @@
* This file defines Macros for MMR register common to all Blackfin
* Processors.
*/
/*
* COPYRIGHT (c) 2006 by Atos Automacao Industrial Ltda.
* modified by Alain Schaefer <alain.schaefer@easc.ch>