From patchwork Wed Jul 19 13:52:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 13319024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63027EB64DA for ; Wed, 19 Jul 2023 13:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tLqWwIP95qaiNwRSXPtlKqtnF6ul3Nrshuvof0DhMlE=; b=CjIxWAI0AMZynr ndK/FPbMnVzAfUOW+BXceC4BGWaWra8dDRmABJ8dy5xVoyr07ajSpkve21JRmxJ91x4zaPAWp1wtG 9BtRceUSweYHaNxWkP7158jcQuyVReMOnvG0BrehPmt+aJe80Ti5SbL75mSvtcbS3oMOGXC96Nebf fl1Qfot0MVtIaj2zd4xiyJQFos7L2Tq2L/VvsdVXu9MESFDO/ZGj0dPW41hi/cKHhbeK3M9W81vIR 0FXo1u+mYyAX3DefCeCO3vZouS8sCNrLqLglGvwV1jMh0Shy2LpvpgmQqWB3lQj2bWMoOuSZvkZ5B 92NHMJmOXhTRMuSRFu+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM7c0-007dT3-2j; Wed, 19 Jul 2023 13:53:04 +0000 Received: from mail.hugovil.com ([162.243.120.170]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM7bx-007dRx-2H for linux-arm-kernel@lists.infradead.org; Wed, 19 Jul 2023 13:53:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=0twBvll8BbpMn27wcaLT/e5BA6uXX2lFysVkum50hag=; b=D XLdQY+7WOtLBKPbPUq2vb7JeHNex8Je8BWXYXzJz/YifO4f4tSZxNK75HhZ3KOCr3hia36vSLrgry Jsg0EOJ8LlG48VhnZJQU7eWFhhekV+EkbcRzk86UxYnGZ8unk9l6IAKIFcjNMqc6QDjTkK89dLQrB pkVI88XuK4du6Lbo=; Received: from modemcable061.19-161-184.mc.videotron.ca ([184.161.19.61]:60540 helo=localhost.localdomain) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qM7bc-0003ut-LY; Wed, 19 Jul 2023 09:52:41 -0400 From: Hugo Villeneuve To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: hugo@hugovil.com, Hugo Villeneuve , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 19 Jul 2023 09:52:37 -0400 Message-Id: <20230719135237.2986984-1-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 184.161.19.61 X-SA-Exim-Mail-From: hugo@hugovil.com Subject: [PATCH v3] arm64: dts: imx8mn-var-som-symphony: update USB OTG for new board versions X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230719_065301_742208_E9017F30 X-CRM114-Status: GOOD ( 17.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Hugo Villeneuve USB OTG is currently not working for new versions of the Variscite Symphony EVK and imx8mn nano SOM (versions >= 1.4a). The PTN5150 circuitry on newer versions of the Symphony EVK board has a non-standard configuration in which the PTN5150 IRQ pin is left unconnected, and the PTN5150 ID pin is connected to GPIO1_IO11. This requires changes to the ptn5150 driver to support this new mode. Variscite have indicated their intention to submit those changes upstream. In the meantime, import device tree changes from linux-5.15 branch of varigit repos to at least make the USB OTG port operate correctly in host mode. Signed-off-by: Hugo Villeneuve --- .../dts/freescale/imx8mn-var-som-symphony.dts | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) base-commit: fdf0eaf11452d72945af31804e2a1048ee1b574c prerequisite-patch-id: 45559b1f2aca74c1c733cc2d61db7b48b1b9594a diff --git a/arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dts b/arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dts index 406a711486da..a7a57442cb81 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dts +++ b/arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dts @@ -1,11 +1,14 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) /* + * Supports Symphony evaluation board versions >= 1.4a. + * * Copyright 2019-2020 Variscite Ltd. * Copyright (C) 2020 Krzysztof Kozlowski */ /dts-v1/; +#include #include "imx8mn-var-som.dtsi" / { @@ -100,14 +103,26 @@ enet-sel-hog { }; }; + /* + * For Symphony board version <= 1.4, the PTN5150 IRQ pin is connected + * to GPIO1_IO11 on the SoM (R106 present, R132 absent). From Symphony + * board version >= 1.4a, the PTN5150 ID pin is connected to GPIO1_IO11 + * on the SoM (R106 absent, R132 present). + */ extcon_usbotg1: typec@3d { compatible = "nxp,ptn5150"; reg = <0x3d>; interrupt-parent = <&gpio1>; - interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + interrupts = <11 IRQ_TYPE_EDGE_FALLING>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ptn5150>; status = "okay"; + + port { + typec1_dr_sw: endpoint { + remote-endpoint = <&usb1_drd_sw>; + }; + }; }; }; @@ -148,8 +163,21 @@ &uart3 { }; &usbotg1 { + dr_mode = "otg"; + hnp-disable; + srp-disable; + adp-disable; + usb-role-switch; disable-over-current; - extcon = <&extcon_usbotg1>, <&extcon_usbotg1>; + samsung,picophy-pre-emp-curr-control = <3>; + samsung,picophy-dc-vol-level-adjust = <7>; + status = "okay"; + + port { + usb1_drd_sw: endpoint { + remote-endpoint = <&typec1_dr_sw>; + }; + }; }; &iomuxc {