diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2007-01-19 23:01:21 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2007-01-19 23:01:21 +0000 |
commit | bc2083c176465947e3ff0edc0fae7fc20c6a3824 (patch) | |
tree | 31d23c97e1f824c456bba632f7e739ea2d8540a5 /c | |
parent | * Makefile.am, (diff) | |
download | rtems-bc2083c176465947e3ff0edc0fae7fc20c6a3824.tar.bz2 |
* mvme5500/Makefile.am, mvme5500/preinstall.am,
* mvme5500/vme/VMEConfig.h, mvme5500/vme/VME.h,
* mvme5500/vme/vmeconfig.c:
removed copies of vmeconfig.c, VME.h - use generic
versions instead.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/Makefile.am | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/preinstall.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/vme/VME.h | 141 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/vme/vmeconfig.c | 128 |
7 files changed, 28 insertions, 272 deletions
diff --git a/c/src/lib/libbsp/powerpc/ChangeLog b/c/src/lib/libbsp/powerpc/ChangeLog index bf79ed2184..27ac74ad40 100644 --- a/c/src/lib/libbsp/powerpc/ChangeLog +++ b/c/src/lib/libbsp/powerpc/ChangeLog @@ -1,5 +1,13 @@ 2007-01-19 Till Straumann <strauman@slac.stanford.edu> + * mvme5500/Makefile.am, mvme5500/preinstall.am, + * mvme5500/vme/VMEConfig.h, mvme5500/vme/VME.h, + * mvme5500/vme/vmeconfig.c: + removed copies of vmeconfig.c, VME.h - use generic + versions instead. + +2007-01-19 Till Straumann <strauman@slac.stanford.edu> + * Makefile.am, * ep1a/Makefile.am, ep1a/preinstall.am, * motorola_powerpc/Makefile.am, motorola_powerpc/preinstall.am, diff --git a/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog b/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog index 0f8c4c6be8..0ba018f04e 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog +++ b/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog @@ -1,3 +1,11 @@ +2007-01-19 Till Straumann <strauman@slac.stanford.edu> + + * mvme5500/Makefile.am, mvme5500/preinstall.am, + * mvme5500/vme/VMEConfig.h, mvme5500/vme/VME.h, + * mvme5500/vme/vmeconfig.c: + removed copies of vmeconfig.c, VME.h - use generic + versions instead. + 2006-12-15 Ralf Corsépius <ralf.corsepius@rtems.org> * network/GT64260eth.c: Use ioctl_command_t as arg to ioctl functions. diff --git a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am index 3e82f1110a..1a51c86c90 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am +++ b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am @@ -106,11 +106,12 @@ network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS) network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) endif ## -include_bsp_HEADERS += vme/VME.h vme/VMEConfig.h +include_bsp_HEADERS += ../../shared/vmeUniverse/VME.h vme/VMEConfig.h include_bsp_HEADERS += ../../shared/vmeUniverse/vmeUniverse.h noinst_PROGRAMS += vme.rel -vme_rel_SOURCES = ../../shared/vmeUniverse/vmeUniverse.c vme/vmeconfig.c +vme_rel_SOURCES = ../../shared/vmeUniverse/vmeUniverse.c +vme_rel_SOURCES+= ../shared/vme/vmeconfig.c ../shared/vme/vme_universe.c vme_rel_CPPFLAGS = $(AM_CPPFLAGS) vme_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) diff --git a/c/src/lib/libbsp/powerpc/mvme5500/preinstall.am b/c/src/lib/libbsp/powerpc/mvme5500/preinstall.am index 1eede8ccfb..8060453e4b 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/preinstall.am +++ b/c/src/lib/libbsp/powerpc/mvme5500/preinstall.am @@ -114,7 +114,7 @@ $(PROJECT_INCLUDE)/bsp/GT64260ethreg.h: network/GT64260ethreg.h $(PROJECT_INCLUD $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/GT64260ethreg.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/GT64260ethreg.h endif -$(PROJECT_INCLUDE)/bsp/VME.h: vme/VME.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) +$(PROJECT_INCLUDE)/bsp/VME.h: ../../shared/vmeUniverse/VME.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/VME.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/VME.h diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vme/VME.h b/c/src/lib/libbsp/powerpc/mvme5500/vme/VME.h deleted file mode 100644 index abc1841b8f..0000000000 --- a/c/src/lib/libbsp/powerpc/mvme5500/vme/VME.h +++ /dev/null @@ -1,141 +0,0 @@ -#ifndef RTEMS_BSP_VME_UNIVERSE_H -#define RTEMS_BSP_VME_UNIVERSE_H -/* VME.h,v 1.1.2.2 2003/03/25 16:46:01 joel Exp */ - -/* SVGM et al. BSP's VME support */ - -/* - * Authorship - * ---------- - * This software was created by - * Till Straumann <strauman@slac.stanford.edu>, 2002, - * Stanford Linear Accelerator Center, Stanford University. - * - * Acknowledgement of sponsorship - * ------------------------------ - * This software was produced by - * the Stanford Linear Accelerator Center, Stanford University, - * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * - * Government disclaimer of liability - * ---------------------------------- - * Neither the United States nor the United States Department of Energy, - * nor any of their employees, makes any warranty, express or implied, or - * assumes any legal liability or responsibility for the accuracy, - * completeness, or usefulness of any data, apparatus, product, or process - * disclosed, or represents that its use would not infringe privately owned - * rights. - * - * Stanford disclaimer of liability - * -------------------------------- - * Stanford University makes no representations or warranties, express or - * implied, nor assumes any liability for the use of this software. - * - * Stanford disclaimer of copyright - * -------------------------------- - * Stanford University, owner of the copyright, hereby disclaims its - * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * - * Maintenance of notices - * ---------------------- - * In the interest of clarity regarding the origin and status of this - * SLAC software, this and all the preceding Stanford University notices - * are to remain affixed to any copy or derivative of this software made - * or distributed by the recipient and are to be affixed to any copy of - * software made or distributed by the recipient that contains a copy or - * derivative of this software. - * - * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ - -/* pull in bsp.h */ -#include <bsp.h> -/* our VME bridge */ -#include <bsp/vmeUniverse.h> -/* our address space configuration */ -#include <bsp/VMEConfig.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. - */ - -#define BSP_vme_init() \ - vmeUniverseInit - -/* 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); -} - -#define BSP_localdram2vme_fast(localaddr) \ - ((localaddr)+_VME_DRAM_OFFSET) - -/* 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) - -/* 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 -/* 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... - */ -extern int _BSP_vme_bridge_irq; - -#endif diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h b/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h index 7bc0c8e44a..0fdbfc9d0e 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h +++ b/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h @@ -14,6 +14,9 @@ #define _VME_A24_ON_PCI 0x9f000000 #define _VME_A16_ON_PCI 0x9fff0000 +/* Reuse BAT 0 for VME */ +#define BSP_VME_BAT_IDX 0 + /* start of the A32 window on the VME bus * TODO: this should perhaps be a configuration option */ @@ -25,4 +28,9 @@ */ #define _VME_DRAM_OFFSET 0x90000000 +#define BSP_VME_UNIVERSE_INSTALL_IRQ_MGR \ + do { \ + vmeUniverseInstallIrqMgr(0,64+12,1,64+13); \ + } while (0) + #endif diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vme/vmeconfig.c b/c/src/lib/libbsp/powerpc/mvme5500/vme/vmeconfig.c deleted file mode 100644 index 36bffd6fa0..0000000000 --- a/c/src/lib/libbsp/powerpc/mvme5500/vme/vmeconfig.c +++ /dev/null @@ -1,128 +0,0 @@ -/* vmeconfig.c,v 1.1.2.2 2003/03/25 16:46:01 joel Exp */ - -/* Standard VME bridge configuration for PPC boards */ - -/* - * Authorship - * ---------- - * This software was created by - * Till Straumann <strauman@slac.stanford.edu>, 3/2002, - * Stanford Linear Accelerator Center, Stanford University. - * - * Acknowledgement of sponsorship - * ------------------------------ - * This software was produced by - * the Stanford Linear Accelerator Center, Stanford University, - * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * - * Government disclaimer of liability - * ---------------------------------- - * Neither the United States nor the United States Department of Energy, - * nor any of their employees, makes any warranty, express or implied, or - * assumes any legal liability or responsibility for the accuracy, - * completeness, or usefulness of any data, apparatus, product, or process - * disclosed, or represents that its use would not infringe privately owned - * rights. - * - * Stanford disclaimer of liability - * -------------------------------- - * Stanford University makes no representations or warranties, express or - * implied, nor assumes any liability for the use of this software. - * - * Stanford disclaimer of copyright - * -------------------------------- - * Stanford University, owner of the copyright, hereby disclaims its - * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * - * Maintenance of notices - * ---------------------- - * In the interest of clarity regarding the origin and status of this - * SLAC software, this and all the preceding Stanford University notices - * are to remain affixed to any copy or derivative of this software made - * or distributed by the recipient and are to be affixed to any copy of - * software made or distributed by the recipient that contains a copy or - * derivative of this software. - * - * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 - */ - -/* Copyright 2004, Brookhaven National Lab. and S. Kate Feng <feng1@bnl.gov> - * Modified to support the MVME5500, 3/2004 - */ - -#include <bsp.h> -#include <bsp/VME.h> -#include <bsp/irq.h> -#include <libcpu/bat.h> - -/* Use a weak alias for the VME configuration. - * This permits individual applications to override - * this routine. - * They may even create an 'empty' - * - * void BSP_vme_config(void) {} - * - * which will avoid linking in the Universe driver - * at all :-). - */ - -void BSP_vme_config(void) __attribute__ (( weak, alias("__BSP_default_vme_config") )); - -void -__BSP_default_vme_config(void) -{ - - vmeUniverseInit(); - vmeUniverseReset(); - - /* setup a PCI0 area to map the VME bus */ - setdbat(0,_VME_A32_WIN0_ON_PCI, _VME_A32_WIN0_ON_PCI, 0x10000000, IO_PAGE); - - /* map VME address ranges */ - vmeUniverseMasterPortCfg( - 0, - VME_AM_EXT_SUP_DATA, - _VME_A32_WIN0_ON_VME, - _VME_A32_WIN0_ON_PCI, - 0x0F000000); - vmeUniverseMasterPortCfg( - 1, - VME_AM_STD_SUP_DATA, - 0x00000000, - _VME_A24_ON_PCI, - 0x00ff0000); - vmeUniverseMasterPortCfg( - 2, - VME_AM_SUP_SHORT_IO, - 0x00000000, - _VME_A16_ON_PCI, - 0x00010000); - -#ifdef _VME_DRAM_OFFSET - /* map our memory to VME */ - vmeUniverseSlavePortCfg( - 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); - - /* install the VME insterrupt manager */ - vmeUniverseInstallIrqMgr(0,64+12,1,64+13); - if (vmeUniverse0PciIrqLine<0) - BSP_panic("Unable to get interrupt line info from PCI config"); - _BSP_vme_bridge_irq= BSP_GPP_IRQ_LOWEST_OFFSET+vmeUniverse0PciIrqLine; - /* install alternate resetter TODO - __BSP_alternate_reset = vmeUniverseResetBus;*/ -} |