blob: e02369fd4b496186f69dd79345b294b6d09364db [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 Stanleyb0683cc2022-05-02 09:51:40 +093011# The 32MB NOR and 64MB NOR layouts use the same configuration
12SRC_URI += "file://fw_env_flash_nor.config"
Adriana Kobylake4778652020-07-07 13:31:51 -050013SRC_URI += "file://fw_env_ast2600_mmc.config"
14
Joel Stanleyb0683cc2022-05-02 09:51:40 +093015ENV_CONFIG_FILE = "fw_env_flash_nor.config"
Patrick Williamsb9799be2021-08-06 09:13:33 -050016ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.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 () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040025 oe_runmake envtools
26}
27
28do_install () {
29 install -d ${D}${base_sbindir}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030030 install -m 755 ${B}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
31 ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv
Adriana Kobylake4778652020-07-07 13:31:51 -050032
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030033 install -d ${D}${sysconfdir}
Adriana Kobylake4778652020-07-07 13:31:51 -050034 install -m 644 ${WORKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config
Brad Bishop6c2fd812019-07-21 18:08:31 -040035}
36
Patrick Williamsb9799be2021-08-06 09:13:33 -050037do_install:class-cross () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040038 install -d ${D}${bindir_cross}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030039 install -m 755 ${B}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
40 ln -sf fw_printenv ${D}${bindir_cross}/fw_setenv
Brad Bishop6c2fd812019-07-21 18:08:31 -040041}
42
Patrick Williamsb9799be2021-08-06 09:13:33 -050043SYSROOT_DIRS:append:class-cross = " ${bindir_cross}"
Brad Bishop6c2fd812019-07-21 18:08:31 -040044
45PACKAGE_ARCH = "${MACHINE_ARCH}"
46BBCLASSEXTEND = "cross"