[PATCH 5/5] bsp/ss555: Move libcpu content to bsps
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Mar 14 07:21:16 UTC 2018
This patch is a part of the BSP source reorganization.
Update #3285.
---
.../clock => bsps/powerpc/ss555/dev}/clock.c | 0
.../powerpc/ss555/dev}/console-generic.c | 0
.../timer => bsps/powerpc/ss555/dev}/timer.c | 0
.../mpc5xx/irq => bsps/powerpc/ss555/start}/irq.c | 0
.../irq => bsps/powerpc/ss555/start}/irq_asm.S | 0
.../irq => bsps/powerpc/ss555/start}/irq_init.c | 0
.../powerpc/ss555/start}/raw_exception.c | 0
c/src/lib/libbsp/powerpc/ss555/Makefile.am | 14 ++--
c/src/lib/libbsp/powerpc/ss555/README | 24 +++++++
c/src/lib/libcpu/powerpc/Makefile.am | 35 ----------
c/src/lib/libcpu/powerpc/mpc5xx/README | 23 -------
c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.c | 68 --------------------
c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.h | 75 ----------------------
13 files changed, 31 insertions(+), 208 deletions(-)
rename {c/src/lib/libcpu/powerpc/mpc5xx/clock => bsps/powerpc/ss555/dev}/clock.c (100%)
rename {c/src/lib/libcpu/powerpc/mpc5xx/console-generic => bsps/powerpc/ss555/dev}/console-generic.c (100%)
rename {c/src/lib/libcpu/powerpc/mpc5xx/timer => bsps/powerpc/ss555/dev}/timer.c (100%)
rename {c/src/lib/libcpu/powerpc/mpc5xx/irq => bsps/powerpc/ss555/start}/irq.c (100%)
rename {c/src/lib/libcpu/powerpc/mpc5xx/irq => bsps/powerpc/ss555/start}/irq_asm.S (100%)
rename {c/src/lib/libcpu/powerpc/mpc5xx/irq => bsps/powerpc/ss555/start}/irq_init.c (100%)
rename {c/src/lib/libcpu/powerpc/mpc5xx/exceptions => bsps/powerpc/ss555/start}/raw_exception.c (100%)
delete mode 100644 c/src/lib/libcpu/powerpc/mpc5xx/README
delete mode 100644 c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.c
delete mode 100644 c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.h
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/clock/clock.c b/bsps/powerpc/ss555/dev/clock.c
similarity index 100%
rename from c/src/lib/libcpu/powerpc/mpc5xx/clock/clock.c
rename to bsps/powerpc/ss555/dev/clock.c
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c b/bsps/powerpc/ss555/dev/console-generic.c
similarity index 100%
rename from c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c
rename to bsps/powerpc/ss555/dev/console-generic.c
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c b/bsps/powerpc/ss555/dev/timer.c
similarity index 100%
rename from c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
rename to bsps/powerpc/ss555/dev/timer.c
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/irq/irq.c b/bsps/powerpc/ss555/start/irq.c
similarity index 100%
rename from c/src/lib/libcpu/powerpc/mpc5xx/irq/irq.c
rename to bsps/powerpc/ss555/start/irq.c
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/irq/irq_asm.S b/bsps/powerpc/ss555/start/irq_asm.S
similarity index 100%
rename from c/src/lib/libcpu/powerpc/mpc5xx/irq/irq_asm.S
rename to bsps/powerpc/ss555/start/irq_asm.S
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/irq/irq_init.c b/bsps/powerpc/ss555/start/irq_init.c
similarity index 100%
rename from c/src/lib/libcpu/powerpc/mpc5xx/irq/irq_init.c
rename to bsps/powerpc/ss555/start/irq_init.c
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/exceptions/raw_exception.c b/bsps/powerpc/ss555/start/raw_exception.c
similarity index 100%
rename from c/src/lib/libcpu/powerpc/mpc5xx/exceptions/raw_exception.c
rename to bsps/powerpc/ss555/start/raw_exception.c
diff --git a/c/src/lib/libbsp/powerpc/ss555/Makefile.am b/c/src/lib/libbsp/powerpc/ss555/Makefile.am
index 6997ece985..0a85ecd539 100644
--- a/c/src/lib/libbsp/powerpc/ss555/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/ss555/Makefile.am
@@ -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
diff --git a/c/src/lib/libbsp/powerpc/ss555/README b/c/src/lib/libbsp/powerpc/ss555/README
index d4b020ba19..54d0bfa85a 100644
--- a/c/src/lib/libbsp/powerpc/ss555/README
+++ b/c/src/lib/libbsp/powerpc/ss555/README
@@ -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.
diff --git a/c/src/lib/libcpu/powerpc/Makefile.am b/c/src/lib/libcpu/powerpc/Makefile.am
index 724dfea710..6d5bc19e5b 100644
--- a/c/src/lib/libcpu/powerpc/Makefile.am
+++ b/c/src/lib/libcpu/powerpc/Makefile.am
@@ -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
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/README b/c/src/lib/libcpu/powerpc/mpc5xx/README
deleted file mode 100644
index 54d6985649..0000000000
--- a/c/src/lib/libcpu/powerpc/mpc5xx/README
+++ /dev/null
@@ -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.
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.c b/c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.c
deleted file mode 100644
index 51db6a62c1..0000000000
--- a/c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.c
+++ /dev/null
@@ -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);
-}
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.h b/c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.h
deleted file mode 100644
index 303ece825d..0000000000
--- a/c/src/lib/libcpu/powerpc/mpc5xx/ictrl/ictrl.h
+++ /dev/null
@@ -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 */
--
2.12.3
More information about the devel
mailing list