OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i960/] [cvme961/] [shmsupp/] [getcfg.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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: getcfg.c,v 1.2 2001-09-27 11:59:56 chris Exp $
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
 
54
shm_config_table BSP_shm_cfgtbl;
55
 
56
void 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.