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