source: rtems/c/src/lib/libbsp/powerpc/mvme5500/vme/VME.h @ f774fc06

4.104.114.84.9
Last change on this file since f774fc06 was f774fc06, checked in by Till Straumann <strauman@…>, on Jan 17, 2007 at 5:45:14 AM

2007-01-16 Till Straumann <strauman@…>

  • ep1a/vme/vmeconfig.c, mvme5500/pci/pcifinddevice.c,
  • mvme5500/startup/pgtbl_activate.c, mvme5500/vectors/bspException.h,
  • mvme5500/vectors/exceptionhandler.c, mvme5500/vme/VME.h,
  • mvme5500/vme/vmeconfig.c, score603e/vme/vmeconfig.c, shared/pci/pcifinddevice.c,
  • shared/startup/pgtbl_activate.c, shared/startup/pgtbl_setup.c,
  • shared/startup/probeMemEnd.c, shared/startup/sbrk.c, shared/vme/VME.h,
  • shared/vme/VMEConfig.h, shared/vme/vme_universe.c, shared/vme/vmeconfig.c: Added SLAC/Stanford Authorship Note / Copyright + Liability Disclaimer.
  • Property mode set to 100644
File size: 4.8 KB
Line 
1#ifndef RTEMS_BSP_VME_UNIVERSE_H
2#define RTEMS_BSP_VME_UNIVERSE_H
3/* VME.h,v 1.1.2.2 2003/03/25 16:46:01 joel Exp */
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/* pull in bsp.h */
53#include <bsp.h>
54/* our VME bridge */
55#include <bsp/vmeUniverse.h>
56/* our address space configuration */
57#include <bsp/VMEConfig.h>
58
59/* VME related declarations */
60/* how to map a VME address to the CPU local bus.
61 * Note that this traverses two bridges:
62 * the grackle and the universe. For the
63 * Universe, there is a lookup procedure while
64 * we assume a 1:1 mapping for the grackle...
65 */
66
67/* NOTE about the fast mapping macros:
68 * using these macros is only safe if the user app
69 * does _NOT_ change the universe mappings!
70 * While changing the PCI windows probably doesn't
71 * make much sense (involves changing the MMU/DBATs as well),
72 * The user might wish to change the VME address
73 * layout, i.e. by remapping _VME_A32_WIN0_ON_VME
74 * and _VME_DRAM_OFFSET...
75 * Hence, using the A24 and A16 macros is probably safe.
76 */
77
78#define BSP_vme_init() \
79        vmeUniverseInit
80
81/* translate through host bridge and vme master window of vme bridge */
82static inline int
83BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr)
84{
85int rval=vmeUniverseXlateAddr(1,0,am,vmeaddr,plocaladdr);
86        *plocaladdr+=PCI_MEM_BASE;
87        return rval;
88}
89
90/* when using this macro, the universe setup MUST NOT BE
91 * CHANGED by the application...
92 */
93#define BSP_vme2local_A32_fast(vmeaddr) \
94        ((vmeaddr)-_VME_A32_WIN0_ON_VME + _VME_A32_WIN0_ON_PCI + PCI_MEM_BASE)
95#define BSP_vme2local_A24_fast(vmeaddr) \
96        (((vmeaddr)&0x7ffffff)+_VME_A24_ON_PCI + PCI_MEM_BASE)
97#define BSP_vme2local_A16_fast(vmeaddr) \
98        (((vmeaddr)&0xffff)+_VME_A16_ON_PCI + PCI_MEM_BASE)
99
100/* how a CPU address is mapped to the VME bus (if at all)
101 */
102static inline int
103BSP_local2vme_adrs(unsigned am, unsigned long localaddr, unsigned long *pvmeaddr)
104{
105return vmeUniverseXlateAddr(0, 0, am,localaddr+PCI_DRAM_OFFSET,pvmeaddr);
106}
107
108#define BSP_localdram2vme_fast(localaddr) \
109        ((localaddr)+_VME_DRAM_OFFSET)
110
111/* interrupt handlers and levels */
112typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector);
113
114#define BSP_installVME_isr(vector, handler, arg) \
115        vmeUniverseInstallISR(vector, handler, arg)
116
117#define BSP_removeVME_isr(vector, handler, arg) \
118        vmeUniverseRemoveISR(vector, handler, arg)
119
120/* retrieve the currently installed ISR for a given vector */
121#define BSP_getVME_isr(vector, parg) \
122    vmeUniverseISRGet(vector, parg)
123
124#define BSP_enableVME_int_lvl(level) \
125        vmeUniverseIntEnable(level)
126
127#define BSP_disableVME_int_lvl(level) \
128        vmeUniverseIntDisable(level)
129
130/* Tell the interrupt manager that the universe driver
131 * already called openpic_eoi() and that this step hence
132 * must be omitted.
133 */
134#define BSP_PCI_VME_DRIVER_DOES_EOI
135/* don't reference vmeUniverse0PciIrqLine directly here - leave it up to
136 * bspstart() to set BSP_vme_bridge_irq. That way, we can generate variants
137 * of the BSP with / without the universe driver...
138 */
139extern int _BSP_vme_bridge_irq;
140
141#endif
Note: See TracBrowser for help on using the repository browser.