]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
PCI: Move private DT related functions into private header
authorRob Herring <robh@kernel.org>
Fri, 11 May 2018 17:15:30 +0000 (12:15 -0500)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 14 May 2018 17:09:40 +0000 (18:09 +0100)
The functions in linux/of_pci.h are primarily used by host bridge
drivers, so they can be private to drivers/pci/.

The remaining functions are still used mostly in host bridge drivers
that still live in arch specific code. Hopefully someday, those will get
moved into drivers/pci as well.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
18 files changed:
drivers/pci/dwc/pci-dra7xx.c
drivers/pci/dwc/pcie-designware-host.c
drivers/pci/host/pci-aardvark.c
drivers/pci/host/pci-ftpci100.c
drivers/pci/host/pci-mvebu.c
drivers/pci/host/pci-rcar-gen2.c
drivers/pci/host/pci-tegra.c
drivers/pci/host/pci-v3-semi.c
drivers/pci/host/pci-xgene.c
drivers/pci/host/pcie-altera.c
drivers/pci/host/pcie-iproc-platform.c
drivers/pci/host/pcie-mediatek.c
drivers/pci/host/pcie-rcar.c
drivers/pci/host/pcie-rockchip.c
drivers/pci/host/pcie-xilinx-nwl.c
drivers/pci/host/pcie-xilinx.c
drivers/pci/pci.h
include/linux/of_pci.h

index ed8558d638e5ca88037c107a0bc903034ea2028d..620709d38a6467ec61a03696b57705ff0889b847 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 
+#include "../pci.h"
 #include "pcie-designware.h"
 
 /* PCIe controller wrapper DRA7XX configuration registers */
index a7657ab3a6e067ee50a6169a32ae488aac8d1d28..396cdb239ed57f20de3804d0fa8906ced8ad854a 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/pci_regs.h>
 #include <linux/platform_device.h>
 
+#include "../pci.h"
 #include "pcie-designware.h"
 
 static struct pci_ops dw_pcie_ops;
index b04d37b3c5deea7b2aafdf34f636adb720a978bd..55b94911bc9a417f6caf6c0d2d70592e23483d8e 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 
+#include "../pci.h"
+
 /* PCIe core registers */
 #define PCIE_CORE_CMD_STATUS_REG                               0x4
 #define     PCIE_CORE_CMD_IO_ACCESS_EN                         BIT(0)
index 5008fd87956a91878e9d33b6cb68d6a3190a990c..474faa2e922e0551f311f7f54c13cb92946a3c27 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/irq.h>
 #include <linux/clk.h>
 
+#include "../pci.h"
+
 /*
  * Special configuration registers directly in the first few words
  * in I/O space.
index 5d4dccfc9d8133cf8cfc66cc9f3bb8536863e780..23e270839e6a8fe666646034052629c28511f83d 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/of_pci.h>
 #include <linux/of_platform.h>
 
+#include "../pci.h"
+
 /*
  * PCIe unit register offsets.
  */
index dd4f1a6b57c56f5026354a6093dac1b6bc82ae81..326171cb1a9780e1d3eec45434f2206617247833 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/sizes.h>
 #include <linux/slab.h>
 
+#include "../pci.h"
+
 /* AHB-PCI Bridge PCI communication registers */
 #define RCAR_AHBPCI_PCICOM_OFFSET      0x800
 
index 389e74be846ceedddb3894be435f46384053721a..f4f53d092e00526cd4dec08e575334fd9f400c1e 100644 (file)
@@ -40,6 +40,8 @@
 #include <soc/tegra/cpuidle.h>
 #include <soc/tegra/pmc.h>
 
+#include "../pci.h"
+
 #define INT_PCI_MSI_NR (8 * 32)
 
 /* register definitions */
index 0a4dea796663821ac9efba6f599ac7c636109a25..04bf53d02f2353c70366e7aa5cfeb0134d7bb6d4 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/regmap.h>
 #include <linux/clk.h>
 
+#include "../pci.h"
+
 #define V3_PCI_VENDOR                  0x00000000
 #define V3_PCI_DEVICE                  0x00000002
 #define V3_PCI_CMD                     0x00000004
index 0a0d7ee6d3c9275374ad12128f5b330b964d34cc..648a5024302263b445d7104cb1d72707c598fa05 100644 (file)
@@ -22,6 +22,8 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
+#include "../pci.h"
+
 #define PCIECORE_CTLANDSTATUS          0x50
 #define PIM1_1L                                0x80
 #define IBAR2                          0x98
index a6af62e0256dc6e944886e4895364ddbaaab4b6f..dc4985087e04c8195ba77b08794875441dbe8514 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
+#include "../pci.h"
+
 #define RP_TX_REG0                     0x2000
 #define RP_TX_REG1                     0x2004
 #define RP_TX_CNTRL                    0x2008
index e764a2a2693ce6818c27ffd72fcc741672b1d22e..fb23fdf919c8112761a20548eec7fdea5ee10699 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/of_platform.h>
 #include <linux/phy/phy.h>
 
+#include "../pci.h"
 #include "pcie-iproc.h"
 
 static const struct of_device_id iproc_pcie_of_match_table[] = {
index a8b20c5012a98605f33b2a201b201394a5c616ee..5b3da5856ca2bd5a60167ef6b98baecbaa0d5018 100644 (file)
@@ -22,6 +22,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
 
+#include "../pci.h"
+
 /* PCIe shared registers */
 #define PCIE_SYS_CFG           0x00
 #define PCIE_INT_ENABLE                0x0c
index 6ab28f29ac6a074fcc42fd316b95330ce3be5dd6..9629ec039debb98c2b1c3a1cbe6d9cfba0113e43 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
 
+#include "../pci.h"
+
 #define PCIECAR                        0x000010
 #define PCIECCTLR              0x000018
 #define  CONFIG_SEND_ENABLE    (1 << 31)
index f1e8f97ea1fb185852d88a12a36d2fd0ece3a937..daf9120a43506c83db9347463dda3d190a0021e4 100644 (file)
@@ -36,6 +36,8 @@
 #include <linux/reset.h>
 #include <linux/regmap.h>
 
+#include "../pci.h"
+
 /*
  * The upper 16 bits of PCIE_CLIENT_CONFIG are a write mask for the lower 16
  * bits.  This allows atomic updates of the register without locking.
index 4839ae578711b3534ac693df1e79207380e03b7c..9505bb9649d04bb1bac0be76f2af3085a136365c 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/platform_device.h>
 #include <linux/irqchip/chained_irq.h>
 
+#include "../pci.h"
+
 /* Bridge core config registers */
 #define BRCFG_PCIE_RX0                 0x00000000
 #define BRCFG_INTERRUPT                        0x00000010
index 0ad188effc0912abaee1ed599fe74de07db387f7..ec193e930caab0ed6e0071fd8eff06eaacbb30c7 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 
+#include "../pci.h"
+
 /* Register definitions */
 #define XILINX_PCIE_REG_BIR            0x00000130
 #define XILINX_PCIE_REG_IDR            0x00000138
index 023f7cf25bff475f32b97da88033810f593ae133..6c7cd16a1d1c64b6ae24bb3c7346dffa68350f1e 100644 (file)
@@ -407,4 +407,44 @@ static inline u64 pci_rebar_size_to_bytes(int size)
        return 1ULL << (size + 20);
 }
 
+struct device_node;
+
+#ifdef CONFIG_OF
+int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
+int of_get_pci_domain_nr(struct device_node *node);
+int of_pci_get_max_link_speed(struct device_node *node);
+
+#else
+static inline int
+of_pci_parse_bus_range(struct device_node *node, struct resource *res)
+{
+       return -EINVAL;
+}
+
+static inline int
+of_get_pci_domain_nr(struct device_node *node)
+{
+       return -1;
+}
+
+static inline int
+of_pci_get_max_link_speed(struct device_node *node)
+{
+       return -EINVAL;
+}
+#endif /* CONFIG_OF */
+
+#if defined(CONFIG_OF_ADDRESS)
+int of_pci_get_host_bridge_resources(struct device_node *dev,
+                       unsigned char busno, unsigned char bus_max,
+                       struct list_head *resources, resource_size_t *io_base);
+#else
+static inline int of_pci_get_host_bridge_resources(struct device_node *dev,
+                       unsigned char busno, unsigned char bus_max,
+                       struct list_head *resources, resource_size_t *io_base)
+{
+       return -EINVAL;
+}
+#endif
+
 #endif /* DRIVERS_PCI_H */
index 091033a6b836fd78bd4a22dfdb622eb4b39c32b8..e83d87fc5673de04345267bf94b90500b1caf5e9 100644 (file)
@@ -13,9 +13,6 @@ struct device_node;
 struct device_node *of_pci_find_child_device(struct device_node *parent,
                                             unsigned int devfn);
 int of_pci_get_devfn(struct device_node *np);
-int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
-int of_get_pci_domain_nr(struct device_node *node);
-int of_pci_get_max_link_speed(struct device_node *node);
 void of_pci_check_probe_only(void);
 int of_pci_map_rid(struct device_node *np, u32 rid,
                   const char *map_name, const char *map_mask_name,
@@ -32,18 +29,6 @@ static inline int of_pci_get_devfn(struct device_node *np)
        return -EINVAL;
 }
 
-static inline int
-of_pci_parse_bus_range(struct device_node *node, struct resource *res)
-{
-       return -EINVAL;
-}
-
-static inline int
-of_get_pci_domain_nr(struct device_node *node)
-{
-       return -1;
-}
-
 static inline int of_pci_map_rid(struct device_node *np, u32 rid,
                        const char *map_name, const char *map_mask_name,
                        struct device_node **target, u32 *id_out)
@@ -51,12 +36,6 @@ static inline int of_pci_map_rid(struct device_node *np, u32 rid,
        return -EINVAL;
 }
 
-static inline int
-of_pci_get_max_link_speed(struct device_node *node)
-{
-       return -EINVAL;
-}
-
 static inline void of_pci_check_probe_only(void) { }
 #endif
 
@@ -70,17 +49,4 @@ of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
 }
 #endif
 
-#if defined(CONFIG_OF_ADDRESS)
-int of_pci_get_host_bridge_resources(struct device_node *dev,
-                       unsigned char busno, unsigned char bus_max,
-                       struct list_head *resources, resource_size_t *io_base);
-#else
-static inline int of_pci_get_host_bridge_resources(struct device_node *dev,
-                       unsigned char busno, unsigned char bus_max,
-                       struct list_head *resources, resource_size_t *io_base)
-{
-       return -EINVAL;
-}
-#endif
-
 #endif