Why does my device tree overlay take so long to load?

I created a custom overlay to initialize all of the hardware on my custom cape. I have the following items: LCD, EHRPWM1A, DCAN1, I2C1, MCASP0, and UART2. My cape does not have an eeprom, so disabled the HDMI overlay and loaded mine instead. Somewhere around 0.25 seconds it begins loading my overlay. Somewhere around 5 seconds it coverts it to a live tree and applies the overlay. The eMMC overlay loads in a few milliseconds, whereas mine takes forever! I even tried moving mine to slot 0, and started ripping out fragments one by one, but it really did not improve it all that much. Even with only UART2 being loaded, it still took 2.5 seconds to apply the UART overlay.

What I am trying to accomplish is get the LCD up and running as quick as possible, but when it takes 5 seconds to apply the overlay it’s way too long. Ideally I would show a splash screen in u-boot, but right now I’m just trying to get a splash screen in the kernel before the login prompt is shown.

Any thoughts?

I hate doing this, but… bump.

I haven't worked with this specific issue, but from what I know your
choices are to either work on making the BeagleBone specific overlay
loading code work faster (probably hard if it's even possible) or to
just forget the overlay part and merge your device tree changes into the
static tree passed to the kernel at boot.

I'd personally recommend the second approach if you're worried about
boot times and have a stable hardware environment (ie: your cape is
always going to be installed). This is really what the device tree code
is meant to do (describe the hardware at boot time) vs. the "poor man's
hot-plug" that the BeagleBone folks seem to be trying to turn DT into.

Awesome, that’s exactly what I’m looking for. I’ll begin researching the static tree, but do you have any pointers? Do I just put my overlay inside the am335x-boneblack.dts file, or is there more to it?

The source for the device tree files is in the kernel source tree, but
you can extract the dts file from the compiled binary version on your
boot partition. Unlike the overlay files, a static device tree has no
"dangling pointer references", so you can easily go back and forth
between the human-readable and machine-compiled versions.

Note the original kernel source version of the DT has a hierarchy (lots
of files including other files) which can help explain how various
pieces fit together, but "decompiling" the DT on your boot partition
will present a "flattened" version with everything in one file.
Depending on exactly what you're wanting to look at, it may be easier to
understand using one version or the other, but they're both ultimately
the same.

Look through the device tree the system is booting with, and if you're
familiar with overlays it should be fairly obvious what you need to
change. Essentially, you want to merge in the changes that would be
made by your overlay and then convert to a binary dtb file you can boot
with. Take care, and I recommend you boot off an SD card while testing
(if you're not already). That way if you goof, you can replace/edit the
DTB file on the FAT partition of the SD card using a different system
and don't have to hassle with recovering the on-board eMMC if you make a
serious goof and wind up with a non-booting system.