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

4.104.115
Last change on this file since eef91af was eef91af, checked in by Joel Sherrill <joel.sherrill@…>, on 08/24/09 at 21:06:01

2009-08-24 Joel Sherrill <joel.sherrill@…>

  • include/bsp.h, startup/bspstart.c: Rename _Thread_Idle_body to bsp_idle_thread.
  • Property mode set to 100644
File size: 6.5 KB
RevLine 
[ca680bc5]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
[68f39d58]26#include <bspopts.h>
27
[82bd8d9d]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
[ca680bc5]66/*
67 * distinguish board characteristics
68 */
69/*
70 * for PM520 mdule on a ZE30 carrier
71 */
72#if defined(PM520_ZE30)
73#define PM520
74#define GPIOPCR_INITMASK 0x337F3F77
75#define GPIOPCR_INITVAL  0x01552114
76/* we have PSC1/4/5/6 */
77/* #define GEN5200_UART_AVAIL_MASK 0x39 */
78#define GEN5200_UART_AVAIL_MASK 0x39
79#endif
80/*
81 * for PM520 mdule on a CR825 carrier
82 */
83#if defined(PM520_CR825)
84#define PM520
85#define GPIOPCR_INITMASK 0x330F0F77
86#define GPIOPCR_INITVAL  0x01050444
87/* we have PSC1/2/3*/
88#define GEN5200_UART_AVAIL_MASK 0x07
89#endif
90
91#if defined(BRS5L)
92/*
93 * IMD Custom Board BRS5L
94 */
95#define GPIOPCR_INITMASK 0xb30F0F77
96#define GPIOPCR_INITVAL  0x91050444
97/* we have PSC1/2/3 */
98#define GEN5200_UART_AVAIL_MASK 0x07
99
100/* we need the low level initialization in start.S*/
101#define NEED_LOW_LEVEL_INIT
102
103#define HAS_NVRAM_93CXX
104#elif defined (PM520)
105
106#define HAS_UBOOT
107
[1abae10]108#elif defined (icecube)
[7da3405]109/*
[1abae10]110 *  Codename: IceCube
111 *  Compatible Boards:
112 *     Freescape MPC5200LITE
113 *     Embedded Planet EP5200
[7da3405]114 */
115
116#define HAS_UBOOT
117
118/* These are copied from PM520 but seem to work so OK */
119#define GPIOPCR_INITMASK 0x330F0F77
120#define GPIOPCR_INITVAL  0x01050444
121
122/* we only have PSC1 */
123#define GEN5200_UART_AVAIL_MASK 0x01
124
[ca680bc5]125#else
126#error "board type not defined"
127#endif
128
129#ifndef ASM
130
131#ifdef __cplusplus
132extern "C" {
133#endif
134
135
136#include <rtems.h>
137#include <rtems/console.h>
138#include <rtems/clockdrv.h>
[ccceaf3]139#include <rtems/rtc.h>
[ca680bc5]140#include <i2cdrv.h>
[4a4c7900]141#include <bsp/irq.h>
142#include <bsp/vectors.h>
[ca680bc5]143
144#if defined(HAS_UBOOT)
[7da3405]145/* This is the define U-Boot uses to configure which entries in the structure are valid */
[ca680bc5]146#define CONFIG_MPC5xxx
147#include <u-boot.h>
[7da3405]148
[144ad33]149extern bd_t bsp_uboot_board_info;
[ca680bc5]150#endif
151
152/*
153 * Network driver configuration
154 */
155struct rtems_bsdnet_ifconfig;
156extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig *config, int attaching);
157#define RTEMS_BSP_NETWORK_DRIVER_NAME   "eth1"
158#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_mpc5200_fec_driver_attach_detach
159
160/* miscellaneous stuff assumed to exist */
161
162/*
163 * We need to decide how much memory will be non-cacheable. This
164 * will mainly be memory that will be used in DMA (network and serial
165 * buffers).
166 */
167/*
168#define NOCACHE_MEM_SIZE 512*1024
169*/
170
171/*
172 *  Device Driver Table Entries
173 */
174
175#ifdef HAS_NVRAM_93CXX
176#define NVRAM_DRIVER_TABLE_ENTRY \
177  { nvram_driver_initialize, nvram_driver_open, nvram_driver_close, \
178    nvram_driver_read, nvram_driver_write, NULL }
179#endif
180
181/*
182 * indicate, that BSP has IDE driver
183 */
184#define RTEMS_BSP_HAS_IDE_DRIVER
185
186/* functions */
187
188/* console modes (only termios) */
189#ifdef  PRINTK_MINOR
190#undef  PRINTK_MINOR
191#endif
192#define PRINTK_MINOR PSC1_MINOR
193
194#define SINGLE_CHAR_MODE
[0a029a5]195/* #define UARTS_USE_TERMIOS_INT   1 */
[7da3405]196/* #define SHOW_MORE_INIT_SETTINGS 1 */
[ca680bc5]197
198/* ata modes */
[c9b005a9]199/* #undef ATA_USE_INT */
200#define ATA_USE_INT
[ca680bc5]201
202/* clock settings */
203#if defined(HAS_UBOOT)
[144ad33]204#define IPB_CLOCK (bsp_uboot_board_info.bi_ipbfreq)
205#define XLB_CLOCK (bsp_uboot_board_info.bi_busfreq)
206#define G2_CLOCK  (bsp_uboot_board_info.bi_intfreq)
[ca680bc5]207#else
208#define IPB_CLOCK 33000000   /* 33 MHz */
209#define XLB_CLOCK 66000000   /* 66 MHz */
210#define G2_CLOCK  231000000  /* 231 MHz */
211#endif
212
[7da3405]213#if defined(HAS_UBOOT)
[144ad33]214#define GEN5200_CONSOLE_BAUD (bsp_uboot_board_info.bi_baudrate)
[7da3405]215#else
216#define GEN5200_CONSOLE_BAUD 9600
217#endif
218
[c9b005a9]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
[ca680bc5]234/* slicetimer settings */
235#define USE_SLICETIMER_0     TRUE
236#define USE_SLICETIMER_1     FALSE
237
[eef91af]238void *bsp_idle_thread( uintptr_t ignored );
239#define BSP_IDLE_TASK_BODY bsp_idle_thread
[af99a743]240
[6826a4c]241/* BSP specific IRQ Benchmarking support */
242void BSP_IRQ_Benchmarking_Reset(void);
243void BSP_IRQ_Benchmarking_Report(void);
[6e2fcea]244
245#if defined(HAS_UBOOT)
246  /* Routine to obtain U-Boot environment variables */
247  const char *bsp_uboot_getenv(
248    const char *name
249  );
250#endif
251
[82bd8d9d]252void cpu_init(void);
253
[ca680bc5]254#ifdef __cplusplus
255}
256#endif
257
258#endif /* ASM */
259
260#endif /* GEN5200 */
Note: See TracBrowser for help on using the repository browser.