source: rtems/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h @ 47fb2fe

4.11
Last change on this file since 47fb2fe was 47fb2fe, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 11, 2013 at 3:22:02 PM

bsp/mpc5200: Add MPC5200_BOARD prefix

  • Property mode set to 100644
File size: 6.7 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#include <bspopts.h>
27
28#include <libcpu/powerpc-utility.h>
29
30/*
31 * Some symbols defined in the linker command file.
32 */
33
34LINKER_SYMBOL(bsp_ram_start);
35LINKER_SYMBOL(bsp_ram_end);
36LINKER_SYMBOL(bsp_ram_size);
37
38LINKER_SYMBOL(bsp_rom_start);
39LINKER_SYMBOL(bsp_rom_end);
40LINKER_SYMBOL(bsp_rom_size);
41
42LINKER_SYMBOL(bsp_dpram_start);
43LINKER_SYMBOL(bsp_dpram_end);
44LINKER_SYMBOL(bsp_dpram_size);
45
46LINKER_SYMBOL(bsp_section_text_start);
47LINKER_SYMBOL(bsp_section_text_end);
48LINKER_SYMBOL(bsp_section_text_size);
49
50LINKER_SYMBOL(bsp_section_data_start);
51LINKER_SYMBOL(bsp_section_data_end);
52LINKER_SYMBOL(bsp_section_data_size);
53
54LINKER_SYMBOL(bsp_section_bss_start);
55LINKER_SYMBOL(bsp_section_bss_end);
56LINKER_SYMBOL(bsp_section_bss_size);
57
58LINKER_SYMBOL(bsp_interrupt_stack_start);
59LINKER_SYMBOL(bsp_interrupt_stack_end);
60LINKER_SYMBOL(bsp_interrupt_stack_size);
61
62LINKER_SYMBOL(bsp_work_area_start);
63
64LINKER_SYMBOL(MBAR);
65
66/* Provide legacy defines */
67
68#ifdef MPC5200_BOARD_PM520_ZE30
69#define PM520_ZE30
70#endif
71
72#ifdef MPC5200_BOARD_PM520_CR825
73#define PM520_CR825
74#endif
75
76#ifdef MPC5200_BOARD_ICECUBE
77#define icecube
78#endif
79
80#ifdef MPC5200_BOARD_BRS5L
81#define BRS5L
82#endif
83
84/*
85 * distinguish board characteristics
86 */
87/*
88 * for PM520 mdule on a ZE30 carrier
89 */
90#if defined(MPC5200_BOARD_PM520_ZE30)
91#define PM520
92#endif
93/*
94 * for PM520 mdule on a CR825 carrier
95 */
96#if defined(MPC5200_BOARD_PM520_CR825)
97#define PM520
98#endif
99
100#if !defined(HAS_UBOOT)
101  /* we need the low level initialization in start.S*/
102  #define NEED_LOW_LEVEL_INIT
103#endif
104
105#if defined(MPC5200_BOARD_BRS5L)
106/*
107 * IMD Custom Board BRS5L
108 */
109
110#define HAS_NVRAM_93CXX
111
112#elif defined (PM520)
113
114/* Nothing special */
115
116#elif defined (MPC5200_BOARD_ICECUBE)
117/*
118 *  Codename: IceCube
119 *  Compatible Boards:
120 *     Freescape MPC5200LITE
121 *     Embedded Planet EP5200
122 */
123
124#elif defined (MPC5200_BOARD_DP2)
125
126/* Nothing special */
127
128#else
129#error "board type not defined"
130#endif
131
132#ifndef ASM
133
134#ifdef __cplusplus
135extern "C" {
136#endif
137
138
139#include <rtems.h>
140#include <rtems/console.h>
141#include <rtems/clockdrv.h>
142#include <rtems/rtc.h>
143#include <i2cdrv.h>
144#include <bsp/irq.h>
145#include <bsp/vectors.h>
146#include <bsp/u-boot.h>
147#include <bsp/default-initial-extension.h>
148
149/*
150 * Network driver configuration
151 */
152struct rtems_bsdnet_ifconfig;
153extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig *config, int attaching);
154#define RTEMS_BSP_NETWORK_DRIVER_NAME   "eth1"
155#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_mpc5200_fec_driver_attach_detach
156
157/* miscellaneous stuff assumed to exist */
158
159/*
160 * We need to decide how much memory will be non-cacheable. This
161 * will mainly be memory that will be used in DMA (network and serial
162 * buffers).
163 */
164/*
165#define NOCACHE_MEM_SIZE 512*1024
166*/
167
168/*
169 *  Device Driver Table Entries
170 */
171
172#ifdef HAS_NVRAM_93CXX
173#define NVRAM_DRIVER_TABLE_ENTRY \
174  { nvram_driver_initialize, nvram_driver_open, nvram_driver_close, \
175    nvram_driver_read, nvram_driver_write, NULL }
176#endif
177
178/*
179 * indicate, that BSP has IDE driver
180 */
181#define RTEMS_BSP_HAS_IDE_DRIVER
182
183/* functions */
184
185/* #define SHOW_MORE_INIT_SETTINGS 1 */
186
187/* ata modes */
188/* #undef ATA_USE_INT */
189#define ATA_USE_INT
190
191/* clock settings */
192#if defined(HAS_UBOOT)
193#define IPB_CLOCK (bsp_uboot_board_info.bi_ipbfreq)
194#define XLB_CLOCK (bsp_uboot_board_info.bi_busfreq)
195#define G2_CLOCK  (bsp_uboot_board_info.bi_intfreq)
196#elif defined(MPC5200_BOARD_BRS5L)
197#define IPB_CLOCK 66000000   /* 66 MHz */
198#define XLB_CLOCK 132000000  /* 132 MHz */
199#define G2_CLOCK  396000000  /* 396 MHz */
200#else
201#define IPB_CLOCK 33000000   /* 33 MHz */
202#define XLB_CLOCK 66000000   /* 66 MHz */
203#define G2_CLOCK  231000000  /* 231 MHz */
204#endif
205
206#if defined(HAS_UBOOT)
207#define GEN5200_CONSOLE_BAUD (bsp_uboot_board_info.bi_baudrate)
208#else
209#define GEN5200_CONSOLE_BAUD 115200
210#endif
211
212/*
213 *  Convert decrement value to tenths of microsecnds (used by
214 *  shared timer driver).
215 *
216 *    + CPU has a XLB_CLOCK bus,
217 *    + There are 4 bus cycles per click
218 *    + We return value in 1/10 microsecond units.
219 *   Modified following equation to integer equation to remove
220 *   floating point math.
221 *   (int) ((float)(_value) / ((XLB_CLOCK/1000000 * 0.1) / 4.0))
222 */
223
224#define BSP_Convert_decrementer( _value ) \
225  (int) (((_value) * 4000) / (XLB_CLOCK/10000))
226
227/* slicetimer settings */
228#define USE_SLICETIMER_0     TRUE
229#define USE_SLICETIMER_1     FALSE
230
231void *bsp_idle_thread( uintptr_t ignored );
232#define BSP_IDLE_TASK_BODY bsp_idle_thread
233
234/* BSP specific IRQ Benchmarking support */
235void BSP_IRQ_Benchmarking_Reset(void);
236void BSP_IRQ_Benchmarking_Report(void);
237
238#if defined(HAS_UBOOT)
239  /* Routine to obtain U-Boot environment variables */
240  const char *bsp_uboot_getenv(
241    const char *name
242  );
243#endif
244
245void cpu_init(void);
246
247typedef enum {
248  MPC5200_FATAL_PCF8563_INVALID_YEAR,
249  MPC5200_FATAL_SLICETIMER_0_IRQ_INSTALL,
250  MPC5200_FATAL_SLICETIMER_1_IRQ_INSTALL,
251  MPC5200_FATAL_TM27_IRQ_INSTALL,
252  MPC5200_FATAL_MSCAN_A_INIT,
253  MPC5200_FATAL_MSCAN_B_INIT,
254  MPC5200_FATAL_MSCAN_A_SET_MODE,
255  MPC5200_FATAL_MSCAN_B_SET_MODE,
256  MPC5200_FATAL_ATA_DISK_IO_INIT,
257  MPC5200_FATAL_ATA_DISK_CREATE,
258  MPC5200_FATAL_ATA_DMA_SINGLE_IRQ_INSTALL,
259  MPC5200_FATAL_ATA_LOCK_CREATE,
260  MPC5200_FATAL_ATA_LOCK_DESTROY
261} mpc5200_fatal_code;
262
263void mpc5200_fatal(mpc5200_fatal_code code) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
264
265#ifdef __cplusplus
266}
267#endif
268
269#endif /* ASM */
270
271#endif /* GEN5200 */
Note: See TracBrowser for help on using the repository browser.