forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[POWERPC] Add uartlite boot console driver for the zImage wrapper
Signed-off-by: Grant Likely <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
- Loading branch information
1 parent
8c38fc2
commit 8b01653
Showing
3 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Xilinx UARTLITE bootloader driver | ||
* | ||
* Copyright (c) 2007 Secret Lab Technologies Ltd. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#include <linux/types.h> | ||
#include <asm/serial.h> | ||
#include <asm/io.h> | ||
#include <platforms/4xx/xparameters/xparameters.h> | ||
|
||
#define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR)) | ||
|
||
void | ||
serial_putc(unsigned long com_port, unsigned char c) | ||
{ | ||
while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x08) != 0); /* spin */ | ||
out_be32(UARTLITE_BASEADDR + 0x4, c); | ||
} | ||
|
||
unsigned char | ||
serial_getc(unsigned long com_port) | ||
{ | ||
while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) == 0); /* spin */ | ||
return in_be32(UARTLITE_BASEADDR); | ||
} | ||
|
||
int | ||
serial_tstc(unsigned long com_port) | ||
{ | ||
return ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) != 0); | ||
} |