From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RldKf-0001T6-Oo for qemu-devel@nongnu.org; Fri, 13 Jan 2012 04:22:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RldKc-0004rr-Aw for qemu-devel@nongnu.org; Fri, 13 Jan 2012 04:21:57 -0500 Message-ID: <4F0FF7AD.2080403@siemens.com> Date: Fri, 13 Jan 2012 10:21:49 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1325894809-17322-1-git-send-email-andreas.faerber@web.de> <1326424168-15705-1-git-send-email-andreas.faerber@web.de> <1326424168-15705-9-git-send-email-andreas.faerber@web.de> In-Reply-To: <1326424168-15705-9-git-send-email-andreas.faerber@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 8/8] prep: Use i82378 PCI->ISA bridge for 'prep' machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , "qemu-ppc@nongnu.org" , "qemu-devel@nongnu.org" , Alexander Graf On 2012-01-13 04:09, Andreas F=C3=A4rber wrote: > Speaker I/O, ISA bus, i8259 PIC, RTC and DMA are no longer set up > individually by the machine. Effectively, no-op speaker I/O is replaced > by pcspk; PIT and i82374 DMA are introduced. >=20 > Signed-off-by: Herv=C3=A9 Poussineau >=20 > Remove related dead, alternative code. > Access i8259 IRQs via ISA bus to resolve cyclic dependency with PCI > host bridge. >=20 > Signed-off-by: Andreas F=C3=A4rber > Cc: Alexander Graf > Cc: Jan Kiszka > --- > hw/ppc_prep.c | 54 +++++++++++--------------------------------------= ----- > 1 files changed, 11 insertions(+), 43 deletions(-) >=20 > diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c > index 747539f..9485d45 100644 > --- a/hw/ppc_prep.c > +++ b/hw/ppc_prep.c > @@ -83,37 +83,9 @@ static const int ide_irq[2] =3D { 13, 13 }; > static uint32_t ne2000_io[NE2000_NB_MAX] =3D { 0x300, 0x320, 0x340, 0x= 360, 0x280, 0x380 }; > static int ne2000_irq[NE2000_NB_MAX] =3D { 9, 10, 11, 3, 4, 5 }; > =20 > -//static ISADevice *pit; > - > /* ISA IO ports bridge */ > #define PPC_IO_BASE 0x80000000 > =20 > -#if 0 > -/* Speaker port 0x61 */ > -static int speaker_data_on; > -static int dummy_refresh_clock; > -#endif > - > -static void speaker_ioport_write (void *opaque, uint32_t addr, uint32_= t val) > -{ > -#if 0 > - speaker_data_on =3D (val >> 1) & 1; > - pit_set_gate(pit, 2, val & 1); > -#endif > -} > - > -static uint32_t speaker_ioport_read (void *opaque, uint32_t addr) > -{ > -#if 0 > - int out; > - out =3D pit_get_out(pit, 2, qemu_get_clock_ns(vm_clock)); > - dummy_refresh_clock ^=3D 1; > - return (speaker_data_on << 1) | pit_get_gate(pit, 2) | (out << 5) = | > - (dummy_refresh_clock << 4); > -#endif > - return 0; > -} > - > /* PCI intack register */ > /* Read-only register (?) */ > static void PPC_intack_write (void *opaque, target_phys_addr_t addr, > @@ -526,6 +498,7 @@ static void ppc_prep_init (ram_addr_t ram_size, > SysBusDevice *sys; > PCIHostState *pcihost; > PCIBus *pci_bus; > + PCIDevice *pci; > ISABus *isa_bus; > qemu_irq *i8259; > qemu_irq *cpu_exit_irq; > @@ -629,13 +602,9 @@ static void ppc_prep_init (ram_addr_t ram_size, > } > } > =20 > - isa_mem_base =3D 0xc0000000; > if (PPC_INPUT(env) !=3D PPC_FLAGS_INPUT_6xx) { > hw_error("Only 6xx bus is supported on PREP machine\n"); > } > - /* Hmm, prep has no pci-isa bridge ??? */ > - isa_bus =3D isa_bus_new(NULL, get_system_io()); > - i8259 =3D i8259_init(isa_bus, first_cpu->irq_inputs[PPC6xx_INPUT_I= NT]); > =20 > dev =3D qdev_create(NULL, "raven-pcihost"); > sys =3D sysbus_from_qdev(dev); > @@ -648,13 +617,21 @@ static void ppc_prep_init (ram_addr_t ram_size, > fprintf(stderr, "Couldn't create PCI host controller.\n"); > exit(1); > } > + > + /* PCI -> ISA bridge */ > + pci =3D pci_create_simple(pci_bus, PCI_DEVFN(1, 0), "i82378"); > + cpu_exit_irq =3D qemu_allocate_irqs(cpu_request_exit, NULL, 1); > + qdev_connect_gpio_out(&pci->qdev, 0, > + first_cpu->irq_inputs[PPC6xx_INPUT_INT]); > + qdev_connect_gpio_out(&pci->qdev, 1, *cpu_exit_irq); > + isa_bus =3D DO_UPCAST(ISABus, qbus, qdev_get_child_bus(&pci->qdev,= "isa.0")); > + > + i8259 =3D isa_bus->irqs; I think this is unneeded. You only access i8259[8] later on for initializing the m48t59. But that one should be creatable as ISA device now (m48t59_init_isa), no? Please check. Jan --=20 Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux