[U-Boot-Users] Testing todays u-boot-fdt

Jerry Van Baren gvb.uboot at gmail.com
Mon Apr 23 02:05:25 CEST 2007


Timur Tabi wrote:
> Jerry Van Baren wrote:
> 
>> The bad version error is because you are running a version 16 blob and 
>> you need a version 17 blob to allow modifications. 
> 
> Why?  U-Boot was able to modify v16 blobs, why can't libfdt do the same?

Hi Timur,

It had very limited capabilities: it "modified" the blob by creating a 
new blob, copying the old stuff to the new blob, and then adding the 
"chosen" node.  For some values, it rewrote values in place but was 
unable to create new properties or nodes.  Switching to libfdt and 
insisting on having a v17 blob (with spare space) totally removes those 
limitations.

libfdt allows modifying the blob in place, but only if it is v17.  I've 
taken advantage of this.  libfdt actually has four sets of capabilities:
1) Read-only
2) Write sequentially (effectively what was done previously)
3) Write in place (modifying pre-existing values - also previous)
4) Full featured write (requires v17 and available space)

I've implemented write/modifies using the full write capabilities 
because it is the simplest for implementing the fdt command and most 
flexible by far (doing a write modifies the value or creates it if it 
doesn't exist).

An improvment to the "set" command would be to do a write in place if 
the full featured write failed (i.e. not a v17 blob or no space left). 
Patches are welcome.  ;-)

Best regards,
gvb




More information about the U-Boot mailing list