mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] booti: add debug prints for kernel header parsing
Date: Mon,  8 Aug 2022 08:55:56 +0200	[thread overview]
Message-ID: <20220808065556.453090-1-a.fatoum@pengutronix.de> (raw)

This proved useful in a debugging session, so make them easily
available with a #define DEBUG for future developers.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/booti.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/common/booti.c b/common/booti.c
index dde1605fe1f1..302d7440abd7 100644
--- a/common/booti.c
+++ b/common/booti.c
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-FileCopyrightText: 2018 Sascha Hauer <s.hauer@pengutronix.de>
 
+#define pr_fmt(fmt) "booti: " fmt
+
 #include <common.h>
 #include <memory.h>
 #include <bootm.h>
@@ -40,6 +42,11 @@ void *booti_load_image(struct image_data *data, phys_addr_t *oftree)
 	image_size = le64_to_cpup(kernel_header + 16);
 
 	kernel = get_kernel_address(data->os_address, text_offset);
+
+	print_hex_dump_bytes("header ", DUMP_PREFIX_OFFSET,
+			     kernel_header, 80);
+	pr_debug("Kernel to be loaded to %lx+%lx\n", kernel, image_size);
+
 	if (kernel == UIMAGE_INVALID_ADDRESS)
 		return ERR_PTR(-ENOENT);
 
-- 
2.30.2




             reply	other threads:[~2022-08-08  6:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08  6:55 Ahmad Fatoum [this message]
2022-08-08 11:21 ` Sascha Hauer

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=20220808065556.453090-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --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