7b9e55dd79e242708f7550e54d7cfa6321df2649
[tpg/acess2.git] / Kernel / arch / armv7 / debug.c
1 /**
2  * Acess2
3  * - By John Hodge (thePowersGang)
4  *
5  * arch/arm7/debug.c
6  * - ARM7 Debug output
7  * NOTE: Currently designed for the realview-pb-a8 emulated by Qemu
8  */
9 #include <acess.h>
10
11 // === CONSTANTS ===
12 //#define UART0_BASE    0x10009000
13 #define UART0_BASE      0xF1000000      // Boot time mapped
14
15 // === PROTOTYPES ===
16 void    KernelPanic_SetMode(void);
17 void    KernelPanic_PutChar(char Ch);
18 void    StartupPrint(const char *str);
19
20 // === GLOBALS ===
21  int    giDebug_SerialInitialised = 0;
22
23 // === CODE ===
24 void Debug_PutCharDebug(char ch)
25 {
26         if(ch == '\n')
27                 Debug_PutCharDebug('\r');
28
29         #if PLATFORM_is_tegra2
30         // Tegra2
31         while( !(*(volatile Uint32*)(UART0_BASE + 0x14) & (1 << 5)) )
32                 ;
33         #endif
34         
35 //      *(volatile Uint32*)(SERIAL_BASE + SERIAL_REG_DATA) = ch;
36         *(volatile Uint32*)(UART0_BASE) = ch;
37 }
38
39 void Debug_PutStringDebug(const char *str)
40 {
41         for( ; *str; str++ )
42                 Debug_PutCharDebug( *str );
43 }
44
45 void KernelPanic_SetMode(void)
46 {
47 }
48
49 void KernelPanic_PutChar(char ch)
50 {
51 //      Debug_PutCharDebug(ch);
52 }
53
54 void StartupPrint(const char *str)
55 {
56 }
57

UCC git Repository :: git.ucc.asn.au