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

4.104.115
Last change on this file since c5a7f1a9 was 2fb1805, checked in by Joel Sherrill <joel.sherrill@…>, on 09/22/08 at 21:50:17

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

  • Makefile.am, console/console.c, include/bsp.h: Use standardized bsp_cleanup() which can optionally print a message, poll for user to press key, and call bsp_reset(). Using this eliminates the various bsp_cleanup() implementations which had their own implementation and variety of string constants.
  • startup/bspreset.c: New file.
  • startup/bspclean.c: Removed.
  • 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/*
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 bsp_uboot_board_info;
93extern const size_t bsp_uboot_board_info_size;
94
95#endif /* HAS_UBOOT */
96
97#define BSP_UART1_MINOR 0
98#define BSP_UART2_MINOR 1
99
100/*
101 * indicate, that BSP has no IDE driver
102 */
103#undef RTEMS_BSP_HAS_IDE_DRIVER
104
105/* misc macros */
106#define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0]))
107
108/* functions */
109
110rtems_status_code bsp_register_i2c(void);
111rtems_status_code bsp_register_spi(void);
112
113/* console modes (only termios) */
114#ifdef  PRINTK_MINOR
115#undef  PRINTK_MINOR
116#endif
117#define PRINTK_MINOR BSP_UART1_MINOR
118
119#if defined(MPC8249EAMDS)
120#define BSP_USE_UART2 TRUE
121#else
122#define BSP_USE_UART2 FALSE
123#endif
124
125#define SINGLE_CHAR_MODE
126#define UARTS_USE_TERMIOS_INT   1
127
128/*
129 * Network driver configuration
130 */
131struct rtems_bsdnet_ifconfig;
132extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching);
133#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
134
135#ifdef MPC8313ERDB
136
137#define RTEMS_BSP_NETWORK_DRIVER_NAME   "tsec2"
138#define RTEMS_BSP_NETWORK_DRIVER_NAME2  "tsec1"
139
140#else /* MPC8313ERDB */
141
142#define RTEMS_BSP_NETWORK_DRIVER_NAME   "tsec1"
143#define RTEMS_BSP_NETWORK_DRIVER_NAME2  "tsec2"
144
145#endif /* MPC8313ERDB */
146
147#if defined(MPC8349EAMDS)
148/*
149 * i2c EEPROM device name
150 */
151#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
152#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
153
154/*
155 * SPI Flash device name
156 */
157#define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash"
158#define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash"
159#endif /* defined(MPC8349EAMDS) */
160
161#if defined(HSC_CM01)
162/*
163 * i2c EEPROM device name
164 */
165#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
166#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
167
168/*
169 * SPI FRAM device name
170 */
171#define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram"
172#define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram"
173#endif /* defined(HSC_CM01) */
174
175extern unsigned int BSP_bus_frequency;
176
177extern uint32_t bsp_clicks_per_usec;
178
179/*
180 *  Convert decrementer value to tenths of microseconds (used by shared timer
181 *  driver).
182 */
183#define BSP_Convert_decrementer( _value ) \
184  ((int) (((_value) * 10) / bsp_clicks_per_usec))
185
186void mpc83xx_zero_4( void *dest, size_t n);
187
188void cpu_init( void);
189
190#ifdef __cplusplus
191}
192#endif
193
194#endif /* ASM */
195
196#endif /* GEN83xx */
Note: See TracBrowser for help on using the repository browser.