1 | /* bsp.h |
---|
2 | * |
---|
3 | * This include file contains all board IO definitions. |
---|
4 | * |
---|
5 | * XXX : put yours in here |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989-1999. |
---|
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 | * $Id$ |
---|
15 | */ |
---|
16 | /* @(#)bsp.h 03/15/96 1.1 */ |
---|
17 | |
---|
18 | #ifndef __P4000_BSP_h |
---|
19 | #define __P4000_BSP_h |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | #include <bspopts.h> |
---|
26 | |
---|
27 | #include <rtems.h> |
---|
28 | #include <console.h> |
---|
29 | #include <clockdrv.h> |
---|
30 | |
---|
31 | /* |
---|
32 | * confdefs.h overrides for this BSP: |
---|
33 | * - number of termios serial ports (defaults to 1) |
---|
34 | * - Interrupt stack space is not minimum if defined. |
---|
35 | */ |
---|
36 | |
---|
37 | /* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */ |
---|
38 | #define CONFIGURE_INTERRUPT_STACK_MEMORY (4 * 1024) |
---|
39 | |
---|
40 | extern void WriteDisplay( char * string ); |
---|
41 | |
---|
42 | /* |
---|
43 | * Define the time limits for RTEMS Test Suite test durations. |
---|
44 | * Long test and short test duration limits are provided. These |
---|
45 | * values are in seconds and need to be converted to ticks for the |
---|
46 | * application. |
---|
47 | * |
---|
48 | */ |
---|
49 | |
---|
50 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
51 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
52 | |
---|
53 | /* |
---|
54 | * Stuff for Time Test 27 |
---|
55 | */ |
---|
56 | |
---|
57 | #define MUST_WAIT_FOR_INTERRUPT 0 |
---|
58 | |
---|
59 | #define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 ) |
---|
60 | |
---|
61 | #define Cause_tm27_intr() |
---|
62 | |
---|
63 | #define Clear_tm27_intr() |
---|
64 | |
---|
65 | #define Lower_tm27_intr() |
---|
66 | |
---|
67 | extern unsigned32 mips_get_timer( void ); |
---|
68 | |
---|
69 | #define CPU_CLOCK_RATE_MHZ (50) |
---|
70 | #define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */ |
---|
71 | |
---|
72 | /* |
---|
73 | * Simple spin delay in microsecond units for device drivers. |
---|
74 | * This is very dependent on the clock speed of the target. |
---|
75 | * |
---|
76 | * NOTE: This macro generates a warning like "integer constant out |
---|
77 | * of range" which is safe to ignore. In 64 bit mode, unsigned32 |
---|
78 | * types are actually 64 bits long so that comparisons between |
---|
79 | * unsigned32 types and pointers are valid. The warning is caused |
---|
80 | * by code in the delay macro that is necessary for 64 bit mode. |
---|
81 | */ |
---|
82 | |
---|
83 | #define rtems_bsp_delay( microseconds ) \ |
---|
84 | { \ |
---|
85 | unsigned32 _end_clock = \ |
---|
86 | mips_get_timer() + microseconds * CLOCKS_PER_MICROSECOND; \ |
---|
87 | _end_clock %= 0x100000000; /* make sure result is 32 bits */ \ |
---|
88 | \ |
---|
89 | /* handle timer overflow, if necessary */ \ |
---|
90 | while ( _end_clock < mips_get_timer() ); \ |
---|
91 | \ |
---|
92 | while ( _end_clock > mips_get_timer() ); \ |
---|
93 | } |
---|
94 | |
---|
95 | /* Constants */ |
---|
96 | |
---|
97 | #define RAM_START 0 |
---|
98 | #define RAM_END 0x100000 |
---|
99 | |
---|
100 | /* miscellaneous stuff assumed to exist */ |
---|
101 | |
---|
102 | extern rtems_configuration_table BSP_Configuration; |
---|
103 | |
---|
104 | /* |
---|
105 | * Device Driver Table Entries |
---|
106 | */ |
---|
107 | |
---|
108 | /* |
---|
109 | * NOTE: Use the standard Console driver entry |
---|
110 | */ |
---|
111 | |
---|
112 | /* |
---|
113 | * NOTE: Use the standard Clock driver entry |
---|
114 | */ |
---|
115 | |
---|
116 | /* miscellaneous stuff assumed to exist */ |
---|
117 | |
---|
118 | mips_isr_entry set_vector( /* returns old vector */ |
---|
119 | rtems_isr_entry handler, /* isr routine */ |
---|
120 | rtems_vector_number vector, /* vector number */ |
---|
121 | int type /* RTEMS or RAW intr */ |
---|
122 | ); |
---|
123 | |
---|
124 | #ifdef __cplusplus |
---|
125 | } |
---|
126 | #endif |
---|
127 | |
---|
128 | #endif |
---|
129 | /* end of include file */ |
---|