Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a52b0d25 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 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()
  ...
parents 539a5fe2 f37afdac
Loading
Loading
Loading
Loading
+0 −46
Original line number Diff line number Diff line
@@ -46,8 +46,6 @@ Two files are introduced:

  a) 'include/asm-mips/mach-au1x00/au1xxx_ide.h'
     containes : struct _auide_hwif
                 struct drive_list_entry dma_white_list
                 struct drive_list_entry dma_black_list
                 timing parameters for PIO mode 0/1/2/3/4
                 timing parameters for MWDMA 0/1/2

@@ -63,12 +61,6 @@ Four configs variables are introduced:
  CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ - maximum transfer size
                                           per descriptor

If MWDMA is enabled and the connected hard disc is not on the white list, the
kernel switches to a "safe mwdma mode" at boot time. In this mode the IDE
performance is substantial slower then in full speed mwdma. In this case
please add your hard disc to the white list (follow instruction from 'ADD NEW
HARD DISC TO WHITE OR BLACK LIST' section).


SUPPORTED IDE MODES
-------------------
@@ -120,44 +112,6 @@ CONFIG_IDEDMA_AUTO=y
Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to
disable the burst support on DBDMA controller.

ADD NEW HARD DISC TO WHITE OR BLACK LIST
----------------------------------------

Step 1 : detect the model name of your hard disc

  a) connect your hard disc to the AU1XXX

  b) boot your kernel and get the hard disc model.

     Example boot log:

     --snipped--
     Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
     ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
     Au1xxx IDE(builtin) configured for MWDMA2
     Probing IDE interface ide0...
     hda: Maxtor 6E040L0, ATA DISK drive
     ide0 at 0xac800000-0xac800007,0xac8001c0 on irq 64
     hda: max request size: 64KiB
     hda: 80293248 sectors (41110 MB) w/2048KiB Cache, CHS=65535/16/63, (U)DMA
     --snipped--

     In this example 'Maxtor 6E040L0'.

Step  2 : edit 'include/asm-mips/mach-au1x00/au1xxx_ide.h'

  Add your hard disc to the dma_white_list or dma_black_list structur.

Step 3 : Recompile the kernel

  Enable MWDMA support in the kernel configuration. Recompile the kernel and
  reboot.

Step 4 : Tests

  If you have add a hard disc to the white list, please run some stress tests
  for verification.


ACKNOWLEDGMENTS
---------------
+1 −2
Original line number Diff line number Diff line
@@ -55,8 +55,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
		ide_init_port_data(hwif, i);

	ide_init_port_hw(hwif, &hw);
	hwif->mmio = 1;
	hwif->quirkproc = NULL;
	hwif->port_ops = NULL;

	idx[0] = i;

+36 −20
Original line number Diff line number Diff line
@@ -191,6 +191,10 @@ static void icside_maskproc(ide_drive_t *drive, int mask)
	local_irq_restore(flags);
}

static const struct ide_port_ops icside_v6_no_dma_port_ops = {
	.maskproc		= icside_maskproc,
};

#ifdef CONFIG_BLK_DEV_IDEDMA_ICS
/*
 * SG-DMA support.
@@ -266,6 +270,11 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode)
		ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data);
}

static const struct ide_port_ops icside_v6_port_ops = {
	.set_dma_mode		= icside_set_dma_mode,
	.maskproc		= icside_maskproc,
};

static void icside_dma_host_set(ide_drive_t *drive, int on)
{
}
@@ -375,25 +384,33 @@ static void icside_dma_lost_irq(ide_drive_t *drive)
	printk(KERN_ERR "%s: IRQ lost\n", drive->name);
}

static void icside_dma_init(ide_hwif_t *hwif)
static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
{
	hwif->dmatable_cpu	= NULL;
	hwif->dmatable_dma	= 0;
	hwif->set_dma_mode	= icside_set_dma_mode;

	hwif->dma_host_set	= icside_dma_host_set;
	hwif->dma_setup		= icside_dma_setup;
	hwif->dma_exec_cmd	= icside_dma_exec_cmd;
	hwif->dma_start		= icside_dma_start;
	hwif->ide_dma_end	= icside_dma_end;
	hwif->ide_dma_test_irq	= icside_dma_test_irq;
	hwif->dma_timeout	= icside_dma_timeout;
	hwif->dma_lost_irq	= icside_dma_lost_irq;
	return 0;
}

static const struct ide_dma_ops icside_v6_dma_ops = {
	.dma_host_set		= icside_dma_host_set,
	.dma_setup		= icside_dma_setup,
	.dma_exec_cmd		= icside_dma_exec_cmd,
	.dma_start		= icside_dma_start,
	.dma_end		= icside_dma_end,
	.dma_test_irq		= icside_dma_test_irq,
	.dma_timeout		= icside_dma_timeout,
	.dma_lost_irq		= icside_dma_lost_irq,
};
#else
#define icside_dma_init(hwif)	(0)
#define icside_v6_dma_ops NULL
#endif

static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d)
{
	return -EOPNOTSUPP;
}

static ide_hwif_t *
icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec)
{
@@ -408,7 +425,6 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
		 * Ensure we're using MMIO
		 */
		default_hwif_mmiops(hwif);
		hwif->mmio = 1;

		for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
			hwif->io_ports[i] = port;
@@ -416,7 +432,6 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
		}
		hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset;
		hwif->irq     = ec->irq;
		hwif->noprobe = 0;
		hwif->chipset = ide_acorn;
		hwif->gendev.parent = &ec->dev;
		hwif->dev = &ec->dev;
@@ -462,8 +477,10 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
}

static const struct ide_port_info icside_v6_port_info __initdata = {
	.init_dma		= icside_dma_off_init,
	.port_ops		= &icside_v6_no_dma_port_ops,
	.dma_ops		= &icside_v6_dma_ops,
	.host_flags		= IDE_HFLAG_SERIALIZE |
				  IDE_HFLAG_NO_DMA | /* no SFF-style DMA */
				  IDE_HFLAG_NO_AUTOTUNE,
	.mwdma_mask		= ATA_MWDMA2,
	.swdma_mask		= ATA_SWDMA2,
@@ -526,7 +543,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
	state->hwif[0]    = hwif;
	state->hwif[1]    = mate;

	hwif->maskproc    = icside_maskproc;
	hwif->hwif_data   = state;
	hwif->config_data = (unsigned long)ioc_base;
	hwif->select_data = sel;
@@ -537,10 +553,10 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
	mate->select_data = sel | 1;

	if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) {
		icside_dma_init(hwif);
		icside_dma_init(mate);
	} else
		d.mwdma_mask = d.swdma_mask = 0;
		d.init_dma = icside_dma_init;
		d.port_ops = &icside_v6_dma_port_ops;
		d.dma_ops = NULL;
	}

	idx[0] = hwif->index;
	idx[1] = mate->index;
+17 −1
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
#include <asm/mach-types.h>
#include <asm/irq.h>

#define DRV_NAME "ide_arm"

#ifdef CONFIG_ARCH_CLPS7500
# include <asm/arch/hardware.h>
#
@@ -28,10 +30,24 @@ static int __init ide_arm_init(void)
{
	ide_hwif_t *hwif;
	hw_regs_t hw;
	unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206;
	u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

	if (!request_region(base, 8, DRV_NAME)) {
		printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
				DRV_NAME, base, base + 7);
		return -EBUSY;
	}

	if (!request_region(ctl, 1, DRV_NAME)) {
		printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",
				DRV_NAME, ctl);
		release_region(base, 8);
		return -EBUSY;
	}

	memset(&hw, 0, sizeof(hw));
	ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
	ide_std_init_ports(&hw, base, ctl);
	hw.irq = IDE_ARM_IRQ;

	hwif = ide_find_port();
+20 −8
Original line number Diff line number Diff line
@@ -317,17 +317,31 @@ static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
	return ATA_CBL_PATA80;
}

static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif)
static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif,
					  const struct ide_port_info *d)
{
	hwif->set_pio_mode = palm_bk3710_set_pio_mode;
	hwif->set_dma_mode = palm_bk3710_set_dma_mode;
	unsigned long base =
		hwif->io_ports[IDE_DATA_OFFSET] - IDE_PALM_ATA_PRI_REG_OFFSET;

	hwif->cable_detect = palm_bk3710_cable_detect;
	printk(KERN_INFO "    %s: MMIO-DMA\n", hwif->name);

	if (ide_allocate_dma_engine(hwif))
		return -1;

	ide_setup_dma(hwif, base);

	return 0;
}

static const struct ide_port_ops palm_bk3710_ports_ops = {
	.set_pio_mode		= palm_bk3710_set_pio_mode,
	.set_dma_mode		= palm_bk3710_set_dma_mode,
	.cable_detect		= palm_bk3710_cable_detect,
};

static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
	.init_hwif		= palm_bk3710_init_hwif,
	.host_flags		= IDE_HFLAG_NO_DMA, /* hack (no PCI) */
	.init_dma		= palm_bk3710_init_dma,
	.port_ops		= &palm_bk3710_ports_ops,
	.pio_mask		= ATA_PIO4,
	.udma_mask		= ATA_UDMA4,	/* (input clk 99MHz) */
	.mwdma_mask		= ATA_MWDMA2,
@@ -394,8 +408,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
	hwif->mmio = 1;
	default_hwif_mmiops(hwif);

	ide_setup_dma(hwif, mem->start);

	idx[0] = i;

	ide_device_add(idx, &palm_bk3710_port_info);
Loading