[sodaville] [PATCH 3/4] of/dtc: force dtb size to modulo 32 bytes

David Gibson david at gibson.dropbear.id.au
Sun Nov 14 11:44:09 EST 2010


On Fri, Nov 12, 2010 at 08:24:53AM -0800, Dirk Brandewie wrote:
> Hi David,
> On 11/11/2010 05:16 PM, David Gibson wrote:
> >On Thu, Nov 11, 2010 at 05:01:16PM -0800, Dirk Brandewie wrote:
[snip]
> >I also think this is the wrong place to do this.  scripts/dtc is a
> >mirror of copy of upstream dtc, designed for making dtb images for
> >general purposes.  I think the alignment should instead go into the
> >linker script fragments you generate to incbin the dtbs.
> 
> I was sleep deprived when I responded to HPA I thought he had
> replied to the patch modifying vmlinux.lds.h since we had talked
> about that file a fair amount. So my first response had little
> bearing on patch in question.
> 
> I am trying to solve two issues with this change.
> 
> The structure needs to be 32 byte aligned for the code in fdt.c to
> be able parse the blob.  You are right I can force this alignment in
> the assembly fragment.
> 
> The second issue is being able to parse the section in the kernel
> image to find each of the blobs that have been concatenated
> together.  If the DTB size is modulo 32 bytes I can use  blob =
> blob+be32_to_cpu(blob->totalsize) to find the next blob in the
> section and use that address directly to have fdt.c parse the blob.
> Otherwise I would need to search for the signature of the next blob
> somewhere past the end of the current blob which is knid of messy
> IMHO.

As hpa says you can just align your increment too, to find the next
blob.

> I have two questions,
> Do you think this acceptable if I made forcing the alignment a
> command line argument?

Um, sure.  It's not actually necessary for what you're doing here, but
it might have some use, I guess, and it's pretty non-invasive.  Your
posted patch for this, however, is broken, see my comments in reply,

> Where is the DTC git tree I should be delivering patches against?
> is git://www.jdl.com/software/dtc.git the correct tree?

That's right.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson


More information about the devicetree-discuss mailing list