Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2146088/?format=api
{ "id": 2146088, "url": "http://patchwork.ozlabs.org/api/patches/2146088/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20251006101057.4172248-6-anshuld@ti.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20251006101057.4172248-6-anshuld@ti.com>", "list_archive_url": null, "date": "2025-10-06T10:10:53", "name": "[-next,v3,5/7] spl: nor: refactor spl_nor_load_image for falcon mode", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "46f6510a058b387cf41d1741a304fcc7df1ad515", "submitter": { "id": 90324, "url": "http://patchwork.ozlabs.org/api/people/90324/?format=api", "name": "Anshul Dalal", "email": "anshuld@ti.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20251006101057.4172248-6-anshuld@ti.com/mbox/", "series": [ { "id": 476383, "url": "http://patchwork.ozlabs.org/api/series/476383/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=476383", "date": "2025-10-06T10:10:48", "name": "Add support for secure falcon mode: disable fallback", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/476383/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2146088/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2146088/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256\n header.s=ti-com-17Q1 header.b=y3PNbXSR;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.b=\"y3PNbXSR\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com", "phobos.denx.de; spf=pass smtp.mailfrom=anshuld@ti.com" ], "Received": [ "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4cgFRv0slrz1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 6 Oct 2025 21:11:55 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 41FD2836CE;\n\tMon, 6 Oct 2025 12:11:18 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 1B95E83759; Mon, 6 Oct 2025 12:11:17 +0200 (CEST)", "from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id E72A9834D4\n for <u-boot@lists.denx.de>; Mon, 6 Oct 2025 12:11:14 +0200 (CEST)", "from fllvem-sh04.itg.ti.com ([10.64.41.54])\n by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTP id 596ABAYk3587757;\n Mon, 6 Oct 2025 05:11:10 -0500", "from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22])\n by fllvem-sh04.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 596ABA2d4044750\n (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL);\n Mon, 6 Oct 2025 05:11:10 -0500", "from DFLE201.ent.ti.com (10.64.6.59) by DFLE101.ent.ti.com\n (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Mon, 6\n Oct 2025 05:11:09 -0500", "from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE201.ent.ti.com\n (10.64.6.59) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend\n Transport; Mon, 6 Oct 2025 05:11:10 -0500", "from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105])\n by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 596AB8s43511803;\n Mon, 6 Oct 2025 05:11:09 -0500" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;\n s=ti-com-17Q1; t=1759745470;\n bh=ZHjkdrG0xIiWnGd6VAVFmfmL3YWLYK2JLZq+jpD51/o=;\n h=From:To:CC:Subject:Date:In-Reply-To:References;\n b=y3PNbXSR4X4YWay1RZEVEF87fMKwkYdqiUjKfvug0lRuiGmxGFxjgUCC7H3Bx1zwy\n SluhEHPWne5QR920OPcCfgTbSFTZReOMbWfT9DRnFT64sRxLFcIehOLxzo+H8xXze6\n /KGcBcfDwz+vgbJ68R4eEaaKCVRHPejboMoJDgnQ=", "From": "Anshul Dalal <anshuld@ti.com>", "To": "<u-boot@lists.denx.de>", "CC": "Anshul Dalal <anshuld@ti.com>, <vigneshr@ti.com>, <trini@konsulko.com>,\n <afd@ti.com>, <m-chawdhry@ti.com>, <n-francis@ti.com>, <b-liu@ti.com>,\n <nm@ti.com>, <bb@ti.com>, <kever.yang@rock-chips.com>,\n <hl@rock-chips.com>, <tim@feathertop.org>,\n <marek.vasut+renesas@mailbox.org>", "Subject": "[PATCH -next v3 5/7] spl: nor: refactor spl_nor_load_image for falcon\n mode", "Date": "Mon, 6 Oct 2025 15:40:53 +0530", "Message-ID": "<20251006101057.4172248-6-anshuld@ti.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20251006101057.4172248-1-anshuld@ti.com>", "References": "<20251006101057.4172248-1-anshuld@ti.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-C2ProcessedOrg": "333ef613-75bf-4e12-a4b1-8e3623f5dcea", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "This patch moves the falcon mode handling logic out of\nspl_nor_load_image to spl_nor_load_image_os, this allows for cleaner\nhandling for fallback to U-Boot in case falcon mode fails.\n\nSigned-off-by: Anshul Dalal <anshuld@ti.com>\n---\n common/spl/spl_nor.c | 102 ++++++++++++++++++++++++-------------------\n 1 file changed, 57 insertions(+), 45 deletions(-)", "diff": "diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c\nindex 1021d933999..9c037bd62eb 100644\n--- a/common/spl/spl_nor.c\n+++ b/common/spl/spl_nor.c\n@@ -25,66 +25,78 @@ unsigned long __weak spl_nor_get_uboot_base(void)\n \treturn CFG_SYS_UBOOT_BASE;\n }\n \n-static int spl_nor_load_image(struct spl_image_info *spl_image,\n-\t\t\t struct spl_boot_device *bootdev)\n+#if CONFIG_IS_ENABLED(OS_BOOT)\n+static int spl_nor_load_image_os(struct spl_image_info *spl_image,\n+\t\t\t\t struct spl_boot_device *bootdev)\n {\n-\tstruct spl_load_info load;\n-\n \t/*\n-\t * Loading of the payload to SDRAM is done with skipping of\n-\t * the mkimage header in this SPL NOR driver\n+\t * Load Linux from its location in NOR flash to its defined\n+\t * location in SDRAM\n \t */\n-\tspl_image->flags |= SPL_COPY_PAYLOAD_ONLY;\n+\tconst struct legacy_img_hdr *header =\n+\t\t(const struct legacy_img_hdr *)CONFIG_SYS_OS_BASE;\n+\tstruct spl_load_info load;\n \n-#if CONFIG_IS_ENABLED(OS_BOOT)\n-\tif (!spl_start_uboot()) {\n-\t\t/*\n-\t\t * Load Linux from its location in NOR flash to its defined\n-\t\t * location in SDRAM\n-\t\t */\n-\t\tconst struct legacy_img_hdr *header =\n-\t\t\t(const struct legacy_img_hdr *)CONFIG_SYS_OS_BASE;\n #ifdef CONFIG_SPL_LOAD_FIT\n-\t\tif (image_get_magic(header) == FDT_MAGIC) {\n-\t\t\tint ret;\n+\tif (image_get_magic(header) == FDT_MAGIC) {\n+\t\tint ret;\n \n-\t\t\tdebug(\"Found FIT\\n\");\n-\t\t\tspl_load_init(&load, spl_nor_load_read, NULL, 1);\n+\t\tdebug(\"Found FIT\\n\");\n+\t\tspl_load_init(&load, spl_nor_load_read, NULL, 1);\n \n-\t\t\tret = spl_load_simple_fit(spl_image, &load,\n-\t\t\t\t\t\t CONFIG_SYS_OS_BASE,\n-\t\t\t\t\t\t (void *)header);\n+\t\tret = spl_load_simple_fit(spl_image, &load, CONFIG_SYS_OS_BASE,\n+\t\t\t\t\t (void *)header);\n \n #if defined CONFIG_SPL_PAYLOAD_ARGS_ADDR && defined CONFIG_CMD_SPL_NOR_OFS\n-\t\t\tmemcpy((void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR,\n-\t\t\t (void *)CONFIG_CMD_SPL_NOR_OFS,\n-\t\t\t CONFIG_CMD_SPL_WRITE_SIZE);\n+\t\tmemcpy((void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR,\n+\t\t (void *)CONFIG_CMD_SPL_NOR_OFS,\n+\t\t CONFIG_CMD_SPL_WRITE_SIZE);\n #endif\n-\t\t\treturn ret;\n-\t\t}\n+\t\treturn ret;\n+\t}\n #endif\n-\t\tif (image_get_os(header) == IH_OS_LINUX) {\n-\t\t\t/* happy - was a Linux */\n-\t\t\tint ret;\n-\n-\t\t\tret = spl_parse_image_header(spl_image, bootdev, header);\n-\t\t\tif (ret)\n-\t\t\t\treturn ret;\n-\n-\t\t\tmemcpy((void *)spl_image->load_addr,\n-\t\t\t (void *)(CONFIG_SYS_OS_BASE +\n-\t\t\t\t\tsizeof(struct legacy_img_hdr)),\n-\t\t\t spl_image->size);\n+\tif (image_get_os(header) != IH_OS_LINUX)\n+\t\treturn -EINVAL;\n+\n+\t/* happy - was a Linux */\n+\tint ret;\n+\n+\tret = spl_parse_image_header(spl_image, bootdev, header);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tmemcpy((void *)spl_image->load_addr,\n+\t (void *)(CONFIG_SYS_OS_BASE + sizeof(struct legacy_img_hdr)),\n+\t spl_image->size);\n+\n #ifdef CONFIG_SPL_PAYLOAD_ARGS_ADDR\n-\t\t\tspl_image->arg = (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR;\n+\tspl_image->arg = (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR;\n #endif\n \n+\treturn 0;\n+}\n+#endif\n+\n+static int spl_nor_load_image(struct spl_image_info *spl_image,\n+\t\t\t struct spl_boot_device *bootdev)\n+{\n+\tint err;\n+\tstruct spl_load_info load;\n+\n+\t/*\n+\t * Loading of the payload to SDRAM is done with skipping of\n+\t * the mkimage header in this SPL NOR driver\n+\t */\n+\tspl_image->flags |= SPL_COPY_PAYLOAD_ONLY;\n+\n+#if CONFIG_IS_ENABLED(OS_BOOT)\n+\tif (!spl_start_uboot()) {\n+\t\terr = spl_nor_load_image_os(spl_image, bootdev);\n+\t\tif (!err)\n \t\t\treturn 0;\n-\t\t} else {\n-\t\t\tputs(\"The Expected Linux image was not found.\\n\"\n-\t\t\t \"Please check your NOR configuration.\\n\"\n-\t\t\t \"Trying to start u-boot now...\\n\");\n-\t\t}\n+\n+\t\tprintf(\"%s: Failed in falcon boot: %d, fallback to U-Boot\",\n+\t\t __func__, err);\n \t}\n #endif\n \n", "prefixes": [ "-next", "v3", "5/7" ] }