All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manish Jaggi <mjaggi@caviumnetworks.com>
To: xen-devel@lists.xen.org
Cc: Prasun.kapoor@cavium.com, "Kumar,
	Vijaya" <Vijaya.Kumar@caviumnetworks.com>,
	Julien Grall <julien.grall@linaro.org>,
	"Stefano Stabellini (Stefano.Stabellini@citrix.com)"
	<stefano.stabellini@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: RFC: [PATCH 1/3] Enhance platform support for PCI
Date: Fri, 20 Feb 2015 17:04:54 +0530	[thread overview]
Message-ID: <54E71BDE.5020106@caviumnetworks.com> (raw)

The platform APIs are enhanced to provide support for parsing pci device
tree nodes and storing the config-space address which is later used for
pci_read/pci_write config calls.
---
  xen/arch/arm/platform.c        | 27 +++++++++++++++++++++++++++
  xen/include/asm-arm/platform.h | 18 +++++++++++++++++-
  2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index cb4cda8..25f07d2 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -128,6 +128,33 @@ int __init platform_smp_init(void)
  }
  #endif
  
+int platform_pci_dt_node_init(struct dt_device_node *node, const void *data)
+{
+    if(platform->pci_dt_node_init)
+        return platform->pci_dt_node_init(node, data);
+    return -1;
+}
+
+int platform_pci_write_config(unsigned int seg, unsigned int bus,
+                                    unsigned int dev, unsigned int func,
+                                    int reg, int size, uint32_t val)
+{
+    if(platform->pci_write_config)
+        return platform->pci_write_config(seg, bus, dev, func, reg, size, val);
+
+    return -1;
+}
+
+int platform_pci_read_config(unsigned int seg, unsigned int bus,
+                                    unsigned int dev, unsigned int func,
+                                    int reg, int size, uint32_t *val)
+{
+    if(platform->pci_read_config)
+        return platform->pci_read_config(seg, bus, dev, func, reg, size, val);
+
+    return -1;
+}
+
  void platform_reset(void)
  {
      if ( platform && platform->reset )
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index eefaca6..da3cc63 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -26,6 +26,16 @@ struct platform_desc {
      void (*reset)(void);
      /* Platform power-off */
      void (*poweroff)(void);
+    /* PCI callback when a pci device tree node is found */
+    int (*pci_dt_node_init)(struct dt_device_node *node, const void *data);
+    /* PCI configspace read and write */
+    int (*pci_read_config)(unsigned int seg, unsigned int bus,
+                            unsigned int dev, unsigned int func,
+                            int reg, int size, uint32_t *val);
+
+    int (*pci_write_config)(unsigned int seg, unsigned int bus,
+                            unsigned int dev, unsigned int func,
+                            int reg, int size, uint32_t val);
      /*
       * Platform quirks
       * Defined has a function because a platform can support multiple
@@ -73,7 +83,13 @@ bool_t platform_has_quirk(uint32_t quirk);
  bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
  unsigned int platform_dom0_evtchn_ppi(void);
  void platform_dom0_gnttab(paddr_t *start, paddr_t *size);
-
+int platform_pci_dt_node_init(struct dt_device_node *node, const void *data);
+int platform_pci_write_config(unsigned int seg, unsigned int bus,
+                                    unsigned int dev, unsigned int func,
+                                    int reg, int size, uint32_t val);
+int platform_pci_read_config(unsigned int seg, unsigned int bus,
+                                    unsigned int dev, unsigned int func,
+                                    int reg, int size, uint32_t *val);
  #define PLATFORM_START(_name, _namestr)                         \
  static const struct platform_desc  __plat_desc_##_name __used   \
  __attribute__((__section__(".arch.info"))) = {                  \
-- 
1.9.1

             reply	other threads:[~2015-02-20 11:34 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 11:34 Manish Jaggi [this message]
2015-02-20 12:03 ` RFC: [PATCH 1/3] Enhance platform support for PCI Julien Grall
2015-02-20 12:10   ` Manish Jaggi
2015-02-20 12:20     ` Julien Grall
2015-02-20 12:34       ` Manish Jaggi
2015-02-20 13:01         ` Manish Jaggi
2015-02-20 13:45           ` Ian Campbell
2015-02-20 14:11             ` Jan Beulich
2015-02-20 14:26               ` Ian Campbell
2015-02-20 14:39                 ` Jan Beulich
2015-02-20 15:01                   ` Ian Campbell
2015-02-20 15:13                     ` Manish Jaggi
2015-02-20 15:15                       ` Julien Grall
2015-02-20 15:15                     ` Jan Beulich
2015-02-20 17:33                       ` Ian Campbell
2015-02-23  8:43                         ` Jan Beulich
2015-02-23 12:45                           ` Ian Campbell
2015-02-23 14:07                             ` Jan Beulich
2015-02-23 14:33                               ` Ian Campbell
2015-02-23 14:45                                 ` Jan Beulich
2015-02-23 15:02                                   ` Ian Campbell
2015-02-23 15:27                                     ` Jan Beulich
2015-02-23 15:46                                       ` Ian Campbell
2015-02-23 16:20                                         ` Jan Beulich
2015-02-26 10:09                                           ` Manish Jaggi
2015-02-26 10:30                                             ` Jan Beulich
2015-02-26 11:05                                             ` Ian Campbell
2015-02-27 14:33                                               ` Stefano Stabellini
2015-02-27 14:42                                                 ` Ian Campbell
2015-02-27 14:54                                                   ` Stefano Stabellini
2015-02-27 15:24                                                     ` Ian Campbell
2015-02-27 15:29                                                       ` Ian Campbell
2015-02-27 16:35                                                       ` Jan Beulich
2015-02-27 16:50                                                         ` Ian Campbell
2015-02-27 17:15                                                           ` Stefano Stabellini
2015-03-02 11:48                                                             ` Ian Campbell
2015-03-03  9:19                                                               ` Manish Jaggi
2015-03-17  5:26                                                           ` Manish Jaggi
2015-03-17  7:28                                                             ` Jan Beulich
2015-03-17 12:06                                                               ` Manish Jaggi
2015-03-17 12:31                                                                 ` Jan Beulich
2015-03-18  4:05                                                                   ` Manish Jaggi
2015-03-17 13:17                                                             ` Konrad Rzeszutek Wilk
2015-03-11 18:26                           ` Stefano Stabellini
2015-03-12  9:16                             ` Jan Beulich
2015-03-12 10:33                               ` Stefano Stabellini
2015-03-12 11:28                                 ` Jan Beulich
2015-03-12  9:30                             ` Ian Campbell
2015-02-20 14:14             ` Manish Jaggi
2015-02-20 14:39               ` Ian Campbell
2015-02-23 10:59                 ` Manish Jaggi
2015-02-23 11:14                   ` Julien Grall
2015-02-23 11:50                     ` Manish Jaggi
2015-02-23 15:15                       ` Julien Grall
2015-02-23 17:12                         ` Manish Jaggi
2015-02-23 21:39                           ` Julien Grall
2015-02-24  0:23                             ` Manish Jaggi
2015-02-24 13:43                               ` Julien Grall
2015-02-25  2:33                                 ` Manish Jaggi
2015-02-25 10:20                                   ` Ian Campbell
2015-02-26 10:49                                     ` Vijay Kilari
2015-02-26 11:12                                       ` Ian Campbell
2015-02-26 13:58                                         ` Julien Grall
2015-02-26 14:46                                       ` Pranavkumar Sawargaonkar
2015-02-26 15:17                                         ` Julien Grall
2015-02-27 10:11                                           ` Pranavkumar Sawargaonkar
2015-02-27 10:38                                             ` Ian Campbell
2015-02-27 13:22                                               ` Ian Campbell
2015-02-27 13:59                                                 ` Vijay Kilari
2015-02-20 13:37       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54E71BDE.5020106@caviumnetworks.com \
    --to=mjaggi@caviumnetworks.com \
    --cc=Prasun.kapoor@cavium.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.