2 * arch/sh/boards/landisk/setup.c
4 * I-O DATA Device, Inc. LANDISK Support.
6 * Copyright (C) 2000 Kazumoto Kojima
7 * Copyright (C) 2002 Paul Mundt
8 * Copylight (C) 2002 Atom Create Engineering Co., Ltd.
9 * Copyright (C) 2005-2007 kogiidena
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/ata_platform.h>
20 #include <asm/machvec.h>
21 #include <mach-landisk/mach/iodata_landisk.h>
24 static void landisk_power_off(void)
26 __raw_writeb(0x01, PA_SHUTDOWN
);
29 static struct resource cf_ide_resources
[3];
31 static struct pata_platform_info pata_info
= {
35 static struct platform_device cf_ide_device
= {
36 .name
= "pata_platform",
38 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
39 .resource
= cf_ide_resources
,
41 .platform_data
= &pata_info
,
45 static struct platform_device rtc_device
= {
50 static struct platform_device
*landisk_devices
[] __initdata
= {
55 static int __init
landisk_devices_setup(void)
58 unsigned long paddrbase
;
61 /* open I/O area window */
62 paddrbase
= virt_to_phys((void *)PA_AREA5_IO
);
63 prot
= PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16
);
64 cf_ide_base
= ioremap_prot(paddrbase
, PAGE_SIZE
, pgprot_val(prot
));
66 printk("allocate_cf_area : can't open CF I/O window!\n");
70 /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
71 cf_ide_resources
[0].start
= (unsigned long)cf_ide_base
+ 0x40;
72 cf_ide_resources
[0].end
= (unsigned long)cf_ide_base
+ 0x40 + 0x0f;
73 cf_ide_resources
[0].flags
= IORESOURCE_IO
;
74 cf_ide_resources
[1].start
= (unsigned long)cf_ide_base
+ 0x2c;
75 cf_ide_resources
[1].end
= (unsigned long)cf_ide_base
+ 0x2c + 0x03;
76 cf_ide_resources
[1].flags
= IORESOURCE_IO
;
77 cf_ide_resources
[2].start
= IRQ_FATA
;
78 cf_ide_resources
[2].flags
= IORESOURCE_IRQ
;
80 return platform_add_devices(landisk_devices
,
81 ARRAY_SIZE(landisk_devices
));
84 device_initcall(landisk_devices_setup
);
86 static void __init
landisk_setup(char **cmdline_p
)
89 __raw_writeb(__raw_readb(PA_LED
) | 0x03, PA_LED
);
91 printk(KERN_INFO
"I-O DATA DEVICE, INC. \"LANDISK Series\" support.\n");
92 pm_power_off
= landisk_power_off
;
98 static struct sh_machine_vector mv_landisk __initmv
= {
100 .mv_setup
= landisk_setup
,
101 .mv_init_irq
= init_landisk_IRQ
,