[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 22/25] PPC: e500: dt: use 64bit cell helper
From: |
Scott Wood |
Subject: |
Re: [Qemu-ppc] [PATCH 22/25] PPC: e500: dt: use 64bit cell helper |
Date: |
Thu, 31 May 2012 17:15:07 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 05/30/2012 06:00 AM, Alexander Graf wrote:
> We have a nice 64bit helper to ease the device tree generation and
> make the code more readable when creating 64bit 2-cell parameters.
> Use it when generating the device tree.
>
> Signed-off-by: Alexander Graf <address@hidden>
> ---
> hw/ppce500_mpc8544ds.c | 10 ++++------
> 1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
> index 2069891..32fbdd3 100644
> --- a/hw/ppce500_mpc8544ds.c
> +++ b/hw/ppce500_mpc8544ds.c
> @@ -91,7 +91,6 @@ static int mpc8544_load_device_tree(CPUPPCState *env,
> const char *kernel_cmdline)
> {
> int ret = -1;
> - uint32_t mem_reg_property[] = {0, cpu_to_be32(ramsize)};
> int fdt_size;
> void *fdt;
> uint8_t hypercall[16];
> @@ -128,8 +127,7 @@ static int mpc8544_load_device_tree(CPUPPCState *env,
>
> qemu_devtree_add_subnode(fdt, "/memory");
> qemu_devtree_setprop_string(fdt, "/memory", "device_type", "memory");
> - qemu_devtree_setprop(fdt, "/memory", "reg", mem_reg_property,
> - sizeof(mem_reg_property));
> + qemu_devtree_setprop_cell64(fdt, "/memory", "reg", ramsize);
The reg property is supposed to contain an address and a size, not just
size. You're getting away with this because address happens to be zero
and you happen to be writing a 64-bit size into a device tree that
expects a 32-bit address followed by a 32-bit size (which should be
changed to expect 64-bit of both).
-Scott
- [Qemu-ppc] [PATCH 05/25] dt: add helper for phandle enumeration, (continued)
- [Qemu-ppc] [PATCH 05/25] dt: add helper for phandle enumeration, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 08/25] dt: add helper for 64bit cell adds, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 10/25] PPC: e500: dt: create memory node dynamically, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 13/25] PPC: e500: dt: create / node dynamically, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 02/25] dt: add helpers for 2, 3 and 4 cell adds, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 12/25] PPC: e500: dt: create /hypervisor node dynamically, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 24/25] PPC: e500: enable manual loading of dtb blob, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 14/25] PPC: e500: dt: create /chosen node dynamically, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 22/25] PPC: e500: dt: use 64bit cell helper, Alexander Graf, 2012/05/30
- Re: [Qemu-ppc] [PATCH 22/25] PPC: e500: dt: use 64bit cell helper,
Scott Wood <=
- [Qemu-ppc] [PATCH 15/25] PPC: e500: dt: create /soc8544 node dynamically, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 20/25] PPC: e500: dt: start with empty device tree, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 07/25] dt: add helper for phandle allocation, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 11/25] PPC: e500: dt: create /cpus node dynamically, Alexander Graf, 2012/05/30
- [Qemu-ppc] [PATCH 18/25] PPC: e500: dt: create global-utils node dynamically, Alexander Graf, 2012/05/30