From patchwork Tue Feb 8 18:20:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Barrett-Morrison X-Patchwork-Id: 1590020 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=timesys-com.20210112.gappssmtp.com header.i=@timesys-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=fXTFUjxD; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtWY928D0z9s0B for ; Wed, 9 Feb 2022 05:21:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4AFF383D63; Tue, 8 Feb 2022 19:21:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=timesys.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=timesys-com.20210112.gappssmtp.com header.i=@timesys-com.20210112.gappssmtp.com header.b="fXTFUjxD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 41EA483D6E; Tue, 8 Feb 2022 19:21:12 +0100 (CET) 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,HTML_MESSAGE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (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 E97D383D61 for ; Tue, 8 Feb 2022 19:21:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=timesys.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=nathan.morrison@timesys.com Received: by mail-yb1-xb35.google.com with SMTP id y6so37611491ybc.5 for ; Tue, 08 Feb 2022 10:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timesys-com.20210112.gappssmtp.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=elBbjHwE6c0wxSRz8e+rV4bFZovg/bwVj0dfkArzr4s=; b=fXTFUjxDStO8jfl5Lo368UFqbIxoSzkYANkPl9I3/QuiT8LqS2a6JjX8Q2G0tQx9c+ r8qKMsfWUJapaWfJ7zUSEXNdXWGv3/N/9hxgTgQpfDvxxbhCoIC+A/Mih+F2lVX42GFc vcZsO2nrRmTrniNp3OQ47fpPTCLlSRrD8xDKG+6tfzNq+PuL0iPod/tJ2PLCqvmFPWP0 BEu2TLQ8w8sLVaA+YQzVaapn+uahFNCmX+d9Z/EEU6Msf1D/BF860pdj73FmYRW9c1/4 kGG6wsNbDaLiwLZlUWrYna3XYaIc6/r/8V7OeqYyocPRkcu0CoZpDOXTHDtnBCKTGVdq aM0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=elBbjHwE6c0wxSRz8e+rV4bFZovg/bwVj0dfkArzr4s=; b=w83lBtam6SLtMn4x7W8COIDxaeZ3ckb4ZJRettCKLtSkQgIvoiStvaU4r3ilAF0Otd McH6r7l31ql95c1CPEBUyrh3s8a1h/xwFFFv7GQItZW9IBmdKf/WpSfylFMiS7sEHVFS NXpBrTOwBeOJA4BaMU7SrY0mLttHpANibheiirwklLQPdH2VRd7JphaAMrq3r8IGu43e F7X9GvdFSoNTlR0mdqEnXdi0/gUTsutE9vNGb/R8hVX9JmgMG3pglEJDlhJUEvsM6hRs Acauy27+SZSqn2dQWaMHn54Q+hjr6SR7/Wh2VEA7SOjEJeHA1eqgFJmQdya7S9B4lhHc a9gw== X-Gm-Message-State: AOAM533WxiYOis3RSS75Ry5/uEuEtDFNd4/zotWY/M2QqGoWigdqyaLq Hxt0Jd8JdeIJ4FXTp06kqHzMs3H4XaSGWAJlrykiAwroUB80KpaX X-Google-Smtp-Source: ABdhPJwjbhrv8xA4wsU5OsbJMDeQ4L9Y8GJtfiyNHOlUWuKIV1Q5PMjrCQVTEh94Y1h3RxyFLnZFYfBK0n+EVLw9/E0= X-Received: by 2002:a81:430a:: with SMTP id q10mr5998015ywa.110.1644344467233; Tue, 08 Feb 2022 10:21:07 -0800 (PST) MIME-Version: 1.0 From: Nathan Barrett-Morrison Date: Tue, 8 Feb 2022 13:20:56 -0500 Message-ID: Subject: [PATCH] common: spl: spl_mmc: Add full FIT image support for kernel/OS loading during Falcon boot mode while booting via MMC To: u-boot@lists.denx.de Cc: Tom Rini X-Content-Filtered-By: Mailman/MimeDel 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Hi Tom, This patch adds support for Falcon mode boot via MMC flash boot devices with full FIT images. While attempting to use Falcon boot mode with FIT images on MMC flash boot devices, I've found the following additional code to be required. Patch attached and also added inline below: Sincerely, Nathan From a3d066656df60856950c9cbb28914d02d57c9364 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Tue, 8 Feb 2022 13:16:24 -0500 Subject: [PATCH] common: spl: spl_mmc: Add full FIT image support for kernel/OS loading during Falcon boot mode while booting via MMC Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- common/spl/spl_mmc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) struct spl_load_info load; From a3d066656df60856950c9cbb28914d02d57c9364 Mon Sep 17 00:00:00 2001 From: Nathan Barrett-Morrison Date: Tue, 8 Feb 2022 13:16:24 -0500 Subject: [PATCH] common: spl: spl_mmc: Add full FIT image support for kernel/OS loading during Falcon boot mode while booting via MMC Signed-off-by: Nathan Barrett-Morrison Cc: Tom Rini --- common/spl/spl_mmc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index e1a7d25bd0..7fb2505c33 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -94,7 +94,19 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image, goto end; } - if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && + if (IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL) && + image_get_magic(header) == FDT_MAGIC) { + u32 image_size_sectors; + + debug("Found FIT\n"); + + image_size_sectors = (roundup(fdt_totalsize(header), 4) + mmc->read_bl_len - 1) / + mmc->read_bl_len; + count = blk_dread(bd, sector, image_size_sectors, CONFIG_SYS_LOAD_ADDR); + debug("hdr read sector %lx, count=%lu\n", sector, count); + + ret = spl_parse_image_header(spl_image, CONFIG_SYS_LOAD_ADDR); + } else if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && image_get_magic(header) == FDT_MAGIC) { struct spl_load_info load; -- 2.30.2