From patchwork Fri Oct 2 11:33:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Klotz X-Patchwork-Id: 2315368 X-Patchwork-Delegate: tim609@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=tXm57X9Q; dkim=pass (2048-bit key; secure) header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=PFHI9ZQz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.u-boot-project.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hxMVB6G9rz1xyX for ; Sat, 03 Oct 2026 07:33:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7E17560D98; Fri, 2 Oct 2026 21:33:53 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id iqH8rN8WuJZW; Fri, 2 Oct 2026 21:33:53 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.0 smtp3.osuosl.org B38A36065F Authentication-Results: smtp3.osuosl.org; arc=pass header.oldest-pass=0 smtp.remote-ip=140.211.166.142 ARC-Seal: i=2; d=osuosl.org; s=arc; a=rsa-sha256; cv=pass; t=1790976832; b=aDja0EfNT+QJv3Pp0VXW0IBgnLEFHbc8oMZbmqRbdvjrW1PvgQFTMzWTd7XoBMONI7mK OxRyudwBUrQ6oqF7hlsg/ymKKQ+CE+bNbYiDCrTkPOPAzrzx3Dw8mKeCACO+X0UEsFXoB WNnpJaHpKq2xH3qmcHNiXu4GqaLtkPJIBGhstz6sosM7iImaZzwnU9iA9vxPVhE4wJBBa Cy5qvNo/jrT8Tp26qyldv8rpjA0e+zw4AT6LVVhXbZeYoqqY2k6KnOt7vljj0YqAX6PLd XawS4rP2v3TJU/kSgi/jZyN4SFSrzMGXAlt+Kf+FaLNt/kzRV5IesYp1Ap7PwQg7xNg== ARC-Message-Signature: i=2; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1790976832; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received: DKIM-Signature:Date:To:From:Cc:Subject:Message-ID:In-Reply-To: References:Feedback-ID:X-Pm-Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:X-Mailman-Approved-At:X-BeenThere: X-Mailman-Version:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Errors-To; bh=1yxwket0wmY/LKSNhmS747nDDkTOb+xtme6/jo9Rs54=; b=b8YYrn5xiNavtOyIaT7xjZzGIZVygUta79yIerho6PTTFqBSKU1fWpswyY92aGkA3KeU lAqtNJxZOCZ4xWrHT8gmNboqWuwhJm9AYWbZwC5n1RGcr41neUculUPCU1LIaVLszmWHI RvKRI81Z9G1xXSIvU8eOV+WB3PXq/wcw1SWJgB3++BmABxCQbS+Y4xMWVJEsWx9wYXAGo 7aIqTtd9tTOWXy3NaJDEzQ4O9suS2m4qzyZP+CdNmlxBAIWwVZ5BHHCqfDaSiwmUq+MST v9vkjOa8XG/43G4n2ADBMSUXZMKm50RBtypsMBWL/JkHsbWF67Za3rh/VAGjuY7l07g== ARC-Authentication-Results: i=2; smtp3.osuosl.org; dmarc=pass header.from=protonmail.com; dkim=pass header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=PFHI9ZQz; arc=pass header.oldest-pass=0 smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1790976832; bh=1yxwket0wmY/LKSNhmS747nDDkTOb+xtme6/jo9Rs54=; h=Date:To:From:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tXm57X9Q3farl/lyzjvM48ur1oF1RULGGAqckBergZ2iBZvkYHguGr9mt9lTRbPmG 77ZdAkiaAujaDaWaSuyXXbODO+58nc5urIjLP+eVvYdNUguqp5Ww57VbrrwUrOg3dQ AEw84lfDcfaieZiWEHAqiC6VST9DQ0bg6DRPpJztLmYTlzBgRwDnRLbclGYjJxmnx0 s5FWWkpRb0yA9bmKWHPHRfRuv92iCaozDVEkXPDa4O4R101M4UvXKR0Wwsey02BJ/d LsfmY9H+MKj0Xl4+eUDQmAzOq/6Zzz4mHsZFbdyAOsGkpSIJjes1C4Z3M+qM3iUqOG V18DnVsG/JOdw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id B38A36065F; Fri, 2 Oct 2026 21:33:52 +0000 (UTC) X-Original-To: u-boot@lists.u-boot-project.org Delivered-To: u-boot@lists.u-boot-project.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 960DF179 for ; Fri, 2 Oct 2026 21:33:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 87BC460666 for ; Fri, 2 Oct 2026 21:33:10 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id mbl-wyx4FifV for ; Fri, 2 Oct 2026 21:33:10 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.0 smtp3.osuosl.org CCA876064B Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=79.135.106.28 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1790976790; b=ZFM/Zaksk15wfLoClk6nFHS3NmhIEVxqAO0na7uHtsiKyRjGoU0tQYDNJLP9JuXUb2SI BLXe1+A9mkxAqWmQFWDLIOl50ZHrGYvkOQW9w1VfwbWKirPUcYa3FPjBDcqX9OUoBC6WK Nlc4kR1w+Jl7fe5FdthC+fFS0h7rf62aWmyCKcjc4JAn3WvDCOFMmadY/XQIRlh6KhJ0E 2aKGWvClasb5PnsN2yJAlxd0L5uwyz4a/AP4MSboTMFf5pX/1hXxC6Tkh7+wHlQMyDiOd lMwc1vMfeJQs2l4qhsXkbqoMNEyK2zsaKPjcxSzeB93INW3kcpRs0m4+cWHURbZdwCg== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1790976790; h=Received-SPF:DKIM-Signature:Date:To:From:Cc:Subject:Message-ID: In-Reply-To:References:Feedback-ID:X-Pm-Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=1yxwket0wmY/LKSNhmS747nDDkTOb+xtme6/jo9Rs54=; b=QQ/uENXQ0/eng/ZphpS96IETm9IwtQeeWNglkbgTTUgSEUKIZtk+vrC2D6OzaLkxKazd OHB8Kc0In9V+f8FZHd3lRxwLqcjBD06aAujXNMZ0p4ln1uXFYMyFqT12T5CBf7zD32hl8 MSohyXr8I0b59SmO74EIdqv/y93ZPhMOiCiPcvR57Viy9qvfFPgJcl0/vw5wdIk3YFCGt KwvZ32tzIACpXDMPsBT6tpXp6OGyX/nuRrWRZPpfwx0DBgao9MzhQgaXZAUr/Ol7ByqoP 8yZFVEk7LWVKTN3omBPNOoxHSNazhj6R02cU2+tXW4aLX4u8BSTDgB7iUAK13Jfcp1A== ARC-Authentication-Results: i=1; smtp3.osuosl.org; dmarc=pass header.from=protonmail.com; dkim=pass header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=PFHI9ZQz; arc=none smtp.remote-ip=79.135.106.28 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.135.106.28; helo=mail-10628.protonmail.ch; envelope-from=davewk225@protonmail.com; receiver= Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=PFHI9ZQz Received: from mail-10628.protonmail.ch (mail-10628.protonmail.ch [79.135.106.28]) by smtp3.osuosl.org (Postfix) with ESMTPS id CCA876064B for ; Fri, 2 Oct 2026 21:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1790976787; x=1791235987; bh=1yxwket0wmY/LKSNhmS747nDDkTOb+xtme6/jo9Rs54=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=PFHI9ZQzN2dcVfHmtNYmIvZURWGis/f+vo/Syt5W99pMiDm5jcb1TfqR/+vl6AAtT whRcrMW0w4AH/s65UUYNIzN4RelkyVpXcUsV5AjA3jlrEthx4uD7puSxHCgxMGCByF e5+C03H2WCppVJEuRUikNIt3MUj2+RZxya6WeFeat/FJiBEcnY5kkVPQUa5byyGFqc 5g5Yob4ZpZ/qOC49b+WVveKmFuS/4QjVapiwlSgYdoK6/AkSN/XMkJTRmp6oOY3zwl Zx9o52dkJk1KtfP4Q67zX+GY+MhmYCWZbWXm9YOiZXa7TjG+upX3LKGm9J7k0UHaze 1Z9RCccFtJVeA== Date: Fri, 02 Oct 2026 21:33:03 +0000 To: u-boot@lists.u-boot-project.org From: Dave Klotz Cc: Huan Zhou , Eric Chung , Yixun Lan , Tom Rini , Guodong Xu , Raymond Mao , u-boot-spacemit@groups.io Subject: [PATCH RESEND 1/2] spacemit: k1: do not require a PMIC or an SPI controller in SPL Message-ID: In-Reply-To: References: Feedback-ID: 100562830:user:proton X-Pm-Message-ID: 372043d79cd4514ed063eac8ebff030a453ecae7 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 02 Oct 2026 21:33:50 +0000 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.u-boot-project.org pmic_init() and nor_early_init() panic when the board device tree describes no PMIC or no SPI controller to the SPL. The OrangePi R2S boots from eMMC with its rails already up, and boards that boot from eMMC or microSD need no SPI NOR, so the SPL stops before it can load U-Boot. Log the missing device and carry on instead. If the SPL then has to boot from SPI without a controller, spl_spi_load_image() reports it. Signed-off-by: Dave Klotz --- board/spacemit/k1/spl.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/board/spacemit/k1/spl.c b/board/spacemit/k1/spl.c index ef23db62d6..96ee4449c4 100644 --- a/board/spacemit/k1/spl.c +++ b/board/spacemit/k1/spl.c @@ -301,8 +301,16 @@ void pmic_init(void) int ret; ret = uclass_get_device(UCLASS_PMIC, 0, &pmic_dev); - if (ret) - panic("Fail to detect PMIC (%d)\n", ret); + if (ret) { + /* + * Not every K1 board describes its PMIC to the SPL, and on some + * the rails are already up when the SPL runs. Only boards whose + * DDR bring-up depends on programming the bucks need one, so a + * missing PMIC is not fatal here. + */ + log_info("No PMIC (%d), leaving rails as found\n", ret); + return; + } set_vdd_core(); set_vdd_1v8(); set_vdd_mmc(); @@ -412,9 +420,15 @@ void nor_early_init(void) struct udevice *dev; int ret; + /* + * A board that boots from eMMC or microSD may describe no SPI + * controller at all; that is not fatal unless the SPL boots from SPI. + */ ret = uclass_get_device(UCLASS_SPI, 0, &dev); - if (ret) - panic("Fail to detect spi controller.\n"); + if (ret) { + log_info("No SPI controller (%d)\n", ret); + return; + } udelay(10); ret = uclass_get_device(UCLASS_SPI_FLASH, 0, &dev); if (ret) From patchwork Fri Oct 2 11:33:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Klotz X-Patchwork-Id: 2315369 X-Patchwork-Delegate: tim609@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=AjUcthux; dkim=pass (2048-bit key; secure) header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=uRu9TF+s; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.u-boot-project.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hxMVG36Lfz1xyX for ; Sat, 03 Oct 2026 07:33:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0E5AF813D8; Fri, 2 Oct 2026 21:33:57 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XgJlgI0hnuI2; Fri, 2 Oct 2026 21:33:56 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.0 smtp1.osuosl.org 50DC88145E Authentication-Results: smtp1.osuosl.org; arc=pass header.oldest-pass=0 smtp.remote-ip=140.211.166.142 ARC-Seal: i=2; d=osuosl.org; s=arc; a=rsa-sha256; cv=pass; t=1790976836; b=bkIzllVGUK4VWGjwwis3AjHrsQ56mSZ2crSiwapVuJUXSLsNyvgKiit1PKoi4855VYwZ /ongfAhA6Y14niiBQ0OswZj3IdJTCCTWidAOv8NhYN6bhJdQDw91G0VO0dTdEEv/kcpwM Cbb7PSqiVthh2VnV7XrN4RiCfkfkdH4+bKt8xWUbGGehxO9On2gWSz0EOI74PLqYN2ubV eIVQvwRv5jYJesfcmmx7D0mqMCIQKOdcuFldIavEtWKFYdU4wzkV6AnlfoW19ZruJAtkJ idcKsSbDUEfYfqskmwYuCMAcff/PQmkfAXFsk++3s+HPqx/QamHra/jAVl8q4z/SCZA== ARC-Message-Signature: i=2; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1790976836; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received: DKIM-Signature:Date:To:From:Cc:Subject:Message-ID:In-Reply-To: References:Feedback-ID:X-Pm-Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:X-Mailman-Approved-At:X-BeenThere: X-Mailman-Version:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Errors-To; bh=1gTy9i+7J4jFY5s6fMi/sYUVuaVfesKxz5Rtr/5yvto=; b=JvH55YUTQdqjPUSOBkO4Nw5ZC+g3MZhBoNpBRW1dbeQiP/60fM6Xl9YkD7ftaYnO3y78 5QQULAzg/+gFQ70DtP9s5sI/vbY+f8+h1UstLecvbwb6OH6OiV1rnsfCdBToZOOt+Sw0J G9rHscl9qkIA+JTc3ckFrsvNMgFbe7tq51UlmxPrnQTPjuj4HfSBe4Y3uzNH/D4zB4Fa2 YLm2HB3zb+kek+TI8W6NqWe+aW3+bhvpIspE7mrm8jALL2excCk07HXj5zbZpXou8Md21 1oBUNfrCecI72uJtmowt2eA2F6R84TL7Q3sP7nuHWzDqttq/5OAdep4qUaiYHgGHiOQ== ARC-Authentication-Results: i=2; smtp1.osuosl.org; dmarc=pass header.from=protonmail.com; dkim=pass header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=uRu9TF+s; arc=pass header.oldest-pass=0 smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1790976836; bh=1gTy9i+7J4jFY5s6fMi/sYUVuaVfesKxz5Rtr/5yvto=; h=Date:To:From:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AjUcthuxz5SsZSFNkNMQowaV8MmfdH5NzbWyc5Wef8To6T3XM1lnbY5HpLrV41p6N QaUVAeBKqs/Pjh0UWs1V8HGvcwrq94d38bXg4eatEf9LFeAtPIPKyNg7jK+kAaW/Pm RZ0r4fh8QaDy3QqIsUOr+6poRBsErYHSunXlOeuj22KwHVb0Y145Ux3f98o1RVsWzF o5r6k/BYqiA4ObQy6PwVuY5IHseiJr73FievQVB2vd+1X5TKHKOpWHdNkHjVQoJl0C SeCyr8k1L4k933WD+FIJLrzfHfLkrTbJHb9KGG58kw73LbwFEMfwwrxA1NQv76+pl6 Bm6Fr7IjenTnQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 50DC88145E; Fri, 2 Oct 2026 21:33:56 +0000 (UTC) X-Original-To: u-boot@lists.u-boot-project.org Delivered-To: u-boot@lists.u-boot-project.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 61BCC34E for ; Fri, 2 Oct 2026 21:33:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5F39F813D8 for ; Fri, 2 Oct 2026 21:33:19 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rnWN4gkfs4BE for ; Fri, 2 Oct 2026 21:33:18 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.0 smtp1.osuosl.org 942C9813C5 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=79.135.106.119 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1790976798; b=DADtGD+QQbIMZWRt/Arq5uNDG2O/kV7g0MQlKJyQ2N0BxG4ScJxaWOykwJ70O/cQgpcG cOTtCw1kbnd+3l045BIb9LdgsjsW1D5uSmB5+7UOLEnf7/2mLQY6n6MaURJ3IHmQwpoqu BEvgj/prFXdBOsfHqA1qBrH7Z6r2C/qx7d1Zcj6yd8w46O0Ljcjz+MoD8vpVf11nHnacg GLo4JzhELjzgbwXd4K9pxYM9RsxO9HcRR63KoamOSvUeD5SK0tKY/R3DbjmcCCAQlthKc 4LN/8lI2GzND9s8MjmjpCBp7K/SSeNX4JuURcP+Kpz52EBNDbswfr0/lq3iOPb/0umg== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1790976798; h=Received-SPF:DKIM-Signature:Date:To:From:Cc:Subject:Message-ID: In-Reply-To:References:Feedback-ID:X-Pm-Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=1gTy9i+7J4jFY5s6fMi/sYUVuaVfesKxz5Rtr/5yvto=; b=OZ0GQxBb0jqht51jtqmVSyfsj/P/jlOInEH0JfuRAnnyxJ3crm+LR1SBpzAqPQZc0/Qf G7llckCN8Jfv+lAGKxzRASLY2T0Bes4Xjcq7HsupKG18BlqJps8pGPvNmYw6ic/G8z7bD lALG76mvddMJO71QunBwWUqWFY3bWLHv+FXanqHcT9K4H59Jsxz0s3AXu6ZmNglNyeRVL CFgqwSDwb1OZpNDKvVz7F9Q6oqNz41v2Sxcl/0XFHZPSsl0gy4Elm05Dc953KoVdy1HOi XdohKrCjLQuvipD/APlovp7r+c391yZGi5YeM9EGCfe5DpXd8mkRKP+hwylLVcb2Vow== ARC-Authentication-Results: i=1; smtp1.osuosl.org; dmarc=pass header.from=protonmail.com; dkim=pass header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=uRu9TF+s; arc=none smtp.remote-ip=79.135.106.119 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.135.106.119; helo=mail-106119.protonmail.ch; envelope-from=davewk225@protonmail.com; receiver= Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.a=rsa-sha256 header.s=protonmail3 header.b=uRu9TF+s Received: from mail-106119.protonmail.ch (mail-106119.protonmail.ch [79.135.106.119]) by smtp1.osuosl.org (Postfix) with ESMTPS id 942C9813C5 for ; Fri, 2 Oct 2026 21:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1790976796; x=1791235996; bh=1gTy9i+7J4jFY5s6fMi/sYUVuaVfesKxz5Rtr/5yvto=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=uRu9TF+spY/p+QZCdvVsm3AwmFAq3si3SGauoVx7Hjs5HREMP0cCHxr3bGYHZjA5m Arwdjb6GbxAgoyqxkW5lEpATCOBCxt11JUyz5/ul7TmM4SaVx3iF1Xz6lu34HskjTj 9zZQK+uj9Q7pzYucRUknCMnUFqwd3sMszTUjkqm1Kapll5jIHKqAk6yeWo0qf0aahr viRBBu180b9sMVM+I4CiHxAGttcia721xEYJgUybXXqOReovEcV62trSPE8Gs2NhSt vJLfK4V2e1a0ido23k55BFm6/46srPaopSeoSTrg5b1Tl33lFRVQ+vAev49ykd3Jtn wv7/T4Ap4LVuQ== Date: Fri, 02 Oct 2026 21:33:10 +0000 To: u-boot@lists.u-boot-project.org From: Dave Klotz Cc: Huan Zhou , Eric Chung , Yixun Lan , Tom Rini , Guodong Xu , Raymond Mao , u-boot-spacemit@groups.io Subject: [PATCH RESEND 2/2] spacemit: k1: fall back to the other boot devices in SPL Message-ID: In-Reply-To: References: Feedback-ID: 100562830:user:proton X-Pm-Message-ID: bd860db7e5d85bbf2a83f8543f27df4103fc2a28 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 02 Oct 2026 21:33:50 +0000 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.u-boot-project.org spl_boot_device() derives the boot device from BootROM state: the SD API pointer the BootROM leaves in SRAM, the boot flag register, and the boot strap. Not every BootROM path is covered by that. On the OrangePi R2S, for example, the BootROM probes a card first ("try sd...") and only then loads the FSBL from eMMC, and on the OrangePi RV2 it falls back from the card to SPI NOR. If the detection names a device that holds no image, the SPL stops with "failed to boot from all boot devices". Provide board_boot_order(): the detected device first, then the other MMC controller and SPI NOR when this SPL can read them. Signed-off-by: Dave Klotz --- board/spacemit/k1/spl.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/board/spacemit/k1/spl.c b/board/spacemit/k1/spl.c index 96ee4449c4..cc0e26bb02 100644 --- a/board/spacemit/k1/spl.c +++ b/board/spacemit/k1/spl.c @@ -498,6 +498,32 @@ u32 spl_boot_device(void) return ret; } +/* + * Try the device the BootROM booted from first, then the other storage + * this SPL can read. The boot-mode detection relies on BootROM state; if + * it names a device that holds no image (the BootROM probed a card before + * falling back to eMMC, say), the SPL still finds U-Boot instead of + * stopping at "failed to boot from all boot devices". + */ +void board_boot_order(u32 *spl_boot_list) +{ + u32 fallbacks[3]; + int i, n = 0, m = 0; + + if (CONFIG_IS_ENABLED(MMC)) { + fallbacks[m++] = BOOT_DEVICE_MMC1; + fallbacks[m++] = BOOT_DEVICE_MMC2; + } + if (CONFIG_IS_ENABLED(SPI_LOAD)) + fallbacks[m++] = BOOT_DEVICE_SPI; + + spl_boot_list[n++] = spl_boot_device(); + for (i = 0; i < m; i++) + if (fallbacks[i] != spl_boot_list[0]) + spl_boot_list[n++] = fallbacks[i]; + spl_boot_list[n] = BOOT_DEVICE_NONE; +} + void spl_board_init(void) { }