2 * Renesas Technology Europe RSK+ Support.
4 * Copyright (C) 2008 Paul Mundt
5 * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk>
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
11 #include <linux/init.h>
12 #include <linux/types.h>
13 #include <linux/platform_device.h>
14 #include <linux/interrupt.h>
15 #include <linux/mtd/mtd.h>
16 #include <linux/mtd/partitions.h>
17 #include <linux/mtd/physmap.h>
18 #include <linux/mtd/map.h>
19 #include <asm/machvec.h>
22 static const char *probes[] = { "cmdlinepart", NULL };
24 static struct mtd_partition *parsed_partitions;
26 static struct mtd_partition rsk_partitions[] = {
31 .mask_flags = MTD_WRITEABLE,
34 .offset = MTDPART_OFS_NXTBLK,
38 .offset = MTDPART_OFS_NXTBLK,
39 .size = MTDPART_SIZ_FULL,
43 static struct physmap_flash_data flash_data = {
47 static struct resource flash_resource = {
50 .flags = IORESOURCE_MEM,
53 static struct platform_device flash_device = {
54 .name = "physmap-flash",
56 .resource = &flash_resource,
59 .platform_data = &flash_data,
63 static struct mtd_info *flash_mtd;
65 static struct map_info rsk_flash_map = {
71 static void __init set_mtd_partitions(void)
75 simple_map_init(&rsk_flash_map);
76 flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map);
77 nr_parts = parse_mtd_partitions(flash_mtd, probes,
78 &parsed_partitions, 0);
79 /* If there is no partition table, used the hard coded table */
81 flash_data.parts = rsk_partitions;
82 flash_data.nr_parts = ARRAY_SIZE(rsk_partitions);
84 flash_data.nr_parts = nr_parts;
85 flash_data.parts = parsed_partitions;
89 static struct platform_device *rsk_devices[] __initdata = {
93 static int __init rsk_devices_setup(void)
96 return platform_add_devices(rsk_devices,
97 ARRAY_SIZE(rsk_devices));
99 device_initcall(rsk_devices_setup);
104 static struct sh_machine_vector mv_rsk __initmv = {