source: rtems/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h @ 699c2be

4.104.114.9
Last change on this file since 699c2be was 699c2be, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 19, 2008 at 12:38:41 PM

2008-08-19 Sebastian Huber <sebastian.huber@…>

  • include/bsp.h, network/network.c, spi/spi_init.c, startup/cpuinit.c, startup/uboot_support.c: Fixed warnings.
  • Property mode set to 100644
File size: 5.2 KB
Line 
1/*===============================================================*\
2| Project: RTEMS generic MPC83xx BSP                              |
3+-----------------------------------------------------------------+
4|                    Copyright (c) 2007                           |
5|                    Embedded Brains GmbH                         |
6|                    Obere Lagerstr. 30                           |
7|                    D-82178 Puchheim                             |
8|                    Germany                                      |
9|                    rtems@embedded-brains.de                     |
10+-----------------------------------------------------------------+
11| The license and distribution terms for this file may be         |
12| found in the file LICENSE in this distribution or at            |
13|                                                                 |
14| http://www.rtems.com/license/LICENSE.                           |
15|                                                                 |
16+-----------------------------------------------------------------+
17| this file contains board specific definitions                   |
18\*===============================================================*/
19
20#ifndef __GEN83xx_BSP_h
21#define __GEN83xx_BSP_h
22
23/*
24 * MPC8313E Reference Design Board
25 */
26
27#ifdef MPC8313ERDB
28
29#define HAS_UBOOT
30
31/* For U-Boot */
32#define CONFIG_MPC83XX
33#define CONFIG_HAS_ETH1
34
35#endif /* MPC8313ERDB */
36
37#include <libcpu/powerpc-utility.h> 
38
39#include <bsp/hwreg_vals.h>
40
41/*
42 * Some symbols defined in the linker command file.
43 */
44
45LINKER_SYMBOL( bsp_ram_start);
46LINKER_SYMBOL( bsp_ram_end);
47LINKER_SYMBOL( bsp_ram_size);
48
49LINKER_SYMBOL( bsp_rom_start);
50LINKER_SYMBOL( bsp_rom_end);
51LINKER_SYMBOL( bsp_rom_size);
52
53LINKER_SYMBOL( bsp_section_text_start);
54LINKER_SYMBOL( bsp_section_text_end);
55LINKER_SYMBOL( bsp_section_text_size);
56
57LINKER_SYMBOL( bsp_section_data_start);
58LINKER_SYMBOL( bsp_section_data_end);
59LINKER_SYMBOL( bsp_section_data_size);
60
61LINKER_SYMBOL( bsp_section_bss_start);
62LINKER_SYMBOL( bsp_section_bss_end);
63LINKER_SYMBOL( bsp_section_bss_size);
64
65LINKER_SYMBOL( bsp_interrupt_stack_start);
66LINKER_SYMBOL( bsp_interrupt_stack_end);
67LINKER_SYMBOL( bsp_interrupt_stack_size);
68
69LINKER_SYMBOL( bsp_work_area_start);
70
71LINKER_SYMBOL( IMMRBAR);
72
73#ifndef ASM
74
75#ifdef __cplusplus
76extern "C" {
77#endif
78
79#include "bspopts.h"
80
81#include <rtems.h>
82#include <rtems/console.h>
83#include <rtems/clockdrv.h>
84#include <bsp/irq.h>
85#include <bsp/vectors.h>
86#include <bsp/tictac.h>
87
88#ifdef HAS_UBOOT
89
90#include <bsp/u-boot.h>
91
92extern bd_t mpc83xx_uboot_board_info;
93
94extern const size_t mpc83xx_uboot_board_info_size;
95
96#endif /* HAS_UBOOT */
97
98/* miscellaneous stuff assumed to exist */
99
100/*
101 * We need to decide how much memory will be non-cacheable. This
102 * will mainly be memory that will be used in DMA (network and serial
103 * buffers).
104 */
105/*
106 *  Stuff for Time Test 27
107 */
108#define MUST_WAIT_FOR_INTERRUPT 0
109
110/*
111 *  Device Driver Table Entries
112 */
113
114/*
115 * NOTE: Use the standard Console driver entry
116 */
117#define BSP_UART1_MINOR 0
118#define BSP_UART2_MINOR 1
119
120/*
121 * NOTE: Use the standard Clock driver entry
122 */
123
124/*
125 * indicate, that BSP has no IDE driver
126 */
127#undef RTEMS_BSP_HAS_IDE_DRIVER
128
129/*
130 * How many libio files we want
131 */
132#define BSP_LIBIO_MAX_FDS       20
133
134/* misc macros */
135#define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0]))
136
137/* functions */
138
139void bsp_cleanup(void);
140rtems_status_code bsp_register_i2c(void);
141rtems_status_code bsp_register_spi(void);
142
143/* console modes (only termios) */
144#ifdef  PRINTK_MINOR
145#undef  PRINTK_MINOR
146#endif
147#define PRINTK_MINOR BSP_UART1_MINOR
148
149#if defined(MPC8249EAMDS)
150#define BSP_USE_UART2 TRUE
151#else
152#define BSP_USE_UART2 FALSE
153#endif
154
155#define SINGLE_CHAR_MODE
156#define UARTS_USE_TERMIOS_INT   1
157
158/*
159 * Network driver configuration
160 */
161struct rtems_bsdnet_ifconfig;
162extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching);
163#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
164
165#ifdef MPC8313ERDB
166
167#define RTEMS_BSP_NETWORK_DRIVER_NAME   "tsec2"
168#define RTEMS_BSP_NETWORK_DRIVER_NAME2  "tsec1"
169
170#else /* MPC8313ERDB */
171
172#define RTEMS_BSP_NETWORK_DRIVER_NAME   "tsec1"
173#define RTEMS_BSP_NETWORK_DRIVER_NAME2  "tsec2"
174
175#endif /* MPC8313ERDB */
176
177#if defined(MPC8349EAMDS)
178/*
179 * i2c EEPROM device name
180 */
181#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
182#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
183
184/*
185 * SPI Flash device name
186 */
187#define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash"
188#define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash"
189#endif /* defined(MPC8349EAMDS) */
190
191#if defined(HSC_CM01)
192/*
193 * i2c EEPROM device name
194 */
195#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
196#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
197
198/*
199 * SPI FRAM device name
200 */
201#define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram"
202#define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram"
203#endif /* defined(HSC_CM01) */
204
205extern unsigned int BSP_bus_frequency;
206
207extern uint32_t bsp_clicks_per_usec;
208
209/*
210 *  Convert decrementer value to tenths of microseconds (used by shared timer
211 *  driver).
212 */
213#define BSP_Convert_decrementer( _value ) \
214  ((int) (((_value) * 10) / bsp_clicks_per_usec))
215
216void mpc83xx_zero_4( void *dest, size_t n);
217
218void cpu_init( void);
219
220#ifdef __cplusplus
221}
222#endif
223
224#endif /* ASM */
225
226#endif /* GEN83xx */
Note: See TracBrowser for help on using the repository browser.