Changeset 32a0058 in rtems


Ignore:
Timestamp:
Jan 31, 2007, 3:57:55 AM (14 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
c1b34d5
Parents:
9b28179d
Message:

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

  • shared/vme/VMEConfig.h: Added more comments about the semantics of the various symbols BSPs should define in this file. Removed declarations of BSP_VMEInit(), BSP_VMEIrqMgrInstall().
  • shared/vme/vmeconfig.c: declare BSP_VMEInit(), BSP_VMEIrqMgrInstall() here.
  • Makefile.am, shared/vme/README,
  • shared/vme/vme_universe_dma.c (added): Added glue code implementing the VMEDMA.h API using the vmeUniverse driver.
Location:
c/src/lib/libbsp/powerpc
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/ChangeLog

    r9b28179d r32a0058  
     12007-01-29      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * shared/vme/VMEConfig.h:
     4        Added more comments about the semantics of the various
     5        symbols BSPs should define in this file.
     6        Removed declarations of BSP_VMEInit(), BSP_VMEIrqMgrInstall().
     7
     8        * shared/vme/vmeconfig.c: declare BSP_VMEInit(),
     9        BSP_VMEIrqMgrInstall() here.
     10
     11        * Makefile.am, shared/vme/README,
     12        * shared/vme/vme_universe_dma.c (added): Added glue code
     13        implementing the VMEDMA.h API using the vmeUniverse driver.
     14
    1152007-01-20      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
    216
  • c/src/lib/libbsp/powerpc/Makefile.am

    r9b28179d r32a0058  
    6464## shared/vme
    6565EXTRA_DIST += shared/vme/vmeconfig.c shared/vme/VMEConfig.h
    66         shared/vme/README shared/vme/vme_universe.c
     66        shared/vme/README shared/vme/vme_universe.c shared/vme/vme_universe_dma.c
    6767
    6868include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/powerpc/shared/vme/README

    r9b28179d r32a0058  
    1 VME.h:          VME API; BSP and bridge-chip independent
     1libbsp/shared/vmeUniverse/VME.h: VME API; BSP and bridge-chip independent
    22VMEConfig.h:    defines BSP specific constants for VME configuration
    33vmeconfig.c     configures the VME bridge using the VME.h API calls
     
    55                Independent of the bridge chip, however.
    66vme_universe.c: implements VME.h for the vmeUniverse driver.
     7vme_universe_dma.c: implements VMEDMA.h for the vmeUniverse driver.
    78
    8 o  other universe BSP     --> use its own vmeConfig.h; may reuse vmeconfig.c, vme_universe.c
     9o  other universe BSP     --> use its own VMEConfig.h; may reuse vmeconfig.c, vme_universe.c
    910o  other non-universe BSP --> use its own VMEConfig.h and vme_xxx.c; may reuse vmeconfig.c
  • c/src/lib/libbsp/powerpc/shared/vme/VMEConfig.h

    r9b28179d r32a0058  
    4949 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
    5050 */
     51
    5152/*
    5253 * The BSP maps VME address ranges into
     
    6162 * configured and VME has to share the available
    6263 * PCI address space with PCI devices.
     64 *
     65 * If you do define BSP_VME_BAT_IDX you must
     66 * make sure the corresponding BAT is really
     67 * available and unused!
    6368 */
    6469
     
    7681
    7782/* start of the A32 window on the VME bus
    78  * TODO: this should perhaps be a configuration option
     83 * TODO: this should perhaps be a run-time configuration option
    7984 */
    8085#define _VME_A32_WIN0_ON_VME    0x20000000
    8186
    8287/* if _VME_DRAM_OFFSET is defined, the BSP
    83  * will map our RAM onto the VME bus, starting
     88 * will map the board RAM onto the VME bus, starting
    8489 * at _VME_DRAM_OFFSET
    8590 */
    8691#define _VME_DRAM_OFFSET                0xc0000000
    8792
    88 /* Tell the interrupt manager that the universe driver
    89  * already called openpic_eoi() and that this step hence
    90  * must be omitted.
    91  */
    92 
     93/* Define BSP_PCI_VME_DRIVER_DOES_EOI to let the vmeUniverse
     94 * driver (Tsi148 driver doesn't implement this) implement
     95 * VME IRQ priorities in software.
     96 *
     97 * Here's how this works:
     98 *
     99 *    1) VME IRQ happens
     100 *    2) universe propagates IRQ to PCI/PPC/main interrupt
     101 *       controller ('PIC' - programmable interrupt controller).
     102 *    3) PIC driver dispatches universe driver's ISR
     103 *    4) universe driver ISR acknowledges IRQ on VME,
     104 *       determines VME vector.
     105 * ++++++++++++ stuff between ++ signs is related to SW priorities +++++++++
     106 *    5) universe driver *masks* all VME IRQ levels <= interrupting
     107 *       level.
     108 *    6) universe driver calls PIC driver's 'EOI' routine.
     109 *       This effectively re-enables PCI and hence higher
     110 *       level VME interrupts.
     111 *    7) universe driver dispatches user VME ISR.
     112 *
     113 * ++>> HIGHER PRIORITY VME IRQ COULD HAPPEN HERE and would be handled <<++
     114 *
     115 *    8) user ISR returns, universe driver re-enables lower
     116 *       level VME interrupts, returns.
     117 *    9) universe driver ISR returns control to PIC driver
     118 *   10) PIC driver *omits* regular EOI sequence since this
     119 *       was already done by universe driver (step 6).
     120 * ++++++++++++ end of special handling (SW priorities) ++++++++++++++++++++
     121 *   11) PIC driver ISR dispatcher returns.
     122 *
     123 * Note that the BSP *MUST* provide the following hooks
     124 * in order for this to work:
     125 *   a) bsp.h must define the symbol BSP_PIC_DO_EOI to
     126 *      a sequence of instructions that terminates an
     127 *      interrupt at the interrupt controller.
     128 *   b) The interrupt controller driver must check the
     129 *      interrupt source and *must omit* running the EOI
     130 *      sequence if the interrupt source is the vmeUniverse
     131 *      (because the universe driver already ran BSP_PIC_DO_EOI)
     132 *      The interrupt controller must define the variable
     133 *
     134 *          int _BSP_vme_bridge_irq = -1;
     135 *
     136 *      which is assigned the universe's interrupt line information
     137 *      by vme_universe.c:BSP_VMEIrqMgrInstall(). The interrupt
     138 *      controller driver may use this variable to determine
     139 *      if an IRQ was caused by the universe.
     140 *
     141 *   c) define BSP_PCI_VME_DRIVER_DOES_EOI
     142 *
     143 *  NOTE: If a) and b) are not implemented by the BSP
     144 *        BSP_PCI_VME_DRIVER_DOES_EOI must be *undefined*.
     145 */
    93146#define BSP_PCI_VME_DRIVER_DOES_EOI
    94 /* don't reference vmeUniverse0PciIrqLine directly here - leave it up to
    95  * bspstart() to set BSP_vme_bridge_irq. That way, we can generate variants
    96  * of the BSP with / without the universe driver...
     147
     148#ifdef BSP_PCI_VME_DRIVER_DOES_EOI
     149/* don't reference vmeUniverse0PciIrqLine directly from the irq
     150 * controller driver - leave it up to BSP_VMEIrqMgrInstall() to
     151 * set _BSP_vme_bridge_irq. That way, we can avoid linking
     152 * the universe driver if VME is unused...
    97153 */
    98154extern int _BSP_vme_bridge_irq;
    99 
    100 extern int BSP_VMEInit();
    101 extern int BSP_VMEIrqMgrInstall();
     155#endif
     156
     157/* If your BSP requires a non-standard way to configure
     158 * the VME interrupt manager then define the symbol
     159 *
     160 * BSP_VME_UNIVERSE_INSTALL_IRQ_MGR
     161 *
     162 * to a proper instruction sequence that installs the
     163 * universe interrupt manager. This requires knowledge
     164 * of the wiring between the universe and the PIC (main
     165 * interrupt controller), i.e., which IRQ 'pins' of the
     166 * universe are wired to which 'lines'/inputs at the PIC.
     167 * (consult vmeUniverse.h for more information).
     168 *
     169 * When installing the universe IRQ manager it is also
     170 * possible to specify whether it should try to share
     171 * PIC interrupts with other sources. This might not
     172 * be supported by all BSPs (but the unverse driver
     173 * recognizes that).
     174 *
     175 * If BSP_VME_UNIVERSE_INSTALL_IRQ_MGR is undefined then
     176 * the default algorithm is used (vme_universe.c):
     177 *
     178 * This default setup uses only a single wire. It reads
     179 * the PIC 'line' from PCI configuration space and assumes
     180 * this to be wired to the first (LIRQ0) IRQ input at the
     181 * universe. The default setup tries to use interrupt
     182 * sharing.
     183 */
    102184
    103185#include <bsp/motorola.h>
  • c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c

    r9b28179d r32a0058  
    5555#include <libcpu/bat.h>
    5656#include <rtems/bspIo.h>
     57
     58extern int BSP_VMEInit();
     59extern int BSP_VMEIrqMgrInstall();
    5760
    5861/* Use a weak alias for the VME configuration.
Note: See TracChangeset for help on using the changeset viewer.