diff options
author | Kristoffer Ericson <Kristoffer_e1@hotmail.com> | 2007-04-09 18:45:08 -0400 |
---|---|---|
committer | Paul Mundt <lethal@hera.kernel.org> | 2007-05-06 22:11:56 -0400 |
commit | 34a780a0afeb8f99c9ca9934f4cc0822541769c6 (patch) | |
tree | 9afecb9b8af6b6b7e3160a3dacff70ab4eea438c /arch/sh/boards | |
parent | dd12666278daa0008ac439603c8d3037bc213556 (diff) |
sh: hp6xx pata_platform support.
Drop the hd64461 I/O ops and wire up pata_platform for MMIO.
Signed-off-by: Kristoffer Ericson <Kristoffer_e1@hotmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/hp6xx/setup.c | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/arch/sh/boards/hp6xx/setup.c b/arch/sh/boards/hp6xx/setup.c index b5a96649ed26..6aeee85c9785 100644 --- a/arch/sh/boards/hp6xx/setup.c +++ b/arch/sh/boards/hp6xx/setup.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/sh/boards/hp6xx/setup.c | 2 | * linux/arch/sh/boards/hp6xx/setup.c |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Andriy Skulysh | 4 | * Copyright (C) 2002 Andriy Skulysh |
5 | * Copyright (C) 2007 Kristoffer Ericson <Kristoffer_e1@hotmail.com> | ||
5 | * | 6 | * |
6 | * May be copied or modified under the terms of the GNU General Public | 7 | * May be copied or modified under the terms of the GNU General Public |
7 | * License. See linux/COPYING for more information. | 8 | * License. See linux/COPYING for more information. |
@@ -10,6 +11,7 @@ | |||
10 | */ | 11 | */ |
11 | #include <linux/types.h> | 12 | #include <linux/types.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/platform_device.h> | ||
13 | #include <asm/hd64461.h> | 15 | #include <asm/hd64461.h> |
14 | #include <asm/io.h> | 16 | #include <asm/io.h> |
15 | #include <asm/irq.h> | 17 | #include <asm/irq.h> |
@@ -19,6 +21,40 @@ | |||
19 | #define SCPCR 0xa4000116 | 21 | #define SCPCR 0xa4000116 |
20 | #define SCPDR 0xa4000136 | 22 | #define SCPDR 0xa4000136 |
21 | 23 | ||
24 | /* CF Slot */ | ||
25 | static struct resource cf_ide_resources[] = { | ||
26 | [0] = { | ||
27 | .start = 0x15000000 + 0x1f0, | ||
28 | .end = 0x15000000 + 0x1f0 + 0x08 - 0x01, | ||
29 | .flags = IORESOURCE_MEM, | ||
30 | }, | ||
31 | [1] = { | ||
32 | .start = 0x15000000 + 0x1fe, | ||
33 | .end = 0x15000000 + 0x1fe + 0x01, | ||
34 | .flags = IORESOURCE_MEM, | ||
35 | }, | ||
36 | [2] = { | ||
37 | .start = 93, | ||
38 | .flags = IORESOURCE_IRQ, | ||
39 | }, | ||
40 | }; | ||
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 | |||
49 | static struct platform_device *hp6xx_devices[] __initdata = { | ||
50 | &cf_ide_device, | ||
51 | }; | ||
52 | |||
53 | static int __init hp6xx_devices_setup(void) | ||
54 | { | ||
55 | return platform_add_devices(hp6xx_devices, ARRAY_SIZE(hp6xx_devices)); | ||
56 | } | ||
57 | |||
22 | static void __init hp6xx_setup(char **cmdline_p) | 58 | static void __init hp6xx_setup(char **cmdline_p) |
23 | { | 59 | { |
24 | u8 v8; | 60 | u8 v8; |
@@ -60,41 +96,12 @@ static void __init hp6xx_setup(char **cmdline_p) | |||
60 | v |= SCPCR_TS_ENABLE; | 96 | v |= SCPCR_TS_ENABLE; |
61 | ctrl_outw(v, SCPCR); | 97 | ctrl_outw(v, SCPCR); |
62 | } | 98 | } |
99 | device_initcall(hp6xx_devices_setup); | ||
63 | 100 | ||
64 | /* | ||
65 | * XXX: This is stupid, we should have a generic machine vector for the cchips | ||
66 | * and just wrap the platform setup code in to this, as it's the only thing | ||
67 | * that ends up being different. | ||
68 | */ | ||
69 | struct sh_machine_vector mv_hp6xx __initmv = { | 101 | struct sh_machine_vector mv_hp6xx __initmv = { |
70 | .mv_name = "hp6xx", | 102 | .mv_name = "hp6xx", |
71 | .mv_setup = hp6xx_setup, | 103 | .mv_setup = hp6xx_setup, |
72 | .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM, | 104 | .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM, |
73 | |||
74 | .mv_inb = hd64461_inb, | ||
75 | .mv_inw = hd64461_inw, | ||
76 | .mv_inl = hd64461_inl, | ||
77 | .mv_outb = hd64461_outb, | ||
78 | .mv_outw = hd64461_outw, | ||
79 | .mv_outl = hd64461_outl, | ||
80 | |||
81 | .mv_inb_p = hd64461_inb_p, | ||
82 | .mv_inw_p = hd64461_inw, | ||
83 | .mv_inl_p = hd64461_inl, | ||
84 | .mv_outb_p = hd64461_outb_p, | ||
85 | .mv_outw_p = hd64461_outw, | ||
86 | .mv_outl_p = hd64461_outl, | ||
87 | |||
88 | .mv_insb = hd64461_insb, | ||
89 | .mv_insw = hd64461_insw, | ||
90 | .mv_insl = hd64461_insl, | ||
91 | .mv_outsb = hd64461_outsb, | ||
92 | .mv_outsw = hd64461_outsw, | ||
93 | .mv_outsl = hd64461_outsl, | ||
94 | |||
95 | .mv_readw = hd64461_readw, | ||
96 | .mv_writew = hd64461_writew, | ||
97 | |||
98 | .mv_irq_demux = hd64461_irq_demux, | 105 | .mv_irq_demux = hd64461_irq_demux, |
99 | }; | 106 | }; |
100 | ALIAS_MV(hp6xx) | 107 | ALIAS_MV(hp6xx) |