3 * (Compatible with Algo System ., LTD. - AP-320A)
5 * Copyright (C) 2008 Renesas Solutions Corp.
6 * Author : Yusuke Goda <goda.yuske@renesas.com>
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
13 #include <linux/init.h>
14 #include <linux/device.h>
15 #include <linux/platform_device.h>
16 #include <linux/mtd/physmap.h>
17 #include <linux/delay.h>
20 static struct resource smc9118_resources[] = {
24 .flags = IORESOURCE_MEM,
29 .flags = IORESOURCE_IRQ,
33 static struct platform_device smc9118_device = {
36 .num_resources = ARRAY_SIZE(smc9118_resources),
37 .resource = smc9118_resources,
40 static struct mtd_partition ap325rxa_nor_flash_partitions[] = {
44 .size = (1 * 1024 * 1024),
45 .mask_flags = MTD_WRITEABLE, /* Read-only */
48 .offset = MTDPART_OFS_APPEND,
49 .size = (2 * 1024 * 1024),
52 .offset = MTDPART_OFS_APPEND,
53 .size = MTDPART_SIZ_FULL,
57 static struct physmap_flash_data ap325rxa_nor_flash_data = {
59 .parts = ap325rxa_nor_flash_partitions,
60 .nr_parts = ARRAY_SIZE(ap325rxa_nor_flash_partitions),
63 static struct resource ap325rxa_nor_flash_resources[] = {
68 .flags = IORESOURCE_MEM,
72 static struct platform_device ap325rxa_nor_flash_device = {
73 .name = "physmap-flash",
74 .resource = ap325rxa_nor_flash_resources,
75 .num_resources = ARRAY_SIZE(ap325rxa_nor_flash_resources),
77 .platform_data = &ap325rxa_nor_flash_data,
81 static struct platform_device *ap325rxa_devices[] __initdata = {
83 &ap325rxa_nor_flash_device
86 static int __init ap325rxa_devices_setup(void)
88 return platform_add_devices(ap325rxa_devices,
89 ARRAY_SIZE(ap325rxa_devices));
91 device_initcall(ap325rxa_devices_setup);
93 #define MSTPCR0 (0xA4150030)
94 #define MSTPCR2 (0xA4150038)
96 static void __init ap325rxa_setup(char **cmdline_p)
98 /* enable VEU0 + VEU1 */
99 ctrl_outl(ctrl_inl(MSTPCR2) & ~0x00000044, MSTPCR2); /* bit 2 + 6 */
102 ctrl_outl(ctrl_inl(MSTPCR0) & ~0x00000001, MSTPCR0); /* bit 0 */
105 static struct sh_machine_vector mv_ap325rxa __initmv = {
106 .mv_name = "AP-325RXA",
107 .mv_setup = ap325rxa_setup,