-
Notifications
You must be signed in to change notification settings - Fork 8k
stm32 clock mux for CK48 definition #96353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d4d97b6
to
6c38115
Compare
&pll { | ||
div-m = <4>; | ||
mul-n = <192>; | ||
div-p = <4>; | ||
div-q = <8>; | ||
clocks = <&clk_hse>; | ||
status = "okay"; | ||
}; | ||
|
||
&rcc { | ||
clocks = <&pll>; | ||
clock-frequency = <DT_FREQ_M(96)>; | ||
ahb-prescaler = <1>; | ||
apb1-prescaler = <2>; | ||
apb2-prescaler = <1>; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional change?
Would it be worth to add an alternate test with its own DTS overlay file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, when the sdmmc is clocked by the PLL_q, a freq = 48MHz is required.
This overlay file "f4_sdmmc48_pll.overlay"is for running this testcase by un-commenting.
The alternate test is "drivers.clock.stm32_clock_configuration.common_device.f4.sdmmc_48".
Two possible config are in this overlay (selection is by commenting/un-commenting). Is there any reason today to change with 2 different testcases/overlay files, if it was your question ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fine. Already having a test for SDMMC over CK48 seems enough.
I just found strange this added inline comments in this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Maybe the commit message could be more verbose on why the change, e.g.:
Define the STM32_CK48_ENABLED especially for the stm32F4 series
+when ck48 node is enabled to leverage its already implemented support.
&pll { | ||
div-m = <4>; | ||
mul-n = <192>; | ||
div-p = <4>; | ||
div-q = <8>; | ||
clocks = <&clk_hse>; | ||
status = "okay"; | ||
}; | ||
|
||
&rcc { | ||
clocks = <&pll>; | ||
clock-frequency = <DT_FREQ_M(96)>; | ||
ahb-prescaler = <1>; | ||
apb1-prescaler = <2>; | ||
apb2-prescaler = <1>; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fine. Already having a test for SDMMC over CK48 seems enough.
I just found strange this added inline comments in this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nack until #94934 (comment) is fixed
efda26e
Add a commit to enable the clk48 |
Define the STM32_CK48_ENABLED especially for the stm32F4 series when ck48 node is enabled to leverage its already implemented support. Signed-off-by: Francois Ramu <[email protected]>
comment updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment below is not blocking.
} | ||
break; | ||
#endif /* STM32_SRC_MSI */ | ||
#if defined(STM32_CK48_ENABLED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good to me, but for consistency one may prefer here:
#if defined(STM32_CK48_ENABLED) | |
#if defined(STM32_SRC_CK48) |
unless what it seems this could be simplified to:
#if defined(STM32_CK48_ENABLED)
case STM32_SRC_CK48:
break;
#endif
That said, I think it's rather the other case that could simplified:
int enabled_clock(uint32_t src_clk)
{
int r = 0;
switch (src_clk) {
/* Supported source clocks */
case STM32_SRC_SYSCLK:
#if defined(STM32_SRC_PCLK)
case STM32_SRC_PCLK:
#endif
#if IS_ENABLED(STM32_HSE_ENABLED)
case STM32_SRC_HSE:
#endif
#if defined(STM32_SRC_EXT_HSE)
/* EXT_HSE is the raw OSC_IN signal, so it is always available
* regardless of the clocks configuration.
*/
case STM32_SRC_EXT_HSE:
#endif
#if IS_ENABLED(STM32_HSI_ENABLED)
case STM32_SRC_HSI:
#endif
#if IS_ENABLED(STM32_LSE_ENABLED)
case STM32_SRC_LSE:
#endif
#if IS_ENABLED(STM32_LSI_ENABLED)
case STM32_SRC_LSI:
#endif
#if IS_ENABLED(STM32_HSI14_ENABLED)
case STM32_SRC_HSI14:
#endif
#if IS_ENABLED(STM32_HSI48_ENABLED)
case STM32_SRC_HSI48:
#endif
(...)
#if defined(STM32_SRC_TIMPLLCLK)
case STM32_SRC_TIMPLLCLK:
#endif
return 0;
/* All not listed sources above are implicitly not supported */
default:
return -ENOTSUP;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to #if defined(STM32_SRC_CK48)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other suggestions are probably out of this PR/issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other suggestions are probably out of this PR/issue
Indeed.
This commit enables the clk48 clock mux if STM32_CK48_ENABLED is set by the device tree. Signed-off-by: Francois Ramu <[email protected]>
|
@FRASTM, I think you need to rebase to get the CI tests to all succeed. |
Define the STM32_CK48_ENABLED especially for the stm32F4 series
FIxes #94934