blob: 895f030070d37f95e7d2efde19047862763671d8 [file] [log] [blame]
Peter Griffin6feb3482008-11-28 22:56:45 +09001/*
Paul Mundtea0aac12008-12-08 14:32:03 +09002 * Renesas Technology Europe RSK+ Support.
Peter Griffin6feb3482008-11-28 22:56:45 +09003 *
Paul Mundtea0aac12008-12-08 14:32:03 +09004 * Copyright (C) 2008 Paul Mundt
Peter Griffin6feb3482008-11-28 22:56:45 +09005 * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk>
6 *
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
9 * for more details.
10 */
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>
20#include <asm/io.h>
21
Paul Mundt603129a2012-01-12 13:47:42 +090022static const char *part_probes[] = { "cmdlinepart", NULL };
23
Paul Mundtea0aac12008-12-08 14:32:03 +090024static struct mtd_partition rsk_partitions[] = {
Peter Griffin6feb3482008-11-28 22:56:45 +090025 {
26 .name = "Bootloader",
27 .offset = 0x00000000,
28 .size = 0x00040000,
29 .mask_flags = MTD_WRITEABLE,
30 }, {
31 .name = "Kernel",
32 .offset = MTDPART_OFS_NXTBLK,
33 .size = 0x001c0000,
34 }, {
35 .name = "Flash_FS",
36 .offset = MTDPART_OFS_NXTBLK,
37 .size = MTDPART_SIZ_FULL,
38 }
39};
40
41static struct physmap_flash_data flash_data = {
Paul Mundt603129a2012-01-12 13:47:42 +090042 .parts = rsk_partitions,
43 .nr_parts = ARRAY_SIZE(rsk_partitions),
44 .width = 2,
45 .part_probe_types = part_probes,
Peter Griffin6feb3482008-11-28 22:56:45 +090046};
47
48static struct resource flash_resource = {
49 .start = 0x20000000,
50 .end = 0x20400000,
51 .flags = IORESOURCE_MEM,
52};
53
54static struct platform_device flash_device = {
55 .name = "physmap-flash",
56 .id = -1,
57 .resource = &flash_resource,
58 .num_resources = 1,
59 .dev = {
60 .platform_data = &flash_data,
61 },
62};
63
Paul Mundtea0aac12008-12-08 14:32:03 +090064static struct platform_device *rsk_devices[] __initdata = {
Peter Griffin6feb3482008-11-28 22:56:45 +090065 &flash_device,
66};
67
Paul Mundtea0aac12008-12-08 14:32:03 +090068static int __init rsk_devices_setup(void)
Peter Griffin6feb3482008-11-28 22:56:45 +090069{
Paul Mundtea0aac12008-12-08 14:32:03 +090070 return platform_add_devices(rsk_devices,
71 ARRAY_SIZE(rsk_devices));
Peter Griffin6feb3482008-11-28 22:56:45 +090072}
Paul Mundtea0aac12008-12-08 14:32:03 +090073device_initcall(rsk_devices_setup);
Peter Griffin6feb3482008-11-28 22:56:45 +090074
75/*
76 * The Machine Vector
77 */
Paul Mundtea0aac12008-12-08 14:32:03 +090078static struct sh_machine_vector mv_rsk __initmv = {
79 .mv_name = "RSK+",
Peter Griffin6feb3482008-11-28 22:56:45 +090080};