Cleaned up AMD Au1200 IDE driver:
- converted to platform bus
- removed pci dependencies
- removed virt_to_phys/phys_to_virt calls
    
System now can root off of a disk.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/AU1xxx_IDE.README
new file mode 100644
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8746e1b..dc5c629 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -799,7 +799,7 @@
 config MIPS_DB1200
 	bool "AMD Alchemy DB1200 board"
 	select SOC_AU1200
-	select DMA_NONCOHERENT
+	select DMA_COHERENT
 	select MIPS_DISABLE_OBSOLETE_IDE
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 
diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c
index 8f78c2f..eb5803a 100644
--- a/arch/mips/au1000/common/dbdma.c
+++ b/arch/mips/au1000/common/dbdma.c
@@ -197,6 +197,12 @@
 	return NULL;
 }
 
+void * au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp)
+{
+        return phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
+}
+EXPORT_SYMBOL(au1xxx_ddma_get_nextptr_virt);
+
 u32
 au1xxx_ddma_add_device(dbdev_tab_t *dev)
 {
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c
index 0c3fd72..4aca18f 100644
--- a/arch/mips/au1000/common/platform.c
+++ b/arch/mips/au1000/common/platform.c
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/resource.h>
 
-#include <asm/mach-au1x00/au1000.h>
+#include <asm/mach-au1x00/au1xxx.h>
 
 /* OHCI (USB full speed host controller) */
 static struct resource au1xxx_usb_ohci_resources[] = {
@@ -154,7 +154,6 @@
 	.resource	= au1xxx_usb_otg_resources,
 };
 
-/*** AU1200 LCD controller ***/
 static struct resource au1200_lcd_resources[] = {
 	[0] = {
 		.start          = LCD_PHYS_ADDR,
@@ -168,6 +167,19 @@
 	}
 };
 
+static struct resource au1200_ide0_resources[] = {
+	[0] = {
+		.start		= AU1XXX_ATA_PHYS_ADDR,
+		.end 		= AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= AU1XXX_ATA_INT,
+		.end		= AU1XXX_ATA_INT,
+		.flags		= IORESOURCE_IRQ,
+	}
+};
+
 static u64 au1200_lcd_dmamask = ~(u32)0;
 
 static struct platform_device au1200_lcd_device = {
@@ -180,6 +192,21 @@
 	.num_resources  = ARRAY_SIZE(au1200_lcd_resources),
 	.resource       = au1200_lcd_resources,
 };
+
+
+static u64 ide0_dmamask = ~(u32)0;
+
+static struct platform_device au1200_ide0_device = {
+	.name		= "au1200-ide",
+	.id		= 0,
+	.dev = {
+		.dma_mask 		= &ide0_dmamask,
+		.coherent_dma_mask	= 0xffffffff,
+	},
+	.num_resources = ARRAY_SIZE(au1200_ide0_resources),
+	.resource	= au1200_ide0_resources,
+};
+
 #endif
 
 static struct platform_device *au1xxx_platform_devices[] __initdata = {
@@ -194,6 +221,7 @@
 	&au1xxx_usb_gdt_device,
 	&au1xxx_usb_otg_device,
 	&au1200_lcd_device,
+	&au1200_ide0_device,
 #endif
 };
 
diff --git a/arch/mips/au1000/pb1200/irqmap.c b/arch/mips/au1000/pb1200/irqmap.c
index 2ec64e7..59e70e5 100644
--- a/arch/mips/au1000/pb1200/irqmap.c
+++ b/arch/mips/au1000/pb1200/irqmap.c
@@ -22,6 +22,7 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/irq.h>
@@ -65,7 +66,7 @@
  */
 static volatile int pb1200_cascade_en=0;
 
-void pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned short bisr = bcsr->int_status;
 	int extirq_nr = 0;
@@ -78,6 +79,7 @@
 		/* Ack and dispatch IRQ */
 		do_IRQ(extirq_nr,regs);
 	}
+	return IRQ_RETVAL(1);
 }
 
 inline void pb1200_enable_irq(unsigned int irq_nr)
@@ -97,7 +99,7 @@
 	if (++pb1200_cascade_en == 1)
 	{
 		request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
-			0, "Pb1200 Cascade", &pb1200_cascade_handler );
+			0, "Pb1200 Cascade", (void *)&pb1200_cascade_handler );
 #ifdef CONFIG_MIPS_PB1200
     /* We have a problem with CPLD rev3. Enable a workaround */
 	if( ((bcsr->whoami & BCSR_WHOAMI_CPLD)>>4) <= 3)