Module Name:    src
Committed By:   sevan
Date:           Fri Feb 23 02:54:56 UTC 2018

Modified Files:
        src/sys/arch/macppc/conf: GENERIC MAMBO POWERMAC POWERMAC_G5
        src/sys/arch/powerpc/oea: ofw_rascons.c

Log Message:
Remove OFB_ENABLE_CACHE
from <macallan>
"it is outdated, genfb and friends don't need or use it, and it makes no sense
on accelerated drivers either. It tries to BAT-map the framebuffer cacheable,
which works on most macs but makes a few models lock up. Genfb doesn't have that
problem and is faster too."


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/sys/arch/macppc/conf/GENERIC
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/macppc/conf/MAMBO
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/macppc/conf/POWERMAC
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/macppc/conf/POWERMAC_G5
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/oea/ofw_rascons.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/macppc/conf/GENERIC
diff -u src/sys/arch/macppc/conf/GENERIC:1.340 src/sys/arch/macppc/conf/GENERIC:1.341
--- src/sys/arch/macppc/conf/GENERIC:1.340	Sat Feb 17 01:31:02 2018
+++ src/sys/arch/macppc/conf/GENERIC	Fri Feb 23 02:54:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.340 2018/02/17 01:31:02 sevan Exp $
+# $NetBSD: GENERIC,v 1.341 2018/02/23 02:54:56 sevan Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		"arch/macppc/conf/std.macppc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.340 $"
+#ident 		"GENERIC-$Revision: 1.341 $"
 
 maxusers	32
 
@@ -268,10 +268,6 @@ trm*	at pci? dev ? function ?	# Tekram D
 
 # Display devices
 # ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-# OFB_ENABLE_CACHE speeds up the console on many machines, but should
-# not be enabled on some older machines, such as the rev. A-D iMacs or any
-# O'Hare based machine that uses external cache like the PowerBook 3400c
-#options 	OFB_ENABLE_CACHE	# Speed up console in ofb
 #options 	OFB_FAKE_VGA_FB		# Allow X to mmap VGA regs
 # 
 # ofb is considered obsolete and machine-independent genfb should be used

Index: src/sys/arch/macppc/conf/MAMBO
diff -u src/sys/arch/macppc/conf/MAMBO:1.27 src/sys/arch/macppc/conf/MAMBO:1.28
--- src/sys/arch/macppc/conf/MAMBO:1.27	Tue Jan 23 14:47:55 2018
+++ src/sys/arch/macppc/conf/MAMBO	Fri Feb 23 02:54:56 2018
@@ -6,7 +6,7 @@ include 	"arch/macppc/conf/std.macppc.g5
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.27 $"
+#ident 		"GENERIC-$Revision: 1.28 $"
 
 maxusers	32
 
@@ -130,9 +130,6 @@ ppb*	at pci? dev ? function ?	# PCI-PCI 
 
 # Other  PCI devices
 #ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-# OFB_ENABLE_CACHE speeds up the console on many machines, but should
-# not be enabled on some older machines, such as the rev. A-D iMacs.
-#options 	OFB_ENABLE_CACHE	# Speed up console
 pciide* at pci? dev ? function ? flags 0x0000	# GENERIC pciide driver
 obio*	at pci? dev ? function ?
 macofcons0 at pci? dev ? function ?	# OpenFirmware console (for debugging)

Index: src/sys/arch/macppc/conf/POWERMAC
diff -u src/sys/arch/macppc/conf/POWERMAC:1.68 src/sys/arch/macppc/conf/POWERMAC:1.69
--- src/sys/arch/macppc/conf/POWERMAC:1.68	Fri Sep 22 17:56:07 2017
+++ src/sys/arch/macppc/conf/POWERMAC	Fri Feb 23 02:54:56 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: POWERMAC,v 1.68 2017/09/22 17:56:07 macallan Exp $
+#	$NetBSD: POWERMAC,v 1.69 2018/02/23 02:54:56 sevan Exp $
 #
 # POWERMAC config file
 #
@@ -85,7 +85,6 @@ wsdisplay* at wsemuldisplaydev? console 
 
 # ofb is deprecated, use genfb instead
 #ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-#options 	OFB_ENABLE_CACHE	# Speed up console
 obio*	at pci? dev ? function ?
 
 nsphy*	at mii? phy ?			# NS83840 PHYs

Index: src/sys/arch/macppc/conf/POWERMAC_G5
diff -u src/sys/arch/macppc/conf/POWERMAC_G5:1.29 src/sys/arch/macppc/conf/POWERMAC_G5:1.30
--- src/sys/arch/macppc/conf/POWERMAC_G5:1.29	Tue Jan 23 14:47:55 2018
+++ src/sys/arch/macppc/conf/POWERMAC_G5	Fri Feb 23 02:54:56 2018
@@ -147,9 +147,6 @@ wsmouse* at ums?
 
 # Other  PCI devices
 #ofb*	at pci? dev ? function ?	# Generic Open Firmware Framebuffer
-# OFB_ENABLE_CACHE speeds up the console on many machines, but should
-# not be enabled on some older machines, such as the rev. A-D iMacs.
-#options 	OFB_ENABLE_CACHE	# Speed up console
 pciide* at pci? dev ? function ? flags 0x0000	# GENERIC pciide driver
 svwsata* at pci? dev ? function ?		# ServerWorks SATA controllers
 obio*	at pci? dev ? function ?

Index: src/sys/arch/powerpc/oea/ofw_rascons.c
diff -u src/sys/arch/powerpc/oea/ofw_rascons.c:1.9 src/sys/arch/powerpc/oea/ofw_rascons.c:1.10
--- src/sys/arch/powerpc/oea/ofw_rascons.c:1.9	Thu Apr 11 18:04:20 2013
+++ src/sys/arch/powerpc/oea/ofw_rascons.c	Fri Feb 23 02:54:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_rascons.c,v 1.9 2013/04/11 18:04:20 macallan Exp $	*/
+/*	$NetBSD: ofw_rascons.c,v 1.10 2018/02/23 02:54:56 sevan Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_rascons.c,v 1.9 2013/04/11 18:04:20 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_rascons.c,v 1.10 2018/02/23 02:54:56 sevan Exp $");
 
 #include "wsdisplay.h"
 
@@ -58,16 +58,6 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_rascons.
 /* we need a wsdisplay to do anything halfway useful */
 #if NWSDISPLAY > 0
 
-#if defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
-int rascons_enable_cache = 0;
-#else
-#ifdef OFB_ENABLE_CACHE
-int rascons_enable_cache = 1;
-#else
-int rascons_enable_cache = 0;
-#endif
-#endif /* PPC_OEA64 */
-
 static int copy_rom_font(void);
 static struct wsdisplay_font openfirm6x11;
 static vaddr_t fbaddr;
@@ -196,39 +186,6 @@ rascons_init_rasops(int node, struct ras
 	if (width == -1 || height == -1 || fbaddr == 0 || fbaddr == -1)
 		return false;
 
-	/* Enable write-through cache. */
-#if defined (PPC_OEA) && !defined (PPC_OEA64) && !defined (PPC_OEA64_BRIDGE)
-	if (rascons_enable_cache) {
-		vaddr_t va;
-		/*
-		 * Let's try to find an empty 256M BAT to use
-		 */
-		for (va = SEGMENT_LENGTH; va < (USER_SR << ADDR_SR_SHFT);
-		     va += SEGMENT_LENGTH) {
-			const u_int i = BAT_VA2IDX(va);
-			const u_int n = BAT_VA2IDX(SEGMENT_LENGTH);
-			u_int j;
-			for (j = 0; j < n; j++) {
-				if (battable[i+j].batu != 0) {
-					break;
-				}
-			}
-			if (j == n) {
-				register_t batl = BATL(fbaddr & 0xf0000000,
-				    BAT_G | BAT_W | BAT_M, BAT_PP_RW);
-				register_t batu = BATL(va, BAT_BL_256M, BAT_Vs);
-				for (j = 0; j < n; j++) {
-					battable[i+j].batl = batl;
-					battable[i+j].batu = batu;
-				}
-				fbaddr &= SEGMENT_MASK;
-				fbaddr |= va;
-				break;
-			}
-		}
-	}
-#endif /* PPC_OEA64 */
-
 	/* initialize rasops */
 	ri->ri_width = width;
 	ri->ri_height = height;

Reply via email to