Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/atari/dev Skip NVRAM checksum check and re-initiali...



details:   https://anonhg.NetBSD.org/src/rev/8b6ebd644deb
branches:  trunk
changeset: 829176:8b6ebd644deb
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jan 20 19:33:53 2018 +0000

description:
Skip NVRAM checksum check and re-initialization on Milan.

Milan's firmware seems to use different check method.

diffstat:

 sys/arch/atari/dev/nvram.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r b25b802bac65 -r 8b6ebd644deb sys/arch/atari/dev/nvram.c
--- a/sys/arch/atari/dev/nvram.c        Sat Jan 20 19:26:38 2018 +0000
+++ b/sys/arch/atari/dev/nvram.c        Sat Jan 20 19:33:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvram.c,v 1.20 2015/03/06 12:41:05 christos Exp $      */
+/*     $NetBSD: nvram.c,v 1.21 2018/01/20 19:33:53 tsutsui Exp $       */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvram.c,v 1.20 2015/03/06 12:41:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvram.c,v 1.21 2018/01/20 19:33:53 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -92,11 +92,15 @@
        /*
         * Check the validity of the NVram contents
         */
-       if (!nvram_csum_valid(nvram_csum())) {
-               printf(": Invalid checksum - re-initialized");
-               for (nreg = MC_NVRAM_START; nreg < MC_NVRAM_CSUM; nreg++)
-                       mc146818_write(RTC, nreg, 0);
-               nvram_set_csum(nvram_csum());
+       /* XXX: Milan's firmware seems to use different check method */
+       if ((machineid & ATARI_MILAN) == 0) {
+               if (!nvram_csum_valid(nvram_csum())) {
+                       printf(": Invalid checksum - re-initialized");
+                       for (nreg = MC_NVRAM_START; nreg < MC_NVRAM_CSUM;
+                           nreg++)
+                               mc146818_write(RTC, nreg, 0);
+                       nvram_set_csum(nvram_csum());
+               }
        }
        sc = device_private(self);
        sc->sc_dev = self;



Home | Main Index | Thread Index | Old Index