linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Jerry Van Baren <gvb.uboot@gmail.com>
Cc: Linuxppc-dev@ozlabs.org
Subject: Re: [PATCH dtc] Implement the -R option and add a -S option.
Date: Sun, 15 Apr 2007 10:42:29 +1000	[thread overview]
Message-ID: <20070415004229.GD9104@localhost.localdomain> (raw)
In-Reply-To: <4620D009.1000800@gmail.com>

On Sat, Apr 14, 2007 at 08:58:49AM -0400, Jerry Van Baren wrote:
> David Gibson wrote:
> > On Thu, Apr 05, 2007 at 01:10:40PM -0400, Jerry Van Baren wrote:
> >> Scott Wood wrote:
> >>> On Wed, Apr 04, 2007 at 10:04:33PM -0400, Jerry Van Baren wrote:
> >>>> Implement the -R <number> option to add memory reserve slots.
> >>>> Add a -S <size> option makes the blob at least this number of bytes.
> >>> Wouldn't it be better to just specify the amount of extra space, instead
> >>> of the minimum total space?  That way, you only need to know what you
> >>> intend to add, not how much is already there.
> >>>
> >>> -Scott
> >> I thought briefly about this, but decided to implement a fixed size so 
> >> that someone could allocate, say, 8K of memory in their memory map 
> >> (likely flash) and know their blob would fit.
> >>
> >> Maybe we need a little -s option to say "add -s bytes".
> > 
> > I think having both options would be a good idea.  It would also be
> > nice to have options to do this from the dts file (something similar
> > to /memreserve/).
> > 
> >> Jon suggested a --stats option to print out the important statistics. 
> >> That would also be a good enhancement.
> > 
> > Ok.  How would you envisage this working?
> > 
> > I've thought for some time that it would be a good idea to add an
> > "info" output mode.  In that mode instead of outputting a converted
> > device tree, it would give various bits of info on the input tree.
> > This would include things like the header field debugging information
> > that's currently output as pseudo-error messages when using dtb input.
> > 
> > I'm not sure to what extent your "--stats" idea would overlap with
> > that.
> 
> Hi David,
> 
> Well, that was Jon's suggestion/idea so I have not thought about it 
> much.  It would probably overlap 100% with your --info idea, with the 
> exception that Jon's suggestion would also put out the blob.

Well, my idea wasn't a new --info but rather "-O info", if that
distinction makes sense.

> Since the dtc puts out the blob to sdtout, this actually is problematic. 
>   I presume that is why you suggest inhibiting output.  Using stderr 
> would sorta bypass that problem, but is not ideal (IMHO).

Yes, that's more or less precisely my reasoning.

> Is there any reason we don't have a -o option to direct the compiled 
> blob output to a file?  Since the usual use is to write to a file, it 
> would free up stdout for (info/stats) outputs.

We do have a -o option...

> On an unrelated related note, I don't believe my -R additions are 
> actually putting out additional reserve map slots (easiest to see using 
> the asm format output).  I'm still trying to understand why not, it 
> seemed pretty straight-forward.  When I implemented it, I was looking at 
> hexdumps of the dtb binary format and looking at the header and thought 
> I had it working... using it with my u-boot mods shows no extra reserved 
> slots.  I'm looking into where I went wrong.

Be careful to check the actual offsets.  Bear in mind that objdump may
elide zero words.  Also bear in mind that the only way a reader of the
device tree has of counting the number of reserve entries is stepping
through until it hits the terminating (0,0), so the extra entries will
just look like an early termination of the list.  In this sense -R
doesn't add "extra slots", but just ensures that there is space after
the reserve map to add more entries.

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

  parent reply	other threads:[~2007-04-15  0:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05  2:04 [PATCH dtc] Implement the -R option and add a -S option Jerry Van Baren
2007-04-05 15:03 ` Jon Loeliger
2007-04-05 15:17   ` Jerry Van Baren
2007-04-05 16:11 ` Scott Wood
2007-04-05 17:10   ` Jerry Van Baren
2007-04-12  6:51     ` David Gibson
2007-04-14 12:58       ` Jerry Van Baren
2007-04-14 16:43         ` Jerry Van Baren
2007-04-15  0:42         ` David Gibson [this message]
2007-04-15  2:13           ` Jerry Van Baren
2007-04-15  2:22             ` David Gibson
2007-04-15  2:41               ` Jerry Van Baren
  -- strict thread matches above, loose matches on Subject: below --
2007-04-05  2:29 [PATCH: " Jerry Van Baren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070415004229.GD9104@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=gvb.uboot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).