/*1* Registration of Cobalt MTD device.2*3* Copyright (C) 2006 Yoichi Yuasa <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/19#include <linux/init.h>20#include <linux/platform_device.h>21#include <linux/mtd/partitions.h>22#include <linux/mtd/physmap.h>2324static struct mtd_partition cobalt_mtd_partitions[] = {25{26.name = "firmware",27.offset = 0x0,28.size = 0x80000,29},30};3132static struct physmap_flash_data cobalt_flash_data = {33.width = 1,34.nr_parts = 1,35.parts = cobalt_mtd_partitions,36};3738static struct resource cobalt_mtd_resource = {39.start = 0x1fc00000,40.end = 0x1fc7ffff,41.flags = IORESOURCE_MEM,42};4344static struct platform_device cobalt_mtd = {45.name = "physmap-flash",46.dev = {47.platform_data = &cobalt_flash_data,48},49.num_resources = 1,50.resource = &cobalt_mtd_resource,51};5253static int __init cobalt_mtd_init(void)54{55platform_device_register(&cobalt_mtd);5657return 0;58}5960module_init(cobalt_mtd_init);616263