Use PMAP_NOCACHE
This commit is contained in:
parent
192ae8787d
commit
f8486b3bd6
@ -1,7 +1,7 @@
|
||||
/* $Id: imx_space.c,v 1.4 2012/09/01 00:06:54 matt Exp $ */
|
||||
/* $Id: imx_space.c,v 1.5 2012/09/01 14:44:42 matt Exp $ */
|
||||
|
||||
/* derived from: */
|
||||
/* $NetBSD: imx_space.c,v 1.4 2012/09/01 00:06:54 matt Exp $ */
|
||||
/* $NetBSD: imx_space.c,v 1.5 2012/09/01 14:44:42 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
|
||||
@ -206,10 +206,9 @@ int
|
||||
imx_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
|
||||
int flag, bus_space_handle_t *bshp)
|
||||
{
|
||||
u_long startpa, endpa, pa;
|
||||
vaddr_t va;
|
||||
pt_entry_t *pte;
|
||||
const struct pmap_devmap *pd;
|
||||
paddr_t startpa, endpa, pa;
|
||||
vaddr_t va;
|
||||
|
||||
if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) {
|
||||
/* Device was statically mapped. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: omap_space.c,v 1.5 2012/07/15 20:54:15 matt Exp $ */
|
||||
/* $NetBSD: omap_space.c,v 1.6 2012/09/01 14:44:43 matt Exp $ */
|
||||
|
||||
/*
|
||||
* bus_space functions for Texas Instruments OMAP processor.
|
||||
@ -73,7 +73,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: omap_space.c,v 1.5 2012/07/15 20:54:15 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: omap_space.c,v 1.6 2012/09/01 14:44:43 matt Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -207,10 +207,9 @@ int
|
||||
omap_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
|
||||
int flag, bus_space_handle_t *bshp)
|
||||
{
|
||||
u_long startpa, endpa, pa;
|
||||
vaddr_t va;
|
||||
pt_entry_t *pte;
|
||||
const struct pmap_devmap *pd;
|
||||
paddr_t startpa, endpa, pa;
|
||||
vaddr_t va;
|
||||
|
||||
if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) {
|
||||
/* Device was statically mapped. */
|
||||
@ -231,15 +230,8 @@ omap_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
|
||||
*bshp = (bus_space_handle_t)(va + (bpa - startpa));
|
||||
|
||||
for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) {
|
||||
pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE, 0);
|
||||
if ((flag & BUS_SPACE_MAP_CACHEABLE) == 0) {
|
||||
pte = vtopte(va);
|
||||
*pte &= ~L2_S_CACHE_MASK;
|
||||
PTE_SYNC(pte);
|
||||
/* XXX: pmap_kenter_pa() also does PTE_SYNC(). a bit of
|
||||
* waste.
|
||||
*/
|
||||
}
|
||||
pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE,
|
||||
(flag & BUS_SPACE_MAP_CACHEABLE) ? 0 : PMAP_NOCACHE);
|
||||
}
|
||||
pmap_update(pmap_kernel());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user