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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [m68k/] [mvme136/] [shmsupp/] [getcfg.c] - Blame information for rev 30

Go to most recent revision | 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:  The MPCSR interrupt on the MVME136 is used as an interprocessor
14
 *          interrupt.   The capablities of the MPCSR are used to generate
15
 *          interprocessor interrupts for up to eight nodes.
16
 *
17
 *          The following table illustrates the configuration limitations:
18
 *
19
 *                                   BUS     MAX
20
 *                          MODE    ENDIAN  NODES
21
 *                        ========= ====== =======
22
 *                         POLLED   LITTLE  2+
23
 *                        INTERRUPT LITTLE  2-8
24
 *
25
 *  COPYRIGHT (c) 1989-1999.
26
 *  On-Line Applications Research Corporation (OAR).
27
 *
28
 *  The license and distribution terms for this file may be
29
 *  found in the file LICENSE in this distribution or at
30
 *  http://www.OARcorp.com/rtems/license.html.
31
 *
32
 *  $Id: getcfg.c,v 1.2 2001-09-27 12:00:14 chris Exp $
33
 */
34
 
35
#include <rtems.h>
36
#include "shm_driver.h"
37
 
38
#define INTERRUPT 1                   /* MVME136 target supports both */
39
#define POLLING   0                   /* polling and interrupt modes  */
40
 
41
shm_config_table BSP_shm_cfgtbl;
42
 
43
rtems_unsigned32 *BSP_int_address()
44
{
45
  rtems_unsigned32 id, offset;
46
 
47
  id      = (rtems_unsigned32) *(rtems_unsigned8 *)0xfffb0061;
48
  offset  = ((id & 0x1f) << 5) | ((id & 0xe0) << 8);
49
  offset |= 0xffff000b;
50
  return( (rtems_unsigned32 * ) offset );
51
}
52
 
53
void Shm_Get_configuration(
54
  rtems_unsigned32   localnode,
55
  shm_config_table **shmcfg
56
)
57
{
58
   BSP_shm_cfgtbl.base         = (rtems_unsigned32 *)0x20000000;
59
   BSP_shm_cfgtbl.length       = 1 * MEGABYTE;
60
   BSP_shm_cfgtbl.format       = SHM_BIG;
61
 
62
   BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt;
63
 
64
#ifdef NEUTRAL_BIG
65
   BSP_shm_cfgtbl.convert      = NULL_CONVERT;
66
#else
67
   BSP_shm_cfgtbl.convert      = CPU_swap_u32;
68
#endif
69
 
70
#if (POLLING==1)
71
   BSP_shm_cfgtbl.poll_intr    = POLLED_MODE;
72
   BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT;
73
   BSP_shm_cfgtbl.Intr.value   = NO_INTERRUPT;
74
   BSP_shm_cfgtbl.Intr.length  = NO_INTERRUPT;
75
#else
76
   BSP_shm_cfgtbl.poll_intr    = INTR_MODE;
77
   BSP_shm_cfgtbl.Intr.address = BSP_int_address();
78
   BSP_shm_cfgtbl.Intr.value   = 0x80;
79
   BSP_shm_cfgtbl.Intr.length  = BYTE;
80
#endif
81
 
82
   *shmcfg = &BSP_shm_cfgtbl;
83
 
84
}

powered by: WebSVN 2.1.0

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