Apalis Evaluation Board Rev 1.1 with TK1 Rev 1.2A
U-boot 2022.4 (but same issue with 2020.10 and toradex version 2019.7)
We have been using the TK1 SOM in our product using U-boot 2020.10 for some time. Now we want to move to booting using the SPL, leveraging it to implement an A/B choice for U-boot proper, and possibly add a recovery boot from usb.
The first naive attempt was to take the u-boot-spl.bin already built by our configuration(
defconfig (47.0 KB)
) and try to boot with that (after using cbootimage to include the BCT). Not only did that not work, but it did not even produce any output on boot.
Tracing the flow from arch/arm/cpu/armv7/start.S to arch/arm/lib/crt0.S and common/spl/spl.c there seems to be no board specific board_init_f() for the TK1. Whereas the one for uboot itself in common/board_f.c seems not to be used for SPL? Since it already prints the U-boot banner and initializes serial, which for SPL seems to be done in spl/spl.c(preloader_console_init()).
Using the generic board_init_f() by enabling CONFIG_SPL_FRAMEWORK_BOARD_INIT_F=y did not produce any output either.
As a next step I eliminated all code from the regular board_init_f() and minimized the device tree (u-boot.dts (3.2 KB)) to get a u-boot that is not “booting through” anymore, but is still capable of serial output. That code was then duplicated to a new board_init_f() in mach-tegra/spl.c and all dts nodes were tagged with u-boot,dm-spl; (u-boot-spl.dts (1.7 KB)). This did not produce any output either.
Since this started to feel like groping in the dark (while throwing stuff against a wall and (not) seeing what sticks…) it would be good if we can get at least some output working to see how far along the SPL actually gets. For this I tried to enable lowlevel debugging using:
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_LL_UART_8250=y
CONFIG_DEBUG_LL_INCLUDE=“debug/8250.S”
CONFIG_DEBUG_UART_PHYS=0x70006000
CONFIG_DEBUG_UART_VIRT=0x70006000
CONFIG_DEBUG_UART_8250_SHIFT=2
and added a few printascii() calls to the start of board_init_f() and in init_sequence_f. Testing this with normal U-boot (to go from a known working situation) produced no extra output.
Secondly I tried using the debug uart with:
CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_BASE=0x70006000
CONFIG_DEBUG_UART_CLOCK=408000000
CONFIG_DEBUG_UART_NS16550=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_ANNOUNCE=y
Again tested with normal U-boot, this killed all output.
There is also the option of using the pre console buffer (CONFIG_PRE_CONSOLE_BUFFER), but that does not really help, since in SPL the console is not working yet. (And it requires an address for the buffer (CONFIG_PRE_CON_BUF_ADDR), for which I am currently not sure what a safe/usable value would be.)
I also looked at using a gpio to control a led as a sign of first life, but it seems spl_gpio_output() is not implemented for the TK1?
I tested the above also using the stock tk1 defconfig (
defconfig-apalis-tk1 (46.1 KB)
) to make sure we did not break anything in our config, but that made no difference.
So with all that, we’re stuck at the moment. How do we get at least debug output over the uart to work? Or better yet, how do we get the SPL to at least a point that it has working serial output?