1 | /* bsp.h |
---|
2 | * |
---|
3 | * This include file contains all Papyrus board IO definitions. |
---|
4 | * |
---|
5 | * Author: Andrew Bray <andy@i-cubed.co.uk> |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1995 by i-cubed ltd. |
---|
8 | * |
---|
9 | * To anyone who acknowledges that this file is provided "AS IS" |
---|
10 | * without any express or implied warranty: |
---|
11 | * permission to use, copy, modify, and distribute this file |
---|
12 | * for any purpose is hereby granted without fee, provided that |
---|
13 | * the above copyright notice and this notice appears in all |
---|
14 | * copies, and that the name of i-cubed limited not be used in |
---|
15 | * advertising or publicity pertaining to distribution of the |
---|
16 | * software without specific, written prior permission. |
---|
17 | * i-cubed limited makes no representations about the suitability |
---|
18 | * of this software for any purpose. |
---|
19 | * |
---|
20 | * Derived from c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h |
---|
21 | * |
---|
22 | * COPYRIGHT (c) 1989-1999. |
---|
23 | * On-Line Applications Research Corporation (OAR). |
---|
24 | * |
---|
25 | * The license and distribution terms for this file may be |
---|
26 | * found in found in the file LICENSE in this distribution or at |
---|
27 | * http://www.rtems.com/license/LICENSE. |
---|
28 | * |
---|
29 | * $Id$ |
---|
30 | */ |
---|
31 | |
---|
32 | #ifndef __PAPYRUS_h |
---|
33 | #define __PAPYRUS_h |
---|
34 | |
---|
35 | #ifdef __cplusplus |
---|
36 | extern "C" { |
---|
37 | #endif |
---|
38 | |
---|
39 | #include <bspopts.h> |
---|
40 | |
---|
41 | /* |
---|
42 | * confdefs.h overrides for this BSP: |
---|
43 | * - termios serial ports (defaults to 1) |
---|
44 | * - Interrupt stack space is not minimum if defined. |
---|
45 | */ |
---|
46 | |
---|
47 | /* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */ |
---|
48 | #define CONFIGURE_INTERRUPT_STACK_MEMORY (12 * 1024) |
---|
49 | |
---|
50 | #ifdef ASM |
---|
51 | /* Definition of where to store registers in alignment handler */ |
---|
52 | #define ALIGN_REGS 0x0140 |
---|
53 | |
---|
54 | #else |
---|
55 | #include <rtems.h> |
---|
56 | #include <console.h> |
---|
57 | #include <clockdrv.h> |
---|
58 | #include <console.h> |
---|
59 | #include <iosupp.h> |
---|
60 | |
---|
61 | /* |
---|
62 | * Define the time limits for RTEMS Test Suite test durations. |
---|
63 | * Long test and short test duration limits are provided. These |
---|
64 | * values are in seconds and need to be converted to ticks for the |
---|
65 | * application. |
---|
66 | * |
---|
67 | */ |
---|
68 | |
---|
69 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
70 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
71 | |
---|
72 | |
---|
73 | /* |
---|
74 | * Stuff for Time Test 27 |
---|
75 | */ |
---|
76 | |
---|
77 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
78 | |
---|
79 | #define Install_tm27_vector( _handler ) \ |
---|
80 | set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 ) |
---|
81 | |
---|
82 | #define Cause_tm27_intr() \ |
---|
83 | do { \ |
---|
84 | uint32_t _clicks = 1; \ |
---|
85 | asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ |
---|
86 | } while (0) |
---|
87 | |
---|
88 | |
---|
89 | #define Clear_tm27_intr() \ |
---|
90 | do { \ |
---|
91 | uint32_t _clicks = 0xffffffff; \ |
---|
92 | asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ |
---|
93 | } while (0) |
---|
94 | |
---|
95 | #define Lower_tm27_intr() \ |
---|
96 | do { \ |
---|
97 | uint32_t _msr = 0; \ |
---|
98 | _ISR_Set_level( 0 ); \ |
---|
99 | asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ |
---|
100 | _msr |= 0x8002; \ |
---|
101 | asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ |
---|
102 | } while (0) |
---|
103 | |
---|
104 | /* Constants */ |
---|
105 | |
---|
106 | /* |
---|
107 | * Device Driver Table Entries |
---|
108 | */ |
---|
109 | |
---|
110 | /* |
---|
111 | * NOTE: Use the standard Console driver entry |
---|
112 | */ |
---|
113 | |
---|
114 | /* |
---|
115 | * NOTE: Use the standard Clock driver entry |
---|
116 | */ |
---|
117 | |
---|
118 | |
---|
119 | /* |
---|
120 | * Information placed in the linkcmds file. |
---|
121 | */ |
---|
122 | |
---|
123 | extern int RAM_START; |
---|
124 | extern int RAM_END; |
---|
125 | extern int RAM_SIZE; |
---|
126 | |
---|
127 | extern int PROM_START; |
---|
128 | extern int PROM_END; |
---|
129 | extern int PROM_SIZE; |
---|
130 | |
---|
131 | extern int CLOCK_SPEED; |
---|
132 | |
---|
133 | extern int end; /* last address in the program */ |
---|
134 | |
---|
135 | /* functions */ |
---|
136 | |
---|
137 | void bsp_start( void ); |
---|
138 | |
---|
139 | void bsp_cleanup( void ); |
---|
140 | |
---|
141 | rtems_isr_entry set_vector( /* returns old vector */ |
---|
142 | rtems_isr_entry handler, /* isr routine */ |
---|
143 | rtems_vector_number vector, /* vector number */ |
---|
144 | int type /* RTEMS or RAW intr */ |
---|
145 | ); |
---|
146 | |
---|
147 | void DEBUG_puts( char *string ); |
---|
148 | |
---|
149 | void BSP_fatal_return( void ); |
---|
150 | |
---|
151 | void bsp_spurious_initialize( void ); |
---|
152 | |
---|
153 | extern rtems_configuration_table BSP_Configuration; /* owned by BSP */ |
---|
154 | |
---|
155 | extern rtems_cpu_table Cpu_table; /* owned by BSP */ |
---|
156 | |
---|
157 | extern uint32_t bsp_isr_level; |
---|
158 | |
---|
159 | #endif /* ASM */ |
---|
160 | |
---|
161 | #ifdef __cplusplus |
---|
162 | } |
---|
163 | #endif |
---|
164 | |
---|
165 | #endif |
---|
166 | /* end of include file */ |
---|