#ifndef _LINUX_ATAHDREG_H
#define _LINUX_ATAHDREG_H

/*
 * This file contains some defines for the Amiga IDE hd controller.
 * Various sources. Check out some definitions (see comments with
 * a ques).
 */

#define IDE_DISABLE_IRQ  0x02
#define IDE_ENABLE_IRQ   0x00
 
/* Hd controller regs. Ref: Disassembling scsi.device */
#define HD_DATA		(0xfff00000)	/* _CTL when writing */
#define HD_ERROR	(0xfff00005)	/* see err-bits */
#define HD_NSECTOR	(0xfff00009)	/* nr of sectors to read/write */
#define HD_SECTOR	(0xfff0000d)	/* starting sector */
#define HD_LCYL		(0xfff00011)	/* starting cylinder */
#define HD_HCYL		(0xfff00015)	/* high byte of starting cyl */
#define HD_CURRENT	(0xfff00019)	/* 101dhhhh , d=drive, hhhh=head */
#define HD_STATUS	(0xfff0001d)	/* see status-bits */
#define HD_PRECOMP HD_ERROR	/* same io address, read=error, write=precomp */
#define HD_COMMAND HD_STATUS	/* same io address, read=status, write=cmd */

#define HD_IRQ_TEST (0xfff00039)  /* MSB = 1, Harddisk is source of interrupt */
#define HD_CMD		  (0xfff00039)

/* Bits of HD_STATUS */
#define ERR_STAT	0x01
#define INDEX_STAT	0x02
#define ECC_STAT	0x04	/* Corrected error */
#define DRQ_STAT	0x08
#define SEEK_STAT	0x10
#define WRERR_STAT	0x20
#define READY_STAT	0x40
#define BUSY_STAT	0x80

/* Values for HD_COMMAND */
#define WIN_RESTORE		0x10
#define WIN_READ		0x20
#define WIN_WRITE		0x30
#define WIN_VERIFY		0x40
#define WIN_FORMAT		0x50
#define WIN_INIT		0x60
#define WIN_SEEK 		0x70
#define WIN_DIAGNOSE		0x90
#define WIN_SPECIFY		0x91
#define WIN_IDENTIFY		0xec

/* Bits for HD_ERROR */
#define MARK_ERR	0x01	/* Bad address mark */
#define TRK0_ERR	0x02	/* couldn't find track 0 */
#define ABRT_ERR	0x04	/* Command aborted */
#define ID_ERR		0x10	/* ID field not found */
#define ECC_ERR		0x40	/* Uncorrectable ECC error */
#define	BBD_ERR		0x80	/* block marked bad */


/* HDIO_GETGEO is the preferred choice - HDIO_REQ will be removed at some
   later date */
#define HDIO_REQ 0x301
#define HDIO_GETGEO 0x301
struct hd_geometry {
      unsigned char heads;
      unsigned char sectors;
      unsigned short cylinders;
      unsigned long start;
};
#endif
