From: 黄涛 Date: Mon, 25 Aug 2014 10:21:55 +0000 (+0800) Subject: misc: SRAM: Add option to map SRAM as cacheable X-Git-Tag: firefly_0821_release~4803 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=79082d3c51f21fafeb4eb9dd23440de35695d1d9;p=firefly-linux-kernel-4.4.55.git misc: SRAM: Add option to map SRAM as cacheable --- 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