source: rtems/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h @ 283e6f0

4.104.11
Last change on this file since 283e6f0 was 283e6f0, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 18, 2008 at 3:09:21 PM

2008-09-18 Joel Sherrill <joel.sherrill@…>

  • include/bsp.h: Eliminate definitions of BSP_LIBIO_MAX_FDS since this is NOT used anywhere.
  • Property mode set to 100644
File size: 7.1 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 <libcpu/powerpc-utility.h> 
27
28/*
29 * Some symbols defined in the linker command file.
30 */
31
32LINKER_SYMBOL(bsp_ram_start);
33LINKER_SYMBOL(bsp_ram_end);
34LINKER_SYMBOL(bsp_ram_size);
35
36LINKER_SYMBOL(bsp_rom_start);
37LINKER_SYMBOL(bsp_rom_end);
38LINKER_SYMBOL(bsp_rom_size);
39
40LINKER_SYMBOL(bsp_dpram_start);
41LINKER_SYMBOL(bsp_dpram_end);
42LINKER_SYMBOL(bsp_dpram_size);
43
44LINKER_SYMBOL(bsp_section_text_start);
45LINKER_SYMBOL(bsp_section_text_end);
46LINKER_SYMBOL(bsp_section_text_size);
47
48LINKER_SYMBOL(bsp_section_data_start);
49LINKER_SYMBOL(bsp_section_data_end);
50LINKER_SYMBOL(bsp_section_data_size);
51
52LINKER_SYMBOL(bsp_section_bss_start);
53LINKER_SYMBOL(bsp_section_bss_end);
54LINKER_SYMBOL(bsp_section_bss_size);
55
56LINKER_SYMBOL(bsp_interrupt_stack_start);
57LINKER_SYMBOL(bsp_interrupt_stack_end);
58LINKER_SYMBOL(bsp_interrupt_stack_size);
59
60LINKER_SYMBOL(bsp_work_area_start);
61
62LINKER_SYMBOL(MBAR);
63
64/*
65 * distinguish board characteristics
66 */
67/*
68 * for PM520 mdule on a ZE30 carrier
69 */
70#if defined(PM520_ZE30)
71#define PM520
72#define GPIOPCR_INITMASK 0x337F3F77
73#define GPIOPCR_INITVAL  0x01552114
74/* we have PSC1/4/5/6 */
75/* #define GEN5200_UART_AVAIL_MASK 0x39 */
76#define GEN5200_UART_AVAIL_MASK 0x39
77#endif
78/*
79 * for PM520 mdule on a CR825 carrier
80 */
81#if defined(PM520_CR825)
82#define PM520
83#define GPIOPCR_INITMASK 0x330F0F77
84#define GPIOPCR_INITVAL  0x01050444
85/* we have PSC1/2/3*/
86#define GEN5200_UART_AVAIL_MASK 0x07
87#endif
88
89#if defined(BRS5L)
90/*
91 * IMD Custom Board BRS5L
92 */
93#define GPIOPCR_INITMASK 0xb30F0F77
94#define GPIOPCR_INITVAL  0x91050444
95/* we have PSC1/2/3 */
96#define GEN5200_UART_AVAIL_MASK 0x07
97
98/* we need the low level initialization in start.S*/
99#define NEED_LOW_LEVEL_INIT
100
101#define HAS_NVRAM_93CXX
102#elif defined (PM520)
103
104#define HAS_UBOOT
105
106#elif defined (icecube)
107/*
108 *  Codename: IceCube
109 *  Compatible Boards:
110 *     Freescape MPC5200LITE
111 *     Embedded Planet EP5200
112 */
113
114#define HAS_UBOOT
115
116/* These are copied from PM520 but seem to work so OK */
117#define GPIOPCR_INITMASK 0x330F0F77
118#define GPIOPCR_INITVAL  0x01050444
119
120/* we only have PSC1 */
121#define GEN5200_UART_AVAIL_MASK 0x01
122
123/* We want to prompt for a reset and then reset the board */
124#define BSP_PRESS_KEY_FOR_RESET 1
125#define BSP_RESET_BOARD_AT_EXIT 1
126
127#else
128#error "board type not defined"
129#endif
130
131#ifndef ASM
132
133#ifdef __cplusplus
134extern "C" {
135#endif
136
137#include "bspopts.h"
138
139#include <rtems.h>
140#include <rtems/console.h>
141#include <rtems/clockdrv.h>
142#include <i2cdrv.h>
143#include <bsp/irq.h>
144#include <bsp/vectors.h>
145
146#if defined(HAS_UBOOT)
147/* This is the define U-Boot uses to configure which entries in the structure are valid */
148#define CONFIG_MPC5xxx
149#include <u-boot.h>
150
151extern bd_t *uboot_bdinfo_ptr;
152extern bd_t uboot_bdinfo_copy;
153#endif
154
155/*
156 * Network driver configuration
157 */
158struct rtems_bsdnet_ifconfig;
159extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig *config, int attaching);
160#define RTEMS_BSP_NETWORK_DRIVER_NAME   "eth1"
161#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_mpc5200_fec_driver_attach_detach
162
163/* miscellaneous stuff assumed to exist */
164
165/*
166 * We need to decide how much memory will be non-cacheable. This
167 * will mainly be memory that will be used in DMA (network and serial
168 * buffers).
169 */
170/*
171#define NOCACHE_MEM_SIZE 512*1024
172*/
173
174/*
175 *  Stuff for Time Test 27
176 */
177#define MUST_WAIT_FOR_INTERRUPT 0
178
179/*
180 *  Device Driver Table Entries
181 */
182
183/*
184 * NOTE: Use the standard Console driver entry
185 */
186
187/*
188 * NOTE: Use the standard Clock driver entry
189 */
190
191#ifdef HAS_NVRAM_93CXX
192#define NVRAM_DRIVER_TABLE_ENTRY \
193  { nvram_driver_initialize, nvram_driver_open, nvram_driver_close, \
194    nvram_driver_read, nvram_driver_write, NULL }
195#endif
196
197#define RTC_DRIVER_TABLE_ENTRY \
198    { rtc_initialize, NULL, NULL, NULL, NULL, NULL }
199extern rtems_device_driver rtc_initialize(
200    rtems_device_major_number major,
201    rtems_device_minor_number minor,
202    void *arg
203);
204
205/*
206 * indicate, that BSP has IDE driver
207 */
208#define RTEMS_BSP_HAS_IDE_DRIVER
209
210/* functions */
211
212/* console modes (only termios) */
213#ifdef  PRINTK_MINOR
214#undef  PRINTK_MINOR
215#endif
216#define PRINTK_MINOR PSC1_MINOR
217
218#define SINGLE_CHAR_MODE
219/* #define UARTS_USE_TERMIOS_INT   1 */
220/* #define SHOW_MORE_INIT_SETTINGS 1 */
221
222/* ata modes */
223/* #undef ATA_USE_INT */
224#define ATA_USE_INT
225
226/* clock settings */
227#if defined(HAS_UBOOT)
228#define IPB_CLOCK (uboot_bdinfo_ptr->bi_ipbfreq)
229#define XLB_CLOCK (uboot_bdinfo_ptr->bi_busfreq)
230#define G2_CLOCK  (uboot_bdinfo_ptr->bi_intfreq)
231#else
232#define IPB_CLOCK 33000000   /* 33 MHz */
233#define XLB_CLOCK 66000000   /* 66 MHz */
234#define G2_CLOCK  231000000  /* 231 MHz */
235#endif
236
237#if defined(HAS_UBOOT)
238#define GEN5200_CONSOLE_BAUD (uboot_bdinfo_ptr->bi_baudrate)
239#else
240#define GEN5200_CONSOLE_BAUD 9600
241#endif
242
243/*
244 *  Convert decrement value to tenths of microsecnds (used by
245 *  shared timer driver).
246 *
247 *    + CPU has a XLB_CLOCK bus,
248 *    + There are 4 bus cycles per click
249 *    + We return value in 1/10 microsecond units.
250 *   Modified following equation to integer equation to remove
251 *   floating point math.
252 *   (int) ((float)(_value) / ((XLB_CLOCK/1000000 * 0.1) / 4.0))
253 */
254
255#define BSP_Convert_decrementer( _value ) \
256  (int) (((_value) * 4000) / (XLB_CLOCK/10000))
257
258/* slicetimer settings */
259#define USE_SLICETIMER_0     TRUE
260#define USE_SLICETIMER_1     FALSE
261
262Thread _Thread_Idle_body(uint32_t ignored);
263#define BSP_IDLE_TASK_BODY _Thread_Idle_body
264
265/* BSP specific IRQ Benchmarking support */
266void BSP_IRQ_Benchmarking_Reset(void);
267void BSP_IRQ_Benchmarking_Report(void);
268
269#if defined(HAS_UBOOT)
270  /* Routine to obtain U-Boot environment variables */
271  const char *bsp_uboot_getenv(
272    const char *name
273  );
274#endif
275
276void cpu_init(void);
277
278#ifdef __cplusplus
279}
280#endif
281
282#endif /* ASM */
283
284#endif /* GEN5200 */
Note: See TracBrowser for help on using the repository browser.