sh: mach-sh03: Move off of cf_enabler to pata_platform, as per landisk.
[linux-2.6/mini2440.git] / arch / sh / boards / mach-sh03 / setup.c
blob0d0b37f9fea4a6d2fc8614c1938c5c2eac274eed
1 /*
2 * linux/arch/sh/boards/sh03/setup.c
4 * Copyright (C) 2004 Interface Co.,Ltd. Saito.K
6 */
8 #include <linux/init.h>
9 #include <linux/irq.h>
10 #include <linux/pci.h>
11 #include <linux/platform_device.h>
12 #include <linux/ata_platform.h>
13 #include <asm/io.h>
14 #include <asm/rtc.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)
26 if (PXSEG(port))
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",
44 .id = -1,
45 .num_resources = ARRAY_SIZE(cf_ide_resources),
46 .resource = cf_ide_resources,
49 static struct resource heartbeat_resources[] = {
50 [0] = {
51 .start = 0xa0800000,
52 .end = 0xa0800000,
53 .flags = IORESOURCE_MEM,
57 static struct platform_device heartbeat_device = {
58 .name = "heartbeat",
59 .id = -1,
60 .num_resources = ARRAY_SIZE(heartbeat_resources),
61 .resource = heartbeat_resources,
64 static struct platform_device *sh03_devices[] __initdata = {
65 &heartbeat_device,
66 &cf_ide_device,
69 static int __init sh03_devices_setup(void)
71 pgprot_t prot;
72 unsigned long paddrbase;
73 void *cf_ide_base;
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);
79 if (!cf_ide_base) {
80 printk("allocate_cf_area : can't open CF I/O window!\n");
81 return -ENOMEM;
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,
101 .mv_nr_irqs = 48,
102 .mv_ioport_map = sh03_ioport_map,
103 .mv_init_irq = init_sh03_IRQ,