From d4f07ae748539d792162a9aa56f192c3992cb3fb Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Thu, 18 Aug 2011 11:11:58 +0200 Subject: MIPS, IDE: Alchem, au1xxx-ide: Remove pb1200/db1200 header dep au1xxx-ide uses defines from the pb1200/db1200 headers: get DBDMA ID through platform resource information, hardcode register spacing. The only 2 users of this driver (and the only boards it can really work on realiably) use the same register layout. Signed-off-by: Manuel Lauss Cc: linux-ide@vger.kernel.org To: Linux-MIPS Cc: linux-ide@vger.kernel.org Acked-by: David S. Miller Patchwork: https://patchwork.linux-mips.org/patch/2716/ Signed-off-by: Ralf Baechle --- drivers/ide/au1xxx-ide.c | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c index b26c234..c778373 100644 --- a/drivers/ide/au1xxx-ide.c +++ b/drivers/ide/au1xxx-ide.c @@ -43,6 +43,10 @@ #define DRV_NAME "au1200-ide" #define DRV_AUTHOR "Enrico Walther / Pete Popov " +#ifndef IDE_REG_SHIFT +#define IDE_REG_SHIFT 5 +#endif + /* enable the burstmode in the dbdma */ #define IDE_AU1XXX_BURSTMODE 1 @@ -317,10 +321,11 @@ static void auide_ddma_rx_callback(int irq, void *param) } #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ -static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags) +static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, + u32 devwidth, u32 flags, u32 regbase) { dev->dev_id = dev_id; - dev->dev_physaddr = (u32)IDE_PHYS_ADDR; + dev->dev_physaddr = CPHYSADDR(regbase); dev->dev_intlevel = 0; dev->dev_intpolarity = 0; dev->dev_tsize = tsize; @@ -344,7 +349,7 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) dbdev_tab_t source_dev_tab, target_dev_tab; u32 dev_id, tsize, devwidth, flags; - dev_id = IDE_DDMA_REQ; + dev_id = hwif->ddma_id; tsize = 8; /* 1 */ devwidth = 32; /* 16 */ @@ -356,20 +361,17 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) #endif /* setup dev_tab for tx channel */ - auide_init_dbdma_dev( &source_dev_tab, - dev_id, - tsize, devwidth, DEV_FLAGS_OUT | flags); + auide_init_dbdma_dev(&source_dev_tab, dev_id, tsize, devwidth, + DEV_FLAGS_OUT | flags, auide->regbase); auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); - auide_init_dbdma_dev( &source_dev_tab, - dev_id, - tsize, devwidth, DEV_FLAGS_IN | flags); + auide_init_dbdma_dev(&source_dev_tab, dev_id, tsize, devwidth, + DEV_FLAGS_IN | flags, auide->regbase); auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); /* We also need to add a target device for the DMA */ - auide_init_dbdma_dev( &target_dev_tab, - (u32)DSCR_CMD0_ALWAYS, - tsize, devwidth, DEV_FLAGS_ANYUSE); + auide_init_dbdma_dev(&target_dev_tab, (u32)DSCR_CMD0_ALWAYS, tsize, + devwidth, DEV_FLAGS_ANYUSE, auide->regbase); auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab); /* Get a channel for TX */ @@ -411,14 +413,12 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) #endif /* setup dev_tab for tx channel */ - auide_init_dbdma_dev( &source_dev_tab, - (u32)DSCR_CMD0_ALWAYS, - 8, 32, DEV_FLAGS_OUT | flags); + auide_init_dbdma_dev(&source_dev_tab, (u32)DSCR_CMD0_ALWAYS, 8, 32, + DEV_FLAGS_OUT | flags, auide->regbase); auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); - auide_init_dbdma_dev( &source_dev_tab, - (u32)DSCR_CMD0_ALWAYS, - 8, 32, DEV_FLAGS_IN | flags); + auide_init_dbdma_dev(&source_dev_tab, (u32)DSCR_CMD0_ALWAYS, 8, 32, + DEV_FLAGS_IN | flags, auide->regbase); auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); /* Get a channel for TX */ @@ -540,6 +540,14 @@ static int au_ide_probe(struct platform_device *dev) goto out; } + res = platform_get_resource(dev, IORESOURCE_DMA, 0); + if (!res) { + pr_debug("%s: no DDMA ID resource\n", DRV_NAME); + ret = -ENODEV; + goto out; + } + ahwif->ddma_id = res->start; + memset(&hw, 0, sizeof(hw)); auide_setup_ports(&hw, ahwif); hw.irq = ahwif->irq; -- cgit v1.1 From 50d5676ebac57c187ac347bae24290f0dc16fdbe Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Fri, 12 Aug 2011 11:39:43 +0200 Subject: MIPS: Alchemy: kill au1xxx.h header No longer required Signed-off-by: Manuel Lauss To: Linux-MIPS Patchwork: https://patchwork.linux-mips.org/patch/2705/ Signed-off-by: Ralf Baechle delete mode 100644 arch/mips/include/asm/mach-au1x00/au1xxx.h --- drivers/ide/au1xxx-ide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ide') diff --git a/drivers/ide/au1xxx-ide.c b/drivers/ide/au1xxx-ide.c index c778373..259786c 100644 --- a/drivers/ide/au1xxx-ide.c +++ b/drivers/ide/au1xxx-ide.c @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include -- cgit v1.1 From 3766386037827fe7064f57f9aec27b3b5e9417aa Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Fri, 12 Aug 2011 11:39:45 +0200 Subject: MIPS: Alchemy: remove all CONFIG_SOC_AU1??? defines Now that no driver any longer depends on the CONFIG_SOC_AU1??? symbols, it's time to get rid of them: Move some of the platform devices to the boards which can use them, Rename a few (unused) constants in the header, Replace them with MIPS_ALCHEMY in the various Kconfig files. Finally delete them altogether from the Alchemy Kconfig file. Signed-off-by: Manuel Lauss To: Linux-MIPS Patchwork: https://patchwork.linux-mips.org/patch/2707/ Signed-off-by: Ralf Baechle --- drivers/ide/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 811dbbd..ff7c6bb 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig @@ -677,19 +677,19 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST config BLK_DEV_IDE_AU1XXX bool "IDE for AMD Alchemy Au1200" - depends on SOC_AU1200 + depends on MIPS_ALCHEMY select IDE_XFER_MODE choice prompt "IDE Mode for AMD Alchemy Au1200" default CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX + depends on BLK_DEV_IDE_AU1XXX config BLK_DEV_IDE_AU1XXX_PIO_DBDMA bool "PIO+DbDMA IDE for AMD Alchemy Au1200" config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA bool "MDMA2+DbDMA IDE for AMD Alchemy Au1200" - depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX + depends on BLK_DEV_IDE_AU1XXX endchoice config BLK_DEV_IDE_TX4938 -- cgit v1.1 From 38789fda295689689d064c0157bc363b1837b5e6 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sun, 17 Jul 2011 15:33:58 -0400 Subject: ide/ata: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed They were getting this implicitly by an include of module.h from device.h -- but we are going to clean that up and break that include chain, so include export.h explicitly now. Signed-off-by: Paul Gortmaker --- drivers/ide/ide-atapi.c | 1 + drivers/ide/ide-disk_proc.c | 1 + drivers/ide/ide-dma-sff.c | 1 + drivers/ide/ide-dma.c | 1 + drivers/ide/ide-eh.c | 1 + drivers/ide/ide-floppy_proc.c | 1 + drivers/ide/ide-io-std.c | 1 + drivers/ide/ide-ioctls.c | 1 + drivers/ide/ide-legacy.c | 1 + drivers/ide/ide-lib.c | 1 + drivers/ide/ide-taskfile.c | 1 + drivers/ide/ide-xfer-mode.c | 1 + drivers/ide/setup-pci.c | 1 + 13 files changed, 13 insertions(+) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 6f218e01..fac3d9d 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ide/ide-disk_proc.c b/drivers/ide/ide-disk_proc.c index f9bbd90..8b570a1 100644 --- a/drivers/ide/ide-disk_proc.c +++ b/drivers/ide/ide-disk_proc.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include "ide-disk.h" diff --git a/drivers/ide/ide-dma-sff.c b/drivers/ide/ide-dma-sff.c index e4cdf78..289d16c 100644 --- a/drivers/ide/ide-dma-sff.c +++ b/drivers/ide/ide-dma-sff.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index d413690..17a65ac 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c index c0aa93f..3297066 100644 --- a/drivers/ide/ide-eh.c +++ b/drivers/ide/ide-eh.c @@ -1,5 +1,6 @@ #include +#include #include #include diff --git a/drivers/ide/ide-floppy_proc.c b/drivers/ide/ide-floppy_proc.c index d711d9b..1600720 100644 --- a/drivers/ide/ide-floppy_proc.c +++ b/drivers/ide/ide-floppy_proc.c @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/drivers/ide/ide-io-std.c b/drivers/ide/ide-io-std.c index 46721c4..1976397 100644 --- a/drivers/ide/ide-io-std.c +++ b/drivers/ide/ide-io-std.c @@ -1,5 +1,6 @@ #include +#include #include #if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \ diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c index 9965ecd..4d19eb9 100644 --- a/drivers/ide/ide-ioctls.c +++ b/drivers/ide/ide-ioctls.c @@ -2,6 +2,7 @@ * IDE ioctls handling. */ +#include #include #include #include diff --git a/drivers/ide/ide-legacy.c b/drivers/ide/ide-legacy.c index b9654a7..30fe363 100644 --- a/drivers/ide/ide-legacy.c +++ b/drivers/ide/ide-legacy.c @@ -1,4 +1,5 @@ #include +#include #include static void ide_legacy_init_one(struct ide_hw **hws, struct ide_hw *hw, diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index e386a32..d9c9829 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 600c89a..5bc2839 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ide/ide-xfer-mode.c b/drivers/ide/ide-xfer-mode.c index 5fc8d5c..eb42188 100644 --- a/drivers/ide/ide-xfer-mode.c +++ b/drivers/ide/ide-xfer-mode.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index ab3db61..34a5e52 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include -- cgit v1.1 From bff7832dd6670dd0e215ce32d60b18f3825a6555 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sun, 3 Jul 2011 13:41:29 -0400 Subject: ide/ata: Add module.h to the implicit modular users A pending cleanup will mean that module.h won't be implicitly everywhere anymore. Make sure the modular drivers in the ide dir are actually calling out for explicitly in advance. Signed-off-by: Paul Gortmaker --- drivers/ide/buddha.c | 1 + drivers/ide/cmd640.c | 1 + drivers/ide/ide-acpi.c | 1 + drivers/ide/ide-pnp.c | 1 + drivers/ide/macide.c | 1 + drivers/ide/pmac.c | 1 + drivers/ide/q40ide.c | 1 + drivers/ide/tc86c001.c | 1 + 8 files changed, 8 insertions(+) (limited to 'drivers/ide') diff --git a/drivers/ide/buddha.c b/drivers/ide/buddha.c index ab4f169..b1d3859 100644 --- a/drivers/ide/buddha.c +++ b/drivers/ide/buddha.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/drivers/ide/cmd640.c b/drivers/ide/cmd640.c index cb10201..a81bd75 100644 --- a/drivers/ide/cmd640.c +++ b/drivers/ide/cmd640.c @@ -105,6 +105,7 @@ #include #include #include +#include #include diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c index 2af8cb4..f22edc6 100644 --- a/drivers/ide/ide-acpi.c +++ b/drivers/ide/ide-acpi.c @@ -17,6 +17,7 @@ #include #include #include +#include #include diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index 017b1df..e5f3db8 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c @@ -17,6 +17,7 @@ #include #include #include +#include #define DRV_NAME "ide-pnp" diff --git a/drivers/ide/macide.c b/drivers/ide/macide.c index 505ec43..adc5fe9 100644 --- a/drivers/ide/macide.c +++ b/drivers/ide/macide.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index 1db7c43..e944c7f 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ide/q40ide.c b/drivers/ide/q40ide.c index 9078608..ecd0a69 100644 --- a/drivers/ide/q40ide.c +++ b/drivers/ide/q40ide.c @@ -15,6 +15,7 @@ #include #include #include +#include #include diff --git a/drivers/ide/tc86c001.c b/drivers/ide/tc86c001.c index e444d24..4799d5c 100644 --- a/drivers/ide/tc86c001.c +++ b/drivers/ide/tc86c001.c @@ -10,6 +10,7 @@ #include #include #include +#include #define DRV_NAME "tc86c001" -- cgit v1.1