]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: nomadik: add FSMC NAND
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 5 Jan 2013 21:28:32 +0000 (22:28 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 28 Jan 2013 22:24:36 +0000 (23:24 +0100)
This adds the FSMC NAND driver and flash partitions to the Nomadik
device tree.

The only compatible string accepted by this driver is currently
"st,spear600-fsmc-nand" which is inappropriate for this system, so
this patch adds the compatible value "stericsson,fsmc-nand" as
well.

Cc: linux-mtd@vger.kernel.org
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/devicetree/bindings/mtd/fsmc-nand.txt
arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
arch/arm/mach-nomadik/cpu-8815.c
drivers/mtd/nand/fsmc_nand.c

index e3ea32e7de3e763bae2aa515375ee8ea8ccd5efd..2240ac09f6ba05cf1bea9aaa6788d01b9c3583e4 100644 (file)
@@ -1,7 +1,7 @@
 * FSMC NAND
 
 Required properties:
-- compatible : "st,spear600-fsmc-nand"
+- compatible : "st,spear600-fsmc-nand", "stericsson,fsmc-nand"
 - reg : Address range of the mtd chip
 - reg-names: Should contain the reg names "fsmc_regs", "nand_data", "nand_addr" and "nand_cmd"
 
index 88fb98f910cf29cff18a452b442ef0137e363f5b..c73df370373bd2af13cb767a0bbd4baf55475892 100644 (file)
                interrupts = <5>;
        };
 
+       /* A NAND flash of 128 MiB */
+       fsmc: flash@40000000 {
+               compatible = "stericsson,fsmc-nand";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               reg = <0x10100000 0x1000>,      /* FSMC Register*/
+                       <0x40000000 0x2000>,    /* NAND Base DATA */
+                       <0x41000000 0x2000>,    /* NAND Base ADDR */
+                       <0x40800000 0x2000>;    /* NAND Base CMD */
+               reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
+               status = "okay";
+
+               partition@0 {
+               label = "X-Loader(NAND)";
+                       reg = <0x0 0x40000>;
+               };
+               partition@40000 {
+                       label = "MemInit(NAND)";
+                       reg = <0x40000 0x40000>;
+               };
+               partition@80000 {
+                       label = "BootLoader(NAND)";
+                       reg = <0x80000 0x200000>;
+               };
+               partition@280000 {
+                       label = "Kernel zImage(NAND)";
+                       reg = <0x280000 0x300000>;
+               };
+               partition@580000 {
+                       label = "Root Filesystem(NAND)";
+                       reg = <0x580000 0x1600000>;
+               };
+               partition@1b80000 {
+                       label = "User Filesystem(NAND)";
+                       reg = <0x1b80000 0x6480000>;
+               };
+       };
+
        amba {
                compatible = "arm,amba-bus";
                #address-cells = <1>;
index 8d071d2769b5f5c52880fbfee3a462c609d0dfbb..a3894ca45bb86da43b94d1133ad779e77d12d226 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
+#include <linux/mtd/fsmc.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -249,6 +250,17 @@ static void __init cpu8815_timer_init_of(void)
        nmdk_timer_init(base, irq);
 }
 
+static struct fsmc_nand_timings cpu8815_nand_timings = {
+       .thiz   = 0,
+       .thold  = 0x10,
+       .twait  = 0x0A,
+       .tset   = 0,
+};
+
+static struct fsmc_nand_platform_data cpu8815_nand_data = {
+       .nand_timings = &cpu8815_nand_timings,
+};
+
 /* These are mostly to get the right device names for the clock lookups */
 static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE,
@@ -259,6 +271,9 @@ static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
                "rng", NULL),
        OF_DEV_AUXDATA("arm,primecell", NOMADIK_RTC_BASE,
                "rtc-pl031", NULL),
+       OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
+               "fsmc-nand", &cpu8815_nand_data),
+
        { /* sentinel */ },
 };
 
index 67e62d3d495cce93a4d633937466c4c6a9524177..61043a92c0070cd0db991bffd9fd51ef12a0b293 100644 (file)
@@ -1218,6 +1218,7 @@ static SIMPLE_DEV_PM_OPS(fsmc_nand_pm_ops, fsmc_nand_suspend, fsmc_nand_resume);
 #ifdef CONFIG_OF
 static const struct of_device_id fsmc_nand_id_table[] = {
        { .compatible = "st,spear600-fsmc-nand" },
+       { .compatible = "stericsson,fsmc-nand" },
        {}
 };
 MODULE_DEVICE_TABLE(of, fsmc_nand_id_table);