[PATCH 2/6] arm/imx6q: add core definitions and low-level debug uart

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Sep 7 10:23:50 EDT 2011


On Wed, Sep 07, 2011 at 02:36:35PM +0200, Uwe Kleine-König wrote:
> But only if the image doesn't support imx6q, right? Anyhow, I hope
> imx6q_map_io isn't called for pre-imx6q SoCs. Ah, and I hope we don't
> need to argue here as Russell doesn't like the new DEBUG_LL changes :-)

I have no problem with the Kconfig menu approach or existing approaches
to DEBUG_LL.  What I have an objection to is trying to stuff the
information for it into places which ultimately render the facility
useless for its intended purpose - to permit debugging the _really_
_early_ assembly code.

That is what it was written for: if we introduce complicated ways to
put behind it, we'll need to come up with a completely new debugging
infrastructure to debug the now buggered debugging infrastructure.

And then people will want to do the same to the debug debugging
infrastructure.  Then we'll have to invent the debug debugging debugging
infrastructure.  Repeat until you've nested it a million times.

It's supposed to be _simple_ and _obviously_ correct so that it _works_
with minimal fuss.  Making it complicated by picking out information
from device trees will kill that, and at that point its not worth keeping
around anymore.

Let me give you an instance: your kernel doesn't boot.  Early printk
doesn't work.  You want to find out if control is even getting to the
very first instruction in head.S.  You can do that with DEBUG_LL as it
stands today because we know exactly where the serial port is supposed
to be.

If you have to pick the DEBUG_LL information out of a DT, you can no
longer do that - you first have to obtain the pointer to DT, and then
parse the DT table to find out where the hell the port is.  What if
the reason your kernel isn't booting is because the DT pointer is
wrong?  What if the reason your kernel isn't booting is because the
information contained within DT is wrong?

How do you debug that?  You probably end up having to write your own
debugging infrastructure using a fixed address for the port.
Congratulations - you just reinvented what DEBUG_LL was designed to
be doing before someone came along and totally buggered it up.

The fact that DEBUG_LL is hard-coded to a certain port address is one
of its strongest points.  It means that if you know that the port
address is correct (which is a matter of looking at the SoCs data
sheets and confirming that the hex digits match) then you can be
reasonably sure that you're going to get some output from it.  No
need to wonder "Is the DT pointer correct?  Are we parsing DT
properly?" etc.

So, either we keep it in its current form or we throw it out from
mainline entirely and I keep it as a separate add-on patch for those
who want to use it.



More information about the linux-arm-kernel mailing list