1require u-boot-common-aspeed-sdk_${PV}.inc
2require conf/machine/distro/include/uboot-distrovars.inc
3require recipes-bsp/u-boot/u-boot-configure.inc
4
5SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
6DEPENDS += "mtd-utils"
7
8PROVIDES += "u-boot-fw-utils"
9RPROVIDES:${PN} += "u-boot-fw-utils"
10
11# The 32MB NOR and 64MB NOR layouts use the same configuration
12SRC_URI += "file://fw_env_flash_nor.config"
13SRC_URI += "file://fw_env_ast2600_mmc.config"
14
15ENV_CONFIG_FILE = "fw_env_flash_nor.config"
16ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config"
17
18INSANE_SKIP:${PN} = "already-stripped"
19EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
20EXTRA_OEMAKE:class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
21
22inherit uboot-config
23
24do_compile () {
25	oe_runmake envtools
26}
27
28do_install () {
29	install -d ${D}${base_sbindir}
30	install -m 755 ${B}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
31	ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv
32
33	install -d ${D}${sysconfdir}
34	install -m 644 ${WORKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config
35}
36
37do_install:class-cross () {
38	install -d ${D}${bindir_cross}
39	install -m 755 ${B}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
40	ln -sf fw_printenv ${D}${bindir_cross}/fw_setenv
41}
42
43SYSROOT_DIRS:append:class-cross = " ${bindir_cross}"
44
45PACKAGE_ARCH = "${MACHINE_ARCH}"
46BBCLASSEXTEND = "cross"
47