Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp265379rdb; Fri, 6 Oct 2023 02:54:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENxB3Tp9Xy2KuUuDFOC9Ku3V5xpnO6bURky2IzuRXWeJrQJYneLZtUp9mBV7dd177hW8Kn X-Received: by 2002:a05:6808:4c8:b0:3a8:7f65:a94 with SMTP id a8-20020a05680804c800b003a87f650a94mr6632203oie.42.1696586043197; Fri, 06 Oct 2023 02:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696586043; cv=none; d=google.com; s=arc-20160816; b=sJIG9J0OiqvpONbvPkOrwDNX7lZM2MCdnT5B9oKYnkc3m672Jhr9tJb6OQdrRJ2CM9 rJdxaDT3gyvP8Slm2uLjoNXDCJPPAd7ripSdqZU8yXmAGY43K3hY8PAzs+x9CAxWPVUo Espyu/64qiN3+h7BOyFBvKk8b+1f1nQZsz9avIcMshwrqGYNi9k8CUY1+F+WC2ywJTky qLecVkxVs/fnPFtFqRO/KmlRl5AEpETdOLWs6eCSig/FehbchRKl/Mu9QJyPx8O8xhnS XF7Zga7GnSDvRagxPCGoYg5kcueUOryb752tc4N18Co/2VLpR9btjAS/0oKZ6YZPDtZk sDMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=EAsXkny87ZOF57hq2rRzij47Q/y5dvWojHFo8373xlo=; fh=/VC3+P35Hyqc6SVMTFn0iEFWgn+I5X2jQRRnug/EFO8=; b=P1l5ON80UJprayeVLSf9tHdgP66WABgtwm8TBXXQUv8UpCHpUdWQWvLnmUAJyQibxH RJaldH8EJa1s+3osAu+jmhonKsqW/eFF3AV9ETqLw5g/Vyhj+HciI1dpYOdjDOu0mvVb qfXU69vy1ACkedEL98mkRVCDKJzv0Sq1mnx3zML8tBmr5uEtwuVH0Xe+SUpon8Mo1NBa 1L2Gzu5UYhhvbqFwbWyK4YGhdOIbIMSmcILkxZTxsnCT0c/MV6XWq0J9L2paveGHlDKS kUKK2+sFQg4Eg2aq1fytpBj/Qg8BRdPHaGLmd0Ak0UtOyxcbsA98Q7UGsaHL39O6DK7W U6WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b="p/Yjr8SJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id k186-20020a633dc3000000b0057a32c18a47si3333210pga.47.2023.10.06.02.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 02:54:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b="p/Yjr8SJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0208F808EDE3; Fri, 6 Oct 2023 02:54:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbjJFJxr (ORCPT + 99 others); Fri, 6 Oct 2023 05:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbjJFJxp (ORCPT ); Fri, 6 Oct 2023 05:53:45 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAAEF9F for ; Fri, 6 Oct 2023 02:53:43 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40572aeb6d0so17339865e9.1 for ; Fri, 06 Oct 2023 02:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1696586022; x=1697190822; darn=vger.kernel.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=EAsXkny87ZOF57hq2rRzij47Q/y5dvWojHFo8373xlo=; b=p/Yjr8SJzp0FOZvU9tGkYOv8Sy5p+MEBUZH350LpCar5L7/wzXgLi3NIoXCcM5yNE6 8siV/oHsbWfT10ihKrAfmopoRfeJcdM7pJcE2zl4ruLyYG2x/JKZ+fQQj5kyCxFowOLE CfPuau5HCGuGeQ4vQBSBa5NJNYGt1lkmyC5fjnM83xpfMm0l8U8L3NHfMNMUO7pjrk8d hZrbM851eZ8jZGBQzBrKoEGtKcFLyBiounrN/3unxBfFDEzL+EpoLwJmodejLveqJNtK cTZIWhntZeeyJIK6H2Nvso2ZT+FSUQhpg8uH2GbVEsSu5ZBkhQQyHNLklkBJy+tfQpwL nGxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696586022; x=1697190822; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EAsXkny87ZOF57hq2rRzij47Q/y5dvWojHFo8373xlo=; b=GQUuTIHTmWBGNGZVlZ54aPetID4uiDGm10nBFGRLQU7HH/Dn2iJBwgP5/I/mRz+s1K UPgIfb5JlEBM2ryZ6+sTlV7R8B7RBjuzXzIS2HKY2w3QLL3p42xpnM/rIabxkwFE3K7N LVxnUKa4zeLnAfgqGsDSWH4VMi98q/xY/L1Y8pBOLhTbVET4FST6RWPZy8aN15/5xR5V 9zymh8VKSo2TW1llL46IjzLeNBs51XSsWHygNL+5DcjhUlQE3DknA9Mt6+s0nacJD/lW fdcvhJFnNIa7bLes9kt42RVrPSmghFsQcDoN08ZVQPMAZi/yFTscsGbpbfE9RZ6y/lBt uBfA== X-Gm-Message-State: AOJu0YxXU9ZtATgbDFreyp0mNb4AqXspIc0TviZmcuHjDkImXo3QdrSb VBFoEOBWLOW/rr0ZhqDo7Qd5ig== X-Received: by 2002:a05:600c:2a4e:b0:3fe:fc0f:52e2 with SMTP id x14-20020a05600c2a4e00b003fefc0f52e2mr6934953wme.37.1696586022042; Fri, 06 Oct 2023 02:53:42 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:8f44:72b3:5bcb:6c6b]) by smtp.gmail.com with ESMTPSA id c5-20020a05600c0ac500b0040586360a36sm5579460wmr.17.2023.10.06.02.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 02:53:41 -0700 (PDT) References: <20231002141020.2403652-1-jbrunet@baylibre.com> <20231002141020.2403652-3-jbrunet@baylibre.com> <1j5y3ozvmk.fsf@starbuckisacylon.baylibre.com> <3e69ae4b-5d9e-42ee-a21e-151de8fbb996@linaro.org> <1j8r8hxutt.fsf@starbuckisacylon.baylibre.com> <036a9fef-02fd-4bfd-afb5-50724f15176c@linaro.org> <1j4jj4xik6.fsf@starbuckisacylon.baylibre.com> <78c8d21f-99b1-40ed-a76f-fdf3cbb42274@linaro.org> User-agent: mu4e 1.8.13; emacs 29.1 From: Jerome Brunet To: Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Kevin Hilman , Da Xue , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH 2/2] arm64: dts: amlogic: add libretech cottonwood support Date: Fri, 06 Oct 2023 11:52:58 +0200 In-reply-to: <78c8d21f-99b1-40ed-a76f-fdf3cbb42274@linaro.org> Message-ID: <1jzg0wvzyz.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 06 Oct 2023 02:54:00 -0700 (PDT) X-Spam-Level: ** On Fri 06 Oct 2023 at 10:32, Neil Armstrong wrote: > On 06/10/2023 10:21, Jerome Brunet wrote: >> On Thu 05 Oct 2023 at 12:04, Neil Armstrong >> wrote: >> >>> On 05/10/2023 11:42, Jerome Brunet wrote: >>>> On Tue 03 Oct 2023 at 09:35, Neil Armstrong >>>> wrote: >>>> >>>>> On 02/10/2023 20:57, Jerome Brunet wrote: >>>>>> On Mon 02 Oct 2023 at 18:45, Neil Armstrong >>>>>> wrote: >>>>>> >>>>> >>>>> >>>>> >>>>>>>> +&usb3_pcie_phy { >>>>>>>> + #address-cells = <1>; >>>>>>>> + #size-cells = <0>; >>>>>>>> + phy-supply = <&vcc_5v>; >>>>>>>> + >>>>>>>> + hub: hub@1 { >>>>>>>> + compatible = "usb5e3,626"; >>>>>>>> + reg = <1>; >>>>>>>> + reset-gpios = <&gpio GPIOC_7 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; >>>>>>>> + }; >>>>>>> >>>>>>> Not sure the PHY is the right place to put the USB HUB, >>>>>>> and it's probable the HUB is connected to both the USB2 and USB3 lines >>>>>> It is connected to the USB3.0 only >>>>>> >>>>>>> so you should have both USB IDs in DT like it'd done for the Odroid-C4: >>>>>>> >>>>>>> / { >>>>>>> ... >>>>>>> /* USB hub supports both USB 2.0 and USB 3.0 root hub */ >>>>>>> usb-hub { >>>>>>> dr_mode = "host"; >>>>>>> #address-cells = <1>; >>>>>>> #size-cells = <0>; >>>>>>> >>>>>>> /* 2.0 hub on port 1 */ >>>>>>> hub_2_0: hub@1 { >>>>>>> compatible = "usb2109,2817"; >>>>>>> reg = <1>; >>>>>>> peer-hub = <&hub_3_0>; >>>>>>> reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; >>>>>>> vdd-supply = <&vcc_5v>; >>>>>>> }; >>>>>>> >>>>>>> /* 3.1 hub on port 4 */ >>>>>>> hub_3_0: hub@2 { >>>>>>> compatible = "usb2109,817"; >>>>>>> reg = <2>; >>>>>>> peer-hub = <&hub_2_0>; >>>>>>> reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>; >>>>>>> vdd-supply = <&vcc_5v>; >>>>>>> }; >>>>>>> }; >>>>>>> ... >>>>>>> }; >>>>>>> >>>>>>> if it only has a single USB ID, then it should go under the dwc3 node. >>>>>> The usb controller is connected to the PHY and what's coming out of the >>>>>> PHY >>>>>> goes to the hub. It seems logical to hub the hub under it. >>>>>> Why bypass the PHY ? >>>>> >>>>> The USB bindings the USB devices nodes should be under the controller's node, >>>>> not the PHY, see: >>>>> >>>>> Documentation/devicetree/bindings/usb/usb-hcd.yaml >>>>> ... >>>>> patternProperties: >>>>> "^.*@[0-9a-f]{1,2}$": >>>>> description: The hard wired USB devices >>>>> type: object >>>>> $ref: /schemas/usb/usb-device.yaml >>>>> ... >>>>> and the example. >>>>> >>>>> Subnodes aren't allowed in the PHY node. >>>> Ok, that is what schema says. >>>> HW wise there is possible problem though. >>>> The phy node has the power supply to the bus. >>>> In that case it is a controllable one. >>>> If fixed USB devices go under the controller instead of the PHY, isn't >>>> it possible that the kernel may attempt to probe them before the bus is >>>> powered ? For this particular board, it would make the reset we are >>>> trying to apply useless. >>> >>> The usb core has a special handling for those usb hubs doing the power >>> up at the right time during the USB setup, including the PHY powering up. >>> So the power sequence should be fine. >>> >>> This has been done on Odroid-C2 and Odroid-N2 already. >> Tried it. Unfortunately something is off with the hub under the dwc3 node >> I often get this error (like once in 3 boots): >> [ 0.419301] usbcore: registered new interface driver usbfs >> [ 0.424434] usbcore: registered new interface driver hub >> [ 0.429696] usbcore: registered new device driver usb >> [ 0.921460] usbcore: registered new interface driver usb-storage >> [ 0.968157] usbcore: registered new interface driver usbhid >> [ 0.972114] usbhid: USB HID core driver >> [ 1.132529] dwc3-meson-g12a ffe09000.usb: USB2 ports: 2 >> [ 1.134897] dwc3-meson-g12a ffe09000.usb: USB3 ports: 1 >> [ 1.144451] dwc2 ff400000.usb: supply vusb_d not found, using dummy regulator >> [ 1.147231] dwc2 ff400000.usb: supply vusb_a not found, using dummy regulator >> [ 1.154464] dwc2 ff400000.usb: EPs: 7, dedicated fifos, 712 entries in SPRAM >> [ 1.219515] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM. >> [ 1.469260] usb 1-1: new high-speed USB device number 2 using xhci-hcd >> [ 1.745395] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd >> [ 9.794777] usbcore: registered new device driver onboard-usb-hub >> [ 10.255484] onboard-usb-hub 1-1: Failed to suspend device, error -32 >> [ 10.261699] onboard-usb-hub 1-1: can't set config #1, error -71 >> [ 10.287500] onboard-usb-hub 1-1: Failed to suspend device, error -32 >> [ 10.287844] onboard-usb-hub 1-1: USB disconnect, device number 2 >> [ 10.573277] usb 1-1: new high-speed USB device number 3 using xhci-hcd >> [ 10.921468] usb 2-1: reset SuperSpeed USB device number 2 using xhci-hcd >> [ 11.193453] usb 2-1: reset SuperSpeed USB device number 2 using xhci-hcd >> While it works reliably when the onboard-usb-hub is under the phy node. >> I added the 5v supply as vdd under the hub for good measure. > > The .reset_us you used from genesys_gl852g is probably too low, you may need to use a bigger one then. > Indeed. This seems to do the trick. I'll change this Thx > Neil > >> >>> >>> Neil >>> >>>> >>>>> >>>>> Neil >>>>> >>>>>> >>>>>>> >>>>>>>> +}; >>>>>>>> + >>>>>>>> +&usb { >>>>>>>> + status = "okay"; >>>>>>>> +}; >>>>> >>>>> >>>> >>