MPC8555CDS: U-Boot vs loader compatibility

Stephane E. Potvin stephane.potvin at telcobridges.com
Tue May 26 18:43:41 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marcel Moolenaar wrote:
> All,
> 
> I think I recently updated the FreeBSD loader on my CDS
> that has U-Boot version 1.3.2-rc1 on it (yes, that sounds
> rather fuzzy :-) In any case, the latest PowerPC U-Boot
> loader is having a problem with netbooting. I see packets
> being transmitted (BOOTP), but none of the responses seem
> to arrive at the loader. Then the ARP resolution is
> attempted, which fails as well.
> 
> I'm assuming there's an incompatibility between my U-Boot
> and the loader so I tried building U-Boot on my FreeBSD
> box, but that's failing due to FDT fodder in tools/mkimage.
> In short: Linuxisms.
> 
> So, before I dive into U-Boot build issues and waste my
> time on that, can someone tell me if I *do* need to
> upgrade and which U-Boot version (at minimum) I need?
> 
> Also: did U-Boot grow support to boot from IDE/ATA that's
> in the VIA chipset on the mainboard?
> 

Hi Marcel,

I'm using 1.3.4 with success (on both 8349 and 8379, it should not be making any difference, but YMMV). I'm attaching a patch that I
use locally to enable u-boot to build cleanly on FreeBSD with the devel/cross-* ports.

Hope this helps

Steph
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkocNfYACgkQmdOXtTCX/nusVACgniIxLqPsM7tT5CDFRVCRC4+3
IvMAoOYkT4O7f07GXdApLeZhjMUHf0v2
=Knx+
-----END PGP SIGNATURE-----
-------------- next part --------------
commit 257e73a8d19a52b08213fa04a53e5777be6d71a3
Author: Stephane E. Potvin <spotvin at telcobridges.com>
Date:   Fri Jan 16 17:19:27 2009 -0500

    Add FreeBSD host support
    
    Signed-off-by: Stephane E. Potvin <spotvin at telcobridges.com>

diff --git a/include/image.h b/include/image.h
index 46138fa..85804ff 100644
--- a/include/image.h
+++ b/include/image.h
@@ -33,7 +33,13 @@
 #ifndef __IMAGE_H__
 #define __IMAGE_H__
 
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+
+typedef u_long ulong;
+#else
 #include <asm/byteorder.h>
+#endif
 #include <command.h>
 
 #ifndef USE_HOSTCC
diff --git a/include/libfdt_env.h b/include/libfdt_env.h
index a7fd2f8..7300edc 100644
--- a/include/libfdt_env.h
+++ b/include/libfdt_env.h
@@ -30,12 +30,23 @@
 #endif /* USE_HOSTCC */
 
 #include <stddef.h>
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#else
 #include <asm/byteorder.h>
+#endif
 extern struct fdt_header *working_fdt;  /* Pointer to the working fdt */
 
+#ifdef __FreeBSD__
+#define fdt32_to_cpu(x)		be32toh(x)
+#define cpu_to_fdt32(x)		htobe32(x)
+#define fdt64_to_cpu(x)		be64toh(x)
+#define cpu_to_fdt64(x)		htobe64(x)
+#else
 #define fdt32_to_cpu(x)		__be32_to_cpu(x)
 #define cpu_to_fdt32(x)		__cpu_to_be32(x)
 #define fdt64_to_cpu(x)		__be64_to_cpu(x)
 #define cpu_to_fdt64(x)		__cpu_to_be64(x)
+#endif
 
 #endif /* _LIBFDT_ENV_H */
diff --git a/include/u-boot/md5.h b/include/u-boot/md5.h
index 8b44a7f..2a0e665 100644
--- a/include/u-boot/md5.h
+++ b/include/u-boot/md5.h
@@ -6,7 +6,13 @@
 #ifndef _MD5_H
 #define _MD5_H
 
+#ifdef __FreeBSD__
+#include <sys/types.h>
+
+typedef uint32_t __u32;
+#else
 #include <linux/types.h>
+#endif
 
 struct MD5Context {
 	__u32 buf[4];
diff --git a/lib_generic/md5.c b/lib_generic/md5.c
index 9150510..212a53f 100644
--- a/lib_generic/md5.c
+++ b/lib_generic/md5.c
@@ -32,7 +32,13 @@
 #include <string.h>
 #endif /* USE_HOSTCC */
 #include <watchdog.h>
+#ifdef __FreeBSD__
+#include <sys/types.h>
+
+typedef uint32_t __u32;
+#else
 #include <linux/types.h>
+#endif
 #include <u-boot/md5.h>
 
 static void
commit c166b9f962151c6365e4c81ad1164c2bc12bb625
Author: Stephane E. Potvin <spotvin at telcobridges.com>
Date:   Fri Jan 16 12:05:01 2009 -0500

    Search for bash under /usr/local/bin also.
    
    Signed-off-by: Stephane E. Potvin <spotvin at telcobridges.com>

diff --git a/config.mk b/config.mk
index 1dac29b..bbf5bb2 100644
--- a/config.mk
+++ b/config.mk
@@ -73,7 +73,8 @@ endif
 
 CONFIG_SHELL	:= $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 		    else if [ -x /bin/bash ]; then echo /bin/bash; \
-		    else echo sh; fi ; fi)
+		    else if [ -x /usr/local/bin/bash ]; then echo /usr/local/bin/bash; \
+		    else echo sh; fi ; fi ; fi)
 
 ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc)
 HOSTCC		= cc
commit 58601ca2a4dc8cbbd74e13512f61e613c1f2a804
Author: Stephane E. Potvin <spotvin at telcobridges.com>
Date:   Fri Jan 16 12:03:36 2009 -0500

    Fix the sed expression used to change the source extension to .o to make
    it work under Solaris and FreeBSD.
    
    Signed-off-by: Stephane E. Potvin <spotvin at telcobridges.com>

diff --git a/rules.mk b/rules.mk
index a77451b..d35fd8d 100644
--- a/rules.mk
+++ b/rules.mk
@@ -28,7 +28,7 @@ _depend:	$(obj).depend
 $(obj).depend:	$(src)Makefile $(TOPDIR)/config.mk $(SRCS)
 		@rm -f $@
 		@for f in $(SRCS); do \
-			g=`basename $$f | sed -e 's/\(.*\)\.\w/\1.o/'`; \
+			g=`basename $$f | sed -e 's/\(.*\)\..*/\1.o/'`; \
 			$(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
 		done
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fbsd_support.diff.sig
Type: application/octet-stream
Size: 72 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ppc/attachments/20090526/61a8bd90/fbsd_support.diff.obj


More information about the freebsd-ppc mailing list