[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2205041226160.64942@angie.orcam.me.uk>
Date: Wed, 4 May 2022 12:46:41 +0100 (BST)
From: "Maciej W. Rozycki" <macro@...am.me.uk>
To: David Laight <David.Laight@...LAB.COM>
cc: 'Linus Walleij' <linus.walleij@...aro.org>,
William Breathitt Gray <william.gray@...aro.org>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
Arnd Bergmann <arnd@...nel.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>
Subject: RE: [RFC v2 10/39] gpio: add HAS_IOPORT dependencies
On Tue, 3 May 2022, David Laight wrote:
> > > There is such a thing as ISA DMA, but you'll still need to initialize
> > > the device via the IO Port bus first, so perhaps setting HAS_IOPORT for
> > > "config ISA" is the right thing to do: all ISA devices are expected to
> > > communicate in some way via ioport.
> >
> > Adding that dependency seems like the right solution to me.
>
> I think it all depends on what HAS_IOPORT is meant to mean and
> how portable kernel binaries need to be.
>
> x86 is (probably) the only architecture that actually has 'in'
> and 'out' instructions - but that doesn't mean that some other
> cpu (and I mean cpu+pcb not architecture) have the ability to
> generate 'IO' bus cycles on a specific physical bus.
I am fairly sure IA-64 has some form of IN/OUT machine instructions too.
> While the obvious case is a physical address window that generates
> PCI(e) IO cycles from normal memory cycles it isn't the only one.
>
> I've used sparc cpu systems that have pcmcia card slots.
> These are pretty much ISA and the drivers might expect to
> access port 0x300 (etc) - certainly that would be right on x86.
>
> In this case is isn't so much that the ISA_BUS depends on support
> for in/out but that presence of the ISA bus provides the required
> in/out support.
Well, one can implement a pluggable PCI/e expansion card with a PCI-ISA
bridge on it and a backplane to plug ISA cards into. Without support for
issuing I/O cycles to PCI from the host however you won't be able to make
use of the ISA backplane except maybe for some ancient ISA memory cards.
So logically I think CONFIG_ISA should depend on CONFIG_HAS_IOPORT and
CONFIG_HAS_IOPORT ought to be selected by platform configurations.
ISTR there was a company that manufactured a USB-ISA option (providing an
external ISA backplane). We never supported it, but in principle if we
wanted to, then it would be the USB-ISA device's driver config option that
CONFIG_ISA would additionally depend on as an alternative. That wouldn't
enable CONFIG_HAS_IOPORT though because the presence of this particular
USB-ISA device would not itself permit the use of I/O cycles with any
PCI/e buses a machine might independently have, so devices for PCI/e
options that require port I/O shouldn't be made available at the same
time.
I think that company might have actually manufactured a similar PCI-ISA
option as well, but that I suppose did rely on support for I/O cycles on
PCI. Early 2000s BTW.
Maciej
Powered by blists - more mailing lists