From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
Cc: Benjamin Fair <b-fair-l0cyMroinI0@public.gmane.org>,
Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>,
Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
danh-arm <dan.handley-5wv7dgnIgG8@public.gmane.org>
Subject: Re: [PATCH] libfdt: add helpers to read address and size from reg
Date: Tue, 22 Nov 2016 14:40:26 +1100 [thread overview]
Message-ID: <20161122034026.GD28479@umbus.fritz.box> (raw)
In-Reply-To: <8730ced3-41c1-e515-ff93-6f719abb5800-l0cyMroinI0@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2951 bytes --]
On Fri, Nov 18, 2016 at 12:05:48PM -0600, Nishanth Menon wrote:
> On 11/18/2016 11:37 AM, Benjamin Fair wrote:
> > On 11/09/2016 10:58 AM, Benjamin Fair wrote:
> > > This patch extends the capability of libfdt to parse the contents of device
> > > trees in a similar manner to fdt_address_cells and fdt_size_cells.
> > >
> > > It adds a helper function which reads the address and size of a device from
> > > the reg property and performs basic sanity checks.
> > >
> > > It does not perform translation to a physical address using the ranges
> > > properties of parents, but this enhancement may be added as a separate
> > > function in the future.
> > >
> > > Signed-off-by: Benjamin Fair <b-fair-l0cyMroinI0@public.gmane.org>
> > > ---
> > >
> > > The intent of this patch is similar to the commit "libfdt: Add helpers to read
> > > #address-cells and #size-cells" [1].
> > >
> > > It is related to "libfdt: add address translation support" [2] but does not
> > > attempt to perform address translation and was written from scratch rather than
> > > reusing GPL code. If the issues with that patch are resolved, that
> > > functionality will complement what is added in this patch.
> > >
> > >
> > > libfdt/fdt_addresses.c | 62 ++++++++++++++++++++++++++++++++++++++++++
> > > libfdt/libfdt.h | 29 ++++++++++++++++++++
> > > libfdt/version.lds | 1 +
> > > tests/.gitignore | 1 +
> > > tests/Makefile.tests | 2 +-
> > > tests/addr_size.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++
> > > tests/addresses.dts | 11 ++++++++
> > > tests/run_tests.sh | 1 +
> > > 8 files changed, 180 insertions(+), 1 deletion(-)
> > > create mode 100644 tests/addr_size.c
>
> I think in a lot of places this simple translation of DT can easily be
> benefiting.
>
> [1] http://www.spinics.net/lists/devicetree-compiler/msg00113.html
> [2] http://www.spinics.net/lists/devicetree-compiler/msg00093.html
>
> Rob, David,
>
> The motivation started off by wanting to have a better integration of libfdt
> and dt support in ATF[2] - and basic stuff is to be able to read address
> from a node - not that we could'nt do something similar as a ATF specific
> library... but common might be better for all of libfdt users, no?
>
> Do you folks have a suggestion as to what might be a better direction to
> take here?
Sorry, I don't really follow what the question is.
>
> Original patch for reference (since my google-fu failed to be able to find a
> devicetree-compiler patchworks)[1]:
>
> [1] http://www.spinics.net/lists/devicetree-compiler/msg00844.html
> [2] https://github.com/ARM-software/arm-trusted-firmware/pull/747#issuecomment-259727132
--
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: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-11-22 3:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 16:58 [PATCH] libfdt: add helpers to read address and size from reg Benjamin Fair
[not found] ` <1478710712-25010-1-git-send-email-b-fair-l0cyMroinI0@public.gmane.org>
2016-11-18 17:37 ` Benjamin Fair
[not found] ` <99dd8a63-19bb-0d06-8bc2-f2ad575ca2cb-l0cyMroinI0@public.gmane.org>
2016-11-18 18:05 ` Nishanth Menon
[not found] ` <8730ced3-41c1-e515-ff93-6f719abb5800-l0cyMroinI0@public.gmane.org>
2016-11-22 3:40 ` David Gibson [this message]
2016-11-22 3:39 ` David Gibson
2016-11-25 10:51 ` David Gibson
[not found] ` <20161125105125.GJ12287-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2016-11-30 19:35 ` Benjamin Fair
[not found] ` <2f744a7f-5112-c83e-d47a-ce9fef491dde-l0cyMroinI0@public.gmane.org>
2016-12-02 3:12 ` David Gibson
[not found] ` <20161202031256.GB10089-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2016-12-05 17:46 ` Benjamin Fair
[not found] ` <c0553cfe-b902-8fa7-e2fc-dafc0523d4b2-l0cyMroinI0@public.gmane.org>
2016-12-05 21:46 ` David Gibson
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=20161122034026.GD28479@umbus.fritz.box \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=b-fair-l0cyMroinI0@public.gmane.org \
--cc=dan.handley-5wv7dgnIgG8@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jdl-CYoMK+44s/E@public.gmane.org \
--cc=nm-l0cyMroinI0@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@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).