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 | |
---|
47 | LINKER_SYMBOL(bsp_ram_start); |
---|
48 | LINKER_SYMBOL(bsp_ram_end); |
---|
49 | LINKER_SYMBOL(bsp_ram_size); |
---|
50 | |
---|
51 | LINKER_SYMBOL(bsp_rom_start); |
---|
52 | LINKER_SYMBOL(bsp_rom_end); |
---|
53 | LINKER_SYMBOL(bsp_rom_size); |
---|
54 | |
---|
55 | LINKER_SYMBOL(bsp_section_text_start); |
---|
56 | LINKER_SYMBOL(bsp_section_text_end); |
---|
57 | LINKER_SYMBOL(bsp_section_text_size); |
---|
58 | |
---|
59 | LINKER_SYMBOL(bsp_section_data_start); |
---|
60 | LINKER_SYMBOL(bsp_section_data_end); |
---|
61 | LINKER_SYMBOL(bsp_section_data_size); |
---|
62 | |
---|
63 | LINKER_SYMBOL(bsp_section_bss_start); |
---|
64 | LINKER_SYMBOL(bsp_section_bss_end); |
---|
65 | LINKER_SYMBOL(bsp_section_bss_size); |
---|
66 | |
---|
67 | LINKER_SYMBOL(bsp_interrupt_stack_start); |
---|
68 | LINKER_SYMBOL(bsp_interrupt_stack_end); |
---|
69 | LINKER_SYMBOL(bsp_interrupt_stack_size); |
---|
70 | |
---|
71 | LINKER_SYMBOL(bsp_work_area_start); |
---|
72 | |
---|
73 | LINKER_SYMBOL(IMMRBAR); |
---|
74 | |
---|
75 | #ifndef ASM |
---|
76 | |
---|
77 | #ifdef __cplusplus |
---|
78 | extern "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 | |
---|
93 | extern bd_t bsp_uboot_board_info; |
---|
94 | extern 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 | |
---|
111 | rtems_status_code bsp_register_i2c(void); |
---|
112 | rtems_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) || defined(HSC_CM01) |
---|
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 | */ |
---|
132 | struct rtems_bsdnet_ifconfig; |
---|
133 | extern 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 | |
---|
176 | extern unsigned int BSP_bus_frequency; |
---|
177 | |
---|
178 | extern 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 | |
---|
187 | void mpc83xx_zero_4( void *dest, size_t n); |
---|
188 | |
---|
189 | void cpu_init( void); |
---|
190 | |
---|
191 | #ifdef __cplusplus |
---|
192 | } |
---|
193 | #endif |
---|
194 | |
---|
195 | #endif /* ASM */ |
---|
196 | |
---|
197 | #endif /* GEN83xx */ |
---|