aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 16:44:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 16:44:19 -0400
commita52b0d25a722e84da999005b75f972aa4824253c (patch)
tree4a3a48305f744e6bde2e3fd663a4473dd712049c /include
parent539a5fe22620a1665cce504167953a71a43232ad (diff)
parentf37afdaca711838b50ecd89b9c15fc745270d77c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (46 commits) ide: constify struct ide_dma_ops ide: add struct ide_dma_ops (take 3) ide: add IDE_HFLAG_SERIALIZE_DMA host flag sl82c105: check bridge revision in sl82c105_init_one() au1xxx-ide: use ->init_dma method palm_bk3710: use ->init_dma method sgiioc4: use ->init_dma method icside: use ->init_dma method ide-pmac: use ->init_dma method ide: do complete DMA setup in ->init_dma method (take 2) au1xxx-ide: fix MWDMA support ide: cleanup ide_setup_dma() ide: factor out setting PCI bus-mastering from ide_hwif_setup_dma() ide: export ide_allocate_dma_engine() ide: move ide_setup_dma() call out from ->init_dma method alim15x3: skip DMA initialization completely on revs < 0x20 pdc202xx_old: remove init_dma_pdc202xx() ide: don't display "BIOS" settings in ide_setup_dma() ide: remove ->cds field from ide_hwif_t (take 2) ide: remove ide_dma_iobase() ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h42
-rw-r--r--include/linux/ide.h109
2 files changed, 62 insertions, 89 deletions
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
index 89655c0cdcd6..b493a5e46c63 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -70,7 +70,6 @@ typedef struct
70 ide_hwif_t *hwif; 70 ide_hwif_t *hwif;
71#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 71#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
72 ide_drive_t *drive; 72 ide_drive_t *drive;
73 u8 white_list, black_list;
74 struct dbdma_cmd *dma_table_cpu; 73 struct dbdma_cmd *dma_table_cpu;
75 dma_addr_t dma_table_dma; 74 dma_addr_t dma_table_dma;
76#endif 75#endif
@@ -81,47 +80,6 @@ typedef struct
81#endif 80#endif
82} _auide_hwif; 81} _auide_hwif;
83 82
84#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
85/* HD white list */
86static const struct drive_list_entry dma_white_list [] = {
87/*
88 * Hitachi
89 */
90 { "HITACHI_DK14FA-20" , NULL },
91 { "HTS726060M9AT00" , NULL },
92/*
93 * Maxtor
94 */
95 { "Maxtor 6E040L0" , NULL },
96 { "Maxtor 6Y080P0" , NULL },
97 { "Maxtor 6Y160P0" , NULL },
98/*
99 * Seagate
100 */
101 { "ST3120026A" , NULL },
102 { "ST320014A" , NULL },
103 { "ST94011A" , NULL },
104 { "ST340016A" , NULL },
105/*
106 * Western Digital
107 */
108 { "WDC WD400UE-00HCT0" , NULL },
109 { "WDC WD400JB-00JJC0" , NULL },
110 { NULL , NULL }
111};
112
113/* HD black list */
114static const struct drive_list_entry dma_black_list [] = {
115/*
116 * Western Digital
117 */
118 { "WDC WD100EB-00CGH0" , NULL },
119 { "WDC WD200BB-00AUA1" , NULL },
120 { "WDC AC24300L" , NULL },
121 { NULL , NULL }
122};
123#endif
124
125/******************************************************************************* 83/*******************************************************************************
126* PIO Mode timing calculation : * 84* PIO Mode timing calculation : *
127* * 85* *
diff --git a/include/linux/ide.h b/include/linux/ide.h
index f20410dd4482..f0af504dfa42 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -387,6 +387,43 @@ typedef struct ide_drive_s {
387 387
388struct ide_port_info; 388struct ide_port_info;
389 389
390struct ide_port_ops {
391 /* host specific initialization of devices on a port */
392 void (*port_init_devs)(struct hwif_s *);
393 /* routine to program host for PIO mode */
394 void (*set_pio_mode)(ide_drive_t *, const u8);
395 /* routine to program host for DMA mode */
396 void (*set_dma_mode)(ide_drive_t *, const u8);
397 /* tweaks hardware to select drive */
398 void (*selectproc)(ide_drive_t *);
399 /* chipset polling based on hba specifics */
400 int (*reset_poll)(ide_drive_t *);
401 /* chipset specific changes to default for device-hba resets */
402 void (*pre_reset)(ide_drive_t *);
403 /* routine to reset controller after a disk reset */
404 void (*resetproc)(ide_drive_t *);
405 /* special host masking for drive selection */
406 void (*maskproc)(ide_drive_t *, int);
407 /* check host's drive quirk list */
408 void (*quirkproc)(ide_drive_t *);
409
410 u8 (*mdma_filter)(ide_drive_t *);
411 u8 (*udma_filter)(ide_drive_t *);
412
413 u8 (*cable_detect)(struct hwif_s *);
414};
415
416struct ide_dma_ops {
417 void (*dma_host_set)(struct ide_drive_s *, int);
418 int (*dma_setup)(struct ide_drive_s *);
419 void (*dma_exec_cmd)(struct ide_drive_s *, u8);
420 void (*dma_start)(struct ide_drive_s *);
421 int (*dma_end)(struct ide_drive_s *);
422 int (*dma_test_irq)(struct ide_drive_s *);
423 void (*dma_lost_irq)(struct ide_drive_s *);
424 void (*dma_timeout)(struct ide_drive_s *);
425};
426
390typedef struct hwif_s { 427typedef struct hwif_s {
391 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ 428 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
392 struct hwif_s *mate; /* other hwif from same PCI chip */ 429 struct hwif_s *mate; /* other hwif from same PCI chip */
@@ -420,38 +457,12 @@ typedef struct hwif_s {
420 457
421 struct device *dev; 458 struct device *dev;
422 459
423 const struct ide_port_info *cds; /* chipset device struct */
424
425 ide_ack_intr_t *ack_intr; 460 ide_ack_intr_t *ack_intr;
426 461
427 void (*rw_disk)(ide_drive_t *, struct request *); 462 void (*rw_disk)(ide_drive_t *, struct request *);
428 463
429#if 0 464 const struct ide_port_ops *port_ops;
430 ide_hwif_ops_t *hwifops; 465 const struct ide_dma_ops *dma_ops;
431#else
432 /* host specific initialization of devices on a port */
433 void (*port_init_devs)(struct hwif_s *);
434 /* routine to program host for PIO mode */
435 void (*set_pio_mode)(ide_drive_t *, const u8);
436 /* routine to program host for DMA mode */
437 void (*set_dma_mode)(ide_drive_t *, const u8);
438 /* tweaks hardware to select drive */
439 void (*selectproc)(ide_drive_t *);
440 /* chipset polling based on hba specifics */
441 int (*reset_poll)(ide_drive_t *);
442 /* chipset specific changes to default for device-hba resets */
443 void (*pre_reset)(ide_drive_t *);
444 /* routine to reset controller after a disk reset */
445 void (*resetproc)(ide_drive_t *);
446 /* special host masking for drive selection */
447 void (*maskproc)(ide_drive_t *, int);
448 /* check host's drive quirk list */
449 void (*quirkproc)(ide_drive_t *);
450#endif
451 u8 (*mdma_filter)(ide_drive_t *);
452 u8 (*udma_filter)(ide_drive_t *);
453
454 u8 (*cable_detect)(struct hwif_s *);
455 466
456 void (*ata_input_data)(ide_drive_t *, void *, u32); 467 void (*ata_input_data)(ide_drive_t *, void *, u32);
457 void (*ata_output_data)(ide_drive_t *, void *, u32); 468 void (*ata_output_data)(ide_drive_t *, void *, u32);
@@ -459,15 +470,7 @@ typedef struct hwif_s {
459 void (*atapi_input_bytes)(ide_drive_t *, void *, u32); 470 void (*atapi_input_bytes)(ide_drive_t *, void *, u32);
460 void (*atapi_output_bytes)(ide_drive_t *, void *, u32); 471 void (*atapi_output_bytes)(ide_drive_t *, void *, u32);
461 472
462 void (*dma_host_set)(ide_drive_t *, int);
463 int (*dma_setup)(ide_drive_t *);
464 void (*dma_exec_cmd)(ide_drive_t *, u8);
465 void (*dma_start)(ide_drive_t *);
466 int (*ide_dma_end)(ide_drive_t *drive);
467 int (*ide_dma_test_irq)(ide_drive_t *drive);
468 void (*ide_dma_clear_irq)(ide_drive_t *drive); 473 void (*ide_dma_clear_irq)(ide_drive_t *drive);
469 void (*dma_lost_irq)(ide_drive_t *drive);
470 void (*dma_timeout)(ide_drive_t *drive);
471 474
472 void (*OUTB)(u8 addr, unsigned long port); 475 void (*OUTB)(u8 addr, unsigned long port);
473 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); 476 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
@@ -514,7 +517,6 @@ typedef struct hwif_s {
514 unsigned long extra_base; /* extra addr for dma ports */ 517 unsigned long extra_base; /* extra addr for dma ports */
515 unsigned extra_ports; /* number of extra dma ports */ 518 unsigned extra_ports; /* number of extra dma ports */
516 519
517 unsigned noprobe : 1; /* don't probe for this interface */
518 unsigned present : 1; /* this interface exists */ 520 unsigned present : 1; /* this interface exists */
519 unsigned serialized : 1; /* serialized all channel operation */ 521 unsigned serialized : 1; /* serialized all channel operation */
520 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ 522 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
@@ -1009,10 +1011,15 @@ void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8
1009void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1011void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
1010 1012
1011#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 1013#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
1012void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); 1014int ide_pci_set_master(struct pci_dev *, const char *);
1015unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *);
1016int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
1013#else 1017#else
1014static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, 1018static inline int ide_hwif_setup_dma(ide_hwif_t *hwif,
1015 const struct ide_port_info *d) { } 1019 const struct ide_port_info *d)
1020{
1021 return -EINVAL;
1022}
1016#endif 1023#endif
1017 1024
1018extern void default_hwif_iops(ide_hwif_t *); 1025extern void default_hwif_iops(ide_hwif_t *);
@@ -1084,6 +1091,8 @@ enum {
1084 /* unmask IRQs */ 1091 /* unmask IRQs */
1085 IDE_HFLAG_UNMASK_IRQS = (1 << 25), 1092 IDE_HFLAG_UNMASK_IRQS = (1 << 25),
1086 IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), 1093 IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26),
1094 /* serialize ports if DMA is possible (for sl82c105) */
1095 IDE_HFLAG_SERIALIZE_DMA = (1 << 27),
1087 /* force host out of "simplex" mode */ 1096 /* force host out of "simplex" mode */
1088 IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28), 1097 IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28),
1089 /* DSC overlap is unsupported */ 1098 /* DSC overlap is unsupported */
@@ -1105,10 +1114,14 @@ struct ide_port_info {
1105 unsigned int (*init_chipset)(struct pci_dev *, const char *); 1114 unsigned int (*init_chipset)(struct pci_dev *, const char *);
1106 void (*init_iops)(ide_hwif_t *); 1115 void (*init_iops)(ide_hwif_t *);
1107 void (*init_hwif)(ide_hwif_t *); 1116 void (*init_hwif)(ide_hwif_t *);
1108 void (*init_dma)(ide_hwif_t *, unsigned long); 1117 int (*init_dma)(ide_hwif_t *,
1118 const struct ide_port_info *);
1119
1120 const struct ide_port_ops *port_ops;
1121 const struct ide_dma_ops *dma_ops;
1122
1109 ide_pci_enablebit_t enablebits[2]; 1123 ide_pci_enablebit_t enablebits[2];
1110 hwif_chipset_t chipset; 1124 hwif_chipset_t chipset;
1111 u8 extra;
1112 u32 host_flags; 1125 u32 host_flags;
1113 u8 pio_mask; 1126 u8 pio_mask;
1114 u8 swdma_mask; 1127 u8 swdma_mask;
@@ -1155,13 +1168,16 @@ void ide_destroy_dmatable(ide_drive_t *);
1155 1168
1156#ifdef CONFIG_BLK_DEV_IDEDMA_SFF 1169#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
1157extern int ide_build_dmatable(ide_drive_t *, struct request *); 1170extern int ide_build_dmatable(ide_drive_t *, struct request *);
1158extern int ide_release_dma(ide_hwif_t *); 1171int ide_allocate_dma_engine(ide_hwif_t *);
1159extern void ide_setup_dma(ide_hwif_t *, unsigned long); 1172void ide_release_dma_engine(ide_hwif_t *);
1173void ide_setup_dma(ide_hwif_t *, unsigned long);
1160 1174
1161void ide_dma_host_set(ide_drive_t *, int); 1175void ide_dma_host_set(ide_drive_t *, int);
1162extern int ide_dma_setup(ide_drive_t *); 1176extern int ide_dma_setup(ide_drive_t *);
1177void ide_dma_exec_cmd(ide_drive_t *, u8);
1163extern void ide_dma_start(ide_drive_t *); 1178extern void ide_dma_start(ide_drive_t *);
1164extern int __ide_dma_end(ide_drive_t *); 1179extern int __ide_dma_end(ide_drive_t *);
1180int ide_dma_test_irq(ide_drive_t *);
1165extern void ide_dma_lost_irq(ide_drive_t *); 1181extern void ide_dma_lost_irq(ide_drive_t *);
1166extern void ide_dma_timeout(ide_drive_t *); 1182extern void ide_dma_timeout(ide_drive_t *);
1167#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ 1183#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
@@ -1179,7 +1195,7 @@ static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1179#endif /* CONFIG_BLK_DEV_IDEDMA */ 1195#endif /* CONFIG_BLK_DEV_IDEDMA */
1180 1196
1181#ifndef CONFIG_BLK_DEV_IDEDMA_SFF 1197#ifndef CONFIG_BLK_DEV_IDEDMA_SFF
1182static inline void ide_release_dma(ide_hwif_t *drive) {;} 1198static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; }
1183#endif 1199#endif
1184 1200
1185#ifdef CONFIG_BLK_DEV_IDEACPI 1201#ifdef CONFIG_BLK_DEV_IDEACPI
@@ -1199,8 +1215,6 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
1199#endif 1215#endif
1200 1216
1201void ide_remove_port_from_hwgroup(ide_hwif_t *); 1217void ide_remove_port_from_hwgroup(ide_hwif_t *);
1202extern int ide_hwif_request_regions(ide_hwif_t *hwif);
1203extern void ide_hwif_release_regions(ide_hwif_t* hwif);
1204void ide_unregister(unsigned int); 1218void ide_unregister(unsigned int);
1205 1219
1206void ide_register_region(struct gendisk *); 1220void ide_register_region(struct gendisk *);
@@ -1210,6 +1224,7 @@ void ide_undecoded_slave(ide_drive_t *);
1210 1224
1211int ide_device_add_all(u8 *idx, const struct ide_port_info *); 1225int ide_device_add_all(u8 *idx, const struct ide_port_info *);
1212int ide_device_add(u8 idx[4], const struct ide_port_info *); 1226int ide_device_add(u8 idx[4], const struct ide_port_info *);
1227int ide_legacy_device_add(const struct ide_port_info *, unsigned long);
1213void ide_port_unregister_devices(ide_hwif_t *); 1228void ide_port_unregister_devices(ide_hwif_t *);
1214void ide_port_scan(ide_hwif_t *); 1229void ide_port_scan(ide_hwif_t *);
1215 1230