From patchwork Tue Jun 18 14:57:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1118018 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="l31jdMVl"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45SrmJ5Bycz9sNC for ; Wed, 19 Jun 2019 00:57:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 44F18C21FEE; Tue, 18 Jun 2019 14:57:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8F636C21FA1; Tue, 18 Jun 2019 14:57:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EDC3DC21FC7; Tue, 18 Jun 2019 14:57:27 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 40EC4C21F3E for ; Tue, 18 Jun 2019 14:57:24 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5IEtuxi027031; Tue, 18 Jun 2019 16:57:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=sTPidtxvVKw3NeTMejTr8N19SQ/YcQHymGv92Cs5ADQ=; b=l31jdMVlckR5wNYzhSx+YPzC/FEOcqACf8Hvl9WLlTXvYxhmSdJYMm2iSAHtip3O0lBC 2ObD47s6M2SIzbCI4lxrQ54mgXXX88p2MO+zzKe/rh0CLKzCn7lii9sDIKu4LwwnI3Jp uOEkVP4WUPuUDqUb7HmbuWuIhYW9k0Wxvms+bLnRDpcpqeNJ2S5zJOq1JpE0UykMVAIe xrhqCBOsspq+8tzBhgC6BRK/rqFJWCoJdq0eMx3iD4np3xkBGESx5iuuZXsYrvEKQtnB UiRVkLI7huU7xa9AF5Q9cbgws/sUeU6/YCsUTlutraF1uMFFIil4TAvjtLK1ef0S8e7D Yw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t68n3qb8r-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 18 Jun 2019 16:57:23 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A1F5238; Tue, 18 Jun 2019 14:57:21 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B0BA12B6E; Tue, 18 Jun 2019 14:57:21 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 16:57:21 +0200 Received: from localhost (10.201.23.85) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 16:57:21 +0200 From: Patrick Delaunay To: Date: Tue, 18 Jun 2019 16:57:16 +0200 Message-ID: <1560869838-22025-1-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-18_07:, , signatures=0 Cc: U-Boot STM32 , Marek Vasut Subject: [U-Boot] [PATCH v2 1/3] usb: dwc2: correctly handle binding for g-tx-fifo-size X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Manage g-tx-fifo-size as a array as specify in the binding. Signed-off-by: Patrick Delaunay Reviewed-by: Marek Vasut --- Changes in v2: - move dt update in a separate patch - remove unecessary temporary variable drivers/usb/gadget/dwc2_udc_otg.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 494ab53..023439c 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -1039,6 +1039,7 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev) int node = dev_of_offset(dev); ulong drvdata; void (*set_params)(struct dwc2_plat_otg_data *data); + int ret; if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL) { dev_dbg(dev, "Invalid mode\n"); @@ -1050,7 +1051,18 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev) platdata->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0); platdata->np_tx_fifo_sz = dev_read_u32_default(dev, "g-np-tx-fifo-size", 0); - platdata->tx_fifo_sz = dev_read_u32_default(dev, "g-tx-fifo-size", 0); + + platdata->tx_fifo_sz_nb = + dev_read_size(dev, "g-tx-fifo-size") / sizeof(u32); + if (platdata->tx_fifo_sz_nb > DWC2_MAX_HW_ENDPOINTS) + platdata->tx_fifo_sz_nb = DWC2_MAX_HW_ENDPOINTS; + if (platdata->tx_fifo_sz_nb) { + ret = dev_read_u32_array(dev, "g-tx-fifo-size", + platdata->tx_fifo_sz_array, + platdata->tx_fifo_sz_nb); + if (ret) + return ret; + } platdata->force_b_session_valid = dev_read_bool(dev, "u-boot,force-b-session-valid"); From patchwork Tue Jun 18 14:57:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1118020 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="Oj5Ytb3J"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45SrnY4FTRz9sBr for ; Wed, 19 Jun 2019 00:58:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4737EC21FA1; Tue, 18 Jun 2019 14:58:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D2222C21FF6; Tue, 18 Jun 2019 14:57:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 68532C21F4E; Tue, 18 Jun 2019 14:57:29 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 3D7B9C22000 for ; Tue, 18 Jun 2019 14:57:26 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5IEtweE027216; Tue, 18 Jun 2019 16:57:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=9cMjbfbiESLHCMt2fd94r2wObJtzOztfXkGas+s5uNU=; b=Oj5Ytb3Jyx9LpqfecQPYKkpCLTFSLyhSpYgwV+zDbgqTBaEhd96ABF4Untfq8cZ8HSJJ +DLe145zJqMKvrPcAPN5AjyBCPy4GUlRLD+Z9pQEyiki5J8KG5Srs4jlX9gtXxr8qnG3 L+TCzRKwEs03o40FP1JkZV8dtXnX+Pa/6HnWl3cw8/RsWvFvk6hz1j1CWihsn73/GLH4 tndwGMi6UMbNEXjuauZ8CXcwFB8QWF16Q7PmuIbQgBg56zykIdAkSV/GyxQqmPAeV9E6 iXZPqfzc0P9EppEq2v1+hs5LDwNI54OVYZyuSWv9cSWyLsS3zrzlkFkomK0E8njYvhsh Nw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t68n3qb8t-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 18 Jun 2019 16:57:23 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4D37331; Tue, 18 Jun 2019 14:57:23 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 31CF42B70; Tue, 18 Jun 2019 14:57:22 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 16:57:22 +0200 Received: from localhost (10.201.23.85) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 16:57:22 +0200 From: Patrick Delaunay To: Date: Tue, 18 Jun 2019 16:57:17 +0200 Message-ID: <1560869838-22025-2-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560869838-22025-1-git-send-email-patrick.delaunay@st.com> References: <1560869838-22025-1-git-send-email-patrick.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-18_07:, , signatures=0 Cc: U-Boot STM32 , Tom Rini Subject: [U-Boot] [PATCH v2 2/3] ARM: dts: stm32mp1: remove override for g-tx-fifo-size X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Remove the override for usbotg_hs on g-tx-fifo-size as the correct binding, used in the kernel device tree, is now supported in dwc2 device driver. Signed-off-by: Patrick Delaunay --- Changes in v2: - move dt update in a separate patch arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi index 5b19e44..994092a 100644 --- a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi @@ -56,10 +56,6 @@ }; }; -&usbotg_hs { - g-tx-fifo-size = <576>; -}; - &v3v3 { regulator-always-on; }; From patchwork Tue Jun 18 14:57:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1118019 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="TeBrezGY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45SrnW2k0sz9sBp for ; Wed, 19 Jun 2019 00:58:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 099D0C21FE2; Tue, 18 Jun 2019 14:57:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3070DC21FC7; Tue, 18 Jun 2019 14:57:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 369C3C22006; Tue, 18 Jun 2019 14:57:29 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 25366C21FFD for ; Tue, 18 Jun 2019 14:57:26 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5IEtwjW027249; Tue, 18 Jun 2019 16:57:24 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=JjTOdGIelS2ulJqE0pQ9RAARDMFHAiIsDb0iTKio8iw=; b=TeBrezGYSjr+R7grwh5krPbK4C2u/OcGQz7xFNL/9cx2IJfGBRqW1B/XWUPOy2kHcbxW l2C3siSxXmUZIFJ5Ldd6E5F1fZhnTWfYvg43A4d2Fatoyd7Nv7jm3JfjbzUOVH1kPYHJ VPq9qMgfhcBUdTCRiHgvIqqS25Iw00o9Bw86jeCmjho0jB4+hUrP1wzc7u+01j1flML8 7MXiQyIc2yg4FCmTLWoE4OOM2QuaHOduMG0tbGPsQIwBwSNo0p09UyDbiGWhHz/APvdo qxq3lIhnD2YvnNPhdYymx8A2ktsOhJcJboxEt5gysmTAMs6AB3B2KGdUokY+6r1PwFXD lA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t68n3qb8u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 18 Jun 2019 16:57:24 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 158D334; Tue, 18 Jun 2019 14:57:24 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EFFB62B6E; Tue, 18 Jun 2019 14:57:23 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 16:57:24 +0200 Received: from localhost (10.201.23.85) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 16:57:23 +0200 From: Patrick Delaunay To: Date: Tue, 18 Jun 2019 16:57:18 +0200 Message-ID: <1560869838-22025-3-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560869838-22025-1-git-send-email-patrick.delaunay@st.com> References: <1560869838-22025-1-git-send-email-patrick.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-18_07:, , signatures=0 Cc: U-Boot STM32 , Marek Vasut Subject: [U-Boot] [PATCH v2 3/3] usb: dwc2: allow peripheral mode for OTG configuration X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Allow device mode in DWC2 driver when device tree select the dr_mode "peripheral" or "otg". The device mode is not allowed when dr_mode = "host" in device tree. Signed-off-by: Patrick Delaunay Reviewed-by: Marek Vasut --- Changes in v2: None drivers/usb/gadget/dwc2_udc_otg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 023439c..35f4147 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -1041,7 +1041,8 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev) void (*set_params)(struct dwc2_plat_otg_data *data); int ret; - if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL) { + if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL && + usb_get_dr_mode(node) != USB_DR_MODE_OTG) { dev_dbg(dev, "Invalid mode\n"); return -ENODEV; }