Thu Nov 5 20:40:22 2015 UTC ()
Pull up following revision(s) (requested by isaki in ticket #983):
	sys/arch/x68k/x68k/machdep.c: revision 1.192
To turn off the power, it's necessary to turn off the alarm signal
of RTC before writing the system port.  This is a fix for rev 1.191.
Thanks to Y.Sugahara.
Should be pulled up to netbsd-7.


(riz)
diff -r1.191 -r1.191.4.1 src/sys/arch/x68k/x68k/machdep.c

cvs diff -r1.191 -r1.191.4.1 src/sys/arch/x68k/x68k/machdep.c (expand / switch to context diff)
--- src/sys/arch/x68k/x68k/machdep.c 2014/03/26 16:21:39 1.191
+++ src/sys/arch/x68k/x68k/machdep.c 2015/11/05 20:40:22 1.191.4.1
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.191 2014/03/26 16:21:39 isaki Exp $	*/
+/*	$NetBSD: machdep.c,v 1.191.4.1 2015/11/05 20:40:22 riz Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.191 2014/03/26 16:21:39 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.191.4.1 2015/11/05 20:40:22 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -106,6 +106,7 @@
 #include <machine/bus.h>
 #include <machine/autoconf.h>
 #include <arch/x68k/dev/intiovar.h>
+#include <arch/x68k/x68k/iodevice.h>
 
 extern void doboot(void) __attribute__((__noreturn__));
 
@@ -522,6 +523,10 @@
 	if (((howto & RB_POWERDOWN) == RB_POWERDOWN) && power_switch_is_off) {
 		printf("powering off...\n");
 		delay(1000000);
+
+		/* Turn off the alarm signal of RTC */
+		IODEVbase->io_rtc.bank0.reset = 0x0c;
+
 		intio_set_sysport_powoff(0x00);
 		intio_set_sysport_powoff(0x0f);
 		intio_set_sysport_powoff(0x0f);