Re: [PATCH 4/4] common: spl: spl: Remove video driver before u-boot proper

2023-04-19 Thread Nikhil M Jain

Hi Simon,

On 19/04/23 07:16, Simon Glass wrote:

Hi Nikhil,

On Mon, 10 Apr 2023 at 02:21, Nikhil M Jain  wrote:


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 
---
  common/spl/spl.c | 15 +++
  1 file changed, 15 insertions(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index a630e79866..72078a8ebc 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -35,6 +35,8 @@
  #include 
  #include 
  #include 
+#include 
+#include 
  #include 
  #include 
  #include 
@@ -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)


Should use if(IS_ENABLED(...))

But it would be better to pass the frame buffer to U-Boot proper so it
can use the same address. This can be done with a bloblist record. See
for example [1]

Yes it would be better, I will try to use bloblist for passing frame 
buffer to u-boot.



+   struct udevice *dev;
+   int rc;
+
+   rc = uclass_find_device(UCLASS_VIDEO, 0, );


uclass_find_first_device


+   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(_image);
  }
--
2.34.1



Regards,
Simon

[1] 
https://patchwork.ozlabs.org/project/uboot/patch/20230331103047.26.Ieb0824a81d8ad4109fa501c9497b01b8749f913a@changeid/


Thanks,
Nikhil


Re: [PATCH 4/4] common: spl: spl: Remove video driver before u-boot proper

2023-04-18 Thread Simon Glass
Hi Nikhil,

On Mon, 10 Apr 2023 at 02:21, Nikhil M Jain  wrote:
>
> 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 
> ---
>  common/spl/spl.c | 15 +++
>  1 file changed, 15 insertions(+)
>
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index a630e79866..72078a8ebc 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -35,6 +35,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -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)

Should use if(IS_ENABLED(...))

But it would be better to pass the frame buffer to U-Boot proper so it
can use the same address. This can be done with a bloblist record. See
for example [1]

> +   struct udevice *dev;
> +   int rc;
> +
> +   rc = uclass_find_device(UCLASS_VIDEO, 0, );

uclass_find_first_device

> +   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(_image);
>  }
> --
> 2.34.1
>

Regards,
Simon

[1] 
https://patchwork.ozlabs.org/project/uboot/patch/20230331103047.26.Ieb0824a81d8ad4109fa501c9497b01b8749f913a@changeid/


[PATCH 4/4] common: spl: spl: Remove video driver before u-boot proper

2023-04-10 Thread Nikhil M Jain
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 
---
 common/spl/spl.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index a630e79866..72078a8ebc 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -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, );
+   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(_image);
 }
-- 
2.34.1