blob: 115481458f8c25f87b290acb4ae16b974fcba327 [file] [log] [blame]
Brad Bishop6c2fd812019-07-21 18:08:31 -04001require u-boot-common-aspeed-sdk_${PV}.inc
Zev Weissb0fe8fd2022-01-18 18:23:39 -08002require recipes-bsp/u-boot/u-boot-configure.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 Stanleyb0683cc2022-05-02 09:51:40 +093010# The 32MB NOR and 64MB NOR layouts use the same configuration
11SRC_URI += "file://fw_env_flash_nor.config"
Adriana Kobylake4778652020-07-07 13:31:51 -050012SRC_URI += "file://fw_env_ast2600_mmc.config"
13
Joel Stanleyb0683cc2022-05-02 09:51:40 +093014ENV_CONFIG_FILE = "fw_env_flash_nor.config"
Patrick Williamsb9799be2021-08-06 09:13:33 -050015ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config"
Joel Stanley52db5ae2020-03-20 12:17:07 +103016
Patrick Williamsb9799be2021-08-06 09:13:33 -050017INSANE_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'
Brad Bishop6c2fd812019-07-21 18:08:31 -040020
21inherit uboot-config
22
23do_compile () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040024 oe_runmake envtools
25}
26
27do_install () {
28 install -d ${D}${base_sbindir}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030029 install -m 755 ${B}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
30 ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv
Adriana Kobylake4778652020-07-07 13:31:51 -050031
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030032 install -d ${D}${sysconfdir}
Adriana Kobylake4778652020-07-07 13:31:51 -050033 install -m 644 ${WORKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config
Brad Bishop6c2fd812019-07-21 18:08:31 -040034}
35
Patrick Williamsb9799be2021-08-06 09:13:33 -050036do_install:class-cross () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040037 install -d ${D}${bindir_cross}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030038 install -m 755 ${B}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
39 ln -sf fw_printenv ${D}${bindir_cross}/fw_setenv
Brad Bishop6c2fd812019-07-21 18:08:31 -040040}
41
Patrick Williamsb9799be2021-08-06 09:13:33 -050042SYSROOT_DIRS:append:class-cross = " ${bindir_cross}"
Brad Bishop6c2fd812019-07-21 18:08:31 -040043
44PACKAGE_ARCH = "${MACHINE_ARCH}"
45BBCLASSEXTEND = "cross"