]> git.sur5r.net Git - u-boot/blobdiff - include/ata.h
net: make ARP timeout configurable
[u-boot] / include / ata.h
index 719f76a2ffead666424588159fa9c1ab6c0f1d04..aa6e90d4702e710a0ed8a0d45092bcb30ac8f0ea 100644 (file)
 #define ATA_DEVICE(x)  ((x & 1)<<4)
 #define ATA_LBA                0xE0
 
+enum {
+       ATA_MAX_DEVICES = 1,    /* per bus/port */
+       ATA_MAX_PRD = 256,      /* we could make these 256/256 */
+       ATA_SECT_SIZE = 256,    /*256 words per sector */
+
+       /* bits in ATA command block registers */
+       ATA_HOB = (1 << 7),     /* LBA48 selector */
+       ATA_NIEN = (1 << 1),    /* disable-irq flag */
+       /*ATA_LBA                 = (1 << 6), */ /* LBA28 selector */
+       ATA_DEV1 = (1 << 4),    /* Select Device 1 (slave) */
+       ATA_DEVICE_OBS = (1 << 7) | (1 << 5),   /* obs bits in dev reg */
+       ATA_DEVCTL_OBS = (1 << 3),      /* obsolete bit in devctl reg */
+       ATA_BUSY = (1 << 7),    /* BSY status bit */
+       ATA_DRDY = (1 << 6),    /* device ready */
+       ATA_DF = (1 << 5),      /* device fault */
+       ATA_DRQ = (1 << 3),     /* data request i/o */
+       ATA_ERR = (1 << 0),     /* have an error */
+       ATA_SRST = (1 << 2),    /* software reset */
+       ATA_ABORTED = (1 << 2), /* command aborted */
+       /* ATA command block registers */
+       ATA_REG_DATA = 0x00,
+       ATA_REG_ERR = 0x01,
+       ATA_REG_NSECT = 0x02,
+       ATA_REG_LBAL = 0x03,
+       ATA_REG_LBAM = 0x04,
+       ATA_REG_LBAH = 0x05,
+       ATA_REG_DEVICE = 0x06,
+       ATA_REG_STATUS = 0x07,
+       ATA_PCI_CTL_OFS = 0x02,
+       /* and their aliases */
+       ATA_REG_FEATURE = ATA_REG_ERR,
+       ATA_REG_CMD = ATA_REG_STATUS,
+       ATA_REG_BYTEL = ATA_REG_LBAM,
+       ATA_REG_BYTEH = ATA_REG_LBAH,
+       ATA_REG_DEVSEL = ATA_REG_DEVICE,
+       ATA_REG_IRQ = ATA_REG_NSECT,
+
+       /* SETFEATURES stuff */
+       SETFEATURES_XFER = 0x03,
+       XFER_UDMA_7 = 0x47,
+       XFER_UDMA_6 = 0x46,
+       XFER_UDMA_5 = 0x45,
+       XFER_UDMA_4 = 0x44,
+       XFER_UDMA_3 = 0x43,
+       XFER_UDMA_2 = 0x42,
+       XFER_UDMA_1 = 0x41,
+       XFER_UDMA_0 = 0x40,
+       XFER_MW_DMA_2 = 0x22,
+       XFER_MW_DMA_1 = 0x21,
+       XFER_MW_DMA_0 = 0x20,
+       XFER_PIO_4 = 0x0C,
+       XFER_PIO_3 = 0x0B,
+       XFER_PIO_2 = 0x0A,
+       XFER_PIO_1 = 0x09,
+       XFER_PIO_0 = 0x08,
+       XFER_SW_DMA_2 = 0x12,
+       XFER_SW_DMA_1 = 0x11,
+       XFER_SW_DMA_0 = 0x10,
+       XFER_PIO_SLOW = 0x00
+};
 /*
  * ATA Commands (only mandatory commands listed here)
  */
 #define ATA_CMD_SETF   0xEF    /* Set Features                 */
 #define ATA_CMD_CHK_PWR        0xE5    /* Check Power Mode             */
 
+#define ATA_CMD_READ_EXT 0x24  /* Read Sectors (with retries)  with 48bit addressing */
+#define ATA_CMD_WRITE_EXT      0x34    /* Write Sectores (with retries) with 48bit addressing */
+#define ATA_CMD_VRFY_EXT       0x42    /* Read Verify  (with retries)  with 48bit addressing */
+
 /*
  * ATAPI Commands
  */
@@ -192,7 +256,7 @@ typedef struct hd_driveid {
        unsigned short  major_rev_num;  /*  */
        unsigned short  minor_rev_num;  /*  */
        unsigned short  command_set_1;  /* bits 0:Smart 1:Security 2:Removable 3:PM */
-       unsigned short  command_set_2;  /* bits 14:Smart Enabled 13:0 zero */
+       unsigned short  command_set_2;  /* bits 14:Smart Enabled 13:0 zero 10:lba48 support*/
        unsigned short  cfsse;          /* command set-feature supported extensions */
        unsigned short  cfs_enable_1;   /* command set-feature enabled */
        unsigned short  cfs_enable_2;   /* command set-feature enabled */
@@ -203,7 +267,10 @@ typedef struct hd_driveid {
        unsigned short  CurAPMvalues;   /* current APM values */
        unsigned short  word92;         /* reserved (word 92) */
        unsigned short  hw_config;      /* hardware config */
-       unsigned short  words94_125[32];/* reserved words 94-125 */
+       unsigned short  words94_99[6];/* reserved words 94-99 */
+       /*unsigned long long  lba48_capacity; /--* 4 16bit values containing lba 48 total number of sectors */
+       unsigned short  lba48_capacity[4]; /* 4 16bit values containing lba 48 total number of sectors */
+       unsigned short  words104_125[22];/* reserved words 104-125 */
        unsigned short  last_lun;       /* reserved (word 126) */
        unsigned short  word127;        /* reserved (word 127) */
        unsigned short  dlf;            /* device lock function