Attention is currently required from: Alper Nebi Yasak, Arthur Heymans, Jianjun Wang, Nico Huber, Ron Minnich, Shelley Chen, Yu-Ping Wu.
Julius Werner has posted comments on this change by Alper Nebi Yasak. ( 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/d18f54b1_92d81a2e?usp... : PS5, Line 532: CPU communicate with peripheral devices over PCI I/O space.
`resource_t` is a mere integer. `struct resource` is used to describe resources, […]
Okay, sorry, I guess I meant `struct resource`. I was thinking of stuff like what `src/drivers/emulation/qemu/bochs.c` seems to do, where it gets a `struct resource` from the platform to represent its base address and whenever it wants to write to some register it uses a little helper that checks whether `res->flags & IORESOURCE_IO`, and uses that to decide whether to use I/O or MMIO accessors.
I was kinda assuming that that's how that whole coreboot device framework (which I don't really have any experience with because the non-PCI Arm drivers I usually worked on don't use it) works... that you have your `devicetree.cb` thing which says the platform has an instance of device X which is mapped at MMIO address Y (or I/O address Y), and then that somehow gets translated into a `struct resource` and passed to the X driver which can then use the address and flags in that struct to figure out how to talk to it. And if you're on an x86 device you can write your `devicetree.cb` such that it represents an I/O address, and if you're on an Arm device you write it such that it represents an MMIO address (and I guess you need to do the math to see where in your SoC's PCI MMIO window that thing falls by hand then when writing `devicetree.cb`, or maybe build some magic into sconfig that allows you to define the different PCI roots and have it do that math for you).
Is that not how it works?