Early UART setup on 2.6 kernel for mpc85xx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines
Quoted 5 lines
In order to debug the kernel 2.6, I want setup serial port with=20 UART on mpc85xx as early as possible. I add the register access=20 code at the beginning of
platform_init(). For example, I try=20 to write THR register(0xe0004500). However the system just=20 hanging there with this line.
<snip everything else>
If you are using a relatively new kernel like I am starting=20 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=20 go in and configure your linux kernel.
This causes the udbg serial driver to be initialized, and=20 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=20 because most of that is in assembly. Get a JTAG emulator (BDI or Lauterbach) and start stepping through.
Tom Morrison
Quoted 5 lines · Tom
Quoted 5 lines
Quoted 5 lines
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.
Make sure there's a mapping in the TLB for that address.
Quoted 3 lines
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.
It's quite possible to debug assembly code without JTAG. :-)
-Scott
On the other side of early_debug...
In reply to a message not in the archiveIt looks like I am getting up to the point where the=20 rootfs has been NFS mounted correctly. Whew, but the first thing the INIT program does it try to open the /dev/console device - and it goes oops:
Quoted 6 lines
Quoted 6 lines
kernel BUG at
drivers/char/tty_io.c:781!Oops: Exception in kernel mode, sig: 5 [#1] Empirix MPC848 Cheetah Board Modules linked in: NIP: c01390d4 LR: c013abe4 CTR: 00000000 REGS: effc3d50 TRAP: 0700 Not tainted
(2.6.23-r3_tom-g46b28357-dirty)
Quoted 10 lines
Quoted 9 lines
MSR: 00021000 <ME> CR: 24242422 XER: 00000000
TASK =3D effc1a80[1] 'init' THREAD:effc2000
GPR00: 00000001effc3e00effc1a8000000000effc3de000000001 00000000
c02b60c8
GPR08:00001aa300000000c030b73000000000 222424221001f2f8fffffff0
007fff94
GPR16: 20000000 00000000 00000000effc3e30c17c2528c17c253000000130
Quoted 15 lines
Quoted 13 lines
00000128
GPR24:c02c000000000001 00000001 00000000 00000000 00029000c17c2400
00000001
NIP [c01390d4]tty_ldisc_put+0x44/0x70
LR [c013abe4]release_dev+0x4ec/0x6a0Call Trace: [effc3e00] [c021d800] __mutex_unlock_slowpath+0x40/0xd4 (unreliable) [effc3e20] [c013abe4] release_dev+0x4ec/0x6a0 [effc3ee0] [c013adac] tty_release+0x14/0x28 [effc3ef0] [c0068844] __fput+0x178/0x19c [effc3f10] [c0066a5c] filp_close+0x54/0xac [effc3f30] [c0066b34] sys_close+0x80/0xc0 [effc3f40] [c000c54c] ret_from_syscall+0x0/0x3cQuoted 2 lines
Instruction dump:
7c0001107c0000d00f0000007fa000a67c0001461d43004c3d20c031
3929b730
Quoted 1 line
Quoted 1 line
7d4a4a14816a0048212b00007c095914<0f000000>396bffff806a0044
916a0048
Now, it seems the root cause is that the tty's=20 console_init was NEVER being called.=20
I am wondering if there was a reason or rhyme for this?