[0074691a] | 1 | /* bsp.h |
---|
| 2 | * |
---|
| 3 | * This include file contains all board IO definitions. |
---|
| 4 | * |
---|
| 5 | * XXX : put yours in here |
---|
| 6 | * |
---|
[08311cc3] | 7 | * COPYRIGHT (c) 1989-1999. |
---|
[0074691a] | 8 | * On-Line Applications Research Corporation (OAR). |
---|
| 9 | * |
---|
[98e4ebf5] | 10 | * The license and distribution terms for this file may be |
---|
| 11 | * found in the file LICENSE in this distribution or at |
---|
[0074691a] | 12 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 13 | * |
---|
| 14 | * $Id$ |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #ifndef __GEN68302_BSP_h |
---|
| 18 | #define __GEN68302_BSP_h |
---|
| 19 | |
---|
| 20 | #ifdef __cplusplus |
---|
| 21 | extern "C" { |
---|
| 22 | #endif |
---|
| 23 | |
---|
[4906d72f] | 24 | #include <bspopts.h> |
---|
| 25 | |
---|
[0074691a] | 26 | #include <rtems.h> |
---|
| 27 | #include <console.h> |
---|
| 28 | #include <iosupp.h> |
---|
| 29 | #include <clockdrv.h> |
---|
| 30 | #include <m68302.h> |
---|
| 31 | |
---|
[df49c60] | 32 | /* |
---|
| 33 | * confdefs.h overrides for this BSP: |
---|
| 34 | * - number of termios serial ports (defaults to 1) |
---|
| 35 | * - Interrupt stack space is not minimum if defined. |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | /* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */ |
---|
| 39 | #define CONFIGURE_INTERRUPT_STACK_MEMORY (4 * 1024) |
---|
| 40 | |
---|
[5e2dce0] | 41 | #ifndef VARIANT |
---|
| 42 | #define VARIANT bare |
---|
| 43 | #endif |
---|
[0074691a] | 44 | #if defined(VARIANT) |
---|
| 45 | |
---|
| 46 | #define __bsp_cat(x, y) x ## y |
---|
[c23386a] | 47 | #define __bsp_xcat(x, y) __bsp_cat(x,y) |
---|
[0074691a] | 48 | #define __bsp_str(s) #s |
---|
| 49 | #define __bsp_xstr(s) __bsp_str(s) |
---|
| 50 | |
---|
[c23386a] | 51 | #define __BSP_HEADER_FILE__ __bsp_xcat(VARIANT,.h) |
---|
[0074691a] | 52 | #define __BSP_HEADER_FILE_STR__ __bsp_xstr(__BSP_HEADER_FILE__) |
---|
| 53 | |
---|
| 54 | #include __BSP_HEADER_FILE_STR__ |
---|
| 55 | #endif |
---|
| 56 | |
---|
| 57 | /* |
---|
| 58 | * Define the time limits for RTEMS Test Suite test durations. |
---|
| 59 | * Long test and short test duration limits are provided. These |
---|
| 60 | * values are in seconds and need to be converted to ticks for the |
---|
| 61 | * application. |
---|
| 62 | * |
---|
| 63 | */ |
---|
| 64 | |
---|
| 65 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
| 66 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
| 67 | |
---|
| 68 | /* |
---|
| 69 | * Stuff for Time Test 27 |
---|
| 70 | */ |
---|
| 71 | |
---|
| 72 | #define MUST_WAIT_FOR_INTERRUPT 0 |
---|
| 73 | |
---|
| 74 | #define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 ) |
---|
| 75 | |
---|
| 76 | #define Cause_tm27_intr() |
---|
| 77 | |
---|
| 78 | #define Clear_tm27_intr() |
---|
| 79 | |
---|
| 80 | #define Lower_tm27_intr() |
---|
| 81 | |
---|
| 82 | /* |
---|
| 83 | * Simple spin delay in microsecond units for device drivers. |
---|
| 84 | * This is very dependent on the clock speed of the target. |
---|
| 85 | */ |
---|
| 86 | |
---|
[cf282090] | 87 | #define rtems_bsp_delay( microseconds ) \ |
---|
[0074691a] | 88 | { register rtems_unsigned32 _delay=(microseconds); \ |
---|
| 89 | register rtems_unsigned32 _tmp=123; \ |
---|
| 90 | asm volatile( "0: \ |
---|
| 91 | nbcd %0 ; \ |
---|
| 92 | nbcd %0 ; \ |
---|
| 93 | dbf %1,0b" \ |
---|
| 94 | : "=d" (_tmp), "=d" (_delay) \ |
---|
| 95 | : "0" (_tmp), "1" (_delay) ); \ |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | /* Constants */ |
---|
| 99 | |
---|
| 100 | #define RAM_START RAM_BASE |
---|
| 101 | #define RAM_END (RAM_BASE + RAM_SIZE) |
---|
| 102 | |
---|
| 103 | /* Structures */ |
---|
| 104 | |
---|
| 105 | #ifdef GEN68302_INIT |
---|
| 106 | #undef EXTERN |
---|
| 107 | #define EXTERN |
---|
| 108 | #else |
---|
| 109 | #undef EXTERN |
---|
| 110 | #define EXTERN extern |
---|
| 111 | #endif |
---|
| 112 | |
---|
| 113 | /* |
---|
| 114 | * Device Driver Table Entries |
---|
| 115 | */ |
---|
| 116 | |
---|
| 117 | /* |
---|
| 118 | * NOTE: Use the standard Console driver entry |
---|
| 119 | */ |
---|
| 120 | |
---|
| 121 | /* |
---|
| 122 | * NOTE: Use the standard Clock driver entry |
---|
| 123 | */ |
---|
| 124 | |
---|
| 125 | /* miscellaneous stuff assumed to exist */ |
---|
| 126 | |
---|
| 127 | extern rtems_configuration_table BSP_Configuration; |
---|
| 128 | |
---|
| 129 | extern m68k_isr_entry M68Kvec[]; /* vector table address */ |
---|
| 130 | |
---|
| 131 | /* functions */ |
---|
| 132 | |
---|
| 133 | void bsp_cleanup( void ); |
---|
| 134 | |
---|
| 135 | m68k_isr_entry set_vector( |
---|
| 136 | rtems_isr_entry handler, |
---|
| 137 | rtems_vector_number vector, |
---|
| 138 | int type |
---|
| 139 | ); |
---|
| 140 | |
---|
| 141 | #ifdef __cplusplus |
---|
| 142 | } |
---|
| 143 | #endif |
---|
| 144 | |
---|
| 145 | #endif |
---|
| 146 | /* end of include file */ |
---|