forked from Imagelibrary/rtems
bsp/ss555: Move libcpu content to bsps
This patch is a part of the BSP source reorganization. Update #3285.
This commit is contained in:
@@ -37,16 +37,16 @@ libbsp_a_SOURCES += startup/tm27supp.c
|
||||
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/exceptions/ppc_exc_print.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/dev/clock.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/dev/console-generic.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/dev/timer.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/start/irq_asm.S
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/start/irq.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/start/irq_init.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/start/raw_exception.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/start/vectors_init.c
|
||||
libbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/start/vectors.S
|
||||
|
||||
libbsp_a_LIBADD = \
|
||||
../../../libcpu/@RTEMS_CPU@/mpc5xx/clock.rel \
|
||||
../../../libcpu/@RTEMS_CPU@/mpc5xx/console-generic.rel \
|
||||
../../../libcpu/@RTEMS_CPU@/mpc5xx/exceptions.rel \
|
||||
../../../libcpu/@RTEMS_CPU@/mpc5xx/irq.rel \
|
||||
../../../libcpu/@RTEMS_CPU@/mpc5xx/timer.rel
|
||||
|
||||
include $(top_srcdir)/../../../../automake/local.am
|
||||
include $(srcdir)/../../../../../../bsps/powerpc/shared/shared.am
|
||||
include $(srcdir)/../../../../../../bsps/powerpc/ss555/headers.am
|
||||
|
||||
@@ -256,3 +256,27 @@ Sample programs:
|
||||
- The loopback, fileio, unilimited, and pppd tests fail due to memory
|
||||
limitations.
|
||||
- The paranoia program dies on a floating-point assist exception.
|
||||
|
||||
Various non-BSP-dependent support routines.
|
||||
|
||||
timer - Support for the RTEMS timer tick, using the Programmable
|
||||
Interval Timer (PIT).
|
||||
|
||||
console-generic - Console support via the on-chip dual SCI port in the QSMCM
|
||||
module.
|
||||
|
||||
exception - Installation and deinstallation of exception handlers, by
|
||||
manipulation of exception vector table.
|
||||
|
||||
irq - Exception handler for all external and decrementer interrupts.
|
||||
Generalized interrupt handler which calls specific handlers
|
||||
via entries in the interrupt connection table. Interrupt
|
||||
connection table maintenance routines. USIU and UIMB
|
||||
interrupt masking and level control.
|
||||
|
||||
timer - Support for RTEMS timer tests, using the PowerPC timebase
|
||||
(TB) registers.
|
||||
|
||||
vectors - Compressed MPC5XX exception vector table, exception handler
|
||||
prologues, default exception handler. Code to initialize
|
||||
table with default handlers.
|
||||
|
||||
@@ -45,41 +45,6 @@ if ppc405
|
||||
## ppc4xx/include
|
||||
endif # ppc405
|
||||
|
||||
|
||||
## mpc5xx
|
||||
EXTRA_DIST += mpc5xx/README
|
||||
if mpc5xx
|
||||
# mpc5xx/clock
|
||||
noinst_PROGRAMS += mpc5xx/clock.rel
|
||||
mpc5xx_clock_rel_SOURCES = mpc5xx/clock/clock.c
|
||||
mpc5xx_clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
mpc5xx_clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
|
||||
|
||||
# mpc5xx/console-generic
|
||||
noinst_PROGRAMS += mpc5xx/console-generic.rel
|
||||
mpc5xx_console_generic_rel_SOURCES = mpc5xx/console-generic/console-generic.c
|
||||
mpc5xx_console_generic_rel_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
mpc5xx_console_generic_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
|
||||
|
||||
# mpc5xx/exceptions
|
||||
noinst_PROGRAMS += mpc5xx/exceptions.rel
|
||||
mpc5xx_exceptions_rel_SOURCES = mpc5xx/exceptions/raw_exception.c
|
||||
mpc5xx_exceptions_rel_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
mpc5xx_exceptions_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
|
||||
|
||||
# mpc5xx/irq
|
||||
noinst_PROGRAMS += mpc5xx/irq.rel
|
||||
mpc5xx_irq_rel_SOURCES = mpc5xx/irq/irq.c mpc5xx/irq/irq_init.c mpc5xx/irq/irq_asm.S
|
||||
mpc5xx_irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
mpc5xx_irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
|
||||
|
||||
# mpc5xx/timer
|
||||
noinst_PROGRAMS += mpc5xx/timer.rel
|
||||
mpc5xx_timer_rel_SOURCES = mpc5xx/timer/timer.c
|
||||
mpc5xx_timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
mpc5xx_timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
|
||||
endif
|
||||
|
||||
if mpc6xx
|
||||
|
||||
# mpc6xx/mmu
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
Various non-BSP-dependent support routines.
|
||||
|
||||
timer - Support for the RTEMS timer tick, using the Programmable
|
||||
Interval Timer (PIT).
|
||||
|
||||
console-generic - Console support via the on-chip dual SCI port in the QSMCM
|
||||
module.
|
||||
|
||||
exception - Installation and deinstallation of exception handlers, by
|
||||
manipulation of exception vector table.
|
||||
|
||||
irq - Exception handler for all external and decrementer interrupts.
|
||||
Generalized interrupt handler which calls specific handlers
|
||||
via entries in the interrupt connection table. Interrupt
|
||||
connection table maintenance routines. USIU and UIMB
|
||||
interrupt masking and level control.
|
||||
|
||||
timer - Support for RTEMS timer tests, using the PowerPC timebase
|
||||
(TB) registers.
|
||||
|
||||
vectors - Compressed MPC5XX exception vector table, exception handler
|
||||
prologues, default exception handler. Code to initialize
|
||||
table with default handlers.
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* mpc505/509 external interrupt controller management.
|
||||
*/
|
||||
|
||||
#include "ictrl.h"
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/score/powerpc.h>
|
||||
|
||||
/*
|
||||
* Internal routines.
|
||||
*/
|
||||
|
||||
static unsigned long volatile *const IRQAND =
|
||||
(unsigned long volatile *const)0x8007EFA4;
|
||||
|
||||
static void nullHandler()
|
||||
{
|
||||
}
|
||||
|
||||
/* Interrupt dispatch table. */
|
||||
static ExtIsrHandler extIrqHandlers[NUM_IRQS] =
|
||||
{
|
||||
nullHandler,
|
||||
nullHandler,
|
||||
nullHandler,
|
||||
nullHandler,
|
||||
nullHandler,
|
||||
nullHandler,
|
||||
nullHandler
|
||||
};
|
||||
|
||||
|
||||
/* RTEMS external interrupt handler. Calls installed external interrupt
|
||||
handlers for every pending external interrupt in turn. */
|
||||
static rtems_isr extIsr_( rtems_vector_number i )
|
||||
{
|
||||
#define BIT_NUMBER(val, bit) \
|
||||
__asm__ volatile ( "cntlzw %0, %1; srawi %0, %0, 1": "=r" (bit) : "r" (val) );
|
||||
|
||||
int bit;
|
||||
(void)i;
|
||||
|
||||
BIT_NUMBER(*IRQAND & IMASK_ALL, bit);
|
||||
while ( bit < NUM_IRQS ) {
|
||||
extIrqHandlers[bit]();
|
||||
BIT_NUMBER(*IRQAND & IMASK_ALL, bit);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Public routines
|
||||
*/
|
||||
|
||||
void extIrqSetHandler(ExtInt interrupt,ExtIsrHandler handler)
|
||||
{
|
||||
extIrqHandlers[interrupt] = handler;
|
||||
}
|
||||
|
||||
void extIsrInit( void )
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
extIrqDisable(IMASK_ALL);
|
||||
for( i = 0; i < NUM_IRQS; i++)
|
||||
extIrqHandlers[i] = nullHandler;
|
||||
set_vector(extIsr_,PPC_IRQ_EXTERNAL,1);
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
#ifndef _ICTRL_H
|
||||
#define _ICTRL_H
|
||||
|
||||
/*
|
||||
* mpc505/509 external interrupt controller management.
|
||||
*
|
||||
* FIXME: should be somehow merged into general RTEMS interrupt
|
||||
* management code.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _SIU_IRQENABLE ((unsigned long volatile *const)0x8007EFA8)
|
||||
#define _SIU_IRQPEND ((unsigned long volatile *const)0x8007EFA0)
|
||||
|
||||
/* Interrupt masks. */
|
||||
enum {
|
||||
IMASK_EXT0 = 0x80000000,
|
||||
IMASK_EXT1 = 0x20000000,
|
||||
IMASK_EXT2 = 0x08000000,
|
||||
IMASK_EXT3 = 0x02000000,
|
||||
IMASK_EXT4 = 0x00800000,
|
||||
IMASK_EXT5 = 0x00200000,
|
||||
IMASK_EXT6 = 0x00080000,
|
||||
IMASK_ALL = IMASK_EXT0 | IMASK_EXT1 | IMASK_EXT2 | IMASK_EXT3 |
|
||||
IMASK_EXT4 | IMASK_EXT5 | IMASK_EXT6
|
||||
};
|
||||
|
||||
/* Interrupt numbers. */
|
||||
typedef enum {
|
||||
IRQ_EXT0,
|
||||
IRQ_EXT1,
|
||||
IRQ_EXT2,
|
||||
IRQ_EXT3,
|
||||
IRQ_EXT4,
|
||||
IRQ_EXT5,
|
||||
IRQ_EXT6,
|
||||
NUM_IRQS
|
||||
} ExtInt;
|
||||
|
||||
/* Type of external interrupt handlers */
|
||||
typedef void (*ExtIsrHandler) (void);
|
||||
|
||||
/* Initialization. Must be called once after RTEMS interrupts sybsystem
|
||||
is initiailized. 'predriver_hook' is one of such places. */
|
||||
extern void extIsrInit( void );
|
||||
|
||||
/* Set interrupt handler 'handler' for external interrupt number
|
||||
'interrupt'. */
|
||||
extern void extIrqSetHandler(ExtInt interrupt, ExtIsrHandler handler);
|
||||
|
||||
/* Check is external interrupt 'irq' (IMASK_XXXX) is pended. */
|
||||
#define extIrqIsSet(irq) \
|
||||
(*_SIU_IRQPEND & (irq))
|
||||
|
||||
/* Enable external interrupt 'irq' (IMASK_XXXX) processing. */
|
||||
#define extIrqEnable(irq) \
|
||||
(*_SIU_IRQENABLE |= (irq))
|
||||
|
||||
/* Disable external interrupt 'irq' (IMASK_XXXX) processing. */
|
||||
#define extIrqDisable(irq) \
|
||||
(*_SIU_IRQENABLE &= ~(irq))
|
||||
|
||||
/* Check if external interrupt 'irq' (IMASK_XXXX) processing is
|
||||
enabled. */
|
||||
#define extIrqGetEnable \
|
||||
(*_SIU_IRQENABLE)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ICTRL_H */
|
||||
Reference in New Issue
Block a user