[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/60] hw/block/fdc-isa: Implement relocation and enabling/disabli
From: |
Michael S. Tsirkin |
Subject: |
[PULL 28/60] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC |
Date: |
Wed, 14 Feb 2024 06:14:43 -0500 |
From: Bernhard Beschow <shentey@gmail.com>
The real SuperI/O chips emulated by QEMU allow for relocating and enabling or
disabling their SuperI/O functions via software. So far this is not implemented.
Prepare for that by adding isa_fdc_set_{enabled,iobase}.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-Id: <20240114123911.4877-8-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/hw/block/fdc.h | 3 +++
hw/block/fdc-isa.c | 14 ++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h
index 35248c0837..c367c5efea 100644
--- a/include/hw/block/fdc.h
+++ b/include/hw/block/fdc.h
@@ -14,6 +14,9 @@ void fdctrl_init_sysbus(qemu_irq irq, hwaddr mmio_base,
DriveInfo **fds);
void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base,
DriveInfo **fds, qemu_irq *fdc_tc);
+void isa_fdc_set_iobase(ISADevice *fdc, hwaddr iobase);
+void isa_fdc_set_enabled(ISADevice *fdc, bool enabled);
+
FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i);
int cmos_get_fd_drive_type(FloppyDriveType fd0);
diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c
index 2d8a98ce7d..e43dc532af 100644
--- a/hw/block/fdc-isa.c
+++ b/hw/block/fdc-isa.c
@@ -192,6 +192,20 @@ static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
return dev;
}
+void isa_fdc_set_iobase(ISADevice *fdc, hwaddr iobase)
+{
+ FDCtrlISABus *isa = ISA_FDC(fdc);
+
+ fdc->ioport_id = iobase;
+ isa->iobase = iobase;
+ portio_list_set_address(&isa->portio_list, isa->iobase);
+}
+
+void isa_fdc_set_enabled(ISADevice *fdc, bool enabled)
+{
+ portio_list_set_enabled(&ISA_FDC(fdc)->portio_list, enabled);
+}
+
int cmos_get_fd_drive_type(FloppyDriveType fd0)
{
int val;
--
MST
- [PULL 17/60] amd_iommu: report x2APIC support to the operating system, (continued)
- [PULL 17/60] amd_iommu: report x2APIC support to the operating system, Michael S. Tsirkin, 2024/02/14
- [PULL 18/60] test: bios-tables-test: add IVRS changed binary, Michael S. Tsirkin, 2024/02/14
- [PULL 19/60] hw/i386/x86: Reverse if statement, Michael S. Tsirkin, 2024/02/14
- [PULL 20/60] hw/i386/x86: Fix PIC interrupt handling if APIC is globally disabled, Michael S. Tsirkin, 2024/02/14
- [PULL 21/60] target/i386/cpu: Fix typo in comment, Michael S. Tsirkin, 2024/02/14
- [PULL 23/60] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus, Michael S. Tsirkin, 2024/02/14
- [PULL 24/60] hw/char/parallel: Move portio_list from ParallelState to ISAParallelState, Michael S. Tsirkin, 2024/02/14
- [PULL 25/60] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio, Michael S. Tsirkin, 2024/02/14
- [PULL 26/60] exec/ioport: Add portio_list_set_address(), Michael S. Tsirkin, 2024/02/14
- [PULL 27/60] exec/ioport: Add portio_list_set_enabled(), Michael S. Tsirkin, 2024/02/14
- [PULL 28/60] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC,
Michael S. Tsirkin <=
- [PULL 29/60] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL, Michael S. Tsirkin, 2024/02/14
- [PULL 30/60] hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL, Michael S. Tsirkin, 2024/02/14
- [PULL 31/60] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions, Michael S. Tsirkin, 2024/02/14
- [PULL 32/60] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Michael S. Tsirkin, 2024/02/14
- [PULL 33/60] vhost-user.rst: Fix vring address description, Michael S. Tsirkin, 2024/02/14
- [PULL 35/60] virtio_iommu: Clear IOMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 36/60] smmu: Clear SMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 34/60] MAINTAINERS: Drop myself as VT-d maintainers, Michael S. Tsirkin, 2024/02/14
- [PULL 40/60] cxl/cdat: Fix header sum value in CDAT checksum, Michael S. Tsirkin, 2024/02/14
- [PULL 39/60] hw/pci-bridge/cxl_upstream: Drop g_malloc() failure handling, Michael S. Tsirkin, 2024/02/14