forked from Imagelibrary/rtems
@@ -85,6 +85,10 @@ int mbx8xx_console_get_configuration(void);
|
||||
|
||||
void _InitMBX8xx(void);
|
||||
|
||||
int BSP_disconnect_clock_handler(void);
|
||||
|
||||
int BSP_connect_clock_handler (rtems_irq_hdl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -77,24 +77,6 @@ RTEMS_BSPOPTS_HELP([CONS_SCC4_MODE],
|
||||
channel. Set it to CONS_MODE_POLLED for polled operation, CONS_MODE_IRQ for
|
||||
interrupt driven (spooled) operation. Set it to CONS_MODE_UNUSED, if not used])
|
||||
|
||||
RTEMS_BSPOPTS_SET([SPI_BOARD_INIT_FNC],[pghplus],[bsp_pghplus_spi_init])
|
||||
RTEMS_BSPOPTS_SET([SPI_BOARD_INIT_FNC],[*],[bsp_dummy_spi_init])
|
||||
RTEMS_BSPOPTS_HELP([SPI_BOARD_INIT_FNC],
|
||||
[(BSP--SPI board init function) Specify the function that inits the board
|
||||
port lines and further devices.])
|
||||
|
||||
RTEMS_BSPOPTS_SET([SPI_SEND_STOP_FNC],[pghplus],[bsp_pghplus_spi_send_stop])
|
||||
RTEMS_BSPOPTS_SET([SPI_SEND_STOP_FNC],[*],[bsp_dummy_spi_send_stop])
|
||||
RTEMS_BSPOPTS_HELP([SPI_SEND_STOP_FNC],
|
||||
[(BSP--SPI send stop function) Specify the function that deaddresses SPI
|
||||
devices. Set to bsp_dummy_spi_send_stop for dummy implementation])
|
||||
|
||||
RTEMS_BSPOPTS_SET([SPI_SEND_ADDR_FNC],[pghplus],[bsp_pghplus_spi_sel_addr])
|
||||
RTEMS_BSPOPTS_SET([SPI_SEND_ADDR_FNC],[*],[bsp_dummy_spi_sel_addr])
|
||||
RTEMS_BSPOPTS_HELP([SPI_SEND_ADDR_FNC],
|
||||
[(BSP--SPI send address function) Specify the function that addresses SPI
|
||||
devices. Set to bsp_dummy_spi_sel_addr for dummy implementation])
|
||||
|
||||
# add selection of primary network interface
|
||||
RTEMS_BSPOPTS_SET([BSP_USE_NETWORK_FEC],[pghplus],[1])
|
||||
RTEMS_BSPOPTS_SET([BSP_USE_NETWORK_FEC],[*],[0])
|
||||
|
||||
@@ -66,6 +66,7 @@ LINKER_SYMBOL( bsp_work_area_start);
|
||||
#include <rtems.h>
|
||||
#include <rtems/console.h>
|
||||
#include <rtems/clockdrv.h>
|
||||
#include <rtems/irq.h>
|
||||
#include <mpc8xx.h>
|
||||
#include <mpc8xx/cpm.h>
|
||||
#include <mpc8xx/mmu.h>
|
||||
@@ -144,6 +145,24 @@ extern uint32_t BSP_bus_frequency;
|
||||
int BSP_disconnect_clock_handler(void);
|
||||
int BSP_connect_clock_handler (rtems_irq_hdl);
|
||||
|
||||
extern uint32_t bsp_clock_speed;
|
||||
|
||||
char serial_getc(void);
|
||||
|
||||
int serial_tstc(void);
|
||||
|
||||
void serial_init(void);
|
||||
|
||||
int mbx8xx_console_get_configuration(void);
|
||||
|
||||
void _InitTQM8xx (void);
|
||||
|
||||
rtems_status_code bsp_register_spi(void);
|
||||
|
||||
void *bsp_idle_thread( uintptr_t ignored );
|
||||
|
||||
void cpu_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -150,6 +150,8 @@ extern "C" {
|
||||
|
||||
#define BSP_INTERRUPT_VECTOR_MAX BSP_MAX_OFFSET
|
||||
|
||||
extern int BSP_irq_enabled_at_cpm(const rtems_irq_number irqLine);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -35,28 +35,28 @@
|
||||
* functions to enable/disable a source at the SIU/CPM irq controller
|
||||
*/
|
||||
|
||||
rtems_status_code bsp_irq_disable_at_SIU(rtems_vector_number irqnum)
|
||||
static rtems_status_code bsp_irq_disable_at_SIU(rtems_vector_number irqnum)
|
||||
{
|
||||
rtems_vector_number vecnum = irqnum - BSP_SIU_IRQ_LOWEST_OFFSET;
|
||||
m8xx.simask &= ~(1 << (31 - vecnum));
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
rtems_status_code bsp_irq_enable_at_SIU(rtems_vector_number irqnum)
|
||||
static rtems_status_code bsp_irq_enable_at_SIU(rtems_vector_number irqnum)
|
||||
{
|
||||
rtems_vector_number vecnum = irqnum - BSP_SIU_IRQ_LOWEST_OFFSET;
|
||||
m8xx.simask |= (1 << (31 - vecnum));
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
rtems_status_code bsp_irq_disable_at_CPM(rtems_vector_number irqnum)
|
||||
static rtems_status_code bsp_irq_disable_at_CPM(rtems_vector_number irqnum)
|
||||
{
|
||||
rtems_vector_number vecnum = irqnum - BSP_CPM_IRQ_LOWEST_OFFSET;
|
||||
m8xx.cimr &= ~(1 << (vecnum));
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
rtems_status_code bsp_irq_enable_at_CPM(rtems_vector_number irqnum)
|
||||
static rtems_status_code bsp_irq_enable_at_CPM(rtems_vector_number irqnum)
|
||||
{
|
||||
rtems_vector_number vecnum = irqnum - BSP_CPM_IRQ_LOWEST_OFFSET;
|
||||
m8xx.cimr |= (1 << (vecnum));
|
||||
@@ -184,7 +184,7 @@ static int BSP_irq_handle_at_siu( unsigned excNum)
|
||||
/*
|
||||
* Activate the CPIC
|
||||
*/
|
||||
rtems_status_code mpc8xx_cpic_initialize( void)
|
||||
static rtems_status_code mpc8xx_cpic_initialize( void)
|
||||
{
|
||||
/*
|
||||
* mask off all interrupts
|
||||
@@ -204,7 +204,7 @@ rtems_status_code mpc8xx_cpic_initialize( void)
|
||||
/*
|
||||
* Activate the SIU interrupt controller
|
||||
*/
|
||||
rtems_status_code mpc8xx_siu_int_initialize( void)
|
||||
static rtems_status_code mpc8xx_siu_int_initialize( void)
|
||||
{
|
||||
/*
|
||||
* mask off all interrupts
|
||||
@@ -214,7 +214,7 @@ rtems_status_code mpc8xx_siu_int_initialize( void)
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
int mpc8xx_exception_handler(BSP_Exception_frame *frame,
|
||||
static int mpc8xx_exception_handler(BSP_Exception_frame *frame,
|
||||
unsigned exception_number)
|
||||
{
|
||||
return BSP_irq_handle_at_siu(exception_number);
|
||||
|
||||
@@ -626,30 +626,7 @@ int m8xx_spi_ioctl
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static rtems_status_code bsp_dummy_spi_sel_addr
|
||||
(
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Purpose: |
|
||||
| address a slave device on the bus |
|
||||
+---------------------------------------------------------------------------+
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
rtems_libi2c_bus_t *bh, /* bus specifier structure */
|
||||
uint32_t addr, /* address to send on bus */
|
||||
int rw /* 0=write,1=read */
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
| rtems_status_code |
|
||||
\*=========================================================================*/
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static rtems_status_code bsp_dummy_spi_send_start
|
||||
static rtems_status_code bsp_spi_send_start
|
||||
(
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Purpose: |
|
||||
@@ -670,28 +647,7 @@ static rtems_status_code bsp_dummy_spi_send_start
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static rtems_status_code bsp_dummy_spi_send_stop
|
||||
(
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Purpose: |
|
||||
| deselect SPI |
|
||||
+---------------------------------------------------------------------------+
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
rtems_libi2c_bus_t *bh /* bus specifier structure */
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
| o = ok or error code |
|
||||
\*=========================================================================*/
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static rtems_status_code bsp_pghplus_spi_sel_addr
|
||||
static rtems_status_code bsp_spi_sel_addr
|
||||
(
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Purpose: |
|
||||
@@ -740,7 +696,7 @@ static rtems_status_code bsp_pghplus_spi_sel_addr
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static rtems_status_code bsp_pghplus_spi_send_stop
|
||||
static rtems_status_code bsp_spi_send_stop
|
||||
(
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Purpose: |
|
||||
@@ -756,7 +712,7 @@ static rtems_status_code bsp_pghplus_spi_send_stop
|
||||
\*=========================================================================*/
|
||||
{
|
||||
#if defined(DEBUG)
|
||||
printk("bsp_pghplus_spi_send_stop called... ");
|
||||
printk("bsp_spi_send_stop called... ");
|
||||
#endif
|
||||
m8xx.pbdat = (m8xx.pbdat
|
||||
| PGHPLUS_PB_SPI_DISP4_CE_MSK
|
||||
@@ -770,7 +726,7 @@ static rtems_status_code bsp_pghplus_spi_send_stop
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static rtems_status_code bsp_pghplus_spi_init
|
||||
static rtems_status_code bsp_spi_init
|
||||
(
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Purpose: |
|
||||
@@ -790,7 +746,7 @@ static rtems_status_code bsp_pghplus_spi_init
|
||||
int ret_code;
|
||||
|
||||
#if defined(DEBUG)
|
||||
printk("bsp_pghplus_spi_init called... ");
|
||||
printk("bsp_spi_init called... ");
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -842,45 +798,15 @@ static rtems_status_code bsp_pghplus_spi_init
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static rtems_status_code bsp_dummy_spi_init
|
||||
(
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Purpose: |
|
||||
| do board specific init: |
|
||||
| - initialize pins for addressing |
|
||||
| - register further drivers |
|
||||
+---------------------------------------------------------------------------+
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
int spi_busno
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
| o = ok or error code |
|
||||
\*=========================================================================*/
|
||||
{
|
||||
#if defined(DEBUG)
|
||||
printk("bsp_dummy_spi_init called... ");
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
printk("... exit OK\r\n");
|
||||
#endif
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/*=========================================================================*\
|
||||
| list of handlers |
|
||||
\*=========================================================================*/
|
||||
|
||||
rtems_libi2c_bus_ops_t bsp_spi_ops = {
|
||||
init: m8xx_spi_init,
|
||||
send_start: bsp_dummy_spi_send_start,
|
||||
send_stop: SPI_SEND_STOP_FNC,
|
||||
send_addr: SPI_SEND_ADDR_FNC,
|
||||
send_start: bsp_spi_send_start,
|
||||
send_stop: bsp_spi_send_stop,
|
||||
send_addr: bsp_spi_sel_addr,
|
||||
read_bytes: m8xx_spi_read_bytes,
|
||||
write_bytes: m8xx_spi_write_bytes,
|
||||
ioctl: m8xx_spi_ioctl
|
||||
@@ -937,7 +863,7 @@ rtems_status_code bsp_register_spi
|
||||
}
|
||||
spi_busno = ret_code;
|
||||
|
||||
SPI_BOARD_INIT_FNC(spi_busno);
|
||||
bsp_spi_init(spi_busno);
|
||||
/*
|
||||
* FIXME: further drivers, when available
|
||||
*/
|
||||
|
||||
@@ -50,11 +50,6 @@ uint32_t bsp_clicks_per_usec; /* for PIT driver: OSCCLK */
|
||||
uint32_t bsp_timer_average_overhead; /* Average overhead of timer in ticks */
|
||||
uint32_t bsp_timer_least_valid; /* Least valid number from timer */
|
||||
bool bsp_timer_internal_clock; /* TRUE, when timer runs with CPU clk */
|
||||
/*
|
||||
* Use the shared implementations of the following routines.
|
||||
* Look in rtems/c/src/lib/libbsp/shared/bsplibc.c.
|
||||
*/
|
||||
extern void cpu_init( void);
|
||||
|
||||
void BSP_panic( char *s)
|
||||
{
|
||||
@@ -75,6 +70,7 @@ void _BSP_Fatal_error( unsigned n)
|
||||
rtems_interrupt_level level;
|
||||
|
||||
rtems_interrupt_disable( level);
|
||||
(void) level;
|
||||
|
||||
printk( "%s PANIC ERROR %u\n", _RTEMS_version, n);
|
||||
|
||||
@@ -83,7 +79,7 @@ void _BSP_Fatal_error( unsigned n)
|
||||
}
|
||||
}
|
||||
|
||||
const char *bsp_tqm_get_cib_string( const char *cib_id)
|
||||
static const char *bsp_tqm_get_cib_string( const char *cib_id)
|
||||
{
|
||||
char srch_pattern[10] = "";
|
||||
char *fnd_str;
|
||||
@@ -113,7 +109,7 @@ const char *bsp_tqm_get_cib_string( const char *cib_id)
|
||||
}
|
||||
}
|
||||
|
||||
rtems_status_code bsp_tqm_get_cib_uint32( const char *cib_id,
|
||||
static rtems_status_code bsp_tqm_get_cib_uint32( const char *cib_id,
|
||||
uint32_t *result)
|
||||
{
|
||||
const char *item_ptr;
|
||||
|
||||
@@ -47,8 +47,6 @@
|
||||
volatile uint32_t Clock_driver_ticks;
|
||||
extern volatile m8xx_t m8xx;
|
||||
extern int BSP_get_clock_irq_level(void);
|
||||
extern int BSP_connect_clock_handler(rtems_isr_entry);
|
||||
extern int BSP_disconnect_clock_handler(void);
|
||||
extern uint32_t bsp_clicks_per_usec;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user