Module Name:    src
Committed By:   snj
Date:           Sat Mar 11 07:40:21 UTC 2017

Modified Files:
        src/sys/arch/arm/arm32 [netbsd-7]: pmap.c
        src/sys/arch/arm/include/arm32 [netbsd-7]: pmap.h
        src/sys/arch/evbarm/gumstix [netbsd-7]: gumstix_machdep.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1366):
        sys/arch/arm/include/arm32/pmap.h: 1.145
        sys/arch/arm/arm32/pmap.c: 1.343, 1.344
        sys/arch/evbarm/gumstix/gumstix_machdep.c: 1.58 via patch
Fixup the compile time decisions around PMAP_{INCLUDE,NEEDS}_PTE_SYNC and
fix the options for xscale boards which require the code in
pmap_l2ptp_ctor marked as #ifndef PMAP_INCLUDE_PTE_SYNC.
Fix the typo (pte -> opte) in this code block and consistently use opte
elsewhere.
PR/51990: Regression data_abort_handler: data_aborts fsr=0x406 far=0xbfffeff5  
on copyout in init
--
fix unused.
--
Set xscale_cache_clean_addr appropriately and re-arrange default KVA
layout to allow direct map for all boards.
OVERO/DUOVERO/PEPPER aren't tested.
PR/52010: Regression: Gumstix Verdex is hanging in enabling cache + KASSERT 
ram_size


To generate a diff of this commit:
cvs rdiff -u -r1.295.2.8 -r1.295.2.9 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.135.2.2 -r1.135.2.3 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.50 -r1.50.2.1 src/sys/arch/evbarm/gumstix/gumstix_machdep.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/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.295.2.8 src/sys/arch/arm/arm32/pmap.c:1.295.2.9
--- src/sys/arch/arm/arm32/pmap.c:1.295.2.8	Fri Feb 26 22:31:06 2016
+++ src/sys/arch/arm/arm32/pmap.c	Sat Mar 11 07:40:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.295.2.8 2016/02/26 22:31:06 snj Exp $	*/
+/*	$NetBSD: pmap.c,v 1.295.2.9 2017/03/11 07:40:21 snj Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,7 @@
 #include <arm/locore.h>
 //#include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.295.2.8 2016/02/26 22:31:06 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.295.2.9 2017/03/11 07:40:21 snj Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -968,6 +968,7 @@ pmap_is_cached(pmap_t pm)
  *       - The specified pmap is 'active' in the cache/tlb.
  */
 
+#ifdef PMAP_INCLUDE_PTE_SYNC
 static inline void
 pmap_pte_sync_current(pmap_t pm, pt_entry_t *ptep)
 {
@@ -976,10 +977,9 @@ pmap_pte_sync_current(pmap_t pm, pt_entr
 	arm_dsb();
 }
 
-#ifdef PMAP_INCLUDE_PTE_SYNC
-#define	PTE_SYNC_CURRENT(pm, ptep)	pmap_pte_sync_current(pm, ptep)
+# define PTE_SYNC_CURRENT(pm, ptep)	pmap_pte_sync_current(pm, ptep)
 #else
-#define	PTE_SYNC_CURRENT(pm, ptep)	/* nothing */
+# define PTE_SYNC_CURRENT(pm, ptep)	__nothing
 #endif
 
 /*
@@ -1708,7 +1708,7 @@ pmap_l2ptp_ctor(void *arg, void *v, int 
 			/*
 			 * Page tables must have the cache-mode set correctly.
 			 */
-			const pt_entry_t npte = (pte & ~L2_S_CACHE_MASK)
+			const pt_entry_t npte = (opte & ~L2_S_CACHE_MASK)
 			    | pte_l2_s_cache_mode_pt;
 			l2pte_set(ptep, npte, opte);
 			PTE_SYNC(ptep);
@@ -1987,7 +1987,7 @@ pmap_vac_me_user(struct vm_page_md *md, 
 			pt_entry_t npte = opte & ~L2_S_CACHE_MASK;
 
 			if ((va != pv->pv_va || pm != pv->pv_pmap)
-			    && l2pte_valid_p(npte)) {
+			    && l2pte_valid_p(opte)) {
 #ifdef PMAP_CACHE_VIVT
 				pmap_cache_wbinv_page(pv->pv_pmap, pv->pv_va,
 				    true, pv->pv_flags);
@@ -2315,7 +2315,7 @@ pmap_vac_me_harder(struct vm_page_md *md
 		if (opte == npte)	/* only update is there's a change */
 			continue;
 
-		if (l2pte_valid_p(npte)) {
+		if (l2pte_valid_p(opte)) {
 			pmap_tlb_flush_SE(pv->pv_pmap, pv->pv_va, pv->pv_flags);
 		}
 
@@ -4252,7 +4252,7 @@ pmap_prefetchabt_fixup(void *v)
 	if ((opte & L2_S_PROT_U) == 0 || (opte & L2_XS_XN) == 0)
 		goto out;
 
-	paddr_t pa = l2pte_pa(pte);
+	paddr_t pa = l2pte_pa(opte);
 	struct vm_page * const pg = PHYS_TO_VM_PAGE(pa);
 	KASSERT(pg != NULL);
 

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.135.2.2 src/sys/arch/arm/include/arm32/pmap.h:1.135.2.3
--- src/sys/arch/arm/include/arm32/pmap.h:1.135.2.2	Wed May 27 05:33:29 2015
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Mar 11 07:40:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.135.2.2 2015/05/27 05:33:29 msaitoh Exp $	*/
+/*	$NetBSD: pmap.h,v 1.135.2.3 2017/03/11 07:40:21 snj Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -479,15 +479,21 @@ vtophys(vaddr_t va)
 extern int pmap_needs_pte_sync;
 #if defined(_KERNEL_OPT)
 /*
+ * Perform compile time evaluation of PMAP_NEEDS_PTE_SYNC when only a
+ * single MMU type is selected.
+ *
  * StrongARM SA-1 caches do not have a write-through mode.  So, on these,
- * we need to do PTE syncs.  If only SA-1 is configured, then evaluate
- * this at compile time.
+ * we need to do PTE syncs. Additionally, V6 MMUs also need PTE syncs.
+ * Finally, MEMC, GENERIC and XSCALE MMUs do not need PTE syncs.
+ *
+ * Use run time evaluation for all other cases.
+ * 
  */
-#if (ARM_MMU_SA1 + ARM_MMU_V6 != 0) && (ARM_NMMUS == 1)
+#if (ARM_NMMUS == 1)
+#if (ARM_MMU_SA1 + ARM_MMU_V6 != 0)
 #define	PMAP_INCLUDE_PTE_SYNC
-#if (ARM_MMU_V6 > 0)
 #define	PMAP_NEEDS_PTE_SYNC	1
-#elif (ARM_MMU_SA1 == 0)
+#elif (ARM_MMU_MEMC + ARM_MMU_GENERIC + ARM_MMU_XSCALE != 0)
 #define	PMAP_NEEDS_PTE_SYNC	0
 #endif
 #endif

Index: src/sys/arch/evbarm/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.50 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.50.2.1
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.50	Sat Jun  7 10:30:13 2014
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Mar 11 07:40:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.50 2014/06/07 10:30:13 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.50.2.1 2017/03/11 07:40:21 snj Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -187,13 +187,16 @@
 #endif
 
 /*
- * The range 0xc1000000 - 0xcfffffff is available for kernel VM space
- * Core-logic registers and I/O mappings occupy 0xfd000000 - 0xffffffff
+ * The range 0xc1000000 - 0xfd000000 is available for kernel VM space
+ * Core-logic registers and I/O mappings occupy
+ *
+ *    0xfd000000 - 0xfd800000	on gumstix
+ *    0xc0000000 - 0xc0400000	on overo, duovero and pepper
  */
 #ifndef KERNEL_VM_BASE
-#define	KERNEL_VM_BASE		0xc1000000
+#define	KERNEL_VM_BASE		0xc8000000
 #endif
-#define KERNEL_VM_SIZE		0x0f000000
+#define KERNEL_VM_SIZE		0x35000000
 
 BootConfig bootconfig;		/* Boot config storage */
 static char bootargs[MAX_BOOT_STRING];
@@ -397,6 +400,9 @@ initarm(void *arg)
 	 */
 
 #if defined(GUMSTIX)
+	extern vaddr_t xscale_cache_clean_addr;
+	xscale_cache_clean_addr = 0xff000000U;
+
 	cpu_reset_address = NULL;
 #elif defined(OVERO)
 	cpu_reset_address = overo_reset;

Reply via email to