From patchwork Mon Aug 25 17:58:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 382822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D5A81140088 for ; Tue, 26 Aug 2014 03:59:41 +1000 (EST) Received: from localhost ([::1]:49860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLyYN-0008A5-TH for incoming@patchwork.ozlabs.org; Mon, 25 Aug 2014 13:59:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLyXt-0007UT-Ot for qemu-devel@nongnu.org; Mon, 25 Aug 2014 13:59:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLyXn-0003Cm-8h for qemu-devel@nongnu.org; Mon, 25 Aug 2014 13:59:09 -0400 Received: from s16892447.onlinehome-server.info ([82.165.15.123]:40008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLyXn-00039w-2u for qemu-devel@nongnu.org; Mon, 25 Aug 2014 13:59:03 -0400 Received: from cpc46-slam6-2-0-cust316.2-4.cable.virginm.net ([86.21.77.61] helo=kentang.lan) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1XLyXZ-00064K-Id; Mon, 25 Aug 2014 18:58:55 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, blauwirbel@gmail.com Date: Mon, 25 Aug 2014 18:58:19 +0100 Message-Id: <1408989500-5652-2-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1408989500-5652-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1408989500-5652-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.21.77.61 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 1/2] apb: add implementation of UltraSPARC IIi PCI TAS register 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org FreeBSD SPARC64 checks the value of this register on boot in order to calculate the DVMA base address. Signed-off-by: Mark Cave-Ayland --- hw/pci-host/apb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c index 60bd81e..3b7fb13 100644 --- a/hw/pci-host/apb.c +++ b/hw/pci-host/apb.c @@ -68,6 +68,11 @@ do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0) #define PBM_PCI_IMR_MASK 0x7fffffff #define PBM_PCI_IMR_ENABLED 0x80000000 +/* PCI Target Address Space Register (see UltraSPARC IIi User's Manual + section 19.3.0.4) */ +#define PBM_PCI_TARGET_AS 0x2028 +#define PBM_PCI_TARGET_AS_CD_ENABLE 0x40 + #define POR (1U << 31) #define SOFT_POR (1U << 30) #define SOFT_XIR (1U << 29) @@ -731,6 +736,12 @@ static void pci_pbm_reset(DeviceState *d) s->irq_request = NO_IRQ_REQUEST; s->pci_irq_in = 0ULL; + /* Set target address space register to base 0xc0000000, size 0x20000000 + to match OpenBIOS virtual-dma properties */ + s->pci_control[((PBM_PCI_TARGET_AS & 0x3f) >> 2)] = 0x0; + s->pci_control[((PBM_PCI_TARGET_AS & 0x3f) >> 2) + 1] = + PBM_PCI_TARGET_AS_CD_ENABLE; + if (s->nr_resets++ == 0) { /* Power on reset */ s->reset_control = POR;