public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "김재원/JAEWON KIM" <jaewon02.kim@samsung.com>
To: "'Tudor Ambarus'" <tudor.ambarus@linaro.org>,
	"'Sylwester Nawrocki'" <s.nawrocki@samsung.com>,
	"'Chanwoo Choi'" <cw00.choi@samsung.com>,
	"'Alim Akhtar'" <alim.akhtar@samsung.com>
Cc: "'Sam Protsenko'" <semen.protsenko@linaro.org>,
	"'Krzysztof Kozlowski'" <krzysztof.kozlowski@linaro.org>,
	linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	'linux-arm-kernel' <linux-arm-kernel@lists.infradead.org>,
	"'Peter Griffin'" <peter.griffin@linaro.org>,
	"'André Draszik'" <andre.draszik@linaro.org>,
	"'William McVicker'" <willmcvicker@google.com>,
	kernel-team@android.com
Subject: RE: samsung: clk: re-parent MUX to OSCCLK at run-time
Date: Thu, 7 Mar 2024 17:21:47 +0900	[thread overview]
Message-ID: <000001da7068$7f60f020$7e22d060$@samsung.com> (raw)
In-Reply-To: <d508dfc1-bc28-4470-92aa-cf71915966f4@linaro.org>

Hi Tudor


On 3/6/24 12:20, Tudor Ambarus wrote:
> 
> Hi,
> 
> Trying to get some feedback from the samsung experts. Please consider the
> following:
> 
>                          ---------------------------------------------
>                         |                                CMU_PERIC0   |
>                         |                                             |
>                         |  MUX_USI                                    |
>                         |                                             |
>                         |  |\                                         |
>               OSCCLK ---|->| \                                        |
>                         |  |  \                                       |
>                         |  | M |                                      |
>                         |  | U |--> DIV_CLK_PERIC0_USI*_ --> GATE_USI |
>                         |  | X |        (1 ~ 16)                      |
>                         |  |  /                                       |
> DIV_CLKCMU_PERIC0_IP ---|->| /                                        |
>     (1 ~ 16)          | |  |/                                         |
>                       | |                                             |
>                       | |                                             |
>                       | |  MUX_I3C                                    |
>                       | |                                             |
>                       | |  |\                                         |
>                       --|->| \                                        |
>                         |  |  \                                       |
>                         |  | M |                                      |
>                         |  | U |--> DIV_CLK_PERIC0_I3C --> GATE_I3C   |
>                         |  | X |                                      |
>                         |  |  /                                       |
>               OSCCLK ---|->| /                                        |
>                         |  |/                                         |
>                         |                                             |
>                          ---------------------------------------------
> 
> Is it fine to re-parent the MUX_USI from above to OSCCLK at run-time,
> during normal operation mode? Experimentally I determined that it's fine,
> but the datasheet that I'm reading mentions OSCCLK just in the low-power
> mode context:
> i/ CMU ... "Communicates with Power Management Unit (PMU) to stop clocks
> or switch OSC clock before entering a Low-Power mode to reduce power
> consumption by minimizing clock toggling".
> ii/ "All CMUs have MUXs to change the OSCCLK during power-down mode".
> 
> Re-parenting the MUX to OSCCLK allows lower clock rates for the USI blocks
> than the DIV_CLK_PERIC0_USI can offer. For a USI clock rate below
> 6.25 MHz I have to either reparent MUX_USI to OSCCLK, or to propagate the
> clock rate to the common divider DIV_CLKCMU_PERIC0_IP. I find the
> propagation to the common DIV less desirable as a low USI clock rate
> affects I3C by lowering its clock rate too. Worse, if the common bus
> divider is not protected (using CLK_SET_RATE_GATE), USI can lower the I3C
> clock rate without I3C noticing.
> 
> Either re-parenting the MUX_USI to OSCCLK, or propagating the clock rate
> to DIV_CLKCMU_PERIC0_IP allows the same clock ranges. The first with the
> benefit of not affecting the clock rate of I3C for USI clock rates below
> 6.25 MHz. Is it fine to re-parent MUX_USI to OSCCLK at run-time?
> 
> If no feedback is received I lean towards propagating the USI clock rate
> to the common divider, but by protecting it with CLK_SET_RATE_GATE.
> 
> Feel free to add in To: or Cc: whoever might be interested. Thanks, ta


"DIV_CLK_PERIC0_USI" re-parent to OSCCLK is already used samsung downstream driver.
Looking at the samsung downstream SPI driver, if the SPI request clock is lower than the clock that can be supported by the CMU, it re-parents to OSCCLK.

There is no problem with clock switching before USI data transfer.

Thanks
Jaewon Kim


  parent reply	other threads:[~2024-03-07  8:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240306032013epcas5p4932674432fbb49f586ed9d00f006a9e8@epcas5p4.samsung.com>
2024-03-06  3:20 ` samsung: clk: re-parent MUX to OSCCLK at run-time Tudor Ambarus
2024-03-06  4:49   ` Alim Akhtar
2024-03-06  6:09     ` Tudor Ambarus
2024-03-07  2:05       ` Alim Akhtar
2024-03-07  8:21   ` 김재원/JAEWON KIM [this message]
2024-03-22  9:17     ` Tudor Ambarus

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='000001da7068$7f60f020$7e22d060$@samsung.com' \
    --to=jaewon02.kim@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andre.draszik@linaro.org \
    --cc=cw00.choi@samsung.com \
    --cc=kernel-team@android.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=s.nawrocki@samsung.com \
    --cc=semen.protsenko@linaro.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=willmcvicker@google.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