Linux 3.17-rc2
[linux/fpc-iii.git] / arch / mips / mti-sead3 / sead3-mtd.c
blobf9c890d726779447b8f6f757f816d0bd25da0dab
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
7 */
8 #include <linux/init.h>
9 #include <linux/platform_device.h>
10 #include <linux/mtd/physmap.h>
12 static struct mtd_partition sead3_mtd_partitions[] = {
14 .name = "User FS",
15 .offset = 0x00000000,
16 .size = 0x01fc0000,
17 }, {
18 .name = "Board Config",
19 .offset = 0x01fc0000,
20 .size = 0x00040000,
21 .mask_flags = MTD_WRITEABLE
25 static struct physmap_flash_data sead3_flash_data = {
26 .width = 4,
27 .nr_parts = ARRAY_SIZE(sead3_mtd_partitions),
28 .parts = sead3_mtd_partitions
31 static struct resource sead3_flash_resource = {
32 .start = 0x1c000000,
33 .end = 0x1dffffff,
34 .flags = IORESOURCE_MEM
37 static struct platform_device sead3_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &sead3_flash_data,
43 .num_resources = 1,
44 .resource = &sead3_flash_resource,
47 static int __init sead3_mtd_init(void)
49 platform_device_register(&sead3_flash);
51 return 0;
53 device_initcall(sead3_mtd_init);