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>
23 #include <mach/irqs.h>
29 static struct pata_platform_info bast_ide_platdata
= {
33 static struct resource bast_ide0_resource
[] = {
34 [0] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDEPRI
, 8 * 0x20),
35 [1] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDEPRIAUX
+ (6 * 0x20), 0x20),
36 [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE0
),
39 static struct platform_device bast_device_ide0
= {
40 .name
= "pata_platform",
42 .num_resources
= ARRAY_SIZE(bast_ide0_resource
),
43 .resource
= bast_ide0_resource
,
45 .platform_data
= &bast_ide_platdata
,
46 .coherent_dma_mask
= ~0,
51 static struct resource bast_ide1_resource
[] = {
52 [0] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDESEC
, 8 * 0x20),
53 [1] = DEFINE_RES_MEM(BAST_IDE_CS
+ BAST_PA_IDESECAUX
+ (6 * 0x20), 0x20),
54 [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE1
),
57 static struct platform_device bast_device_ide1
= {
58 .name
= "pata_platform",
60 .num_resources
= ARRAY_SIZE(bast_ide1_resource
),
61 .resource
= bast_ide1_resource
,
63 .platform_data
= &bast_ide_platdata
,
64 .coherent_dma_mask
= ~0,
68 static struct platform_device
*bast_ide_devices
[] __initdata
= {
73 static __init
int bast_ide_init(void)
75 if (machine_is_bast() || machine_is_vr1000())
76 return platform_add_devices(bast_ide_devices
,
77 ARRAY_SIZE(bast_ide_devices
));
82 fs_initcall(bast_ide_init
);