RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / mips / mti-sead3 / sead3-mtd.c
blob30450b4b00c93cf09b0e2a9d3bf4f67275344553
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) 2006 MIPS Technologies, Inc.
7 * written by Ralf Baechle <ralf@linux-mips.org>
8 */
10 #include <linux/init.h>
11 #include <linux/platform_device.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <mtd/mtd-abi.h>
16 static struct mtd_partition sead3_mtd_partitions[] = {
18 .name = "User FS",
19 .offset = 0x00000000,
20 .size = 0x01fc0000,
21 }, {
22 .name = "Board Config",
23 .offset = 0x01fc0000,
24 .size = 0x00040000,
25 .mask_flags = MTD_WRITEABLE
29 static struct physmap_flash_data sead3_flash_data = {
30 .width = 4,
31 .nr_parts = ARRAY_SIZE(sead3_mtd_partitions),
32 .parts = sead3_mtd_partitions
35 static struct resource sead3_flash_resource = {
36 .start = 0x1c000000,
37 .end = 0x1dffffff,
38 .flags = IORESOURCE_MEM
41 static struct platform_device sead3_flash = {
42 .name = "physmap-flash",
43 .id = 0,
44 .dev = {
45 .platform_data = &sead3_flash_data,
47 .num_resources = 1,
48 .resource = &sead3_flash_resource,
51 static int __init sead3_mtd_init(void)
53 platform_device_register(&sead3_flash);
55 return 0;
58 module_init(sead3_mtd_init)