From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMxgY-0006bW-PO for qemu-devel@nongnu.org; Thu, 28 Aug 2014 07:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMxgT-000705-LJ for qemu-devel@nongnu.org; Thu, 28 Aug 2014 07:16:10 -0400 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:47137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMxgT-0006zz-Dj for qemu-devel@nongnu.org; Thu, 28 Aug 2014 07:16:05 -0400 Received: by mail-lb0-f180.google.com with SMTP id w7so677954lbi.25 for ; Thu, 28 Aug 2014 04:16:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1408989500-5652-3-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1408989500-5652-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1408989500-5652-3-git-send-email-mark.cave-ayland@ilande.co.uk> From: Artyom Tarasenko Date: Thu, 28 Aug 2014 13:15:43 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 2/2] apb: implement PCI bus error interrupt map registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: Blue Swirl , qemu-devel On Mon, Aug 25, 2014 at 7:58 PM, Mark Cave-Ayland wrote: > Both OpenBSD and FreeBSD SPARC64 attempt to read the interrupt map from the > hardware and will fail if the correct ino isn't present. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Artyom Tarasenko > --- > hw/pci-host/apb.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c > index 3b7fb13..d2c5c14 100644 > --- a/hw/pci-host/apb.c > +++ b/hw/pci-host/apb.c > @@ -147,6 +147,7 @@ typedef struct APBState { > IOMMUState iommu; > uint32_t pci_control[16]; > uint32_t pci_irq_map[8]; > + uint32_t pci_err_irq_map[4]; > uint32_t obio_irq_map[32]; > qemu_irq *pbm_irqs; > qemu_irq *ivec_irqs; > @@ -441,7 +442,7 @@ static void apb_config_writel (void *opaque, hwaddr addr, > pbm_check_irqs(s); > } > break; > - case 0x1000 ... 0x1080: /* OBIO interrupt control */ > + case 0x1000 ... 0x107f: /* OBIO interrupt control */ > if (addr & 4) { > unsigned int ino = ((addr & 0xff) >> 3); > s->obio_irq_map[ino] &= PBM_PCI_IMR_MASK; > @@ -519,13 +520,20 @@ static uint64_t apb_config_readl (void *opaque, > val = 0; > } > break; > - case 0x1000 ... 0x1080: /* OBIO interrupt control */ > + case 0x1000 ... 0x107f: /* OBIO interrupt control */ > if (addr & 4) { > val = s->obio_irq_map[(addr & 0xff) >> 3]; > } else { > val = 0; > } > break; > + case 0x1080 ... 0x108f: /* PCI bus error */ > + if (addr & 4) { > + val = s->pci_err_irq_map[(addr & 0xf) >> 3]; > + } else { > + val = 0; > + } > + break; > case 0x2000 ... 0x202f: /* PCI control */ > val = s->pci_control[(addr & 0x3f) >> 2]; > break; > @@ -763,6 +771,9 @@ static int pci_pbm_init_device(SysBusDevice *dev) > for (i = 0; i < 8; i++) { > s->pci_irq_map[i] = (0x1f << 6) | (i << 2); > } > + for (i = 0; i < 2; i++) { > + s->pci_err_irq_map[i] = (0x1f << 6) | 0x30; > + } > for (i = 0; i < 32; i++) { > s->obio_irq_map[i] = ((0x1f << 6) | 0x20) + i; > } > -- > 1.7.10.4 > > -- Regards, Artyom Tarasenko linux/sparc and solaris/sparc under qemu blog: http://tyom.blogspot.com/search/label/qemu