diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2005-11-04 08:10:42 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2005-11-04 08:10:42 +0000 |
commit | 6d3ff66f7a7480edabac28dece38f3381460b99f (patch) | |
tree | 8bebcd1ae8a3a2782350a1ad29734856271f34e7 /c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c | |
parent | Cosmetics (diff) | |
download | rtems-6d3ff66f7a7480edabac28dece38f3381460b99f.tar.bz2 |
2005-11-03 Till Straumann <strauman@slac.stanford.edu>
* shared/vme/README, shared/vme/vme_universe.c: New files.
* Makefile.am, motorola_powerpc/Makefile.am, mvme5500/vme/vmeconfig.c,
shared/vme/VME.h, shared/vme/VMEConfig.h, shared/vme/vmeconfig.c:
Several VME related upgrades and fixes, hopefully addressing PR#835:
Separated API, API-implementation by a specific VME bridge driver and
BSP-specific configuration of the driver into different files,
describing their purpose in a README. All of these changes use the
upgraded vmeUniverse.c driver.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c b/c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c index 15baf84d15..e951acf51c 100644 --- a/c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c +++ b/c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c @@ -1,15 +1,16 @@ /* $Id$ */ -/* Standard VME bridge configuration for VGM type boards */ +/* Default VME bridge configuration - note that this file + * is independent of the bridge driver/chip + */ /* Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 */ #include <bsp.h> #include <bsp/VME.h> -#include <bsp/irq.h> +#include <bsp/VMEConfig.h> #include <libcpu/bat.h> -#include <libcpu/spr.h> -#include <bsp/motorola.h> +#include <rtems/bspIo.h> /* Use a weak alias for the VME configuration. * This permits individual applications to override @@ -24,50 +25,38 @@ void BSP_vme_config(void) __attribute__ (( weak, alias("__BSP_default_vme_config") )); -SPR_RO(DBAT0U) - void __BSP_default_vme_config(void) { -union { - struct _BATU bat; - unsigned long batbits; -} dbat0u; - - vmeUniverseInit(); - vmeUniverseReset(); - /* setup a PCI area to map the VME bus */ - dbat0u.batbits = _read_DBAT0U(); - - /* if we have page tables, BAT0 is available */ - if (dbat0u.bat.vs || dbat0u.bat.vp) { - printk("WARNING: BAT0 is taken (no pagetables?); " - "VME bridge must share PCI range for VME access\n" - "Skipping VME initialization...\n"); + if ( BSP_VMEInit() ) { + printk("Skipping VME initialization...\n"); return; } - setdbat(0, +#ifdef BSP_VME_BAT_IDX + /* setup a PCI area to map the VME bus */ + setdbat(BSP_VME_BAT_IDX, PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI, PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI, 0x10000000, IO_PAGE); +#endif /* map VME address ranges */ - vmeUniverseMasterPortCfg( + BSP_VMEOutboundPortCfg( 0, VME_AM_EXT_SUP_DATA, _VME_A32_WIN0_ON_VME, _VME_A32_WIN0_ON_PCI, 0x0F000000); - vmeUniverseMasterPortCfg( + BSP_VMEOutboundPortCfg( 1, VME_AM_STD_SUP_DATA, 0x00000000, _VME_A24_ON_PCI, 0x00ff0000); - vmeUniverseMasterPortCfg( + BSP_VMEOutboundPortCfg( 2, VME_AM_SUP_SHORT_IO, 0x00000000, @@ -76,26 +65,17 @@ union { #ifdef _VME_DRAM_OFFSET /* map our memory to VME */ - vmeUniverseSlavePortCfg( + BSP_VMEInboundPortCfg( 0, VME_AM_EXT_SUP_DATA, _VME_DRAM_OFFSET, PCI_DRAM_OFFSET, BSP_mem_size); - - /* make sure the host bridge PCI master is enabled */ - vmeUniverseWriteReg( - vmeUniverseReadReg(UNIV_REGOFF_PCI_CSR) | UNIV_PCI_CSR_BM, - UNIV_REGOFF_PCI_CSR); #endif /* stdio is not yet initialized; the driver will revert to printk */ - vmeUniverseMasterPortsShow(0); - vmeUniverseSlavePortsShow(0); + BSP_VMEOutboundPortsShow(0); + BSP_VMEInboundPortsShow(0); - /* install the VME insterrupt manager */ - vmeUniverseInstallIrqMgr(0,5,1,6); - if (vmeUniverse0PciIrqLine<0) - BSP_panic("Unable to get interrupt line info from PCI config"); - _BSP_vme_bridge_irq=BSP_PCI_IRQ_LOWEST_OFFSET+vmeUniverse0PciIrqLine; + BSP_VMEIrqMgrInstall(); } |