mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 2/2] arm/cpu/start.c: Avoid copying device-tree when possible
Date: Fri, 25 Sep 2015 23:02:18 -0700	[thread overview]
Message-ID: <1443247338-29171-2-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1443247338-29171-1-git-send-email-andrew.smirnov@gmail.com>

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@gmail.com>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-09-26  6:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-26  6:02 [PATCH 1/2] arm/cpu/start.c: Distil some common code in __start() Andrey Smirnov
2015-09-26  6:02 ` Andrey Smirnov [this message]
2015-09-29  6:58   ` [PATCH 2/2] arm/cpu/start.c: Avoid copying device-tree when possible Sascha Hauer
2015-09-29 17:52     ` Andrey Smirnov
2015-09-30  7:00       ` Sascha Hauer
2015-09-30 17:56         ` Andrey Smirnov
2015-10-01  6:22           ` Sascha Hauer
2015-10-06 17:35             ` Andrey Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443247338-29171-2-git-send-email-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox