Skip to content

Commit 969907a

Browse files
committed
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: ide: drivers/ide/generic.c -> drivers/ide/ide-pci-generic.c ide-disk: set non-rotational queue flag for SSD and CF devices ide-cd: add TEAC CD-224E to the NO_AUTOCLOSE list ide: Add tx4938ide driver (v2) TXx9: Add TX4938 ATA support (v3) ide: Add tx4939ide driver (v6) ide: two more pci_ioremap_bar() conversions pci: use pci_ioremap_bar() in drivers/ide sgiioc4: use ide_host_add() (take 2) sgiioc4: fix error cleanup path (take 2)
2 parents ea54168 + fa3fd72 commit 969907a

File tree

13 files changed

+1157
-27
lines changed

13 files changed

+1157
-27
lines changed

arch/mips/include/asm/txx9/tx4938.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,17 @@ void tx4938_setup_pcierr_irq(void);
292292
void tx4938_irq_init(void);
293293
void tx4938_mtd_init(int ch);
294294

295+
struct tx4938ide_platform_info {
296+
/*
297+
* I/O port shift, for platforms with ports that are
298+
* constantly spaced and need larger than the 1-byte
299+
* spacing used by ata_std_ports().
300+
*/
301+
unsigned int ioport_shift;
302+
unsigned int gbus_clock; /* 0 means no PIO mode tuning. */
303+
unsigned int ebus_ch;
304+
};
305+
306+
void tx4938_ata_init(unsigned int irq, unsigned int shift, int tune);
307+
295308
#endif

arch/mips/txx9/generic/setup_tx4938.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/param.h>
1717
#include <linux/ptrace.h>
1818
#include <linux/mtd/physmap.h>
19+
#include <linux/platform_device.h>
1920
#include <asm/reboot.h>
2021
#include <asm/traps.h>
2122
#include <asm/txx9irq.h>
@@ -335,6 +336,52 @@ void __init tx4938_mtd_init(int ch)
335336
txx9_physmap_flash_init(ch, start, size, &pdata);
336337
}
337338

339+
void __init tx4938_ata_init(unsigned int irq, unsigned int shift, int tune)
340+
{
341+
struct platform_device *pdev;
342+
struct resource res[] = {
343+
{
344+
/* .start and .end are filled in later */
345+
.flags = IORESOURCE_MEM,
346+
}, {
347+
.start = irq,
348+
.flags = IORESOURCE_IRQ,
349+
},
350+
};
351+
struct tx4938ide_platform_info pdata = {
352+
.ioport_shift = shift,
353+
/*
354+
* The IDE driver should not change bus timings if other ISA
355+
* devices existed.
356+
*/
357+
.gbus_clock = tune ? txx9_gbus_clock : 0,
358+
};
359+
u64 ebccr;
360+
int i;
361+
362+
if ((__raw_readq(&tx4938_ccfgptr->pcfg) &
363+
(TX4938_PCFG_ATA_SEL | TX4938_PCFG_NDF_SEL))
364+
!= TX4938_PCFG_ATA_SEL)
365+
return;
366+
for (i = 0; i < 8; i++) {
367+
/* check EBCCRn.ISA, EBCCRn.BSZ, EBCCRn.ME */
368+
ebccr = __raw_readq(&tx4938_ebuscptr->cr[i]);
369+
if ((ebccr & 0x00f00008) == 0x00e00008)
370+
break;
371+
}
372+
if (i == 8)
373+
return;
374+
pdata.ebus_ch = i;
375+
res[0].start = ((ebccr >> 48) << 20) + 0x10000;
376+
res[0].end = res[0].start + 0x20000 - 1;
377+
pdev = platform_device_alloc("tx4938ide", -1);
378+
if (!pdev ||
379+
platform_device_add_resources(pdev, res, ARRAY_SIZE(res)) ||
380+
platform_device_add_data(pdev, &pdata, sizeof(pdata)) ||
381+
platform_device_add(pdev))
382+
platform_device_put(pdev);
383+
}
384+
338385
static void __init tx4938_stop_unused_modules(void)
339386
{
340387
__u64 pcfg, rst = 0, ckd = 0;

arch/mips/txx9/rbtx4938/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ static void __init rbtx4938_device_init(void)
352352
rbtx4938_ne_init();
353353
tx4938_wdt_init();
354354
rbtx4938_mtd_init();
355+
tx4938_ata_init(RBTX4938_IRQ_IOC_ATA, 0, 1);
355356
txx9_iocled_init(RBTX4938_LED_ADDR - IO_BASE, -1, 8, 1, "green", NULL);
356357
}
357358

drivers/ide/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,16 @@ config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
720720
default "128"
721721
depends on BLK_DEV_IDE_AU1XXX
722722

723+
config BLK_DEV_IDE_TX4938
724+
tristate "TX4938 internal IDE support"
725+
depends on SOC_TX4938
726+
select IDE_TIMINGS
727+
728+
config BLK_DEV_IDE_TX4939
729+
tristate "TX4939 internal IDE support"
730+
depends on SOC_TX4939
731+
select BLK_DEV_IDEDMA_SFF
732+
723733
config IDE_ARM
724734
tristate "ARM IDE support"
725735
depends on ARM && (ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)

drivers/ide/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o
6868

6969
# Must appear at the end of the block
7070
obj-$(CONFIG_BLK_DEV_GENERIC) += ide-pci-generic.o
71-
ide-pci-generic-y += generic.o
7271

7372
obj-$(CONFIG_IDEPCI_PCIBUS_ORDER) += ide-scan-pci.o
7473

@@ -111,3 +110,6 @@ obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o
111110
obj-$(CONFIG_BLK_DEV_PALMCHIP_BK3710) += palm_bk3710.o
112111

113112
obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o
113+
114+
obj-$(CONFIG_BLK_DEV_IDE_TX4938) += tx4938ide.o
115+
obj-$(CONFIG_BLK_DEV_IDE_TX4939) += tx4939ide.o

drivers/ide/ide-cd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,7 @@ static const struct cd_list_entry ide_cd_quirks_list[] = {
19661966
{ "Optiarc DVD RW AD-5200A", NULL, IDE_AFLAG_PLAY_AUDIO_OK },
19671967
{ "Optiarc DVD RW AD-7200A", NULL, IDE_AFLAG_PLAY_AUDIO_OK },
19681968
{ "Optiarc DVD RW AD-7543A", NULL, IDE_AFLAG_NO_AUTOCLOSE },
1969+
{ "TEAC CD-ROM CD-224E", NULL, IDE_AFLAG_NO_AUTOCLOSE },
19691970
{ NULL, NULL, 0 }
19701971
};
19711972

drivers/ide/ide-disk.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ static int ide_disk_check(ide_drive_t *drive, const char *s)
600600
static void ide_disk_setup(ide_drive_t *drive)
601601
{
602602
struct ide_disk_obj *idkp = drive->driver_data;
603+
struct request_queue *q = drive->queue;
603604
ide_hwif_t *hwif = drive->hwif;
604605
u16 *id = drive->id;
605606
char *m = (char *)&id[ATA_ID_PROD];
@@ -626,11 +627,14 @@ static void ide_disk_setup(ide_drive_t *drive)
626627
if (max_s > hwif->rqsize)
627628
max_s = hwif->rqsize;
628629

629-
blk_queue_max_sectors(drive->queue, max_s);
630+
blk_queue_max_sectors(q, max_s);
630631
}
631632

632633
printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name,
633-
drive->queue->max_sectors / 2);
634+
q->max_sectors / 2);
635+
636+
if (ata_id_is_ssd(id) || ata_id_is_cfa(id))
637+
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
634638

635639
/* calculate drive capacity, and select LBA if possible */
636640
ide_disk_get_capacity(drive);
File renamed without changes.

drivers/ide/scc_pata.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,6 @@ static u8 scc_udma_filter(ide_drive_t *drive)
536536

537537
static int setup_mmio_scc (struct pci_dev *dev, const char *name)
538538
{
539-
unsigned long ctl_base = pci_resource_start(dev, 0);
540-
unsigned long dma_base = pci_resource_start(dev, 1);
541-
unsigned long ctl_size = pci_resource_len(dev, 0);
542-
unsigned long dma_size = pci_resource_len(dev, 1);
543539
void __iomem *ctl_addr;
544540
void __iomem *dma_addr;
545541
int i, ret;
@@ -557,10 +553,12 @@ static int setup_mmio_scc (struct pci_dev *dev, const char *name)
557553
return ret;
558554
}
559555

560-
if ((ctl_addr = ioremap(ctl_base, ctl_size)) == NULL)
556+
ctl_addr = pci_ioremap_bar(dev, 0);
557+
if (!ctl_addr)
561558
goto fail_0;
562559

563-
if ((dma_addr = ioremap(dma_base, dma_size)) == NULL)
560+
dma_addr = pci_ioremap_bar(dev, 1);
561+
if (!dma_addr)
564562
goto fail_1;
565563

566564
pci_set_master(dev);

drivers/ide/sgiioc4.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
567567
unsigned long cmd_base, irqport;
568568
unsigned long bar0, cmd_phys_base, ctl;
569569
void __iomem *virt_base;
570-
struct ide_host *host;
571570
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
572-
struct ide_port_info d = sgiioc4_port_info;
573571
int rc;
574572

575573
/* Get the CmdBlk and CtrlBlk Base Registers */
576574
bar0 = pci_resource_start(dev, 0);
577-
virt_base = ioremap(bar0, pci_resource_len(dev, 0));
575+
virt_base = pci_ioremap_bar(dev, 0);
578576
if (virt_base == NULL) {
579577
printk(KERN_ERR "%s: Unable to remap BAR 0 address: 0x%lx\n",
580578
DRV_NAME, bar0);
@@ -590,7 +588,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
590588
printk(KERN_ERR "%s %s -- ERROR: addresses 0x%08lx to 0x%08lx "
591589
"already in use\n", DRV_NAME, pci_name(dev),
592590
cmd_phys_base, cmd_phys_base + IOC4_CMD_CTL_BLK_SIZE);
593-
return -EBUSY;
591+
rc = -EBUSY;
592+
goto req_mem_rgn_err;
594593
}
595594

596595
/* Initialize the IO registers */
@@ -603,21 +602,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
603602
/* Initializing chipset IRQ Registers */
604603
writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4));
605604

606-
host = ide_host_alloc(&d, hws);
607-
if (host == NULL) {
608-
rc = -ENOMEM;
609-
goto err;
610-
}
611-
612-
rc = ide_host_register(host, &d, hws);
613-
if (rc)
614-
goto err_free;
605+
rc = ide_host_add(&sgiioc4_port_info, hws, NULL);
606+
if (!rc)
607+
return 0;
615608

616-
return 0;
617-
err_free:
618-
ide_host_free(host);
619-
err:
620609
release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE);
610+
req_mem_rgn_err:
621611
iounmap(virt_base);
622612
return rc;
623613
}

drivers/ide/siimage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ static int __devinit siimage_init_one(struct pci_dev *dev,
784784
printk(KERN_WARNING DRV_NAME " %s: MMIO ports not "
785785
"available\n", pci_name(dev));
786786
} else {
787-
ioaddr = ioremap(bar5, barsize);
787+
ioaddr = pci_ioremap_bar(dev, 5);
788788
if (ioaddr == NULL)
789789
release_mem_region(bar5, barsize);
790790
}

0 commit comments

Comments
 (0)