1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | */ |
---|
5 | |
---|
6 | /* |
---|
7 | * COPYRIGHT (c) 1989-2012. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.com/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #ifndef _BSP_H |
---|
16 | #define _BSP_H |
---|
17 | |
---|
18 | #ifdef __cplusplus |
---|
19 | extern "C" { |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <bspopts.h> |
---|
23 | #include <bsp/default-initial-extension.h> |
---|
24 | |
---|
25 | #include <rtems.h> |
---|
26 | #include <rtems/iosupp.h> |
---|
27 | #include <rtems/console.h> |
---|
28 | #include <rtems/clockdrv.h> |
---|
29 | #include <libcpu/rm5231.h> |
---|
30 | |
---|
31 | extern void WriteDisplay( char * string ); |
---|
32 | |
---|
33 | extern uint32_t mips_get_timer( void ); |
---|
34 | |
---|
35 | #define BSP_FEATURE_IRQ_EXTENSION |
---|
36 | #define BSP_SHARED_HANDLER_SUPPORT 1 |
---|
37 | |
---|
38 | #define CPU_CLOCK_RATE_MHZ (200) |
---|
39 | #define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */ |
---|
40 | |
---|
41 | /* |
---|
42 | * Simple spin delay in microsecond units for device drivers. |
---|
43 | * This is very dependent on the clock speed of the target. |
---|
44 | * |
---|
45 | * NOTE: This macro generates a warning like "integer constant out |
---|
46 | * of range" which is safe to ignore. In 64 bit mode, unsigned32 |
---|
47 | * types are actually 64 bits long so that comparisons between |
---|
48 | * unsigned32 types and pointers are valid. The warning is caused |
---|
49 | * by code in the delay macro that is necessary for 64 bit mode. |
---|
50 | */ |
---|
51 | |
---|
52 | #define rtems_bsp_delay( microseconds ) \ |
---|
53 | { \ |
---|
54 | uint32_t _end_clock = \ |
---|
55 | mips_get_timer() + microseconds * CLOCKS_PER_MICROSECOND; \ |
---|
56 | _end_clock %= 0x100000000; /* make sure result is 32 bits */ \ |
---|
57 | \ |
---|
58 | /* handle timer overflow, if necessary */ \ |
---|
59 | while ( _end_clock < mips_get_timer() ); \ |
---|
60 | \ |
---|
61 | while ( _end_clock > mips_get_timer() ); \ |
---|
62 | } |
---|
63 | |
---|
64 | /* Constants */ |
---|
65 | |
---|
66 | #define RAM_START 0 |
---|
67 | #define RAM_END 0x100000 |
---|
68 | |
---|
69 | #ifdef __cplusplus |
---|
70 | } |
---|
71 | #endif |
---|
72 | |
---|
73 | #endif /* __HURRICANE_BSP_h */ |
---|