ARM: MX3: add NOR flash support via physmap mtd driver
authorDaniel Mack <daniel@caiaq.de>
Thu, 19 Nov 2009 11:02:11 +0000 (12:02 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Thu, 19 Nov 2009 16:11:02 +0000 (17:11 +0100)
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx3/mx31lite.c

index 4651e2376a71af7bbd241596c858fa834665c1a6..def6b67365946dbe4cfe07e3b7244c4d44305ce3 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/spi/spi.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ulpi.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -180,6 +181,32 @@ static struct mxc_usbh_platform_data usbh2_pdata = {
        .flags  = MXC_EHCI_POWER_PINS_ENABLED,
 };
 
+/*
+ * NOR flash
+ */
+
+static struct physmap_flash_data nor_flash_data = {
+       .width  = 2,
+};
+
+static struct resource nor_flash_resource = {
+       .start  = 0xa0000000,
+       .end    = 0xa1ffffff,
+       .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device physmap_flash_device = {
+       .name   = "physmap-flash",
+       .id     = 0,
+       .dev    = {
+               .platform_data  = &nor_flash_data,
+       },
+       .resource = &nor_flash_resource,
+       .num_resources = 1,
+};
+
+
+
 /*
  * This structure defines the MX31 memory map.
  */
@@ -227,7 +254,10 @@ static void __init mxc_board_init(void)
        mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
                                      "mx31lite");
 
+       /* NOR and NAND flash */
+       platform_device_register(&physmap_flash_device);
        mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info);
+
        mxc_register_device(&mxc_spi_device1, &spi1_pdata);
        spi_register_board_info(&mc13783_spi_dev, 1);