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 <bsp/hwreg_vals.h> |
---|
24 | |
---|
25 | #ifndef ASM |
---|
26 | |
---|
27 | #ifdef __cplusplus |
---|
28 | extern "C" { |
---|
29 | #endif |
---|
30 | |
---|
31 | #include "bspopts.h" |
---|
32 | |
---|
33 | #include <rtems.h> |
---|
34 | #include <rtems/console.h> |
---|
35 | #include <rtems/clockdrv.h> |
---|
36 | #include <bsp/irq.h> |
---|
37 | #include <bsp/vectors.h> |
---|
38 | |
---|
39 | /* miscellaneous stuff assumed to exist */ |
---|
40 | |
---|
41 | /* |
---|
42 | * We need to decide how much memory will be non-cacheable. This |
---|
43 | * will mainly be memory that will be used in DMA (network and serial |
---|
44 | * buffers). |
---|
45 | */ |
---|
46 | /* |
---|
47 | * Stuff for Time Test 27 |
---|
48 | */ |
---|
49 | #define MUST_WAIT_FOR_INTERRUPT 0 |
---|
50 | |
---|
51 | /* |
---|
52 | * Device Driver Table Entries |
---|
53 | */ |
---|
54 | |
---|
55 | /* |
---|
56 | * NOTE: Use the standard Console driver entry |
---|
57 | */ |
---|
58 | #define BSP_UART1_MINOR 0 |
---|
59 | #define BSP_UART2_MINOR 1 |
---|
60 | |
---|
61 | /* |
---|
62 | * NOTE: Use the standard Clock driver entry |
---|
63 | */ |
---|
64 | |
---|
65 | /* |
---|
66 | * indicate, that BSP has no IDE driver |
---|
67 | */ |
---|
68 | #undef RTEMS_BSP_HAS_IDE_DRIVER |
---|
69 | |
---|
70 | /* |
---|
71 | * How many libio files we want |
---|
72 | */ |
---|
73 | #define BSP_LIBIO_MAX_FDS 20 |
---|
74 | |
---|
75 | /* misc macros */ |
---|
76 | #define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0])) |
---|
77 | |
---|
78 | /* functions */ |
---|
79 | |
---|
80 | void bsp_cleanup(void); |
---|
81 | rtems_status_code bsp_register_i2c(void); |
---|
82 | rtems_status_code bsp_register_spi(void); |
---|
83 | |
---|
84 | /* console modes (only termios) */ |
---|
85 | #ifdef PRINTK_MINOR |
---|
86 | #undef PRINTK_MINOR |
---|
87 | #endif |
---|
88 | #define PRINTK_MINOR BSP_UART1_MINOR |
---|
89 | |
---|
90 | #if defined(MPC8249EAMDS) |
---|
91 | #define BSP_USE_UART2 TRUE |
---|
92 | #else |
---|
93 | #define BSP_USE_UART2 FALSE |
---|
94 | #endif |
---|
95 | |
---|
96 | #define SINGLE_CHAR_MODE |
---|
97 | #define UARTS_USE_TERMIOS_INT 1 |
---|
98 | |
---|
99 | /* |
---|
100 | * Convert decrement value to tenths of microsecnds (used by |
---|
101 | * shared timer driver). |
---|
102 | * |
---|
103 | * + CPU has a csb_clock bus, |
---|
104 | * + There are 4 bus cycles per click |
---|
105 | * + We return value in 1/10 microsecond units. |
---|
106 | * Modified following equation to integer equation to remove |
---|
107 | * floating point math. |
---|
108 | * (int) ((float)(_value) / ((XLB_CLOCK/1000000 * 0.1) / 4.0)) |
---|
109 | */ |
---|
110 | |
---|
111 | extern unsigned int BSP_bus_frequency; |
---|
112 | #define BSP_Convert_decrementer( _value ) \ |
---|
113 | (int) (((_value) * 4000) / (BSP_bus_frequency/10000)) |
---|
114 | |
---|
115 | /* |
---|
116 | * Network driver configuration |
---|
117 | */ |
---|
118 | struct rtems_bsdnet_ifconfig; |
---|
119 | extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching); |
---|
120 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1" |
---|
121 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach |
---|
122 | |
---|
123 | #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2" |
---|
124 | |
---|
125 | #if defined(MPC8349EAMDS) |
---|
126 | /* |
---|
127 | * i2c EEPROM device name |
---|
128 | */ |
---|
129 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom" |
---|
130 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom" |
---|
131 | |
---|
132 | /* |
---|
133 | * SPI Flash device name |
---|
134 | */ |
---|
135 | #define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash" |
---|
136 | #define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash" |
---|
137 | #endif /* defined(MPC8349EAMDS) */ |
---|
138 | |
---|
139 | #if defined(HSC_CM01) |
---|
140 | /* |
---|
141 | * i2c EEPROM device name |
---|
142 | */ |
---|
143 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom" |
---|
144 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom" |
---|
145 | |
---|
146 | /* |
---|
147 | * SPI FRAM device name |
---|
148 | */ |
---|
149 | #define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram" |
---|
150 | #define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram" |
---|
151 | #endif /* defined(HSC_CM01) */ |
---|
152 | |
---|
153 | #ifdef __cplusplus |
---|
154 | } |
---|
155 | #endif |
---|
156 | |
---|
157 | #endif /* ASM */ |
---|
158 | |
---|
159 | #endif /* GEN83xx */ |
---|