1 | #ifndef RTEMS_BSP_VME_CONFIG_H |
---|
2 | #define RTEMS_BSP_VME_CONFIG_H |
---|
3 | /* $Id$ */ |
---|
4 | |
---|
5 | /* BSP specific address space configuration parameters */ |
---|
6 | |
---|
7 | /* |
---|
8 | * The BSP maps VME address ranges into |
---|
9 | * one BAT. |
---|
10 | * NOTE: the BSP (startup/bspstart.c) uses |
---|
11 | * hardcoded window lengths that match this |
---|
12 | * layout: |
---|
13 | * |
---|
14 | * BSP_VME_BAT_IDX defines |
---|
15 | * which BAT to use for mapping the VME bus. |
---|
16 | * If this is undefined, no extra BAT will be |
---|
17 | * configured and VME has to share the available |
---|
18 | * PCI address space with PCI devices. |
---|
19 | */ |
---|
20 | |
---|
21 | #if defined(mvme2100) |
---|
22 | #define _VME_A32_WIN0_ON_PCI 0x90000000 |
---|
23 | #define _VME_A24_ON_PCI 0x9f000000 |
---|
24 | #define _VME_A16_ON_PCI 0x9fff0000 |
---|
25 | #define BSP_VME_BAT_IDX 1 |
---|
26 | #else |
---|
27 | #define _VME_A32_WIN0_ON_PCI 0x10000000 |
---|
28 | #define _VME_A24_ON_PCI 0x1f000000 |
---|
29 | #define _VME_A16_ON_PCI 0x1fff0000 |
---|
30 | #define BSP_VME_BAT_IDX 0 |
---|
31 | #endif |
---|
32 | |
---|
33 | /* start of the A32 window on the VME bus |
---|
34 | * TODO: this should perhaps be a configuration option |
---|
35 | */ |
---|
36 | #define _VME_A32_WIN0_ON_VME 0x20000000 |
---|
37 | |
---|
38 | /* if _VME_DRAM_OFFSET is defined, the BSP |
---|
39 | * will map our RAM onto the VME bus, starting |
---|
40 | * at _VME_DRAM_OFFSET |
---|
41 | */ |
---|
42 | #define _VME_DRAM_OFFSET 0xc0000000 |
---|
43 | |
---|
44 | /* Tell the interrupt manager that the universe driver |
---|
45 | * already called openpic_eoi() and that this step hence |
---|
46 | * must be omitted. |
---|
47 | */ |
---|
48 | |
---|
49 | #define BSP_PCI_VME_DRIVER_DOES_EOI |
---|
50 | /* don't reference vmeUniverse0PciIrqLine directly here - leave it up to |
---|
51 | * bspstart() to set BSP_vme_bridge_irq. That way, we can generate variants |
---|
52 | * of the BSP with / without the universe driver... |
---|
53 | */ |
---|
54 | extern int _BSP_vme_bridge_irq; |
---|
55 | |
---|
56 | extern int BSP_VMEInit(); |
---|
57 | extern int BSP_VMEIrqMgrInstall(); |
---|
58 | |
---|
59 | #include <bsp/motorola.h> |
---|
60 | #include <bsp/pci.h> |
---|
61 | |
---|
62 | #define BSP_VME_UNIVERSE_INSTALL_IRQ_MGR \ |
---|
63 | do { \ |
---|
64 | int bus, dev, i = 0, j; \ |
---|
65 | const struct _int_map *bspmap; \ |
---|
66 | /* install the VME interrupt manager; \ |
---|
67 | * if there's a bsp route map, use it to \ |
---|
68 | * configure additional lines... \ |
---|
69 | */ \ |
---|
70 | if (0 == pci_find_device(0x10e3, 0x0000, 0, &bus, &dev, &i)){ \ |
---|
71 | if ( (bspmap = motorolaIntMap(currentBoard)) ) { \ |
---|
72 | for ( i=0; bspmap[i].bus >= 0; i++ ) { \ |
---|
73 | if ( bspmap[i].bus == bus && bspmap[i].slot == dev ) { \ |
---|
74 | int pins[5], names[4]; \ |
---|
75 | /* found it; use info here... */ \ |
---|
76 | /* copy up to 4 entries; terminated with -1 pin */ \ |
---|
77 | for ( j=0; \ |
---|
78 | j<5 && (pins[j]=bspmap[i].pin_route[j].pin-1)>=0; \ |
---|
79 | j++) { \ |
---|
80 | names[j] = bspmap[i].pin_route[j].int_name[0]; \ |
---|
81 | } \ |
---|
82 | pins[4] = -1; \ |
---|
83 | if ( 0 == vmeUniverseInstallIrqMgrAlt( \ |
---|
84 | 1, /* shared IRQs */ \ |
---|
85 | pins[0], names[0], \ |
---|
86 | pins[1], names[1], \ |
---|
87 | pins[2], names[2], \ |
---|
88 | pins[3], names[3], \ |
---|
89 | -1) ) { \ |
---|
90 | i = -1; \ |
---|
91 | break; \ |
---|
92 | } \ |
---|
93 | } \ |
---|
94 | } \ |
---|
95 | } \ |
---|
96 | if ( i >= 0 ) \ |
---|
97 | vmeUniverseInstallIrqMgrAlt(1,0,-1,-1); \ |
---|
98 | } \ |
---|
99 | } while (0) |
---|
100 | |
---|
101 | #endif |
---|