Skip to contentSkip to conversation

hw/block/fdc-isa: Respect QOM properties when building AML

PATCH Applied Bernhard Beschow 3 participants 3 messages Feb 9, 2022 – Feb 11, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/block/fdc-isa: Respect QOM properties when building AML

Other ISA devices such as serial-isa use the properties in their build_aml functions. fdc-isa not using them is probably an oversight.

---
 hw/block/fdc-isa.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
hw/block/fdc-isa.c +7 -4
index 3bf64e0665..ab663dce93 100644
@@ -216,6 +216,7 @@ int cmos_get_fd_drive_type(FloppyDriveType fd0)
 
 static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
 {
+    FDCtrlISABus *isa = ISA_FDC(isadev);
     Aml *dev;
     Aml *crs;
     int i;
@@ -227,11 +228,13 @@ static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
     };
 
     crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04));
-    aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01));
-    aml_append(crs, aml_irq_no_flags(6));
     aml_append(crs,
-        aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2));
+        aml_io(AML_DECODE16, isa->iobase + 2, isa->iobase + 2, 0x00, 0x04));
+    aml_append(crs,
+        aml_io(AML_DECODE16, isa->iobase + 7, isa->iobase + 7, 0x00, 0x01));
+    aml_append(crs, aml_irq_no_flags(isa->irq));
+    aml_append(crs,
+        aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, isa->dma));
 
     dev = aml_device("FDC0");
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700")));
Signature · 1 line
2.35.1
Reviewed-by Philippe Mathieu-Daudé on v1 1/1
#1 lore raw
Quoted 28 lines · Bernhard Beschow

Other ISA devices such as serial-isa use the properties in their build_aml functions. fdc-isa not using them is probably an oversight.

---
  hw/block/fdc-isa.c | 11 +++++++----
  1 file changed, 7 insertions(+), 4 deletions(-)
hw/block/fdc-isa.c +1 -3
index 3bf64e0665..ab663dce93 100644
@@ -216,6 +216,7 @@ int cmos_get_fd_drive_type(FloppyDriveType fd0)
 
  static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
  {
+    FDCtrlISABus *isa = ISA_FDC(isadev);
      Aml *dev;
      Aml *crs;
      int i;
@@ -227,11 +228,13 @@ static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
      };
 
      crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04));
-    aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01));
-    aml_append(crs, aml_irq_no_flags(6));
      aml_append(crs,

hw/block/fdc-isa.c static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) · line 240

Quoted 10 lines
hw/block/fdc-isa.c +6 -1
-        aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2));
+        aml_io(AML_DECODE16, isa->iobase + 2, isa->iobase + 2, 0x00, 0x04));
+    aml_append(crs,
+        aml_io(AML_DECODE16, isa->iobase + 7, isa->iobase + 7, 0x00, 0x01));
+    aml_append(crs, aml_irq_no_flags(isa->irq));
+    aml_append(crs,
+        aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, isa->dma));
 
      dev = aml_device("FDC0");
      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700")));