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.org/license/LICENSE. | |
---|
15 | | | |
---|
16 | +-----------------------------------------------------------------+ |
---|
17 | | this file contains board specific definitions | |
---|
18 | \*===============================================================*/ |
---|
19 | |
---|
20 | |
---|
21 | #ifndef LIBBSP_POWERPC_GEN83XX_BSP_H |
---|
22 | #define LIBBSP_POWERPC_GEN83XX_BSP_H |
---|
23 | |
---|
24 | #define BSP_FEATURE_IRQ_EXTENSION |
---|
25 | |
---|
26 | #include <bspopts.h> |
---|
27 | |
---|
28 | #include <libcpu/powerpc-utility.h> |
---|
29 | |
---|
30 | #include <bsp/hwreg_vals.h> |
---|
31 | |
---|
32 | /* |
---|
33 | * Some symbols defined in the linker command file. |
---|
34 | */ |
---|
35 | |
---|
36 | LINKER_SYMBOL(bsp_ram_start); |
---|
37 | LINKER_SYMBOL(bsp_ram_end); |
---|
38 | LINKER_SYMBOL(bsp_ram_size); |
---|
39 | |
---|
40 | LINKER_SYMBOL(bsp_rom_start); |
---|
41 | LINKER_SYMBOL(bsp_rom_end); |
---|
42 | LINKER_SYMBOL(bsp_rom_size); |
---|
43 | |
---|
44 | LINKER_SYMBOL(bsp_section_text_start); |
---|
45 | LINKER_SYMBOL(bsp_section_text_end); |
---|
46 | LINKER_SYMBOL(bsp_section_text_size); |
---|
47 | |
---|
48 | LINKER_SYMBOL(bsp_section_data_start); |
---|
49 | LINKER_SYMBOL(bsp_section_data_end); |
---|
50 | LINKER_SYMBOL(bsp_section_data_size); |
---|
51 | |
---|
52 | LINKER_SYMBOL(bsp_section_bss_start); |
---|
53 | LINKER_SYMBOL(bsp_section_bss_end); |
---|
54 | LINKER_SYMBOL(bsp_section_bss_size); |
---|
55 | |
---|
56 | LINKER_SYMBOL(bsp_interrupt_stack_start); |
---|
57 | LINKER_SYMBOL(bsp_interrupt_stack_end); |
---|
58 | LINKER_SYMBOL(bsp_interrupt_stack_size); |
---|
59 | |
---|
60 | LINKER_SYMBOL(bsp_work_area_start); |
---|
61 | |
---|
62 | LINKER_SYMBOL(IMMRBAR); |
---|
63 | |
---|
64 | #ifndef ASM |
---|
65 | |
---|
66 | #include <rtems.h> |
---|
67 | #include <bsp/vectors.h> |
---|
68 | #include <bsp/irq.h> |
---|
69 | #include <bsp/default-initial-extension.h> |
---|
70 | |
---|
71 | #ifdef __cplusplus |
---|
72 | extern "C" { |
---|
73 | #endif |
---|
74 | |
---|
75 | /* |
---|
76 | * indicate, that BSP has no IDE driver |
---|
77 | */ |
---|
78 | #undef RTEMS_BSP_HAS_IDE_DRIVER |
---|
79 | |
---|
80 | /* misc macros */ |
---|
81 | #define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0])) |
---|
82 | |
---|
83 | void *bsp_idle_thread( uintptr_t ignored ); |
---|
84 | #define BSP_IDLE_TASK_BODY bsp_idle_thread |
---|
85 | |
---|
86 | /* functions */ |
---|
87 | rtems_status_code bsp_register_i2c(void); |
---|
88 | rtems_status_code bsp_register_spi(void); |
---|
89 | |
---|
90 | /* |
---|
91 | * Network driver configuration |
---|
92 | */ |
---|
93 | struct rtems_bsdnet_ifconfig; |
---|
94 | extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching); |
---|
95 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach |
---|
96 | |
---|
97 | #ifdef MPC83XX_BOARD_MPC8313ERDB |
---|
98 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec2" |
---|
99 | #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec1" |
---|
100 | #else |
---|
101 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1" |
---|
102 | #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2" |
---|
103 | #endif |
---|
104 | |
---|
105 | #if defined(MPC83XX_BOARD_MPC8349EAMDS) |
---|
106 | /* |
---|
107 | * i2c EEPROM device name |
---|
108 | */ |
---|
109 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom" |
---|
110 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom" |
---|
111 | |
---|
112 | /* |
---|
113 | * SPI Flash device name |
---|
114 | */ |
---|
115 | #define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash" |
---|
116 | #define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash" |
---|
117 | #endif /* defined(MPC83XX_BOARD_MPC8349EAMDS) */ |
---|
118 | |
---|
119 | #if defined(MPC83XX_BOARD_HSC_CM01) |
---|
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 FRAM device name |
---|
128 | */ |
---|
129 | #define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram" |
---|
130 | #define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram" |
---|
131 | #endif /* defined(MPC83XX_BOARD_HSC_CM01) */ |
---|
132 | |
---|
133 | extern unsigned int BSP_bus_frequency; |
---|
134 | |
---|
135 | extern uint32_t bsp_clicks_per_usec; |
---|
136 | |
---|
137 | /* |
---|
138 | * Convert decrementer value to tenths of microseconds (used by shared timer |
---|
139 | * driver). |
---|
140 | */ |
---|
141 | #define BSP_Convert_decrementer( _value ) \ |
---|
142 | ((int) (((_value) * 10) / bsp_clicks_per_usec)) |
---|
143 | |
---|
144 | void mpc83xx_zero_4( void *dest, size_t n); |
---|
145 | |
---|
146 | void cpu_init( void); |
---|
147 | |
---|
148 | void bsp_restart(void *addr); |
---|
149 | |
---|
150 | #if defined(HAS_UBOOT) |
---|
151 | /* Routine to obtain U-Boot environment variables */ |
---|
152 | const char *bsp_uboot_getenv( |
---|
153 | const char *name |
---|
154 | ); |
---|
155 | #endif |
---|
156 | |
---|
157 | #ifdef __cplusplus |
---|
158 | } |
---|
159 | #endif |
---|
160 | |
---|
161 | #endif /* ASM */ |
---|
162 | |
---|
163 | #endif /* GEN83xx */ |
---|