From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF949C433EF for ; Tue, 21 Dec 2021 15:57:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 63828834E6; Tue, 21 Dec 2021 16:56:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="YfMzvM4D"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 655F4833B8; Tue, 21 Dec 2021 16:56:17 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EC605834B9 for ; Tue, 21 Dec 2021 16:55:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E6E3D61665; Tue, 21 Dec 2021 15:55:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A738C36AEB; Tue, 21 Dec 2021 15:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640102148; bh=ILEiAJcDXzz/0Yp3Wm5DAKHUMcye9GnJfu4hYhWubuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YfMzvM4D29vVQ9AhGQnDokluiND+RV8gVhvL5fYK5TlCffHMFdT+1VzXDUuf8Znx8 kb1KESEC8GENAveKEVyyNq1e/gak0IFfQRqCxbxYa/X4PEoN8btDxDWc2h4JTxhA15 GoPXt+8ND5evK7DZHwk1K5UlyVA2GWJrXSpdjUInXIhby2jjLvq7sBy7ivJcPFZRIN PB/KYvmV23yI36Qzw3TfzbwPnAZW28a6vKXSwUvxQJTEszvXHUebO98KdMOnA26iPs tOxHH4UNrnDY8o09GjsGJWbYovPL4HCcGoTVjvnDfWEVhDDW3T3NyIaBMm75/IDbbX DFd2zN6Op2fVw== Received: by pali.im (Postfix) id 531D4778; Tue, 21 Dec 2021 16:55:48 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Chris Packham Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-marvell 11/16] tools: kwbimage: Show binary image address in mkimage -l, in addition to size Date: Tue, 21 Dec 2021 16:54:11 +0100 Message-Id: <20211221155416.8557-12-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211221155416.8557-1-pali@kernel.org> References: <20211221155416.8557-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean For debugging purposes it is good to know where the binary image would be loaded and also it is needed to know if printed size is image size or the size of header together with image. Make it unambiguous by showoing that printed size is not the size of the whole header, but only the size of executable code, and print also the load/execute address of this binary image. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún --- tools/kwbimage.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 4b3b40ce24fb..094ebb1049c3 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -1823,9 +1823,12 @@ static void kwbimage_print_header(const void *ptr) for_each_opt_hdr_v1 (ohdr, mhdr) { if (ohdr->headertype == OPT_HDR_V1_BINARY_TYPE) { - printf("BIN Hdr Size: "); + printf("BIN Img Size: "); genimg_print_size(opt_hdr_v1_size(ohdr) - 12 - 4 * ohdr->data[0]); + printf("BIN Img Addr: %08x\n", 0x40000000 + + (unsigned)((uint8_t *)ohdr - (uint8_t *)mhdr) + + 8 + 4 * ohdr->data[0]); } } -- 2.20.1