[U-Boot] Questions on adding a new type to mkimage
Charles Manning
cdhmanning at gmail.com
Thu Feb 20 20:50:01 CET 2014
I am in the throes of extending mkimage to add socfpga support. This is my
first time in mkimage, so please forgive me being on a learning curve.
It seems that the most "normal" path for mkimage signers is to append some
sort of header to the front of the image
ie the flow is
write header out
copy image data with copy_file
call set_header
The socfpga preloader needs something a bit different. It does not add a
header, but instead adds a tail (CRC+padding) and mashes some bytes into a
known place in the image.
Unfortunately the mkimage framework does not seem to provide an "add tail"
function which is really what is needed here.
The only way I can see to extend the size of the image, using the normal
mkimage workflow would be to do something like this:
*Provide vrec_header which adds a fake header of 64k - input_size.
* Allow copy_file to then do the copy step.
* I now have a 64k "image" which is 64k-size 0 bytes, followed by the actual
input_data.
* When set_header is called, shift the actual input data to where it should
be, add the CRC and fix up the padding.
This seems needlessly contrived to work with the framework.
Or the alternative might be just to treat this as a special case....
Thoughts/opinions???
Thanks
Charles
More information about the U-Boot
mailing list