]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/sh/boards/se/7206/setup.c
sh: se7206: Make the I/O port routines less stupid.
[linux-2.6-omap-h63xx.git] / arch / sh / boards / se / 7206 / setup.c
1 /*
2  *
3  * linux/arch/sh/boards/se/7206/setup.c
4  *
5  * Copyright (C) 2006  Yoshinori Sato
6  * Copyright (C) 2007  Paul Mundt
7  *
8  * Hitachi 7206 SolutionEngine Support.
9  */
10 #include <linux/init.h>
11 #include <linux/platform_device.h>
12 #include <asm/se7206.h>
13 #include <asm/io.h>
14 #include <asm/machvec.h>
15 #include <asm/heartbeat.h>
16
17 static struct resource smc91x_resources[] = {
18         [0] = {
19                 .start          = 0x300,
20                 .end            = 0x300 + 0x020 - 1,
21                 .flags          = IORESOURCE_MEM,
22         },
23         [1] = {
24                 .start          = 64,
25                 .end            = 64,
26                 .flags          = IORESOURCE_IRQ,
27         },
28 };
29
30 static struct platform_device smc91x_device = {
31         .name           = "smc91x",
32         .id             = -1,
33         .num_resources  = ARRAY_SIZE(smc91x_resources),
34         .resource       = smc91x_resources,
35 };
36
37 static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
38
39 static struct heartbeat_data heartbeat_data = {
40         .bit_pos        = heartbeat_bit_pos,
41         .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
42 };
43
44 static struct resource heartbeat_resources[] = {
45         [0] = {
46                 .start  = PA_LED,
47                 .end    = PA_LED,
48                 .flags  = IORESOURCE_MEM,
49         },
50 };
51
52 static struct platform_device heartbeat_device = {
53         .name           = "heartbeat",
54         .id             = -1,
55         .dev    = {
56                 .platform_data  = &heartbeat_data,
57         },
58         .num_resources  = ARRAY_SIZE(heartbeat_resources),
59         .resource       = heartbeat_resources,
60 };
61
62 static struct platform_device *se7206_devices[] __initdata = {
63         &smc91x_device,
64         &heartbeat_device,
65 };
66
67 static int __init se7206_devices_setup(void)
68 {
69         return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
70 }
71 __initcall(se7206_devices_setup);
72
73 /*
74  * The Machine Vector
75  */
76
77 static struct sh_machine_vector mv_se __initmv = {
78         .mv_name                = "SolutionEngine",
79         .mv_nr_irqs             = 256,
80         .mv_inb                 = se7206_inb,
81         .mv_inw                 = se7206_inw,
82         .mv_outb                = se7206_outb,
83         .mv_outw                = se7206_outw,
84
85         .mv_inb_p               = se7206_inb_p,
86         .mv_inw_p               = se7206_inw,
87         .mv_outb_p              = se7206_outb_p,
88         .mv_outw_p              = se7206_outw,
89
90         .mv_insb                = se7206_insb,
91         .mv_insw                = se7206_insw,
92         .mv_outsb               = se7206_outsb,
93         .mv_outsw               = se7206_outsw,
94
95         .mv_init_irq            = init_se7206_IRQ,
96 };