[U-Boot] [PATCH] powerpc: add support for the Freescale P1022DS reference board

Timur Tabi timur at freescale.com
Fri May 21 18:07:19 CEST 2010


Wolfgang Denk wrote:
>>>>>> > >>>> +#ifndef __ASSEMBLY__
>>>>>> > >>>> +extern unsigned long calculate_board_sys_clk(void);
>>>>>> > >>>> +extern unsigned long calculate_board_ddr_clk(void);
>>>>>> > >>>> +#endif
>>>>> > >>>
>>>>> > >>> Please move to appropriate header file.
> ...
>> > Well, this particular change would probably need to be made later, because I
>> > would probably need to change all the board header files at once.  It's not
>> > trivial.

> What exactly is not trivial in moving some prototype declarations to
> another header file?  Please elucidate.  The most difficult part is
> probably determining where they actually belong to.

Well, I'm having a hard time finding a good header file.

For the P1022DS, I just need to have this macros known to speed.c, so I
could add these lines to the top of /arch/powerpc/cpu/mpc85xx/speed.c:

	#include <common.h>
	#include <ppc_asm.tmpl>
	#include <asm/processor.h>
	#include <asm/io.h>

	/* Clock frequency */
	unsigned long calculate_board_sys_clk(void);
	unsigned long calculate_board_ddr_clk(void);

	DECLARE_GLOBAL_DATA_PTR;

But I suspect this will not be sufficient for all of the other 85xx boards.

Another option is arch/powerpc/include/asm/config.h, but that header file
doesn't have any function prototypes today.

There's also include/common.h, near this block:

#if defined(CONFIG_MPC85xx)
typedef MPC85xx_SYS_INFO sys_info_t;
void	get_sys_info  ( sys_info_t * );
ulong	get_ddr_freq  (ulong);
#endif
#if defined(CONFIG_MPC86xx)
typedef MPC86xx_SYS_INFO sys_info_t;
void   get_sys_info  ( sys_info_t * );
#endif

Suggestions?

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list