[ac7d5ef0] | 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: 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, 1990, 1991, 1992, 1993, 1994. |
---|
| 26 | * On-Line Applications Research Corporation (OAR). |
---|
| 27 | * All rights assigned to U.S. Government, 1994. |
---|
| 28 | * |
---|
| 29 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 30 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 31 | * notice must appear in all copies of this file and its derivatives. |
---|
| 32 | * |
---|
| 33 | * $Id$ |
---|
| 34 | */ |
---|
| 35 | |
---|
| 36 | #include <rtems.h> |
---|
| 37 | #include "shm.h" |
---|
| 38 | |
---|
| 39 | #define INTERRUPT 1 /* MVME136 target supports both */ |
---|
| 40 | #define POLLING 0 /* polling and interrupt modes */ |
---|
| 41 | |
---|
| 42 | shm_config_table BSP_shm_cfgtbl; |
---|
| 43 | |
---|
| 44 | rtems_unsigned32 *BSP_int_address() |
---|
| 45 | { |
---|
| 46 | rtems_unsigned32 id, offset; |
---|
| 47 | |
---|
| 48 | id = (rtems_unsigned32) *(rtems_unsigned8 *)0xfffb0061; |
---|
| 49 | offset = ((id & 0x1f) << 5) | ((id & 0xe0) << 8); |
---|
| 50 | offset |= 0xffff000b; |
---|
| 51 | return( (rtems_unsigned32 * ) offset ); |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | void Shm_Get_configuration( |
---|
| 55 | rtems_unsigned32 localnode, |
---|
| 56 | shm_config_table **shmcfg |
---|
| 57 | ) |
---|
| 58 | { |
---|
| 59 | BSP_shm_cfgtbl.base = (rtems_unsigned32 *)0x20000000; |
---|
| 60 | BSP_shm_cfgtbl.length = 1 * MEGABYTE; |
---|
| 61 | BSP_shm_cfgtbl.format = SHM_BIG; |
---|
| 62 | |
---|
| 63 | BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt; |
---|
| 64 | |
---|
| 65 | #ifdef NEUTRAL_BIG |
---|
| 66 | BSP_shm_cfgtbl.convert = NULL_CONVERT; |
---|
| 67 | #else |
---|
| 68 | BSP_shm_cfgtbl.convert = CPU_swap_u32; |
---|
| 69 | #endif |
---|
| 70 | |
---|
| 71 | #if (POLLING==1) |
---|
| 72 | BSP_shm_cfgtbl.poll_intr = POLLED_MODE; |
---|
| 73 | BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT; |
---|
| 74 | BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT; |
---|
| 75 | BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT; |
---|
| 76 | #else |
---|
| 77 | BSP_shm_cfgtbl.poll_intr = INTR_MODE; |
---|
| 78 | BSP_shm_cfgtbl.Intr.address = BSP_int_address(); |
---|
| 79 | BSP_shm_cfgtbl.Intr.value = 0x80; |
---|
| 80 | BSP_shm_cfgtbl.Intr.length = BYTE; |
---|
| 81 | #endif |
---|
| 82 | |
---|
| 83 | *shmcfg = &BSP_shm_cfgtbl; |
---|
| 84 | |
---|
| 85 | } |
---|