diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-04 16:12:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-04 16:12:29 -0500 |
commit | ff51a98799931256b555446b2f5675db08de6229 (patch) | |
tree | 81a51eef70f120fd5d752430ccff0fdf06483508 /include/linux | |
parent | a80958f4849316a18c06f75b9e850ccecbf20df8 (diff) | |
parent | 8e42a5a220a3369c70d88474e887a6de6a4ae209 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (82 commits)
[PATCH] pata_ali: small fixes
[PATCH] pata_via: VIA 8251 bridged systems are now out and about
[PATCH] trivial piix: swap bogus dot for comma space
[PATCH] sata_promise: PHYMODE4 fixup
[PATCH] libata: always use polling IDENTIFY
[libata] pata_cs5535: fix build
[PATCH] ahci: do not powerdown during initialization
[PATCH] libata: prepare ata_sg_clean() for invocation from EH
[PATCH] libata: separate out rw ATA taskfile building into ata_build_rw_tf()
[PATCH] libata: implement ata_exec_internal_sg()
[PATCH] libata: make sure IRQ is cleared after ata_bmdma_freeze()
[PATCH] libata: move BMDMA host status recording from EH to interrupt handler
[PATCH] libata: make sure sdev doesn't go away while rescanning
[PATCH] libata: don't request sense if the port is frozen
[PATCH] libata: fix READ CAPACITY simulation
[PATCH] libata: implement ATA_FLAG_SETXFER_POLLING and use it in pata_via, take #2
[PATCH] libata: set IRQF_SHARED for legacy PCI IDE IRQs
[PATCH] libata: remove unused HSM_ST_UNKNOWN
[PATCH] libata: kill unnecessary sht->max_sectors initializations
[PATCH] libata: add missing sht->slave_destroy
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ata.h | 14 | ||||
-rw-r--r-- | include/linux/libata.h | 52 | ||||
-rw-r--r-- | include/linux/pata_platform.h | 13 |
3 files changed, 40 insertions, 39 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index d89441907024..1df941648a57 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -200,8 +200,9 @@ enum { | |||
200 | ATA_CBL_NONE = 0, | 200 | ATA_CBL_NONE = 0, |
201 | ATA_CBL_PATA40 = 1, | 201 | ATA_CBL_PATA40 = 1, |
202 | ATA_CBL_PATA80 = 2, | 202 | ATA_CBL_PATA80 = 2, |
203 | ATA_CBL_PATA_UNK = 3, | 203 | ATA_CBL_PATA40_SHORT = 3, /* 40 wire cable to high UDMA spec */ |
204 | ATA_CBL_SATA = 4, | 204 | ATA_CBL_PATA_UNK = 4, |
205 | ATA_CBL_SATA = 5, | ||
205 | 206 | ||
206 | /* SATA Status and Control Registers */ | 207 | /* SATA Status and Control Registers */ |
207 | SCR_STATUS = 0, | 208 | SCR_STATUS = 0, |
@@ -342,6 +343,15 @@ static inline int ata_id_is_cfa(const u16 *id) | |||
342 | return 0; | 343 | return 0; |
343 | } | 344 | } |
344 | 345 | ||
346 | static inline int ata_drive_40wire(const u16 *dev_id) | ||
347 | { | ||
348 | if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id)) | ||
349 | return 0; /* SATA */ | ||
350 | if (dev_id[93] & 0x4000) | ||
351 | return 0; /* 80 wire */ | ||
352 | return 1; | ||
353 | } | ||
354 | |||
345 | static inline int atapi_cdb_len(const u16 *dev_id) | 355 | static inline int atapi_cdb_len(const u16 *dev_id) |
346 | { | 356 | { |
347 | u16 tmp = dev_id[0] & 0x3; | 357 | u16 tmp = dev_id[0] & 0x3; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index abd2debebca2..202283b5df96 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -140,6 +140,7 @@ enum { | |||
140 | ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ | 140 | ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ |
141 | ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ | 141 | ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ |
142 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ | 142 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ |
143 | ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ | ||
143 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, | 144 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, |
144 | 145 | ||
145 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ | 146 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
@@ -175,6 +176,7 @@ enum { | |||
175 | ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H | 176 | ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H |
176 | * Register FIS clearing BSY */ | 177 | * Register FIS clearing BSY */ |
177 | ATA_FLAG_DEBUGMSG = (1 << 13), | 178 | ATA_FLAG_DEBUGMSG = (1 << 13), |
179 | ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ | ||
178 | 180 | ||
179 | /* The following flag belongs to ap->pflags but is kept in | 181 | /* The following flag belongs to ap->pflags but is kept in |
180 | * ap->flags because it's referenced in many LLDs and will be | 182 | * ap->flags because it's referenced in many LLDs and will be |
@@ -283,6 +285,9 @@ enum { | |||
283 | ATA_EHI_QUIET = (1 << 3), /* be quiet */ | 285 | ATA_EHI_QUIET = (1 << 3), /* be quiet */ |
284 | 286 | ||
285 | ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ | 287 | ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ |
288 | ATA_EHI_PRINTINFO = (1 << 17), /* print configuration info */ | ||
289 | ATA_EHI_SETMODE = (1 << 18), /* configure transfer mode */ | ||
290 | ATA_EHI_POST_SETMODE = (1 << 19), /* revaildating after setmode */ | ||
286 | 291 | ||
287 | ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK, | 292 | ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK, |
288 | 293 | ||
@@ -307,10 +312,11 @@ enum { | |||
307 | (some horkage may be drive/controller pair dependant */ | 312 | (some horkage may be drive/controller pair dependant */ |
308 | 313 | ||
309 | ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ | 314 | ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ |
315 | ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ | ||
316 | ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ | ||
310 | }; | 317 | }; |
311 | 318 | ||
312 | enum hsm_task_states { | 319 | enum hsm_task_states { |
313 | HSM_ST_UNKNOWN, /* state unknown */ | ||
314 | HSM_ST_IDLE, /* no command on going */ | 320 | HSM_ST_IDLE, /* no command on going */ |
315 | HSM_ST, /* (waiting the device to) transfer data */ | 321 | HSM_ST, /* (waiting the device to) transfer data */ |
316 | HSM_ST_LAST, /* (waiting the device to) complete command */ | 322 | HSM_ST_LAST, /* (waiting the device to) complete command */ |
@@ -329,6 +335,7 @@ enum ata_completion_errors { | |||
329 | AC_ERR_SYSTEM = (1 << 6), /* system error */ | 335 | AC_ERR_SYSTEM = (1 << 6), /* system error */ |
330 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ | 336 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ |
331 | AC_ERR_OTHER = (1 << 8), /* unknown */ | 337 | AC_ERR_OTHER = (1 << 8), /* unknown */ |
338 | AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */ | ||
332 | }; | 339 | }; |
333 | 340 | ||
334 | /* forward declarations */ | 341 | /* forward declarations */ |
@@ -700,6 +707,8 @@ extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param); | |||
700 | extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param); | 707 | extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param); |
701 | extern int ata_std_prereset(struct ata_port *ap); | 708 | extern int ata_std_prereset(struct ata_port *ap); |
702 | extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); | 709 | extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); |
710 | extern int sata_port_hardreset(struct ata_port *ap, | ||
711 | const unsigned long *timing); | ||
703 | extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); | 712 | extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); |
704 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); | 713 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); |
705 | extern void ata_port_disable(struct ata_port *); | 714 | extern void ata_port_disable(struct ata_port *); |
@@ -744,9 +753,8 @@ extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg); | |||
744 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 753 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
745 | extern void ata_host_resume(struct ata_host *host); | 754 | extern void ata_host_resume(struct ata_host *host); |
746 | extern int ata_ratelimit(void); | 755 | extern int ata_ratelimit(void); |
747 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 756 | extern int ata_busy_sleep(struct ata_port *ap, |
748 | unsigned long timeout_pat, | 757 | unsigned long timeout_pat, unsigned long timeout); |
749 | unsigned long timeout); | ||
750 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), | 758 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), |
751 | void *data, unsigned long delay); | 759 | void *data, unsigned long delay); |
752 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, | 760 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, |
@@ -787,6 +795,7 @@ extern void ata_id_string(const u16 *id, unsigned char *s, | |||
787 | unsigned int ofs, unsigned int len); | 795 | unsigned int ofs, unsigned int len); |
788 | extern void ata_id_c_string(const u16 *id, unsigned char *s, | 796 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
789 | unsigned int ofs, unsigned int len); | 797 | unsigned int ofs, unsigned int len); |
798 | extern unsigned long ata_device_blacklisted(const struct ata_device *dev); | ||
790 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 799 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
791 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 800 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
792 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 801 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
@@ -1061,7 +1070,7 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, | |||
1061 | udelay(10); | 1070 | udelay(10); |
1062 | status = ata_chk_status(ap); | 1071 | status = ata_chk_status(ap); |
1063 | max--; | 1072 | max--; |
1064 | } while ((status & bits) && (max > 0)); | 1073 | } while (status != 0xff && (status & bits) && (max > 0)); |
1065 | 1074 | ||
1066 | return status; | 1075 | return status; |
1067 | } | 1076 | } |
@@ -1082,7 +1091,7 @@ static inline u8 ata_wait_idle(struct ata_port *ap) | |||
1082 | { | 1091 | { |
1083 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 1092 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
1084 | 1093 | ||
1085 | if (status & (ATA_BUSY | ATA_DRQ)) { | 1094 | if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { |
1086 | unsigned long l = ap->ioaddr.status_addr; | 1095 | unsigned long l = ap->ioaddr.status_addr; |
1087 | if (ata_msg_warn(ap)) | 1096 | if (ata_msg_warn(ap)) |
1088 | printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n", | 1097 | printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n", |
@@ -1148,37 +1157,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
1148 | } | 1157 | } |
1149 | 1158 | ||
1150 | /** | 1159 | /** |
1151 | * ata_irq_on - Enable interrupts on a port. | ||
1152 | * @ap: Port on which interrupts are enabled. | ||
1153 | * | ||
1154 | * Enable interrupts on a legacy IDE device using MMIO or PIO, | ||
1155 | * wait for idle, clear any pending interrupts. | ||
1156 | * | ||
1157 | * LOCKING: | ||
1158 | * Inherited from caller. | ||
1159 | */ | ||
1160 | |||
1161 | static inline u8 ata_irq_on(struct ata_port *ap) | ||
1162 | { | ||
1163 | struct ata_ioports *ioaddr = &ap->ioaddr; | ||
1164 | u8 tmp; | ||
1165 | |||
1166 | ap->ctl &= ~ATA_NIEN; | ||
1167 | ap->last_ctl = ap->ctl; | ||
1168 | |||
1169 | if (ap->flags & ATA_FLAG_MMIO) | ||
1170 | writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr); | ||
1171 | else | ||
1172 | outb(ap->ctl, ioaddr->ctl_addr); | ||
1173 | tmp = ata_wait_idle(ap); | ||
1174 | |||
1175 | ap->ops->irq_clear(ap); | ||
1176 | |||
1177 | return tmp; | ||
1178 | } | ||
1179 | |||
1180 | |||
1181 | /** | ||
1182 | * ata_irq_ack - Acknowledge a device interrupt. | 1160 | * ata_irq_ack - Acknowledge a device interrupt. |
1183 | * @ap: Port on which interrupts are enabled. | 1161 | * @ap: Port on which interrupts are enabled. |
1184 | * | 1162 | * |
diff --git a/include/linux/pata_platform.h b/include/linux/pata_platform.h new file mode 100644 index 000000000000..2d5fd647e0e9 --- /dev/null +++ b/include/linux/pata_platform.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __LINUX_PATA_PLATFORM_H | ||
2 | #define __LINUX_PATA_PLATFORM_H | ||
3 | |||
4 | struct pata_platform_info { | ||
5 | /* | ||
6 | * I/O port shift, for platforms with ports that are | ||
7 | * constantly spaced and need larger than the 1-byte | ||
8 | * spacing used by ata_std_ports(). | ||
9 | */ | ||
10 | unsigned int ioport_shift; | ||
11 | }; | ||
12 | |||
13 | #endif /* __LINUX_PATA_PLATFORM_H */ | ||