[PATCH] booti: add debug prints for kernel header parsing

Sascha Hauer sha at pengutronix.de
Mon Aug 8 04:21:08 PDT 2022


On Mon, Aug 08, 2022 at 08:55:56AM +0200, Ahmad Fatoum wrote:
> 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 at pengutronix.de>
> ---
>  common/booti.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied, thanks

Sascha

> 
> 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 at 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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list