Help with tegra2 hardware and early printing

15 views
Skip to first unread message

Sam King

unread,
Oct 31, 2011, 11:13:48 AM10/31/11
to Android Linux Kernel Development
Hello,

I am having trouble getting information out of my tegra2 (ventana)
system early in the boot sequence, which is making debugging some
early boot code I am working on nearly impossible. My code runs right
after the bootloader well before the MMU has been enabled. I tried
writing pixel valued directly to both of the video memory regions for
my platform, but nothing happend. Since fastboot prints some simple
messages to the screen I am assuming this is possible, I just can't
figure out how.

I also tried enabling the early boot 8250 driver and I tried writing
directly to the serial port myself using this code, any help is
appreciated:

#define FCR (2<<2)
#define IER (1<<2)
#define DLL 0
#define DLH (1<<2)
#define LCR (3<<2)
#define MCR (4<<2)
#define TX 0
#define LCR_DLAB 0x80

.global _reset
_reset:
/* physical serial port location, uses 8250 interface on
ventana board */
ldr r0, =0x70006300
/* 8n1 */
mov r1, #0x3
strb r1, [r0, #LCR]
/* interrupts off */
mov r1, #0
strb r1, [r0, #IER]
/* no fifo */
mov r1, #0
strb r1, [r0, #FCR]

/* 115200 baud rate, usbclk is 216000000 for ventana divisor
= 0x75 */
ldrb r1, [r0, #LCR]
orr r1, r1, #LCR_DLAB
strb r1, [r0, #LCR]
mov r1, #0x75
strb r1, [r0, #DLL]
mov r1, #0x0
strb r1, [r0, #DLH]
mov r1, #3
strb r1, [r0, #LCR]

/* Send an 'A' */
mov r1, #0x41
strb r1, [r0, #TX]

jagan

unread,
Nov 1, 2011, 3:14:02 AM11/1/11
to android...@googlegroups.com
For early boot logs, did you enabled required configs????

Regards,
Jagan.

Sam King

unread,
Nov 1, 2011, 6:44:52 AM11/1/11
to Android Linux Kernel Development
I did try using the earlycon kernel command line argument, but it did
not work.

It turns out that the version of fastboot that I am using uses a non-
standard (nvidia specific) atag value to pass the bootloader
framebuffer to the kernel. With this I can write to the screen.

Although I can write to the screen now I am curious as to why earlycon
did not work if anyone knows how to do this properly.

--Sam

jagan

unread,
Nov 1, 2011, 7:56:33 AM11/1/11
to android...@googlegroups.com
But even if earlycon works, you need to enable DEBUG_LL & respective DEBUG_UART &
you can pass earlyprintk=1 as a CMDLINE argument

Regards,
Jagan
Reply all
Reply to author
Forward
0 new messages