diff options
Diffstat (limited to 'c/src/lib')
18 files changed, 296 insertions, 28 deletions
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c index 7a291ef02e..85d1bc552d 100644 --- a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c @@ -1,4 +1,3 @@ -#define STACK_CHECKER_ON /* bsp_start() * * This routine starts the application. It includes application, diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c index 366a6502e7..870e43b79e 100644 --- a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c @@ -1,4 +1,3 @@ -#define STACK_CHECKER_ON /* bsp_start() * * This routine starts the application. It includes application, diff --git a/c/src/lib/libbsp/m68k/mvme162/README b/c/src/lib/libbsp/m68k/mvme162/README index 4f4a263722..af6082db21 100644 --- a/c/src/lib/libbsp/m68k/mvme162/README +++ b/c/src/lib/libbsp/m68k/mvme162/README @@ -28,6 +28,25 @@ any case I am ready to answer questions regarding the port and intend to follow the future RTEMS versions. I will do my best to provide whatever support I can afford time-wise. +MVME162FX and DMA on the IP bus +------------------------------- + +From Eric Vaitl <eric@viasat.com>: + +If you have any customers that will be using the 162FX, tell them to +be careful. The main difference between the 162 and the 162FX is DMA +on the IP bus. I spent over a month trying to write a DMA HDLC driver +for GreenSprings IP-MP and couldn't get it to work. I talked to some +people at GreenSprings, and they agreed that there really is no way to +get DMA to work unless you know the size of the packets in advance. +Once the IP2 chip DMA controller is given the character count and +enabled, it doesn't accept further commands until all of the +characters have arrived. The only way to terminate a DMA transfer +prematurely is by raising DMAEND* during the last read. None of the IP +modules that I know of are currently able to do that. GreenSprings is +working on the problem, but nothing is going to available for a few +months. + Installation ------------ Nothing unique to the MVME162. It has been incorporated into the diff --git a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h b/c/src/lib/libbsp/m68k/mvme162/include/bsp.h index 54e74da532..37b16cb69b 100644 --- a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h +++ b/c/src/lib/libbsp/m68k/mvme162/include/bsp.h @@ -1,6 +1,6 @@ /* bsp.h * - * This include file contains all MVME162 board IO definitions. + * This include file contains all MVME162fx board IO definitions. * * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. * On-Line Applications Research Corporation (OAR). @@ -165,6 +165,13 @@ typedef volatile struct mcchip_regs { * Prototypes for the low-level serial io are also included here, * because such stuff is bsp-specific (yet). The function bodies * are in console.c + * + * NOTE from Eric Vaitl <evaitl@viasat.com>: + * + * I dropped RTEMS into a 162FX today (the MVME162-513). The 162FX has a + * bug in the MC2 chip (revision 1) such that the SCC data register is + * not accessible, it has to be accessed indirectly through the SCC + * control register. */ enum {portB, portA}; @@ -190,10 +197,11 @@ typedef volatile struct scc_regs { #define ZREAD0(port) (scc[port].csr) #define ZREAD(port, n) (ZWRITE0(port, n), (scc[port].csr)) -#define ZREADD(port) (scc[port].buf) +#define ZREADD(port) (scc[port].csr=0x08, scc[port].csr ) #define ZWRITE(port, n, v) (ZWRITE0(port, n), ZWRITE0(port, v)) -#define ZWRITED(port, v) (scc[port].buf = (unsigned char)(v)) +#define ZWRITED(port, v) (scc[port].csr = 0x08, \ + scc[port].csr = (unsigned char)(v)) /*----------------------------------------------------------------*/ /* diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c index 215a53cc46..8c8497aaf5 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c +++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c @@ -28,6 +28,8 @@ void bsp_return_to_monitor_trap() { extern void start( void ); + page_table_teardown(); + lcsr->intr_ena = 0; /* disable interrupts */ m68k_set_vbr(0xFFE00000); /* restore 162Bug vectors */ asm volatile( "trap #15" ); /* trap to 162Bug */ diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c index 211ce19032..c862548700 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c @@ -188,7 +188,7 @@ int main( lcsr->vector_base = (VBR0 << 28) | (VBR1 << 24); - m68k_enable_caching(); + page_table_init(); /* * we only use a hook to get the C library initialized. diff --git a/c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s b/c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s index c159401474..e5df33a114 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s +++ b/c/src/lib/libbsp/powerpc/papyrus/dlentry/dlentry.s @@ -3,7 +3,7 @@ * This file contains the entry veneer for RTEMS programs * downloaded to Papyrus. * - * Author: Andrew Bray <andy@i-cubed.demon.co.uk> + * Author: Andrew Bray <andy@i-cubed.co.uk> * * COPYRIGHT (c) 1995 by i-cubed ltd. * @@ -223,8 +223,8 @@ bss_addr: stw r3, 4(r1) stw r3, 8(r1) stw r3, 12(r1) - .extern .main - b .main /* call the first C routine */ + .extern SYM (main) + b SYM (main) /* call the first C routine */ /*------------------------------------------------------------------------------- * bssclr. diff --git a/c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s b/c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s index ef5bf49e42..a6a8f5ff86 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s +++ b/c/src/lib/libbsp/powerpc/papyrus/flashentry/flashentry.s @@ -3,7 +3,7 @@ * This file contains the entry veneer for RTEMS programs * stored in Papyrus' flash ROM. * - * Author: Andrew Bray <andy@i-cubed.demon.co.uk> + * Author: Andrew Bray <andy@i-cubed.co.uk> * * COPYRIGHT (c) 1995 by i-cubed ltd. * @@ -230,8 +230,10 @@ bss_addr: *----------------------------------------------------------------------*/ addis r2,r0,0x8000 addi r2,r2,0x0001 - mticcr r2 - mtdccr r2 + + mtspr 0x3fb, r2 /* ICCR */ + mtspr 0x3fa, r2 /* DCCR */ + /*----------------------------------------------------------------------- * C_setup. *----------------------------------------------------------------------*/ @@ -243,8 +245,8 @@ bss_addr: stw r3, 4(r1) stw r3, 8(r1) stw r3, 12(r1) - .extern .main - b .main /* call the first C routine */ + .extern SYM (main) + b SYM (main) /* call the first C routine */ /*------------------------------------------------------------------------------- * Rom2ram. diff --git a/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h b/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h index 6518be25c1..4025a8796e 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h +++ b/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h @@ -2,7 +2,7 @@ * * This include file contains all Papyrus board IO definitions. * - * Author: Andrew Bray <andy@i-cubed.demon.co.uk> + * Author: Andrew Bray <andy@i-cubed.co.uk> * * COPYRIGHT (c) 1995 by i-cubed ltd. * @@ -44,6 +44,9 @@ extern "C" { #else #include <rtems.h> #include <console.h> +#include <clockdrv.h> +#include <console.h> +#include <iosupp.h> /* * Define the time limits for RTEMS Test Suite test durations. @@ -56,6 +59,7 @@ extern "C" { #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ + /* * Stuff for Time Test 27 */ @@ -78,18 +82,30 @@ extern "C" { #define delay( microseconds ) \ { \ unsigned32 start, ticks, now; \ - asm volatile ("mftblo %0" : "=r" (start)); \ + asm volatile ("mfspr %0, 0x3dd" : "=r" (start)); /* TBLO */ \ ticks = (microseconds) * Cpu_table.clicks_per_usec; \ do \ - asm volatile ("mftblo %0" : "=r" (now)); \ + asm volatile ("mfspr %0, 0x3dd" : "=r" (now)); /* TBLO */ \ while (now - start < ticks); \ } + /* Constants */ #define RAM_START 0 #define RAM_END 0x00200000 + +/* Some useful LED debugging bits */ +/* LED numbers are from 0-2 */ +#define __led_base ((volatile int *)0x7F200000) + +/* Turn a LED on */ +#define led_on(n) (__led_base[n] = 0) + +/* Turn a LED off */ +#define led_off(n) (__led_base[n] = 1) + /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; /* owned by BSP */ @@ -98,7 +114,7 @@ extern rtems_cpu_table Cpu_table; /* owned by BSP */ /* * Device Driver Table Entries */ - + /* * NOTE: Use the standard Console driver entry */ @@ -106,16 +122,21 @@ extern rtems_cpu_table Cpu_table; /* owned by BSP */ /* * NOTE: Use the standard Clock driver entry */ - + /* * How many libio files we want */ - + #define BSP_LIBIO_MAX_FDS 20 /* functions */ -void bsp_start( void ); +int bsp_start( + int argc, + char **argv, + char **environp +); + void bsp_cleanup( void ); rtems_isr_entry set_vector( /* returns old vector */ diff --git a/c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h b/c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h index 5a311bef0a..71684ad0d5 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h +++ b/c/src/lib/libbsp/powerpc/papyrus/include/coverhd.h @@ -26,7 +26,7 @@ */ /* - * Updated for a 25MHz Papyrus by Andrew Bray <andy@i-cubed.demon.co.uk> + * Updated for a 25MHz Papyrus by Andrew Bray <andy@i-cubed.co.uk> * * Units are 100ns. * diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c b/c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c index a03ad3024f..eab849d5e1 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c +++ b/c/src/lib/libbsp/powerpc/papyrus/startup/bspclean.c @@ -7,7 +7,7 @@ * * OUTPUT: NONE * - * Author: Andrew Bray <andy@i-cubed.demon.co.uk> + * Author: Andrew Bray <andy@i-cubed.co.uk> * * COPYRIGHT (c) 1995 by i-cubed ltd. * diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c b/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c index b044367f43..9629737dd9 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c @@ -9,7 +9,7 @@ * * OUTPUT: NONE * - * Author: Andrew Bray <andy@i-cubed.demon.co.uk> + * Author: Andrew Bray <andy@i-cubed.co.uk> * * COPYRIGHT (c) 1995 by i-cubed ltd. * @@ -166,7 +166,7 @@ bsp_postdriver_hook(void) rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } -int main( +int bsp_start( int argc, char **argv, char **environp @@ -225,8 +225,6 @@ int main( * not malloc'ed. It is just "pulled from the air". */ -/*BSP_Configuration.work_space_size *= 4;*/ - BSP_Configuration.work_space_start = (void *) RAM_END - BSP_Configuration.work_space_size; diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c b/c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c index e1bb7ac4a5..efb3e9d8e0 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c +++ b/c/src/lib/libbsp/powerpc/papyrus/startup/setvec.c @@ -12,7 +12,7 @@ * RETURNS: * address of previous interrupt handler * - * Author: Andrew Bray <andy@i-cubed.demon.co.uk> + * Author: Andrew Bray <andy@i-cubed.co.uk> * * COPYRIGHT (c) 1995 by i-cubed ltd. * diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/README b/c/src/lib/libbsp/unix/posix/shmsupp/README index e69de29bb2..93d6fcbe8c 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/README +++ b/c/src/lib/libbsp/unix/posix/shmsupp/README @@ -0,0 +1,9 @@ +# +# $Id$ +# + +This directory contains the SHM driver support files for +System V/POSIX derived UNIX flavors. + +WARNING: The interrupt support in this directory currently will + only work in a homogeneous system. diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c b/c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c index e69de29bb2..2b34ec8584 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c +++ b/c/src/lib/libbsp/unix/posix/shmsupp/addrconv.c @@ -0,0 +1,30 @@ +/* addrconv.v + * + * No address range conversion is required. + * + * Input parameters: + * addr - address to convert + * + * Output parameters: + * returns - converted address + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#include <bsp.h> +#include <shm.h> + +void *Shm_Convert_address( + void *addr +) +{ + return ( addr ); +} diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c b/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c index e69de29bb2..c912447631 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c +++ b/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c @@ -0,0 +1,74 @@ +/* void Shm_get_config( localnode, &shmcfg ) + * + * This routine initializes, if necessary, and returns a pointer + * to the Shared Memory Configuration Table for the UNIX + * simulator. + * + * INPUT PARAMETERS: + * localnode - local node number + * shmcfg - address of pointer to SHM Config Table + * + * OUTPUT PARAMETERS: + * *shmcfg - pointer to SHM Config Table + * + * NOTES: This driver is capable of supporting a practically unlimited + * number of nodes. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#include <bsp.h> +#include <shm.h> + +shm_config_table BSP_shm_cfgtbl; + +int semid; + +void Shm_Cause_interrupt_unix( + rtems_unsigned32 node +); + +void Shm_Get_configuration( + rtems_unsigned32 localnode, + shm_config_table **shmcfg +) +{ + _CPU_SHM_Init( + Shm_Maximum_nodes, + Shm_Is_master_node(), + (void **)&BSP_shm_cfgtbl.base, + (unsigned32 *)&BSP_shm_cfgtbl.length + ); + + BSP_shm_cfgtbl.format = SHM_BIG; + + BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt_unix; + +#ifdef NEUTRAL_BIG + BSP_shm_cfgtbl.convert = NULL_CONVERT; +#else + BSP_shm_cfgtbl.convert = CPU_swap_u32; +#endif + + if ( _CPU_SHM_Get_vector() ) { + BSP_shm_cfgtbl.poll_intr = INTR_MODE; + BSP_shm_cfgtbl.Intr.address = (vol_u32 *) _CPU_Get_pid(); /* process id */ + BSP_shm_cfgtbl.Intr.value = _CPU_SHM_Get_vector(); /* signal to send */ + BSP_shm_cfgtbl.Intr.length = LONG; + } else { + BSP_shm_cfgtbl.poll_intr = POLLED_MODE; + BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT; + BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT; + BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT; + } + + *shmcfg = &BSP_shm_cfgtbl; +} diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/intr.c b/c/src/lib/libbsp/unix/posix/shmsupp/intr.c index e69de29bb2..243af403d9 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/intr.c +++ b/c/src/lib/libbsp/unix/posix/shmsupp/intr.c @@ -0,0 +1,33 @@ +/* void Shm_interrupt_unix( node ) + * + * This routine is the shared memory driver routine which + * generates interrupts to other CPUs. + * + * Input parameters: + * node - destination of this packet (0 = broadcast) + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#include <bsp.h> +#include <shm.h> + +void Shm_Cause_interrupt_unix( + rtems_unsigned32 node +) +{ + Shm_Interrupt_information *intr; + intr = &Shm_Interrupt_table[node]; + + _CPU_SHM_Send_interrupt( (int) intr->address, (int) intr->value ); +} diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/lock.c b/c/src/lib/libbsp/unix/posix/shmsupp/lock.c index e69de29bb2..76a57d0a06 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/lock.c +++ b/c/src/lib/libbsp/unix/posix/shmsupp/lock.c @@ -0,0 +1,74 @@ +/* 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, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#include <bsp.h> +#include <shm.h> + +extern int semid; + +/* + * Shm_Initialize_lock + * + * Initialize the lock for the specified locked queue. + */ + +void Shm_Initialize_lock( + Shm_Locked_queue_Control *lq_cb +) +{ + lq_cb->lock = lq_cb - Shm_Locked_queues; +} + +/* Shm_Lock( &lq_cb ) + * + * This shared memory locked queue support routine locks the + * specified locked queue. It disables interrupts to prevent + * a deadlock condition. + */ + +void Shm_Lock( + Shm_Locked_queue_Control *lq_cb +) +{ + rtems_unsigned32 isr_level; + + rtems_interrupt_disable( isr_level ); + + Shm_isrstat = isr_level; + + _CPU_SHM_Lock( lq_cb->lock ); +} + +/* + * Shm_Unlock + * + * Unlock the lock for the specified locked queue. + */ + +void Shm_Unlock( + Shm_Locked_queue_Control *lq_cb +) +{ + rtems_unsigned32 isr_level; + + _CPU_SHM_Unlock( lq_cb->lock ); + + isr_level = Shm_isrstat; + rtems_interrupt_enable( isr_level ); +} |