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( !(regs[15] & 0x10) ) {
31 // RX Int hadn't fired
32 Debug("No IRQ %x %x", regs[15], regs[0]);
36 Serial_ByteReceived(gSerial_KernelDebugPort, ch);
39 void Debug_PutCharDebug(char ch)
42 Debug_PutCharDebug('\r');
44 volatile Uint32 *regs = (void*)UART0_BASE;
46 if( !giDebug_SerialInitialised ) {
47 regs[14] = 0x10; // Enable RX interrupt
48 regs[13] = (1<<1); // Set RX trigger to 1 byte
49 giDebug_SerialInitialised = 1;
52 #if PLATFORM_is_tegra2
54 while( !(regs[5] & (1 << 5)) )
58 // *(volatile Uint32*)(SERIAL_BASE + SERIAL_REG_DATA) = ch;
62 void Debug_PutStringDebug(const char *str)
65 Debug_PutCharDebug( *str );
68 void KernelPanic_SetMode(void)
72 void KernelPanic_PutChar(char ch)
74 // Debug_PutCharDebug(ch);
77 void StartupPrint(const char *str)