source: rtems/c/src/lib/libbsp/i960/cvme961/shmsupp/getcfg.c @ 9a7e074d

4.104.114.84.95
Last change on this file since 9a7e074d was 48bfd992, checked in by Joel Sherrill <joel.sherrill@…>, on 11/30/99 at 19:58:02

Renamed shm.h to shm_driver.h to avoid conflicts with POSIX shm.h.

Renamed file shmsupp/intr.c in some BSPs to shmsupp/cause_intr.c to
avoid conflict with rtems/src/intr.c (Classic API Interrupt Manager).

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/*  void Shm_Get_configuration( localnode, &shmcfg )
2 *
3 *  This routine initializes, if necessary, and returns a pointer
4 *  to the Shared Memory Configuration Table for the Cyclone CVME961.
5 *
6 *  INPUT PARAMETERS:
7 *    localnode - local node number
8 *    shmcfg    - address of pointer to SHM Config Table
9 *
10 *  OUTPUT PARAMETERS:
11 *    *shmcfg   - pointer to SHM Config Table
12 *
13 *  NOTES:  CVME961 target system has onboard dual-ported memory.  This
14 *          file uses the USE_ONBOARD_RAM macro to determine if this
15 *          RAM is to be used as the SHM.  If so (i.e. USE_ONBOARD_RAM
16 *          is set to 1), it is assumed that the master node's dual
17 *          ported memory will be used and that it is configured
18 *          correctly.  The node owning the memory CANNOT access it
19 *          using a local address.  The "if" insures that the MASTER
20 *          node uses a local address to access the dual-ported memory.
21 *
22 *          The interprocessor interrupt used on the CVME961 is generated
23 *          by the VIC068.   The ICMS capablities of the VIC068 are used
24 *          to generate interprocessor interrupts for up to eight nodes.
25 *
26 *           The following table illustrates the configuration limitations:
27 *
28 *                                   BUS     MAX
29 *                          MODE    ENDIAN  NODES
30 *                        ========= ====== =======
31 *                         POLLED   LITTLE  2+
32 *                        INTERRUPT LITTLE  2-8
33 *
34 *  COPYRIGHT (c) 1989-1999.
35 *  On-Line Applications Research Corporation (OAR).
36 *
37 *  The license and distribution terms for this file may be
38 *  found in the file LICENSE in this distribution or at
39 *  http://www.OARcorp.com/rtems/license.html.
40 *
41 *  $Id$
42 */
43
44#include <rtems.h>
45#include "shm_driver.h"
46
47#define USE_ONBOARD_RAM 0             /* use onboard (1) or VME RAM   */
48                                      /*   for SHM communications     */
49
50#define INTERRUPT 1                   /* CVME961 target supports both */
51#define POLLING   0                   /* polling and interrupt modes  */
52
53
54shm_config_table BSP_shm_cfgtbl;
55
56void Shm_Get_configuration(
57  rtems_unsigned32   localnode,
58  shm_config_table **shmcfg
59)
60{
61#if ( USE_ONBOARD_RAM == 1 )
62   if ( Shm_RTEMS_MP_Configuration->node == MASTER )
63     BSP_shm_cfgtbl.base   = (rtems_unsigned32 *)0x00300000;
64   else
65     BSP_shm_cfgtbl.base   = (rtems_unsigned32 *)0x10300000;
66#else
67   BSP_shm_cfgtbl.base     = (rtems_unsigned32 *)0x20000000;
68#endif
69
70   BSP_shm_cfgtbl.length       = 1 * MEGABYTE;
71   BSP_shm_cfgtbl.format       = SHM_LITTLE;
72
73   BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
74
75#ifdef NEUTRAL_BIG
76   BSP_shm_cfgtbl.convert      = (void *)CPU_swap_u32;
77#else
78   BSP_shm_cfgtbl.convert      = NULL_CONVERT;
79#endif
80
81#if (POLLING==1)
82   BSP_shm_cfgtbl.poll_intr    = POLLED_MODE;
83   BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
84   BSP_shm_cfgtbl.Intr.value   = NO_INTERRUPT;
85   BSP_shm_cfgtbl.Intr.length  = NO_INTERRUPT;
86#else
87   BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
88   BSP_shm_cfgtbl.Intr.address =
89        (rtems_unsigned32 *) (0xffff0021|((localnode-1) << 12));
90                                                          /* use ICMS0 */
91   BSP_shm_cfgtbl.Intr.value   = 1;
92   BSP_shm_cfgtbl.Intr.length  = BYTE;
93#endif
94
95   *shmcfg = &BSP_shm_cfgtbl;
96
97}
Note: See TracBrowser for help on using the repository browser.