From: Peter Maydell <peter.maydell@linaro.org>
To: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
Cc: qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties
Date: Fri, 6 Jul 2012 16:34:08 +0100 [thread overview]
Message-ID: <CAFEAcA-DmcZN_V_Sdhw-r-JRkpa609X7dqLDVk0WiLyHL_ae_Q@mail.gmail.com> (raw)
In-Reply-To: <CAEgOgz5+ysAbCE+zfEjaLPyNu8VnxjN6-i5C=+MWRyz1q4O86A@mail.gmail.com>
On 6 July 2012 02:56, Peter Crosthwaite <peter.crosthwaite@petalogix.com> wrote:
> Can we generalise and get functionality for reading cells with offsets
> as well? Your function assumes (and asserts) that the property is a
> single cell, but can we add a index parameter for reading a non-0th
> property out of a multi-cell prop? Needed for reading things like
> ranges, regs and interrupt properties.
I was playing about with this and I'm really not sure that we should
be providing a "read a single u32 from a u32 array property" at the
device_tree.c layer. For example, for handling the ranges property
what you really want to do is treat it as a list of tuples (including
doing something sensible if it doesn't have the right length to be
a complete list), so the code that knows the structure of the ranges
property is better off calling qemu_devtree_getprop to get a uint32_t*
for the whole array. Then it has the whole thing as a straightforward
C array which will be much easier and more efficient to handle than
constantly bouncing back into the fdt layer to read each uint32_t.
I've also just realised that I'm assuming that the pointer returned
by fdt_getprop() is naturally aligned for a 32 bit integer if the
property is a 32 bit integer -- is that valid?
-- PMM
next prev parent reply other threads:[~2012-07-06 15:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-05 17:00 [Qemu-devel] [PATCH 0/6] arm_boot/vexpress-a15: Support >4GB of RAM Peter Maydell
2012-07-05 17:00 ` [Qemu-devel] [PATCH 1/6] hw/arm_boot.c: Make ram_size a target_phys_addr_t Peter Maydell
2012-07-06 1:58 ` Peter Crosthwaite
2012-07-06 13:48 ` Andreas Färber
2012-07-06 13:54 ` Alexander Graf
2012-07-06 14:02 ` Andreas Färber
2012-07-06 14:04 ` Peter Maydell
2012-07-05 17:00 ` [Qemu-devel] [PATCH 2/6] hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct Peter Maydell
2012-07-06 2:00 ` Peter Crosthwaite
2012-07-06 7:23 ` Peter Maydell
2012-07-05 17:00 ` [Qemu-devel] [PATCH 3/6] hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity Peter Maydell
2012-07-06 2:05 ` Peter Crosthwaite
2012-07-06 7:25 ` Peter Maydell
2012-07-05 17:00 ` [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties Peter Maydell
2012-07-06 1:56 ` Peter Crosthwaite
2012-07-06 7:18 ` Peter Maydell
2012-07-06 15:34 ` Peter Maydell [this message]
2012-07-06 15:44 ` Peter Maydell
2012-07-10 6:54 ` Peter Crosthwaite
2012-07-10 7:52 ` Peter Maydell
2012-07-10 13:03 ` Peter Maydell
2012-07-13 1:24 ` Peter Crosthwaite
2012-07-05 17:00 ` [Qemu-devel] [PATCH 5/6] hw/arm_boot.c: Support DTBs which use 64 bit addresses Peter Maydell
2012-07-05 18:53 ` Blue Swirl
2012-07-05 19:26 ` Peter Maydell
2012-07-06 2:19 ` Peter Crosthwaite
2012-07-05 17:00 ` [Qemu-devel] [PATCH 6/6] hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard Peter Maydell
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=CAFEAcA-DmcZN_V_Sdhw-r-JRkpa609X7dqLDVk0WiLyHL_ae_Q@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=peter.crosthwaite@petalogix.com \
--cc=qemu-devel@nongnu.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).