From patchwork Wed Jan 13 14:54:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 59668 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3412753lbb; Wed, 13 Jan 2016 06:55:14 -0800 (PST) X-Received: by 10.140.142.207 with SMTP id 198mr178517044qho.77.1452696914317; Wed, 13 Jan 2016 06:55:14 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d32si1671286qgd.48.2016.01.13.06.55.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 13 Jan 2016 06:55:14 -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; dkim=fail header.i=@linaro.org Received: from localhost ([::1]:37478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJMpN-0000Bq-WA for patch@linaro.org; Wed, 13 Jan 2016 09:55:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJMoy-0008Le-4J for qemu-devel@nongnu.org; Wed, 13 Jan 2016 09:54:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJMot-0004D6-T9 for qemu-devel@nongnu.org; Wed, 13 Jan 2016 09:54:48 -0500 Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]:36793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJMos-0004Cm-Ko for qemu-devel@nongnu.org; Wed, 13 Jan 2016 09:54:43 -0500 Received: by mail-pf0-x236.google.com with SMTP id n128so82445503pfn.3 for ; Wed, 13 Jan 2016 06:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=hrCqp76yLfyL/XsKC9JFQ2tcnIfgX9psLIXlR43p4M0=; b=S9pnYxs1iJBymmS0lATdfJWopMrKWTqy1XYPQZBPl7h0mHTrEkMqDKeubujnHqdJ7n WNaMHyUiglAnHriqOay4hwF+PI7B5wQwZ4S1UMvemJlNascNo2Dt+bAbGmbvWSquImyQ pAB8EEA3ZFQpWd9qi+yae7564t41sVeAQRYmA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hrCqp76yLfyL/XsKC9JFQ2tcnIfgX9psLIXlR43p4M0=; b=KiZOZB3QKbAoI/5T1Orha891PRPw2XPa0Aj3QFwerYvW7iYLTclC8HVRifs1/o66l3 crqoSjNTTP8hYZ1RXUaXSXmtcf2ML5p8I93MCqmVetKFtLlraJP4vKGao4XftLLy5mDU IhS/+IJMB2OXh11OTRkLfD6ptJ+g5RJDRSwnQB6pO/ONs5fkacMLjYVQ3FwVaFjpT/oi upBkfMmKBsZpw36CtijinCX1m6u43xFEAfK1CIrA3mHpvqf40fgCKO5e9aSUBg/s6VG9 4Eeh0KJ2seo18fzwjY0YoGKe38emGk8PwFGW4jtfdM6Tn7j70KDOjAu4i/MF3czuzpnH oC1A== X-Gm-Message-State: ALoCoQmB9keIyT/qSPn9DNWCfS2sJ8d/qX94AmvgMI6uAqVTzQi34BtDJkVTNstj5EIzIJnohOK5M1K+uHzucSCEKhunPznPQQ== X-Received: by 10.98.67.139 with SMTP id l11mr43230075pfi.66.1452696881828; Wed, 13 Jan 2016 06:54:41 -0800 (PST) Received: from localhost.localdomain ([39.182.11.117]) by smtp.gmail.com with ESMTPSA id w82sm3175816pfi.95.2016.01.13.06.54.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 06:54:40 -0800 (PST) From: Shannon Zhao To: qemu-arm@nongnu.org Date: Wed, 13 Jan 2016 22:54:17 +0800 Message-Id: <1452696857-4091-1-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::236 Cc: peter.maydell@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@ml01.01.org, qemu-devel@nongnu.org, zhaoshenglong@huawei.com, lersek@redhat.com Subject: [Qemu-devel] [PATCH v2] ARM: Virt: Don't generate RTC ACPI device when using UEFI 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 When booting the VM with UEFI, UEFI takes ownership of the RTC hardware. While UEFI can use libfdt to disable the RTC device node in the DTB that it passes to the OS, it cannot modify AML. Therefore, we won't generate the RTC ACPI device at all when using UEFI. Signed-off-by: Shannon Zhao --- v2: just totally don't generate the RTC ACPI device when using UEFI --- hw/arm/virt-acpi-build.c | 19 ------------------- 1 file changed, 19 deletions(-) -- 2.1.0 Acked-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek Reviewed-by: Peter Maydell diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 0caf5ce..ac568a3 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -94,23 +94,6 @@ static void acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap, aml_append(scope, dev); } -static void acpi_dsdt_add_rtc(Aml *scope, const MemMapEntry *rtc_memmap, - uint32_t rtc_irq) -{ - Aml *dev = aml_device("RTC0"); - aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0013"))); - aml_append(dev, aml_name_decl("_UID", aml_int(0))); - - Aml *crs = aml_resource_template(); - aml_append(crs, aml_memory32_fixed(rtc_memmap->base, - rtc_memmap->size, AML_READ_WRITE)); - aml_append(crs, - aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH, - AML_EXCLUSIVE, &rtc_irq, 1)); - aml_append(dev, aml_name_decl("_CRS", crs)); - aml_append(scope, dev); -} - static void acpi_dsdt_add_flash(Aml *scope, const MemMapEntry *flash_memmap) { Aml *dev, *crs; @@ -575,8 +558,6 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) acpi_dsdt_add_cpus(scope, guest_info->smp_cpus); acpi_dsdt_add_uart(scope, &memmap[VIRT_UART], (irqmap[VIRT_UART] + ARM_SPI_BASE)); - acpi_dsdt_add_rtc(scope, &memmap[VIRT_RTC], - (irqmap[VIRT_RTC] + ARM_SPI_BASE)); acpi_dsdt_add_flash(scope, &memmap[VIRT_FLASH]); acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO], (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPORTS);