Early UART setup on 2.6 kernel for mpc85xx
Morrison, Tom
tmorrison at empirix.com
Mon Aug 13 21:09:40 EST 2007
>> In order to debug the kernel 2.6, I want setup serial port with
>> UART on mpc85xx as early as possible. I add the register access
>> code at the beginning of platform_init(). For example, I try
>> to write THR register(0xe0004500). However the system just
>> hanging there with this line.
<snip everything else>
If you are using a relatively new kernel like I am starting
up with - you don't need to add anything - you can use the
"Early Debugging/Early Console" which defines PPC_EARLY_DEBUG
You can find this in the kernel hacking options when you
go in and configure your linux kernel.
This causes the udbg serial driver to be initialized, and
99% of the early debug output is already put to the screen.
This hands the serial port over to the console driver later
on in the boot, and it works great (good job whoever wrote
this piece - more than a helpful tool!).
FWIW, you really can't debug the earliest init code
because most of that is in assembly. Get a JTAG emulator
(BDI or Lauterbach) and start stepping through.
Tom Morrison
More information about the Linuxppc-dev
mailing list