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, jonas@kwiboo.se, u-boot@lists.denx.de,
	Fabio Estevam <festevam@nabladev.com>
Subject: [PATCH v2 5/7] rockchip: spl-boot-order: Add SPI NAND support
Date: Sun,  8 Feb 2026 18:26:22 -0300	[thread overview]
Message-ID: <20260208212624.3413494-6-festevam@gmail.com> (raw)
In-Reply-To: <20260208212624.3413494-1-festevam@gmail.com>

From: Fabio Estevam <festevam@nabladev.com>

Make spl-boot-order to accept boot 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>
---
Changes since v1:
- None.

 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-08 21:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-08 21:26 [PATCH v2 0/7] ARM: Add RV1103B Omega4 board support Fabio Estevam
2026-02-08 21:26 ` [PATCH v2 1/7] ARM: dts: Add RV1103B Omega4 support Fabio Estevam
2026-02-09 10:45   ` Jonas Karlman
2026-02-08 21:26 ` [PATCH v2 2/7] pinctrl: rockchip: Add RV1103B support Fabio Estevam
2026-02-09 10:50   ` Jonas Karlman
2026-02-08 21:26 ` [PATCH v2 3/7] clk: rockchip: Add RV1103B clock driver Fabio Estevam
2026-02-08 21:26 ` [PATCH v2 4/7] tools: rkcommon: Add RV1103B support Fabio Estevam
2026-02-08 21:26 ` Fabio Estevam [this message]
2026-02-09  9:56   ` [PATCH v2 5/7] rockchip: spl-boot-order: Add SPI NAND support Jonas Karlman
2026-02-08 21:26 ` [PATCH v2 6/7] spl: add SPI NAND support via MTD in SPL Fabio Estevam
2026-02-08 23:47   ` Jonas Karlman
2026-02-08 21:26 ` [PATCH v2 7/7] omega4-rv1103b: Add the initial support Fabio Estevam
2026-07-06 12:26 ` [PATCH v2 0/7] ARM: Add RV1103B Omega4 board support Simon Glass
2026-07-06 12:31   ` Fabio Estevam
2026-07-06 13:54     ` Tom Rini
2026-07-08 22:36       ` Simon Glass

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=20260208212624.3413494-6-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=festevam@nabladev.com \
    --cc=jonas@kwiboo.se \
    --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.