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 <linux/gpio.h>
20 #include <linux/leds.h>
21 #include <asm/machvec.h>
23 #include <cpu/sh7203.h>
25 static struct smc911x_platdata smc911x_info
= {
26 .flags
= SMC911X_USE_16BIT
,
27 .irq_flags
= IRQF_TRIGGER_LOW
,
30 static struct resource smc911x_resources
[] = {
33 .end
= 0x24000000 + 0x100,
34 .flags
= IORESOURCE_MEM
,
39 .flags
= IORESOURCE_IRQ
,
43 static struct platform_device smc911x_device
= {
46 .num_resources
= ARRAY_SIZE(smc911x_resources
),
47 .resource
= smc911x_resources
,
49 .platform_data
= &smc911x_info
,
53 static const char *probes
[] = { "cmdlinepart", NULL
};
55 static struct mtd_partition
*parsed_partitions
;
57 static struct mtd_partition rsk7203_partitions
[] = {
62 .mask_flags
= MTD_WRITEABLE
,
65 .offset
= MTDPART_OFS_NXTBLK
,
69 .offset
= MTDPART_OFS_NXTBLK
,
70 .size
= MTDPART_SIZ_FULL
,
74 static struct physmap_flash_data flash_data
= {
78 static struct resource flash_resource
= {
81 .flags
= IORESOURCE_MEM
,
84 static struct platform_device flash_device
= {
85 .name
= "physmap-flash",
87 .resource
= &flash_resource
,
90 .platform_data
= &flash_data
,
94 static struct mtd_info
*flash_mtd
;
96 static struct map_info rsk7203_flash_map
= {
102 static void __init
set_mtd_partitions(void)
106 simple_map_init(&rsk7203_flash_map
);
107 flash_mtd
= do_map_probe("cfi_probe", &rsk7203_flash_map
);
108 nr_parts
= parse_mtd_partitions(flash_mtd
, probes
,
109 &parsed_partitions
, 0);
110 /* If there is no partition table, used the hard coded table */
112 flash_data
.parts
= rsk7203_partitions
;
113 flash_data
.nr_parts
= ARRAY_SIZE(rsk7203_partitions
);
115 flash_data
.nr_parts
= nr_parts
;
116 flash_data
.parts
= parsed_partitions
;
120 static struct gpio_led rsk7203_gpio_leds
[] = {
127 .default_trigger
= "nand-disk",
132 .default_trigger
= "timer",
136 .name
= "red:heartbeat",
137 .default_trigger
= "heartbeat",
143 static struct gpio_led_platform_data rsk7203_gpio_leds_info
= {
144 .leds
= rsk7203_gpio_leds
,
145 .num_leds
= ARRAY_SIZE(rsk7203_gpio_leds
),
148 static struct platform_device led_device
= {
152 .platform_data
= &rsk7203_gpio_leds_info
,
156 static struct platform_device
*rsk7203_devices
[] __initdata
= {
162 static int __init
rsk7203_devices_setup(void)
164 /* Select pins for SCIF0 */
165 gpio_request(GPIO_FN_TXD0
, NULL
);
166 gpio_request(GPIO_FN_RXD0
, NULL
);
168 set_mtd_partitions();
169 return platform_add_devices(rsk7203_devices
,
170 ARRAY_SIZE(rsk7203_devices
));
172 device_initcall(rsk7203_devices_setup
);
177 static struct sh_machine_vector mv_rsk7203 __initmv
= {
178 .mv_name
= "RSK+7203",