Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Add optional ap_startup callback to struct arm_plat...



details:   https://anonhg.NetBSD.org/src/rev/2d14deb07259
branches:  trunk
changeset: 836335:2d14deb07259
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Oct 12 21:44:20 2018 +0000

description:
Add optional ap_startup callback to struct arm_platform. This allows for
late (post-UVM init) initialization of platform specific stuff.

diffstat:

 sys/arch/aarch64/aarch64/aarch64_machdep.c |  11 +++++++++--
 sys/arch/arm/arm32/arm32_machdep.c         |   9 +++++++--
 sys/arch/arm/fdt/arm_fdtvar.h              |   3 ++-
 3 files changed, 18 insertions(+), 5 deletions(-)

diffs (91 lines):

diff -r 4bd114c953bf -r 2d14deb07259 sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c        Fri Oct 12 21:41:34 2018 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c        Fri Oct 12 21:44:20 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.12 2018/10/04 23:53:13 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.13 2018/10/12 21:44:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.12 2018/10/04 23:53:13 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.13 2018/10/12 21:44:20 jmcneill Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
 #include "opt_kernhist.h"
 #include "opt_modular.h"
+#include "opt_fdt.h"
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -63,6 +64,7 @@
 #include <aarch64/vmparam.h>
 
 #include <arch/evbarm/fdt/platform.h>
+#include <arm/fdt/arm_fdtvar.h>
 
 #ifdef VERBOSE_INIT_ARM
 #define VPRINTF(...)   printf(__VA_ARGS__)
@@ -533,6 +535,11 @@
 
        consinit();
 
+#ifdef FDT
+       if (arm_fdt_platform()->ap_startup != NULL)
+               arm_fdt_platform()->ap_startup();
+#endif
+
        /*
         * Allocate a submap for physio.
         */
diff -r 4bd114c953bf -r 2d14deb07259 sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c        Fri Oct 12 21:41:34 2018 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c        Fri Oct 12 21:44:20 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_machdep.c,v 1.120 2018/08/22 07:47:33 skrll Exp $        */
+/*     $NetBSD: arm32_machdep.c,v 1.121 2018/10/12 21:44:20 jmcneill Exp $     */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.120 2018/08/22 07:47:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.121 2018/10/12 21:44:20 jmcneill Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_fdt.h"
@@ -285,6 +285,11 @@
         */
        pmap_postinit();
 
+#ifdef FDT
+       if (arm_fdt_platform()->ap_startup != NULL)
+               arm_fdt_platform()->ap_startup();
+#endif
+
        /*
         * Initialize error message buffer (at end of core).
         */
diff -r 4bd114c953bf -r 2d14deb07259 sys/arch/arm/fdt/arm_fdtvar.h
--- a/sys/arch/arm/fdt/arm_fdtvar.h     Fri Oct 12 21:41:34 2018 +0000
+++ b/sys/arch/arm/fdt/arm_fdtvar.h     Fri Oct 12 21:44:20 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdtvar.h,v 1.9 2018/09/10 11:05:12 ryo Exp $ */
+/* $NetBSD: arm_fdtvar.h,v 1.10 2018/10/12 21:44:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -38,6 +38,7 @@
 struct arm_platform {
        const struct pmap_devmap * (*ap_devmap)(void);
        void                    (*ap_bootstrap)(void);
+       void                    (*ap_startup)(void);
        void                    (*ap_init_attach_args)(struct fdt_attach_args *);
        void                    (*ap_early_putchar)(char);
        void                    (*ap_device_register)(device_t, void *);



Home | Main Index | Thread Index | Old Index