u-boot-aspeed: improve env handling

This fixes some build errors we faced due to add new ast2500-based
platform.
* Allow to redefine input env file.
* Backport providing "u-boot-default-env" from u-boot.inc
* PROVIDES += "u-boot-fw-utils" is not enough, add also RPROVIDES

Last two changes allows to exclude from build modern libubootenv which
somewhy doesn't work for us.

Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
Change-Id: I33f152c572f6c0b4d8b608375b252290efacd1ea
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb
index 45505b0..a142c17 100644
--- a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed-sdk_2019.04.bb
@@ -21,11 +21,12 @@
 UBOOT_ENV_SIZE:df-phosphor-mmc = "0x10000"
 UBOOT_ENV:df-phosphor-mmc = "u-boot-env"
 UBOOT_ENV_SUFFIX:df-phosphor-mmc = "bin"
+UBOOT_ENV_TXT:df-phosphor-mmc = "u-boot-env-ast2600.txt"
 
 do_compile:append() {
     if [ -n "${UBOOT_ENV}" ]
     then
         # Generate redundant environment image
-        ${B}/tools/mkenvimage -r -s ${UBOOT_ENV_SIZE} -o ${WORKDIR}/${UBOOT_ENV_BINARY} ${WORKDIR}/u-boot-env-ast2600.txt
+        ${B}/tools/mkenvimage -r -s ${UBOOT_ENV_SIZE} -o ${WORKDIR}/${UBOOT_ENV_BINARY} ${WORKDIR}/${UBOOT_ENV_TXT}
     fi
 }
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed.inc b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed.inc
index 19de5d2..3028a9e 100644
--- a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed.inc
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed.inc
@@ -182,7 +182,11 @@
 
 }
 
+PACKAGE_BEFORE_PN += "${PN}-env"
+
+RPROVIDES:${PN}-env += "u-boot-default-env"
 FILES:${PN} = "/boot ${sysconfdir} ${datadir}"
+RDEPENDS:${PN} += "${PN}-env"
 
 do_deploy () {
     if [ -n "${UBOOT_CONFIG}" ]
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb
index 13a4081..6c1470a 100644
--- a/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed-sdk_2019.04.bb
@@ -4,6 +4,7 @@
 DEPENDS += "mtd-utils"
 
 PROVIDES += "u-boot-fw-utils"
+RPROVIDES:${PN} += "u-boot-fw-utils"
 
 SRC_URI += "file://fw_env_ast2600_nor.config"
 SRC_URI += "file://fw_env_ast2600_mmc.config"