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 A1ED8CD3420 for ; Tue, 3 Sep 2024 10:29:32 +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=YuTSwIl9q9JUC3i2aYAeogOmWxwYrrJ9+YxLTjByK44=; b=wdrGlOPTdnQUPV5erL/vS1d3Lo DAGOvP2A1xywAD9pWZda6+ZScSl4rU+qSz78di/xyCdHui0AAGU685VQDHP4AH1LrLILfP78uv7kJ rwpuVdebiXyk8pLovE16xAtviZ20UBvYOPCAaHVGkd8MDiw1zukRihHpTSJFHxXcxfV1/VQcRSTk8 THaa1BhKr2spI2Z1f6LSjoyrhorGSU9LQ2/DRqK0fKZxfdHHlHOHcvPneDJbIuoicYlqRxMOIuX7O ysiBuaBzpcY8lWG6EFKASAJNa1twgWteaoQOx309tSWi2v9NOLo5mu19bocxgVYwh1q/mhhZBAdkT n089BSBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQmm-0000000HLQQ-3xu7; Tue, 03 Sep 2024 10:29:21 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQj6-0000000HKkv-32jr for linux-arm-kernel@bombadil.infradead.org; Tue, 03 Sep 2024 10:25:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID: Sender:Reply-To:Content-ID:Content-Description; bh=YuTSwIl9q9JUC3i2aYAeogOmWxwYrrJ9+YxLTjByK44=; b=IrUeLIFF5PIiIKPW18aDiDQYLZ z1Rk/CaX7IQ6Rv/sbGjVzTHw1MJv5wYZQBU7xTs8s9Famt8JGHwqkc/8K6Ru4BFkCB7HJPcVAKMTZ B9bd9Q8nC4UHTzEV84qm6DOLOiAFPF6T4E6RB525dQmsyH3k2Vz5au9znaLKkTlx60FpbxQTW6xqx muj0WQ1EG5rbmiga3DPhZvzxCvdBztvmH1OjtNXFl4/4DhHCOKeO6XZYjkGjiVknb1tygyXIZX/pZ I+mkERGV/TffJUv4C8HxQ1VEuzyOv65xHYq7Th2l2xaN55sIU5iliIWCNkDu7i3FVH68/mpJ6j63I 7MX4daBw==; Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQj2-0000000CJKB-1YpI for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 10:25:31 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2f3e9fb6ee9so64710941fa.3 for ; Tue, 03 Sep 2024 03:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1725359124; x=1725963924; 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=YuTSwIl9q9JUC3i2aYAeogOmWxwYrrJ9+YxLTjByK44=; b=ZCnQS7m5Aw2/PisFOApC9un9w1nxBuIna+gPmSD2boYsGY+JOq1tuUXh3amkPbaaAk 6IvwZWxBp7ctVASrnEfTYOiJE1/G21ylbFTju0UWhSRhxq+j2Ph/1NC3ismVfuLG6viL 3sajHFIQ2Qb1YMzoGO3GCKXyHFyO64Jxz7guqIvvUEH1tpevmokISwPzfzbD8OGp7nrh J7IF2y4rfefIUMGnTRI5sa+cfbbxQicGBXleIMeIineuXN/G8AmBmU1FQdXB6HISHwhh xnTItGFcc2JwO/91yrHAOMyQCEZim/Qv+UOqxk+jWKBh6NFo4MTfcmtq85zAv45Ja/79 hE1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725359124; x=1725963924; 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=YuTSwIl9q9JUC3i2aYAeogOmWxwYrrJ9+YxLTjByK44=; b=AC+XUzacTruvowCikBt6dftpKJGaHHEiml1ecOCE1gGQfgNgBKrcljSvGMAbepKOlr iu/32kAV5MrLTg1SiydICsQ8OBQgPLGCHI2eQ6UMZ2ivntggVL2Ul8oUc8ZDiRqCWvK6 M4m32wKPt22ivAMV969jD1D+rS0qGOcgCakxGqmdzkJ21vdvtAMJcNvGxF1vgT/g+JL+ FHS3D8Wf9uAPkbmW/qJNeckl6d3ofTlG0HV9/rvUBcKZJ/D3OVTr/TzIqV0Q0ROumw4t 60SwbEoOsnaYqgOCHJso507k6MECyzGBieX8AV6qklDDGZNuE4oFvvtNEarxaV0Z1LM/ vHCg== X-Forwarded-Encrypted: i=1; AJvYcCUG6fLbFnACc3nbSZT9PG1/YidiByqTmP95F0ADtu1J69ZHskzkiZMtVxpbvppXq2N1SbK/rC0uIiZlNuIE/zrK@lists.infradead.org X-Gm-Message-State: AOJu0Yw+BJpX5C/FqoOk3bzfzWUbDNGiHEsbtG/abtDJNXJu997XAGeF DBBPEHEvSW9ExZsJdE9BEZ52/JgyF7xYRnqY8lgNBMXDlZtkFP8pL3WnfzkNjCo= X-Google-Smtp-Source: AGHT+IGZWwpSEYRg2qH2RqcYvPMCJJySduQWh9YhT7sAL+Iohwe2+AkwTjRfrV7dO20ThLaUEJ4qCQ== X-Received: by 2002:a2e:a7c1:0:b0:2f3:d82b:1955 with SMTP id 38308e7fff4ca-2f636a2be54mr41394781fa.25.1725359124125; Tue, 03 Sep 2024 03:25:24 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226cd4bcbsm6343668a12.74.2024.09.03.03.25.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2024 03:25:23 -0700 (PDT) Message-ID: Date: Tue, 3 Sep 2024 13:25:21 +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> <5556d176-cca7-492c-ba21-48256d5d6338@tuxon.dev> <590a4fb2-24b2-432b-92db-534c5a52ed0b@tuxon.dev> <35dc7414-f5bd-4ed4-bfa1-f723f4f0078c@tuxon.dev> From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_112528_766357_BC0977D3 X-CRM114-Status: GOOD ( 30.62 ) 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 03.09.2024 10:18, Biju Das wrote: > Hi Claudiu, > >> -----Original Message----- >> From: Biju Das >> Sent: Monday, September 2, 2024 11:48 AM >> Subject: RE: [PATCH 00/16] Add initial USB support for the Renesas RZ/G3S SoC >> >> Hi Claudiu, >> >>> -----Original Message----- >>> From: claudiu beznea >>> Sent: Monday, September 2, 2024 11:41 AM >>> Subject: Re: [PATCH 00/16] Add initial USB support for the Renesas >>> RZ/G3S SoC >>> >>> >>> >>> On 02.09.2024 12:18, Biju Das wrote: >>>>>>>> Do you have any plan to control this power transitions(ALL_ON to AWO and vice versa) in linux? >>>>>>> As you know, the RZ/G3S USB PM code is already prepared. This is >>>>>>> also configuring these signals when going to suspend/exiting from resume. >>>>>>> W/o configuring properly these signals the USB is not working after a suspend/resume cycle. >>>>>> One option is to handle SYSC USB PWRRDY signal in TF-A, if you >>>>>> plan to handle system transitions >>>>> there?? >>>>> >>>>> As I mentioned, the settings in these registers may be changed by >>>>> intermediary booting >>> applications. >>>>> Depending on that, Linux need to control it also on probe for USB >>>>> to work (it should be the same with PCIe, these signals seems similar from HW manual >> description). >>>> You mean system transition settings will be override by U-boot, so Linux needs to restore it >> back?? >>> >>> It was talking about booting... >> >> I am also referring to boot. Boot starts with TF-A and it has a system state. >> >>> >>> You proposed to handle SYSC signals from TF-A in a discussion about system power transitions: >>> >>> "One option is to handle SYSC USB PWRRDY signal in TF-A, if you plan to handle system transitions" >>> >>> (I was guessing the "system transition" statement there refers to >>> power states transitions, ALL_ON <-> >>> AWO/VBAT) >> >> That is correct. >> >>> >>> and I gave the booting process as a counter example: if we handle it >>> in TF-A it may not be enough as these signals might be changed by intermediary booting applications >> (e.g., U-Boot). >> >> Why should U-boot override, system state signals such as USB PWRREADY? Can you please give an example. >> >>> >>> To conclude, there are 3 scenarios I see where these signals need to >>> be >>> handled: >>> 1/ booting >>> 2/ suspend to RAM >>> 3/ driver unbind/bind >> >> --> It should be OK as linux is not handling USB PWRREADY signal. >> >>> >>> In case of booting: if we have TF-A to set signals there might be >>> intermediary booting applications (e.g. U-Boot) that set these signals >>> also. If it leaves it in improper state and Linux wants to use USB then the USB will not work (if >> Linux doesn't handle it). >> >> That is the problem of U-boot. U-boot should not override system state signals such as USB PWRREADY. >> >>> >>> In case of suspend to RAM: as TF-A is the only application in the >>> suspend to RAM chain, it should work handling it in TF-A. >> >> That is correct, TF-A should handle based on system state. >> >>> >>> In case of unbind/bind: currently we don't know if these signals >>> introduces any kind of power saving so asserting/de-asserting them in Linux may be useful from this >> perspective, if any. >> >> These are system signals, according to me should not be used in unbind/bind. >> >> I may be wrong. > > Just to add the below are the 4 system states (power mode) for this LSI. > > If I understand correctly, we need to configure USB PWRRDY signal > only when there is a transition from ALL_ON to AWO mode and vice versa. > as you see on AWO mode only CM-33 is active. > > • ALL_OFF mode: All CPUs and peripheral modules can not be worked. > • ALL_ON mode: All CPUs and peripheral modules can be worked. > • AWO mode: Cortex-M33 and peripheral modules in PD_VCC and PD_VBATT domain can be worked. > • VBATT mode: Only RTC, tamper detection and backup registers can be worked. > > System manager which is controlling both CA-55 and CM-33, will set USB PWRRDY signal > based on system state. > > Since we don't have system manager for controlling both CA-55 and CM-33 > Probably from CA-55 perspective, TF-A should be sufficient. > > During boot clr USB PWR READY signal in TF-A. > STR case, suspend set USB PWR READY signal in TF-A. > STR case, resume clr USB PWR READY signal in TF-A. As I said previously, it can be done in different ways. My point was to let Linux set what it needs for all it's devices to work. I think the way to go forward is a maintainer decision. Thank you, Claudiu Beznea > > I am not expert in this area. I may be wrong. > > Maybe we need to get an opinion from Power experts in Linux. > > Cheers, > Biju