summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-04-20 13:38:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-04-20 14:32:43 +0200
commit1efa1c8389604dcf303b9acfa26c0ae60db9d9b4 (patch)
tree0fe569d6ad62623bf820f1dcd3620227995fae75 /c/src/lib/libbsp/sparc
parentbsps/sparc: Move network drivers to bsps (diff)
downloadrtems-1efa1c8389604dcf303b9acfa26c0ae60db9d9b4.tar.bz2
bsps: Move MPCI support to bsps
This patch is a part of the BSP source reorganization. Update #3285.
Diffstat (limited to 'c/src/lib/libbsp/sparc')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/Makefile.am8
-rw-r--r--c/src/lib/libbsp/sparc/leon3/shmsupp/README4
-rw-r--r--c/src/lib/libbsp/sparc/leon3/shmsupp/addrconv.c28
-rw-r--r--c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c76
-rw-r--r--c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c90
-rw-r--r--c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c50
6 files changed, 4 insertions, 252 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index cd5d1dfa46..c64bec2458 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -186,10 +186,10 @@ endif
if HAS_MP
# shmsupp
-librtemsbsp_a_SOURCES += shmsupp/addrconv.c
-librtemsbsp_a_SOURCES += shmsupp/getcfg.c
-librtemsbsp_a_SOURCES += shmsupp/lock.c
-librtemsbsp_a_SOURCES += shmsupp/mpisr.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/mpci/addrconv.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/mpci/getcfg.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/mpci/lock.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/sparc/leon3/mpci/mpisr.c
endif
diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/README b/c/src/lib/libbsp/sparc/leon3/shmsupp/README
deleted file mode 100644
index 9ad11538b7..0000000000
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This should describe how to use SHM in a multiprocessor LEON3
-configuration.
-
-Especially useful would be how to test this on tsim-leon3.
diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/addrconv.c b/c/src/lib/libbsp/sparc/leon3/shmsupp/addrconv.c
deleted file mode 100644
index 2656bc1ccf..0000000000
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/addrconv.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Shm_Convert_address
- *
- * No address range conversion is required.
- *
- * Input parameters:
- * address - address to convert
- *
- * Output parameters:
- * returns - converted address
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * 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/LICENSE.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <shm_driver.h>
-
-void *Shm_Convert_address(
- void *address
-)
-{
- return ( address );
-}
diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c b/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c
deleted file mode 100644
index fc67cf8e3a..0000000000
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * @file
- *
- * LEON3 Shared Memory Driver Support - Configuration
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * On-Line Applications Research Corporation (OAR).
- *
- * 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/LICENSE.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <shm_driver.h>
-
-/* Let user override this configuration by declaring this a weak variable */
-shm_config_table BSP_shm_cfgtbl __attribute__((weak)) =
-{
- (vol_u32 *)0x40000000, /* USER OVERRIDABLE */
- 0x00001000, /* USER OVERRIDABLE */
- SHM_BIG,
- NULL_CONVERT,
- INTR_MODE,
- Shm_Cause_interrupt,
- {
- NULL,
- 0, /* USER OVERRIDABLE - Uses default MP-IRQ if 0 */
- 4,
- },
-};
-
-void Shm_Get_configuration(
- uint32_t localnode,
- shm_config_table **shmcfg
-)
-{
- int i;
- unsigned int tmp;
- rtems_multiprocessing_table *mptable;
-
- BSP_shm_cfgtbl.format = SHM_BIG;
-
- /*
- * Override cause_intr or shm_isr if your target has
- * special requirements.
- */
-
- BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
-
-#ifdef NEUTRAL_BIG
- BSP_shm_cfgtbl.convert = NULL_CONVERT;
-#else
- BSP_shm_cfgtbl.convert = CPU_swap_u32;
-#endif
-
- BSP_shm_cfgtbl.poll_intr = INTR_MODE;
- BSP_shm_cfgtbl.Intr.address =
- (vol_u32 *) &(LEON3_IrqCtrl_Regs->force[LEON3_Cpu_Index]);
- if (BSP_shm_cfgtbl.Intr.value == 0)
- BSP_shm_cfgtbl.Intr.value = 1 << LEON3_mp_irq; /* Use default MP-IRQ */
- BSP_shm_cfgtbl.Intr.length = 4;
-
- if (LEON3_Cpu_Index == 0) {
- tmp = 0;
- mptable = rtems_configuration_get_user_multiprocessing_table();
- for (i = 1; i < mptable->maximum_nodes; i++)
- tmp |= (1 << i);
- LEON3_IrqCtrl_Regs->mpstat = tmp;
- }
-
- *shmcfg = &BSP_shm_cfgtbl;
-}
diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c b/c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c
deleted file mode 100644
index 5b118f24b6..0000000000
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/lock.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * @file
- *
- * LEON3 Shared Memory Lock Routines
- *
- * This shared memory locked queue support routine need to be
- * able to lock the specified locked queue. Interrupts are
- * disabled while the queue is locked to prevent preemption
- * and deadlock when two tasks poll for the same lock.
- * previous level.
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * On-Line Applications Research Corporation (OAR).
- *
- * 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/LICENSE.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <shm_driver.h>
-
-
-/*
- * Initialize the lock for the specified locked queue.
- */
-void Shm_Initialize_lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- lq_cb->lock = LQ_UNLOCKED;
-}
-
-/*
- * This shared memory locked queue support routine locks the
- * specified locked queue. It disables interrupts to prevent
- * a deadlock condition.
- */
-extern unsigned int LEON3_Atomic_Swap(uint32_t value, uint32_t *address);
-
-__asm__ (
- ".text\n"
- ".align 4\n"
- "LEON3_Atomic_Swap:\n"
- " retl\n"
- " swapa [%o1] 1, %o0\n"
-);
-
-
-
-void Shm_Lock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- uint32_t isr_level;
- uint32_t *lockptr = (uint32_t *) &lq_cb->lock;
- uint32_t lock_value;
-
- lock_value = SHM_LOCK_VALUE;
- rtems_interrupt_disable( isr_level );
-
- Shm_isrstat = isr_level;
- while ( lock_value ) {
- lock_value = LEON3_Atomic_Swap(lock_value, lockptr);
- /*
- * If not available, then may want to delay to reduce load on lock.
- */
- }
-}
-
-/*
- * Shm_Unlock
- *
- * Unlock the lock for the specified locked queue.
- */
-
-void Shm_Unlock(
- Shm_Locked_queue_Control *lq_cb
-)
-{
- uint32_t isr_level;
-
- lq_cb->lock = SHM_UNLOCK_VALUE;
- isr_level = Shm_isrstat;
- rtems_interrupt_enable( isr_level );
-}
-
diff --git a/c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c b/c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c
deleted file mode 100644
index cdf05293f1..0000000000
--- a/c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * @file
- *
- * LEON3 Shared Memory Driver Interrupt Support
- */
-
-/*
- * COPYRIGHT (c) 1989-2012.
- * On-Line Applications Research Corporation (OAR).
- *
- * 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/LICENSE.
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <shm_driver.h>
-
-#if 0
-void Shm_isr(void)
-{
- /*
- * If this routine has to do anything other than the mpisr.c
- * found in the generic driver, then copy the contents of the generic
- * mpisr.c and augment it to satisfy this particular board. Typically,
- * you need to have a board specific mpisr.c when the interrupt
- * must be cleared.
- *
- * If the generic mpisr.c satisifies your requirements, then
- * remove this routine from your target's shmsupp/mpisr.c file.
- * Then simply install the generic Shm_isr in the Shm_setvec
- * routine below.
- */
-}
-#endif
-
-/*
- * This driver routine sets the SHM interrupt vector to point to the
- * driver's SHM interrupt service routine.
- */
-void Shm_setvec( void )
-{
- /*
- * Interrupt driven mode is not currently supported.
- * This is thought to be the interrupt to use.
- */
- LEON_Unmask_interrupt(LEON3_mp_irq);
- set_vector((rtems_isr_entry) Shm_isr, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
-}