diff options
| author | Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> | 2013-12-17 08:37:56 -0500 |
|---|---|---|
| committer | Brian Norris <computersforpeace@gmail.com> | 2014-01-03 14:22:25 -0500 |
| commit | 75be1ea26b7153a8e09b02e26655a4d7daf3627e (patch) | |
| tree | 79bd8e3cd67ecdbecc5af8a60ff1cccdefef58c3 | |
| parent | 9ba51cff551515592c1657c509923da57b330b16 (diff) | |
mtd: nand: davinci: adjust DT properties to MTD generic
The properties davinci-ecc-mode, davinci-nand-use-bbt, davinci-nand-buswidth
are MTD generic. Correct names for them are: nand-ecc-mode, nand-on-flash-bbt,
nand-bus-width accordingly. So rename them in dts and documentation.
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| -rw-r--r-- | Documentation/devicetree/bindings/mtd/davinci-nand.txt | 25 | ||||
| -rw-r--r-- | drivers/mtd/nand/davinci_nand.c | 14 |
2 files changed, 30 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/mtd/davinci-nand.txt b/Documentation/devicetree/bindings/mtd/davinci-nand.txt index d2a3fc020023..befaa5bb84e5 100644 --- a/Documentation/devicetree/bindings/mtd/davinci-nand.txt +++ b/Documentation/devicetree/bindings/mtd/davinci-nand.txt | |||
| @@ -37,7 +37,7 @@ Recommended properties : | |||
| 37 | - ti,davinci-mask-chipsel: mask for chipselect address. Needed to mask | 37 | - ti,davinci-mask-chipsel: mask for chipselect address. Needed to mask |
| 38 | addresses for given chipselect. | 38 | addresses for given chipselect. |
| 39 | 39 | ||
| 40 | - ti,davinci-ecc-mode: operation mode of the NAND ecc mode. ECC mode | 40 | - nand-ecc-mode: operation mode of the NAND ecc mode. ECC mode |
| 41 | valid values for davinci driver: | 41 | valid values for davinci driver: |
| 42 | - "none" | 42 | - "none" |
| 43 | - "soft" | 43 | - "soft" |
| @@ -45,10 +45,25 @@ Recommended properties : | |||
| 45 | 45 | ||
| 46 | - ti,davinci-ecc-bits: used ECC bits, currently supported 1 or 4. | 46 | - ti,davinci-ecc-bits: used ECC bits, currently supported 1 or 4. |
| 47 | 47 | ||
| 48 | - ti,davinci-nand-buswidth: buswidth 8 or 16. | 48 | - nand-bus-width: buswidth 8 or 16. If not present 8. |
| 49 | |||
| 50 | - nand-on-flash-bbt: use flash based bad block table support. OOB | ||
| 51 | identifier is saved in OOB area. If not present | ||
| 52 | false. | ||
| 53 | |||
| 54 | Deprecated properties: | ||
| 55 | |||
| 56 | - ti,davinci-ecc-mode: operation mode of the NAND ecc mode. ECC mode | ||
| 57 | valid values for davinci driver: | ||
| 58 | - "none" | ||
| 59 | - "soft" | ||
| 60 | - "hw" | ||
| 61 | |||
| 62 | - ti,davinci-nand-buswidth: buswidth 8 or 16. If not present 8. | ||
| 49 | 63 | ||
| 50 | - ti,davinci-nand-use-bbt: use flash based bad block table support. OOB | 64 | - ti,davinci-nand-use-bbt: use flash based bad block table support. OOB |
| 51 | identifier is saved in OOB area. | 65 | identifier is saved in OOB area. If not present |
| 66 | false. | ||
| 52 | 67 | ||
| 53 | Nand device bindings may contain additional sub-nodes describing partitions of | 68 | Nand device bindings may contain additional sub-nodes describing partitions of |
| 54 | the address space. See partition.txt for more detail. The NAND Flash timing | 69 | the address space. See partition.txt for more detail. The NAND Flash timing |
| @@ -66,9 +81,9 @@ nand_cs3@62000000 { | |||
| 66 | ti,davinci-mask-ale = <0>; | 81 | ti,davinci-mask-ale = <0>; |
| 67 | ti,davinci-mask-cle = <0>; | 82 | ti,davinci-mask-cle = <0>; |
| 68 | ti,davinci-mask-chipsel = <0>; | 83 | ti,davinci-mask-chipsel = <0>; |
| 69 | ti,davinci-ecc-mode = "hw"; | 84 | nand-ecc-mode = "hw"; |
| 70 | ti,davinci-ecc-bits = <4>; | 85 | ti,davinci-ecc-bits = <4>; |
| 71 | ti,davinci-nand-use-bbt; | 86 | nand-on-flash-bbt; |
| 72 | 87 | ||
| 73 | partition@180000 { | 88 | partition@180000 { |
| 74 | label = "ubifs"; | 89 | label = "ubifs"; |
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index e6757b3a33b1..8a61a40f2ca9 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
| 36 | #include <linux/of_device.h> | 36 | #include <linux/of_device.h> |
| 37 | #include <linux/of.h> | 37 | #include <linux/of.h> |
| 38 | #include <linux/of_mtd.h> | ||
| 38 | 39 | ||
| 39 | #include <linux/platform_data/mtd-davinci.h> | 40 | #include <linux/platform_data/mtd-davinci.h> |
| 40 | #include <linux/platform_data/mtd-davinci-aemif.h> | 41 | #include <linux/platform_data/mtd-davinci-aemif.h> |
| @@ -534,7 +535,6 @@ static struct davinci_nand_pdata | |||
| 534 | struct davinci_nand_pdata *pdata; | 535 | struct davinci_nand_pdata *pdata; |
| 535 | const char *mode; | 536 | const char *mode; |
| 536 | u32 prop; | 537 | u32 prop; |
| 537 | int len; | ||
| 538 | 538 | ||
| 539 | pdata = devm_kzalloc(&pdev->dev, | 539 | pdata = devm_kzalloc(&pdev->dev, |
| 540 | sizeof(struct davinci_nand_pdata), | 540 | sizeof(struct davinci_nand_pdata), |
| @@ -558,6 +558,8 @@ static struct davinci_nand_pdata | |||
| 558 | "ti,davinci-mask-chipsel", &prop)) | 558 | "ti,davinci-mask-chipsel", &prop)) |
| 559 | pdata->mask_chipsel = prop; | 559 | pdata->mask_chipsel = prop; |
| 560 | if (!of_property_read_string(pdev->dev.of_node, | 560 | if (!of_property_read_string(pdev->dev.of_node, |
| 561 | "nand-ecc-mode", &mode) || | ||
| 562 | !of_property_read_string(pdev->dev.of_node, | ||
| 561 | "ti,davinci-ecc-mode", &mode)) { | 563 | "ti,davinci-ecc-mode", &mode)) { |
| 562 | if (!strncmp("none", mode, 4)) | 564 | if (!strncmp("none", mode, 4)) |
| 563 | pdata->ecc_mode = NAND_ECC_NONE; | 565 | pdata->ecc_mode = NAND_ECC_NONE; |
| @@ -569,12 +571,16 @@ static struct davinci_nand_pdata | |||
| 569 | if (!of_property_read_u32(pdev->dev.of_node, | 571 | if (!of_property_read_u32(pdev->dev.of_node, |
| 570 | "ti,davinci-ecc-bits", &prop)) | 572 | "ti,davinci-ecc-bits", &prop)) |
| 571 | pdata->ecc_bits = prop; | 573 | pdata->ecc_bits = prop; |
| 572 | if (!of_property_read_u32(pdev->dev.of_node, | 574 | |
| 575 | prop = of_get_nand_bus_width(pdev->dev.of_node); | ||
| 576 | if (0 < prop || !of_property_read_u32(pdev->dev.of_node, | ||
| 573 | "ti,davinci-nand-buswidth", &prop)) | 577 | "ti,davinci-nand-buswidth", &prop)) |
| 574 | if (prop == 16) | 578 | if (prop == 16) |
| 575 | pdata->options |= NAND_BUSWIDTH_16; | 579 | pdata->options |= NAND_BUSWIDTH_16; |
| 576 | if (of_find_property(pdev->dev.of_node, | 580 | if (of_property_read_bool(pdev->dev.of_node, |
| 577 | "ti,davinci-nand-use-bbt", &len)) | 581 | "nand-on-flash-bbt") || |
| 582 | of_property_read_bool(pdev->dev.of_node, | ||
| 583 | "ti,davinci-nand-use-bbt")) | ||
| 578 | pdata->bbt_options = NAND_BBT_USE_FLASH; | 584 | pdata->bbt_options = NAND_BBT_USE_FLASH; |
| 579 | } | 585 | } |
| 580 | 586 | ||
