devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	jdl-ClAdetSTwOo@public.gmane.org,
	Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	Kim Phillips
	<kim.phillips-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	Kumar Gala
	<galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
	Benjamin Herrenschmidt
	<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH 2/2] libfdt: Add address translation functions
Date: Wed, 14 May 2014 14:22:56 +1000	[thread overview]
Message-ID: <20140514042256.GF28789@voom> (raw)
In-Reply-To: <CAL_Jsq+Lppxf7OHO1ekqpc7E+P8cMJcTOftZSd2TrN8kb4PQuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1906 bytes --]

On Mon, May 12, 2014 at 02:01:14PM -0500, Rob Herring wrote:
> On Mon, May 12, 2014 at 1:06 AM, David Gibson
> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> > Add the fdt_address_translate() function to process 'ranges' properties
> > to translate addresses from one bus to another.
> 
> Some trailing whitespace errors:
> 
> Applying: libfdt: Add address translation functions
> dtc/.git/rebase-apply/patch:87: trailing whitespace.
> 
> dtc/.git/rebase-apply/patch:208: trailing whitespace.
>  * @inbusoffset: offset of node which defines the address space of the input
> dtc/.git/rebase-apply/patch:342: trailing whitespace.
> 
> warning: 3 lines add whitespace errors.

Oops.  Not sure how I missed those.

> [...]
> 
> 
> > +int fdt_address_translate(const void *fdt,
> > +                         int inbusoffset, const fdt32_t *inaddr,
> > +                         int outbusoffset, fdt32_t *outaddr)
> 
> The translated address in native endian would be more useful, but more
> importantly how does one determine the translated address size needed
> to convert it? I don't see any reason for the caller to have the
> outaddr in be32. While in theory you could need something larger than
> a uint64_t, the reality is any >2 cell case is broken anyway.

The output isn't necessarily representable in any simple type
(e.g. translating from an ISA bus to a parent PCI bus - output is 3
cells).

I'm certainly thinking helper functions to translate simple 1 and 2
cell addresses to native integers, but this function is intended to
strictly translate between one device tree address representation and
another device tree address representation.

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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2014-05-14  4:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12  6:06 [PATCH 1/2] libfdt: Add helpers to read #address-cells and #size-cells David Gibson
     [not found] ` <1399874771-23089-1-git-send-email-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2014-05-12  6:06   ` [PATCH 2/2] libfdt: Add address translation functions David Gibson
     [not found]     ` <1399874771-23089-2-git-send-email-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2014-05-12 19:01       ` Rob Herring
     [not found]         ` <CAL_Jsq+Lppxf7OHO1ekqpc7E+P8cMJcTOftZSd2TrN8kb4PQuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-14  4:22           ` 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=20140514042256.GF28789@voom \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=jdl-ClAdetSTwOo@public.gmane.org \
    --cc=kim.phillips-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.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).