0001
0002
0003
0004
0005
0006
0007 #include <linux/init.h>
0008 #include <linux/platform_device.h>
0009 #include <linux/mtd/partitions.h>
0010 #include <linux/mtd/physmap.h>
0011
0012 static struct mtd_partition cobalt_mtd_partitions[] = {
0013 {
0014 .name = "firmware",
0015 .offset = 0x0,
0016 .size = 0x80000,
0017 },
0018 };
0019
0020 static struct physmap_flash_data cobalt_flash_data = {
0021 .width = 1,
0022 .nr_parts = 1,
0023 .parts = cobalt_mtd_partitions,
0024 };
0025
0026 static struct resource cobalt_mtd_resource = {
0027 .start = 0x1fc00000,
0028 .end = 0x1fc7ffff,
0029 .flags = IORESOURCE_MEM,
0030 };
0031
0032 static struct platform_device cobalt_mtd = {
0033 .name = "physmap-flash",
0034 .dev = {
0035 .platform_data = &cobalt_flash_data,
0036 },
0037 .num_resources = 1,
0038 .resource = &cobalt_mtd_resource,
0039 };
0040
0041 static int __init cobalt_mtd_init(void)
0042 {
0043 platform_device_register(&cobalt_mtd);
0044
0045 return 0;
0046 }
0047 device_initcall(cobalt_mtd_init);