From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LN72F-0000mi-HR for qemu-devel@nongnu.org; Wed, 14 Jan 2009 09:47:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LN72E-0000lv-GH for qemu-devel@nongnu.org; Wed, 14 Jan 2009 09:47:59 -0500 Received: from [199.232.76.173] (port=48444 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LN72E-0000lo-90 for qemu-devel@nongnu.org; Wed, 14 Jan 2009 09:47:58 -0500 Received: from savannah.gnu.org ([199.232.41.3]:50573 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LN72D-00054v-VM for qemu-devel@nongnu.org; Wed, 14 Jan 2009 09:47:58 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LN72D-0005aI-5Z for qemu-devel@nongnu.org; Wed, 14 Jan 2009 14:47:57 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LN72C-0005aE-Tl for qemu-devel@nongnu.org; Wed, 14 Jan 2009 14:47:57 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Wed, 14 Jan 2009 14:47:56 +0000 Subject: [Qemu-devel] [6295] escc: allow one IRQ per serial channel Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6295 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6295 Author: aurel32 Date: 2009-01-14 14:47:56 +0000 (Wed, 14 Jan 2009) Log Message: ----------- escc: allow one IRQ per serial channel The Z85C30 on the PowerMAC machines have one interrupt per serial channel, while the Sparc machines have only one for both. Allow the emulated device to use one IRQ per channel. Patch by Laurent Vivier. Modified Paths: -------------- trunk/hw/escc.c trunk/hw/escc.h trunk/hw/ppc_chrp.c trunk/hw/ppc_oldworld.c trunk/hw/sun4m.c Modified: trunk/hw/escc.c =================================================================== --- trunk/hw/escc.c 2009-01-14 14:47:46 UTC (rev 6294) +++ trunk/hw/escc.c 2009-01-14 14:47:56 UTC (rev 6295) @@ -719,8 +719,9 @@ } -int escc_init(target_phys_addr_t base, qemu_irq irq, CharDriverState *chrA, - CharDriverState *chrB, int clock, int it_shift) +int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB, + CharDriverState *chrA, CharDriverState *chrB, + int clock, int it_shift) { int escc_io_memory, i; SerialState *s; @@ -741,9 +742,10 @@ s->chn[1].chr = chrA; s->chn[0].disabled = 0; s->chn[1].disabled = 0; + s->chn[0].irq = irqB; + s->chn[1].irq = irqA; for (i = 0; i < 2; i++) { - s->chn[i].irq = irq; s->chn[i].chn = 1 - i; s->chn[i].type = ser; s->chn[i].clock = clock / 2; Modified: trunk/hw/escc.h =================================================================== --- trunk/hw/escc.h 2009-01-14 14:47:46 UTC (rev 6294) +++ trunk/hw/escc.h 2009-01-14 14:47:56 UTC (rev 6295) @@ -1,7 +1,8 @@ /* escc.c */ #define ESCC_SIZE 4 -int escc_init(target_phys_addr_t base, qemu_irq irq, CharDriverState *chrA, - CharDriverState *chrB, int clock, int it_shift); +int escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB, + CharDriverState *chrA, CharDriverState *chrB, + int clock, int it_shift); void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq, int disabled, int clock, int it_shift); Modified: trunk/hw/ppc_chrp.c =================================================================== --- trunk/hw/ppc_chrp.c 2009-01-14 14:47:46 UTC (rev 6294) +++ trunk/hw/ppc_chrp.c 2009-01-14 14:47:56 UTC (rev 6295) @@ -263,8 +263,8 @@ /* XXX: suppress that */ dummy_irq = i8259_init(NULL); - escc_mem_index = escc_init(0x80013000, dummy_irq[4], serial_hds[0], - serial_hds[1], ESCC_CLOCK, 4); + escc_mem_index = escc_init(0x80013000, dummy_irq[4], dummy_irq[5], + serial_hds[0], serial_hds[1], ESCC_CLOCK, 4); for(i = 0; i < nb_nics; i++) pci_nic_init(pci_bus, &nd_table[i], -1, "ne2k_pci"); Modified: trunk/hw/ppc_oldworld.c =================================================================== --- trunk/hw/ppc_oldworld.c 2009-01-14 14:47:46 UTC (rev 6294) +++ trunk/hw/ppc_oldworld.c 2009-01-14 14:47:56 UTC (rev 6295) @@ -304,7 +304,7 @@ /* XXX: suppress that */ dummy_irq = i8259_init(NULL); - escc_mem_index = escc_init(0x80013000, pic[0x10], serial_hds[0], + escc_mem_index = escc_init(0x80013000, pic[0x0f], pic[0x10], serial_hds[0], serial_hds[1], ESCC_CLOCK, 4); for(i = 0; i < nb_nics; i++) Modified: trunk/hw/sun4m.c =================================================================== --- trunk/hw/sun4m.c 2009-01-14 14:47:46 UTC (rev 6294) +++ trunk/hw/sun4m.c 2009-01-14 14:47:56 UTC (rev 6295) @@ -548,8 +548,8 @@ nographic, ESCC_CLOCK, 1); // Slavio TTYA (base+4, Linux ttyS0) is the first Qemu serial device // Slavio TTYB (base+0, Linux ttyS1) is the second Qemu serial device - escc_init(hwdef->serial_base, slavio_irq[hwdef->ser_irq], serial_hds[0], - serial_hds[1], ESCC_CLOCK, 1); + escc_init(hwdef->serial_base, slavio_irq[hwdef->ser_irq], slavio_irq[hwdef->ser_irq], + serial_hds[0], serial_hds[1], ESCC_CLOCK, 1); cpu_halt = qemu_allocate_irqs(cpu_halt_signal, NULL, 1); slavio_misc = slavio_misc_init(hwdef->slavio_base, hwdef->apc_base, @@ -1331,8 +1331,8 @@ nographic, ESCC_CLOCK, 1); // Slavio TTYA (base+4, Linux ttyS0) is the first Qemu serial device // Slavio TTYB (base+0, Linux ttyS1) is the second Qemu serial device - escc_init(hwdef->serial_base, sbi_irq[hwdef->ser_irq], serial_hds[0], - serial_hds[1], ESCC_CLOCK, 1); + escc_init(hwdef->serial_base, sbi_irq[hwdef->ser_irq], sbi_irq[hwdef->ser_irq], + serial_hds[0], serial_hds[1], ESCC_CLOCK, 1); if (drive_get_max_bus(IF_SCSI) > 0) { fprintf(stderr, "qemu: too many SCSI bus\n"); @@ -1534,8 +1534,9 @@ nographic, ESCC_CLOCK, 1); // Slavio TTYA (base+4, Linux ttyS0) is the first Qemu serial device // Slavio TTYB (base+0, Linux ttyS1) is the second Qemu serial device - escc_init(hwdef->serial_base, slavio_irq[hwdef->ser_irq], serial_hds[0], - serial_hds[1], ESCC_CLOCK, 1); + escc_init(hwdef->serial_base, slavio_irq[hwdef->ser_irq], + slavio_irq[hwdef->ser_irq], serial_hds[0], serial_hds[1], + ESCC_CLOCK, 1); slavio_misc = slavio_misc_init(0, 0, hwdef->aux1_base, 0, slavio_irq[hwdef->me_irq], NULL, &fdc_tc);