From patchwork Fri Dec 8 15:02:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 121180 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp780821qgn; Fri, 8 Dec 2017 07:14:57 -0800 (PST) X-Google-Smtp-Source: ACJfBov5etYUiLRjWU/O6NukomEl0b5HT36oW8vNojRKcIfm5blyB3mTQ1UPMNFJPtoQctVCcFXt X-Received: by 10.37.132.71 with SMTP id r7mr500376ybm.506.1512746097819; Fri, 08 Dec 2017 07:14:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512746097; cv=none; d=google.com; s=arc-20160816; b=1GuJbFCyCHrPjRmVsuIaEndmg2GDwUzhtNpqHaQhUu7noKf+yzoCrC8AotjussrRDf iHnyL62LaJwktHYTV+IucoN3X//Rw30WNZO+BBQzuO72xl1CawqubMJrdr5BVzuvJ7hr EqMyskbOb7TCvbemoY6INo3RSglCvqJ8K7mDmf/tFMKt8rcV+N89WeNZ03LqVeH/FNuj 35RZc0dPzmgBECMkAZH6rgyuQv6OMKXmXyBreQZMn/1PdCAcOZ2U7dopM97QQLLpS+gW 0LEndMjgVWOA3m7fRgXK5so89lLDvmQvidgUXPo5ogtgJV4SnH+l6gm1uNQzAUAb9nnT wsDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=alI/yWR2hG4TcFL/K5w3/aoViFfHzJhIzay3TnLGCW8=; b=WCvLFZ61dkOfs7f41fAFvegolWyYZ/fKXSvAcqFFkacn2Gjcyrw1IHKCWTUWaBmjDa /7LflQU92x17p55lDi5RLXcrhbATviB0c4AUnFMedK134OveR7AbsHb+vnny0iAYWwpi qwvEFl3sdNt4GJvcp+6rBpoJl4UiO+K4AHfyIC8H+JcrsGBQJELtK+Ox1yZl5YNjTBfN spHtKBR9nswhIcXIa4hhnDh6A/kOlbZL2tJm2VWrpVfzTn3sMqh77g/o6ZOs+t3XD2yS +ztGWrb7Qm4kcHZmRVcbccDd6lFE2DHxuspdGbDOYfqE1i+70U4djCsdDfLGb3Cxaf0j 3Xfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d11si1690778ywm.125.2017.12.08.07.14.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 08 Dec 2017 07:14:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNKMb-0001NE-BC for patch@linaro.org; Fri, 08 Dec 2017 10:14:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNKKt-0000GM-Fa for qemu-devel@nongnu.org; Fri, 08 Dec 2017 10:13:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNKKs-0000I2-Fd for qemu-devel@nongnu.org; Fri, 08 Dec 2017 10:13:11 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:38966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNKKp-0000DR-Vj; Fri, 08 Dec 2017 10:13:08 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1eNKAD-0000tQ-HS; Fri, 08 Dec 2017 15:02:09 +0000 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Fri, 8 Dec 2017 15:02:06 +0000 Message-Id: <1512745328-5109-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512745328-5109-1-git-send-email-peter.maydell@linaro.org> References: <1512745328-5109-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 1/3] hw/arm/virt: Add virt-2.12 machine type X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason A . Donenfeld" , Shannon Zhao Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add virt-2.12 machine type. Signed-off-by: Peter Maydell --- include/hw/compat.h | 3 +++ hw/arm/virt.c | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) -- 2.7.4 Reviewed-by: Andrew Jones diff --git a/include/hw/compat.h b/include/hw/compat.h index cf389b4..263de97 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -1,6 +1,9 @@ #ifndef HW_COMPAT_H #define HW_COMPAT_H +#define HW_COMPAT_2_11 \ + /* empty */ + #define HW_COMPAT_2_10 \ {\ .driver = "virtio-mouse-device",\ diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 151592b..543f9bd 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1618,7 +1618,7 @@ static void machvirt_machine_init(void) } type_init(machvirt_machine_init); -static void virt_2_11_instance_init(Object *obj) +static void virt_2_12_instance_init(Object *obj) { VirtMachineState *vms = VIRT_MACHINE(obj); VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); @@ -1678,10 +1678,25 @@ static void virt_2_11_instance_init(Object *obj) vms->irqmap = a15irqmap; } +static void virt_machine_2_12_options(MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(2, 12) + +#define VIRT_COMPAT_2_11 \ + HW_COMPAT_2_11 + +static void virt_2_11_instance_init(Object *obj) +{ + virt_2_12_instance_init(obj); +} + static void virt_machine_2_11_options(MachineClass *mc) { + virt_machine_2_12_options(mc); + SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_11); } -DEFINE_VIRT_MACHINE_AS_LATEST(2, 11) +DEFINE_VIRT_MACHINE(2, 11) #define VIRT_COMPAT_2_10 \ HW_COMPAT_2_10 From patchwork Fri Dec 8 15:02:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 121179 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp767675qgn; Fri, 8 Dec 2017 07:04:52 -0800 (PST) X-Google-Smtp-Source: ACJfBovYLk8hEeSE242rOPkcRULxfIVkiSz2K6n7oECHs1h5YYNW3mS/picjQ7M5NHhMqKIEg7+t X-Received: by 10.37.199.82 with SMTP id w79mr1030213ybe.360.1512745491970; Fri, 08 Dec 2017 07:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512745491; cv=none; d=google.com; s=arc-20160816; b=07doQepV2on0Jz4ni3BgXfPArw0HHteWFSRZn4iq8frE9tOSfpSvq1NAse6SRYePD7 dJOuJi51SdhRYPkLVsJ/YBr8+tGg1GLxGhPiV7S12LuWrvtf3ZWgeKTCSatCdUlrNHcN 4HukzUpMKAivWgyxBpWR2x6emZVRqEV3Ukw4OtxmyK8P5Uin3bxMDZYoPs1t8li3lZBy jX1kj0Dcld6A6J5VYZeGkX1neMr602ZR4sj49GRD7Ie91xKfDw5bMFV4EFEqxRVIeAzi nbYP3yZyURQSblSFVZSqUZYgiOMckEFeP6kxpmxx+ozR4QR9qQgUyOXz7jDywuJ7ssGN KFhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=4/vL3fKmdXB/2Jc76dU3nLfqA50MYkZ7A309BCNs6aE=; b=g4SHkYNc56HILrwe6icfPhy67VE/1m8Xsj0N1egcJSnu2oVO+mbHz8JvtZPGwVHgzz 7dbIkb2uyXQv9Kpnk9BtKdqZ6DGbkFD62M+cac6quh3ViscEDKoiXLMR0uYELYQwOIdm /tRnVkmoVAMxBNqsl7LB8ukNrT6yb2d363A8NrDOb3OBPbA4Jda6ZqchW7oDuPi6OVDR kkwW8roXKOeBrXACLI9Qu4oConpecgabTHUJXcJmEryRVIMiHxuw/tkJsgwe7lsIz1so nc+AOTposBPtUZbvpPmImxoLZ2ibhgc18JwJGYjbroXfY+V+GxdxFYr4hqacl6lbtGVo mQGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o15si1279904ywm.600.2017.12.08.07.04.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 08 Dec 2017 07:04:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNKCp-000235-GA for patch@linaro.org; Fri, 08 Dec 2017 10:04:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNKAO-0000dk-38 for qemu-devel@nongnu.org; Fri, 08 Dec 2017 10:02:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNKAM-0007NM-UM for qemu-devel@nongnu.org; Fri, 08 Dec 2017 10:02:20 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:38946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNKAG-0007Jn-IA; Fri, 08 Dec 2017 10:02:12 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1eNKAE-0000ti-6w; Fri, 08 Dec 2017 15:02:10 +0000 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Fri, 8 Dec 2017 15:02:07 +0000 Message-Id: <1512745328-5109-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512745328-5109-1-git-send-email-peter.maydell@linaro.org> References: <1512745328-5109-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 2/3] hw/arm/virt: Add another UART to the virt board X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason A . Donenfeld" , Shannon Zhao Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently we only provide one non-secure UART on the virt board. This is OK for most purposes, but there are some use cases where having a second UART would be useful (like bare-metal testing where you don't really want to have to probe and set up a PCI device just to have a second comms channel). Add a second NS UART to the virt board. This will be the second serial device if 'secure=no' (the default), and the third serial device if 'secure=yes'. Signed-off-by: Peter Maydell Reviewed-by: Andrew Jones --- include/hw/arm/virt.h | 2 ++ hw/arm/virt.c | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 33b0ff3..685009a 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -72,6 +72,7 @@ enum { VIRT_GPIO, VIRT_SECURE_UART, VIRT_SECURE_MEM, + VIRT_UART_2, }; typedef struct MemMapEntry { @@ -85,6 +86,7 @@ typedef struct { bool no_its; bool no_pmu; bool claim_edge_triggered_timers; + bool no_second_uart; } VirtMachineClass; typedef struct { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 543f9bd..e234f55 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -139,6 +139,7 @@ static const MemMapEntry a15memmap[] = { [VIRT_FW_CFG] = { 0x09020000, 0x00000018 }, [VIRT_GPIO] = { 0x09030000, 0x00001000 }, [VIRT_SECURE_UART] = { 0x09040000, 0x00001000 }, + [VIRT_UART_2] = { 0x09050000, 0x00001000 }, [VIRT_MMIO] = { 0x0a000000, 0x00000200 }, /* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that size */ [VIRT_PLATFORM_BUS] = { 0x0c000000, 0x02000000 }, @@ -157,6 +158,7 @@ static const int a15irqmap[] = { [VIRT_PCIE] = 3, /* ... to 6 */ [VIRT_GPIO] = 7, [VIRT_SECURE_UART] = 8, + [VIRT_UART_2] = 9, [VIRT_MMIO] = 16, /* ...to 16 + NUM_VIRTIO_TRANSPORTS - 1 */ [VIRT_GIC_V2M] = 48, /* ...to 48 + NUM_GICV2M_SPIS - 1 */ [VIRT_PLATFORM_BUS] = 112, /* ...to 112 + PLATFORM_BUS_NUM_IRQS -1 */ @@ -676,7 +678,7 @@ static void create_uart(const VirtMachineState *vms, qemu_irq *pic, int uart, if (uart == VIRT_UART) { qemu_fdt_setprop_string(vms->fdt, "/chosen", "stdout-path", nodename); - } else { + } else if (uart == VIRT_SECURE_UART) { /* Mark as not usable by the normal world */ qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); @@ -1260,6 +1262,7 @@ static void machvirt_init(MachineState *machine) int n, virt_max_cpus; MemoryRegion *ram = g_new(MemoryRegion, 1); bool firmware_loaded = bios_name || drive_get(IF_PFLASH, 0, 0); + int uart_count = 0; /* We can probe only here because during property set * KVM is not available yet @@ -1419,11 +1422,16 @@ static void machvirt_init(MachineState *machine) fdt_add_pmu_nodes(vms); - create_uart(vms, pic, VIRT_UART, sysmem, serial_hds[0]); + create_uart(vms, pic, VIRT_UART, sysmem, serial_hds[uart_count++]); if (vms->secure) { create_secure_ram(vms, secure_sysmem); - create_uart(vms, pic, VIRT_SECURE_UART, secure_sysmem, serial_hds[1]); + create_uart(vms, pic, VIRT_SECURE_UART, secure_sysmem, + serial_hds[uart_count++]); + } + + if (!vmc->no_second_uart) { + create_uart(vms, pic, VIRT_UART_2, sysmem, serial_hds[uart_count++]); } create_rtc(vms, pic); @@ -1693,8 +1701,13 @@ static void virt_2_11_instance_init(Object *obj) static void virt_machine_2_11_options(MachineClass *mc) { + VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + virt_machine_2_12_options(mc); SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_11); + + /* The second NS UART was added in 2.12 */ + vmc->no_second_uart = true; } DEFINE_VIRT_MACHINE(2, 11) From patchwork Fri Dec 8 15:02:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 121177 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp767165qgn; Fri, 8 Dec 2017 07:04:31 -0800 (PST) X-Google-Smtp-Source: AGs4zMaokcaZqWFhojGY65KtoCFyoXsSjWGYJaJkCYh9ICyMeMKeRsQ4kwwQdxOXSR0XZWAVAxI6 X-Received: by 10.129.160.200 with SMTP id x191mr20374801ywg.365.1512745471376; Fri, 08 Dec 2017 07:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512745471; cv=none; d=google.com; s=arc-20160816; b=ji4Ono6TUS8e6FKu9Liab/qI1Pm6p4HjFRqKoceQiR/DAaDNpS1O9dKx+IBb3qbQai xtcO+rns5JZUeH0NBsQK/fQf8uQobkK9OcWpD+G1BB+SoAevaPhCHJ5FSCUeQBt71XHI BBGAAkrgKEncMNNOu+ZYpJnDM2PkNq/MJwiLArBnJGz4I/w12E/akoFAm25pZMmMIrIt tAPkDNcsBAHeop2jvs/zMVQEc6fhCnzxq6sXbLrtJwsLA20H8jfdZXtje7tQMObFBV5D xXn0QYjlrtsTHAY9Uj8PuyAL8sMjialX0F9mB2vUdpUIQIfkjeeyVX2T0+9uHqD2Gu+k aikw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=6VAeUTzDZQehRD+xqkw8Xtl+DXvyTFxn0tpvyZdzXTg=; b=i2eST9/4CWtvdSuB0eS25rJgMMG72ioHkyj3WUpYpu2i/vpNZdGNGwZVyYCEKf+tQC 5gLTk7Vgm0DqCIO5/kc+bswZgj/1RuXhDFiV8UxNsJ2leWH+Rt6YdDv6JVXVBdrmE9lK q6L4H9O7UGT1OgJAuqT2ij1Fm7OAkvOZ2IqDngPo+/ZIzfUUesoqnysdglrAaMEhbZOn d1FfYOLA+ST+TlXvSKrYsJKRJHAhZbhLOaP8gxM3nXIfBv1A8aD/Z4u2cyJIssMKegtm gs31uyWYRJOShYP6j0DJO64tgO0VaBSOu3llkKbXAYFu+XM+hE6c1HVNEmFlY+7zRqIY DH9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g203si1709044ywe.421.2017.12.08.07.04.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 08 Dec 2017 07:04:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNKCU-0001MG-Ve for patch@linaro.org; Fri, 08 Dec 2017 10:04:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNKAP-0000fr-1S for qemu-devel@nongnu.org; Fri, 08 Dec 2017 10:02:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNKAO-0007Ns-9S for qemu-devel@nongnu.org; Fri, 08 Dec 2017 10:02:21 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:38946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNKAH-0007Jn-GE; Fri, 08 Dec 2017 10:02:13 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1eNKAF-0000uJ-HF; Fri, 08 Dec 2017 15:02:11 +0000 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Fri, 8 Dec 2017 15:02:08 +0000 Message-Id: <1512745328-5109-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512745328-5109-1-git-send-email-peter.maydell@linaro.org> References: <1512745328-5109-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 3/3] hw/arm/virt-acpi-build: Add second UART to ACPI tables X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason A . Donenfeld" , Shannon Zhao Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add the second UART to the ACPI tables. Signed-off-by: Peter Maydell Reviewed-by: Shannon Zhao --- Pure guesswork, as I don't have a UEFI setup to hand and am not familiar with ACPI table formats either... --- hw/arm/virt-acpi-build.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 3d78ff6..a38287b 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -689,6 +689,7 @@ static void build_fadt(GArray *table_data, BIOSLinker *linker, static void build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) { + VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); Aml *scope, *dsdt; const MemMapEntry *memmap = vms->memmap; const int *irqmap = vms->irqmap; @@ -706,6 +707,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) acpi_dsdt_add_cpus(scope, vms->smp_cpus); acpi_dsdt_add_uart(scope, &memmap[VIRT_UART], (irqmap[VIRT_UART] + ARM_SPI_BASE)); + if (!vmc->no_second_uart) { + acpi_dsdt_add_uart(scope, &memmap[VIRT_UART_2], + (irqmap[VIRT_UART_2] + ARM_SPI_BASE)); + } acpi_dsdt_add_flash(scope, &memmap[VIRT_FLASH]); acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]); acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO],