linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Support for configurable PCIe endpoint
@ 2016-08-03  6:03 Kishon Vijay Abraham I
  2016-08-03  7:42 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Kishon Vijay Abraham I @ 2016-08-03  6:03 UTC (permalink / raw)
  To: bhelgaas, linux-pci, arnd, Jingoo Han, Pratyush Anand
  Cc: Ley Foon Tan, Rob Herring, Tanmay Inamdar, Roy Zang, Mingkai Hu,
	Minghuan Lian, Richard Zhu, Lucas Stach, Murali Karicheri,
	Thomas Petazzoni, Jason Cooper, Thierry Reding,
	Kishon Vijay Abraham I, Simon Horman, Joao Pinto, Zhou Wang,
	Gabriele Paoloni, Stanimir Varbanov, David Daney, linux-kernel,
	linux-arm-kernel, linux-omap

Hi,

The PCIe controller present in TI's DRA7 SoC is capable of operating either in
Root Complex mode or Endpoint mode. (It uses Synopsys Designware Core).I'd
assume most of the PCIe controllers on other platforms that use Designware core
should also be capable to operate in endpoint mode. But linux kernel right now
supports only RC mode.

PCIe endpoint support discussion came up briefly before [1] but it was felt the
practical use case will find firmware more suitable and endpoint support in
kernel can be used only for validation or demo.

Validation or demo is itself a valid use case in my opinion (consider something
similar to gadget zero for USB). There can be other use cases as well. The RC
can use the SoC with EP mode support as an accelerator to accomplish specific
task. Here RC gives data to the EP. The EP processes the data. The processing
can be done either in ARM itself or it can use other hardware accelerators
(like DSP, IVA-HD etc..) present in the EP system. If HW accelerator is used,
the linux kernel running in ARM can be used to accomplish other tasks. Once EP
mode support is added, I think more use cases will be added.

>From the high level this should look _similar_ to the gadget framework of USB.
One difference from USB would be this should allow HW components (like DSP, PRU
etc.. and maybe even some peripheral) in the EP system to be used by RC system.

So these are the high-level steps that I thought would be needed to add EP
support in linux.
*) move pcie-designware.c out of drivers/pci/host (maybe create a
drivers/pci/designware/ folder?). All users of pcie-designware.c should be
moved here.
This is in preparation for adding EP mode support to designware.

*) Add library functions in pcie-designware.c specific to EP mode like
initializing general ecam registers, BAR registers etc.. These functions should
be invoked from a *function* driver (function driver should determine the use
of a particular EP).

*) Add a sample *function* driver that can be used just for validation. This
function driver will invoke the previously added functions in PCIe controller
to initialize ecam, BAR etc.. This will invoke the PCIe controller functions
through *ep-core* layer. That way the same function driver can be made to work
with different PCIe controllers. (A PCIe driver corresponding to this function
driver should also be implemented in RC side)

*) Add *ep-core* layer to bind the function driver to the controller driver and
using which the function driver will invoke controller driver callbacks (to
initialize ecam, BAR registers etc..)

*) Modify platform driver to support EP mode (in my case pci-dra7xx.c).

*) dt binding specific to EP mode should be created.

Once I complete the implementation and start posting RFC patches, a lot of
these will become clear. But I want to check if this sounds okay to you guys
before starting the implementation.

Let me know if you have some other ideas too.

Cheers
Kishon

[1] -> http://www.spinics.net/lists/linux-pci/msg26026.html

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

end of thread, other threads:[~2016-08-30  5:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03  6:03 Support for configurable PCIe endpoint Kishon Vijay Abraham I
2016-08-03  7:42 ` Arnd Bergmann
2016-08-04  8:19   ` Kishon Vijay Abraham I
2016-08-03  9:47 ` Christoph Hellwig
2016-08-03 16:03   ` Arnd Bergmann
2016-08-03 17:27     ` Christoph Hellwig
2016-08-03 19:38       ` Arnd Bergmann
2016-08-04  8:49   ` Kishon Vijay Abraham I
2016-08-03 13:39 ` Joao Pinto
2016-08-04 10:02   ` Kishon Vijay Abraham I
2016-08-04 11:13     ` Arnd Bergmann
2016-08-18 13:14       ` Kishon Vijay Abraham I
2016-08-25 12:59         ` Arnd Bergmann
2016-08-29 11:47           ` Kishon Vijay Abraham I
2016-08-17  9:49     ` Mingkai Hu
2016-08-18 12:24       ` Kishon Vijay Abraham I
2016-08-29 15:25         ` Roy Zang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).