3 * Debug routines which directly access the uart.
6 #include <linux/types.h>
7 #include <asm/gt64120.h>
10 //#define SERIAL_BASE EV96100_UART0_REGS_BASE
11 #define SERIAL_BASE 0xBD000020
12 #define NS16550_BASE SERIAL_BASE
15 #define SERA_DATA 0x08
16 //#define SERB_CMD 0x05
18 #define SERB_DATA 0x00
21 #define TIMEOUT 0xffff
24 static const char digits
[16] = "0123456789abcdef";
25 static volatile unsigned char *const com1
= (unsigned char *) SERIAL_BASE
;
29 static inline void slow_down()
32 for (k
= 0; k
< 10000; k
++);
38 void putch(const unsigned char c
)
50 } while (0 == (ch
& TX_BUSY
));
54 void putchar(const unsigned char c
)
66 } while (0 == (ch
& TX_BUSY
));
70 void puts(unsigned char *cp
)
83 } while (0 == (ch
& TX_BUSY
));
84 com1
[SERB_DATA
] = *cp
++;
90 void fputs(unsigned char *cp
)
104 } while (0 == (ch
& TX_BUSY
));
105 com1
[SERB_DATA
] = *cp
++;
110 void put64(uint64_t ul
)
115 cnt
= 16; /* 16 nibbles in a 64 bit long */
120 ch
= (unsigned char) (ul
>> cnt
* 4) & 0x0F;
125 void put32(unsigned u
)
130 cnt
= 8; /* 8 nibbles in a 32 bit long */
135 ch
= (unsigned char) (u
>> cnt
* 4) & 0x0F;