[ARM] 4981/1: [KS8695] Simple LED driver
[safe/jmp/linux-2.6] / arch / arm / mach-at91 / board-csb637.c
index 7746094..c5c721d 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/hardware.h>
 #include <asm/setup.h>
@@ -81,6 +82,42 @@ static struct at91_udc_data __initdata csb637_udc_data = {
        .pullup_pin   = AT91_PIN_PB1,
 };
 
+#define CSB_FLASH_BASE AT91_CHIPSELECT_0
+#define CSB_FLASH_SIZE 0x1000000
+
+static struct mtd_partition csb_flash_partitions[] = {
+       {
+               .name           = "uMON flash",
+               .offset         = 0,
+               .size           = MTDPART_SIZ_FULL,
+               .mask_flags     = MTD_WRITEABLE,        /* read only */
+       }
+};
+
+static struct physmap_flash_data csb_flash_data = {
+       .width          = 2,
+       .parts          = csb_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(csb_flash_partitions),
+};
+
+static struct resource csb_flash_resources[] = {
+       {
+               .start  = CSB_FLASH_BASE,
+               .end    = CSB_FLASH_BASE + CSB_FLASH_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device csb_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+                               .platform_data = &csb_flash_data,
+                       },
+       .resource       = csb_flash_resources,
+       .num_resources  = ARRAY_SIZE(csb_flash_resources),
+};
+
 static void __init csb637_board_init(void)
 {
        /* Serial */
@@ -92,9 +129,11 @@ static void __init csb637_board_init(void)
        /* USB Device */
        at91_add_device_udc(&csb637_udc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* SPI */
        at91_add_device_spi(NULL, 0);
+       /* NOR flash */
+       platform_device_register(&csb_flash);
 }
 
 MACHINE_START(CSB637, "Cogent CSB637")