linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Jon Loeliger <jdl@freescale.com>, linuxppc-dev@ozlabs.org
Subject: [3/3] dtc: -Odts produces v1 output
Date: Wed, 7 Nov 2007 11:17:37 +1100	[thread overview]
Message-ID: <20071107001737.GD553@localhost.localdomain> (raw)
In-Reply-To: <20071107001303.GA553@localhost.localdomain>

This patch alters the -Odts mode output so that it uses dts-v1 format.
This means that dtc -Idts -Odts used on a v0 dts file will convert
that file to v1.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

---
 treesource.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: dtc/treesource.c
===================================================================
--- dtc.orig/treesource.c	2007-11-07 11:16:45.000000000 +1100
+++ dtc/treesource.c	2007-11-07 11:16:55.000000000 +1100
@@ -141,7 +141,7 @@
 			l = l->next;
 		}
 
-		fprintf(f, "%x", be32_to_cpu(*cp++));
+		fprintf(f, "0x%x", be32_to_cpu(*cp++));
 		if ((void *)cp >= propend)
 			break;
 		fprintf(f, " ");
@@ -258,12 +258,14 @@
 {
 	struct reserve_info *re;
 
+	fprintf(f, "/dts-v1/;\n\n");
+
 	for (re = bi->reservelist; re; re = re->next) {
 		if (re->label)
 			fprintf(f, "%s: ", re->label);
-		fprintf(f, "/memreserve/\t%016llx-%016llx;\n",
+		fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n",
 			(unsigned long long)re->re.address,
-			(unsigned long long)(re->re.address + re->re.size - 1));
+			(unsigned long long)re->re.size);
 	}
 
 	write_tree_source_node(f, bi->dt, 0);

-- 
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-11-07  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  0:13 [0/3] Transition to C-style literals (cut the next) David Gibson
2007-11-07  0:16 ` [1/3] dtc: Simplify lexing/parsing of literals vs. node/property names David Gibson
2007-11-07  0:17 ` [2/3] dtc: Switch dtc to C-style literals David Gibson
2007-11-07  0:17 ` David Gibson [this message]

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=20071107001737.GD553@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=jdl@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    /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).