meta-nuvoton: u-boot-nuvoton: set device tree from the machine config

Handle machines setting custom values for UBOOT_DEVICETREE
in their owned machine.conf

(From meta-nuvoton rev: 77da50308b102dec6109c2ac73dea4a5cb70ac46)

Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: Icbe86c967540084ab0e616b4dd7da70c7c36c099
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton.inc b/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton.inc
index 55d8b47..60c722d 100644
--- a/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton.inc
+++ b/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton.inc
@@ -68,6 +68,10 @@
 UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf"
 UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}"
 
+# Set Device tree from the machine config automatically
+UBOOT_MAKE_TARGET += '${@"" if d.getVar("UBOOT_DEVICETREE") is None \
+    else " DEVICE_TREE=" + d.getVar("UBOOT_DEVICETREE")}'
+
 # returns all the elements from the src uri that are .cfg files
 def find_cfgs(d):
     sources=src_patches(d, True)