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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED7DFC433EF for ; Wed, 10 Nov 2021 08:31:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 730FB610A3 for ; Wed, 10 Nov 2021 08:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 730FB610A3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DAD90839CB; Wed, 10 Nov 2021 09:31:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1636533065; bh=9bxk/wDy8mZ6p1pMwECORNShy62Vg/CbiU33WqQAKZQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=q0Utoe/whppgq3nUBhP8Jnodryjb7J6G7Dpgg6thoo+gQcCWpef60pRLI2MG8mgHf L1DLCA7bvXevmSxn52K88BYM5xW1mJXv2KP3v8u3nXosWb/fHuWh+yrw7iD15I+PUk fuZ4RRXIKH0myMT//qveIjY58aJKx6tkXcc+NTI6IhYbzgUILykd7KnyZsye3F5929 VSFUoznzHA7EvrcMGMGhgUaaFpks96yL3VruNx5TtrvDLtoWP6t+dkcyL1k2HNJaXD OdTAq+JfvoF/N5C7NT1ev6UNsugia5Cjpjm0+3m0LxHhjywKJ/frvSp4hIKjyIM3Ii VBnMmPlVnJjqg== Received: by phobos.denx.de (Postfix, from userid 109) id 5EF05839CC; Wed, 10 Nov 2021 09:31:03 +0100 (CET) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6350C839C7 for ; Wed, 10 Nov 2021 09:31:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (unknown [91.198.250.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4Hpyjc2NcpzQkFr; Wed, 10 Nov 2021 09:31:00 +0100 (CET) Message-ID: <0bf42aca-e2a6-e0dc-781f-25ed99fceaa8@denx.de> Date: Wed, 10 Nov 2021 09:30:56 +0100 MIME-Version: 1.0 Subject: Re: [PATCH u-boot-marvell 11/11] tools: kwbimage: Properly set srcaddr in kwbimage v0 Content-Language: en-US To: =?UTF-8?Q?Marek_Beh=c3=ban?= Cc: u-boot@lists.denx.de, =?UTF-8?Q?Pali_Roh=c3=a1r?= , =?UTF-8?Q?Marek_Beh=c3=ban?= References: <20211108171251.25382-1-kabel@kernel.org> <20211108171251.25382-12-kabel@kernel.org> From: Stefan Roese In-Reply-To: <20211108171251.25382-12-kabel@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 On 08.11.21 18:12, Marek Behún wrote: > From: Pali Rohár > > Field srcaddr in kwbimage v0 needs to be adjusted similarly like in v1. > > Signed-off-by: Pali Rohár > Signed-off-by: Marek Behún Reviewed-by: Stefan Roese Thanks, Stefan > --- > tools/kwbimage.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/tools/kwbimage.c b/tools/kwbimage.c > index 952023c14c..875f636c7a 100644 > --- a/tools/kwbimage.c > +++ b/tools/kwbimage.c > @@ -937,6 +937,28 @@ static void *image_create_v0(size_t *imagesz, struct image_tool_params *params, > main_hdr->checksum = image_checksum8(image, > sizeof(struct main_hdr_v0)); > > + /* > + * For SATA srcaddr is specified in number of sectors starting from > + * sector 0. The main header is stored at sector number 1. > + * This expects the sector size to be 512 bytes. > + * Header size is already aligned. > + */ > + if (main_hdr->blockid == IBR_HDR_SATA_ID) > + main_hdr->srcaddr = cpu_to_le32(headersz / 512 + 1); > + > + /* > + * For SDIO srcaddr is specified in number of sectors starting from > + * sector 0. The main header is stored at sector number 0. > + * This expects sector size to be 512 bytes. > + * Header size is already aligned. > + */ > + if (main_hdr->blockid == IBR_HDR_SDIO_ID) > + main_hdr->srcaddr = cpu_to_le32(headersz / 512); > + > + /* For PCIe srcaddr is not used and must be set to 0xFFFFFFFF. */ > + if (main_hdr->blockid == IBR_HDR_PEX_ID) > + main_hdr->srcaddr = cpu_to_le32(0xFFFFFFFF); > + > /* Generate the ext header */ > if (has_ext) { > struct ext_hdr_v0 *ext_hdr; > Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de