Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5230CCD195 for ; Fri, 17 Oct 2025 19:33:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD89B83873; Fri, 17 Oct 2025 21:33:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="mgE0Jp6+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 95B7083835; Fri, 17 Oct 2025 21:33:29 +0200 (CEST) Received: from fllvem-ot03.ext.ti.com (fllvem-ot03.ext.ti.com [198.47.19.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EBF2B83829 for ; Fri, 17 Oct 2025 21:33:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=anshuld@ti.com Received: from fllvem-sh03.itg.ti.com ([10.64.41.86]) by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTP id 59HJXL31349600; Fri, 17 Oct 2025 14:33:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1760729601; bh=BbZxgYaZXSunJAFSiz+hI0oBFVfB5R/85vVnxDoswa0=; h=From:To:CC:Subject:Date; b=mgE0Jp6++s8ocSfBjv3+hIMkn7Uhfd1MI/8C4XeKanlBtbwD81VOP7WDZ93B89ue0 g/UgsyttCgP3nvFc7MyK3PRAuQ4NKF9xZqJFGOTlMonzWgUIXgz5T+3pIg+Ci3HCYt 7zSnrg5r3P32jRhVVSbD2ewnViOHrgbmnhtAhSE8= Received: from DLEE211.ent.ti.com (dlee211.ent.ti.com [157.170.170.113]) by fllvem-sh03.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 59HJXLmf2644551 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Oct 2025 14:33:21 -0500 Received: from DLEE202.ent.ti.com (157.170.170.77) by DLEE211.ent.ti.com (157.170.170.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Fri, 17 Oct 2025 14:33:21 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE202.ent.ti.com (157.170.170.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Fri, 17 Oct 2025 14:33:21 -0500 Received: from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 59HJXJdm1801561; Fri, 17 Oct 2025 14:33:20 -0500 From: Anshul Dalal To: CC: Anshul Dalal , , , , , , , , , , , , Subject: [PATCH v4 0/7] Add support for secure falcon mode: disable fallback Date: Sat, 18 Oct 2025 01:03:05 +0530 Message-ID: <20251017193318.4124997-1-anshuld@ti.com> X-Mailer: git-send-email 2.51.0 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 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 Hi all, Continuing from the last series[1], this patch series addresses the requirement of allowing no fallbacks in secure falcon mode. To do this in a clean way, all the falcon mode logic for each boot media was refactored to a corresponding *_load_image_os function whereas the regular boot is implemented in *_load_image, this allows us to easily return early in case the *_load_image_os function fails with secure mode enabled. The series also introduces the new SPL_OS_BOOT_SECURE config symbol which enables secure falcon boot flow. The generic flow after the patch series looks as follows: static int spl__load_image(...) { if (CONFIG_IS_ENABLED(OS_BOOT)) { ret = spl__load_image_os(...); puts("Failcon mode failed\n"); if (CONFIG_IS_ENABLED(OS_BOOT_SECURE)) { puts("no fallback allowed!\n"); return ret; } puts("Falling back to U-Boot\n"); } /* Regular boot flow */ } Regards, Anshul [1]: https://lore.kernel.org/u-boot/20250923124639.667718-1-anshuld@ti.com/ --- Changes in v4: - Change CONFIG_IS_ENABLED to IS_ENABLED - Fix unused function warnings v3: https://lore.kernel.org/u-boot/20251006101057.4172248-1-anshuld@ti.com/ Changes in v3: - Remove the patch enabling SPL_OS_BOOT for TI_SECURE_DEVICE v2: https://lore.kernel.org/u-boot/20250923130901.705124-1-anshuld@ti.com/ Changes in v2: - Remove extra printf to address SPL size concerns v1: https://lore.kernel.org/u-boot/20250916105857.163951-1-anshuld@ti.com/ --- Anshul Dalal (7): spl: Kconfig: add SPL_OS_BOOT_SECURE config symbol spl: mmc: split spl_mmc_do_fs_boot into regular/os_boot spl: ubi: refactor spl_ubi_load_image for falcon mode spl: spi: refactor spl_spi_load_image for falcon mode spl: nor: refactor spl_nor_load_image for falcon mode spl: nand: refactor spl_nand_load_image for falcon mode spl: falcon: disable fallback to U-Boot on failure common/spl/Kconfig | 8 ++++ common/spl/spl_mmc.c | 84 +++++++++++++++++++++------------ common/spl/spl_nand.c | 95 +++++++++++++++++++++----------------- common/spl/spl_nor.c | 105 ++++++++++++++++++++++++------------------ common/spl/spl_spi.c | 33 ++++++++++--- common/spl/spl_ubi.c | 46 +++++++++++++----- 6 files changed, 235 insertions(+), 136 deletions(-) -- 2.51.0