2008-03-21 14:54:13 +08:00
|
|
|
/*
|
|
|
|
* linux/arch/sh/boards/se/7721/setup.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Renesas Solutions Corp.
|
|
|
|
*
|
|
|
|
* Hitachi UL SolutionEngine 7721 Support.
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/platform_device.h>
|
2008-07-29 20:41:37 +08:00
|
|
|
#include <mach-se/mach/se7721.h>
|
2008-12-17 13:41:54 +08:00
|
|
|
#include <mach-se/mach/mrshpc.h>
|
|
|
|
#include <asm/machvec.h>
|
2008-03-21 14:54:13 +08:00
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/heartbeat.h>
|
|
|
|
|
|
|
|
static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
|
|
|
|
|
|
|
|
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_16BIT,
|
2008-03-21 14:54:13 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device heartbeat_device = {
|
|
|
|
.name = "heartbeat",
|
|
|
|
.id = -1,
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &heartbeat_data,
|
|
|
|
},
|
2010-01-15 11:24:34 +08:00
|
|
|
.num_resources = 1,
|
|
|
|
.resource = &heartbeat_resource,
|
2008-03-21 14:54:13 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource cf_ide_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = PA_MRSHPC_IO + 0x1f0,
|
|
|
|
.end = PA_MRSHPC_IO + 0x1f0 + 8 ,
|
|
|
|
.flags = IORESOURCE_IO,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = PA_MRSHPC_IO + 0x1f0 + 0x206,
|
|
|
|
.end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
|
|
|
|
.flags = IORESOURCE_IO,
|
|
|
|
},
|
|
|
|
[2] = {
|
|
|
|
.start = MRSHPC_IRQ0,
|
|
|
|
.flags = IORESOURCE_IRQ,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device cf_ide_device = {
|
|
|
|
.name = "pata_platform",
|
|
|
|
.id = -1,
|
|
|
|
.num_resources = ARRAY_SIZE(cf_ide_resources),
|
|
|
|
.resource = cf_ide_resources,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device *se7721_devices[] __initdata = {
|
|
|
|
&cf_ide_device,
|
|
|
|
&heartbeat_device
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init se7721_devices_setup(void)
|
|
|
|
{
|
2008-12-17 13:41:54 +08:00
|
|
|
mrshpc_setup_windows();
|
|
|
|
return platform_add_devices(se7721_devices, ARRAY_SIZE(se7721_devices));
|
2008-03-21 14:54:13 +08:00
|
|
|
}
|
|
|
|
device_initcall(se7721_devices_setup);
|
|
|
|
|
|
|
|
static void __init se7721_setup(char **cmdline_p)
|
|
|
|
{
|
|
|
|
/* for USB */
|
2010-01-26 11:58:40 +08:00
|
|
|
__raw_writew(0x0000, 0xA405010C); /* PGCR */
|
|
|
|
__raw_writew(0x0000, 0xA405010E); /* PHCR */
|
|
|
|
__raw_writew(0x00AA, 0xA4050118); /* PPCR */
|
|
|
|
__raw_writew(0x0000, 0xA4050124); /* PSELA */
|
2008-03-21 14:54:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The Machine Vector
|
|
|
|
*/
|
|
|
|
struct sh_machine_vector mv_se7721 __initmv = {
|
|
|
|
.mv_name = "Solution Engine 7721",
|
|
|
|
.mv_setup = se7721_setup,
|
|
|
|
.mv_init_irq = init_se7721_IRQ,
|
|
|
|
};
|