]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
of/mtd/nand: add generic binding and helper for NAND_BBT_NO_OOB_BBM
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 12 Jun 2014 11:40:06 +0000 (13:40 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Jul 2014 10:41:22 +0000 (12:41 +0200)
add a boolean property 'nand-no-oob-bbm' and helper function to be
able to set the NAND_BBT_NO_OOB_BBM flag in DT capable NAND drivers
and use it for i.MX and MXS nand drivers.

Documentation/devicetree/bindings/mtd/nand.txt
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
drivers/mtd/nand/mxc_nand.c
drivers/of/of_mtd.c
include/linux/of_mtd.h

index b53f92e252d4a7f48427ca1e123381dc04e91e41..e46bfbeb16e75077a1347ad98206dc1c580f24d6 100644 (file)
@@ -5,6 +5,7 @@
   "soft_bch".
 - nand-bus-width : 8 or 16 bus width if not present 8
 - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
+- nand-no-oob-bbm: boolean to disable writing bad block markers to flash
 
 - nand-ecc-strength: integer representing the number of bits to correct
                     per ECC step.
index 959cb9b7031077a460cc1e7c39bbd06d47c65152..37537b4406ac3101de3a640745c08b7b5003946c 100644 (file)
@@ -1724,6 +1724,9 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
        if (of_get_nand_on_flash_bbt(this->dev->of_node)) {
                chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
 
+               if (of_get_nand_no_oob_bbm(this->dev->of_node))
+                       chip->bbt_options |= NAND_BBT_NO_OOB_BBM;
+
                if (of_property_read_bool(this->dev->of_node,
                                                "fsl,no-blockmark-swap"))
                        this->swap_block_mark = false;
index dba262bf766ff197c3afe9db1c68e11ca12f7a2b..bb54a2ae68416f0d5ed8acba4f17e287f00f45d9 100644 (file)
@@ -1496,6 +1496,8 @@ static int mxcnd_probe(struct platform_device *pdev)
                this->bbt_md = &bbt_mirror_descr;
                /* update flash based bbt */
                this->bbt_options |= NAND_BBT_USE_FLASH;
+               if (of_get_nand_no_oob_bbm(pdev->dev.of_node))
+                       this->bbt_options |= NAND_BBT_NO_OOB_BBM;
        }
 
        init_completion(&host->op_completion);
index b7361ed705375e6e49dbfde3bd9d7fce4f0c97a2..d947acc0dd814281b9de9b92d5dad77ead4fe3c5 100644 (file)
@@ -117,3 +117,15 @@ bool of_get_nand_on_flash_bbt(struct device_node *np)
        return of_property_read_bool(np, "nand-on-flash-bbt");
 }
 EXPORT_SYMBOL_GPL(of_get_nand_on_flash_bbt);
+
+/**
+ * of_get_nand_no_oob_bbm - Get nand no oob bbm for given device_node
+ * @np:        Pointer to the given device_node
+ *
+ * return true if present, false otherwise
+ */
+bool of_get_nand_no_oob_bbm(struct device_node *np)
+{
+       return of_property_read_bool(np, "nand-no-oob-bbm");
+}
+EXPORT_SYMBOL_GPL(of_get_nand_no_oob_bbm);
index e266caa364029fafba52d443931f76d3758cc099..6ece1a95d35dcbb2c7695b2571bc88e2c629fa39 100644 (file)
@@ -17,6 +17,7 @@ int of_get_nand_ecc_step_size(struct device_node *np);
 int of_get_nand_ecc_strength(struct device_node *np);
 int of_get_nand_bus_width(struct device_node *np);
 bool of_get_nand_on_flash_bbt(struct device_node *np);
+bool of_get_nand_no_oob_bbm(struct device_node *np);
 
 #else /* CONFIG_OF_MTD */
 
@@ -45,6 +46,11 @@ static inline bool of_get_nand_on_flash_bbt(struct device_node *np)
        return false;
 }
 
+static inline bool of_get_nand_no_oob_bbm(struct device_node *np)
+{
+       return false;
+}
+
 #endif /* CONFIG_OF_MTD */
 
 #endif /* __LINUX_OF_MTD_H */