1 /* 2 * Copyright (c) 1988 Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)udareg.h 7.3 (Berkeley) 05/08/91 11 */ 12 13 /* 14 * UDA50 registers and structures 15 */ 16 17 /* 18 * Writing any value to udaip starts initialisation. Reading from it 19 * when the UDA is running makes the UDA look through the command ring 20 * to find any new commands. Reading udasa gives status; writing it 21 * during initialisation sets things up. 22 */ 23 struct udadevice { 24 u_short udaip; /* initialisation and polling */ 25 u_short udasa; /* status and address */ 26 }; 27 28 /* 29 * Bits in UDA status register during initialisation 30 */ 31 #define UDA_ERR 0x8000 /* error */ 32 #define UDA_STEP4 0x4000 /* step 4 has started */ 33 #define UDA_STEP3 0x2000 /* step 3 has started */ 34 #define UDA_STEP2 0x1000 /* step 2 has started */ 35 #define UDA_STEP1 0x0800 /* step 1 has started */ 36 #define UDA_NV 0x0400 /* no host settable interrupt vector */ 37 #define UDA_QB 0x0200 /* controller supports Q22 bus */ 38 #define UDA_DI 0x0100 /* controller implements diagnostics */ 39 #define UDA_IE 0x0080 /* interrupt enable */ 40 #define UDA_NCNRMASK 0x003f /* in STEP1, bits 0-2=NCMDL2, 3-5=NRSPL2 */ 41 #define UDA_IVECMASK 0x007f /* in STEP2, bits 0-6 are interruptvec / 4 */ 42 #define UDA_PI 0x0001 /* host requests adapter purge interrupts */ 43 44 /* 45 * Bits in UDA status register after initialisation 46 */ 47 #define UDA_GO 0x0001 /* run */ 48 49 #define UDASR_BITS \ 50 "\20\20ERR\17STEP4\16STEP3\15STEP2\14STEP1\13NV\12QB\11DI\10IE\1GO" 51 52 /* 53 * UDA Communications Area. Note that this structure definition 54 * requires NRSP and NCMD to be defined already. 55 */ 56 struct udaca { 57 short ca_xxx1; /* unused */ 58 char ca_xxx2; /* unused */ 59 char ca_bdp; /* BDP to purge */ 60 short ca_cmdint; /* command ring transition flag */ 61 short ca_rspint; /* response ring transition flag */ 62 long ca_rspdsc[NRSP];/* response descriptors */ 63 long ca_cmddsc[NCMD];/* command descriptors */ 64 }; 65 66 /* 67 * Simplified routines (e.g., uddump) reprogram the UDA50 for one command 68 * and one response at a time; uda1ca is like udaca except that it provides 69 * exactly one command and response descriptor. 70 */ 71 struct uda1ca { 72 short ca_xxx1; 73 char ca_xxx2; 74 char ca_bdp; 75 short ca_cmdint; 76 short ca_rspint; 77 long ca_rspdsc; 78 long ca_cmddsc; 79 }; 80