aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/patches-3.10/0200-PCI-mvebu-move-clock-enable-before-register-access.patch
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2014-02-11 02:07:44 +0000
committerLuka Perkov <luka@openwrt.org>2014-02-11 02:07:44 +0000
commitc9ae111a20be4c9555128cced8edded660d133df (patch)
treefd4809b562d454394cbb9ec517bf3f1ef2d5b6f2 /target/linux/mvebu/patches-3.10/0200-PCI-mvebu-move-clock-enable-before-register-access.patch
parent3af779eb172b0438f77e8a01a97dd0eb9a146076 (diff)
downloadupstream-c9ae111a20be4c9555128cced8edded660d133df.tar.gz
upstream-c9ae111a20be4c9555128cced8edded660d133df.tar.bz2
upstream-c9ae111a20be4c9555128cced8edded660d133df.zip
mvebu: backport mainline patches from kernel 3.13
This is a backport of the patches accepted to the Linux mainline related to mvebu SoC (Armada XP and Armada 370) between Linux v3.12, and Linux v3.13. This work mainly covers: * Finishes work for sharing the pxa nand driver(drivers/mtd/nand/pxa3xx_nand.c) between the PXA family, and the Armada family. * timer initialization update, and access function for the Armada family. * Generic IRQ handling backporting. * Some bug fixes. Signed-off-by: Seif Mazareeb <seif.mazareeb@gmail.com> CC: Luka Perkov <luka@openwrt.org> SVN-Revision: 39566
Diffstat (limited to 'target/linux/mvebu/patches-3.10/0200-PCI-mvebu-move-clock-enable-before-register-access.patch')
-rw-r--r--target/linux/mvebu/patches-3.10/0200-PCI-mvebu-move-clock-enable-before-register-access.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-3.10/0200-PCI-mvebu-move-clock-enable-before-register-access.patch b/target/linux/mvebu/patches-3.10/0200-PCI-mvebu-move-clock-enable-before-register-access.patch
new file mode 100644
index 0000000000..33fba3db7d
--- /dev/null
+++ b/target/linux/mvebu/patches-3.10/0200-PCI-mvebu-move-clock-enable-before-register-access.patch
@@ -0,0 +1,65 @@
+From c524c5790d413b37702013e7e83a845fd3f007ac Mon Sep 17 00:00:00 2001
+From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
+Date: Tue, 13 Aug 2013 14:25:20 +0200
+Subject: [PATCH 200/203] PCI: mvebu: move clock enable before register access
+
+The clock passed to PCI controller found on MVEBU SoCs may come from a
+clock gate. This requires the clock to be enabled before any registers
+are accessed. Therefore, move the clock enable before register iomap to
+ensure it is enabled.
+
+Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+---
+ drivers/pci/host/pci-mvebu.c | 25 ++++++++++++-------------
+ 1 file changed, 12 insertions(+), 13 deletions(-)
+
+--- a/drivers/pci/host/pci-mvebu.c
++++ b/drivers/pci/host/pci-mvebu.c
+@@ -896,11 +896,23 @@ static int __init mvebu_pcie_probe(struc
+ continue;
+ }
+
++ port->clk = of_clk_get_by_name(child, NULL);
++ if (IS_ERR(port->clk)) {
++ dev_err(&pdev->dev, "PCIe%d.%d: cannot get clock\n",
++ port->port, port->lane);
++ continue;
++ }
++
++ ret = clk_prepare_enable(port->clk);
++ if (ret)
++ continue;
++
+ port->base = mvebu_pcie_map_registers(pdev, child, port);
+ if (IS_ERR(port->base)) {
+ dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
+ port->port, port->lane);
+ port->base = NULL;
++ clk_disable_unprepare(port->clk);
+ continue;
+ }
+
+@@ -916,22 +928,9 @@ static int __init mvebu_pcie_probe(struc
+ port->port, port->lane);
+ }
+
+- port->clk = of_clk_get_by_name(child, NULL);
+- if (!port->clk) {
+- dev_err(&pdev->dev, "PCIe%d.%d: cannot get clock\n",
+- port->port, port->lane);
+- iounmap(port->base);
+- port->haslink = 0;
+- continue;
+- }
+-
+ port->dn = child;
+-
+- clk_prepare_enable(port->clk);
+ spin_lock_init(&port->conf_lock);
+-
+ mvebu_sw_pci_bridge_init(port);
+-
+ i++;
+ }
+