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: 122644 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2473413vqt; Wed, 19 Jul 2023 07:20:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlFwPOUac3qP3fI/MxrnhsemY6e2KNvl1S0NjVjPoLGV7VxOhnD8ITWJG/AORoU4v79vO6bP X-Received: by 2002:a05:6358:94a4:b0:131:127d:4b59 with SMTP id i36-20020a05635894a400b00131127d4b59mr16944039rwb.23.1689776407741; Wed, 19 Jul 2023 07:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689776407; cv=none; d=google.com; s=arc-20160816; b=wrA5VKb3z2jhTxfaMcFy+8OUkZtYynSR0o/2YODRvkBTAY0XOWiT2uylQfxg6r0Rsx PUZAfojkrfMHD5BXTv3PqBZOnTX5+P2b0+9zp9iwT0pUo5pVTzkTbN962kzZZOOl108k ULzbafTXYYu5CsUVK8RNI5Nl/dGuwDzOU8Z3OpM+yezQ7pEb3hhjH+ROELSSXBlhlEsE U7gIfPvTVrzpfnwFQwFveWzJjuONea7kTMM6sYPI+f9y0q3O0v4aQ07Gz8HkpWYO9wTE rUVYt4u2MW7IPRl9PWHSB3mZNrGkZ6ifQRroiigjzE0rYHqrarFXOnzShkHrG2tlge+R Tn+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :message-id:date:cc:to:from:dkim-signature; bh=0twBvll8BbpMn27wcaLT/e5BA6uXX2lFysVkum50hag=; fh=VbjWmrdj8S360M0Zc4Z5KGxcUjAYCDhUOnVy7TOapco=; b=UNnWXwn0AgTcnq2QKDRQ/1E1HfOBOSiBjE+pkHuEQhcpfAsN/tWMTpPM/L9E7QU20g jTHN/hLak1oQN79vbqOjRzLndWeOD1PnKovmUQ9GP44cEF4iWfJrP9Lel7U/yeftowuI +3cXU6EHYxEPRrzq5v+RSUaWQenvyRtQbTmWJOtzJhad1x7/NvlgsSy++e9R+eYRWy1c 3re+7TKSPjxXoE2A0QzAJUMj+LLNiJ2WeJhyRJsDywbgrl+UKEE6ffY2jTJiAP44mtyL NA0RrXc0LhdQSXairvNyNZSI4Y7e5fKSu36E5GuN6frQ3gykywOscchx1ZVSneYEAd0G KEBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=DXLdQY+7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 35-20020a631363000000b0055c81ab9a9fsi3622291pgt.582.2023.07.19.07.19.53; Wed, 19 Jul 2023 07:20:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=DXLdQY+7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbjGSNxB (ORCPT + 99 others); Wed, 19 Jul 2023 09:53:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbjGSNxA (ORCPT ); Wed, 19 Jul 2023 09:53:00 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBAB212C; Wed, 19 Jul 2023 06:52:57 -0700 (PDT) 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 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771858986741083462 X-GMAIL-MSGID: 1771858986741083462 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 {