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

4.104.114.84.95
Last change on this file since 06cfd95 was 06cfd95, checked in by Till Straumann <strauman@…>, on 06/19/06 at 20:51:19

Indicate that it's ok to use decoupled cycles to access
on-board memory from VME.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/* $Id$ */
2
3/* Default VME bridge configuration - note that this file
4 * is independent of the bridge driver/chip
5 */
6
7/* Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 */
8
9#include <bsp.h>
10#include <bsp/VME.h>
11#include <bsp/VMEConfig.h>
12#include <libcpu/bat.h>
13#include <rtems/bspIo.h>
14
15/* Use a weak alias for the VME configuration.
16 * This permits individual applications to override
17 * this routine.
18 * They may even create an 'empty'
19 *
20 *    void BSP_vme_config(void) {}
21 *
22 * which will avoid linking in the Universe driver
23 * at all :-).
24 */
25
26void BSP_vme_config(void) __attribute__ (( weak, alias("__BSP_default_vme_config") ));
27
28void
29__BSP_default_vme_config(void)
30{
31
32  if ( BSP_VMEInit() ) {
33        printk("Skipping VME initialization...\n");
34        return;
35  }
36
37#ifdef BSP_VME_BAT_IDX
38  /* setup a PCI area to map the VME bus */
39  setdbat(BSP_VME_BAT_IDX,
40                  PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI,
41                  PCI_MEM_BASE + _VME_A32_WIN0_ON_PCI,
42                  0x10000000,
43                  IO_PAGE);
44#endif
45
46  /* map VME address ranges */
47  BSP_VMEOutboundPortCfg(
48        0,
49        VME_AM_EXT_SUP_DATA,
50        _VME_A32_WIN0_ON_VME,
51        _VME_A32_WIN0_ON_PCI,
52        0x0F000000);
53  BSP_VMEOutboundPortCfg(
54        1,
55        VME_AM_STD_SUP_DATA,
56        0x00000000,
57        _VME_A24_ON_PCI,
58        0x00ff0000);
59  BSP_VMEOutboundPortCfg(
60        2,
61        VME_AM_SUP_SHORT_IO,
62        0x00000000,
63        _VME_A16_ON_PCI,
64        0x00010000);
65
66#ifdef _VME_DRAM_OFFSET
67  /* map our memory to VME giving the driver a hint that it's ordinary memory
68   * so they can enable decoupled cycles which should give better performance...
69   */
70  BSP_VMEInboundPortCfg(
71        0,
72        VME_AM_EXT_SUP_DATA | VME_AM_IS_MEMORY,
73        _VME_DRAM_OFFSET,
74        PCI_DRAM_OFFSET,
75        BSP_mem_size);
76#endif
77
78  /* stdio is not yet initialized; the driver will revert to printk */
79  BSP_VMEOutboundPortsShow(0);
80  BSP_VMEInboundPortsShow(0);
81
82  BSP_VMEIrqMgrInstall();
83}
Note: See TracBrowser for help on using the repository browser.