From nobody Fri Nov 7 07:16:24 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1608938311; cv=none; d=zohomail.com; s=zohoarc; b=EqssoHu0LYM3ocLjS8Kqr/E19Nl69LudghrlNqPGfQrZzxF6agilcMTphYy7+HhEij8Ppzy8L2vjgDF5no7Gk/ncsiZ0ALc4DO6uYIWa6pI8yM3ULMTAnqLv5YTzJlWn7HYV99VT3iKg3Z3vKgv2v9Y6NShJ96ZD23XZeWZ0QwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608938311; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=W3TaPg63qdiDVK9O8ny+f/GxzWCeg+r0Rb27Tmb8ftI=; b=ToKJ4yxvG71BnIvpAa1WyrxSwf8FQwttmx26zbMcGPLPIqbDvXQhsU0Np9eis+PP4FfZ8idjgG7OwxEfHvYkEqdkH3XgnvpdrhHHHQeANdIloxKNGQ3WYgDl+x5GaP81/mWNTyakaYoGNHRtp6PcQ7clC+93NeuS/9onvn+4Sps= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608938311006765.0542661083286; Fri, 25 Dec 2020 15:18:31 -0800 (PST) Received: from localhost ([::1]:34750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kswLu-0002QY-9j for importer@patchew.org; Fri, 25 Dec 2020 18:18:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kswKN-00011y-Io; Fri, 25 Dec 2020 18:16:55 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:29473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kswKL-0006ab-0G; Fri, 25 Dec 2020 18:16:54 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 568AE7470E7; Sat, 26 Dec 2020 00:16:49 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id C8A9E7470E4; Sat, 26 Dec 2020 00:16:48 +0100 (CET) Message-Id: <802e43fd7cc1877e7ba831d491bb4c26a692e538.1608937677.git.balaton@eik.bme.hu> In-Reply-To: References: Subject: [PATCH 1/3] ppc4xx: Move common dependency on serial to common option Date: Sat, 26 Dec 2020 00:07:57 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org X-Spam-Probability: 8% Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Mark Cave-Ayland , Guenter Roeck , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: BALATON Zoltan From: BALATON Zoltan via Content-Type: text/plain; charset="utf-8" All machines that select SERIAL also select PPC4XX so we can just add this common dependency there once. Signed-off-by: BALATON Zoltan --- hw/ppc/Kconfig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index dd86e664d2..8548f42b0d 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -37,7 +37,6 @@ config PPC405 select M48T59 select PFLASH_CFI02 select PPC4XX - select SERIAL =20 config PPC440 bool @@ -46,13 +45,13 @@ config PPC440 imply E1000_PCI select PCI_EXPRESS select PPC4XX - select SERIAL select FDT_PPC =20 config PPC4XX bool select BITBANG_I2C select PCI + select SERIAL =20 config SAM460EX bool @@ -61,7 +60,6 @@ config SAM460EX select IDE_SII3112 select M41T80 select PPC440 - select SERIAL select SM501 select SMBUS_EEPROM select USB_EHCI_SYSBUS @@ -123,7 +121,6 @@ config VIRTEX bool select PPC4XX select PFLASH_CFI01 - select SERIAL select XILINX select XILINX_ETHLITE select FDT_PPC --=20 2.21.3 From nobody Fri Nov 7 07:16:24 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1608938310; cv=none; d=zohomail.com; s=zohoarc; b=Uo1240iUrTdGqeOwpPcHuFgStHVZXDQj25PmyZmBLoULUDAtvasB2Wrr+gjRP9BpaW/BYzsCq/XM9m68VsI93HM+2tZei27P0DwP+3pcXNLUBCgM2zcAk6cYc84plyTAUG7Go4g1CpgO9YWZV970JNBvK91umcvr0FEE3d7qsmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608938310; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=v4UecZnGAW6pdXkljD5U1TBsiFdcZRacBa/OyMxoaK8=; b=VszsftRuMGAX5PchzhYNj+z51lWsidLt7ntMUy2AdGU57C6g9bnm05sJzYHCVOT0/sk6ZT0g052SE2a/t4T+qecAwYv+lsLt7dhr0iQWtRXYhCDye+/3skDLRDBMh9YxyMeDv6WMp6/p1mFAo8e4ErgKprqv0y3BtQwD+ZFGiBE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608938310750656.542660542803; Fri, 25 Dec 2020 15:18:30 -0800 (PST) Received: from localhost ([::1]:34690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kswLt-0002P1-0Q for importer@patchew.org; Fri, 25 Dec 2020 18:18:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kswKN-00011m-Gh; Fri, 25 Dec 2020 18:16:55 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]:55163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kswKK-0006ad-TA; Fri, 25 Dec 2020 18:16:54 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 668667470EB; Sat, 26 Dec 2020 00:16:49 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id CE5BB7470E8; Sat, 26 Dec 2020 00:16:48 +0100 (CET) Message-Id: <01f1df6570298564ad7303e9146c1473b247d951.1608937677.git.balaton@eik.bme.hu> In-Reply-To: References: Subject: [PATCH 2/3] sam460ex: Drop unneeded dependencies Date: Sat, 26 Dec 2020 00:07:57 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org X-Spam-Probability: 8% Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Mark Cave-Ayland , Guenter Roeck , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: BALATON Zoltan From: BALATON Zoltan via Content-Type: text/plain; charset="utf-8" Remove dependencies from KConfig that are not actually needed. Signed-off-by: BALATON Zoltan --- hw/ppc/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 8548f42b0d..5893f80909 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -55,7 +55,6 @@ config PPC4XX =20 config SAM460EX bool - select PPC405 select PFLASH_CFI01 select IDE_SII3112 select M41T80 @@ -64,7 +63,6 @@ config SAM460EX select SMBUS_EEPROM select USB_EHCI_SYSBUS select USB_OHCI - select FDT_PPC =20 config PREP bool --=20 2.21.3 From nobody Fri Nov 7 07:16:24 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1608938427; cv=none; d=zohomail.com; s=zohoarc; b=ZI71QTp2t73vFwG1DHp3Crkxdu/cjM8ryc/bJ9FaXO0UZKGZghpN6xquG0PSKJBj2KY04d2ZLqMr16j2E18GL2ODdFPYDwRQzRRvW8efr46Cqm7aMlHg3fGwkp+97X/66ha3QmsuIFr+IY6PKL0ek93KqLQ9FzPCOICi5IkJebk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608938427; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ap7CRb5SEejDLe06323nvnjjH7eqyHtj/1mtqjyI4zI=; b=BMFmfCM7YCXef+TISVo3kXFqxwm/LjRWpGcgPaKQfUJqArhxiq/5nVZNMZ+BWFaoMwpoMFpsgDpqARjz+iO1S2xVCSmgZ/Uh1R+rhnE8Wcn3grwjQJJ33za8UDZD6ZHsyF6GUhl6P6oVo0w8gnEDohM3J8lLNSjXar9SyekDFC0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608938427266457.5940638406055; Fri, 25 Dec 2020 15:20:27 -0800 (PST) Received: from localhost ([::1]:40034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kswNk-0004ax-9a for importer@patchew.org; Fri, 25 Dec 2020 18:20:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kswKO-000146-TY; Fri, 25 Dec 2020 18:16:56 -0500 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:48598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kswKK-0006ae-TK; Fri, 25 Dec 2020 18:16:56 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 704507470EC; Sat, 26 Dec 2020 00:16:49 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id D30AD7470DF; Sat, 26 Dec 2020 00:16:48 +0100 (CET) Message-Id: <7df2e39f5229780c2ebf05b2efe0d8ce12d0766a.1608937677.git.balaton@eik.bme.hu> In-Reply-To: References: Subject: [PATCH 3/3] sam460ex: Clean up irq mapping Date: Sat, 26 Dec 2020 00:07:57 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org X-Spam-Probability: 8% Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Mark Cave-Ayland , Guenter Roeck , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: BALATON Zoltan From: BALATON Zoltan via Content-Type: text/plain; charset="utf-8" Avoid mapping multiple interrupts to the same irq. Instead map them to the 4 PCI interrupts and use an or-gate in the board to connect them to the interrupt controller. This does not fix any known problem but does not seem to cause a new problem either and may be cleaner at least. Signed-off-by: BALATON Zoltan Tested-by: Guenter Roeck --- hw/ppc/Kconfig | 1 + hw/ppc/ppc440_pcix.c | 28 ++++++++++++++-------------- hw/ppc/sam460ex.c | 16 +++++++++++++--- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 5893f80909..fabdb1a96f 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -58,6 +58,7 @@ config SAM460EX select PFLASH_CFI01 select IDE_SII3112 select M41T80 + select OR_IRQ select PPC440 select SM501 select SMBUS_EEPROM diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index ee952314c8..504decbbc2 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -57,8 +57,8 @@ struct PPC440PCIXState { PCIDevice *dev; struct PLBOutMap pom[PPC440_PCIX_NR_POMS]; struct PLBInMap pim[PPC440_PCIX_NR_PIMS]; + qemu_irq irq[PCI_NUM_PINS]; uint32_t sts; - qemu_irq irq; AddressSpace bm_as; MemoryRegion bm; =20 @@ -415,24 +415,20 @@ static void ppc440_pcix_reset(DeviceState *dev) s->sts =3D 0; } =20 -/* All pins from each slot are tied to a single board IRQ. - * This may need further refactoring for other boards. */ static int ppc440_pcix_map_irq(PCIDevice *pci_dev, int irq_num) { - trace_ppc440_pcix_map_irq(pci_dev->devfn, irq_num, 0); - return 0; + int n =3D (irq_num + PCI_SLOT(pci_dev->devfn)) % PCI_NUM_PINS; + + trace_ppc440_pcix_map_irq(pci_dev->devfn, irq_num, n); + return n; } =20 static void ppc440_pcix_set_irq(void *opaque, int irq_num, int level) { - qemu_irq *pci_irq =3D opaque; + qemu_irq *pci_irqs =3D opaque; =20 trace_ppc440_pcix_set_irq(irq_num); - if (irq_num < 0) { - error_report("%s: PCI irq %d", __func__, irq_num); - return; - } - qemu_set_irq(*pci_irq, level); + qemu_set_irq(pci_irqs[irq_num], level); } =20 static AddressSpace *ppc440_pcix_set_iommu(PCIBus *b, void *opaque, int de= vfn) @@ -472,15 +468,19 @@ static void ppc440_pcix_realize(DeviceState *dev, Err= or **errp) SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); PPC440PCIXState *s; PCIHostState *h; + int i; =20 h =3D PCI_HOST_BRIDGE(dev); s =3D PPC440_PCIX_HOST_BRIDGE(dev); =20 - sysbus_init_irq(sbd, &s->irq); + for (i =3D 0; i < ARRAY_SIZE(s->irq); i++) { + sysbus_init_irq(sbd, &s->irq[i]); + } memory_region_init(&s->busmem, OBJECT(dev), "pci bus memory", UINT64_M= AX); h->bus =3D pci_register_root_bus(dev, NULL, ppc440_pcix_set_irq, - ppc440_pcix_map_irq, &s->irq, &s->busmem, - get_system_io(), PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS= ); + ppc440_pcix_map_irq, s->irq, &s->busmem, + get_system_io(), PCI_DEVFN(0, 0), ARRAY_SIZE(s->i= rq), + TYPE_PCI_BUS); =20 s->dev =3D pci_create_simple(h->bus, PCI_DEVFN(0, 0), "ppc4xx-host-bri= dge"); =20 diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 14e6583eb0..59b19fbca1 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -33,6 +33,7 @@ #include "sysemu/qtest.h" #include "sysemu/reset.h" #include "hw/sysbus.h" +#include "hw/or-irq.h" #include "hw/char/serial.h" #include "hw/i2c/ppc4xx_i2c.h" #include "hw/i2c/smbus_eeprom.h" @@ -292,7 +293,7 @@ static void sam460ex_init(MachineState *machine) SysBusDevice *sbdev; struct boot_info *boot_info; uint8_t *spd_data; - int success; + int i, success; =20 cpu =3D POWERPC_CPU(cpu_create(machine->cpu_type)); env =3D &cpu->env; @@ -382,13 +383,22 @@ static void sam460ex_init(MachineState *machine) =20 /* PCI bus */ ppc460ex_pcie_init(env); - /* All PCI irqs are connected to the same UIC pin (cf. UBoot source) */ - dev =3D sysbus_create_simple("ppc440-pcix-host", 0xc0ec00000, uic[1][0= ]); + dev =3D sysbus_create_simple("ppc440-pcix-host", 0xc0ec00000, NULL); pci_bus =3D (PCIBus *)qdev_get_child_bus(dev, "pci.0"); if (!pci_bus) { error_report("couldn't create PCI controller!"); exit(1); } + /* All PCI irqs are connected to the same UIC pin (cf. UBoot source) */ + sbdev =3D SYS_BUS_DEVICE(dev); + dev =3D qdev_new(TYPE_OR_IRQ); + object_property_set_int(OBJECT(dev), "num-lines", PCI_NUM_PINS, + &error_fatal); + qdev_realize_and_unref(dev, NULL, &error_fatal); + for (i =3D 0; i < PCI_NUM_PINS; i++) { + sysbus_connect_irq(sbdev, i, qdev_get_gpio_in(dev, i)); + } + qdev_connect_gpio_out(dev, 0, uic[1][0]); memory_region_init_alias(isa, NULL, "isa_mmio", get_system_io(), 0, 0x10000); memory_region_add_subregion(get_system_memory(), 0xc08000000, isa); --=20 2.21.3