summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKishon Vijay Abraham I2014-05-29 00:27:26 -0500
committerKishon Vijay Abraham I2014-05-29 01:23:22 -0500
commit75e29a67a8ea19f8efe04fac3d8c6a8d273e5ee3 (patch)
tree9b2a01339db2745cdca6fc90af929925df786b25
parent39e62ace82da1937f4e83652ac2c421d149423c5 (diff)
downloadlinux-phy-75e29a67a8ea19f8efe04fac3d8c6a8d273e5ee3.tar.gz
linux-phy-75e29a67a8ea19f8efe04fac3d8c6a8d273e5ee3.tar.xz
linux-phy-75e29a67a8ea19f8efe04fac3d8c6a8d273e5ee3.zip
PCI: host: pcie-dra7xx: use reset framework APIs to reset PCIe
Get reset nodes from dt and use reset framework APIs to reset PCIe. This is needed since reset is handled by the SoC. Cc: Dan Murphy <dmurphy@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-rw-r--r--Documentation/devicetree/bindings/pci/ti-pci.txt4
-rw-r--r--drivers/pci/host/pci-dra7xx.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/pci/ti-pci.txt b/Documentation/devicetree/bindings/pci/ti-pci.txt
index d07d2eba2abd..3649c2e5e630 100644
--- a/Documentation/devicetree/bindings/pci/ti-pci.txt
+++ b/Documentation/devicetree/bindings/pci/ti-pci.txt
@@ -22,6 +22,8 @@ PCIe Designware Controller
22 num-lanes, 22 num-lanes,
23 interrupt-map-mask, 23 interrupt-map-mask,
24 interrupt-map : as specified in ../designware-pcie.txt 24 interrupt-map : as specified in ../designware-pcie.txt
25 - resets: phandle used if reset is handled be soc
26 - reset-names: name given to the phandle
25 27
26Example: 28Example:
27axi { 29axi {
@@ -45,6 +47,8 @@ axi {
45 ti,hwmods = "pcie1"; 47 ti,hwmods = "pcie1";
46 phys = <&pcie1_phy>; 48 phys = <&pcie1_phy>;
47 phy-names = "pcie-phy0"; 49 phy-names = "pcie-phy0";
50 resets = <&prm_resets &device_reset>;
51 reset-names = "reset";
48 interrupt-map-mask = <0 0 0 7>; 52 interrupt-map-mask = <0 0 0 7>;
49 interrupt-map = <0 0 0 1 &pcie_intc 1>, 53 interrupt-map = <0 0 0 1 &pcie_intc 1>,
50 <0 0 0 2 &pcie_intc 2>, 54 <0 0 0 2 &pcie_intc 2>,
diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 8fb3a2ed7ca1..17f5e6acf459 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -22,6 +22,7 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/pm_runtime.h> 23#include <linux/pm_runtime.h>
24#include <linux/resource.h> 24#include <linux/resource.h>
25#include <linux/reset.h>
25#include <linux/types.h> 26#include <linux/types.h>
26 27
27#include "pcie-designware.h" 28#include "pcie-designware.h"
@@ -332,6 +333,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
332 struct device *dev = &pdev->dev; 333 struct device *dev = &pdev->dev;
333 struct device_node *np = dev->of_node; 334 struct device_node *np = dev->of_node;
334 char name[10]; 335 char name[10];
336 struct reset_control *rstc;
335 337
336 dra7xx = devm_kzalloc(dev, sizeof(*dra7xx), GFP_KERNEL); 338 dra7xx = devm_kzalloc(dev, sizeof(*dra7xx), GFP_KERNEL);
337 if (!dra7xx) 339 if (!dra7xx)
@@ -355,6 +357,14 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
355 if (!base) 357 if (!base)
356 return -ENOMEM; 358 return -ENOMEM;
357 359
360 rstc = devm_reset_control_get(dev, "reset");
361 if (IS_ERR(rstc))
362 return PTR_ERR(rstc);
363
364 ret = reset_control_deassert(rstc);
365 if (ret)
366 return ret;
367
358 phy_count = of_property_count_strings(np, "phy-names"); 368 phy_count = of_property_count_strings(np, "phy-names");
359 if (phy_count < 0) { 369 if (phy_count < 0) {
360 dev_err(dev, "unable to find the strings\n"); 370 dev_err(dev, "unable to find the strings\n");