source: rtems/c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h @ 4f599ed

4.115
Last change on this file since 4f599ed was 4f599ed, checked in by Till Straumann <strauman@…>, on 05/18/11 at 05:26:53

2011-05-18 Till Straumann <strauman@…>

PR1797/bsps: Applied cleaned-up version of Kate's patch.
CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK is now a 'bspopts.h'
setting and as such configurable.

  • Property mode set to 100644
File size: 4.8 KB
Line 
1/*
2 *  bsp.h  -- contain BSP API definition.
3 *
4 *  Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  (C) S. Kate Feng 2003-2007 : Modified it to support the mvme5500 BSP.
11 *
12 *
13 */
14
15#ifndef _BSP_H
16#define _BSP_H
17
18#include <bspopts.h>
19
20#include <rtems.h>
21#include <rtems/console.h>
22#include <rtems/clockdrv.h>
23#include <libcpu/io.h>
24#include <bsp/vectors.h>
25
26/* Board type */
27typedef enum {
28        undefined = 0,
29        MVME5500,
30        MVME6100
31} BSP_BoardTypes;
32
33BSP_BoardTypes BSP_getBoardType();
34
35/* Board type */
36typedef enum {
37        Undefined,
38        UNIVERSE2,
39        TSI148,
40} BSP_VMEchipTypes;
41
42BSP_VMEchipTypes BSP_getVMEchipType();
43
44/* The version of Discovery system controller */
45
46typedef enum {
47        notdefined,
48        GT64260A,
49        GT64260B,
50        MV64360,
51} DiscoveryChipVersion;
52
53DiscoveryChipVersion BSP_getDiscoveryChipVersion();
54
55#define _256M           0x10000000
56#define _512M           0x20000000
57
58#define GT64x60_REG_BASE        0xf1000000  /* Base of GT64260 Reg Space */
59#define GT64x60_REG_SPACE_SIZE  0x10000     /* 64Kb Internal Reg Space */
60
61#define GT64x60_DEV1_BASE       0xf1100000  /* Device bank1(chip select 1) base
62                                             */
63#define GT64260_DEV1_SIZE       0x00100000 /* Device bank size */
64
65/* fundamental addresses for this BSP (PREPxxx are from libcpu/io.h) */
66#define _IO_BASE GT64x60_REG_BASE
67
68#define BSP_NVRAM_BASE_ADDR     0xf1110000
69
70#define BSP_RTC_INTA_REG        0x7ff0
71#define BSP_RTC_SECOND          0x7ff2
72#define BSP_RTC_MINUTE          0x7ff3
73#define BSP_RTC_HOUR            0x7ff4
74#define BSP_RTC_DATE            0x7ff5
75#define BSP_RTC_INTERRUPTS      0x7ff6
76#define BSP_RTC_WATCHDOG        0x7ff7
77
78/* PCI0 Domain I/O space */
79#define PCI0_IO_BASE            0xf0000000
80#define PCI1_IO_BASE            0xf0800000
81
82/* PCI 0 memory space as seen from the CPU */
83#define PCI0_MEM_BASE           0x80000000
84#define PCI_MEM_BASE            0  /* glue for vmeUniverse */
85#define PCI_MEM_BASE_ADJUSTMENT        0
86
87/* address of our ram on the PCI bus */
88#define PCI_DRAM_OFFSET         0
89
90/* PCI 1 memory space as seen from the CPU */
91#define PCI1_MEM_BASE           0xe0000000
92#define PCI1_MEM_SIZE           0x10000000
93
94/* Needed for hot adding via PMCspan on the PCI0 local bus.
95 * This is board dependent, only because mvme5500
96 * supports hot adding and has more than one local PCI
97 * bus.
98 */
99#define BSP_MAX_PCI_BUS_ON_PCI0 8
100#define BSP_MAX_PCI_BUS_ON_PCI1 2
101#define BSP_MAX_PCI_BUS  (BSP_MAX_PCI_BUS_ON_PCI0+BSP_MAX_PCI_BUS_ON_PCI1)
102
103
104/* The glues to Till's vmeUniverse, although the name does not
105 * actually reflect the relevant architect of the MVME5500.
106 * Till TODO ? :  BSP_PCI_DO_EOI instead ?
107 * BSP_EXT_IRQ0 instead of BSP_PCI_IRQ0 ?
108 *
109 */
110#define BSP_PIC_DO_EOI  inl(0xc34)  /* PCI IACK */
111#define BSP_PCI_IRQ0 BSP_GPP_IRQ_LOWEST_OFFSET
112
113/*
114 *  confdefs.h overrides for this BSP:
115 *   - Interrupt stack space is not minimum if defined.
116 */
117#define BSP_INTERRUPT_STACK_SIZE  (16 * 1024) /* <skf> 2/09 wants it to be adjustable by BSP */
118
119/* uart.c uses out_8 instead of outb  */
120#define BSP_UART_IOBASE_COM1    GT64x60_DEV1_BASE + 0x20000
121#define BSP_UART_IOBASE_COM2    GT64x60_DEV1_BASE + 0x21000
122
123#define BSP_CONSOLE_PORT                BSP_UART_COM1  /* console */
124#define BSP_UART_BAUD_BASE              115200
125
126/*
127 * Total memory using RESIDUAL DATA
128 */
129extern unsigned int BSP_mem_size;
130/*
131 * PCI Bus Frequency
132 */
133extern unsigned int BSP_bus_frequency;
134/*
135 * processor clock frequency
136 */
137extern unsigned int BSP_processor_frequency;
138/*
139 * Time base divisior (how many tick for 1 second).
140 */
141extern unsigned int BSP_time_base_divisor;
142
143#define BSP_Convert_decrementer( _value ) \
144  ((unsigned long long) ((((unsigned long long)BSP_time_base_divisor) * 1000000ULL) /((unsigned long long) BSP_bus_frequency)) * ((unsigned long long) (_value)))
145
146extern rtems_configuration_table  BSP_Configuration;
147extern void BSP_panic(char *s);
148extern void bsp_reset(void);
149/* extern int printk(const char *, ...) __attribute__((format(printf, 1, 2))); */
150extern int BSP_disconnect_clock_handler (void);
151extern int BSP_connect_clock_handler (void);
152
153extern unsigned long _BSP_clear_hostbridge_errors();
154
155#if 0
156#define RTEMS_BSP_NETWORK_DRIVER_NAME   "gt1"
157#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_GT64260eth_driver_attach
158#else
159#define RTEMS_BSP_NETWORK_DRIVER_NAME   "wmG1"
160#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_i82544EI_driver_attach
161#endif
162
163extern int RTEMS_BSP_NETWORK_DRIVER_ATTACH();
164
165#define gccMemBar() RTEMS_COMPILER_MEMORY_BARRIER()
166
167static inline void lwmemBar()
168{
169    __asm__ volatile("lwsync":::"memory");
170}
171
172static inline void io_flush()
173{
174    __asm__ volatile("isync":::"memory");
175}
176static inline void memBar()
177{
178    __asm__ volatile("sync":::"memory");
179}
180static inline void ioBar()
181{
182    __asm__ volatile("eieio":::"memory");
183}
184
185#endif
Note: See TracBrowser for help on using the repository browser.