mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-09-23 23:24:07 +00:00
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 ...
This commit is contained in:
@@ -47,13 +47,6 @@ typedef unsigned char byte; /* used everywhere */
|
||||
#define ERROR_RESET 3 /* Reset controller every 4th retry */
|
||||
#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */
|
||||
|
||||
/*
|
||||
* Tune flags
|
||||
*/
|
||||
#define IDE_TUNE_NOAUTO 2
|
||||
#define IDE_TUNE_AUTO 1
|
||||
#define IDE_TUNE_DEFAULT 0
|
||||
|
||||
/*
|
||||
* state flags
|
||||
*/
|
||||
@@ -68,23 +61,30 @@ typedef unsigned char byte; /* used everywhere */
|
||||
*/
|
||||
#define IDE_NR_PORTS (10)
|
||||
|
||||
#define IDE_DATA_OFFSET (0)
|
||||
#define IDE_ERROR_OFFSET (1)
|
||||
#define IDE_NSECTOR_OFFSET (2)
|
||||
#define IDE_SECTOR_OFFSET (3)
|
||||
#define IDE_LCYL_OFFSET (4)
|
||||
#define IDE_HCYL_OFFSET (5)
|
||||
#define IDE_SELECT_OFFSET (6)
|
||||
#define IDE_STATUS_OFFSET (7)
|
||||
#define IDE_CONTROL_OFFSET (8)
|
||||
#define IDE_IRQ_OFFSET (9)
|
||||
struct ide_io_ports {
|
||||
unsigned long data_addr;
|
||||
|
||||
#define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET
|
||||
#define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET
|
||||
#define IDE_ALTSTATUS_OFFSET IDE_CONTROL_OFFSET
|
||||
#define IDE_IREASON_OFFSET IDE_NSECTOR_OFFSET
|
||||
#define IDE_BCOUNTL_OFFSET IDE_LCYL_OFFSET
|
||||
#define IDE_BCOUNTH_OFFSET IDE_HCYL_OFFSET
|
||||
union {
|
||||
unsigned long error_addr; /* read: error */
|
||||
unsigned long feature_addr; /* write: feature */
|
||||
};
|
||||
|
||||
unsigned long nsect_addr;
|
||||
unsigned long lbal_addr;
|
||||
unsigned long lbam_addr;
|
||||
unsigned long lbah_addr;
|
||||
|
||||
unsigned long device_addr;
|
||||
|
||||
union {
|
||||
unsigned long status_addr; /* read: status */
|
||||
unsigned long command_addr; /* write: command */
|
||||
};
|
||||
|
||||
unsigned long ctl_addr;
|
||||
|
||||
unsigned long irq_addr;
|
||||
};
|
||||
|
||||
#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good))
|
||||
#define BAD_R_STAT (BUSY_STAT | ERR_STAT)
|
||||
@@ -163,7 +163,11 @@ typedef u8 hwif_chipset_t;
|
||||
* Structure to hold all information about the location of this port
|
||||
*/
|
||||
typedef struct hw_regs_s {
|
||||
unsigned long io_ports[IDE_NR_PORTS]; /* task file registers */
|
||||
union {
|
||||
struct ide_io_ports io_ports;
|
||||
unsigned long io_ports_array[IDE_NR_PORTS];
|
||||
};
|
||||
|
||||
int irq; /* our irq number */
|
||||
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
|
||||
hwif_chipset_t chipset;
|
||||
@@ -179,10 +183,10 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
|
||||
hw->io_ports[i] = io_addr++;
|
||||
for (i = 0; i <= 7; i++)
|
||||
hw->io_ports_array[i] = io_addr++;
|
||||
|
||||
hw->io_ports[IDE_CONTROL_OFFSET] = ctl_addr;
|
||||
hw->io_ports.ctl_addr = ctl_addr;
|
||||
}
|
||||
|
||||
#include <asm/ide.h>
|
||||
@@ -328,7 +332,6 @@ typedef struct ide_drive_s {
|
||||
unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */
|
||||
unsigned doorlocking : 1; /* for removable only: door lock/unlock works */
|
||||
unsigned nodma : 1; /* disallow DMA */
|
||||
unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */
|
||||
unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
|
||||
unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */
|
||||
unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */
|
||||
@@ -432,8 +435,8 @@ typedef struct hwif_s {
|
||||
|
||||
char name[6]; /* name of interface, eg. "ide0" */
|
||||
|
||||
/* task file registers for pata and sata */
|
||||
unsigned long io_ports[IDE_NR_PORTS];
|
||||
struct ide_io_ports io_ports;
|
||||
|
||||
unsigned long sata_scr[SATA_NR_PORTS];
|
||||
|
||||
ide_drive_t drives[MAX_DRIVES]; /* drive info */
|
||||
@@ -520,7 +523,6 @@ typedef struct hwif_s {
|
||||
unsigned present : 1; /* this interface exists */
|
||||
unsigned serialized : 1; /* serialized all channel operation */
|
||||
unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
|
||||
unsigned reset : 1; /* reset after probe */
|
||||
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
|
||||
unsigned mmio : 1; /* host uses MMIO */
|
||||
|
||||
@@ -703,10 +705,6 @@ void ide_add_generic_settings(ide_drive_t *);
|
||||
read_proc_t proc_ide_read_capacity;
|
||||
read_proc_t proc_ide_read_geometry;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IDEPCI
|
||||
void ide_pci_create_host_proc(const char *, get_info_t *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Standard exit stuff:
|
||||
*/
|
||||
@@ -807,8 +805,14 @@ int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsig
|
||||
#ifndef _IDE_C
|
||||
extern ide_hwif_t ide_hwifs[]; /* master data repository */
|
||||
#endif
|
||||
extern int ide_noacpi;
|
||||
extern int ide_acpigtf;
|
||||
extern int ide_acpionboot;
|
||||
extern int noautodma;
|
||||
|
||||
extern int ide_vlb_clk;
|
||||
extern int ide_pci_clk;
|
||||
|
||||
ide_hwif_t *ide_find_port_slot(const struct ide_port_info *);
|
||||
|
||||
static inline ide_hwif_t *ide_find_port(void)
|
||||
@@ -1068,8 +1072,6 @@ enum {
|
||||
IDE_HFLAG_NO_DMA = (1 << 14),
|
||||
/* check if host is PCI IDE device before allowing DMA */
|
||||
IDE_HFLAG_NO_AUTODMA = (1 << 15),
|
||||
/* don't autotune PIO */
|
||||
IDE_HFLAG_NO_AUTOTUNE = (1 << 16),
|
||||
/* host is CS5510/CS5520 */
|
||||
IDE_HFLAG_CS5520 = IDE_HFLAG_VDMA,
|
||||
/* no LBA48 */
|
||||
@@ -1215,13 +1217,15 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
|
||||
#endif
|
||||
|
||||
void ide_remove_port_from_hwgroup(ide_hwif_t *);
|
||||
void ide_unregister(unsigned int);
|
||||
void ide_unregister(ide_hwif_t *);
|
||||
|
||||
void ide_register_region(struct gendisk *);
|
||||
void ide_unregister_region(struct gendisk *);
|
||||
|
||||
void ide_undecoded_slave(ide_drive_t *);
|
||||
|
||||
void ide_port_apply_params(ide_hwif_t *);
|
||||
|
||||
int ide_device_add_all(u8 *idx, const struct ide_port_info *);
|
||||
int ide_device_add(u8 idx[4], const struct ide_port_info *);
|
||||
int 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)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
|
||||
hwif->OUTB(drive->ctl | (on ? 0 : 2),
|
||||
hwif->io_ports[IDE_CONTROL_OFFSET]);
|
||||
hwif->OUTB(drive->ctl | (on ? 0 : 2), hwif->io_ports.ctl_addr);
|
||||
}
|
||||
|
||||
static inline u8 ide_read_status(ide_drive_t *drive)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
|
||||
return hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
|
||||
return hwif->INB(hwif->io_ports.status_addr);
|
||||
}
|
||||
|
||||
static inline u8 ide_read_altstatus(ide_drive_t *drive)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
|
||||
return hwif->INB(hwif->io_ports[IDE_CONTROL_OFFSET]);
|
||||
return hwif->INB(hwif->io_ports.ctl_addr);
|
||||
}
|
||||
|
||||
static inline u8 ide_read_error(ide_drive_t *drive)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
|
||||
return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]);
|
||||
return hwif->INB(hwif->io_ports.error_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1368,7 +1371,7 @@ static inline void ide_atapi_discard_data(ide_drive_t *drive, unsigned bcount)
|
||||
|
||||
/* FIXME: use ->atapi_input_bytes */
|
||||
while (bcount--)
|
||||
(void)hwif->INB(hwif->io_ports[IDE_DATA_OFFSET]);
|
||||
(void)hwif->INB(hwif->io_ports.data_addr);
|
||||
}
|
||||
|
||||
static 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)
|
||||
|
||||
/* FIXME: use ->atapi_output_bytes */
|
||||
while (bcount--)
|
||||
hwif->OUTB(0, hwif->io_ports[IDE_DATA_OFFSET]);
|
||||
hwif->OUTB(0, hwif->io_ports.data_addr);
|
||||
}
|
||||
|
||||
#endif /* _IDE_H */
|
||||
|
||||
Reference in New Issue
Block a user