1 | #ifndef RTEMS_BSP_VME_API_H |
---|
2 | #define RTEMS_BSP_VME_API_H |
---|
3 | /* $Id$ */ |
---|
4 | |
---|
5 | /* SVGM et al. BSP's VME support */ |
---|
6 | |
---|
7 | /* |
---|
8 | * Authorship |
---|
9 | * ---------- |
---|
10 | * This software was created by |
---|
11 | * Till Straumann <strauman@slac.stanford.edu>, 2002, |
---|
12 | * Stanford Linear Accelerator Center, Stanford University. |
---|
13 | * |
---|
14 | * Acknowledgement of sponsorship |
---|
15 | * ------------------------------ |
---|
16 | * This software was produced by |
---|
17 | * the Stanford Linear Accelerator Center, Stanford University, |
---|
18 | * under Contract DE-AC03-76SFO0515 with the Department of Energy. |
---|
19 | * |
---|
20 | * Government disclaimer of liability |
---|
21 | * ---------------------------------- |
---|
22 | * Neither the United States nor the United States Department of Energy, |
---|
23 | * nor any of their employees, makes any warranty, express or implied, or |
---|
24 | * assumes any legal liability or responsibility for the accuracy, |
---|
25 | * completeness, or usefulness of any data, apparatus, product, or process |
---|
26 | * disclosed, or represents that its use would not infringe privately owned |
---|
27 | * rights. |
---|
28 | * |
---|
29 | * Stanford disclaimer of liability |
---|
30 | * -------------------------------- |
---|
31 | * Stanford University makes no representations or warranties, express or |
---|
32 | * implied, nor assumes any liability for the use of this software. |
---|
33 | * |
---|
34 | * Stanford disclaimer of copyright |
---|
35 | * -------------------------------- |
---|
36 | * Stanford University, owner of the copyright, hereby disclaims its |
---|
37 | * copyright and all other rights in this software. Hence, anyone may |
---|
38 | * freely use it for any purpose without restriction. |
---|
39 | * |
---|
40 | * Maintenance of notices |
---|
41 | * ---------------------- |
---|
42 | * In the interest of clarity regarding the origin and status of this |
---|
43 | * SLAC software, this and all the preceding Stanford University notices |
---|
44 | * are to remain affixed to any copy or derivative of this software made |
---|
45 | * or distributed by the recipient and are to be affixed to any copy of |
---|
46 | * software made or distributed by the recipient that contains a copy or |
---|
47 | * derivative of this software. |
---|
48 | * |
---|
49 | * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 |
---|
50 | */ |
---|
51 | |
---|
52 | #include <stdio.h> |
---|
53 | |
---|
54 | /* address modifiers & friends */ |
---|
55 | #include <bsp/vme_am_defs.h> |
---|
56 | |
---|
57 | /* VME related declarations */ |
---|
58 | |
---|
59 | /* |
---|
60 | * BSP-specific configuration routine; sets up |
---|
61 | * VME windows and installs the VME interrupt manager. |
---|
62 | */ |
---|
63 | void BSP_vme_config() __attribute__((weak)); |
---|
64 | |
---|
65 | /* translate through host bridge and vme master window of vme bridge */ |
---|
66 | int |
---|
67 | BSP_vme2local_adrs(unsigned long am, unsigned long vmeaddr, unsigned long *plocaladdr); |
---|
68 | |
---|
69 | /* how a CPU address is mapped to the VME bus (if at all) */ |
---|
70 | int |
---|
71 | BSP_local2vme_adrs(unsigned long am, unsigned long localaddr, unsigned long *pvmeaddr); |
---|
72 | |
---|
73 | /* interrupt handlers and levels */ |
---|
74 | typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector); |
---|
75 | |
---|
76 | int |
---|
77 | BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg); |
---|
78 | int |
---|
79 | BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg); |
---|
80 | |
---|
81 | /* retrieve the currently installed ISR for a given vector */ |
---|
82 | BSP_VME_ISR_t |
---|
83 | BSP_getVME_isr(unsigned long vector, void **parg); |
---|
84 | |
---|
85 | int |
---|
86 | BSP_enableVME_int_lvl(unsigned int level); |
---|
87 | |
---|
88 | int |
---|
89 | BSP_disableVME_int_lvl(unsigned int level); |
---|
90 | |
---|
91 | int |
---|
92 | BSP_VMEOutboundPortCfg( |
---|
93 | unsigned long port, |
---|
94 | unsigned long address_space, |
---|
95 | unsigned long vme_address, |
---|
96 | unsigned long pci_address, |
---|
97 | unsigned long size); |
---|
98 | |
---|
99 | int |
---|
100 | BSP_VMEInboundPortCfg( |
---|
101 | unsigned long port, |
---|
102 | unsigned long address_space, |
---|
103 | unsigned long vme_address, |
---|
104 | unsigned long pci_address, |
---|
105 | unsigned long size); |
---|
106 | |
---|
107 | void |
---|
108 | BSP_VMEOutboundPortsShow(FILE *f); |
---|
109 | |
---|
110 | void |
---|
111 | BSP_VMEInboundPortsShow(FILE *f); |
---|
112 | |
---|
113 | #endif |
---|