-
Hello! I'm new to using Yocto, and have been working to build a simple, minimal Poky distro for an ASUS PE1100N development board. This board uses an Nvidia Orin NX SoM. Here's what I have so far. I found that my approach "works", but it does not seem stable--a recent PR in Because I had to update my approach after a small change relating to the device tree, I'm not confident that I'm installing them the right way. I found this discussion recommending to install them directly by listing them in SRC_URI, but I'm not experienced enough with device trees or Yocto to understand how to apply this advice. What is the recommended approach for using pre-existing device tree files? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I took a quick look, and it appears OK, more or less - might be a bit of overkill, but without doing a side-by-side comparison of the vendor's files vs. NVIDIA's, it might be hard to pick out the exact files to install. It is somewhat confusing, since there are different device tree files used for the kernel, the UEFI bootloader, and various bits of the early-stage boot firmware. For the kernel device trees, you could set |
Beta Was this translation helpful? Give feedback.
-
Thank you, @madisongh ! This pointed me in a better direction, and I have a working device, now! Still, do you have an example of what it means to "provide" the .dtb files? I mostly copied the patterns from these recipes as closely as I could:
but I'm still not sure I'm doing this "the right way". I have a base recipe which exposes the BSP package contents to dependent recipes: # asus-bsp.bb
SUMMARY = "PE1100N BSP files"
DESCRIPTION = "ASUS PE1100N BSP contents"
LICENSE = "CLOSED"
PACKAGES = "${PN}"
DEPENDS = " \
nvidia-kernel-oot \
rsync-native \
"
SRC_URI = "https://dlcdnets.asus.com/pub/ASUS/mb/Embedded_IPC/PE1100N/PE1100N_JONXS_Orin-NX-16GB_JetPack-ssd-6.0.0_L4T-36.3.0_v2.0.5-official-20240815.tar.gz?model=PE1100N;downloadfilename=asus-bsp.tar.gz"
SRC_URI[sha256sum] = "4ff015558eaa700994d6dc0bf0ae996b4b9efc13cb44a6fdcb723cabd8806ff0"
S = "${WORKDIR}/mfi_PE1100N-orin"
INHIBIT_DEFAULT_DEPS = "1"
INHIBIT_SYSROOT_STRIP = "1"
SYSROOT_DIRS += "/boot/devicetree"
do_install() {
install -d ${D}/boot/devicetree
install -m 0644 ${S}/bootloader/*.dtb* ${D}/boot/devicetree/
}
bsp = "${SYSROOT_DESTDIR}/sysroot-only/asus-bsp/"
populate_sysroot_asus_bsp() {
install -d ${bsp}
rsync \
--recursive \
--inplace \
--whole-file \
--no-compress \
--exclude='rootfs/' \
--exclude='tools/' \
${S}/ ${bsp}
install -d "${SYSROOT_DESTDIR}/sysroot-only/generated/"
install -m 0644 ${STAGING_DIR_HOST}/boot/devicetree/* "${SYSROOT_DESTDIR}/sysroot-only/generated/"
}
do_populate_sysroot[postfuncs] += "populate_sysroot_asus_bsp"
FILES:${PN} = "/boot/devicetree" And a virtual/dtb provider depending on the BSP recipe: # asus-bsp-dtb.bb
SUMMARY = "PE1100N BSP DTB provider"
DESCRIPTION = "Provides virtual/dtb for the ASUS PE1100N BSP"
LICENSE = "CLOSED"
PACKAGES = "${PN}"
DEPENDS = " \
asus-bsp \
"
PROVIDES = "virtual/dtb"
INHIBIT_DEFAULT_DEPS = "1"
inherit deploy kernel-arch
PACKAGE_ARCH = "${MACHINE_ARCH}"
bsp = "${STAGING_DIR_HOST}/sysroot-only/asus-bsp"
do_deploy() {
install -d ${DEPLOYDIR}/devicetree/
install -m 0644 ${bsp}/bootloader/*.dtb* ${DEPLOYDIR}/devicetree/
install -m 0644 ${bsp}/../generated/* ${DEPLOYDIR}/devicetree/
}
addtask deploy before do_build after do_install
ALLOW_EMPTY:${PN} = "1" Finally, a .bbappend to copy files into the flash staging area: # tegra-bootfiles_%.bbappend
DEPENDS += "asus-bsp"
INHIBIT_SYSROOT_STRIP = "1"
bsp = "${STAGING_DIR_HOST}/sysroot-only/asus-bsp"
do_install:append() {
for f in ${TEGRA_BOOT_FIRMWARE_FILES}; do
if [ -e ${bsp}/bootloader/$f ]; then
install -m 0644 ${bsp}/bootloader/$f ${D}${datadir}/tegraflash
else
bbnote "File ${bsp}/bootloader/$f does not exist"
fi
done
install_asus_boot_firmware_files
install -m 0644 ${BCT_TEMPLATE} ${D}${datadir}/tegraflash/${EMMC_BCT}
}
install_asus_boot_firmware_files() {
case "${SOC_FAMILY}" in
tegra234)
install -m 0644 ${bsp}/bootloader/tegra234-*.dts* ${D}${datadir}/tegraflash/
install -m 0644 ${bsp}/bootloader/tegra234-bpmp-*.dtb ${D}${datadir}/tegraflash/
install -m 0644 ${bsp}/bootloader/tegra234*bct* ${D}${datadir}/tegraflash/
install -m 0644 ${bsp}/bootloader/bpmp_t234-*.bin ${D}${datadir}/tegraflash/
;;
*)
bberror "Unrecognized SOC_FAMILY: ${SOC_FAMILY}"
;;
esac
} |
Beta Was this translation helpful? Give feedback.
I took a quick look, and it appears OK, more or less - might be a bit of overkill, but without doing a side-by-side comparison of the vendor's files vs. NVIDIA's, it might be hard to pick out the exact files to install. It is somewhat confusing, since there are different device tree files used for the kernel, the UEFI bootloader, and various bits of the early-stage boot firmware.
For the kernel device trees, you could set
PREFERRED_PROVIDER_virtual/dtb
in your machine configuration to point to a recipe where you provide those DTB files, rather than using a bbappend to add them in with the rest of the NVIDIA-provided device trees. You might miss out on some DTB overlays built out of the NV…