[PATCH v2] MTD: lantiq: handle NO_XIP on cfi0001 flash
Hauke Mehrtens
hauke at hauke-m.de
Mon Jun 6 13:35:41 PDT 2016
From: John Crispin <john at phrozen.org>
This uses the same device tree attribute as physmap_of.c
Signed-off-by: John Crispin <john at phrozen.org>
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
drivers/mtd/maps/lantiq-flash.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
index c8febb3..88fc6d9 100644
--- a/drivers/mtd/maps/lantiq-flash.c
+++ b/drivers/mtd/maps/lantiq-flash.c
@@ -137,7 +137,11 @@ ltq_mtd_probe(struct platform_device *pdev)
if (!ltq_mtd->map)
return -ENOMEM;
- ltq_mtd->map->phys = ltq_mtd->res->start;
+ if (of_find_property(pdev->dev.of_node, "no-unaligned-direct-access",
+ NULL))
+ ltq_mtd->map->phys = NO_XIP;
+ else
+ ltq_mtd->map->phys = ltq_mtd->res->start;
ltq_mtd->map->size = resource_size(ltq_mtd->res);
ltq_mtd->map->virt = devm_ioremap_resource(&pdev->dev, ltq_mtd->res);
if (IS_ERR(ltq_mtd->map->virt))
--
2.8.1
More information about the linux-mtd
mailing list