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 Support Cortex-A9 (addr_d > addr_c).
details: https://anonhg.NetBSD.org/src/rev/f821f1ef18ed
branches: trunk
changeset: 320029:f821f1ef18ed
user: hkenken <hkenken%NetBSD.org@localhost>
date: Wed Jun 20 05:50:09 2018 +0000
description:
Support Cortex-A9 (addr_d > addr_c).
diffstat:
sys/arch/arm/fdt/gic_fdt.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (41 lines):
diff -r 479289ce882f -r f821f1ef18ed sys/arch/arm/fdt/gic_fdt.c
--- a/sys/arch/arm/fdt/gic_fdt.c Wed Jun 20 05:19:12 2018 +0000
+++ b/sys/arch/arm/fdt/gic_fdt.c Wed Jun 20 05:50:09 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_fdt.c,v 1.9 2018/06/06 19:49:51 jakllsch Exp $ */
+/* $NetBSD: gic_fdt.c,v 1.10 2018/06/20 05:50:09 hkenken Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.9 2018/06/06 19:49:51 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.10 2018/06/20 05:50:09 hkenken Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -140,8 +140,9 @@
return;
}
- const bus_addr_t addr = addr_d;
- const bus_size_t size = (addr_c + size_c) - addr_d;
+ const bus_addr_t addr = min(addr_d, addr_c);
+ const bus_size_t end = max(addr_d + size_d, addr_c + size_c);
+ const bus_size_t size = end - addr;
error = bus_space_map(faa->faa_bst, addr, size, 0, &bsh);
if (error) {
@@ -153,8 +154,8 @@
.mpcaa_name = "armgic",
.mpcaa_memt = faa->faa_bst,
.mpcaa_memh = bsh,
- .mpcaa_off1 = 0,
- .mpcaa_off2 = addr_c - addr_d
+ .mpcaa_off1 = addr_d - addr,
+ .mpcaa_off2 = addr_c - addr,
};
config_found(self, &mpcaa, NULL);
Home |
Main Index |
Thread Index |
Old Index