Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 21:40:12 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r259335 - in stable/10/sys/arm: allwinner arm broadcom/bcm2835 include lpc mv rockchip samsung/exynos tegra ti versatile xilinx
Message-ID:  <201312132140.rBDLeCJs033888@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Fri Dec 13 21:40:12 2013
New Revision: 259335
URL: http://svnweb.freebsd.org/changeset/base/259335

Log:
  MFC r257201, r257202
  
    Retire arm_remap_nocache() and the data and constants associated with it.

Modified:
  stable/10/sys/arm/allwinner/a10_machdep.c
  stable/10/sys/arm/arm/busdma_machdep.c
  stable/10/sys/arm/arm/pmap-v6.c
  stable/10/sys/arm/arm/pmap.c
  stable/10/sys/arm/arm/vm_machdep.c
  stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
  stable/10/sys/arm/include/pmap.h
  stable/10/sys/arm/lpc/lpc_machdep.c
  stable/10/sys/arm/mv/mv_machdep.c
  stable/10/sys/arm/rockchip/rk30xx_machdep.c
  stable/10/sys/arm/samsung/exynos/exynos5_machdep.c
  stable/10/sys/arm/tegra/tegra2_machdep.c
  stable/10/sys/arm/ti/ti_machdep.c
  stable/10/sys/arm/versatile/versatile_machdep.c
  stable/10/sys/arm/xilinx/zy7_machdep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/arm/allwinner/a10_machdep.c
==============================================================================
--- stable/10/sys/arm/allwinner/a10_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/allwinner/a10_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/arm/busdma_machdep.c
==============================================================================
--- stable/10/sys/arm/arm/busdma_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/arm/busdma_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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, 
 	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
 			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++;

Modified: stable/10/sys/arm/arm/pmap-v6.c
==============================================================================
--- stable/10/sys/arm/arm/pmap-v6.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/arm/pmap-v6.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -1951,7 +1951,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st
 	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);

Modified: stable/10/sys/arm/arm/pmap.c
==============================================================================
--- stable/10/sys/arm/arm/pmap.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/arm/pmap.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -2423,7 +2423,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st
 	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

Modified: stable/10/sys/arm/arm/vm_machdep.c
==============================================================================
--- stable/10/sys/arm/arm/vm_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/arm/vm_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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 =

Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
==============================================================================
--- stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/include/pmap.h
==============================================================================
--- stable/10/sys/arm/include/pmap.h	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/include/pmap.h	Fri Dec 13 21:40:12 2013	(r259335)
@@ -727,11 +727,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 */
 

Modified: stable/10/sys/arm/lpc/lpc_machdep.c
==============================================================================
--- stable/10/sys/arm/lpc/lpc_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/lpc/lpc_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/mv/mv_machdep.c
==============================================================================
--- stable/10/sys/arm/mv/mv_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/mv/mv_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c
==============================================================================
--- stable/10/sys/arm/rockchip/rk30xx_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/rockchip/rk30xx_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -55,7 +55,7 @@ vm_offset_t
 initarm_lastaddr(void)
 {
 
-	return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE);
+	return (DEVMAP_BOOTSTRAP_MAP_START);
 }
 
 void

Modified: stable/10/sys/arm/samsung/exynos/exynos5_machdep.c
==============================================================================
--- stable/10/sys/arm/samsung/exynos/exynos5_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/samsung/exynos/exynos5_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/tegra/tegra2_machdep.c
==============================================================================
--- stable/10/sys/arm/tegra/tegra2_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/tegra/tegra2_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/ti/ti_machdep.c
==============================================================================
--- stable/10/sys/arm/ti/ti_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/ti/ti_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/versatile/versatile_machdep.c
==============================================================================
--- stable/10/sys/arm/versatile/versatile_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/versatile/versatile_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -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

Modified: stable/10/sys/arm/xilinx/zy7_machdep.c
==============================================================================
--- stable/10/sys/arm/xilinx/zy7_machdep.c	Fri Dec 13 21:28:45 2013	(r259334)
+++ stable/10/sys/arm/xilinx/zy7_machdep.c	Fri Dec 13 21:40:12 2013	(r259335)
@@ -59,7 +59,7 @@ vm_offset_t
 initarm_lastaddr(void)
 {
 
-	return (ZYNQ7_PSIO_VBASE - ARM_NOCACHE_KVA_SIZE);
+	return (ZYNQ7_PSIO_VBASE);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312132140.rBDLeCJs033888>