summaryrefslogtreecommitdiffstats
path: root/drivers/of/mem_generic.c
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2013-05-12 23:54:03 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-13 21:17:10 +0200
commit74c4acea0dbc8a270e584c01f13f61dcc87e4cbd (patch)
treecdd78ef67a06bfc18d9d5b57c6616b3096f1806d /drivers/of/mem_generic.c
parent8b35646356f778287c11971cc8d464aa579f0421 (diff)
downloadbarebox-74c4acea0dbc8a270e584c01f13f61dcc87e4cbd.tar.gz
barebox-74c4acea0dbc8a270e584c01f13f61dcc87e4cbd.tar.xz
of: separate out "generic" memory bank adding
This patch separates out the "generic" memory segment registration function (of_add_memory_bank()) from of_add_memory(). The MIPS architecture has different view on memory resources than the ARM and PPC architectures so the "generic" of_add_memory_bank() is unusable for the MIPS architecture. We can add MIPS-specific of_add_memory_bank() into arch/mips code. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/of/mem_generic.c')
-rw-r--r--drivers/of/mem_generic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/of/mem_generic.c b/drivers/of/mem_generic.c
new file mode 100644
index 0000000000..9094243c04
--- /dev/null
+++ b/drivers/of/mem_generic.c
@@ -0,0 +1,15 @@
+#include <common.h>
+#include <of.h>
+#include <memory.h>
+
+void of_add_memory_bank(struct device_node *node, bool dump, int r,
+ u64 base, u64 size)
+{
+ static char str[6];
+
+ sprintf(str, "ram%d", r);
+ barebox_add_memory_bank(str, base, size);
+
+ if (dump)
+ pr_info("%s: %s: 0x%llx@0x%llx\n", node->name, str, size, base);
+}