summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2013-10-27 03:13:26 +0000
committerian <ian@FreeBSD.org>2013-10-27 03:13:26 +0000
commit7b011cd9377544934fa3928d1f40d7d5973f7a9f (patch)
tree2845b26324c8412cced10240287b98ab1a90ff52 /sys
parent7fa106116d54cc826abd69020bb0b4c4703eda2b (diff)
downloadFreeBSD-src-7b011cd9377544934fa3928d1f40d7d5973f7a9f.zip
FreeBSD-src-7b011cd9377544934fa3928d1f40d7d5973f7a9f.tar.gz
Retire arm_remap_nocache() and the data and constants associated with it.
The only remaining user was the code that allocates bounce pages for armv4 busdma. It's not clear why bounce pages would need uncached memory, but if that ever changes, kmem_alloc_attr() would be the way to get it.
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/allwinner/a10_machdep.c2
-rw-r--r--sys/arm/arm/busdma_machdep.c37
-rw-r--r--sys/arm/arm/pmap-v6.c1
-rw-r--r--sys/arm/arm/pmap.c1
-rw-r--r--sys/arm/arm/vm_machdep.c74
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_machdep.c2
-rw-r--r--sys/arm/include/pmap.h5
-rw-r--r--sys/arm/lpc/lpc_machdep.c2
-rw-r--r--sys/arm/mv/mv_machdep.c2
-rw-r--r--sys/arm/samsung/exynos/exynos5_machdep.c2
-rw-r--r--sys/arm/tegra/tegra2_machdep.c2
-rw-r--r--sys/arm/ti/ti_machdep.c2
-rw-r--r--sys/arm/versatile/versatile_machdep.c2
-rw-r--r--sys/arm/xilinx/zy7_machdep.c2
14 files changed, 18 insertions, 118 deletions
diff --git a/sys/arm/allwinner/a10_machdep.c b/sys/arm/allwinner/a10_machdep.c
index 18ddfc5..90badf2 100644
--- a/sys/arm/allwinner/a10_machdep.c
+++ b/sys/arm/allwinner/a10_machdep.c
@@ -57,7 +57,7 @@ vm_offset_t
initarm_lastaddr(void)
{
- return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE);
+ return (DEVMAP_BOOTSTRAP_MAP_START);
}
void
diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c
index 6181d35..8fae22a 100644
--- a/sys/arm/arm/busdma_machdep.c
+++ b/sys/arm/arm/busdma_machdep.c
@@ -122,7 +122,6 @@ struct bus_dma_tag {
struct bounce_page {
vm_offset_t vaddr; /* kva of bounce buffer */
- vm_offset_t vaddr_nocache; /* kva of bounce buffer uncached */
bus_addr_t busaddr; /* Physical address */
vm_offset_t datavaddr; /* kva of client data */
bus_addr_t dataaddr; /* client physical address */
@@ -1196,39 +1195,23 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
STAILQ_FOREACH(bpage, &map->bpages, links) {
if (op & BUS_DMASYNC_PREWRITE) {
if (bpage->datavaddr != 0)
- bcopy((void *)bpage->datavaddr,
- (void *)(bpage->vaddr_nocache != 0 ?
- bpage->vaddr_nocache :
- bpage->vaddr),
- bpage->datacount);
+ bcopy((void *)bpage->datavaddr,
+ (void *)bpage->vaddr, bpage->datacount);
else
physcopyout(bpage->dataaddr,
- (void *)(bpage->vaddr_nocache != 0 ?
- bpage->vaddr_nocache :
- bpage->vaddr),
- bpage->datacount);
- if (bpage->vaddr_nocache == 0) {
- cpu_dcache_wb_range(bpage->vaddr,
- bpage->datacount);
- cpu_l2cache_wb_range(bpage->vaddr,
- bpage->datacount);
- }
+ (void *)bpage->vaddr,bpage->datacount);
+ cpu_dcache_wb_range(bpage->vaddr, bpage->datacount);
+ cpu_l2cache_wb_range(bpage->vaddr, bpage->datacount);
dmat->bounce_zone->total_bounced++;
}
if (op & BUS_DMASYNC_POSTREAD) {
- if (bpage->vaddr_nocache == 0) {
- cpu_dcache_inv_range(bpage->vaddr,
- bpage->datacount);
- cpu_l2cache_inv_range(bpage->vaddr,
- bpage->datacount);
- }
+ cpu_dcache_inv_range(bpage->vaddr, bpage->datacount);
+ cpu_l2cache_inv_range(bpage->vaddr, bpage->datacount);
if (bpage->datavaddr != 0)
- bcopy((void *)(bpage->vaddr_nocache != 0 ?
- bpage->vaddr_nocache : bpage->vaddr),
+ bcopy((void *)bpage->vaddr,
(void *)bpage->datavaddr, bpage->datacount);
else
- physcopyin((void *)(bpage->vaddr_nocache != 0 ?
- bpage->vaddr_nocache : bpage->vaddr),
+ physcopyin((void *)bpage->vaddr,
bpage->dataaddr, bpage->datacount);
dmat->bounce_zone->total_bounced++;
}
@@ -1385,8 +1368,6 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages)
break;
}
bpage->busaddr = pmap_kextract(bpage->vaddr);
- bpage->vaddr_nocache = (vm_offset_t)arm_remap_nocache(
- (void *)bpage->vaddr, PAGE_SIZE);
mtx_lock(&bounce_lock);
STAILQ_INSERT_TAIL(&bz->bounce_page_list, bpage, links);
total_bpages++;
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c
index c89d14d..108a0fd 100644
--- a/sys/arm/arm/pmap-v6.c
+++ b/sys/arm/arm/pmap-v6.c
@@ -1951,7 +1951,6 @@ pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt)
virtual_avail = round_page(virtual_avail);
virtual_end = vm_max_kernel_address;
kernel_vm_end = pmap_curmaxkvaddr;
- arm_nocache_startaddr = vm_max_kernel_address;
mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF);
pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb);
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index c72effd..b3eef01 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -2423,7 +2423,6 @@ pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt)
virtual_avail = round_page(virtual_avail);
virtual_end = vm_max_kernel_address;
kernel_vm_end = pmap_curmaxkvaddr;
- arm_nocache_startaddr = vm_max_kernel_address;
mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF);
#ifdef ARM_USE_SMALL_ALLOC
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index ebb9878..4013caa 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -482,80 +482,6 @@ cpu_exit(struct thread *td)
{
}
-#define BITS_PER_INT (8 * sizeof(int))
-vm_offset_t arm_nocache_startaddr;
-static int arm_nocache_allocated[ARM_NOCACHE_KVA_SIZE / (PAGE_SIZE *
- BITS_PER_INT)];
-
-/*
- * Functions to map and unmap memory non-cached into KVA the kernel won't try
- * to allocate. The goal is to provide uncached memory to busdma, to honor
- * BUS_DMA_COHERENT.
- * We can allocate at most ARM_NOCACHE_KVA_SIZE bytes.
- * The allocator is rather dummy, each page is represented by a bit in
- * a bitfield, 0 meaning the page is not allocated, 1 meaning it is.
- * As soon as it finds enough contiguous pages to satisfy the request,
- * it returns the address.
- */
-void *
-arm_remap_nocache(void *addr, vm_size_t size)
-{
- int i, j;
-
- size = round_page(size);
- for (i = 0; i < ARM_NOCACHE_KVA_SIZE / PAGE_SIZE; i++) {
- if (!(arm_nocache_allocated[i / BITS_PER_INT] & (1 << (i %
- BITS_PER_INT)))) {
- for (j = i; j < i + (size / (PAGE_SIZE)); j++)
- if (arm_nocache_allocated[j / BITS_PER_INT] &
- (1 << (j % BITS_PER_INT)))
- break;
- if (j == i + (size / (PAGE_SIZE)))
- break;
- }
- }
- if (i < ARM_NOCACHE_KVA_SIZE / PAGE_SIZE) {
- vm_offset_t tomap = arm_nocache_startaddr + i * PAGE_SIZE;
- void *ret = (void *)tomap;
- vm_paddr_t physaddr = vtophys((vm_offset_t)addr);
- vm_offset_t vaddr = (vm_offset_t) addr;
-
- vaddr = vaddr & ~PAGE_MASK;
- for (; tomap < (vm_offset_t)ret + size; tomap += PAGE_SIZE,
- vaddr += PAGE_SIZE, physaddr += PAGE_SIZE, i++) {
- cpu_idcache_wbinv_range(vaddr, PAGE_SIZE);
-#ifdef ARM_L2_PIPT
- cpu_l2cache_wbinv_range(physaddr, PAGE_SIZE);
-#else
- cpu_l2cache_wbinv_range(vaddr, PAGE_SIZE);
-#endif
- pmap_kenter_nocache(tomap, physaddr);
- cpu_tlb_flushID_SE(vaddr);
- arm_nocache_allocated[i / BITS_PER_INT] |= 1 << (i %
- BITS_PER_INT);
- }
- return (ret);
- }
-
- return (NULL);
-}
-
-void
-arm_unmap_nocache(void *addr, vm_size_t size)
-{
- vm_offset_t raddr = (vm_offset_t)addr;
- int i;
-
- size = round_page(size);
- i = (raddr - arm_nocache_startaddr) / (PAGE_SIZE);
- for (; size > 0; size -= PAGE_SIZE, i++) {
- arm_nocache_allocated[i / BITS_PER_INT] &= ~(1 << (i %
- BITS_PER_INT));
- pmap_kremove(raddr);
- raddr += PAGE_SIZE;
- }
-}
-
#ifdef ARM_USE_SMALL_ALLOC
static TAILQ_HEAD(,arm_small_page) pages_normal =
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
index f4b6718..2a549a2 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
@@ -65,7 +65,7 @@ vm_offset_t
initarm_lastaddr(void)
{
- return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE);
+ return (DEVMAP_BOOTSTRAP_MAP_START);
}
void
diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h
index 471792b..39493a3 100644
--- a/sys/arm/include/pmap.h
+++ b/sys/arm/include/pmap.h
@@ -735,11 +735,6 @@ struct arm_small_page {
#endif
-#define ARM_NOCACHE_KVA_SIZE 0x1000000
-extern vm_offset_t arm_nocache_startaddr;
-void *arm_remap_nocache(void *, vm_size_t);
-void arm_unmap_nocache(void *, vm_size_t);
-
extern vm_paddr_t dump_avail[];
#endif /* _KERNEL */
diff --git a/sys/arm/lpc/lpc_machdep.c b/sys/arm/lpc/lpc_machdep.c
index 4604755..cb3ab84 100644
--- a/sys/arm/lpc/lpc_machdep.c
+++ b/sys/arm/lpc/lpc_machdep.c
@@ -66,7 +66,7 @@ initarm_lastaddr(void)
while (1);
/* Platform-specific initialisation */
- return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE);
+ return (fdt_immr_va);
}
void
diff --git a/sys/arm/mv/mv_machdep.c b/sys/arm/mv/mv_machdep.c
index 54c78bf..8dfeb7b 100644
--- a/sys/arm/mv/mv_machdep.c
+++ b/sys/arm/mv/mv_machdep.c
@@ -206,7 +206,7 @@ initarm_lastaddr(void)
while (1);
/* Platform-specific initialisation */
- return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE);
+ return (fdt_immr_va);
}
void
diff --git a/sys/arm/samsung/exynos/exynos5_machdep.c b/sys/arm/samsung/exynos/exynos5_machdep.c
index 98490cd..007bdb5 100644
--- a/sys/arm/samsung/exynos/exynos5_machdep.c
+++ b/sys/arm/samsung/exynos/exynos5_machdep.c
@@ -49,7 +49,7 @@ vm_offset_t
initarm_lastaddr(void)
{
- return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE);
+ return (DEVMAP_BOOTSTRAP_MAP_START);
}
void
diff --git a/sys/arm/tegra/tegra2_machdep.c b/sys/arm/tegra/tegra2_machdep.c
index 447dbdc..66fe0a9 100644
--- a/sys/arm/tegra/tegra2_machdep.c
+++ b/sys/arm/tegra/tegra2_machdep.c
@@ -109,7 +109,7 @@ initarm_lastaddr(void)
if (fdt_immr_addr(TEGRA2_BASE) != 0) /* FIXME ???? */
while (1);
- return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE);
+ return (fdt_immr_va);
}
void
diff --git a/sys/arm/ti/ti_machdep.c b/sys/arm/ti/ti_machdep.c
index f10f114..66bd4a0 100644
--- a/sys/arm/ti/ti_machdep.c
+++ b/sys/arm/ti/ti_machdep.c
@@ -63,7 +63,7 @@ initarm_lastaddr(void)
{
ti_cpu_reset = NULL;
- return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE);
+ return (DEVMAP_BOOTSTRAP_MAP_START);
}
void
diff --git a/sys/arm/versatile/versatile_machdep.c b/sys/arm/versatile/versatile_machdep.c
index b7cf5fa..0a8c0d8 100644
--- a/sys/arm/versatile/versatile_machdep.c
+++ b/sys/arm/versatile/versatile_machdep.c
@@ -60,7 +60,7 @@ vm_offset_t
initarm_lastaddr(void)
{
- return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE);
+ return (DEVMAP_BOOTSTRAP_MAP_START);
}
void
diff --git a/sys/arm/xilinx/zy7_machdep.c b/sys/arm/xilinx/zy7_machdep.c
index 2f25afb..edda8d7 100644
--- a/sys/arm/xilinx/zy7_machdep.c
+++ b/sys/arm/xilinx/zy7_machdep.c
@@ -59,7 +59,7 @@ vm_offset_t
initarm_lastaddr(void)
{
- return (ZYNQ7_PSIO_VBASE - ARM_NOCACHE_KVA_SIZE);
+ return (ZYNQ7_PSIO_VBASE);
}
void
OpenPOWER on IntegriCloud