blob: 499a3e9dbfc2eb1d421e750d8d16a296b4acbd22 [file] [log] [blame]
Yoshinori Satof36af3fd2006-11-05 16:21:09 +09001/*
2 *
3 * linux/arch/sh/boards/se/7206/setup.c
4 *
5 * Copyright (C) 2006 Yoshinori Sato
Paul Mundt3b4d9532007-02-13 15:42:28 +09006 * Copyright (C) 2007 Paul Mundt
Yoshinori Satof36af3fd2006-11-05 16:21:09 +09007 *
8 * Hitachi 7206 SolutionEngine Support.
Yoshinori Satof36af3fd2006-11-05 16:21:09 +09009 */
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090010#include <linux/init.h>
11#include <linux/platform_device.h>
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090012#include <asm/se7206.h>
Paul Mundt710ee0c2006-11-05 16:48:42 +090013#include <asm/io.h>
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090014#include <asm/machvec.h>
Paul Mundt8786c952007-08-20 13:03:41 +090015#include <asm/heartbeat.h>
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090016
17static struct resource smc91x_resources[] = {
18 [0] = {
19 .start = 0x300,
20 .end = 0x300 + 0x020 - 1,
21 .flags = IORESOURCE_MEM,
22 },
23 [1] = {
24 .start = 64,
25 .end = 64,
26 .flags = IORESOURCE_IRQ,
27 },
28};
29
30static struct platform_device smc91x_device = {
31 .name = "smc91x",
32 .id = -1,
33 .num_resources = ARRAY_SIZE(smc91x_resources),
34 .resource = smc91x_resources,
35};
36
Paul Mundt3b4d9532007-02-13 15:42:28 +090037static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
38
Paul Mundt8786c952007-08-20 13:03:41 +090039static struct heartbeat_data heartbeat_data = {
40 .bit_pos = heartbeat_bit_pos,
41 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
42};
43
Paul Mundt3b4d9532007-02-13 15:42:28 +090044static struct resource heartbeat_resources[] = {
45 [0] = {
46 .start = PA_LED,
Paul Mundta1fd3062007-08-23 15:11:44 +090047 .end = PA_LED,
Paul Mundt3b4d9532007-02-13 15:42:28 +090048 .flags = IORESOURCE_MEM,
49 },
50};
51
52static struct platform_device heartbeat_device = {
53 .name = "heartbeat",
54 .id = -1,
55 .dev = {
Paul Mundta1fd3062007-08-23 15:11:44 +090056 .platform_data = &heartbeat_data,
Paul Mundt3b4d9532007-02-13 15:42:28 +090057 },
58 .num_resources = ARRAY_SIZE(heartbeat_resources),
59 .resource = heartbeat_resources,
60};
61
62static struct platform_device *se7206_devices[] __initdata = {
63 &smc91x_device,
64 &heartbeat_device,
65};
66
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090067static int __init se7206_devices_setup(void)
68{
Paul Mundt3b4d9532007-02-13 15:42:28 +090069 return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090070}
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090071__initcall(se7206_devices_setup);
72
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090073/*
74 * The Machine Vector
75 */
76
Paul Mundt82f81f42007-05-15 15:19:34 +090077static struct sh_machine_vector mv_se __initmv = {
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090078 .mv_name = "SolutionEngine",
79 .mv_nr_irqs = 256,
80 .mv_inb = se7206_inb,
81 .mv_inw = se7206_inw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090082 .mv_outb = se7206_outb,
83 .mv_outw = se7206_outw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090084
85 .mv_inb_p = se7206_inb_p,
86 .mv_inw_p = se7206_inw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090087 .mv_outb_p = se7206_outb_p,
88 .mv_outw_p = se7206_outw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090089
90 .mv_insb = se7206_insb,
91 .mv_insw = se7206_insw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090092 .mv_outsb = se7206_outsb,
93 .mv_outsw = se7206_outsw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090094
95 .mv_init_irq = init_se7206_IRQ,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090096};