
On 02/12/2011 19:16, Simon Glass wrote:
It actually started as a last-ditch panic message printer. It morphed into the general pre-console putc after discussions on the list (with Graeme).
It can happen that your early board code does not know what clocks to use, or can't find a console, or some other critical error. It then calls panic() which silently dies or maybe reboots if you are lucky. This problem mostly comes about with device trees, where we must have certain info in the device tree before we can even get to relocation.
The idea is that boards provide a way of outputting characters which tries to work on all types of boards with that SOC. For example, they output the characters on all UARTs with various clock options, etc.
We use it on Tegra to print a friendly panic message when something is horribly wrong. In this case we will never make it to relocation so the pre-console buffer will not be displayed. So we can't rely on that.
I do not know if this mechanism can be used on other SOCs, but IMHO it does not hurt and it helps at least on Tegra, as you explained me.
Applied to u-boot-staging, sbabic@denx.de branch
Best regards, Stefano Babic