linux/arch/mips/mti-sead3/sead3-mtd.c
<<
>>
Prefs
   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) 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>
  11
  12static struct mtd_partition sead3_mtd_partitions[] = {
  13        {
  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
  22        },
  23};
  24
  25static struct physmap_flash_data sead3_flash_data = {
  26        .width          = 4,
  27        .nr_parts       = ARRAY_SIZE(sead3_mtd_partitions),
  28        .parts          = sead3_mtd_partitions
  29};
  30
  31static struct resource sead3_flash_resource = {
  32        .start          = 0x1c000000,
  33        .end            = 0x1dffffff,
  34        .flags          = IORESOURCE_MEM
  35};
  36
  37static struct platform_device sead3_flash = {
  38        .name           = "physmap-flash",
  39        .id             = 0,
  40        .dev            = {
  41                .platform_data  = &sead3_flash_data,
  42        },
  43        .num_resources  = 1,
  44        .resource       = &sead3_flash_resource,
  45};
  46
  47static int __init sead3_mtd_init(void)
  48{
  49        platform_device_register(&sead3_flash);
  50
  51        return 0;
  52}
  53
  54module_init(sead3_mtd_init)
  55