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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFF68CA0ED3 for ; Mon, 2 Sep 2024 08:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xuSIAX3TkFJwp4EKqR8txlbKQ8ME5wdxgrNK5MzVZqo=; b=Dl2bQhBAXEWLoCZbnuMUXc8mqE gVgd0YputqVeE5bkE67Cz3u2uCizIALHo6GigDO4YWOVUTcNLxxTG7D/RLaShHPzmxyRoC7jwq7Lz CTcbwOcoE8LnfQpoLVXT4jaXUs5lupqOfEBPHVuj9Ou51FkpfV1tmv7NkyFnNYrVDvdd7QEvGKoBZ yiULZ7FNTynDx/H3RYarAtoaaohPjleuO8a9q09rzAnK2JXg+Ti8xY1F8hgsF3GkTjW+2/YgjUQJr r1P3Gjzj7uvFY3clkKY1XosZacy2ZBswTHnLtM8SkTMCYYPCOWLCj7ynXhiX8ryhKceqmcxtEMhc2 YXRE1XBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl2Rq-0000000DVud-3mzn; Mon, 02 Sep 2024 08:30:06 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl2QI-0000000DVQ8-21hl for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 08:28:32 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5becc379f3fso3273920a12.3 for ; Mon, 02 Sep 2024 01:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1725265709; x=1725870509; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=xuSIAX3TkFJwp4EKqR8txlbKQ8ME5wdxgrNK5MzVZqo=; b=ORRu8teo3tsEOI87XHhSBf6hZEOtvyckYnJnmpxbxlMkfHoNEGy6O2Nj31822IEJs0 mrFOY6QCGwE6QQ8tmJEtkVdBOj6vwBnx1tJWeHzw9zc8UM2YMxbn9xaV463/SkISH9gs TUW73E8CMrw5Bes4pqQtaxsBdbjOPoQRWhf2ZUk0hyiepWr3FErv8ay5WF8NA+mnATDD GJd1NdtNE7qK4k5U/aShE7lSDPOFnoC4OX1bsO34MDHY15ics3Pdr0qPyVulepTszpcC 5d7fROdLSZ+VKIFQimiV1eF3u3KaeID2oe/Eene2m6F9E+BauSuXLxOvu5hUN4ebjYEp ojTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265709; x=1725870509; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xuSIAX3TkFJwp4EKqR8txlbKQ8ME5wdxgrNK5MzVZqo=; b=dzECc9Uuihf3fSY3IgXpjIBNcVtjurrPXM51frtZ73lUF1hFCKLyNoa3zZ9poVzSAd R22dg6gM0E3jlB+5AUySM6kWGn53YbcrkjR/N9iNMzBsplD3nR/UeQphWyEsfcqFkidr PVrYm4g5zBV1hPA13A6U2hkmf9IA1BwhaqzyKNv9x6EgUPcZrJ5+2WgX4jctOZalajDx gEy+G171jbsCxhjnYTT883N6FDG9FwHD+Ytfm9aYlWNfNAJmYnIb8B5RDW9Gp+jayXRS Np/8iXbMuEaDaMF7F2DS/j3k1hH14+njPSCKsHeasn3r+ds834QB95gnSjebV5KL1/Wa sCwA== X-Forwarded-Encrypted: i=1; AJvYcCVUA5hU2h8JFwAaiB27tbFypwzjANledLETSonNskp/KC0FQcVgnZvPeqKF3msNmefAD563qxyC6q9M/1Ql4Qsh@lists.infradead.org X-Gm-Message-State: AOJu0Yx7LbkvxCB8+oPPCExsrz/P/TI7VOurzN2iJ9Wb/uP3x9zrJQ2y 3ojs/2/uOcaVcxipwrwPTsPmG2N5M52lkom7glUT6Gs3koUOA1SLqejsBM9x8bU= X-Google-Smtp-Source: AGHT+IFnSS3AyZyXwK3tX+2059zJpEoBIuXq5dRlOW8dSAq2eAxT17MymZumSDwZSnEQaWTkK5CbQg== X-Received: by 2002:a17:907:944c:b0:a7a:97ca:3058 with SMTP id a640c23a62f3a-a897f7910e8mr1024209166b.5.1725265708448; Mon, 02 Sep 2024 01:28:28 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891d6f87sm522330766b.158.2024.09.02.01.28.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Sep 2024 01:28:28 -0700 (PDT) Message-ID: <90df82c1-bb09-4c91-ba7f-af328066bd43@tuxon.dev> Date: Mon, 2 Sep 2024 11:28:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/16] Add initial USB support for the Renesas RZ/G3S SoC Content-Language: en-US To: Biju Das , Ulf Hansson Cc: "vkoul@kernel.org" , "kishon@kernel.org" , "robh@kernel.org" , "krzk+dt@kernel.org" , "conor+dt@kernel.org" , "p.zabel@pengutronix.de" , "geert+renesas@glider.be" , "magnus.damm@gmail.com" , "gregkh@linuxfoundation.org" , "mturquette@baylibre.com" , "sboyd@kernel.org" , Yoshihiro Shimoda , "linux-phy@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" , "linux-pm@vger.kernel.org" , Claudiu Beznea References: <20240822152801.602318-1-claudiu.beznea.uj@bp.renesas.com> <99bef301-9f6c-4797-b47e-c83e56dfbda9@tuxon.dev> From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_012830_545313_232A2BC3 X-CRM114-Status: GOOD ( 30.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 31.08.2024 08:13, Biju Das wrote: > Hi Claudiu, > >> -----Original Message----- >> From: claudiu beznea >> Sent: Friday, August 30, 2024 9:23 AM >> Subject: Re: [PATCH 00/16] Add initial USB support for the Renesas RZ/G3S SoC >> >> Hi, Ulf, >> >> On 29.08.2024 18:26, Ulf Hansson wrote: >>> On Thu, 22 Aug 2024 at 17:28, Claudiu wrote: >>>> >>>> From: Claudiu Beznea >>>> >>>> Hi, >>>> >>>> Series adds initial USB support for the Renesas RZ/G3S SoC. >>>> >>>> Series is split as follows: >>>> >>>> - patch 01/16 - add clock reset and power domain support for USB >>>> - patch 02-04/16 - add reset control support for a USB signal >>>> that need to be controlled before/after >>>> the power to USB area is turned on/off. >>>> >>>> Philipp, Ulf, Geert, all, >>>> >>>> I detailed my approach for this in patch >>>> 04/16, please have a look and let me know >>>> your input. >>> >>> I have looked briefly. Your suggested approach may work, but I have a >>> few thoughts, see below. >>> >>> If I understand correctly, it is the consumer driver for the device >>> that is attached to the USB power domain that becomes responsible for >>> asserting/de-asserting this new signal. Right? >> >> Right! >> >>> >>> In this regard, please note that the consumer driver doesn't really >>> know when the power domain really gets powered-on/off. Calling >>> pm_runtime_get|put*() is dealing with the reference counting. For >>> example, a call to pm_runtime_get*() just makes sure that the PM >>> domain gets-or-remains powered-on. Could this be a problem from the >>> reset-signal point of view? >> >> It should be safe. From the HW manual I understand the hardware block is something like the following: >> >> >> USB area >> +-------------------------+ >> | | >> | PHY --->USB controller | >> SYSC --> | ^ | >> | | | >> | PHY reset | >> +-------------------------+ > > How USB PWRRDY signal is connected to USB? HW manual mentions this in the chapter describing the SYS_USB_PWRRDY register: Controls PWRRDY terminal of USB 0: PWRRDY 1: PWRRDY down When turning off the *USB region* power, set this bit to 1. When turning on the *USB region* power, set this bit to 0 By USB region I get the that it is related to the SoC area where resides all the USB IPs. I cannot tell more than what is in the hardware manual. > > USB block consists of PHY control, PHY, USB HOST and USB OTG Controller IPs. > > Is it connected to top level block or connected to each IP's for turning off the USB region power? I cannot tell more than it is in the hardware manual. > > ? Or Just PHY (HW manual mentions for AWO, the USB PWRRDY signal->USB PHY PWRRDY signal control)? > > If the USBPWRRDY signal is connected across modules with this reset signal approach > then you may need to update bindings [1] with that reset signal > > [1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20240822152801.602318-12-claudiu.beznea.uj@bp.renesas.com/ If that is true, then this signal may need to be routed to the PHY for better hardware description. > > > Cheers, > Biju > >> >> Where: >> - SYSC is the system controller that controls the new signal for which >> I'm requesting opinions in this series >> - PHY reset: is the block controlling the PHYs >> - PHY: is the block controlling the USB PHYs >> - USB controller: is the USB controller >> >> Currently, I passed the SYSC signal handling to the PHY reset driver; w/o PHY reset the rest of the >> USB logic cannot work (neither PHY block nor USB controller). >> >> Currently, the PHY reset driver call pm_runtime_resume_and_get() in probe and pm_runtime_put() in >> remove. The struct reset_control_ops::{assert, deassert} only set specific bits in registers (no >> pm_runtime* calls). >> >> The PHY driver is taking its PHY reset in probe and release it in remove(). >> With this approach the newly introduced SYSC signal will be de-asserted/asserted only in the PHY reset >> probe/remove (either if it is handled though PM domain or reset control signal). >> >> If the SYSC signal would be passed to all the blocks in the USB area (and it would be handled though >> PM domains) it should be no problem either, AFAICT, because of reference counting the >> pm_runtime_get|put*() is taking care of. As the PHY reset is the root node the in the devices node >> tree for USB the reference counting should work, too (I may miss something though, please correct me >> if I'm wrong). >> >> If the SYSC signal would be handled though a reset control driver (as proposed in this series) and we >> want to pass this reference to all the blocks in the USB area then we can request the reset signal as >> shared and, AFAIK, this is also reference counted. The devices node tree should help with the order, >> too, if I'm not wrong. >> >> Thank you for looking at this, >> Claudiu Beznea >> >>> >>> [...] >>> >>> Kind regards >>> Uffe