• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/arch/mips/mti-sead3/
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.
5 *
6 * Copyright (C) 2006 MIPS Technologies, Inc.
7 *     written by Ralf Baechle <ralf@linux-mips.org>
8 */
9
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>
15
16static struct mtd_partition sead3_mtd_partitions[] = {
17	{
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
26	},
27};
28
29static struct physmap_flash_data sead3_flash_data = {
30	.width		= 4,
31	.nr_parts	= ARRAY_SIZE(sead3_mtd_partitions),
32	.parts		= sead3_mtd_partitions
33};
34
35static struct resource sead3_flash_resource = {
36	.start		= 0x1c000000,
37	.end		= 0x1dffffff,
38	.flags		= IORESOURCE_MEM
39};
40
41static struct platform_device sead3_flash = {
42	.name		= "physmap-flash",
43	.id		= 0,
44	.dev		= {
45		.platform_data	= &sead3_flash_data,
46	},
47	.num_resources	= 1,
48	.resource	= &sead3_flash_resource,
49};
50
51static int __init sead3_mtd_init(void)
52{
53	platform_device_register(&sead3_flash);
54
55	return 0;
56}
57
58module_init(sead3_mtd_init)
59