Module Name: src
Committed By: bouyer
Date: Wed Jan 27 20:59:46 UTC 2010
Modified Files:
src/distrib/sparc/ramdisk [netbsd-4]: dot.profile
src/sys/arch/sparc/sparc [netbsd-4]: auxreg.h
src/sys/arch/sparc/stand/common [netbsd-4]: promdev.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1379):
sys/arch/sparc/sparc/auxreg.h: revision 1.13
distrib/sparc/ramdisk/dot.profile: revision 1.20
sys/arch/sparc/stand/common/promdev.c: revision 1.23
Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by m...@.
Use /dev/fd0a rather than /dev/rfd0a to read instfs.tgz image from floppy.
It looks newer (appearred after 1.6) gzip tries to read less than DEV_BSIZE
(to check header?) so we can't use raw device directly.
(note sparc bootfs ramdisk doesn't have dd(1))
Workaround for PR port-sparc/42193, and would also fix PR install/28734.
Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
A comment in the macro says AUXIO4M_FTC bit is auto-clear,
but my two SS20s (including compatible) with 150MHz hyperSPARCs
get data_overrun without it, and no bad side effect on SS5
(works with and without this change).
Closes PR port-sparc/42516, which is the last one of a bunch of
floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
for details.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.16.1 src/distrib/sparc/ramdisk/dot.profile
cvs rdiff -u -r1.12 -r1.12.24.1 src/sys/arch/sparc/sparc/auxreg.h
cvs rdiff -u -r1.20.8.1 -r1.20.8.2 src/sys/arch/sparc/stand/common/promdev.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sparc/ramdisk/dot.profile
diff -u src/distrib/sparc/ramdisk/dot.profile:1.18 src/distrib/sparc/ramdisk/dot.profile:1.18.16.1
--- src/distrib/sparc/ramdisk/dot.profile:1.18 Fri Jul 11 12:16:56 2003
+++ src/distrib/sparc/ramdisk/dot.profile Wed Jan 27 20:59:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: dot.profile,v 1.18 2003/07/11 12:16:56 pk Exp $
+# $NetBSD: dot.profile,v 1.18.16.1 2010/01/27 20:59:46 bouyer Exp $
#
# Copyright (c) 2000 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -83,7 +83,7 @@
local dev rval
rval=0
- dev="/dev/rfd0a"
+ dev="/dev/fd0a"
echo "Ejecting floppy disk"
eject $dev
Index: src/sys/arch/sparc/sparc/auxreg.h
diff -u src/sys/arch/sparc/sparc/auxreg.h:1.12 src/sys/arch/sparc/sparc/auxreg.h:1.12.24.1
--- src/sys/arch/sparc/sparc/auxreg.h:1.12 Wed Nov 16 03:00:23 2005
+++ src/sys/arch/sparc/sparc/auxreg.h Wed Jan 27 20:59:46 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: auxreg.h,v 1.12 2005/11/16 03:00:23 uwe Exp $ */
+/* $NetBSD: auxreg.h,v 1.12.24.1 2010/01/27 20:59:46 bouyer Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -105,6 +105,9 @@
if (CPU_ISSUN4M) { \
/* AUXIO4M_FTC bit is auto-clear */ \
*AUXIO4M_REG = auxio_regval | AUXIO4M_FTC; \
+ /* XXX we need to clear it on hyperSPARC SS20 */ \
+ DELAY(10); \
+ *AUXIO4M_REG = auxio_regval; \
} else { \
auxio_regval |= AUXIO4C_FTC; \
*AUXIO4C_REG = auxio_regval; \
Index: src/sys/arch/sparc/stand/common/promdev.c
diff -u src/sys/arch/sparc/stand/common/promdev.c:1.20.8.1 src/sys/arch/sparc/stand/common/promdev.c:1.20.8.2
--- src/sys/arch/sparc/stand/common/promdev.c:1.20.8.1 Thu May 8 07:57:32 2008
+++ src/sys/arch/sparc/stand/common/promdev.c Wed Jan 27 20:59:46 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: promdev.c,v 1.20.8.1 2008/05/08 07:57:32 jdc Exp $ */
+/* $NetBSD: promdev.c,v 1.20.8.2 2010/01/27 20:59:46 bouyer Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -215,6 +215,15 @@
#endif
/*
+ * Don't check disklabel on floppy boot since
+ * reopening it could cause Data Access Exception later.
+ */
+ if (strncmp(prom_bootdevice, "fd", 2) == 0 ||
+ strstr(prom_bootdevice, "SUNW,fdtwo") != NULL ||
+ strstr(prom_bootdevice, "fdthree") != NULL)
+ return 0;
+
+ /*
* We need to read from the raw partition (i.e. the
* beginning of the disk in order to check the NetBSD
* disklabel to see if the boot partition is type RAID.