[PATCH] tools: logos: Rename TI logo files

2023-09-01 Thread Nikhil M Jain
Change the file name from ti.gz and ti.bmp to ti_logos_414x97_32bpp to
help user understand the resolution and identify the logo files when
placed in the boot partition and update the splashfile name with the
same in .env file.

Signed-off-by: Nikhil M Jain 
---
 board/ti/am62x/am62x.env   |   2 +-
 tools/logos/{ti.bmp => ti_logo_414x97_32bpp.bmp}   | Bin
 tools/logos/{ti.gz => ti_logo_414x97_32bpp.bmp.gz} | Bin
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename tools/logos/{ti.bmp => ti_logo_414x97_32bpp.bmp} (100%)
 rename tools/logos/{ti.gz => ti_logo_414x97_32bpp.bmp.gz} (100%)

diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env
index f2dc87893a..ece9eacc08 100644
--- a/board/ti/am62x/am62x.env
+++ b/board/ti/am62x/am62x.env
@@ -17,7 +17,7 @@ bootpart=1:2
 bootdir=/boot
 rd_spec=-
 
-splashfile=ti.gz
+splashfile=ti_logo_414x97_32bpp.bmp.gz
 splashimage=0x8020
 splashpos=m,m
 splashsource=sf
diff --git a/tools/logos/ti.bmp b/tools/logos/ti_logo_414x97_32bpp.bmp
similarity index 100%
rename from tools/logos/ti.bmp
rename to tools/logos/ti_logo_414x97_32bpp.bmp
diff --git a/tools/logos/ti.gz b/tools/logos/ti_logo_414x97_32bpp.bmp.gz
similarity index 100%
rename from tools/logos/ti.gz
rename to tools/logos/ti_logo_414x97_32bpp.bmp.gz
-- 
2.34.1



Re: [PATCH 5/9] board_f: Fix corruption of relocaddr

2023-07-28 Thread Nikhil M Jain




On 28/07/23 14:05, Nikhil M Jain wrote:

Hi Simon,

On 27/07/23 23:31, Simon Glass wrote:

Hi Nikhil,

On Wed, 26 Jul 2023 at 23:22, Nikhil M Jain  wrote:


Hi Simon,

On 27/07/23 06:23, Simon Glass wrote:

Hi Devarsh,

On Wed, 26 Jul 2023 at 05:09, Devarsh Thakkar  wrote:


Hi Simon,

On 26/07/23 02:58, Simon Glass wrote:

Hi Devarsh,

On Tue, 25 Jul 2023 at 03:21, Devarsh Thakkar  
wrote:


Hi Simon,

On 24/07/23 20:22, Simon Glass wrote:
When the video framebuffer comes from the bloblist, we should 
not change
relocaddr to this address, since it interfers with the normal 
memory

allocation.

This fixes a boot loop in qemu-x86_64

Signed-off-by: Simon Glass 
Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info 
from SPL to u-boot")

---

   common/board_f.c | 1 -
   1 file changed, 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 7d2c380e91e2..5c8646b22283 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -419,7 +419,6 @@ static int reserve_video(void)
    if (!ho)
    return log_msg_ret("blf", -ENOENT);
    video_reserve_from_bloblist(ho);
- gd->relocaddr = ho->fb;


I think this change was done as relocaddr pointer was required to 
be updated
to move after frame-buffer reserved area to ensure that any 
further memory
reservations done using gd->relocaddr (for e.g. in 
reserve_trace/uboot/malloc)
don't overlap with frame-buffer reserved area passed from blob, 
so I think
removing this line may cause further memory reservations to 
overlap with

reserved framebuffer.

Could you please confirm?


SPL and U-Boot have different memory layouts. The current code is
interrupting U-Boot's careful building up of chunks of memory used 
for

different purposes.



But it is possible they could be using similar memory layout for some
components like framebuffer.
For e.g. in our case we are using same video_reserve func in A53 
SPL too

and which allocates framebuffer from gd->relocaddr as seen here:

https://source.denx.de/u-boot/u-boot/-/blob/v2023.10-rc1/common/board_f.c?ref_type=tags#L427


Even if it is similar, the point is that U-Boot proper needs to do its
own allocation stuff.

Of course, if SPL sets up the video, it will provide the framebuffer
address, but only that. The other addresses need to be done using the
normal mechanism.




The video memory has already been allocated by SPL, so we don't need
to insert a new one here, as your code demonstrates.



Agreed.


But also we have no way of knowing if it is legal to relocate U-Boot
(and various other things) just below the frame buffer chosen by SPL.



Yes, so i suppose your case is that framebuffer address which is 
being passed
by SPL is totally disjoint and too far away from gd->relocaddr, for 
e.g. it is
at the start (or bottom of DDR) and doesn't interfere with 
gd->relocaddr in
any manner since relocaddr points to ramtop (i.e. near to end 
address of DDR).


In that case I agree it doesn't make sense to move relocaddr to 
ho->fb.


But for the scenario where gd->relocaddr and ho->fb are nearby 
there is every
possibility that gd->relocaddr may overlap with framebuffer, also 
the code in
reserve_trace, reserve_uboot doesn't have any intelligence or check 
that it is

overlapping with framebuffer area or not.

I think one thing that can probably be done here is to have a check 
that if
passed framebuffer area falls within current relocaddr region, then 
update the

relocaddr else don't touch relocaddr :

if (ho->fb <= gd->relocaddr - ho->size)


Just a small correction here
if (ho->fb >= gd->relocaddr - ho->size)

    //It means framebuffer are is overlapping with current 
relocaddr so update

relocaddr
  gd->relocaddr = ho->fb


We should go ahead with this check because it won't disrupt u-boot's
allocation of memory and will allow both the cases if a platform is
using same memory layout or different memory layout across SPL and
u-boot proper. Below are the logs for both scenarios.

https://gist.github.com/NikMJain/aca198ae77b6f1855459bc8fbdd683df


else
    //don't update gd->relocaddr since ho->fb is disjoint to 
gd->relocaddr


Could you please share your opinion on this and if above logic 
suffice your

case too ?


I don't think this line is needed at all, which is why this patch
removes it. What problem are you seeing?


Across SPL stage and U-boot we are keeping same memory layout and
ensuring that same memory regions are used, this way it doesn't
interfere in the way of u-boot while allocating memory regions for
various purposes. This allowed us to display splash screen without any
flicker across the stages.

Now if you remove the line  gd->relocaddr = ho->fb, the frame buffer
region will be used for reserving memory for other purposes which
corrupts the frame buffer.

One solution which we are planning to implement is move the ram_top to a
lo

Re: [PATCH 5/9] board_f: Fix corruption of relocaddr

2023-07-28 Thread Nikhil M Jain

Hi Simon,

On 27/07/23 23:31, Simon Glass wrote:

Hi Nikhil,

On Wed, 26 Jul 2023 at 23:22, Nikhil M Jain  wrote:


Hi Simon,

On 27/07/23 06:23, Simon Glass wrote:

Hi Devarsh,

On Wed, 26 Jul 2023 at 05:09, Devarsh Thakkar  wrote:


Hi Simon,

On 26/07/23 02:58, Simon Glass wrote:

Hi Devarsh,

On Tue, 25 Jul 2023 at 03:21, Devarsh Thakkar  wrote:


Hi Simon,

On 24/07/23 20:22, Simon Glass wrote:

When the video framebuffer comes from the bloblist, we should not change
relocaddr to this address, since it interfers with the normal memory
allocation.

This fixes a boot loop in qemu-x86_64

Signed-off-by: Simon Glass 
Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to 
u-boot")
---

   common/board_f.c | 1 -
   1 file changed, 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 7d2c380e91e2..5c8646b22283 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -419,7 +419,6 @@ static int reserve_video(void)
if (!ho)
return log_msg_ret("blf", -ENOENT);
video_reserve_from_bloblist(ho);
- gd->relocaddr = ho->fb;


I think this change was done as relocaddr pointer was required to be updated
to move after frame-buffer reserved area to ensure that any further memory
reservations done using gd->relocaddr (for e.g. in reserve_trace/uboot/malloc)
don't overlap with frame-buffer reserved area passed from blob, so I think
removing this line may cause further memory reservations to overlap with
reserved framebuffer.

Could you please confirm?


SPL and U-Boot have different memory layouts. The current code is
interrupting U-Boot's careful building up of chunks of memory used for
different purposes.



But it is possible they could be using similar memory layout for some
components like framebuffer.
For e.g. in our case we are using same video_reserve func in A53 SPL too
and which allocates framebuffer from gd->relocaddr as seen here:

https://source.denx.de/u-boot/u-boot/-/blob/v2023.10-rc1/common/board_f.c?ref_type=tags#L427


Even if it is similar, the point is that U-Boot proper needs to do its
own allocation stuff.

Of course, if SPL sets up the video, it will provide the framebuffer
address, but only that. The other addresses need to be done using the
normal mechanism.




The video memory has already been allocated by SPL, so we don't need
to insert a new one here, as your code demonstrates.



Agreed.


But also we have no way of knowing if it is legal to relocate U-Boot
(and various other things) just below the frame buffer chosen by SPL.



Yes, so i suppose your case is that framebuffer address which is being passed
by SPL is totally disjoint and too far away from gd->relocaddr, for e.g. it is
at the start (or bottom of DDR) and doesn't interfere with gd->relocaddr in
any manner since relocaddr points to ramtop (i.e. near to end address of DDR).

In that case I agree it doesn't make sense to move relocaddr to ho->fb.

But for the scenario where gd->relocaddr and ho->fb are nearby there is every
possibility that gd->relocaddr may overlap with framebuffer, also the code in
reserve_trace, reserve_uboot doesn't have any intelligence or check that it is
overlapping with framebuffer area or not.

I think one thing that can probably be done here is to have a check that if
passed framebuffer area falls within current relocaddr region, then update the
relocaddr else don't touch relocaddr :

if (ho->fb <= gd->relocaddr - ho->size)
//It means framebuffer are is overlapping with current relocaddr so update
relocaddr
  gd->relocaddr = ho->fb


We should go ahead with this check because it won't disrupt u-boot's
allocation of memory and will allow both the cases if a platform is
using same memory layout or different memory layout across SPL and
u-boot proper. Below are the logs for both scenarios.

https://gist.github.com/NikMJain/aca198ae77b6f1855459bc8fbdd683df


else
//don't update gd->relocaddr since ho->fb is disjoint to gd->relocaddr

Could you please share your opinion on this and if above logic suffice your
case too ?


I don't think this line is needed at all, which is why this patch
removes it. What problem are you seeing?


Across SPL stage and U-boot we are keeping same memory layout and
ensuring that same memory regions are used, this way it doesn't
interfere in the way of u-boot while allocating memory regions for
various purposes. This allowed us to display splash screen without any
flicker across the stages.

Now if you remove the line  gd->relocaddr = ho->fb, the frame buffer
region will be used for reserving memory for other purposes which
corrupts the frame buffer.

One solution which we are planning to implement is move the ram_top to a
lower address leaving out a region for video buffer and u-boot can do
the allocation from the new ram_top address without spl video handoff
interfering in the u-boot'

[PATCH 1/2] drivers: video: tidss: tidss_drv: Change remove method

2023-07-27 Thread Nikhil M Jain
Change remove method of DSS video driver to disable video port instead
of performing a soft reset, as soft reset takes longer duration. Video
port is disabled by setting enable bit of video port to 0.

Signed-off-by: Nikhil M Jain 
---
 drivers/video/tidss/tidss_drv.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/video/tidss/tidss_drv.c b/drivers/video/tidss/tidss_drv.c
index 078e3e82e3..623bf4cf31 100644
--- a/drivers/video/tidss/tidss_drv.c
+++ b/drivers/video/tidss/tidss_drv.c
@@ -901,19 +901,9 @@ static int tidss_drv_probe(struct udevice *dev)
 
 static int tidss_drv_remove(struct udevice *dev)
 {
-   u32 val;
-   int ret;
struct tidss_drv_priv *priv = dev_get_priv(dev);
 
-   priv->base_common = dev_remap_addr_index(dev, 0);
-   REG_FLD_MOD(priv, DSS_SYSCONFIG, 1, 1, 1);
-   /* Wait for reset to complete */
-   ret = readl_poll_timeout(priv->base_common + DSS_SYSSTATUS,
-val, val & 1, 5000);
-   if (ret) {
-   dev_warn(priv->dev, "failed to reset priv\n");
-   return ret;
-   }
+   VP_REG_FLD_MOD(priv, 0, DSS_VP_CONTROL, 0, 0, 0);
return 0;
 }
 
-- 
2.34.1



[PATCH 2/2] drivers: video: tidss: tidss_drv: Use kconfig VIDEO_REMOVE to remove video

2023-07-27 Thread Nikhil M Jain
Perform removal of DSS if kconfigs VIDEO_REMOVE or SPL_VIDEO_REMOVE is
set by user. Otherwise if above Kconfigs are not selected, it is assumed
that user wants splash screen to be displayed until linux kernel boots
up. In such scenario, leave the power domain of DSS as "on" so that
splash screen stays intact until kernel boots up.

Signed-off-by: Nikhil M Jain 
---
 drivers/video/tidss/tidss_drv.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/video/tidss/tidss_drv.c b/drivers/video/tidss/tidss_drv.c
index 623bf4cf31..e285f255d7 100644
--- a/drivers/video/tidss/tidss_drv.c
+++ b/drivers/video/tidss/tidss_drv.c
@@ -901,9 +901,11 @@ static int tidss_drv_probe(struct udevice *dev)
 
 static int tidss_drv_remove(struct udevice *dev)
 {
-   struct tidss_drv_priv *priv = dev_get_priv(dev);
+   if (CONFIG_IS_ENABLED(VIDEO_REMOVE)) {
+   struct tidss_drv_priv *priv = dev_get_priv(dev);
 
-   VP_REG_FLD_MOD(priv, 0, DSS_VP_CONTROL, 0, 0, 0);
+   VP_REG_FLD_MOD(priv, 0, DSS_VP_CONTROL, 0, 0, 0);
+   }
return 0;
 }
 
@@ -929,5 +931,9 @@ U_BOOT_DRIVER(tidss_drv) = {
.probe = tidss_drv_probe,
.remove = tidss_drv_remove,
.priv_auto = sizeof(struct tidss_drv_priv),
+#if CONFIG_IS_ENABLED(VIDEO_REMOVE)
.flags = DM_FLAG_OS_PREPARE,
+#else
+   .flags = DM_FLAG_OS_PREPARE | DM_FLAG_LEAVE_PD_ON,
+#endif
 };
-- 
2.34.1



[PATCH 0/2] Update remove method for DSS driver

2023-07-27 Thread Nikhil M Jain
This patch series aims at updating the remove method for DSS video
driver.

Nikhil M Jain (2):
  drivers: video: tidss: tidss_drv: Change remove method
  drivers: video: tidss: tidss_drv: Use kconfig VIDEO_REMOVE to remove
video

 drivers/video/tidss/tidss_drv.c | 18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

-- 
2.34.1



Re: [PATCH 5/9] board_f: Fix corruption of relocaddr

2023-07-26 Thread Nikhil M Jain

Hi Simon,

On 27/07/23 06:23, Simon Glass wrote:

Hi Devarsh,

On Wed, 26 Jul 2023 at 05:09, Devarsh Thakkar  wrote:


Hi Simon,

On 26/07/23 02:58, Simon Glass wrote:

Hi Devarsh,

On Tue, 25 Jul 2023 at 03:21, Devarsh Thakkar  wrote:


Hi Simon,

On 24/07/23 20:22, Simon Glass wrote:

When the video framebuffer comes from the bloblist, we should not change
relocaddr to this address, since it interfers with the normal memory
allocation.

This fixes a boot loop in qemu-x86_64

Signed-off-by: Simon Glass 
Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info from SPL to 
u-boot")
---

  common/board_f.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 7d2c380e91e2..5c8646b22283 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -419,7 +419,6 @@ static int reserve_video(void)
   if (!ho)
   return log_msg_ret("blf", -ENOENT);
   video_reserve_from_bloblist(ho);
- gd->relocaddr = ho->fb;


I think this change was done as relocaddr pointer was required to be updated
to move after frame-buffer reserved area to ensure that any further memory
reservations done using gd->relocaddr (for e.g. in reserve_trace/uboot/malloc)
don't overlap with frame-buffer reserved area passed from blob, so I think
removing this line may cause further memory reservations to overlap with
reserved framebuffer.

Could you please confirm?


SPL and U-Boot have different memory layouts. The current code is
interrupting U-Boot's careful building up of chunks of memory used for
different purposes.



But it is possible they could be using similar memory layout for some
components like framebuffer.
For e.g. in our case we are using same video_reserve func in A53 SPL too
and which allocates framebuffer from gd->relocaddr as seen here:

https://source.denx.de/u-boot/u-boot/-/blob/v2023.10-rc1/common/board_f.c?ref_type=tags#L427


Even if it is similar, the point is that U-Boot proper needs to do its
own allocation stuff.

Of course, if SPL sets up the video, it will provide the framebuffer
address, but only that. The other addresses need to be done using the
normal mechanism.




The video memory has already been allocated by SPL, so we don't need
to insert a new one here, as your code demonstrates.



Agreed.


But also we have no way of knowing if it is legal to relocate U-Boot
(and various other things) just below the frame buffer chosen by SPL.



Yes, so i suppose your case is that framebuffer address which is being passed
by SPL is totally disjoint and too far away from gd->relocaddr, for e.g. it is
at the start (or bottom of DDR) and doesn't interfere with gd->relocaddr in
any manner since relocaddr points to ramtop (i.e. near to end address of DDR).

In that case I agree it doesn't make sense to move relocaddr to ho->fb.

But for the scenario where gd->relocaddr and ho->fb are nearby there is every
possibility that gd->relocaddr may overlap with framebuffer, also the code in
reserve_trace, reserve_uboot doesn't have any intelligence or check that it is
overlapping with framebuffer area or not.

I think one thing that can probably be done here is to have a check that if
passed framebuffer area falls within current relocaddr region, then update the
relocaddr else don't touch relocaddr :

if (ho->fb <= gd->relocaddr - ho->size)
   //It means framebuffer are is overlapping with current relocaddr so update
relocaddr
 gd->relocaddr = ho->fb
else
   //don't update gd->relocaddr since ho->fb is disjoint to gd->relocaddr

Could you please share your opinion on this and if above logic suffice your
case too ?


I don't think this line is needed at all, which is why this patch
removes it. What problem are you seeing?


Across SPL stage and U-boot we are keeping same memory layout and
ensuring that same memory regions are used, this way it doesn't
interfere in the way of u-boot while allocating memory regions for
various purposes. This allowed us to display splash screen without any
flicker across the stages.

Now if you remove the line  gd->relocaddr = ho->fb, the frame buffer 
region will be used for reserving memory for other purposes which

corrupts the frame buffer.

One solution which we are planning to implement is move the ram_top to a
lower address leaving out a region for video buffer and u-boot can do
the allocation from the new ram_top address without spl video handoff
interfering in the u-boot's allocation of memory.The region above the 
ram_top can be used for video.


Present Scenario
+-+ram_top
| |
|  page_table |
| |
| |
+-+
| |
| |
| |
| |
| |
|  video frame buffer |
| |
| |
| |
| |
| |
| |

Re: [EXTERNAL] [PATCH 2/9] video: Tidy up Makefile rule for video

2023-07-25 Thread Nikhil M Jain




On 24/07/23 20:21, Simon Glass wrote:

Drop the duplication and add a single rule which can handle SPL as well.

Signed-off-by: Simon Glass
---

  drivers/Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions


Reviewed-by: Nikhil M Jain 


Re: [PATCH 4/5] env: ti: mmc.env: Fix overlays directory path

2023-07-25 Thread Nikhil M Jain




On 25/07/23 13:09, Manorit Chawdhry wrote:

From: Vignesh Raghavendra

Similar to get_fdt_mmc make get_overlays_mmc look at/boot/dtb/* path
for overlay files.

Signed-off-by: Vignesh Raghavendra
Signed-off-by: Manorit Chawdhry
---
  include/environment/ti/mmc.env | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


Reviewed-by: Nikhil M Jain 


Re: [PATCH 3/5] env: ti: mmc.env: Move mmc related args to common place

2023-07-25 Thread Nikhil M Jain




On 25/07/23 13:09, Manorit Chawdhry wrote:

From: Vignesh Raghavendra

All K3 SoCs use same set of args to load kernel for MMC. So move this to
common place to avoid duplication.

Signed-off-by: Vignesh Raghavendra
Signed-off-by: Manorit Chawdhry
---
  board/ti/am62x/am62x.env   | 14 --
  board/ti/am64x/am64x.env   | 14 --
  board/ti/am65x/am65x.env   | 14 --
  board/ti/j721e/j721e.env   | 15 ---
  board/ti/j721s2/j721s2.env | 17 -
  include/environment/ti/mmc.env | 14 ++
  6 files changed, 14 insertions(+), 74 deletions(-)


Reviewed-by: Nikhil M Jain 


Re: [PATCH 1/5] configs: am62x: add SPL_MAX_SIZE back

2023-07-25 Thread Nikhil M Jain




On 25/07/23 13:09, Manorit Chawdhry wrote:

This was regressed by the following commit and is required to build with
additional configs enabled.

Fixes: 14439cd71c1a ("configs: k3: make consistent bootcmd across all k3 socs")

Signed-off-by: Manorit Chawdhry
---
  configs/am62x_evm_a53_defconfig | 1 +
  1 file changed, 1 insertion(+)


Tested-by: Nikhil M Jain 


Re: [PATCH 01/18] arch: mach-k3: security: fix the check for authentication

2023-07-25 Thread Nikhil M Jain

Hi Manorit,

On 24/07/23 20:27, Tom Rini wrote:

On Fri, Jul 14, 2023 at 11:22:24AM +0530, Manorit Chawdhry wrote:


Fix regression occurred during refactoring for the mentioned commit.

Fixes: bd6a24759374 ("arm: mach-k3: security: separate out validating binary 
logic")

Signed-off-by: Manorit Chawdhry 


For the series, applied to u-boot/master, thanks!



This series got merged but it still has outstanding comments, I hope you
will be sending fixes.

Thanks,
Nikhil


Re: [PATCH V2 0/2] Fix warnings occurred during compilation

2023-07-20 Thread Nikhil M Jain

Hi Tom,

On 19/07/23 18:48, Tom Rini wrote:

On Wed, Jul 19, 2023 at 06:44:18PM +0530, Nikhil M Jain wrote:

Hi Tom,

On 19/07/23 17:28, Tom Rini wrote:

On Wed, Jul 19, 2023 at 04:44:36PM +0530, Nikhil M Jain wrote:

Hi Tom,

Seems like this series fell through the cracks, so a gentle reminder on
this.

On 21/06/23 16:29, Nikhil M Jain wrote:

This patch series aims at fixing warnings which occur during
compilation, by including required header files and using appropriate
types for variables which are typecasted.

Changes in V2:
- Type cast bmp_load_addr to uintptr_t at places necessary rather than
 changing argument type.

Nikhil M Jain (2):
 board: ti: am62x: evm: Include necessary header files
 common: splash_source: Fix type casting errors.

board/ti/am62x/evm.c   | 1 +
common/splash_source.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)


This depends on the other series that you just reposted I believe you
had said before.



This series is independent and doesn't depend on the series I have
reposted yesterday.


What is it against then? It didn't apply before, I could have sworn I
reported.


I have checked, these patches can be applied on tip of next
independently. Below are the logs.

[1] https://gist.github.com/NikMJain/336831817fc79d6bf3d512d6d2663d59

Thanks,
Nikhil


Re: [EXTERNAL] Re: [PATCH V2 0/2] Fix warnings occurred during compilation

2023-07-19 Thread Nikhil M Jain

Hi Tom,

On 19/07/23 17:28, Tom Rini wrote:

On Wed, Jul 19, 2023 at 04:44:36PM +0530, Nikhil M Jain wrote:

Hi Tom,

Seems like this series fell through the cracks, so a gentle reminder on
this.

On 21/06/23 16:29, Nikhil M Jain wrote:

This patch series aims at fixing warnings which occur during
compilation, by including required header files and using appropriate
types for variables which are typecasted.

Changes in V2:
- Type cast bmp_load_addr to uintptr_t at places necessary rather than
changing argument type.

Nikhil M Jain (2):
board: ti: am62x: evm: Include necessary header files
common: splash_source: Fix type casting errors.

   board/ti/am62x/evm.c   | 1 +
   common/splash_source.c | 6 +++---
   2 files changed, 4 insertions(+), 3 deletions(-)


This depends on the other series that you just reposted I believe you
had said before.



This series is independent and doesn't depend on the series I have
reposted yesterday.

Thanks,
Nikhil


Re: [PATCH V2 0/2] Fix warnings occurred during compilation

2023-07-19 Thread Nikhil M Jain

Hi Tom,

Seems like this series fell through the cracks, so a gentle reminder on
this.

On 21/06/23 16:29, Nikhil M Jain wrote:

This patch series aims at fixing warnings which occur during
compilation, by including required header files and using appropriate
types for variables which are typecasted.

Changes in V2:
- Type cast bmp_load_addr to uintptr_t at places necessary rather than
   changing argument type.

Nikhil M Jain (2):
   board: ti: am62x: evm: Include necessary header files
   common: splash_source: Fix type casting errors.

  board/ti/am62x/evm.c   | 1 +
  common/splash_source.c | 6 +++---
  2 files changed, 4 insertions(+), 3 deletions(-)



Thanks,
Nikhil


[PATCH V6 10/10] common: Kconfig: Fix CMD_BMP/BMP dependency

2023-07-18 Thread Nikhil M Jain
From: Samuel Dionne-Riel 

Using `default y` will not select BMP when CMD_BMP has been enabled, if
it was already configured.

By using `select`, if `CMD_BMP` is turned on, it will force the presence
of `BMP`.

Fixes: 072b0e16c4 ("common: Kconfig: Add BMP configs")
Signed-off-by: Samuel Dionne-Riel 
Signed-off-by: Nikhil M Jain 
---
V6 (patch introduced):
- Fix CMD_BMP/BMP dependency.

 cmd/Kconfig| 1 +
 common/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index c1941849f9..de7a27a86a 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1989,6 +1989,7 @@ config CMD_2048
 config CMD_BMP
bool "Enable 'bmp' command"
depends on VIDEO
+   select BMP
help
  This provides a way to obtain information about a BMP-format image
  and to display it. BMP (which presumably stands for BitMaP) is a
diff --git a/common/Kconfig b/common/Kconfig
index 42baca20a6..ba08fbfedf 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1158,7 +1158,6 @@ config IO_TRACE
 
 config BMP
bool "Enable bmp image display"
-   default y if CMD_BMP
help
  Enable bmp functions to display bmp image and get bmp info.
 
-- 
2.34.1



[PATCH V6 04/10] include: video: Reserve video using blob

2023-07-18 Thread Nikhil M Jain
Add method to reserve video framebuffer information using blob,
received from previous stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Simon Glass 
---
V6:
- No change.

V5:
- No change.

V4:
- No change.

V3:
- Add Reviewed-by tag.

V2:
- Remove #if CONFIG_IS_ENABLED(VIDEO) in video_reserve_from_blob.

 drivers/video/video-uclass.c | 11 +++
 include/video.h  |  9 +
 2 files changed, 20 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 1b66a8061a..497ebd9acf 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -142,6 +142,17 @@ int video_reserve(ulong *addrp)
return 0;
 }
 
+int video_reserve_from_bloblist(struct video_handoff *ho)
+{
+   gd->video_bottom = ho->fb;
+   gd->fb_base = ho->fb;
+   gd->video_top = ho->fb + ho->size;
+   debug("Reserving %luk for video using blob at: %08x\n",
+ ((unsigned long)ho->size) >> 10, (u32)ho->fb);
+
+   return 0;
+}
+
 int video_fill(struct udevice *dev, u32 colour)
 {
struct video_priv *priv = dev_get_uclass_priv(dev);
diff --git a/include/video.h b/include/video.h
index fffaae84e5..bdf1cf7855 100644
--- a/include/video.h
+++ b/include/video.h
@@ -390,4 +390,13 @@ int bmp_display(ulong addr, int x, int y);
  */
 int bmp_info(ulong addr);
 
+/*
+ * video_reserve_from_bloblist()- Reserve frame-buffer memory for video devices
+ * using blobs.
+ *
+ * @ho: video information passed from SPL
+ * Returns: 0 (always)
+ */
+int video_reserve_from_bloblist(struct video_handoff *ho);
+
 #endif
-- 
2.34.1



[PATCH V6 09/10] doc: board: ti: am62x_sk: Add A53 SPL DDR layout

2023-07-18 Thread Nikhil M Jain
To understand usage of DDR in A53 SPL stage, add a table showing region
and space used by major components of SPL.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Tom Rini 
---
V6:
- Add Reviewed-by tag.

V5:
- Change the layout of A53 SPL DDR into tabular format.

V4(patch introduced):
- Document A53 SPL DDR memory layout.

 doc/board/ti/am62x_sk.rst | 57 +++
 1 file changed, 57 insertions(+)

diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index 27d7b527c6..8642bdf16d 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -230,6 +230,63 @@ Image formats:
 | +---+ |
 +---+
 
+A53 SPL DDR Memory Layout
+-
+
+This provides an overview memory usage in A53 SPL stage.
+
+.. list-table::
+   :widths: 16 16 16
+   :header-rows: 1
+
+   * - Region
+ - Start Address
+ - End Address
+
+   * - EMPTY
+ - 0x8000
+ - 0x8008
+
+   * - TEXT BASE
+ - 0x8008
+ - 0x800d8000
+
+   * - EMPTY
+ - 0x800d8000
+ - 0x8020
+
+   * - BMP IMAGE
+ - 0x8020
+ - 0x80b77660
+
+   * - STACK
+ - 0x80b77660
+ - 0x80b77e60
+
+   * - GD
+ - 0x80b77e60
+ - 0x80b78000
+
+   * - MALLOC
+ - 0x80b78000
+ - 0x80b8
+
+   * - EMPTY
+ - 0x80b8
+ - 0x80c8
+
+   * - BSS
+ - 0x80c8
+ - 0x80d0
+
+   * - BLOBS
+ - 0x80d0
+ - 0x80d00400
+
+   * - EMPTY
+ - 0x80d00400
+ - 0x8100
+
 Switch Setting for Boot Mode
 
 
-- 
2.34.1



[PATCH V6 08/10] configs: am62x_evm_a53: Add bloblist address

2023-07-18 Thread Nikhil M Jain
Set bloblist address to 0x80D0.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V6:
- No change.

V5:
- No change.

V4:
- Remove the link to SPL DDR memory layout and add a new patch.

V3:
- Add link to updated memory map.

V2:
- Add Reviewed-by tag.

 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf..5c572dfb33 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -102,3 +102,4 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_BLOBLIST_ADDR=0x80D0
-- 
2.34.1



[PATCH V6 07/10] common: spl: spl: Remove video driver

2023-07-18 Thread Nikhil M Jain
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before
jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to
remove video if required.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V6:
- No change.

V5:
- No change.

V4:
- No change.

V3:
- Replace #if defined(CONFIG_SPL_VIDEO_REMOVE) with
  if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE).

V2:
- Add Reviewed-by tag.

 common/spl/spl.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d45dd1c923..f09bb97781 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -891,18 +891,18 @@ 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);
+   if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE)) {
+   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



[PATCH V6 06/10] drivers: video: Kconfig: Add config remove video

2023-07-18 Thread Nikhil M Jain
This is required since user may want to either call the remove method
of video driver and reset the display or not call the remove method
to continue displaying until next stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
Reviewed-by: Tom Rini 
---
V6:
- No change.

V5:
- No change.

V4:
- Add Reviewed-by tag.

V3:
- No change.

V2:
- Add Reviewed-by tag.

 drivers/video/Kconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4976295071..de64e33c2f 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -833,6 +833,12 @@ config IHS_VIDEO_OUT
  out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
  textual overlays of the display outputs.
 
+config VIDEO_REMOVE
+   bool "Remove video driver"
+   help
+ Use this option to specify if user wants to call remove method of
+ video driver in u-boot proper stage.
+
 config SPLASH_SCREEN
bool "Show a splash-screen image"
help
@@ -1056,6 +1062,12 @@ config SPL_SYS_WHITE_ON_BLACK
 This can be better in low-light situations or to reduce eye strain in
 some cases.
 
+config SPL_VIDEO_REMOVE
+   bool "Remove video driver after SPL stage"
+   help
+ if this  option is enabled video driver will be removed at the end of
+ SPL stage, beforeloading the next stage.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
-- 
2.34.1



[PATCH V6 03/10] board: ti: am62x: evm: Update function calls for splash screen

2023-07-18 Thread Nikhil M Jain
Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
up pagetable, initialise DRAM and enable Dcache to avoid multiple
function calls.

Check for CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to prevent
any build failure in case video config is not defined and video related
functions are called.

Check for CONFIG_SPL_SPLASH_SCREEN and CONFIG_SPL_BMP before calling
splash_display to avoid compilation failure.

Signed-off-by: Nikhil M Jain 
---
V6:
- No change.

V5:
- No change.

V4:
- Update commit message as per comments.

V3:
- No change.

V2:
- Use CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to reserve
  video and  call splash at SPL.
- Check SPL_SPLASH_SCREEN and SPL_BMP before calling splash display.

 arch/arm/mach-k3/am625_init.c |  1 +
 board/ti/am62x/evm.c  | 41 +--
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 787fe92295..0e5d44269e 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -214,6 +214,7 @@ void board_init_f(ulong dummy)
if (ret)
panic("DRAM init failed: %d\n", ret);
 #endif
+   spl_enable_dcache();
 }
 
 u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 34830f445f..d3c1786cd9 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -59,42 +59,31 @@ int dram_init_banksize(void)
 }
 
 #if defined(CONFIG_SPL_BUILD)
-#ifdef CONFIG_SPL_VIDEO_TIDSS
-static int setup_dram(void)
-{
-   dram_init();
-   dram_init_banksize();
-   gd->ram_base = CFG_SYS_SDRAM_BASE;
-   gd->ram_top = gd->ram_base + gd->ram_size;
-   gd->relocaddr = gd->ram_top;
-   return 0;
-}
-
 static int video_setup(void)
 {
-   ulong addr;
-   int ret;
-   addr = gd->relocaddr;
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   ulong addr;
+   int ret;
+
+   addr = gd->relocaddr;
+   ret = video_reserve();
+   if (ret)
+   return ret;
+   debug("Reserving %luk for video at: %08lx\n",
+ ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+   gd->relocaddr = addr;
+   }
 
-   ret = video_reserve();
-   if (ret)
-   return ret;
-   debug("Reserving %luk for video at: %08lx\n",
- ((unsigned long)gd->relocaddr - addr) >> 10, addr);
-   gd->relocaddr = addr;
return 0;
 }
 
-#endif
 void spl_board_init(void)
 {
-#if defined(CONFIG_SPL_VIDEO_TIDSS)
-   setup_dram();
-   arch_reserve_mmu();
video_setup();
enable_caches();
-   splash_display();
-#endif
+   if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP))
+   splash_display();
+
 }
 
 #if defined(CONFIG_K3_AM64_DDRSS)
-- 
2.34.1



[PATCH V6 05/10] common: board_f: Pass frame buffer info from SPL to u-boot

2023-07-18 Thread Nikhil M Jain
U-boot proper can use frame buffer address passed from SPL to reserve
the memory area used by framebuffer set in SPL so that splash image
set in SPL continues to get displayed while u-boot proper is running.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
Reviewed-by: Simon Glass 
---
V6:
- No change.

V5:
- No change.

V4:
- Add Reviewed-by tag.

V3:
- Clean up errors appeared in checkpatch.

V2:
- Fix commit message.
- Revert use of #if.

 common/board_f.c | 11 ++-
 drivers/video/video-uclass.c | 12 
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 1688e27071..8e5dbaf06c 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -411,7 +411,16 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-   if (IS_ENABLED(CONFIG_VIDEO)) {
+   if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
+   CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   video_reserve_from_bloblist(ho);
+   gd->relocaddr = ho->fb;
+   } else if (CONFIG_IS_ENABLED(VIDEO)) {
ulong addr;
int ret;
 
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 497ebd9acf..1a318e2310 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,12 +6,14 @@
 #define LOG_CATEGORY UCLASS_VIDEO
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -139,6 +141,16 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
  gd->video_top);
 
+   if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   ho->fb = *addrp;
+   ho->size = size;
+   }
+
return 0;
 }
 
-- 
2.34.1



[PATCH V6 02/10] arch: arm: mach-k3: common: Return a pointer after setting page table

2023-07-18 Thread Nikhil M Jain
In spl_dcache_enable after setting up page table, set gd->relocaddr
pointer to tlb_addr, to get next location to reserve memory. Align
tlb_addr with 64KB address.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V6:
- No change.

V5:
- No change.

V4:
- Add Reviewed-by tag.

V3:
- No change.

V2:
- Perform 64KB alignment on tlb_addr.

 arch/arm/mach-k3/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index bda01527d3..f9cfa66059 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -629,8 +629,10 @@ void spl_enable_dcache(void)
ram_top = (phys_addr_t) 0x1;
 
gd->arch.tlb_addr = ram_top - gd->arch.tlb_size;
+   gd->arch.tlb_addr &= ~(0x1 - 1);
debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
  gd->arch.tlb_addr + gd->arch.tlb_size);
+   gd->relocaddr = gd->arch.tlb_addr;
 
dcache_enable();
 #endif
-- 
2.34.1



[PATCH V6 01/10] common: spl: spl: Update stack pointer address

2023-07-18 Thread Nikhil M Jain
At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Tom Rini 
---
V6:
- No change.

V5:
- No change.

V4:
- No change.

V3:
- Add Reviewed-by tag.

V2:
- No change.

 common/spl/spl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d74acec10b..d45dd1c923 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,7 @@ ulong spl_relocate_stack_gd(void)
 #endif
/* Get stack position: use 8-byte alignment for ABI compliance */
ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+   gd->start_addr_sp = ptr;
new_gd = (gd_t *)ptr;
memcpy(new_gd, (void *)gd, sizeof(gd_t));
 #if CONFIG_IS_ENABLED(DM)
-- 
2.34.1



[PATCH V6 00/10] Update SPL splashscreen framework for AM62x

2023-07-18 Thread Nikhil M Jain
This patch series aims at updating SPL splashscreen framework for AM62x.

This patch series depends on
https://lore.kernel.org/u-boot/20230504225829.2537050-1-...@chromium.org/

This series:
- Fixes compilation issues in case splash related configs are not
  defined in SPL.
- Does page table setup, dram initialisation and dcache enabling in
  one function call spl_enable_dcache.
- Allows passing of framebuffer from spl to u-boot, eliminating flicker.

V6:
- Add patch [1] from Samuel Dionne-Riel fixing CMD_BMP/BMP dependecy.

V5:
- Change A53 SPL DDR layout from ASCII table to tabular format.

V4:
- Fix commit message.
- Introduce patch defining DDR layout in A53 SPL.
- Add Reviewed-by tags.

V3:
- Fix spacing issues.
- Add Reviewed-by tag.
- Replace #if with if in patch
  common: spl: spl: Remove video driver
- Add link to updated memory map.

V2:
- Update cover letter.
- Fix commit message.

[1]: 
https://patchwork.ozlabs.org/project/uboot/patch/20230709231810.633044-1-sam...@dionne-riel.com/

Nikhil M Jain (9):
  common: spl: spl: Update stack pointer address
  arch: arm: mach-k3: common: Return a pointer after setting page table
  board: ti: am62x: evm: Update function calls for splash screen
  include: video: Reserve video using blob
  common: board_f: Pass frame buffer info from SPL to u-boot
  drivers: video: Kconfig: Add config remove video
  common: spl: spl: Remove video driver
  configs: am62x_evm_a53: Add bloblist address
  doc: board: ti: am62x_sk: Add A53 SPL DDR layout

Samuel Dionne-Riel (1):
  common: Kconfig: Fix CMD_BMP/BMP dependency

 arch/arm/mach-k3/am625_init.c   |  1 +
 arch/arm/mach-k3/common.c   |  2 ++
 board/ti/am62x/evm.c| 41 +---
 cmd/Kconfig |  1 +
 common/Kconfig  |  1 -
 common/board_f.c| 11 ++-
 common/spl/spl.c| 23 ++---
 configs/am62x_evm_a53_defconfig |  1 +
 doc/board/ti/am62x_sk.rst   | 57 +
 drivers/video/Kconfig   | 12 +++
 drivers/video/video-uclass.c| 23 +
 include/video.h |  9 ++
 12 files changed, 143 insertions(+), 39 deletions(-)

-- 
2.34.1



Re: [PATCH 08/18] environment: ti: Make get_fdt_mmc common

2023-07-17 Thread Nikhil M Jain

Hi Manorit,

On 14/07/23 11:22, Manorit Chawdhry wrote:

From: Andrew Davis 

Since get_fdt_mmc is common, factor it out into mmc.env and remove
it from each platform env file along with changing the directory path to
reflect the standards. Use it in mmcloados but keep loadfdt
defined in case it is still used by some external uEnv.txt script.

Signed-off-by: Andrew Davis 
Signed-off-by: Manorit Chawdhry 
---
  board/ti/am62ax/am62ax.env | 1 -
  board/ti/am62x/am62x.env   | 1 -
  board/ti/am64x/am64x.env   | 1 -
  board/ti/am65x/am65x.env   | 1 -
  board/ti/j721e/j721e.env   | 1 -
  board/ti/j721s2/j721s2.env | 1 -
  include/environment/ti/mmc.env | 5 +++--
  7 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/board/ti/am62ax/am62ax.env b/board/ti/am62ax/am62ax.env
index 95401756e20a..491ec973bbc6 100644
--- a/board/ti/am62ax/am62ax.env
+++ b/board/ti/am62ax/am62ax.env
@@ -17,7 +17,6 @@ bootpart=1:2
  bootdir=/boot
  rd_spec=-
  init_mmc=run args_all args_mmc
-get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
  get_overlay_mmc=
fdt address ${fdtaddr};
fdt resize 0x10;


get_overlay_mmc and init_mmc are also common, these can also be moved to 
mmc.env file.



diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env
index 37af69199167..0901a8536da5 100644
--- a/board/ti/am62x/am62x.env
+++ b/board/ti/am62x/am62x.env
@@ -17,7 +17,6 @@ bootpart=1:2
  bootdir=/boot
  rd_spec=-
  init_mmc=run args_all args_mmc
-get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
  get_overlay_mmc=
fdt address ${fdtaddr};
fdt resize 0x10;
diff --git a/board/ti/am64x/am64x.env b/board/ti/am64x/am64x.env
index 4d27f16e8ca9..015f63a66c71 100644
--- a/board/ti/am64x/am64x.env
+++ b/board/ti/am64x/am64x.env
@@ -21,7 +21,6 @@ bootpart=1:2
  bootdir=/boot
  rd_spec=-
  init_mmc=run args_all args_mmc
-get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
  get_overlay_mmc=
fdt address ${fdtaddr};
fdt resize 0x10;
diff --git a/board/ti/am65x/am65x.env b/board/ti/am65x/am65x.env
index 3c583b77fd1e..d7130cc3f7df 100644
--- a/board/ti/am65x/am65x.env
+++ b/board/ti/am65x/am65x.env
@@ -20,7 +20,6 @@ bootpart=1:2
  bootdir=/boot
  rd_spec=-
  init_mmc=run args_all args_mmc
-get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
  get_overlay_mmc=
fdt address ${fdtaddr};
fdt resize 0x10;
diff --git a/board/ti/j721e/j721e.env b/board/ti/j721e/j721e.env
index 12b5610b3e47..23ce7e1af746 100644
--- a/board/ti/j721e/j721e.env
+++ b/board/ti/j721e/j721e.env
@@ -37,7 +37,6 @@ bootpart=1:2
  bootdir=/boot
  rd_spec=-
  init_mmc=run args_all args_mmc
-get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
  get_overlay_mmc=
fdt address ${fdtaddr};
fdt resize 0x10;
diff --git a/board/ti/j721s2/j721s2.env b/board/ti/j721s2/j721s2.env
index 67953d3f5984..9464fe499037 100644
--- a/board/ti/j721s2/j721s2.env
+++ b/board/ti/j721s2/j721s2.env
@@ -31,7 +31,6 @@ name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw
  #endif
  rd_spec=-
  init_mmc=run args_all args_mmc
-get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
  get_overlay_mmc=
fdt address ${fdtaddr};
fdt resize 0x10;
diff --git a/include/environment/ti/mmc.env b/include/environment/ti/mmc.env
index 5677d057d864..a052d288535e 100644
--- a/include/environment/ti/mmc.env
+++ b/include/environment/ti/mmc.env
@@ -13,7 +13,8 @@ importbootenv=echo Importing environment from mmc${mmcdev} 
...;
env import -t ${loadaddr} ${filesize}
  loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
  loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
-loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
+loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
+get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
  envboot=mmc dev ${mmcdev};
if mmc rescan; then
echo SD/MMC found on device ${mmcdev};
@@ -32,7 +33,7 @@ envboot=mmc dev ${mmcdev};
fi;
  mmcloados=
if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
-   if run loadfdt; then
+   if run get_fdt_mmc; then
bootz ${loadaddr} - ${fdtaddr};
else
if test ${boot_fdt} = try; then



Thanks,
Nikhil


Re: [PATCH 07/18] environment: ti: Prefix ARM64 DTB names with directory

2023-07-17 Thread Nikhil M Jain




On 14/07/23 11:22, Manorit Chawdhry wrote:

From: Andrew Davis

In Linux the ARM64 DTSs are stored in vendor directories to help organize
the files and prevent naming collisions. The deployed DTBs will mirror
this and so the vendor prefix should be added to the variable used to
locate these files.

Suggested-by: Ryan Eatmon
Signed-off-by: Andrew Davis
Signed-off-by: Manorit Chawdhry
---
  board/ti/am62ax/am62ax.env   | 2 +-
  board/ti/am62x/am62x.env | 2 +-
  board/ti/am64x/am64x.env | 4 ++--
  board/ti/am65x/am65x.env | 2 +-
  board/ti/j721e/j721e.env | 8 
  board/ti/j721s2/j721s2.env   | 6 +++---
  include/configs/am62ax_evm.h | 2 +-
  7 files changed, 13 insertions(+), 13 deletions(-)


Reviewed-by: Nikhil M Jain 


Re: [PATCH 13/18] configs: k3: make consistent bootcmd across all k3 socs

2023-07-17 Thread Nikhil M Jain

Hi Manorit,

On 14/07/23 11:22, Manorit Chawdhry wrote:

From: Kamlesh Gurudasani 

Default to common bootcmd that is set across all k3 devices.

Signed-off-by: Manorit Chawdhry 
Signed-off-by: Kamlesh Gurudasani 
---
  configs/am62ax_evm_a53_defconfig | 1 +
  configs/am62x_evm_a53_defconfig  | 3 +--
  configs/am64x_evm_a53_defconfig  | 2 +-
  configs/j7200_evm_a72_defconfig  | 2 +-
  configs/j721e_evm_a72_defconfig  | 2 +-
  configs/j721s2_evm_a72_defconfig | 2 +-
  6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configs/am62ax_evm_a53_defconfig b/configs/am62ax_evm_a53_defconfig
index 76ec5ed40463..773cf3a591c6 100644
--- a/configs/am62ax_evm_a53_defconfig
+++ b/configs/am62ax_evm_a53_defconfig
@@ -23,6 +23,7 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_SPL_MAX_SIZE=0x58000
  CONFIG_SPL_PAD_TO=0x0
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf73..de90663383ec 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -29,8 +29,7 @@ CONFIG_SPL_SPI=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; setenv 
fdtfile ti/${name_fdt}; run distro_bootcmd"
-CONFIG_SPL_MAX_SIZE=0x58000


Please add this config back.


+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x80c8
  CONFIG_SPL_BSS_MAX_SIZE=0x8
diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 123a70049aeb..f792b5859e94 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -33,7 +33,7 @@ CONFIG_SPL_SPI=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
get_kern_${boot}; run get_fdt_${boot}; run run_kern"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_BOARD_LATE_INIT=y
  CONFIG_SPL_MAX_SIZE=0x18
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig
index 0abc865cb5d5..c68d52537e54 100644
--- a/configs/j7200_evm_a72_defconfig
+++ b/configs/j7200_evm_a72_defconfig
@@ -33,7 +33,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_OF_SYSTEM_SETUP=y
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
main_cpsw0_qsgmii_phyinit; run boot_rprocs; if test ${boot_fit} -eq 1; then run 
get_fit_${boot}; run get_overlaystring; run run_fit; else; run get_kern_${boot}; run 
get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_LOGLEVEL=7
  CONFIG_SPL_MAX_SIZE=0xc
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 825dbd865cd9..525f150e91d9 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -33,7 +33,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_OF_SYSTEM_SETUP=y
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run 
main_cpsw0_qsgmii_phyinit; run boot_rprocs; if test ${boot_fit} -eq 1; then run 
get_fit_${boot}; run get_overlaystring; run run_fit; else; run get_kern_${boot}; run 
get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_LOGLEVEL=7
  CONFIG_SPL_MAX_SIZE=0xc
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig
index 13c1a0cdbe9b..d59f3156d105 100644
--- a/configs/j721s2_evm_a72_defconfig
+++ b/configs/j721s2_evm_a72_defconfig
@@ -32,7 +32,7 @@ CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_OF_SYSTEM_SETUP=y
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; if 
test ${boot_fit} -eq 1; then run get_fit_${boot}; run get_overlaystring; run run_fit; 
else; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; 
fi;"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_LOGLEVEL=7
  CONFIG_SPL_MAX_SIZE=0xc
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y



Thanks,
Nikhil


Re: [PATCH 13/18] configs: k3: make consistent bootcmd across all k3 socs

2023-07-17 Thread Nikhil M Jain

Hi Manorit,

On 14/07/23 11:22, Manorit Chawdhry wrote:

From: Kamlesh Gurudasani 

Default to common bootcmd that is set across all k3 devices.

Signed-off-by: Manorit Chawdhry 
Signed-off-by: Kamlesh Gurudasani 
---
  configs/am62ax_evm_a53_defconfig | 1 +
  configs/am62x_evm_a53_defconfig  | 3 +--
  configs/am64x_evm_a53_defconfig  | 2 +-
  configs/j7200_evm_a72_defconfig  | 2 +-
  configs/j721e_evm_a72_defconfig  | 2 +-
  configs/j721s2_evm_a72_defconfig | 2 +-
  6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configs/am62ax_evm_a53_defconfig b/configs/am62ax_evm_a53_defconfig
index 76ec5ed40463..773cf3a591c6 100644
--- a/configs/am62ax_evm_a53_defconfig
+++ b/configs/am62ax_evm_a53_defconfig
@@ -23,6 +23,7 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_SPL_MAX_SIZE=0x58000
  CONFIG_SPL_PAD_TO=0x0
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf73..de90663383ec 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -29,8 +29,7 @@ CONFIG_SPL_SPI=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; setenv 
fdtfile ti/${name_fdt}; run distro_bootcmd"
-CONFIG_SPL_MAX_SIZE=0x58000


Please add this config back.


+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x80c8
  CONFIG_SPL_BSS_MAX_SIZE=0x8
diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 123a70049aeb..f792b5859e94 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -33,7 +33,7 @@ CONFIG_SPL_SPI=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
get_kern_${boot}; run get_fdt_${boot}; run run_kern"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_BOARD_LATE_INIT=y
  CONFIG_SPL_MAX_SIZE=0x18
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig
index 0abc865cb5d5..c68d52537e54 100644
--- a/configs/j7200_evm_a72_defconfig
+++ b/configs/j7200_evm_a72_defconfig
@@ -33,7 +33,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_OF_SYSTEM_SETUP=y
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
main_cpsw0_qsgmii_phyinit; run boot_rprocs; if test ${boot_fit} -eq 1; then run 
get_fit_${boot}; run get_overlaystring; run run_fit; else; run get_kern_${boot}; run 
get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_LOGLEVEL=7
  CONFIG_SPL_MAX_SIZE=0xc
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 825dbd865cd9..525f150e91d9 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -33,7 +33,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_OF_SYSTEM_SETUP=y
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run 
main_cpsw0_qsgmii_phyinit; run boot_rprocs; if test ${boot_fit} -eq 1; then run 
get_fit_${boot}; run get_overlaystring; run run_fit; else; run get_kern_${boot}; run 
get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_LOGLEVEL=7
  CONFIG_SPL_MAX_SIZE=0xc
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig
index 13c1a0cdbe9b..d59f3156d105 100644
--- a/configs/j721s2_evm_a72_defconfig
+++ b/configs/j721s2_evm_a72_defconfig
@@ -32,7 +32,7 @@ CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
  CONFIG_OF_SYSTEM_SETUP=y
  CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; if 
test ${boot_fit} -eq 1; then run get_fit_${boot}; run get_overlaystring; run run_fit; 
else; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; 
fi;"
+CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
  CONFIG_LOGLEVEL=7
  CONFIG_SPL_MAX_SIZE=0xc
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y



Thanks,
Nikhil


Re: [PATCH 03/18] board: ti: am64x: am64x.env: set fdtfile env variable

2023-07-17 Thread Nikhil M Jain




On 14/07/23 11:22, Manorit Chawdhry wrote:

From: Kamlesh Gurudasani

Set fdtfile env variable similar to other k3 socs.

Signed-off-by: Kamlesh Gurudasani
Signed-off-by: Manorit Chawdhry
---
  board/ti/am64x/am64x.env | 1 +
  1 file changed, 1 insertion(+)


Reviewed-by: Nikhil M Jain 


Re: [EXTERNAL] Re: [PATCH] common: Kconfig: Fix CMD_BMP/BMP dependency

2023-07-14 Thread Nikhil M Jain




On 10/07/23 20:36, Tom Rini wrote:

On Sun, Jul 09, 2023 at 07:18:10PM -0400, Samuel Dionne-Riel wrote:


Using `default y` will not select BMP when CMD_BMP has been enabled, if
it was already configured.

By using `select`, if `CMD_BMP` is turned on, it will force the presence
of `BMP`.

Fixes: 072b0e16c482114d242580dd7a3197db5966705f


The fixes tag should be the "git log -n1 --oneline" version of the
commit, btw.


Signed-off-by: Samuel Dionne-Riel 
---
  cmd/Kconfig| 1 +
  common/Kconfig | 2 +-
  2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 02e54f1e50..94c54b2359 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1988,6 +1988,7 @@ config CMD_2048
  config CMD_BMP
bool "Enable 'bmp' command"
depends on VIDEO
+   select BMP
help
  This provides a way to obtain information about a BMP-format image
  and to display it. BMP (which presumably stands for BitMaP) is a
diff --git a/common/Kconfig b/common/Kconfig
index bbabadb35e..d0117e3dc8 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1157,7 +1157,7 @@ config IO_TRACE
  
  config BMP

bool "Enable bmp image display"
-   default y if CMD_BMP
+   default n
help
  Enable bmp functions to display bmp image and get bmp info.


Since this is something that can be resolved by correcting the resulting
.config file (or storing a new defconfig in your build system, or what
have you) I'm not grabbing this for the release I'll be doing later
today.  Also in a v2, "default n" is the default. And I'm not entirely
sure if BMP (and SPL_BMP) end up being things that should be asked, or
should be select'd because they're library functions. Finally, this
should perhaps be part of
https://patchwork.ozlabs.org/project/uboot/list/?series=360683=*
but I'm not sure and will wait for Nikhil to chime in.

@Samuel, is it okay if I pick this patch and send it as a patch as part 
of my above mentioned series with the changes suggested by Tom?


Re: [PATCH V5 0/9] Update SPL splashscreen framework for AM62x

2023-07-05 Thread Nikhil M Jain

Hi Tom,

Gentle reminder

On 21/06/23 15:51, Nikhil M Jain wrote:

This patch series aims at updating SPL splashscreen framework for AM62x.

This patch series depends on
https://lore.kernel.org/u-boot/20230504225829.2537050-1-...@chromium.org/

This series:
- Fixes compilation issues in case splash related configs are not
   defined in SPL.
- Does page table setup, dram initialisation and dcache enabling in
   one function call spl_enable_dcache.
- Allows passing of framebuffer from spl to u-boot, eliminating flicker.

V5:
- Change A53 SPL DDR layout from ASCII table to tabular format.

V4:
- Fix commit message.
- Introduce patch defining DDR layout in A53 SPL.
- Add Reviewed-by tags.

V3:
- Fix spacing issues.
- Add Reviewed-by tag.
- Replace #if with if in patch
   common: spl: spl: Remove video driver
- Add link to updated memory map.

V2:
- Update cover letter.
- Fix commit message.

Nikhil M Jain (9):
   common: spl: spl: Update stack pointer address
   arch: arm: mach-k3: common: Return a pointer after setting page table
   board: ti: am62x: evm: Update function calls for splash screen
   include: video: Reserve video using blob
   common: board_f: Pass frame buffer info from SPL to u-boot
   drivers: video: Kconfig: Add config remove video
   common: spl: spl: Remove video driver
   configs: am62x_evm_a53: Add bloblist address
   doc: board: ti: am62x_sk: Add A53 SPL DDR layout

  arch/arm/mach-k3/am625_init.c   |  1 +
  arch/arm/mach-k3/common.c   |  2 ++
  board/ti/am62x/evm.c| 41 +---
  common/board_f.c| 11 ++-
  common/spl/spl.c| 23 ++---
  configs/am62x_evm_a53_defconfig |  1 +
  doc/board/ti/am62x_sk.rst   | 57 +
  drivers/video/Kconfig   | 12 +++
  drivers/video/video-uclass.c| 23 +
  include/video.h |  9 ++
  10 files changed, 142 insertions(+), 38 deletions(-)



Thanks
Nikhil


Re: [EXTERNAL] Re: [PATCH] arch: arm: dts: k3-am625-sk: Update timings node name for panel-lvds

2023-06-25 Thread Nikhil M Jain

Hi Tom,

On 23/06/23 22:26, Tom Rini wrote:

On Fri, Jun 23, 2023 at 06:11:52PM +0530, Nikhil M Jain wrote:

Update the name of timing parameter node to panel-timing from
panel-timngs.

Signed-off-by: Nikhil M Jain 
---
  arch/arm/dts/k3-am625-sk.dts | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/k3-am625-sk.dts b/arch/arm/dts/k3-am625-sk.dts
index 73dec8781c..a87b48bfed 100644
--- a/arch/arm/dts/k3-am625-sk.dts
+++ b/arch/arm/dts/k3-am625-sk.dts
@@ -168,7 +168,7 @@
width-mm = <217>;
height-mm = <136>;
data-mapping = "vesa-24";
-   panel-timings {
+   panel-timing {
bootph-pre-ram;
clock-frequency = <150274>;
hactive = <1920>;


First, what tree is this against? Second, you know this needs to go to
the linux dts file, first. Thanks.

Yes I understand this should first go to linux dts. Please ignore this 
patch, once we have dss node in linux dts, I will send the pathces.


Thanks,
Nikhil


[PATCH] arch: arm: dts: k3-am625-sk: Update timings node name for panel-lvds

2023-06-23 Thread Nikhil M Jain
Update the name of timing parameter node to panel-timing from
panel-timngs.

Signed-off-by: Nikhil M Jain 
---
 arch/arm/dts/k3-am625-sk.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/k3-am625-sk.dts b/arch/arm/dts/k3-am625-sk.dts
index 73dec8781c..a87b48bfed 100644
--- a/arch/arm/dts/k3-am625-sk.dts
+++ b/arch/arm/dts/k3-am625-sk.dts
@@ -168,7 +168,7 @@
width-mm = <217>;
height-mm = <136>;
data-mapping = "vesa-24";
-   panel-timings {
+   panel-timing {
bootph-pre-ram;
clock-frequency = <150274>;
hactive = <1920>;
-- 
2.34.1



[PATCH V2 2/2] common: splash_source: Fix type casting errors

2023-06-21 Thread Nikhil M Jain
During compilation splash_source puts out below warning for type
conversion in splash_load_fit for bmp_load_addr and fit_header.
Change their type to uintptr_t to fix the warnings.

common/splash_source.c: In function ‘splash_load_fit’:
common/splash_source.c:366:22: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]
  366 | img_header = (struct legacy_img_hdr *)bmp_load_addr;
  |  ^
common/splash_source.c:376:49: warning: cast from pointer to integer of 
different size [-Wpointer-to-int-cast]
  376 | res = splash_storage_read_raw(location, (u32)fit_header, 
fit_size);
  | ^
common/splash_source.c:401:25: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]
  401 | memmove((void *)bmp_load_addr, internal_splash_data, 
internal_splash_size);

The above warnings are generated if CONFIG_FIT is enabled.

Signed-off-by: Nikhil M Jain 
---
V2:
- Type cast bmp_load_addr to uintptr_t at places necessary instead of
  changing argument type for splash_load_fit as done in splash_load_raw.

 common/splash_source.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/splash_source.c b/common/splash_source.c
index a260137619..7223a1aae7 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -363,7 +363,7 @@ static int splash_load_fit(struct splash_location 
*location, u32 bmp_load_addr)
if (res < 0)
return res;
 
-   img_header = (struct legacy_img_hdr *)bmp_load_addr;
+   img_header = (struct legacy_img_hdr *)(uintptr_t)bmp_load_addr;
if (image_get_magic(img_header) != FDT_MAGIC) {
printf("Could not find FDT magic\n");
return -EINVAL;
@@ -373,7 +373,7 @@ static int splash_load_fit(struct splash_location 
*location, u32 bmp_load_addr)
 
/* Read in entire FIT */
fit_header = (const u32 *)(bmp_load_addr + header_size);
-   res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
+   res = splash_storage_read_raw(location, (uintptr_t)fit_header, 
fit_size);
if (res < 0)
return res;
 
@@ -398,7 +398,7 @@ static int splash_load_fit(struct splash_location 
*location, u32 bmp_load_addr)
/* Extract the splash data from FIT */
/* 1. Test if splash is in FIT internal data. */
if (!fit_image_get_data(fit_header, node_offset, _splash_data, 
_splash_size))
-   memmove((void *)bmp_load_addr, internal_splash_data, 
internal_splash_size);
+   memmove((void *)(uintptr_t)bmp_load_addr, internal_splash_data, 
internal_splash_size);
/* 2. Test if splash is in FIT external data with fixed position. */
else if (!fit_image_get_data_position(fit_header, node_offset, 
_splash_addr))
is_splash_external = true;
-- 
2.34.1



[PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files

2023-06-21 Thread Nikhil M Jain
At the time of compilation evm.c gives below warning for implicit
declaration of enable_caches, to mitigate this include cpu_func.h.

board/ti/am62x/evm.c: In function ‘spl_board_init’:
board/ti/am62x/evm.c:90:9: warning: implicit declaration of function 
‘enable_caches’ [-Wimplicit-function-declaration]
90 | enable_caches();

Signed-off-by: Nikhil M Jain 
---
V2:
- No change.

 board/ti/am62x/evm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index d3c1786cd9..ad93908840 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.34.1



[PATCH V2 0/2] Fix warnings occurred during compilation

2023-06-21 Thread Nikhil M Jain
This patch series aims at fixing warnings which occur during
compilation, by including required header files and using appropriate
types for variables which are typecasted.

Changes in V2:
- Type cast bmp_load_addr to uintptr_t at places necessary rather than
  changing argument type.

Nikhil M Jain (2):
  board: ti: am62x: evm: Include necessary header files
  common: splash_source: Fix type casting errors.

 board/ti/am62x/evm.c   | 1 +
 common/splash_source.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

-- 
2.34.1



[PATCH V5 8/9] configs: am62x_evm_a53: Add bloblist address

2023-06-21 Thread Nikhil M Jain
Set bloblist address to 0x80D0.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V5:
- No change.

V4:
- Remove the link to SPL DDR memory layout and add a new patch.

V3:
- Add link to updated memory map.

V2:
- Add Reviewed-by tag.

 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf..5c572dfb33 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -102,3 +102,4 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_BLOBLIST_ADDR=0x80D0
-- 
2.34.1



[PATCH V5 9/9] doc: board: ti: am62x_sk: Add A53 SPL DDR layout

2023-06-21 Thread Nikhil M Jain
To understand usage of DDR in A53 SPL stage, add a table showing region
and space used by major components of SPL.

Signed-off-by: Nikhil M Jain 
---
V5:
- Change the layout of A53 SPL DDR into tabular format.

V4(patch introduced):
- Document A53 SPL DDR memory layout.

 doc/board/ti/am62x_sk.rst | 57 +++
 1 file changed, 57 insertions(+)

diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index 27d7b527c6..8642bdf16d 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -230,6 +230,63 @@ Image formats:
 | +---+ |
 +---+
 
+A53 SPL DDR Memory Layout
+-
+
+This provides an overview memory usage in A53 SPL stage.
+
+.. list-table::
+   :widths: 16 16 16
+   :header-rows: 1
+
+   * - Region
+ - Start Address
+ - End Address
+
+   * - EMPTY
+ - 0x8000
+ - 0x8008
+
+   * - TEXT BASE
+ - 0x8008
+ - 0x800d8000
+
+   * - EMPTY
+ - 0x800d8000
+ - 0x8020
+
+   * - BMP IMAGE
+ - 0x8020
+ - 0x80b77660
+
+   * - STACK
+ - 0x80b77660
+ - 0x80b77e60
+
+   * - GD
+ - 0x80b77e60
+ - 0x80b78000
+
+   * - MALLOC
+ - 0x80b78000
+ - 0x80b8
+
+   * - EMPTY
+ - 0x80b8
+ - 0x80c8
+
+   * - BSS
+ - 0x80c8
+ - 0x80d0
+
+   * - BLOBS
+ - 0x80d0
+ - 0x80d00400
+
+   * - EMPTY
+ - 0x80d00400
+ - 0x8100
+
 Switch Setting for Boot Mode
 
 
-- 
2.34.1



[PATCH V5 6/9] drivers: video: Kconfig: Add config remove video

2023-06-21 Thread Nikhil M Jain
This is required since user may want to either call the remove method
of video driver and reset the display or not call the remove method
to continue displaying until next stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
Reviewed-by: Tom Rini 
---
V5:
- No change.

V4:
- Add Reviewed-by tag.

V3:
- No change.

V2:
- Add Reviewed-by tag.

 drivers/video/Kconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4976295071..de64e33c2f 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -833,6 +833,12 @@ config IHS_VIDEO_OUT
  out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
  textual overlays of the display outputs.
 
+config VIDEO_REMOVE
+   bool "Remove video driver"
+   help
+ Use this option to specify if user wants to call remove method of
+ video driver in u-boot proper stage.
+
 config SPLASH_SCREEN
bool "Show a splash-screen image"
help
@@ -1056,6 +1062,12 @@ config SPL_SYS_WHITE_ON_BLACK
 This can be better in low-light situations or to reduce eye strain in
 some cases.
 
+config SPL_VIDEO_REMOVE
+   bool "Remove video driver after SPL stage"
+   help
+ if this  option is enabled video driver will be removed at the end of
+ SPL stage, beforeloading the next stage.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
-- 
2.34.1



[PATCH V5 7/9] common: spl: spl: Remove video driver

2023-06-21 Thread Nikhil M Jain
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before
jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to
remove video if required.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V5:
- No change.

V4:
- No change.

V3:
- Replace #if defined(CONFIG_SPL_VIDEO_REMOVE) with
  if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE).

V2:
- Add Reviewed-by tag.

 common/spl/spl.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d45dd1c923..f09bb97781 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -891,18 +891,18 @@ 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);
+   if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE)) {
+   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



[PATCH V5 5/9] common: board_f: Pass frame buffer info from SPL to u-boot

2023-06-21 Thread Nikhil M Jain
U-boot proper can use frame buffer address passed from SPL to reserve
the memory area used by framebuffer set in SPL so that splash image
set in SPL continues to get displayed while u-boot proper is running.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
Reviewed-by: Simon Glass 
---
V5:
- No change.

V4:
- Add Reviewed-by tag.

V3:
- Clean up errors appeared in checkpatch.

V2:
- Fix commit message.
- Revert use of #if.

 common/board_f.c | 11 ++-
 drivers/video/video-uclass.c | 12 
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 1688e27071..8e5dbaf06c 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -411,7 +411,16 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-   if (IS_ENABLED(CONFIG_VIDEO)) {
+   if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
+   CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   video_reserve_from_bloblist(ho);
+   gd->relocaddr = ho->fb;
+   } else if (CONFIG_IS_ENABLED(VIDEO)) {
ulong addr;
int ret;
 
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 497ebd9acf..1a318e2310 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,12 +6,14 @@
 #define LOG_CATEGORY UCLASS_VIDEO
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -139,6 +141,16 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
  gd->video_top);
 
+   if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   ho->fb = *addrp;
+   ho->size = size;
+   }
+
return 0;
 }
 
-- 
2.34.1



[PATCH V5 4/9] include: video: Reserve video using blob

2023-06-21 Thread Nikhil M Jain
Add method to reserve video framebuffer information using blob,
received from previous stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Simon Glass 
---
V5:
- No change.

V4:
- No change.

V3:
- Add Reviewed-by tag.

V2:
- Remove #if CONFIG_IS_ENABLED(VIDEO) in video_reserve_from_blob.

 drivers/video/video-uclass.c | 11 +++
 include/video.h  |  9 +
 2 files changed, 20 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 1b66a8061a..497ebd9acf 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -142,6 +142,17 @@ int video_reserve(ulong *addrp)
return 0;
 }
 
+int video_reserve_from_bloblist(struct video_handoff *ho)
+{
+   gd->video_bottom = ho->fb;
+   gd->fb_base = ho->fb;
+   gd->video_top = ho->fb + ho->size;
+   debug("Reserving %luk for video using blob at: %08x\n",
+ ((unsigned long)ho->size) >> 10, (u32)ho->fb);
+
+   return 0;
+}
+
 int video_fill(struct udevice *dev, u32 colour)
 {
struct video_priv *priv = dev_get_uclass_priv(dev);
diff --git a/include/video.h b/include/video.h
index fffaae84e5..bdf1cf7855 100644
--- a/include/video.h
+++ b/include/video.h
@@ -390,4 +390,13 @@ int bmp_display(ulong addr, int x, int y);
  */
 int bmp_info(ulong addr);
 
+/*
+ * video_reserve_from_bloblist()- Reserve frame-buffer memory for video devices
+ * using blobs.
+ *
+ * @ho: video information passed from SPL
+ * Returns: 0 (always)
+ */
+int video_reserve_from_bloblist(struct video_handoff *ho);
+
 #endif
-- 
2.34.1



[PATCH V5 3/9] board: ti: am62x: evm: Update function calls for splash screen

2023-06-21 Thread Nikhil M Jain
Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
up pagetable, initialise DRAM and enable Dcache to avoid multiple
function calls.

Check for CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to prevent
any build failure in case video config is not defined and video related
functions are called.

Check for CONFIG_SPL_SPLASH_SCREEN and CONFIG_SPL_BMP before calling
splash_display to avoid compilation failure.

Signed-off-by: Nikhil M Jain 
---
V5:
- No change.

V4:
- Update commit message as per comments.

V3:
- No change.

V2:
- Use CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to reserve
  video and  call splash at SPL.
- Check SPL_SPLASH_SCREEN and SPL_BMP before calling splash display.

 arch/arm/mach-k3/am625_init.c |  1 +
 board/ti/am62x/evm.c  | 41 +--
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 787fe92295..0e5d44269e 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -214,6 +214,7 @@ void board_init_f(ulong dummy)
if (ret)
panic("DRAM init failed: %d\n", ret);
 #endif
+   spl_enable_dcache();
 }
 
 u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 34830f445f..d3c1786cd9 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -59,42 +59,31 @@ int dram_init_banksize(void)
 }
 
 #if defined(CONFIG_SPL_BUILD)
-#ifdef CONFIG_SPL_VIDEO_TIDSS
-static int setup_dram(void)
-{
-   dram_init();
-   dram_init_banksize();
-   gd->ram_base = CFG_SYS_SDRAM_BASE;
-   gd->ram_top = gd->ram_base + gd->ram_size;
-   gd->relocaddr = gd->ram_top;
-   return 0;
-}
-
 static int video_setup(void)
 {
-   ulong addr;
-   int ret;
-   addr = gd->relocaddr;
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   ulong addr;
+   int ret;
+
+   addr = gd->relocaddr;
+   ret = video_reserve();
+   if (ret)
+   return ret;
+   debug("Reserving %luk for video at: %08lx\n",
+ ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+   gd->relocaddr = addr;
+   }
 
-   ret = video_reserve();
-   if (ret)
-   return ret;
-   debug("Reserving %luk for video at: %08lx\n",
- ((unsigned long)gd->relocaddr - addr) >> 10, addr);
-   gd->relocaddr = addr;
return 0;
 }
 
-#endif
 void spl_board_init(void)
 {
-#if defined(CONFIG_SPL_VIDEO_TIDSS)
-   setup_dram();
-   arch_reserve_mmu();
video_setup();
enable_caches();
-   splash_display();
-#endif
+   if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP))
+   splash_display();
+
 }
 
 #if defined(CONFIG_K3_AM64_DDRSS)
-- 
2.34.1



[PATCH V5 2/9] arch: arm: mach-k3: common: Return a pointer after setting page table

2023-06-21 Thread Nikhil M Jain
In spl_dcache_enable after setting up page table, set gd->relocaddr
pointer to tlb_addr, to get next location to reserve memory. Align
tlb_addr with 64KB address.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V5:
- No change.

V4:
- Add Reviewed-by tag.

V3:
- No change.

V2:
- Perform 64KB alignment on tlb_addr.

 arch/arm/mach-k3/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index bda01527d3..f9cfa66059 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -629,8 +629,10 @@ void spl_enable_dcache(void)
ram_top = (phys_addr_t) 0x1;
 
gd->arch.tlb_addr = ram_top - gd->arch.tlb_size;
+   gd->arch.tlb_addr &= ~(0x1 - 1);
debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
  gd->arch.tlb_addr + gd->arch.tlb_size);
+   gd->relocaddr = gd->arch.tlb_addr;
 
dcache_enable();
 #endif
-- 
2.34.1



[PATCH V5 1/9] common: spl: spl: Update stack pointer address

2023-06-21 Thread Nikhil M Jain
At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Tom Rini 
---
V5:
- No change.

V4:
- No change.

V3:
- Add Reviewed-by tag.

V2:
- No change.

 common/spl/spl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d74acec10b..d45dd1c923 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,7 @@ ulong spl_relocate_stack_gd(void)
 #endif
/* Get stack position: use 8-byte alignment for ABI compliance */
ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+   gd->start_addr_sp = ptr;
new_gd = (gd_t *)ptr;
memcpy(new_gd, (void *)gd, sizeof(gd_t));
 #if CONFIG_IS_ENABLED(DM)
-- 
2.34.1



[PATCH V5 0/9] Update SPL splashscreen framework for AM62x

2023-06-21 Thread Nikhil M Jain
This patch series aims at updating SPL splashscreen framework for AM62x.

This patch series depends on
https://lore.kernel.org/u-boot/20230504225829.2537050-1-...@chromium.org/

This series:
- Fixes compilation issues in case splash related configs are not
  defined in SPL.
- Does page table setup, dram initialisation and dcache enabling in
  one function call spl_enable_dcache.
- Allows passing of framebuffer from spl to u-boot, eliminating flicker.

V5:
- Change A53 SPL DDR layout from ASCII table to tabular format.

V4:
- Fix commit message.
- Introduce patch defining DDR layout in A53 SPL.
- Add Reviewed-by tags.

V3:
- Fix spacing issues.
- Add Reviewed-by tag.
- Replace #if with if in patch
  common: spl: spl: Remove video driver
- Add link to updated memory map.

V2:
- Update cover letter.
- Fix commit message.

Nikhil M Jain (9):
  common: spl: spl: Update stack pointer address
  arch: arm: mach-k3: common: Return a pointer after setting page table
  board: ti: am62x: evm: Update function calls for splash screen
  include: video: Reserve video using blob
  common: board_f: Pass frame buffer info from SPL to u-boot
  drivers: video: Kconfig: Add config remove video
  common: spl: spl: Remove video driver
  configs: am62x_evm_a53: Add bloblist address
  doc: board: ti: am62x_sk: Add A53 SPL DDR layout

 arch/arm/mach-k3/am625_init.c   |  1 +
 arch/arm/mach-k3/common.c   |  2 ++
 board/ti/am62x/evm.c| 41 +---
 common/board_f.c| 11 ++-
 common/spl/spl.c| 23 ++---
 configs/am62x_evm_a53_defconfig |  1 +
 doc/board/ti/am62x_sk.rst   | 57 +
 drivers/video/Kconfig   | 12 +++
 drivers/video/video-uclass.c| 23 +
 include/video.h |  9 ++
 10 files changed, 142 insertions(+), 38 deletions(-)

-- 
2.34.1



Re: [EXTERNAL] Re: [PATCH 0/2] Mitigate warnings occurred during compilation

2023-06-20 Thread Nikhil M Jain

Hi Tom,

On 19/06/23 18:48, Tom Rini wrote:

On Mon, Jun 19, 2023 at 03:14:01PM +0530, Nikhil M Jain wrote:

This patch series aims at mitigating warnings occurred during
compilation by including required header files and using appropriate
types for variables which are typecasted.

Nikhil M Jain (2):
   board: ti: am62x: evm: Include necessary header files
   common: splash_source: Fix type casting errors.

  board/ti/am62x/evm.c   | 1 +
  common/splash_source.c | 4 ++--
  2 files changed, 3 insertions(+), 2 deletions(-)


What is this on top of, or what changes have been made to stock
defconfigs to make these problems appear?

These errors appear when you enable CONFIG_SPLASH_SOURCE and CONFIG_FIT 
is enabled.


Thanks,
Nikhil


[PATCH 2/2] common: splash_source: Fix type casting errors.

2023-06-19 Thread Nikhil M Jain
During compilation splash_source puts out below warning for type
conversion in splash_load_fit for bmp_load_addr and fit_header, change
their type to uintptr_t to mitigate the warnings.

common/splash_source.c: In function ‘splash_load_fit’:
common/splash_source.c:366:22: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]
  366 | img_header = (struct legacy_img_hdr *)bmp_load_addr;
  |  ^
common/splash_source.c:376:49: warning: cast from pointer to integer of 
different size [-Wpointer-to-int-cast]
  376 | res = splash_storage_read_raw(location, (u32)fit_header, 
fit_size);
  | ^
common/splash_source.c:401:25: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]
  401 | memmove((void *)bmp_load_addr, internal_splash_data, 
internal_splash_size);

Signed-off-by: Nikhil M Jain 
---
 common/splash_source.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/splash_source.c b/common/splash_source.c
index a260137619..53f2c7034b 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -343,7 +343,7 @@ static struct splash_location *select_splash_location(
 }
 
 #ifdef CONFIG_FIT
-static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
+static int splash_load_fit(struct splash_location *location, uintptr_t 
bmp_load_addr)
 {
int res;
int node_offset;
@@ -373,7 +373,7 @@ static int splash_load_fit(struct splash_location 
*location, u32 bmp_load_addr)
 
/* Read in entire FIT */
fit_header = (const u32 *)(bmp_load_addr + header_size);
-   res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
+   res = splash_storage_read_raw(location, (uintptr_t)fit_header, 
fit_size);
if (res < 0)
return res;
 
-- 
2.34.1



[PATCH 1/2] board: ti: am62x: evm: Include necessary header files

2023-06-19 Thread Nikhil M Jain
At the time of compilation evm.c gives below warning for implicit
declaration of enable_caches, to mitigate this include cpu_func.h.

board/ti/am62x/evm.c: In function ‘spl_board_init’:
board/ti/am62x/evm.c:90:9: warning: implicit declaration of function 
‘enable_caches’ [-Wimplicit-function-declaration]
90 | enable_caches();

Signed-off-by: Nikhil M Jain 
---
 board/ti/am62x/evm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index d3c1786cd9..ad93908840 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.34.1



[PATCH 0/2] Mitigate warnings occurred during compilation

2023-06-19 Thread Nikhil M Jain
This patch series aims at mitigating warnings occurred during
compilation by including required header files and using appropriate
types for variables which are typecasted.

Nikhil M Jain (2):
  board: ti: am62x: evm: Include necessary header files
  common: splash_source: Fix type casting errors.

 board/ti/am62x/evm.c   | 1 +
 common/splash_source.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.34.1



Re: [PATCH V4 9/9] doc: board: ti: am62x_sk: Add A53 SPL DDR layout

2023-06-19 Thread Nikhil M Jain

Hi Tom,

On 16/06/23 20:24, Tom Rini wrote:

On Fri, Jun 16, 2023 at 04:22:38PM +0530, Nikhil M Jain wrote:

To understand usage of DDR in A53 SPL stage, add a table showing region
and space used by major components of SPL.

Signed-off-by: Nikhil M Jain 
---
V4(patch introduced):
- Document A53 SPL DDR memory layout.

  doc/board/ti/am62x_sk.rst | 53 +++
  1 file changed, 53 insertions(+)

diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index 27d7b527c6..ac40f8d3c4 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -230,6 +230,59 @@ Image formats:
  | +---+ |
  +---+
  
+A53 SPL DDR Memory Layout

+-
+
+This provides an overview memory usage in A53 SPL stage.
+
+ .. code-block:: text


The correct table format to use is in the previous section.


+-+0x8000
|Empty 512 KB |
| |
+-+0x8008
| Text Base   |
|   352 KB|
| |
+-+0x800D8000
|Empty 1.1MB  |
| |
+-+0x8020
| |
| |
| |
|   BMP Image Load|
| |
|   9.4 MB|
| |
| |
| |
| |
| |
| |
+-+0x80B77660
| Stack 2KB   |
+-+0x80B77e60
|GD 416 Bytes |
+-+0x80B78000
| |
|Malloc 352KB |
+-+0x80B8
| |
| Empty 1 MB  |
| |
+-+0x80C8
| BSS 512 KB  |
| |
+-+0x80D0
| Blobs 1KB   |
+-+0x80D00400
| |
|   Empty 2.999MB |
| |
| |
+-+FIT Image load address 0x8100

Is this the right format?

Thank you,
Nikhil


[PATCH V4 9/9] doc: board: ti: am62x_sk: Add A53 SPL DDR layout

2023-06-16 Thread Nikhil M Jain
To understand usage of DDR in A53 SPL stage, add a table showing region
and space used by major components of SPL.

Signed-off-by: Nikhil M Jain 
---
V4(patch introduced):
- Document A53 SPL DDR memory layout.

 doc/board/ti/am62x_sk.rst | 53 +++
 1 file changed, 53 insertions(+)

diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index 27d7b527c6..ac40f8d3c4 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -230,6 +230,59 @@ Image formats:
 | +---+ |
 +---+
 
+A53 SPL DDR Memory Layout
+-
+
+This provides an overview memory usage in A53 SPL stage.
+
+ .. code-block:: text
+
+┌─┐0x8000
+│Empty 512 KB │
+│ │
+├─┤0x8008
+│ Text Base   │
+│   352 KB│
+│ │
+├─┤0x800D8000
+│Empty 1.1MB  │
+│ │
+├─┤0x8020
+│ │
+│ │
+│ │
+│   BMP Image Load│
+│ │
+│   9.4 MB│
+│ │
+│ │
+│ │
+│ │
+│ │
+│ │
+├─┤0x80B77660
+│ Stack 2KB   │
+├─┤0x80B77e60
+│GD 416 Bytes │
+├─┤0x80B78000
+│ │
+│Malloc 352KB │
+├─┤0x80B8
+│ │
+│ Empty 1 MB  │
+│ │
+├─┤0x80C8
+│ BSS 512 KB  │
+│ │
+├─┤0x80D0
+│ Blobs 1KB   │
+├─┤0x80D00400
+│ │
+│   Empty 2.999MB │
+│ │
+│ │
+└─┘FIT Image load address 0x8100
+
 Switch Setting for Boot Mode
 
 
-- 
2.34.1



[PATCH V4 8/9] configs: am62x_evm_a53: Add bloblist address

2023-06-16 Thread Nikhil M Jain
Set bloblist address to 0x80D0.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V4:
- Remove the link to SPL DDR memory layout and add a new patch.

V3:
- Add link to updated memory map.

V2:
- Add Reviewed-by tag.

 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf..5c572dfb33 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -102,3 +102,4 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_BLOBLIST_ADDR=0x80D0
-- 
2.34.1



[PATCH V4 7/9] common: spl: spl: Remove video driver

2023-06-16 Thread Nikhil M Jain
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before
jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to
remove video if required.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V4:
- No change.

V3:
- Replace #if defined(CONFIG_SPL_VIDEO_REMOVE) with
  if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE).

V2:
- Add Reviewed-by tag.

 common/spl/spl.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d45dd1c923..f09bb97781 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -891,18 +891,18 @@ 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);
+   if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE)) {
+   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



[PATCH V4 6/9] drivers: video: Kconfig: Add config remove video

2023-06-16 Thread Nikhil M Jain
This is required since user may want to either call the remove method
of video driver and reset the display or not call the remove method
to continue displaying until next stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
Reviewed-by: Tom Rini 
---
V4:
- Add Reviewed-by tag.

V3:
- No change.

V2:
- Add Reviewed-by tag.

 drivers/video/Kconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4976295071..de64e33c2f 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -833,6 +833,12 @@ config IHS_VIDEO_OUT
  out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
  textual overlays of the display outputs.
 
+config VIDEO_REMOVE
+   bool "Remove video driver"
+   help
+ Use this option to specify if user wants to call remove method of
+ video driver in u-boot proper stage.
+
 config SPLASH_SCREEN
bool "Show a splash-screen image"
help
@@ -1056,6 +1062,12 @@ config SPL_SYS_WHITE_ON_BLACK
 This can be better in low-light situations or to reduce eye strain in
 some cases.
 
+config SPL_VIDEO_REMOVE
+   bool "Remove video driver after SPL stage"
+   help
+ if this  option is enabled video driver will be removed at the end of
+ SPL stage, beforeloading the next stage.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
-- 
2.34.1



[PATCH V4 5/9] common: board_f: Pass frame buffer info from SPL to u-boot

2023-06-16 Thread Nikhil M Jain
U-boot proper can use frame buffer address passed from SPL to reserve
the memory area used by framebuffer set in SPL so that splash image
set in SPL continues to get displayed while u-boot proper is running.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
Reviewed-by: Simon Glass 
---
V4:
- Add Reviewed-by tag.

V3:
- Clean up errors appeared in checkpatch.

V2:
- Fix commit message.
- Revert use of #if.

 common/board_f.c | 11 ++-
 drivers/video/video-uclass.c | 12 
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 1688e27071..8e5dbaf06c 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -411,7 +411,16 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-   if (IS_ENABLED(CONFIG_VIDEO)) {
+   if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
+   CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   video_reserve_from_bloblist(ho);
+   gd->relocaddr = ho->fb;
+   } else if (CONFIG_IS_ENABLED(VIDEO)) {
ulong addr;
int ret;
 
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 497ebd9acf..1a318e2310 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,12 +6,14 @@
 #define LOG_CATEGORY UCLASS_VIDEO
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -139,6 +141,16 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
  gd->video_top);
 
+   if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   ho->fb = *addrp;
+   ho->size = size;
+   }
+
return 0;
 }
 
-- 
2.34.1



[PATCH V4 4/9] include: video: Reserve video using blob

2023-06-16 Thread Nikhil M Jain
Add method to reserve video framebuffer information using blob,
received from previous stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Simon Glass 
---
V4:
- No change.

V3:
- Add Reviewed-by tag.

V2:
- Remove #if CONFIG_IS_ENABLED(VIDEO) in video_reserve_from_blob.

 drivers/video/video-uclass.c | 11 +++
 include/video.h  |  9 +
 2 files changed, 20 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 1b66a8061a..497ebd9acf 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -142,6 +142,17 @@ int video_reserve(ulong *addrp)
return 0;
 }
 
+int video_reserve_from_bloblist(struct video_handoff *ho)
+{
+   gd->video_bottom = ho->fb;
+   gd->fb_base = ho->fb;
+   gd->video_top = ho->fb + ho->size;
+   debug("Reserving %luk for video using blob at: %08x\n",
+ ((unsigned long)ho->size) >> 10, (u32)ho->fb);
+
+   return 0;
+}
+
 int video_fill(struct udevice *dev, u32 colour)
 {
struct video_priv *priv = dev_get_uclass_priv(dev);
diff --git a/include/video.h b/include/video.h
index fffaae84e5..bdf1cf7855 100644
--- a/include/video.h
+++ b/include/video.h
@@ -390,4 +390,13 @@ int bmp_display(ulong addr, int x, int y);
  */
 int bmp_info(ulong addr);
 
+/*
+ * video_reserve_from_bloblist()- Reserve frame-buffer memory for video devices
+ * using blobs.
+ *
+ * @ho: video information passed from SPL
+ * Returns: 0 (always)
+ */
+int video_reserve_from_bloblist(struct video_handoff *ho);
+
 #endif
-- 
2.34.1



[PATCH V4 3/9] board: ti: am62x: evm: Update function calls for splash screen

2023-06-16 Thread Nikhil M Jain
Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
up pagetable, initialise DRAM and enable Dcache, in place of having
separate calls for each.

Check for CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to prevent
any build failure in case video config is not defined and video related
functions are called.

Check for CONFIG_SPL_SPLASH_SCREEN and CONFIG_SPL_BMP before calling
splash_display to avoid compilation failure.

Signed-off-by: Nikhil M Jain 
---
V4:
- Update commit message as per comments.

V3:
- No change.

V2:
- Use CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to reserve
  video and  call splash at SPL.
- Check SPL_SPLASH_SCREEN and SPL_BMP before calling splash display.

 arch/arm/mach-k3/am625_init.c |  1 +
 board/ti/am62x/evm.c  | 41 +--
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 787fe92295..0e5d44269e 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -214,6 +214,7 @@ void board_init_f(ulong dummy)
if (ret)
panic("DRAM init failed: %d\n", ret);
 #endif
+   spl_enable_dcache();
 }
 
 u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 34830f445f..d3c1786cd9 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -59,42 +59,31 @@ int dram_init_banksize(void)
 }
 
 #if defined(CONFIG_SPL_BUILD)
-#ifdef CONFIG_SPL_VIDEO_TIDSS
-static int setup_dram(void)
-{
-   dram_init();
-   dram_init_banksize();
-   gd->ram_base = CFG_SYS_SDRAM_BASE;
-   gd->ram_top = gd->ram_base + gd->ram_size;
-   gd->relocaddr = gd->ram_top;
-   return 0;
-}
-
 static int video_setup(void)
 {
-   ulong addr;
-   int ret;
-   addr = gd->relocaddr;
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   ulong addr;
+   int ret;
+
+   addr = gd->relocaddr;
+   ret = video_reserve();
+   if (ret)
+   return ret;
+   debug("Reserving %luk for video at: %08lx\n",
+ ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+   gd->relocaddr = addr;
+   }
 
-   ret = video_reserve();
-   if (ret)
-   return ret;
-   debug("Reserving %luk for video at: %08lx\n",
- ((unsigned long)gd->relocaddr - addr) >> 10, addr);
-   gd->relocaddr = addr;
return 0;
 }
 
-#endif
 void spl_board_init(void)
 {
-#if defined(CONFIG_SPL_VIDEO_TIDSS)
-   setup_dram();
-   arch_reserve_mmu();
video_setup();
enable_caches();
-   splash_display();
-#endif
+   if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP))
+   splash_display();
+
 }
 
 #if defined(CONFIG_K3_AM64_DDRSS)
-- 
2.34.1



[PATCH V4 2/9] arch: arm: mach-k3: common: Return a pointer after setting page table

2023-06-16 Thread Nikhil M Jain
In spl_dcache_enable after setting up page table, set gd->relocaddr
pointer to tlb_addr, to get next location to reserve memory. Align
tlb_addr with 64KB address.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V4:
- Add Reviewed-by tag.

V3:
- No change.

V2:
- Perform 64KB alignment on tlb_addr.

 arch/arm/mach-k3/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index bda01527d3..f9cfa66059 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -629,8 +629,10 @@ void spl_enable_dcache(void)
ram_top = (phys_addr_t) 0x1;
 
gd->arch.tlb_addr = ram_top - gd->arch.tlb_size;
+   gd->arch.tlb_addr &= ~(0x1 - 1);
debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
  gd->arch.tlb_addr + gd->arch.tlb_size);
+   gd->relocaddr = gd->arch.tlb_addr;
 
dcache_enable();
 #endif
-- 
2.34.1



[PATCH V4 1/9] common: spl: spl: Update stack pointer address

2023-06-16 Thread Nikhil M Jain
At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Tom Rini 
---
V4:
- No change.

V3:
- Add Reviewed-by tag.

V2:
- No change.

 common/spl/spl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d74acec10b..d45dd1c923 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,7 @@ ulong spl_relocate_stack_gd(void)
 #endif
/* Get stack position: use 8-byte alignment for ABI compliance */
ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+   gd->start_addr_sp = ptr;
new_gd = (gd_t *)ptr;
memcpy(new_gd, (void *)gd, sizeof(gd_t));
 #if CONFIG_IS_ENABLED(DM)
-- 
2.34.1



[PATCH V4 0/9] Update SPL splashscreen framework for AM62x

2023-06-16 Thread Nikhil M Jain
This patch series aims at updating SPL splashscreen framework for AM62x.

This patch series depends on
https://lore.kernel.org/u-boot/20230504225829.2537050-1-...@chromium.org/

This series:
- Fixes compilation issues in case splash related configs are not
  defined in SPL.
- Does page table setup, dram initialisation and dcache enabling in
  one function call spl_enable_dcache.
- Allows passing of framebuffer from spl to u-boot, eliminating flicker.

V4:
- Fix commit message.
- Introduce patch defining DDR layout in A53 SPL.
- Add Reviewed-by tags.

V3:
- Fix spacing issues.
- Add Reviewed-by tag.
- Replace #if with if in patch
  common: spl: spl: Remove video driver
- Add link to updated memory map.

V2:
- Update cover letter.
- Fix commit message.


Nikhil M Jain (9):
  common: spl: spl: Update stack pointer address
  arch: arm: mach-k3: common: Return a pointer after setting page table
  board: ti: am62x: evm: Update function calls for splash screen
  include: video: Reserve video using blob
  common: board_f: Pass frame buffer info from SPL to u-boot
  drivers: video: Kconfig: Add config remove video
  common: spl: spl: Remove video driver
  configs: am62x_evm_a53: Add bloblist address
  doc: board: ti: am62x_sk: Add A53 SPL DDR layout

 arch/arm/mach-k3/am625_init.c   |  1 +
 arch/arm/mach-k3/common.c   |  2 ++
 board/ti/am62x/evm.c| 41 ++---
 common/board_f.c| 11 ++-
 common/spl/spl.c| 23 +++---
 configs/am62x_evm_a53_defconfig |  1 +
 doc/board/ti/am62x_sk.rst   | 53 +
 drivers/video/Kconfig   | 12 
 drivers/video/video-uclass.c| 23 ++
 include/video.h |  9 ++
 10 files changed, 138 insertions(+), 38 deletions(-)

-- 
2.34.1



[PATCH V3 7/8] common: spl: spl: Remove video driver

2023-06-14 Thread Nikhil M Jain
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before
jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to
remove video if required.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V3:
- Replace #if defined(CONFIG_SPL_VIDEO_REMOVE) with
  if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE).

V2:
- Add Reviewed-by tag.

 common/spl/spl.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 13b55e9769..79291abeae 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -891,18 +891,18 @@ 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);
+   if (IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE)) {
+   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



[PATCH V3 8/8] configs: am62x_evm_a53: Add bloblist address

2023-06-14 Thread Nikhil M Jain
Set bloblist address to 0x80D0.

Below is the link to updated memory map:

Link: 
https://gist.github.com/NikMJain/5686f7f976c18a359762b52d474dc07b#file-am62x-a53_spl_memory_map-rst

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V3:
- Add link to updated memory map.

V2:
- Add Reviewed-by tag.

 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf..5c572dfb33 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -102,3 +102,4 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_BLOBLIST_ADDR=0x80D0
-- 
2.34.1



[PATCH V3 5/8] common: board_f: Pass frame buffer info from SPL to u-boot

2023-06-14 Thread Nikhil M Jain
U-boot proper can use frame buffer address passed from SPL to reserve
the memory area used by framebuffer set in SPL so that splash image
set in SPL continues to get displayed while u-boot proper is running.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain 
---
V3:
- Clean up errors appeared in checkpatch.

V2:
- Fix commit message.
- Revert use of #if.

 common/board_f.c | 11 ++-
 drivers/video/video-uclass.c | 12 
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 1688e27071..8e5dbaf06c 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -411,7 +411,16 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-   if (IS_ENABLED(CONFIG_VIDEO)) {
+   if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
+   CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   video_reserve_from_bloblist(ho);
+   gd->relocaddr = ho->fb;
+   } else if (CONFIG_IS_ENABLED(VIDEO)) {
ulong addr;
int ret;
 
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 68ce681bb9..f8f0dc0311 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,12 +6,14 @@
 #define LOG_CATEGORY UCLASS_VIDEO
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -139,6 +141,16 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
  gd->video_top);
 
+   if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   ho->fb = *addrp;
+   ho->size = size;
+   }
+
return 0;
 }
 
-- 
2.34.1



[PATCH V3 4/8] include: video: Reserve video using blob

2023-06-14 Thread Nikhil M Jain
Add method to reserve video framebuffer information using blob,
received from previous stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Simon Glass 
---
V3:
- Add Reviewed-by tag.

V2:
- Remove #if CONFIG_IS_ENABLED(VIDEO) in video_reserve_from_blob.

 drivers/video/video-uclass.c | 11 +++
 include/video.h  |  9 +
 2 files changed, 20 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 8396bdfb11..68ce681bb9 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -142,6 +142,17 @@ int video_reserve(ulong *addrp)
return 0;
 }
 
+int video_reserve_from_bloblist(struct video_handoff *ho)
+{
+   gd->video_bottom = ho->fb;
+   gd->fb_base = ho->fb;
+   gd->video_top = ho->fb + ho->size;
+   debug("Reserving %luk for video using blob at: %08x\n",
+ ((unsigned long)ho->size) >> 10, (u32)ho->fb);
+
+   return 0;
+}
+
 int video_fill(struct udevice *dev, u32 colour)
 {
struct video_priv *priv = dev_get_uclass_priv(dev);
diff --git a/include/video.h b/include/video.h
index 18ed159b8d..5f3010d641 100644
--- a/include/video.h
+++ b/include/video.h
@@ -389,4 +389,13 @@ int bmp_display(ulong addr, int x, int y);
  */
 int bmp_info(ulong addr);
 
+/*
+ * video_reserve_from_bloblist()- Reserve frame-buffer memory for video devices
+ * using blobs.
+ *
+ * @ho: video information passed from SPL
+ * Returns: 0 (always)
+ */
+int video_reserve_from_bloblist(struct video_handoff *ho);
+
 #endif
-- 
2.34.1



[PATCH V3 6/8] drivers: video: Kconfig: Add config remove video

2023-06-14 Thread Nikhil M Jain
This is required since user may want to either call the remove method
of video driver and reset the display or not call the remove method
to continue displaying until next stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V3:
- No change.

V2:
- Add Reviewed-by tag.

 drivers/video/Kconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index fcc0e85d2e..a89bfaa448 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -840,6 +840,12 @@ config IHS_VIDEO_OUT
  out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
  textual overlays of the display outputs.
 
+config VIDEO_REMOVE
+   bool "Remove video driver"
+   help
+ Use this option to specify if user wants to call remove method of
+ video driver in u-boot proper stage.
+
 config SPLASH_SCREEN
bool "Show a splash-screen image"
help
@@ -1063,6 +1069,12 @@ config SPL_SYS_WHITE_ON_BLACK
 This can be better in low-light situations or to reduce eye strain in
 some cases.
 
+config SPL_VIDEO_REMOVE
+   bool "Remove video driver after SPL stage"
+   help
+ if this  option is enabled video driver will be removed at the end of
+ SPL stage, beforeloading the next stage.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
-- 
2.34.1



[PATCH V3 3/8] board: ti: am62x: evm: Update function calls for splash screen

2023-06-14 Thread Nikhil M Jain
Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
up pagetable, initialise DRAM and enable Dcache.

Signed-off-by: Nikhil M Jain 
---
V3:
- No change.

V2:
- Use CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to reserve
  video and  call splash at SPL.
- Check SPL_SPLASH_SCREEN and SPL_BMP before calling splash display.

 arch/arm/mach-k3/am625_init.c |  1 +
 board/ti/am62x/evm.c  | 41 +--
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 787fe92295..0e5d44269e 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -214,6 +214,7 @@ void board_init_f(ulong dummy)
if (ret)
panic("DRAM init failed: %d\n", ret);
 #endif
+   spl_enable_dcache();
 }
 
 u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 34830f445f..d3c1786cd9 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -59,42 +59,31 @@ int dram_init_banksize(void)
 }
 
 #if defined(CONFIG_SPL_BUILD)
-#ifdef CONFIG_SPL_VIDEO_TIDSS
-static int setup_dram(void)
-{
-   dram_init();
-   dram_init_banksize();
-   gd->ram_base = CFG_SYS_SDRAM_BASE;
-   gd->ram_top = gd->ram_base + gd->ram_size;
-   gd->relocaddr = gd->ram_top;
-   return 0;
-}
-
 static int video_setup(void)
 {
-   ulong addr;
-   int ret;
-   addr = gd->relocaddr;
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   ulong addr;
+   int ret;
+
+   addr = gd->relocaddr;
+   ret = video_reserve();
+   if (ret)
+   return ret;
+   debug("Reserving %luk for video at: %08lx\n",
+ ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+   gd->relocaddr = addr;
+   }
 
-   ret = video_reserve();
-   if (ret)
-   return ret;
-   debug("Reserving %luk for video at: %08lx\n",
- ((unsigned long)gd->relocaddr - addr) >> 10, addr);
-   gd->relocaddr = addr;
return 0;
 }
 
-#endif
 void spl_board_init(void)
 {
-#if defined(CONFIG_SPL_VIDEO_TIDSS)
-   setup_dram();
-   arch_reserve_mmu();
video_setup();
enable_caches();
-   splash_display();
-#endif
+   if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP))
+   splash_display();
+
 }
 
 #if defined(CONFIG_K3_AM64_DDRSS)
-- 
2.34.1



[PATCH V3 2/8] arch: arm: mach-k3: common: Return a pointer after setting page table

2023-06-14 Thread Nikhil M Jain
In spl_dcache_enable after setting up page table, set gd->relocaddr
pointer to tlb_addr, to get next location to reserve memory. Align
tlb_addr with 64KB address.

Signed-off-by: Nikhil M Jain 
---
V3:
- No change.

V2:
- Perform 64KB alignment on tlb_addr.

 arch/arm/mach-k3/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 0e045919dd..9cd912c523 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -624,8 +624,10 @@ void spl_enable_dcache(void)
ram_top = (phys_addr_t) 0x1;
 
gd->arch.tlb_addr = ram_top - gd->arch.tlb_size;
+   gd->arch.tlb_addr &= ~(0x1 - 1);
debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
  gd->arch.tlb_addr + gd->arch.tlb_size);
+   gd->relocaddr = gd->arch.tlb_addr;
 
dcache_enable();
 #endif
-- 
2.34.1



[PATCH V3 1/8] common: spl: spl: Update stack pointer address

2023-06-14 Thread Nikhil M Jain
At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Tom Rini 
---
V3:
- Add Reviewed-by tag.

V2:
- No change.

 common/spl/spl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 801c4b507c..13b55e9769 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,7 @@ ulong spl_relocate_stack_gd(void)
 #endif
/* Get stack position: use 8-byte alignment for ABI compliance */
ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+   gd->start_addr_sp = ptr;
new_gd = (gd_t *)ptr;
memcpy(new_gd, (void *)gd, sizeof(gd_t));
 #if CONFIG_IS_ENABLED(DM)
-- 
2.34.1



[PATCH V3 0/8] Update SPL splashscreen framework for AM62x

2023-06-14 Thread Nikhil M Jain
This patch series aims at updating SPL splashscreen framework for AM62x.

This patch series depends on
https://lore.kernel.org/u-boot/20230504225829.2537050-1-...@chromium.org/

This series:
- Fixes compilation issues in case splash related configs are not
  defined in SPL.
- Does page table setup, dram initialisation and dcache enabling in
  one function call spl_enable_dcache.
- Allows passing of framebuffer from spl to u-boot, eliminating flicker.

V3:
- Fix spacing issues.
- Add Reviewed-by tag.
- Replace #if with if in patch
  common: spl: spl: Remove video driver
- Add link to updated memory map.

V2:
- Update cover letter.
- Fix commit message.

Nikhil M Jain (8):
  common: spl: spl: Update stack pointer address
  arch: arm: mach-k3: common: Return a pointer after setting page table
  board: ti: am62x: evm: Update function calls for splash screen
  include: video: Reserve video using blob
  common: board_f: Pass frame buffer info from SPL to u-boot
  drivers: video: Kconfig: Add config remove video
  common: spl: spl: Remove video driver
  configs: am62x_evm_a53: Add bloblist address

 arch/arm/mach-k3/am625_init.c   |  1 +
 arch/arm/mach-k3/common.c   |  2 ++
 board/ti/am62x/evm.c| 41 -
 common/board_f.c| 11 -
 common/spl/spl.c| 23 +-
 configs/am62x_evm_a53_defconfig |  1 +
 drivers/video/Kconfig   | 12 ++
 drivers/video/video-uclass.c| 23 ++
 include/video.h |  9 
 9 files changed, 85 insertions(+), 38 deletions(-)

-- 
2.34.1



[PATCH V2 8/8] configs: am62x_evm_a53: Add bloblist address

2023-06-09 Thread Nikhil M Jain
Define bloblist address.

Updated Memory map
0x8000┌─┐
  │Empty 512 KB │
  │ │
0x8008├─┤
  │ Text Base   │
  │   352 KB│
  │ │
0x800D8000├─┤
  │Empty 1.1MB  │
  │ │
0x8020├─┤
  │ │
  │ │
  │ │
  │   BMP Image Load│
  │ │
  │   9.4 MB│
  │ │
  │ │
  │ │
  │ │
  │ │
  │ │
0x80B77660├─┤
  │ Stack 2KB   │
0x80B77e60├─┤
  │GD 416 Bytes │
0x80B78000├─┤
  │ │
  │Malloc 352KB │
0x80B8├─┤
  │ │
  │ Empty 1 MB  │
  │ │
0x80C8├─┤
  │ BSS 512 KB  │
  │ │
0x80D0├─┤
  │ Blobs 1KB   │
0x80D00400├─┤
  │ │
  │   Empty 2.999MB │
  │ │
  │ │
0x8100└─┘FIT Image load address

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V2:
- Add Reviewed-by tag.

 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf..5c572dfb33 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -102,3 +102,4 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_BLOBLIST_ADDR=0x80D0
-- 
2.34.1



[PATCH V2 3/8] board: ti: am62x: evm: Update function calls for splash screen

2023-06-09 Thread Nikhil M Jain
Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
up pagetable, initialise DRAM and enable Dcache.

Signed-off-by: Nikhil M Jain 
---
V2:
- Use CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to reserve
  video and  call splash at SPL.
- Check SPL_SPLASH_SCREEN and SPL_BMP before calling splash display.

 arch/arm/mach-k3/am625_init.c |  1 +
 board/ti/am62x/evm.c  | 41 +--
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 787fe92295..0e5d44269e 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -214,6 +214,7 @@ void board_init_f(ulong dummy)
if (ret)
panic("DRAM init failed: %d\n", ret);
 #endif
+   spl_enable_dcache();
 }
 
 u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 34830f445f..d3c1786cd9 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -59,42 +59,31 @@ int dram_init_banksize(void)
 }
 
 #if defined(CONFIG_SPL_BUILD)
-#ifdef CONFIG_SPL_VIDEO_TIDSS
-static int setup_dram(void)
-{
-   dram_init();
-   dram_init_banksize();
-   gd->ram_base = CFG_SYS_SDRAM_BASE;
-   gd->ram_top = gd->ram_base + gd->ram_size;
-   gd->relocaddr = gd->ram_top;
-   return 0;
-}
-
 static int video_setup(void)
 {
-   ulong addr;
-   int ret;
-   addr = gd->relocaddr;
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   ulong addr;
+   int ret;
+
+   addr = gd->relocaddr;
+   ret = video_reserve();
+   if (ret)
+   return ret;
+   debug("Reserving %luk for video at: %08lx\n",
+ ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+   gd->relocaddr = addr;
+   }
 
-   ret = video_reserve();
-   if (ret)
-   return ret;
-   debug("Reserving %luk for video at: %08lx\n",
- ((unsigned long)gd->relocaddr - addr) >> 10, addr);
-   gd->relocaddr = addr;
return 0;
 }
 
-#endif
 void spl_board_init(void)
 {
-#if defined(CONFIG_SPL_VIDEO_TIDSS)
-   setup_dram();
-   arch_reserve_mmu();
video_setup();
enable_caches();
-   splash_display();
-#endif
+   if (IS_ENABLED(CONFIG_SPL_SPLASH_SCREEN) && IS_ENABLED(CONFIG_SPL_BMP))
+   splash_display();
+
 }
 
 #if defined(CONFIG_K3_AM64_DDRSS)
-- 
2.34.1



[PATCH V2 6/8] drivers: video: Kconfig: Add config remove video

2023-06-09 Thread Nikhil M Jain
This is required since user may want to either call the remove method
of video driver and reset the display or not call the remove method
to continue displaying until next stage.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
V2:
- Add Reviewed-by tag.

 drivers/video/Kconfig | 13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index fcc0e85d2e..eca95dd28e 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -840,6 +840,13 @@ config IHS_VIDEO_OUT
  out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
  textual overlays of the display outputs.
 
+config VIDEO_REMOVE
+   bool "Remove video driver"
+   help
+   Use this option to specify if user wants to call remove method 
of
+   video driver in u-boot proper stage.
+
+
 config SPLASH_SCREEN
bool "Show a splash-screen image"
help
@@ -1063,6 +1070,12 @@ config SPL_SYS_WHITE_ON_BLACK
 This can be better in low-light situations or to reduce eye strain in
 some cases.
 
+config SPL_VIDEO_REMOVE
+   bool "Remove video driver after SPL stage"
+   help
+if this  option is enabled video driver will be removed at the end of
+SPL stage, beforeloading the next stage.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
-- 
2.34.1



[PATCH V2 5/8] common: board_f: Pass frame buffer info from SPL to u-boot

2023-06-09 Thread Nikhil M Jain
U-boot proper can use frame buffer address passed from SPL to reserve
the memory area used by framebuffer set in SPL so that splash image
set in SPL continues to get displayed while u-boot proper is running.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain 
---
V2:
- Fix commit message.
- Revert use of #if.

 common/board_f.c | 12 +++-
 drivers/video/video-uclass.c | 12 
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 1688e27071..418aecc18f 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -411,7 +411,17 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-   if (IS_ENABLED(CONFIG_VIDEO)) {
+
+   if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
+   CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   video_reserve_from_bloblist(ho);
+   gd->relocaddr = ho->fb;
+   } else if(CONFIG_IS_ENABLED(VIDEO)){
ulong addr;
int ret;
 
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 68ce681bb9..f8f0dc0311 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,12 +6,14 @@
 #define LOG_CATEGORY UCLASS_VIDEO
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -139,6 +141,16 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
  gd->video_top);
 
+   if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   ho->fb = *addrp;
+   ho->size = size;
+   }
+
return 0;
 }
 
-- 
2.34.1



[PATCH V2 7/8] common: spl: spl: Remove video driver

2023-06-09 Thread Nikhil M Jain
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before
jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to
remove video if required.

Signed-off-by: Nikhil M Jain 
Reviewed-by: Devarsh Thakkar 
---
v2:
- Add Reviewed-by tag.

 common/spl/spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 13b55e9769..a65781002e 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -891,7 +891,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
debug("Failed to stash bootstage: err=%d\n", ret);
 #endif
 
-#if defined(CONFIG_SPL_VIDEO)
+#if defined(CONFIG_SPL_VIDEO_REMOVE)
struct udevice *dev;
int rc;
 
-- 
2.34.1



[PATCH V2 2/8] arch: arm: mach-k3: common: Return a pointer after setting page table

2023-06-09 Thread Nikhil M Jain
In spl_dcache_enable after setting up page table, set gd->relocaddr
pointer to tlb_addr, to get next location to reserve memory. Align
tlb_addr with 64KB address.

Signed-off-by: Nikhil M Jain 
---
V2:
- Perform 64KB alignment on tlb_addr.

 arch/arm/mach-k3/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 0e045919dd..9cd912c523 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -624,8 +624,10 @@ void spl_enable_dcache(void)
ram_top = (phys_addr_t) 0x1;
 
gd->arch.tlb_addr = ram_top - gd->arch.tlb_size;
+   gd->arch.tlb_addr &= ~(0x1 - 1);
debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
  gd->arch.tlb_addr + gd->arch.tlb_size);
+   gd->relocaddr = gd->arch.tlb_addr;
 
dcache_enable();
 #endif
-- 
2.34.1



[PATCH V2 1/8] common: spl: spl: Update stack pointer address

2023-06-09 Thread Nikhil M Jain
At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain 
---
V2:
- No change.

 common/spl/spl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 801c4b507c..13b55e9769 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,7 @@ ulong spl_relocate_stack_gd(void)
 #endif
/* Get stack position: use 8-byte alignment for ABI compliance */
ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+   gd->start_addr_sp = ptr;
new_gd = (gd_t *)ptr;
memcpy(new_gd, (void *)gd, sizeof(gd_t));
 #if CONFIG_IS_ENABLED(DM)
-- 
2.34.1



[PATCH V2 4/8] include: video: Reserve video using blob

2023-06-09 Thread Nikhil M Jain
Add method to reserve video framebuffer information using blob,
recieved from previous stage.

Signed-off-by: Nikhil M Jain 
---
V2:
- Remove #if CONFIG_IS_ENABLED(VIDEO) in video_reserve_from_blob.

 drivers/video/video-uclass.c | 11 +++
 include/video.h  |  9 +
 2 files changed, 20 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 8396bdfb11..68ce681bb9 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -142,6 +142,17 @@ int video_reserve(ulong *addrp)
return 0;
 }
 
+int video_reserve_from_bloblist(struct video_handoff *ho)
+{
+   gd->video_bottom = ho->fb;
+   gd->fb_base = ho->fb;
+   gd->video_top = ho->fb + ho->size;
+   debug("Reserving %luk for video using blob at: %08x\n",
+ ((unsigned long)ho->size) >> 10, (u32)ho->fb);
+
+   return 0;
+}
+
 int video_fill(struct udevice *dev, u32 colour)
 {
struct video_priv *priv = dev_get_uclass_priv(dev);
diff --git a/include/video.h b/include/video.h
index 18ed159b8d..5f3010d641 100644
--- a/include/video.h
+++ b/include/video.h
@@ -389,4 +389,13 @@ int bmp_display(ulong addr, int x, int y);
  */
 int bmp_info(ulong addr);
 
+/*
+ * video_reserve_from_bloblist()- Reserve frame-buffer memory for video devices
+ * using blobs.
+ *
+ * @ho: video information passed from SPL
+ * Returns: 0 (always)
+ */
+int video_reserve_from_bloblist(struct video_handoff *ho);
+
 #endif
-- 
2.34.1



[PATCH V2 0/8] Update SPL splashscreen framework for AM62x

2023-06-09 Thread Nikhil M Jain
This patch series aims at updating SPL splashscreen framework for AM62x.

This patch series depends on
https://lore.kernel.org/u-boot/20230504225829.2537050-1-...@chromium.org/

This series:
- Fixes compilation issues in case splash related configs are not
  defined in SPL.
- Does page table setup, dram initialisation and dcache enabling in
  one function call spl_enable_dcache.
- Allows passing of framebuffer from spl to u-boot, eliminating flicker.

V2:
- Update cover letter.
- Fix commit message.

Nikhil M Jain (8):
  common: spl: spl: Update stack pointer address
  arch: arm: mach-k3: common: Return a pointer after setting page table
  board: ti: am62x: evm: Update function calls for splash screen
  include: video: Reserve video using blob
  common: board_f: Pass frame buffer info from SPL to u-boot
  drivers: video: Kconfig: Add config remove video
  common: spl: spl: Remove video driver
  configs: am62x_evm_a53: Add bloblist address

 arch/arm/mach-k3/am625_init.c   |  1 +
 arch/arm/mach-k3/common.c   |  2 ++
 board/ti/am62x/evm.c| 41 -
 common/board_f.c| 12 +-
 common/spl/spl.c|  3 ++-
 configs/am62x_evm_a53_defconfig |  1 +
 drivers/video/Kconfig   | 13 +++
 drivers/video/video-uclass.c| 23 ++
 include/video.h |  9 
 9 files changed, 77 insertions(+), 28 deletions(-)

-- 
2.34.1



Re: [PATCH 1/8] common: spl: spl: Update stack pointer address

2023-06-08 Thread Nikhil M Jain

Hi Devarsh,

On 12/05/23 13:39, Devarsh Thakkar wrote:

Hi Nikhil, Vignesh, Tom,

Nikhil,
Thanks for the patch.

On 11/05/23 15:29, Nikhil M Jain wrote:

I think more apt subject would be "Update stack pointer after relocation"

At SPL stage when stack is relocated, the stack pointer needs to be
updated,


since
the stack pointer may point to stack in on chip memory even

though stack is relocated.

Signed-off-by: Nikhil M Jain 
---
  common/spl/spl.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 72078a8ebc..206caf4f8b 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,7 @@ ulong spl_relocate_stack_gd(void)
  #endif
/* Get stack position: use 8-byte alignment for ABI compliance */
ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+   gd->start_addr_sp = ptr;
new_gd = (gd_t *)ptr;


Seems to me you are setting gd->start_addr_sp to new gd's base address, are
they both supposed to be same ?

Vignesh, Tom,

Could you please have a look at this patch and comment ? Does the caller of
this function need to set gd->start_addr_sp or it's ok to set in here only?



I looked at how the start_addr_sp was being updated in u-boot proper 
stage and it is done in the same way as I have done. Since the stack 
grows in opposite direction there won't be any issues.



Regards
Devarsh


memcpy(new_gd, (void *)gd, sizeof(gd_t));
  #if CONFIG_IS_ENABLED(DM)


Thanks,
Nikhil


Re: [EXTERNAL] Re: [PATCH 0/8] Updats SPL splashscreen framework for AM62x

2023-06-02 Thread Nikhil M Jain

Hi Tom,

On 02/06/23 10:09, Nikhil M Jain wrote:

Hi Tom,

On 01/06/23 22:10, Tom Rini wrote:

On Thu, May 11, 2023 at 03:29:50PM +0530, Nikhil M Jain wrote:


This patch series aims at updating SPL splashscreen framework for AM62x.

Nikhil M Jain (8):
   common: spl: spl: Update stack pointer address
   arch: arm: mach-k3: common: Return a pointer after setting page table
   board: ti: am62x: evm: Update function calls for splash screen
   include: video: Reserve video using blob
   common: board_f: Pass frame buffer info from SPL to u-boot
   drivers: video: Kconfig: Add config remove video
   common: spl: spl: Remove video driver
   configs: am62x_evm_a53: Add bloblist address

  arch/arm/mach-k3/am625_init.c   |  1 +
  arch/arm/mach-k3/common.c   |  2 ++
  board/ti/am62x/evm.c    | 46 +
  common/board_f.c    | 13 +-
  common/spl/spl.c    |  3 ++-
  configs/am62x_evm_a53_defconfig |  1 +
  drivers/video/Kconfig   | 12 +
  drivers/video/video-uclass.c    | 24 +
  include/video.h |  9 +++
  9 files changed, 81 insertions(+), 30 deletions(-)


This series causes problems with sandbox even building, please rebase on
current next and put this through CI once you're sure both the TI cases
and at least sandbox also build, thanks.


I will rebase it and ensure it is getting built successfully.

Thanks,
Nikhil


Sorry I forgot to mention but this patch series actually depends on
https://patchwork.ozlabs.org/project/uboot/list/?series=353559
and without above series it won't build cleanly.

Also to add one of the patches from the series [1] had one comment as below:

>Vignesh, Tom,

"Could you please have a look at this patch and comment ? Does the 
caller of this function need to set gd->start_addr_sp or it's ok to set 
in here only?"


Could you please share your opinion for the same?

[1] 
https://lore.kernel.org/u-boot/ae6aa5f2-8bda-850c-5aae-2327ced39...@ti.com/


Thanks,
Nikhil


Re: [EXTERNAL] Re: [PATCH 0/8] Updats SPL splashscreen framework for AM62x

2023-06-01 Thread Nikhil M Jain

Hi Tom,

On 01/06/23 22:10, Tom Rini wrote:

On Thu, May 11, 2023 at 03:29:50PM +0530, Nikhil M Jain wrote:


This patch series aims at updating SPL splashscreen framework for AM62x.

Nikhil M Jain (8):
   common: spl: spl: Update stack pointer address
   arch: arm: mach-k3: common: Return a pointer after setting page table
   board: ti: am62x: evm: Update function calls for splash screen
   include: video: Reserve video using blob
   common: board_f: Pass frame buffer info from SPL to u-boot
   drivers: video: Kconfig: Add config remove video
   common: spl: spl: Remove video driver
   configs: am62x_evm_a53: Add bloblist address

  arch/arm/mach-k3/am625_init.c   |  1 +
  arch/arm/mach-k3/common.c   |  2 ++
  board/ti/am62x/evm.c| 46 +
  common/board_f.c| 13 +-
  common/spl/spl.c|  3 ++-
  configs/am62x_evm_a53_defconfig |  1 +
  drivers/video/Kconfig   | 12 +
  drivers/video/video-uclass.c| 24 +
  include/video.h |  9 +++
  9 files changed, 81 insertions(+), 30 deletions(-)


This series causes problems with sandbox even building, please rebase on
current next and put this through CI once you're sure both the TI cases
and at least sandbox also build, thanks.


I will rebase it and ensure it is getting built successfully.

Thanks,
Nikhil


[PATCH 8/8] configs: am62x_evm_a53: Add bloblist address

2023-05-11 Thread Nikhil M Jain
Define bloblist address.

Signed-off-by: Nikhil M Jain 
---
 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 7c3bc184cf..5c572dfb33 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -102,3 +102,4 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_BLOBLIST_ADDR=0x80D0
-- 
2.34.1



[PATCH 7/8] common: spl: spl: Remove video driver

2023-05-11 Thread Nikhil M Jain
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before
jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to
remove video if required.

Signed-off-by: Nikhil M Jain 
---
 common/spl/spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 206caf4f8b..fcb99bfe20 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -891,7 +891,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
debug("Failed to stash bootstage: err=%d\n", ret);
 #endif
 
-#if defined(CONFIG_SPL_VIDEO)
+#if defined(CONFIG_SPL_VIDEO_REMOVE)
struct udevice *dev;
int rc;
 
-- 
2.34.1



[PATCH 5/8] common: board_f: Pass frame buffer info from SPL to u-boot

2023-05-11 Thread Nikhil M Jain
When video is set up in SPL, U-Boot proper needs to use the correct
frame  buffer address to reserve particular location in memory, to avoid
displaying artifacts on the screen.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain 
---
 common/board_f.c | 13 -
 drivers/video/video-uclass.c | 12 
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 1688e27071..02730ec3a4 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -411,7 +411,17 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-   if (IS_ENABLED(CONFIG_VIDEO)) {
+#if (IS_ENABLED(CONFIG_VIDEO))
+   if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
+   CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   video_reserve_from_blob(ho);
+   gd->relocaddr = ho->fb;
+   } else {
ulong addr;
int ret;
 
@@ -423,6 +433,7 @@ static int reserve_video(void)
  ((unsigned long)gd->relocaddr - addr) >> 10, addr);
gd->relocaddr = addr;
}
+#endif
 
return 0;
 }
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 1264ad1101..324216b0f5 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,12 +6,14 @@
 #define LOG_CATEGORY UCLASS_VIDEO
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -139,6 +141,16 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
  gd->video_top);
 
+   if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   ho->fb = *addrp;
+   ho->size = size;
+   }
+
return 0;
 }
 
-- 
2.34.1



[PATCH 4/8] include: video: Reserve video using blob

2023-05-11 Thread Nikhil M Jain
Add method to reserve video using blob.

Signed-off-by: Nikhil M Jain 
---
 drivers/video/video-uclass.c | 12 
 include/video.h  |  9 +
 2 files changed, 21 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 8396bdfb11..1264ad1101 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -142,6 +142,18 @@ int video_reserve(ulong *addrp)
return 0;
 }
 
+int video_reserve_from_blob(struct video_handoff *ho)
+{
+#if CONFIG_IS_ENABLED(VIDEO)
+   gd->video_bottom = ho->fb;
+   gd->fb_base = ho->fb;
+   gd->video_top = ho->fb + ho->size;
+   debug("Reserving %luk for video using blob at: %08x\n",
+ ((unsigned long)ho->size) >> 10, (u32)ho->fb);
+#endif
+   return 0;
+}
+
 int video_fill(struct udevice *dev, u32 colour)
 {
struct video_priv *priv = dev_get_uclass_priv(dev);
diff --git a/include/video.h b/include/video.h
index 18ed159b8d..13460adc45 100644
--- a/include/video.h
+++ b/include/video.h
@@ -389,4 +389,13 @@ int bmp_display(ulong addr, int x, int y);
  */
 int bmp_info(ulong addr);
 
+/*
+ * video_reserve_from_blob()- Reserve frame-buffer memory for video devices
+ * using blobs.
+ *
+ * @ho: video information passed from SPL
+ * Returns: 0 (always)
+ */
+int video_reserve_from_blob(struct video_handoff *ho);
+
 #endif
-- 
2.34.1



[PATCH 6/8] drivers: video: Kconfig: Add config remove video

2023-05-11 Thread Nikhil M Jain
Add VIDEO_REMOVE configs to allow user to control removing of video
driver, in between stages.

Signed-off-by: Nikhil M Jain 
---
 drivers/video/Kconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index fcc0e85d2e..c5863f4dd5 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -840,6 +840,12 @@ config IHS_VIDEO_OUT
  out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
  textual overlays of the display outputs.
 
+config VIDEO_REMOVE
+   bool "Remove video driver"
+   help
+   Use this option to specify if you want to remove video driver 
before
+   loading OS.
+
 config SPLASH_SCREEN
bool "Show a splash-screen image"
help
@@ -1063,6 +1069,12 @@ config SPL_SYS_WHITE_ON_BLACK
 This can be better in low-light situations or to reduce eye strain in
 some cases.
 
+config SPL_VIDEO_REMOVE
+   bool "Remove video driver after SPL stage"
+   help
+if this  option is enabled video driver will be removed at the end of
+SPL stage, beforeloading the next stage.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
-- 
2.34.1



[PATCH 2/8] arch: arm: mach-k3: common: Return a pointer after setting page table

2023-05-11 Thread Nikhil M Jain
In spl_dcache_enable after setting up page table, set gd->relocaddr
pointer with 64KB alignment, to get next location to reserve memory.

Signed-off-by: Nikhil M Jain 
---
 arch/arm/mach-k3/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 3c85caee57..a8bde942f2 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -614,6 +614,8 @@ void spl_enable_dcache(void)
gd->arch.tlb_addr = ram_top - gd->arch.tlb_size;
debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
  gd->arch.tlb_addr + gd->arch.tlb_size);
+   gd->relocaddr = gd->arch.tlb_addr;
+   gd->relocaddr &= ~(0x1 - 1);
 
dcache_enable();
 #endif
-- 
2.34.1



[PATCH 3/8] board: ti: am62x: evm: Update function calls for splash screen

2023-05-11 Thread Nikhil M Jain
Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
up pagetable, initialise DRAM and enable Dcache.

Signed-off-by: Nikhil M Jain 
---
 arch/arm/mach-k3/am625_init.c |  1 +
 board/ti/am62x/evm.c  | 46 ++-
 2 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 026c4f9c02..9386d14558 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -168,6 +168,7 @@ void board_init_f(ulong dummy)
if (ret)
panic("DRAM init failed: %d\n", ret);
 #endif
+   spl_enable_dcache();
 }
 
 u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 34830f445f..f48a499059 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -59,42 +59,32 @@ int dram_init_banksize(void)
 }
 
 #if defined(CONFIG_SPL_BUILD)
-#ifdef CONFIG_SPL_VIDEO_TIDSS
-static int setup_dram(void)
-{
-   dram_init();
-   dram_init_banksize();
-   gd->ram_base = CFG_SYS_SDRAM_BASE;
-   gd->ram_top = gd->ram_base + gd->ram_size;
-   gd->relocaddr = gd->ram_top;
-   return 0;
-}
-
 static int video_setup(void)
 {
-   ulong addr;
-   int ret;
-   addr = gd->relocaddr;
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   ulong addr;
+   int ret;
+
+   addr = gd->relocaddr;
+   ret = video_reserve();
+   if (ret)
+   return ret;
+   debug("Reserving %luk for video at: %08lx\n",
+ ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+   gd->relocaddr = addr;
+   }
 
-   ret = video_reserve();
-   if (ret)
-   return ret;
-   debug("Reserving %luk for video at: %08lx\n",
- ((unsigned long)gd->relocaddr - addr) >> 10, addr);
-   gd->relocaddr = addr;
return 0;
 }
 
-#endif
 void spl_board_init(void)
 {
-#if defined(CONFIG_SPL_VIDEO_TIDSS)
-   setup_dram();
-   arch_reserve_mmu();
-   video_setup();
-   enable_caches();
-   splash_display();
-#endif
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   video_setup();
+   enable_caches();
+   if (CONFIG_IS_ENABLED(SPLASH_SCREEN))
+   splash_display();
+   }
 }
 
 #if defined(CONFIG_K3_AM64_DDRSS)
-- 
2.34.1



[PATCH 1/8] common: spl: spl: Update stack pointer address

2023-05-11 Thread Nikhil M Jain
At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain 
---
 common/spl/spl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 72078a8ebc..206caf4f8b 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,7 @@ ulong spl_relocate_stack_gd(void)
 #endif
/* Get stack position: use 8-byte alignment for ABI compliance */
ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+   gd->start_addr_sp = ptr;
new_gd = (gd_t *)ptr;
memcpy(new_gd, (void *)gd, sizeof(gd_t));
 #if CONFIG_IS_ENABLED(DM)
-- 
2.34.1



[PATCH 0/8] Updats SPL splashscreen framework for AM62x

2023-05-11 Thread Nikhil M Jain
This patch series aims at updating SPL splashscreen framework for AM62x.

Nikhil M Jain (8):
  common: spl: spl: Update stack pointer address
  arch: arm: mach-k3: common: Return a pointer after setting page table
  board: ti: am62x: evm: Update function calls for splash screen
  include: video: Reserve video using blob
  common: board_f: Pass frame buffer info from SPL to u-boot
  drivers: video: Kconfig: Add config remove video
  common: spl: spl: Remove video driver
  configs: am62x_evm_a53: Add bloblist address

 arch/arm/mach-k3/am625_init.c   |  1 +
 arch/arm/mach-k3/common.c   |  2 ++
 board/ti/am62x/evm.c| 46 +
 common/board_f.c| 13 +-
 common/spl/spl.c|  3 ++-
 configs/am62x_evm_a53_defconfig |  1 +
 drivers/video/Kconfig   | 12 +
 drivers/video/video-uclass.c| 24 +
 include/video.h |  9 +++
 9 files changed, 81 insertions(+), 30 deletions(-)

-- 
2.34.1



[PATCH V3 10/10] board: ti: am62x: am62x: Update splashimage as per new memory map

2023-05-09 Thread Nikhil M Jain
Update splashimage address, to load splash image at a lower address than
stack.

Signed-off-by: Nikhil M Jain 
---
V3:
- Keep splashsource as mmc.

V2:
- No change.

 board/ti/am62x/am62x.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env
index e4e64fa637..8f7f9f8dbc 100644
--- a/board/ti/am62x/am62x.env
+++ b/board/ti/am62x/am62x.env
@@ -33,6 +33,6 @@ get_fit_mmc=load mmc ${bootpart} ${addr_fit}
 partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
 
 splashfile=ti.gz
-splashimage=0x8200
+splashimage=0x8020
 splashpos=m,m
 splashsource=mmc
-- 
2.34.1



[PATCH V3 09/10] configs: am62x_evm_a53_defconfig: Changes in memory to support SPL splash screen

2023-05-09 Thread Nikhil M Jain
To enable splash at A53 SPL, need to do memory map changes which
involves locate stack above malloc and have enough space to load bmp
image above stack. To load a 1920X1200 image a minimum of 8.8MB space is
needed, to support it move malloc down to 0x80b8 from 0x8048 and
bss to 0x80c8 to have 1MB buffer between malloc and BSS.

Observed SPL size 195KB, CONFIG_SPL_SIZE_LIMIT set to 256KB.
Observed stack size 1904 Bytes, CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK set
to 2KB.
CONFIG_SPL_SYS_REPORT_STACK_F_USAGE config sets stack above the malloc
and reports for stack overflow.

Assign 0x80D0 for bloblist which is allocated a size of 1KB.

Memory map at A53 SPL before splash screen
0x8000+-+
  |Empty 512 KB |
  | |
0x8008+-+
  | Text Base   |
  |   352 KB|
  | |
0x800D8000+-+
  | |
  | |
  |Empty 3.6MB  |
  | |
  | |
0x80477660+-+
  |Stack 2 KB   |
0x80477e60+-+
  | GD 416 Bytes|
0x80478000+-+
  |Malloc 352 KB|
  | |
0x8048+-+
  | |
  | |
  | |
  | |
  |   Empty 5.5 MB  |
  | |
  | |
  | |
  | |
0x80a0+-+
  | |
  |  BSS 512 KB |
  | |
0x80a8+-+
  | |
  | |
  | |
  | |
  |   Empty 5.5 MB  |
  | |
  | |
  | |
  | |
0x8100+-+FIT Image load address

New memory map with splash screen at SPL
0x8000+-+
  |Empty 512 KB |
  | |
0x8008+-+
  | Text Base   |
  |   352 KB|
  | |
0x800D8000+-+
  |Empty 1.1MB  |
  | |
0x8020+-+
  | |
  | |
  | |
  |   BMP Image Load|
  | |
  |   9.4 MB|
  | |
  | |
  | |
  | |
  | |
  | |
0x80B77660+-+
  | Stack 2KB   |
0x80B77e60+-+
  |GD 416 Bytes |
0x80B78000+-+
  | |
  |Malloc 352KB |
0x80B8+-+
  | |
  | Empty 1 MB  |
  | |
0x80C8+-+
  | BSS 512 KB  |
  | |
0x80D0+-+
  | Blobs 1KB   |
0x80D00400+-+
  | |
  |   Empty 2.999MB |
  | |
  | |
0x8100+-+FIT Image load address

Signed-off-by: Nikhil M Jain 
---
V3:
- Add bloblist address

V2:
- No change.

 configs/am62x_evm_a53_defconfig | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index cc9c8eab3e..5bd5ef882e 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -8,14 +8,18 @@ CONFIG_SOC_K3_AM625=y
 CONFIG_K3_ATF_LOAD_ADDR=0x9e78
 CONFIG_TARGET_AM625_A53_EVM=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
-CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x8048
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80b8
+CONFIG_SF_DEFAULT_SPEED=2500
 CONFIG_SPL_DM_SPI=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-am625-sk"
 CONFIG_SPL_TEXT_BASE=0x8008
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_DM_RESET=y
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
+CONFIG_SPL_SIZE_LIMIT=0x4
+CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x800
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -27,8 +31,9 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run 
get_kern_${boot

[PATCH V3 08/10] common: spl: spl: Remove video driver before u-boot proper

2023-05-09 Thread Nikhil M Jain
Add method to remove video driver before loading u-boot proper, when
there is no bloblist passed to next stage, to avoid displaying of
artifacts in the next stage, if video is not defined in that stage.

Signed-off-by: Nikhil M Jain 
---
V3 (patch introduced):
- Remove video only if SPL_VIDEO_REMOVE is defined.

V2:
- No change.

 common/spl/spl.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 21a62521a9..8b67a37a26 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 IS_ENABLED(CONFIG_SPL_VIDEO_REMOVE)
+   struct udevice *dev;
+   int rc;
+
+   rc = uclass_find_first_device(UCLASS_VIDEO, );
+   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



[PATCH V3 07/10] drivers: video: Kconfig: Add config remove video

2023-05-09 Thread Nikhil M Jain
Add VIDEO_REMOVE configs to allow user to control removing of video
driver, in between stages.

Signed-off-by: Nikhil M Jain 
---
V3 (patch introduced):
- Add config to remove video.

 drivers/video/Kconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 05eaaa767a..eeb10ebd10 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -809,6 +809,12 @@ config IHS_VIDEO_OUT
  out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
  textual overlays of the display outputs.
 
+config VIDEO_REMOVE
+   bool "Remove video driver"
+   help
+   Use this option to specify if you want to remove video driver 
before
+   loading OS.
+
 config SPLASH_SCREEN
bool "Show a splash-screen image"
help
@@ -1032,6 +1038,12 @@ config SPL_SYS_WHITE_ON_BLACK
 This can be better in low-light situations or to reduce eye strain in
 some cases.
 
+config SPL_VIDEO_REMOVE
+   bool "Remove video driver after SPL stage"
+   help
+if this  option is enabled video driver will be removed at the end of
+SPL stage, beforeloading the next stage.
+
 if SPL_SPLASH_SCREEN
 
 config SPL_SPLASH_SCREEN_ALIGN
-- 
2.34.1



[PATCH V3 06/10] common: board_f: Pass frame buffer info from SPL to u-boot

2023-05-09 Thread Nikhil M Jain
When video is set up in SPL, U-Boot proper needs to use the correct
frame  buffer address to reserve particular location in memory, to avoid
displaying artifacts on the screen.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain 
---
V3 (patch introduced):
- Pass video buffer info from SPL to U-boot.

This patch depends on a patch sent by Simon Glass
https://lore.kernel.org/u-boot/20230504165823.v3.25.Ieb0824a81d8ad4109fa501c9497b01b8749f913a@changeid/

 common/board_f.c | 13 -
 drivers/video/video-uclass.c | 12 
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index f3c1ab53b1..432195f79e 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -411,7 +411,17 @@ __weak int arch_reserve_mmu(void)
 
 static int reserve_video(void)
 {
-   if (IS_ENABLED(CONFIG_VIDEO)) {
+#if (IS_ENABLED(CONFIG_VIDEO))
+   if (IS_ENABLED(CONFIG_SPL_VIDEO) && spl_phase() > PHASE_SPL &&
+   CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho));
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   video_reserve_from_blob(ho);
+   gd->relocaddr = ho->fb;
+   } else {
ulong addr;
int ret;
 
@@ -423,6 +433,7 @@ static int reserve_video(void)
  ((unsigned long)gd->relocaddr - addr) >> 10, addr);
gd->relocaddr = addr;
}
+#endif
 
return 0;
 }
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 1264ad1101..324216b0f5 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -6,12 +6,14 @@
 #define LOG_CATEGORY UCLASS_VIDEO
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -139,6 +141,16 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
  gd->video_top);
 
+   if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+   struct video_handoff *ho;
+
+   ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+   if (!ho)
+   return log_msg_ret("blf", -ENOENT);
+   ho->fb = *addrp;
+   ho->size = size;
+   }
+
return 0;
 }
 
-- 
2.34.1



[PATCH V3 05/10] include: video: Reserve video using blob

2023-05-09 Thread Nikhil M Jain
Add method to reserve video using blob.

Signed-off-by: Nikhil M Jain 
---
V3 (patch introduced):
- Add method to reserve video using blob.

This patch depends on a patch sent by Simon Glass
https://lore.kernel.org/u-boot/20230504165823.v3.25.Ieb0824a81d8ad4109fa501c9497b01b8749f913a@changeid/

 drivers/video/video-uclass.c | 12 
 include/video.h  |  9 +
 2 files changed, 21 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 8396bdfb11..1264ad1101 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -142,6 +142,18 @@ int video_reserve(ulong *addrp)
return 0;
 }
 
+int video_reserve_from_blob(struct video_handoff *ho)
+{
+#if CONFIG_IS_ENABLED(VIDEO)
+   gd->video_bottom = ho->fb;
+   gd->fb_base = ho->fb;
+   gd->video_top = ho->fb + ho->size;
+   debug("Reserving %luk for video using blob at: %08x\n",
+ ((unsigned long)ho->size) >> 10, (u32)ho->fb);
+#endif
+   return 0;
+}
+
 int video_fill(struct udevice *dev, u32 colour)
 {
struct video_priv *priv = dev_get_uclass_priv(dev);
diff --git a/include/video.h b/include/video.h
index 18ed159b8d..13460adc45 100644
--- a/include/video.h
+++ b/include/video.h
@@ -389,4 +389,13 @@ int bmp_display(ulong addr, int x, int y);
  */
 int bmp_info(ulong addr);
 
+/*
+ * video_reserve_from_blob()- Reserve frame-buffer memory for video devices
+ * using blobs.
+ *
+ * @ho: video information passed from SPL
+ * Returns: 0 (always)
+ */
+int video_reserve_from_blob(struct video_handoff *ho);
+
 #endif
-- 
2.34.1



[PATCH V3 04/10] board: ti: am62x: evm: Add necessary functions to call splash screen

2023-05-09 Thread Nikhil M Jain
To enable splash screen at SPL, call methods to reserve memory for video
and enable cache, and splash_display to display bmp image.

Signed-off-by: Nikhil M Jain 
---
V3:
- Remove function call for dram setup and set pagetable.
- Call splash display only if SPLASH_SCREEN is defined.

V2:
- No change.

 board/ti/am62x/evm.c | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 1b7b439cf5..22967bb1bc 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -59,6 +60,35 @@ int dram_init_banksize(void)
 }
 
 #if defined(CONFIG_SPL_BUILD)
+
+static int video_setup(void)
+{
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   ulong addr;
+   int ret;
+
+   addr = gd->relocaddr;
+   ret = video_reserve();
+   if (ret)
+   return ret;
+   debug("Reserving %luk for video at: %08lx\n",
+ ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+   gd->relocaddr = addr;
+   }
+
+   return 0;
+}
+
+void spl_board_init(void)
+{
+   if (CONFIG_IS_ENABLED(VIDEO)) {
+   video_setup();
+   enable_caches();
+   if (CONFIG_IS_ENABLED(SPLASH_SCREEN))
+   splash_display();
+   }
+}
+
 #if defined(CONFIG_K3_AM64_DDRSS)
 static void fixup_ddr_driver_for_ecc(struct spl_image_info *spl_image)
 {
-- 
2.34.1



  1   2   3   >