-
Notifications
You must be signed in to change notification settings - Fork 8.2k
alternate clock configuration for the stm32 ospi driver #46703
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
Conversation
erwango
left a comment
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.
Otherwise looks good
1b4d3db to
5ece992
Compare
|
refine with the new STM32_DT_CLOCKS macro from #46842 |
erwango
left a comment
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, but requires #46842 to be merged first
The clock of the octospi peripheral is directly defined by the DTS and configured by the clock_control_on function. No specific stm32cube function is required then. The clock control is taking this clock source to calculate the clock rate. Signed-off-by: Francois Ramu <[email protected]>
|
rebase after merge of #46842 |
erwango
left a comment
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.
One request on the setting location, otherwise LGTM.
The definition of the clock source for the 2 octospi instances is given by the DTS node. The default value selects the sysclk (not pclk) for the alternate clock control. Signed-off-by: Francois Ramu <[email protected]>
The definition of the octospi clock source is given by the DTS node. The default value selects the sysclk (not pclk) for the alternate clock control. Signed-off-by: Francois Ramu <[email protected]>
|
By default, the alternate clock source for the octospi peripheral is not the PCLK but the SYSCLOCK, so it has to be defined in the DTS (of the soc). |
For stm32 MCUs, this PR is configuring the clock source for the ospi peripheral based on the definition of the DTS.
The clock source of the Octospi is set by a bit field in one independent clock configuration register of the RCC.
In the clock control driver, the alternate clock source of the peripheral is defined by the macro OCTOSPI_SEL() or OSPI_SEL() depending on the serie. This is valid for any stm32 device with octospi peripheral.
The DTS of the board gives the clock source to be applied like:
Signed-off-by: Francois Ramu [email protected]