Commit fd6ec5f3 authored by Linus Torvalds's avatar Linus Torvalds

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:
  ata: add CFA specific identify data words
  remove stale comment from <linux/hdreg.h>
  AT91: initialize Compact Flash on AT91SAM9263 cpu
  ide: add at91_ide driver
  ide: allow to wrap interrupt handler
  ide-iops: fix odd-length ATAPI PIO transfers
  ide: NULL noise: drivers/ide/ide-*.c
  ide: expiry() returns int, negative expiry() return values won't be noticed
parents 83d5a325 d42ad15b
...@@ -347,6 +347,111 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) ...@@ -347,6 +347,111 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
#endif #endif
/* --------------------------------------------------------------------
* Compact Flash (PCMCIA or IDE)
* -------------------------------------------------------------------- */
#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) || \
defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE)
static struct at91_cf_data cf0_data;
static struct resource cf0_resources[] = {
[0] = {
.start = AT91_CHIPSELECT_4,
.end = AT91_CHIPSELECT_4 + SZ_256M - 1,
.flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
}
};
static struct platform_device cf0_device = {
.id = 0,
.dev = {
.platform_data = &cf0_data,
},
.resource = cf0_resources,
.num_resources = ARRAY_SIZE(cf0_resources),
};
static struct at91_cf_data cf1_data;
static struct resource cf1_resources[] = {
[0] = {
.start = AT91_CHIPSELECT_5,
.end = AT91_CHIPSELECT_5 + SZ_256M - 1,
.flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
}
};
static struct platform_device cf1_device = {
.id = 1,
.dev = {
.platform_data = &cf1_data,
},
.resource = cf1_resources,
.num_resources = ARRAY_SIZE(cf1_resources),
};
void __init at91_add_device_cf(struct at91_cf_data *data)
{
unsigned long ebi0_csa;
struct platform_device *pdev;
if (!data)
return;
/*
* assign CS4 or CS5 to SMC with Compact Flash logic support,
* we assume SMC timings are configured by board code,
* except True IDE where timings are controlled by driver
*/
ebi0_csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
switch (data->chipselect) {
case 4:
at91_set_A_periph(AT91_PIN_PD6, 0); /* EBI0_NCS4/CFCS0 */
ebi0_csa |= AT91_MATRIX_EBI0_CS4A_SMC_CF1;
cf0_data = *data;
pdev = &cf0_device;
break;
case 5:
at91_set_A_periph(AT91_PIN_PD7, 0); /* EBI0_NCS5/CFCS1 */
ebi0_csa |= AT91_MATRIX_EBI0_CS5A_SMC_CF2;
cf1_data = *data;
pdev = &cf1_device;
break;
default:
printk(KERN_ERR "AT91 CF: bad chip-select requested (%u)\n",
data->chipselect);
return;
}
at91_sys_write(AT91_MATRIX_EBI0CSA, ebi0_csa);
if (data->det_pin) {
at91_set_gpio_input(data->det_pin, 1);
at91_set_deglitch(data->det_pin, 1);
}
if (data->irq_pin) {
at91_set_gpio_input(data->irq_pin, 1);
at91_set_deglitch(data->irq_pin, 1);
}
if (data->vcc_pin)
/* initially off */
at91_set_gpio_output(data->vcc_pin, 0);
/* enable EBI controlled pins */
at91_set_A_periph(AT91_PIN_PD5, 1); /* NWAIT */
at91_set_A_periph(AT91_PIN_PD8, 0); /* CFCE1 */
at91_set_A_periph(AT91_PIN_PD9, 0); /* CFCE2 */
at91_set_A_periph(AT91_PIN_PD14, 0); /* CFNRW */
pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "at91_ide" : "at91_cf";
platform_device_register(pdev);
}
#else
void __init at91_add_device_cf(struct at91_cf_data *data) {}
#endif
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* NAND / SmartMedia * NAND / SmartMedia
......
...@@ -56,6 +56,9 @@ struct at91_cf_data { ...@@ -56,6 +56,9 @@ struct at91_cf_data {
u8 vcc_pin; /* power switching */ u8 vcc_pin; /* power switching */
u8 rst_pin; /* card reset */ u8 rst_pin; /* card reset */
u8 chipselect; /* EBI Chip Select number */ u8 chipselect; /* EBI Chip Select number */
u8 flags;
#define AT91_CF_TRUE_IDE 0x01
#define AT91_IDE_SWAP_A0_A2 0x02
}; };
extern void __init at91_add_device_cf(struct at91_cf_data *data); extern void __init at91_add_device_cf(struct at91_cf_data *data);
......
...@@ -721,6 +721,11 @@ config BLK_DEV_IDE_TX4939 ...@@ -721,6 +721,11 @@ config BLK_DEV_IDE_TX4939
depends on SOC_TX4939 depends on SOC_TX4939
select BLK_DEV_IDEDMA_SFF select BLK_DEV_IDEDMA_SFF
config BLK_DEV_IDE_AT91
tristate "Atmel AT91 (SAM9, CAP9, AT572D940HF) IDE support"
depends on ARM && ARCH_AT91 && !ARCH_AT91RM9200 && !ARCH_AT91X40
select IDE_TIMINGS
config IDE_ARM config IDE_ARM
tristate "ARM IDE support" tristate "ARM IDE support"
depends on ARM && (ARCH_RPC || ARCH_SHARK) depends on ARM && (ARCH_RPC || ARCH_SHARK)
......
...@@ -116,3 +116,4 @@ obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o ...@@ -116,3 +116,4 @@ obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o
obj-$(CONFIG_BLK_DEV_IDE_TX4938) += tx4938ide.o obj-$(CONFIG_BLK_DEV_IDE_TX4938) += tx4938ide.o
obj-$(CONFIG_BLK_DEV_IDE_TX4939) += tx4939ide.o obj-$(CONFIG_BLK_DEV_IDE_TX4939) += tx4939ide.o
obj-$(CONFIG_BLK_DEV_IDE_AT91) += at91_ide.o
This diff is collapsed.
...@@ -125,5 +125,5 @@ const struct ide_proc_devset ide_disk_settings[] = { ...@@ -125,5 +125,5 @@ const struct ide_proc_devset ide_disk_settings[] = {
IDE_PROC_DEVSET(multcount, 0, 16), IDE_PROC_DEVSET(multcount, 0, 16),
IDE_PROC_DEVSET(nowerr, 0, 1), IDE_PROC_DEVSET(nowerr, 0, 1),
IDE_PROC_DEVSET(wcache, 0, 1), IDE_PROC_DEVSET(wcache, 0, 1),
{ 0 }, { NULL },
}; };
...@@ -29,5 +29,5 @@ const struct ide_proc_devset ide_floppy_settings[] = { ...@@ -29,5 +29,5 @@ const struct ide_proc_devset ide_floppy_settings[] = {
IDE_PROC_DEVSET(bios_head, 0, 255), IDE_PROC_DEVSET(bios_head, 0, 255),
IDE_PROC_DEVSET(bios_sect, 0, 63), IDE_PROC_DEVSET(bios_sect, 0, 63),
IDE_PROC_DEVSET(ticks, 0, 255), IDE_PROC_DEVSET(ticks, 0, 255),
{ 0 }, { NULL },
}; };
...@@ -908,7 +908,7 @@ void ide_timer_expiry (unsigned long data) ...@@ -908,7 +908,7 @@ void ide_timer_expiry (unsigned long data)
ide_drive_t *uninitialized_var(drive); ide_drive_t *uninitialized_var(drive);
ide_handler_t *handler; ide_handler_t *handler;
unsigned long flags; unsigned long flags;
unsigned long wait = -1; int wait = -1;
int plug_device = 0; int plug_device = 0;
spin_lock_irqsave(&hwif->lock, flags); spin_lock_irqsave(&hwif->lock, flags);
...@@ -1162,6 +1162,7 @@ irqreturn_t ide_intr (int irq, void *dev_id) ...@@ -1162,6 +1162,7 @@ irqreturn_t ide_intr (int irq, void *dev_id)
return irq_ret; return irq_ret;
} }
EXPORT_SYMBOL_GPL(ide_intr);
/** /**
* ide_do_drive_cmd - issue IDE special command * ide_do_drive_cmd - issue IDE special command
......
...@@ -315,6 +315,8 @@ void ide_output_data(ide_drive_t *drive, struct request *rq, void *buf, ...@@ -315,6 +315,8 @@ void ide_output_data(ide_drive_t *drive, struct request *rq, void *buf,
u8 io_32bit = drive->io_32bit; u8 io_32bit = drive->io_32bit;
u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
len++;
if (io_32bit) { if (io_32bit) {
unsigned long uninitialized_var(flags); unsigned long uninitialized_var(flags);
......
...@@ -950,6 +950,7 @@ static int ide_port_setup_devices(ide_hwif_t *hwif) ...@@ -950,6 +950,7 @@ static int ide_port_setup_devices(ide_hwif_t *hwif)
static int init_irq (ide_hwif_t *hwif) static int init_irq (ide_hwif_t *hwif)
{ {
struct ide_io_ports *io_ports = &hwif->io_ports; struct ide_io_ports *io_ports = &hwif->io_ports;
irq_handler_t irq_handler;
int sa = 0; int sa = 0;
mutex_lock(&ide_cfg_mtx); mutex_lock(&ide_cfg_mtx);
...@@ -959,6 +960,10 @@ static int init_irq (ide_hwif_t *hwif) ...@@ -959,6 +960,10 @@ static int init_irq (ide_hwif_t *hwif)
hwif->timer.function = &ide_timer_expiry; hwif->timer.function = &ide_timer_expiry;
hwif->timer.data = (unsigned long)hwif; hwif->timer.data = (unsigned long)hwif;
irq_handler = hwif->host->irq_handler;
if (irq_handler == NULL)
irq_handler = ide_intr;
#if defined(__mc68000__) #if defined(__mc68000__)
sa = IRQF_SHARED; sa = IRQF_SHARED;
#endif /* __mc68000__ */ #endif /* __mc68000__ */
...@@ -969,7 +974,7 @@ static int init_irq (ide_hwif_t *hwif) ...@@ -969,7 +974,7 @@ static int init_irq (ide_hwif_t *hwif)
if (io_ports->ctl_addr) if (io_ports->ctl_addr)
hwif->tp_ops->set_irq(hwif, 1); hwif->tp_ops->set_irq(hwif, 1);
if (request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwif)) if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
goto out_up; goto out_up;
if (!hwif->rqsize) { if (!hwif->rqsize) {
......
...@@ -231,7 +231,7 @@ static const struct ide_proc_devset ide_generic_settings[] = { ...@@ -231,7 +231,7 @@ static const struct ide_proc_devset ide_generic_settings[] = {
IDE_PROC_DEVSET(pio_mode, 0, 255), IDE_PROC_DEVSET(pio_mode, 0, 255),
IDE_PROC_DEVSET(unmaskirq, 0, 1), IDE_PROC_DEVSET(unmaskirq, 0, 1),
IDE_PROC_DEVSET(using_dma, 0, 1), IDE_PROC_DEVSET(using_dma, 0, 1),
{ 0 }, { NULL },
}; };
static void proc_ide_settings_warn(void) static void proc_ide_settings_warn(void)
......
...@@ -2166,7 +2166,7 @@ static const struct ide_proc_devset idetape_settings[] = { ...@@ -2166,7 +2166,7 @@ static const struct ide_proc_devset idetape_settings[] = {
__IDE_PROC_DEVSET(speed, 0, 0xffff, NULL, NULL), __IDE_PROC_DEVSET(speed, 0, 0xffff, NULL, NULL),
__IDE_PROC_DEVSET(tdsc, IDETAPE_DSC_RW_MIN, IDETAPE_DSC_RW_MAX, __IDE_PROC_DEVSET(tdsc, IDETAPE_DSC_RW_MIN, IDETAPE_DSC_RW_MAX,
mulf_tdsc, divf_tdsc), mulf_tdsc, divf_tdsc),
{ 0 }, { NULL },
}; };
#endif #endif
......
...@@ -89,6 +89,8 @@ enum { ...@@ -89,6 +89,8 @@ enum {
ATA_ID_DLF = 128, ATA_ID_DLF = 128,
ATA_ID_CSFO = 129, ATA_ID_CSFO = 129,
ATA_ID_CFA_POWER = 160, ATA_ID_CFA_POWER = 160,
ATA_ID_CFA_KEY_MGMT = 162,
ATA_ID_CFA_MODES = 163,
ATA_ID_ROT_SPEED = 217, ATA_ID_ROT_SPEED = 217,
ATA_ID_PIO4 = (1 << 1), ATA_ID_PIO4 = (1 << 1),
......
...@@ -511,7 +511,6 @@ struct hd_driveid { ...@@ -511,7 +511,6 @@ struct hd_driveid {
unsigned short words69_70[2]; /* reserved words 69-70 unsigned short words69_70[2]; /* reserved words 69-70
* future command overlap and queuing * future command overlap and queuing
*/ */
/* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
unsigned short words71_74[4]; /* reserved words 71-74 unsigned short words71_74[4]; /* reserved words 71-74
* for IDENTIFY PACKET DEVICE command * for IDENTIFY PACKET DEVICE command
*/ */
......
...@@ -866,6 +866,7 @@ struct ide_host { ...@@ -866,6 +866,7 @@ struct ide_host {
unsigned int n_ports; unsigned int n_ports;
struct device *dev[2]; struct device *dev[2];
unsigned int (*init_chipset)(struct pci_dev *); unsigned int (*init_chipset)(struct pci_dev *);
irq_handler_t irq_handler;
unsigned long host_flags; unsigned long host_flags;
void *host_priv; void *host_priv;
ide_hwif_t *cur_port; /* for hosts requiring serialization */ ide_hwif_t *cur_port; /* for hosts requiring serialization */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment