diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2012-11-02 10:22:41 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> | 2012-11-15 12:50:30 -0500 |
commit | 192afdbfbc5c3346e27b3c3e3be8337495b2a41b (patch) | |
tree | 3fba2b0dc131373680a809557f68a9c7f7e62547 | |
parent | 6f9f59ee2e254a7e997985d8eb708930da49245a (diff) |
mtd: davinci: add support for parition binding nodes
Enhance the driver to support partition subnodes inside the nand
device bindings to describe partions on the nand device.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r-- | Documentation/devicetree/bindings/arm/davinci/nand.txt | 8 | ||||
-rw-r--r-- | drivers/mtd/nand/davinci_nand.c | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/arm/davinci/nand.txt b/Documentation/devicetree/bindings/arm/davinci/nand.txt index e37241f1fdd8..4746452c4f5d 100644 --- a/Documentation/devicetree/bindings/arm/davinci/nand.txt +++ b/Documentation/devicetree/bindings/arm/davinci/nand.txt | |||
@@ -23,6 +23,9 @@ Recommended properties : | |||
23 | - ti,davinci-nand-buswidth: buswidth 8 or 16 | 23 | - ti,davinci-nand-buswidth: buswidth 8 or 16 |
24 | - ti,davinci-nand-use-bbt: use flash based bad block table support. | 24 | - ti,davinci-nand-use-bbt: use flash based bad block table support. |
25 | 25 | ||
26 | nand device bindings may contain additional sub-nodes describing | ||
27 | partitions of the address space. See partition.txt for more detail. | ||
28 | |||
26 | Example (enbw_cmc board): | 29 | Example (enbw_cmc board): |
27 | aemif@60000000 { | 30 | aemif@60000000 { |
28 | compatible = "ti,davinci-aemif"; | 31 | compatible = "ti,davinci-aemif"; |
@@ -47,5 +50,10 @@ aemif@60000000 { | |||
47 | ti,davinci-ecc-mode = "hw"; | 50 | ti,davinci-ecc-mode = "hw"; |
48 | ti,davinci-ecc-bits = <4>; | 51 | ti,davinci-ecc-bits = <4>; |
49 | ti,davinci-nand-use-bbt; | 52 | ti,davinci-nand-use-bbt; |
53 | |||
54 | partition@180000 { | ||
55 | label = "ubifs"; | ||
56 | reg = <0x180000 0x7e80000>; | ||
57 | }; | ||
50 | }; | 58 | }; |
51 | }; | 59 | }; |
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 945047ad0952..3502606f6480 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c | |||
@@ -821,9 +821,16 @@ syndrome_done: | |||
821 | if (ret < 0) | 821 | if (ret < 0) |
822 | goto err_scan; | 822 | goto err_scan; |
823 | 823 | ||
824 | ret = mtd_device_parse_register(&info->mtd, NULL, NULL, pdata->parts, | 824 | if (pdata->parts) |
825 | pdata->nr_parts); | 825 | ret = mtd_device_parse_register(&info->mtd, NULL, NULL, |
826 | 826 | pdata->parts, pdata->nr_parts); | |
827 | else { | ||
828 | struct mtd_part_parser_data ppdata; | ||
829 | |||
830 | ppdata.of_node = pdev->dev.of_node; | ||
831 | ret = mtd_device_parse_register(&info->mtd, NULL, &ppdata, | ||
832 | NULL, 0); | ||
833 | } | ||
827 | if (ret < 0) | 834 | if (ret < 0) |
828 | goto err_scan; | 835 | goto err_scan; |
829 | 836 | ||