[RFC] pata_platform for ARM RiscPC

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Russell King
Date: Friday, March 30, 2007 - 4:08 am

Add pata_platform device for RiscPC, thereby converting the primary
IDE channel on the machine to PATA.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---

Since this is dependent on the previous patch (to avoid build errors)
this needs to wait until the devm_ioport patch is merged.  I'll
therefore push this through the ARM tree at the appropriate time.

 arch/arm/mach-rpc/riscpc.c |   35 +++++++++++++++++++++++++++++++++++
 drivers/ata/Kconfig        |    2 +-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 208a2b5..711a2db 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -17,6 +17,7 @@
 #include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/serial_8250.h>
+#include <linux/pata_platform.h>
 
 #include <asm/elf.h>
 #include <asm/io.h>
@@ -159,11 +160,45 @@ static struct plat_serial8250_port serial_platform_data[] = {
 	},
 };
 
+static struct pata_platform_info pata_platform_data = {
+	.ioport_shift		= 2,
+};
+
+static struct resource pata_resources[] = {
+	[0] = {
+		.start		= 0x030107c0,
+		.end		= 0x030107df,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= 0x03010fd8,
+		.end		= 0x03010fdb,
+		.flags		= IORESOURCE_MEM,
+	},
+	[2] = {
+		.start		= IRQ_HARDDISK,
+		.end		= IRQ_HARDDISK,
+		.flags		= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device pata_device = {
+	.name			= "pata_platform",
+	.id			= -1,
+	.num_resources		= ARRAY_SIZE(pata_resources),
+	.resource		= pata_resources,
+	.dev			= {
+		.platform_data	= &pata_platform_data,
+		.coherent_dma_mask = ~0,	/* grumble */
+	},
+};
+
 static struct platform_device *devs[] __initdata = {
 	&iomd_device,
 	&kbd_device,
 	&serial_device,
 	&acornfb_device,
+	&pata_device,
 };
 
 static int __init rpc_init(void)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index d16b5b0..d8a9758 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -545,7 +545,7 @@ config PATA_WINBOND_VLB
 
 config PATA_PLATFORM
 	tristate "Generic platform device PATA support"
-	depends on EMBEDDED
+	depends on EMBEDDED || ARCH_RPC
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Provide dummy devm_ioport_* if !HAS_IOPORT, Russell King, (Fri Mar 30, 4:00 am)
[RFC] pata_platform for ARM RiscPC, Russell King, (Fri Mar 30, 4:08 am)
Re: [PATCH] Provide dummy devm_ioport_* if !HAS_IOPORT, Christoph Hellwig, (Fri Mar 30, 4:08 am)
Re: [RFC] pata_icside driver, Russell King, (Sun Apr 8, 3:18 am)
Re: [RFC] pata_icside driver, Alan Cox, (Sun Apr 8, 11:59 am)
Re: [RFC] pata_icside driver, Alan Cox, (Sun Apr 8, 1:09 pm)
Re: [RFC] pata_icside driver, Jeff Garzik, (Sun Apr 8, 6:03 pm)
Re: [RFC] pata_icside driver, Russell King, (Mon Apr 9, 1:18 am)
Re: [RFC] pata_icside driver, Roland Dreier, (Mon Apr 9, 1:24 am)
Re: [RFC] pata_icside driver, Russell King, (Mon Apr 9, 1:44 am)
Re: [RFC] pata_icside driver, Alan Cox, (Mon Apr 9, 2:56 am)
Re: [RFC] pata_icside driver, Alan Cox, (Mon Apr 9, 3:25 am)
Re: [RFC] pata_icside driver, Jeff Garzik, (Mon Apr 9, 3:56 am)
Re: [RFC] pata_icside driver, Jeff Garzik, (Mon Apr 9, 4:13 am)
Re: [RFC] pata_platform for ARM RiscPC, Jeff Garzik, (Mon Apr 9, 4:32 am)
Re: [RFC] pata_icside driver, Russell King, (Mon Apr 9, 4:33 am)
Re: [RFC] pata_icside driver, Russell King, (Mon Apr 9, 4:36 am)
Re: [RFC] pata_icside driver, Jeff Garzik, (Mon Apr 9, 5:02 am)
Re: [RFC] pata_icside driver, Russell King, (Sat Apr 21, 8:09 am)