Adding support for MOXA ART SoC. Testing port of linux-2.6.32.60-moxart.
[linux-3.6.7-moxart.git] / arch / arm / mach-s3c24xx / bast-ide.c
blobba02cf8d80a2168c244f8c15570edfda0ebb3e1a
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>
27 #include <mach/map.h>
28 #include <mach/bast-map.h>
29 #include <mach/bast-irq.h>
31 /* IDE ports */
33 static struct pata_platform_info bast_ide_platdata = {
34 .ioport_shift = 5,
37 #define IDE_CS S3C2410_CS5
39 static struct resource bast_ide0_resource[] = {
40 [0] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDEPRI, 8 * 0x20),
41 [1] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDEPRIAUX + (6 * 0x20), 0x20),
42 [2] = DEFINE_RES_IRQ(IRQ_IDE0),
45 static struct platform_device bast_device_ide0 = {
46 .name = "pata_platform",
47 .id = 0,
48 .num_resources = ARRAY_SIZE(bast_ide0_resource),
49 .resource = bast_ide0_resource,
50 .dev = {
51 .platform_data = &bast_ide_platdata,
52 .coherent_dma_mask = ~0,
57 static struct resource bast_ide1_resource[] = {
58 [0] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDESEC, 8 * 0x20),
59 [1] = DEFINE_RES_MEM(IDE_CS + BAST_PA_IDESECAUX + (6 * 0x20), 0x20),
60 [2] = DEFINE_RES_IRQ(IRQ_IDE1),
63 static struct platform_device bast_device_ide1 = {
64 .name = "pata_platform",
65 .id = 1,
66 .num_resources = ARRAY_SIZE(bast_ide1_resource),
67 .resource = bast_ide1_resource,
68 .dev = {
69 .platform_data = &bast_ide_platdata,
70 .coherent_dma_mask = ~0,
74 static struct platform_device *bast_ide_devices[] __initdata = {
75 &bast_device_ide0,
76 &bast_device_ide1,
79 static __init int bast_ide_init(void)
81 if (machine_is_bast() || machine_is_vr1000())
82 return platform_add_devices(bast_ide_devices,
83 ARRAY_SIZE(bast_ide_devices));
85 return 0;
88 fs_initcall(bast_ide_init);