-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/stm32: Add clock config for mp1 to kconfig #17521
Conversation
This was done in something of a hurry but seems to work locally. Maybe @aabadie can give it a quick look to make sure I am on track before I make it nice and clean. I would also like to know if I should update the ranges for some of these, this MP1 has huge available ranges it seems. |
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.
boards/stm32mp157c-dk2/Kconfig
Outdated
@@ -15,3 +15,10 @@ config BOARD_STM32MP157C_DK2 | |||
# Put defined MCU peripherals here (in alphabetical order) | |||
select HAS_PERIPH_TIMER | |||
select HAS_PERIPH_UART | |||
select HAS_PERIPH_GPIO |
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.
Shouldn't this be already selected at CPU level ?
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.
Yup, I think I was just trying to copy what was in the makefile FEATURES_PROVIDED
. Fixed.
#ifdef SHOW_MACRO_VALUES_WITH_PRAGMA_MESSAGE | ||
#pragma message "The values after cfg_clock_default.h applied" | ||
#pragma message "CONFIG_CLOCK_PLL_M: " XSTR(CONFIG_CLOCK_PLL_M) | ||
#pragma message "CONFIG_BOARD_HAS_HSE: " XSTR(CLOCK_HSE) | ||
#pragma message "CONFIG_CLOCK_PLL_N: " XSTR(CONFIG_CLOCK_PLL_N) | ||
#pragma message "CONFIG_CLOCK_PLL_P: " XSTR(CONFIG_CLOCK_PLL_P) | ||
#pragma message "CONFIG_CLOCK_PLL_Q: " XSTR(CONFIG_CLOCK_PLL_Q) | ||
#pragma message "CONFIG_CLOCK_PLL_R: " XSTR(CONFIG_CLOCK_PLL_R) | ||
#pragma message "CONFIG_CLOCK_MCU_DIV: " XSTR(CONFIG_CLOCK_MCU_DIV) | ||
#pragma message "CONFIG_CLOCK_APB1_DIV: " XSTR(CONFIG_CLOCK_APB1_DIV) | ||
#pragma message "CONFIG_CLOCK_APB2_DIV: " XSTR(CONFIG_CLOCK_APB2_DIV) | ||
#pragma message "CONFIG_CLOCK_APB3_DIV: " XSTR(CONFIG_CLOCK_APB3_DIV) | ||
#pragma message "CLOCK_CORECLOCK: " XSTR(CLOCK_CORECLOCK) | ||
#endif /* SHOW_MACRO_VALUES_WITH_PRAGMA_MESSAGE */ | ||
|
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.
This appears twice in this file, is this expected ?
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.
This was more meant for a before and after picture, this way we could know if a value was applied by something else such as kconfig or another override vs applied by this file. This one is actually pretty easy to view but others can be a bit tricky (at least for me).
I also don't know if we want this in, it is a bit ugly I find. Maybe there is a more clever way of doing this though in order to resolve macros.
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.
Better remove it for now. In my previous clock rework PRs, I printed the values at runtime, which is less handy but ensures that the generated firmware is valid (correct core clock, etc).
be81bb9
to
68e94ea
Compare
rebased and cleanup |
Hi all, I think it is the most reasonable choice @fjmolinas. I still have the hardware, I will do it with pleasure, but most certainly in coming weeks rather than in coming days. |
This also doesn't effect the make based building so I guess it is low risk. If we get it in then maybe @gdoffe tests in a few weeks, if things are ok great, if not we can fix it later. Lets just try not to forget (something that happens quite often with me). |
Lets go with this then! |
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.
ACK!
@aabadie are you ok with merging? (didn't hit auto-merge yet) |
Yes (auto-merge enabled :) ) |
Contribution description
This adds the clock config and makes kconfig work for the stm32mp1 based boards (currently only stm32mp157c-dk2).
U also added some way to print the values of the macros... Maybe we would leave it in, especially for some of the more complex things.
Testing procedure
murdock passes and kconfig binaries match.
Issues/PRs references
#14975