[U-Boot-Users] LIBFDT on the mpc8349emds was[PATCH: u-boot-fdt] Improve error print messages.

Jerry Van Baren
2007-08-08T15:05:38Z

Michal Simek wrote:
> HI,
>
>> Undefine CONFIG_OF_FLAT_TREE - it and CONFIG_OF_LIBFDT are mutually
>> exclusive. That is The Old Way, CONFIG_OF_LIBFDT is The New Way. The
>> following is the starting point. CONFIG_OF_BOARD_SETUP is most likely
>> necessary, CONFIG_OF_HAS_BD_T is either necessary or A Good Thing, and
>> CONFIG_OF_HAS_UBOOT_ENV is optional.
>>
>> /* pass open firmware flat tree */
>> #define CONFIG_OF_LIBFDT 1
>> #undef CONFIG_OF_FLAT_TREE
>> #define CONFIG_OF_BOARD_SETUP 1
>> #define CONFIG_OF_HAS_BD_T 1
>> #define CONFIG_OF_HAS_UBOOT_ENV 1
>
> I changed setting but I have problem with compilation.
>
> /* pass open firmware flat tree */
> -#define CONFIG_OF_FLAT_TREE 1
> +#define CONFIG_OF_LIBFDT 1
> +#undef CONFIG_OF_FLAT_TREE
> #define CONFIG_OF_BOARD_SETUP 1
> +#define CONFIG_OF_HAS_BD_T 1
> +#define CONFIG_OF_HAS_UBOOT_ENV
> MPC8349 has compilation problem.
>
> common/libcommon.a(cmd_bootm.o): In function `do_bootm_linux':
> /tmp/1/u-boot-fdt.git/common/cmd_bootm.c:978: undefined reference to
> `ft_board_setup'
> common/libcommon.a(cmd_fdt.o): In function `do_fdt':
> /tmp/1/u-boot-fdt.git/common/cmd_fdt.c:300: undefined reference to
> `ft_board_setup'
> make: *** [u-boot] Error 1
>
> I tried to change board specific file. Part of patch is below. And
> function ft_get_prop isn't available. Function ft_get_prop is in
> common/ft_build.c and this file is in CONFIG_OF_FLAT_TREE choice. What
> can I do with this?
>
> --- a/board/mpc8349emds/mpc8349emds.c
> +++ b/board/mpc8349emds/mpc8349emds.c
> @@ -584,7 +584,7 @@ U_BOOT_CMD(
> );
> #endif /* if defined(CONFIG_DDR_ECC) && defined(CONFIG_DDR_ECC_CMD) */
>
> -#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
> +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
> void
> ft_board_setup(void *blob, bd_t *bd)
> {
>
> I can try fdt on PQ3 (MPC8560 and EP8548).Is it better choise than PQ II
> Pro?
>
> Best regards,
> Michal Simek

Hi Michal,

Kim is more knowledgeable on the 8349 boards than me, I only have a
MPC8360-MDS-PB board.

The problem is that you have defined (per my directions)
CONFIG_OF_BOARD_SETUP which means that it will call-out to
ft_board_setup() to do board-specific setup.

There are two possibilities:
1) I'm wrong and you don't want to define CONFIG_OF_BOARD_SETUP.
2) You need to implement an appropriate ft_board_setup() and friends
using the LIBFDT functions.

Number 2 is the more likely possibility. Your error message is
indicating that you need to port your mpc8349emds board-specific setup
from the old CONFIG_OF_FLAT_TREE methods (which call ft_get_prop(),
etc.) to the New Improved[tm] CONFIG_OF_LIBFDT methods.

Kim Phillips may have done this adaptation already, I believe what you
really want to do is to clone Kim's u-boot-83xx repo and start there
(either on the "mpc83xx" branch or the "testing" branch). If Kim has
not done the adaptation yet, follow his lead on one of the other 83xx
boards which he has done.

Best regards,
gvb