2 * R8610 RDC321x platform devices
4 * Copyright (C) 2009, Florian Fainelli
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #include <linux/init.h>
24 #include <linux/mtd/physmap.h>
25 #include <linux/input.h>
27 #include <asm/rdc_boards.h>
29 static int __init
parse_r8610_partitions(struct mtd_info
*master
, struct mtd_partition
**pparts
, unsigned long plat_data
)
31 struct mtd_partition
*rdc_flash_parts
;
33 rdc_flash_parts
= kzalloc(sizeof(struct mtd_partition
) * 4, GFP_KERNEL
);
35 *pparts
= rdc_flash_parts
;
37 rdc_flash_parts
[0].name
= "kernel";
38 rdc_flash_parts
[0].size
= 0x001f0000;
39 rdc_flash_parts
[0].offset
= 0;
40 rdc_flash_parts
[1].name
= "config";
41 rdc_flash_parts
[1].size
= 0x10000;
42 rdc_flash_parts
[1].offset
= MTDPART_OFS_APPEND
;
43 rdc_flash_parts
[2].name
= "rootfs";
44 rdc_flash_parts
[2].size
= 0x1E0000;
45 rdc_flash_parts
[2].offset
= MTDPART_OFS_APPEND
;
46 rdc_flash_parts
[3].name
= "redboot";
47 rdc_flash_parts
[3].size
= 0x20000;
48 rdc_flash_parts
[3].offset
= MTDPART_OFS_APPEND
;
49 rdc_flash_parts
[3].mask_flags
= MTD_WRITEABLE
;
54 struct mtd_part_parser __initdata r8610_parser
= {
56 .parse_fn
= parse_r8610_partitions
,
60 static int __init
r8610_setup(void)
62 return register_mtd_parser(&r8610_parser
);
65 arch_initcall(r8610_setup
);