diff mbox

[9/9] PPC: Add USB per default on U3

Message ID 1263297526-13518-10-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf Jan. 12, 2010, 11:58 a.m. UTC
Linux with CONFIG_PPC64 doesn't support ADB devices anymore, so we have to
use USB for keyboard and mouse.

This patch enables USB per default on U3 and adds a virtual keyboard and mouse
there.

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

Comments

Andreas Färber Jan. 12, 2010, 9:54 p.m. UTC | #1
Am 12.01.2010 um 12:58 schrieb Alexander Graf:

> Linux with CONFIG_PPC64 doesn't support ADB devices anymore, so we  
> have to
> use USB for keyboard and mouse.
>
> This patch enables USB per default on U3 and adds a virtual keyboard  
> and mouse
> there.

Wasn't the PowerMac G3 blue&white (Yosemite) the first New World Mac?  
It had a USB keyboard and mouse and ADB for backwards compatibility.

> diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
> index c08211e..52a56e4 100644
> --- a/hw/ppc_newworld.c
> +++ b/hw/ppc_newworld.c

> @@ -353,12 +354,14 @@ static void ppc_core99_init (ram_addr_t  
> ram_size,
>     ide_mem_index[2] = pmac_ide_init(hd, pic[0x0e], dbdma, 0x1a,  
> pic[0x02]);
>
>     /* cuda also initialize ADB */
> +    if (machine_arch == ARCH_MAC99_U3) {
> +        usb_enabled = 1;
> +    }

I'd therefore propose to enable USB independently of U3 for the New  
World machine.

Andreas
Alexander Graf Jan. 12, 2010, 10:03 p.m. UTC | #2
On 12.01.2010, at 22:54, Andreas Färber wrote:

> 
> Am 12.01.2010 um 12:58 schrieb Alexander Graf:
> 
>> Linux with CONFIG_PPC64 doesn't support ADB devices anymore, so we have to
>> use USB for keyboard and mouse.
>> 
>> This patch enables USB per default on U3 and adds a virtual keyboard and mouse
>> there.
> 
> Wasn't the PowerMac G3 blue&white (Yosemite) the first New World Mac? It had a USB keyboard and mouse and ADB for backwards compatibility.
> 
>> diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
>> index c08211e..52a56e4 100644
>> --- a/hw/ppc_newworld.c
>> +++ b/hw/ppc_newworld.c
> 
>> @@ -353,12 +354,14 @@ static void ppc_core99_init (ram_addr_t ram_size,
>>    ide_mem_index[2] = pmac_ide_init(hd, pic[0x0e], dbdma, 0x1a, pic[0x02]);
>> 
>>    /* cuda also initialize ADB */
>> +    if (machine_arch == ARCH_MAC99_U3) {
>> +        usb_enabled = 1;
>> +    }
> 
> I'd therefore propose to enable USB independently of U3 for the New World machine.

Well USB comes with quite some overhead, so I'd like to only enable it only when necessary. On the U3 it is necessary, because we don't get a keyboard otherwise. On PPC32 Macs we can just not have USB and be happy.

Alex
diff mbox

Patch

diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
index c08211e..52a56e4 100644
--- a/hw/ppc_newworld.c
+++ b/hw/ppc_newworld.c
@@ -41,6 +41,7 @@ 
 #include "elf.h"
 #include "kvm.h"
 #include "kvm_ppc.h"
+#include "hw/usb.h"
 
 #define MAX_IDE_BUS 2
 #define VGA_BIOS_SIZE 65536
@@ -353,12 +354,14 @@  static void ppc_core99_init (ram_addr_t ram_size,
     ide_mem_index[2] = pmac_ide_init(hd, pic[0x0e], dbdma, 0x1a, pic[0x02]);
 
     /* cuda also initialize ADB */
+    if (machine_arch == ARCH_MAC99_U3) {
+        usb_enabled = 1;
+    }
     cuda_init(&cuda_mem_index, pic[0x19]);
 
     adb_kbd_init(&adb_bus);
     adb_mouse_init(&adb_bus);
 
-
     macio_init(pci_bus, PCI_DEVICE_ID_APPLE_UNI_N_KEYL, 0, pic_mem_index,
                dbdma_mem_index, cuda_mem_index, NULL, 3, ide_mem_index,
                escc_mem_index);
@@ -367,6 +370,13 @@  static void ppc_core99_init (ram_addr_t ram_size,
         usb_ohci_init_pci(pci_bus, -1);
     }
 
+    /* U3 needs to use USB for input because Linux doesn't support via-cuda
+       on PPC64 */
+    if (machine_arch == ARCH_MAC99_U3) {
+        usbdevice_create("keyboard");
+        usbdevice_create("mouse");
+    }
+
     if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8)
         graphic_depth = 15;