diff options
author | Nikhil M Jain <n-jain1@ti.com> | 2023-04-10 14:19:13 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-05-08 09:26:12 -0400 |
commit | 7a17e4c6f1019296a12fc68005916f11de6db928 (patch) | |
tree | b7b1fcf8caf6975f9c29e27af5e70773c1e2a132 /common/spl/spl.c | |
parent | 72236302e67827a9d4aa251308d162a14f6ce2d6 (diff) | |
download | u-boot-7a17e4c6f1019296a12fc68005916f11de6db928.tar.gz |
common: spl: spl: Remove video driver before u-boot proper
Add method to remove video driver before loading u-boot proper. When
bootstage changes from SPL to u-boot proper, noo method is called to
remove video driver, and at u-boot proper if video driver is not
enabled, the video driver starts displaying garbage on the screen,
because there is no reserved space for video and the frame buffer gets
u-boot proper data written.
Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Diffstat (limited to 'common/spl/spl.c')
-rw-r--r-- | common/spl/spl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index a630e798661..72078a8ebc8 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -35,6 +35,8 @@ #include <mapmem.h> #include <dm/root.h> #include <dm/util.h> +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> #include <linux/compiler.h> #include <fdt_support.h> #include <bootcount.h> @@ -889,6 +891,19 @@ void board_init_r(gd_t *dummy1, ulong dummy2) debug("Failed to stash bootstage: err=%d\n", ret); #endif +#if defined(CONFIG_SPL_VIDEO) + struct udevice *dev; + int rc; + + rc = uclass_find_device(UCLASS_VIDEO, 0, &dev); + if (!rc && dev) { + rc = device_remove(dev, DM_REMOVE_NORMAL); + if (rc) + printf("Cannot remove video device '%s' (err=%d)\n", + dev->name, rc); + } +#endif + spl_board_prepare_for_boot(); jump_to_image_no_args(&spl_image); } |