Commit | Line | Data |
---|---|---|
f36af3fd YS |
1 | /* |
2 | * | |
3 | * linux/arch/sh/boards/se/7206/setup.c | |
4 | * | |
5 | * Copyright (C) 2006 Yoshinori Sato | |
f11c9c2f | 6 | * Copyright (C) 2007 - 2008 Paul Mundt |
f36af3fd YS |
7 | * |
8 | * Hitachi 7206 SolutionEngine Support. | |
f36af3fd | 9 | */ |
f36af3fd YS |
10 | #include <linux/init.h> |
11 | #include <linux/platform_device.h> | |
f11c9c2f | 12 | #include <linux/smc91x.h> |
939a24a6 | 13 | #include <mach-se/mach/se7206.h> |
710ee0cc | 14 | #include <asm/io.h> |
f36af3fd | 15 | #include <asm/machvec.h> |
8786c952 | 16 | #include <asm/heartbeat.h> |
f36af3fd YS |
17 | |
18 | static struct resource smc91x_resources[] = { | |
19 | [0] = { | |
f11c9c2f PM |
20 | .name = "smc91x-regs", |
21 | .start = PA_SMSC + 0x300, | |
22 | .end = PA_SMSC + 0x300 + 0x020 - 1, | |
f36af3fd YS |
23 | .flags = IORESOURCE_MEM, |
24 | }, | |
25 | [1] = { | |
26 | .start = 64, | |
27 | .end = 64, | |
28 | .flags = IORESOURCE_IRQ, | |
29 | }, | |
30 | }; | |
31 | ||
f11c9c2f PM |
32 | static struct smc91x_platdata smc91x_info = { |
33 | .flags = SMC91X_USE_16BIT, | |
34 | }; | |
35 | ||
f36af3fd YS |
36 | static struct platform_device smc91x_device = { |
37 | .name = "smc91x", | |
38 | .id = -1, | |
f11c9c2f PM |
39 | .dev = { |
40 | .dma_mask = NULL, | |
41 | .coherent_dma_mask = 0xffffffff, | |
42 | .platform_data = &smc91x_info, | |
43 | }, | |
f36af3fd YS |
44 | .num_resources = ARRAY_SIZE(smc91x_resources), |
45 | .resource = smc91x_resources, | |
46 | }; | |
47 | ||
3b4d9539 PM |
48 | static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; |
49 | ||
8786c952 PM |
50 | static struct heartbeat_data heartbeat_data = { |
51 | .bit_pos = heartbeat_bit_pos, | |
52 | .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), | |
7216ddc6 | 53 | .regsize = 32, |
8786c952 PM |
54 | }; |
55 | ||
3b4d9539 PM |
56 | static struct resource heartbeat_resources[] = { |
57 | [0] = { | |
58 | .start = PA_LED, | |
a1fd306b | 59 | .end = PA_LED, |
3b4d9539 PM |
60 | .flags = IORESOURCE_MEM, |
61 | }, | |
62 | }; | |
63 | ||
64 | static struct platform_device heartbeat_device = { | |
65 | .name = "heartbeat", | |
66 | .id = -1, | |
67 | .dev = { | |
a1fd306b | 68 | .platform_data = &heartbeat_data, |
3b4d9539 PM |
69 | }, |
70 | .num_resources = ARRAY_SIZE(heartbeat_resources), | |
71 | .resource = heartbeat_resources, | |
72 | }; | |
73 | ||
74 | static struct platform_device *se7206_devices[] __initdata = { | |
75 | &smc91x_device, | |
76 | &heartbeat_device, | |
77 | }; | |
78 | ||
f36af3fd YS |
79 | static int __init se7206_devices_setup(void) |
80 | { | |
3b4d9539 | 81 | return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices)); |
f36af3fd | 82 | } |
f36af3fd YS |
83 | __initcall(se7206_devices_setup); |
84 | ||
f36af3fd YS |
85 | /* |
86 | * The Machine Vector | |
87 | */ | |
88 | ||
82f81f47 | 89 | static struct sh_machine_vector mv_se __initmv = { |
f36af3fd YS |
90 | .mv_name = "SolutionEngine", |
91 | .mv_nr_irqs = 256, | |
92 | .mv_inb = se7206_inb, | |
93 | .mv_inw = se7206_inw, | |
f36af3fd YS |
94 | .mv_outb = se7206_outb, |
95 | .mv_outw = se7206_outw, | |
f36af3fd YS |
96 | |
97 | .mv_inb_p = se7206_inb_p, | |
98 | .mv_inw_p = se7206_inw, | |
f36af3fd YS |
99 | .mv_outb_p = se7206_outb_p, |
100 | .mv_outw_p = se7206_outw, | |
f36af3fd YS |
101 | |
102 | .mv_insb = se7206_insb, | |
103 | .mv_insw = se7206_insw, | |
f36af3fd YS |
104 | .mv_outsb = se7206_outsb, |
105 | .mv_outsw = se7206_outsw, | |
f36af3fd YS |
106 | |
107 | .mv_init_irq = init_se7206_IRQ, | |
f36af3fd | 108 | }; |