3 * - By John Hodge (thePowersGang)
7 * NOTE: Currently designed for the realview-pb-a8 emulated by Qemu
11 #include <drv_serial.h>
14 //#define UART0_BASE 0x10009000
15 #define UART0_BASE 0xF1000000 // Boot time mapped
18 void Debug_int_SerialIRQHandler(int IRQ, void *unused);
19 void KernelPanic_SetMode(void);
20 void KernelPanic_PutChar(char Ch);
21 void StartupPrint(const char *str);
24 int giDebug_SerialInitialised = 0;
27 void Debug_int_SerialIRQHandler(int IRQ, void *unused)
29 volatile Uint32 *regs = (void*)UART0_BASE;
30 #if PLATFORM_is_realview_pb
31 if( !(regs[15] & 0x10) ) {
33 if( !(regs[5] & 1) ) {
35 // RX Int hadn't fired
36 Debug("No IRQ %x %x", regs[15], regs[0]);
40 Serial_ByteReceived(gSerial_KernelDebugPort, ch);
43 void Debug_PutCharDebug(char ch)
46 Debug_PutCharDebug('\r');
48 volatile Uint32 *regs = (void*)UART0_BASE;
50 if( !giDebug_SerialInitialised ) {
51 #if PLATFORM_is_tegra2
52 // 16550 (i.e. PC) compatible
53 regs[1] = 5; // Enable RX interrupt
55 regs[14] = 0x10; // Enable RX interrupt
56 regs[13] = (1<<1); // Set RX trigger to 1 byte
58 giDebug_SerialInitialised = 1;
61 #if PLATFORM_is_tegra2
63 while( !(regs[5] & (1 << 5)) )
70 void Debug_PutStringDebug(const char *str)
73 Debug_PutCharDebug( *str );
76 void KernelPanic_SetMode(void)
80 void KernelPanic_PutChar(char ch)
82 // Debug_PutCharDebug(ch);
85 void StartupPrint(const char *str)