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 8692DC433EF for ; Thu, 17 Feb 2022 09:44:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 90B9583B68; Thu, 17 Feb 2022 10:44:25 +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="eiLiNMTP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B9E7E83B62; Thu, 17 Feb 2022 10:44:23 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 48B3B82DB7 for ; Thu, 17 Feb 2022 10:44:19 +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 ams.source.kernel.org (Postfix) with ESMTPS id F22D8B82120; Thu, 17 Feb 2022 09:44:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9715DC340E8; Thu, 17 Feb 2022 09:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645091057; bh=KQnY3GlUDB3O5WLgm1bXhhVByQW5fIlcyHH44HnADJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eiLiNMTPXvhS4NqiX3tZ4SOrXNLfhMWUUAscaWIvmZd2YMR0D6/Mw/u/z3eIqOHzY HL1IFa5z+oPx3lTJRcfzGZUIWRnk9KWTNZVb+FHN0sQwRvVg3kIXrqRd9Q8BhXeUh9 SLbvlIZbKQKdMEsBLB8YxUHIeIw+0RxkufnaRlRQsFQXkHJsMoXiX1jrRKv7PCo652 iqwBcZv7bWcVGQnh85e7uwbfUEFL2Vl33YOjRjUoACJ9nKNB4j7YvB0EvaLAUCoQwW gIo26pGyMdYOaxFDVym2x4mFdOtutZ9cHVSdgTwwIu1i1jS+TLsGnV4CuJEfIVpcSv PUISyUL6WCt/Q== Received: by pali.im (Postfix) id 26FAD1187; Thu, 17 Feb 2022 10:44:15 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Tony Dinh Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-marvell v2 0/7] tools: kwbimage: Support for parsing extended v0 format Date: Thu, 17 Feb 2022 10:43:33 +0100 Message-Id: <20220217094340.9048-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220215185925.16060-1-pali@kernel.org> References: <20220215185925.16060-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.39 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.5 at phobos.denx.de X-Virus-Status: Clean This patch series extends kwbimage v0 format support by providing ability to dump content of Dove boot images (extension of v0 format). It also fixes recognition of these images in kwboot utility (as it uses macros and inline functions from kwbimage.h header file). Implementation is based on 88AP510 Functional Specifications, Chapter 5.2 Boot Image Format, which is publicly available at: https://web.archive.org/web/20120130172443/https://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf Printing information about image.kwb is possible by: $ ./tools/dumpimage -l image.kwb Dumping image.kwb is possible by commands: $ ./tools/dumpimage -T kwbimage -p -1 -o image.cfg image.kwb $ ./tools/dumpimage -T kwbimage -p 0 -o data.bin image.kwb $ ./tools/dumpimage -T kwbimage -p 1 -o binary1.bin image.kwb $ ./tools/dumpimage -T kwbimage -p 2 -o binary2.bin image.kwb ... (where -p N is Nth binary executable header, e.g. SPL) Dove images contains more sections which in config file begins with line "MATCH ADDRESS 0xaddr MASK 0xmask VALUE 0xval" and means that section is executed only when check ((readl(addr) & mask) == (val & mask)) passes. Support for generating these kind of images is not provided. I hope that this patch series helps somebody else to implement it. Changes in v2: * Implement custom function fls4() as it is not possible to use U-Boot's fls() from asm-generic/bitsops/fls.h file when compling for Mac or Win. Pali Rohár (7): tools: kwbimage: Define structures for extended kwbimage v0 headers tools: kwbimage: Fix calculating size of kwbimage v0 header tools: kwbimage: Add support for dumping extended and binary v0 headers tools: kwbimage: Do not show mkimage error message in dumpimage tools: kwbimage: Add support for NAND_BLKSZ and NAND_BADBLK_LOCATION for v0 images tools: kwbimage: Fix help how to extract DDR3 training code tools: kwbimage: Add me as an author of kwbimage tools/kwbimage.c | 152 ++++++++++++++++++++++++++++++++++++++++++----- tools/kwbimage.h | 116 ++++++++++++++++++++++++++++++++---- 2 files changed, 244 insertions(+), 24 deletions(-) -- 2.20.1