Re: [REGRESSION] mipsel: no RTC CMOS on the Malta platform in QEMU

From: Arnd Bergmann
Date: Tue Jan 14 2025 - 05:31:05 EST


On Tue, Jan 14, 2025, at 11:09, Jiaxun Yang wrote:
> 在2025年1月14日一月 上午8:02,Geert Uytterhoeven写道:
>>
>> Shouldn't arch/mips/include/asm/io.h do
>>
>> #define PCI_IOBASE mips_io_port_base
>>
>> unconditionally, _before_ including <asm-generic/io.h>?
>
> The problem here is defining PCI_IOBASE implied use of logic_pio and VM mapped
> io access, which is not true for many MIPS systems...
>

I don't think that was ever meant to be the intention of the
#ifdef in drivers/pci/pci.c. Checking for PCI_IOBASE there
should mainly ensure the default
pci_pio_to_address/pci_address_to_pio don't cause a link
failure on architectures that don't have any memory mapped
PIO at all.

For MIPS platforms that don't need logic_pio because all of
the PIO space is mapped to a fixed physical address, the
default pci_remap_iospace/pci_pio_to_address/pci_address_to_pio/
pci_register_io_range could just be replaced with a trivial
architecture/platform specific version.

Arnd