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

4.104.114.84.9
Last change on this file since e79a1947 was e79a1947, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 10, 2004 at 11:51:17 PM

2004-11-10 Richard Campbell <richard.campbell@…>

  • Makefile.am, bootloader/misc.c, bootloader/pci.c, bootloader/pci.h, console/console.c, console/inch.c, console/reboot.c, console/uart.c, console/uart.h, irq/irq.c, irq/irq.h, irq/irq_init.c, motorola/motorola.c, motorola/motorola.h, openpic/openpic.c, openpic/openpic.h, pci/detect_raven_bridge.c, pci/pci.c, start/start.S, startup/bspstart.c, vectors/vectors_init.c, vme/vmeconfig.c: Add MVME2100 BSP and MPC8240 support. There was also a significant amount of spelling and whitespace cleanup.
  • tod/todcfg.c: New file.
  • Property mode set to 100644
File size: 2.3 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  vmeUniverseInit();
38  vmeUniverseReset();
39  /* setup a PCI area to map the VME bus */
40
41  dbat0u.batbits = _read_DBAT0U();
42
43  /* if we have page tables, BAT0 is available */
44  if (dbat0u.bat.vs || dbat0u.bat.vp) {
45        printk("WARNING: BAT0 is taken (no pagetables?); "
46               "VME bridge must share PCI range for VME access\n"
47               "Skipping VME initialization...\n");
48        return;
49  }
50
51  setdbat(0,
52                  PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI,
53                  PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI,
54                  0x10000000,
55                  IO_PAGE);
56
57  /* map VME address ranges */
58  vmeUniverseMasterPortCfg(
59        0,
60        VME_AM_EXT_SUP_DATA,
61        _VME_A32_WIN0_ON_VME,
62        _VME_A32_WIN0_ON_PCI,
63        0x0F000000);
64  vmeUniverseMasterPortCfg(
65        1,
66        VME_AM_STD_SUP_DATA,
67        0x00000000,
68        _VME_A24_ON_PCI,
69        0x00ff0000);
70  vmeUniverseMasterPortCfg(
71        2,
72        VME_AM_SUP_SHORT_IO,
73        0x00000000,
74        _VME_A16_ON_PCI,
75        0x00010000);
76
77#ifdef _VME_DRAM_OFFSET
78  /* map our memory to VME */
79  vmeUniverseSlavePortCfg(
80        0,
81        VME_AM_EXT_SUP_DATA,
82        _VME_DRAM_OFFSET,
83        PCI_DRAM_OFFSET,
84        BSP_mem_size);
85
86  /* make sure the host bridge PCI master is enabled */
87  vmeUniverseWriteReg(
88        vmeUniverseReadReg(UNIV_REGOFF_PCI_CSR) | UNIV_PCI_CSR_BM,
89        UNIV_REGOFF_PCI_CSR);
90#endif
91
92  /* stdio is not yet initialized; the driver will revert to printk */
93  vmeUniverseMasterPortsShow(0);
94  vmeUniverseSlavePortsShow(0);
95
96  /* install the VME insterrupt manager */
97  vmeUniverseInstallIrqMgr(0,5,1,6);
98  if (vmeUniverse0PciIrqLine<0)
99        BSP_panic("Unable to get interrupt line info from PCI config");
100  _BSP_vme_bridge_irq=BSP_PCI_IRQ_LOWEST_OFFSET+vmeUniverse0PciIrqLine;
101}
Note: See TracBrowser for help on using the repository browser.