Module Name:    src
Committed By:   jmcneill
Date:           Fri Oct 12 21:44:20 UTC 2018

Modified Files:
        src/sys/arch/aarch64/aarch64: aarch64_machdep.c
        src/sys/arch/arm/arm32: arm32_machdep.c
        src/sys/arch/arm/fdt: arm_fdtvar.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/fdt/arm_fdtvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.12 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.13
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.12	Thu Oct  4 23:53:13 2018
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Fri Oct 12 21:44:20 2018
@@ -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 @@ __KERNEL_RCSID(1, "$NetBSD: aarch64_mach
 #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 @@ cpu_startup(void)
 
 	consinit();
 
+#ifdef FDT
+	if (arm_fdt_platform()->ap_startup != NULL)
+		arm_fdt_platform()->ap_startup();
+#endif
+
 	/*
 	 * Allocate a submap for physio.
 	 */

Index: src/sys/arch/arm/arm32/arm32_machdep.c
diff -u src/sys/arch/arm/arm32/arm32_machdep.c:1.120 src/sys/arch/arm/arm32/arm32_machdep.c:1.121
--- src/sys/arch/arm/arm32/arm32_machdep.c:1.120	Wed Aug 22 07:47:33 2018
+++ src/sys/arch/arm/arm32/arm32_machdep.c	Fri Oct 12 21:44:20 2018
@@ -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 @@ cpu_startup(void)
 	 */
 	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).
 	 */

Index: src/sys/arch/arm/fdt/arm_fdtvar.h
diff -u src/sys/arch/arm/fdt/arm_fdtvar.h:1.9 src/sys/arch/arm/fdt/arm_fdtvar.h:1.10
--- src/sys/arch/arm/fdt/arm_fdtvar.h:1.9	Mon Sep 10 11:05:12 2018
+++ src/sys/arch/arm/fdt/arm_fdtvar.h	Fri Oct 12 21:44:20 2018
@@ -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 <jmcne...@invisible.ca>
@@ -38,6 +38,7 @@ struct fdt_attach_args;
 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 *);

Reply via email to