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

Fix unintended looong waiting time during boot.
This commit is contained in:
rin 2021-03-02 07:27:24 +00:00
parent 89ec4cfcd0
commit 543561f91c
2 changed files with 10 additions and 10 deletions

View File

@ -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 @@ cpu_configure(void)
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);

View File

@ -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 @@ cpu_startup(void)
*/
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 @@ cpu_startup(void)
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) ==