19 #define UART_FCR_CLEAR_RCVR 0x02
20 #define UART_FCR_CLEAR_XMIT 0x04
23 #define UART_MCR_RTS 0x02
24 #define UART_MCR_DTR 0x01
25 #define UART_LCR_DLAB 0x80
26 #define UART_LCR_WLEN8 0x03
28 static int virtex_ns16550_console_init(
void *devp)
30 unsigned char *reg_base;
31 u32 reg_shift, reg_offset,
clk, spd;
38 n = getprop(devp,
"reg-offset", ®_offset,
sizeof(reg_offset));
39 if (n ==
sizeof(reg_offset))
40 reg_base += reg_offset;
42 n = getprop(devp,
"reg-shift", ®_shift,
sizeof(reg_shift));
43 if (n !=
sizeof(reg_shift))
46 n = getprop(devp,
"current-speed", (
void *)&spd,
sizeof(spd));
51 n = getprop(devp,
"clock-frequency", (
void *)&clk,
sizeof(clk));
55 divisor = clk / (16 * spd);
85 devp = finddevice(
"/chosen");
89 if (getprop(devp,
"linux,stdout-path", path,
MAX_PATH_LEN) > 0) {
90 devp = finddevice(path);
94 if ((getprop(devp,
"device_type", devtype,
sizeof(devtype)) > 0)
95 && !
strcmp(devtype,
"serial")
97 virtex_ns16550_console_init(devp);