Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-12 Thread Peter Crosthwaite
On Fri, Jul 6, 2012 at 3:00 AM, Peter Maydell peter.mayd...@linaro.org wrote: Add support for reading device tree properties (both generic and single-cell ones) to QEMU's convenience wrapper layer. Signed-off-by: Peter Maydell peter.mayd...@linaro.org Reviewed-by: Peter A. G. Crosthwaite

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-10 Thread Peter Crosthwaite
On Sat, Jul 7, 2012 at 1:34 AM, Peter Maydell peter.mayd...@linaro.org wrote: On 6 July 2012 02:56, Peter Crosthwaite peter.crosthwa...@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

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-10 Thread Peter Maydell
On 10 July 2012 07:54, Peter Crosthwaite peter.crosthwa...@petalogix.com wrote: If user care about efficiency over safety, then your get_prop + cast + endian_swap approach will always be available to them. I just think a single idx arg at the end creates more options for users. We could vararg

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-10 Thread Peter Maydell
On 10 July 2012 07:54, Peter Crosthwaite peter.crosthwa...@petalogix.com wrote: Constantly bouncing back is safer however. If you hang on to an in-place pointer into the FDT (as returned by get_prop) and someone comes along and set_props() then your pointer is corrupted. Ive been snagged

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-06 Thread Peter Maydell
On 6 July 2012 02:56, Peter Crosthwaite peter.crosthwa...@petalogix.com wrote: On Fri, Jul 6, 2012 at 3:00 AM, Peter Maydell peter.mayd...@linaro.org wrote: +uint32_t qemu_devtree_getprop_cell(void *fdt, const char *node_path, + const char *property) Hi

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-06 Thread Peter Maydell
On 6 July 2012 02:56, Peter Crosthwaite peter.crosthwa...@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

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-06 Thread Peter Maydell
On 6 July 2012 16:34, Peter Maydell peter.mayd...@linaro.org wrote: 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? To answer my own question here, the dtb

[Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-05 Thread Peter Maydell
Add support for reading device tree properties (both generic and single-cell ones) to QEMU's convenience wrapper layer. Signed-off-by: Peter Maydell peter.mayd...@linaro.org --- device_tree.c | 30 ++ device_tree.h |4 2 files changed, 34 insertions(+), 0

Re: [Qemu-devel] [PATCH 4/6] device_tree: Add support for reading device tree properties

2012-07-05 Thread Peter Crosthwaite
On Fri, Jul 6, 2012 at 3:00 AM, Peter Maydell peter.mayd...@linaro.org wrote: Add support for reading device tree properties (both generic and single-cell ones) to QEMU's convenience wrapper layer. Signed-off-by: Peter Maydell peter.mayd...@linaro.org --- device_tree.c | 30