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