Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 1 | require u-boot-common-aspeed-sdk_${PV}.inc |
zhanghaicheng | 851a10e | 2021-12-23 09:44:26 +0800 | [diff] [blame] | 2 | require conf/machine/distro/include/uboot-distrovars.inc |
Zev Weiss | b0fe8fd | 2022-01-18 18:23:39 -0800 | [diff] [blame] | 3 | require recipes-bsp/u-boot/u-boot-configure.inc |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 4 | |
| 5 | SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities" |
| 6 | DEPENDS += "mtd-utils" |
| 7 | |
| 8 | PROVIDES += "u-boot-fw-utils" |
Andrei Kartashev | b60b7b1 | 2021-07-29 09:01:35 +0300 | [diff] [blame] | 9 | RPROVIDES:${PN} += "u-boot-fw-utils" |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 10 | |
Joel Stanley | 52db5ae | 2020-03-20 12:17:07 +1030 | [diff] [blame] | 11 | SRC_URI += "file://fw_env_ast2600_nor.config" |
Adriana Kobylak | e477865 | 2020-07-07 13:31:51 -0500 | [diff] [blame] | 12 | SRC_URI += "file://fw_env_ast2600_mmc.config" |
Howard Chiu | c1c2370 | 2022-04-26 09:32:42 +0800 | [diff] [blame] | 13 | SRC_URI += "file://fw_env_flash_32M_nor.config" |
zhanghaicheng | 851a10e | 2021-12-23 09:44:26 +0800 | [diff] [blame] | 14 | SRC_URI += "file://fw_env_flash_64M_nor.config" |
Howard Chiu | c1c2370 | 2022-04-26 09:32:42 +0800 | [diff] [blame] | 15 | SRC_URI:append:uboot-flash-32768 = " file://u-boot_flash_32M.cfg" |
Adriana Kobylak | e477865 | 2020-07-07 13:31:51 -0500 | [diff] [blame] | 16 | |
| 17 | ENV_CONFIG_FILE = "fw_env_ast2600_nor.config" |
Patrick Williams | b9799be | 2021-08-06 09:13:33 -0500 | [diff] [blame] | 18 | ENV_CONFIG_FILE:df-phosphor-mmc = "fw_env_ast2600_mmc.config" |
Howard Chiu | c1c2370 | 2022-04-26 09:32:42 +0800 | [diff] [blame] | 19 | ENV_CONFIG_FILE:uboot-flash-32768 = "fw_env_flash_32M_nor.config" |
zhanghaicheng | 851a10e | 2021-12-23 09:44:26 +0800 | [diff] [blame] | 20 | ENV_CONFIG_FILE:uboot-flash-65536 = "fw_env_flash_64M_nor.config" |
Joel Stanley | 52db5ae | 2020-03-20 12:17:07 +1030 | [diff] [blame] | 21 | |
Patrick Williams | b9799be | 2021-08-06 09:13:33 -0500 | [diff] [blame] | 22 | INSANE_SKIP:${PN} = "already-stripped" |
| 23 | EXTRA_OEMAKE:class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1' |
| 24 | EXTRA_OEMAKE:class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1' |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 25 | |
| 26 | inherit uboot-config |
| 27 | |
| 28 | do_compile () { |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 29 | oe_runmake envtools |
| 30 | } |
| 31 | |
| 32 | do_install () { |
| 33 | install -d ${D}${base_sbindir} |
Andrei Kartashev | c5b413f | 2021-10-08 00:14:45 +0300 | [diff] [blame] | 34 | install -m 755 ${B}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv |
| 35 | ln -sf fw_printenv ${D}${base_sbindir}/fw_setenv |
Adriana Kobylak | e477865 | 2020-07-07 13:31:51 -0500 | [diff] [blame] | 36 | |
Andrei Kartashev | c5b413f | 2021-10-08 00:14:45 +0300 | [diff] [blame] | 37 | install -d ${D}${sysconfdir} |
Adriana Kobylak | e477865 | 2020-07-07 13:31:51 -0500 | [diff] [blame] | 38 | install -m 644 ${WORKDIR}/${ENV_CONFIG_FILE} ${D}${sysconfdir}/fw_env.config |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 39 | } |
| 40 | |
Patrick Williams | b9799be | 2021-08-06 09:13:33 -0500 | [diff] [blame] | 41 | do_install:class-cross () { |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 42 | install -d ${D}${bindir_cross} |
Andrei Kartashev | c5b413f | 2021-10-08 00:14:45 +0300 | [diff] [blame] | 43 | install -m 755 ${B}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv |
| 44 | ln -sf fw_printenv ${D}${bindir_cross}/fw_setenv |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 45 | } |
| 46 | |
Patrick Williams | b9799be | 2021-08-06 09:13:33 -0500 | [diff] [blame] | 47 | SYSROOT_DIRS:append:class-cross = " ${bindir_cross}" |
Brad Bishop | 6c2fd81 | 2019-07-21 18:08:31 -0400 | [diff] [blame] | 48 | |
| 49 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 50 | BBCLASSEXTEND = "cross" |