[97871c97] | 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 XXX target. |
---|
| 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 | XXX: FIX THE COMMENTS BELOW WHEN THE CPU IS KNOWN |
---|
| 14 | * NOTES: The XYZ does not have an interprocessor interrupt. |
---|
| 15 | * |
---|
| 16 | * The following table illustrates the configuration limitations: |
---|
| 17 | * |
---|
| 18 | * BUS MAX |
---|
| 19 | * MODE ENDIAN NODES |
---|
| 20 | * ========= ====== ======= |
---|
| 21 | * POLLED BIG 2+ |
---|
| 22 | * INTERRUPT **** NOT SUPPORTED **** |
---|
| 23 | * |
---|
| 24 | * COPYRIGHT (c) 1989-1999. |
---|
| 25 | * On-Line Applications Research Corporation (OAR). |
---|
| 26 | * |
---|
| 27 | * The license and distribution terms for this file may be |
---|
| 28 | * found in the file LICENSE in this distribution or at |
---|
| 29 | * http://www.rtems.com/license/LICENSE. |
---|
| 30 | * |
---|
| 31 | * getcfg.c,v 1.7.8.1 2003/09/04 18:44:56 joel Exp |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | #include <rtems.h> |
---|
| 35 | #include <bsp.h> |
---|
| 36 | #include <shm_driver.h> |
---|
| 37 | |
---|
| 38 | /* multiprocessor communications interface (MPCI) table */ |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | extern rtems_mpci_entry Shm_Get_packet( |
---|
| 42 | rtems_packet_prefix ** |
---|
| 43 | ); |
---|
| 44 | |
---|
| 45 | rtems_mpci_entry Shm_Initialization( void ); |
---|
| 46 | |
---|
| 47 | extern rtems_mpci_entry Shm_Receive_packet( |
---|
| 48 | rtems_packet_prefix ** |
---|
| 49 | ); |
---|
| 50 | |
---|
| 51 | extern rtems_mpci_entry Shm_Return_packet( |
---|
| 52 | rtems_packet_prefix * |
---|
| 53 | ); |
---|
| 54 | |
---|
| 55 | extern rtems_mpci_entry Shm_Send_packet( |
---|
[1408ea8d] | 56 | uint32_t, |
---|
[97871c97] | 57 | rtems_packet_prefix * |
---|
| 58 | ); |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | /* rtems_mpci_table MPCI_table = { */ |
---|
| 62 | /* 100000, /\* default timeout value in ticks *\/ */ |
---|
| 63 | /* MAX_PACKET_SIZE, /\* maximum packet size *\/ */ |
---|
| 64 | /* Shm_Initialization, /\* initialization procedure *\/ */ |
---|
| 65 | /* Shm_Get_packet, /\* get packet procedure *\/ */ |
---|
| 66 | /* Shm_Return_packet, /\* return packet procedure *\/ */ |
---|
| 67 | /* Shm_Send_packet, /\* packet send procedure *\/ */ |
---|
| 68 | /* Shm_Receive_packet /\* packet receive procedure *\/ */ |
---|
| 69 | /* }; */ |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | /* |
---|
| 73 | * configured if currently polling of interrupt driven |
---|
| 74 | */ |
---|
| 75 | |
---|
| 76 | #define INTERRUPT 0 /* XXX: */ |
---|
| 77 | #define POLLING 1 /* XXX: fix me -- is polling ONLY!!! */ |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | shm_config_table BSP_shm_cfgtbl; |
---|
| 81 | |
---|
| 82 | void Shm_Get_configuration( |
---|
[1408ea8d] | 83 | uint32_t localnode, |
---|
[97871c97] | 84 | shm_config_table **shmcfg |
---|
| 85 | ) |
---|
| 86 | { |
---|
| 87 | extern rtems_configuration_table Configuration; |
---|
| 88 | int i; |
---|
[4bbf6ecb] | 89 | unsigned int tmp; |
---|
[44b06ca] | 90 | |
---|
[4bbf6ecb] | 91 | BSP_shm_cfgtbl.base = 0x40000000; |
---|
| 92 | BSP_shm_cfgtbl.length = 0x00001000; |
---|
| 93 | BSP_shm_cfgtbl.format = SHM_BIG; |
---|
[97871c97] | 94 | |
---|
[4bbf6ecb] | 95 | /* |
---|
| 96 | * Override cause_intr or shm_isr if your target has |
---|
| 97 | * special requirements. |
---|
| 98 | */ |
---|
[97871c97] | 99 | |
---|
[4bbf6ecb] | 100 | BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt; |
---|
[97871c97] | 101 | |
---|
| 102 | #ifdef NEUTRAL_BIG |
---|
[4bbf6ecb] | 103 | BSP_shm_cfgtbl.convert = NULL_CONVERT; |
---|
[97871c97] | 104 | #else |
---|
[4bbf6ecb] | 105 | BSP_shm_cfgtbl.convert = CPU_swap_u32; |
---|
[97871c97] | 106 | #endif |
---|
| 107 | |
---|
[4bbf6ecb] | 108 | BSP_shm_cfgtbl.poll_intr = INTR_MODE; |
---|
| 109 | BSP_shm_cfgtbl.Intr.address = |
---|
| 110 | (vol_u32) &(LEON3_IrqCtrl_Regs->force[LEON3_Cpu_Index]); |
---|
[44b06ca] | 111 | BSP_shm_cfgtbl.Intr.value = 1 << LEON3_MP_IRQ ; |
---|
[4bbf6ecb] | 112 | BSP_shm_cfgtbl.Intr.length = 4; |
---|
| 113 | |
---|
| 114 | if (LEON3_Cpu_Index == 0) { |
---|
| 115 | tmp = 0; |
---|
| 116 | for (i = 1; |
---|
| 117 | i < (Configuration.User_multiprocessing_table)->maximum_nodes+1; i++) |
---|
| 118 | tmp |= (1 << i); |
---|
[44b06ca] | 119 | LEON3_IrqCtrl_Regs->mpstat = tmp; |
---|
[4bbf6ecb] | 120 | } |
---|
| 121 | |
---|
| 122 | *shmcfg = &BSP_shm_cfgtbl; |
---|
[97871c97] | 123 | } |
---|