[ac7d5ef0] | 1 | /* bsp.h |
---|
| 2 | * |
---|
| 3 | * This include file contains all DMV152 board IO definitions. |
---|
| 4 | * |
---|
[03f2154e] | 5 | * COPYRIGHT (c) 1989-1997. |
---|
[ac7d5ef0] | 6 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 7 | * Copyright assigned to U.S. Government, 1994. |
---|
[ac7d5ef0] | 8 | * |
---|
[98e4ebf5] | 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 11 | * http://www.OARcorp.com/rtems/license.html. |
---|
[ac7d5ef0] | 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #ifndef __DMV152_h |
---|
| 17 | #define __DMV152_h |
---|
| 18 | |
---|
| 19 | #ifdef __cplusplus |
---|
| 20 | extern "C" { |
---|
| 21 | #endif |
---|
| 22 | |
---|
| 23 | #include <rtems.h> |
---|
[3a4ae6c] | 24 | #include <console.h> |
---|
| 25 | #include <clockdrv.h> |
---|
[ac7d5ef0] | 26 | #include <iosupp.h> |
---|
[3a4ae6c] | 27 | #include <vmeintr.h> |
---|
[b739617] | 28 | #include <zilog/z8530.h> |
---|
| 29 | #include <zilog/z8536.h> |
---|
[ac7d5ef0] | 30 | |
---|
| 31 | /* |
---|
| 32 | * Define the time limits for RTEMS Test Suite test durations. |
---|
| 33 | * Long test and short test duration limits are provided. These |
---|
| 34 | * values are in seconds and need to be converted to ticks for the |
---|
| 35 | * application. |
---|
| 36 | * |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
| 40 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
| 41 | |
---|
| 42 | /* |
---|
| 43 | * Define the interrupt mechanism for Time Test 27 |
---|
| 44 | */ |
---|
| 45 | |
---|
| 46 | /* use a VMEbus interrupt */ |
---|
| 47 | |
---|
| 48 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
| 49 | |
---|
| 50 | #define Install_tm27_vector( handler ) \ |
---|
| 51 | { \ |
---|
| 52 | set_vector( (handler), 0x50, 1 ); \ |
---|
| 53 | (*(volatile rtems_unsigned32 *)0x0d800024) = 0x50; /* set IVECT reg */ \ |
---|
| 54 | (*(volatile rtems_unsigned8 *)0x0d00000c) = 0x40; /* set VIE reg */ \ |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | #define Cause_tm27_intr() \ |
---|
| 58 | (*(volatile rtems_unsigned8 *)0x0d000003) = 0x0f /* set VINT */ |
---|
| 59 | |
---|
| 60 | #define Clear_tm27_intr() /* no operation necessary */ |
---|
| 61 | |
---|
| 62 | #define Lower_tm27_intr() |
---|
| 63 | |
---|
| 64 | /* |
---|
| 65 | * Simple spin delay in microsecond units for device drivers. |
---|
| 66 | * This is very dependent on the clock speed of the target. |
---|
| 67 | */ |
---|
| 68 | |
---|
| 69 | #define delay( microseconds ) \ |
---|
| 70 | { register rtems_unsigned32 _delay=(microseconds); \ |
---|
| 71 | register rtems_unsigned32 _tmp=123; \ |
---|
| 72 | asm volatile( "0: \ |
---|
| 73 | nbcd %0 ; \ |
---|
| 74 | nbcd %0 ; \ |
---|
| 75 | dbf %1,0b" \ |
---|
| 76 | : "=d" (_tmp), "=d" (_delay) \ |
---|
| 77 | : "0" (_tmp), "1" (_delay) ); \ |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | /* macros */ |
---|
| 81 | |
---|
| 82 | #undef Z8x36_STATE0 |
---|
| 83 | #undef Z8x36_WRITE |
---|
| 84 | #undef Z8x36_READ |
---|
| 85 | |
---|
| 86 | #define Z8x36_STATE0 ( z8536 ) \ |
---|
| 87 | { char *garbage; \ |
---|
| 88 | (garbage) = *(VOL8(z8536+0x7)) \ |
---|
| 89 | } |
---|
| 90 | |
---|
| 91 | #define Z8x36_WRITE( z8536, reg, data ) \ |
---|
| 92 | *(VOL8(z8536+0x7)) = (reg); \ |
---|
| 93 | *(VOL8(z8536+0x7)) = (data) |
---|
| 94 | |
---|
| 95 | #define Z8x36_READ( z8536, reg, data ) \ |
---|
| 96 | *(VOL8(z8536+0x7)) = (reg); \ |
---|
| 97 | (data) = *(VOL8(z8536+0x7)) |
---|
| 98 | |
---|
| 99 | /* |
---|
| 100 | * ACC Register Addresses |
---|
| 101 | */ |
---|
| 102 | |
---|
| 103 | #define ACC_BASE 0x0D000000 |
---|
| 104 | |
---|
| 105 | #define ACC_STAT0 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x00)) |
---|
| 106 | #define ACC_STAT1 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x01)) |
---|
| 107 | #define ACC_GENCTL ((volatile rtems_unsigned8 *) (ACC_BASE + 0x02)) |
---|
| 108 | #define ACC_VINT ((volatile rtems_unsigned8 *) (ACC_BASE + 0x03)) |
---|
| 109 | #define ACC_VREQ ((volatile rtems_unsigned8 *) (ACC_BASE + 0x04)) |
---|
| 110 | #define ACC_VARB ((volatile rtems_unsigned8 *) (ACC_BASE + 0x05)) |
---|
| 111 | #define ACC_ID ((volatile rtems_unsigned8 *) (ACC_BASE + 0x06)) |
---|
| 112 | #define ACC_CTL2 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x07)) |
---|
| 113 | #define ACC_7IS ((volatile rtems_unsigned8 *) (ACC_BASE + 0x08)) |
---|
| 114 | #define ACC_LIS ((volatile rtems_unsigned8 *) (ACC_BASE + 0x09)) |
---|
| 115 | #define ACC_7IE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0A)) |
---|
| 116 | #define ACC_LIE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0B)) |
---|
| 117 | #define ACC_VIE ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0C)) |
---|
| 118 | #define ACC_IC10 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0D)) |
---|
| 119 | #define ACC_IC32 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0E)) |
---|
| 120 | #define ACC_IC54 ((volatile rtems_unsigned8 *) (ACC_BASE + 0x0F)) |
---|
| 121 | |
---|
| 122 | /* constants */ |
---|
| 123 | |
---|
| 124 | #define RAM_START 0 |
---|
| 125 | #define RAM_END 0x100000 |
---|
| 126 | |
---|
| 127 | #define USE_CHANNEL_A 0 /* 1 = use channel A for console */ |
---|
| 128 | #define USE_CHANNEL_B 1 /* 1 = use channel B for console */ |
---|
| 129 | |
---|
| 130 | #define TIMER 0x0c000000 |
---|
| 131 | #define TIMER_VECTOR 0x4D |
---|
| 132 | |
---|
| 133 | #if (USE_CHANNEL_A == 1) |
---|
[0956b52] | 134 | #define CONSOLE_CONTROL 0x0C800007 |
---|
| 135 | #define CONSOLE_DATA 0x0C800005 |
---|
[ac7d5ef0] | 136 | #elif (USE_CHANNEL_B == 1) |
---|
| 137 | #define CONSOLE_CONTROL 0x0C800001 |
---|
| 138 | #define CONSOLE_DATA 0x0C800003 |
---|
| 139 | #endif |
---|
| 140 | |
---|
| 141 | /* Structures */ |
---|
| 142 | |
---|
| 143 | #ifdef D152_INIT |
---|
| 144 | #undef EXTERN |
---|
| 145 | #define EXTERN |
---|
| 146 | #else |
---|
| 147 | #undef EXTERN |
---|
| 148 | #define EXTERN extern |
---|
| 149 | #endif |
---|
| 150 | |
---|
| 151 | /* miscellaneous stuff assumed to exist */ |
---|
| 152 | |
---|
| 153 | extern rtems_configuration_table BSP_Configuration; |
---|
| 154 | |
---|
[497428a2] | 155 | extern m68k_isr_entry M68Kvec[]; /* vector table address */ |
---|
[ac7d5ef0] | 156 | |
---|
[3a4ae6c] | 157 | /* |
---|
| 158 | * Device Driver Table Entries |
---|
| 159 | */ |
---|
| 160 | |
---|
| 161 | /* |
---|
| 162 | * NOTE: Use the standard Console driver entry |
---|
| 163 | */ |
---|
| 164 | |
---|
| 165 | /* |
---|
| 166 | * NOTE: Use the standard Clock driver entry |
---|
| 167 | */ |
---|
| 168 | |
---|
| 169 | /* |
---|
| 170 | * How many libio files we want |
---|
| 171 | */ |
---|
| 172 | |
---|
| 173 | #define BSP_LIBIO_MAX_FDS 20 |
---|
| 174 | |
---|
[ac7d5ef0] | 175 | /* functions */ |
---|
| 176 | |
---|
| 177 | void bsp_cleanup( void ); |
---|
| 178 | |
---|
[497428a2] | 179 | m68k_isr_entry set_vector( |
---|
[ac7d5ef0] | 180 | rtems_isr_entry handler, |
---|
| 181 | rtems_vector_number vector, |
---|
| 182 | int type |
---|
| 183 | ); |
---|
| 184 | |
---|
| 185 | #ifdef __cplusplus |
---|
| 186 | } |
---|
| 187 | #endif |
---|
| 188 | |
---|
| 189 | #endif |
---|
| 190 | /* end of include file */ |
---|