Speed of DTB processing vs "hard-coded" (on BBB)?

I'm working on reducing the boot time (power on to my C user code running) as much as possible. I've seen demonstrations of an RPi booting in under 1 second.

Does anyone have any idea how much overhead is introduced by the DTB processing? If I were to remove the DTB support in a custom kernel, and hard-code all the necessary peripherals, how much time could I theoretically shave off the boot?

It's probably not worth all that effort, but if DTB processing adds two seconds to the boot, it's worth considering. If the overhead is negligible compared to doing it without, that's valuable information, too.

Thanks,

I would think hard coding into the main DTB would add time. A couple ways to think about it would be you could theoretically in userspace after the board has booted. Then systemd is supposed to be better at parallel tasks when booting compared to SYSV. Which again could mean that keeping things seperate could lead to faster boot times.

With all that said. You could test it yourself. There is a systemd command that allows you to see how long things take to load during boot.

https://wiki.archlinux.org/index.php/Improve_boot_performance

Also I find it difficult in believing that the rPI can boot any faster than a BBB. That 1 second “boot time” was probably hibernate . . . suspend ram to disk, or whatever it is called on Linux.

Thanks, William. Yeah, it could be from hibernate, but I don't think so:

  https://www.youtube.com/watch?v=4Fjfqz6FxC8

And it looks like it's 3 seconds power-to-app. I can probably live with that.

Wouldn't you want to know how much time it takes before deciding
to reduce the time it takes.

Hence my question.

How long is your "power on to my C user code running"?

Forever. This is an embedded device that I'd like to be operational from power-on (it's not necessarily always powered). I don't want to make the user wait.

Rick, If we’re talking uboot-> executable, no Linux, you can probably do the same. One of the beagleboard.org google group community “liyoshi” I think had a Qt app booting in under 5 seconds too I think. It’s been a while since I’ve seen that post, and do not remember what topic is was under . . .

I’ll check that video in a bit though.

That's interesting. Unfortunately, while my primary app is a C program I wrote, I also (currently) rely on node.js to provide a configuration server. This server does NOT have to be up and running immediately.

However, an upcoming enhancement to my app will have it fetching data from the network (it currently stores it all locally), so WiFi has to connect as quickly as possible.

Seems like I'd have to write years of additional code if I have no Linux...

https://groups.google.com/forum/#!searchin/beagleboard/Qt$20boot/beagleboard/iOOM7utU1Nw/L67y8Qi7r9wJ

The video I was thinking of was actually an imx6 board. But liyaoshi says that 1 s boot times should be achievable. Scroll down to liyaoshi’s posts an see what he / she recommends for faster boots.

And as Robert Nelson points out towards the end of that post. there is also Falcon mode for uboot. Pretty much skips most of uboot, and goes straight into loading the kernel. How much time that will actually save ? dunno . . .

Awesome, thanks for the links!

btw, beyond u-boot's falcon mode. There is a lot of room for
improvement on the kernel side.

see:

https://lwn.net/Articles/645808/

Regards,