source: rtems/c/src/lib/libbsp/powerpc/gen5200/include/bsp.h @ 144ad33

4.104.115
Last change on this file since 144ad33 was 144ad33, checked in by Joel Sherrill <joel.sherrill@…>, on 09/20/08 at 21:39:02

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

  • Makefile.am, include/bsp.h, network_5200/network.c, start/start.S, startup/bspstart.c, startup/cpuinit.c: Use top level shared bsp_get_work_area() implementation. Augment it to know about U-Boot.
  • startup/bspgetworkarea.c: Removed.
  • 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 <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 <rtems/rtc.h>
143#include <i2cdrv.h>
144#include <bsp/irq.h>
145#include <bsp/vectors.h>
146
147#if defined(HAS_UBOOT)
148/* This is the define U-Boot uses to configure which entries in the structure are valid */
149#define CONFIG_MPC5xxx
150#include <u-boot.h>
151
152extern bd_t bsp_uboot_board_info;
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 *  Device Driver Table Entries
176 */
177
178#ifdef HAS_NVRAM_93CXX
179#define NVRAM_DRIVER_TABLE_ENTRY \
180  { nvram_driver_initialize, nvram_driver_open, nvram_driver_close, \
181    nvram_driver_read, nvram_driver_write, NULL }
182#endif
183
184/*
185 * indicate, that BSP has IDE driver
186 */
187#define RTEMS_BSP_HAS_IDE_DRIVER
188
189/* functions */
190
191/* console modes (only termios) */
192#ifdef  PRINTK_MINOR
193#undef  PRINTK_MINOR
194#endif
195#define PRINTK_MINOR PSC1_MINOR
196
197#define SINGLE_CHAR_MODE
198/* #define UARTS_USE_TERMIOS_INT   1 */
199/* #define SHOW_MORE_INIT_SETTINGS 1 */
200
201/* ata modes */
202/* #undef ATA_USE_INT */
203#define ATA_USE_INT
204
205/* clock settings */
206#if defined(HAS_UBOOT)
207#define IPB_CLOCK (bsp_uboot_board_info.bi_ipbfreq)
208#define XLB_CLOCK (bsp_uboot_board_info.bi_busfreq)
209#define G2_CLOCK  (bsp_uboot_board_info.bi_intfreq)
210#else
211#define IPB_CLOCK 33000000   /* 33 MHz */
212#define XLB_CLOCK 66000000   /* 66 MHz */
213#define G2_CLOCK  231000000  /* 231 MHz */
214#endif
215
216#if defined(HAS_UBOOT)
217#define GEN5200_CONSOLE_BAUD (bsp_uboot_board_info.bi_baudrate)
218#else
219#define GEN5200_CONSOLE_BAUD 9600
220#endif
221
222/*
223 *  Convert decrement value to tenths of microsecnds (used by
224 *  shared timer driver).
225 *
226 *    + CPU has a XLB_CLOCK bus,
227 *    + There are 4 bus cycles per click
228 *    + We return value in 1/10 microsecond units.
229 *   Modified following equation to integer equation to remove
230 *   floating point math.
231 *   (int) ((float)(_value) / ((XLB_CLOCK/1000000 * 0.1) / 4.0))
232 */
233
234#define BSP_Convert_decrementer( _value ) \
235  (int) (((_value) * 4000) / (XLB_CLOCK/10000))
236
237/* slicetimer settings */
238#define USE_SLICETIMER_0     TRUE
239#define USE_SLICETIMER_1     FALSE
240
241Thread _Thread_Idle_body(uint32_t ignored);
242#define BSP_IDLE_TASK_BODY _Thread_Idle_body
243
244/* BSP specific IRQ Benchmarking support */
245void BSP_IRQ_Benchmarking_Reset(void);
246void BSP_IRQ_Benchmarking_Report(void);
247
248#if defined(HAS_UBOOT)
249  /* Routine to obtain U-Boot environment variables */
250  const char *bsp_uboot_getenv(
251    const char *name
252  );
253#endif
254
255void cpu_init(void);
256
257#ifdef __cplusplus
258}
259#endif
260
261#endif /* ASM */
262
263#endif /* GEN5200 */
Note: See TracBrowser for help on using the repository browser.