1 | /* bsp.h |
---|
2 | * |
---|
3 | * This include file contains all mrm board IO definitions. |
---|
4 | * |
---|
5 | * COPYRIGHT (c) 1989-2009. |
---|
6 | * On-Line Applications Research Corporation (OAR). |
---|
7 | * |
---|
8 | * The license and distribution terms for this file may be |
---|
9 | * found in the file LICENSE in this distribution or at |
---|
10 | * http://www.rtems.com/license/LICENSE. |
---|
11 | */ |
---|
12 | |
---|
13 | #ifndef _BSP_H |
---|
14 | #define _BSP_H |
---|
15 | |
---|
16 | #ifdef __cplusplus |
---|
17 | extern "C" { |
---|
18 | #endif |
---|
19 | |
---|
20 | #include <bspopts.h> |
---|
21 | #include <bsp/default-initial-extension.h> |
---|
22 | |
---|
23 | #include <rtems.h> |
---|
24 | #include <rtems/bspIo.h> |
---|
25 | #include <rtems/clockdrv.h> |
---|
26 | #include <rtems/console.h> |
---|
27 | #include <rtems/iosupp.h> |
---|
28 | #include <mrm332.h> |
---|
29 | #include <rtems/m68k/sim.h> |
---|
30 | #include <rtems/m68k/qsm.h> |
---|
31 | |
---|
32 | #define BSP_SMALL_MEMORY 1 |
---|
33 | |
---|
34 | #define CONSOLE_SCI |
---|
35 | |
---|
36 | /* |
---|
37 | * Simple spin delay in microsecond units for device drivers. |
---|
38 | * This is very dependent on the clock speed of the target. |
---|
39 | */ |
---|
40 | |
---|
41 | #define rtems_bsp_delay( microseconds ) \ |
---|
42 | { register uint32_t _delay=(microseconds); \ |
---|
43 | register uint32_t _tmp=123; \ |
---|
44 | __asm__ volatile( "0: \ |
---|
45 | nbcd %0 ; \ |
---|
46 | nbcd %0 ; \ |
---|
47 | dbf %1,0b" \ |
---|
48 | : "=d" (_tmp), "=d" (_delay) \ |
---|
49 | : "0" (_tmp), "1" (_delay) ); \ |
---|
50 | } |
---|
51 | |
---|
52 | /* externals */ |
---|
53 | |
---|
54 | extern char _etext[]; |
---|
55 | extern char _copy_start[]; |
---|
56 | extern char _edata[]; |
---|
57 | extern char _clear_start[]; |
---|
58 | extern char end[]; |
---|
59 | extern char _copy_data_from_rom[]; |
---|
60 | |
---|
61 | /* constants */ |
---|
62 | |
---|
63 | #ifdef __START_C__ |
---|
64 | #define STACK_SIZE "#0x800" |
---|
65 | #else |
---|
66 | #define STACK_SIZE 0x800 |
---|
67 | #endif |
---|
68 | |
---|
69 | /* macros */ |
---|
70 | |
---|
71 | #define RAW_PUTS(str) \ |
---|
72 | { register char *ptr = str; \ |
---|
73 | while (*ptr) SCI_output_char(*ptr++); \ |
---|
74 | } |
---|
75 | |
---|
76 | #define RAW_PUTI(n) { \ |
---|
77 | register int i, j; \ |
---|
78 | \ |
---|
79 | RAW_PUTS("0x"); \ |
---|
80 | for (i=28;i>=0;i -= 4) { \ |
---|
81 | j = (n>>i) & 0xf; \ |
---|
82 | SCI_output_char( (j>9 ? j-10+'a' : j+'0') ); \ |
---|
83 | } \ |
---|
84 | } |
---|
85 | |
---|
86 | /* miscellaneous stuff assumed to exist */ |
---|
87 | |
---|
88 | extern rtems_isr_entry M68Kvec[]; /* vector table address */ |
---|
89 | |
---|
90 | extern int stack_size; |
---|
91 | extern int stack_start; |
---|
92 | |
---|
93 | /* functions */ |
---|
94 | |
---|
95 | rtems_isr_entry set_vector( |
---|
96 | rtems_isr_entry handler, |
---|
97 | rtems_vector_number vector, |
---|
98 | int type |
---|
99 | ); |
---|
100 | |
---|
101 | void Spurious_Initialize(void); |
---|
102 | |
---|
103 | void _UART_flush(void); |
---|
104 | |
---|
105 | void outbyte(char); |
---|
106 | |
---|
107 | #ifdef __cplusplus |
---|
108 | } |
---|
109 | #endif |
---|
110 | |
---|
111 | #endif |
---|