-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 162823 b: refs/heads/master c: f6a2740 h: refs/heads/master i: 162821: f6b3d51 162819: 9075afe 162815: 78e05b1 v: v3
- Loading branch information
Wu Zhangjin
authored and
Ralf Baechle
committed
Sep 17, 2009
1 parent
dd2881a
commit 447b2aa
Showing
3 changed files
with
47 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 95ff7c955376d5bd52f044f445ea04eab4fb0f9a | ||
refs/heads/master: f6a2740d0c1b3fd0d3cc8ec17e232f82f2d8b14c |
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,41 @@ | ||
/* early printk support | ||
* | ||
* Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca> | ||
* Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology | ||
* Author: Wu Zhangjin, wuzj@lemote.com | ||
* | ||
* 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/io.h> | ||
#include <linux/init.h> | ||
#include <linux/serial_reg.h> | ||
|
||
#include <asm/mips-boards/bonito64.h> | ||
|
||
#define UART_BASE (BONITO_PCIIO_BASE + 0x3f8) | ||
|
||
#define PORT(base, offset) (u8 *)(base + offset) | ||
|
||
static inline unsigned int serial_in(phys_addr_t base, int offset) | ||
{ | ||
return readb(PORT(base, offset)); | ||
} | ||
|
||
static inline void serial_out(phys_addr_t base, int offset, int value) | ||
{ | ||
writeb(value, PORT(base, offset)); | ||
} | ||
|
||
void prom_putchar(char c) | ||
{ | ||
phys_addr_t uart_base = | ||
(phys_addr_t) ioremap_nocache(UART_BASE, 8); | ||
|
||
while ((serial_in(uart_base, UART_LSR) & UART_LSR_THRE) == 0) | ||
; | ||
|
||
serial_out(uart_base, UART_TX, c); | ||
} |