summaryrefslogtreecommitdiffstats
path: root/target/linux/amazon-2.6/files/arch/mips/amazon/prom.c
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2007-08-05 08:53:07 +0000
committerJohn Crispin <john@openwrt.org>2007-08-05 08:53:07 +0000
commitcb3d2ae6e2fcc84c63709de3e7ff1ee1f211a7ac (patch)
tree534f9680f6adc984816f0cafa3476dda7d254f9a /target/linux/amazon-2.6/files/arch/mips/amazon/prom.c
parent049dc2925bcd34d0a2df4c288aa9d014407708c0 (diff)
downloadmaster-31e0f0ae-cb3d2ae6e2fcc84c63709de3e7ff1ee1f211a7ac.tar.gz
master-31e0f0ae-cb3d2ae6e2fcc84c63709de3e7ff1ee1f211a7ac.tar.bz2
master-31e0f0ae-cb3d2ae6e2fcc84c63709de3e7ff1ee1f211a7ac.zip
cleaned up amazon serial and prom code
SVN-Revision: 8344
Diffstat (limited to 'target/linux/amazon-2.6/files/arch/mips/amazon/prom.c')
-rw-r--r--target/linux/amazon-2.6/files/arch/mips/amazon/prom.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/target/linux/amazon-2.6/files/arch/mips/amazon/prom.c b/target/linux/amazon-2.6/files/arch/mips/amazon/prom.c
index d60c3faa29..2947473ad0 100644
--- a/target/linux/amazon-2.6/files/arch/mips/amazon/prom.c
+++ b/target/linux/amazon-2.6/files/arch/mips/amazon/prom.c
@@ -1,6 +1,21 @@
/*
- * copyright 2007 john crispin <blogic@openwrt.org>
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright 2007 John Crispin <blogic@openwrt.org>
*/
+
#include <linux/init.h>
#include <linux/string.h>
#include <linux/ctype.h>
@@ -17,11 +32,11 @@
void prom_putchar(char c)
{
/* Wait for FIFO to empty */
- while (((*AMAZON_ASC_FSTAT) >> 8) != 0x00) ;
+ while ((amazon_readl(AMAZON_ASC_FSTAT) >> 8) != 0x00) ;
/* Crude cr/nl handling is better than none */
if(c == '\n')
- *AMAZON_ASC_TBUF=('\r');
- *AMAZON_ASC_TBUF=(c);
+ amazon_writel('\r', AMAZON_ASC_TBUF);
+ amazon_writel(c, AMAZON_ASC_TBUF);
}
void prom_printf(const char * fmt, ...)
@@ -32,7 +47,8 @@ void prom_printf(const char * fmt, ...)
char buf[1024];
va_start(args, fmt);
- l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */
+ /* FIXME - hopefully i < sizeof(buf) */
+ l = vsprintf(buf, fmt, args);
va_end(args);
buf_end = buf + l;