diff options
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/vme/VME.h')
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/vme/VME.h | 127 |
1 files changed, 49 insertions, 78 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/vme/VME.h b/c/src/lib/libbsp/powerpc/shared/vme/VME.h index a7aea8a3bd..6b2e1bba84 100644 --- a/c/src/lib/libbsp/powerpc/shared/vme/VME.h +++ b/c/src/lib/libbsp/powerpc/shared/vme/VME.h @@ -1,98 +1,69 @@ -#ifndef RTEMS_BSP_VME_UNIVERSE_H -#define RTEMS_BSP_VME_UNIVERSE_H +#ifndef RTEMS_BSP_VME_API_H +#define RTEMS_BSP_VME_API_H /* $Id$ */ /* SVGM et al. BSP's VME support */ /* Author: Till Straumann, <strauman@slac.stanford.edu> */ -/* pull in bsp.h */ -#include <bsp.h> -/* our VME bridge */ -#include <bsp/vmeUniverse.h> -/* our address space configuration */ -#include <bsp/VMEConfig.h> +#include <stdio.h> + +/* address modifiers & friends */ +#include <bsp/vme_am_defs.h> /* VME related declarations */ -/* how to map a VME address to the CPU local bus. - * Note that this traverses two bridges: - * the grackle and the universe. For the - * Universe, there is a lookup procedure while - * we assume a 1:1 mapping for the grackle... - */ -/* NOTE about the fast mapping macros: - * using these macros is only safe if the user app - * does _NOT_ change the universe mappings! - * While changing the PCI windows probably doesn't - * make much sense (involves changing the MMU/DBATs as well), - * The user might wish to change the VME address - * layout, i.e. by remapping _VME_A32_WIN0_ON_VME - * and _VME_DRAM_OFFSET... - * Hence, using the A24 and A16 macros is probably safe. +/* + * BSP-specific configuration routine; sets up + * VME windows and installs the VME interrupt manager. */ - -#define BSP_vme_init() \ - vmeUniverseInit +void BSP_vme_config() __attribute__((weak)); /* translate through host bridge and vme master window of vme bridge */ -static inline int -BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr) -{ -int rval=vmeUniverseXlateAddr(1,0,am,vmeaddr,plocaladdr); - *plocaladdr+=PCI_MEM_BASE; - return rval; -} - -/* when using this macro, the universe setup MUST NOT BE - * CHANGED by the application... - */ -#define BSP_vme2local_A32_fast(vmeaddr) \ - ((vmeaddr)-_VME_A32_WIN0_ON_VME + _VME_A32_WIN0_ON_PCI + PCI_MEM_BASE) -#define BSP_vme2local_A24_fast(vmeaddr) \ - (((vmeaddr)&0x7ffffff)+_VME_A24_ON_PCI + PCI_MEM_BASE) -#define BSP_vme2local_A16_fast(vmeaddr) \ - (((vmeaddr)&0xffff)+_VME_A16_ON_PCI + PCI_MEM_BASE) - -/* how a CPU address is mapped to the VME bus (if at all) - */ -static inline int -BSP_local2vme_adrs(unsigned am, unsigned long localaddr, unsigned long *pvmeaddr) -{ -return vmeUniverseXlateAddr(0, 0, am,localaddr+PCI_DRAM_OFFSET,pvmeaddr); -} +int +BSP_vme2local_adrs(unsigned long am, unsigned long vmeaddr, unsigned long *plocaladdr); -#define BSP_localdram2vme_fast(localaddr) \ - ((localaddr)+_VME_DRAM_OFFSET) +/* how a CPU address is mapped to the VME bus (if at all) */ +int +BSP_local2vme_adrs(unsigned long am, unsigned long localaddr, unsigned long *pvmeaddr); /* interrupt handlers and levels */ typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector); -#define BSP_installVME_isr(vector, handler, arg) \ - vmeUniverseInstallISR(vector, handler, arg) - -#define BSP_removeVME_isr(vector, handler, arg) \ - vmeUniverseRemoveISR(vector, handler, arg) +int +BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg); +int +BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg); /* retrieve the currently installed ISR for a given vector */ -#define BSP_getVME_isr(vector, parg) \ - vmeUniverseISRGet(vector, parg) - -#define BSP_enableVME_int_lvl(level) \ - vmeUniverseIntEnable(level) - -#define BSP_disableVME_int_lvl(level) \ - vmeUniverseIntDisable(level) - -/* Tell the interrupt manager that the universe driver - * already called openpic_eoi() and that this step hence - * must be omitted. - */ -#define BSP_PCI_VME_DRIVER_DOES_EOI -extern int _BSP_vme_bridge_irq; -/* don't reference vmeUniverse0PciIrqLine directly here - leave it up to - * bspstart() to set BSP_vme_bridge_irq. That way, we can generate variants - * of the BSP with / without the universe driver... - */ -#define BSP_PCI_VME_BRIDGE_IRQ _BSP_vme_bridge_irq +BSP_VME_ISR_t +BSP_getVME_isr(unsigned long vector, void **parg); + +int +BSP_enableVME_int_lvl(unsigned int level); + +int +BSP_disableVME_int_lvl(unsigned int level); + +int +BSP_VMEOutboundPortCfg( + unsigned long port, + unsigned long address_space, + unsigned long vme_address, + unsigned long pci_address, + unsigned long size); + +int +BSP_VMEInboundPortCfg( + unsigned long port, + unsigned long address_space, + unsigned long vme_address, + unsigned long pci_address, + unsigned long size); + +void +BSP_VMEOutboundPortsShow(FILE *f); + +void +BSP_VMEInboundPortsShow(FILE *f); #endif |