[f849f3e] | 1 | /* bsp.h |
---|
| 2 | * |
---|
| 3 | * This include file contains some definitions specific to a board |
---|
| 4 | * based upon the generic capabilities of a Mongoose-V. |
---|
| 5 | * |
---|
[ef380d3f] | 6 | * COPYRIGHT (c) 1989-2001. |
---|
[f849f3e] | 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * |
---|
| 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[e00bf285] | 11 | * http://www.rtems.com/license/LICENSE. |
---|
[f849f3e] | 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #ifndef __GENERIC_MONGOOSE_V_h |
---|
| 17 | #define __GENERIC_MONGOOSE_V_h |
---|
| 18 | |
---|
| 19 | #ifdef __cplusplus |
---|
| 20 | extern "C" { |
---|
| 21 | #endif |
---|
| 22 | |
---|
[fddaaf12] | 23 | #include <bspopts.h> |
---|
| 24 | |
---|
[f849f3e] | 25 | #include <rtems.h> |
---|
| 26 | #include <iosupp.h> |
---|
| 27 | #include <console.h> |
---|
| 28 | #include <clockdrv.h> |
---|
| 29 | #include <libcpu/mongoose-v.h> |
---|
| 30 | |
---|
[a355e3ea] | 31 | |
---|
| 32 | #ifndef CPU_CLOCK_RATE |
---|
| 33 | #define CLOCK_RATE 12000000 |
---|
| 34 | #endif |
---|
| 35 | |
---|
| 36 | #define CPU_CLOCK_RATE_HZ CLOCK_RATE |
---|
| 37 | #define CPU_CLOCK_RATE_MHZ (CLOCK_RATE/1000000) |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | /* |
---|
| 41 | * Useful defines set here so we can avoid duplicating them all over |
---|
| 42 | * creation. |
---|
| 43 | * |
---|
| 44 | */ |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | /* |
---|
| 49 | * assertSoftwareInt defined in vectorisrs.c the prototype is here so |
---|
| 50 | * userspace code can get to it directly. |
---|
| 51 | * */ |
---|
| 52 | |
---|
| 53 | extern void assertSoftwareInterrupt(unsigned32); |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | |
---|
[f849f3e] | 59 | /* |
---|
| 60 | * Define the time limits for RTEMS Test Suite test durations. |
---|
| 61 | * Long test and short test duration limits are provided. These |
---|
| 62 | * values are in seconds and need to be converted to ticks for the |
---|
| 63 | * application. |
---|
| 64 | * |
---|
| 65 | */ |
---|
| 66 | |
---|
| 67 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
| 68 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
| 69 | |
---|
| 70 | /* |
---|
| 71 | * Define the interrupt mechanism for Time Test 27 |
---|
| 72 | * |
---|
| 73 | * NOTE: Following are for XXX and are board independent |
---|
| 74 | * |
---|
| 75 | */ |
---|
| 76 | |
---|
[a355e3ea] | 77 | |
---|
| 78 | #define CLOCK_VECTOR MONGOOSEV_IRQ_TIMER1 |
---|
| 79 | |
---|
| 80 | |
---|
[f849f3e] | 81 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
| 82 | |
---|
[a355e3ea] | 83 | #if 1 |
---|
| 84 | |
---|
[f849f3e] | 85 | #define Install_tm27_vector( handler ) \ |
---|
[a355e3ea] | 86 | (void) set_vector( handler, MONGOOSEV_IRQ_SOFTWARE_1, 1 ); |
---|
[f849f3e] | 87 | |
---|
| 88 | |
---|
| 89 | |
---|
[a355e3ea] | 90 | #define Cause_tm27_intr() assertSoftwareInterrupt(0); |
---|
[f849f3e] | 91 | |
---|
[a355e3ea] | 92 | #define Clear_tm27_intr() |
---|
[f849f3e] | 93 | #define Lower_tm27_intr() |
---|
[a355e3ea] | 94 | |
---|
[f849f3e] | 95 | #else |
---|
[a355e3ea] | 96 | |
---|
[f849f3e] | 97 | #define Install_tm27_vector( handler ) \ |
---|
[a355e3ea] | 98 | (void) set_vector( handler, MONGOOSEV_IRQ_TIMER1, 1 ); |
---|
[f849f3e] | 99 | |
---|
| 100 | #define Cause_tm27_intr() \ |
---|
| 101 | do { \ |
---|
| 102 | ; \ |
---|
| 103 | } while(0) |
---|
| 104 | |
---|
| 105 | #define Clear_tm27_intr() |
---|
| 106 | #define Lower_tm27_intr() |
---|
| 107 | |
---|
| 108 | #endif |
---|
| 109 | |
---|
| 110 | /* Constants */ |
---|
| 111 | |
---|
| 112 | /* miscellaneous stuff assumed to exist */ |
---|
| 113 | |
---|
| 114 | extern rtems_configuration_table BSP_Configuration; |
---|
| 115 | |
---|
| 116 | /* |
---|
| 117 | * Device Driver Table Entries |
---|
| 118 | */ |
---|
| 119 | |
---|
| 120 | /* |
---|
| 121 | * NOTE: Use the standard Console driver entry |
---|
| 122 | */ |
---|
| 123 | |
---|
| 124 | /* |
---|
| 125 | * NOTE: Use the standard Clock driver entry |
---|
| 126 | */ |
---|
| 127 | |
---|
| 128 | /* functions */ |
---|
| 129 | |
---|
| 130 | void bsp_cleanup( void ); |
---|
| 131 | |
---|
[7de58239] | 132 | rtems_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int ); |
---|
| 133 | |
---|
[f849f3e] | 134 | #ifdef __cplusplus |
---|
| 135 | } |
---|
| 136 | #endif |
---|
| 137 | |
---|
| 138 | #endif |
---|
[7de58239] | 139 | |
---|
[f849f3e] | 140 | /* end of include file */ |
---|