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

Commit 72558dde authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (36 commits)
  ide: re-add TRM290 fix lost during ide_build_dmatable() cleanup
  scc_pata: kill unused variables
  sgiioc4: kill duplicate ioremap()
  sgiioc4: kill useless address checks
  delkin_cb: add PM support
  ide: remove broken hpt34x driver
  ide-floppy: remove idefloppy_floppy_t typedef
  sgiioc4: remove maskproc() method
  hpt366: cleanup maskproc() method
  ide: mask interrupt in ide_config_drive_speed()
  hpt366: fix compile warning
  ide: remove unused macros from <asm-parisc/ide.h>
  ide: remove M68K_IDE_SWAPW define from <asm-m68k/ide.h>
  ide: remove dead <asm-arm/arch-sa1100/ide.h>
  ide: fix support for IDE PCI controllers using MMIO on frv
  ide-cd: remove stale comment
  ide-cd: small drive type print fix
  ide-cd: debug log enhancements
  ide: add generic ATA/ATAPI disk driver
  ide: allow device drivers to specify per-device type /proc settings
  ...
parents b9138523 769b49ce
Loading
Loading
Loading
Loading
+0 −75
Original line number Diff line number Diff line
/*
 * arch/arm/mach-sa1100/include/mach/ide.h
 *
 * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre
 *
 * 18-aug-2000: Cleanup by Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
 *              Get rid of the special ide_init_hwif_ports() functions
 *              and make a generalised function that can be used by all
 *              architectures.
 */

#include <asm/irq.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>

#error "This code is broken and needs update to match with current ide support"


/*
 * Set up a hw structure for a specified data port, control port and IRQ.
 * This should follow whatever the default interface uses.
 */
static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
				       unsigned long ctrl_port, int *irq)
{
	unsigned long reg = data_port;
	int i;
	int regincr = 1;

	/* The Empeg board has the first two address lines unused */
	if (machine_is_empeg())
		regincr = 1 << 2;

	/* The LART doesn't use A0 for IDE */
	if (machine_is_lart())
		regincr = 1 << 1;

	memset(hw, 0, sizeof(*hw));

	for (i = 0; i <= 7; i++) {
		hw->io_ports_array[i] = reg;
		reg += regincr;
	}

	hw->io_ports.ctl_addr = ctrl_port;

	if (irq)
		*irq = 0;
}

/*
 * This registers the standard ports for this architecture with the IDE
 * driver.
 */
static __inline__ void
ide_init_default_hwifs(void)
{
    if (machine_is_lart()) {
#ifdef CONFIG_SA1100_LART
        hw_regs_t hw;

        /* Enable GPIO as interrupt line */
        GPDR &= ~LART_GPIO_IDE;
	set_irq_type(LART_IRQ_IDE, IRQ_TYPE_EDGE_RISING);

        /* set PCMCIA interface timing */
        MECR = 0x00060006;

        /* init the interface */
	ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x0000, PCMCIA_IO_0_BASE + 0x1000, NULL);
        hw.irq = LART_IRQ_IDE;
        ide_register_hw(&hw);
#endif
    }
}
+31 −57
Original line number Diff line number Diff line
@@ -84,21 +84,40 @@ config BLK_DEV_IDE_SATA

	  If unsure, say N.

config BLK_DEV_IDEDISK
	tristate "Include IDE/ATA-2 DISK support"
	---help---
	  This will include enhanced support for MFM/RLL/IDE hard disks.  If
	  you have a MFM/RLL/IDE disk, and there is no special reason to use
	  the old hard disk driver instead, say Y.  If you have an SCSI-only
	  system, you can say N here.
config IDE_GD
	tristate "generic ATA/ATAPI disk support"
	default y
	help
	  Support for ATA/ATAPI disks (including ATAPI floppy drives).

	  To compile this driver as a module, choose M here: the
	  module will be called ide-disk.
	  Do not compile this driver as a module if your root file system
	  (the one containing the directory /) is located on the IDE disk.
	  To compile this driver as a module, choose M here.
	  The module will be called ide-gd_mod.

	  If unsure, say Y.

config IDE_GD_ATA
	bool "ATA disk support"
	depends on IDE_GD
	default y
	help
	  This will include support for ATA hard disks.

	  If unsure, say Y.

config IDE_GD_ATAPI
	bool "ATAPI floppy support"
	depends on IDE_GD
	select IDE_ATAPI
	help
	  This will include support for ATAPI floppy drives
	  (i.e. Iomega ZIP or MKE LS-120).

	  For information about jumper settings and the question
	  of when a ZIP drive uses a partition table, see
	  <http://www.win.tue.nl/~aeb/linux/zip/zip-1.html>.

	  If unsure, say N.

config BLK_DEV_IDECS
	tristate "PCMCIA IDE support"
	depends on PCMCIA
@@ -163,29 +182,6 @@ config BLK_DEV_IDETAPE
	  To compile this driver as a module, choose M here: the
	  module will be called ide-tape.

config BLK_DEV_IDEFLOPPY
	tristate "Include IDE/ATAPI FLOPPY support"
	select IDE_ATAPI
	---help---
	  If you have an IDE floppy drive which uses the ATAPI protocol,
	  answer Y.  ATAPI is a newer protocol used by IDE CD-ROM/tape/floppy
	  drives, similar to the SCSI protocol.

	  The LS-120 and the IDE/ATAPI Iomega ZIP drive are also supported by
	  this driver. For information about jumper settings and the question
	  of when a ZIP drive uses a partition table, see
	  <http://www.win.tue.nl/~aeb/linux/zip/zip-1.html>.
	  (ATAPI PD-CD/CDR drives are not supported by this driver; support
	  for PD-CD/CDR drives is available if you answer Y to
	  "SCSI emulation support", below).

	  If you say Y here, the FLOPPY drive will be identified along with
	  other IDE devices, as "hdb" or "hdc", or something similar (check
	  the boot messages with dmesg).

	  To compile this driver as a module, choose M here: the
	  module will be called ide-floppy.

config BLK_DEV_IDESCSI
	tristate "SCSI emulation support (DEPRECATED)"
	depends on SCSI
@@ -332,7 +328,7 @@ config IDEPCI_PCIBUS_ORDER
# TODO: split it on per host driver config options (or module parameters)
config BLK_DEV_OFFBOARD
	bool "Boot off-board chipsets first support (DEPRECATED)"
	depends on BLK_DEV_IDEPCI && (BLK_DEV_AEC62XX || BLK_DEV_GENERIC || BLK_DEV_HPT34X || BLK_DEV_HPT366 || BLK_DEV_PDC202XX_NEW || BLK_DEV_PDC202XX_OLD || BLK_DEV_TC86C001)
	depends on BLK_DEV_IDEPCI && (BLK_DEV_AEC62XX || BLK_DEV_GENERIC || BLK_DEV_HPT366 || BLK_DEV_PDC202XX_NEW || BLK_DEV_PDC202XX_OLD || BLK_DEV_TC86C001)
	help
	  Normally, IDE controllers built into the motherboard (on-board
	  controllers) are assigned to ide0 and ide1 while those on add-in PCI
@@ -482,28 +478,6 @@ config BLK_DEV_CS5535

	  It is safe to say Y to this question.

config BLK_DEV_HPT34X
	tristate "HPT34X chipset support"
	depends on BROKEN
	select BLK_DEV_IDEDMA_PCI
	help
	  This driver adds up to 4 more EIDE devices sharing a single
	  interrupt. The HPT343 chipset in its current form is a non-bootable
	  controller; the HPT345/HPT363 chipset is a bootable (needs BIOS FIX)
	  PCI UDMA controllers. This driver requires dynamic tuning of the
	  chipset during the ide-probe at boot time. It is reported to support
	  DVD II drives, by the manufacturer.

config HPT34X_AUTODMA
	bool "HPT34X AUTODMA support (EXPERIMENTAL)"
	depends on BLK_DEV_HPT34X && EXPERIMENTAL
	help
	  This is a dangerous thing to attempt currently! Please read the
	  comments at the top of <file:drivers/ide/pci/hpt34x.c>.  If you say Y
	  here, then say Y to "Use DMA by default when available" as well.

	  If unsure, say N.

config BLK_DEV_HPT366
	tristate "HPT36X/37X chipset support"
	select BLK_DEV_IDEDMA_PCI
+13 −6
Original line number Diff line number Diff line
@@ -37,18 +37,25 @@ obj-$(CONFIG_IDE_H8300) += h8300/
obj-$(CONFIG_IDE_GENERIC)		+= ide-generic.o
obj-$(CONFIG_BLK_DEV_IDEPNP)		+= ide-pnp.o

ide-disk_mod-y += ide-disk.o ide-disk_ioctl.o
ide-gd_mod-y += ide-gd.o
ide-cd_mod-y += ide-cd.o ide-cd_ioctl.o ide-cd_verbose.o
ide-floppy_mod-y += ide-floppy.o ide-floppy_ioctl.o

ifeq ($(CONFIG_IDE_GD_ATA), y)
	ide-gd_mod-y += ide-disk.o ide-disk_ioctl.o
ifeq ($(CONFIG_IDE_PROC_FS), y)
	ide-disk_mod-y += ide-disk_proc.o
	ide-floppy_mod-y += ide-floppy_proc.o
	ide-gd_mod-y += ide-disk_proc.o
endif
endif

ifeq ($(CONFIG_IDE_GD_ATAPI), y)
	ide-gd_mod-y += ide-floppy.o ide-floppy_ioctl.o
ifeq ($(CONFIG_IDE_PROC_FS), y)
	ide-gd_mod-y += ide-floppy_proc.o
endif
endif

obj-$(CONFIG_BLK_DEV_IDEDISK)		+= ide-disk_mod.o
obj-$(CONFIG_IDE_GD)			+= ide-gd_mod.o
obj-$(CONFIG_BLK_DEV_IDECD)		+= ide-cd_mod.o
obj-$(CONFIG_BLK_DEV_IDEFLOPPY)		+= ide-floppy_mod.o
obj-$(CONFIG_BLK_DEV_IDETAPE)		+= ide-tape.o

ifeq ($(CONFIG_BLK_DEV_IDECS), y)
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ int ide_set_media_lock(ide_drive_t *drive, struct gendisk *disk, int on)
{
	struct ide_atapi_pc pc;

	if (drive->atapi_flags & IDE_AFLAG_NO_DOORLOCK)
	if ((drive->dev_flags & IDE_DFLAG_DOORLOCKING) == 0)
		return 0;

	ide_init_pc(&pc);
+38 −23
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ static void ide_cd_put(struct cdrom_info *cd)
/* Mark that we've seen a media change and invalidate our internal buffers. */
static void cdrom_saw_media_change(ide_drive_t *drive)
{
	drive->atapi_flags |= IDE_AFLAG_MEDIA_CHANGED;
	drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
	drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID;
}

@@ -340,8 +340,8 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
	}

	ide_debug_log(IDE_DBG_RQ, "%s: stat: 0x%x, good_stat: 0x%x, "
		      "rq->cmd_type: 0x%x, err: 0x%x\n", __func__, stat,
		      good_stat, rq->cmd_type, err);
		      "rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x, err: 0x%x\n",
		      __func__, stat, good_stat, rq->cmd[0], rq->cmd_type, err);

	if (blk_sense_request(rq)) {
		/*
@@ -843,13 +843,10 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq)
	rq->q->prep_rq_fn(rq->q, rq);
}

/*
 * All other packet commands.
 */
static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq)
{

	ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);
	ide_debug_log(IDE_DBG_FUNC, "Call %s, rq->cmd[0]: 0x%x\n",
		      __func__, rq->cmd[0]);

	/*
	 * Some of the trailing request sense fields are optional,
@@ -876,7 +873,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
	if (!sense)
		sense = &local_sense;

	ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x, "
	ide_debug_log(IDE_DBG_PC, "Call %s, cmd[0]: 0x%x, write: 0x%x, "
		      "timeout: %d, cmd_flags: 0x%x\n", __func__, cmd[0], write,
		      timeout, cmd_flags);

@@ -1177,8 +1174,9 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq)
	unsigned short sectors_per_frame =
		queue_hardsect_size(drive->queue) >> SECTOR_BITS;

	ide_debug_log(IDE_DBG_RQ, "Call %s, write: 0x%x, secs_per_frame: %u\n",
		      __func__, write, sectors_per_frame);
	ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x, "
		      "secs_per_frame: %u\n",
		      __func__, rq->cmd[0], write, sectors_per_frame);

	if (write) {
		/* disk has become write protected */
@@ -1221,7 +1219,8 @@ static ide_startstop_t cdrom_do_newpc_cont(ide_drive_t *drive)
static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
{

	ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd_type: 0x%x\n", __func__,
	ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, "
		      "rq->cmd_type: 0x%x\n", __func__, rq->cmd[0],
		      rq->cmd_type);

	if (blk_pc_request(rq))
@@ -1257,9 +1256,6 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
	}
}

/*
 * cdrom driver request routine.
 */
static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
					sector_t block)
{
@@ -1267,8 +1263,10 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
	ide_handler_t *fn;
	int xferlen;

	ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd_type: 0x%x, block: %llu\n",
		      __func__, rq->cmd_type, (unsigned long long)block);
	ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, "
		      "rq->cmd_type: 0x%x, block: %llu\n",
		      __func__, rq->cmd[0], rq->cmd_type,
		      (unsigned long long)block);

	if (blk_fs_request(rq)) {
		if (drive->atapi_flags & IDE_AFLAG_SEEKING) {
@@ -1412,6 +1410,10 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,

	*capacity = 1 + be32_to_cpu(capbuf.lba);
	*sectors_per_frame = blocklen >> SECTOR_BITS;

	ide_debug_log(IDE_DBG_PROBE, "%s: cap: %lu, sectors_per_frame: %lu\n",
		      __func__, *capacity, *sectors_per_frame);

	return 0;
}

@@ -1643,6 +1645,9 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf)
		maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]);
	}

	ide_debug_log(IDE_DBG_PROBE, "%s: curspeed: %u, maxspeed: %u\n",
		      __func__, curspeed, maxspeed);

	cd->current_speed = (curspeed + (176/2)) / 176;
	cd->max_speed = (maxspeed + (176/2)) / 176;
}
@@ -1732,7 +1737,7 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
		return 0;

	if ((buf[8 + 6] & 0x01) == 0)
		drive->atapi_flags |= IDE_AFLAG_NO_DOORLOCK;
		drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
	if (buf[8 + 6] & 0x08)
		drive->atapi_flags &= ~IDE_AFLAG_NO_EJECT;
	if (buf[8 + 3] & 0x01)
@@ -1777,7 +1782,7 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
	if ((cdi->mask & CDC_DVD_R) == 0 || (cdi->mask & CDC_DVD_RAM) == 0)
		printk(KERN_CONT " DVD%s%s",
				 (cdi->mask & CDC_DVD_R) ? "" : "-R",
				 (cdi->mask & CDC_DVD_RAM) ? "" : "-RAM");
				 (cdi->mask & CDC_DVD_RAM) ? "" : "/RAM");

	if ((cdi->mask & CDC_CD_R) == 0 || (cdi->mask & CDC_CD_RW) == 0)
		printk(KERN_CONT " CD%s%s",
@@ -1908,6 +1913,16 @@ static const struct ide_proc_devset idecd_settings[] = {
	IDE_PROC_DEVSET(dsc_overlap, 0, 1),
	{ 0 },
};

static ide_proc_entry_t *ide_cd_proc_entries(ide_drive_t *drive)
{
	return idecd_proc;
}

static const struct ide_proc_devset *ide_cd_proc_devsets(ide_drive_t *drive)
{
	return idecd_settings;
}
#endif

static const struct cd_list_entry ide_cd_quirks_list[] = {
@@ -1986,8 +2001,8 @@ static int ide_cdrom_setup(ide_drive_t *drive)
	if (!drive->queue->unplug_delay)
		drive->queue->unplug_delay = 1;

	drive->atapi_flags = IDE_AFLAG_MEDIA_CHANGED | IDE_AFLAG_NO_EJECT |
		       ide_cd_flags(id);
	drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
	drive->atapi_flags = IDE_AFLAG_NO_EJECT | ide_cd_flags(id);

	if ((drive->atapi_flags & IDE_AFLAG_VERTOS_300_SSD) &&
	    fw_rev[4] == '1' && fw_rev[6] <= '2')
@@ -2069,8 +2084,8 @@ static ide_driver_t ide_cdrom_driver = {
	.end_request		= ide_end_request,
	.error			= __ide_error,
#ifdef CONFIG_IDE_PROC_FS
	.proc			= idecd_proc,
	.settings		= idecd_settings,
	.proc_entries		= ide_cd_proc_entries,
	.proc_devsets		= ide_cd_proc_devsets,
#endif
};

Loading