aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-27 13:13:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-27 13:13:06 -0400
commitfba5c1af5c4fd6645fe62ea84ccde0981282cf66 (patch)
tree834022eb683e0badd5a1e5eb5957f74c0e69ebb4 /include
parentf222eba0f9d98376d363b51fcc2361fb56929844 (diff)
parent077e3bdb9ec34d7cb5751b5be81a4a0f6f0eb5dc (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: (49 commits) ide-tape: remove tape->merge_stage ide-tape: mv tape->merge_stage_size tape->merge_bh_size ide-tape: mv idetape_empty_write_pipeline ide_tape_flush_merge_buffer ide-tape: mv idetape_discard_read_pipeline ide_tape_discard_merge_buffer ide-tape: make __idetape_discard_read_pipeline() of type void ide: remove now unused ide_pci_create_host_proc() ide: remove /proc/ide/ali ide-tape: improve buffer pages freeing strategy ide-tape: mv tape->pages_per_stage tape->pages_per_buffer ide-tape: mv tape->stage_size tape->buffer_size ide-tape: improve buffer allocation strategy ide: add struct ide_io_ports (take 3) ide: make ide_unregister() take 'ide_hwif_t *' as an argument (take 2) ide: sanitize ide_unregister() usage mpc8xx-ide: use ide_find_port() ide: add "noacpi" / "acpigtf" / "acpionboot" parameters gayle: add "doubler" parameter ide: add "cdrom=" and "chs=" parameters ide: add "nodma|noflush|noprobe|nowerr=" parameters ide: remove obsoleted "hdx=autotune" kernel parameter ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-sa1100/ide.h6
-rw-r--r--include/asm-cris/arch-v10/ide.h11
-rw-r--r--include/linux/ide.h95
3 files changed, 56 insertions, 56 deletions
diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h
index 98b10bcf9f1b..b14cbda01dc3 100644
--- a/include/asm-arm/arch-sa1100/ide.h
+++ b/include/asm-arm/arch-sa1100/ide.h
@@ -37,12 +37,12 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
37 37
38 memset(hw, 0, sizeof(*hw)); 38 memset(hw, 0, sizeof(*hw));
39 39
40 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { 40 for (i = 0; i <= 7; i++) {
41 hw->io_ports[i] = reg; 41 hw->io_ports_array[i] = reg;
42 reg += regincr; 42 reg += regincr;
43 } 43 }
44 44
45 hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; 45 hw->io_ports.ctl_addr = ctrl_port;
46 46
47 if (irq) 47 if (irq)
48 *irq = 0; 48 *irq = 0;
diff --git a/include/asm-cris/arch-v10/ide.h b/include/asm-cris/arch-v10/ide.h
index ea34e0d0a388..5366e6239328 100644
--- a/include/asm-cris/arch-v10/ide.h
+++ b/include/asm-cris/arch-v10/ide.h
@@ -59,22 +59,19 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, u
59 int i; 59 int i;
60 60
61 /* fill in ports for ATA addresses 0 to 7 */ 61 /* fill in ports for ATA addresses 0 to 7 */
62 62 for (i = 0; i <= 7; i++) {
63 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { 63 hw->io_ports_array[i] = data_port |
64 hw->io_ports[i] = data_port |
65 IO_FIELD(R_ATA_CTRL_DATA, addr, i) | 64 IO_FIELD(R_ATA_CTRL_DATA, addr, i) |
66 IO_STATE(R_ATA_CTRL_DATA, cs0, active); 65 IO_STATE(R_ATA_CTRL_DATA, cs0, active);
67 } 66 }
68 67
69 /* the IDE control register is at ATA address 6, with CS1 active instead of CS0 */ 68 /* the IDE control register is at ATA address 6, with CS1 active instead of CS0 */
70 69 hw->io_ports.ctl_addr = data_port |
71 hw->io_ports[IDE_CONTROL_OFFSET] = data_port |
72 IO_FIELD(R_ATA_CTRL_DATA, addr, 6) | 70 IO_FIELD(R_ATA_CTRL_DATA, addr, 6) |
73 IO_STATE(R_ATA_CTRL_DATA, cs1, active); 71 IO_STATE(R_ATA_CTRL_DATA, cs1, active);
74 72
75 /* whats this for ? */ 73 /* whats this for ? */
76 74 hw->io_ports.irq_addr = 0;
77 hw->io_ports[IDE_IRQ_OFFSET] = 0;
78} 75}
79 76
80static inline void ide_init_default_hwifs(void) 77static inline void ide_init_default_hwifs(void)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index f0af504dfa42..32fd77bb4436 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -48,13 +48,6 @@ typedef unsigned char byte; /* used everywhere */
48#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ 48#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */
49 49
50/* 50/*
51 * Tune flags
52 */
53#define IDE_TUNE_NOAUTO 2
54#define IDE_TUNE_AUTO 1
55#define IDE_TUNE_DEFAULT 0
56
57/*
58 * state flags 51 * state flags
59 */ 52 */
60 53
@@ -68,23 +61,30 @@ typedef unsigned char byte; /* used everywhere */
68 */ 61 */
69#define IDE_NR_PORTS (10) 62#define IDE_NR_PORTS (10)
70 63
71#define IDE_DATA_OFFSET (0) 64struct ide_io_ports {
72#define IDE_ERROR_OFFSET (1) 65 unsigned long data_addr;
73#define IDE_NSECTOR_OFFSET (2) 66
74#define IDE_SECTOR_OFFSET (3) 67 union {
75#define IDE_LCYL_OFFSET (4) 68 unsigned long error_addr; /* read: error */
76#define IDE_HCYL_OFFSET (5) 69 unsigned long feature_addr; /* write: feature */
77#define IDE_SELECT_OFFSET (6) 70 };
78#define IDE_STATUS_OFFSET (7) 71
79#define IDE_CONTROL_OFFSET (8) 72 unsigned long nsect_addr;
80#define IDE_IRQ_OFFSET (9) 73 unsigned long lbal_addr;
81 74 unsigned long lbam_addr;
82#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET 75 unsigned long lbah_addr;
83#define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET 76
84#define IDE_ALTSTATUS_OFFSET IDE_CONTROL_OFFSET 77 unsigned long device_addr;
85#define IDE_IREASON_OFFSET IDE_NSECTOR_OFFSET 78
86#define IDE_BCOUNTL_OFFSET IDE_LCYL_OFFSET 79 union {
87#define IDE_BCOUNTH_OFFSET IDE_HCYL_OFFSET 80 unsigned long status_addr; /*  read: status  */
81 unsigned long command_addr; /* write: command */
82 };
83
84 unsigned long ctl_addr;
85
86 unsigned long irq_addr;
87};
88 88
89#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) 89#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good))
90#define BAD_R_STAT (BUSY_STAT | ERR_STAT) 90#define BAD_R_STAT (BUSY_STAT | ERR_STAT)
@@ -163,7 +163,11 @@ typedef u8 hwif_chipset_t;
163 * Structure to hold all information about the location of this port 163 * Structure to hold all information about the location of this port
164 */ 164 */
165typedef struct hw_regs_s { 165typedef struct hw_regs_s {
166 unsigned long io_ports[IDE_NR_PORTS]; /* task file registers */ 166 union {
167 struct ide_io_ports io_ports;
168 unsigned long io_ports_array[IDE_NR_PORTS];
169 };
170
167 int irq; /* our irq number */ 171 int irq; /* our irq number */
168 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ 172 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
169 hwif_chipset_t chipset; 173 hwif_chipset_t chipset;
@@ -179,10 +183,10 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
179{ 183{
180 unsigned int i; 184 unsigned int i;
181 185
182 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) 186 for (i = 0; i <= 7; i++)
183 hw->io_ports[i] = io_addr++; 187 hw->io_ports_array[i] = io_addr++;
184 188
185 hw->io_ports[IDE_CONTROL_OFFSET] = ctl_addr; 189 hw->io_ports.ctl_addr = ctl_addr;
186} 190}
187 191
188#include <asm/ide.h> 192#include <asm/ide.h>
@@ -328,7 +332,6 @@ typedef struct ide_drive_s {
328 unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */ 332 unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */
329 unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ 333 unsigned doorlocking : 1; /* for removable only: door lock/unlock works */
330 unsigned nodma : 1; /* disallow DMA */ 334 unsigned nodma : 1; /* disallow DMA */
331 unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */
332 unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ 335 unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
333 unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ 336 unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */
334 unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ 337 unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */
@@ -432,8 +435,8 @@ typedef struct hwif_s {
432 435
433 char name[6]; /* name of interface, eg. "ide0" */ 436 char name[6]; /* name of interface, eg. "ide0" */
434 437
435 /* task file registers for pata and sata */ 438 struct ide_io_ports io_ports;
436 unsigned long io_ports[IDE_NR_PORTS]; 439
437 unsigned long sata_scr[SATA_NR_PORTS]; 440 unsigned long sata_scr[SATA_NR_PORTS];
438 441
439 ide_drive_t drives[MAX_DRIVES]; /* drive info */ 442 ide_drive_t drives[MAX_DRIVES]; /* drive info */
@@ -520,7 +523,6 @@ typedef struct hwif_s {
520 unsigned present : 1; /* this interface exists */ 523 unsigned present : 1; /* this interface exists */
521 unsigned serialized : 1; /* serialized all channel operation */ 524 unsigned serialized : 1; /* serialized all channel operation */
522 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ 525 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
523 unsigned reset : 1; /* reset after probe */
524 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 526 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
525 unsigned mmio : 1; /* host uses MMIO */ 527 unsigned mmio : 1; /* host uses MMIO */
526 528
@@ -703,10 +705,6 @@ void ide_add_generic_settings(ide_drive_t *);
703read_proc_t proc_ide_read_capacity; 705read_proc_t proc_ide_read_capacity;
704read_proc_t proc_ide_read_geometry; 706read_proc_t proc_ide_read_geometry;
705 707
706#ifdef CONFIG_BLK_DEV_IDEPCI
707void ide_pci_create_host_proc(const char *, get_info_t *);
708#endif
709
710/* 708/*
711 * Standard exit stuff: 709 * Standard exit stuff:
712 */ 710 */
@@ -807,8 +805,14 @@ int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsig
807#ifndef _IDE_C 805#ifndef _IDE_C
808extern ide_hwif_t ide_hwifs[]; /* master data repository */ 806extern ide_hwif_t ide_hwifs[]; /* master data repository */
809#endif 807#endif
808extern int ide_noacpi;
809extern int ide_acpigtf;
810extern int ide_acpionboot;
810extern int noautodma; 811extern int noautodma;
811 812
813extern int ide_vlb_clk;
814extern int ide_pci_clk;
815
812ide_hwif_t *ide_find_port_slot(const struct ide_port_info *); 816ide_hwif_t *ide_find_port_slot(const struct ide_port_info *);
813 817
814static inline ide_hwif_t *ide_find_port(void) 818static inline ide_hwif_t *ide_find_port(void)
@@ -1068,8 +1072,6 @@ enum {
1068 IDE_HFLAG_NO_DMA = (1 << 14), 1072 IDE_HFLAG_NO_DMA = (1 << 14),
1069 /* check if host is PCI IDE device before allowing DMA */ 1073 /* check if host is PCI IDE device before allowing DMA */
1070 IDE_HFLAG_NO_AUTODMA = (1 << 15), 1074 IDE_HFLAG_NO_AUTODMA = (1 << 15),
1071 /* don't autotune PIO */
1072 IDE_HFLAG_NO_AUTOTUNE = (1 << 16),
1073 /* host is CS5510/CS5520 */ 1075 /* host is CS5510/CS5520 */
1074 IDE_HFLAG_CS5520 = IDE_HFLAG_VDMA, 1076 IDE_HFLAG_CS5520 = IDE_HFLAG_VDMA,
1075 /* no LBA48 */ 1077 /* no LBA48 */
@@ -1215,13 +1217,15 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
1215#endif 1217#endif
1216 1218
1217void ide_remove_port_from_hwgroup(ide_hwif_t *); 1219void ide_remove_port_from_hwgroup(ide_hwif_t *);
1218void ide_unregister(unsigned int); 1220void ide_unregister(ide_hwif_t *);
1219 1221
1220void ide_register_region(struct gendisk *); 1222void ide_register_region(struct gendisk *);
1221void ide_unregister_region(struct gendisk *); 1223void ide_unregister_region(struct gendisk *);
1222 1224
1223void ide_undecoded_slave(ide_drive_t *); 1225void ide_undecoded_slave(ide_drive_t *);
1224 1226
1227void ide_port_apply_params(ide_hwif_t *);
1228
1225int ide_device_add_all(u8 *idx, const struct ide_port_info *); 1229int ide_device_add_all(u8 *idx, const struct ide_port_info *);
1226int ide_device_add(u8 idx[4], const struct ide_port_info *); 1230int ide_device_add(u8 idx[4], const struct ide_port_info *);
1227int ide_legacy_device_add(const struct ide_port_info *, unsigned long); 1231int ide_legacy_device_add(const struct ide_port_info *, unsigned long);
@@ -1333,29 +1337,28 @@ static inline void ide_set_irq(ide_drive_t *drive, int on)
1333{ 1337{
1334 ide_hwif_t *hwif = drive->hwif; 1338 ide_hwif_t *hwif = drive->hwif;
1335 1339
1336 hwif->OUTB(drive->ctl | (on ? 0 : 2), 1340 hwif->OUTB(drive->ctl | (on ? 0 : 2), hwif->io_ports.ctl_addr);
1337 hwif->io_ports[IDE_CONTROL_OFFSET]);
1338} 1341}
1339 1342
1340static inline u8 ide_read_status(ide_drive_t *drive) 1343static inline u8 ide_read_status(ide_drive_t *drive)
1341{ 1344{
1342 ide_hwif_t *hwif = drive->hwif; 1345 ide_hwif_t *hwif = drive->hwif;
1343 1346
1344 return hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); 1347 return hwif->INB(hwif->io_ports.status_addr);
1345} 1348}
1346 1349
1347static inline u8 ide_read_altstatus(ide_drive_t *drive) 1350static inline u8 ide_read_altstatus(ide_drive_t *drive)
1348{ 1351{
1349 ide_hwif_t *hwif = drive->hwif; 1352 ide_hwif_t *hwif = drive->hwif;
1350 1353
1351 return hwif->INB(hwif->io_ports[IDE_CONTROL_OFFSET]); 1354 return hwif->INB(hwif->io_ports.ctl_addr);
1352} 1355}
1353 1356
1354static inline u8 ide_read_error(ide_drive_t *drive) 1357static inline u8 ide_read_error(ide_drive_t *drive)
1355{ 1358{
1356 ide_hwif_t *hwif = drive->hwif; 1359 ide_hwif_t *hwif = drive->hwif;
1357 1360
1358 return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]); 1361 return hwif->INB(hwif->io_ports.error_addr);
1359} 1362}
1360 1363
1361/* 1364/*
@@ -1368,7 +1371,7 @@ static inline void ide_atapi_discard_data(ide_drive_t *drive, unsigned bcount)
1368 1371
1369 /* FIXME: use ->atapi_input_bytes */ 1372 /* FIXME: use ->atapi_input_bytes */
1370 while (bcount--) 1373 while (bcount--)
1371 (void)hwif->INB(hwif->io_ports[IDE_DATA_OFFSET]); 1374 (void)hwif->INB(hwif->io_ports.data_addr);
1372} 1375}
1373 1376
1374static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount) 1377static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount)
@@ -1377,7 +1380,7 @@ static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount)
1377 1380
1378 /* FIXME: use ->atapi_output_bytes */ 1381 /* FIXME: use ->atapi_output_bytes */
1379 while (bcount--) 1382 while (bcount--)
1380 hwif->OUTB(0, hwif->io_ports[IDE_DATA_OFFSET]); 1383 hwif->OUTB(0, hwif->io_ports.data_addr);
1381} 1384}
1382 1385
1383#endif /* _IDE_H */ 1386#endif /* _IDE_H */