2006-11-05 15:21:09 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* linux/arch/sh/boards/se/7206/setup.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Yoshinori Sato
|
2008-05-09 13:13:17 +08:00
|
|
|
* Copyright (C) 2007 - 2008 Paul Mundt
|
2006-11-05 15:21:09 +08:00
|
|
|
*
|
|
|
|
* Hitachi 7206 SolutionEngine Support.
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/platform_device.h>
|
2008-05-09 13:13:17 +08:00
|
|
|
#include <linux/smc91x.h>
|
2008-07-29 20:41:37 +08:00
|
|
|
#include <mach-se/mach/se7206.h>
|
2006-11-05 15:48:42 +08:00
|
|
|
#include <asm/io.h>
|
2006-11-05 15:21:09 +08:00
|
|
|
#include <asm/machvec.h>
|
2007-08-20 12:03:41 +08:00
|
|
|
#include <asm/heartbeat.h>
|
2006-11-05 15:21:09 +08:00
|
|
|
|
|
|
|
static struct resource smc91x_resources[] = {
|
|
|
|
[0] = {
|
2008-05-09 13:13:17 +08:00
|
|
|
.name = "smc91x-regs",
|
|
|
|
.start = PA_SMSC + 0x300,
|
|
|
|
.end = PA_SMSC + 0x300 + 0x020 - 1,
|
2006-11-05 15:21:09 +08:00
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = 64,
|
|
|
|
.end = 64,
|
|
|
|
.flags = IORESOURCE_IRQ,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2008-05-09 13:13:17 +08:00
|
|
|
static struct smc91x_platdata smc91x_info = {
|
|
|
|
.flags = SMC91X_USE_16BIT,
|
|
|
|
};
|
|
|
|
|
2006-11-05 15:21:09 +08:00
|
|
|
static struct platform_device smc91x_device = {
|
|
|
|
.name = "smc91x",
|
|
|
|
.id = -1,
|
2008-05-09 13:13:17 +08:00
|
|
|
.dev = {
|
|
|
|
.dma_mask = NULL,
|
|
|
|
.coherent_dma_mask = 0xffffffff,
|
|
|
|
.platform_data = &smc91x_info,
|
|
|
|
},
|
2006-11-05 15:21:09 +08:00
|
|
|
.num_resources = ARRAY_SIZE(smc91x_resources),
|
|
|
|
.resource = smc91x_resources,
|
|
|
|
};
|
|
|
|
|
2007-02-13 14:42:28 +08:00
|
|
|
static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
|
|
|
|
|
2007-08-20 12:03:41 +08:00
|
|
|
static struct heartbeat_data heartbeat_data = {
|
|
|
|
.bit_pos = heartbeat_bit_pos,
|
|
|
|
.nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
|
|
|
|
};
|
|
|
|
|
2010-01-15 11:24:34 +08:00
|
|
|
static struct resource heartbeat_resource = {
|
|
|
|
.start = PA_LED,
|
|
|
|
.end = PA_LED,
|
|
|
|
.flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
|
2007-02-13 14:42:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device heartbeat_device = {
|
|
|
|
.name = "heartbeat",
|
|
|
|
.id = -1,
|
|
|
|
.dev = {
|
2007-08-23 14:11:44 +08:00
|
|
|
.platform_data = &heartbeat_data,
|
2007-02-13 14:42:28 +08:00
|
|
|
},
|
2010-01-15 11:24:34 +08:00
|
|
|
.num_resources = 1,
|
|
|
|
.resource = &heartbeat_resource,
|
2007-02-13 14:42:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device *se7206_devices[] __initdata = {
|
|
|
|
&smc91x_device,
|
|
|
|
&heartbeat_device,
|
|
|
|
};
|
|
|
|
|
2006-11-05 15:21:09 +08:00
|
|
|
static int __init se7206_devices_setup(void)
|
|
|
|
{
|
2007-02-13 14:42:28 +08:00
|
|
|
return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices));
|
2006-11-05 15:21:09 +08:00
|
|
|
}
|
2011-01-07 11:02:15 +08:00
|
|
|
device_initcall(se7206_devices_setup);
|
2006-11-05 15:21:09 +08:00
|
|
|
|
2010-11-02 00:18:48 +08:00
|
|
|
static int se7206_mode_pins(void)
|
|
|
|
{
|
|
|
|
return MODE_PIN1 | MODE_PIN2;
|
|
|
|
}
|
|
|
|
|
2006-11-05 15:21:09 +08:00
|
|
|
/*
|
|
|
|
* The Machine Vector
|
|
|
|
*/
|
|
|
|
|
2007-05-15 14:19:34 +08:00
|
|
|
static struct sh_machine_vector mv_se __initmv = {
|
2006-11-05 15:21:09 +08:00
|
|
|
.mv_name = "SolutionEngine",
|
|
|
|
.mv_nr_irqs = 256,
|
|
|
|
.mv_init_irq = init_se7206_IRQ,
|
2010-11-02 00:18:48 +08:00
|
|
|
.mv_mode_pins = se7206_mode_pins,
|
2006-11-05 15:21:09 +08:00
|
|
|
};
|