From patchwork Mon Sep 7 14:23:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 53242 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 66C7122B05 for ; Mon, 7 Sep 2015 14:41:55 +0000 (UTC) Received: by lanb10 with SMTP id b10sf27771513lan.3 for ; Mon, 07 Sep 2015 07:41:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=gONp1If1upe1HhTRaDeWBaKlx2TzlrNLwyFZKwYKYmU=; b=eirwZkG5o5uOD/ul4E4+Y81lH4KjkfuDSAGHR4GfKOQ1T7IPl6dQWg8bHUviJTmUZR FUvSCqAt8pg2sC8BFf7nXPnbqRbEBn0cCfQPR8kdg6MeKg4DSmQrpogXgabH581uicd2 DoYelLh+urhL1XlRt6pKhZLAdTLc/HFSbnsF+oR8zmXF6XpIH6XNEwOLZv9Li49CMtVz FVajUc0sPSBJCXchLZk9c1nDpMwVABRs5wKNR+fyAAkcg/JHzK9DYudRhmU9zh7e/quF hDtgLRZuwaN0C4KnbPpAoAME9OhLpk5sxMsD3uT1xj60Rfs9YW6Jg6OEiVLwFLKwJYlp PO/w== X-Gm-Message-State: ALoCoQmiOGaFT0jD8gsYWWqZH8ss5k+b3zO3i05IIUib0cKqsCULKOTJLTmKlyOo8S+FB2XOd2p9 X-Received: by 10.180.12.205 with SMTP id a13mr5153012wic.4.1441636914141; Mon, 07 Sep 2015 07:41:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.180.75 with SMTP id dm11ls127471lac.102.gmail; Mon, 07 Sep 2015 07:41:53 -0700 (PDT) X-Received: by 10.152.7.106 with SMTP id i10mr17416909laa.114.1441636913968; Mon, 07 Sep 2015 07:41:53 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id lh8si157598lbc.59.2015.09.07.07.41.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2015 07:41:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lagj9 with SMTP id j9so53663752lag.2 for ; Mon, 07 Sep 2015 07:41:53 -0700 (PDT) X-Received: by 10.112.125.134 with SMTP id mq6mr6269939lbb.19.1441636913847; Mon, 07 Sep 2015 07:41:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp414999lbq; Mon, 7 Sep 2015 07:41:52 -0700 (PDT) X-Received: by 10.55.40.18 with SMTP id o18mr26449106qkh.41.1441636912759; Mon, 07 Sep 2015 07:41:52 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h12si13884798qkh.122.2015.09.07.07.41.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 07 Sep 2015 07:41:52 -0700 (PDT) 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; Received: from localhost ([::1]:56993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxcG-0003YL-0M for patch@linaro.org; Mon, 07 Sep 2015 10:41:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxLO-0003b3-UR for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:24:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxLK-0008Jv-EW for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:24:26 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:34077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxLK-0008EB-9Z for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:24:22 -0400 Received: by wicfx3 with SMTP id fx3so90466771wic.1 for ; Mon, 07 Sep 2015 07:24:00 -0700 (PDT) X-Received: by 10.180.8.68 with SMTP id p4mr35834331wia.27.1441635839965; Mon, 07 Sep 2015 07:23:59 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by smtp.gmail.com with ESMTPSA id lz10sm20311076wjb.48.2015.09.07.07.23.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Sep 2015 07:23:59 -0700 (PDT) From: Leif Lindholm To: qemu-devel@nongnu.org Date: Mon, 7 Sep 2015 15:23:46 +0100 Message-Id: <1441635826-4866-3-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441635826-4866-1-git-send-email-leif.lindholm@linaro.org> References: <1441635826-4866-1-git-send-email-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.181 Cc: peter.maydell@linaro.org, drjones@redhat.com, shannon.zhao@linaro.org, al.stone@linaro.org Subject: [Qemu-devel] [PATCH 2/2] hw/arm/virt-acpi-build: Add DBG2 table X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Add a DBG2 table, describing the pl011 UART. Signed-off-by: Leif Lindholm --- hw/arm/virt-acpi-build.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 9088248..6d53dbe 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -352,6 +352,38 @@ build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt) } static void +build_dbg2(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) +{ + AcpiDebugPort2 *dbg2; + const MemMapEntry *uart_memmap = &guest_info->memmap[VIRT_UART]; + + dbg2 = acpi_data_push(table_data, sizeof(*dbg2)); + + dbg2->debug_devices_offset = 44; + dbg2->number_debug_devices = 1; + dbg2->debug_devices[0].revision = 0; + dbg2->debug_devices[0].length = 40; + dbg2->debug_devices[0].number_generic_address_registers = 1; + dbg2->debug_devices[0].namespace_string_length = 2; + dbg2->debug_devices[0].namespace_string_offset = 38; + dbg2->debug_devices[0].oem_data_length = 0; + dbg2->debug_devices[0].oem_data_offset = 0; + dbg2->debug_devices[0].port_type = 0x8000; /* Serial */ + dbg2->debug_devices[0].port_subtype = 0x3; /* ARM PL011 UART */ + dbg2->debug_devices[0].base_address_register_offset = 22; + + dbg2->debug_devices[0].base_address[0].space_id = AML_SYSTEM_MEMORY; + dbg2->debug_devices[0].base_address[0].bit_width = 8; + dbg2->debug_devices[0].base_address[0].bit_offset = 0; + dbg2->debug_devices[0].base_address[0].access_width = 1; + dbg2->debug_devices[0].base_address[0].address = cpu_to_le64(uart_memmap->base); + + strcpy((char *)dbg2->debug_devices[0].namespace_string, "."); + + build_header(linker, table_data, (void *)dbg2, "DBG2", sizeof(*dbg2), 0); +} + +static void build_spcr(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) { AcpiSerialPortConsoleRedirection *spcr; @@ -577,7 +609,7 @@ void virt_acpi_build(VirtGuestInfo *guest_info, AcpiBuildTables *tables) dsdt = tables_blob->len; build_dsdt(tables_blob, tables->linker, guest_info); - /* FADT MADT GTDT MCFG SPCR pointed to by RSDT */ + /* FADT MADT GTDT MCFG DBG2 SPCR pointed to by RSDT */ acpi_add_table(table_offsets, tables_blob); build_fadt(tables_blob, tables->linker, dsdt); @@ -591,6 +623,9 @@ void virt_acpi_build(VirtGuestInfo *guest_info, AcpiBuildTables *tables) build_mcfg(tables_blob, tables->linker, guest_info); acpi_add_table(table_offsets, tables_blob); + build_dbg2(tables_blob, tables->linker, guest_info); + + acpi_add_table(table_offsets, tables_blob); build_spcr(tables_blob, tables->linker, guest_info); /* RSDT is pointed to by RSDP */