Commit Graph

71 Commits

Author SHA1 Message Date
Matt Madison
fa83834fdc tegra-flash-init: update variable name
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>
2024-09-14 05:27:15 -07:00
Kurt Kiefer
2ba2294c45 tegra-flash-init: use usb configuration state for connection status
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>
2024-09-05 06:30:55 -07:00
Stefan Schorr
716714ae34 initrd-flash: Add custom extra-pre-wipe
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>
2024-08-16 13:09:01 -07:00
Matt Madison
8df401bd44 tegra-minimal-initramfs: add ucsi-ccg module to initramfs
needed for booting from at least some types of USB storage devices.

Signed-off-by: Matt Madison <matt@madison.systems>
2024-06-16 13:47:18 -07:00
Matt Madison
8f9efcd3c0 tegra-flash-init: make machine-specific
since we now have a dependency on a machine-specific variable.

Signed-off-by: Matt Madison <matt@madison.systems>
2024-06-11 14:25:04 -07:00
Pavel Löbl
105532880b tegra-flash-init: derive mtd name from OTABOOTDEV variable
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>
2024-06-11 14:21:28 -07:00
Matt Madison
e4667a53af tegra-initrd-flash-initramfs: remove graphics console from kernel command line
Signed-off-by: Matt Madison <matt@madison.systems>
2024-05-31 09:57:00 -07:00
Matt Madison
14c20def2e tegra-minimal-initramfs: include some drivers
Just a minimal set, mainly to support booting off NVMe.

Signed-off-by: Matt Madison <matt@madison.systems>
2024-05-30 12:13:39 -07:00
Matt Madison
218dfb2d9f tegra-initrd-flash-initramfs: add 'essential' machine packages
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>
2024-05-30 12:13:39 -07:00
Matt Madison
106d558853 initrdscripts: updates for L4T R36.3
* 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>
2024-05-30 12:13:39 -07:00
Matt Madison
742f465849 meta: fix unpack warnings from recipes with only in-tree files
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>
2024-05-29 06:15:10 -07:00
Matt Madison
614c2510a9 meta: update all recipes for the UNPACKDIR transition
* 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>
2024-05-28 06:53:54 -07:00
mci
a59987982d initrd-flash: Add custom extra init
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>
2024-04-27 03:19:44 -07:00
Matt Madison
d247268438 nativesdk-packagegroup-cuda-sdk-host: use inherit_defer
to eliminate the build-time warning about the nativesdk class
not being inherited last.

Signed-off-by: Matt Madison <matt@madison.systems>
2024-01-20 06:19:19 -08:00
Matt Madison
7bd22255e5 systemd: drop bbappend
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>
2023-08-20 08:35:43 -07:00
Matt Madison
6b32272a2d Revert "systemd: update bbappend to fix dependency for efi"
This reverts commit b70f2c34e2.
No longer needed since the upstream recipe has been fixed.

Signed-off-by: Matt Madison <matt@madison.systems>
2023-08-18 10:34:55 -07:00
Matt Madison
b70f2c34e2 systemd: update bbappend to fix dependency for efi
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>
2023-08-04 06:11:15 -07:00
Matt Madison
56e0e9ba94 gcc-for-nvcc: update to gcc 10.3.0
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>
2023-07-22 09:31:47 -07:00
Ming Liu
512eab93cf tegra-minimal-init: fix some invalid loop conditions
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>
2023-07-21 04:19:26 -07:00
Ming Liu
e6ab46b6c4 tegra-minimal-init: fix inconsistent indentions
Use blank space instead TAB everythere.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2023-07-21 04:19:26 -07:00
Ming Liu
7cdef334a1 tegra-minimal-init:platform-preboot.sh: also handle rootfstype
Otherwise it might be missed in init-boot.sh.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2023-07-21 04:19:26 -07:00
Ming Liu
91fa40401f tegra-minimal-init:platform-preboot.sh: support more bootdev types
Support more bootdev types: UUID, PARTUUID, PARTLABEL, LABEL.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2023-07-21 04:19:26 -07:00
Ming Liu
56ed0e78f6 tegra-minimal-init: dont assume boot device /dev/mmcblk0p1
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>
2023-07-21 04:19:26 -07:00
Ming Liu
703e84d39e tegra-minimal-init:platform-preboot.sh: avoid unecessarily boot delay
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>
2023-07-21 04:19:26 -07:00
Matt Madison
75960efc44 meta: rework image name usage for IMAGE_NAME_SUFFIX changes
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>
2023-07-04 07:51:51 -07:00
Jose Quaresma
11f04524bf tegra-flash-reboot: fix build with clang 16
| /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>
2023-03-22 08:36:12 -07:00
Matt Madison
ee3094f7bc tegra-flash-init: add erase-nvme command
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>
2023-02-08 03:14:00 -08:00
Matt Madison
511be2ce57 tegra-initrd-flash-initramfs: use initrd-flash fstype
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>
2023-01-17 07:56:09 -08:00
Matt Madison
cd194fdd43 tegra-flash-init: add BCT redundant copies to mmcblk0boot0 writes
in the program-boot-device script.

Signed-off-by: Matt Madison <matt@madison.systems>
2023-01-10 07:44:12 -08:00
Matt Madison
cda6115e56 tegra-flash-init: add dump of partition table to logs
to help with debugging layout mismatch problems in case
of an error.

Signed-off-by: Matt Madison <matt@madison.systems>
2023-01-02 11:22:47 -08:00
Matt Madison
31912882e9 tegra-minimal-init: add retries for locating APP partition label
When booting off a USB storage device, we need to give the kernel time
to probe the device.

Signed-off-by: Matt Madison <matt@madison.systems>
2022-12-30 03:20:20 -08:00
Matt Madison
1471257ca0 tegra-initrd-flash-initramfs: add recipe
for building the initrd used for initrd-based flashing.

Signed-off-by: Matt Madison <matt@madison.systems>
2022-12-30 03:20:20 -08:00
Matt Madison
5e23c6117b tegra-flash-init: add recipe for supporting initrd flashing
* 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>
2022-12-30 03:20:20 -08:00
Matt Madison
72124d7edf tegra-flash-reboot: add recipe
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>
2022-12-30 03:20:20 -08:00
Matt Madison
d00be8a344 tegra-minimal-init: add delay and retry when looking up partition label
Another workaround for SDcard-based systems.

Signed-off-by: Matt Madison <matt@madison.systems>
2022-09-05 13:54:07 -07:00
Matt Madison
dfd707a9f1 tegra-minimal-init: add retry loop for rootfs mount
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>
2022-09-05 13:54:07 -07:00
Matt Madison
952564246b tegra-minimal-init: fix boot chain variable check
to use BootChainOsCurrent, rather than BootChainFwCurrent.

Signed-off-by: Matt Madison <matt@madison.systems>
2022-09-05 13:54:07 -07:00
Matt Madison
164ce0d6ed tegra-minimal-init: support L4T UEFI boot chain variable
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>
2022-09-05 13:54:07 -07:00
Matt Madison
d49e397067 tegra-minimal-init: drop references to platform-preboot-cboot script
which was dropped in an earlier commit.

Signed-off-by: Matt Madison <matt@madison.systems>
2022-09-05 13:54:07 -07:00
Matt Madison
3a26a95c2d systemd: add bbappend
to enable EFI support on tegra platforms.

Signed-off-by: Matt Madison <matt@madison.systems>
2022-09-05 13:54:07 -07:00
Matt Madison
d6ab45616a tegra-minimal-init: clean up for L4T R35.1.0
The preboot script is common now, and always needs
util-linux-blkid.

Signed-off-by: Matt Madison <matt@madison.systems>
2022-09-05 13:54:07 -07:00
Matt Madison
7609c09739 packagegroups: add CUDA-gcc toolchain to SDK packagegroups
for tegra platforms.

Signed-off-by: Matt Madison <matt@madison.systems>
2021-12-16 10:04:11 -08:00
Matt Madison
b9507ceb23 meta: convert to new override syntax
* 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>
2021-08-03 08:27:55 -07:00
Matt Madison
7a8cf920b0 tegra-minimal-initramfs: add temporary workaround for hashing issue
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>
2020-10-20 06:32:37 -07:00
Matt Madison
24e1922b7f busybox: make modifications tegra-specific
and package it separately for tegra, too.

Signed-off-by: Matt Madison <matt@madison.systems>
2020-07-27 04:12:06 -07:00
Bryan Cisneros
4d33518fe7 tegra-minimal-init: add platform-pre-switchroot
Optionally run any custom initialization just before
switching the rootfs.
2020-07-23 03:15:32 -07:00
Matt Madison
fbc7101405 psplash: remove patch
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>
2020-06-08 07:55:59 -07:00
Matt Madison
1253d508bd packagegroup-base: update bbappend
to add tegra-wifi to packagegroup-base-wifi on tegra
platforms.

Signed-off-by: Matt Madison <matt@madison.systems>
2020-05-22 11:21:40 -07:00
shlomow
98c2d13c49 tegra-minimal-init: add support for rootfstype kernel param when mounting rootfs 2020-05-12 13:31:24 -07:00
Matt Madison
1fe286e748 systemd-conf: remove bbappend and wired.network override
The interoperability issue with the Ethernet driver
and LLDP appears to be resolved.

Signed-off-by: Matt Madison <matt@madison.systems>
2020-04-26 08:42:42 -07:00