xref: /openbmc/linux/arch/sh/boards/mach-se/7751/setup.c (revision da2014a2)
1da2014a2SPaul Mundt /*
2da2014a2SPaul Mundt  * linux/arch/sh/boards/se/7751/setup.c
3da2014a2SPaul Mundt  *
4da2014a2SPaul Mundt  * Copyright (C) 2000  Kazumoto Kojima
5da2014a2SPaul Mundt  *
6da2014a2SPaul Mundt  * Hitachi SolutionEngine Support.
7da2014a2SPaul Mundt  *
8da2014a2SPaul Mundt  * Modified for 7751 Solution Engine by
9da2014a2SPaul Mundt  * Ian da Silva and Jeremy Siegel, 2001.
10da2014a2SPaul Mundt  */
11da2014a2SPaul Mundt #include <linux/init.h>
12da2014a2SPaul Mundt #include <linux/platform_device.h>
13da2014a2SPaul Mundt #include <asm/machvec.h>
14da2014a2SPaul Mundt #include <asm/se7751.h>
15da2014a2SPaul Mundt #include <asm/io.h>
16da2014a2SPaul Mundt #include <asm/heartbeat.h>
17da2014a2SPaul Mundt 
18da2014a2SPaul Mundt static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
19da2014a2SPaul Mundt 
20da2014a2SPaul Mundt static struct heartbeat_data heartbeat_data = {
21da2014a2SPaul Mundt 	.bit_pos	= heartbeat_bit_pos,
22da2014a2SPaul Mundt 	.nr_bits	= ARRAY_SIZE(heartbeat_bit_pos),
23da2014a2SPaul Mundt };
24da2014a2SPaul Mundt 
25da2014a2SPaul Mundt static struct resource heartbeat_resources[] = {
26da2014a2SPaul Mundt 	[0] = {
27da2014a2SPaul Mundt 		.start	= PA_LED,
28da2014a2SPaul Mundt 		.end	= PA_LED,
29da2014a2SPaul Mundt 		.flags	= IORESOURCE_MEM,
30da2014a2SPaul Mundt 	},
31da2014a2SPaul Mundt };
32da2014a2SPaul Mundt 
33da2014a2SPaul Mundt static struct platform_device heartbeat_device = {
34da2014a2SPaul Mundt 	.name		= "heartbeat",
35da2014a2SPaul Mundt 	.id		= -1,
36da2014a2SPaul Mundt 	.dev	= {
37da2014a2SPaul Mundt 		.platform_data	= &heartbeat_data,
38da2014a2SPaul Mundt 	},
39da2014a2SPaul Mundt 	.num_resources	= ARRAY_SIZE(heartbeat_resources),
40da2014a2SPaul Mundt 	.resource	= heartbeat_resources,
41da2014a2SPaul Mundt };
42da2014a2SPaul Mundt 
43da2014a2SPaul Mundt static struct platform_device *se7751_devices[] __initdata = {
44da2014a2SPaul Mundt 	&heartbeat_device,
45da2014a2SPaul Mundt };
46da2014a2SPaul Mundt 
47da2014a2SPaul Mundt static int __init se7751_devices_setup(void)
48da2014a2SPaul Mundt {
49da2014a2SPaul Mundt 	return platform_add_devices(se7751_devices, ARRAY_SIZE(se7751_devices));
50da2014a2SPaul Mundt }
51da2014a2SPaul Mundt __initcall(se7751_devices_setup);
52da2014a2SPaul Mundt 
53da2014a2SPaul Mundt /*
54da2014a2SPaul Mundt  * The Machine Vector
55da2014a2SPaul Mundt  */
56da2014a2SPaul Mundt static struct sh_machine_vector mv_7751se __initmv = {
57da2014a2SPaul Mundt 	.mv_name		= "7751 SolutionEngine",
58da2014a2SPaul Mundt 	.mv_nr_irqs		= 72,
59da2014a2SPaul Mundt 
60da2014a2SPaul Mundt 	.mv_inb			= sh7751se_inb,
61da2014a2SPaul Mundt 	.mv_inw			= sh7751se_inw,
62da2014a2SPaul Mundt 	.mv_inl			= sh7751se_inl,
63da2014a2SPaul Mundt 	.mv_outb		= sh7751se_outb,
64da2014a2SPaul Mundt 	.mv_outw		= sh7751se_outw,
65da2014a2SPaul Mundt 	.mv_outl		= sh7751se_outl,
66da2014a2SPaul Mundt 
67da2014a2SPaul Mundt 	.mv_inb_p		= sh7751se_inb_p,
68da2014a2SPaul Mundt 	.mv_inw_p		= sh7751se_inw,
69da2014a2SPaul Mundt 	.mv_inl_p		= sh7751se_inl,
70da2014a2SPaul Mundt 	.mv_outb_p		= sh7751se_outb_p,
71da2014a2SPaul Mundt 	.mv_outw_p		= sh7751se_outw,
72da2014a2SPaul Mundt 	.mv_outl_p		= sh7751se_outl,
73da2014a2SPaul Mundt 
74da2014a2SPaul Mundt 	.mv_insl		= sh7751se_insl,
75da2014a2SPaul Mundt 	.mv_outsl		= sh7751se_outsl,
76da2014a2SPaul Mundt 
77da2014a2SPaul Mundt 	.mv_init_irq		= init_7751se_IRQ,
78da2014a2SPaul Mundt };
79