Root/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/boards/r8610.c

1/*
2 * R8610 RDC321x platform devices
3 *
4 * Copyright (C) 2009, Florian Fainelli
5 *
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.
10 *
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.
15 *
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.
20 *
21 */
22
23#include <linux/init.h>
24#include <linux/mtd/physmap.h>
25#include <linux/input.h>
26
27#include <asm/rdc_boards.h>
28
29static int __init parse_r8610_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long plat_data)
30{
31    struct mtd_partition *rdc_flash_parts;
32    
33    rdc_flash_parts = kzalloc(sizeof(struct mtd_partition) * 4, GFP_KERNEL);
34    
35    *pparts = rdc_flash_parts;
36    
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;
50
51    return 4;
52}
53
54struct mtd_part_parser __initdata r8610_parser = {
55    .owner = THIS_MODULE,
56    .parse_fn = parse_r8610_partitions,
57    .name = "R8610",
58};
59
60static int __init r8610_setup(void)
61{
62    return register_mtd_parser(&r8610_parser);
63}
64
65arch_initcall(r8610_setup);
66

Archive Download this file



interactive