[PATCH 08/15] MIPS: dtb: register only one memory bank

Antony Pavlov antonynpavlov at gmail.com
Mon Mar 7 05:30:19 PST 2016


From: Peter Mamonov <pmamonov at gmail.com>

Signed-off-by: Peter Mamonov <pmamonov at gmail.com>
Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
 arch/mips/boot/dtb.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/mips/boot/dtb.c b/arch/mips/boot/dtb.c
index 23d8979..977c837 100644
--- a/arch/mips/boot/dtb.c
+++ b/arch/mips/boot/dtb.c
@@ -28,11 +28,13 @@ void of_add_memory_bank(struct device_node *node, bool dump, int r,
 {
 	static char str[12];
 
-	sprintf(str, "kseg0_ram%d", r);
-	barebox_add_memory_bank(str, KSEG0 | base, size);
-
-	sprintf(str, "kseg1_ram%d", r);
-	barebox_add_memory_bank(str, KSEG1 | base, size);
+	if (IS_ENABLED(CONFIG_MMU)) {
+		sprintf(str, "kseg0_ram%d", r);
+		barebox_add_memory_bank(str, KSEG0 | base, size);
+	} else {
+		sprintf(str, "kseg1_ram%d", r);
+		barebox_add_memory_bank(str, KSEG1 | base, size);
+	}
 
 	if (dump)
 		pr_info("%s: %s: 0x%llx at 0x%llx\n", node->name, str, size, base);
-- 
2.7.0




More information about the barebox mailing list