From a771462e6b62c9c2147d533601332de40ab1ce4c Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Wed, 31 Jan 2007 03:40:58 +0000 Subject: 2007-01-30 Till Straumann * Makefile.am, preinstall.am, include/bsp.h, * vme/vmeconfig.c (removed), vme/VMEConfig.h (added): cleaned up vme support - use files from libbsp/powerpc/shared/vme and define BSP specifica in VMEConfig.h. Use VME DMA support implemented by vmeUniverse and libbsp/powerpc/shared/vme/vme_universe_dma.c --- c/src/lib/libbsp/powerpc/ep1a/ChangeLog | 9 ++ c/src/lib/libbsp/powerpc/ep1a/Makefile.am | 13 +- c/src/lib/libbsp/powerpc/ep1a/include/bsp.h | 15 +++ c/src/lib/libbsp/powerpc/ep1a/preinstall.am | 14 +- c/src/lib/libbsp/powerpc/ep1a/vme/VMEConfig.h | 104 +++++++++++++++ c/src/lib/libbsp/powerpc/ep1a/vme/vmeconfig.c | 178 -------------------------- 6 files changed, 151 insertions(+), 182 deletions(-) create mode 100644 c/src/lib/libbsp/powerpc/ep1a/vme/VMEConfig.h delete mode 100644 c/src/lib/libbsp/powerpc/ep1a/vme/vmeconfig.c (limited to 'c') diff --git a/c/src/lib/libbsp/powerpc/ep1a/ChangeLog b/c/src/lib/libbsp/powerpc/ep1a/ChangeLog index 66357c43e7..6888a03bec 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/ChangeLog +++ b/c/src/lib/libbsp/powerpc/ep1a/ChangeLog @@ -1,3 +1,12 @@ +2007-01-30 Till Straumann + + * Makefile.am, preinstall.am, include/bsp.h, + * vme/vmeconfig.c (removed), vme/VMEConfig.h (added): + cleaned up vme support - use files from libbsp/powerpc/shared/vme + and define BSP specifica in VMEConfig.h. + Use VME DMA support implemented by vmeUniverse and + libbsp/powerpc/shared/vme/vme_universe_dma.c + 2006-12-02 Ralf Corsépius * configure.ac: New BUG-REPORT address. diff --git a/c/src/lib/libbsp/powerpc/ep1a/Makefile.am b/c/src/lib/libbsp/powerpc/ep1a/Makefile.am index 1c022ec8fc..44f1153342 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/Makefile.am +++ b/c/src/lib/libbsp/powerpc/ep1a/Makefile.am @@ -91,12 +91,19 @@ vectors_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) ## include_bsp_HEADERS += ../../shared/vmeUniverse/vmeUniverse.h \ - ../../powerpc/shared/vme/VMEConfig.h \ + vme/VMEConfig.h \ ../../shared/vmeUniverse/vme_am_defs.h \ - ../../shared/vmeUniverse/VME.h + ../../shared/vmeUniverse/VME.h \ + ../../shared/vmeUniverse/vmeUniverseDMA.h\ + ../../shared/vmeUniverse/bspVmeDmaList.h\ + ../../shared/vmeUniverse/VMEDMA.h noinst_PROGRAMS += vme.rel -vme_rel_SOURCES = ../../shared/vmeUniverse/vmeUniverse.c vme/vmeconfig.c \ +vme_rel_SOURCES = ../../shared/vmeUniverse/vmeUniverse.c \ + ../../shared/vmeUniverse/bspVmeDmaList.c \ + ../shared/vme/vmeconfig.c \ + ../shared/vme/vme_universe_dma.c \ + ../shared/vme/vme_universe.c \ ../../shared/vmeUniverse/vme_am_defs.h vme_rel_CPPFLAGS = $(AM_CPPFLAGS) vme_rel_LDFLAGS = $(RTEMS_RELLDFLAGS) diff --git a/c/src/lib/libbsp/powerpc/ep1a/include/bsp.h b/c/src/lib/libbsp/powerpc/ep1a/include/bsp.h index 8b6c72db33..712d61a1f7 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/include/bsp.h +++ b/c/src/lib/libbsp/powerpc/ep1a/include/bsp.h @@ -129,6 +129,21 @@ * This is an offset from EUMBBAR */ #define BSP_OPEN_PIC_BASE_OFFSET 0x40000 + +/* BSP_PIC_DO_EOI is optionally used by the 'vmeUniverse' driver + * to implement VME IRQ priorities in software. + * Note that this requires support by the interrupt controller + * driver (cf. libbsp/shared/powerpc/irq/openpic_i8259_irq.c) + * and the BSP-specific universe initialization/configuration + * (cf. libbsp/shared/powerpc/vme/VMEConfig.h vme_universe.c) + * + * ********* IMPORTANT NOTE ******** + * When deriving from this file (new BSPs) + * DO NOT define "BSP_PIC_DO_EOI" if you don't know what + * you are doing i.e., w/o implementing the required pieces + * mentioned above. + * ********* IMPORTANT NOTE ******** + */ #define BSP_PIC_DO_EOI openpic_eoi(0) diff --git a/c/src/lib/libbsp/powerpc/ep1a/preinstall.am b/c/src/lib/libbsp/powerpc/ep1a/preinstall.am index 6b43ab716b..26b7a8b95d 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/preinstall.am +++ b/c/src/lib/libbsp/powerpc/ep1a/preinstall.am @@ -101,7 +101,7 @@ $(PROJECT_INCLUDE)/bsp/vmeUniverse.h: ../../shared/vmeUniverse/vmeUniverse.h $(P $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vmeUniverse.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vmeUniverse.h -$(PROJECT_INCLUDE)/bsp/VMEConfig.h: ../../powerpc/shared/vme/VMEConfig.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) +$(PROJECT_INCLUDE)/bsp/VMEConfig.h: vme/VMEConfig.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/VMEConfig.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/VMEConfig.h @@ -113,6 +113,18 @@ $(PROJECT_INCLUDE)/bsp/VME.h: ../../shared/vmeUniverse/VME.h $(PROJECT_INCLUDE)/ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/VME.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/VME.h +$(PROJECT_INCLUDE)/bsp/vmeUniverseDMA.h: ../../shared/vmeUniverse/vmeUniverseDMA.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vmeUniverseDMA.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vmeUniverseDMA.h + +$(PROJECT_INCLUDE)/bsp/bspVmeDmaList.h: ../../shared/vmeUniverse/bspVmeDmaList.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bspVmeDmaList.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bspVmeDmaList.h + +$(PROJECT_INCLUDE)/bsp/VMEDMA.h: ../../shared/vmeUniverse/VMEDMA.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/VMEDMA.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/VMEDMA.h + $(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT) TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT) diff --git a/c/src/lib/libbsp/powerpc/ep1a/vme/VMEConfig.h b/c/src/lib/libbsp/powerpc/ep1a/vme/VMEConfig.h new file mode 100644 index 0000000000..4610b630ee --- /dev/null +++ b/c/src/lib/libbsp/powerpc/ep1a/vme/VMEConfig.h @@ -0,0 +1,104 @@ +#ifndef RTEMS_BSP_VME_CONFIG_H +#define RTEMS_BSP_VME_CONFIG_H +/* $Id$ */ + +/* BSP specific address space configuration parameters */ + +/* + * Authorship + * ---------- + * This software was created by + * Till Straumann , 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 + */ +/* + * The BSP maps VME address ranges into + * one BAT. + * NOTE: the BSP (startup/bspstart.c) uses + * hardcoded window lengths that match this + * layout: + * + * BSP_VME_BAT_IDX defines + * which BAT to use for mapping the VME bus. + * If this is undefined, no extra BAT will be + * configured and VME has to share the available + * PCI address space with PCI devices. + */ +#undef BSP_VME_BAT_IDX + +#define _VME_A32_WIN0_ON_PCI 0x10000000 +#define _VME_A24_ON_PCI 0x1f000000 +#define _VME_A16_ON_PCI 0x1fff0000 + +/* start of the A32 window on the VME bus + * TODO: this should perhaps be a configuration option + */ +#define _VME_A32_WIN0_ON_VME 0x20000000 + +/* if _VME_DRAM_OFFSET is defined, the BSP + * will map our RAM onto the VME bus, starting + * at _VME_DRAM_OFFSET + */ +#undef _VME_DRAM_OFFSET + +#undef _VME_CSR_ON_PCI + +/* 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; + +extern int BSP_VMEInit(); +extern int BSP_VMEIrqMgrInstall(); + +#define BSP_VME_UNIVERSE_INSTALL_IRQ_MGR \ + do { \ + vmeUniverseInstallIrqMgr(0,5,1,6); \ + } while (0) + +#endif diff --git a/c/src/lib/libbsp/powerpc/ep1a/vme/vmeconfig.c b/c/src/lib/libbsp/powerpc/ep1a/vme/vmeconfig.c deleted file mode 100644 index b430d4eabc..0000000000 --- a/c/src/lib/libbsp/powerpc/ep1a/vme/vmeconfig.c +++ /dev/null @@ -1,178 +0,0 @@ -/* Standard VME bridge configuration for VGM type boards */ - -/* - * $Id$ - * - * Authorship - * ---------- - * This software was created by - * Till Straumann , 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 - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* 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") )); - -SPR_RO(DBAT0U) - -extern uint32_t VME_Slot1; - -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(); - - /* 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 -#if 0 - if (VME_Slot1){ - /* map our memory to VME */ -printk("vmeUniverseSlavePortCfg length of 0x%x\n", BSP_mem_size); - vmeUniverseSlavePortCfg( - 0, - VME_AM_EXT_SUP_DATA, - _VME_DRAM_32_OFFSET1, - PCI_DRAM_OFFSET, - BSP_mem_size); -printk("vmeUniverseSlavePortCfg length of 0x%x\n", _VME_A24_SIZE); - vmeUniverseSlavePortCfg( - 1, - VME_AM_STD_SUP_DATA, - _VME_DRAM_24_OFFSET1, - PCI_DRAM_OFFSET, - _VME_A24_SIZE); -printk("vmeUniverseSlavePortCfg length of 0x%x\n", _VME_A16_SIZE); - vmeUniverseSlavePortCfg( - 2, - VME_AM_SUP_SHORT_IO, - _VME_DRAM_16_OFFSET1, - PCI_DRAM_OFFSET, - _VME_A16_SIZE); - } - else { -printk("vmeUniverseSlavePortCfg length of 0x%x\n", BSP_mem_size); - vmeUniverseSlavePortCfg( - 0, - VME_AM_EXT_SUP_DATA, - _VME_DRAM_32_OFFSET2, - PCI_DRAM_OFFSET, - BSP_mem_size); -printk("vmeUniverseSlavePortCfg length of 0x%x\n", _VME_A24_SIZE); - vmeUniverseSlavePortCfg( - 1, - VME_AM_STD_SUP_DATA, - _VME_DRAM_24_OFFSET2, - PCI_DRAM_OFFSET, - _VME_A24_SIZE); -printk("vmeUniverseSlavePortCfg length of 0x%x\n", _VME_A16_SIZE); - vmeUniverseSlavePortCfg( - 2, - VME_AM_SUP_SHORT_IO, - _VME_DRAM_16_OFFSET2, - PCI_DRAM_OFFSET, - _VME_A16_SIZE); - } -#endif - - /* 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,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; -} -- cgit v1.2.3