From: Sean Anderson <seanga2@gmail.com>
To: Patrick DELAUNAY <patrick.delaunay@foss.st.com>,
Amelie Delaunay <amelie.delaunay@foss.st.com>,
u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>,
Patrice Chotard <patrice.chotard@foss.st.com>,
uboot-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH 1/3] phy: stm32-usbphyc: add counter of PLL consumer
Date: Sat, 11 Jun 2022 11:43:47 -0400 [thread overview]
Message-ID: <217c9525-9d3c-a6ed-0d3f-0830a534ae84@gmail.com> (raw)
In-Reply-To: <4a7519b0-9bb7-f92e-3e73-7be0ba9959d7@foss.st.com>
On 5/17/22 3:42 AM, Patrick DELAUNAY wrote:
> Hi Sean,
>
> On 5/11/22 18:48, Sean Anderson wrote:
>> On 5/10/22 5:51 AM, Amelie Delaunay wrote:
>>> Hi Patrick,
>>> Hi Sean,
>>>
>>> On 5/9/22 16:37, Patrick DELAUNAY wrote:
>>>> Hi Sean,
>>>>
>>>> On 5/8/22 20:21, Sean Anderson wrote:
>>>>> On 4/26/22 8:37 AM, Patrick Delaunay wrote:
>>>>>> Add the counter of the PLL user n_pll_cons managed by the 2 functions
>>>>>> stm32_usbphyc_pll_enable / stm32_usbphyc_pll_disable.
>>>>>>
>>>>>> This counter allow to remove the function stm32_usbphyc_is_init
>>>>>> and it is a preliminary step for ck_usbo_48m introduction.
>>>>>
>>>>> Is it necessary to disable this clock before booting to Linux? If it isn't,
>>>>> then perhaps it is simpler to just not disable the clock.
>>>>>
>>>>> --Sean
>>>>
>>>>
>>>> No, it is not necessary, we only need to enable the clock for the first user.
>>>>
>>>> I copy the clock behavior from kernel,
>>>>
>>>> but I agree that can be simpler.
>>>>
>>>>
>>>> Amelie any notice about this point ?
>>>>
>>>> Do you prefer that I kept the behavior - same as kernel driver - or I simplify the U-Boot driver ?
>>>
>>> In case the PLL has not been disabled before Kernel boot, usbphyc Kernel driver will wait for the PLL pwerdown.
>>> USB could also not being used in Kernel, so PLL would remain enabled, and would waste power.
>>> I am rather in favor of disabling the PLL.
>>
>> It should be disabled if clk_ignore_unused is not in the kernel parameters,
>> as long as Linux is also aware of the clock.
>>
>> Generally, I would like to avoid refcounting if possible. Many U-Boot
>> drivers do not disable their clocks (because they don't do any cleanup),
>> so you can end up with the clock staying on anyway.
>>
>> --Sean
>>
>>> Regards,
>>> Amelie
>>>
>>>>
>>>>
>>>> Patrick
>>>>
>>>>
>>>>>
>
> In general, I'm also in favor of not disabling the clock in U-Boot.
>
> But this PLL with vdda1v1 and vdda1v8 dependency is requested for
>
> - USBPHYC himself or
>
> - source clock of RCC,
>
>
> And we have have see many issue for this PLL initialization sequence / dependencies.
>
>
> So for clock support, I only reused the existing/working function called by the PHY ops init & exit =
>
> stm32_usbphyc_phy_init & stm32_usbphyc_phy_exit
>
> => the PLL and the associated VDD are already deactivated on USBPHYC exit.
>
>
> And to be coherent I for the same for the clock to avoid conflict between these 2 users
>
> (USBPHYC or RCC) as it is done also in Linux kernel.
>
>
> Avoid to deactivate PLL on clock disable is a major objection or just a advice?
Just advice. If all of the clock's users call disable, then it is fine.
--Sean
next prev parent reply other threads:[~2022-06-11 15:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 12:37 [PATCH 0/3] stm32mp: handle ck_usbo_48m clock provided by USBPHYC Patrick Delaunay
2022-04-26 12:37 ` [PATCH 1/3] phy: stm32-usbphyc: add counter of PLL consumer Patrick Delaunay
2022-05-06 14:18 ` Patrice CHOTARD
2022-05-10 7:45 ` [Uboot-stm32] " Patrice CHOTARD
2022-05-10 11:50 ` Patrice CHOTARD
2022-05-08 18:21 ` Sean Anderson
2022-05-09 14:37 ` Patrick DELAUNAY
2022-05-10 9:51 ` Amelie Delaunay
2022-05-11 16:48 ` Sean Anderson
2022-05-17 7:42 ` Patrick DELAUNAY
2022-06-11 15:43 ` Sean Anderson [this message]
2022-09-07 13:31 ` Patrick DELAUNAY
2022-04-26 12:37 ` [PATCH 2/3] phy: stm32-usbphyc: usbphyc is a clock provider of ck_usbo_48m clock Patrick Delaunay
2022-05-06 14:24 ` Patrice CHOTARD
2022-05-10 7:45 ` [Uboot-stm32] " Patrice CHOTARD
2022-05-08 18:23 ` Sean Anderson
2022-05-09 15:44 ` Patrick DELAUNAY
2022-09-07 13:31 ` Patrick DELAUNAY
2022-04-26 12:37 ` [PATCH 3/3] clk: stm32mp: handle ck_usbo_48m clock provided by USBPHYC Patrick Delaunay
2022-05-06 14:26 ` Patrice CHOTARD
2022-05-10 7:45 ` [Uboot-stm32] " Patrice CHOTARD
2022-09-07 13:32 ` Patrick DELAUNAY
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=217c9525-9d3c-a6ed-0d3f-0830a534ae84@gmail.com \
--to=seanga2@gmail.com \
--cc=amelie.delaunay@foss.st.com \
--cc=joe.hershberger@ni.com \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-stm32@st-md-mailman.stormreply.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox