2 * linux/arch/sh/boards/sh03/setup.c
4 * Copyright (C) 2004 Interface Co.,Ltd. Saito.K
8 #include <linux/init.h>
10 #include <linux/pci.h>
11 #include <linux/platform_device.h>
12 #include <linux/ata_platform.h>
15 #include <mach-sh03/mach/io.h>
16 #include <mach-sh03/mach/sh03.h>
17 #include <asm/addrspace.h>
19 static void __init
init_sh03_IRQ(void)
21 plat_irq_setup_pins(IRQ_MODE_IRQ
);
24 /* arch/sh/boards/sh03/rtc.c */
25 void sh03_time_init(void);
27 static void __init
sh03_setup(char **cmdline_p
)
29 board_time_init
= sh03_time_init
;
32 static struct resource cf_ide_resources
[] = {
36 .flags
= IORESOURCE_IO
,
39 .start
= 0x1f0 + 0x206,
40 .end
= 0x1f0 +8 + 0x206 + 8,
41 .flags
= IORESOURCE_IO
,
45 .flags
= IORESOURCE_IRQ
,
49 static struct platform_device cf_ide_device
= {
50 .name
= "pata_platform",
52 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
53 .resource
= cf_ide_resources
,
56 static struct resource heartbeat_resources
[] = {
60 .flags
= IORESOURCE_MEM
,
64 static struct platform_device heartbeat_device
= {
67 .num_resources
= ARRAY_SIZE(heartbeat_resources
),
68 .resource
= heartbeat_resources
,
71 static struct platform_device
*sh03_devices
[] __initdata
= {
76 static int __init
sh03_devices_setup(void)
79 unsigned long paddrbase
;
82 /* open I/O area window */
83 paddrbase
= virt_to_phys((void *)PA_AREA5_IO
);
84 prot
= PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16
);
85 cf_ide_base
= ioremap_prot(paddrbase
, PAGE_SIZE
, pgprot_val(prot
));
87 printk("allocate_cf_area : can't open CF I/O window!\n");
91 /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
92 cf_ide_resources
[0].start
+= (unsigned long)cf_ide_base
;
93 cf_ide_resources
[0].end
+= (unsigned long)cf_ide_base
;
94 cf_ide_resources
[1].start
+= (unsigned long)cf_ide_base
;
95 cf_ide_resources
[1].end
+= (unsigned long)cf_ide_base
;
97 return platform_add_devices(sh03_devices
, ARRAY_SIZE(sh03_devices
));
99 device_initcall(sh03_devices_setup
);
101 static struct sh_machine_vector mv_sh03 __initmv
= {
102 .mv_name
= "Interface (CTP/PCI-SH03)",
103 .mv_setup
= sh03_setup
,
104 .mv_init_irq
= init_sh03_IRQ
,