Module Name: src
Committed By: jmcneill
Date: Tue Jun 20 19:13:34 UTC 2017
Modified Files:
src/sys/arch/arm/samsung: exynos_platform.c
Log Message:
Implement platform reset for exynos5
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/samsung/exynos_platform.c
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/arm/samsung/exynos_platform.c
diff -u src/sys/arch/arm/samsung/exynos_platform.c:1.5 src/sys/arch/arm/samsung/exynos_platform.c:1.6
--- src/sys/arch/arm/samsung/exynos_platform.c:1.5 Sun Jun 11 16:21:41 2017
+++ src/sys/arch/arm/samsung/exynos_platform.c Tue Jun 20 19:13:34 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_platform.c,v 1.5 2017/06/11 16:21:41 jmcneill Exp $ */
+/* $NetBSD: exynos_platform.c,v 1.6 2017/06/20 19:13:34 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <[email protected]>
@@ -33,7 +33,7 @@
#include "ukbd.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.5 2017/06/11 16:21:41 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.6 2017/06/20 19:13:34 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -57,6 +57,8 @@ __KERNEL_RCSID(0, "$NetBSD: exynos_platf
#include <arm/fdt/arm_fdtvar.h>
+#define EXYNOS5_SWRESET_REG 0x10040400
+
#define DEVMAP_ALIGN(a) ((a) & ~L1_S_OFFSET)
#define DEVMAP_SIZE(s) roundup2((s), L1_S_SIZE)
#define DEVMAP_ENTRY(va, pa, sz) \
@@ -124,9 +126,13 @@ exynos_platform_device_register(device_t
}
static void
-exynos_platform_reset(void)
+exynos5_platform_reset(void)
{
- printf("%s: not implemented\n", __func__);
+ bus_space_tag_t bst = &armv7_generic_bs_tag;
+ bus_space_handle_t bsh;
+
+ bus_space_map(bst, EXYNOS5_SWRESET_REG, 4, 0, &bsh);
+ bus_space_write_4(bst, bsh, 0, 1);
}
static void
@@ -147,7 +153,7 @@ static const struct arm_platform exynos5
.init_attach_args = exynos_platform_init_attach_args,
.early_putchar = exynos_platform_early_putchar,
.device_register = exynos_platform_device_register,
- .reset = exynos_platform_reset,
+ .reset = exynos5_platform_reset,
.delay = exynos_platform_delay,
.uart_freq = exynos_platform_uart_freq,
};