Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/fdt Add arm_fdt_memory_dump helper for dumping ...
details: https://anonhg.NetBSD.org/src/rev/772001216fcf
branches: trunk
changeset: 354785:772001216fcf
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Thu Jun 29 20:55:10 2017 +0000
description:
Add arm_fdt_memory_dump helper for dumping physical addresses from ddb
diffstat:
sys/arch/arm/fdt/arm_fdt.c | 27 +++++++++++++++++++++++++--
sys/arch/arm/fdt/arm_fdtvar.h | 4 +++-
2 files changed, 28 insertions(+), 3 deletions(-)
diffs (61 lines):
diff -r 3596d99c2cf4 -r 772001216fcf sys/arch/arm/fdt/arm_fdt.c
--- a/sys/arch/arm/fdt/arm_fdt.c Thu Jun 29 20:54:28 2017 +0000
+++ b/sys/arch/arm/fdt/arm_fdt.c Thu Jun 29 20:55:10 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdt.c,v 1.3 2017/05/30 22:00:25 jmcneill Exp $ */
+/* $NetBSD: arm_fdt.c,v 1.4 2017/06/29 20:55:10 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.3 2017/05/30 22:00:25 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.4 2017/06/29 20:55:10 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -143,3 +143,26 @@
{
_arm_fdt_irq_handler(tf);
}
+
+void
+arm_fdt_memory_dump(paddr_t pa)
+{
+ const struct arm_platform *plat = arm_fdt_platform();
+ struct fdt_attach_args faa;
+ bus_space_tag_t bst;
+ bus_space_handle_t bsh;
+
+ plat->init_attach_args(&faa);
+
+ bst = faa.faa_bst;
+ bus_space_map(bst, pa, 0x100, 0, &bsh);
+
+ for (int i = 0; i < 0x100; i += 0x10) {
+ printf("%" PRIxPTR ": %08x %08x %08x %08x\n",
+ (uintptr_t)(pa + i),
+ bus_space_read_4(bst, bsh, i + 0),
+ bus_space_read_4(bst, bsh, i + 4),
+ bus_space_read_4(bst, bsh, i + 8),
+ bus_space_read_4(bst, bsh, i + 12));
+ }
+}
diff -r 3596d99c2cf4 -r 772001216fcf sys/arch/arm/fdt/arm_fdtvar.h
--- a/sys/arch/arm/fdt/arm_fdtvar.h Thu Jun 29 20:54:28 2017 +0000
+++ b/sys/arch/arm/fdt/arm_fdtvar.h Thu Jun 29 20:55:10 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdtvar.h,v 1.5 2017/06/02 13:53:28 jmcneill Exp $ */
+/* $NetBSD: arm_fdtvar.h,v 1.6 2017/06/29 20:55:10 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -71,4 +71,6 @@
void arm_fdt_irq_set_handler(void (*)(void *));
void arm_fdt_irq_handler(void *);
+void arm_fdt_memory_dump(paddr_t);
+
#endif /* !_ARM_ARM_FDTVAR_H */
Home |
Main Index |
Thread Index |
Old Index