Skip to content

Commit

Permalink
tegra194-flash-dry: Avoid potential rtcpu firmware load failure
Browse files Browse the repository at this point in the history
Patch boot blob to avoid these potential errors:

tegra-hsp-mailbox ivc-bc00000.rtcpu: IOVM setup error: 110
tegra186-cam-rtcpu bc00000.rtcpu: command: 0x00000000: empty mailbox timeout

Also, reduce verbosity level.

Signed-off-by: Alexandru Costache <[email protected]>
  • Loading branch information
acostach committed Jan 20, 2022
1 parent 362fc18 commit 37c0021
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://${BALENA_COREBASE}/COPYING.Apache-2.0;md5=89aea4e17d9

IMAGE_ROOTFS_ALIGNMENT ?= "4"

BOOT_BINDIFF="boot0_t194_agx.bindiff"

DEPENDS = " \
coreutils-native \
virtual/bootloader \
Expand All @@ -22,6 +24,7 @@ SRC_URI = " \
file://resinOS-flash194.xml \
file://partition_specification194.txt \
file://cti-rogue-32-4-3-pinmux.cfg \
file://${BOOT_BINDIFF} \
"

PINMUXCFG = "tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg"
Expand All @@ -44,7 +47,7 @@ LNXFILE="${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin"
IMAGE_TEGRAFLASH_KERNEL ?= "${DEPLOY_DIR_IMAGE}/${LNXFILE}"
BINARY_INSTALL_PATH = "/opt/tegra-binaries"

OS_KERNEL_CMDLINE = "${@bb.utils.contains('DEVELOPMENT_IMAGE','1','console=ttyTHS0,115200n8 console=tty1 debug loglevel=7','console=null quiet splash vt.global_cursor_default=0 consoleblank=0',d)}"
OS_KERNEL_CMDLINE = "${@bb.utils.contains('DEVELOPMENT_IMAGE','1','console=ttyTHS0,115200n8 console=tty1 ','console=null quiet splash vt.global_cursor_default=0 consoleblank=0',d)}"
ROOTA_ARGS="root=LABEL=resin-rootA ro rootwait rootfstype=ext4 ${KERNEL_ARGS} ${OS_KERNEL_CMDLINE}"
ROOTB_ARGS="root=LABEL=resin-rootB ro rootwait rootfstype=ext4 ${KERNEL_ARGS} ${OS_KERNEL_CMDLINE}"

Expand Down Expand Up @@ -253,6 +256,24 @@ do_configure() {
dd if=${DEPLOY_DIR_IMAGE}/bootfiles/mem_coldboot_sigheader.bct.encrypt of=boot0.img seek=720896 bs=1 conv=notrunc
dd if=${DEPLOY_DIR_IMAGE}/bootfiles/mem_coldboot_sigheader.bct.encrypt of=boot0.img seek=925696 bs=1 conv=notrunc

# Although the device will boot fine, rtcpu may not run as expected unless
# we patch the boot blob to resemble entirely the one created during provisioning by the flashing tools.
# Example dmesg logs of this failure:
# tegra-hsp-mailbox ivc-bc00000.rtcpu: IOVM setup error: 110
# tegra186-cam-rtcpu bc00000.rtcpu: command: 0x00000000: empty mailbox timeout
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=557072 bs=1 count=32 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=560096 skip=32 bs=1 count=32 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=561168 skip=64 bs=1 count=32 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=562176 skip=96 bs=1 count=320 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=563536 skip=416 bs=1 count=320 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=587152 skip=736 bs=1 count=32 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=638992 skip=768 bs=1 count=32 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=642016 skip=800 bs=1 count=32 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=643088 skip=832 bs=1 count=32 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=644096 skip=864 bs=1 count=320 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=645456 skip=1184 bs=1 count=320 conv=notrunc
dd if=${WORKDIR}/${BOOT_BINDIFF} of=boot0.img seek=669072 skip=1504 bs=1 count=32 conv=notrunc

cp boot0.img ${DEPLOY_DIR_IMAGE}/bootfiles/
}

Expand Down

0 comments on commit 37c0021

Please sign in to comment.