Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbppc/obs405 Invoke calc_delayconst() before read_...



details:   https://anonhg.NetBSD.org/src/rev/8b67e3f4a18d
branches:  trunk
changeset: 959966:8b67e3f4a18d
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Mar 02 07:27:24 2021 +0000

description:
Invoke calc_delayconst() before read_eeprom(), which uses delay(9).

Fix unintended looong waiting time during boot.

diffstat:

 sys/arch/evbppc/obs405/obs600_autoconf.c |   6 ++----
 sys/arch/evbppc/obs405/obs600_machdep.c  |  14 ++++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diffs (71 lines):

diff -r 550aa49d345c -r 8b67e3f4a18d sys/arch/evbppc/obs405/obs600_autoconf.c
--- a/sys/arch/evbppc/obs405/obs600_autoconf.c  Tue Mar 02 07:23:22 2021 +0000
+++ b/sys/arch/evbppc/obs405/obs600_autoconf.c  Tue Mar 02 07:27:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obs600_autoconf.c,v 1.9 2021/03/02 07:21:01 rin Exp $  */
+/*     $NetBSD: obs600_autoconf.c,v 1.10 2021/03/02 07:27:24 rin Exp $ */
 
 /*
  * Copyright 2004 Shigeyuki Fukushima.
@@ -33,7 +33,7 @@
  * DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obs600_autoconf.c,v 1.9 2021/03/02 07:21:01 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obs600_autoconf.c,v 1.10 2021/03/02 07:27:24 rin Exp $");
 
 #include "dwctwo.h"
 
@@ -101,8 +101,6 @@
        pic_add(&pic_uic1);
        pic_add(&pic_uic2);
 
-       calc_delayconst();
-
        /* Make sure that timers run at CPU frequency */
        mtdcr(DCR_CPC0_CR1, mfdcr(DCR_CPC0_CR1) & ~CPC0_CR1_CETE);
 
diff -r 550aa49d345c -r 8b67e3f4a18d sys/arch/evbppc/obs405/obs600_machdep.c
--- a/sys/arch/evbppc/obs405/obs600_machdep.c   Tue Mar 02 07:23:22 2021 +0000
+++ b/sys/arch/evbppc/obs405/obs600_machdep.c   Tue Mar 02 07:27:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obs600_machdep.c,v 1.10 2018/07/15 05:16:42 maxv Exp $ */
+/*     $NetBSD: obs600_machdep.c,v 1.11 2021/03/02 07:27:24 rin Exp $  */
 /*     Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $    */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.10 2018/07/15 05:16:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.11 2021/03/02 07:27:24 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -206,10 +206,6 @@
         */
        board_info_init();
 
-       read_eeprom(sizeof(buf), buf);
-       macaddr = &buf[0];
-       macaddr1 = &buf[8];
-
        /*
         * Now that we have VM, malloc()s are OK in bus_space.
         */
@@ -228,8 +224,14 @@
                panic("setting mem-size");
        prop_object_release(pn);
 
+       calc_delayconst(); /* required by read_eeprom() */
+
 #define ETHER_ADDR_LEN 6
 
+       read_eeprom(sizeof(buf), buf);
+       macaddr = &buf[0];
+       macaddr1 = &buf[8];
+
        pd = prop_data_create_data_nocopy(macaddr, ETHER_ADDR_LEN);
        KASSERT(pd != NULL);
        if (prop_dictionary_set(board_properties, "emac0-mac-addr", pd) ==



Home | Main Index | Thread Index | Old Index