[U-Boot] [PATCH v2 3/3] ARM: atmel: add sama5d4ek board support

Bo Shen voice.shen at atmel.com
Wed Oct 29 04:38:02 CET 2014


Hi Andreas,

On 10/29/2014 11:24 AM, Andreas Bießmann wrote:

[snip]

>> >diff --git a/arch/arm/include/asm/arch-at91/clk.h b/arch/arm/include/asm/arch-at91/clk.h
>> >index 4076a78..21ce2db 100644
>> >--- a/arch/arm/include/asm/arch-at91/clk.h
>> >+++ b/arch/arm/include/asm/arch-at91/clk.h
>> >@@ -10,6 +10,7 @@
>> >  #define __ASM_ARM_ARCH_CLK_H__
>> >
>> >  #include <asm/arch/hardware.h>
>> >+#include <asm/arch/at91_pmc.h>
>> >  #include <asm/global_data.h>
>> >
>> >  static inline unsigned long get_cpu_clk_rate(void)
> Could we please rewrite this peace of code like this:
>
> #ifdef CPU_HAS_H32MXDIV
> static inline unsigned int get_h32mxdiv(void)
> {
> 	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
> 	return readl(pmc->mckr) & (AT91_PMC_MCKR_H32MXDIV));
> }
> #else
> static inline unsigned int get_h32mxdiv(void)
> {
> 	return 0;
> }
> #endif
>
> static inline unsigned long get_macb_pclk_rate(unsigned int dev_id)
> {
> 	if (get_h32mxdiv())
> 		return get_mck_clk_rate() / 2;
> 	else
> 		return get_mck_clk_rate();
> }
>
> and so forth
>
> The 'if'-path should be optimized away anyway and I feel the single
> get_clk_X functions will look nicer then.

OK, I will change the code like this. Thanks.

> Rest of this series looks good and should be applied soon.
>
> Best Regards
>
> Andreas Bießmann
>

Best Regards,
Bo Shen


More information about the U-Boot mailing list