Merge branch 'for-2.6.30' into for-2.6.31
[pandora-kernel.git] / arch / arm / mach-w90x900 / mach-w90p910evb.c
index 9ebc93f..726ff67 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/timer.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <mach/map.h>
 
 #include "cpu.h"
+/*w90p910 evb norflash driver data */
 
-static struct map_desc w90p910_iodesc[] __initdata = {
+#define W90P910_FLASH_BASE     0xA0000000
+#define W90P910_FLASH_SIZE     0x400000
+
+static struct mtd_partition w90p910_flash_partitions[] = {
+       {
+               .name   =       "NOR Partition 1 for kernel (960K)",
+               .size   =       0xF0000,
+               .offset =       0x10000,
+       },
+       {
+               .name   =       "NOR Partition 2 for image (1M)",
+               .size   =       0x100000,
+               .offset =       0x100000,
+       },
+       {
+               .name   =       "NOR Partition 3 for user (2M)",
+               .size   =       0x200000,
+               .offset =       0x00200000,
+       }
 };
 
-static struct w90x900_uartcfg w90p910_uartcfgs[] = {
-       W90X900_UARTCFG(0, 0, 0, 0, 0),
-       W90X900_UARTCFG(1, 0, 0, 0, 0),
-       W90X900_UARTCFG(2, 0, 0, 0, 0),
-       W90X900_UARTCFG(3, 0, 0, 0, 0),
-       W90X900_UARTCFG(4, 0, 0, 0, 0),
+static struct physmap_flash_data w90p910_flash_data = {
+       .width          =       2,
+       .parts          =       w90p910_flash_partitions,
+       .nr_parts       =       ARRAY_SIZE(w90p910_flash_partitions),
+};
+
+static struct resource w90p910_flash_resources[] = {
+       {
+               .start  =       W90P910_FLASH_BASE,
+               .end    =       W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1,
+               .flags  =       IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device w90p910_flash_device = {
+       .name           =       "physmap-flash",
+       .id             =       0,
+       .dev            = {
+                               .platform_data = &w90p910_flash_data,
+                       },
+       .resource       =       w90p910_flash_resources,
+       .num_resources  =       ARRAY_SIZE(w90p910_flash_resources),
+};
+
+static struct map_desc w90p910_iodesc[] __initdata = {
 };
 
 /*Here should be your evb resourse,such as LCD*/
 
 static struct platform_device *w90p910evb_dev[] __initdata = {
+       &w90p910_serial_device,
+       &w90p910_flash_device,
 };
 
 static void __init w90p910evb_map_io(void)
 {
        w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
        w90p910_init_clocks(0);
-       w90p910_init_uarts(w90p910_uartcfgs, ARRAY_SIZE(w90p910_uartcfgs));
 }
 
 static void __init w90p910evb_init(void)