From patchwork Thu Apr 4 12:58:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 15928 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 756F427796 for ; Thu, 4 Apr 2013 13:12:39 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id p12sf2458558vbe.4 for ; Thu, 04 Apr 2013 06:12:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=LtdtcpTQHexmcigM5Ha4b8MVuYficpZgxTyCpHpuIRA=; b=TdmosfjIHB1C0sDIz/2zQ5NdrZhdU2q+vc5oQ4bG87luwaIs3iuqGJzmkM1FaZwPkv vSc8YLO1WmzF7ozoMjgmiLPKp87a+7/5fnrFb8pRCLDfAmKlFTNV2Stw6D/GWhldRFAj J0/bzEy1tqlp2+WBiv9Yfnzueqfwe+jDqsbmVAqAL5siZ7qEL52VtUBlpzN2K7OWxxWK +ouTfUjooXoz2ARcQnBKMQLq6R+sM89ffcGx+MKsO44FfyEF11Pehw8XIY8oUmNskSXe o+9v2UdA1gip96w2Q3MxYBRBhsmRBhR7y26gwBAEsYQleO3crEOiv3WAUwXLDsR+M4/n xTHg== X-Received: by 10.224.219.146 with SMTP id hu18mr3287072qab.3.1365081154126; Thu, 04 Apr 2013 06:12:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.27.137 with SMTP id t9ls1549958qeg.60.gmail; Thu, 04 Apr 2013 06:12:33 -0700 (PDT) X-Received: by 10.58.252.72 with SMTP id zq8mr4682290vec.20.1365081153901; Thu, 04 Apr 2013 06:12:33 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id os3si8145020vcb.23.2013.04.04.06.12.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 06:12:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id kw10so78668vcb.19 for ; Thu, 04 Apr 2013 06:12:33 -0700 (PDT) X-Received: by 10.52.19.239 with SMTP id i15mr3949530vde.47.1365081153638; Thu, 04 Apr 2013 06:12:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp215290vez; Thu, 4 Apr 2013 06:12:32 -0700 (PDT) X-Received: by 10.194.77.110 with SMTP id r14mr9673536wjw.2.1365081152326; Thu, 04 Apr 2013 06:12:32 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id p16si4273739wjw.161.2013.04.04.06.12.31 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 06:12:32 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UNjkP-0005RI-Ni; Thu, 04 Apr 2013 13:58:33 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Arnd Bergmann , "Michael S. Tsirkin" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Will Deacon , Paul Brook , Aurelien Jarno Subject: [PATCH v3 05/11] versatile_pci: Use separate PCI I/O space rather than system I/O space Date: Thu, 4 Apr 2013 13:58:27 +0100 Message-Id: <1365080313-20875-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1365080313-20875-1-git-send-email-peter.maydell@linaro.org> References: <1365080313-20875-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQltWT5+79uOUayN0HdyP67KXP/d3Bj89Z/aYrXdTkmBVUP9CdG+wR5hNF+Kc16GGaUE5+dc X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Rather than overloading the system I/O space (which doesn't even make any sense on ARM) for PCI I/O, create an memory region in the PCI controller and use that to represent the I/O space. Signed-off-by: Peter Maydell Acked-by: Paul Brook --- hw/versatile_pci.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c index dfd3001..777e9b1 100644 --- a/hw/versatile_pci.c +++ b/hw/versatile_pci.c @@ -19,7 +19,8 @@ typedef struct { qemu_irq irq[4]; MemoryRegion mem_config; MemoryRegion mem_config2; - MemoryRegion isa; + MemoryRegion pci_io_space; + MemoryRegion pci_io_window; PCIBus pci_bus; PCIDevice pci_dev; @@ -77,8 +78,10 @@ static void pci_vpb_init(Object *obj) PCIHostState *h = PCI_HOST_BRIDGE(obj); PCIVPBState *s = PCI_VPB(obj); + memory_region_init(&s->pci_io_space, "pci_io", 1ULL << 32); + pci_bus_new_inplace(&s->pci_bus, DEVICE(obj), "pci", - get_system_memory(), get_system_io(), + get_system_memory(), &s->pci_io_space, PCI_DEVFN(11, 0)); h->bus = &s->pci_bus; @@ -111,8 +114,14 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp) memory_region_init_io(&s->mem_config2, &pci_vpb_config_ops, &s->pci_bus, "pci-vpb-config", 0x1000000); sysbus_init_mmio(sbd, &s->mem_config2); - isa_mmio_setup(&s->isa, 0x0100000); - sysbus_init_mmio(sbd, &s->isa); + + /* The window into I/O space is always into a fixed base address; + * its size is the same for both realview and versatile. + */ + memory_region_init_alias(&s->pci_io_window, "pci-vbp-io-window", + &s->pci_io_space, 0, 0x100000); + + sysbus_init_mmio(sbd, &s->pci_io_space); /* TODO Remove once realize propagates to child devices. */ object_property_set_bool(OBJECT(&s->pci_dev), true, "realized", errp);