From patchwork Thu Mar 20 13:56:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 875173 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2087.outbound.protection.outlook.com [40.107.249.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 688EC1EB1B7 for ; Thu, 20 Mar 2025 13:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742478978; cv=fail; b=YTJecCoTrogKnHvvBfSRqM7u5qTR1/Gm1RqrGX2h1ae1mz2FIpoNRVIl8MQrYECD+jVO7fwD+uwMtErDwyVOZiHWPh/MGwlQfZRpjYjiXqJuz793i5oVm/TRvpmgiqyxxmXXQGkclXzxGbUGQSfHNnucv+WWxVQESkXtlb9PrP8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742478978; c=relaxed/simple; bh=IyikGsiFQFHGmxnPrjNqnoB91XpbUDxmPsQCmwdprzw=; h=Message-ID:Date:Cc:From:Subject:To:Content-Type:MIME-Version; b=nOtS/HVeuKTPKEVGWVm2FadCBcC6d4jBD0aBGvu7g1yjF3VZZ49eMMaGdKyC2qKV946VaYoKqmHIAeLQ3hrOTLmgEiIfMqNLGQfNAc679jAXyEhLm23/dAOFzTlKXIX6CE8HDKS87U/qtk+/nBN+genHmUzgUMV+drl4ntV99CE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de; spf=pass smtp.mailfrom=cherry.de; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b=XSzgFIPa; arc=fail smtp.client-ip=40.107.249.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cherry.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cherry.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cherry.de header.i=@cherry.de header.b="XSzgFIPa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g3LNq0/PtyTG8IgPzfD9GCAc4g/pVzzsJrJoLT7DmsuUJo6K3To6aLXZLhOGGk9yLHl4mWecHzrduYtBecabJRy2cijJQBC10w3MGYfqryEDEUJp0UPnz3qXv8eGnKhi4XKvDsKYLGdyS76v4+LCf9ttzL2LccXSx8px/O1rt+XQlccG2XIYAkn+OAaPVegdUORtajnuZmXW4DledBfcaFnwCuguXoWLhwhsgo5VRLRO0/+KtpEKF2KupwGvKgc3LFKu7OHtiAZerfMJb+jYP7QJTeXyRDQT9hDRLOa8b2gF8UrkN4btw9lWhGMdEmUmXd9RUIryM+4mA9Zo2hs2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qUKkpaq2Xh7Srk5h3/ZmHLof88r7s3AtNvrVaUtFtks=; b=WdTdoN94MabVO0/g/ZtLCw6s2drH3HduQgGux1QhHl09vrROdVCT6oj5aoHUPnRj72ubEMHLwCKoAa2wZ2B/Zk8eH7bRfxp2uJhbl+uluHcxfuVtlrQNjoMWAkiW0WwCV9fFRdR/KtZuxrtcnnpg7KOEjhJSgR5NPPIuM1dNqKD5LgRjf5d+gdrHDF5oTL/WNXw59exPecHdO2a2UQCxJDIpjkfPa7hi5B2eA0XaBJ2GH8qcQp9MCUKlU2x1kpbsnttR+uZuFYYJQdhn6lVtScJ9NbDCaE55+qX3bI39n/y80sB/iUWxd9DTzgFLReEjgjYy8uhrgUVJIwQuutR0kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cherry.de; dmarc=pass action=none header.from=cherry.de; dkim=pass header.d=cherry.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cherry.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qUKkpaq2Xh7Srk5h3/ZmHLof88r7s3AtNvrVaUtFtks=; b=XSzgFIPa0QTWylXeRAvZCAa/vzGLg3OzozcwCG68xa4qQ5QL6dCJoO8PVx8bgAIfn/BFLpsMUF/gb+ZpUPRH60BKp7h2wnejS1BXp5qlvb2pHGk0c9qWgSmiJ9NAaG5ipgubGttcqs+jf9YvT4eHISHLD2TT+8QWgk7ZU5bxOlc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cherry.de; Received: from AS8PR04MB8897.eurprd04.prod.outlook.com (2603:10a6:20b:42c::20) by DUZPR04MB9746.eurprd04.prod.outlook.com (2603:10a6:10:4b1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.35; Thu, 20 Mar 2025 13:56:11 +0000 Received: from AS8PR04MB8897.eurprd04.prod.outlook.com ([fe80::35f6:bc7d:633:369a]) by AS8PR04MB8897.eurprd04.prod.outlook.com ([fe80::35f6:bc7d:633:369a%6]) with mapi id 15.20.8534.031; Thu, 20 Mar 2025 13:56:11 +0000 Message-ID: <939f75e9-7d17-4627-b19f-71e286d11256@cherry.de> Date: Thu, 20 Mar 2025 14:56:10 +0100 User-Agent: Mozilla Thunderbird Content-Language: en-US Cc: Heiko Stuebner , Lukasz Czechowski From: Quentin Schulz Subject: Discussing some limitations of USB onboard devices To: linux-usb@vger.kernel.org X-ClientProxiedBy: FR4P281CA0028.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c9::19) To AS8PR04MB8897.eurprd04.prod.outlook.com (2603:10a6:20b:42c::20) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8897:EE_|DUZPR04MB9746:EE_ X-MS-Office365-Filtering-Correlation-Id: ea13e31f-d390-4f13-0c53-08dd67b6f886 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?ehjW2JXSri+hNDSQreJ3RFCPtq9A05D?= =?utf-8?q?5BOic+4oXcSwZySzpO2hvFjIIPx7419sSY1whN3mNUE6XNA1lsUSGUcvHbuFe7JgZ?= =?utf-8?q?G90aN5P4I3A509grwng5cOxhfdGSIXGYDi9OtrXOnU0WIJ5JYqnLYU+RJgu5Smtd+?= =?utf-8?q?RykKrywwgC9FSQGibtFJSWznlDWkvG0/wLvIFCS1kXcSc1V79aYQxQhpZITtOkUsP?= =?utf-8?q?Ql7njfc+T+t0xZUIuTX5McgKH2XH1Y05pQk7sBrrDxarD8IaZQblbxxm4SvHWhLoO?= =?utf-8?q?0gZaGPKlX0JRvADtnMkBRADgy+MKs6N4SSVd0wGkBLu7/Ua3yebayyQ/AmFiPK0GJ?= =?utf-8?q?DIWpfw/c4cEdXdV1eAK4A1c2Ec5/dpuHoPFNYfbg9qzhDaRMNqnPygVWlM63dczdm?= =?utf-8?q?tq3IoTztNfyBLgTcC+oadmYAnu+H8kOzXKky2n0qKZfMmwA7tnN02MoNHmDsyVyu+?= =?utf-8?q?nymcTDRG+y9Xtt+UNac1pHW3xR56nav3tt8btmqf8QoMl6hF5YI5Td1E4JH5XQCxK?= =?utf-8?q?M6ixkjUdzevjiZGJQt0yMzIqaLWemq6MmTLAox4ZheXioEZYJgmOAh/mLTG26psSl?= =?utf-8?q?CwCFBqH1cGgRE8CuwaENHu0KGaJi9CP0bkqtBHbiHbTuHIUbYgYooMyAHhm1Dhw6q?= =?utf-8?q?W9A+nct/DdGFhtbMJK5cQ2HnLQ2ZWaWfuP0Jt4mWeUO4BLopC3rezQRMD7AGR0bgg?= =?utf-8?q?04DRMGso6nzL7zXa+sgptMGT+WNkd3KDEbhe1niOT1JviSDbi/B3aK9emPHE6LrFC?= =?utf-8?q?XHj9l8QoojxdzppKpPeBZBKScHmphXf1E5OLq1BfUA4qRhZAUu+LghL33hxGOLege?= =?utf-8?q?6ZNY0PKoShGgHShVhXfNoaAU3XakL0porvJcS+eXkK6zdGn2lPFmLWtCDKwR5XHNG?= =?utf-8?q?YiXfUt41+hYd7X16YFSB2dufML6Ghygy8JBieVFHCVPbanqrG45o0j/lbJnFq0FxV?= =?utf-8?q?8mH5MI1xgZKW43Q1ceSyN/bZ65he6WxaROGOfMk+sO0vM26ctV0vihRI5iUwS9I/C?= =?utf-8?q?R5Je7uUlxa3LOupQ0dSH02/4Ro80jg/8lHRwB488VJpT3Maj8PR6gws0AHXYZGuby?= =?utf-8?q?j799WC3OhPQGCGvhviP0KGg4CIgjAu3x/VH1PCHJqY1SXs1o+EO0Mt4xk7lSZKRIR?= =?utf-8?q?C/wDKmFtcjDbCouDnfGOpWgjdqaMG3GtuYXwLlOgvWGo+CgtlKk7rbe9vHE0O8xXY?= =?utf-8?q?tApzX4VG/lkSPb/qwxQ0cku+VOz495uGiPdsYsq/o5/5lcGN7bT7M5fHuR2mdw4JW?= =?utf-8?q?yQDdQJnjEdyH/cl5mdoniHwo1e2GA+BvD4lWAbaGjXXbrsTHPORNIAKdD02cuoTuL?= =?utf-8?q?5Ylr5QA1ntc+?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8897.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SF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ZJJA81CAI5v8qhSDngGKvf?= =?utf-8?q?LfYFas/HOEBgG4LH6jBGmocNqFPpDXvTBbJj4srQTV7i3en+BrUgR5aqnYNxEp+Vu?= =?utf-8?q?fMh5rKxJFBLRrWXBF67jcKjopvHN0QeB+IA1y1XQQcxkB3L9xfegKOlyue1IQ40SG?= =?utf-8?q?Ai2omcltHWr8H9aCfSzr2pfxFaqfHQtKJDZJ3XwpxPdnUpLu/tJBAz+ze6qdcr5e9?= =?utf-8?q?CjbRTXupf7xfVUBh/OxD1z67lJa5rhvNnnZN1nA/zvuXAaT8VUC38l3Aia+XOE43y?= =?utf-8?q?m+G6rGwqQwhjdTPNOq930guz7CT3R/QaZxmDcc1bKKLtTX5icAMh01awLgzEa4Eau?= =?utf-8?q?I1kLy7ZA6uJBpFQftYIB7TJBtfvvOtyo/ZNF2xayvOYZU2JlpIceQHTELZOrEXShT?= =?utf-8?q?DE/Q5izpNd1rEwc2a1YuERcIQxwUsjiQLAPkGYqxj33IhnxIxoK6RrM7kQ/STW5XF?= =?utf-8?q?nYn2Lxt0+t3xEik7h4EBjyp71SmADiAXObMgcQ8nigGmz24UxHSoS6MTMroP/rerc?= =?utf-8?q?D4g2Xj4i51dewurCV3MuzwpWIjhN/EBXuqtoYByFTdBWbcJjUAbm1Q1j/f50iDDxR?= =?utf-8?q?7t8pzEkXHZ70LS9K73k/EN6VDilI4BrLVkTE5/7mXvF/bqXzyx4mfdlOt00I7x9Ko?= =?utf-8?q?XDN673b0KQV1DcnpoDCrmjG8m1IwXYw7sTCOaJXP+hN/6DDJ91kUuJxsZE/X739W3?= =?utf-8?q?V2NDpF8lqzJZAteJsT+srnxjn9zMs+0wzQ=3D=3D?= X-OriginatorOrg: cherry.de X-MS-Exchange-CrossTenant-Network-Message-Id: ea13e31f-d390-4f13-0c53-08dd67b6f886 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8897.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2025 13:56:10.9986 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5n2iAsffX82hBci0ZFDmU8tAgKu34XYUNXAlJ+KfNJC3H8kCliV1PxKiKdEg2beiTdQj4kLdlPIrApX+cvt7nveX0RnqFcqSBXo6PoQpxMI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9746 Hi all, We're working on fixing the Device Tree for our RK3399 Puma board to use onboard USB hubs instead of some hack we currently have for handling the reset line that is unreliable. This is the diff I believe should represent what needs to be done for supporting that: """ """ However, this simply doesn't work for a few reasons. 1) pinctrl request is broken, I get the following error messages: """ [ 2.979479] rockchip-pinctrl pinctrl: pin gpio4-3 already requested by fe900000.usb:hub@1; cannot claim for 1-1 [ 2.981799] rockchip-usb2phy ff770000.syscon:usb2phy@e450: Requested PHY is disabled [ 2.981846] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller [ 2.993129] rockchip-pinctrl pinctrl: error -EINVAL: pin-131 (1-1) [ 3.002141] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 3 [ 3.007936] rockchip-pinctrl pinctrl: error -EINVAL: could not request pin 131 (gpio4-3) from group cy3304-reset on device rockchip-pinctrl [ 3.023446] onboard-usb-dev 1-1: Error applying setting, reverse things back [...] [ 3.131038] rockchip-pinctrl pinctrl: pin gpio4-3 already requested by fe900000.usb:hub@1; cannot claim for 2-1 [ 3.132598] dwmmc_rockchip fe320000.mmc: Version ID is 270a [ 3.136997] rockchip-pinctrl pinctrl: error -EINVAL: pin-131 (2-1) [ 3.142490] dwmmc_rockchip fe320000.mmc: DW MMC controller at irq 81,32 bit host data width,256 deep fifo [ 3.149860] rockchip-pinctrl pinctrl: error -EINVAL: could not request pin 131 (gpio4-3) from group cy3304-reset on device rockchip-pinctrl [ 3.199221] onboard-usb-dev 2-1: Error applying setting, reverse things back """ This can be worked around by using the HCD node to store the pinctrl, but it feels wrong to me. Another way could be to have a pinctrl-names differ from "default" or "init" (e.g. "hub") and handle that directly in the probe of the platform device to avoid triggering the automagic pinctrl "default"/"init" behavior pre-binding/probing (which I assume is the reason for this error?). 2) I get error messages wrt vdd/vdd2 supply for the second hub: """ [ 2.564690] dwc3 fe900000.usb: Failed to create device link (0x180) with supplier regulator-vcc1v2-phy for /usb@fe900000/usb@fe900000/hub@2 [ 2.578928] dwc3 fe900000.usb: Failed to create device link (0x180) with supplier regulator-vcc3v3-sys for /usb@fe900000/usb@fe900000/hub@2 """ I assume this may be because there's no device created with the OF node of the second hub (the second device uses the platform device and its OF node from the peer-hub, the first device to probe; if I'm not mistaken?). For that SoM it isn't a big issue because both power rails are always on and at boot (like, enforced by hardware), so it'd be fine for us to use dummy regulators (e.g. not having the properties in the first place). 3) reset-gpios (and probably other properties like clocks, i2c-bus, etc...) need to be identical on both hubs. Otherwise the first hub to probe will be whose OF node will be used, so if properties are missing or different from the other hub, we'll just handle properties from that first-to-probe hub. I assume this is fine as we expect peer hubs to use the same reset GPIO(s), clocks and everything else as they are seen as individual physical entities and that's the expectation of how the HW is functioning? Should we (can we?) enforce that on the dt-binding level to make sure that is the case? What are the recommendations here? Did I misunderstand how to declare our onboard hub in the DT? Did I misunderstand some internals of this onboard hub driver maybe? Is there anything we can do to improve that? Cheers, Quentin diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi index e00fbaa8acc16..7aa260fc9dda7 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi @@ -60,16 +60,6 @@ vcc3v3_sys: regulator-vcc3v3-sys { vin-supply = <&vcc5v0_sys>; }; - vcc5v0_host: regulator-vcc5v0-host { - compatible = "regulator-fixed"; - gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&vcc5v0_host_en>; - regulator-name = "vcc5v0_host"; - regulator-always-on; - vin-supply = <&vcc5v0_sys>; - }; - vcc5v0_sys: regulator-vcc5v0-sys { compatible = "regulator-fixed"; regulator-name = "vcc5v0_sys"; @@ -527,8 +517,8 @@ pmic_int_l: pmic-int-l { }; }; - usb2 { - vcc5v0_host_en: vcc5v0-host-en { + usb { + cy3304_reset: cy3304-reset { rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; }; @@ -597,7 +587,6 @@ u2phy1_otg: otg-port { }; u2phy1_host: host-port { - phy-supply = <&vcc5v0_host>; status = "okay"; }; }; @@ -609,6 +598,30 @@ &usbdrd3_1 { &usbdrd_dwc3_1 { status = "okay"; dr_mode = "host"; + #address-cells = <1>; + #size-cells = <0>; + + hub_2_0: hub@1 { + compatible = "usb4b4,6502"; + reg = <1>; + peer-hub = <&hub_3_0>; + pinctrl-names = "default"; + pinctrl-0 = <&cy3304_reset>; + reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; + vdd-supply = <&vcc1v2_phy>; + vdd2-supply = <&vcc3v3_sys>; + }; + + hub_3_0: hub@2 { + compatible = "usb4b4,6500"; + reg = <2>; + peer-hub = <&hub_2_0>; + pinctrl-names = "default"; + pinctrl-0 = <&cy3304_reset>; + reset-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; + vdd-supply = <&vcc1v2_phy>; + vdd2-supply = <&vcc3v3_sys>; + }; }; &usb_host1_ehci {