Attention is currently required from: Alper Nebi Yasak, Arthur Heymans, Nico Huber, Shelley Chen, Yu-Ping Wu, ron minnich.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/80372?usp=email )
Change subject: arch/io.h: Add port I/O functions to other architectures ......................................................................
Patch Set 5:
(1 comment)
File src/device/Kconfig:
https://review.coreboot.org/c/coreboot/+/80372/comment/90ca6f44_118adbdf : PS5, Line 532: CPU communicate with peripheral devices over PCI I/O space.
There's definitely PCI hardware in the world that would need it. However, […]
+Shelley, +Yu-Ping, do you know more details about how PCI I/O accesses work on Arm? Do the PCI devices we've used for now just not use any I/O space resources, or how did we solve this problem there?
Sorry, I have to admit I know basically nothing about PCI and have no practical experience with those drivers. All I know is that from the point of view of an Arm CPU, there is no I/O bus and the concept of a global, peripheral-independent `inb()` function doesn't really make sense. However, if you say that it makes PCI programming and driver reuse easier in practice to treat it that way I might be swayed to see your point. The fact that Linux seems to do it this way as well is certainly a good argument.
So if we do translate this by just adding `CONFIG_PCI_IOBASE` to everything, where does that IOBASE come from in the hardware? Is this hardwired in the SoC? Is it dynamically set up somehow? If so, where does the address space come from? (In my experience, Arm SoCs don't tend to have the kind of "memory holes" in the middle of their DRAM that x86 has — DRAM is contiguous in linear address space and everything else has its own hardwired offsets.)
I mostly want to make sure that we can really have this thing in a Kconfig even if there are multiple PCI devices needing it or even multiple PCI controllers (is that a thing that happens in practice?) in the system. Is it really guaranteed to always just be a single global window that counts for everything?