qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH] ppc: Fix sam460ex devicetree when booting the Lin


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH] ppc: Fix sam460ex devicetree when booting the Linux kernel
Date: Fri, 22 Jun 2018 15:03:34 +1000
User-agent: Mutt/1.10.0 (2018-05-17)

Balaton, can you review this please.

On Thu, Jun 21, 2018 at 09:47:51PM -0700, Guenter Roeck wrote:
> sam4660ex (or at least this emulation) does not support the "ibm,cpm" power
> management. As a result, Linux crashes when trying to access it. Remove
> its devicetree node. Also, if/when we boot the Linux kernel directly,
> u-boot will not fix up serial frequencies in the devicetree file, and
> serial port initialization will fail. Add plausible frequency values to the
> first serial port to be able to use it. Disable the second serial port
> since it is not available on the board.  Also set valid values for the
> other clock nodes otherwise set by u-boot.
> 
> Signed-off-by: Guenter Roeck <address@hidden>
> ---
>  hw/ppc/sam460ex.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
> index bdc53d2..045a255 100644
> --- a/hw/ppc/sam460ex.c
> +++ b/hw/ppc/sam460ex.c
> @@ -308,6 +308,24 @@ static int sam460ex_load_device_tree(hwaddr addr,
>      qemu_fdt_setprop_cell(fdt, "/cpus/address@hidden", "timebase-frequency",
>                                tb_freq);
>  
> +    /* Remove cpm node (not emulated) */
> +    qemu_fdt_nop_node(fdt, "/cpm");
> +    /* set serial port clock and speed */
> +    qemu_fdt_setprop_cell(fdt, "/plb/opb/address@hidden", "clock-frequency",
> +                              50000000);
> +    qemu_fdt_setprop_cell(fdt, "/plb/opb/address@hidden", "current-speed",
> +                              38400);
> +    /* disable second serial port */
> +    qemu_fdt_setprop_string(fdt, "/plb/opb/address@hidden", "status",
> +                              "disabled");
> +    /* some more clocks */
> +    qemu_fdt_setprop_cell(fdt, "/plb", "clock-frequency",
> +                              50000000);
> +    qemu_fdt_setprop_cell(fdt, "/plb/opb", "clock-frequency",
> +                              50000000);
> +    qemu_fdt_setprop_cell(fdt, "/plb/opb/ebc", "clock-frequency",
> +                              50000000);
> +
>      rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr);
>      g_free(fdt);
>      ret = fdt_size;

-- 
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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]