From patchwork Mon Jun 12 08:09:15 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: 1793801 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=OjvVq63+; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qfkwf0Qd4z20X6 for ; Mon, 12 Jun 2023 18:13:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C87884780; Mon, 12 Jun 2023 10:13:34 +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="OjvVq63+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 120C2860BB; Mon, 12 Jun 2023 10:13:25 +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-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 E8C6B85FD2 for ; Mon, 12 Jun 2023 10:13: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-wr1-x433.google.com with SMTP id ffacd0b85a97d-30fc6b513afso135993f8f.1 for ; Mon, 12 Jun 2023 01:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686557601; x=1689149601; 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=65FMNRHvXfBnRFwQV444VgyDPoRERLgrzU5KrsHA6mo=; b=OjvVq63+EJh/OKLmSMlmM3Lla4uZ87mRXA9FenJOh/vLshOZUIRQIPaDbPLMFzBBtX nKmFM2izWXkTqp5B2OdDa8tA4/uxA8cHxCn6AwwYVjTmlaNSDgqg9oqkAnqkN8Bl+yhQ Y9kmarS/UXnPT2DzCbUWTrNn4LxKxUD/6/tuXleb4ujuV/igb245v5COlT1V/5oA7wtr UcPt32ZHPeBfCmqALunGGEqXXQiRdZfJVnRXQy/ICqrLTpiBPhOQXQFxp6kel9526F5o o3+AhwC8OId1d1+BIOqJ2OWIx9DFbQExSKjIPSiZI3xTpkI8461jb7b5jTf4waX+n3bF 8AlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686557601; x=1689149601; 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=65FMNRHvXfBnRFwQV444VgyDPoRERLgrzU5KrsHA6mo=; b=BZwY/ZVNc46MCBvf94O4LuE/jD9O0RQQzpVDjVrTR8yucR96/0uGtL+UW9Xolr+ysa c8XlGiuwl6H7za/DjBdVEMRyH8e4udNFC+pyGfmCN1nYOMEnegN0MNGDRHeU6b+tS+aW 3vBBqiLbJRdKXa99yEwK95RRFHBkCYEBvyQ+hTlEreBKyFuVTrM88plaAojGW4d5zZmQ lSC77dHps4jjwJ9H3QaenVLnfnK0pEXo/vnNI5gJmVO6CF6FQt/XHKmBEu1kuzLV7R79 0s/iPToAN2ZsUzOEYhjPwhm6tVihoyS3VGOoVGOEXaDaNv/KVJg9BY/MsDc4sWLNC65+ 7dCw== X-Gm-Message-State: AC+VfDwkA+2YbdJAxpW5GpvNh8fPXrO8aISHxXSWaaj0T2DAuKS9vVIX 6PoMaGxqY2VBpPIeVNNpIAM+NHj0b5prQCCyiF4= X-Google-Smtp-Source: ACHHUZ4wJKFp/RbbrhH2WEAqEs2t2Nv/e6+BngSAwol76baxjAmHpPHHN+ytM5WqhfsQpGls3nkMOA== X-Received: by 2002:a5d:5704:0:b0:30f:bc21:1ce4 with SMTP id a4-20020a5d5704000000b0030fbc211ce4mr2301633wrv.14.1686557601070; Mon, 12 Jun 2023 01:13:21 -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 m9-20020a056000008900b0030ae499da59sm11637390wrx.111.2023.06.12.01.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:13:20 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH v3 1/6] fwu_metadata: make sure structures are packed Date: Mon, 12 Jun 2023 09:09:15 +0100 Message-ID: <20230612081314.723786-2-rui.silva@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612081314.723786-1-rui.silva@linaro.org> References: <20230612081314.723786-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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/fwu_mdata.h b/include/fwu_mdata.h index 8fda4f4ac225..56189e2f40a9 100644 --- a/include/fwu_mdata.h +++ b/include/fwu_mdata.h @@ -6,6 +6,7 @@ #if !defined _FWU_MDATA_H_ #define _FWU_MDATA_H_ +#include #include /** @@ -22,7 +23,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 +39,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 +63,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 Mon Jun 12 08:09:16 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: 1793803 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=euzavWnd; 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 4Qfkwt4tf5z20X6 for ; Mon, 12 Jun 2023 18:14:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D61BA8613D; Mon, 12 Jun 2023 10:13:36 +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="euzavWnd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C953686140; Mon, 12 Jun 2023 10:13:27 +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-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (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 B4B7084780 for ; Mon, 12 Jun 2023 10:13: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-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f642a24555so4700435e87.3 for ; Mon, 12 Jun 2023 01:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686557603; x=1689149603; 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=TwRQFVNgk5iYBZjiAyXKFcgSva9nP31u4rqCpTdVzK4=; b=euzavWndBfuo/Mwq2WJNkRy9pZom/R0L9Clm7mqIUZRPUhqpjMcKfb6KX78d72CrTC MBvhGyjc1NPdrpTuYXiRkCd8IsfTdjrGPYfgyxNwzZcR8SPXX1xwWrzJuB4py0N0flIL oi/DLjDKprLr0d8vJndp/SOc/8q84gsYpsAWgDVjRRXLhk0AtEqlbFL+XRvb1IKCtNTo llsDnI0aONEwzuoqErZ5+m4DR09xWg6XwAvz02QJtFmnZy0qadagZQc6t53iO3gAX7tp TQ76k08RxoaIFK9lW9SbDxcMVebkddPXDdDa68jUc2rCbZmc/b1VuJYDaiefw/7hi0QN 9jWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686557603; x=1689149603; 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=TwRQFVNgk5iYBZjiAyXKFcgSva9nP31u4rqCpTdVzK4=; b=hHVWKB9FxZwjQRCqfgnXI7I9Xc2isANOx2wv4Vm8+Xt8JoMh8C3fIoKg4kUEQLJYHL 7vz/pj9nI5FtJKtwzmTOBXu4fixECsDcLZqVreDjrJVqkgqb/yQo0S3rqMIbDX80P12i kl6WQ56dZJGjKDdCJCw8AQSHy4XnxtTuZoo4gJGoXS4izYIivkuWfHWaN5yxXO5Z2ppF hgNcTrpIkPWCU/JXP3TTYK07DOZX1d4g2FblG62VCjpyxKF1Mpj9PIW71+Ec7fn6mCuW bVSY1abgzCKJx/4AIgxi0paKMJvUwRke/qlvsA8ngrt4bRAw9QDobflCIWj6aVRQthap R8Lw== X-Gm-Message-State: AC+VfDynU0kpdgQK4QxoZzHqx8NOm8ZkOFXikZp5fSmRkbfvkHT+uXTC RQsqEDWK43DBHOfZXQX8CfR25p+95mU4UJ11xD0= X-Google-Smtp-Source: ACHHUZ7lGmD1iFcuj7sL6VA2zOZfEkPQI5EdsAMHGEyX64KEvQ+tVwYJ8Kory/1p8v3vVwaaXgOKNw== X-Received: by 2002:a19:434c:0:b0:4f4:e744:2e71 with SMTP id m12-20020a19434c000000b004f4e7442e71mr3158885lfj.64.1686557602873; Mon, 12 Jun 2023 01:13: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 m9-20020a056000008900b0030ae499da59sm11637390wrx.111.2023.06.12.01.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:13:22 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH v3 2/6] nvmxip: move header to include Date: Mon, 12 Jun 2023 09:09:16 +0100 Message-ID: <20230612081314.723786-3-rui.silva@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612081314.723786-1-rui.silva@linaro.org> References: <20230612081314.723786-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 test/dm/nvmxip.c | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) 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 diff --git a/test/dm/nvmxip.c b/test/dm/nvmxip.c index e934748eb5d2..89bf481f6161 100644 --- a/test/dm/nvmxip.c +++ b/test/dm/nvmxip.c @@ -17,7 +17,7 @@ #include #include #include -#include "../../drivers/mtd/nvmxip/nvmxip.h" +#include /* NVMXIP devices described in the device tree */ #define SANDBOX_NVMXIP_DEVICES 2 From patchwork Mon Jun 12 08:09:17 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: 1793805 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=FSrMY6KG; 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 4Qfkx81kllz20X6 for ; Mon, 12 Jun 2023 18:14:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 273D786172; Mon, 12 Jun 2023 10:13:39 +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="FSrMY6KG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5D8AE84780; Mon, 12 Jun 2023 10:13:28 +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-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 4C91D85FD2 for ; Mon, 12 Jun 2023 10:13: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=rui.silva@linaro.org Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f7368126a6so27237285e9.0 for ; Mon, 12 Jun 2023 01:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686557604; x=1689149604; 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=FdIzyYY1XPhUXau8Tsr/xKuKS/q/o23vEd6unqtx3FA=; b=FSrMY6KG4ZJ1nOYvwhvAQzQNgWXzuDjXfXaivVRu7MFYs/WlhD2yNHJxHgw1xf3qV5 ZAWUWfIGkjfzQgHHyefY/LURDn2O0KRpp7aTwd9rvB3KVoT8o6fiZ8Eh0MnNG8RPjzMM pmfWpMqVT1xpEIjRZHU/zt6b2uyU4xaQuU5RHT1e7D+BhxfmYauGS6DxLIsMPZQbJOEW l4kjqL9KJmjXuWL0l4Be0ZGOhUFNaNF/BzGvmkOdRftl9frIdUw3ik+09v+O4nM0xo1d 3GtrT7FJtGiA2G4Z1/DMRCH1ZqLwIcWOHv2FjuGJzqaOe+PShg0I7eSzkHfKpfU1hX/9 Fnmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686557604; x=1689149604; 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=FdIzyYY1XPhUXau8Tsr/xKuKS/q/o23vEd6unqtx3FA=; b=Xoh+n0i4lFo6XorcP9lc6EnSC8J9eavc2idDolMJba+WdCfQ30JMGz6RU3/lZLuyEf IiBgiLJEZ637SCmHVKkU5mv8OWsi5jPGBPFrT5MkHjE2CDxf+VzbuPdw/y7Lw+oSB+O0 hU2HqfUGbffWKsc7ucM+D5ZjpMyevDZyfhHe5BcOBnbUYnVcBMh9bOx7zHNwvUllqQfb ioaUUln8V+WAsWn++AaG3yLdm/Trce6Y8pSTR8TJantB/5ycw6KVMsjR69TgexMUkBuD EQri34egEHnXAw5kCxmzSHXW24uJSarw0fBF5GAMp5xaWedQJkPB6e+73rrWiC8hXTly dBjQ== X-Gm-Message-State: AC+VfDwCpSP6VwRExEOgcsmFJ65LekUaLkq0to+vnphp0hgTJdpNCiNs GOWCtYQZqmCHKUeQZnimO4lf2DOsdmLDUqH3ON8= X-Google-Smtp-Source: ACHHUZ7omvjuhH6kEn2oW81kqH4ibgTp55RitEZoWnvTLLv1p/PULa3t9vU1CcZg7H6LhoeeD+tsUg== X-Received: by 2002:a05:600c:2255:b0:3f8:11f6:69ff with SMTP id a21-20020a05600c225500b003f811f669ffmr3304420wmm.10.1686557604497; Mon, 12 Jun 2023 01:13: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 m9-20020a056000008900b0030ae499da59sm11637390wrx.111.2023.06.12.01.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:13: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 v3 3/6] corstone1000: add fwu-metadata store info Date: Mon, 12 Jun 2023 09:09:17 +0100 Message-ID: <20230612081314.723786-4-rui.silva@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612081314.723786-1-rui.silva@linaro.org> References: <20230612081314.723786-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 Mon Jun 12 08:09:18 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: 1793806 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=cIp5SR2d; 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 4QfkxP5pKQz20X6 for ; Mon, 12 Jun 2023 18:14:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2492786180; Mon, 12 Jun 2023 10:13:43 +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="cIp5SR2d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9672986068; Mon, 12 Jun 2023 10:13:32 +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-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 3818D860BB for ; Mon, 12 Jun 2023 10:13: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=rui.silva@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-30ad458f085so2857906f8f.0 for ; Mon, 12 Jun 2023 01:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686557606; x=1689149606; 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=k80/pMirkb2jWWuhd9T5GN+t3ZNRVU51/E4vwNeD9I8=; b=cIp5SR2de0Z4+S7gSlYMVelqtHV6I8UtBOmIiHBgv4UlUH0AbZ11krx4iL6ywiDJ60 LDYAHVBpkKXCLZbpyB/mOimOKuIzfAKu2joW3inFzBt1+TOeXj/mx82k3ZmjxtRjQCEW 54yhfLfQiANqxrsUKtCMZhn7hbzWF6MgX1iBZIM+GjxeE1PGd5oqYTrBFuJD7A45q11G CTdwGwCYbOdWs5orUefQa8ktntF0us51kA0bIUwMQ195CuBc3zvKFV8s5hXnElF0AwPH +teLhOMZQOPW0ZE7NyAgisX6TvXruZTVFsH1eBeRAK+/qYj/NNd0pCi0xLufPmu2SIzB jenQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686557606; x=1689149606; 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=k80/pMirkb2jWWuhd9T5GN+t3ZNRVU51/E4vwNeD9I8=; b=V12C0GL00FYw9lETA7yuqlTSbLPM7wnUSDEZdu9SLqPySRm37WrgONAc7nPJweHr5f bkioRZies99JdX+PUCLCgtm99nLUipaeO6DGDn8oXXlOdLhA7Xb1hTal+paGyru9w+M4 2K3VARo+/nAuGjC/Ab/QMVuh8NUNDUzjXDxoEULDXY1NkBs0bhW630d8aXfTRA5fXQLa CLAcnBBqALS6/UE4UEl8Auh/UchmXinFyyzORyodOTzG3BtNOzoEQwNjlngXUae1uekD 6u0tX340qsOQ9VGoP76rA2Bj2lvaoAGbSBuv96sHsyh67evN3OrHE9pl8YnXXmwhZ7SE MCzA== X-Gm-Message-State: AC+VfDyun7GGvrphQDXS419CoQwlbYE8WgiPqmjMRZGEb9VysgQNPzL0 S/ByfPBTwhWvpb4Jw8BkEQD50TwzhVp3YH/cCIM= X-Google-Smtp-Source: ACHHUZ4ATdFC2rEe5tCLmBAUaw9BAmqHtLUgpT2RPlpGZOHzCuAUqrCfwG5CmgsYwKcJ2UEIg6Obkw== X-Received: by 2002:a5d:5267:0:b0:30a:f68f:9b94 with SMTP id l7-20020a5d5267000000b0030af68f9b94mr4420100wrc.21.1686557606415; Mon, 12 Jun 2023 01:13:26 -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 m9-20020a056000008900b0030ae499da59sm11637390wrx.111.2023.06.12.01.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:13: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 v3 4/6] corstone1000: add boot index Date: Mon, 12 Jun 2023 09:09:18 +0100 Message-ID: <20230612081314.723786-5-rui.silva@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612081314.723786-1-rui.silva@linaro.org> References: <20230612081314.723786-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 Mon Jun 12 08:09:19 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: 1793807 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=Jm5xWvCa; 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 4Qfkxg4p2hz20X6 for ; Mon, 12 Jun 2023 18:14:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E9588861A4; Mon, 12 Jun 2023 10:13:49 +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="Jm5xWvCa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 99F1B86020; Mon, 12 Jun 2023 10:13:34 +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 042CF85C2B for ; Mon, 12 Jun 2023 10:13: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-wr1-x435.google.com with SMTP id ffacd0b85a97d-307d20548adso2669174f8f.0 for ; Mon, 12 Jun 2023 01:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686557608; x=1689149608; 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=ovU0MGhzCzTnjcROWLwnyI2Ykpmd6U3TMNgjgLiSVjI=; b=Jm5xWvCancICF8Zwz5GdICYC8De56CUefrWLmiqUm0SItDQf/AuTxP2EUanJTCv5M1 lCvXn9SBxWI6d4iTj7l4A6uStckZRNocqy2Yh+dIA6ic+uzdyPseRd2YP1pb7uhIZsDO Wa4YTwJZnbcZCudA+9lnMQT638wfMEfyvSbqI5eSG3AMjkpRmYlBR19FW7KNDL+6pznD yW5cKfw72KXc3oDxUiiNVijrTDLuhoObEadOZUPcB3J+Gsj07W4x1liJP4FKaCAp9pKk KpWvjRqXmsfSh4IbFdBeyc8Uy0p1OAEmh6WH+hKly/JfhmztrZzHbkIzOPBnnh9Ulyvh 4Dcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686557608; x=1689149608; 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=ovU0MGhzCzTnjcROWLwnyI2Ykpmd6U3TMNgjgLiSVjI=; b=YjACnofJN4DuswvPh4S5a4PZXkd8KGzYnQFsCcJKn2pjzICLelmARjqFmXOQxQd5gq ETmibIVIZGMDp5Rdepz9sd3iqTEGRCnl+vX9ayb03y7BZ/oI5O7SCngHdddKcv6lzHzd 14Hn6tyOQZ3XJBf+zeux1ayJ4/NjbpwEwVtil89UmtR5ZFyC0qe0gvGYKWS7sKTHg8Mn irB6SWQmbWGe8g2lIb2bRiPR8Pv9ouL2yY8UomUFCq/jsuTqhslwOK1Zvxl62veE2f8k rewSrAio+2BVsm5VT+1ZYDbUR9JXB+M6RaM8rICUDpU/hjQOV3rGR4aHkXhzXp3JmhNP mqqA== X-Gm-Message-State: AC+VfDzRrQMNbqETGNoM66PmTq2W0Zjh1N23jXHmOThRWQYfxPs+sZen oVx//zCAm0jlwC3M+NDtHeCPGewZVQqFb1fG0Hw= X-Google-Smtp-Source: ACHHUZ5IrfE3uixHxVEktm0hsMm5e932uBwwvUs1m+GtSzvh3rIoL3kcSZxHirBQ0oTd8w7cQjyyLg== X-Received: by 2002:a5d:4ac7:0:b0:307:88ba:c999 with SMTP id y7-20020a5d4ac7000000b0030788bac999mr4163329wrs.62.1686557608134; Mon, 12 Jun 2023 01:13:28 -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 m9-20020a056000008900b0030ae499da59sm11637390wrx.111.2023.06.12.01.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:13:27 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH v3 5/6] corstone1000: set kernel_addr based on boot_idx Date: Mon, 12 Jun 2023 09:09:19 +0100 Message-ID: <20230612081314.723786-6-rui.silva@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612081314.723786-1-rui.silva@linaro.org> References: <20230612081314.723786-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 Mon Jun 12 08:09:20 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: 1793808 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=xZTSgAwA; 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 4Qfkxx72kyz20X6 for ; Mon, 12 Jun 2023 18:15:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC95686199; Mon, 12 Jun 2023 10:13:54 +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="xZTSgAwA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A76D885FD2; Mon, 12 Jun 2023 10:13:35 +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-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 C04F186172 for ; Mon, 12 Jun 2023 10:13:30 +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-x433.google.com with SMTP id ffacd0b85a97d-30e56fc9fd2so3841755f8f.0 for ; Mon, 12 Jun 2023 01:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686557610; x=1689149610; 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=bumfp8O7XAdHeMTkY7Md+UNfLCPBaWNtgU9uikTvGtk=; b=xZTSgAwAbU6FE63/0+w87AeMtnMW/DubNf2wQinYAN/OLLlP9ih/d3rmlPfmGBfk8I cGo9nWShKsvBmbp7gnoCU0Hr2Wvc9O67nOumqcRCSE+5uCdLGLCY449RfFFtAH4fA7+m 2nD0Wk7hEpxA7HWBRGSW8V1NLnSApail2IY830ol+94ejQrDRXqH1YiaiuobTVpWtk5P fEdeFB3fCRz+fCOvEnt5CGjDp9lj2ptlUqkDXUwNS2g7KvoQ3t2Q8SR+VHsyoYkiUcn5 XRhSVHlQ2r6dNT2ZVIDIovF0tVgkEmU2CJZGa+A75d/gp0LNv4EdvAhLimAUsyKF+hZV O06Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686557610; x=1689149610; 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=bumfp8O7XAdHeMTkY7Md+UNfLCPBaWNtgU9uikTvGtk=; b=KS4eNDv4bNhh2L0jxXGe4xTDTA+hna1xFUXUz0sUWQjkJxHltk27YCbn6gb9QhyIKy XRS3pwiBczdYsWFR2HI7rUbpNYAKtk0+1EtChzLkhUTupvFTQiQGXkmKWchQEZUkT4No Ne9HQQ8T1HLsl9oEhdvoxsP+RRlk4HPjsS2BSLSOsa+dHw9FKuCmcKEgoLAGvbD8+ntP 0mJDoOfs2GjQWuMsXF5hD2We1vmiH88Sy3/8b0MCi5LncZaimrGPuqYCl0749vKfezOY 7mDDw3W7j46EiF3i4obEibvzHDxO9glvrq2roE0Br4FlPhnVJLg9acsaDS9lKTAGyT6m 3uig== X-Gm-Message-State: AC+VfDxC2IX1QdzmWSXxV4ZWH8nS6OYchBd2XQazUrFo6hy4FV8pQYlX cZdL1W3e6c9MUJ4D1UB/h4PZCPhdk+r5H0OS1Iw= X-Google-Smtp-Source: ACHHUZ4A8Omjdz7UInA8g6ZD+scFCao2DDyZ0fqq+Tl9AKvlkFp7w4p3QcsNAu85PBq0nGdrdZrTGA== X-Received: by 2002:a5d:44d2:0:b0:30f:c012:b529 with SMTP id z18-20020a5d44d2000000b0030fc012b529mr2147510wrr.56.1686557610053; Mon, 12 Jun 2023 01:13:30 -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 m9-20020a056000008900b0030ae499da59sm11637390wrx.111.2023.06.12.01.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:13:29 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH v3 6/6] corstone1000: add nvmxip, fwu-mdata and gpt options Date: Mon, 12 Jun 2023 09:09:20 +0100 Message-ID: <20230612081314.723786-7-rui.silva@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612081314.723786-1-rui.silva@linaro.org> References: <20230612081314.723786-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