From: David Gibson <david@gibson.dropbear.id.au>
To: "Mark A. Greer" <mgreer@mvista.com>
Cc: linuxppc-dev <Linuxppc-dev@ozlabs.org>, Jon Loeliger <jdl@jdl.com>
Subject: Re: dtc: .quad asm directive generation
Date: Thu, 16 Mar 2006 13:05:00 +1100 [thread overview]
Message-ID: <20060316020500.GA17486@localhost.localdomain> (raw)
In-Reply-To: <20060316015924.GA32493@mag.az.mvista.com>
On Wed, Mar 15, 2006 at 06:59:24PM -0700, Mark A. Greer wrote:
> On Thu, Mar 16, 2006 at 11:49:48AM +1100, David Gibson wrote:
> > On Wed, Mar 15, 2006 at 05:00:59PM -0700, Mark A. Greer wrote:
> > > On Tue, Mar 14, 2006 at 06:06:57PM -0600, Jon Loeliger wrote:
> > > >
> > > > For 9 months nothing. Dave abdicates his DTC maintainer role to me.
> > >
> > > Jon,
> > >
> > > I can't find dtc under ~dgibson on ozlabs anymore. Do you have it
> > > somewhere now?
> >
> > Ah, bother. I did arrange for one of the old addresses of the tree to
> > keep working, but forgot that it wasn't the one which had been widely
> > announced. Just a minute, I'll send an announcement to the lists.
>
> Okay, thanks guys.
>
> Here is a patch that fixes a problem I'm having with asm output. My
> host system is a x86 box so its 32-bit, little endian.
>
> Disclaimer: Everything below is AFAICT.
>
> The problem is that asm_emit_cell() was swapping its asm output when
> it shouldn't be (because the assembler will do the necessary swapping).
> The cell values (asm_emit_cell()) are different from the data values
> (asm_emit_data()) because the cell values are generated within the
> program and don't get swapped like the data values read from the dts file.
> They should be left as they are so that the assembler will swap them,
> if necessary. For example, when the property length field was 4,
> the asm output contained ".long 0x4000000" and sent the kernel prom.c
> dt parsing code into the weeds.
>
> The dtb output is correct.
>
> Did any of that make sense?
Ah, yes, that be32_to_cpu() is, indeed, complete crap.
> /me knows he's rambling...
>
> Anyway, here is a simple patch the fixes it for me (i.e., the
> cross-assembled asm output matches the dtb).
>
> Mark
> ---
>
> diff -Nurp dtc/flattree.c dtc_new/flattree.c
> --- dtc/flattree.c 2006-02-24 10:57:56.000000000 -0700
> +++ dtc_new/flattree.c 2006-03-15 18:02:07.000000000 -0700
> @@ -121,7 +121,7 @@ static void asm_emit_cell(void *e, cell_
> {
> FILE *f = e;
>
> - fprintf(f, "\t.long\t0x%x\n", be32_to_cpu(val));
> + fprintf(f, "\t.long\t0x%x\n", val);
> }
>
> static void asm_emit_string(void *e, char *str, int len)
>
--
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
next prev parent reply other threads:[~2006-03-16 2:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-13 21:21 dtc: .quad asm directive generation Mark A. Greer
2006-03-14 3:31 ` David Gibson
2006-03-14 23:52 ` Mark A. Greer
2006-03-15 0:06 ` Jon Loeliger
2006-03-15 17:49 ` Mark A. Greer
2006-03-16 0:00 ` Mark A. Greer
2006-03-16 0:49 ` David Gibson
2006-03-16 1:59 ` Mark A. Greer
2006-03-16 2:05 ` David Gibson [this message]
2006-03-16 0:56 ` Stephen Rothwell
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=20060316020500.GA17486@localhost.localdomain \
--to=david@gibson.dropbear.id.au \
--cc=Linuxppc-dev@ozlabs.org \
--cc=jdl@jdl.com \
--cc=mgreer@mvista.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).