Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/fdt Use correct #cells for parent address when decod...
details: https://anonhg.NetBSD.org/src/rev/bf517808c30c
branches: trunk
changeset: 454669:bf517808c30c
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Sep 24 15:23:34 2019 +0000
description:
Use correct #cells for parent address when decoding ranges
diffstat:
sys/dev/fdt/fdt_subr.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (38 lines):
diff -r c0534a2107fe -r bf517808c30c sys/dev/fdt/fdt_subr.c
--- a/sys/dev/fdt/fdt_subr.c Tue Sep 24 14:39:38 2019 +0000
+++ b/sys/dev/fdt/fdt_subr.c Tue Sep 24 15:23:34 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.30 2019/06/14 11:08:18 hkenken Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.31 2019/09/24 15:23:34 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.30 2019/06/14 11:08:18 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.31 2019/09/24 15:23:34 jmcneill Exp $");
#include "opt_fdt.h"
@@ -224,7 +224,7 @@
const int addr_cells = fdtbus_get_addr_cells(phandle);
const int size_cells = fdtbus_get_size_cells(phandle);
- const int paddr_cells = fdtbus_get_addr_cells(OF_parent(parent));
+ const int paddr_cells = fdtbus_get_addr_cells(parent);
if (addr_cells == -1 || size_cells == -1 || paddr_cells == -1)
return paddr;
@@ -237,6 +237,10 @@
cl = fdtbus_get_cells(buf, size_cells);
buf += size_cells * 4;
+#ifdef FDTBUS_DEBUG
+ printf("%s: %s: cba=0x%#" PRIx64 ", pba=0x%#" PRIx64 ", cl=0x%#" PRIx64 "\n", __func__, fdt_get_name(fdtbus_get_data(), fdtbus_phandle2offset(phandle), NULL), cba, pba, cl);
+#endif
+
if (paddr >= cba && paddr < cba + cl)
return fdtbus_decode_range(parent, pba) + (paddr - cba);
Home |
Main Index |
Thread Index |
Old Index