summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2013-07-29 14:09:55 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:42:30 +0900
commitab84897c9691256ed00a57b408725f7be09945bf (patch)
treee24cd8cc2806664f32421e0a644cba4450e40c3b /include
parentebeb950298b69d5459888f581fbb76fd881ed0e7 (diff)
downloadlinux-3.10-ab84897c9691256ed00a57b408725f7be09945bf.tar.gz
linux-3.10-ab84897c9691256ed00a57b408725f7be09945bf.tar.bz2
linux-3.10-ab84897c9691256ed00a57b408725f7be09945bf.zip
drivers: of: add initialization code for dma reserved memory
This patch adds device tree support for contiguous and reserved memory regions defined in device tree. Large memory blocks can be reliably reserved only during early boot. This must happen before the whole memory management subsystem is initialized, because we need to ensure that the given contiguous blocks are not yet allocated by kernel. Also it must happen before kernel mappings for the whole low memory are created, to ensure that there will be no mappings (for reserved blocks) or mapping with special properties can be created (for CMA blocks). This all happens before device tree structures are unflattened, so we need to get reserved memory layout directly from fdt. Later, those reserved memory regions are assigned to devices on each device structure initialization. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Acked-by: Tomasz Figa <t.figa@samsung.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/of_reserved_mem.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h
new file mode 100644
index 00000000000..c8412825581
--- /dev/null
+++ b/include/linux/of_reserved_mem.h
@@ -0,0 +1,14 @@
+#ifndef __OF_RESERVED_MEM_H
+#define __OF_RESERVED_MEM_H
+
+#ifdef CONFIG_OF_RESERVED_MEM
+void of_reserved_mem_device_init(struct device *dev);
+void of_reserved_mem_device_release(struct device *dev);
+void early_init_dt_scan_reserved_mem(void);
+#else
+static inline void of_reserved_mem_device_init(struct device *dev) { }
+static inline void of_reserved_mem_device_release(struct device *dev) { }
+static inline void early_init_dt_scan_reserved_mem(void) { }
+#endif
+
+#endif /* __OF_RESERVED_MEM_H */