Pull video into release branch
[linux-2.6] / 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  */
11
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <asm/se7206.h>
15 #include <asm/io.h>
16 #include <asm/machvec.h>
17
18 static struct resource smc91x_resources[] = {
19         [0] = {
20                 .start          = 0x300,
21                 .end            = 0x300 + 0x020 - 1,
22                 .flags          = IORESOURCE_MEM,
23         },
24         [1] = {
25                 .start          = 64,
26                 .end            = 64,
27                 .flags          = IORESOURCE_IRQ,
28         },
29 };
30
31 static struct platform_device smc91x_device = {
32         .name           = "smc91x",
33         .id             = -1,
34         .num_resources  = ARRAY_SIZE(smc91x_resources),
35         .resource       = smc91x_resources,
36 };
37
38 static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
39
40 static struct resource heartbeat_resources[] = {
41         [0] = {
42                 .start  = PA_LED,
43                 .end    = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
44                 .flags  = IORESOURCE_MEM,
45         },
46 };
47
48 static struct platform_device heartbeat_device = {
49         .name           = "heartbeat",
50         .id             = -1,
51         .dev    = {
52                 .platform_data  = heartbeat_bit_pos,
53         },
54         .num_resources  = ARRAY_SIZE(heartbeat_resources),
55         .resource       = heartbeat_resources,
56 };
57
58 static struct platform_device *se7206_devices[] __initdata = {
59         &smc91x_device,
60         &heartbeat_device,
61 };
62
63 static int __init se7206_devices_setup(void)
64 {
65         return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
66 }
67 __initcall(se7206_devices_setup);
68
69 /*
70  * The Machine Vector
71  */
72
73 static struct sh_machine_vector mv_se __initmv = {
74         .mv_name                = "SolutionEngine",
75         .mv_nr_irqs             = 256,
76         .mv_inb                 = se7206_inb,
77         .mv_inw                 = se7206_inw,
78         .mv_inl                 = se7206_inl,
79         .mv_outb                = se7206_outb,
80         .mv_outw                = se7206_outw,
81         .mv_outl                = se7206_outl,
82
83         .mv_inb_p               = se7206_inb_p,
84         .mv_inw_p               = se7206_inw,
85         .mv_inl_p               = se7206_inl,
86         .mv_outb_p              = se7206_outb_p,
87         .mv_outw_p              = se7206_outw,
88         .mv_outl_p              = se7206_outl,
89
90         .mv_insb                = se7206_insb,
91         .mv_insw                = se7206_insw,
92         .mv_insl                = se7206_insl,
93         .mv_outsb               = se7206_outsb,
94         .mv_outsw               = se7206_outsw,
95         .mv_outsl               = se7206_outsl,
96
97         .mv_init_irq            = init_se7206_IRQ,
98 };