From 513ee62128d212b0fe5d59f65d6eb121e9736702 Mon Sep 17 00:00:00 2001 From: Patrick Wildt Date: Wed, 5 Oct 2016 07:44:25 +0000 Subject: 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@ --- sys/arch/armv7/armv7/armv7_machdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/arch/armv7') diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c index bd5ea253766..419c8050569 100644 --- a/sys/arch/armv7/armv7/armv7_machdep.c +++ b/sys/arch/armv7/armv7/armv7_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: armv7_machdep.c,v 1.41 2016/10/05 07:29:59 patrick Exp $ */ +/* $OpenBSD: armv7_machdep.c,v 1.42 2016/10/05 07:44:24 patrick Exp $ */ /* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */ /* @@ -199,7 +199,7 @@ int safepri = 0; /* Prototypes */ char bootargs[MAX_BOOT_STRING]; -int bootstrap_bs_map(void *, bus_addr_t, bus_size_t, int, +int bootstrap_bs_map(void *, uint64_t, bus_size_t, int, bus_space_handle_t *); void process_kernel_args(char *); void consinit(void); @@ -322,7 +322,7 @@ read_ttb(void) static vaddr_t section_free = 0xfd000000; /* XXX - huh */ int -bootstrap_bs_map(void *t, bus_addr_t bpa, bus_size_t size, +bootstrap_bs_map(void *t, uint64_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { u_long startpa, pa, endpa; @@ -397,7 +397,7 @@ initarm(void *arg0, void *arg1, void *arg2, paddr_t loadaddr) /* early bus_space_map support */ struct bus_space tmp_bs_tag; - int (*map_func_save)(void *, bus_addr_t, bus_size_t, int, + int (*map_func_save)(void *, uint64_t, bus_size_t, int, bus_space_handle_t *); if (arg0) -- cgit v1.2.3