aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/mtd/gpmc-nand.txt8
-rw-r--r--arch/arm/mach-omap2/gpmc.c14
2 files changed, 22 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
index 6a983c1d87cd..df338cb5059c 100644
--- a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
@@ -29,6 +29,13 @@ Optional properties:
29 "bch4" 4-bit BCH ecc code 29 "bch4" 4-bit BCH ecc code
30 "bch8" 8-bit BCH ecc code 30 "bch8" 8-bit BCH ecc code
31 31
32 - ti,nand-xfer-type: A string setting the data transfer type. One of:
33
34 "prefetch-polled" Prefetch polled mode (default)
35 "polled" Polled mode, without prefetch
36 "prefetch-dma" Prefetch enabled sDMA mode
37 "prefetch-irq" Prefetch enabled irq mode
38
32 - elm_id: Specifies elm device node. This is required to support BCH 39 - elm_id: Specifies elm device node. This is required to support BCH
33 error correction using ELM module. 40 error correction using ELM module.
34 41
@@ -55,6 +62,7 @@ Example for an AM33xx board:
55 reg = <0 0 0>; /* CS0, offset 0 */ 62 reg = <0 0 0>; /* CS0, offset 0 */
56 nand-bus-width = <16>; 63 nand-bus-width = <16>;
57 ti,nand-ecc-opt = "bch8"; 64 ti,nand-ecc-opt = "bch8";
65 ti,nand-xfer-type = "polled";
58 66
59 gpmc,sync-clk-ps = <0>; 67 gpmc,sync-clk-ps = <0>;
60 gpmc,cs-on-ns = <0>; 68 gpmc,cs-on-ns = <0>;
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 6c4da1254f53..a195468286f4 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1345,6 +1345,13 @@ static const char * const nand_ecc_opts[] = {
1345 [OMAP_ECC_BCH8_CODE_HW] = "bch8", 1345 [OMAP_ECC_BCH8_CODE_HW] = "bch8",
1346}; 1346};
1347 1347
1348static const char * const nand_xfer_types[] = {
1349 [NAND_OMAP_PREFETCH_POLLED] = "prefetch-polled",
1350 [NAND_OMAP_POLLED] = "polled",
1351 [NAND_OMAP_PREFETCH_DMA] = "prefetch-dma",
1352 [NAND_OMAP_PREFETCH_IRQ] = "prefetch-irq",
1353};
1354
1348static int gpmc_probe_nand_child(struct platform_device *pdev, 1355static int gpmc_probe_nand_child(struct platform_device *pdev,
1349 struct device_node *child) 1356 struct device_node *child)
1350{ 1357{
@@ -1374,6 +1381,13 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
1374 break; 1381 break;
1375 } 1382 }
1376 1383
1384 if (!of_property_read_string(child, "ti,nand-xfer-type", &s))
1385 for (val = 0; val < ARRAY_SIZE(nand_xfer_types); val++)
1386 if (!strcasecmp(s, nand_xfer_types[val])) {
1387 gpmc_nand_data->xfer_type = val;
1388 break;
1389 }
1390
1377 val = of_get_nand_bus_width(child); 1391 val = of_get_nand_bus_width(child);
1378 if (val == 16) 1392 if (val == 16)
1379 gpmc_nand_data->devsize = NAND_BUSWIDTH_16; 1393 gpmc_nand_data->devsize = NAND_BUSWIDTH_16;