[U-Boot] [PATCH] mpc85xx: add function prototypes for sys and ddr clocks to speed.c

Timur Tabi timur at freescale.com
Fri May 21 20:18:13 CEST 2010


Scott Wood wrote:
> On 05/21/2010 01:07 PM, Timur Tabi wrote:
>> On most Freescale 85xx boards, the CONFIG_SYS_CLK_FREQ and CONFIG_DDR_CLK_FREQ
>> macros are defined like this:
> 
> Like what?

Doh.  Git commit delete those lines because they began with a "#".

This was supposed to be there:

#define CONFIG_SYS_CLK_FREQ	calculate_board_sys_clk()
#define CONFIG_DDR_CLK_FREQ	calculate_board_ddr_clk()

>> This means that in order to use these macros, the callers must have prototypes
>> for the corresponding functions.  On 85xx, only speed.c uses these macros, so
>> let's define the prototypes there.  This eliminates the need to define the
>> prototypes in the board config files.
> 
> It also eliminates the utility of the prototype in making sure usage 
> matches the definition, and requires that the user of the macros provide 
> implementation prerequisites.

Hmm... Looks like calculate_board_sys_clk() is defined only on the p2020
currently.  Everyone else uses get_board_sys_clk().  So perhaps we need to
fix p2020ds to use get_board_sys_clk() instead of calculate_board_sys_clk().
 But that's a different problem.

Well, I'm open to suggestions.  Wolfgang asked me to find a solution to this:

#ifndef __ASSEMBLY__
unsigned long calculate_board_sys_clk(void);
unsigned long calculate_board_ddr_clk(void);
#endif
#define CONFIG_SYS_CLK_FREQ	calculate_board_sys_clk()
#define CONFIG_DDR_CLK_FREQ	calculate_board_ddr_clk()

He doesn't want the prototypes in the board header file.

> 
> -Scott


-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list