From patchwork Mon May 31 08:57:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1485599 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=Fw/bDuge; 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Ftq1J5Ll4z9sVm for ; Mon, 31 May 2021 18:57:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BB66F82E40; Mon, 31 May 2021 10:57:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="Fw/bDuge"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4984E82E81; Mon, 31 May 2021 10:57:13 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 371B182E40 for ; Mon, 31 May 2021 10:57:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x630.google.com with SMTP id jt22so15603087ejb.7 for ; Mon, 31 May 2021 01:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2bOaHvFN75oqKqFy53uvm8/0f1N+IYo54AbtbXK5JWo=; b=Fw/bDugeZCepIMGUh+05XKTV4+pPfL5WmZezsfzRWvcxeG4SSSe90Jk7MObD63p/qw gMGh1yQMKvyy07qLgXPmNBI4dtARP3KjMR5H7RQU0FWh9ebEYe99R7SKvABcsuRVQGz9 sFUBH6HYaJgA/dHvT7iA5GHmgYLaLMFZfLNFwLOCGbh3PzEnRNl9VJAmKZjjfwjDz4uz YWuW+HxwHGKMNs9KsfHtQq70ixAdJMRxQ8jZqdec1oRWjg2frEEJLo3nAEEgvhVb5jVn LFvk6LREDtoeevCRulozNyEDlp9o6emG2iRD1JrlFHn/Or37vQ+1+K5+UmU5QbCYHVkz WDBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=2bOaHvFN75oqKqFy53uvm8/0f1N+IYo54AbtbXK5JWo=; b=Wn/jAIs5s3UJUPd+ZSygJm5u3RDYCoQN3eXj2HECVw7vmd/OkO6MgtgQ7NCg9sTE7a 62ix0qP2MZt0lJ7kmtRmJ5Qmh4fgPT+LqKmHAWbni+2gxApWJ2UhxLxnFnAlZ0CtmDUT 8klw1AEVSQJeh/3pUj2NZUHIIBIQ3y8XV1UILZOtUTCiK2sBkak93Ppr8UtWMMPUlZva JJuY/LZm4UREU57ufaAjNNzDIwNeilKXL18tVfW70AxiKFMFWsZzp2vS8X55xxfiRmg3 PRuz2f8kqSG3pPiCtGlVxRu2CK02CZcWqiWQuOK0hPZApBpVJSmWJ+amKg7MigBD1TWU /eHQ== X-Gm-Message-State: AOAM532xgRtM2G3SODSM32fhdsB/aj2nW26oCDlX7EUkfbVVZmmqo/Ja tv5erSjRqT0JdVPWj/Kl08RBQ5VfS8zuXF6U X-Google-Smtp-Source: ABdhPJyJcD3+aUBCTcF9la+azHPePFOtG/3+SsH7fkLvQHHVBDANScoqdhZaK48d4C+9+6LUlcUhmw== X-Received: by 2002:a17:907:779a:: with SMTP id ky26mr14713637ejc.293.1622451428646; Mon, 31 May 2021 01:57:08 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id d15sm6669640edu.86.2021.05.31.01.57.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 May 2021 01:57:08 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com, Simon Glass Cc: Alexandru Gagniuc , Marek Vasut , Philippe Reynes Subject: [PATCH] spl: fit: Also record architecture in /fit-images Date: Mon, 31 May 2021 10:57:07 +0200 Message-Id: <96201d6e54f3124e8ddb185fe020c65da2ef842b.1622451425.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean On ARM64 secure OS can run as 64bit or 32bit that's why it is necessary to record information about architecture that other code can read it and properly pass it to TF-A and start in 64bit or 32bit mode. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- common/fdt_support.c | 4 +++- common/spl/spl_fit.c | 3 ++- include/fdt_support.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index a9a32df1e78f..240f1e57d135 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -594,7 +594,7 @@ void fdt_fixup_ethernet(void *fdt) int fdt_record_loadable(void *blob, u32 index, const char *name, uintptr_t load_addr, u32 size, uintptr_t entry_point, - const char *type, const char *os) + const char *type, const char *os, const char *arch) { int err, node; @@ -622,6 +622,8 @@ int fdt_record_loadable(void *blob, u32 index, const char *name, fdt_setprop_string(blob, node, "type", type); if (os) fdt_setprop_string(blob, node, "os", os); + if (arch) + fdt_setprop_string(blob, node, "arch", arch); return node; } diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index caddf5119679..f6c475315ed6 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -480,7 +480,8 @@ static int spl_fit_record_loadable(const struct spl_fit_info *ctx, int index, ret = fdt_record_loadable(blob, index, name, image->load_addr, image->size, image->entry_point, fdt_getprop(ctx->fit, node, "type", NULL), - fdt_getprop(ctx->fit, node, "os", NULL)); + fdt_getprop(ctx->fit, node, "os", NULL), + fdt_getprop(ctx->fit, node, "arch", NULL)); return ret; } diff --git a/include/fdt_support.h b/include/fdt_support.h index 1e4dbc0a8f65..f6f46bb8e9ce 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -160,11 +160,12 @@ static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {} * @param entry_point entry point (if specified, otherwise pass -1) * @param type type (if specified, otherwise pass NULL) * @param os os-type (if specified, otherwise pass NULL) + * @param arch architecture (if specified, otherwise pass NULL) * @return 0 if ok, or -1 or -FDT_ERR_... on error */ int fdt_record_loadable(void *blob, u32 index, const char *name, uintptr_t load_addr, u32 size, uintptr_t entry_point, - const char *type, const char *os); + const char *type, const char *os, const char *arch); #ifdef CONFIG_PCI #include