With 2ba2294c45, we
now use 'configured' instead of 'suspended', but
missed updating the declaration of the variable
within the functions that use it.
Signed-off-by: Matt Madison <matt@madison.systems>
When a device is enumerated by the host, its usb configuration state
changes to positively identify that it is ready to go. Conversely,
when it is powered down, its configuration state indicates that it
is no longer in that ready ('configured') state.
A side effect of the power saving for the USB peripheral would change
the device into a suspended state if it is not configured, but this
mechanism does not work reliably on the Orin AGX devkit.
Additionally, the gadget device sysfs node changed from a single
/UDC/device/gadget function to /UDC/device/gadget.# in kernels newer
than the current L4T 5.15, breaking the previous method for newer
kernels.
Use this more direct method of determining if the usb host is using
the device so it will work across various platforms as well as kernel
versions.
Signed-off-by: Kurt Kiefer <kekiefer@gmail.com>
This introduces a hook to the initrd-flash script which makes it
possible to run custom scripts before erasing the storage disk
via "erase-nvme" or overwriting it via "export-devices".
Note: There exists already an "extra" hock to run future scripts
before the final reboot step. Similar to that, any future recipe
intended to add custom extra pre-wipe scripts can use the
TEGRA_INITRD_FLASH_INSTALL variable in the distro config to add
the new package(s).
Furthermore, note that these custom scripts will need to be
installed with executable permission set in the
/init_extra-pre-wipe.d folder of the tegraflash initrd image.
Signed-off-by: Stefan Schorr <stefan.schorr@cognex.com>
On custom board the QSPI flash can be under different name
(like mtd1). Instead hardcoding mtd0 we derive the mtd device
name from OTABOOTDEV variable already specified in machine
files.
Signed-off-by: Pavel Löbl <pavel@loebl.cz>
Drivers that are generally always needed are included in the
MACHINE_ESSENTIAL_EXTRA_* variables, so just include these in the
initrd-flash image.
Signed-off-by: Matt Madison <matt@madison.systems>
* More drivers are now kernel modules
* Switch from ECID to module serial number for
forming USB device ID when flashing
Signed-off-by: Matt Madison <matt@madison.systems>
There is now a check that ${S} exists after running do_unpack.
The convention for recipes with only local in-tree files is
to define S and point UNPACKDIR at the same directory. All
such recipes are updated to use this convention.
Signed-off-by: Matt Madison <matt@madison.systems>
* No more 'S = "${WORKDIR}"', which is not permitted
* All ${WORKDIR} references for local files updated to ${UNPACKDIR}
* Custom do_unpack for the recipes that are in the public_sources
archive in the BSP adjusted for the new unpacking approach
* Some SRC_URIs updated with 'destsuffix=' parameters where needed
Signed-off-by: Matt Madison <matt@madison.systems>
This makes it possible for extra custom steps to take before the final reboot step of the initrd flashing process.
A new recipe can use the TEGRA_INITRD_FLASH_INSTALL variable in the distro config, to add the new package(s) that provides the custom extra init steps.
Note that these scripts needs to be installed with execution permition, in the /init_extra.d folder of the tegraflash initrd image.
Signed-off-by: Michael Christensen <msc95@hotmail.dk>
The latest systemd's EFI support assumes you're using the systemd EFI stub
when booting, which we aren't, so drop the bbappend that turns it on.
Signed-off-by: Matt Madison <matt@madison.systems>
A temporary workaround until the systemd recipe in OE-Core
is fixed to correct the build-time dependency in PACKAGECONFIG[efi].
Signed-off-by: Matt Madison <matt@madison.systems>
imported from OE-Core hardknott, and rename the
recipes to be 'gcc-for-nvcc' instead of including
a repeat of the major version number.
Signed-off-by: Matt Madison <matt@madison.systems>
There is no count++ logic when mounting root device fails, so it will
hang which is certainly wrong, fix it.
When "rootwait" kernel parameter is being used, it should wait for root
device present infinitely.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Dont assume boot device is /dev/mmcblk0p1, there is a variable
TNSPEC_BOOTDEV in machine conf is for that purpose, use that.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
When foundslotsfx is not set true, it does not have to wait for
APP$slotsfx partition, that can delay the boot.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
OE-Core has reworked how the IMAGE_NAME and IMAGE_NAME_SUFFIX
variables are used - the suffix now gets embedded in IMAGE_NAME.
To account for this, adjust the tegra-specific image bbclasses
to drop ${IMAGE_NAME_SUFFIX} references, and adjust the recipes
for the ESP and initrd images to nullify IMAGE_NAME_SUFFIX, since
we don't really want '.rootfs' in the resultant artifact names
in those cases.
Signed-off-by: Matt Madison <matt@madison.systems>
| /build/tmp/work/armv8a_tegra-lmp-linux/tegra-flash-reboot/1.0-r0/reboot-recovery.c:8:15: error: call to undeclared function 'syscall'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
| return (int) syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, arg);
| ^
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
to allow the user to wipe an attached NVMe drive if switching
back to booting from internal storage during initrd flashing.
Signed-off-by: Matt Madison <matt@madison.systems>
The initrd-flash kernel/initrd image has to be the Android
(cboot-style) image type, and now that we have a separate
variable in the machine configs to specify that, use that
variable to set INITRAMFS_FSTYPES in the recipe.
Signed-off-by: Matt Madison <matt@madison.systems>
* Booted via RCM boot process, running entirely within
the initramfs
* Accepts command sequence from host for handling specific
flashing steps
* Programs boot device (SPI flash or mmcblk0bootX devices)
from signed binaries sent from host
* Exports storage devices via USB gadget to host for
partitioning/writing
Signed-off-by: Matt Madison <matt@madison.systems>
to provide a small utility to reboot into recovery mode,
which can't be done with busybox's reboot command.
Signed-off-by: Matt Madison <matt@madison.systems>
On SDcard-based systems (e.g., Xavier NX devkit), even after
/dev/mmcblk0p1 shows up in the filesystem, you can get a mount
failure because it's not fully ready. For now, just try it
up to 5 times with a 1 second delay between tries to work around
this.
Signed-off-by: Matt Madison <matt@madison.systems>
Stock L4T puts a different 'root=' setting into the kernel image
in the two kernel partitions and/or writes the extlinux.conf differently
based on which slot is being updated. To avoid having to do that,
and since the bootloader itself doesn't update the kernel command line
to indicate which boot chain we should be using, parse the
BootChainFwCurrent EFI variable to make that determination instead.
Signed-off-by: Matt Madison <matt@madison.systems>
* Ran convert-overrides.py to generate the initial changes
* Manual cleanup afterwards (which was a lot, due to our
extensive use of overrides).
Signed-off-by: Matt Madison <matt@madison.systems>
The combination of hashequiv and the improved pseudo tracking
in OE-Core prevents the enabling of sstate packages for the
initramfs image. Temporarily work around these failures by
overriding the hash reporting function until something better
is worked out.
Signed-off-by: Matt Madison <matt@madison.systems>
Patches for the issues with FBIO_WAITFORVSYNC and FBIOPAN_DISPLAY
have been applied to the kernel, so this patch is no longer needed.
Signed-off-by: Matt Madison <matt@madison.systems>