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/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 <linux/smc911x.h>
19 #include <asm/machvec.h>
22 static struct smc911x_platdata smc911x_info = {
23 .flags = SMC911X_USE_16BIT,
24 .irq_flags = IRQF_TRIGGER_LOW,
27 static struct resource smc911x_resources[] = {
30 .end = 0x24000000 + 0x100,
31 .flags = IORESOURCE_MEM,
36 .flags = IORESOURCE_IRQ,
40 static struct platform_device smc911x_device = {
43 .num_resources = ARRAY_SIZE(smc911x_resources),
44 .resource = smc911x_resources,
46 .platform_data = &smc911x_info,
50 static const char *probes[] = { "cmdlinepart", NULL };
52 static struct mtd_partition *parsed_partitions;
54 static struct mtd_partition rsk7203_partitions[] = {
59 .mask_flags = MTD_WRITEABLE,
62 .offset = MTDPART_OFS_NXTBLK,
66 .offset = MTDPART_OFS_NXTBLK,
67 .size = MTDPART_SIZ_FULL,
71 static struct physmap_flash_data flash_data = {
75 static struct resource flash_resource = {
78 .flags = IORESOURCE_MEM,
81 static struct platform_device flash_device = {
82 .name = "physmap-flash",
84 .resource = &flash_resource,
87 .platform_data = &flash_data,
91 static struct mtd_info *flash_mtd;
93 static struct map_info rsk7203_flash_map = {
99 static void __init set_mtd_partitions(void)
103 simple_map_init(&rsk7203_flash_map);
104 flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
105 nr_parts = parse_mtd_partitions(flash_mtd, probes,
106 &parsed_partitions, 0);
107 /* If there is no partition table, used the hard coded table */
109 flash_data.parts = rsk7203_partitions;
110 flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
112 flash_data.nr_parts = nr_parts;
113 flash_data.parts = parsed_partitions;
118 static struct platform_device *rsk7203_devices[] __initdata = {
123 static int __init rsk7203_devices_setup(void)
125 set_mtd_partitions();
126 return platform_add_devices(rsk7203_devices,
127 ARRAY_SIZE(rsk7203_devices));
129 device_initcall(rsk7203_devices_setup);
134 static struct sh_machine_vector mv_rsk7203 __initmv = {
135 .mv_name = "RSK+7203",