Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Mar 2015 09:56:49 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Russell Haley <russ.haley@gmail.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Digi-CCWMX53 - u-boot
Message-ID:  <1427212609.5591.10.camel@freebsd.org>
In-Reply-To: <CABx9NuTbuxyu-W%2BgLznVnFS1aAivw6u6HPHuD99d1=f-staC=g@mail.gmail.com>
References:  <CABx9NuQZe3k%2BAtRxtUg5k3=5jM20RQdgnwpuKr9uc07VY1C1EQ@mail.gmail.com> <622469F8-C245-4E84-B5E1-FE360D3C9B4C@me.com> <CABx9NuRhwfW=AZ%2BLUnQ4f2yzO-cf%2BbNX28BZqP6KCs5xKf-G-g@mail.gmail.com> <F33D2637-1D5D-431F-89D4-D9C051582A57@me.com> <CABx9NuQD=tapnsueRQO-mQq5=sRZ4RLPg7fRyuyk237HH=8vDA@mail.gmail.com> <215C10E1-9F47-46B6-A60B-430D7DEDA090@me.com> <CABx9NuTbuxyu-W%2BgLznVnFS1aAivw6u6HPHuD99d1=f-staC=g@mail.gmail.com>

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

--=-vL65/0kiueeSHcpPsgBo
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

On Mon, 2015-03-23 at 22:34 -0700, Russell Haley wrote:
> Okay, I'll create a 10 jail and see what happens. Last straw is to try
> this in Linux? I'm working on a make tutorial right now. <shrug>
> 
> Good doggy Russell, good doggy.
> 
> ha ha.
> 

Try the attached new port I just threw together for building u-boot for
this board.  I have a different imx53 board so I haven't run-tested
this, but it builds for me on my x86 10-stable machine.

Unfortunately, this is the oldest u-boot source I've ever tried to work
with and most of the "standard freebsd u-boot patches" won't apply, so
this is pretty much exactly what comes from Rui's github branch.  (I was
able to use the latest u-boot from denx for my imx53 board, but
apparently Digi never contributed their changes back to denx so this
ancient version is the only option right now.)

To use this diff, cd to your /usr/ports dir and apply the diff using:

  patch -p0 </path/to/u-boot-ccwmx53.diff

Then just cd to /usr/ports/sysutils/u-boot-ccwmx53 and do "make install"
and you should end up with the u-boot files for your board installed
at /usr/local/share/u-boot

-- Ian


--=-vL65/0kiueeSHcpPsgBo
Content-Disposition: inline; filename="u-boot-ccwmx53.diff"
Content-Type: text/x-patch; name="u-boot-ccwmx53.diff"; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Index: sysutils/u-boot-ccwmx53/Makefile
===================================================================
--- sysutils/u-boot-ccwmx53/Makefile	(revision 0)
+++ sysutils/u-boot-ccwmx53/Makefile	(working copy)
@@ -0,0 +1,43 @@
+# $FreeBSD$
+
+PORTNAME=	u-boot
+PORTVERSION=	2013.08
+CATEGORIES=	sysutils
+PKGNAMESUFFIX=	-ccwmx53
+DISTNAME=	u-boot-${PORTVERSION}-ccwmx53
+
+MAINTAINER=	ian@FreeBSD.org
+COMMENT=	Cross-build U-Boot loader for Digi ConnectCore Wi-i.MX53
+
+LICENSE=	GPLv2
+
+BUILD_DEPENDS=  arm-none-eabi-gcc:${PORTSDIR}/devel/arm-none-eabi-gcc
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	rpaulo
+GH_PROJECT=	uboot-ccwmx53-digi
+GH_COMMIT=	6ae3457
+GH_TAGNAME=	${GH_COMMIT}
+NO_ARCH=	yes
+
+WRKSRC=		${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_TAGNAME}
+USES=		gmake
+SSP_UNSAFE=	yes # cross-build static linking dies with -fstack-protector
+
+U_BOOT_DIR=	share/u-boot/${PORTNAME}${PKGNAMESUFFIX}
+PLIST_FILES=	${U_BOOT_DIR}/u-boot.imx \
+		${U_BOOT_DIR}/README
+
+MAKE_ARGS+=	ARCH=arm \
+		CROSS_COMPILE=arm-none-eabi- \
+		HOSTCC=cc
+
+do-configure:
+	cd ${WRKSRC}; ${GMAKE} ${MAKE_ARGS} ccwmx53js_config
+
+do-install:
+	${MKDIR} ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}
+	${CP} ${WRKSRC}/u-boot.bin ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/
+	${CP} ${.CURDIR}/pkg-descr ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/README
+
+.include <bsd.port.mk>

Property changes on: sysutils/u-boot-ccwmx53/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+FreeBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: sysutils/u-boot-ccwmx53/distinfo
===================================================================
--- sysutils/u-boot-ccwmx53/distinfo	(revision 0)
+++ sysutils/u-boot-ccwmx53/distinfo	(working copy)
@@ -0,0 +1,2 @@
+SHA256 (u-boot-2013.08-ccwmx53.tar.gz) = b38d9676ac539199c2e92cff75525f593b4f1c9beeacfa5d03b2133716f08cb5
+SIZE (u-boot-2013.08-ccwmx53.tar.gz) = 12640869

Property changes on: sysutils/u-boot-ccwmx53/distinfo
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: sysutils/u-boot-ccwmx53/files/patch-api_api__storage.c
===================================================================
--- sysutils/u-boot-ccwmx53/files/patch-api_api__storage.c	(revision 0)
+++ sysutils/u-boot-ccwmx53/files/patch-api_api__storage.c	(working copy)
@@ -0,0 +1,28 @@
+--- api/api_storage.c.orig	2015-01-12 14:39:08 UTC
++++ api/api_storage.c
+@@ -107,10 +107,13 @@ static int dev_stor_get(int type, int fi
+ 
+ 	if (first) {
+ 		di->cookie = (void *)get_dev(specs[type].name, 0);
+-		if (di->cookie == NULL)
++		if (di->cookie == NULL) {
+ 			return 0;
+-		else
++		} else {
+ 			found = 1;
++			if (specs[type].max_dev > 1)
++				*more = 1;
++		}
+ 
+ 	} else {
+ 		for (i = 0; i < specs[type].max_dev; i++)
+@@ -146,7 +149,8 @@ static int dev_stor_get(int type, int fi
+ 			dd = (block_dev_desc_t *)di->cookie;
+ 			if (dd->type == DEV_TYPE_UNKNOWN) {
+ 				debugf("device instance exists, but is not active..");
+-				found = 0;
++				di->di_stor.block_count = 0;
++				di->di_stor.block_size = 0;
+ 			} else {
+ 				di->di_stor.block_count = dd->lba;
+ 				di->di_stor.block_size = dd->blksz;

Property changes on: sysutils/u-boot-ccwmx53/files/patch-api_api__storage.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: sysutils/u-boot-ccwmx53/files/patch-common_cmd__elf.c
===================================================================
--- sysutils/u-boot-ccwmx53/files/patch-common_cmd__elf.c	(revision 0)
+++ sysutils/u-boot-ccwmx53/files/patch-common_cmd__elf.c	(working copy)
@@ -0,0 +1,30 @@
+--- common/cmd_elf.c.orig	2013-08-22 11:38:09.000000000 -0600
++++ common/cmd_elf.c	2015-03-24 08:54:01.000000000 -0600
+@@ -34,21 +34,12 @@ unsigned long do_bootelf_exec (ulong (*e
+ 	unsigned long ret;
+ 
+ 	/*
+-	 * QNX images require the data cache is disabled.
+-	 * Data cache is already flushed, so just turn it off.
+-	 */
+-	int dcache = dcache_status ();
+-	if (dcache)
+-		dcache_disable ();
+-
+-	/*
+-	 * pass address parameter as argv[0] (aka command name),
+-	 * and all remaining args
+-	 */
+-	ret = entry (argc, argv);
+-
+-	if (dcache)
+-		dcache_enable ();
++	 * FreeBSD wants the caches enabled while ubldr runs, and as of r276397
++	 * the kernel can tolerate being entered with internal (but not external
++	 * PL310) caches enabled on armv6/7 systems.  So don't disable caches
++	 * here, just launch the program directly.
++	 */
++	ret = entry(argc, argv);
+ 
+ 	return ret;
+ }

Property changes on: sysutils/u-boot-ccwmx53/files/patch-common_cmd__elf.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: sysutils/u-boot-ccwmx53/files/patch-config.mk
===================================================================
--- sysutils/u-boot-ccwmx53/files/patch-config.mk	(revision 0)
+++ sysutils/u-boot-ccwmx53/files/patch-config.mk	(working copy)
@@ -0,0 +1,11 @@
+--- config.mk.orig	2014-08-14 14:51:10 UTC
++++ config.mk
+@@ -92,7 +92,7 @@ HOSTCC		 = $(call os_x_before, 10, 5, "c
+ HOSTCFLAGS	+= $(call os_x_before, 10, 4, "-traditional-cpp")
+ HOSTLDFLAGS	+= $(call os_x_before, 10, 5, "-multiply_defined suppress")
+ else
+-HOSTCC		= gcc
++HOSTCC		?= gcc
+ endif
+ 
+ ifeq ($(HOSTOS),cygwin)

Property changes on: sysutils/u-boot-ccwmx53/files/patch-config.mk
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: sysutils/u-boot-ccwmx53/pkg-descr
===================================================================
--- sysutils/u-boot-ccwmx53/pkg-descr	(revision 0)
+++ sysutils/u-boot-ccwmx53/pkg-descr	(working copy)
@@ -0,0 +1,10 @@
+U-Boot loader for Digi ConnectCore Wi-i.MX53
+
+Install the u-boot.bin file onto the boot disk using:
+
+  dd if=u-boot.bin of=/dev/whatever bs=1k oseek=1 conv=sync
+
+This version is patched so that:
+ * ELF and API features are enabled to support ubldr.
+
+For general information about U-Boot see WWW: http://www.denx.de/wiki/U-Boot

Property changes on: sysutils/u-boot-ccwmx53/pkg-descr
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property

--=-vL65/0kiueeSHcpPsgBo--




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