diff mbox series

[09/20] rockchip: mkimage: Add rk3576 support

Message ID 20241121142731.1202209-10-heiko@sntech.de
State New
Delegated to: Kever Yang
Headers show
Series Support for the RK3576 | expand

Commit Message

Heiko Stübner Nov. 21, 2024, 2:27 p.m. UTC
From: Xuhui Lin <xuhui.lin@rock-chips.com>

Add support for rk3576 package header in mkimage tool.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 tools/rkcommon.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Quentin Schulz Nov. 26, 2024, 4:53 p.m. UTC | #1
Hi Heiko,

On 11/21/24 3:27 PM, Heiko Stuebner wrote:
> From: Xuhui Lin <xuhui.lin@rock-chips.com>
> 
> Add support for rk3576 package header in mkimage tool.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>   tools/rkcommon.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> index 3e52236b15a..d89c7d3afea 100644
> --- a/tools/rkcommon.c
> +++ b/tools/rkcommon.c
> @@ -135,6 +135,7 @@ static struct spl_info spl_infos[] = {
>   	{ "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 },
>   	{ "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 },
>   	{ "rk3568", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 },
> +	{ "rk3576", "RK35", 0x80000 - 0x1000, false, RK_HEADER_V2 },

I don't understand why we remove 0x1000 here from the size of the SRAM.

If I go back in git history, I found 
915e09814a83128fee8b87b2ee2e5f4a17e04a01 which states it's total SRAM - 
size used by BootROM.

Can anyone provide feedback on how one is supposed to find this out? I 
think it's not the first time I'm confused by this and I'm not sure 
anyone's answered me before, but in any case, documenting this would be 
much welcome :)

The RK3576 does have 512KiB of SRAM so the base value before subtracting 
is fine :)

Cheers,
Quentin
Kever Yang Jan. 10, 2025, 12:54 a.m. UTC | #2
Hi Quentin,

On 2024/11/27 00:53, Quentin Schulz wrote:
> Hi Heiko,
>
> On 11/21/24 3:27 PM, Heiko Stuebner wrote:
>> From: Xuhui Lin <xuhui.lin@rock-chips.com>
>>
>> Add support for rk3576 package header in mkimage tool.
>>
>> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
>> ---
>>   tools/rkcommon.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
>> index 3e52236b15a..d89c7d3afea 100644
>> --- a/tools/rkcommon.c
>> +++ b/tools/rkcommon.c
>> @@ -135,6 +135,7 @@ static struct spl_info spl_infos[] = {
>>       { "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 },
>>       { "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 },
>>       { "rk3568", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 },
>> +    { "rk3576", "RK35", 0x80000 - 0x1000, false, RK_HEADER_V2 },
>
> I don't understand why we remove 0x1000 here from the size of the SRAM.
>
> If I go back in git history, I found 
> 915e09814a83128fee8b87b2ee2e5f4a17e04a01 which states it's total SRAM 
> - size used by BootROM.
>
> Can anyone provide feedback on how one is supposed to find this out? I 
> think it's not the first time I'm confused by this and I'm not sure 
> anyone's answered me before, but in any case, documenting this would 
> be much welcome :)
If you look this change at vendor U-Boot, you can find below commit msg:
"Sram total size is 512KB and 4KB is used as bootrom stack."
This size limit is for the first blob binary which is TPL/DDR init, and 
after running the DDR init,
we need to back to bootROM, so we should not touch the bootRom stack to 
keep the bootRom
available.

Thanks,
- Kever
>
> The RK3576 does have 512KiB of SRAM so the base value before 
> subtracting is fine :)
>
> Cheers,
> Quentin
>
Quentin Schulz Jan. 14, 2025, 4:43 p.m. UTC | #3
Hi Kever,

On 1/10/25 1:54 AM, Kever Yang wrote:
> Hi Quentin,
> 
> On 2024/11/27 00:53, Quentin Schulz wrote:
>> Hi Heiko,
>>
>> On 11/21/24 3:27 PM, Heiko Stuebner wrote:
>>> From: Xuhui Lin <xuhui.lin@rock-chips.com>
>>>
>>> Add support for rk3576 package header in mkimage tool.
>>>
>>> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
>>> ---
>>>   tools/rkcommon.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/tools/rkcommon.c b/tools/rkcommon.c
>>> index 3e52236b15a..d89c7d3afea 100644
>>> --- a/tools/rkcommon.c
>>> +++ b/tools/rkcommon.c
>>> @@ -135,6 +135,7 @@ static struct spl_info spl_infos[] = {
>>>       { "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 },
>>>       { "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 },
>>>       { "rk3568", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 },
>>> +    { "rk3576", "RK35", 0x80000 - 0x1000, false, RK_HEADER_V2 },
>>
>> I don't understand why we remove 0x1000 here from the size of the SRAM.
>>
>> If I go back in git history, I found 
>> 915e09814a83128fee8b87b2ee2e5f4a17e04a01 which states it's total SRAM 
>> - size used by BootROM.
>>
>> Can anyone provide feedback on how one is supposed to find this out? I 
>> think it's not the first time I'm confused by this and I'm not sure 
>> anyone's answered me before, but in any case, documenting this would 
>> be much welcome :)
> If you look this change at vendor U-Boot, you can find below commit msg:
> "Sram total size is 512KB and 4KB is used as bootrom stack."

Somehow this value changed for a couple of SoCs in vendor U-Boot so I'm 
not really trusting it ;)

> This size limit is for the first blob binary which is TPL/DDR init, and 
> after running the DDR init,
> we need to back to bootROM, so we should not touch the bootRom stack to 
> keep the bootRom
> available.
> 

Considering we don't have access to the source code of the BootROM, I 
assume we're in the case of "trust us the BootROM needs that much for 
its stack" and there's nothing we can do to verify it?

Cheers,
Quentin
diff mbox series

Patch

diff --git a/tools/rkcommon.c b/tools/rkcommon.c
index 3e52236b15a..d89c7d3afea 100644
--- a/tools/rkcommon.c
+++ b/tools/rkcommon.c
@@ -135,6 +135,7 @@  static struct spl_info spl_infos[] = {
 	{ "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 },
 	{ "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 },
 	{ "rk3568", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 },
+	{ "rk3576", "RK35", 0x80000 - 0x1000, false, RK_HEADER_V2 },
 	{ "rk3588", "RK35", 0x100000 - 0x1000, false, RK_HEADER_V2 },
 };