Patchwork mips malta: Fix fdc regression

login
register
mail settings
Submitter Stefan Weil
Date Aug. 27, 2009, 6:17 a.m.
Message ID <1251353872-16463-1-git-send-email-weil@mail.berlios.de>
Download mbox | patch
Permalink /patch/32221/
State Superseded
Headers show

Comments

Stefan Weil - Aug. 27, 2009, 6:17 a.m.
8baf73adf664e79eae201c3f618078a220a661d9 (qdev/isa: convert fdc)
breaks MIPS Malta:

Tried to create isa device isa-fdc with no isa bus present

Fix this by creating an isa bus for piix4
and convert initialization code for i8042
in mips_malta.c to new style (copy from pc.c)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 hw/mips_malta.c |    6 +++++-
 hw/piix_pci.c   |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)
Stefan Weil - Aug. 28, 2009, 11:47 a.m.
Stefan Weil schrieb:
> 8baf73adf664e79eae201c3f618078a220a661d9 (qdev/isa: convert fdc)
> breaks MIPS Malta:
>
> Tried to create isa device isa-fdc with no isa bus present
>
> Fix this by creating an isa bus for piix4
> and convert initialization code for i8042
> in mips_malta.c to new style (copy from pc.c)
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  hw/mips_malta.c |    6 +++++-
>  hw/piix_pci.c   |    1 +
>  2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/hw/mips_malta.c b/hw/mips_malta.c
> index d8fa264..e4421a6 100644
> --- a/hw/mips_malta.c
> +++ b/hw/mips_malta.c
> @@ -764,6 +764,7 @@ void mips_malta_init (ram_addr_t ram_size,
>      target_long bios_size;
>      int64_t kernel_entry;
>      PCIBus *pci_bus;
> +    ISADevice *isa_dev;
>      CPUState *env;
>      RTCState *rtc_state;
>      fdctrl_t *floppy_controller;
> @@ -919,7 +920,10 @@ void mips_malta_init (ram_addr_t ram_size,
>      DMA_init(0);
>  
>      /* Super I/O */
> -    i8042_init(i8259[1], i8259[12], 0x60);
> +    isa_dev = isa_create_simple("i8042", 0x60, 0x64);
> +    isa_connect_irq(isa_dev, 0, i8259[1]);
> +    isa_connect_irq(isa_dev, 1, i8259[12]);
> + 
>      rtc_state = rtc_init(0x70, i8259[8], 2000);
>      serial_init(0x3f8, i8259[4], 115200, serial_hds[0]);
>      serial_init(0x2f8, i8259[3], 115200, serial_hds[1]);
> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> index e2ddf4b..736fca4 100644
> --- a/hw/piix_pci.c
> +++ b/hw/piix_pci.c
> @@ -362,6 +362,7 @@ static void piix4_initfn(PCIDevice *d)
>  {
>      uint8_t *pci_conf;
>  
> +    isa_bus_new(&d->qdev);
>      register_savevm("PIIX4", 0, 2, piix_save, piix_load, d);
>  
>      pci_conf = d->config;
>   

The patch no longer applies because i8042_init changed in latest QEMU.
I'll split it in two independent new patches.

Regards
Stefan

Patch

diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index d8fa264..e4421a6 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -764,6 +764,7 @@  void mips_malta_init (ram_addr_t ram_size,
     target_long bios_size;
     int64_t kernel_entry;
     PCIBus *pci_bus;
+    ISADevice *isa_dev;
     CPUState *env;
     RTCState *rtc_state;
     fdctrl_t *floppy_controller;
@@ -919,7 +920,10 @@  void mips_malta_init (ram_addr_t ram_size,
     DMA_init(0);
 
     /* Super I/O */
-    i8042_init(i8259[1], i8259[12], 0x60);
+    isa_dev = isa_create_simple("i8042", 0x60, 0x64);
+    isa_connect_irq(isa_dev, 0, i8259[1]);
+    isa_connect_irq(isa_dev, 1, i8259[12]);
+ 
     rtc_state = rtc_init(0x70, i8259[8], 2000);
     serial_init(0x3f8, i8259[4], 115200, serial_hds[0]);
     serial_init(0x2f8, i8259[3], 115200, serial_hds[1]);
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index e2ddf4b..736fca4 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -362,6 +362,7 @@  static void piix4_initfn(PCIDevice *d)
 {
     uint8_t *pci_conf;
 
+    isa_bus_new(&d->qdev);
     register_savevm("PIIX4", 0, 2, piix_save, piix_load, d);
 
     pci_conf = d->config;