2006-12-28 17:50:35 +01:00
|
|
|
/*
|
2005-04-17 00:20:36 +02:00
|
|
|
* linux/arch/sh/boards/se/770x/setup.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2000 Kazumoto Kojima
|
|
|
|
*
|
|
|
|
* Hitachi SolutionEngine Support.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
2007-02-13 07:42:28 +01:00
|
|
|
#include <linux/platform_device.h>
|
2008-07-29 14:41:37 +02:00
|
|
|
#include <mach-se/mach/se.h>
|
2008-12-17 06:41:54 +01:00
|
|
|
#include <mach-se/mach/mrshpc.h>
|
|
|
|
#include <asm/machvec.h>
|
2006-10-03 06:14:04 +02:00
|
|
|
#include <asm/io.h>
|
2006-09-27 04:16:20 +02:00
|
|
|
#include <asm/smc37c93x.h>
|
2007-08-20 06:03:41 +02:00
|
|
|
#include <asm/heartbeat.h>
|
2006-09-27 11:17:31 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* Configure the Super I/O chip
|
|
|
|
*/
|
|
|
|
static void __init smsc_config(int index, int data)
|
|
|
|
{
|
|
|
|
outb_p(index, INDEX_PORT);
|
|
|
|
outb_p(data, DATA_PORT);
|
|
|
|
}
|
|
|
|
|
2006-09-27 11:17:31 +02:00
|
|
|
/* XXX: Another candidate for a more generic cchip machine vector */
|
|
|
|
static void __init smsc_setup(char **cmdline_p)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
|
|
|
outb_p(CONFIG_ENTER, CONFIG_PORT);
|
|
|
|
outb_p(CONFIG_ENTER, CONFIG_PORT);
|
|
|
|
|
|
|
|
/* FDC */
|
|
|
|
smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
|
|
|
|
smsc_config(ACTIVATE_INDEX, 0x01);
|
|
|
|
smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
|
|
|
|
|
|
|
|
/* AUXIO (GPIO): to use IDE1 */
|
|
|
|
smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
|
|
|
|
smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
|
|
|
|
smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
|
|
|
|
|
|
|
|
/* COM1 */
|
|
|
|
smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
|
|
|
|
smsc_config(ACTIVATE_INDEX, 0x01);
|
|
|
|
smsc_config(IO_BASE_HI_INDEX, 0x03);
|
|
|
|
smsc_config(IO_BASE_LO_INDEX, 0xf8);
|
|
|
|
smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
|
|
|
|
|
|
|
|
/* COM2 */
|
|
|
|
smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
|
|
|
|
smsc_config(ACTIVATE_INDEX, 0x01);
|
|
|
|
smsc_config(IO_BASE_HI_INDEX, 0x02);
|
|
|
|
smsc_config(IO_BASE_LO_INDEX, 0xf8);
|
|
|
|
smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
|
|
|
|
|
|
|
|
/* RTC */
|
|
|
|
smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
|
|
|
|
smsc_config(ACTIVATE_INDEX, 0x01);
|
|
|
|
smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
|
|
|
|
|
|
|
|
/* XXX: PARPORT, KBD, and MOUSE will come here... */
|
|
|
|
outb_p(CONFIG_EXIT, CONFIG_PORT);
|
|
|
|
}
|
|
|
|
|
2007-03-12 07:12:27 +01:00
|
|
|
|
|
|
|
static struct resource cf_ide_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = PA_MRSHPC_IO + 0x1f0,
|
|
|
|
.end = PA_MRSHPC_IO + 0x1f0 + 8,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = PA_MRSHPC_IO + 0x1f0 + 0x206,
|
2008-06-18 11:32:03 +02:00
|
|
|
.end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
|
2007-03-12 07:12:27 +01:00
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[2] = {
|
2007-04-26 04:51:00 +02:00
|
|
|
.start = IRQ_CFCARD,
|
2007-03-12 07:12:27 +01:00
|
|
|
.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,
|
|
|
|
};
|
|
|
|
|
2007-02-13 07:42:28 +01:00
|
|
|
static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
|
|
|
|
|
2007-08-20 06:03:41 +02:00
|
|
|
static struct heartbeat_data heartbeat_data = {
|
|
|
|
.bit_pos = heartbeat_bit_pos,
|
|
|
|
.nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
|
|
|
|
};
|
|
|
|
|
2010-01-15 04:24:34 +01:00
|
|
|
static struct resource heartbeat_resource = {
|
|
|
|
.start = PA_LED,
|
|
|
|
.end = PA_LED,
|
|
|
|
.flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
|
2007-02-13 07:42:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device heartbeat_device = {
|
|
|
|
.name = "heartbeat",
|
|
|
|
.id = -1,
|
|
|
|
.dev = {
|
2007-08-23 08:11:44 +02:00
|
|
|
.platform_data = &heartbeat_data,
|
2007-02-13 07:42:28 +01:00
|
|
|
},
|
2010-01-15 04:24:34 +01:00
|
|
|
.num_resources = 1,
|
|
|
|
.resource = &heartbeat_resource,
|
2007-02-13 07:42:28 +01:00
|
|
|
};
|
|
|
|
|
2008-07-29 07:37:25 +02:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7712)
|
2008-06-18 11:29:06 +02:00
|
|
|
/* SH771X Ethernet driver */
|
|
|
|
static struct resource sh_eth0_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = SH_ETH0_BASE,
|
|
|
|
.end = SH_ETH0_BASE + 0x1B8,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = SH_ETH0_IRQ,
|
|
|
|
.end = SH_ETH0_IRQ,
|
|
|
|
.flags = IORESOURCE_IRQ,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device sh_eth0_device = {
|
2013-06-07 15:55:08 +02:00
|
|
|
.name = "sh771x-ether",
|
|
|
|
.id = 0,
|
2008-06-18 11:29:06 +02:00
|
|
|
.dev = {
|
|
|
|
.platform_data = PHY_ID,
|
|
|
|
},
|
|
|
|
.num_resources = ARRAY_SIZE(sh_eth0_resources),
|
|
|
|
.resource = sh_eth0_resources,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource sh_eth1_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = SH_ETH1_BASE,
|
|
|
|
.end = SH_ETH1_BASE + 0x1B8,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
.start = SH_ETH1_IRQ,
|
|
|
|
.end = SH_ETH1_IRQ,
|
|
|
|
.flags = IORESOURCE_IRQ,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device sh_eth1_device = {
|
2013-06-07 15:55:08 +02:00
|
|
|
.name = "sh771x-ether",
|
|
|
|
.id = 1,
|
2008-06-18 11:29:06 +02:00
|
|
|
.dev = {
|
|
|
|
.platform_data = PHY_ID,
|
|
|
|
},
|
|
|
|
.num_resources = ARRAY_SIZE(sh_eth1_resources),
|
|
|
|
.resource = sh_eth1_resources,
|
|
|
|
};
|
2008-07-29 07:37:25 +02:00
|
|
|
#endif
|
2008-06-18 11:29:06 +02:00
|
|
|
|
2007-02-13 07:42:28 +01:00
|
|
|
static struct platform_device *se_devices[] __initdata = {
|
|
|
|
&heartbeat_device,
|
2007-03-12 07:12:27 +01:00
|
|
|
&cf_ide_device,
|
2008-07-29 07:37:25 +02:00
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7712)
|
2008-06-18 11:29:06 +02:00
|
|
|
&sh_eth0_device,
|
|
|
|
&sh_eth1_device,
|
2008-07-29 07:37:25 +02:00
|
|
|
#endif
|
2007-02-13 07:42:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static int __init se_devices_setup(void)
|
|
|
|
{
|
2008-12-17 06:41:54 +01:00
|
|
|
mrshpc_setup_windows();
|
2007-02-13 07:42:28 +01:00
|
|
|
return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
|
|
|
|
}
|
2007-03-27 11:13:51 +02:00
|
|
|
device_initcall(se_devices_setup);
|
2007-02-13 07:42:28 +01:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
/*
|
2006-09-27 11:17:31 +02:00
|
|
|
* The Machine Vector
|
2005-04-17 00:20:36 +02:00
|
|
|
*/
|
2007-05-15 08:19:34 +02:00
|
|
|
static struct sh_machine_vector mv_se __initmv = {
|
2006-09-27 11:17:31 +02:00
|
|
|
.mv_name = "SolutionEngine",
|
|
|
|
.mv_setup = smsc_setup,
|
|
|
|
.mv_init_irq = init_se_IRQ,
|
|
|
|
};
|