aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/boot/simple
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-04-27 15:50:03 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 21:02:04 -0400
commit8b01653ab01eebc781c5a375ff336d0837f30c4e (patch)
treef86e552eb7e1490dec344c1088b97fa03e7238a7 /arch/ppc/boot/simple
parent8c38fc2b7429b26105fe244890c8d5ab3043f099 (diff)
[POWERPC] Add uartlite boot console driver for the zImage wrapper
Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc/boot/simple')
-rw-r--r--arch/ppc/boot/simple/Makefile1
-rw-r--r--arch/ppc/boot/simple/uartlite_tty.c37
2 files changed, 38 insertions, 0 deletions
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index bcfb6cde70c4..5b877792d14f 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -201,6 +201,7 @@ boot-$(CONFIG_8260) += m8260_tty.o
201endif 201endif
202boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o 202boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o
203boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o 203boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o
204boot-$(CONFIG_SERIAL_UARTLITE_CONSOLE) += uartlite_tty.o
204 205
205LIBS := $(common)/lib.a $(bootlib)/lib.a 206LIBS := $(common)/lib.a $(bootlib)/lib.a
206ifeq ($(CONFIG_PPC_PREP),y) 207ifeq ($(CONFIG_PPC_PREP),y)
diff --git a/arch/ppc/boot/simple/uartlite_tty.c b/arch/ppc/boot/simple/uartlite_tty.c
new file mode 100644
index 000000000000..0eae1eab38d4
--- /dev/null
+++ b/arch/ppc/boot/simple/uartlite_tty.c
@@ -0,0 +1,37 @@
1/*
2 * Xilinx UARTLITE bootloader driver
3 *
4 * Copyright (c) 2007 Secret Lab Technologies Ltd.
5 *
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.
10 */
11
12#include <linux/types.h>
13#include <asm/serial.h>
14#include <asm/io.h>
15#include <platforms/4xx/xparameters/xparameters.h>
16
17#define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR))
18
19void
20serial_putc(unsigned long com_port, unsigned char c)
21{
22 while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x08) != 0); /* spin */
23 out_be32(UARTLITE_BASEADDR + 0x4, c);
24}
25
26unsigned char
27serial_getc(unsigned long com_port)
28{
29 while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) == 0); /* spin */
30 return in_be32(UARTLITE_BASEADDR);
31}
32
33int
34serial_tstc(unsigned long com_port)
35{
36 return ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) != 0);
37}