diff mbox

[U-Boot,RFC,5/5] rockchip: mkimage: use spl_boot0 for all Rockchip SoCs

Message ID 1496227840-19007-6-git-send-email-kever.yang@rock-chips.com
State Changes Requested
Delegated to: Philipp Tomsich
Headers show

Commit Message

Kever Yang May 31, 2017, 10:50 a.m. UTC
Enable the spl_boot0 in SPL and use the pre-padding TAG memory,
the mkimage do not need to pad it but only need to replace the value
with correct TAG value.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 tools/rkcommon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Philipp Tomsich May 31, 2017, 10:58 a.m. UTC | #1
Now that there are no remaining cases where (spl_boot0 == false), we can
drop the spl_boot0 field from struct spl_info and also remove the if-check
(leaving only the code-path for true in place).

There should be no need to keep the legacy code-path around, as GIT will
always remember them anyway.

Regards,
Philipp.

> On 31 May 2017, at 12:50, Kever Yang <kever.yang@rock-chips.com> wrote:
> 
> Enable the spl_boot0 in SPL and use the pre-padding TAG memory,
> the mkimage do not need to pad it but only need to replace the value
> with correct TAG value.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
> tools/rkcommon.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> index 836a5a5..b58dfae 100644
> --- a/tools/rkcommon.c
> +++ b/tools/rkcommon.c
> @@ -68,10 +68,10 @@ struct spl_info {
> };
> 
> static struct spl_info spl_infos[] = {
> -	{ "rk3036", "RK30", 0x1000, false, false },
> -	{ "rk3188", "RK31", 0x8000 - 0x800, true, false },
> -	{ "rk3288", "RK32", 0x8000, false, false },
> -	{ "rk3328", "RK32", 0x8000 - 0x1000, false, false },
> +	{ "rk3036", "RK30", 0x1000, false, true },
> +	{ "rk3188", "RK31", 0x8000 - 0x800, true, true },
> +	{ "rk3288", "RK32", 0x8000, false, true },
> +	{ "rk3328", "RK32", 0x8000 - 0x1000, false, true },
> 	{ "rk3399", "RK33", 0x20000, false, true },
> };
> 
> -- 
> 1.9.1
>
Andyshrk June 1, 2017, 1:11 a.m. UTC | #2
Hi Philipp:

2017-05-31 18:58 GMT+08:00 Dr. Philipp Tomsich <
philipp.tomsich@theobroma-systems.com>:

> Now that there are no remaining cases where (spl_boot0 == false), we can
> drop the spl_boot0 field from struct spl_info and also remove the if-check
> (leaving only the code-path for true in place).
>
>

  I think we still have one case: use mkimage to pack ddr.bin  from
rockchip as spl.bin.



> There should be no need to keep the legacy code-path around, as GIT will
> always remember them anyway.
>
> Regards,
> Philipp.
>
> > On 31 May 2017, at 12:50, Kever Yang <kever.yang@rock-chips.com> wrote:
> >
> > Enable the spl_boot0 in SPL and use the pre-padding TAG memory,
> > the mkimage do not need to pad it but only need to replace the value
> > with correct TAG value.
> >
> > Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> > ---
> >
> > tools/rkcommon.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> > index 836a5a5..b58dfae 100644
> > --- a/tools/rkcommon.c
> > +++ b/tools/rkcommon.c
> > @@ -68,10 +68,10 @@ struct spl_info {
> > };
> >
> > static struct spl_info spl_infos[] = {
> > -     { "rk3036", "RK30", 0x1000, false, false },
> > -     { "rk3188", "RK31", 0x8000 - 0x800, true, false },
> > -     { "rk3288", "RK32", 0x8000, false, false },
> > -     { "rk3328", "RK32", 0x8000 - 0x1000, false, false },
> > +     { "rk3036", "RK30", 0x1000, false, true },
> > +     { "rk3188", "RK31", 0x8000 - 0x800, true, true },
> > +     { "rk3288", "RK32", 0x8000, false, true },
> > +     { "rk3328", "RK32", 0x8000 - 0x1000, false, true },
> >       { "rk3399", "RK33", 0x20000, false, true },
> > };
> >
> > --
> > 1.9.1
> >
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>
Philipp Tomsich June 1, 2017, 7:41 a.m. UTC | #3
> On 01 Jun 2017, at 03:11, Andy Yan <andyshrk@gmail.com> wrote:
> 
> Hi Philipp:
> 
> 2017-05-31 18:58 GMT+08:00 Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com>:
> Now that there are no remaining cases where (spl_boot0 == false), we can
> drop the spl_boot0 field from struct spl_info and also remove the if-check
> (leaving only the code-path for true in place).
> 
> 
> 
>   I think we still have one case: use mkimage to pack ddr.bin  from rockchip as spl.bin.

Excellent point! I completely missed that use-case.

However, then we’d need to implement support (an additional commandline flag?) for
communicating this into mkimage: with the current state of the code, the new code path
(i.e. assuming its a pre-padded image) will be always be taken and ddr.bin can’t be processed.

The alternative would be to clearly document that a ddr.bin needs to be prepadded and then
pad the ddr.bin manually before passing it to mkimage.

I have no preference either way, but would recommend/request that if we leave the code-path
in, then there should be a way to invoke it.

Best regards,
Philipp.
Kever Yang June 2, 2017, 1:09 a.m. UTC | #4
Philipp and Andy,


I will remove the "spl_boot0 == false" case in next version.

Rockchip ddr.bin is always with pre-paded TAG.

Thanks,
- Kever
On 06/01/2017 03:41 PM, Dr. Philipp Tomsich wrote:
>> On 01 Jun 2017, at 03:11, Andy Yan <andyshrk@gmail.com> wrote:
>>
>> Hi Philipp:
>>
>> 2017-05-31 18:58 GMT+08:00 Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com>:
>> Now that there are no remaining cases where (spl_boot0 == false), we can
>> drop the spl_boot0 field from struct spl_info and also remove the if-check
>> (leaving only the code-path for true in place).
>>
>>
>>
>>    I think we still have one case: use mkimage to pack ddr.bin  from rockchip as spl.bin.
> Excellent point! I completely missed that use-case.
>
> However, then we’d need to implement support (an additional commandline flag?) for
> communicating this into mkimage: with the current state of the code, the new code path
> (i.e. assuming its a pre-padded image) will be always be taken and ddr.bin can’t be processed.
>
> The alternative would be to clearly document that a ddr.bin needs to be prepadded and then
> pad the ddr.bin manually before passing it to mkimage.
>
> I have no preference either way, but would recommend/request that if we leave the code-path
> in, then there should be a way to invoke it.
>
> Best regards,
> Philipp.
>
>
diff mbox

Patch

diff --git a/tools/rkcommon.c b/tools/rkcommon.c
index 836a5a5..b58dfae 100644
--- a/tools/rkcommon.c
+++ b/tools/rkcommon.c
@@ -68,10 +68,10 @@  struct spl_info {
 };
 
 static struct spl_info spl_infos[] = {
-	{ "rk3036", "RK30", 0x1000, false, false },
-	{ "rk3188", "RK31", 0x8000 - 0x800, true, false },
-	{ "rk3288", "RK32", 0x8000, false, false },
-	{ "rk3328", "RK32", 0x8000 - 0x1000, false, false },
+	{ "rk3036", "RK30", 0x1000, false, true },
+	{ "rk3188", "RK31", 0x8000 - 0x800, true, true },
+	{ "rk3288", "RK32", 0x8000, false, true },
+	{ "rk3328", "RK32", 0x8000 - 0x1000, false, true },
 	{ "rk3399", "RK33", 0x20000, false, true },
 };