From patchwork Mon May 29 14:02:27 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: 686707 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp250843wru; Mon, 29 May 2023 07:03:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GCULFyfHLB8hXtebfqBoHs9om+sQYqUJZPIKdCsV4dCg1EeAyVN0Ci0Esgr8PiS4DHqLj X-Received: by 2002:a17:902:f687:b0:1b0:1d7b:ed33 with SMTP id l7-20020a170902f68700b001b01d7bed33mr10350519plg.69.1685369021837; Mon, 29 May 2023 07:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685369021; cv=none; d=google.com; s=arc-20160816; b=0OTa2ZIoIxgMKSc6n4s9QvdQBqaPJflbY8Q5pF9kjns7PiaQMe7UNAuykVovvWFiir h1avlFuRYEKrJqxMQLYo5zkloeY6yIX3r+wGWTOxB7Y9RrlqZ+2NEejQQtMLeKC+RjA4 +0jp/hInXe7FF8yrCAGueKPd+/msdKcQt93QkK+4Qy3Lec0V2TF216XtAzSGy96FGz0V i1ui2x+6eazdtqamz7LjGN1si7nyXEVOMIpT9H/UMAm3dBR0qxeTA8rgIoqPsLMkds6z /ab0n47UTz8whFN7nV9ui1b1pJcnmHMcdMMCnEdirsa4CnPKPLao2iylyJQfOambTZu3 09cg== 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=yjkLRaPZqzDFHaFgw6FQYvK9VVhCe9s110mFsuZZ3OU=; b=Z0xTdKm0JJJHFEWoDz/STOi5ZOzdExG1LuqqnnL8GbRLIrgREIusYXnjyNB5r9+iTK ldM7NF922XL4V7Nn71Oe7RrbcXJCL6cfYqhgZ28TCujeIdTZweTjwcltQELhO2G+AM3D TdNPNLdpBTLmvNJlbsJb5E4BW7e6MwEsp1+dZQx6rCmHSTcT+hyKVvelTvBH8cTGIXOR Z5G7r6VJ2JJOpNTmvvJRF9So2MIxmFH3PHBsFwG2mmH0TgnhkOYLzq/luIspYdanFCJx 7i1VveatT9uviV9qGBR/PJlwnpy6hzOMpwfFqdj+b4P70oZn3COEtdre2t93N/uLi8GU RokA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sPKKjNyq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id x21-20020a170902821500b001aafe3f409asi9118510pln.205.2023.05.29.07.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 07:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sPKKjNyq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 C4A6985D4E; Mon, 29 May 2023 16:02:48 +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="sPKKjNyq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5203985C77; Mon, 29 May 2023 16:02:43 +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-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 C9F7B8267E for ; Mon, 29 May 2023 16:02:40 +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-x32b.google.com with SMTP id 5b1f17b1804b1-3f6a6b9c079so21742385e9.1 for ; Mon, 29 May 2023 07:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685368960; x=1687960960; 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=yjkLRaPZqzDFHaFgw6FQYvK9VVhCe9s110mFsuZZ3OU=; b=sPKKjNyqB6a4ro3ZpZ4V8voHwxPkS2xW7TMJ0BQgRl4URh25lpyICFygaIkYsajCfe mFaIIyK8+4j3wyoVIbT1A7Q4tdhfk5CDzj63lBnIU6e/O5+oDNql/WoR9YEcJWZLD9ck 7JAIbks+mcD4F29GttI2ciHPr3JflrAIfzHsA2VyDb7CWgcNP8tLW9Sfxoc0TkX+QTSV JQb6YJBqm7B7g6072VXMK6xuSdbpgT/J9F6/CCwAFSLhvN0CkjfxUdFwMLP6Q9ltuPDs ACcuVrJmHuNZSMjMZUA0ri7uMd4U4kDGVaw1aXnIofGovAGVETLMNUR+dpIPEsI+PVnh Ikdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685368960; x=1687960960; 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=yjkLRaPZqzDFHaFgw6FQYvK9VVhCe9s110mFsuZZ3OU=; b=YPpMvmzMiY1DrIzCM2FDE/GsBcvck7rTtudsDf3+TPabNVYtar117OkOLk83MMyDFH p7h5Uu7AM63gCojsNWAjQv5sxW8trnerDSfhSEFULMY4IB6U7fLM/5XB/UcsBJ1QQPhh 6bpQE4SZhPPWvF+09wa0yBo7+5lKba89lT0rCKrfFT9kNh2ER/bcK0yeTdgB8hwfIPEl CW8gVhktmvMpcvfSi6IL4NbzJppBPDTTjpK6JxPk6h68CRdk7ZL/HmU9QQyitoxuP1w2 SIofdDTPZOmpGzno6EM0oa6KR3FzZNjoNIc42ezBYfBEpCTPwgX07YSSyPNfbHrrDolG VlnQ== X-Gm-Message-State: AC+VfDw6Dzv5B9TABYBfBUSZyO4dzLdfJgJfiS58CSFvlbP+SbNOgBdA L/8ttjs7YQu3tGB0EqGh6lC3NNycJhwqaVWCB1s= X-Received: by 2002:adf:fe12:0:b0:30a:782a:7f97 with SMTP id n18-20020adffe12000000b0030a782a7f97mr8791767wrr.12.1685368960101; Mon, 29 May 2023 07:02:40 -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 w12-20020a5d544c000000b002fed865c55esm54123wrv.56.2023.05.29.07.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 07:02:39 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Rui Miguel Silva Subject: [PATCH v2 4/6] corstone1000: add boot index Date: Mon, 29 May 2023 15:02:27 +0100 Message-Id: <20230529140229.3225090-5-rui.silva@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230529140229.3225090-1-rui.silva@linaro.org> References: <20230529140229.3225090-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; }