[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 10/11] hw/ppc/pegasos2: Let pegasos2 machine configure Sup
From: |
Bernhard Beschow |
Subject: |
Re: [PATCH v4 10/11] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions |
Date: |
Mon, 08 Jan 2024 19:54:34 +0000 |
Am 7. Januar 2024 13:54:57 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>On Sat, 6 Jan 2024, Bernhard Beschow wrote:
>> 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>
>> ---
>> hw/ppc/pegasos2.c | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
>> index 3203a4a728..0a40ebd542 100644
>> --- a/hw/ppc/pegasos2.c
>> +++ b/hw/ppc/pegasos2.c
>> @@ -285,6 +285,15 @@ static void
>> pegasos2_pci_config_write(Pegasos2MachineState *pm, int bus,
>> pegasos2_mv_reg_write(pm, pcicfg + 4, len, val);
>> }
>>
>> +static void pegasos2_superio_write(Pegasos2MachineState *pm, uint32_t addr,
>> + uint32_t val)
>> +{
>> + AddressSpace *as = CPU(pm->cpu)->as;
>
>I think this function should not need Pegasos2MachineState *pm and can just
>use cpu_physical_memory_write() instead.
Okay, I'll change it.
Best regards,
Bernhard
> Otherwise
>
>Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
>
>> +
>> + stb_phys(as, PCI1_IO_BASE + 0x3f0, addr);
>> + stb_phys(as, PCI1_IO_BASE + 0x3f1, val);
>> +}
>> +
>> static void pegasos2_machine_reset(MachineState *machine, ShutdownCause
>> reason)
>> {
>> Pegasos2MachineState *pm = PEGASOS2_MACHINE(machine);
>> @@ -310,6 +319,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(pm, 0xf4, 0xbe);
>> + pegasos2_superio_write(pm, 0xf6, 0xef);
>> + pegasos2_superio_write(pm, 0xf7, 0xfc);
>> + pegasos2_superio_write(pm, 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) |
>>
- [PATCH v4 02/11] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus, (continued)
- [PATCH v4 02/11] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus, Bernhard Beschow, 2024/01/06
- [PATCH v4 03/11] hw/char/parallel: Move portio_list from ParallelState to ISAParallelState, Bernhard Beschow, 2024/01/06
- [PATCH v4 04/11] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio, Bernhard Beschow, 2024/01/06
- [PATCH v4 05/11] exec/ioport: Add portio_list_set_address(), Bernhard Beschow, 2024/01/06
- [PATCH v4 06/11] exec/ioport: Add portio_list_set_enabled(), Bernhard Beschow, 2024/01/06
- [PATCH v4 08/11] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL, Bernhard Beschow, 2024/01/06
- [PATCH v4 07/11] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC, Bernhard Beschow, 2024/01/06
- [PATCH v4 09/11] hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL, Bernhard Beschow, 2024/01/06
- [PATCH v4 10/11] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions, Bernhard Beschow, 2024/01/06
- [PATCH v4 11/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Bernhard Beschow, 2024/01/06
- Re: [PATCH v4 00/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Mark Cave-Ayland, 2024/01/07