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: 1787144 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=sPKKjNyq; 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 4QVHLg5dMbz20Py for ; Tue, 30 May 2023 00:03:39 +1000 (AEST) 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-Google-Smtp-Source: ACHHUZ5z34khroLzIS2YAZ+t3dUP61QtQ+R5zVcKgekomcRWV2WwFcmCHHDcjvJXGQoirwBCagb33w== 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; }