Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 2014 10:30:45 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Ron Brown <ron.brown@arcserv.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Stand-alone DTB build fails
Message-ID:  <151B5B71-EC24-4C7F-8652-CD5BC337A0FB@gmail.com>
In-Reply-To: <535A77BB.1070600@arcserv.com>
References:  <535A77BB.1070600@arcserv.com>

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

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?151B5B71-EC24-4C7F-8652-CD5BC337A0FB>