Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2578992rwl; Mon, 27 Mar 2023 02:07:54 -0700 (PDT) X-Google-Smtp-Source: AKy350bwLSu4GSBY4GG0dNcXnG37PsZ9cF0p1AJMpfHUj6xIph9LV638Q2XPwwFEIjRcFo2dSkwp X-Received: by 2002:aa7:c9d6:0:b0:4f9:db7b:b6b4 with SMTP id i22-20020aa7c9d6000000b004f9db7bb6b4mr9997940edt.40.1679908074437; Mon, 27 Mar 2023 02:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679908074; cv=none; d=google.com; s=arc-20160816; b=EMUyDZYVpFgUdSqS77b5MpuprP43WTXAz1kmMiugzmHZnhc/KVEYOFqFGRpnWUcPD0 EV2QR3qknQeils50o2Jkh2QGTcFmT29RKLwFaQOuXGKcZB2Dfi4i4KW/GAYeJhNZf51R Ek+FI0M/y/IR/o/LkZC5pMW8V/QSzscto+V4CldJdJ5q32tlnx0ACnToVpnY4rQDKmKU H+BhN7tXBV6NDEqubYR4hE9bFvNkbK81zUhQDO7C/TQDpZZ35hTZlvJ1/nImrduBHM/H sW0kU3M8ZTwoFvponmCUbHIuRU4/t+1KE50W2hu+zm4CykwJpr2IbLZtVP683E9HLTER ImyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=yQIdbVMX9y5gCZwziXh+eJ7m5aAsLc6kjYKtybSTRBs=; b=nDUpVkhZK2xcaislH3D8HRlb1y0N34DLGjettCHKNWc27/arBgZ6VoiKxtW3yIsfxB wlhOout5fuDTNFN8fwYh9m32Bf4NL7K8QGEMT8DTbC5fDz7wb9Pnw7THWk4HTj67SU4V z6CJ7FH0dGQ1HXnQTy9UBBicQuH3Wl19e+NqWuzJA7tgFipO28rr0XbvytMvMDRGYZ27 BqQifSWkxowGqLvqCSGPz12GDiWg16LUhfDjGBhmPYT+YUa0XZ7gve3jdOYPcoiyC4cy OSSRDeAexER2ZrNOs/4NMPooJ69h7yVZjP23zNT9A1vpPi045mZEiNEufqFsO6CPxJqq 6Fdg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs29-20020a1709073e9d00b0093333679c9fsi28371563ejc.150.2023.03.27.02.07.28; Mon, 27 Mar 2023 02:07:54 -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; 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 S233438AbjC0I7n (ORCPT + 99 others); Mon, 27 Mar 2023 04:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232814AbjC0I7O (ORCPT ); Mon, 27 Mar 2023 04:59:14 -0400 X-Greylist: delayed 441 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 27 Mar 2023 01:57:10 PDT Received: from pi.fatal.se (andreasfatal-1-pt.tunnel.tserv3.fmt2.ipv6.he.net [IPv6:2001:470:1f04:f16::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 83AED55AF for ; Mon, 27 Mar 2023 01:57:10 -0700 (PDT) Received: by pi.fatal.se (Postfix, from userid 1000) id 3A18E2A127; Mon, 27 Mar 2023 10:49:47 +0200 (CEST) Date: Mon, 27 Mar 2023 10:49:47 +0200 From: Andreas Henriksson To: Jun Li , Marco Felsch Cc: "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "shawnguo@kernel.org" , dl-linux-imx , "festevam@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "kernel@pengutronix.de" , Xu Yang Subject: Re: [PATCH] arm64: dts: imx8mp-evk: add dual-role usb port1 support Message-ID: <20230327084947.dcguxgyo2lfen2ms@fatal.se> References: <20230323105826.2058003-1-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 24, 2023 at 10:18:17AM +0000, Jun Li wrote: > > > > -----Original Message----- > > From: Marco Felsch > > Sent: Thursday, March 23, 2023 6:58 PM > > To: robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; > > shawnguo@kernel.org; dl-linux-imx ; festevam@gmail.com > > Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; > > kernel@pengutronix.de > > Subject: [PATCH] arm64: dts: imx8mp-evk: add dual-role usb port1 support > > > > The i.MX8MP-EVK has a dual-role usb-type-c port marked as PORT1. By this > > commit the dual-role support is added which allows the user-space to assign > > usb-gadget functions to it via the configFS. > > So just ignore the orientation switch will make this port cannot work > at super speed, this is actually why this port is not enabled at upstream. > I see the orientation switch via GPIO for SBU is already merged: > drivers/usb/typec/mux/gpio-sbu-mux.c > Do you have interest to expand this driver to support super speed > switch for this case? [...] FWIW This is what I ended up with (after backporting the gpio-sbu-mux patches) a little while ago trying to get the usb-c ports going on imx8mp-evk. I've not yet had the time to fully test this (only done host/device, not tested: SS, orientation, etc), so beware that it might be completely wrong. #include "dt-bindings/usb/pd.h" &usb3_phy0 { vbus-power-supply = <&ptn5110>; status = "okay"; }; &usb3_0 { status = "okay"; }; &usb_dwc3_0 { dr_mode = "otg"; hnp-disable; srp-disable; adp-disable; usb-role-switch; role-switch-default-mode = "peripheral"; snps,dis-u1-entry-quirk; snps,dis-u2-entry-quirk; status = "okay"; port { usb3_drd_sw: endpoint { remote-endpoint = <&typec_dr_sw>; }; }; }; &i2c2 { clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2>; status = "okay"; ptn5110: tcpc@50 { compatible = "nxp,ptn5110"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_typec>; reg = <0x50>; interrupt-parent = <&gpio4>; interrupts = <19 IRQ_TYPE_LEVEL_LOW>; status = "okay"; port { typec_dr_sw: endpoint { remote-endpoint = <&usb3_drd_sw>; }; }; usb_con: connector { compatible = "usb-c-connector"; label = "USB-C"; power-role = "dual"; data-role = "dual"; try-power-role = "sink"; source-pdos = ; sink-pdos = ; op-sink-microwatt = <15000000>; self-powered; ports { #address-cells = <1>; #size-cells = <0>; port@1 { reg = <1>; typec_con_ss: endpoint { remote-endpoint = <&usb3_data_ss>; }; }; }; }; }; }; &iomuxc { pinctrl_typec: typec1grp { fsl,pins = < MX8MP_IOMUXC_SAI1_TXD7__GPIO4_IO19 0x1c4 >; }; pinctrl_typec_mux: typec1muxgrp { fsl,pins = < MX8MP_IOMUXC_SAI1_MCLK__GPIO4_IO20 0x16 MX8MP_IOMUXC_SD2_WP__GPIO2_IO20 0x16 >; }; pinctrl_i2c2: i2c2grp { fsl,pins = < MX8MP_IOMUXC_I2C2_SCL__I2C2_SCL 0x400001c2 MX8MP_IOMUXC_I2C2_SDA__I2C2_SDA 0x400001c2 >; }; }; / { gpio-sbu-mux { compatible = "gpio-sbu-mux"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_typec_mux>; select-gpios = <&gpio4 20 GPIO_ACTIVE_LOW>; // (PAD_)SAI1_MCLK -> USB1_SS_SEL enable-gpios = <&gpio2 20 GPIO_ACTIVE_LOW>; // (PAD_)SD2_WP -> USB1_TYPEC_EN_B -> TYPEC_EN_B //mode-switch; orientation-switch; port { usb3_data_ss: endpoint { remote-endpoint = <&typec_con_ss>; }; }; }; }; Hope it might help. Regards, Andreas Henriksson