[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/60] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O fu
From: |
Michael S. Tsirkin |
Subject: |
[PULL 31/60] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions |
Date: |
Wed, 14 Feb 2024 06:14:52 -0500 |
From: Bernhard Beschow <shentey@gmail.com>
This is a preparation for implementing relocation and toggling of SuperI/O
functions in the VT8231 device model. Upon reset, all SuperI/O functions will be
deactivated, so in case if no -bios is given, let the machine configure those
functions the same way Pegasos II firmware would do.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <20240114123911.4877-11-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/ppc/pegasos2.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index d84f3f977d..04d6decb2b 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -285,6 +285,12 @@ static void pegasos2_pci_config_write(Pegasos2MachineState
*pm, int bus,
pegasos2_mv_reg_write(pm, pcicfg + 4, len, val);
}
+static void pegasos2_superio_write(uint8_t addr, uint8_t val)
+{
+ cpu_physical_memory_write(PCI1_IO_BASE + 0x3f0, &addr, 1);
+ cpu_physical_memory_write(PCI1_IO_BASE + 0x3f1, &val, 1);
+}
+
static void pegasos2_machine_reset(MachineState *machine, ShutdownCause reason)
{
Pegasos2MachineState *pm = PEGASOS2_MACHINE(machine);
@@ -310,6 +316,12 @@ static void pegasos2_machine_reset(MachineState *machine,
ShutdownCause reason)
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
PCI_INTERRUPT_LINE, 2, 0x9);
+ pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
+ 0x50, 1, 0x6);
+ pegasos2_superio_write(0xf4, 0xbe);
+ pegasos2_superio_write(0xf6, 0xef);
+ pegasos2_superio_write(0xf7, 0xfc);
+ pegasos2_superio_write(0xf2, 0x14);
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
0x50, 1, 0x2);
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) |
--
MST
- [PULL 20/60] hw/i386/x86: Fix PIC interrupt handling if APIC is globally disabled, (continued)
- [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, 2024/02/14
- [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 <=
- [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
- [PULL 41/60] hw/cxl/mbox: Remove dead code, Michael S. Tsirkin, 2024/02/14
- [PULL 42/60] hw/cxl/device: read from register values in mdev_reg_read(), Michael S. Tsirkin, 2024/02/14
- [PULL 46/60] tests/acpi: Allow update of DSDT.cxl, Michael S. Tsirkin, 2024/02/14