diff mbox

[Qemu-ppc,v8,2/2] Add USB enablement on sPAPR platform.

Message ID 1344966575-25952-2-git-send-email-zhlcindy@linux.vnet.ibm.com
State New
Headers show

Commit Message

Li Zhang Aug. 14, 2012, 5:49 p.m. UTC
USB is enabled as default on sPAPR platform because it needs
USB keyboard and USB mouse when VGA is enabled.

This patch is to add USB controller on sPAPR platform.

Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
---
 hw/spapr.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Comments

Alexander Graf Aug. 14, 2012, 6:09 p.m. UTC | #1
On 14.08.2012, at 19:49, Li Zhang <zhlcindy@gmail.com> wrote:

> USB is enabled as default on sPAPR platform because it needs
> USB keyboard and USB mouse when VGA is enabled.
> 
> This patch is to add USB controller on sPAPR platform.
> 
> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>

This looks a lot better than the first version :).

Alex

> ---
> hw/spapr.c |    5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/spapr.c b/hw/spapr.c
> index 81c9343..b45401b 100644
> --- a/hw/spapr.c
> +++ b/hw/spapr.c
> @@ -710,6 +710,11 @@ static void ppc_spapr_init(ram_addr_t ram_size,
>         spapr_vscsi_create(spapr->vio_bus);
>     }
> 
> +    if (usb_enabled(true)) {
> +        pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus,
> +                          -1, "pci-ohci");
> +    }
> +
>     if (rma_size < (MIN_RMA_SLOF << 20)) {
>         fprintf(stderr, "qemu: pSeries SLOF firmware requires >= "
>                 "%ldM guest RMA (Real Mode Area memory)\n", MIN_RMA_SLOF);
> -- 
> 1.7.7.6
>
Li Zhang Aug. 15, 2012, 6 a.m. UTC | #2
On 2012年08月15日 02:09, Alexander Graf wrote:
>
> On 14.08.2012, at 19:49, Li Zhang <zhlcindy@gmail.com> wrote:
>
>> USB is enabled as default on sPAPR platform because it needs
>> USB keyboard and USB mouse when VGA is enabled.
>>
>> This patch is to add USB controller on sPAPR platform.
>>
>> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
> This looks a lot better than the first version :).
Thanks. :)
>
> Alex
>
>> ---
>> hw/spapr.c |    5 +++++
>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/spapr.c b/hw/spapr.c
>> index 81c9343..b45401b 100644
>> --- a/hw/spapr.c
>> +++ b/hw/spapr.c
>> @@ -710,6 +710,11 @@ static void ppc_spapr_init(ram_addr_t ram_size,
>>          spapr_vscsi_create(spapr->vio_bus);
>>      }
>>
>> +    if (usb_enabled(true)) {
Would you help replace "true" as "spapr->has_graphics" as your patch?
We think it should be better to set the default as true when 
spapr->has_graphics.
How do you think?
>> +        pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus,
>> +                          -1, "pci-ohci");
>> +    }
>> +
>>      if (rma_size < (MIN_RMA_SLOF << 20)) {
>>          fprintf(stderr, "qemu: pSeries SLOF firmware requires >= "
>>                  "%ldM guest RMA (Real Mode Area memory)\n", MIN_RMA_SLOF);
>> -- 
>> 1.7.7.6
>>
Alexander Graf Aug. 15, 2012, 7:02 a.m. UTC | #3
On 15.08.2012, at 08:00, Li Zhang <zhlcindy@linux.vnet.ibm.com> wrote:

> On 2012年08月15日 02:09, Alexander Graf wrote:
>> 
>> On 14.08.2012, at 19:49, Li Zhang <zhlcindy@gmail.com> wrote:
>> 
>>> USB is enabled as default on sPAPR platform because it needs
>>> USB keyboard and USB mouse when VGA is enabled.
>>> 
>>> This patch is to add USB controller on sPAPR platform.
>>> 
>>> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
>> This looks a lot better than the first version :).
> Thanks. :)
>> 
>> Alex
>> 
>>> ---
>>> hw/spapr.c |    5 +++++
>>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>> 
>>> diff --git a/hw/spapr.c b/hw/spapr.c
>>> index 81c9343..b45401b 100644
>>> --- a/hw/spapr.c
>>> +++ b/hw/spapr.c
>>> @@ -710,6 +710,11 @@ static void ppc_spapr_init(ram_addr_t ram_size,
>>>         spapr_vscsi_create(spapr->vio_bus);
>>>     }
>>> 
>>> +    if (usb_enabled(true)) {
> Would you help replace "true" as "spapr->has_graphics" as your patch?
> We think it should be better to set the default as true when spapr->has_graphics.
> How do you think?

Yes, that's pretty much what I was asking for (here and for the mac99 u3 machine). Just base your patch on ppc-next. My patches are in there.

Alex

>>> +        pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus,
>>> +                          -1, "pci-ohci");
>>> +    }
>>> +
>>>     if (rma_size < (MIN_RMA_SLOF << 20)) {
>>>         fprintf(stderr, "qemu: pSeries SLOF firmware requires >= "
>>>                 "%ldM guest RMA (Real Mode Area memory)\n", MIN_RMA_SLOF);
>>> -- 
>>> 1.7.7.6
>>> 
> 
> 
> -- 
> 
> Li Zhang
> IBM China Linux Technology Centre
>
Li Zhang Aug. 16, 2012, 1:29 a.m. UTC | #4
On 2012年08月15日 15:02, Alexander Graf wrote:
>
> On 15.08.2012, at 08:00, Li Zhang <zhlcindy@linux.vnet.ibm.com> wrote:
>
>> On 2012年08月15日 02:09, Alexander Graf wrote:
>>> On 14.08.2012, at 19:49, Li Zhang <zhlcindy@gmail.com> wrote:
>>>
>>>> USB is enabled as default on sPAPR platform because it needs
>>>> USB keyboard and USB mouse when VGA is enabled.
>>>>
>>>> This patch is to add USB controller on sPAPR platform.
>>>>
>>>> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
>>> This looks a lot better than the first version :).
>> Thanks. :)
>>> Alex
>>>
>>>> ---
>>>> hw/spapr.c |    5 +++++
>>>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/hw/spapr.c b/hw/spapr.c
>>>> index 81c9343..b45401b 100644
>>>> --- a/hw/spapr.c
>>>> +++ b/hw/spapr.c
>>>> @@ -710,6 +710,11 @@ static void ppc_spapr_init(ram_addr_t ram_size,
>>>>         spapr_vscsi_create(spapr->vio_bus);
>>>>     }
>>>>
>>>> +    if (usb_enabled(true)) {
>> Would you help replace "true" as "spapr->has_graphics" as your patch?
>> We think it should be better to set the default as true when spapr->has_graphics.
>> How do you think?
> Yes, that's pretty much what I was asking for (here and for the mac99 u3 machine). Just base your patch on ppc-next. My patches are in there.
That's great. Thanks a lot!
> Alex
>
>>>> +        pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus,
>>>> +                          -1, "pci-ohci");
>>>> +    }
>>>> +
>>>>     if (rma_size < (MIN_RMA_SLOF << 20)) {
>>>>         fprintf(stderr, "qemu: pSeries SLOF firmware requires >= "
>>>>                 "%ldM guest RMA (Real Mode Area memory)\n", MIN_RMA_SLOF);
>>>> -- 
>>>> 1.7.7.6
>>>>
>>
>> -- 
>>
>> Li Zhang
>> IBM China Linux Technology Centre
>>
Benjamin Herrenschmidt Aug. 16, 2012, 1:52 a.m. UTC | #5
On Thu, 2012-08-16 at 09:29 +0800, Li Zhang wrote:
> > Yes, that's pretty much what I was asking for (here and for the
> mac99 u3 machine). Just base your patch on ppc-next. My patches are in
> there.
> That's great. Thanks a lot!

Note that you missed the hard freeze for qemu 1.2, it was today.

So we'll have to do a simpler patch to wire up USB to pseries for 1.2
and delay your work for the next release.

Something along the lines in spapr.c of:

  if (usb_enabled) {
     instanciate ohci
     if (vga enabled) {
        add mouse & kbd
     }
  }
Cheers,
Ben.
David Gibson Aug. 16, 2012, 2:06 a.m. UTC | #6
On Thu, Aug 16, 2012 at 11:52:11AM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2012-08-16 at 09:29 +0800, Li Zhang wrote:
> > > Yes, that's pretty much what I was asking for (here and for the
> > mac99 u3 machine). Just base your patch on ppc-next. My patches are in
> > there.
> > That's great. Thanks a lot!
> 
> Note that you missed the hard freeze for qemu 1.2, it was today.
> 
> So we'll have to do a simpler patch to wire up USB to pseries for 1.2
> and delay your work for the next release.
> 
> Something along the lines in spapr.c of:
> 
>   if (usb_enabled) {
>      instanciate ohci
>      if (vga enabled) {
>         add mouse & kbd
>      }
>   }

I've just sent such a patch to Alex, so Li you can polish up your
patches so they're ready for 1.3.
Li Zhang Aug. 16, 2012, 2:15 a.m. UTC | #7
On Thu, Aug 16, 2012 at 9:52 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Thu, 2012-08-16 at 09:29 +0800, Li Zhang wrote:
>> > Yes, that's pretty much what I was asking for (here and for the
>> mac99 u3 machine). Just base your patch on ppc-next. My patches are in
>> there.
>> That's great. Thanks a lot!
>
> Note that you missed the hard freeze for qemu 1.2, it was today.
>
> So we'll have to do a simpler patch to wire up USB to pseries for 1.2
> and delay your work for the next release.
>
> Something along the lines in spapr.c of:
>
>   if (usb_enabled) {
>      instanciate ohci
>      if (vga enabled) {
>         add mouse & kbd
>      }
>   }

Oh, so sorry for that. I will do that for next release.

> Cheers,
> Ben.
>
>
Li Zhang Aug. 16, 2012, 2:17 a.m. UTC | #8
On Thu, Aug 16, 2012 at 10:06 AM, David Gibson <dwg@au1.ibm.com> wrote:
> On Thu, Aug 16, 2012 at 11:52:11AM +1000, Benjamin Herrenschmidt wrote:
>> On Thu, 2012-08-16 at 09:29 +0800, Li Zhang wrote:
>> > > Yes, that's pretty much what I was asking for (here and for the
>> > mac99 u3 machine). Just base your patch on ppc-next. My patches are in
>> > there.
>> > That's great. Thanks a lot!
>>
>> Note that you missed the hard freeze for qemu 1.2, it was today.
>>
>> So we'll have to do a simpler patch to wire up USB to pseries for 1.2
>> and delay your work for the next release.
>>
>> Something along the lines in spapr.c of:
>>
>>   if (usb_enabled) {
>>      instanciate ohci
>>      if (vga enabled) {
>>         add mouse & kbd
>>      }
>>   }
>
> I've just sent such a patch to Alex, so Li you can polish up your
> patches so they're ready for 1.3.

Oh, I see.
Thanks, David.
>
> --
> David Gibson                    | I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
>                                 | _way_ _around_!
> http://www.ozlabs.org/~dgibson
>
>
diff mbox

Patch

diff --git a/hw/spapr.c b/hw/spapr.c
index 81c9343..b45401b 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -710,6 +710,11 @@  static void ppc_spapr_init(ram_addr_t ram_size,
         spapr_vscsi_create(spapr->vio_bus);
     }
 
+    if (usb_enabled(true)) {
+        pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus,
+                          -1, "pci-ohci");
+    }
+
     if (rma_size < (MIN_RMA_SLOF << 20)) {
         fprintf(stderr, "qemu: pSeries SLOF firmware requires >= "
                 "%ldM guest RMA (Real Mode Area memory)\n", MIN_RMA_SLOF);