From patchwork Sat Apr 6 15:44:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 15951 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 93F1526EC2 for ; Sat, 6 Apr 2013 15:45:00 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id b14sf6052076qcs.8 for ; Sat, 06 Apr 2013 08:44:50 -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=E+5VMHMZ29bGyrCdxebP8DSWKaKZhv5HyiQJnh6OO0o=; b=Z4jIcMpw/3SJy2lk8otCTgslWD18bXo4GCyeuabkE2i02/lpNIvJ3ihe+qmlCB4pR0 Gx56y6f+qsG2Nu1819zlV4zTDOcW9YltTTEQ4nOZyJcGPiLdXFClf8IJNbmqbvInLC1I VJQ5CGUaj5M8jqzhSrmY/0PSJFVM+rTzVoTYtyppFIeyPcCecsvo7UiPh84JEm6HA2gA g8oxHbV5vTmC6dLWte0eNOnywWEo4cz/+J5VpPfOQDlOcX5XH4l5gd21TnqezXgZA9Wx w5uyqPOJqY1ogQAvItRgZQwPuHmmaY4z99DZRvFCN4cK4Ke6T7xtr7XLi35qOtvBhBs0 dDoQ== X-Received: by 10.224.219.146 with SMTP id hu18mr1483804qab.3.1365263090472; Sat, 06 Apr 2013 08:44:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.131.33 with SMTP id oj1ls2587001qeb.89.gmail; Sat, 06 Apr 2013 08:44:50 -0700 (PDT) X-Received: by 10.220.137.145 with SMTP id w17mr4804394vct.73.1365263090348; Sat, 06 Apr 2013 08:44:50 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id b4si13838264vdw.44.2013.04.06.08.44.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 06 Apr 2013 08:44:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id pa12so4377323veb.12 for ; Sat, 06 Apr 2013 08:44:50 -0700 (PDT) X-Received: by 10.220.161.4 with SMTP id p4mr11387219vcx.32.1365263090236; Sat, 06 Apr 2013 08:44:50 -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 h8csp296689vez; Sat, 6 Apr 2013 08:44:49 -0700 (PDT) X-Received: by 10.66.25.147 with SMTP id c19mr20786560pag.207.1365263084139; Sat, 06 Apr 2013 08:44:44 -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 tz4si774029pab.33.2013.04.06.08.44.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 06 Apr 2013 08:44:43 -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 1UOVID-0004PK-2G; Sat, 06 Apr 2013 16:44:37 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , "Michael S. Tsirkin" , Paul Brook , Arnd Bergmann , Will Deacon Subject: [PATCH v4 05/11] versatile_pci: Use separate PCI I/O space rather than system I/O space Date: Sat, 6 Apr 2013 16:44:30 +0100 Message-Id: <1365263076-16909-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1365263076-16909-1-git-send-email-peter.maydell@linaro.org> References: <1365263076-16909-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQkJPHeSFBEbbAFXDYKjEYsWG0kb6O3oU681PTp/BzoMlv19AKeb+4BR4tUakfk7nRTTAzCG X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 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 9e0ece0..ce5bdf2 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), TYPE_PCI_BUS); 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);