Fix DTB generation mechanism and build failure
authorLuis Machado <luis.machado@linaro.org>
Wed, 7 Apr 2021 19:20:44 +0000 (16:20 -0300)
committerLuis Machado <luis.machado@linaro.org>
Thu, 8 Apr 2021 18:02:14 +0000 (15:02 -0300)
I ran into a build failure with --enable-targets=all due to the fact that
the moxie sim expects to be able to use the dtc tool.  If it isn't available,
the builds fails.

The following patch adds a prebuilt dtb file to the tree. That file is the one
that is used for installations.

The patch also enables (re-)generation of the dtb file through maintainer
mode, if it needs to be updated due to a change in the dts file.

Tested on aarch64-linux/x86_64-linux.

sim/moxie/ChangeLog:

2021-04-08  Luis Machado  <luis.machado@linaro.org>

* Makefile.in (moxie-gdb.dtb): Add maintainer mode dependency.
(install-dtb): Install prebuilt dtb file.
* moxie-gdb.dtb: New prebuilt file.

sim/moxie/ChangeLog
sim/moxie/Makefile.in
sim/moxie/moxie-gdb.dtb [new file with mode: 0644]

index b73cfab8447c18c46f47d0fac621b8c8c359c502..95ddb4fa3b381ed18b0efb9e20eff2d01cce45d0 100644 (file)
@@ -1,3 +1,9 @@
+2021-04-08  Luis Machado  <luis.machado@linaro.org>
+
+       * Makefile.in (moxie-gdb.dtb): Add maintainer mode dependency.
+       (install-dtb): Install prebuilt dtb file.
+       * moxie-gdb.dtb: New prebuilt file.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
index ee51386729063625c47b88edf98535e450f3baef..bd58074491fc7016dad4b8afa53f22a83629f8f6 100644 (file)
@@ -17,6 +17,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+DTC = @DTC@
+
 dtbdir = @datadir@/gdb/dtb
 
 SIM_OBJS = \
@@ -32,9 +34,17 @@ SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
 all: moxie-gdb.dtb
 
-moxie-gdb.dtb: moxie-gdb.dts
-       dtc -O dtb -o moxie-gdb.dtb ${srcdir}/moxie-gdb.dts
+moxie-gdb.dtb: @MAINTAINER_MODE_TRUE@ moxie-gdb.dts
+       @echo Regenerating moxie-gdb.dtb
+       if test "x$(DTC)" != x; then \
+         $(DTC) -O dtb -o moxie-gdb.dtb ${srcdir}/moxie-gdb.dts || exit 1; \
+         $(SHELL) $(srcroot)/move-if-change moxie-gdb.dtb ${srcdir}/moxie-gdb.dtb || exit 1; \
+       else \
+         echo "Could not update the moxie-gdb.dtb file because the device "; \
+         echo "tree compiler tool (dtc) is missing.  Install the tool to "; \
+         echo "update the device tree blob."; \
+       fi
 
 install-dtb: moxie-gdb.dtb
        $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(dtbdir)
-       $(INSTALL_DATA) moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb
+       $(INSTALL_DATA) $(srcdir)/moxie-gdb.dtb $(DESTDIR)$(dtbdir)/moxie-gdb.dtb
diff --git a/sim/moxie/moxie-gdb.dtb b/sim/moxie/moxie-gdb.dtb
new file mode 100644 (file)
index 0000000..4c7e457
Binary files /dev/null and b/sim/moxie/moxie-gdb.dtb differ
This page took 0.027139 seconds and 4 git commands to generate.