u-boot: add support for SPL UART variant
[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot-ti.inc
index 968f3e41bd602f78790e8bfb364b016918ba7840..c024e9634ae7ce9e04d4f730b82951c5edf9c0d5 100644 (file)
@@ -15,3 +15,27 @@ PKG_${PN}-dbg = "u-boot-dbg"
 S = "${WORKDIR}/git"
 
 UBOOT_SUFFIX = "img"
+
+# SPL (Second Program Loader) to be loaded over UART
+SPL_UART_BINARY ?= ""
+SPL_UART_IMAGE ?= "${SPL_UART_BINARY}-${MACHINE}-${PV}-${PR}"
+SPL_UART_SYMLINK ?= "${SPL_UART_BINARY}-${MACHINE}"
+
+do_install_append () {
+    if [ "x${SPL_UART_BINARY}" != "x" ]
+    then
+        install ${S}/spl/${SPL_UART_BINARY} ${D}/boot/${SPL_UART_IMAGE}
+        ln -sf ${SPL_UART_IMAGE} ${D}/boot/${SPL_UART_BINARY}
+    fi
+}
+
+do_deploy_append () {
+    cd ${DEPLOYDIR}
+    if [ "x${SPL_UART_BINARY}" != "x" ]
+    then
+        install ${S}/spl/${SPL_UART_BINARY} ${DEPLOYDIR}/${SPL_UART_IMAGE}
+        rm -f ${DEPLOYDIR}/${SPL_UART_BINARY} ${DEPLOYDIR}/${SPL_UART_SYMLINK}
+        ln -sf ${SPL_UART_IMAGE} ${DEPLOYDIR}/${SPL_UART_BINARY}
+        ln -sf ${SPL_UART_IMAGE} ${DEPLOYDIR}/${SPL_UART_SYMLINK}
+    fi
+}