blob: 22976efc4f5f5dee108a04272390f924cd20815a [file] [log] [blame]
Brad Bishop6c2fd812019-07-21 18:08:31 -04001require u-boot-common-aspeed-sdk_${PV}.inc
zhanghaicheng851a10e2021-12-23 09:44:26 +08002require conf/machine/distro/include/uboot-distrovars.inc
Zev Weissb0fe8fd2022-01-18 18:23:39 -08003require recipes-bsp/u-boot/u-boot-configure.inc
Brad Bishop6c2fd812019-07-21 18:08:31 -04004
5SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
6DEPENDS += "mtd-utils"
7
8PROVIDES += "u-boot-fw-utils"
Andrei Kartashevb60b7b12021-07-29 09:01:35 +03009RPROVIDES:${PN} += "u-boot-fw-utils"
Brad Bishop6c2fd812019-07-21 18:08:31 -040010
Joel Stanley52db5ae2020-03-20 12:17:07 +103011SRC_URI += "file://fw_env_ast2600_nor.config"
Adriana Kobylake4778652020-07-07 13:31:51 -050012SRC_URI += "file://fw_env_ast2600_mmc.config"
zhanghaicheng851a10e2021-12-23 09:44:26 +080013SRC_URI += "file://fw_env_flash_64M_nor.config"
Adriana Kobylake4778652020-07-07 13:31:51 -050014
15ENV_CONFIG_FILE = "fw_env_ast2600_nor.config"
Patrick Williamsb9799be2021-08-06 09:13:33 -050016ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config"
zhanghaicheng851a10e2021-12-23 09:44:26 +080017ENV_CONFIG_FILE:uboot-flash-65536 = "fw_env_flash_64M_nor.config"
Joel Stanley52db5ae2020-03-20 12:17:07 +103018
Patrick Williamsb9799be2021-08-06 09:13:33 -050019INSANE_SKIP:${PN} = "already-stripped"
20EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
21EXTRA_OEMAKE:class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
Brad Bishop6c2fd812019-07-21 18:08:31 -040022
23inherit uboot-config
24
25do_compile () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040026 oe_runmake envtools
27}
28
29do_install () {
30 install -d ${D}${base_sbindir}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030031 install -m 755 ${B}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
32 ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv
Adriana Kobylake4778652020-07-07 13:31:51 -050033
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030034 install -d ${D}${sysconfdir}
Adriana Kobylake4778652020-07-07 13:31:51 -050035 install -m 644 ${WORKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config
Brad Bishop6c2fd812019-07-21 18:08:31 -040036}
37
Patrick Williamsb9799be2021-08-06 09:13:33 -050038do_install:class-cross () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040039 install -d ${D}${bindir_cross}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030040 install -m 755 ${B}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
41 ln -sf fw_printenv ${D}${bindir_cross}/fw_setenv
Brad Bishop6c2fd812019-07-21 18:08:31 -040042}
43
Patrick Williamsb9799be2021-08-06 09:13:33 -050044SYSROOT_DIRS:append:class-cross = " ${bindir_cross}"
Brad Bishop6c2fd812019-07-21 18:08:31 -040045
46PACKAGE_ARCH = "${MACHINE_ARCH}"
47BBCLASSEXTEND = "cross"