blob: 8f5c65d43d1d85a6e1db054cd5f065ee3aa72119 [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 Mundtf11c9c22008-05-09 14:13:17 +09006 * Copyright (C) 2007 - 2008 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>
Paul Mundtf11c9c22008-05-09 14:13:17 +090012#include <linux/smc91x.h>
Paul Mundt939a24a2008-07-29 21:41:37 +090013#include <mach-se/mach/se7206.h>
Paul Mundt710ee0c2006-11-05 16:48:42 +090014#include <asm/io.h>
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090015#include <asm/machvec.h>
Paul Mundt8786c952007-08-20 13:03:41 +090016#include <asm/heartbeat.h>
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090017
18static struct resource smc91x_resources[] = {
19 [0] = {
Paul Mundtf11c9c22008-05-09 14:13:17 +090020 .name = "smc91x-regs",
21 .start = PA_SMSC + 0x300,
22 .end = PA_SMSC + 0x300 + 0x020 - 1,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090023 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = 64,
27 .end = 64,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
Paul Mundtf11c9c22008-05-09 14:13:17 +090032static struct smc91x_platdata smc91x_info = {
33 .flags = SMC91X_USE_16BIT,
34};
35
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090036static struct platform_device smc91x_device = {
37 .name = "smc91x",
38 .id = -1,
Paul Mundtf11c9c22008-05-09 14:13:17 +090039 .dev = {
40 .dma_mask = NULL,
41 .coherent_dma_mask = 0xffffffff,
42 .platform_data = &smc91x_info,
43 },
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090044 .num_resources = ARRAY_SIZE(smc91x_resources),
45 .resource = smc91x_resources,
46};
47
Paul Mundt3b4d9532007-02-13 15:42:28 +090048static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
49
Paul Mundt8786c952007-08-20 13:03:41 +090050static struct heartbeat_data heartbeat_data = {
51 .bit_pos = heartbeat_bit_pos,
52 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
53};
54
Paul Mundta09d2832010-01-15 12:24:34 +090055static struct resource heartbeat_resource = {
56 .start = PA_LED,
57 .end = PA_LED,
58 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
Paul Mundt3b4d9532007-02-13 15:42:28 +090059};
60
61static struct platform_device heartbeat_device = {
62 .name = "heartbeat",
63 .id = -1,
64 .dev = {
Paul Mundta1fd3062007-08-23 15:11:44 +090065 .platform_data = &heartbeat_data,
Paul Mundt3b4d9532007-02-13 15:42:28 +090066 },
Paul Mundta09d2832010-01-15 12:24:34 +090067 .num_resources = 1,
68 .resource = &heartbeat_resource,
Paul Mundt3b4d9532007-02-13 15:42:28 +090069};
70
71static struct platform_device *se7206_devices[] __initdata = {
72 &smc91x_device,
73 &heartbeat_device,
74};
75
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090076static int __init se7206_devices_setup(void)
77{
Paul Mundt3b4d9532007-02-13 15:42:28 +090078 return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090079}
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090080__initcall(se7206_devices_setup);
81
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090082/*
83 * The Machine Vector
84 */
85
Paul Mundt82f81f42007-05-15 15:19:34 +090086static struct sh_machine_vector mv_se __initmv = {
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090087 .mv_name = "SolutionEngine",
88 .mv_nr_irqs = 256,
89 .mv_inb = se7206_inb,
90 .mv_inw = se7206_inw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090091 .mv_outb = se7206_outb,
92 .mv_outw = se7206_outw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090093
94 .mv_inb_p = se7206_inb_p,
95 .mv_inw_p = se7206_inw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090096 .mv_outb_p = se7206_outb_p,
97 .mv_outw_p = se7206_outw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +090098
99 .mv_insb = se7206_insb,
100 .mv_insw = se7206_insw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +0900101 .mv_outsb = se7206_outsb,
102 .mv_outsw = se7206_outsw,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +0900103
104 .mv_init_irq = init_se7206_IRQ,
Yoshinori Satof36af3fd2006-11-05 16:21:09 +0900105};