From owner-freebsd-current@FreeBSD.ORG  Fri Apr 25 16:30:49 2014
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5448E5DC
 for <freebsd-current@freebsd.org>; Fri, 25 Apr 2014 16:30:49 +0000 (UTC)
Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com
 [209.85.192.170])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 26BCE1848
 for <freebsd-current@freebsd.org>; Fri, 25 Apr 2014 16:30:48 +0000 (UTC)
Received: by mail-pd0-f170.google.com with SMTP id v10so3322131pde.15
 for <freebsd-current@freebsd.org>; Fri, 25 Apr 2014 09:30:48 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:content-type:mime-version:subject:from
 :in-reply-to:date:cc:content-transfer-encoding:message-id:references
 :to; bh=GnIy6gqsHY+FElF5vKe8xwYKWscbZYYja+nyVQ8/9ow=;
 b=ERHst35Vqp3DGAAORrsknzYuFvjXtqxqQ5zL1bLP5eQ1eoefGkIryzKkmuBFvWARfl
 s9cSYTryFi5eEJ3kcBc3avZDCqtbMMP1ovUj+79qxPxZpUCXQMGkOYeXCs8xf7hvJLPb
 ustgfIKqgyY3UA7x//dxRKTJW9QJr9e8SXP1W4V9lflUMU2qzZ1QKCmMBYIr3RKz/lby
 1pIfjlIwP041/YSUwKYe8zoVex5vCg2qqiMeASVfb5m6mpUoumj8mX19Ly1Y9OqAKRSl
 v5+CKheOV5DNnOOQvrjiZn/HDOrOniGLLRDKAt/kmz8sim0GLUa++FyCJnuWoxfY4u33
 NhmA==
X-Gm-Message-State: ALoCoQmIwWInSkdCn1uCNJNvGEiw0LQblH5DuvUgll5M1a37tLpxfJ2lzrO4WMtx53nB2vJsNOUZ
X-Received: by 10.66.221.4 with SMTP id qa4mr9068329pac.138.1398443447921;
 Fri, 25 Apr 2014 09:30:47 -0700 (PDT)
Received: from [10.64.25.6] (dc1-prod.netflix.com. [69.53.236.251])
 by mx.google.com with ESMTPSA id yw3sm16893875pbc.69.2014.04.25.09.30.46
 for <multiple recipients>
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Fri, 25 Apr 2014 09:30:47 -0700 (PDT)
Sender: Warner Losh <wlosh@bsdimp.com>
X-Google-Original-From: Warner Losh <bsdimp@gmail.com>
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\))
Subject: Re: Stand-alone DTB build fails
From: Warner Losh <imp@bsdimp.com>
In-Reply-To: <535A77BB.1070600@arcserv.com>
Date: Fri, 25 Apr 2014 10:30:45 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <151B5B71-EC24-4C7F-8652-CD5BC337A0FB@gmail.com>
References: <535A77BB.1070600@arcserv.com>
To: Ron Brown <ron.brown@arcserv.com>
X-Mailer: Apple Mail (2.1874)
Cc: freebsd-current@freebsd.org
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 25 Apr 2014 16:30:49 -0000


On Apr 25, 2014, at 8:56 AM, Ron Brown <ron.brown@arcserv.com> wrote:

> The FreeBSD Wiki at https://wiki.freebsd.org/FlattenedDeviceTree =
refers to
> building a dtb in the following manner:
>=20
> --
>  On platforms capable of running loader(8) the default scenario is to =
use
>  a stand-alone DTB file, which is handled by the loader and handed =
over to
>  kernel at boot time. In this approach, a DTB should be created at =
kernel
>  build time:
>=20
>  If FDT_DTS_FILE is specified in the kernel config file, the DTB is
>  compiled automatically as part of the buildkernel stage. The user =
does
>  not have to perform any explicit steps.
>=20
>  If the default DTS file is not specified in the kernel config file, =
the
>  DTB needs to be created separately by the user with the builddtb =
target:
>=20
>    $ make builddtb FDT_DTS_FILE=3Dmpc8572ds.dts
> --
>=20
> However, this fails with:
>    ERROR: Specified DTS File (zedboard.dts) does not exist!
>=20
> This is because /usr/src/Makefile.inc1 uses the MACHINE environment
> variable to find FDT_DTS_FILE:
>=20
> Starting at line 1836:
>    if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; =
...
>    echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \
>    exist!"; \
>=20
> MACHINE refers to the currently running system, however most of the =
ARM
> development is cross-compiled and the zedboard .dts resides in the =
dts/arm
> directory while MACHINE points if to the dts/amd64 directory.
> Should Makefile.inc1 instead refer to TARGET or something similar?
>=20
>    if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; =
...

I think this is a mistake, but the make_dtb script also makes a similar
mistake (because it expects to be called from a different context). I=92ll=

sort this out and post a patch.

Warner