RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bsp.h
Go to the documentation of this file.
1
9/*===============================================================*\
10| Project: RTEMS generic MPC83xx BSP |
11+-----------------------------------------------------------------+
12| Copyright (c) 2007 |
13| Embedded Brains GmbH |
14| Obere Lagerstr. 30 |
15| D-82178 Puchheim |
16| Germany |
17| rtems@embedded-brains.de |
18+-----------------------------------------------------------------+
19| The license and distribution terms for this file may be |
20| found in the file LICENSE in this distribution or at |
21| |
22| http://www.rtems.org/license/LICENSE. |
23| |
24+-----------------------------------------------------------------+
25| this file contains board specific definitions |
26\*===============================================================*/
27
28
29#ifndef LIBBSP_POWERPC_GEN83XX_BSP_H
30#define LIBBSP_POWERPC_GEN83XX_BSP_H
31
42#define BSP_FEATURE_IRQ_EXTENSION
43
44#include <bspopts.h>
45
47
48#include <bsp/hwreg_vals.h>
49
50/*
51 * Some symbols defined in the linker command file.
52 */
53
54LINKER_SYMBOL(bsp_ram_start);
55LINKER_SYMBOL(bsp_ram_end);
56LINKER_SYMBOL(bsp_ram_size);
57
58LINKER_SYMBOL(bsp_rom_start);
59LINKER_SYMBOL(bsp_rom_end);
60LINKER_SYMBOL(bsp_rom_size);
61
62LINKER_SYMBOL(bsp_section_text_start);
63LINKER_SYMBOL(bsp_section_text_end);
64LINKER_SYMBOL(bsp_section_text_size);
65
66LINKER_SYMBOL(bsp_section_data_start);
67LINKER_SYMBOL(bsp_section_data_end);
68LINKER_SYMBOL(bsp_section_data_size);
69
70LINKER_SYMBOL(bsp_section_bss_start);
71LINKER_SYMBOL(bsp_section_bss_end);
72LINKER_SYMBOL(bsp_section_bss_size);
73
74LINKER_SYMBOL(bsp_work_area_start);
75
76LINKER_SYMBOL(IMMRBAR);
77
78#ifndef ASM
79
80#include <rtems.h>
81#include <bsp/vectors.h>
82#include <bsp/irq.h>
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
89/*
90 * indicate, that BSP has no IDE driver
91 */
92#undef RTEMS_BSP_HAS_IDE_DRIVER
93
94/* misc macros */
95#define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0]))
96
97void *bsp_idle_thread( uintptr_t ignored );
98#define BSP_IDLE_TASK_BODY bsp_idle_thread
99
100/* functions */
101rtems_status_code bsp_register_i2c(void);
102rtems_status_code bsp_register_spi(void);
103
104/*
105 * Network driver configuration
106 */
107struct rtems_bsdnet_ifconfig;
108extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching);
109#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
110
111#ifdef MPC83XX_BOARD_MPC8313ERDB
112 #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec2"
113 #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec1"
114#else
115 #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1"
116 #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2"
117#endif
118
119#if defined(MPC83XX_BOARD_MPC8349EAMDS)
120/*
121 * i2c EEPROM device name
122 */
123#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
124#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
125
126/*
127 * SPI Flash device name
128 */
129#define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash"
130#define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash"
131#endif /* defined(MPC83XX_BOARD_MPC8349EAMDS) */
132
133#if defined(MPC83XX_BOARD_HSC_CM01)
134/*
135 * i2c EEPROM device name
136 */
137#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
138#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
139
140/*
141 * SPI FRAM device name
142 */
143#define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram"
144#define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram"
145#endif /* defined(MPC83XX_BOARD_HSC_CM01) */
146
147extern unsigned int BSP_bus_frequency;
148
149extern uint32_t bsp_clicks_per_usec;
150
151/*
152 * Convert decrementer value to tenths of microseconds (used by shared timer
153 * driver).
154 */
155#define BSP_Convert_decrementer( _value ) \
156 ((int) (((_value) * 10) / bsp_clicks_per_usec))
157
158void mpc83xx_zero_4( void *dest, size_t n);
159
160void cpu_init( void);
161
162void bsp_restart(void *addr);
163
164#if defined(HAS_UBOOT)
165 /* Routine to obtain U-Boot environment variables */
166 const char *bsp_uboot_getenv(
167 const char *name
168 );
169#endif
170
171#ifdef __cplusplus
172}
173#endif
174
175#endif /* ASM */
176
179#endif /* GEN83xx */
PowerPC Exceptions API.
DEFAULT_INITIAL_EXTENSION Support.
rtems_status_code
Classic API Status.
Definition: status.h:43
void bsp_restart(const void *addr)
Restarts the bsp with "addr" address.
Definition: restart.c:25
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:26
uint32_t bsp_clicks_per_usec
Time base clicks per micro second.
Definition: bspstart.c:99
General purpose assembler macros, linker command file support and some inline functions for direct re...
Definition: deflate.c:115