Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Big endian support for virt_platform_early_putchar ...
details: https://anonhg.NetBSD.org/src/rev/003a2ae8fdac
branches: trunk
changeset: 319905:003a2ae8fdac
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Fri Jun 15 14:37:35 2018 +0000
description:
Big endian support for virt_platform_early_putchar and xputc.
diffstat:
sys/arch/arm/virt/virt_platform.c | 11 ++++++-----
sys/arch/evbarm/virt/virt_start.S | 7 +++++--
2 files changed, 11 insertions(+), 7 deletions(-)
diffs (63 lines):
diff -r 188d10220f96 -r 003a2ae8fdac sys/arch/arm/virt/virt_platform.c
--- a/sys/arch/arm/virt/virt_platform.c Fri Jun 15 14:32:29 2018 +0000
+++ b/sys/arch/arm/virt/virt_platform.c Fri Jun 15 14:37:35 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virt_platform.c,v 1.1 2018/06/14 10:56:39 jmcneill Exp $ */
+/* $NetBSD: virt_platform.c,v 1.2 2018/06/15 14:37:35 jakllsch Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
#include "opt_fdt_arm.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virt_platform.c,v 1.1 2018/06/14 10:56:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virt_platform.c,v 1.2 2018/06/15 14:37:35 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -96,12 +96,13 @@
(volatile uint32_t *)VIRT_CORE_PTOV(VIRT_UART_BASE) :
(volatile uint32_t *)VIRT_UART_BASE;
- while ((uartaddr[PL01XCOM_FR / 4] & PL01X_FR_TXFF) != 0)
+ while ((le32toh(uartaddr[PL01XCOM_FR / 4]) & PL01X_FR_TXFF) != 0)
continue;
- uartaddr[PL01XCOM_DR / 4] = c;
+ uartaddr[PL01XCOM_DR / 4] = htole32(c);
+ arm_dsb();
- while ((uartaddr[PL01XCOM_FR / 4] & PL01X_FR_TXFE) == 0)
+ while ((le32toh(uartaddr[PL01XCOM_FR / 4]) & PL01X_FR_TXFE) == 0)
continue;
}
diff -r 188d10220f96 -r 003a2ae8fdac sys/arch/evbarm/virt/virt_start.S
--- a/sys/arch/evbarm/virt/virt_start.S Fri Jun 15 14:32:29 2018 +0000
+++ b/sys/arch/evbarm/virt/virt_start.S Fri Jun 15 14:37:35 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virt_start.S,v 1.2 2018/06/15 14:32:29 jakllsch Exp $ */
+/* $NetBSD: virt_start.S,v 1.3 2018/06/15 14:37:35 jakllsch Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
#include <arm/virt/virt_platform.h>
-RCSID("$NetBSD: virt_start.S,v 1.2 2018/06/15 14:32:29 jakllsch Exp $")
+RCSID("$NetBSD: virt_start.S,v 1.3 2018/06/15 14:37:35 jakllsch Exp $")
#ifdef VERBOSE_INIT_ARM
#define XPUTC(n) mov r0, n; bl xputc
@@ -139,6 +139,9 @@
xputc:
movw r2, #0x0000
movt r2, #0x0900
+#ifdef __ARMEB__
+ lsl r0, r0, #24
+#endif
str r0, [r2]
bx lr
Home |
Main Index |
Thread Index |
Old Index