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 static void __iomem
*sh03_ioport_map(unsigned long port
, unsigned int size
)
27 return (void __iomem
*)port
;
29 return (void __iomem
*)(port
+ PCI_IO_BASE
);
32 /* arch/sh/boards/sh03/rtc.c */
33 void sh03_time_init(void);
35 static void __init
sh03_setup(char **cmdline_p
)
37 board_time_init
= sh03_time_init
;
40 static struct resource cf_ide_resources
[3];
42 static struct platform_device cf_ide_device
= {
43 .name
= "pata_platform",
45 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
46 .resource
= cf_ide_resources
,
49 static struct resource heartbeat_resources
[] = {
53 .flags
= IORESOURCE_MEM
,
57 static struct platform_device heartbeat_device
= {
60 .num_resources
= ARRAY_SIZE(heartbeat_resources
),
61 .resource
= heartbeat_resources
,
64 static struct platform_device
*sh03_devices
[] __initdata
= {
69 static int __init
sh03_devices_setup(void)
72 unsigned long paddrbase
;
75 /* open I/O area window */
76 paddrbase
= virt_to_phys((void *)PA_AREA5_IO
);
77 prot
= PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16
);
78 cf_ide_base
= p3_ioremap(paddrbase
, PAGE_SIZE
, prot
.pgprot
);
80 printk("allocate_cf_area : can't open CF I/O window!\n");
84 /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
85 cf_ide_resources
[0].start
= (unsigned long)cf_ide_base
+ 0x40;
86 cf_ide_resources
[0].end
= (unsigned long)cf_ide_base
+ 0x40 + 0x0f;
87 cf_ide_resources
[0].flags
= IORESOURCE_IO
;
88 cf_ide_resources
[1].start
= (unsigned long)cf_ide_base
+ 0x2c;
89 cf_ide_resources
[1].end
= (unsigned long)cf_ide_base
+ 0x2c + 0x03;
90 cf_ide_resources
[1].flags
= IORESOURCE_IO
;
91 cf_ide_resources
[2].start
= IRQ_FATA
;
92 cf_ide_resources
[2].flags
= IORESOURCE_IRQ
;
94 return platform_add_devices(sh03_devices
, ARRAY_SIZE(sh03_devices
));
96 __initcall(sh03_devices_setup
);
98 static struct sh_machine_vector mv_sh03 __initmv
= {
99 .mv_name
= "Interface (CTP/PCI-SH03)",
100 .mv_setup
= sh03_setup
,
102 .mv_ioport_map
= sh03_ioport_map
,
103 .mv_init_irq
= init_sh03_IRQ
,