U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Gibbons <jamie.gibbons@microchip.com>
To: <u-boot@lists.denx.de>
Cc: Conor Dooley <conor.dooley@microchip.com>,
	Valentina Fernandez Alanis
	<valentina.fernandezalanis@microchip.com>,
	Tom Rini <trini@konsulko.com>,
	"Leo Yu-Chi Liang" <ycliang@andestech.com>,
	Sughosh Ganu <sughosh.ganu@arm.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Martin Herren <sputnik@on-the-web.ch>,
	Michal Simek <michal.simek@amd.com>,
	<jamie.gibbons@microchip.com>
Subject: [PATCH v2 2/6] misc: mpfs_syscontroller: bind RNG sub-device
Date: Wed, 22 Jul 2026 16:45:45 +0100	[thread overview]
Message-ID: <20260722154602.3373184-3-jamie.gibbons@microchip.com> (raw)
In-Reply-To: <20260722154602.3373184-1-jamie.gibbons@microchip.com>

The MPFS RNG driver is not described by the device tree and is instead
registered dynamically by the system controller. Explicitly bind the
MPFS RNG driver as a child device during system controller probe.

This ensures the RNG device is instantiated and available via UCLASS_RNG
without requiring a device tree node.

Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
 drivers/misc/mpfs_syscontroller.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/misc/mpfs_syscontroller.c b/drivers/misc/mpfs_syscontroller.c
index 8803263ca4c..e20f183be3b 100644
--- a/drivers/misc/mpfs_syscontroller.c
+++ b/drivers/misc/mpfs_syscontroller.c
@@ -11,6 +11,7 @@
 #include <asm/system.h>
 #include <dm.h>
 #include <dm/device_compat.h>
+#include <dm/lists.h>
 #include <env.h>
 #include <errno.h>
 #include <linux/compat.h>
@@ -334,6 +335,7 @@ EXPORT_SYMBOL(mpfs_syscontroller_process_dtbo);
 static int mpfs_syscontroller_probe(struct udevice *dev)
 {
 	struct mpfs_syscontroller_priv *sys_controller = dev_get_priv(dev);
+	struct udevice *rng_dev;
 	int ret;
 
 	ret = mbox_get_by_index(dev, 0, &sys_controller->chan);
@@ -343,6 +345,10 @@ static int mpfs_syscontroller_probe(struct udevice *dev)
 		return ret;
 	}
 
+	ret = device_bind_driver(dev, "mpfs_rng", "mpfs-rng", &rng_dev);
+	if (ret)
+		dev_err(dev, "Failed to bind mpfs_rng: %d\n", ret);
+
 	init_completion(&sys_controller->c);
 	dev_info(dev, "Registered MPFS system controller\n");
 
-- 
2.43.0


  parent reply	other threads:[~2026-07-23  0:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 15:45 [PATCH v2 0/6] MPFS: add hardware RNG support and fix RNG consumers Jamie Gibbons
2026-07-22 15:45 ` [PATCH v2 1/6] misc: mpfs_syscontroller: add mailbox RX helper for service responses Jamie Gibbons
2026-07-22 15:45 ` Jamie Gibbons [this message]
2026-07-22 15:45 ` [PATCH v2 3/6] rng: add Microchip PolarFire SoC hardware RNG driver Jamie Gibbons
2026-07-27  7:14   ` Leo Liang via U-Boot
2026-07-27  8:12     ` Jamie.Gibbons--- via U-Boot
2026-07-28  7:59       ` Leo Liang via U-Boot
2026-07-22 15:45 ` [PATCH v2 4/6] configs: microchip_mpfs_generic: enable MPFS RNG support Jamie Gibbons
2026-07-27  7:14   ` Leo Liang via U-Boot
2026-07-22 15:45 ` [PATCH v2 5/6] mailbox: mpfs-mbox: replace unbounded BUSY polling with bounded waits Jamie Gibbons
2026-07-22 15:45 ` [PATCH v2 6/6] mailbox: mpfs: add bounded wait for BUSY to clear before sending request Jamie Gibbons
2026-07-28  8:12 ` [PATCH v2 0/6] MPFS: add hardware RNG support and fix RNG consumers Leo Liang via U-Boot

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=20260722154602.3373184-3-jamie.gibbons@microchip.com \
    --to=jamie.gibbons@microchip.com \
    --cc=conor.dooley@microchip.com \
    --cc=michal.simek@amd.com \
    --cc=sputnik@on-the-web.ch \
    --cc=sughosh.ganu@arm.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=valentina.fernandezalanis@microchip.com \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox