Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/allwinner Make early console work on big endian...



details:   https://anonhg.NetBSD.org/src/rev/0dbef56341f5
branches:  trunk
changeset: 332706:0dbef56341f5
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Oct 04 19:38:17 2014 +0000

description:
Make early console work on big endian kernels

diffstat:

 sys/arch/arm/allwinner/awin_board.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (48 lines):

diff -r 1354c3b8ec7d -r 0dbef56341f5 sys/arch/arm/allwinner/awin_board.c
--- a/sys/arch/arm/allwinner/awin_board.c       Sat Oct 04 18:10:04 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_board.c       Sat Oct 04 19:38:17 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: awin_board.c,v 1.19 2014/09/11 08:01:31 matt Exp $     */
+/*     $NetBSD: awin_board.c,v 1.20 2014/10/04 19:38:17 martin Exp $   */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.19 2014/09/11 08:01:31 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.20 2014/10/04 19:38:17 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -91,10 +91,10 @@
 static int
 awin_cngetc(dev_t dv)
 {
-        if ((uart_base[com_lsr] & LSR_RXRDY) == 0)
+        if ((le32toh(uart_base[com_lsr]) & LSR_RXRDY) == 0)
                return -1;
 
-       return uart_base[com_data] & 0xff;
+       return le32toh(uart_base[com_data]) & 0xff;
 }
 
 static void
@@ -102,13 +102,13 @@
 {
        int timo = 150000;
 
-        while ((uart_base[com_lsr] & LSR_TXRDY) == 0 && --timo > 0)
+        while ((le32toh(uart_base[com_lsr]) & LSR_TXRDY) == 0 && --timo > 0)
                ;
 
-       uart_base[com_data] = c & 0xff;
+       uart_base[com_data] = htole32(c & 0xff);
 
        timo = 150000;
-        while ((uart_base[com_lsr] & LSR_TSRE) == 0 && --timo > 0)
+        while ((le32toh(uart_base[com_lsr]) & LSR_TSRE) == 0 && --timo > 0)
                ;
 }
 



Home | Main Index | Thread Index | Old Index