1 /* $NetBSD: rlreg.h,v 1.5 2017/05/22 17:22:29 ragge Exp $ */ 2 3 /* 4 * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27 /* 28 * RL11 registers. 29 */ 30 #define RL_CS 0 31 #define RL_BA 2 32 #define RL_DA 4 33 #define RL_MP 6 34 #define RL_BAE 8 /* Only on RLV12 */ 35 36 /* 37 * Bits in Control/Status register 38 */ 39 #define RLCS_DRDY 0000001 40 #define RLCS_IE 0000100 41 #define RLCS_CRDY 0000200 42 #define RLCS_DE 0040000 43 #define RLCS_ERR 0100000 44 #define RLCS_ERRMSK 0036000 45 /* Command to give to drive */ 46 #define RLCS_NOOP 0000000 /* No operation */ 47 #define RLCS_WCK 0000002 /* Write Check */ 48 #define RLCS_GS 0000004 /* Get Status */ 49 #define RLCS_SEEK 0000006 /* Seek */ 50 #define RLCS_RHDR 0000010 /* Read Header */ 51 #define RLCS_WD 0000012 /* Write data */ 52 #define RLCS_RD 0000014 /* Read data */ 53 #define RLCS_RDWO 0000016 /* Read data without hdr check */ 54 #define RLCS_USHFT 8 /* Shift unit number left */ 55 #define RLCS_ADSHFT 4 /* Shift address bits 16-17 left */ 56 57 /* 58 * Bits in Disk Address register 59 */ 60 #define RLDA_SEEK 0000001 /* Issue a "Seek" command */ 61 #define RLDA_GS 0000003 /* Issue a "Get Status" command */ 62 #define RLDA_DIR 0000004 /* Move head towards spindle */ 63 #define RLDA_RST 0000010 /* Reset the drive */ 64 #define RLDA_HSSEEK 0000020 /* Head select for seek */ 65 #define RLDA_HSRW 0000100 /* Head select for read/write */ 66 #define RLDA_CYLSHFT 7 67 68 /* 69 * Bits in Multipurpose register 70 */ 71 #define RLMP_STATUS 0000007 /* Status bits mask */ 72 #define RLMP_UNLOAD 0 /* not loaded */ 73 #define RLMP_SPINUP 1 /* spinning up */ 74 #define RLMP_BRUSHING 2 /* brushes out */ 75 #define RLMP_LOADHEADS 3 /* loading heads */ 76 #define RLMP_SEEKING 4 /* seeking */ 77 #define RLMP_LOCKED 5 /* lock turned on */ 78 #define RLMP_UNLHEADS 6 /* unloading heads */ 79 #define RLMP_SPUNDOWN 7 /* disk spun down */ 80 81 #define RLMP_DT 0000200 /* Set if RL02, otherwise RL01 */ 82 #define RLMP_HS 0000100 /* Head select */ 83 84 /* 85 * RL01/RL02 disk layout. 86 */ 87 #define RL_BPS 256 /* Bytes/sector */ 88 #define RL_SPT 40 /* Sectors/track */ 89 #define RL_TPS01 256 /* Tracks/surface RL01 */ 90 #define RL_TPS02 512 /* Tracks/surface RL02 */ 91 #define RL_SPD 2 /* Surfaces/disk */ 92 93 /* 94 * Other... 95 */ 96 #define RL_MAXDPC 4 /* Max disks/controller */ 97