diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2007-04-27 15:50:03 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-29 21:02:04 -0400 |
commit | 8b01653ab01eebc781c5a375ff336d0837f30c4e (patch) | |
tree | f86e552eb7e1490dec344c1088b97fa03e7238a7 /arch/ppc/boot/simple | |
parent | 8c38fc2b7429b26105fe244890c8d5ab3043f099 (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/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc/boot/simple/uartlite_tty.c | 37 |
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 | |||
201 | endif | 201 | endif |
202 | boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o | 202 | boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o |
203 | boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o | 203 | boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o |
204 | boot-$(CONFIG_SERIAL_UARTLITE_CONSOLE) += uartlite_tty.o | ||
204 | 205 | ||
205 | LIBS := $(common)/lib.a $(bootlib)/lib.a | 206 | LIBS := $(common)/lib.a $(bootlib)/lib.a |
206 | ifeq ($(CONFIG_PPC_PREP),y) | 207 | ifeq ($(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 | |||
19 | void | ||
20 | serial_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 | |||
26 | unsigned char | ||
27 | serial_getc(unsigned long com_port) | ||
28 | { | ||
29 | while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) == 0); /* spin */ | ||
30 | return in_be32(UARTLITE_BASEADDR); | ||
31 | } | ||
32 | |||
33 | int | ||
34 | serial_tstc(unsigned long com_port) | ||
35 | { | ||
36 | return ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) != 0); | ||
37 | } | ||