Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: installboot(8) changes for installing u-boot directly to SPI flash (or other raw flash devices)



> On Sep 14, 2019, at 9:59 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
> 
> 
>> On Sep 14, 2019, at 3:07 AM, Tobias Nygren <tnn%NetBSD.org@localhost> wrote:
>> 
>> Hi,
>> 
>> It's a good addition.  A feature that might be useful is ability to
>> have a different input and output block size with option to insert
>> padding. The Rockchip SPI stage 1 loader has to have input block size
>> of 2kB and output block size of 4kB, i.e. 2kB blocks are interleaved
>> with 2kB of NUL bytes. In the U-Boot package I created a special file
>> with the padding built in, but if we can handle the padding from the
>> tool we can use the same image for both SD-card and SPI.
> 
> Oh, interesting.  This seems different even than the output block size that makes the flash happiest (my interpretation of the previous dd examples you and bouyer@ posted is that the obs you used was intended to line up with he flash erase unit size).
> 
> Let me think about how to handle this.

Ok, morning coffee has kicked in...  Perhaps:

* input-block-size -- Amount of data to read from the input file per iteration.  If specified, input-pad-size is also required.

* input-pad-size -- Amount of data to pad the input by.  Must be non-zero.  Padding is zeros, unless the preserve directive is also set, in which case it's read from the target device.  If specified, input-block-size is also required.

If both input-block-size and output-block-size are unspecified, they default to sectorsize.

If input-block-size is unspecified and output-block-size is specified, input-block-size = output-block-size.

If output-block-size is unspecified and input-block-size is specified, output-block-size = input-block-size.

Requirement: output-block-size >= (input-block-size + input-pad-size)

Requirement: output-block-size % (input-block-size + input-pad-size) == 0

I think that will cover it.  I'll play around with this later today.

-- thorpej



Home | Main Index | Thread Index | Old Index