diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-12-16 22:48:41 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-12-22 04:44:45 -0500 |
commit | 8db806ec80ce80605005d1d558add716152a1134 (patch) | |
tree | 11198cd4f35164c0e6931a88e7723e02bbacfee0 /arch/sh/boards/mach-sh03 | |
parent | 98a955da8525a4218c8186fba5a6b949f563bbea (diff) |
sh: mach-sh03: Move off of cf_enabler to pata_platform, as per landisk.
This gets rid of the cf enabler use on mach-sh03 and switches to use
pata_platform with the proper address directly. cf_enabler is
subsequently disabled for mach-sh03.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-sh03')
-rw-r--r-- | arch/sh/boards/mach-sh03/setup.c | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c index 5771219be3fd..0d0b37f9fea4 100644 --- a/arch/sh/boards/mach-sh03/setup.c +++ b/arch/sh/boards/mach-sh03/setup.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/irq.h> | 9 | #include <linux/irq.h> |
10 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
12 | #include <linux/ata_platform.h> | ||
12 | #include <asm/io.h> | 13 | #include <asm/io.h> |
13 | #include <asm/rtc.h> | 14 | #include <asm/rtc.h> |
14 | #include <mach-sh03/mach/io.h> | 15 | #include <mach-sh03/mach/io.h> |
@@ -20,15 +21,10 @@ static void __init init_sh03_IRQ(void) | |||
20 | plat_irq_setup_pins(IRQ_MODE_IRQ); | 21 | plat_irq_setup_pins(IRQ_MODE_IRQ); |
21 | } | 22 | } |
22 | 23 | ||
23 | extern void *cf_io_base; | ||
24 | |||
25 | static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size) | 24 | static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size) |
26 | { | 25 | { |
27 | if (PXSEG(port)) | 26 | if (PXSEG(port)) |
28 | return (void __iomem *)port; | 27 | return (void __iomem *)port; |
29 | /* CompactFlash (IDE) */ | ||
30 | if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6)) | ||
31 | return (void __iomem *)((unsigned long)cf_io_base + port); | ||
32 | 28 | ||
33 | return (void __iomem *)(port + PCI_IO_BASE); | 29 | return (void __iomem *)(port + PCI_IO_BASE); |
34 | } | 30 | } |
@@ -41,6 +37,15 @@ static void __init sh03_setup(char **cmdline_p) | |||
41 | board_time_init = sh03_time_init; | 37 | board_time_init = sh03_time_init; |
42 | } | 38 | } |
43 | 39 | ||
40 | static struct resource cf_ide_resources[3]; | ||
41 | |||
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, | ||
47 | }; | ||
48 | |||
44 | static struct resource heartbeat_resources[] = { | 49 | static struct resource heartbeat_resources[] = { |
45 | [0] = { | 50 | [0] = { |
46 | .start = 0xa0800000, | 51 | .start = 0xa0800000, |
@@ -58,10 +63,34 @@ static struct platform_device heartbeat_device = { | |||
58 | 63 | ||
59 | static struct platform_device *sh03_devices[] __initdata = { | 64 | static struct platform_device *sh03_devices[] __initdata = { |
60 | &heartbeat_device, | 65 | &heartbeat_device, |
66 | &cf_ide_device, | ||
61 | }; | 67 | }; |
62 | 68 | ||
63 | static int __init sh03_devices_setup(void) | 69 | static int __init sh03_devices_setup(void) |
64 | { | 70 | { |
71 | pgprot_t prot; | ||
72 | unsigned long paddrbase; | ||
73 | void *cf_ide_base; | ||
74 | |||
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; | ||
82 | } | ||
83 | |||
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; | ||
93 | |||
65 | return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices)); | 94 | return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices)); |
66 | } | 95 | } |
67 | __initcall(sh03_devices_setup); | 96 | __initcall(sh03_devices_setup); |