From owner-freebsd-ppc@FreeBSD.ORG Tue May 26 18:43:40 2009 Return-Path: Delivered-To: ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4DB610656B9 for ; Tue, 26 May 2009 18:43:40 +0000 (UTC) (envelope-from prvs=139732143f=spotvin@telcobridges.com) Received: from zerofail.com (gatekeeper1.zerofail.com [208.71.11.38]) by mx1.freebsd.org (Postfix) with ESMTP id 678D18FC20 for ; Tue, 26 May 2009 18:43:40 +0000 (UTC) (envelope-from prvs=139732143f=spotvin@telcobridges.com) Received: from telcobridges.com by telcobridges.com (zerofail.com) (SecurityGateway 1.1.4) with SMTP id SG003860603.MSG for ; Tue, 26 May 2009 14:33:04 -0400 Received: from leia.telcobridges.lan ([208.94.105.59]) by telcobridges.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 26 May 2009 14:33:28 -0400 Message-ID: <4A1C35F8.7000002@telcobridges.com> Date: Tue, 26 May 2009 14:33:28 -0400 From: "Stephane E. Potvin" Organization: TelcoBridges Inc. User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: Marcel Moolenaar References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: multipart/mixed; boundary="------------070604060609060800000505" X-OriginalArrivalTime: 26 May 2009 18:33:28.0800 (UTC) FILETIME=[76B2DE00:01C9DE30] X-SGHeloLookup-Result: hardfail smtp.helo=telcobridges.com (does not match 208.71.8.41) X-SGOP-RefID: str=0001.0A090201.4A1C35F9.0147:SCFSTAT5152683, ss=1, fgs=0 (_st=1 _vt=0 _iwf=0) Cc: Rafal Jaworowski , ppc@freebsd.org Subject: Re: MPC8555CDS: U-Boot vs loader compatibility X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2009 18:43:41 -0000 This is a multi-part message in MIME format. --------------070604060609060800000505 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----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----- --------------070604060609060800000505 Content-Type: text/plain; name="fbsd_support.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fbsd_support.diff" commit 257e73a8d19a52b08213fa04a53e5777be6d71a3 Author: Stephane E. Potvin Date: Fri Jan 16 17:19:27 2009 -0500 Add FreeBSD host support Signed-off-by: Stephane E. Potvin 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 + +typedef u_long ulong; +#else #include +#endif #include #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 +#ifdef __FreeBSD__ +#include +#else #include +#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 + +typedef uint32_t __u32; +#else #include +#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 #endif /* USE_HOSTCC */ #include +#ifdef __FreeBSD__ +#include + +typedef uint32_t __u32; +#else #include +#endif #include static void commit c166b9f962151c6365e4c81ad1164c2bc12bb625 Author: Stephane E. Potvin Date: Fri Jan 16 12:05:01 2009 -0500 Search for bash under /usr/local/bin also. Signed-off-by: Stephane E. Potvin 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 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 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 --------------070604060609060800000505 Content-Type: application/octet-stream; name="fbsd_support.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="fbsd_support.diff.sig" iEYEABECAAYFAkocNfgACgkQmdOXtTCX/nsI8gCfW3dcRZ1ZqTPGmLnJ8hzbii+YJmgAoPnI bh91pipBK1zlWaf/l6fJvAEW --------------070604060609060800000505--