From patchwork Mon Feb 27 12:34:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Reifferscheid X-Patchwork-Id: 732793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vX1Rh1XZtz9s9x for ; Mon, 27 Feb 2017 23:36:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="npP16+Wz"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id:Date:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=vLBsLIr5cm5oQ97SkUd8khqZvygThkxpD4gnjY1tlbI=; b=npP16+WzpQyutl dHM9QrklSpd2Z4zcXVpw6XOKAlI5PaHDZzBHoY9oOyMWIIPqLdQccjj3i9EFMgpJ0gBkxRQ7PDBIH RtXsFUVC0kZHhK7l4vM/EoNAQjMqrkd2ghERiMRP+rFWa5F/lSgqJntjGQKk2fs4SZzTlpN5IJH3C RRkXgg2UKCq+OacWbQVwvDhvRk29hWcLTHe312sXWbR/yiYiWFitKZqwabV1bId2vSG3Mb2eA0yLv unWy4RrnThDzh7xkXCqS5ITfbbAl9A60reegnbdek3eIwTB85dwzQzrw1S2KKfhdwcwYjwiNrQWXH BgrMMoPHMKQ5d8JUej3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ciKXK-0006FL-DI; Mon, 27 Feb 2017 12:36:18 +0000 Received: from mail.reifferscheid.org ([176.9.36.208]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ciKWm-00064A-VT for lede-dev@lists.infradead.org; Mon, 27 Feb 2017 12:35:47 +0000 Received: from pd9f86b51.dip0.t-ipconnect.de ([217.248.107.81] helo=debian.local) by reifferscheid.org with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.80) (envelope-from ) id 1ciKWL-0008B3-Bu for lede-dev@lists.infradead.org; Mon, 27 Feb 2017 13:35:17 +0100 From: Thomas Reifferscheid To: lede-dev@lists.infradead.org Date: Mon, 27 Feb 2017 13:34:01 +0100 Message-Id: <1488198841-5878-1-git-send-email-thomas@reifferscheid.org> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170227_043545_233993_5DB3BC7D X-CRM114-Status: GOOD ( 10.73 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [RFC] ipq806x: Add USB Type Selector for R7500 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The patch enables the primary USB port on R7500. Because of the missing general IPQ8064x TCSR initialisation functions a workaround using pinctrl,single was chosen. It allows us to set 1a4000b0 from 0000.0010 to 0000.0011 thus enabling the primary USB port - prior to the dwc3-phy initialisation. Needs to be reworked once Qualcomm adds TCSR initialisation functionality from their 3.x kernel into 4.x kernels. The patch fixes FS#497 and partially backs off 45bf3d4f248ea2d770a1625fdee8899dc40329af which had the right idea but was missing the syscon-tcsr handler - which by the time of the upstream patch attempt (January 2015) was trying to set the TCSR USB Type selector at the wrong part of the kernel. Signed-off-by: Thomas Reifferscheid --- ...ipq806x-add-usbtypesel-required-for-r7500.patch | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 target/linux/ipq806x/patches-4.4/716-ipq806x-add-usbtypesel-required-for-r7500.patch diff --git a/target/linux/ipq806x/patches-4.4/716-ipq806x-add-usbtypesel-required-for-r7500.patch b/target/linux/ipq806x/patches-4.4/716-ipq806x-add-usbtypesel-required-for-r7500.patch new file mode 100644 index 0000000..4927708 --- /dev/null +++ b/target/linux/ipq806x/patches-4.4/716-ipq806x-add-usbtypesel-required-for-r7500.patch @@ -0,0 +1,56 @@ +diff -Naur a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi +--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi 2017-02-27 12:34:58.669161969 +0100 ++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi 2017-02-27 12:40:51.253172676 +0100 +@@ -626,6 +626,13 @@ + reg = <0x1a400000 0x100>; + }; + ++ usbtypesel: pinmux@1a4000b0 { ++ compatible = "pinctrl-single"; ++ pinctrl-single,register-width = <32>; /* u32 */ ++ pinctrl-single,function-mask = <0x03>; /* only allow to set the 2 LSBs */ ++ reg = <0x1a4000b0 0x04>; /* u32 */ ++ }; ++ + lcc: clock-controller@28000000 { + compatible = "qcom,lcc-ipq8064"; + reg = <0x28000000 0x1000>; +@@ -685,8 +692,6 @@ + clocks = <&gcc USB30_0_MASTER_CLK>; + clock-names = "core"; + +- syscon-tcsr = <&tcsr 0xb0 1>; +- + ranges; + + status = "disabled"; +@@ -709,8 +714,6 @@ + clocks = <&gcc USB30_1_MASTER_CLK>; + clock-names = "core"; + +- syscon-tcsr = <&tcsr 0xb0 0>; +- + ranges; + + status = "disabled"; +diff -Naur a/arch/arm/boot/dts/qcom-ipq8064-r7500.dts b/arch/arm/boot/dts/qcom-ipq8064-r7500.dts +--- a/arch/arm/boot/dts/qcom-ipq8064-r7500.dts 2017-02-27 12:35:08.693162274 +0100 ++++ b/arch/arm/boot/dts/qcom-ipq8064-r7500.dts 2017-02-27 12:35:12.677162395 +0100 +@@ -131,6 +131,17 @@ + status = "ok"; + }; + ++ pinmux@1a4000b0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&board_pins>; ++ ++ board_pins: pinmux_board_pins { ++ pinctrl-single,pins = < ++ 0x00 0x03 /* IPQ_TCSR_USB_CONTROLLER_TYPE_SEL TCSR_USB_SELECT_USB3_DUAL */ ++ >; ++ }; ++ }; ++ + phy@100f8800 { /* USB3 port 1 HS phy */ + status = "ok"; + };