From 79082d3c51f21fafeb4eb9dd23440de35695d1d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 25 Aug 2014 18:21:55 +0800 Subject: [PATCH] misc: SRAM: Add option to map SRAM as cacheable --- Documentation/devicetree/bindings/misc/sram.txt | 1 + drivers/misc/sram.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/misc/sram.txt b/Documentation/devicetree/bindings/misc/sram.txt index 4fa9af31a061..db6ee8e79100 100644 --- a/Documentation/devicetree/bindings/misc/sram.txt +++ b/Documentation/devicetree/bindings/misc/sram.txt @@ -11,6 +11,7 @@ Required properties: Optional properties: - map-exec: Map range to allow code execution +- map-cacheable: Map range as cacheable Example: diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index baa50080ac46..31f268c86885 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -53,6 +53,8 @@ static int sram_probe(struct platform_device *pdev) map_exec |= true; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (res && of_get_property(pdev->dev.of_node, "map-cacheable", NULL)) + res->flags |= IORESOURCE_CACHEABLE; if (map_exec) virt_base = devm_ioremap_exec_resource(&pdev->dev, res); else -- 2.34.1