source: rtems/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h @ 4a4c7900

4.104.114.84.95
Last change on this file since 4a4c7900 was 4a4c7900, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on Aug 13, 2006 at 3:58:46 PM

added vectors.h to bsp.h
fixed bug in mscan

  • Property mode set to 100644
File size: 6.2 KB
Line 
1/*===============================================================*\
2| Project: RTEMS generic MPC5200 BSP                              |
3+-----------------------------------------------------------------+
4| Partially based on the code references which are named below.   |
5| Adaptions, modifications, enhancements and any recent parts of  |
6| the code are:                                                   |
7|                    Copyright (c) 2005                           |
8|                    Embedded Brains GmbH                         |
9|                    Obere Lagerstr. 30                           |
10|                    D-82178 Puchheim                             |
11|                    Germany                                      |
12|                    rtems@embedded-brains.de                     |
13+-----------------------------------------------------------------+
14| The license and distribution terms for this file may be         |
15| found in the file LICENSE in this distribution or at            |
16|                                                                 |
17| http://www.rtems.com/license/LICENSE.                           |
18|                                                                 |
19+-----------------------------------------------------------------+
20| this file contains board specific definitions                   |
21\*===============================================================*/
22
23#ifndef __GEN5200_BSP_h
24#define __GEN5200_BSP_h
25
26/*
27 * distinguish board characteristics
28 */
29/*
30 * for PM520 mdule on a ZE30 carrier
31 */
32#if defined(PM520_ZE30)
33#define PM520
34#define GPIOPCR_INITMASK 0x337F3F77
35#define GPIOPCR_INITVAL  0x01552114
36/* we have PSC1/4/5/6 */
37/* #define GEN5200_UART_AVAIL_MASK 0x39 */
38#define GEN5200_UART_AVAIL_MASK 0x39
39#endif
40/*
41 * for PM520 mdule on a CR825 carrier
42 */
43#if defined(PM520_CR825)
44#define PM520
45#define GPIOPCR_INITMASK 0x330F0F77
46#define GPIOPCR_INITVAL  0x01050444
47/* we have PSC1/2/3*/
48#define GEN5200_UART_AVAIL_MASK 0x07
49#endif
50
51#if defined(BRS5L)
52/*
53 * IMD Custom Board BRS5L
54 */
55#define GPIOPCR_INITMASK 0xb30F0F77
56#define GPIOPCR_INITVAL  0x91050444
57/* we have PSC1/2/3 */
58#define GEN5200_UART_AVAIL_MASK 0x07
59/*
60 * address range definitions
61 */
62/* ROM definitions (2 MB) */
63#define ROM_START       0xFFE00000
64#define ROM_SIZE        0x00200000
65#define ROM_END         (ROM_START+ROM_SIZE-1)
66#define BOOT_START      ROM_START
67#define BOOT_END        ROM_END
68
69/* SDRAM definitions (256 MB) */
70#define RAM_START       0x00000000
71#define RAM_SIZE        0x10000000
72#define RAM_END         (RAM_START+RAM_SIZE-1)
73
74/* DPRAM definitions (64 KB) */
75#define DPRAM_START  0xFF000000
76#define DPRAM_END    0xFF0003FF
77
78/* internal memory map definitions (64 KB) */
79#define MBAR         0xF0000000
80
81/* we need the low level initialization in start.S*/
82#define NEED_LOW_LEVEL_INIT
83
84#define HAS_NVRAM_93CXX
85#elif defined (PM520)
86
87/*
88 * MicroSys PM520 internal memory map definitions
89 */
90#define MBAR         0xF0000000
91#define HAS_UBOOT
92
93#else
94#error "board type not defined"
95#endif
96
97#ifndef ASM
98
99#ifdef __cplusplus
100extern "C" {
101#endif
102
103#include "bspopts.h"
104
105#include <rtems.h>
106#include <rtems/console.h>
107#include <rtems/clockdrv.h>
108#include <i2cdrv.h>
109#include <bsp/irq.h>
110#include <bsp/vectors.h>
111
112#if defined(HAS_UBOOT)
113#define CONFIG_MPC5xxx
114#include <u-boot.h>
115extern bd_t *uboot_bdinfo_ptr;
116extern bd_t uboot_bdinfo_copy;
117#endif
118
119/*
120 * Network driver configuration
121 */
122struct rtems_bsdnet_ifconfig;
123extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig *config, int attaching);
124#define RTEMS_BSP_NETWORK_DRIVER_NAME   "eth1"
125#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_mpc5200_fec_driver_attach_detach
126
127/* miscellaneous stuff assumed to exist */
128
129extern rtems_configuration_table BSP_Configuration;
130/*
131 * We need to decide how much memory will be non-cacheable. This
132 * will mainly be memory that will be used in DMA (network and serial
133 * buffers).
134 */
135/*
136#define NOCACHE_MEM_SIZE 512*1024
137*/
138
139/*
140 *  Define the time limits for RTEMS Test Suite test durations.
141 *  Long test and short test duration limits are provided.  These
142 *  values are in seconds and need to be converted to ticks for the
143 *  application.
144 *
145 */
146
147#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
148#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
149
150/*
151 *  Stuff for Time Test 27
152 */
153#define MUST_WAIT_FOR_INTERRUPT 0
154
155/*
156 *  Device Driver Table Entries
157 */
158
159/*
160 * NOTE: Use the standard Console driver entry
161 */
162
163/*
164 * NOTE: Use the standard Clock driver entry
165 */
166
167#ifdef HAS_NVRAM_93CXX
168#define NVRAM_DRIVER_TABLE_ENTRY \
169  { nvram_driver_initialize, nvram_driver_open, nvram_driver_close, \
170    nvram_driver_read, nvram_driver_write, NULL }
171#endif
172
173#define RTC_DRIVER_TABLE_ENTRY \
174    { rtc_initialize, NULL, NULL, NULL, NULL, NULL }
175extern rtems_device_driver rtc_initialize(
176    rtems_device_major_number major,
177    rtems_device_minor_number minor,
178    void *arg
179);
180
181/*
182 * indicate, that BSP has IDE driver
183 */
184#define RTEMS_BSP_HAS_IDE_DRIVER
185
186/*
187 * How many libio files we want
188 */
189#define BSP_LIBIO_MAX_FDS       20
190
191/* functions */
192
193void bsp_cleanup(void);
194
195/* console modes (only termios) */
196#ifdef  PRINTK_MINOR
197#undef  PRINTK_MINOR
198#endif
199#define PRINTK_MINOR PSC1_MINOR
200
201#define SINGLE_CHAR_MODE
202#define UARTS_USE_TERMIOS_INT   1
203
204/* ata modes */
205/* #undef ATA_USE_INT */
206#define ATA_USE_INT
207
208/* clock settings */
209#if defined(HAS_UBOOT)
210#define IPB_CLOCK (uboot_bdinfo_ptr->bi_ipbfreq)
211#define XLB_CLOCK (uboot_bdinfo_ptr->bi_busfreq)
212#define G2_CLOCK  (uboot_bdinfo_ptr->bi_intfreq)
213#else
214#define IPB_CLOCK 33000000   /* 33 MHz */
215#define XLB_CLOCK 66000000   /* 66 MHz */
216#define G2_CLOCK  231000000  /* 231 MHz */
217#endif
218
219/*
220 *  Convert decrement value to tenths of microsecnds (used by
221 *  shared timer driver).
222 *
223 *    + CPU has a XLB_CLOCK bus,
224 *    + There are 4 bus cycles per click
225 *    + We return value in 1/10 microsecond units.
226 *   Modified following equation to integer equation to remove
227 *   floating point math.
228 *   (int) ((float)(_value) / ((XLB_CLOCK/1000000 * 0.1) / 4.0))
229 */
230
231#define BSP_Convert_decrementer( _value ) \
232  (int) (((_value) * 4000) / (XLB_CLOCK/10000))
233
234/* slicetimer settings */
235#define USE_SLICETIMER_0     TRUE
236#define USE_SLICETIMER_1     FALSE
237
238#ifdef __cplusplus
239}
240#endif
241
242#endif /* ASM */
243
244#endif /* GEN5200 */
Note: See TracBrowser for help on using the repository browser.