allow coexistance of N build and AC build.
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / arch / ppc / boot / simple / uartlite_tty.c
blob0eae1eab38d48b5bf07eb980d35ccb46dd8c226d
1 /*
2 * Xilinx UARTLITE bootloader driver
4 * Copyright (c) 2007 Secret Lab Technologies Ltd.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
12 #include <linux/types.h>
13 #include <asm/serial.h>
14 #include <asm/io.h>
15 #include <platforms/4xx/xparameters/xparameters.h>
17 #define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR))
19 void
20 serial_putc(unsigned long com_port, unsigned char c)
22 while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x08) != 0); /* spin */
23 out_be32(UARTLITE_BASEADDR + 0x4, c);
26 unsigned char
27 serial_getc(unsigned long com_port)
29 while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) == 0); /* spin */
30 return in_be32(UARTLITE_BASEADDR);
33 int
34 serial_tstc(unsigned long com_port)
36 return ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) != 0);