Re: [RFC v2 29/39] rtc: add HAS_IOPORT dependencies

From: Maciej W. Rozycki
Date: Wed Jun 01 2022 - 08:25:43 EST


On Fri, 29 Apr 2022, Niklas Schnelle wrote:

> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 41c65b4d2baf..e1bb11a225b2 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -951,6 +951,7 @@ comment "Platform RTC drivers"
> config RTC_DRV_CMOS
> tristate "PC-style 'CMOS'"
> depends on X86 || ARM || PPC || MIPS || SPARC64
> + depends on HAS_IOPORT

Umm, I missed this one previously and this is wrong. We use this driver
for the DECstation machines (CONFIG_MIPS/CONFIG_MACH_DECSTATION) and those
do not use (nor indeed have) port I/O as they are TURBOchannel systems and
they only have a single (memory) address space. Consequently their DS1287
chip is memory-mapped (in a linear fashion actually, i.e. there's no
visible address/data register and individual locations are accessible with
single CPU instructions), cf. arch/mips/include/asm/mach-dec/mc146818rtc.h
(that probably ought to be converted to `readb'/`writeb' one day).

So this has to be sorted differently, perhaps by just:

+ depends on HAS_IOPORT || MACH_DECSTATION

Note that other machines handled by the MIPS port do use port I/O, cf.
arch/mips/include/asm/mach-*/mc146818rtc.h.

Maciej