source: rtems/c/src/lib/libbsp/m68k/mcf5206elite/include/bsp.h @ f05b2ac

4.104.114.84.95
Last change on this file since f05b2ac was f05b2ac, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/21/04 at 16:01:48

Remove duplicate white lines.

  • Property mode set to 100644
File size: 6.2 KB
Line 
1/*
2 * Board Support Package for MCF5206eLITE evaluation board
3 * BSP definitions
4 *
5 * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
6 * Author: Victor V. Vengerov <vvv@oktet.ru>
7 *
8 * The license and distribution terms for this file may be
9 * found in the file LICENSE in this distribution or at
10 *
11 * http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef __mcf5206elite_BSP_h
17#define __mcf5206elite_BSP_h
18
19#include "mcf5206/mcf5206e.h"
20
21#ifndef KB
22#define KB (1024)
23#endif
24#ifndef MB
25#define MB (KB*KB)
26#endif
27
28/*** Board resources allocation ***/
29
30/*
31 * To achieve some compatibility with dBUG monitor, we use the same
32 * memory resources allocation as it is used in dBUG.
33 *
34 * If this definitions will be changed, change the linker script also.
35 */
36
37/* Memory mapping */
38/* CS0: Boot Flash */
39#define BSP_MEM_ADDR_FLASH    (0xFFE00000)
40#define BSP_MEM_SIZE_FLASH    (1*MB)
41#define BSP_MEM_MASK_FLASH    (MCF5206E_CSMR_MASK_1M)
42
43/* CS2: External SRAM */
44#define BSP_MEM_ADDR_ESRAM    (0x30000000)
45#define BSP_MEM_SIZE_ESRAM    (1*MB)
46#define BSP_MEM_MASK_ESRAM    (MCF5206E_CSMR_MASK_1M)
47
48/* CS3: General-Purpose I/O register */
49#define BSP_MEM_ADDR_GPIO     (0x40000000)
50#define BSP_MEM_SIZE_GPIO     (64*KB)
51#define BSP_MEM_MASK_GPIO     (MCF5206E_CSMR_MASK_64K)
52
53/* DRAM0: Dynamic RAM */
54#define BSP_MEM_ADDR_DRAM     (0x00000000)
55#define BSP_MEM_SIZE_DRAM     (16*MB)
56#define BSP_MEM_MASK_DRAM     (MCF5206E_DCMR_MASK_16M)
57
58/* On-chip SRAM */
59#define BSP_MEM_ADDR_SRAM     (0x20000000)
60#define BSP_MEM_SIZE_SRAM     (8*KB)
61
62/* On-chip peripherial registers */
63#define BSP_MEM_ADDR_IMM      (0x10000000)
64#define BSP_MEM_SIZE_IMM      (1*KB)
65#define MBAR BSP_MEM_ADDR_IMM
66
67/* Interrupt vector assignment */
68#define BSP_INTVEC_AVEC1    (25)
69#define BSP_INTLVL_AVEC1    (1)
70#define BSP_INTPRIO_AVEC1   (3)
71
72#define BSP_INTVEC_AVEC2    (26)
73#define BSP_INTLVL_AVEC2    (2)
74#define BSP_INTPRIO_AVEC2   (3)
75
76#define BSP_INTVEC_AVEC3    (27)
77#define BSP_INTLVL_AVEC3    (3)
78#define BSP_INTPRIO_AVEC3   (3)
79
80#define BSP_INTVEC_AVEC4    (28)
81#define BSP_INTLVL_AVEC4    (4)
82#define BSP_INTPRIO_AVEC4   (3)
83
84#define BSP_INTVEC_AVEC5    (29)
85#define BSP_INTLVL_AVEC5    (5)
86#define BSP_INTPRIO_AVEC5   (3)
87
88#define BSP_INTVEC_AVEC6    (30)
89#define BSP_INTLVL_AVEC6    (6)
90#define BSP_INTPRIO_AVEC6   (3)
91
92#define BSP_INTVEC_AVEC7    (31)
93#define BSP_INTLVL_AVEC7    (7)
94#define BSP_INTPRIO_AVEC7   (3)
95
96#define BSP_INTVEC_TIMER1   (BSP_INTVEC_AVEC5)
97#define BSP_INTLVL_TIMER1   (BSP_INTLVL_AVEC5)
98#define BSP_INTPRIO_TIMER1  (2)
99
100#define BSP_INTVEC_TIMER2    (BSP_INTVEC_AVEC6)
101#define BSP_INTLVL_TIMER2    (BSP_INTLVL_AVEC6)
102#define BSP_INTPRIO_TIMER2   (2)
103
104#define BSP_INTVEC_MBUS     (BSP_INTVEC_AVEC4)
105#define BSP_INTLVL_MBUS     (BSP_INTLVL_AVEC4)
106#define BSP_INTPRIO_MBUS    (2)
107
108#define BSP_INTVEC_UART1    (64)
109#define BSP_INTLVL_UART1    (4)
110#define BSP_INTPRIO_UART1   (0)
111
112#define BSP_INTVEC_UART2    (65)
113#define BSP_INTLVL_UART2    (4)
114#define BSP_INTPRIO_UART2   (1)
115
116#define BSP_INTVEC_DMA0     (66)
117#define BSP_INTLVL_DMA0     (3)
118#define BSP_INTPRIO_DMA0    (1)
119
120#define BSP_INTVEC_DMA1     (67)
121#define BSP_INTLVL_DMA1     (3)
122#define BSP_INTPRIO_DMA1    (2)
123
124/* Location of DS1307 Real-Time Clock/NVRAM chip */
125#define DS1307_I2C_BUS_NUMBER (0)
126
127#ifndef ASM
128
129#ifdef __cplusplus
130extern "C" {
131#endif
132
133#include <bspopts.h>
134#include <rtems.h>
135#include <rtems/console.h>
136#include <rtems/iosupp.h>
137#include <rtems/clockdrv.h>
138
139#include "i2c.h"
140
141/*
142 *  confdefs.h overrides for this BSP:
143 *   - termios serial ports (defaults to 1)
144 *   - Interrupt stack space is not minimum if defined.
145 */
146
147#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
148#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
149
150/* System frequency */
151#define BSP_SYSTEM_FREQUENCY ((unsigned int)&_SYS_CLOCK_FREQUENCY)
152extern char _SYS_CLOCK_FREQUENCY; /* Don't use this variable directly!!! */
153
154/* MBUS I2C bus clock default frequency */
155#define BSP_MBUS_FREQUENCY (16000)
156
157/* Number of I2C buses supported in this board */
158#define I2C_NUMBER_OF_BUSES (1)
159
160/* I2C bus selection */
161#define I2C_SELECT_BUS(bus)
162
163/*
164 *  Define the time limits for RTEMS Test Suite test durations.
165 *  Long test and short test duration limits are provided.  These
166 *  values are in seconds and need to be converted to ticks for the
167 *  application.
168 *
169 */
170
171#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
172#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
173
174/*
175 *  Stuff for Time Test 27
176 *  Don't bother with hardware -- just use a software-interrupt
177 */
178
179#define MUST_WAIT_FOR_INTERRUPT 0
180
181#define Install_tm27_vector( handler ) set_vector( (handler), 34, 1 )
182
183#define Cause_tm27_intr()       asm volatile ("trap #2");
184
185#define Clear_tm27_intr()
186
187#define Lower_tm27_intr()
188
189/*
190 *  Simple spin delay in microsecond units for device drivers.
191 *  This is very dependent on the clock speed of the target.
192 */
193
194#define delay( microseconds ) \
195  { register uint32_t         _delay=(microseconds); \
196    register uint32_t         _tmp=123; \
197    asm volatile( "0: \
198                     nbcd      %0 ; \
199                     nbcd      %0 ; \
200                     dbf       %1,0b" \
201                  : "=d" (_tmp), "=d" (_delay) \
202                  : "0"  (_tmp), "1"  (_delay) ); \
203  }
204
205/* Constants */
206
207/* Structures */
208
209/*
210 *  Device Driver Table Entries
211 */
212
213/*
214 * NOTE: Use the standard Console driver entry
215 */
216
217/*
218 * NOTE: Use the standard Clock driver entry
219 */
220
221/*
222 * Real-Time Clock Driver Table Entry
223 * NOTE: put this entry to the device driver table AFTER I2C bus driver!
224 */
225#define RTC_DRIVER_TABLE_ENTRY \
226    { rtc_initialize, NULL, NULL, NULL, NULL, NULL }
227extern rtems_device_driver rtc_initialize(
228    rtems_device_major_number major,
229    rtems_device_minor_number minor,
230    void *arg
231);
232
233/* miscellaneous stuff assumed to exist */
234
235extern rtems_configuration_table BSP_Configuration;
236
237extern m68k_isr_entry M68Kvec[];   /* vector table address */
238
239extern rtems_isr (*rtems_clock_hook)(rtems_vector_number);
240
241/* functions */
242
243void bsp_cleanup( void );
244
245m68k_isr_entry set_vector(
246  rtems_isr_entry     handler,
247  rtems_vector_number vector,
248  int                 type
249);
250
251/*
252 * Values assigned by link editor
253 */
254extern void *_RomBase, *_RamBase;
255
256#ifdef __cplusplus
257}
258#endif
259
260#endif /* ASM */
261
262#endif
263/* end of include file */
Note: See TracBrowser for help on using the repository browser.