source: rtems/c/src/lib/libbsp/powerpc/shared/vme/vmeconfig.c @ 6128a4a

4.104.114.84.9
Last change on this file since 6128a4a was 046506c0, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 15, 2003 at 12:59:50 PM

2003-04-15 Joel Sherrill <joel@…>

PR 386/bsps

  • vme/vmeconfig.c: Removed declaration of _BSP_vme_bridge_irq.
  • Property mode set to 100644
File size: 2.5 KB
Line 
1/* $Id$ */
2
3/* Standard VME bridge configuration for VGM type boards */
4
5/* Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 */
6
7#include <bsp.h>
8#include <bsp/VME.h>
9#include <bsp/irq.h>
10#include <libcpu/bat.h>
11#include <libcpu/spr.h>
12#include <bsp/motorola.h>
13
14/* Use a weak alias for the VME configuration.
15 * This permits individual applications to override
16 * this routine.
17 * They may even create an 'empty'
18 *
19 *    void BSP_vme_config(void) {}
20 *
21 * which will avoid linking in the Universe driver
22 * at all :-).
23 */
24
25void BSP_vme_config(void) __attribute__ (( weak, alias("__BSP_default_vme_config") ));
26
27SPR_RO(DBAT0U)
28
29void
30__BSP_default_vme_config(void)
31{
32union {
33        struct _BATU    bat;
34        unsigned long   batbits;
35} dbat0u;
36
37  if (currentBoard < MVME_2300 || currentBoard >= MVME_1600) {
38                printk("VME bridge for this board is unknown - if it's a Tundra Universe, add the board to 'shared/vme/vmeconfig.c'\n");
39                printk("Skipping VME initialization...\n");
40                return;
41  }
42
43  vmeUniverseInit();
44  vmeUniverseReset();
45
46  /* setup a PCI area to map the VME bus */
47
48  dbat0u.batbits = _read_DBAT0U();
49
50  /* if we have page tables, BAT0 is available */
51  if (dbat0u.bat.vs || dbat0u.bat.vp) {
52        printk("WARNING: BAT0 is taken (no pagetables?); VME bridge must share PCI range for VME access\n");
53        printk("Skipping VME initialization...\n");
54        return;
55  }
56
57  setdbat(0,
58                  PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI,
59                  PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI,
60                  0x10000000,
61                  IO_PAGE);
62
63  /* map VME address ranges */
64  vmeUniverseMasterPortCfg(
65        0,
66        VME_AM_EXT_SUP_DATA,
67        _VME_A32_WIN0_ON_VME,
68        _VME_A32_WIN0_ON_PCI,
69        0x0F000000);
70  vmeUniverseMasterPortCfg(
71        1,
72        VME_AM_STD_SUP_DATA,
73        0x00000000,
74        _VME_A24_ON_PCI,
75        0x00ff0000);
76  vmeUniverseMasterPortCfg(
77        2,
78        VME_AM_SUP_SHORT_IO,
79        0x00000000,
80        _VME_A16_ON_PCI,
81        0x00010000);
82
83#ifdef _VME_DRAM_OFFSET
84  /* map our memory to VME */
85  vmeUniverseSlavePortCfg(
86        0,
87        VME_AM_EXT_SUP_DATA,
88        _VME_DRAM_OFFSET,
89        PCI_DRAM_OFFSET,
90        BSP_mem_size);
91
92  /* make sure the host bridge PCI master is enabled */
93  vmeUniverseWriteReg(
94        vmeUniverseReadReg(UNIV_REGOFF_PCI_CSR) | UNIV_PCI_CSR_BM,
95        UNIV_REGOFF_PCI_CSR);
96#endif
97
98  /* stdio is not yet initialized; the driver will revert to printk */
99  vmeUniverseMasterPortsShow(0);
100  vmeUniverseSlavePortsShow(0);
101
102  /* install the VME insterrupt manager */
103  vmeUniverseInstallIrqMgr(0,5,1,6);
104  if (vmeUniverse0PciIrqLine<0)
105        BSP_panic("Unable to get interrupt line info from PCI config");
106  _BSP_vme_bridge_irq=BSP_PCI_IRQ_LOWEST_OFFSET+vmeUniverse0PciIrqLine;
107}
Note: See TracBrowser for help on using the repository browser.