2 * Renesas Technology Europe RSK+ 7201 Support.
4 * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk>
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/init.h>
11 #include <linux/types.h>
12 #include <linux/platform_device.h>
13 #include <linux/interrupt.h>
14 #include <linux/mtd/mtd.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mtd/physmap.h>
17 #include <linux/mtd/map.h>
18 #include <asm/machvec.h>
21 static const char *probes[] = { "cmdlinepart", NULL };
23 static struct mtd_partition *parsed_partitions;
25 static struct mtd_partition rsk7201_partitions[] = {
30 .mask_flags = MTD_WRITEABLE,
33 .offset = MTDPART_OFS_NXTBLK,
37 .offset = MTDPART_OFS_NXTBLK,
38 .size = MTDPART_SIZ_FULL,
42 static struct physmap_flash_data flash_data = {
46 static struct resource flash_resource = {
49 .flags = IORESOURCE_MEM,
52 static struct platform_device flash_device = {
53 .name = "physmap-flash",
55 .resource = &flash_resource,
58 .platform_data = &flash_data,
62 static struct mtd_info *flash_mtd;
64 static struct map_info rsk7201_flash_map = {
70 static void __init set_mtd_partitions(void)
74 simple_map_init(&rsk7201_flash_map);
75 flash_mtd = do_map_probe("cfi_probe", &rsk7201_flash_map);
76 nr_parts = parse_mtd_partitions(flash_mtd, probes,
77 &parsed_partitions, 0);
78 /* If there is no partition table, used the hard coded table */
80 flash_data.parts = rsk7201_partitions;
81 flash_data.nr_parts = ARRAY_SIZE(rsk7201_partitions);
83 flash_data.nr_parts = nr_parts;
84 flash_data.parts = parsed_partitions;
88 static struct platform_device *rsk7201_devices[] __initdata = {
92 static int __init rsk7201_devices_setup(void)
95 return platform_add_devices(rsk7201_devices,
96 ARRAY_SIZE(rsk7201_devices));
98 device_initcall(rsk7201_devices_setup);
103 static struct sh_machine_vector mv_rsk7201 __initmv = {
104 .mv_name = "RSK+7201",