All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] MIPS: ralink: fix PCI IO resources
@ 2021-09-25  8:46 Sergio Paracuellos
  2021-09-25  8:46 ` [PATCH v2 1/6] Revert "MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT" Sergio Paracuellos
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sergio Paracuellos @ 2021-09-25  8:46 UTC (permalink / raw)
  To: tsbogend
  Cc: robh, arnd, catalin.marinas, Liviu.Dudau, bhelgaas, matthias.bgg,
	gregkh, linux-mips, linux-pci, linux-staging, neil, linux-kernel

MIPs ralink need a special tratement regarding the way it handles PCI IO                                                           |6   
resources. On MIPS I/O ports are memory mapped, so we access them using normal                                                     |  1 
load/store instructions. MIPS 'plat_mem_setup()' function does a call to                                                           |  2 Sergio Paracuellos (6): 
'set_io_port_base(KSEG1)'. There, variable 'mips_io_port_base'                                                                     |  3   Revert "MIPS: ralink: don't define PC_IOBASE but increase
is set then using this address which is a virtual address to which all                                                             |  4     IO_SPACE_LIMIT"
ports are being mapped. Ralink I/O space has a mapping of bus address                                                              |  5   Revert "staging: mt7621-pci: set end limit for 'ioport_resource'"
equal to the window into the mmio space, with an offset of IO start range                                                          |  6   MIPS: ralink: set PCI_IOBASE to 'mips_io_port_base'
cpu address. This means that to have this working we need:                                                                         |  7   PCI: Allow architecture-specific pci_remap_iospace()
- linux port numbers in the range 0-0xffff.                                                                                        |  8   MIPS: implement architecture-specific 'pci_remap_iospace()'
- pci port numbers in the range 0-0xffff.                                                                                          |  9   staging: mt7621-pci: properly adjust base address for the IO window
- io_offset being zero.                                                                                                            | 10  

These means at the end to have bus address 0 mapped to IO range cpu address.                                                       | 12  arch/mips/include/asm/pci.h                | 2 ++
We need a way of properly set 'mips_io_port_base' with a virtually mapped                                                          | 13  arch/mips/pci/pci-generic.c                | 9 +++++++++
value of the IO cpu address.                                                                                                       | 14  drivers/pci/pci.c                          | 2 ++

This series do the following approach:                                                                                             | 16  5 files changed, 17 insertions(+), 4 deletions(-)
1) Revert two bad commit from a previous attempt of make this work [0].                                                            | 17 
2) Set PCI_IOBASE to mips 'mips_io_port_base'.                                                                                     | 18 -- 
3) Allow architecture dependent 'pci_remap_iospace'.                                                                               | 19 2.25.1
4) Implement 'pci_remap_iospace' for MIPS.                                                                                         | 20 
5) Be sure IOBASE address for IO window is set with correct value.                                                                 |~                                                                                                                                      

More context about this series appoach in this mail thread [1].                                                                    |~                                                                                                                                      

Patches related with reverts are from this merge cycle so they are only
added to the staging git tree. So to have all stuff together I'd like to
get everybody Ack's to get all of this series through staging tree if
possible :).

Thanks in advance for your time.                                                                                                   |~                                                                                                                                      

Changes in v2:
- re-do commit messages for PCI patch as Bjorn pointed out in previous series.
- Add Bjorn's Acked-by for PCI subsystem patch.
- Re-do commit message of MIPS 'pci_remap_iospace()' patch to align with changes
in the PCI patch (s/architecture dependent/architecture-specific/)
- Add Fixes-by tag for MIPS set PCI_IOBASE patch.

[0]: https://www.spinics.net/lists/kernel/msg4051474.html                                                                          |~                                                                                                                                      
[1]: https://lkml.org/lkml/2021/9/22/6

Sergio Paracuellos (6):
  Revert "MIPS: ralink: don't define PC_IOBASE but increase
    IO_SPACE_LIMIT"
  Revert "staging: mt7621-pci: set end limit for 'ioport_resource'"
  MIPS: ralink: set PCI_IOBASE to 'mips_io_port_base'
  PCI: Allow architecture-specific pci_remap_iospace()
  MIPS: implement architecture-specific 'pci_remap_iospace()'
  staging: mt7621-pci: properly adjust base address for the IO window

 arch/mips/include/asm/mach-ralink/spaces.h | 4 +++-
 arch/mips/include/asm/pci.h                | 2 ++
 arch/mips/pci/pci-generic.c                | 9 +++++++++
 drivers/pci/pci.c                          | 2 ++
 drivers/staging/mt7621-pci/pci-mt7621.c    | 4 +---
 5 files changed, 17 insertions(+), 4 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-25  8:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-25  8:46 [PATCH v2 0/6] MIPS: ralink: fix PCI IO resources Sergio Paracuellos
2021-09-25  8:46 ` [PATCH v2 1/6] Revert "MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT" Sergio Paracuellos
2021-09-25  8:46 ` [PATCH v2 2/6] Revert "staging: mt7621-pci: set end limit for 'ioport_resource'" Sergio Paracuellos
2021-09-25  8:46 ` [PATCH v2 3/6] MIPS: ralink: set PCI_IOBASE to 'mips_io_port_base' Sergio Paracuellos
2021-09-25  8:46 ` [PATCH v2 4/6] PCI: Allow architecture-specific pci_remap_iospace() Sergio Paracuellos
2021-09-25  8:46 ` [PATCH v2 5/6] MIPS: implement architecture-specific 'pci_remap_iospace()' Sergio Paracuellos
2021-09-25  8:46 ` [PATCH v2 6/6] staging: mt7621-pci: properly adjust base address for the IO window Sergio Paracuellos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.