From patchwork Tue May 2 13:11:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 1775878 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=m+2fawWI; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q9gV74J6Rz20fd for ; Tue, 2 May 2023 23:12:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8733F84743; Tue, 2 May 2023 15:12:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="m+2fawWI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C1AE88473C; Tue, 2 May 2023 15:12:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B12B884734 for ; Tue, 2 May 2023 15:12:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rui.silva@linaro.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f182d745deso36638805e9.0 for ; Tue, 02 May 2023 06:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683033134; x=1685625134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YkuaoCFV9B9612IdMsCHmsC97jW3CcgHDgumf8cJRWk=; b=m+2fawWIoT5AphFO+AFb7k0h+cGMPi9wzppze99bxHHofrP8hTcs11fVMloshDEC1i WSsIWRXh+l7QeLMmJvQStGSPV/V+kyR5lly79G8aB/GJBaltbFk4+b+phs1ZjRzoz/aI X+cB8zLZPQs+c66frdntm1zrjs0GSMuv4DZHv5ZF9e1c4MrSutBYWdmTRCnaSps8h4/H taZhcKE+0PIb9m7bz/gs+juucRwRnXVOktHQnLPZZncAstN+AXi8R/OttkyTYQ0gtSGe pdBhEqMohu6Qkh44isrjv0DwmwMgtu5kGIm/lZplGHshBbsTMnYrZb3ao35s7Vv/sn7v qSrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683033134; x=1685625134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YkuaoCFV9B9612IdMsCHmsC97jW3CcgHDgumf8cJRWk=; b=eRnsMNC8dN2CLLeVDieJdLiEUXOIhGGyxINvUnybfDJTdEsKBYKZQrOhIXCxajNy08 GsURK999NcwRywNwQgMd0eq1jJIXyCQr+zU26Cro2tEMTJmL5h/tZsuAoUt7XPtCALMt FBy49YvPlj/w66QMNscm+SmLJtaRpOkHHy3KYwKjkcXhOr862j+k2UsM/0DpD7yT52b9 MOAvQTEeknBKEA6OdPYJAj4DYarCcztpv5bphq12O/+U3hKnmrEMtpIDDB033Rk5/Zd0 qXw6mexOie/PtttRtxpb93kDGOfiGjOjY1bU7ERbmhpdsSzV9Yo5u+wW5FFNM0YdnPcz Z++A== X-Gm-Message-State: AC+VfDxvTUzjvm/PfG/czHbkEVmkm/TZhgdUCqvlzmUvdNiwK7jY2ZVh fczreJlmYTZIt+VcRhjSDoY9IesvnHO8zbm+KNQ= X-Google-Smtp-Source: ACHHUZ5l/jpj6EqQTChmDIZc22vu5Uhw3JPEOMy/huX+MTlqdzWFuUSMMkKlGPNs5M6mL2QPZoLr3A== X-Received: by 2002:a05:600c:2296:b0:3f0:8ed8:853c with SMTP id 22-20020a05600c229600b003f08ed8853cmr11874923wmf.37.1683033134528; Tue, 02 May 2023 06:12:14 -0700 (PDT) Received: from arch-thunder.local (a109-49-33-111.cpe.netcabo.pt. [109.49.33.111]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm35277121wml.48.2023.05.02.06.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 06:12:13 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH 1/6] fwu_metadata: make sure structures are packed Date: Tue, 2 May 2023 14:11:55 +0100 Message-Id: <20230502131200.2551513-2-rui.silva@linaro.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502131200.2551513-1-rui.silva@linaro.org> References: <20230502131200.2551513-1-rui.silva@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The fwu metadata in the metadata partitions should/are packed to guarantee that the info is correct in all platforms. Also the size of them are used to calculate the crc32 and that is important to get it right. Signed-off-by: Rui Miguel Silva Reviewed-by: Ilias Apalodimas --- include/fwu_mdata.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fwu_mdata.h b/include/fwu_mdata.h index 8fda4f4ac225..c61221a91735 100644 --- a/include/fwu_mdata.h +++ b/include/fwu_mdata.h @@ -22,7 +22,7 @@ struct fwu_image_bank_info { efi_guid_t image_uuid; uint32_t accepted; uint32_t reserved; -}; +} __packed; /** * struct fwu_image_entry - information for a particular type of image @@ -38,7 +38,7 @@ struct fwu_image_entry { efi_guid_t image_type_uuid; efi_guid_t location_uuid; struct fwu_image_bank_info img_bank_info[CONFIG_FWU_NUM_BANKS]; -}; +} __packed; /** * struct fwu_mdata - FWU metadata structure for multi-bank updates @@ -62,6 +62,6 @@ struct fwu_mdata { uint32_t previous_active_index; struct fwu_image_entry img_entry[CONFIG_FWU_NUM_IMAGES_PER_BANK]; -}; +} __packed; #endif /* _FWU_MDATA_H_ */ From patchwork Tue May 2 13:11:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 1775879 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=p1Sv8jhd; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q9gVP2XSVz20fd for ; Tue, 2 May 2023 23:12:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6252F8473A; Tue, 2 May 2023 15:12:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="p1Sv8jhd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93DD384738; Tue, 2 May 2023 15:12:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7296384735 for ; Tue, 2 May 2023 15:12:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rui.silva@linaro.org Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-306342d7668so895375f8f.1 for ; Tue, 02 May 2023 06:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683033137; x=1685625137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CcTlPr/4utG1hdzdaD1JJTRYHUH+5REsTbseI+4PkM4=; b=p1Sv8jhdqGluQ1vSRImvLIgMCPWSKIWKO1buzEnwGSwblPKh3YWlCQ3gld/uAhRFVG J31ayWj9fW6finntXfTztdzamdhZck9QsDGQMA1WDZ6+R/TgLXo8GlulzdtkzNz8yLhn +McdJXmLg9Uq8wxaW4IAXAQneQqT2cSTJJGQEdzBQx+lAs7BIXnmqxZR2KHECfoH2/Ht J7HVZ2arnMlljnJ+xnYfKrcXAmRSPu0DdtbqGILRgLBlKkn37E5SrEKagBBzJJUaxzCC cq9w7zDsp4B6/UbXGSkpqB5HbnfWb+kwZnNu/T7Hi7sFqbemHWTbxUVnK9yNKZptSP2O YEXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683033137; x=1685625137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CcTlPr/4utG1hdzdaD1JJTRYHUH+5REsTbseI+4PkM4=; b=O3d1F5RO8zIipp2IaWpL37R7CtpJXHsyxS91Rp7mbP9fgYfDFNQU+9Ji/mz+Y7akka opQ78GDL/OIsPer3CtZCHzCQBZmwlVjTw5pMrT6AkDjzI37dm7aRgvSo9lgDD45PaHOn FmzyALi3Z4dktpp4m22+UKcYzCw27pfm0AmibQ8RRapwrxiX/JX5dnk6hPyYpPd2QSJ6 SWpwehg0s3oqamMalkbryXM4UBeDwzIHWdBUKYP+ohTvQZVknKtHwO/X8xk69pfqBQso sG64oBeQNt+OjyffhlK0SD3/4bv2ufa1s/XRMi6SuXVIaqexan7z82G+1ta1miYrLoig dMPQ== X-Gm-Message-State: AC+VfDwklX+vQ12s3fbQA5DtVUv6lk71hRngXJU8Ynt0sxiMVPElk5b8 QnrocFoIUVfweknEiP+mgXruBw+2mTWkcGOWv3Q= X-Google-Smtp-Source: ACHHUZ4RvNazMIo+6YLiLi2ULClCqqyEnz6XQP3H7yOYTRz4lz9JFN/uT1LJUX+4AKKrUJ4G8WF36A== X-Received: by 2002:a5d:6a4e:0:b0:306:2f5f:6201 with SMTP id t14-20020a5d6a4e000000b003062f5f6201mr4025609wrw.33.1683033137227; Tue, 02 May 2023 06:12:17 -0700 (PDT) Received: from arch-thunder.local (a109-49-33-111.cpe.netcabo.pt. [109.49.33.111]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm35277121wml.48.2023.05.02.06.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 06:12:16 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH 2/6] nvmxip: move header to include Date: Tue, 2 May 2023 14:11:56 +0100 Message-Id: <20230502131200.2551513-3-rui.silva@linaro.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502131200.2551513-1-rui.silva@linaro.org> References: <20230502131200.2551513-1-rui.silva@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Move header to include to allow external code to get the internal bdev structures to access block device operations. as at it, just add the UCLASS_NVMXIP string so we get the correct output in partitions listing. Signed-off-by: Rui Miguel Silva --- {drivers/mtd/nvmxip => include}/nvmxip.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {drivers/mtd/nvmxip => include}/nvmxip.h (100%) diff --git a/drivers/mtd/nvmxip/nvmxip.h b/include/nvmxip.h similarity index 100% rename from drivers/mtd/nvmxip/nvmxip.h rename to include/nvmxip.h From patchwork Tue May 2 13:11:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 1775880 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jS40rMTW; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q9gVf6CRYz20fd for ; Tue, 2 May 2023 23:12:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4983484757; Tue, 2 May 2023 15:12:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="jS40rMTW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 68EB78473C; Tue, 2 May 2023 15:12:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 44F6E84735 for ; Tue, 2 May 2023 15:12:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rui.silva@linaro.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f1950f5628so36459385e9.3 for ; Tue, 02 May 2023 06:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683033140; x=1685625140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E9AFngAdl26/ZbtRWEQybxP4AJ+s3NWkfMFTnneAISU=; b=jS40rMTWz8KogmLjjQTAA5tIQsHhSCobx+twu87cJkQOP8msNcvkhq/T8Gl+sCmwSq yaSUu+X9DERCtZ/CfIfg5ObTR0c+f8OlNwTSJOzYAiD1RzotveJOIQVCEEBA8wZYr37Y hn5DnkK5ayib3PvRBYBilKTuWqtwVDWPR/q8QWJ1Bkr2/d+Zt8Uore5HkKXGh/uj1nWB jFh8xY39YxXlGD6vTnHHP9VYPPY6PTVE2nHUe4rMoVsCfmuukjm/OXQ97zTy+CrQ/wgP efAh51KwzPkOLlwklaFSu8VBgQzJgw9Nhi1O8xIJDzdjREQNQ0Yp4611fm/At2upcjY1 LvBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683033140; x=1685625140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E9AFngAdl26/ZbtRWEQybxP4AJ+s3NWkfMFTnneAISU=; b=EKTDIKmrhfOhLiIhqUwxuaZZqvvpUTkMgn3Vt6Ew7kUF4qYR1xPHxynH1bVb7+qtIH aTyjmQdAven3Hw1TjlMfHPwRnTKIsqW2CWGe7KKRaP6/13U769UOiKmUr0Swx47yqS5O qMfBeIL4M4z+Y5+IcFMefUqdrJIT82uf3sqHL35KMSiWgJi2VSoHqK/ve1eMiwU1Gcoc aM63ujDP/NYhl3FsI4JA51XfDOt7mLDRcnsPqYnNIDu/N5s6YmIQrNKH3Bn4bvbncu7q UThFKAmAuDIfh/4GAccAgCR4+sy2A8VNPvbQIcIKWndXaxORsjB3JCZr8yXWK7hwdQoi i7Jw== X-Gm-Message-State: AC+VfDw4tMTwykckHX5rWHPyBN/liVAaZaGwNQ3Q4X6SRGL5nReIaSxj l7kM9PkTdNY09hz5buoo24fuVsGoIQn84N/tKfE= X-Google-Smtp-Source: ACHHUZ4UdFhrRWGyqqsf/qs9S21BO+8q9spKTpHN8jvpqV72WVMGBwpl4oKqmuE7CEhXjYFMf8+VEg== X-Received: by 2002:a7b:c5da:0:b0:3f1:72d4:b271 with SMTP id n26-20020a7bc5da000000b003f172d4b271mr13832268wmk.3.1683033140027; Tue, 02 May 2023 06:12:20 -0700 (PDT) Received: from arch-thunder.local (a109-49-33-111.cpe.netcabo.pt. [109.49.33.111]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm35277121wml.48.2023.05.02.06.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 06:12:18 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH 3/6] corstone1000: add fwu-metadata store info Date: Tue, 2 May 2023 14:11:57 +0100 Message-Id: <20230502131200.2551513-4-rui.silva@linaro.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502131200.2551513-1-rui.silva@linaro.org> References: <20230502131200.2551513-1-rui.silva@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Add fwu-mdata node and handle for the reference nvmxip-qspi. Signed-off-by: Rui Miguel Silva --- arch/arm/dts/corstone1000.dtsi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/corstone1000.dtsi b/arch/arm/dts/corstone1000.dtsi index 533dfdf8e1ca..1e0ec075e4cd 100644 --- a/arch/arm/dts/corstone1000.dtsi +++ b/arch/arm/dts/corstone1000.dtsi @@ -38,7 +38,7 @@ reg = <0x88200000 0x77e00000>; }; - nvmxip-qspi@08000000 { + nvmxip: nvmxip-qspi@08000000 { compatible = "nvmxip,qspi"; reg = <0x08000000 0x2000000>; lba_shift = <9>; @@ -106,6 +106,11 @@ method = "smc"; }; + fwu-mdata { + compatible = "u-boot,fwu-mdata-gpt"; + fwu-mdata-store = <&nvmxip>; + }; + soc { compatible = "simple-bus"; #address-cells = <1>; From patchwork Tue May 2 13:11:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 1775881 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=S88/r1/5; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q9gVy4pXqz20fd for ; Tue, 2 May 2023 23:13:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 279968476D; Tue, 2 May 2023 15:12:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="S88/r1/5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28B5984761; Tue, 2 May 2023 15:12:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C2ED884735 for ; Tue, 2 May 2023 15:12:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rui.silva@linaro.org Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f173af665fso23244385e9.3 for ; Tue, 02 May 2023 06:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683033142; x=1685625142; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O4vbhFn9Gl5nq1EjiKotc/2XwjjjNn4biK1M3w2B0W4=; b=S88/r1/5zWTdyyfUQKUCSQtWPEU7gWAGG50Q/xdTnU5sjVXNZC82zS21PYvKQw1Htw FJas/8e1hvRuObbDmn8uYTePeU1qZVjqcwfb5oc6XhXuQ4BrLYm6Hz24E14HoS24ouhu JpK5bjTUy2t59NukIMKAbWDPtPHvvOz06ZxyqGFoHO5NYGYtpTkrbHaZXTWZIK7bHg/Q /JNHJyT8kTtlU10wjh5X1swPbljFfc8PeyokUvlH8cW9XQArSbe62m+6TH+2qd2k44W4 nMtWDDCk0SMlrzMkgPIO06rIZ6pEWq68UwfnSrXCU+30qMo8874JF8cVp4fdD9QMd9Wi jbqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683033142; x=1685625142; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O4vbhFn9Gl5nq1EjiKotc/2XwjjjNn4biK1M3w2B0W4=; b=JHBVHlVMx9Xtwzwa2B2PeOup07JEJLg8dl4dWyXrhTy+oGJUIpFaN7Sf/FjuQsu+jg CZ+lWUa2C80jLriI80x+GpdD/xGAyNTNQWr4UVVkHO0zOhc+FspSNlUjzcchVFX2/+WN v7AN2zxq+CLb5VqDIPrpfQthG1uKc1assJLPbqoJLf9XPy9T4JzbFNnGa83bnmXOyteF FZeGrUbMYSsA0+bwIKrWboijSlV1wTNnzJg8bQ0qHNQGfDVjB7d6VoLYmXZxQ2ashHWg EGMh9O019OsDejVum/RAUG5FG1SyGAb9c8rXQcF7lm+JtiO5dL8zR8UMl0k8q2HEGjr5 XiHQ== X-Gm-Message-State: AC+VfDxbUQDOlHxdDdYgBpm5zPBNIhVWJ+XESj28snEswYlGPPnHqsL6 pXcrsDiXqAg7JMqTqmV76PmuLV1O4OTuEGTBDXE= X-Google-Smtp-Source: ACHHUZ6UIYYPVosPihKOcZah1jG+g+WmTtL2War7OVRif01blGDKPQs1z+2RFWF/e3B/IGe2x9lo2A== X-Received: by 2002:a05:600c:ad0:b0:3f0:f3ee:9e2a with SMTP id c16-20020a05600c0ad000b003f0f3ee9e2amr11697918wmr.35.1683033142540; Tue, 02 May 2023 06:12:22 -0700 (PDT) Received: from arch-thunder.local (a109-49-33-111.cpe.netcabo.pt. [109.49.33.111]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm35277121wml.48.2023.05.02.06.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 06:12:21 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH 4/6] corstone1000: add boot index Date: Tue, 2 May 2023 14:11:58 +0100 Message-Id: <20230502131200.2551513-5-rui.silva@linaro.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502131200.2551513-1-rui.silva@linaro.org> References: <20230502131200.2551513-1-rui.silva@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean it is expected that the firmware that runs before u-boot somehow provide the information of the bank for now we will fetch the info from the metadata since the Secure enclave is the one responsible for this information. Signed-off-by: Rui Miguel Silva --- board/armltd/corstone1000/corstone1000.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c index 6ec8e6144fb4..1bead7a0a8b4 100644 --- a/board/armltd/corstone1000/corstone1000.c +++ b/board/armltd/corstone1000/corstone1000.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include @@ -87,6 +89,20 @@ int dram_init_banksize(void) return 0; } -void reset_cpu(void) +void fwu_plat_get_bootidx(uint *boot_idx) { + int ret; + + /* + * in our platform, the Secure Enclave is the one who controls + * all the boot tries and status, so, every time we get here + * we know that the we are booting from the active index + */ + ret = fwu_get_active_index(boot_idx); + if (ret < 0) { + *boot_idx = CONFIG_FWU_NUM_BANKS; + log_err("corstone1000: failed to read active index\n"); + } + + return ret; } From patchwork Tue May 2 13:11:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 1775882 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=gINWAWG0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q9gWD5QX9z20fd for ; Tue, 2 May 2023 23:13:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D948B84735; Tue, 2 May 2023 15:12:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="gINWAWG0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D278984754; Tue, 2 May 2023 15:12:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 57E3E84735 for ; Tue, 2 May 2023 15:12:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rui.silva@linaro.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f315712406so168621185e9.0 for ; Tue, 02 May 2023 06:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683033145; x=1685625145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0kXcHmrTGhAsYW+GY8q4oSakae8yeLX+s+0qCphutOE=; b=gINWAWG0cLDdP9l3uRjPqwdi6peLc5nVVuVKhItSO7sdXcB9meiRGdvAOBsiuiUrPd gmtDTnUsCbyVhFvYPNBYua6slV4TR+GDfwn5v5Wo1yCdiprHJsRYYRjvAgIXfKTeXDGs M4vKZxqI98V09WaMMxH/YlxpGEXvRaRAvfj32rcV9hrOFFBPloEE+YVkx+icNjBZrAZ4 YPLwbGbKGP3KCV5VnkP8k2pz9FWkG7UN5JTQ/ruAci889nCCgCFMnyj9o2blSIqBxY2v c1Y/sTZekv3TB2Za35ed7VfYeaqRl4tTYYz1W2ZUSUdKcmSMNw9Q/qAvULO28CCzo3Fs j+4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683033145; x=1685625145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0kXcHmrTGhAsYW+GY8q4oSakae8yeLX+s+0qCphutOE=; b=M6vNMavH3M4Fu6/KfUxHTUKEwEjBqbpes9pu6FjLoOtSd3+B8DiYUAM0ZTU7xXHoJf PXfx0L74r6SGRxB7xlf9LLx4xr0P+3iUizdg2q2mIC2uxO9GXmzQXLeXZzxwYKMTYpCL GG+0YQ9WqEuyfIM7POU/XXJHEb/Hc06S5DzyP+X5pNxovrzUrK9opajxk61VWGuK3LYT hr8S8sgJjziQHlX8bDoJu8mZtMMdQgnHD9tt5ktLhYo3oFkZsIyPcj/DsTbdiy//tzK/ NlrYc2Se3/OherT04aq4P9T+7I10A8navy61J0B+wTvxARSrSRDotqQpB9fvFS9jQpeA sszw== X-Gm-Message-State: AC+VfDzXHIxgP8wzg8CVXOsPAzSmRV2UupEm+GrnsSToNCP9vZOmK48x Nlj1nirqmOfwgkW9ZN46F1//PRfoJ0vQWGKmIFI= X-Google-Smtp-Source: ACHHUZ4UVNakLPSqa/ztszNm8rJRjgzjztMcAaAxBNcsw77IWzrYYu/Vb5+CJ/qvp6q4utF5iymhKg== X-Received: by 2002:a05:600c:190e:b0:3f1:96a8:3560 with SMTP id j14-20020a05600c190e00b003f196a83560mr15849858wmq.10.1683033144996; Tue, 02 May 2023 06:12:24 -0700 (PDT) Received: from arch-thunder.local (a109-49-33-111.cpe.netcabo.pt. [109.49.33.111]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm35277121wml.48.2023.05.02.06.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 06:12:24 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH 5/6] corstone1000: set kernel_addr based on boot_idx Date: Tue, 2 May 2023 14:11:59 +0100 Message-Id: <20230502131200.2551513-6-rui.silva@linaro.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502131200.2551513-1-rui.silva@linaro.org> References: <20230502131200.2551513-1-rui.silva@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean We need to distinguish between boot banks and from which partition to load the kernel+initramfs to memory. For that, fetch the boot index, fetch the correspondent partition, calculate the correct kernel address and then set the env variable kernel_addr with that value. Signed-off-by: Rui Miguel Silva --- board/armltd/corstone1000/corstone1000.c | 56 +++++++++++++++++++++++- configs/corstone1000_defconfig | 1 + 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c index 1bead7a0a8b4..a4567449f1be 100644 --- a/board/armltd/corstone1000/corstone1000.c +++ b/board/armltd/corstone1000/corstone1000.c @@ -5,16 +5,24 @@ * Rui Miguel Silva */ +#include #include #include #include #include -#include #include +#include +#include #include #include #include +#define CORSTONE1000_KERNEL_PARTS 2 +#define CORSTONE1000_KERNEL_PRIMARY "kernel_primary" +#define CORSTONE1000_KERNEL_SECONDARY "kernel_secondary" + +static int corstone1000_boot_idx; + static struct mm_region corstone1000_mem_map[] = { { /* CVM */ @@ -103,6 +111,52 @@ void fwu_plat_get_bootidx(uint *boot_idx) *boot_idx = CONFIG_FWU_NUM_BANKS; log_err("corstone1000: failed to read active index\n"); } +} + +int board_late_init(void) +{ + struct disk_partition part_info; + struct udevice *dev, *bdev; + struct nvmxip_plat *plat; + struct blk_desc *desc; + int ret; + + ret = uclass_first_device_err(UCLASS_NVMXIP, &dev); + if (ret < 0) { + log_err("Cannot find kernel device\n"); + return ret; + } + + plat = dev_get_plat(dev); + device_find_first_child(dev, &bdev); + desc = dev_get_uclass_plat(bdev); + ret = fwu_get_active_index(&corstone1000_boot_idx); + if (ret < 0) { + log_err("corstone1000: failed to read boot index\n"); + return ret; + } + + if (!corstone1000_boot_idx) + ret = part_get_info_by_name(desc, CORSTONE1000_KERNEL_PRIMARY, + &part_info); + else + ret = part_get_info_by_name(desc, CORSTONE1000_KERNEL_SECONDARY, + &part_info); + + if (ret < 0) { + log_err("failed to fetch kernel partition index: %d\n", + corstone1000_boot_idx); + return ret; + } + + ret = 0; + + ret |= env_set_hex("kernel_addr", plat->phys_base + + (part_info.start * part_info.blksz)); + ret |= env_set_hex("kernel_size", part_info.size * part_info.blksz); + + if (ret < 0) + log_err("failed to setup kernel addr and size\n"); return ret; } diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig index 2d391048cd67..5be5335bdfc1 100644 --- a/configs/corstone1000_defconfig +++ b/configs/corstone1000_defconfig @@ -20,6 +20,7 @@ CONFIG_CONSOLE_RECORD=y CONFIG_LOGLEVEL=7 # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_BOARD_LATE_INIT=y CONFIG_SYS_MAXARGS=64 CONFIG_SYS_CBSIZE=512 # CONFIG_CMD_CONSOLE is not set From patchwork Tue May 2 13:12:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 1775883 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JDKSMPgV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q9gWV6wP1z20fd for ; Tue, 2 May 2023 23:13:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D091E8475C; Tue, 2 May 2023 15:12:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.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=linaro.org header.i=@linaro.org header.b="JDKSMPgV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 91DAB84735; Tue, 2 May 2023 15:12:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4CFEE84772 for ; Tue, 2 May 2023 15:12:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rui.silva@linaro.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f19ab994ccso38987305e9.2 for ; Tue, 02 May 2023 06:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683033147; x=1685625147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xxs8lJsVS2Tdiw1Eq8/YtsKOZ8Y7K7wM++EQTjGHcR8=; b=JDKSMPgVYAW84xJplVZ4RZdrHSYPrfTxrxdprZE8V2LEd5zeJJESNHakTSL9uMQfMt cIcStAa4Y3vJsYvyLBPZ6je504R61YDzYmQ6vAVlANCrwxfjDppmINMXyiM/YQLEMHF0 e2IO1q8IDgReARIHCCHvg7C+osb485xi/r4OE5U07T2rZgRuryWKOG+oM7LdekTlyK5l uAJF8kiPRaaPRtOBoyIfo8Pi8/ohkZSFMkmthHHypbFBTf2dERj+H3QTflT29Ioq5hL6 Mck1jTe0xuzvMGSpv9UG3HJfnMvaxp6vH6qgHiEGxmPa9fMgwKvpIFNpD5H9YWXXw8Pe F0GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683033147; x=1685625147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xxs8lJsVS2Tdiw1Eq8/YtsKOZ8Y7K7wM++EQTjGHcR8=; b=lBJ2fUSidvGHcQMlabnNNAfbKowg4lyQE6GHo45JSkPE3MqMhiA6fZtxC13Mcywr2K W0l5eVA1N9aOe8Ar1fdZiSqp2lHUkQPSoOCQE9pJZnSwhGsPCb3TwFrpPlvI0hOfUyGm XRrRiPSF+SsrrABGIbH6R6chWxQxVgsdqLLm8soPTa3LfESBA8dqbSREUvr3ua9DH86j 1vvHNp0fa7ANkEf7GZKzcVvB+DGacvU3sfr26x7Af1uZgbzvY9RRixEzIO1qRL6atEIu lwpjAwjTMnzK0g1UN5Up4ZOvqfDb4Q/sCEnTPNlOvDm9lTjHngNtq7QliHxUiJh6eSQB pTtQ== X-Gm-Message-State: AC+VfDx5ZXuI5ii9/zYvTwu4AUA6z/1wTpDVxw5SbK0SX1sdVpu2PYMC cF7qcde54vpHuxKaWKxwrGpHuLLiTmcb7rebybc= X-Google-Smtp-Source: ACHHUZ4GcuGh+CxH/k50Io+bE5VlGh0tzzVqA6nsjI6+xH5WqMVPg7Agv2KLlGHZ5tECnB70WVuyYg== X-Received: by 2002:a1c:4c0e:0:b0:3f0:7f4b:f3c0 with SMTP id z14-20020a1c4c0e000000b003f07f4bf3c0mr12917437wmf.19.1683033147494; Tue, 02 May 2023 06:12:27 -0700 (PDT) Received: from arch-thunder.local (a109-49-33-111.cpe.netcabo.pt. [109.49.33.111]) by smtp.gmail.com with ESMTPSA id c21-20020a7bc855000000b003f17300c7dcsm35277121wml.48.2023.05.02.06.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 06:12:26 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH 6/6] corstone1000: add nvmxip, fwu-mdata and gpt options Date: Tue, 2 May 2023 14:12:00 +0100 Message-Id: <20230502131200.2551513-7-rui.silva@linaro.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502131200.2551513-1-rui.silva@linaro.org> References: <20230502131200.2551513-1-rui.silva@linaro.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Enable the newest features: nvmxip, fwu-metadata and gpt. Commands to print the partition info, gpt info and fwu metadata will be available. Adjust also env boot script the address of the bootbank with the new gpt layout, and also remove the not needed kernel address bank0 and bank1 and retrieve function that would test the bank flag before and now we are getting the info from the fwu metadata. Signed-off-by: Rui Miguel Silva --- board/armltd/corstone1000/corstone1000.c | 1 + board/armltd/corstone1000/corstone1000.env | 10 +--------- configs/corstone1000_defconfig | 13 ++++++++++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c index a4567449f1be..01c80aaf9d77 100644 --- a/board/armltd/corstone1000/corstone1000.c +++ b/board/armltd/corstone1000/corstone1000.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/board/armltd/corstone1000/corstone1000.env b/board/armltd/corstone1000/corstone1000.env index b24ff07fc6bd..ee318b1b1c30 100644 --- a/board/armltd/corstone1000/corstone1000.env +++ b/board/armltd/corstone1000/corstone1000.env @@ -1,13 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0+ */ usb_pgood_delay=250 -boot_bank_flag=0x08002000 -kernel_addr_bank_0=0x083EE000 -kernel_addr_bank_1=0x0936E000 -retrieve_kernel_load_addr= - if itest.l *${boot_bank_flag} == 0; then - setenv kernel_addr $kernel_addr_bank_0; - else - setenv kernel_addr $kernel_addr_bank_1; - fi; +boot_bank_flag=0x08005006 kernel_addr_r=0x88200000 diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig index 5be5335bdfc1..a8a79fd10568 100644 --- a/configs/corstone1000_defconfig +++ b/configs/corstone1000_defconfig @@ -15,7 +15,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9 ip=dhcp earlyprintk" -CONFIG_BOOTCOMMAND="run retrieve_kernel_load_addr; echo Loading kernel from $kernel_addr to memory ... ; loadm $kernel_addr $kernel_addr_r 0xc00000; usb start; usb reset; run distro_bootcmd; bootefi $kernel_addr_r $fdtcontroladdr;" +CONFIG_BOOTCOMMAND="echo Loading kernel from $kernel_addr to memory ... ; loadm $kernel_addr $kernel_addr_r 0xc00000; usb start; usb reset; run distro_bootcmd; bootefi $kernel_addr_r $fdtcontroladdr;" CONFIG_CONSOLE_RECORD=y CONFIG_LOGLEVEL=7 # CONFIG_DISPLAY_CPUINFO is not set @@ -24,11 +24,16 @@ CONFIG_BOARD_LATE_INIT=y CONFIG_SYS_MAXARGS=64 CONFIG_SYS_CBSIZE=512 # CONFIG_CMD_CONSOLE is not set +CONFIG_CMD_FWU_METADATA=y CONFIG_CMD_BOOTZ=y CONFIG_SYS_BOOTM_LEN=0x800000 # CONFIG_CMD_XIMG is not set +CONFIG_CMD_NVMXIP=y +CONFIG_CMD_GPT=y +# CONFIG_RANDOM_UUID is not set CONFIG_CMD_LOADM=y # CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_NFS is not set @@ -40,6 +45,8 @@ CONFIG_OF_CONTROL=y CONFIG_VERSION_VARIABLE=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_REGMAP=y +CONFIG_FWU_MDATA=y +CONFIG_FWU_MDATA_GPT_BLK=y CONFIG_MISC=y # CONFIG_MMC is not set CONFIG_NVMXIP_QSPI=y @@ -51,6 +58,10 @@ CONFIG_RAM=y CONFIG_DM_RTC=y CONFIG_RTC_EMULATION=y CONFIG_DM_SERIAL=y +CONFIG_SYSRESET=y CONFIG_USB=y CONFIG_USB_ISP1760=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_IGNORE_OSINDICATIONS=y +CONFIG_FWU_MULTI_BANK_UPDATE=y CONFIG_ERRNO_STR=y