All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] drivers: port PCIe designware to new DT parsing API
@ 2015-01-07 15:29 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 32+ messages in thread
From: Lorenzo Pieralisi @ 2015-01-07 15:29 UTC (permalink / raw)
  To: linux-pci, linux-arm-kernel, devicetree
  Cc: Lorenzo Pieralisi, Arnd Bergmann, Liviu Dudau, Mohit Kumar,
	Jingoo Han, Bjorn Helgaas, Rob Herring

The introduction of the DT API:

of_pci_get_host_bridge_resources()

allows to retrieve PCI resources from the device tree in a generic way.

Some PCI host controllers, in addition to standard IO and MEM resources and
corresponding CPU addresses, require to retrieve the addresses that are used
for bus routing of IO/MEM regions as seen at the bus level corresponding
to the bus segment the host controller is sitting on, so that the host
controller can programme its inbound/outbound memory regions correctly to
respond to bus transactions coming from the CPU on the host controller bus
ports.

The DT generic layer provides functions that carry out the PCI
ranges <-> resources translation from PCI addresses to CPU addresses (as
seen at the CPU top level bus, through all required hierarchical bus layers),
but there is no generic API to retrieve the PCI range CPU untranslated
addresses, so PCI host controllers have to do it in a driver specific way
through the DT property parsing methods.

This patchset converts the PCIe designware host controller driver to
use the API:

of_pci_get_host_bridge_resources()

in order to retrieve the PCI regions resources. To achieve generality, it
also augments the parsing API so that a new DT struct is created out of
PCI ranges, that contains the PCI resource and the range parser itself
so that it can be passed back to PCI host controllers drivers that
can, if needed, use it to parse the CPU untranslated addresses
corresponding to the resource in question.

The first patch in the series is a fix/update for the parsing function:

of_pci_get_host_bridge_resources()

It is part of the RFC series since it is a controversial fix to be
discussed before getting merged.

Patch [2-3] augment the parsing API and convert the PCIe designware
driver code.

The current API stays unchanged, so that the existing drivers using it
do not need patching and changes are limited.

Tested on an iMX6 Sabrelite board.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Mohit Kumar <mohit.kumar@st.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Rob Herring <robh+dt@kernel.org>

Lorenzo Pieralisi (3):
  drivers: of: fix resources freeing in
    of_pci_get_host_bridge_resources()
  drivers: of: of_pci_get_host_bridge_resources() range parsing update
  drivers: pci: host: update the pcie designware driver to new range
    parsing API

 drivers/of/of_pci.c                |  36 +++++++--
 drivers/pci/host/pcie-designware.c | 145 +++++++++++++++++--------------------
 drivers/pci/host/pcie-designware.h |   5 +-
 include/linux/of_address.h         |   5 ++
 4 files changed, 104 insertions(+), 87 deletions(-)

-- 
2.2.1

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

end of thread, other threads:[~2015-01-26 13:06 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07 15:29 [RFC PATCH 0/3] drivers: port PCIe designware to new DT parsing API Lorenzo Pieralisi
2015-01-07 15:29 ` Lorenzo Pieralisi
2015-01-07 15:29 ` [RFC PATCH 1/3] drivers: of: fix resources freeing in of_pci_get_host_bridge_resources() Lorenzo Pieralisi
2015-01-07 15:29   ` Lorenzo Pieralisi
2015-01-19 18:32   ` Liviu Dudau
2015-01-19 18:32     ` Liviu Dudau
2015-01-20 10:49     ` Lorenzo Pieralisi
2015-01-20 10:49       ` Lorenzo Pieralisi
2015-01-20 10:49       ` Lorenzo Pieralisi
2015-01-20 11:20       ` Liviu Dudau
2015-01-20 11:20         ` Liviu Dudau
2015-01-20 11:20         ` Liviu Dudau
     [not found]         ` <20150120112031.GA342-hOhETlTuV5niMG9XS5x8Mg@public.gmane.org>
2015-01-26 11:21           ` Lorenzo Pieralisi
2015-01-26 11:21             ` Lorenzo Pieralisi
2015-01-26 11:21             ` Lorenzo Pieralisi
2015-01-26 13:06             ` Liviu Dudau
2015-01-26 13:06               ` Liviu Dudau
2015-01-26 13:06               ` Liviu Dudau
2015-01-07 15:29 ` [RFC PATCH 2/3] drivers: of: of_pci_get_host_bridge_resources() range parsing update Lorenzo Pieralisi
2015-01-07 15:29   ` Lorenzo Pieralisi
     [not found] ` <1420644571-18928-1-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
2015-01-07 15:29   ` [RFC PATCH 3/3] drivers: pci: host: update the pcie designware driver to new range parsing API Lorenzo Pieralisi
2015-01-07 15:29     ` Lorenzo Pieralisi
2015-01-07 15:29     ` Lorenzo Pieralisi
2015-01-19 16:40   ` [RFC PATCH 0/3] drivers: port PCIe designware to new DT " Rob Herring
2015-01-19 16:40     ` Rob Herring
2015-01-19 16:40     ` Rob Herring
     [not found]     ` <CAL_JsqLYg9vhFVmf=O4YLPfboj-dyoCR0H5dzBbMC3PeAEOwhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-19 16:59       ` Arnd Bergmann
2015-01-19 16:59         ` Arnd Bergmann
2015-01-19 16:59         ` Arnd Bergmann
2015-01-20 10:39         ` Lorenzo Pieralisi
2015-01-20 10:39           ` Lorenzo Pieralisi
2015-01-20 10:39           ` Lorenzo Pieralisi

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.