blob: 2708ae081ff5f7f23a56452c2e8e2e39e53fdc23 [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
Brad Bishop6c2fd812019-07-21 18:08:31 -04003
4SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
5DEPENDS += "mtd-utils"
6
7PROVIDES += "u-boot-fw-utils"
Andrei Kartashevb60b7b12021-07-29 09:01:35 +03008RPROVIDES:${PN} += "u-boot-fw-utils"
Brad Bishop6c2fd812019-07-21 18:08:31 -04009
Joel Stanley52db5ae2020-03-20 12:17:07 +103010SRC_URI += "file://fw_env_ast2600_nor.config"
Adriana Kobylake4778652020-07-07 13:31:51 -050011SRC_URI += "file://fw_env_ast2600_mmc.config"
zhanghaicheng851a10e2021-12-23 09:44:26 +080012SRC_URI += "file://fw_env_flash_64M_nor.config"
Adriana Kobylake4778652020-07-07 13:31:51 -050013
14ENV_CONFIG_FILE = "fw_env_ast2600_nor.config"
Patrick Williamsb9799be2021-08-06 09:13:33 -050015ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config"
zhanghaicheng851a10e2021-12-23 09:44:26 +080016ENV_CONFIG_FILE:uboot-flash-65536 = "fw_env_flash_64M_nor.config"
Joel Stanley52db5ae2020-03-20 12:17:07 +103017
Patrick Williamsb9799be2021-08-06 09:13:33 -050018INSANE_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'
Brad Bishop6c2fd812019-07-21 18:08:31 -040021
22inherit uboot-config
23
24do_compile () {
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030025 oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
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"