Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/samsung Fix exynos5 devmap, bootstrap, and impl...



details:   https://anonhg.NetBSD.org/src/rev/25a9080a3290
branches:  trunk
changeset: 824594:25a9080a3290
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jun 10 23:22:36 2017 +0000

description:
Fix exynos5 devmap, bootstrap, and implement early_putchar.

diffstat:

 sys/arch/arm/samsung/exynos_platform.c |  22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diffs (70 lines):

diff -r cde10b58862b -r 25a9080a3290 sys/arch/arm/samsung/exynos_platform.c
--- a/sys/arch/arm/samsung/exynos_platform.c    Sat Jun 10 23:20:56 2017 +0000
+++ b/sys/arch/arm/samsung/exynos_platform.c    Sat Jun 10 23:22:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_platform.c,v 1.1 2017/06/10 15:13:18 jmcneill Exp $ */
+/* $NetBSD: exynos_platform.c,v 1.2 2017/06/10 23:22:36 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
 #include "ukbd.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.1 2017/06/10 15:13:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.2 2017/06/10 23:22:36 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -51,12 +51,12 @@
 #include <arm/samsung/exynos_reg.h>
 #include <arm/samsung/exynos_var.h>
 
+#include <evbarm/exynos/platform.h>
+
 #include <arm/cortex/gtmr_var.h>
 
 #include <arm/fdt/arm_fdtvar.h>
 
-#define        EXYNOS_CORE_VBASE       0xf0000000
-
 #define        DEVMAP_ALIGN(a) ((a) & ~L1_S_OFFSET)
 #define        DEVMAP_SIZE(s)  roundup2((s), L1_S_SIZE)
 #define        DEVMAP_ENTRY(va, pa, sz)                        \
@@ -75,17 +75,24 @@
        static const struct pmap_devmap devmap[] = {
                DEVMAP_ENTRY(EXYNOS_CORE_VBASE,
                             EXYNOS_CORE_PBASE,
-                            EXYNOS_CORE_SIZE),
+                            EXYNOS5_CORE_SIZE),
+               DEVMAP_ENTRY(EXYNOS5_AUDIOCORE_VBASE,
+                            EXYNOS5_AUDIOCORE_PBASE,
+                            EXYNOS5_AUDIOCORE_SIZE),
                DEVMAP_ENTRY_END
        };      
 
        return devmap;
 }
 
+#define EXYNOS_IOPHYSTOVIRT(a) \
+    ((vaddr_t)(((a) - EXYNOS_CORE_PBASE) + EXYNOS_CORE_VBASE))
+
 static void
 exynos_platform_bootstrap(void)
 {
-       exynos_bootstrap(EXYNOS_CORE_PBASE, 0 /* XXX */);
+       paddr_t uart_address = armreg_tpidruro_read();  /* XXX */
+       exynos_bootstrap(EXYNOS_CORE_VBASE, EXYNOS_IOPHYSTOVIRT(uart_address));
 }
 
 static void
@@ -103,6 +110,9 @@
 static void
 exynos_platform_early_putchar(char c)
 {
+       extern void exynos_putchar(int);        /* XXX from exynos_start.S */
+
+       exynos_putchar(c);
 }
 
 static void



Home | Main Index | Thread Index | Old Index