All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: kever.yang@rock-chips.com
Cc: trini@konsulko.com, u-boot@lists.denx.de,
	Fabio Estevam <festevam@nabladev.com>
Subject: [PATCH 4/7] rockchip: spl-boot-order: Add SPI NAND support
Date: Sat, 31 Jan 2026 21:44:53 -0300	[thread overview]
Message-ID: <20260201004456.763107-5-festevam@gmail.com> (raw)
In-Reply-To: <20260201004456.763107-1-festevam@gmail.com>

From: Fabio Estevam <festevam@nabladev.com>

Make spl-boot-order to accept booting from SPI NAND as well.

With this change, it is possible to specify spi_nand as the boot medium
like this:

u-boot,spl-boot-order = &spi_nand;

Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
 arch/arm/mach-rockchip/spl-boot-order.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/spl-boot-order.c b/arch/arm/mach-rockchip/spl-boot-order.c
index 6572dde29f65..e5897536934a 100644
--- a/arch/arm/mach-rockchip/spl-boot-order.c
+++ b/arch/arm/mach-rockchip/spl-boot-order.c
@@ -4,6 +4,7 @@
  */
 
 #include <dm.h>
+#include <dm/device_compat.h>
 #include <fdt_support.h>
 #include <log.h>
 #include <mmc.h>
@@ -75,6 +76,8 @@ static int spl_node_to_boot_device(int node)
 	 */
 	if (!uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
 		return BOOT_DEVICE_SPI;
+	if (fdt_node_check_compatible(gd->fdt_blob, node, "spi-nand") == 0)
+		return BOOT_DEVICE_SPI;
 
 	return -1;
 }
@@ -221,8 +224,12 @@ int spl_decode_boot_device(u32 boot_device, char *buf, size_t buflen)
 
 			ret = uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &dev);
 			if (ret) {
-				debug("%s: could not find udevice for %s\n", __func__, conf);
-				continue;
+				ret = uclass_find_device_by_of_offset(UCLASS_MTD, node, &dev);
+				if (ret || !device_is_compatible(dev, "spi-nand")) {
+					debug("%s: could not find udevice for %s\n",
+					      __func__, conf);
+					continue;
+				}
 			}
 
 			return ofnode_get_path(dev_ofnode(dev), buf, buflen);
-- 
2.34.1


  parent reply	other threads:[~2026-02-01  0:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-01  0:44 [PATCH 0/7] ARM: Add RV1103 Omega4 board support Fabio Estevam
2026-02-01  0:44 ` [PATCH 1/7] pinctrl: rockchip: Add support for RV1103 Fabio Estevam
2026-02-01  1:28   ` Jonas Karlman
2026-02-01  0:44 ` [PATCH 2/7] clk: " Fabio Estevam
2026-02-01  0:44 ` [PATCH 3/7] tools: rkcommon: Add rv1103 support Fabio Estevam
2026-02-01  1:44   ` Jonas Karlman
2026-02-01  0:44 ` Fabio Estevam [this message]
2026-02-01  0:44 ` [PATCH 5/7] spl: Add SPI NAND support via MTD in SPL Fabio Estevam
2026-02-01  0:44 ` [PATCH 6/7] ARM: dts: Add RV1103 Omega4 support Fabio Estevam
2026-02-01  0:44 ` [PATCH 7/7] omega4-rv1103: Add initial support Fabio Estevam
2026-02-01  1:12 ` [PATCH 0/7] ARM: Add RV1103 Omega4 board support Jonas Karlman
2026-02-03 15:10   ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260201004456.763107-5-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=festevam@nabladev.com \
    --cc=kever.yang@rock-chips.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.