aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2014-11-04 13:43:01 +1000
committerNathan Rossi <nathan.rossi@xilinx.com>2014-11-04 13:52:47 +1000
commit05bdd2e0f8bc00852e359ee13d1fd83a99fbd7df (patch)
treed93cbd474385ed4f21e235adf7a9415bf2da46cb
parent6daefe94f3de89ef77af9a3c710a2849e09145e0 (diff)
downloadmeta-xilinx-05bdd2e0f8bc00852e359ee13d1fd83a99fbd7df.tar.gz
meta-xilinx-05bdd2e0f8bc00852e359ee13d1fd83a99fbd7df.tar.bz2
meta-xilinx-05bdd2e0f8bc00852e359ee13d1fd83a99fbd7df.zip
linux-xlnx_3.14: Add patch for USB PHY reset during probe
* Adds the ability for the USB driver to reset the PHY via a GPIO pin * This resolves the case where FSBL, u-boot-spl, u-boot does not reset the PHY Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
-rw-r--r--recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch58
-rw-r--r--recipes-kernel/linux/linux-xlnx_3.14.bb4
2 files changed, 62 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch b/recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch
new file mode 100644
index 00000000..6ef36098
--- /dev/null
+++ b/recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch
@@ -0,0 +1,58 @@
+From: Mike Looijmans <mike.looijmans@topic.nl>
+Date: Thu, 25 Sep 2014 07:53:49 +0200
+Subject: [PATCH] usb/host/zynq-dr-of: PHY reset during probe
+
+---
+ drivers/usb/host/zynq-dr-of.c | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/drivers/usb/host/zynq-dr-of.c b/drivers/usb/host/zynq-dr-of.c
+index 9ab936a..2765894 100644
+--- a/drivers/usb/host/zynq-dr-of.c
++++ b/drivers/usb/host/zynq-dr-of.c
+@@ -26,6 +26,8 @@
+ #include <linux/string.h>
+ #include <linux/clk.h>
+ #include <linux/usb/ulpi.h>
++#include <linux/gpio.h>
++#include <linux/of_gpio.h>
+
+ #include "ehci-zynq.h"
+
+@@ -152,11 +154,33 @@ static int zynq_dr_of_probe(struct platform_device *ofdev)
+ static unsigned int idx;
+ struct resource *res;
+ int i, phy_init;
++ int reset_gpio;
+ int ret;
+
+ pdata = &data;
+ memset(pdata, 0, sizeof(data));
+
++ reset_gpio = of_get_named_gpio(np, "xlnx,phy-reset-gpio", 0);
++ if (gpio_is_valid(reset_gpio)) {
++ ret = devm_gpio_request_one(&ofdev->dev, reset_gpio,
++ GPIOF_INIT_LOW, "ulpi resetb");
++ if (ret) {
++ dev_err(&ofdev->dev, "Failed to request ULPI reset gpio: %d\n", ret);
++ return ret;
++ }
++ udelay(1); /* ULPI Datasheet specifies a 1us pulse width for reset */
++ if (of_property_read_bool(np, "xlnx,phy-reset-gpio-tristate"))
++ gpio_direction_input(reset_gpio);
++ else
++ gpio_set_value_cansleep(reset_gpio, 1);
++ udelay(1); /* ULPI will assert the DIR line, give it time to do so */
++ } else {
++ /* GPIO controller is not yet available, try again later. */
++ if (reset_gpio == -EPROBE_DEFER) {
++ return -EPROBE_DEFER;
++ }
++ }
++
+ res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
+ if (IS_ERR(res)) {
+ dev_err(&ofdev->dev,
+--
+2.1.1
+
diff --git a/recipes-kernel/linux/linux-xlnx_3.14.bb b/recipes-kernel/linux/linux-xlnx_3.14.bb
index d30f5816..a941c4a7 100644
--- a/recipes-kernel/linux/linux-xlnx_3.14.bb
+++ b/recipes-kernel/linux/linux-xlnx_3.14.bb
@@ -4,3 +4,7 @@ KBRANCH ?= "xlnx_3.14"
SRCREV ?= "2b48a8aeea7367359f9eebe55c4a09a05227f32b"
include linux-xlnx.inc
+
+SRC_URI_append += " \
+ file://usb-host-zynq-dr-of-PHY-reset-during-probe.patch \
+ "