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