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: 691625 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp16994wru; Mon, 12 Jun 2023 01:14:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kOsgk1JUN6u6UEktK8XPO9EvX1vwIq7LCziM9NJTGtwfzuQe10suubVfrqs34z+6HZq9q X-Received: by 2002:a05:6a20:3cab:b0:10b:7400:cef7 with SMTP id b43-20020a056a203cab00b0010b7400cef7mr10702691pzj.17.1686557675812; Mon, 12 Jun 2023 01:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686557675; cv=none; d=google.com; s=arc-20160816; b=nxkUFBHeZsSQCHS/qYfMkIX9HU/KLmdR/wZJNofXNZr1YMXmwnX3JLZRa7zlZbJUqP R9U2TUlinkt4NaM089wpQg0Jl/9uoDxdecyE91C5zryNntxrphcxkjbzKxMWrlXk09vc rUrnMbai71xCtzQdmvR29qxskKz92QUDVhsgLGa28c+IGapajvHRHb5RC4jC9Hygj2uU jAADyzfmlbHJRBfgExAkDKazINdYF3jASxl315yy7KDFSlOWjBkNg3/n6ykTx+P50sgs dficBRFZU4pjIkYVzEQKqUnSYElyxzSM2v/y6QzoTTacUobRsf0PHjpkP02V3uPw8xWQ 67fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=k80/pMirkb2jWWuhd9T5GN+t3ZNRVU51/E4vwNeD9I8=; b=T+2BQKEiHrDbhGi9/VwWOT2TXKAkHaIQG40dCsWM0AgJWRTaw+t+H6bp86O0tDYUgE fUqzmD+14ai33aeCdCyCl2T6MGUhSorxjgzldoqbUnBWdMBKbm4psq8TyB2Dq2LniOJJ bx1GPrsrZXBtKoFm/4g9tNKOCQ0rW4iszcDAdjpOpXzoOCXCzKkLoHpubAYYVXcSLX5L Cp2LjWHAq46JaE3IjGZdvvs/PcOrJQKQO+K1HJoe/3dFimPKMwrmmCKr7Qrqyf6CA+Bo YssNm+Knjelw2Vmn6rhGjC1VSm5NgyUdFlnBnq6mwhvPrIkpQ4nD1NqhTf8xMzVGS4bv HGXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cIp5SR2d; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id t12-20020a63954c000000b0053efcd20010si6524590pgn.423.2023.06.12.01.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 01:14:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cIp5SR2d; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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; }