Re: [PATCH v4 10/37] sh: Common PCI framework support

"Arnd Bergmann" <[email protected]>
Newsgroups gmane.linux.ports.sh.devel
Message-ID <[email protected]>
On Tue, Nov 14, 2023, at 03:00, Yoshinori Sato wrote:
> When CONFIG_OF=y, a common PCI framework is used.
> The new driver also needs to reference PCI headers, so move the
> necessary header files to a public location rather than a private one.
>
> Signed-off-by: Yoshinori Sato <[email protected]>
> ---
>  arch/sh/include/asm/io.h                      | 40 +++++++++++++------
>  .../sh/{drivers/pci => include/asm}/pci-sh4.h |  7 ++--
>  .../{drivers/pci => include/asm}/pci-sh7751.h |  0
>  .../{drivers/pci => include/asm}/pci-sh7780.h |  0
>  arch/sh/include/asm/pci.h                     |  4 ++

I think ideally the PCI host driver should be moved to
drivers/pci/controller, but I'm not sure if that solves
your problem here. There should normally be no need to
put driver specific headers into a global location.
 
>  #define IO_SPACE_LIMIT 0xffffffff

The IO_SPACE_LIMIT is wrong here, as most of the address space
is not actually reserved for port I/O. Usually you want just
64KB here, but you can also make this PIO_MASK I think.

> +#ifdef __KERNEL__
> +#define PCI_IOBASE	((void __iomem *)0xfe240000UL)
> +
> +#define HAVE_ARCH_PIO_SIZE
> +#define PIO_OFFSET	0xfe240000UL
> +#define PIO_MASK	0x3ffffUL
> +#define PIO_RESERVED	0x40000UL
> +#endif /* __KERNEL__ */

As far as I understand the generic iomap code, this does
not work because PIO_OFFSET has to be smaller than
PIO_RESERVED. Once you remove the GENERIC_IOMAP hack, it
should no longer matter.

      Arnd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.