2006-09-27 13:09:34 +04:00
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/platform_device.h>
|
2008-07-07 16:11:54 +04:00
|
|
|
#include <linux/mtd/physmap.h>
|
2008-07-29 16:41:37 +04:00
|
|
|
#include <asm/machvec.h>
|
|
|
|
#include <mach-se/mach/se7343.h>
|
2008-07-07 16:11:54 +04:00
|
|
|
#include <asm/heartbeat.h>
|
2006-09-27 13:09:34 +04:00
|
|
|
#include <asm/irq.h>
|
2008-07-07 16:11:54 +04:00
|
|
|
#include <asm/io.h>
|
2006-09-27 13:09:34 +04:00
|
|
|
|
|
|
|
static struct resource smc91x_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = 0x10000000,
|
|
|
|
.end = 0x1000000F,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
[1] = {
|
|
|
|
/*
|
|
|
|
* shared with other devices via externel
|
|
|
|
* interrupt controller in FPGA...
|
|
|
|
*/
|
2008-07-07 16:11:54 +04:00
|
|
|
.start = SMC_IRQ,
|
|
|
|
.end = SMC_IRQ,
|
2006-09-27 13:09:34 +04:00
|
|
|
.flags = IORESOURCE_IRQ,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device smc91x_device = {
|
|
|
|
.name = "smc91x",
|
|
|
|
.id = 0,
|
|
|
|
.num_resources = ARRAY_SIZE(smc91x_resources),
|
|
|
|
.resource = smc91x_resources,
|
|
|
|
};
|
|
|
|
|
2007-02-13 09:42:28 +03:00
|
|
|
static struct resource heartbeat_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = PA_LED,
|
2007-08-23 10:11:44 +04:00
|
|
|
.end = PA_LED,
|
2007-02-13 09:42:28 +03:00
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2008-07-07 16:11:54 +04:00
|
|
|
static struct heartbeat_data heartbeat_data = {
|
|
|
|
.regsize = 16,
|
|
|
|
};
|
|
|
|
|
2007-02-13 09:42:28 +03:00
|
|
|
static struct platform_device heartbeat_device = {
|
|
|
|
.name = "heartbeat",
|
|
|
|
.id = -1,
|
2008-07-07 16:11:54 +04:00
|
|
|
.dev = {
|
|
|
|
.platform_data = &heartbeat_data,
|
|
|
|
},
|
2007-02-13 09:42:28 +03:00
|
|
|
.num_resources = ARRAY_SIZE(heartbeat_resources),
|
|
|
|
.resource = heartbeat_resources,
|
|
|
|
};
|
|
|
|
|
2008-07-07 16:11:54 +04:00
|
|
|
static struct mtd_partition nor_flash_partitions[] = {
|
|
|
|
{
|
|
|
|
.name = "loader",
|
|
|
|
.offset = 0x00000000,
|
|
|
|
.size = 128 * 1024,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "rootfs",
|
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
|
.size = 31 * 1024 * 1024,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "data",
|
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
|
.size = MTDPART_SIZ_FULL,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct physmap_flash_data nor_flash_data = {
|
|
|
|
.width = 2,
|
|
|
|
.parts = nor_flash_partitions,
|
|
|
|
.nr_parts = ARRAY_SIZE(nor_flash_partitions),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource nor_flash_resources[] = {
|
|
|
|
[0] = {
|
|
|
|
.start = 0x00000000,
|
|
|
|
.end = 0x01ffffff,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device nor_flash_device = {
|
|
|
|
.name = "physmap-flash",
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &nor_flash_data,
|
|
|
|
},
|
|
|
|
.num_resources = ARRAY_SIZE(nor_flash_resources),
|
|
|
|
.resource = nor_flash_resources,
|
|
|
|
};
|
|
|
|
|
2007-02-13 09:42:28 +03:00
|
|
|
static struct platform_device *sh7343se_platform_devices[] __initdata = {
|
2006-09-27 13:09:34 +04:00
|
|
|
&smc91x_device,
|
2007-02-13 09:42:28 +03:00
|
|
|
&heartbeat_device,
|
2008-07-07 16:11:54 +04:00
|
|
|
&nor_flash_device,
|
2006-09-27 13:09:34 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static int __init sh7343se_devices_setup(void)
|
|
|
|
{
|
2007-02-13 09:42:28 +03:00
|
|
|
return platform_add_devices(sh7343se_platform_devices,
|
|
|
|
ARRAY_SIZE(sh7343se_platform_devices));
|
2006-09-27 13:09:34 +04:00
|
|
|
}
|
2008-07-07 16:11:54 +04:00
|
|
|
device_initcall(sh7343se_devices_setup);
|
2006-09-27 13:09:34 +04:00
|
|
|
|
2008-07-07 16:11:54 +04:00
|
|
|
/*
|
|
|
|
* Initialize the board
|
|
|
|
*/
|
2006-09-27 13:09:34 +04:00
|
|
|
static void __init sh7343se_setup(char **cmdline_p)
|
|
|
|
{
|
2008-07-07 16:11:54 +04:00
|
|
|
ctrl_outw(0xf900, FPGA_OUT); /* FPGA */
|
|
|
|
|
|
|
|
ctrl_outw(0x0002, PORT_PECR); /* PORT E 1 = IRQ5 */
|
|
|
|
ctrl_outw(0x0020, PORT_PSELD);
|
|
|
|
|
|
|
|
printk(KERN_INFO "MS7343CP01 Setup...done\n");
|
2006-09-27 13:09:34 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The Machine Vector
|
|
|
|
*/
|
2007-05-15 10:19:34 +04:00
|
|
|
static struct sh_machine_vector mv_7343se __initmv = {
|
2006-09-27 13:09:34 +04:00
|
|
|
.mv_name = "SolutionEngine 7343",
|
|
|
|
.mv_setup = sh7343se_setup,
|
|
|
|
.mv_nr_irqs = 108,
|
|
|
|
.mv_inb = sh7343se_inb,
|
|
|
|
.mv_inw = sh7343se_inw,
|
|
|
|
.mv_inl = sh7343se_inl,
|
|
|
|
.mv_outb = sh7343se_outb,
|
|
|
|
.mv_outw = sh7343se_outw,
|
|
|
|
.mv_outl = sh7343se_outl,
|
|
|
|
|
|
|
|
.mv_inb_p = sh7343se_inb_p,
|
|
|
|
.mv_inw_p = sh7343se_inw,
|
|
|
|
.mv_inl_p = sh7343se_inl,
|
|
|
|
.mv_outb_p = sh7343se_outb_p,
|
|
|
|
.mv_outw_p = sh7343se_outw,
|
|
|
|
.mv_outl_p = sh7343se_outl,
|
|
|
|
|
|
|
|
.mv_insb = sh7343se_insb,
|
|
|
|
.mv_insw = sh7343se_insw,
|
|
|
|
.mv_insl = sh7343se_insl,
|
|
|
|
.mv_outsb = sh7343se_outsb,
|
|
|
|
.mv_outsw = sh7343se_outsw,
|
|
|
|
.mv_outsl = sh7343se_outsl,
|
|
|
|
|
|
|
|
.mv_init_irq = init_7343se_IRQ,
|
|
|
|
};
|