From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWDzY-0007Mj-Tp for qemu-devel@nongnu.org; Fri, 22 Jun 2018 00:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWDzX-0004rB-Ts for qemu-devel@nongnu.org; Fri, 22 Jun 2018 00:48:12 -0400 From: Guenter Roeck Date: Thu, 21 Jun 2018 21:47:51 -0700 Message-Id: <1529642871-14214-1-git-send-email-linux@roeck-us.net> Subject: [Qemu-devel] [PATCH] ppc: Fix sam460ex devicetree when booting the Linux kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Guenter Roeck 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 --- 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/cpu@0", "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/serial@ef600300", "clock-frequency", + 50000000); + qemu_fdt_setprop_cell(fdt, "/plb/opb/serial@ef600300", "current-speed", + 38400); + /* disable second serial port */ + qemu_fdt_setprop_string(fdt, "/plb/opb/serial@ef600400", "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; -- 2.7.4