diff options
author | Tom Rini <trini@konsulko.com> | 2023-01-12 17:05:41 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-12 17:05:41 -0500 |
commit | 87c9e117bf57d6bb42c5521a3f6ec9ca7d97e5fa (patch) | |
tree | 9a2a90d475abd35c8945bb3af7aa0c14bfc149f7 /drivers/misc/fs_loader.c | |
parent | f58885d002302b8047446a6a15f7376bb7b1ea32 (diff) | |
parent | 48b3ecbedf8208845ac5956a3fb8817269fafedd (diff) |
Merge branch '2023-01-12-further-assorted-general-updates'
- Bring in a number of assorted updates, some of which have been waiting
around for a bit. Make silent console really be silent, get rid of
gpio_hog_probe_all, add RNG for imx6, make net/fm use fs_loader, get
rid of a bad __weak usage and set distro_bootpart_uuid in another case.
Diffstat (limited to 'drivers/misc/fs_loader.c')
-rw-r--r-- | drivers/misc/fs_loader.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c index 5b4d03639c3..ccf5c7a8037 100644 --- a/drivers/misc/fs_loader.c +++ b/drivers/misc/fs_loader.c @@ -15,6 +15,8 @@ #include <fs_loader.h> #include <log.h> #include <asm/global_data.h> +#include <dm/device-internal.h> +#include <dm/root.h> #include <linux/string.h> #include <mapmem.h> #include <malloc.h> @@ -297,6 +299,31 @@ U_BOOT_DRIVER(fs_loader) = { .priv_auto = sizeof(struct firmware), }; +static struct device_plat default_plat = { 0 }; + +int get_fs_loader(struct udevice **dev) +{ + int ret; + ofnode node = ofnode_get_chosen_node("firmware-loader"); + + if (ofnode_valid(node)) + return uclass_get_device_by_ofnode(UCLASS_FS_FIRMWARE_LOADER, + node, dev); + + /* Try the first device if none was chosen */ + ret = uclass_first_device_err(UCLASS_FS_FIRMWARE_LOADER, dev); + if (ret != -ENODEV) + return ret; + + /* Just create a new device */ + ret = device_bind(dm_root(), DM_DRIVER_GET(fs_loader), "default-loader", + &default_plat, ofnode_null(), dev); + if (ret) + return ret; + + return device_probe(*dev); +} + UCLASS_DRIVER(fs_loader) = { .id = UCLASS_FS_FIRMWARE_LOADER, .name = "fs-loader", |