X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Farch%2Farmv7%2Fdebug.c;h=78746f177bbbd9b12b8905a1d30f5d4b33ed55ea;hb=71402d670b1de4f4db7c1768e92ac1f723b51d9a;hp=dd87e7ee435df083b4baabee8ae1205a4b0c7daa;hpb=25398a7f24d189ee7a70fcf0e64827cbc8999028;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/arch/armv7/debug.c b/KernelLand/Kernel/arch/armv7/debug.c index dd87e7ee..78746f17 100644 --- a/KernelLand/Kernel/arch/armv7/debug.c +++ b/KernelLand/Kernel/arch/armv7/debug.c @@ -9,6 +9,7 @@ */ #include #include +#include // === CONSTANTS === //#define UART0_BASE 0x10009000 @@ -27,7 +28,11 @@ void StartupPrint(const char *str); void Debug_int_SerialIRQHandler(int IRQ, void *unused) { volatile Uint32 *regs = (void*)UART0_BASE; + #if PLATFORM_is_realview_pb if( !(regs[15] & 0x10) ) { + #else + if( !(regs[5] & 1) ) { + #endif // RX Int hadn't fired Debug("No IRQ %x %x", regs[15], regs[0]); return ; @@ -44,8 +49,13 @@ void Debug_PutCharDebug(char ch) volatile Uint32 *regs = (void*)UART0_BASE; if( !giDebug_SerialInitialised ) { + #if PLATFORM_is_tegra2 + // 16550 (i.e. PC) compatible + regs[1] = 5; // Enable RX interrupt + #else regs[14] = 0x10; // Enable RX interrupt regs[13] = (1<<1); // Set RX trigger to 1 byte + #endif giDebug_SerialInitialised = 1; } @@ -55,7 +65,6 @@ void Debug_PutCharDebug(char ch) ; #endif -// *(volatile Uint32*)(SERIAL_BASE + SERIAL_REG_DATA) = ch; regs[0] = ch; } @@ -78,3 +87,8 @@ void StartupPrint(const char *str) { } +void Proc_PrintBacktrace(void) +{ + // TODO: Print backtrace +} +