2 * Renesas Technology Europe RSK+ 7203 Support.
4 * Copyright (C) 2008 Paul Mundt
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/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/mtd/map.h>
17 #include <asm/machvec.h>
20 static struct resource smc911x_resources[] = {
23 .end = 0x24000000 + 0x100,
24 .flags = IORESOURCE_MEM,
29 .flags = IORESOURCE_IRQ,
33 static struct platform_device smc911x_device = {
36 .num_resources = ARRAY_SIZE(smc911x_resources),
37 .resource = smc911x_resources,
40 static const char *probes[] = { "cmdlinepart", NULL };
42 static struct mtd_partition *parsed_partitions;
44 static struct mtd_partition rsk7203_partitions[] = {
49 .mask_flags = MTD_WRITEABLE,
52 .offset = MTDPART_OFS_NXTBLK,
56 .offset = MTDPART_OFS_NXTBLK,
57 .size = MTDPART_SIZ_FULL,
61 static struct physmap_flash_data flash_data = {
65 static struct resource flash_resource = {
68 .flags = IORESOURCE_MEM,
71 static struct platform_device flash_device = {
72 .name = "physmap-flash",
74 .resource = &flash_resource,
77 .platform_data = &flash_data,
81 static struct mtd_info *flash_mtd;
83 static struct map_info rsk7203_flash_map = {
89 static void __init set_mtd_partitions(void)
93 simple_map_init(&rsk7203_flash_map);
94 flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
95 nr_parts = parse_mtd_partitions(flash_mtd, probes,
96 &parsed_partitions, 0);
97 /* If there is no partition table, used the hard coded table */
99 flash_data.parts = rsk7203_partitions;
100 flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
102 flash_data.nr_parts = nr_parts;
103 flash_data.parts = parsed_partitions;
108 static struct platform_device *rsk7203_devices[] __initdata = {
113 static int __init rsk7203_devices_setup(void)
115 set_mtd_partitions();
116 return platform_add_devices(rsk7203_devices,
117 ARRAY_SIZE(rsk7203_devices));
119 device_initcall(rsk7203_devices_setup);
124 static struct sh_machine_vector mv_rsk7203 __initmv = {
125 .mv_name = "RSK+7203",