source: rtems/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h @ 68f39d58

4.104.11
Last change on this file since 68f39d58 was 68f39d58, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 1, 2008 at 9:35:40 AM

2008-10-01 Ralf Corsépius <ralf.corsepius@…>

  • include/bsp.h: #include <bspopts.h> first.
  • Property mode set to 100644
File size: 4.7 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#include <bspopts.h>
24
25/*
26 * MPC8313E Reference Design Board
27 */
28
29#ifdef MPC8313ERDB
30
31#define HAS_UBOOT
32
33/* For U-Boot */
34#define CONFIG_MPC83XX
35#define CONFIG_HAS_ETH1
36
37#endif /* MPC8313ERDB */
38
39#include <libcpu/powerpc-utility.h> 
40
41#include <bsp/hwreg_vals.h>
42
43/*
44 * Some symbols defined in the linker command file.
45 */
46
47LINKER_SYMBOL(bsp_ram_start);
48LINKER_SYMBOL(bsp_ram_end);
49LINKER_SYMBOL(bsp_ram_size);
50
51LINKER_SYMBOL(bsp_rom_start);
52LINKER_SYMBOL(bsp_rom_end);
53LINKER_SYMBOL(bsp_rom_size);
54
55LINKER_SYMBOL(bsp_section_text_start);
56LINKER_SYMBOL(bsp_section_text_end);
57LINKER_SYMBOL(bsp_section_text_size);
58
59LINKER_SYMBOL(bsp_section_data_start);
60LINKER_SYMBOL(bsp_section_data_end);
61LINKER_SYMBOL(bsp_section_data_size);
62
63LINKER_SYMBOL(bsp_section_bss_start);
64LINKER_SYMBOL(bsp_section_bss_end);
65LINKER_SYMBOL(bsp_section_bss_size);
66
67LINKER_SYMBOL(bsp_interrupt_stack_start);
68LINKER_SYMBOL(bsp_interrupt_stack_end);
69LINKER_SYMBOL(bsp_interrupt_stack_size);
70
71LINKER_SYMBOL(bsp_work_area_start);
72
73LINKER_SYMBOL(IMMRBAR);
74
75#ifndef ASM
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
81
82#include <rtems.h>
83#include <rtems/console.h>
84#include <rtems/clockdrv.h>
85#include <bsp/irq.h>
86#include <bsp/vectors.h>
87#include <bsp/tictac.h>
88
89#ifdef HAS_UBOOT
90
91#include <bsp/u-boot.h>
92
93extern bd_t bsp_uboot_board_info;
94extern const size_t bsp_uboot_board_info_size;
95
96#endif /* HAS_UBOOT */
97
98#define BSP_UART1_MINOR 0
99#define BSP_UART2_MINOR 1
100
101/*
102 * indicate, that BSP has no IDE driver
103 */
104#undef RTEMS_BSP_HAS_IDE_DRIVER
105
106/* misc macros */
107#define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0]))
108
109/* functions */
110
111rtems_status_code bsp_register_i2c(void);
112rtems_status_code bsp_register_spi(void);
113
114/* console modes (only termios) */
115#ifdef  PRINTK_MINOR
116#undef  PRINTK_MINOR
117#endif
118#define PRINTK_MINOR BSP_UART1_MINOR
119
120#if defined(MPC8249EAMDS)
121#define BSP_USE_UART2 TRUE
122#else
123#define BSP_USE_UART2 FALSE
124#endif
125
126#define SINGLE_CHAR_MODE
127#define UARTS_USE_TERMIOS_INT   1
128
129/*
130 * Network driver configuration
131 */
132struct rtems_bsdnet_ifconfig;
133extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching);
134#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
135
136#ifdef MPC8313ERDB
137
138#define RTEMS_BSP_NETWORK_DRIVER_NAME   "tsec2"
139#define RTEMS_BSP_NETWORK_DRIVER_NAME2  "tsec1"
140
141#else /* MPC8313ERDB */
142
143#define RTEMS_BSP_NETWORK_DRIVER_NAME   "tsec1"
144#define RTEMS_BSP_NETWORK_DRIVER_NAME2  "tsec2"
145
146#endif /* MPC8313ERDB */
147
148#if defined(MPC8349EAMDS)
149/*
150 * i2c EEPROM device name
151 */
152#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
153#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
154
155/*
156 * SPI Flash device name
157 */
158#define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash"
159#define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash"
160#endif /* defined(MPC8349EAMDS) */
161
162#if defined(HSC_CM01)
163/*
164 * i2c EEPROM device name
165 */
166#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
167#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
168
169/*
170 * SPI FRAM device name
171 */
172#define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram"
173#define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram"
174#endif /* defined(HSC_CM01) */
175
176extern unsigned int BSP_bus_frequency;
177
178extern uint32_t bsp_clicks_per_usec;
179
180/*
181 *  Convert decrementer value to tenths of microseconds (used by shared timer
182 *  driver).
183 */
184#define BSP_Convert_decrementer( _value ) \
185  ((int) (((_value) * 10) / bsp_clicks_per_usec))
186
187void mpc83xx_zero_4( void *dest, size_t n);
188
189void cpu_init( void);
190
191#ifdef __cplusplus
192}
193#endif
194
195#endif /* ASM */
196
197#endif /* GEN83xx */
Note: See TracBrowser for help on using the repository browser.