[afe99c2] | 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 MVME147. |
---|
| 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 SIGLP interrupt on the MVME147 is used as an interprocessor |
---|
| 14 | * interrupt. |
---|
| 15 | * |
---|
| 16 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 17 | * On-Line Applications Research Corporation (OAR). |
---|
| 18 | * All rights assigned to U.S. Government, 1994. |
---|
| 19 | * |
---|
| 20 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 21 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 22 | * notice must appear in all copies of this file and its derivatives. |
---|
| 23 | * |
---|
| 24 | * MVME147 port for TNI - Telecom Bretagne |
---|
| 25 | * by Dominique LE CAMPION (Dominique.LECAMPION@enst-bretagne.fr) |
---|
| 26 | * June 1996 |
---|
| 27 | * |
---|
| 28 | * $Id$ |
---|
| 29 | */ |
---|
| 30 | |
---|
| 31 | #include <bsp.h> |
---|
| 32 | #include <rtems.h> |
---|
| 33 | #include "shm.h" |
---|
| 34 | |
---|
| 35 | #define INTERRUPT 1 /* MVME147 target supports both */ |
---|
| 36 | #define POLLING 0 /* polling and interrupt modes */ |
---|
| 37 | |
---|
| 38 | shm_config_table BSP_shm_cfgtbl; |
---|
| 39 | |
---|
| 40 | rtems_unsigned32 *BSP_int_address() |
---|
| 41 | { |
---|
| 42 | rtems_unsigned32 id, offset; |
---|
| 43 | |
---|
| 44 | id = (rtems_unsigned32) vme_lcsr->gcsr_base_address; |
---|
| 45 | offset = (id << 4) & 0xF0; |
---|
| 46 | offset |= 0xffff0003; /* points to GCSR global 1 */ |
---|
| 47 | return( (rtems_unsigned32 * ) offset ); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | void Shm_Get_configuration( |
---|
| 51 | rtems_unsigned32 localnode, |
---|
| 52 | shm_config_table **shmcfg |
---|
| 53 | ) |
---|
| 54 | { |
---|
| 55 | /* A shared mem space has bee left between RAM_END and DRAM_END |
---|
| 56 | on the first node*/ |
---|
| 57 | if (localnode == 1) |
---|
| 58 | BSP_shm_cfgtbl.base = RAM_END; |
---|
| 59 | else |
---|
| 60 | BSP_shm_cfgtbl.base = DRAM_END + RAM_END; |
---|
| 61 | BSP_shm_cfgtbl.length = DRAM_END - RAM_END; |
---|
| 62 | BSP_shm_cfgtbl.format = SHM_BIG; |
---|
| 63 | |
---|
| 64 | BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt; |
---|
| 65 | |
---|
| 66 | #ifdef NEUTRAL_BIG |
---|
| 67 | BSP_shm_cfgtbl.convert = NULL_CONVERT; |
---|
| 68 | #else |
---|
| 69 | BSP_shm_cfgtbl.convert = CPU_swap_u32; |
---|
| 70 | #endif |
---|
| 71 | |
---|
| 72 | #if (POLLING==1) |
---|
| 73 | BSP_shm_cfgtbl.poll_intr = POLLED_MODE; |
---|
| 74 | BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT; |
---|
| 75 | BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT; |
---|
| 76 | BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT; |
---|
| 77 | #else |
---|
| 78 | BSP_shm_cfgtbl.poll_intr = INTR_MODE; |
---|
| 79 | BSP_shm_cfgtbl.Intr.address = BSP_int_address(); /* GCSR global 1 */ |
---|
| 80 | BSP_shm_cfgtbl.Intr.value = 0x01; /* SIGLP */ |
---|
| 81 | BSP_shm_cfgtbl.Intr.length = BYTE; |
---|
| 82 | #endif |
---|
| 83 | |
---|
| 84 | *shmcfg = &BSP_shm_cfgtbl; |
---|
| 85 | |
---|
| 86 | } |
---|