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

4.9
Last change on this file since eb32e3a was eb32e3a, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 11/18/08 at 11:36:28

include/bsp.h, include/hwreg_vals.h, network/network.c:

correct some init values for HSC_CM01 boards
change strategy to determine MAC address

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