January 21, 2025

Antminer S9 board - U-boot, find main, follow execution

I am (at this point) primarily concerned with the SPL, but there is a large amount of code sharing between the SPL and full U-boot, so all of this will be useful in any case.

The game starts in arch/arm/cpu/armv7/start.S

This calls _main in short order. This is in arch/arm/lib/crt0.S. This file has a big comment describing many important things that is worth reading (and rereading). It will ultimately call board_init_r().

There are 1000 or more instances of board_init_r() in the U-boot sources. What I found useful was to look at spl/u-boot-spl.map which directs me to "common/spl/spl.c". This is our first C code. We are now able to use ctags somewhat effectively.

It does contain multiple calls to puts() and printf(), so where does the uart get initialized?


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org