1 /* linux/arch/arm/mach-s3c2410/bast-ide.c
3 * Copyright 2007 Simtec Electronics
4 * http://www.simtec.co.uk/products/EB2410ITX/
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/types.h>
15 #include <linux/init.h>
16 #include <linux/interrupt.h>
18 #include <linux/platform_device.h>
19 #include <linux/ata_platform.h>
21 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/map.h>
25 #include <asm/mach/irq.h>
28 #include <mach/bast-map.h>
29 #include <mach/bast-irq.h>
33 static struct pata_platform_info bast_ide_platdata
= {
37 #define IDE_CS S3C2410_CS5
39 static struct resource bast_ide0_resource
[] = {
41 .start
= IDE_CS
+ BAST_PA_IDEPRI
,
42 .end
= IDE_CS
+ BAST_PA_IDEPRI
+ (8 * 0x20) - 1,
43 .flags
= IORESOURCE_MEM
,
46 .start
= IDE_CS
+ BAST_PA_IDEPRIAUX
+ (6 * 0x20) ,
47 .end
= IDE_CS
+ BAST_PA_IDEPRIAUX
+ (7 * 0x20) - 1,
48 .flags
= IORESOURCE_MEM
,
53 .flags
= IORESOURCE_IRQ
,
57 static struct platform_device bast_device_ide0
= {
58 .name
= "pata_platform",
60 .num_resources
= ARRAY_SIZE(bast_ide0_resource
),
61 .resource
= bast_ide0_resource
,
63 .platform_data
= &bast_ide_platdata
,
64 .coherent_dma_mask
= ~0,
69 static struct resource bast_ide1_resource
[] = {
71 .start
= IDE_CS
+ BAST_PA_IDESEC
,
72 .end
= IDE_CS
+ BAST_PA_IDESEC
+ (8 * 0x20) - 1,
73 .flags
= IORESOURCE_MEM
,
76 .start
= IDE_CS
+ BAST_PA_IDESECAUX
+ (6 * 0x20),
77 .end
= IDE_CS
+ BAST_PA_IDESECAUX
+ (7 * 0x20) - 1,
78 .flags
= IORESOURCE_MEM
,
83 .flags
= IORESOURCE_IRQ
,
87 static struct platform_device bast_device_ide1
= {
88 .name
= "pata_platform",
90 .num_resources
= ARRAY_SIZE(bast_ide1_resource
),
91 .resource
= bast_ide1_resource
,
93 .platform_data
= &bast_ide_platdata
,
94 .coherent_dma_mask
= ~0,
98 static struct platform_device
*bast_ide_devices
[] __initdata
= {
103 static __init
int bast_ide_init(void)
105 if (machine_is_bast() || machine_is_vr1000())
106 return platform_add_devices(bast_ide_devices
,
107 ARRAY_SIZE(bast_ide_devices
));
112 fs_initcall(bast_ide_init
);