1 // SPDX-License-Identifier: GPL-2.0
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 #include <linux/kernel.h>
9 #include <linux/types.h>
10 #include <linux/init.h>
11 #include <linux/interrupt.h>
13 #include <linux/platform_device.h>
14 #include <linux/ata_platform.h>
16 #include <asm/mach-types.h>
18 #include <asm/mach/arch.h>
19 #include <asm/mach/map.h>
20 #include <asm/mach/irq.h>
28 static struct pata_platform_info bast_ide_platdata
= {
32 static struct resource bast_ide0_resource
[] = {
33 [0] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDEPRI
, 8 * 0x20),
34 [1] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDEPRIAUX
+ (6 * 0x20), 0x20),
35 [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE0
),
38 static struct platform_device bast_device_ide0
= {
39 .name
= "pata_platform",
41 .num_resources
= ARRAY_SIZE(bast_ide0_resource
),
42 .resource
= bast_ide0_resource
,
44 .platform_data
= &bast_ide_platdata
,
45 .coherent_dma_mask
= ~0,
50 static struct resource bast_ide1_resource
[] = {
51 [0] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDESEC
, 8 * 0x20),
52 [1] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDESECAUX
+ (6 * 0x20), 0x20),
53 [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE1
),
56 static struct platform_device bast_device_ide1
= {
57 .name
= "pata_platform",
59 .num_resources
= ARRAY_SIZE(bast_ide1_resource
),
60 .resource
= bast_ide1_resource
,
62 .platform_data
= &bast_ide_platdata
,
63 .coherent_dma_mask
= ~0,
67 static struct platform_device
*bast_ide_devices
[] __initdata
= {
72 static __init
int bast_ide_init(void)
74 if (machine_is_bast() || machine_is_vr1000())
75 return platform_add_devices(bast_ide_devices
,
76 ARRAY_SIZE(bast_ide_devices
));
81 fs_initcall(bast_ide_init
);