From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9894C54EE9 for ; Mon, 19 Sep 2022 11:18:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9B60284C27; Mon, 19 Sep 2022 13:18:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=tq-group.com header.i=@tq-group.com header.b="JQag7eUt"; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="TuWNBcAS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2AF4084BF1; Mon, 19 Sep 2022 08:21:03 +0200 (CEST) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9588984BF6 for ; Mon, 19 Sep 2022 08:21:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alexander.stein@ew.tq-group.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1663568461; x=1695104461; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=6p9PcS21L/ds5YRrWtvSsAz53QsqMiWBbf9cjGG08H4=; b=JQag7eUt0m6WkPwHX913EvKScqgbPGBKr+tfxEy4qrf6mMWYI0gwzfsN EJQ4kKYAIwT1ty6kTFHqM4IFZfNWARrXFbF1iKrs2CWCMd3QUeBI4eyNK wkvZRwykyRnjtUVc3fEZXzzDziZtbLrgK3cQyizBTKVVeuE85OYvhfjzE O19YBPs2TbYKcw55wHberTGOSKhQgv+CboIvX+Vh227xEgzVG+Ogu+R0i xXw7oie75kMS03uo4MAeVR+uX4e0Ke3b2TtKpnskAy5F1huj2UzEc3/zM GSmnSIouYKhRES8B97B++619l7zrcGaDQ22k8fWkHJ8w761dtlOUkI9o7 Q==; X-IronPort-AV: E=Sophos;i="5.93,327,1654552800"; d="scan'208";a="26243406" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 19 Sep 2022 08:21:00 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Mon, 19 Sep 2022 08:21:00 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Mon, 19 Sep 2022 08:21:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1663568460; x=1695104460; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=6p9PcS21L/ds5YRrWtvSsAz53QsqMiWBbf9cjGG08H4=; b=TuWNBcAShjknB2r257VPivsiZq3YAi29yBYr9URuf/hIzPjZK5OoLfx4 GpA2XvqBDvrHz6me/XL16/Syf7BKN7yjJlA7RgNg7SK9xQSfwS4JugvRh 7cSvUR5eKL9J0mMhA3OyBWS75E453kaO13Ysyfh5iYlXB4GEgU2lllTdK i/nOx6bedH7e/LSFZP74EDtmsv+9rZMN2A/ZcT0lIHOEhOKKogacm2MUv 6oFKrZFoGti/Ktgs+qG4cyS00X0usgsZ+pxB8venqIgBnrCEi2nv9OAw2 wqxTCrcw21rXishRHi5t1wCk2yT5Z2ltDGcu6uIzk/QEFDMwl+Ob+Qybv w==; X-IronPort-AV: E=Sophos;i="5.93,327,1654552800"; d="scan'208";a="26243405" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 19 Sep 2022 08:21:00 +0200 Received: from steina-w.localnet (unknown [10.123.49.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id E338C280056; Mon, 19 Sep 2022 08:20:59 +0200 (CEST) From: Alexander Stein To: u-boot , Marek Vasut , "Peng Fan (OSS)" , Stefano Babic , Martyn Welch , Fabio Estevam , "NXP i.MX U-Boot Team" , Tim Harvey Subject: Re: U-Boot support for IMX8MP dual-role Date: Mon, 19 Sep 2022 08:20:52 +0200 Message-ID: <12059772.O9o76ZdvQC@steina-w> Organization: TQ-Systems GmbH In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Mailman-Approved-At: Mon, 19 Sep 2022 13:18:08 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hello Tim, Am Freitag, 16. September 2022, 20:43:54 CEST schrieb Tim Harvey: > Greetings, > > I'm wondering if anyone has done any work to get dual-role USB working > for the IMX8MP (or any other dwc3 host based board) and how they went > about it if so. > > The imx8mp-venice-gw74xx has dual-role support through a USB Type-C > connector with a TPS25821 (driverless) that monitors the CC signals > and manages VBUS, as well as asserts gpio's: > FAULT# - pinmuxed to OC pin > SINK# - used as GPIO for role > POL# - used for SS mux to connector > > For linux this is managed with a usb-role-switch dt prop and a > connector node with compatible of gpio-usb-b-connector and id-gpios > [1]. I did not see anything like that in use in U-Boot for dwc3 hosts > but perhaps I was looking in the wrong place. > > For U-Boot I can get this type-C connector to work in host mode only > by changing dr_mode="otg" to dr_mode="host". With the default dt prop > dr_mode=otg dwc3-generic-peripheral is bound instead of > dwc3-generic-host thus no host controller is found. > > It seems to me that dwc3_glue_bind needs support added to be able to > check id-gpios or vbus-gpios if usb-role-switch and something like > gpio-usb-b-connector or linux,extcon-usb-gpio are used. Does this > sound like the correct implementation? > > I notice that drivers/usb/host/xhci-dwc3.c which is a driver for the > dwc3 core (compatible snps,dwc3) and this does look at usb-role-swich > however this driver as a subnode of fsl,imx8mp-dwc3 (glue) does not > bind and perhaps that is an issue. In that driver usb-role-switch > causes the driver to use role-switch-default-mode for the default mode > which still does not look at an id/vbus pin so that would not be > feature complete either. For imx8mp you probably need something like [1] to support usb-role-switch. But I am not aware how things are done in u-boot. Best regards, Alexander [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ commit/?id=a102f07e4edf0f1cf06bf9825ab10e26a29dd945 > Best Regards, > > TIm > 1 > https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git/commit/? > h=for-next&id=c8a4192d238e9258ab0bc916b3c138a4722af215