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 <[email protected]>
---
 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 61d6780f0b9..79dc43f085f 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>
@@ -332,6 +333,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);
@@ -341,6 +343,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

Reply via email to