public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] FDT include file problems
@ 2008-10-19 22:01 Wolfgang Denk
  2008-10-20  3:10 ` Jerry Van Baren
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2008-10-19 22:01 UTC (permalink / raw)
  To: u-boot

Hello,

on some systems (for example Fedora Core 4) U-Boot builds with the
following wanrings only:

...
In file included from /home/wd/git/u-boot/include/libfdt_env.h:33,
                 from fdt.c:51:
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
In file included from /home/wd/git/u-boot/include/libfdt_env.h:33,
                 from fdt_ro.c:51:
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
In file included from /home/wd/git/u-boot/include/libfdt_env.h:33,
                 from fdt_rw.c:51:
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
In file included from /home/wd/git/u-boot/include/libfdt_env.h:33,
                 from fdt_strerror.c:51:
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
In file included from /home/wd/git/u-boot/include/libfdt_env.h:33,
                 from fdt_wip.c:51:
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
...


The suggested change works in image.h, for example like this:

=======================================================================

diff --git a/include/image.h b/include/image.h
index 82e6345..1598b61 100644
--- a/include/image.h
+++ b/include/image.h
@@ -33,27 +33,29 @@
 #ifndef __IMAGE_H__
 #define __IMAGE_H__
 
-#include <asm/byteorder.h>
-#include <command.h>
-
-#ifndef USE_HOSTCC
-#include <lmb.h>
-#include <linux/string.h>
-#include <asm/u-boot.h>
-
-#else
+#if USE_HOSTCC
+#include <endian.h>
 
 /* new uImage format support enabled on host */
 #define CONFIG_FIT		1
 #define CONFIG_OF_LIBFDT	1
 #define CONFIG_FIT_VERBOSE	1 /* enable fit_format_{error,warning}() */
 
+#else
+
+#include <lmb.h>
+#include <linux/string.h>
+#include <asm/u-boot.h>
+#include <asm/byteorder.h>
+
 #endif /* USE_HOSTCC */
 
 #if defined(CONFIG_FIT) && !defined(CONFIG_OF_LIBFDT)
 #error "CONFIG_OF_LIBFDT not enabled, required by CONFIG_FIT!"
 #endif
 
+#include <command.h>
+
 #if defined(CONFIG_FIT)
 #include <fdt.h>
 #include <libfdt.h>

=======================================================================

However, for the FDT code this doesn't help,  as  we  then  will  get
unresolved    references    for    fdt32_to_cpu(),    cpu_to_fdt32(),
fdt64_to_cpu() and cpu_to_fdt64().

The 32 bit accesses couldbe worked  around  by  using  htonl()  resp.
ntohl(), but I don't know a good way for the 64 bit cases.

Is there a clean and portable way to do this?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There you go man, Keep as cool as you can. It riles them  to  believe
that you perceive the web they weave. Keep on being free!

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-10-21  9:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-19 22:01 [U-Boot] FDT include file problems Wolfgang Denk
2008-10-20  3:10 ` Jerry Van Baren
2008-10-20  7:23   ` Wolfgang Denk
2008-10-20 10:17     ` Jerry Van Baren
2008-10-20 10:51       ` Wolfgang Denk
2008-10-20 11:08       ` Wolfgang Denk
2008-10-20 23:43         ` Jerry Van Baren
2008-10-21  9:24           ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox