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).

Ok, I've updated the diff:

	https://github.com/thorpej/netbsd-src/pull/30/files

It now includes the input-block-size and input-pad-size directives I proposed to address the RockChip SPI loader's needs.  You'd use it like so:

                <key>u-boot-install-spi</key>
                <array>
                        <dict>
                                <key>file-name</key>
                                <string>u-boot-sunxi-with-spl.bin</string>
                                <key>output-size</key>
                                <integer>2097152</integer>
                                <key>output-block-size</key>
                                <integer>65536</integer>
                                <key>input-block-size</key>
                                <integer>2048</integer>
                                <key>input-pad-size</key>
                                <integer>2048</integer>
                        </dict>
                </array>

...and the verbose mode output looks like this:

Board: <some random example>
Max u-boot offset (rounded): 422245 (422400)
First free block available for file systems: 825 (0x339)
Writing 'u-boot-sunxi-with-spl.bin' 422245 to '/Users/thorpej/dummy.img' @ 0
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 0)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 2048)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 4096)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 6144)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 8192)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 10240)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 12288)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 14336)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 16384)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 18432)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 20480)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 22528)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 24576)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 26624)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 28672)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 30720)
(Writing '/Users/thorpej/dummy.img' -- 65536 @ 0)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 32768)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 34816)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 36864)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 38912)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 40960)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 43008)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 45056)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 47104)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 49152)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 51200)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 53248)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 55296)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 57344)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 59392)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 61440)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 63488)
(Writing '/Users/thorpej/dummy.img' -- 65536 @ 65536)
.
.
.
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 393216)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 395264)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 397312)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 399360)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 401408)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 403456)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 405504)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 407552)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 409600)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 411648)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 413696)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 415744)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 417792)
(Reading 'u-boot-sunxi-with-spl.bin' -- 2048 @ 419840)
(Reading 'u-boot-sunxi-with-spl.bin' -- 357 @ 421888)
(Writing '/Users/thorpej/dummy.img' -- 65536 @ 786432)
(Writing '/Users/thorpej/dummy.img' -- 65536 @ 851968)
(Writing '/Users/thorpej/dummy.img' -- 65536 @ 917504)
.
.
.
(Writing '/Users/thorpej/dummy.img' -- 65536 @ 1966080)
(Writing '/Users/thorpej/dummy.img' -- 65536 @ 2031616)

-- thorpej



Home | Main Index | Thread Index | Old Index