Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch FDT-ize "delay" by having fdt_machdep provide the d...
details: https://anonhg.NetBSD.org/src/rev/a9ed20c834f0
branches: trunk
changeset: 354029:a9ed20c834f0
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Jun 02 00:16:27 2017 +0000
description:
FDT-ize "delay" by having fdt_machdep provide the delay() function and
move the implementations into the platform code.
diffstat:
sys/arch/arm/fdt/arm_fdtvar.h | 3 ++-
sys/arch/arm/nvidia/tegra_platform.c | 11 +++++++++--
sys/arch/arm/nvidia/tegra_timer.c | 6 +++---
sys/arch/arm/nvidia/tegra_var.h | 4 +++-
sys/arch/evbarm/fdt/fdt_machdep.c | 12 ++++++++++--
5 files changed, 27 insertions(+), 9 deletions(-)
diffs (134 lines):
diff -r e42b63618cd6 -r a9ed20c834f0 sys/arch/arm/fdt/arm_fdtvar.h
--- a/sys/arch/arm/fdt/arm_fdtvar.h Fri Jun 02 00:09:56 2017 +0000
+++ b/sys/arch/arm/fdt/arm_fdtvar.h Fri Jun 02 00:16:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdtvar.h,v 1.3 2017/05/30 22:00:25 jmcneill Exp $ */
+/* $NetBSD: arm_fdtvar.h,v 1.4 2017/06/02 00:16:27 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -42,6 +42,7 @@
void (*early_putchar)(char);
void (*device_register)(device_t, void *);
void (*reset)(void);
+ void (*delay)(u_int);
};
struct arm_platform_info {
diff -r e42b63618cd6 -r a9ed20c834f0 sys/arch/arm/nvidia/tegra_platform.c
--- a/sys/arch/arm/nvidia/tegra_platform.c Fri Jun 02 00:09:56 2017 +0000
+++ b/sys/arch/arm/nvidia/tegra_platform.c Fri Jun 02 00:16:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_platform.c,v 1.4 2017/05/30 22:55:26 jmcneill Exp $ */
+/* $NetBSD: tegra_platform.c,v 1.5 2017/06/02 00:16:27 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: tegra_platform.c,v 1.4 2017/05/30 22:55:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_platform.c,v 1.5 2017/06/02 00:16:27 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -182,6 +182,12 @@
tegra_pmc_reset();
}
+static void
+tegra_platform_delay(u_int us)
+{
+ tegra_timer_delay(us);
+}
+
static const struct arm_platform tegra_platform = {
.devmap = tegra_platform_devmap,
.bootstrap = tegra_platform_bootstrap,
@@ -189,6 +195,7 @@
.early_putchar = tegra_platform_early_putchar,
.device_register = tegra_platform_device_register,
.reset = tegra_platform_reset,
+ .delay = tegra_platform_delay,
};
ARM_PLATFORM(tegra124, "nvidia,tegra124", &tegra_platform);
diff -r e42b63618cd6 -r a9ed20c834f0 sys/arch/arm/nvidia/tegra_timer.c
--- a/sys/arch/arm/nvidia/tegra_timer.c Fri Jun 02 00:09:56 2017 +0000
+++ b/sys/arch/arm/nvidia/tegra_timer.c Fri Jun 02 00:16:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_timer.c,v 1.6 2017/05/25 23:54:45 jmcneill Exp $ */
+/* $NetBSD: tegra_timer.c,v 1.7 2017/06/02 00:16:27 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_timer.c,v 1.6 2017/05/25 23:54:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_timer.c,v 1.7 2017/06/02 00:16:27 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -161,7 +161,7 @@
}
void
-delay(u_int us)
+tegra_timer_delay(u_int us)
{
static bool timerus_configured = false;
bus_space_tag_t bst = &armv7_generic_bs_tag;
diff -r e42b63618cd6 -r a9ed20c834f0 sys/arch/arm/nvidia/tegra_var.h
--- a/sys/arch/arm/nvidia/tegra_var.h Fri Jun 02 00:09:56 2017 +0000
+++ b/sys/arch/arm/nvidia/tegra_var.h Fri Jun 02 00:16:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_var.h,v 1.37 2017/05/28 00:40:20 jmcneill Exp $ */
+/* $NetBSD: tegra_var.h,v 1.38 2017/06/02 00:16:27 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -85,6 +85,8 @@
uint32_t tegra_fuse_read(u_int);
+void tegra_timer_delay(u_int);
+
void tegra_xusbpad_sata_enable(void);
void tegra_xusbpad_xhci_enable(void);
diff -r e42b63618cd6 -r a9ed20c834f0 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Fri Jun 02 00:09:56 2017 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Fri Jun 02 00:16:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.2 2017/05/30 22:55:27 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.3 2017/06/02 00:16:28 jmcneill Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.2 2017/05/30 22:55:27 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.3 2017/06/02 00:16:28 jmcneill Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@@ -284,6 +284,14 @@
initialized = true;
}
+void
+delay(u_int us)
+{
+ const struct arm_platform *plat = arm_fdt_platform();
+
+ plat->delay(us);
+}
+
static void
fdt_device_register(device_t self, void *aux)
{
Home |
Main Index |
Thread Index |
Old Index