Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Feb 2014 19:37:42 -0700
From:      Ian Lepore <ian@FreeBSD.org>
To:        Tom Everett <tom@khubla.com>
Cc:        freebsd-arm <freebsd-arm@FreeBSD.org>, Bernd Walter <ticso@cicely7.cicely.de>, ticso@cicely.de
Subject:   Re: wandboard / imx6 / exynos4 / cortex-a9 "wrong-endian bug" fixed
Message-ID:  <1391395062.13026.69.camel@revolution.hippie.lan>
In-Reply-To: <CAB3ij4AjkrMfF2YLrjTE5vZx25XT%2B2iTSghKG=kh8iu==XeZ2w@mail.gmail.com>
References:  <1391371204.13026.43.camel@revolution.hippie.lan> <20140202230450.GA42331@cicely7.cicely.de> <CAB3ij4AjkrMfF2YLrjTE5vZx25XT%2B2iTSghKG=kh8iu==XeZ2w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-N6KpUAYlO/lXDkjp/owK
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

On Sun, 2014-02-02 at 18:25 -0700, Tom Everett wrote:
> I can confirm that a crochet image for Wandboard no longer crashes after
> this fix.  It doesn't mount the FS yet, but that's a known issue, noted
> here:
> 
> https://github.com/kientzle/crochet-freebsd/issues/29

That thread mentions needing to build a u-boot for wandboard.  Here's a
patchset for doing that.  Apply this in your ports/sysutils dir, using:
 
  patch -p0 <u-boot-wandboard.diff

This was copied from Tim's beaglebone work and changed a bit for
wandboard.  

I've been meaning to ask about how we should handle this.  Do we want a
u-boot port for every board, or is there some way to parameterize a
single port so that it applies the right set of patches, or what?  I'm
not very savvy about ports.

-- Ian


--=-N6KpUAYlO/lXDkjp/owK
Content-Disposition: attachment; filename="u-boot-wandboard.diff"
Content-Type: text/x-patch; name="u-boot-wandboard.diff"; charset="us-ascii"
Content-Transfer-Encoding: 7bit

diff --recursive -Nu u-boot-wandboard.orig/Makefile u-boot-wandboard/Makefile
--- u-boot-wandboard.orig/Makefile	1969-12-31 17:00:00.000000000 -0700
+++ u-boot-wandboard/Makefile	2013-08-01 13:13:33.000000000 -0600
@@ -0,0 +1,47 @@
+# $FreeBSD: head/sysutils/u-boot-wandboard-eabi/Makefile 323863 2013-07-29 00:04:33Z kientzle $
+
+PORTNAME=	wandboard
+PORTVERSION=	2013.04
+CATEGORIES=	sysutils
+MASTER_SITES=	ftp://ftp.denx.de/pub/u-boot/ \
+		${MASTER_SITE_LOCAL}
+MASTER_SITE_SUBDIR=	kientzle
+PKGNAMEPREFIX=	u-boot-
+PKGNAMESUFFIX=	-eabi
+DISTNAME=	u-boot-2013.04
+
+MAINTAINER=	kientzle@FreeBSD.org
+COMMENT=	U-Boot loader for wandboard
+
+BUILD_DEPENDS=	arm-eabi-gcc:${PORTSDIR}/devel/arm-eabi-gcc
+
+WRKSRC=		${WRKDIR}/u-boot-${PORTVERSION}
+USE_BZIP2=	yes
+USE_GMAKE=	yes
+U_BOOT_DIR=	share/u-boot/${PORTNAME}${PKGNAMESUFFIX}
+PLIST_FILES=	${U_BOOT_DIR}/bb-uboot.img \
+		${U_BOOT_DIR}/bb-uenv.txt \
+		${U_BOOT_DIR}/MLO \
+		${U_BOOT_DIR}/README
+PLIST_DIRS=	${U_BOOT_DIR} share/u-boot
+
+CROSS_PREFIX=	arm-eabi-
+ARCH=		arm
+
+do-configure:
+	(cd ${WRKSRC}; ${GMAKE} CROSS_COMPILE=${CROSS_PREFIX} wandboard_solo)
+
+do-build:
+	(cd ${WRKSRC};${GMAKE} CROSS_COMPILE=${CROSS_PREFIX} )
+
+do-install:
+	${MKDIR} ${PREFIX}/${U_BOOT_DIR}
+	${CP} ${WRKSRC}/MLO ${PREFIX}/${U_BOOT_DIR}
+	${CP} ${WRKSRC}/u-boot.img ${PREFIX}/${U_BOOT_DIR}/bb-uboot.img
+	${TOUCH} ${PREFIX}/${U_BOOT_DIR}/bb-uenv.txt
+	${CP} ${.CURDIR}/pkg-descr ${PREFIX}/${U_BOOT_DIR}/README
+
+post-install:
+	${ECHO_CMD} U-Boot files are installed in ${U_BOOT_DIR}.
+
+.include <bsd.port.mk>
diff --recursive -Nu u-boot-wandboard.orig/distinfo u-boot-wandboard/distinfo
--- u-boot-wandboard.orig/distinfo	1969-12-31 17:00:00.000000000 -0700
+++ u-boot-wandboard/distinfo	2013-08-01 11:06:33.000000000 -0600
@@ -0,0 +1,2 @@
+SHA256 (u-boot-2013.04.tar.bz2) = 4150e5a4480707c55a8d5b4570262e43af68d8ed3bdc0a433d8e7df47989a69e
+SIZE (u-boot-2013.04.tar.bz2) = 9837387
diff --recursive -Nu u-boot-wandboard.orig/files/patch-api_Makefile u-boot-wandboard/files/patch-api_Makefile
--- u-boot-wandboard.orig/files/patch-api_Makefile	1969-12-31 17:00:00.000000000 -0700
+++ u-boot-wandboard/files/patch-api_Makefile	2013-08-01 11:06:49.000000000 -0600
@@ -0,0 +1,11 @@
+--- api/Makefile.orig	2013-04-19 09:25:43.000000000 -0500
++++ api/Makefile	2013-05-16 17:14:54.000000000 -0500
+@@ -24,7 +24,7 @@
+ 
+ LIB	= $(obj)libapi.o
+ 
+-COBJS-$(CONFIG_API) += api.o api_display.o api_net.o api_storage.o \
++COBJS-$(CONFIG_API) += api.o api_display.o api_storage.o \
+ 		       api_platform-$(ARCH).o
+ 
+ COBJS	:= $(COBJS-y)
diff --recursive -Nu u-boot-wandboard.orig/files/patch-examples_api_Makefile u-boot-wandboard/files/patch-examples_api_Makefile
--- u-boot-wandboard.orig/files/patch-examples_api_Makefile	1969-12-31 17:00:00.000000000 -0700
+++ u-boot-wandboard/files/patch-examples_api_Makefile	2013-08-01 11:06:49.000000000 -0600
@@ -0,0 +1,11 @@
+--- examples/api/Makefile.orig	2013-04-19 09:25:43.000000000 -0500
++++ examples/api/Makefile	2013-05-16 17:05:38.000000000 -0500
+@@ -69,7 +69,7 @@
+ #########################################################################
+ 
+ $(OUTPUT):	$(OBJS)
+-		$(LD) -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS)
++		$(LD) -static -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS)
+ 		$(OBJCOPY) -O binary $@ $(OUTPUT).bin 2>/dev/null
+ 
+ # Rule to build generic library C files
diff --recursive -Nu u-boot-wandboard.orig/files/patch-include_configs_wandboard.h u-boot-wandboard/files/patch-include_configs_wandboard.h
--- u-boot-wandboard.orig/files/patch-include_configs_wandboard.h	1969-12-31 17:00:00.000000000 -0700
+++ u-boot-wandboard/files/patch-include_configs_wandboard.h	2013-09-19 11:20:36.000000000 -0600
@@ -0,0 +1,30 @@
+--- include/configs/wandboard.h.orig	2013-08-01 12:41:56.000000000 -0600
++++ include/configs/wandboard.h	2013-08-01 12:56:25.000000000 -0600
+@@ -47,6 +47,9 @@
+ 
+ #undef CONFIG_CMD_IMLS
+ 
++#define CONFIG_CMD_ELF
++#define CONFIG_SYS_MMC_MAX_DEVICE	2
++
+ #define CONFIG_BOOTDELAY		5
+ 
+ #define CONFIG_SYS_MEMTEST_START	0x10000000
+@@ -54,6 +56,16 @@
+ #define CONFIG_LOADADDR			0x12000000
+ #define CONFIG_SYS_TEXT_BASE		0x17800000
+ 
++/* USB Configs */
++#define CONFIG_CMD_USB
++#define CONFIG_CMD_FAT
++#define CONFIG_USB_EHCI
++#define CONFIG_USB_EHCI_MX6
++#define CONFIG_USB_STORAGE
++#define CONFIG_MXC_USB_PORT     1
++#define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
++#define CONFIG_MXC_USB_FLAGS    0
++
+ /* MMC Configuration */
+ #define CONFIG_FSL_ESDHC
+ #define CONFIG_FSL_USDHC
+
diff --recursive -Nu u-boot-wandboard.orig/pkg-descr u-boot-wandboard/pkg-descr
--- u-boot-wandboard.orig/pkg-descr	1969-12-31 17:00:00.000000000 -0700
+++ u-boot-wandboard/pkg-descr	2013-08-01 11:06:33.000000000 -0600
@@ -0,0 +1,18 @@
+U-Boot loader for BeagleBone and BeagleBone Black.
+
+This version is patched so that:
+ * ELF and API features are enabled
+ * U-Boot binary is called BB-UBOOT.IMG
+ * It loads env from BB-UENV.TXT (an empty file suffices)
+ * It loads BBONE.DTB if running on an older (white) BeagleBone,
+   or BBONEBLK.DTB if running on a BeagleBone Black
+ * By default, it loads ELF ubldr from file BBUBLDR to address 0x88000000
+
+Note: prefixing the boot files with 'BB' allows building
+images with boot bits for more than one board.
+
+For information about running FreeBSD on BeagleBone or BeagleBone Black, see
+ https://wiki.freebsd.org/FreeBSD/arm/BeagleBone
+
+For general information about U-Boot, see
+WWW: http://www.denx.de/wiki/U-Boot

--=-N6KpUAYlO/lXDkjp/owK--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1391395062.13026.69.camel>