From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur3vQ-0004ck-Rt for qemu-devel@nongnu.org; Mon, 24 Jun 2013 06:23:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ur3vO-0007bM-6H for qemu-devel@nongnu.org; Mon, 24 Jun 2013 06:23:08 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:58047 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur3vN-0007Zx-W9 for qemu-devel@nongnu.org; Mon, 24 Jun 2013 06:23:06 -0400 From: Peter Maydell Date: Mon, 24 Jun 2013 11:22:54 +0100 Message-Id: <1372069376-30640-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 0/2] device_tree: add qemu_devtree_setprop_sized_cells() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , David Gibson , Alexander Graf , patches@linaro.org These patches add a new function qemu_devtree_setprop_sized_cells() to device_tree.c and use it in arm/boot.c. We already have a qemu_devtree_setprop_cells() which sets a dtb property to an array of cells whose values are specified by varargs. However for the fairly common case of setting a property to a list of addresses or of address,size pairs the number of cells used by each element in the list depends on the parent's #address-cells and #size-cells properties. To make this easier we provide an analogous qemu_devtree_setprop_sized_cells() function which allows the number of cells used by each element to be specified. The arm/boot.c use is fairly straightforward; I also have some virtio related patches brewing which are going to need to use this to set their 'regs' property values. I figured it was probably better to send this out for review now rather than wait for those, though. The arm/boot bit of the patch depends (textually at least) on http://patchwork.ozlabs.org/patch/251377/ (arm/boot: Free dtb blob memory after use); it will apply cleanly to git://git.linaro.org/people/pmaydell/qemu-arm.git arm-devs.next. Peter Maydell (2): device_tree: Add qemu_devtree_setprop_sized_cells() utility function arm/boot: Use qemu_devtree_setprop_sized_cells() device_tree.c | 48 ++++++++++++++++++++++++++++++++++++++++++ hw/arm/boot.c | 28 ++++++------------------ include/sysemu/device_tree.h | 29 +++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 21 deletions(-) -- 1.7.9.5