aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorMark Jackson <mpfj-list@newflow.co.uk>2013-04-19 16:08:28 -0400
committerTony Lindgren <tony@atomide.com>2013-05-16 11:53:22 -0400
commit496c8a0bbb726c2608b3b1318d231ab04a9a2ec3 (patch)
tree2e8bea0925efe644bb64fec913329c10eb9576a1 /arch/arm/mach-omap2
parent4d5843616d16eb1a5851a976ec82b8d436233ad7 (diff)
ARM: OMAP2+: Allow NAND transfer mode to be specified in DT
OMAP devices support various NAND transfer modes. Currently all device-tree definitions will use the default "prefetch polled" mode, so this patch enables the transfer mode to be specified in the device-tree. Signed-off-by: Mark Jackson <mpfj@newflow.co.uk> Acked-by: Pekon Gupta <pekon@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/gpmc.c14
1 files changed, 14 insertions, 0 deletions
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;