Re: `io{re,un}map()` build error in s390 under `!CONFIG_HAS_IOMEM`
"Arnd Bergmann" <[email protected]>
| Newsgroups | org.kernel.vger.rust-for-linux,dev.linux.lists.driver-core,org.kernel.vger.linux-arch,org.kernel.vger.linux-s390 |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 12, 2026, at 13:19, Maciej W. Rozycki wrote:
> On Tue, 4 Aug 2026, Arnd Bergmann wrote:
>
>> arch/um is the only other one that does not always enable HAS_IOMEM,
>> though most m68k targets don't have any support for ISA/PCI style
>> MMIO or PIO and probably should not enable it in theory.
>
> While HAS_IOPORT is indeed a feature that has propagated from Intel x86
> (or really 8080, etc.) to non-x86 systems through ISA/PCI what's been so
> special about ISA/PCI WRT HAS_IOMEM?
>
> AFAICT HAS_IOMEM is all about just having peripherals located in the
> CPU's regular memory addressing space. All the DEC MIPS platforms fall
> into this category, never seen PCI/ISA, some have no peripheral bus.
To me this is more about the driver model: On most architectures,
you can use portable drivers that use IORESOURCE_MEM resources
with ioremap() and the do readl()/writel() on those to access
little-endian registers.
s390 and um only support this conceptually for PCI devices,
and the HW implementation is different enough that the abstraction
breaks down in some cases (like memremap()). m68k Amiga is
similar to decstation I think, in that it has devices that are
memory mapped, but they are always visible in the kernel address
space and are accessed through their own abstraction instead of
readl()/writel(). m68k q40 does have ISA devices with both
port and memory accesses that can use portable drivers. I think
other m68k platforms use a mix of ioremap()/readl()/writel()
and their own lower-level accessors based on the driver, but
none of those drivers are shared with another platform.
Arnd