blob: 1a7e8f5b7c471e461123192388a5032fa99ddc6d [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"
Howard Chiuc1c23702022-04-26 09:32:42 +080013SRC_URI += "file://fw_env_flash_32M_nor.config"
zhanghaicheng851a10e2021-12-23 09:44:26 +080014SRC_URI += "file://fw_env_flash_64M_nor.config"
Howard Chiuc1c23702022-04-26 09:32:42 +080015SRC_URI:append:uboot-flash-32768 = " file://u-boot_flash_32M.cfg"
Adriana Kobylake4778652020-07-07 13:31:51 -050016
17ENV_CONFIG_FILE = "fw_env_ast2600_nor.config"
Patrick Williamsb9799be2021-08-06 09:13:33 -050018ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config"
Howard Chiuc1c23702022-04-26 09:32:42 +080019ENV_CONFIG_FILE:uboot-flash-32768 = "fw_env_flash_32M_nor.config"
zhanghaicheng851a10e2021-12-23 09:44:26 +080020ENV_CONFIG_FILE:uboot-flash-65536 = "fw_env_flash_64M_nor.config"
Joel Stanley52db5ae2020-03-20 12:17:07 +103021
Patrick Williamsb9799be2021-08-06 09:13:33 -050022INSANE_SKIP:${PN} = "already-stripped"
23EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
24EXTRA_OEMAKE:class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
Brad Bishop6c2fd812019-07-21 18:08:31 -040025
26inherit uboot-config
27
28do_compile () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040029 oe_runmake envtools
30}
31
32do_install () {
33 install -d ${D}${base_sbindir}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030034 install -m 755 ${B}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
35 ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv
Adriana Kobylake4778652020-07-07 13:31:51 -050036
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030037 install -d ${D}${sysconfdir}
Adriana Kobylake4778652020-07-07 13:31:51 -050038 install -m 644 ${WORKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config
Brad Bishop6c2fd812019-07-21 18:08:31 -040039}
40
Patrick Williamsb9799be2021-08-06 09:13:33 -050041do_install:class-cross () {
Brad Bishop6c2fd812019-07-21 18:08:31 -040042 install -d ${D}${bindir_cross}
Andrei Kartashevc5b413f2021-10-08 00:14:45 +030043 install -m 755 ${B}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
44 ln -sf fw_printenv ${D}${bindir_cross}/fw_setenv
Brad Bishop6c2fd812019-07-21 18:08:31 -040045}
46
Patrick Williamsb9799be2021-08-06 09:13:33 -050047SYSROOT_DIRS:append:class-cross = " ${bindir_cross}"
Brad Bishop6c2fd812019-07-21 18:08:31 -040048
49PACKAGE_ARCH = "${MACHINE_ARCH}"
50BBCLASSEXTEND = "cross"