public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jerry Van Baren <vanbaren@cideas.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages.
Date: Wed, 08 Aug 2007 08:50:42 -0400	[thread overview]
Message-ID: <46B9BC22.5040309@cideas.com> (raw)
In-Reply-To: <1898.6090-7377-1943913798-1186557335@seznam.cz>

Michal Simek wrote:
> Hi,
> 
> I am trying to work with fdt (MPC8349EMDS board) but I have some problems.
> 
> I download the latest version from u-boot-fdt.git fdt branch
> 
> I made minor changes in setting file.
> 
> diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
> index 1567fcf..33198d6 100644
> --- a/include/configs/MPC8349EMDS.h
> +++ b/include/configs/MPC8349EMDS.h
> @@ -339,6 +339,7 @@
>  #endif
> 
>  /* pass open firmware flat tree */
> +#define CONFIG_OF_LIBFDT       1
>  #define CONFIG_OF_FLAT_TREE    1
>  #define CONFIG_OF_BOARD_SETUP  1

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

> 
> @@ -739,7 +740,7 @@
>                 "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
>         "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
>                 "bootm\0"                                               \
> -       "load=tftp 100000 /tftpboot/mpc8349emds/u-boot.bin\0"           \
> +       "load=tftp 100000 mpc8349emds/u-boot.bin\0"             \
>         "update=protect off fe000000 fe03ffff; "                        \
>                 "era fe000000 fe03ffff; cp.b 100000 fe000000 ${filesize}\0"     \
>         "upd=run load;run update\0"                                     \
> [monstr at simekmichal1 u-boot-fdt.git]$
> 
> I got error message in compiling process
> 
> ppc_82xx-gcc -g  -Os   -fPIC -ffixed-r14 -meabi -mrelocatable -D__KERNEL__ -DTEXT_BASE=0xFE000000  -I/tmp/1/u-boot-fdt.git/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/eldk/usr/bin/../lib/gcc/powerpc-linux/4.0.0/include -pipe  -DCONFIG_PPC -D__powerpc__ -DCONFIG_MPC83XX -DCONFIG_E300 -ffixed-r2 -ffixed-r29 -msoft-float -Wall -Wstrict-prototypes -c -o cpu.o cpu.c
> cpu.c: In function 'fdt_set_eth0':
> cpu.c:336: warning: implicit declaration of function 'fdt_get_property'
> cpu.c:337: warning: implicit declaration of function 'fdt_setprop'
> cpu.c: In function 'ft_cpu_setup':
> cpu.c:502: warning: implicit declaration of function 'fdt_find_node_by_path'
> cpu.c:502: error: 'fdt' undeclared (first use in this function)
> cpu.c:502: error: (Each undeclared identifier is reported only once
> cpu.c:502: error: for each function it appears in.)
> make[1]: *** [cpu.o] Error 1
> make[1]: Leaving directory `/tmp/1/u-boot-fdt.git/cpu/mpc83xx'
> make: *** [cpu/mpc83xx/libmpc83xx.a] Error 2
> [monstr at simekmichal1 u-boot-fdt.git]$
> 
> I made simple changes. I suppose that function needs pointer to fdt structure.
> 
> diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
> index 1a6cba7..37cbaa8 100644
> --- a/cpu/mpc83xx/cpu.c
> +++ b/cpu/mpc83xx/cpu.c
> @@ -497,6 +497,7 @@ ft_cpu_setup(void *blob, bd_t *bd)
>         int  nodeoffset;
>         int  err;
>         int  j;
> +       void *fdt=getenv("fdtaddr");
> 
>         for (j = 0; j < (sizeof(fixup_props) / sizeof(fixup_props[0])); j++) {
>                 nodeoffset = fdt_find_node_by_path(fdt, fixup_props[j].node);
> 
> Now building process ends with success. 

Perhaps successful build, but the wrong fix.  The problem is due to your 
enabling CONFIG_OF_FLAT_TREE.

[snip]

> And I got an error. Do you know where is the problem?

Yes.

> Thanks for your responds,
> Best regards,
> 
> Michal Simek

HTH,
gvb

  reply	other threads:[~2007-08-08 12:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-07 16:06 [U-Boot-Users] [PATCH: u-boot-fdt] Improve error print messages Jerry Van Baren
2007-08-07 20:29 ` Kim Phillips
2007-08-08  7:15   ` Michal Simek
2007-08-08 12:50     ` Jerry Van Baren [this message]
2007-08-08 13:38       ` Michal Simek
2007-08-08 15:05         ` [U-Boot-Users] LIBFDT on the mpc8349emds was[PATCH: " Jerry Van Baren
     [not found]           ` <20070808170651.9c7e78f8.kim.phillips@freescale.com>
2007-08-10  6:33             ` Kim Phillips
2007-08-09 21:05 ` [U-Boot-Users] [PATCH: " Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2007-08-08  1:26 Jerry Van Baren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46B9BC22.5040309@cideas.com \
    --to=vanbaren@cideas.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox