[U-Boot-Users] [PATCH] Add defines to libata (Take three)
Tor Krill
tor at excito.com
Mon Mar 31 23:26:13 CEST 2008
This patch adds some missing defines to libata.
Add check power mode command.
Add obsoleted bits in dev reg
Add ata command register defines
Signed-off-by: Tor Krill <tor at excito.com>
---
include/libata.h | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/include/libata.h b/include/libata.h
index aedba74..b50af9b 100644
--- a/include/libata.h
+++ b/include/libata.h
@@ -30,6 +30,7 @@
enum ata_cmd {
/* non-NCQ command */
ATA_CMD_DEV_RESET = 0x08, /* ATAPI device reset */
+ ATA_CMD_CHK_POWER = 0xE5, /* check power mode */
ATA_CMD_FLUSH_CACHE = 0xE7,
ATA_CMD_FLUSH_CACHE_EXT = 0xEA,
ATA_CMD_ID_ATA = 0xEC,
@@ -110,6 +111,7 @@ enum {
ATA_HOB = (1 << 7), /* LBA48 selector */
ATA_NIEN = (1 << 1), /* disable-irq flag */
ATA_LBA = (1 << 6), /* LBA28 selector */
+ ATA_DEVICE_OBS = (1 << 7) | (1 << 5), /* obs bits in dev reg */
ATA_DEV1 = (1 << 4), /* Select Device 1 (slave) */
ATA_BUSY = (1 << 7), /* BSY status bit */
ATA_DRDY = (1 << 6), /* device ready */
@@ -156,6 +158,26 @@ enum {
ATA_UDMA7 = ATA_UDMA6 | (1 << 7),
};
+/* ATA command block registers */
+enum ata_regs {
+ 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,
+};
+
#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
#define ata_id_has_fua(id) ((id)[84] & (1 << 6))
--
1.5.4.4
More information about the U-Boot
mailing list