summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schaeffer <daniel@dschaeffer.localdomain>2008-02-26 13:14:35 -0500
committerDaniel Schaeffer <daniel@dschaeffer.localdomain>2008-02-26 13:14:35 -0500
commit5618bf1def92acd00a72fb5e1da2fcfb11f83122 (patch)
treefd7f8b527ebef3f9e5a6372f03377442063e25e5
parenta8967d7592c081ea57adf5206412b1eea9a076a5 (diff)
Fixed MXC IDE compile bugs
-rw-r--r--arch/arm/configs/imx27ads_defconfig52
-rw-r--r--drivers/ide/arm/mxc_ide.c82
-rw-r--r--include/asm-arm/ide.h2
3 files changed, 66 insertions, 70 deletions
diff --git a/arch/arm/configs/imx27ads_defconfig b/arch/arm/configs/imx27ads_defconfig
index 63dd5cdf9014..1e6cb69830f4 100644
--- a/arch/arm/configs/imx27ads_defconfig
+++ b/arch/arm/configs/imx27ads_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.24
-# Thu Feb 14 14:03:37 2008
+# Tue Feb 19 12:19:19 2008
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -216,7 +216,7 @@ CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_PREEMPT=y
CONFIG_HZ=100
CONFIG_AEABI=y
-CONFIG_OABI_COMPAT=y
+# CONFIG_OABI_COMPAT is not set
# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
@@ -250,8 +250,6 @@ CONFIG_CMDLINE="noinitrd console=ttymxc0 root=/dev/mtdblock2 rw ip=off"
#
# At least one emulation must be selected
#
-# CONFIG_FPE_NWFPE is not set
-# CONFIG_FPE_FASTFPE is not set
# CONFIG_VFP is not set
#
@@ -540,7 +538,47 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
# CONFIG_ATA_OVER_ETH is not set
CONFIG_MISC_DEVICES=y
# CONFIG_EEPROM_93CX6 is not set
-# CONFIG_IDE is not set
+CONFIG_IDE=m
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=m
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=m
+# CONFIG_BLK_DEV_PLATFORM is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDE_MXC=m
+
+#
+# Other IDE chipsets support
+#
+
+#
+# Note: most of these also require special kernel boot parameters
+#
+# CONFIG_BLK_DEV_4DRIVES is not set
+# CONFIG_BLK_DEV_ALI14XX is not set
+# CONFIG_BLK_DEV_DTC2278 is not set
+# CONFIG_BLK_DEV_HT6560B is not set
+# CONFIG_BLK_DEV_QD65XX is not set
+# CONFIG_BLK_DEV_UMC8672 is not set
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD is not set
#
# SCSI device support
@@ -978,8 +1016,8 @@ CONFIG_FONT_8x16=y
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LOGO_LINUX_CLUT224 is not set
-# CONFIG_LOGO_MX27ADS_CLUT224 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_LOGO_MX27ADS_CLUT224=y
CONFIG_LOGO_TS_CLUT224=y
#
diff --git a/drivers/ide/arm/mxc_ide.c b/drivers/ide/arm/mxc_ide.c
index 02216dd21ad2..2a3c2c188f80 100644
--- a/drivers/ide/arm/mxc_ide.c
+++ b/drivers/ide/arm/mxc_ide.c
@@ -49,7 +49,7 @@
extern void gpio_ata_active(void);
extern void gpio_ata_inactive(void);
-static int mxc_ide_config_drive(ide_drive_t * drive, u8 xfer_mode);
+static void mxc_ide_config_drive(ide_drive_t * drive, u8 xfer_mode);
static void mxc_ide_dma_callback(void *arg, int error, unsigned int count);
static struct clk *ata_clk;
@@ -253,11 +253,12 @@ static void mxc_ide_selectproc(ide_drive_t * drive)
* @param drive Specifies the drive
* @param pio Specifies the PIO mode number desired
*/
-static void mxc_ide_tune(ide_drive_t * drive, u8 pio)
+static void mxc_ide_set_pio_mode(ide_drive_t * drive, u8 pio)
{
- set_ata_bus_timing(pio, PIO);
+ set_ata_bus_timing(pio, PIO);
}
+
/*!
* Hardware-specific interrupt service routine for the ATA driver,
* called mainly just to dismiss the interrupt at the hardware, and
@@ -293,9 +294,9 @@ static int mxc_ide_ack_intr(struct hwif_s *hw)
*
* @param xfer_mode Specifies the desired transfer mode
*
- * @return EINVAL Illegal mode specified
*/
-static int mxc_ide_set_speed(ide_drive_t * drive, u8 xfer_mode)
+#warning Revisit
+static void mxc_ide_set_dma_mode(ide_drive_t * drive, const u8 xfer_mode)
{
mxc_ide_private_t *priv = (mxc_ide_private_t *) HWIF(drive)->hwif_data;
@@ -309,24 +310,24 @@ static int mxc_ide_set_speed(ide_drive_t * drive, u8 xfer_mode)
case XFER_UDMA_1:
case XFER_UDMA_0:
priv->ultra = 1;
- return set_ata_bus_timing(xfer_mode - XFER_UDMA_0, UDMA);
+ set_ata_bus_timing(xfer_mode - XFER_UDMA_0, UDMA);
break;
case XFER_MW_DMA_2:
case XFER_MW_DMA_1:
case XFER_MW_DMA_0:
priv->ultra = 0;
- return set_ata_bus_timing(xfer_mode - XFER_MW_DMA_0, MDMA);
+ set_ata_bus_timing(xfer_mode - XFER_MW_DMA_0, MDMA);
break;
case XFER_PIO_4:
case XFER_PIO_3:
case XFER_PIO_2:
case XFER_PIO_1:
case XFER_PIO_0:
- return set_ata_bus_timing(xfer_mode - XFER_PIO_0, PIO);
+ set_ata_bus_timing(xfer_mode - XFER_PIO_0, PIO);
break;
}
- return -EINVAL;
+ return;
}
/*!
@@ -385,39 +386,6 @@ static int mxc_ide_dma_on(ide_drive_t * drive)
return 0;
}
-/*!
- * Turn on DMA if the drive can handle it.
- *
- * @param drive Specifies the drive
- *
- * @return 0 if successful
- */
-static int mxc_ide_dma_check(ide_drive_t * drive)
-{
- struct hd_driveid *id = drive->id;
- if (id && (id->capability & 1)) {
- /*
- * Enable DMA on any drive that has
- * UltraDMA (mode 0/1/2/3/4/5/6) enabled
- */
- if ((id->field_valid & 4) && ((id->dma_ultra >> 8) & 0x7f))
- return HWIF(drive)->ide_dma_on(drive);
- /*
- * Enable DMA on any drive that has mode2 DMA
- * (multi or single) enabled
- */
- if (id->field_valid & 2) /* regular DMA */
- if ((id->dma_mword & 0x404) == 0x404 ||
- (id->dma_1word & 0x404) == 0x404)
- return HWIF(drive)->ide_dma_on(drive);
-
- /* Consult the list of known "good" drives */
- if (__ide_dma_good_drive(drive))
- return HWIF(drive)->ide_dma_on(drive);
- }
- HWIF(drive)->dma_off_quietly(drive);
- return 0;
-}
/*!
* The DMA is done, and the drive is done. We'll check the BD array for
@@ -516,14 +484,13 @@ static void mxc_ide_set_intrq(ide_hwif_t * hwif, intrq_which_t which)
*
* @return 0 = success, non-zero otherwise
*/
-static int mxc_ide_config_drive(ide_drive_t * drive, u8 xfer_mode)
+static void mxc_ide_config_drive(ide_drive_t * drive, u8 xfer_mode)
{
- int err;
- ide_hwif_t *hwif = HWIF(drive);
+ ide_hwif_t *hwif = HWIF(drive);
mxc_ide_private_t *priv = (mxc_ide_private_t *) (hwif->hwif_data);
u8 prev = priv->enable;
- mxc_ide_set_speed(drive, xfer_mode);
+ mxc_ide_set_dma_mode(drive, xfer_mode);
/*
* Work around an ADS hardware bug:
@@ -543,8 +510,6 @@ static int mxc_ide_config_drive(ide_drive_t * drive, u8 xfer_mode)
priv->enable = 0;
ATA_RAW_WRITE(0, MXC_IDE_INTR_ENABLE);
- err = ide_config_drive_speed(drive, xfer_mode);
-
if (ATA_RAW_READ(MXC_IDE_INTR_PENDING) &
(MXC_IDE_INTR_ATA_INTRQ2 | MXC_IDE_INTR_ATA_INTRQ1)) {
/*
@@ -563,8 +528,6 @@ static int mxc_ide_config_drive(ide_drive_t * drive, u8 xfer_mode)
priv->enable = prev;
ATA_RAW_WRITE(prev, MXC_IDE_INTR_ENABLE);
-
- return err;
}
/*!
@@ -856,10 +819,13 @@ static void mxc_ide_dma_init(ide_hwif_t * hwif)
hwif->dmatable_cpu = NULL;
hwif->dmatable_dma = 0;
- hwif->speedproc = mxc_ide_set_speed;
- hwif->resetproc = mxc_ide_resetproc;
- hwif->autodma = 0;
+ hwif->set_dma_mode = &mxc_ide_set_dma_mode;
+ hwif->set_pio_mode = &mxc_ide_set_pio_mode;
+
+ // hwif->speedproc = mxc_ide_set_speed;
+ hwif->resetproc = mxc_ide_resetproc;
+
/*
* Allocate and setup the DMA channels
*/
@@ -885,7 +851,6 @@ static void mxc_ide_dma_init(ide_hwif_t * hwif)
/*
* All ready now
*/
- hwif->atapi_dma = 1;
hwif->ultra_mask = 0x7f;
hwif->mwdma_mask = 0x07;
hwif->swdma_mask = 0x07;
@@ -897,7 +862,6 @@ static void mxc_ide_dma_init(ide_hwif_t * hwif)
hwif->dma_off_quietly = mxc_ide_dma_off_quietly;
hwif->ide_dma_on = mxc_ide_dma_on;
- hwif->ide_dma_check = mxc_ide_dma_check;
hwif->dma_setup = mxc_ide_dma_setup;
hwif->dma_exec_cmd = mxc_ide_dma_exec_cmd;
hwif->dma_start = mxc_ide_dma_start;
@@ -912,7 +876,6 @@ static void mxc_ide_dma_init(ide_hwif_t * hwif)
return;
err_out:
- hwif->atapi_dma = 0;
if (priv->dma_read_chan >= 0)
mxc_dma_free(priv->dma_read_chan);
if (priv->dma_write_chan >= 0)
@@ -960,10 +923,9 @@ mxc_ide_register(unsigned long base, unsigned int aux, int irq,
hw.ack_intr = &mxc_ide_ack_intr;
*hwifp = hwif;
- ide_register_hw(&hw, 0, hwifp);
+ ide_register_hw(&hw, NULL, 0, hwifp);
hwif->selectproc = &mxc_ide_selectproc;
- hwif->tuneproc = &mxc_ide_tune;
hwif->maskproc = &mxc_ide_maskproc;
hwif->hwif_data = (void *)priv;
mxc_ide_set_intrq(hwif, INTRQ_MCU);
@@ -984,10 +946,6 @@ mxc_ide_register(unsigned long base, unsigned int aux, int irq,
mxc_ide_dma_init(hwif);
- for (i = 0; i < MAX_DRIVES; i++) {
- mxc_ide_dma_check(hwif->drives + i);
- }
-
return 0;
}
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index 2cbe806ce442..c96814017199 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -32,7 +32,7 @@
#ifdef CONFIG_ARCH_MXC
#define IDE_ARCH_ACK_INTR
-#define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
+#define ide_ack_intr(hwif) ((hwif)->ack_intr(hwif))
#endif /* CONFIG_ARCH_MXC */
#endif /* __KERNEL__ */