[U-Boot-Users] PATCH: mpc85xx set lcb clock (CONFIG_CCB_CLCKDIV)

Hi,
Here is a patch to add support for manually setting the system (CCB) clock divider for MPC85xx boards.
This patch introduces a new macro CONFIG_CCB_CLCKDIV, whose value should be set to the desired clock divider. If the macro is not defined, this patch has no effect.
As an example, the new option can be used in the board config file like this:
#define CONFIG_CCB_CLCKDIV 4
The patch is against git commit: a524e112b424c6843800ea2f19d3a8cf01d0aa94
John Ogness
Signed-off-by: John Ogness john.ogness@linutronix.de

Hi,
After reading over MPC85xx specs, I realized that the patch I sent should use a better macro name. The new function was also a bit confusing because it had the CLKDIV bits as its argument, instead of the actual ratio.
Here is a new version of the patch that corrects these issues. Both macro and function should now be clearer.
The patch is against git commit: c956717ab25c962ef49d49064dfc73f4edcba1fb
John Ogness
Signed-off-by: John Ogness john.ogness@linutronix.de

I've changed the patch so that it is less intrusive. It now simply adds the new function to the "init_sequence" if defined.
Signed-off-by: John Ogness john.ogness@linutronix.de

John Ogness wrote:
I've changed the patch so that it is less intrusive. It now simply adds the new function to the "init_sequence" if defined.
Signed-off-by: John Ogness john.ogness@linutronix.de
Could you please send your patches inline next time to simplify reviewing? Thanks.
I have a general remark here. Currently, various 85xx boards setup the local bus in the board specific code called from checkboard(). Your set_lbc_clock_ratio() would be called earlier and is therefore unusable for these board. Nevertheless, the setting of the clock rate is just one thing to be done to setup the local bus properly but there are more including bug fixes. I would appreciate a generic function for that purpose to get rid of duplicated code.
Wolfgang.
participants (2)
-
John Ogness
-
Wolfgang Grandegger