[PATCH] doc: rockchip: Clarify the rkspi image format further

Dragan Simic dsimic at manjaro.org
Sun Feb 11 15:21:33 CET 2024


Hello Johan,

On 2024-02-11 15:07, Johan Jonker wrote:
> On 2/10/24 19:18, Dragan Simic wrote:
>> As discussed on the U-Boot mailing list, [1][2] only some Rockchip 
>> SoCs
>> suffer from a bug in their BROMs that requires a specific format for 
>> their
> 
> This not a bug.
> 
>> SPI images, which was the reason for the rkspi format to be 
>> introduced.
>> 
>> Improve the description of the rkspi format a bit to mention this, for
>> future reference and to make understanding it easier.
>> 
>> [1] 
>> https://lore.kernel.org/u-boot/c32129ba-db25-4b9d-9a4a-032d88dfb9cd@kwiboo.se/
>> [2] 
>> https://lore.kernel.org/u-boot/CACdvmAjfCWicRd=LKKyob7fZo79AFkUQKy0e1HBb0zyJuoO70g@mail.gmail.com/
>> 
>> Signed-off-by: Dragan Simic <dsimic at manjaro.org>
>> ---
>>  doc/README.rockchip | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>> 
>> diff --git a/doc/README.rockchip b/doc/README.rockchip
>> index 84caff8a24d3..e0c5c395ec6a 100644
>> --- a/doc/README.rockchip
>> +++ b/doc/README.rockchip
>> @@ -649,7 +649,12 @@ sector is used. The header is the same as with 
>> rksd and the maximum size is
> 
>>  also 32KB (before spreading). The image should be written to the 
>> start of
>>  SPI flash.
>> 
> 
> On rk3066 an image should start before page address:
> NAND : 50
> SPI  : 13
> EMMC :  1
> 
> Not sure about start limits for other SoC's. (Kever ??)
> 
> Also rk3066 and rk3188 use RC4 crypto.
> 
>> -See above for instructions on how to write a SPI image.
>> +Only the BROMs of some Rockchip SoCs, such as the RK3399, suffer from 
>> a bug
>> +that mandates the above-described data spreading, thus requiring the 
>> rkspi
>> +format to be used for their SPI images. Rockchip SoCs that don't 
>> suffer
>> +from this bug use the rksd format for their SPI images.
>> +
> 
> This not a bug. It's a design choice to reuse the reading function in
> the boot ROM shared by EMMC, NAND and SPI etc. due to size
> restrictions.
> 
> See NAND example:
> https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/blob/master/drivers/block/rkmtd.c?ref_type=heads#L259
> 
> This NAND code also applies to SPI with minor tweaks.
> Code will never read more then 2k regardless of the page size.
> 
> ===
> This info must be written in a more neutral wording.(no bugs involved)
> Just describe the 2 formats and the SoC's that use it.

Thank you for the clarification!  I'll make sure to get the
wording adjusted to be more neutral.

> ===
> Extra:
> 
> Could someone cleanup README.rockchip
> The file README.rockchip has most building scenarios covered by now.
> Please have a look if all the boot log listing in that file are still
> needed or can be removed.

There's much more in README.rockchip that should be cleaned
up and refreshed a bit.  I'll convert the file into the RST
format and do a few cleanups.  After that, everyone will be
more than welcome to perform more cleanups.

> ===
> 
> Is there a need for SPI programmer code a la RKMTD with common base
> and block interface tools?
> 
> ===
> 
> Is someone able to extract rk3568 boot ROM code in order to study NAND
> boot behavior for a future RKMTD NFC V9 upgrade?
> 
>> +See the section above for instructions on how to write an SPI image.
>> 
>>  rkmux.py
>>  --------
>> 


More information about the U-Boot mailing list