[PATCH 2/2] arm/cpu/start.c: Avoid copying device-tree when possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case of non-relocatable image device-tree blob should already be
preloaded into memory as a part of Barebox binary upload, so there is
no need to 'memcpy' it again

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 arch/arm/cpu/start.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 7ffde7c..c461a73 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -107,6 +107,15 @@ static noinline __noreturn void __start(unsigned long membase,

 		switch (get_any_boarddata_magic(boarddata)) {
 		case FDT_MAGIC:
+			if (!IS_ENABLED(CONFIG_RELOCATABLE)) {
+				/*
+				  If Barebox is not relocatable
+				  there's no need to move data around
+				 */
+				barebox_boot_dtb = boarddata;
+				break;
+			}
+
 			totalsize = get_unaligned_be32(boarddata + 4);
 			var = &barebox_boot_dtb;
 			name = "DTB";
--
2.1.4

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux