summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2016-10-05 07:44:25 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2016-10-05 07:44:25 +0000
commit513ee62128d212b0fe5d59f65d6eb121e9736702 (patch)
treec79175ad897919873d5420c0ca3e449b58c3c662 /sys/arch/arm
parentfc3f943158b70e208265cb5b52b20953505e3865 (diff)
Some device trees use 64-bit intermediate virtual addresses. This
means that even though the hardware in the end never leaves the 32-bit address space, some addresses used solely in the device tree can be bigger than 32-bit. As bus_space_map(9) takes addresses of size bus_addr_t, which is 32-bit on ARMv7, we cannot pass those virtual addresses to the parent bus, even though it will be mapped back into a 32-bit address in the end. To work around this, make bus_space_map(9) take a 64-bit address. Since this is implemented as a macro and function pointer we can safely do that without harming any other architecture. ok kettenis@ deraadt@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/armv7/armv7_space.c4
-rw-r--r--sys/arch/arm/include/bus.h6
-rw-r--r--sys/arch/arm/simplebus/simplebus.c6
3 files changed, 8 insertions, 8 deletions
diff --git a/sys/arch/arm/armv7/armv7_space.c b/sys/arch/arm/armv7/armv7_space.c
index 4f6c1e04e73..c7e9b686b8f 100644
--- a/sys/arch/arm/armv7/armv7_space.c
+++ b/sys/arch/arm/armv7/armv7_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_space.c,v 1.8 2016/08/08 14:47:52 kettenis Exp $ */
+/* $OpenBSD: armv7_space.c,v 1.9 2016/10/05 07:44:24 patrick Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -165,7 +165,7 @@ struct bus_space armv7_bs_tag = {
};
int
-armv7_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
+armv7_bs_map(void *t, uint64_t bpa, bus_size_t size,
int flags, bus_space_handle_t *bshp)
{
u_long startpa, endpa, pa;
diff --git a/sys/arch/arm/include/bus.h b/sys/arch/arm/include/bus.h
index f00c897d4be..10b214a7579 100644
--- a/sys/arch/arm/include/bus.h
+++ b/sys/arch/arm/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.15 2016/08/26 21:50:43 patrick Exp $ */
+/* $OpenBSD: bus.h,v 1.16 2016/10/05 07:44:24 patrick Exp $ */
/* $NetBSD: bus.h,v 1.12 2003/10/23 15:03:24 scw Exp $ */
/*-
@@ -93,7 +93,7 @@ struct bus_space {
void *bs_cookie;
/* mapping/unmapping */
- int (*bs_map) (void *, bus_addr_t, bus_size_t,
+ int (*bs_map) (void *, uint64_t, bus_size_t,
int, bus_space_handle_t *);
void (*bs_unmap) (void *, bus_space_handle_t,
bus_size_t);
@@ -373,7 +373,7 @@ struct bus_space {
*/
#define bs_map_proto(f) \
-int __bs_c(f,_bs_map) (void *t, bus_addr_t addr, \
+int __bs_c(f,_bs_map) (void *t, uint64_t addr, \
bus_size_t size, int flags, bus_space_handle_t *bshp);
#define bs_unmap_proto(f) \
diff --git a/sys/arch/arm/simplebus/simplebus.c b/sys/arch/arm/simplebus/simplebus.c
index d2f5bfe8b8d..71ffe0dc080 100644
--- a/sys/arch/arm/simplebus/simplebus.c
+++ b/sys/arch/arm/simplebus/simplebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: simplebus.c,v 1.9 2016/09/18 17:50:26 kettenis Exp $ */
+/* $OpenBSD: simplebus.c,v 1.10 2016/10/05 07:44:24 patrick Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
*
@@ -30,7 +30,7 @@ int simplebus_match(struct device *, void *, void *);
void simplebus_attach(struct device *, struct device *, void *);
void simplebus_attach_node(struct device *, int);
-int simplebus_bs_map(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);
+int simplebus_bs_map(void *, uint64_t, bus_size_t, int, bus_space_handle_t *);
struct simplebus_softc {
struct device sc_dev;
@@ -205,7 +205,7 @@ simplebus_attach_node(struct device *self, int node)
* Translate memory address if needed.
*/
int
-simplebus_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
+simplebus_bs_map(void *t, uint64_t bpa, bus_size_t size,
int flag, bus_space_handle_t *bshp)
{
struct simplebus_softc *sc = (struct simplebus_softc *)t;