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 HP PA-RISC |
---|
5 | * simulator. |
---|
6 | * |
---|
7 | * INPUT PARAMETERS: |
---|
8 | * localnode - local node number |
---|
9 | * shmcfg - address of pointer to SHM Config Table |
---|
10 | * |
---|
11 | * OUTPUT PARAMETERS: |
---|
12 | * *shmcfg - pointer to SHM Config Table |
---|
13 | * |
---|
14 | * NOTES: The MP interrupt used is the Runway bus' ability to directly |
---|
15 | * address the control registers of up to four CPUs and cause |
---|
16 | * interrupts on them. |
---|
17 | * |
---|
18 | * The following table illustrates the configuration limitations: |
---|
19 | * |
---|
20 | * BUS MAX |
---|
21 | * MODE ENDIAN NODES |
---|
22 | * ========= ====== ======= |
---|
23 | * POLLED BIG 2+ |
---|
24 | * INTERRUPT BIG 2..4 (on Runway) |
---|
25 | * |
---|
26 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
27 | * On-Line Applications Research Corporation (OAR). |
---|
28 | * All rights assigned to U.S. Government, 1994. |
---|
29 | * |
---|
30 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
31 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
32 | * notice must appear in all copies of this file and its derivatives. |
---|
33 | * |
---|
34 | * $Id$ |
---|
35 | */ |
---|
36 | |
---|
37 | #include <bsp.h> |
---|
38 | #include <runway.h> |
---|
39 | |
---|
40 | #include <shm.h> |
---|
41 | |
---|
42 | #define INTERRUPT 0 /* can be interrupt or polling */ |
---|
43 | #define POLLING 1 |
---|
44 | |
---|
45 | #define HPPA_RUNWAY_PROC_HPA_BASE ((void *) 0xFFFA0000) |
---|
46 | |
---|
47 | /* given a processor number, where is its HPA? */ |
---|
48 | #define HPPA_RUNWAY_HPA(cpu) \ |
---|
49 | ((rtems_unsigned32) (HPPA_RUNWAY_PROC_HPA_BASE + ((cpu) * 0x2000))) |
---|
50 | |
---|
51 | #define HPPA_RUNWAY_REG_IO_EIR_OFFSET 0x000 |
---|
52 | |
---|
53 | shm_config_table BSP_shm_cfgtbl; |
---|
54 | |
---|
55 | void Shm_Cause_interrupt_simhppa( |
---|
56 | rtems_unsigned32 node |
---|
57 | ); |
---|
58 | |
---|
59 | void Shm_Get_configuration( |
---|
60 | rtems_unsigned32 localnode, |
---|
61 | shm_config_table **shmcfg |
---|
62 | ) |
---|
63 | { |
---|
64 | BSP_shm_cfgtbl.base = (vol_u32 *) 0x44000000; |
---|
65 | BSP_shm_cfgtbl.length = 16 * KILOBYTE; |
---|
66 | BSP_shm_cfgtbl.format = SHM_BIG; |
---|
67 | |
---|
68 | BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt_simhppa; |
---|
69 | |
---|
70 | #ifdef NEUTRAL_BIG |
---|
71 | BSP_shm_cfgtbl.convert = NULL_CONVERT; |
---|
72 | #else |
---|
73 | BSP_shm_cfgtbl.convert = CPU_swap_u32; |
---|
74 | #endif |
---|
75 | |
---|
76 | #if ( POLLING == 1 ) |
---|
77 | BSP_shm_cfgtbl.poll_intr = POLLED_MODE; |
---|
78 | BSP_shm_cfgtbl.Intr.address = NO_INTERRUPT; |
---|
79 | BSP_shm_cfgtbl.Intr.value = NO_INTERRUPT; |
---|
80 | BSP_shm_cfgtbl.Intr.length = NO_INTERRUPT; |
---|
81 | #else |
---|
82 | BSP_shm_cfgtbl.poll_intr = INTR_MODE; |
---|
83 | BSP_shm_cfgtbl.Intr.address = |
---|
84 | (vol_u32 *) (HPPA_RUNWAY_HPA( localnode - 1) + |
---|
85 | HPPA_RUNWAY_REG_IO_EIR_OFFSET); |
---|
86 | BSP_shm_cfgtbl.Intr.value = HPPA_INTERRUPT_EXTERNAL_MPCI; |
---|
87 | BSP_shm_cfgtbl.Intr.length = LONG; |
---|
88 | #endif |
---|
89 | |
---|
90 | *shmcfg = &BSP_shm_cfgtbl; |
---|
91 | } |
---|
92 | |
---|