qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] PPC: Initialize OpenPIC properly
@ 2009-12-18 22:37 Alexander Graf
  2009-12-18 22:37 ` [Qemu-devel] [PATCH] PPC: Use interrupts for escc Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2009-12-18 22:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, Aurelien Jarno

When lowering an IRQ line, we search for the line we're supposed to lower.

Usually we run into an optimization there that queues up interrupts. This
queue ends with -1. Unfortunately we didn't set the first item to -1.

This patch fixes this, making interrupts work on PPC64.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/openpic.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/openpic.c b/hw/openpic.c
index 42db59d..1e4b3c1 100644
--- a/hw/openpic.c
+++ b/hw/openpic.c
@@ -442,7 +442,9 @@ static void openpic_reset (void *opaque)
 	opp->dst[i].pctp      = 0x0000000F;
 	opp->dst[i].pcsr      = 0x00000000;
 	memset(&opp->dst[i].raised, 0, sizeof(IRQ_queue_t));
+        opp->dst[i].raised.next = -1;
 	memset(&opp->dst[i].servicing, 0, sizeof(IRQ_queue_t));
+        opp->dst[i].servicing.next = -1;
     }
     /* Initialise timers */
     for (i = 0; i < MAX_TMR; i++) {
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH] PPC: Use interrupts for escc
  2009-12-18 22:37 [Qemu-devel] [PATCH] PPC: Initialize OpenPIC properly Alexander Graf
@ 2009-12-18 22:37 ` Alexander Graf
  2009-12-19 21:58   ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2009-12-18 22:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, Aurelien Jarno

When using the escc with Linux, we need interrupts. So instead of creating
a dummy device, let's just map them to the openpic we have anyways.

This makes Linux on PPC64 with console=ttyPZ0 work.

Obviously, this change needs to be reflected in openbios. Patch for that
follows this one. Please update the binary then.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc_newworld.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
index b29a7bc..a09f096 100644
--- a/hw/ppc_newworld.c
+++ b/hw/ppc_newworld.c
@@ -108,7 +108,6 @@ static void ppc_core99_init (ram_addr_t ram_size,
     MacIONVRAMState *nvr;
     int nvram_mem_index;
     int vga_bios_size, bios_size;
-    qemu_irq *dummy_irq;
     int pic_mem_index, dbdma_mem_index, cuda_mem_index, escc_mem_index;
     int ppc_boot_device;
     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
@@ -318,10 +317,7 @@ static void ppc_core99_init (ram_addr_t ram_size,
     /* init basic PC hardware */
     pci_vga_init(pci_bus, vga_bios_offset, vga_bios_size);
 
-    /* XXX: suppress that */
-    dummy_irq = i8259_init(NULL);
-
-    escc_mem_index = escc_init(0x80013000, dummy_irq[4], dummy_irq[5],
+    escc_mem_index = escc_init(0x80013000, pic[0x25], pic[0x24],
                                serial_hds[0], serial_hds[1], ESCC_CLOCK, 4);
 
     for(i = 0; i < nb_nics; i++)
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] PPC: Use interrupts for escc
  2009-12-18 22:37 ` [Qemu-devel] [PATCH] PPC: Use interrupts for escc Alexander Graf
@ 2009-12-19 21:58   ` Andreas Färber
  2009-12-19 22:08     ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2009-12-19 21:58 UTC (permalink / raw)
  To: Alexander Graf; +Cc: blauwirbel, qemu-devel, Aurelien Jarno

Am 18.12.2009 um 23:37 schrieb Alexander Graf:

> When using the escc with Linux, we need interrupts. So instead of  
> creating
> a dummy device, let's just map them to the openpic we have anyways.
>
> This makes Linux on PPC64 with console=ttyPZ0 work.

With these patches and OpenBIOS r646, booting 'install64' on the  
following Debian CDs worked for me:

debian-40r4a-powerpc-netinst.iso
debian-503-powerpc-netinst.iso

By default however you get the following error:

invalid/unsupported opcode: 1e - 12 - 1b (782106e4) 00000000014080e4 1
invalid/unsupported opcode: 00 - 00 - 00 (00000000) 0000000000008734 0

which translates to: qemu-system-ppc64 is using a 32-bit CPU by default.
'-cpu ppc64' (970FX according to OpenBIOS) worked, while '-cpu 970'  
was not recognized by OpenBIOS.

If you change only the CPU to 'ppc64', it will be rejected:
qemu: hardware error: Bus model not supported on OldWorld Mac machine

That's why Alex mentioned '-M mac99' elsewhere, I guess. Can't we  
change the defaults? I believe the G5 was the first 64-bit Mac and is  
considered New World, so Old World shouldn't even be selectable IMO.

`install64 console=ttyPZ0` only gets me to the penguin and appears to  
hang...
`install64` gets me through to the installer screen on Linux/amd64  
host. There are merely some FATALs visible while trying to load  
drivers for therm_* and windfarm_* devices ("No such device").

Andreas

> Obviously, this change needs to be reflected in openbios. Patch for  
> that
> follows this one. Please update the binary then.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> hw/ppc_newworld.c |    6 +-----
> 1 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
> index b29a7bc..a09f096 100644
> --- a/hw/ppc_newworld.c
> +++ b/hw/ppc_newworld.c
> @@ -108,7 +108,6 @@ static void ppc_core99_init (ram_addr_t ram_size,
>     MacIONVRAMState *nvr;
>     int nvram_mem_index;
>     int vga_bios_size, bios_size;
> -    qemu_irq *dummy_irq;
>     int pic_mem_index, dbdma_mem_index, cuda_mem_index,  
> escc_mem_index;
>     int ppc_boot_device;
>     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
> @@ -318,10 +317,7 @@ static void ppc_core99_init (ram_addr_t ram_size,
>     /* init basic PC hardware */
>     pci_vga_init(pci_bus, vga_bios_offset, vga_bios_size);
>
> -    /* XXX: suppress that */
> -    dummy_irq = i8259_init(NULL);
> -
> -    escc_mem_index = escc_init(0x80013000, dummy_irq[4],  
> dummy_irq[5],
> +    escc_mem_index = escc_init(0x80013000, pic[0x25], pic[0x24],
>                                serial_hds[0], serial_hds[1],  
> ESCC_CLOCK, 4);
>
>     for(i = 0; i < nb_nics; i++)
> -- 
> 1.6.0.2
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] PPC: Use interrupts for escc
  2009-12-19 21:58   ` Andreas Färber
@ 2009-12-19 22:08     ` Alexander Graf
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2009-12-19 22:08 UTC (permalink / raw)
  To: Andreas Färber
  Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org, Aurelien Jarno


Am 19.12.2009 um 22:58 schrieb Andreas Färber <andreas.faerber@web.de>:

> Am 18.12.2009 um 23:37 schrieb Alexander Graf:
>
>> When using the escc with Linux, we need interrupts. So instead of  
>> creating
>> a dummy device, let's just map them to the openpic we have anyways.
>>
>> This makes Linux on PPC64 with console=ttyPZ0 work.
>
> With these patches and OpenBIOS r646, booting 'install64' on the  
> following Debian CDs worked for me:
>
> debian-40r4a-powerpc-netinst.iso
> debian-503-powerpc-netinst.iso

Nice, interesting!

>
> By default however you get the following error:
>
> invalid/unsupported opcode: 1e - 12 - 1b (782106e4) 00000000014080e4 1
> invalid/unsupported opcode: 00 - 00 - 00 (00000000) 0000000000008734 0
>
> which translates to: qemu-system-ppc64 is using a 32-bit CPU by  
> default.
> '-cpu ppc64' (970FX according to OpenBIOS) worked, while '-cpu 970'  
> was not recognized by OpenBIOS.

Yes, I only test whatever I do with -cpu 970fx.

>
> If you change only the CPU to 'ppc64', it will be rejected:
> qemu: hardware error: Bus model not supported on OldWorld Mac machine
>
> That's why Alex mentioned '-M mac99' elsewhere, I guess. Can't we  
> change the defaults? I believe the G5 was the first 64-bit Mac and  
> is considered New World, so Old World shouldn't even be selectable  
> IMO.

I agree. Please send a patch, CC me and I'll ack it.

>
> `install64 console=ttyPZ0` only gets me to the penguin and appears  
> to hang...

Well, on older kernels this was console=ttyS0.

> `install64` gets me through to the installer screen on Linux/amd64  
> host. There are merely some FATALs visible while trying to load  
> drivers for therm_* and windfarm_* devices ("No such device").

Yesh, ADB shouldn't work either so you don't get input devices :-(.

Alex

>
> Andreas
>
>> Obviously, this change needs to be reflected in openbios. Patch for  
>> that
>> follows this one. Please update the binary then.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> hw/ppc_newworld.c |    6 +-----
>> 1 files changed, 1 insertions(+), 5 deletions(-)
>>
>> diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
>> index b29a7bc..a09f096 100644
>> --- a/hw/ppc_newworld.c
>> +++ b/hw/ppc_newworld.c
>> @@ -108,7 +108,6 @@ static void ppc_core99_init (ram_addr_t ram_size,
>>    MacIONVRAMState *nvr;
>>    int nvram_mem_index;
>>    int vga_bios_size, bios_size;
>> -    qemu_irq *dummy_irq;
>>    int pic_mem_index, dbdma_mem_index, cuda_mem_index,  
>> escc_mem_index;
>>    int ppc_boot_device;
>>    DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
>> @@ -318,10 +317,7 @@ static void ppc_core99_init (ram_addr_t  
>> ram_size,
>>    /* init basic PC hardware */
>>    pci_vga_init(pci_bus, vga_bios_offset, vga_bios_size);
>>
>> -    /* XXX: suppress that */
>> -    dummy_irq = i8259_init(NULL);
>> -
>> -    escc_mem_index = escc_init(0x80013000, dummy_irq[4], dummy_irq 
>> [5],
>> +    escc_mem_index = escc_init(0x80013000, pic[0x25], pic[0x24],
>>                               serial_hds[0], serial_hds[1],  
>> ESCC_CLOCK, 4);
>>
>>    for(i = 0; i < nb_nics; i++)
>> -- 
>> 1.6.0.2
>>
>>
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-19 22:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-18 22:37 [Qemu-devel] [PATCH] PPC: Initialize OpenPIC properly Alexander Graf
2009-12-18 22:37 ` [Qemu-devel] [PATCH] PPC: Use interrupts for escc Alexander Graf
2009-12-19 21:58   ` Andreas Färber
2009-12-19 22:08     ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).