[PATCH]: cmd: part: add part block command

Tom Rini trini at konsulko.com
Tue Jun 2 20:51:23 CEST 2020


On Tue, Jun 02, 2020 at 11:36:48AM -0700, razvan becheriu wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> here is the implementation of the functions:
> 
> # function ota_conv_sizes
> # Convert a bytes size to a block size
> # input  bytesize : size in bytes to convert
> # input  blksize  : size of a block in bytes
> # output num_blk  : converted size in blocks
> setenv ota_conv_sizes 'setexpr num_blk $bytesize / $blksize ; setexpr
> mod_blk $bytesize % $blksize ; if itest $mod_blk > 0 ; then setexpr num_blk
> $num_blk + 1; fi;'
> 
> # function ota_mmc_write
> # Write a memory buffer to mmc drive
> # input floadaddr    : address of buffer to write
> # input u_part_start : block start in mmc
> # input num_blk      : number of block to write
> setenv ota_mmc_write 'if itest $ota_verbose == 1 ; then echo "mmc write
> ${floadaddr} ${u_part_start} ${num_blk};"; fi; mmc write $floadaddr
> $u_part_start $num_blk; ret=$?; if itest $ret != 0 ; then setenv
> ota_abort_reason "mmc write ${floadaddr} ${u_part_start} ${num_blk}
> failed"; setenv ota_abort 1; fi;'
> 
> the old u-boot version supported 'part info mmc 0:${u_part_num}
> u_part_start u_part_sz u_part_blksz;' to get the block size.

Old upstream U-Boot?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/cac556f5/attachment.sig>


More information about the U-Boot mailing list