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 | /* Author: Till Straumann, <strauman@slac.stanford.edu> */ |
---|
7 | |
---|
8 | #include <stdio.h> |
---|
9 | |
---|
10 | /* address modifiers & friends */ |
---|
11 | #include <bsp/vme_am_defs.h> |
---|
12 | |
---|
13 | /* VME related declarations */ |
---|
14 | |
---|
15 | /* |
---|
16 | * BSP-specific configuration routine; sets up |
---|
17 | * VME windows and installs the VME interrupt manager. |
---|
18 | */ |
---|
19 | void BSP_vme_config() __attribute__((weak)); |
---|
20 | |
---|
21 | /* translate through host bridge and vme master window of vme bridge */ |
---|
22 | int |
---|
23 | BSP_vme2local_adrs(unsigned long am, unsigned long vmeaddr, unsigned long *plocaladdr); |
---|
24 | |
---|
25 | /* how a CPU address is mapped to the VME bus (if at all) */ |
---|
26 | int |
---|
27 | BSP_local2vme_adrs(unsigned long am, unsigned long localaddr, unsigned long *pvmeaddr); |
---|
28 | |
---|
29 | /* interrupt handlers and levels */ |
---|
30 | typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector); |
---|
31 | |
---|
32 | int |
---|
33 | BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg); |
---|
34 | int |
---|
35 | BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg); |
---|
36 | |
---|
37 | /* retrieve the currently installed ISR for a given vector */ |
---|
38 | BSP_VME_ISR_t |
---|
39 | BSP_getVME_isr(unsigned long vector, void **parg); |
---|
40 | |
---|
41 | int |
---|
42 | BSP_enableVME_int_lvl(unsigned int level); |
---|
43 | |
---|
44 | int |
---|
45 | BSP_disableVME_int_lvl(unsigned int level); |
---|
46 | |
---|
47 | int |
---|
48 | BSP_VMEOutboundPortCfg( |
---|
49 | unsigned long port, |
---|
50 | unsigned long address_space, |
---|
51 | unsigned long vme_address, |
---|
52 | unsigned long pci_address, |
---|
53 | unsigned long size); |
---|
54 | |
---|
55 | int |
---|
56 | BSP_VMEInboundPortCfg( |
---|
57 | unsigned long port, |
---|
58 | unsigned long address_space, |
---|
59 | unsigned long vme_address, |
---|
60 | unsigned long pci_address, |
---|
61 | unsigned long size); |
---|
62 | |
---|
63 | void |
---|
64 | BSP_VMEOutboundPortsShow(FILE *f); |
---|
65 | |
---|
66 | void |
---|
67 | BSP_VMEInboundPortsShow(FILE *f); |
---|
68 | |
---|
69 | #endif |
---|