]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - include/asm-m68k/swim_iop.h
2 * SWIM access through the IOP
3 * Written by Joshua M. Thompson
6 /* IOP number and channel number for the SWIM */
8 #define SWIM_IOP IOP_NUM_ISM
13 #define CMD_INIT 0x01 /* Initialize */
14 #define CMD_SHUTDOWN 0x02 /* Shutdown */
15 #define CMD_START_POLL 0x03 /* Start insert/eject polling */
16 #define CMD_STOP_POLL 0x04 /* Stop insert/eject polling */
17 #define CMD_SETHFSTAG 0x05 /* Set HFS tag buffer address */
18 #define CMD_STATUS 0x06 /* Status */
19 #define CMD_EJECT 0x07 /* Eject */
20 #define CMD_FORMAT 0x08 /* Format */
21 #define CMD_FORMAT_VERIFY 0x09 /* Format and Verify */
22 #define CMD_WRITE 0x0A /* Write */
23 #define CMD_READ 0x0B /* Read */
24 #define CMD_READ_VERIFY 0x0C /* Read and Verify */
25 #define CMD_CACHE_CTRL 0x0D /* Cache control */
26 #define CMD_TAGBUFF_CTRL 0x0E /* Tag buffer control */
27 #define CMD_GET_ICON 0x0F /* Get Icon */
31 /* note: apple sez DRV_FDHD is 4, but I get back a type */
32 /* of 5 when I do a drive status check on my FDHD */
34 #define DRV_NONE 0 /* No drive */
35 #define DRV_UNKNOWN 1 /* Unspecified drive */
36 #define DRV_400K 2 /* 400K */
37 #define DRV_800K 3 /* 400K/800K */
38 #define DRV_FDHD 5 /* 400K/800K/720K/1440K */
39 #define DRV_HD20 7 /* Apple HD20 */
43 #define FMT_HD20 0x0001 /* Apple HD20 */
44 #define FMT_400K 0x0002 /* 400K (GCR) */
45 #define FMT_800K 0x0004 /* 800K (GCR) */
46 #define FMT_720K 0x0008 /* 720K (MFM) */
47 #define FMT_1440K 0x0010 /* 1.44M (MFM) */
49 #define FMD_KIND_400K 1
50 #define FMD_KIND_800K 2
51 #define FMD_KIND_720K 3
52 #define FMD_KIND_1440K 1
56 #define ICON_MEDIA 0x01 /* Have IOP supply media icon */
57 #define ICON_DRIVE 0x01 /* Have IOP supply drive icon */
61 #define gcrOnMFMErr -400 /* GCR (400/800K) on HD media */
62 #define verErr -84 /* verify failed */
63 #define fmt2Err -83 /* can't get enough sync during format */
64 #define fmt1Err -82 /* can't find sector 0 after track format */
65 #define sectNFErr -81 /* can't find sector */
66 #define seekErr -80 /* drive error during seek */
67 #define spdAdjErr -79 /* can't set drive speed */
68 #define twoSideErr -78 /* drive is single-sided */
69 #define initIWMErr -77 /* error during initialization */
70 #define tk0badErr -76 /* track zero is bad */
71 #define cantStepErr -75 /* drive error during step */
72 #define wrUnderrun -74 /* write underrun occurred */
73 #define badDBtSlp -73 /* bad data bitslip marks */
74 #define badDCksum -72 /* bad data checksum */
75 #define noDtaMkErr -71 /* can't find data mark */
76 #define badBtSlpErr -70 /* bad address bitslip marks */
77 #define badCksmErr -69 /* bad address-mark checksum */
78 #define dataVerErr -68 /* read-verify failed */
79 #define noAdrMkErr -67 /* can't find an address mark */
80 #define noNybErr -66 /* no nybbles? disk is probably degaussed */
81 #define offLinErr -65 /* no disk in drive */
82 #define noDriveErr -64 /* drive isn't connected */
83 #define nsDrvErr -56 /* no such drive */
84 #define paramErr -50 /* bad positioning information */
85 #define wPrErr -44 /* write protected */
86 #define openErr -23 /* already initialized */
90 struct swim_drvstatus
{
91 __u16 curr_track
; /* Current track number */
92 __u8 write_prot
; /* 0x80 if disk is write protected */
93 __u8 disk_in_drive
; /* 0x01 or 0x02 if a disk is in the drive */
94 __u8 installed
; /* 0x01 if drive installed, 0xFF if not */
95 __u8 num_sides
; /* 0x80 if two-sided format supported */
96 __u8 two_sided
; /* 0xff if two-sided format diskette */
97 __u8 new_interface
; /* 0x00 if old 400K drive, 0xFF if newer */
98 __u16 errors
; /* Disk error count */
99 struct { /* 32 bits */
102 __u16 external
:1; /* Drive is external */
103 __u16 scsi
:1; /* Drive is a SCSI drive */
104 __u16 fixed
:1; /* Drive has fixed media */
105 __u16 secondary
:1; /* Drive is secondary drive */
106 __u8 type
; /* Drive type */
108 __u8 mfm_drive
; /* 0xFF if this is an FDHD drive */
109 __u8 mfm_disk
; /* 0xFF if 720K/1440K (MFM) disk */
110 __u8 mfm_format
; /* 0x00 if 720K, 0xFF if 1440K */
111 __u8 ctlr_type
; /* 0x00 if IWM, 0xFF if SWIM */
112 __u16 curr_format
; /* Current format type */
113 __u16 allowed_fmt
; /* Allowed format types */
114 __u32 num_blocks
; /* Number of blocks on disk */
115 __u8 icon_flags
; /* Icon flags */
119 /* Commands issued from the host to the IOP: */
121 struct swimcmd_init
{
122 __u8 code
; /* CMD_INIT */
125 __u8 drives
[28]; /* drive type list */
128 struct swimcmd_startpoll
{
129 __u8 code
; /* CMD_START_POLL */
134 struct swimcmd_sethfstag
{
135 __u8 code
; /* CMD_SETHFSTAG */
138 caddr_t tagbuf
; /* HFS tag buffer address */
141 struct swimcmd_status
{
142 __u8 code
; /* CMD_STATUS */
145 struct swim_drvstatus status
;
148 struct swimcmd_eject
{
149 __u8 code
; /* CMD_EJECT */
152 struct swim_drvstatus status
;
155 struct swimcmd_format
{
156 __u8 code
; /* CMD_FORMAT */
161 __u16 fmt
; /* format kind */
162 __u8 hdrbyte
; /* fmt byte for hdr (0=default) */
163 __u8 interleave
; /* interleave (0 = default) */
164 caddr_t databuf
; /* sector data buff (0=default */
165 caddr_t tagbuf
; /* tag data buffer (0=default) */
167 struct swim_drvstatus status
;
171 struct swimcmd_fmtverify
{
172 __u8 code
; /* CMD_FORMAT_VERIFY */
178 __u8 code
; /* CMD_READ, CMD_WRITE or CMD_READ_VERIFY */
181 caddr_t buffer
; /* R/W buffer address */
182 __u32 first_block
; /* Starting block */
183 __u32 num_blocks
; /* Number of blocks */
184 __u8 tag
[12]; /* tag data */
187 struct swimcmd_cachectl
{
188 __u8 code
; /* CMD_CACHE_CTRL */
191 __u8 enable
; /* Nonzero to enable cache */
192 __u8 install
; /* +1 = install, -1 = remove, 0 = neither */
195 struct swimcmd_tagbufctl
{
196 __u8 code
; /* CMD_TAGBUFF_CTRL */
199 caddr_t buf
; /* buffer address or 0 to disable */
202 struct swimcmd_geticon
{
203 __u8 code
; /* CMD_GET_ICON */
206 caddr_t buffer
; /* Nuffer address */
207 __u16 kind
; /* 0 = media icon, 1 = drive icon */
209 __u16 max_bytes
; /* maximum byte count */
212 /* Messages from the SWIM IOP to the host CPU: */
214 struct swimmsg_status
{
215 __u8 code
; /* 1 = insert, 2 = eject, 3 = status changed */
218 struct swim_drvstatus status
;
221 #endif /* __ASSEMBLY__ */