Module Name: src Committed By: skrll Date: Sat Dec 19 08:27:01 UTC 2015
Modified Files: src/sys/arch/arm/broadcom: bcm2835_space.c Log Message: Fix up bus_space_map for latest RPI firmware which now passes the FB address in the mailbox properties as a bus address. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835_space.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/broadcom/bcm2835_space.c diff -u src/sys/arch/arm/broadcom/bcm2835_space.c:1.8 src/sys/arch/arm/broadcom/bcm2835_space.c:1.9 --- src/sys/arch/arm/broadcom/bcm2835_space.c:1.8 Sat Feb 28 09:34:34 2015 +++ src/sys/arch/arm/broadcom/bcm2835_space.c Sat Dec 19 08:27:01 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_space.c,v 1.8 2015/02/28 09:34:34 skrll Exp $ */ +/* $NetBSD: bcm2835_space.c,v 1.9 2015/12/19 08:27:01 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bcm2835_space.c,v 1.8 2015/02/28 09:34:34 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_space.c,v 1.9 2015/12/19 08:27:01 skrll Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -292,18 +292,17 @@ bcm2835_bs_map(void *t, bus_addr_t ba, b int pmap_flags; -#if defined(BCM2836) + /* Attempt to find the PA device mapping */ pa = ba; -#else - pa = ba & ~BCM2835_BUSADDR_CACHE_MASK; -#endif - /* this does device addresses */ - if ((pd = pmap_devmap_find_pa(pa, size)) != NULL) { + if ((pd = pmap_devmap_find_pa(ba, size)) != NULL) { /* Device was statically mapped. */ *bshp = pd->pd_va + (pa - pd->pd_pa); return 0; } + /* Now assume bus address so convert to PA */ + pa = ba & ~BCM2835_BUSADDR_CACHE_MASK; + startpa = trunc_page(pa); endpa = round_page(pa + size);